@dr.pogodin/react-utils 1.49.0 → 1.50.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (213) hide show
  1. package/babel.scripts.config.js +19 -0
  2. package/build/development/client/getInj.js +18 -29
  3. package/build/development/client/getInj.js.map +1 -1
  4. package/build/development/client/index.js +11 -14
  5. package/build/development/client/index.js.map +1 -1
  6. package/build/development/client/init.js +9 -17
  7. package/build/development/client/init.js.map +1 -1
  8. package/build/development/index.js +26 -4
  9. package/build/development/index.js.map +1 -1
  10. package/build/development/server/Cache.js +15 -20
  11. package/build/development/server/Cache.js.map +1 -1
  12. package/build/development/server/index.js +142 -160
  13. package/build/development/server/index.js.map +1 -1
  14. package/build/development/server/renderer.js +150 -197
  15. package/build/development/server/renderer.js.map +1 -1
  16. package/build/development/server/server.js +63 -86
  17. package/build/development/server/server.js.map +1 -1
  18. package/build/development/server/utils/errors.js +72 -87
  19. package/build/development/server/utils/errors.js.map +1 -1
  20. package/build/development/shared/components/Button/index.js +8 -17
  21. package/build/development/shared/components/Button/index.js.map +1 -1
  22. package/build/development/shared/components/Checkbox/index.js +12 -5
  23. package/build/development/shared/components/Checkbox/index.js.map +1 -1
  24. package/build/development/shared/components/GenericLink/index.js +54 -58
  25. package/build/development/shared/components/GenericLink/index.js.map +1 -1
  26. package/build/development/shared/components/Input/index.js +16 -24
  27. package/build/development/shared/components/Input/index.js.map +1 -1
  28. package/build/development/shared/components/Link.js +2 -5
  29. package/build/development/shared/components/Link.js.map +1 -1
  30. package/build/development/shared/components/Modal/index.js +28 -41
  31. package/build/development/shared/components/Modal/index.js.map +1 -1
  32. package/build/development/shared/components/NavLink.js +2 -3
  33. package/build/development/shared/components/NavLink.js.map +1 -1
  34. package/build/development/shared/components/PageLayout/index.js +19 -20
  35. package/build/development/shared/components/PageLayout/index.js.map +1 -1
  36. package/build/development/shared/components/TextArea/index.js +12 -28
  37. package/build/development/shared/components/TextArea/index.js.map +1 -1
  38. package/build/development/shared/components/Throbber/index.js +11 -12
  39. package/build/development/shared/components/Throbber/index.js.map +1 -1
  40. package/build/development/shared/components/WithTooltip/Tooltip.js +46 -68
  41. package/build/development/shared/components/WithTooltip/Tooltip.js.map +1 -1
  42. package/build/development/shared/components/WithTooltip/index.js +21 -28
  43. package/build/development/shared/components/WithTooltip/index.js.map +1 -1
  44. package/build/development/shared/components/YouTubeVideo/index.js +21 -25
  45. package/build/development/shared/components/YouTubeVideo/index.js.map +1 -1
  46. package/build/development/shared/components/index.js +1 -3
  47. package/build/development/shared/components/index.js.map +1 -1
  48. package/build/development/shared/components/selectors/CustomDropdown/Options/index.js +6 -7
  49. package/build/development/shared/components/selectors/CustomDropdown/Options/index.js.map +1 -1
  50. package/build/development/shared/components/selectors/CustomDropdown/index.js +7 -9
  51. package/build/development/shared/components/selectors/CustomDropdown/index.js.map +1 -1
  52. package/build/development/shared/components/selectors/NativeDropdown/index.js +23 -27
  53. package/build/development/shared/components/selectors/NativeDropdown/index.js.map +1 -1
  54. package/build/development/shared/components/selectors/Switch/index.js +4 -4
  55. package/build/development/shared/components/selectors/Switch/index.js.map +1 -1
  56. package/build/development/shared/components/selectors/common.js +2 -5
  57. package/build/development/shared/components/selectors/common.js.map +1 -1
  58. package/build/development/shared/utils/config.js +11 -15
  59. package/build/development/shared/utils/config.js.map +1 -1
  60. package/build/development/shared/utils/globalState.js +1 -7
  61. package/build/development/shared/utils/globalState.js.map +1 -1
  62. package/build/development/shared/utils/index.js +2 -2
  63. package/build/development/shared/utils/index.js.map +1 -1
  64. package/build/development/shared/utils/isomorphy/buildInfo.js +15 -24
  65. package/build/development/shared/utils/isomorphy/buildInfo.js.map +1 -1
  66. package/build/development/shared/utils/isomorphy/environment-check.js +4 -9
  67. package/build/development/shared/utils/isomorphy/environment-check.js.map +1 -1
  68. package/build/development/shared/utils/isomorphy/index.js +17 -23
  69. package/build/development/shared/utils/isomorphy/index.js.map +1 -1
  70. package/build/development/shared/utils/jest/E2eSsrEnv.js +48 -77
  71. package/build/development/shared/utils/jest/E2eSsrEnv.js.map +1 -1
  72. package/build/development/shared/utils/jest/index.js +48 -72
  73. package/build/development/shared/utils/jest/index.js.map +1 -1
  74. package/build/development/shared/utils/splitComponent.js +67 -74
  75. package/build/development/shared/utils/splitComponent.js.map +1 -1
  76. package/build/development/shared/utils/time.js +25 -28
  77. package/build/development/shared/utils/time.js.map +1 -1
  78. package/build/development/shared/utils/webpack.js +22 -29
  79. package/build/development/shared/utils/webpack.js.map +1 -1
  80. package/build/production/client/getInj.js.map +1 -1
  81. package/build/production/client/index.js.map +1 -1
  82. package/build/production/index.js +26 -1
  83. package/build/production/index.js.map +1 -1
  84. package/build/production/server/Cache.js.map +1 -1
  85. package/build/production/server/index.js.map +1 -1
  86. package/build/production/server/renderer.js.map +1 -1
  87. package/build/production/server/server.js.map +1 -1
  88. package/build/production/shared/components/Button/index.js.map +1 -1
  89. package/build/production/shared/components/Checkbox/index.js +1 -1
  90. package/build/production/shared/components/Checkbox/index.js.map +1 -1
  91. package/build/production/shared/components/GenericLink/index.js +2 -2
  92. package/build/production/shared/components/GenericLink/index.js.map +1 -1
  93. package/build/production/shared/components/Input/index.js.map +1 -1
  94. package/build/production/shared/components/Link.js.map +1 -1
  95. package/build/production/shared/components/Modal/index.js.map +1 -1
  96. package/build/production/shared/components/NavLink.js.map +1 -1
  97. package/build/production/shared/components/PageLayout/index.js.map +1 -1
  98. package/build/production/shared/components/TextArea/index.js.map +1 -1
  99. package/build/production/shared/components/Throbber/index.js.map +1 -1
  100. package/build/production/shared/components/WithTooltip/index.js.map +1 -1
  101. package/build/production/shared/components/YouTubeVideo/index.js.map +1 -1
  102. package/build/production/shared/components/index.js.map +1 -1
  103. package/build/production/shared/components/selectors/CustomDropdown/Options/index.js.map +1 -1
  104. package/build/production/shared/components/selectors/CustomDropdown/index.js.map +1 -1
  105. package/build/production/shared/components/selectors/NativeDropdown/index.js.map +1 -1
  106. package/build/production/shared/components/selectors/Switch/index.js.map +1 -1
  107. package/build/production/shared/utils/config.js.map +1 -1
  108. package/build/production/shared/utils/index.js.map +1 -1
  109. package/build/production/shared/utils/jest/index.js.map +1 -1
  110. package/build/production/shared/utils/splitComponent.js +20 -3
  111. package/build/production/shared/utils/splitComponent.js.map +1 -1
  112. package/build/production/shared/utils/time.js.map +1 -1
  113. package/build/production/shared/utils/webpack.js.map +1 -1
  114. package/build/types-code/shared/components/Checkbox/index.d.ts +3 -2
  115. package/build/types-code/shared/components/GenericLink/index.d.ts +0 -1
  116. package/build/types-scss/src/shared/components/Checkbox/theme.scss.d.ts +2 -0
  117. package/build/web/client/getInj.js +10 -70
  118. package/build/web/client/getInj.js.map +1 -1
  119. package/build/web/client/index.js +2 -27
  120. package/build/web/client/index.js.map +1 -1
  121. package/build/web/client/init.js +10 -44
  122. package/build/web/client/init.js.map +1 -1
  123. package/build/web/index.js +26 -6
  124. package/build/web/index.js.map +1 -1
  125. package/build/web/server/Cache.js +3 -41
  126. package/build/web/server/Cache.js.map +1 -1
  127. package/build/web/server/index.js +7 -78
  128. package/build/web/server/index.js.map +1 -1
  129. package/build/web/server/renderer.js +61 -420
  130. package/build/web/server/renderer.js.map +1 -1
  131. package/build/web/server/server.js +38 -212
  132. package/build/web/server/server.js.map +1 -1
  133. package/build/web/server/utils/errors.js +9 -48
  134. package/build/web/server/utils/errors.js.map +1 -1
  135. package/build/web/server/utils/index.js +1 -2
  136. package/build/web/server/utils/index.js.map +1 -1
  137. package/build/web/shared/components/Button/index.js +12 -101
  138. package/build/web/shared/components/Button/index.js.map +1 -1
  139. package/build/web/shared/components/Checkbox/index.js +1 -35
  140. package/build/web/shared/components/Checkbox/index.js.map +1 -1
  141. package/build/web/shared/components/Checkbox/theme.scss +22 -0
  142. package/build/web/shared/components/GenericLink/index.js +12 -65
  143. package/build/web/shared/components/GenericLink/index.js.map +1 -1
  144. package/build/web/shared/components/GenericLink/style.scss +1 -0
  145. package/build/web/shared/components/Input/index.js +11 -69
  146. package/build/web/shared/components/Input/index.js.map +1 -1
  147. package/build/web/shared/components/Link.js +2 -12
  148. package/build/web/shared/components/Link.js.map +1 -1
  149. package/build/web/shared/components/Modal/index.js +10 -130
  150. package/build/web/shared/components/Modal/index.js.map +1 -1
  151. package/build/web/shared/components/NavLink.js +2 -10
  152. package/build/web/shared/components/NavLink.js.map +1 -1
  153. package/build/web/shared/components/PageLayout/index.js +2 -27
  154. package/build/web/shared/components/PageLayout/index.js.map +1 -1
  155. package/build/web/shared/components/TextArea/index.js +21 -106
  156. package/build/web/shared/components/TextArea/index.js.map +1 -1
  157. package/build/web/shared/components/Throbber/index.js +2 -24
  158. package/build/web/shared/components/Throbber/index.js.map +1 -1
  159. package/build/web/shared/components/WithTooltip/Tooltip.js +16 -145
  160. package/build/web/shared/components/WithTooltip/Tooltip.js.map +1 -1
  161. package/build/web/shared/components/WithTooltip/index.js +12 -104
  162. package/build/web/shared/components/WithTooltip/index.js.map +1 -1
  163. package/build/web/shared/components/YouTubeVideo/index.js +5 -43
  164. package/build/web/shared/components/YouTubeVideo/index.js.map +1 -1
  165. package/build/web/shared/components/index.js +1 -15
  166. package/build/web/shared/components/index.js.map +1 -1
  167. package/build/web/shared/components/selectors/CustomDropdown/Options/index.js +6 -81
  168. package/build/web/shared/components/selectors/CustomDropdown/Options/index.js.map +1 -1
  169. package/build/web/shared/components/selectors/CustomDropdown/index.js +7 -122
  170. package/build/web/shared/components/selectors/CustomDropdown/index.js.map +1 -1
  171. package/build/web/shared/components/selectors/NativeDropdown/index.js +7 -68
  172. package/build/web/shared/components/selectors/NativeDropdown/index.js.map +1 -1
  173. package/build/web/shared/components/selectors/Switch/index.js +1 -49
  174. package/build/web/shared/components/selectors/Switch/index.js.map +1 -1
  175. package/build/web/shared/components/selectors/common.js +1 -10
  176. package/build/web/shared/components/selectors/common.js.map +1 -1
  177. package/build/web/shared/components/selectors/index.js +1 -3
  178. package/build/web/shared/components/selectors/index.js.map +1 -1
  179. package/build/web/shared/utils/config.js +6 -40
  180. package/build/web/shared/utils/config.js.map +1 -1
  181. package/build/web/shared/utils/globalState.js +2 -11
  182. package/build/web/shared/utils/globalState.js.map +1 -1
  183. package/build/web/shared/utils/index.js +1 -9
  184. package/build/web/shared/utils/index.js.map +1 -1
  185. package/build/web/shared/utils/isomorphy/buildInfo.js +4 -25
  186. package/build/web/shared/utils/isomorphy/buildInfo.js.map +1 -1
  187. package/build/web/shared/utils/isomorphy/environment-check.js +3 -9
  188. package/build/web/shared/utils/isomorphy/environment-check.js.map +1 -1
  189. package/build/web/shared/utils/isomorphy/index.js +5 -27
  190. package/build/web/shared/utils/isomorphy/index.js.map +1 -1
  191. package/build/web/shared/utils/jest/E2eSsrEnv.js +51 -221
  192. package/build/web/shared/utils/jest/E2eSsrEnv.js.map +1 -1
  193. package/build/web/shared/utils/jest/global.js +1 -3
  194. package/build/web/shared/utils/jest/global.js.map +1 -1
  195. package/build/web/shared/utils/jest/index.js +27 -146
  196. package/build/web/shared/utils/jest/index.js.map +1 -1
  197. package/build/web/shared/utils/splitComponent.js +34 -197
  198. package/build/web/shared/utils/splitComponent.js.map +1 -1
  199. package/build/web/shared/utils/time.js +5 -69
  200. package/build/web/shared/utils/time.js.map +1 -1
  201. package/build/web/shared/utils/webpack.js +6 -53
  202. package/build/web/shared/utils/webpack.js.map +1 -1
  203. package/config/babel/webpack.js +1 -1
  204. package/eslint.config.mjs +1 -0
  205. package/package.json +10 -13
  206. package/bin/build.js +0 -236
  207. package/config/webpack/lib-base.d.ts +0 -22
  208. package/config/webpack/lib-base.js +0 -167
  209. package/config/webpack/lib-development.d.ts +0 -5
  210. package/config/webpack/lib-development.js +0 -35
  211. package/config/webpack/lib-production.d.ts +0 -5
  212. package/config/webpack/lib-production.js +0 -42
  213. package/webpack.config.ts +0 -49
@@ -0,0 +1,19 @@
1
+ // Babel config for compilation of helper scripts (bin-ts-src > bin).
2
+
3
+ /* global module */
4
+
5
+ module.exports = {
6
+ plugins: [
7
+ ['@babel/transform-runtime', { useESModules: true }],
8
+ ],
9
+ presets: [
10
+ ['@babel/env', {
11
+ bugfixes: true,
12
+ corejs: '3.49',
13
+ modules: false,
14
+ targets: 'maintained node versions',
15
+ useBuiltIns: 'usage',
16
+ }],
17
+ '@babel/typescript',
18
+ ],
19
+ };
@@ -4,33 +4,28 @@ import "core-js/modules/es.array-buffer.transfer-to-fixed-length.js";
4
4
  import "core-js/modules/es.typed-array.to-reversed.js";
5
5
  import "core-js/modules/es.typed-array.to-sorted.js";
6
6
  import "core-js/modules/es.typed-array.with.js";
7
- import "core-js/modules/web.dom-exception.stack.js";
8
- // Encapsulates retrieval of server-side data injection into HTML template.
9
-
7
+ import "core-js/modules/web.dom-exception.stack.js"; // Encapsulates retrieval of server-side data injection into HTML template.
10
8
  /* global document */
11
-
12
- import { SEC_MS, timer } from '@dr.pogodin/js-utils';
9
+ import { SEC_MS, timer } from "@dr.pogodin/js-utils";
13
10
  import { getBuildInfo } from "../shared/utils/isomorphy/buildInfo.js";
14
11
  let inj;
15
12
  export default function getInj() {
16
13
  inj ??= (async () => {
17
- const metaElement = typeof document === 'undefined' ? null : document.querySelector('meta[itemprop="drpruinj"]');
14
+ const metaElement = typeof document === "undefined" ? null : document.querySelector("meta[itemprop=\"drpruinj\"]");
18
15
  if (metaElement) {
19
- metaElement.remove();
20
-
21
- // NOTE: Since 2025 there is Uint8Array.fromBase64(), which should be
16
+ metaElement.remove(); // NOTE: Since 2025 there is Uint8Array.fromBase64(), which should be
22
17
  // preferred, but it is not supported by older environments yet.
23
18
  const data = atob(metaElement.content);
24
19
  if (!window.isSecureContext) {
25
- if (window.location.protocol === 'https:') {
26
- throw Error('Loaded via HTTPS, but it is not considered a secure context');
27
- } else if (window.location.protocol !== 'http:') {
28
- throw Error('Unexpected protocol');
20
+ if (window.location.protocol === "https:") {
21
+ throw Error("Loaded via HTTPS, but it is not considered a secure context");
22
+ } else if (window.location.protocol !== "http:") {
23
+ throw Error("Unexpected protocol");
29
24
  }
30
- const target = window.location.href.replace(/^http:/, 'https:');
25
+ const target = window.location.href.replace(/^http:/, "https:");
31
26
  window.location.replace(target);
32
27
  await timer(3 * SEC_MS);
33
- throw Error('Failed to move into secure context');
28
+ throw Error("Failed to move into secure context");
34
29
  }
35
30
  const {
36
31
  key
@@ -39,29 +34,23 @@ export default function getInj() {
39
34
  const dataBuffer = Uint8Array.from(data.slice(16), code);
40
35
  const ivBuffer = Uint8Array.from(data.slice(0, 16), code);
41
36
  const keyBuffer = Uint8Array.from(atob(key), code);
42
- const cKey = await window.crypto.subtle.importKey('raw', keyBuffer, {
43
- name: 'AES-CBC'
44
- }, false, ['decrypt']);
37
+ const cKey = await window.crypto.subtle.importKey("raw", keyBuffer, {
38
+ name: "AES-CBC"
39
+ }, false, ["decrypt"]);
45
40
  const buffer = await window.crypto.subtle.decrypt({
46
41
  iv: ivBuffer,
47
- name: 'AES-CBC'
42
+ name: "AES-CBC"
48
43
  }, cKey, dataBuffer);
49
- const decoder = new TextDecoder();
50
-
51
- // eslint-disable-next-line no-eval
52
- const res = eval(`(${decoder.decode(buffer)})`);
53
-
54
- // NOTE: This is important, to be able to return the injection
44
+ const decoder = new TextDecoder(); // eslint-disable-next-line no-eval
45
+ const res = eval(`(${decoder.decode(buffer)})`); // NOTE: This is important, to be able to return the injection
55
46
  // synchronously once it is initialized.
56
47
  inj = res;
57
48
  return res;
58
- } else if (typeof window !== 'undefined' && window.REACT_UTILS_INJECTION) {
49
+ } else if (typeof window !== "undefined" && window.REACT_UTILS_INJECTION) {
59
50
  const res = window.REACT_UTILS_INJECTION;
60
51
  delete window.REACT_UTILS_INJECTION;
61
52
  return res;
62
- }
63
-
64
- // Otherwise, a bunch of dependent stuff will easily fail in non-standard
53
+ } // Otherwise, a bunch of dependent stuff will easily fail in non-standard
65
54
  // environments, where no client-side initialization is performed. Like tests,
66
55
  // Docusaurus examples, etc.
67
56
  return {};
@@ -1 +1 @@
1
- {"version":3,"file":"getInj.js","names":["SEC_MS","timer","getBuildInfo","inj","getInj","metaElement","document","querySelector","remove","data","atob","content","window","isSecureContext","location","protocol","Error","target","href","replace","key","code","x","charCodeAt","dataBuffer","Uint8Array","from","slice","ivBuffer","keyBuffer","cKey","crypto","subtle","importKey","name","buffer","decrypt","iv","decoder","TextDecoder","res","eval","decode","REACT_UTILS_INJECTION"],"sources":["../../../src/client/getInj.ts"],"sourcesContent":["// Encapsulates retrieval of server-side data injection into HTML template.\n\n/* global document */\n\nimport { SEC_MS, timer } from '@dr.pogodin/js-utils';\n\nimport type { InjT } from 'utils/globalState';\n\nimport { getBuildInfo } from 'utils/isomorphy/buildInfo';\n\nlet inj: InjT | Promise<InjT> | undefined;\n\nexport default function getInj(): InjT | Promise<InjT> {\n inj ??= (async () => {\n const metaElement: HTMLMetaElement | null = typeof document === 'undefined'\n ? null : document.querySelector('meta[itemprop=\"drpruinj\"]');\n\n if (metaElement) {\n metaElement.remove();\n\n // NOTE: Since 2025 there is Uint8Array.fromBase64(), which should be\n // preferred, but it is not supported by older environments yet.\n const data = atob(metaElement.content);\n\n if (!window.isSecureContext) {\n if (window.location.protocol === 'https:') {\n throw Error('Loaded via HTTPS, but it is not considered a secure context');\n } else if (window.location.protocol !== 'http:') {\n throw Error('Unexpected protocol');\n }\n\n const target = window.location.href.replace(/^http:/, 'https:');\n window.location.replace(target);\n\n await timer(3 * SEC_MS);\n throw Error('Failed to move into secure context');\n }\n\n const { key } = getBuildInfo();\n\n const code = (x: string) => x.charCodeAt(0);\n const dataBuffer = Uint8Array.from(data.slice(16), code);\n const ivBuffer = Uint8Array.from(data.slice(0, 16), code);\n const keyBuffer = Uint8Array.from(atob(key), code);\n\n const cKey = await window.crypto.subtle.importKey(\n 'raw',\n keyBuffer,\n { name: 'AES-CBC' },\n false,\n ['decrypt'],\n );\n\n const buffer = await window.crypto.subtle.decrypt({\n iv: ivBuffer,\n name: 'AES-CBC',\n }, cKey, dataBuffer);\n\n const decoder = new TextDecoder();\n\n // eslint-disable-next-line no-eval\n const res = eval(`(${decoder.decode(buffer)})`) as InjT;\n\n // NOTE: This is important, to be able to return the injection\n // synchronously once it is initialized.\n inj = res;\n\n return res;\n } else if (typeof window !== 'undefined' && window.REACT_UTILS_INJECTION) {\n const res = window.REACT_UTILS_INJECTION;\n delete window.REACT_UTILS_INJECTION;\n return res;\n }\n\n // Otherwise, a bunch of dependent stuff will easily fail in non-standard\n // environments, where no client-side initialization is performed. Like tests,\n // Docusaurus examples, etc.\n return {};\n })();\n\n return inj;\n}\n"],"mappings":";;;;;;;AAAA;;AAEA;;AAEA,SAASA,MAAM,EAAEC,KAAK,QAAQ,sBAAsB;AAAA,SAI3CC,YAAY;AAErB,IAAIC,GAAqC;AAEzC,eAAe,SAASC,MAAMA,CAAA,EAAyB;EACrDD,GAAG,KAAK,CAAC,YAAY;IACnB,MAAME,WAAmC,GAAG,OAAOC,QAAQ,KAAK,WAAW,GACvE,IAAI,GAAGA,QAAQ,CAACC,aAAa,CAAC,2BAA2B,CAAC;IAE9D,IAAIF,WAAW,EAAE;MACfA,WAAW,CAACG,MAAM,CAAC,CAAC;;MAEpB;MACA;MACA,MAAMC,IAAI,GAAGC,IAAI,CAACL,WAAW,CAACM,OAAO,CAAC;MAEtC,IAAI,CAACC,MAAM,CAACC,eAAe,EAAE;QAC3B,IAAID,MAAM,CAACE,QAAQ,CAACC,QAAQ,KAAK,QAAQ,EAAE;UACzC,MAAMC,KAAK,CAAC,6DAA6D,CAAC;QAC5E,CAAC,MAAM,IAAIJ,MAAM,CAACE,QAAQ,CAACC,QAAQ,KAAK,OAAO,EAAE;UAC/C,MAAMC,KAAK,CAAC,qBAAqB,CAAC;QACpC;QAEA,MAAMC,MAAM,GAAGL,MAAM,CAACE,QAAQ,CAACI,IAAI,CAACC,OAAO,CAAC,QAAQ,EAAE,QAAQ,CAAC;QAC/DP,MAAM,CAACE,QAAQ,CAACK,OAAO,CAACF,MAAM,CAAC;QAE/B,MAAMhB,KAAK,CAAC,CAAC,GAAGD,MAAM,CAAC;QACvB,MAAMgB,KAAK,CAAC,oCAAoC,CAAC;MACnD;MAEA,MAAM;QAAEI;MAAI,CAAC,GAAGlB,YAAY,CAAC,CAAC;MAE9B,MAAMmB,IAAI,GAAIC,CAAS,IAAKA,CAAC,CAACC,UAAU,CAAC,CAAC,CAAC;MAC3C,MAAMC,UAAU,GAAGC,UAAU,CAACC,IAAI,CAACjB,IAAI,CAACkB,KAAK,CAAC,EAAE,CAAC,EAAEN,IAAI,CAAC;MACxD,MAAMO,QAAQ,GAAGH,UAAU,CAACC,IAAI,CAACjB,IAAI,CAACkB,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAEN,IAAI,CAAC;MACzD,MAAMQ,SAAS,GAAGJ,UAAU,CAACC,IAAI,CAAChB,IAAI,CAACU,GAAG,CAAC,EAAEC,IAAI,CAAC;MAElD,MAAMS,IAAI,GAAG,MAAMlB,MAAM,CAACmB,MAAM,CAACC,MAAM,CAACC,SAAS,CAC/C,KAAK,EACLJ,SAAS,EACT;QAAEK,IAAI,EAAE;MAAU,CAAC,EACnB,KAAK,EACL,CAAC,SAAS,CACZ,CAAC;MAED,MAAMC,MAAM,GAAG,MAAMvB,MAAM,CAACmB,MAAM,CAACC,MAAM,CAACI,OAAO,CAAC;QAChDC,EAAE,EAAET,QAAQ;QACZM,IAAI,EAAE;MACR,CAAC,EAAEJ,IAAI,EAAEN,UAAU,CAAC;MAEpB,MAAMc,OAAO,GAAG,IAAIC,WAAW,CAAC,CAAC;;MAEjC;MACA,MAAMC,GAAG,GAAGC,IAAI,CAAC,IAAIH,OAAO,CAACI,MAAM,CAACP,MAAM,CAAC,GAAG,CAAS;;MAEvD;MACA;MACAhC,GAAG,GAAGqC,GAAG;MAET,OAAOA,GAAG;IACZ,CAAC,MAAM,IAAI,OAAO5B,MAAM,KAAK,WAAW,IAAIA,MAAM,CAAC+B,qBAAqB,EAAE;MACxE,MAAMH,GAAG,GAAG5B,MAAM,CAAC+B,qBAAqB;MACxC,OAAO/B,MAAM,CAAC+B,qBAAqB;MACnC,OAAOH,GAAG;IACZ;;IAEA;IACA;IACA;IACA,OAAO,CAAC,CAAC;EACX,CAAC,EAAE,CAAC;EAEJ,OAAOrC,GAAG;AACZ","ignoreList":[]}
1
+ {"version":3,"file":"getInj.js","names":["SEC_MS","timer","getBuildInfo","inj","getInj","metaElement","document","querySelector","remove","data","atob","content","window","isSecureContext","location","protocol","Error","target","href","replace","key","code","x","charCodeAt","dataBuffer","Uint8Array","from","slice","ivBuffer","keyBuffer","cKey","crypto","subtle","importKey","name","buffer","decrypt","iv","decoder","TextDecoder","res","eval","decode","REACT_UTILS_INJECTION"],"sources":["../../../src/client/getInj.ts"],"sourcesContent":["// Encapsulates retrieval of server-side data injection into HTML template.\n\n/* global document */\n\nimport { SEC_MS, timer } from '@dr.pogodin/js-utils';\n\nimport type { InjT } from 'utils/globalState';\n\nimport { getBuildInfo } from 'utils/isomorphy/buildInfo';\n\nlet inj: InjT | Promise<InjT> | undefined;\n\nexport default function getInj(): InjT | Promise<InjT> {\n inj ??= (async () => {\n const metaElement: HTMLMetaElement | null = typeof document === 'undefined'\n ? null : document.querySelector('meta[itemprop=\"drpruinj\"]');\n\n if (metaElement) {\n metaElement.remove();\n\n // NOTE: Since 2025 there is Uint8Array.fromBase64(), which should be\n // preferred, but it is not supported by older environments yet.\n const data = atob(metaElement.content);\n\n if (!window.isSecureContext) {\n if (window.location.protocol === 'https:') {\n throw Error('Loaded via HTTPS, but it is not considered a secure context');\n } else if (window.location.protocol !== 'http:') {\n throw Error('Unexpected protocol');\n }\n\n const target = window.location.href.replace(/^http:/, 'https:');\n window.location.replace(target);\n\n await timer(3 * SEC_MS);\n throw Error('Failed to move into secure context');\n }\n\n const { key } = getBuildInfo();\n\n const code = (x: string) => x.charCodeAt(0);\n const dataBuffer = Uint8Array.from(data.slice(16), code);\n const ivBuffer = Uint8Array.from(data.slice(0, 16), code);\n const keyBuffer = Uint8Array.from(atob(key), code);\n\n const cKey = await window.crypto.subtle.importKey(\n 'raw',\n keyBuffer,\n { name: 'AES-CBC' },\n false,\n ['decrypt'],\n );\n\n const buffer = await window.crypto.subtle.decrypt({\n iv: ivBuffer,\n name: 'AES-CBC',\n }, cKey, dataBuffer);\n\n const decoder = new TextDecoder();\n\n // eslint-disable-next-line no-eval\n const res = eval(`(${decoder.decode(buffer)})`) as InjT;\n\n // NOTE: This is important, to be able to return the injection\n // synchronously once it is initialized.\n inj = res;\n\n return res;\n } else if (typeof window !== 'undefined' && window.REACT_UTILS_INJECTION) {\n const res = window.REACT_UTILS_INJECTION;\n delete window.REACT_UTILS_INJECTION;\n return res;\n }\n\n // Otherwise, a bunch of dependent stuff will easily fail in non-standard\n // environments, where no client-side initialization is performed. Like tests,\n // Docusaurus examples, etc.\n return {};\n })();\n\n return inj;\n}\n"],"mappings":";;;;;;oDAAA;AAEA;AAEA,SAASA,MAAM,EAAEC,KAAK,QAAQ,sBAAsB;AAIpD,SAASC,YAAY;AAErB,IAAIC,GAAqC;AAEzC,eAAe,SAASC,MAAMA,CAAA,EAAyB;EACrDD,GAAG,KAAK,CAAC,YAAY;IACnB,MAAME,WAAmC,GAAG,OAAOC,QAAQ,KAAK,WAAW,GACvE,IAAI,GAAGA,QAAQ,CAACC,aAAa,CAAC,6BAA2B,CAAC;IAE9D,IAAIF,WAAW,EAAE;MACfA,WAAW,CAACG,MAAM,CAAC,CAAC,CAEpB;MACA;MACA,MAAMC,IAAI,GAAGC,IAAI,CAACL,WAAW,CAACM,OAAO,CAAC;MAEtC,IAAI,CAACC,MAAM,CAACC,eAAe,EAAE;QAC3B,IAAID,MAAM,CAACE,QAAQ,CAACC,QAAQ,KAAK,QAAQ,EAAE;UACzC,MAAMC,KAAK,CAAC,6DAA6D,CAAC;QAC5E,CAAC,MAAM,IAAIJ,MAAM,CAACE,QAAQ,CAACC,QAAQ,KAAK,OAAO,EAAE;UAC/C,MAAMC,KAAK,CAAC,qBAAqB,CAAC;QACpC;QAEA,MAAMC,MAAM,GAAGL,MAAM,CAACE,QAAQ,CAACI,IAAI,CAACC,OAAO,CAAC,QAAQ,EAAE,QAAQ,CAAC;QAC/DP,MAAM,CAACE,QAAQ,CAACK,OAAO,CAACF,MAAM,CAAC;QAE/B,MAAMhB,KAAK,CAAC,CAAC,GAAGD,MAAM,CAAC;QACvB,MAAMgB,KAAK,CAAC,oCAAoC,CAAC;MACnD;MAEA,MAAM;QAAEI;MAAI,CAAC,GAAGlB,YAAY,CAAC,CAAC;MAE9B,MAAMmB,IAAI,GAAIC,CAAS,IAAKA,CAAC,CAACC,UAAU,CAAC,CAAC,CAAC;MAC3C,MAAMC,UAAU,GAAGC,UAAU,CAACC,IAAI,CAACjB,IAAI,CAACkB,KAAK,CAAC,EAAE,CAAC,EAAEN,IAAI,CAAC;MACxD,MAAMO,QAAQ,GAAGH,UAAU,CAACC,IAAI,CAACjB,IAAI,CAACkB,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAEN,IAAI,CAAC;MACzD,MAAMQ,SAAS,GAAGJ,UAAU,CAACC,IAAI,CAAChB,IAAI,CAACU,GAAG,CAAC,EAAEC,IAAI,CAAC;MAElD,MAAMS,IAAI,GAAG,MAAMlB,MAAM,CAACmB,MAAM,CAACC,MAAM,CAACC,SAAS,CAC/C,KAAK,EACLJ,SAAS,EACT;QAAEK,IAAI,EAAE;MAAU,CAAC,EACnB,KAAK,EACL,CAAC,SAAS,CACZ,CAAC;MAED,MAAMC,MAAM,GAAG,MAAMvB,MAAM,CAACmB,MAAM,CAACC,MAAM,CAACI,OAAO,CAAC;QAChDC,EAAE,EAAET,QAAQ;QACZM,IAAI,EAAE;MACR,CAAC,EAAEJ,IAAI,EAAEN,UAAU,CAAC;MAEpB,MAAMc,OAAO,GAAG,IAAIC,WAAa,CAAb,CAAa,CAEjC;MACA,MAAMC,GAAG,GAAGC,IAAI,CAAC,IAAIH,OAAO,CAACI,MAAM,CAACP,MAAM,CAAC,GAAG,CAAS,CAEvD;MACA;MACAhC,GAAG,GAAGqC,GAAG;MAET,OAAOA,GAAG;IACZ,CAAC,MAAM,IAAI,OAAO5B,MAAM,KAAK,WAAW,IAAIA,MAAM,CAAC+B,qBAAqB,EAAE;MACxE,MAAMH,GAAG,GAAG5B,MAAM,CAAC+B,qBAAqB;MACxC,OAAO/B,MAAM,CAAC+B,qBAAqB;MACnC,OAAOH,GAAG;IACZ,CAEA;IACA;IACA;IACA,OAAO,CAAC,CAAC;EACX,CAAC,EAAE,CAAC;EAEJ,OAAOrC,GAAG;AACZ","ignoreList":[]}
@@ -1,21 +1,18 @@
1
1
  // Initialization of client-side code.
2
- /* global document */
3
-
4
- import { createRoot, hydrateRoot } from 'react-dom/client';
5
- import { BrowserRouter } from 'react-router';
6
- import { GlobalStateProvider } from '@dr.pogodin/react-global-state';
7
- import { HelmetProvider } from '@dr.pogodin/react-helmet';
2
+ /* global document */import { createRoot, hydrateRoot } from "react-dom/client";
3
+ import { BrowserRouter } from "react-router";
4
+ import { GlobalStateProvider } from "@dr.pogodin/react-global-state";
5
+ import { HelmetProvider } from "@dr.pogodin/react-helmet";
8
6
  import getInj from "./getInj.js";
9
- import { jsx as _jsx } from "react/jsx-runtime";
10
- /**
11
- * Prepares and launches the app at client side.
12
- * @param Application Root application component
13
- * @param [options={}] Optional. Additional settings.
14
- */
7
+ import { jsx as _jsx } from "react/jsx-runtime"; /**
8
+ * Prepares and launches the app at client side.
9
+ * @param Application Root application component
10
+ * @param [options={}] Optional. Additional settings.
11
+ */
15
12
  export async function launchClient(Application, options = {}) {
16
13
  const inj = await getInj();
17
- const container = document.getElementById('react-view');
18
- if (!container) throw Error('Failed to find container for React app');
14
+ const container = document.getElementById("react-view");
15
+ if (!container) throw Error("Failed to find container for React app");
19
16
  const scene = /*#__PURE__*/_jsx(GlobalStateProvider, {
20
17
  initialState: inj.ISTATE ?? options.initialState,
21
18
  children: /*#__PURE__*/_jsx(BrowserRouter, {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["createRoot","hydrateRoot","BrowserRouter","GlobalStateProvider","HelmetProvider","getInj","jsx","_jsx","launchClient","Application","options","inj","container","document","getElementById","Error","scene","initialState","ISTATE","children","dontHydrate","root","render"],"sources":["../../../src/client/index.tsx"],"sourcesContent":["// Initialization of client-side code.\n/* global document */\n\nimport type { ComponentType } from 'react';\nimport { createRoot, hydrateRoot } from 'react-dom/client';\nimport { BrowserRouter } from 'react-router';\n\nimport { GlobalStateProvider } from '@dr.pogodin/react-global-state';\nimport { HelmetProvider } from '@dr.pogodin/react-helmet';\n\nimport getInj from './getInj';\n\ntype OptionsT = {\n dontHydrate?: boolean;\n initialState?: unknown;\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 async function launchClient(\n Application: ComponentType,\n options: OptionsT = {},\n): Promise<void> {\n const inj = await getInj();\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={inj.ISTATE ?? options.initialState}>\n <BrowserRouter>\n <HelmetProvider>\n <Application />\n </HelmetProvider>\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":"AAAA;AACA;;AAGA,SAASA,UAAU,EAAEC,WAAW,QAAQ,kBAAkB;AAC1D,SAASC,aAAa,QAAQ,cAAc;AAE5C,SAASC,mBAAmB,QAAQ,gCAAgC;AACpE,SAASC,cAAc,QAAQ,0BAA0B;AAAA,OAElDC,MAAM;AAAiB,SAAAC,GAAA,IAAAC,IAAA;AAO9B;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,YAAYA,CAChCC,WAA0B,EAC1BC,OAAiB,GAAG,CAAC,CAAC,EACP;EACf,MAAMC,GAAG,GAAG,MAAMN,MAAM,CAAC,CAAC;EAE1B,MAAMO,SAAS,GAAGC,QAAQ,CAACC,cAAc,CAAC,YAAY,CAAC;EACvD,IAAI,CAACF,SAAS,EAAE,MAAMG,KAAK,CAAC,wCAAwC,CAAC;EACrE,MAAMC,KAAK,gBACTT,IAAA,CAACJ,mBAAmB;IAACc,YAAY,EAAEN,GAAG,CAACO,MAAM,IAAIR,OAAO,CAACO,YAAa;IAAAE,QAAA,eACpEZ,IAAA,CAACL,aAAa;MAAAiB,QAAA,eACZZ,IAAA,CAACH,cAAc;QAAAe,QAAA,eACbZ,IAAA,CAACE,WAAW,IAAE;MAAC,CACD;IAAC,CACJ;EAAC,CACG,CACtB;EAED,IAAIC,OAAO,CAACU,WAAW,EAAE;IACvB,MAAMC,IAAI,GAAGrB,UAAU,CAACY,SAAS,CAAC;IAClCS,IAAI,CAACC,MAAM,CAACN,KAAK,CAAC;EACpB,CAAC,MAAMf,WAAW,CAACW,SAAS,EAAEI,KAAK,CAAC;AACtC","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["createRoot","hydrateRoot","BrowserRouter","GlobalStateProvider","HelmetProvider","getInj","jsx","_jsx","launchClient","Application","options","inj","container","document","getElementById","Error","scene","initialState","ISTATE","children","dontHydrate","root","render"],"sources":["../../../src/client/index.tsx"],"sourcesContent":["// Initialization of client-side code.\n/* global document */\n\nimport type { ComponentType } from 'react';\nimport { createRoot, hydrateRoot } from 'react-dom/client';\nimport { BrowserRouter } from 'react-router';\n\nimport { GlobalStateProvider } from '@dr.pogodin/react-global-state';\nimport { HelmetProvider } from '@dr.pogodin/react-helmet';\n\nimport getInj from './getInj';\n\ntype OptionsT = {\n dontHydrate?: boolean;\n initialState?: unknown;\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 async function launchClient(\n Application: ComponentType,\n options: OptionsT = {},\n): Promise<void> {\n const inj = await getInj();\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={inj.ISTATE ?? options.initialState}>\n <BrowserRouter>\n <HelmetProvider>\n <Application />\n </HelmetProvider>\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":"AAAA;AACA,qBAGA,SAASA,UAAU,EAAEC,WAAW,QAAQ,kBAAkB;AAC1D,SAASC,aAAa,QAAQ,cAAc;AAE5C,SAASC,mBAAmB,QAAQ,gCAAgC;AACpE,SAASC,cAAc,QAAQ,0BAA0B;AAEzD,OAAOC,MAAM;AAAiB,SAAAC,GAAA,IAAAC,IAAA,4BAO9B;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,YAAYA,CAChCC,WAA0B,EAC1BC,OAAiB,GAAG,CAAC,CAAC,EACP;EACf,MAAMC,GAAG,GAAG,MAAMN,MAAM,CAAC,CAAC;EAE1B,MAAMO,SAAS,GAAGC,QAAQ,CAACC,cAAc,CAAC,YAAY,CAAC;EACvD,IAAI,CAACF,SAAS,EAAE,MAAMG,KAAK,CAAC,wCAAwC,CAAC;EACrE,MAAMC,KAAK,gBACTT,IAAA,CAACJ,mBAAmB;IAACc,YAAY,EAAEN,GAAG,CAACO,MAAM,IAAIR,OAAO,CAACO,YAAa;IAAAE,QAAA,eACpEZ,IAAA,CAACL,aAAa;MAAAiB,QAAA,eACZZ,IAAA,CAACH,cAAc;QAAAe,QAAA,eACbZ,IAAA,CAACE,WAAW,IAAE;MAAC,CACD;IAAC,CACJ;EAAC,CACG,CACtB;EAED,IAAIC,OAAO,CAACU,WAAW,EAAE;IACvB,MAAMC,IAAI,GAAGrB,UAAU,CAACY,SAAS,CAAC;IAClCS,IAAI,CAACC,MAAM,CAACN,KAAK,CAAC;EACpB,CAAC,MAAMf,WAAW,CAACW,SAAS,EAAEI,KAAK,CAAC;AACtC","ignoreList":[]}
@@ -3,19 +3,12 @@
3
3
  */
4
4
  /* global window */
5
5
  import { getBuildInfo } from "../shared/utils/isomorphy/buildInfo.js";
6
- const buildInfo = getBuildInfo();
7
-
8
- // TODO: Should be moved into buildInfo module?
9
-
10
- if (process.env.NODE_ENV !== 'production') {
6
+ const buildInfo = getBuildInfo(); // TODO: Should be moved into buildInfo module?
7
+ if (process.env.NODE_ENV !== "production") {
11
8
  // eslint-disable-next-line no-console
12
- console.warn('Dev mode: "BUILD_INFO" attached to the global "window"');
13
-
14
- // eslint-disable-next-line no-underscore-dangle
9
+ console.warn("Dev mode: \"BUILD_INFO\" attached to the global \"window\""); // eslint-disable-next-line no-underscore-dangle
15
10
  window.__DEV_BUILD_INFO__ = BUILD_INFO;
16
- }
17
-
18
- /* TODO: A proper logger should be moved to `@dr.pogodin/react-utils`. */
11
+ } /* TODO: A proper logger should be moved to `@dr.pogodin/react-utils`. */
19
12
  const {
20
13
  useServiceWorker
21
14
  } = buildInfo;
@@ -23,20 +16,19 @@ if (useServiceWorker) {
23
16
  const {
24
17
  navigator
25
18
  } = window;
26
- if ('serviceWorker' in navigator) {
27
- window.addEventListener('load', () => {
19
+ if ("serviceWorker" in navigator) {
20
+ window.addEventListener("load", () => {
28
21
  void (async () => {
29
22
  try {
30
23
  // Note: no matter the "publicPath", we want to serve the service worker
31
24
  // from the web app root, to allow it control any and all pages of the
32
25
  // web app (otherwise, it will be restricted to the scope of its path).
33
26
  // The server takes it into account.
34
- const reg = await navigator.serviceWorker.register('/__service-worker.js');
35
- // eslint-disable-next-line no-console
36
- console.log('SW registered:', reg);
27
+ const reg = await navigator.serviceWorker.register("/__service-worker.js"); // eslint-disable-next-line no-console
28
+ console.log("SW registered:", reg);
37
29
  } catch (err) {
38
30
  // eslint-disable-next-line no-console
39
- console.log('SW registration failed:', err);
31
+ console.log("SW registration failed:", err);
40
32
  }
41
33
  })();
42
34
  });
@@ -1 +1 @@
1
- {"version":3,"file":"init.js","names":["getBuildInfo","buildInfo","process","env","NODE_ENV","console","warn","window","__DEV_BUILD_INFO__","BUILD_INFO","useServiceWorker","navigator","addEventListener","reg","serviceWorker","register","log","err"],"sources":["../../../src/client/init.ts"],"sourcesContent":["/**\n * Initialization of client-side environment.\n */\n\n/* global window */\n\nimport { type BuildInfoT, getBuildInfo } from 'utils/isomorphy/buildInfo';\n\nconst buildInfo = getBuildInfo();\n\n// TODO: Should be moved into buildInfo module?\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/consistent-type-definitions\n interface Window {\n __DEV_BUILD_INFO__: BuildInfoT | undefined;\n }\n}\n\ndeclare const BUILD_INFO: BuildInfoT | undefined;\n\nif (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.warn('Dev mode: \"BUILD_INFO\" attached to the global \"window\"');\n\n // eslint-disable-next-line no-underscore-dangle\n window.__DEV_BUILD_INFO__ = BUILD_INFO;\n}\n\n/* TODO: A proper logger should be moved to `@dr.pogodin/react-utils`. */\nconst { useServiceWorker } = buildInfo;\nif (useServiceWorker) {\n const { navigator } = window;\n if ('serviceWorker' in navigator) {\n window.addEventListener('load', () => {\n void (async () => {\n try {\n // Note: no matter the \"publicPath\", we want to serve the service worker\n // from the web app root, to allow it control any and all pages of the\n // web app (otherwise, it will be restricted to the scope of its path).\n // The server takes it into account.\n const reg = await navigator\n .serviceWorker.register('/__service-worker.js');\n // eslint-disable-next-line no-console\n console.log('SW registered:', reg);\n } catch (err) {\n // eslint-disable-next-line no-console\n console.log('SW registration failed:', err);\n }\n })();\n });\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AAEA;AAAA,SAE0BA,YAAY;AAEtC,MAAMC,SAAS,GAAGD,YAAY,CAAC,CAAC;;AAEhC;;AAUA,IAAIE,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,EAAE;EACzC;EACAC,OAAO,CAACC,IAAI,CAAC,wDAAwD,CAAC;;EAEtE;EACAC,MAAM,CAACC,kBAAkB,GAAGC,UAAU;AACxC;;AAEA;AACA,MAAM;EAAEC;AAAiB,CAAC,GAAGT,SAAS;AACtC,IAAIS,gBAAgB,EAAE;EACpB,MAAM;IAAEC;EAAU,CAAC,GAAGJ,MAAM;EAC5B,IAAI,eAAe,IAAII,SAAS,EAAE;IAChCJ,MAAM,CAACK,gBAAgB,CAAC,MAAM,EAAE,MAAM;MACpC,KAAK,CAAC,YAAY;QAChB,IAAI;UACF;UACA;UACA;UACA;UACA,MAAMC,GAAG,GAAG,MAAMF,SAAS,CACxBG,aAAa,CAACC,QAAQ,CAAC,sBAAsB,CAAC;UACjD;UACAV,OAAO,CAACW,GAAG,CAAC,gBAAgB,EAAEH,GAAG,CAAC;QACpC,CAAC,CAAC,OAAOI,GAAG,EAAE;UACZ;UACAZ,OAAO,CAACW,GAAG,CAAC,yBAAyB,EAAEC,GAAG,CAAC;QAC7C;MACF,CAAC,EAAE,CAAC;IACN,CAAC,CAAC;EACJ;AACF","ignoreList":[]}
1
+ {"version":3,"file":"init.js","names":["getBuildInfo","buildInfo","process","env","NODE_ENV","console","warn","window","__DEV_BUILD_INFO__","BUILD_INFO","useServiceWorker","navigator","addEventListener","reg","serviceWorker","register","log","err"],"sources":["../../../src/client/init.ts"],"sourcesContent":["/**\n * Initialization of client-side environment.\n */\n\n/* global window */\n\nimport { type BuildInfoT, getBuildInfo } from 'utils/isomorphy/buildInfo';\n\nconst buildInfo = getBuildInfo();\n\n// TODO: Should be moved into buildInfo module?\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/consistent-type-definitions\n interface Window {\n __DEV_BUILD_INFO__: BuildInfoT | undefined;\n }\n}\n\ndeclare const BUILD_INFO: BuildInfoT | undefined;\n\nif (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line no-console\n console.warn('Dev mode: \"BUILD_INFO\" attached to the global \"window\"');\n\n // eslint-disable-next-line no-underscore-dangle\n window.__DEV_BUILD_INFO__ = BUILD_INFO;\n}\n\n/* TODO: A proper logger should be moved to `@dr.pogodin/react-utils`. */\nconst { useServiceWorker } = buildInfo;\nif (useServiceWorker) {\n const { navigator } = window;\n if ('serviceWorker' in navigator) {\n window.addEventListener('load', () => {\n void (async () => {\n try {\n // Note: no matter the \"publicPath\", we want to serve the service worker\n // from the web app root, to allow it control any and all pages of the\n // web app (otherwise, it will be restricted to the scope of its path).\n // The server takes it into account.\n const reg = await navigator\n .serviceWorker.register('/__service-worker.js');\n // eslint-disable-next-line no-console\n console.log('SW registered:', reg);\n } catch (err) {\n // eslint-disable-next-line no-console\n console.log('SW registration failed:', err);\n }\n })();\n });\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AAEA;AAAA,SAE0BA,YAAY;AAEtC,MAAMC,SAAS,GAAGD,YAAY,CAAC,CAAC,CAEhC;AAUA,IAAIE,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,EAAE;EACzC;EACAC,OAAO,CAACC,IAAI,CAAC,4DAAwD,CAAC,CAEtE;EACAC,MAAM,CAACC,kBAAkB,GAAGC,UAAU;AACxC,CAEA;AACA,MAAM;EAAEC;AAAiB,CAAC,GAAGT,SAAS;AACtC,IAAIS,gBAAgB,EAAE;EACpB,MAAM;IAAEC;EAAU,CAAC,GAAGJ,MAAM;EAC5B,IAAI,eAAe,IAAII,SAAS,EAAE;IAChCJ,MAAM,CAACK,gBAAgB,CAAC,MAAM,EAAE,MAAM;MACpC,KAAK,CAAC,YAAY;QAChB,IAAI;UACF;UACA;UACA;UACA;UACA,MAAMC,GAAG,GAAG,MAAMF,SAAS,CACxBG,aAAa,CAACC,QAAQ,CAAC,sBAAsB,CAAC,CACjD;UACAV,OAAO,CAACW,GAAG,CAAC,gBAAgB,EAAEH,GAAG,CAAC;QACpC,CAAE,QAAOI,GAAG,EAAE;UACZ;UACAZ,OAAO,CAACW,GAAG,CAAC,yBAAyB,EAAEC,GAAG,CAAC;QAC7C;MACF,CAAC,EAAE,CAAC;IACN,CAAC,CAAC;EACJ;AACF","ignoreList":[]}
@@ -1,11 +1,33 @@
1
+ // TODO: For now I commented out this safeguard check, as I am not sure how
2
+ // to easily make it work: it should not be triggered in HMR mode, but if I
3
+ // add the code relying on import.meta, it fails in Jest environment, because
4
+ // Jest does not support ES modules yet, and import.meta is not support in
5
+ // CommonJS modules, and the "babel-plugin-transform-import-meta" plugin
6
+ // we use to workaround this issue for import.meta.dirname, etc. does not
7
+ // transform import.meta.webpackHot
1
8
  // It is a safeguard against multiple instances / versions of the library
2
9
  // being loaded into environment by mistake (e.g. because of different
3
10
  // packages pinning down different exact versions of the lib, thus preventing
4
11
  // a proper dedupe and using a single common library version).
5
- if (global.REACT_UTILS_LIBRARY_LOADED) {
6
- throw Error('React utils library is already loaded');
7
- } else global.REACT_UTILS_LIBRARY_LOADED = true;
8
- export { GlobalStateProvider, getGlobalState, newAsyncDataEnvelope, useAsyncCollection, useAsyncData, useGlobalState, withGlobalStateType } from '@dr.pogodin/react-global-state';
12
+ // if (global.REACT_UTILS_LIBRARY_LOADED) {
13
+ // throw Error('React utils library is already loaded');
14
+ // } else global.REACT_UTILS_LIBRARY_LOADED = true;
15
+ /*
16
+ declare global {
17
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions
18
+ interface ImportMeta {
19
+ webpackHot?: {
20
+ dispose(cb: () => void): void;
21
+ };
22
+ }
23
+ }
24
+
25
+ if (import.meta.webpackHot) {
26
+ import.meta.webpackHot.dispose(() => {
27
+ delete global.REACT_UTILS_LIBRARY_LOADED;
28
+ });
29
+ }
30
+ */export { GlobalStateProvider, getGlobalState, newAsyncDataEnvelope, useAsyncCollection, useAsyncData, useGlobalState, withGlobalStateType } from "@dr.pogodin/react-global-state";
9
31
  export * from "./shared/components/index.js";
10
32
  export { Barrier, Cached, Emitter, Semaphore, THEME_COMPOSE, THEME_PRIORITY, ThemeProvider, assertEmptyObject, getConfig, getSsrContext, isomorphy, splitComponent, time, useTheme, webpack, withRetries } from "./shared/utils/index.js";
11
33
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["global","REACT_UTILS_LIBRARY_LOADED","Error","GlobalStateProvider","getGlobalState","newAsyncDataEnvelope","useAsyncCollection","useAsyncData","useGlobalState","withGlobalStateType","Barrier","Cached","Emitter","Semaphore","THEME_COMPOSE","THEME_PRIORITY","ThemeProvider","assertEmptyObject","getConfig","getSsrContext","isomorphy","splitComponent","time","useTheme","webpack","withRetries"],"sources":["../../src/index.ts"],"sourcesContent":["// It is a safeguard against multiple instances / versions of the library\n// being loaded into environment by mistake (e.g. because of different\n// packages pinning down different exact versions of the lib, thus preventing\n// a proper dedupe and using a single common library version).\nif (global.REACT_UTILS_LIBRARY_LOADED) {\n throw Error('React utils library is already loaded');\n} else global.REACT_UTILS_LIBRARY_LOADED = true;\n\nexport {\n type AsyncCollectionLoaderT,\n type AsyncCollectionT,\n type AsyncDataEnvelopeT,\n type AsyncDataLoaderT,\n type ForceT,\n GlobalStateProvider,\n type UseAsyncDataOptionsT,\n type UseAsyncDataResT,\n type UseGlobalStateResT,\n type ValueOrInitializerT,\n getGlobalState,\n newAsyncDataEnvelope,\n useAsyncCollection,\n useAsyncData,\n useGlobalState,\n withGlobalStateType,\n} from '@dr.pogodin/react-global-state';\n\nexport * from 'components';\n\nexport {\n type BeforeRenderResT,\n type BeforeRenderT,\n type ConfigT,\n type ServerSsrContext,\n type ServerT,\n} from './server';\n\nexport {\n Barrier,\n Cached,\n Emitter,\n type Listener,\n type ObjectKey,\n Semaphore,\n THEME_COMPOSE,\n THEME_PRIORITY,\n type Theme,\n ThemeProvider,\n assertEmptyObject,\n getConfig,\n getSsrContext,\n isomorphy,\n splitComponent,\n time,\n useTheme,\n webpack,\n withRetries,\n} from 'utils';\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA,IAAIA,MAAM,CAACC,0BAA0B,EAAE;EACrC,MAAMC,KAAK,CAAC,uCAAuC,CAAC;AACtD,CAAC,MAAMF,MAAM,CAACC,0BAA0B,GAAG,IAAI;AAE/C,SAMEE,mBAAmB,EAKnBC,cAAc,EACdC,oBAAoB,EACpBC,kBAAkB,EAClBC,YAAY,EACZC,cAAc,EACdC,mBAAmB,QACd,gCAAgC;AAAA;AAAA,SAarCC,OAAO,EACPC,MAAM,EACNC,OAAO,EAGPC,SAAS,EACTC,aAAa,EACbC,cAAc,EAEdC,aAAa,EACbC,iBAAiB,EACjBC,SAAS,EACTC,aAAa,EACbC,SAAS,EACTC,cAAc,EACdC,IAAI,EACJC,QAAQ,EACRC,OAAO,EACPC,WAAW","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["GlobalStateProvider","getGlobalState","newAsyncDataEnvelope","useAsyncCollection","useAsyncData","useGlobalState","withGlobalStateType","Barrier","Cached","Emitter","Semaphore","THEME_COMPOSE","THEME_PRIORITY","ThemeProvider","assertEmptyObject","getConfig","getSsrContext","isomorphy","splitComponent","time","useTheme","webpack","withRetries"],"sources":["../../src/index.ts"],"sourcesContent":["// TODO: For now I commented out this safeguard check, as I am not sure how\n// to easily make it work: it should not be triggered in HMR mode, but if I\n// add the code relying on import.meta, it fails in Jest environment, because\n// Jest does not support ES modules yet, and import.meta is not support in\n// CommonJS modules, and the \"babel-plugin-transform-import-meta\" plugin\n// we use to workaround this issue for import.meta.dirname, etc. does not\n// transform import.meta.webpackHot\n\n// It is a safeguard against multiple instances / versions of the library\n// being loaded into environment by mistake (e.g. because of different\n// packages pinning down different exact versions of the lib, thus preventing\n// a proper dedupe and using a single common library version).\n// if (global.REACT_UTILS_LIBRARY_LOADED) {\n// throw Error('React utils library is already loaded');\n// } else global.REACT_UTILS_LIBRARY_LOADED = true;\n\n/*\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/consistent-type-definitions\n interface ImportMeta {\n webpackHot?: {\n dispose(cb: () => void): void;\n };\n }\n}\n\nif (import.meta.webpackHot) {\n import.meta.webpackHot.dispose(() => {\n delete global.REACT_UTILS_LIBRARY_LOADED;\n });\n}\n*/\n\nexport {\n type AsyncCollectionLoaderT,\n type AsyncCollectionT,\n type AsyncDataEnvelopeT,\n type AsyncDataLoaderT,\n type ForceT,\n GlobalStateProvider,\n type UseAsyncDataOptionsT,\n type UseAsyncDataResT,\n type UseGlobalStateResT,\n type ValueOrInitializerT,\n getGlobalState,\n newAsyncDataEnvelope,\n useAsyncCollection,\n useAsyncData,\n useGlobalState,\n withGlobalStateType,\n} from '@dr.pogodin/react-global-state';\n\nexport * from 'components';\n\nexport {\n type BeforeRenderResT,\n type BeforeRenderT,\n type ConfigT,\n type ServerSsrContext,\n type ServerT,\n} from './server';\n\nexport {\n Barrier,\n Cached,\n Emitter,\n type Listener,\n type ObjectKey,\n Semaphore,\n THEME_COMPOSE,\n THEME_PRIORITY,\n type Theme,\n ThemeProvider,\n assertEmptyObject,\n getConfig,\n getSsrContext,\n isomorphy,\n splitComponent,\n time,\n useTheme,\n webpack,\n withRetries,\n} from 'utils';\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAEA,SAMEA,mBAAmB,EAKnBC,cAAc,EACdC,oBAAoB,EACpBC,kBAAkB,EAClBC,YAAY,EACZC,cAAc,EACdC,mBAAmB,QACd,gCAAgC;AAEvC;AAAA,SAWEC,OAAO,EACPC,MAAM,EACNC,OAAO,EAGPC,SAAS,EACTC,aAAa,EACbC,cAAc,EAEdC,aAAa,EACbC,iBAAiB,EACjBC,SAAS,EACTC,aAAa,EACbC,SAAS,EACTC,cAAc,EACdC,IAAI,EACJC,QAAQ,EACRC,OAAO,EACPC,WAAW","ignoreList":[]}
@@ -1,35 +1,30 @@
1
1
  /**
2
2
  * Implements the static cache.
3
- */
4
- export default class Cache {
3
+ */export default class Cache {
5
4
  items = {};
6
5
  size = 0;
7
6
  constructor(maxSize) {
8
7
  this.maxSize = maxSize;
9
- }
10
-
11
- /**
12
- * Cache lookup.
13
- * @param key Item key to look for.
14
- * @param [maxage=Number.MAX_VALUE] Optional. The maximum age of
15
- * cached item to serve. Default to infinite.
16
- * @returns Cached item, or null if the item is absent in cache,
17
- * or stale.
18
- */
8
+ } /**
9
+ * Cache lookup.
10
+ * @param key Item key to look for.
11
+ * @param [maxage=Number.MAX_VALUE] Optional. The maximum age of
12
+ * cached item to serve. Default to infinite.
13
+ * @returns Cached item, or null if the item is absent in cache,
14
+ * or stale.
15
+ */
19
16
  get({
20
17
  key,
21
18
  maxage = Number.MAX_VALUE
22
19
  }) {
23
20
  const item = this.items[key];
24
21
  return item && Date.now() - item.timestamp < maxage ? item.data : null;
25
- }
26
-
27
- /**
28
- * Adds item to cache.
29
- * @param data Item to add.
30
- * @param key Key to store the item at.
31
- * @param size Byte size of the item.
32
- */
22
+ } /**
23
+ * Adds item to cache.
24
+ * @param data Item to add.
25
+ * @param key Key to store the item at.
26
+ * @param size Byte size of the item.
27
+ */
33
28
  add(data, key, size) {
34
29
  const cached = this.items[key];
35
30
  if (cached) this.size -= cached.size;
@@ -1 +1 @@
1
- {"version":3,"file":"Cache.js","names":["Cache","items","size","constructor","maxSize","get","key","maxage","Number","MAX_VALUE","item","Date","now","timestamp","data","add","cached","entries","Object","sort","a","b","entry","itemKey"],"sources":["../../../src/server/Cache.ts"],"sourcesContent":["type CachedItemT<DatumT> = {\n data: DatumT;\n size: number;\n timestamp: number;\n};\n\n/**\n * Implements the static cache.\n */\nexport default class Cache<DatumT> {\n private items: Record<string, CachedItemT<DatumT>> = {};\n\n private size = 0;\n\n constructor(private maxSize: number) { }\n\n /**\n * Cache lookup.\n * @param key Item key to look for.\n * @param [maxage=Number.MAX_VALUE] Optional. The maximum age of\n * cached item to serve. Default to infinite.\n * @returns Cached item, or null if the item is absent in cache,\n * or stale.\n */\n get({\n key,\n maxage = Number.MAX_VALUE,\n }: {\n key: string;\n maxage?: number;\n }): DatumT | null {\n const item = this.items[key];\n return item && Date.now() - item.timestamp < maxage ? item.data : null;\n }\n\n /**\n * Adds item to cache.\n * @param data Item to add.\n * @param key Key to store the item at.\n * @param size Byte size of the item.\n */\n add(data: DatumT, key: string, size: number): void {\n const cached = this.items[key];\n if (cached) this.size -= cached.size;\n\n this.items[key] = { data, size, timestamp: Date.now() };\n this.size += size;\n\n if (this.size > this.maxSize) {\n const entries = Object.entries(this.items);\n entries.sort((a, b) => a[1].timestamp - b[1].timestamp);\n\n for (const entry of entries) {\n const [itemKey, item] = entry;\n delete this.items[itemKey];\n this.size -= item.size;\n if (this.size < this.maxSize / 2) break;\n }\n }\n }\n}\n"],"mappings":"AAMA;AACA;AACA;AACA,eAAe,MAAMA,KAAK,CAAS;EACzBC,KAAK,GAAwC,CAAC,CAAC;EAE/CC,IAAI,GAAG,CAAC;EAEhBC,WAAWA,CAASC,OAAe,EAAE;IAAA,KAAjBA,OAAe,GAAfA,OAAe;EAAI;;EAEvC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,GAAGA,CAAC;IACFC,GAAG;IACHC,MAAM,GAAGC,MAAM,CAACC;EAIlB,CAAC,EAAiB;IAChB,MAAMC,IAAI,GAAG,IAAI,CAACT,KAAK,CAACK,GAAG,CAAC;IAC5B,OAAOI,IAAI,IAAIC,IAAI,CAACC,GAAG,CAAC,CAAC,GAAGF,IAAI,CAACG,SAAS,GAAGN,MAAM,GAAGG,IAAI,CAACI,IAAI,GAAG,IAAI;EACxE;;EAEA;AACF;AACA;AACA;AACA;AACA;EACEC,GAAGA,CAACD,IAAY,EAAER,GAAW,EAAEJ,IAAY,EAAQ;IACjD,MAAMc,MAAM,GAAG,IAAI,CAACf,KAAK,CAACK,GAAG,CAAC;IAC9B,IAAIU,MAAM,EAAE,IAAI,CAACd,IAAI,IAAIc,MAAM,CAACd,IAAI;IAEpC,IAAI,CAACD,KAAK,CAACK,GAAG,CAAC,GAAG;MAAEQ,IAAI;MAAEZ,IAAI;MAAEW,SAAS,EAAEF,IAAI,CAACC,GAAG,CAAC;IAAE,CAAC;IACvD,IAAI,CAACV,IAAI,IAAIA,IAAI;IAEjB,IAAI,IAAI,CAACA,IAAI,GAAG,IAAI,CAACE,OAAO,EAAE;MAC5B,MAAMa,OAAO,GAAGC,MAAM,CAACD,OAAO,CAAC,IAAI,CAAChB,KAAK,CAAC;MAC1CgB,OAAO,CAACE,IAAI,CAAC,CAACC,CAAC,EAAEC,CAAC,KAAKD,CAAC,CAAC,CAAC,CAAC,CAACP,SAAS,GAAGQ,CAAC,CAAC,CAAC,CAAC,CAACR,SAAS,CAAC;MAEvD,KAAK,MAAMS,KAAK,IAAIL,OAAO,EAAE;QAC3B,MAAM,CAACM,OAAO,EAAEb,IAAI,CAAC,GAAGY,KAAK;QAC7B,OAAO,IAAI,CAACrB,KAAK,CAACsB,OAAO,CAAC;QAC1B,IAAI,CAACrB,IAAI,IAAIQ,IAAI,CAACR,IAAI;QACtB,IAAI,IAAI,CAACA,IAAI,GAAG,IAAI,CAACE,OAAO,GAAG,CAAC,EAAE;MACpC;IACF;EACF;AACF","ignoreList":[]}
1
+ {"version":3,"file":"Cache.js","names":["Cache","items","size","constructor","maxSize","get","key","maxage","Number","MAX_VALUE","item","Date","now","timestamp","data","add","cached","entries","Object","sort","a","b","entry","itemKey"],"sources":["../../../src/server/Cache.ts"],"sourcesContent":["type CachedItemT<DatumT> = {\n data: DatumT;\n size: number;\n timestamp: number;\n};\n\n/**\n * Implements the static cache.\n */\nexport default class Cache<DatumT> {\n private items: Record<string, CachedItemT<DatumT>> = {};\n\n private size = 0;\n\n constructor(private maxSize: number) { }\n\n /**\n * Cache lookup.\n * @param key Item key to look for.\n * @param [maxage=Number.MAX_VALUE] Optional. The maximum age of\n * cached item to serve. Default to infinite.\n * @returns Cached item, or null if the item is absent in cache,\n * or stale.\n */\n get({\n key,\n maxage = Number.MAX_VALUE,\n }: {\n key: string;\n maxage?: number;\n }): DatumT | null {\n const item = this.items[key];\n return item && Date.now() - item.timestamp < maxage ? item.data : null;\n }\n\n /**\n * Adds item to cache.\n * @param data Item to add.\n * @param key Key to store the item at.\n * @param size Byte size of the item.\n */\n add(data: DatumT, key: string, size: number): void {\n const cached = this.items[key];\n if (cached) this.size -= cached.size;\n\n this.items[key] = { data, size, timestamp: Date.now() };\n this.size += size;\n\n if (this.size > this.maxSize) {\n const entries = Object.entries(this.items);\n entries.sort((a, b) => a[1].timestamp - b[1].timestamp);\n\n for (const entry of entries) {\n const [itemKey, item] = entry;\n delete this.items[itemKey];\n this.size -= item.size;\n if (this.size < this.maxSize / 2) break;\n }\n }\n }\n}\n"],"mappings":"AAMA;AACA;AACA,GACA,eAAe,MAAMA,KAAc;EACzBC,KAAK,GAAwC,CAAC,CAAC;EAE/CC,IAAI,GAAG,CAAC;EAEhBC,WAAWA,CAASC,OAAe,EAAE;IAAA,KAAjBA,OAAe,GAAfA,OAAmB;EAAA,CAEvC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,GAAGA,CAAC;IACFC,GAAG;IACHC,MAAM,GAAGC,MAAM,CAACC;EAIlB,CAAC,EAAiB;IAChB,MAAMC,IAAI,GAAG,IAAI,CAACT,KAAK,CAACK,GAAG,CAAC;IAC5B,OAAOI,IAAI,IAAIC,IAAI,CAACC,GAAG,CAAC,CAAC,GAAGF,IAAI,CAACG,SAAS,GAAGN,MAAM,GAAGG,IAAI,CAACI,IAAI,GAAG,IAAI;EACxE,CAEA;AACF;AACA;AACA;AACA;AACA;EACEC,GAAGA,CAACD,IAAY,EAAER,GAAW,EAAEJ,IAAY,EAAQ;IACjD,MAAMc,MAAM,GAAG,IAAI,CAACf,KAAK,CAACK,GAAG,CAAC;IAC9B,IAAIU,MAAM,EAAE,IAAI,CAACd,IAAI,IAAIc,MAAM,CAACd,IAAI;IAEpC,IAAI,CAACD,KAAK,CAACK,GAAG,CAAC,GAAG;MAAEQ,IAAI;MAAEZ,IAAI;MAAEW,SAAS,EAAEF,IAAI,CAACC,GAAG,CAAC;IAAE,CAAC;IACvD,IAAI,CAACV,IAAI,IAAIA,IAAI;IAEjB,IAAI,IAAI,CAACA,IAAI,GAAG,IAAI,CAACE,OAAO,EAAE;MAC5B,MAAMa,OAAO,GAAGC,MAAM,CAACD,OAAO,CAAC,IAAI,CAAChB,KAAK,CAAC;MAC1CgB,OAAO,CAACE,IAAI,CAAC,CAACC,CAAC,EAAEC,CAAC,KAAKD,CAAC,CAAC,CAAC,CAAC,CAACP,SAAS,GAAGQ,CAAC,CAAC,CAAC,CAAC,CAACR,SAAS,CAAC;MAEvD,KAAK,MAAMS,KAAK,IAAIL,OAAO,EAAE;QAC3B,MAAM,CAACM,OAAO,EAAEb,IAAI,CAAC,GAAGY,KAAK;QAC7B,OAAO,IAAI,CAACrB,KAAK,CAACsB,OAAO,CAAC;QAC1B,IAAI,CAACrB,IAAI,IAAIQ,IAAI,CAACR,IAAI;QACtB,IAAI,IAAI,CAACA,IAAI,GAAG,IAAI,CAACE,OAAO,GAAG,CAAC,EAAE;MACpC;IACF;EACF;AACF","ignoreList":[]}