@dimina-kit/devtools 0.4.0-dev.20260828161241 → 0.4.0-dev.20260907055341

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 (277) hide show
  1. package/README.md +52 -729
  2. package/dist/main/app/app.d.ts +27 -7
  3. package/dist/main/app/app.js +285 -681
  4. package/dist/main/app/editor-view.d.ts +21 -0
  5. package/dist/main/app/editor-view.js +71 -0
  6. package/dist/main/app/global-mirrors.d.ts +23 -0
  7. package/dist/main/app/global-mirrors.js +37 -0
  8. package/dist/main/app/host-sidebar-default.d.ts +19 -0
  9. package/dist/main/app/host-sidebar-default.js +44 -0
  10. package/dist/main/app/menu-setup.d.ts +13 -0
  11. package/dist/main/app/menu-setup.js +49 -0
  12. package/dist/main/app/open-project-ipc.d.ts +13 -0
  13. package/dist/main/app/open-project-ipc.js +21 -0
  14. package/dist/main/app/project-list-surface.d.ts +31 -0
  15. package/dist/main/app/project-list-surface.js +20 -0
  16. package/dist/main/app/project-window.d.ts +36 -0
  17. package/dist/main/app/project-window.js +93 -0
  18. package/dist/main/app/servers.d.ts +17 -0
  19. package/dist/main/app/servers.js +60 -0
  20. package/dist/main/app/ui-extension-targets.d.ts +42 -0
  21. package/dist/main/app/ui-extension-targets.js +101 -0
  22. package/dist/main/app/window-close-reveal.harness.d.ts +34 -0
  23. package/dist/main/app/window-close-reveal.harness.js +65 -0
  24. package/dist/main/app/window-events.d.ts +15 -0
  25. package/dist/main/app/window-events.js +45 -0
  26. package/dist/main/app/window-runtime-services.d.ts +41 -0
  27. package/dist/main/app/window-runtime-services.js +178 -0
  28. package/dist/main/app/workbench-modules.d.ts +24 -0
  29. package/dist/main/app/workbench-modules.js +51 -0
  30. package/dist/main/app/workbench-window.d.ts +85 -0
  31. package/dist/main/app/workbench-window.js +310 -0
  32. package/dist/main/index.bundle.js +10669 -9096
  33. package/dist/main/ipc/app.d.ts +4 -1
  34. package/dist/main/ipc/app.js +4 -3
  35. package/dist/main/ipc/device-picker.d.ts +16 -0
  36. package/dist/main/ipc/device-picker.js +27 -0
  37. package/dist/main/ipc/index.d.ts +1 -0
  38. package/dist/main/ipc/index.js +1 -0
  39. package/dist/main/ipc/internal-devtools.d.ts +2 -1
  40. package/dist/main/ipc/internal-devtools.js +4 -3
  41. package/dist/main/ipc/popover.d.ts +4 -1
  42. package/dist/main/ipc/popover.js +25 -9
  43. package/dist/main/ipc/project-create.d.ts +2 -1
  44. package/dist/main/ipc/project-create.js +6 -5
  45. package/dist/main/ipc/project-fs.d.ts +3 -1
  46. package/dist/main/ipc/project-fs.js +17 -17
  47. package/dist/main/ipc/projects.d.ts +3 -3
  48. package/dist/main/ipc/projects.js +13 -12
  49. package/dist/main/ipc/session.d.ts +4 -1
  50. package/dist/main/ipc/session.js +16 -11
  51. package/dist/main/ipc/settings.d.ts +4 -1
  52. package/dist/main/ipc/settings.js +12 -19
  53. package/dist/main/ipc/simulator-module.d.ts +5 -0
  54. package/dist/main/ipc/simulator-module.js +9 -5
  55. package/dist/main/ipc/simulator.d.ts +4 -1
  56. package/dist/main/ipc/simulator.js +12 -18
  57. package/dist/main/ipc/tooltip.d.ts +2 -1
  58. package/dist/main/ipc/tooltip.js +8 -7
  59. package/dist/main/ipc/views.d.ts +4 -1
  60. package/dist/main/ipc/views.js +20 -9
  61. package/dist/main/runtime/devtools-backend-before-quit.harness.d.ts +2 -20
  62. package/dist/main/runtime/devtools-backend-before-quit.harness.js +14 -283
  63. package/dist/main/runtime/devtools-backend.js +14 -3
  64. package/dist/main/runtime/devtools-runtime-mock.harness.d.ts +21 -0
  65. package/dist/main/runtime/devtools-runtime-mock.harness.js +313 -0
  66. package/dist/main/services/app-services.d.ts +62 -0
  67. package/dist/main/services/app-services.js +64 -0
  68. package/dist/main/services/automation/connection-target.d.ts +36 -0
  69. package/dist/main/services/automation/connection-target.js +29 -0
  70. package/dist/main/services/automation/console-bridge.d.ts +28 -0
  71. package/dist/main/services/automation/console-bridge.js +91 -0
  72. package/dist/main/services/automation/handlers/app.js +4 -4
  73. package/dist/main/services/automation/handlers/element.js +55 -21
  74. package/dist/main/services/automation/index.d.ts +12 -1
  75. package/dist/main/services/automation/index.js +54 -133
  76. package/dist/main/services/default-adapter.js +1 -1
  77. package/dist/main/services/fs-bridge-protocol.d.ts +61 -0
  78. package/dist/main/services/fs-bridge-protocol.js +34 -0
  79. package/dist/main/services/fs-watch-sse.d.ts +8 -1
  80. package/dist/main/services/fs-watch-sse.js +19 -5
  81. package/dist/main/services/mcp/connection-owner.d.ts +38 -0
  82. package/dist/main/services/mcp/connection-owner.js +79 -0
  83. package/dist/main/services/mcp/index.d.ts +3 -1
  84. package/dist/main/services/mcp/index.js +4 -3
  85. package/dist/main/services/mcp/opened-project.d.ts +88 -0
  86. package/dist/main/services/mcp/opened-project.js +60 -0
  87. package/dist/main/services/mcp/target-manager.d.ts +71 -23
  88. package/dist/main/services/mcp/target-manager.js +269 -142
  89. package/dist/main/services/mcp/target-selection.d.ts +47 -0
  90. package/dist/main/services/mcp/target-selection.js +71 -0
  91. package/dist/main/services/mcp/tools/context-tools.js +20 -5
  92. package/dist/main/services/mcp/tools/project-tools.d.ts +29 -6
  93. package/dist/main/services/mcp/tools/project-tools.js +37 -25
  94. package/dist/main/services/module.d.ts +13 -5
  95. package/dist/main/services/notifications/renderer-notifier.d.ts +28 -4
  96. package/dist/main/services/notifications/renderer-notifier.js +15 -3
  97. package/dist/main/services/projects/local-provider.js +2 -0
  98. package/dist/main/services/projects/project-repository.d.ts +31 -1
  99. package/dist/main/services/projects/project-repository.js +144 -20
  100. package/dist/main/services/projects/types.d.ts +31 -8
  101. package/dist/main/services/safe-area/index.d.ts +19 -5
  102. package/dist/main/services/safe-area/index.js +38 -13
  103. package/dist/main/services/simulator/ui-extensions.d.ts +8 -0
  104. package/dist/main/services/simulator/ui-extensions.js +16 -6
  105. package/dist/main/services/simulator-storage/index.d.ts +12 -1
  106. package/dist/main/services/simulator-storage/index.js +22 -7
  107. package/dist/main/services/simulator-storage/window-scope.d.ts +20 -0
  108. package/dist/main/services/simulator-storage/window-scope.js +20 -0
  109. package/dist/main/services/views/host-slot-port-channel.d.ts +20 -3
  110. package/dist/main/services/views/host-slot-port-channel.js +33 -5
  111. package/dist/main/services/views/managed-web-contents-view.js +21 -1
  112. package/dist/main/services/views/native-simulator-view.js +13 -16
  113. package/dist/main/services/views/overlay-panels-view.d.ts +13 -0
  114. package/dist/main/services/views/overlay-panels-view.js +31 -0
  115. package/dist/main/services/views/view-manager.d.ts +1 -1
  116. package/dist/main/services/views/view-manager.js +3 -0
  117. package/dist/main/services/window-contexts/context-router.d.ts +36 -0
  118. package/dist/main/services/window-contexts/context-router.js +55 -0
  119. package/dist/main/services/workbench-coi-host.d.ts +52 -0
  120. package/dist/main/services/workbench-coi-host.js +227 -0
  121. package/dist/main/services/workbench-coi-server.js +75 -133
  122. package/dist/main/services/workbench-coi-shutdown.d.ts +40 -0
  123. package/dist/main/services/workbench-coi-shutdown.js +69 -0
  124. package/dist/main/services/workbench-coi-static.d.ts +23 -0
  125. package/dist/main/services/workbench-coi-static.js +87 -0
  126. package/dist/main/services/workbench-context.d.ts +27 -3
  127. package/dist/main/services/workbench-context.js +10 -5
  128. package/dist/main/services/workspace/compile-mode-adapter.d.ts +18 -0
  129. package/dist/main/services/workspace/compile-mode-adapter.js +57 -0
  130. package/dist/main/services/workspace/compile-mode-store.d.ts +25 -0
  131. package/dist/main/services/workspace/compile-mode-store.js +71 -0
  132. package/dist/main/services/workspace/workspace-compile-modes.d.ts +59 -0
  133. package/dist/main/services/workspace/workspace-compile-modes.js +93 -0
  134. package/dist/main/services/workspace/workspace-referer.d.ts +17 -0
  135. package/dist/main/services/workspace/workspace-referer.js +26 -0
  136. package/dist/main/services/workspace/workspace-service.d.ts +4 -0
  137. package/dist/main/services/workspace/workspace-service.js +51 -84
  138. package/dist/main/services/workspace/workspace-thumbnails.d.ts +22 -0
  139. package/dist/main/services/workspace/workspace-thumbnails.js +67 -0
  140. package/dist/main/utils/ipc-context-source.d.ts +40 -0
  141. package/dist/main/utils/ipc-context-source.js +23 -0
  142. package/dist/main/utils/ipc-registry.d.ts +42 -36
  143. package/dist/main/utils/ipc-registry.js +117 -50
  144. package/dist/main/utils/sender-policy.d.ts +9 -0
  145. package/dist/main/utils/sender-policy.js +26 -3
  146. package/dist/main/utils/theme.d.ts +3 -2
  147. package/dist/main/utils/theme.js +3 -2
  148. package/dist/main/windows/main-window/create.d.ts +16 -0
  149. package/dist/main/windows/main-window/create.js +19 -11
  150. package/dist/main/windows/main-window/events.d.ts +1 -1
  151. package/dist/main/windows/main-window/events.js +26 -13
  152. package/dist/main/windows/main-window/index.d.ts +1 -1
  153. package/dist/main/windows/main-window/index.js +1 -1
  154. package/dist/native-host/common/common.js +94 -73
  155. package/dist/native-host/render/render.js +4079 -3171
  156. package/dist/native-host/service/service.js +2 -2
  157. package/dist/preload/runtime/native-host.d.ts +4 -0
  158. package/dist/preload/runtime/temp-files.js +9 -2
  159. package/dist/preload/runtime/wait-for-slot-root.d.ts +7 -4
  160. package/dist/preload/runtime/wait-for-slot-root.js +36 -8
  161. package/dist/preload/windows/host-dialog-runtime.cjs +10 -3
  162. package/dist/preload/windows/host-dialog-runtime.cjs.map +2 -2
  163. package/dist/preload/windows/host-sidebar-runtime.cjs +10 -3
  164. package/dist/preload/windows/host-sidebar-runtime.cjs.map +2 -2
  165. package/dist/preload/windows/host-toolbar-runtime.cjs +10 -3
  166. package/dist/preload/windows/host-toolbar-runtime.cjs.map +2 -2
  167. package/dist/preload/windows/main.cjs +181 -4
  168. package/dist/preload/windows/main.cjs.map +4 -4
  169. package/dist/preload/windows/simulator.cjs +10 -0
  170. package/dist/preload/windows/simulator.cjs.map +2 -2
  171. package/dist/preload/windows/simulator.js +10 -0
  172. package/dist/render-host/pageFrame.html +1 -1
  173. package/dist/render-host/preload.cjs +16 -4
  174. package/dist/renderer/assets/button-CB2MWjHY.js +2 -0
  175. package/dist/renderer/assets/constants-CkoGPQTS.js +2 -0
  176. package/dist/renderer/assets/constants-zQZ2-y21.js +2 -0
  177. package/dist/renderer/assets/{createLucideIcon-Bqi8hpdi.js → createLucideIcon-cZ9FlZZw.js} +2 -2
  178. package/dist/renderer/assets/devicePicker-H2eIO4e1.js +2 -0
  179. package/dist/renderer/assets/dialog-pHzEA8Vx.js +46 -0
  180. package/dist/renderer/assets/dist-B5HADirS.js +2 -0
  181. package/dist/renderer/assets/{dist-DKWdE1TK.js → dist-DIFlRMKe.js} +2 -2
  182. package/dist/renderer/assets/hostSidebarDefault-DRWh6OCt.js +2 -0
  183. package/dist/renderer/assets/index-CEL_XFge.js +2 -0
  184. package/dist/renderer/assets/{input-Ct3alvkq.js → input-CAObw95L.js} +2 -2
  185. package/dist/renderer/assets/ipc-channels-overlays-gIPUFnqc.js +2 -0
  186. package/dist/renderer/assets/jsx-runtime-DICEQH_0.css +1 -0
  187. package/dist/renderer/assets/{jsx-runtime-DGLHmmOq.js → jsx-runtime-DIw5wnYl.js} +1 -1
  188. package/dist/renderer/assets/plus-BQ9u5EbL.js +2 -0
  189. package/dist/renderer/assets/popover-Cw7G2Ctp.js +2 -0
  190. package/dist/renderer/assets/presets-DMZOb9ay.js +2 -0
  191. package/dist/renderer/assets/project-api-YTOr_Yvo.js +2 -0
  192. package/dist/renderer/assets/{projectCreateDialog-Bbjz75bP.js → projectCreateDialog-BmLqiYxn.js} +2 -2
  193. package/dist/renderer/assets/search-BMvuYF48.js +2 -0
  194. package/dist/renderer/assets/select-nFP95TxM.js +2 -0
  195. package/dist/renderer/assets/settings-CnpVfSWt.js +2 -0
  196. package/dist/renderer/assets/settings-api-Ccsf-Nsj.js +2 -0
  197. package/dist/renderer/assets/settings-tab-bar-CAzrv32m.js +2 -0
  198. package/dist/renderer/assets/smartphone-Bb2GdIKy.js +2 -0
  199. package/dist/renderer/assets/tabs-CPKN3Mmq.js +2 -0
  200. package/dist/renderer/assets/{tooltip-B_-_YVbw.js → tooltip-D6AxXRk5.js} +2 -2
  201. package/dist/renderer/assets/types-Bh0hA7El.js +2 -0
  202. package/dist/renderer/assets/updateDialog-CwndJ0Bl.js +2 -0
  203. package/dist/renderer/assets/{utils-kfQov6Pa.js → utils-sEB5OZEQ.js} +2 -2
  204. package/dist/renderer/assets/view-api-B-2zPBR5.js +2 -0
  205. package/dist/renderer/assets/view-ids-BfaDVV5P.js +2 -0
  206. package/dist/renderer/assets/workbench-BLJ0wKsg.js +5 -0
  207. package/dist/renderer/assets/{workbenchSettings-CV4LVA9b.js → workbenchSettings-YD0Ctbm_.js} +3 -3
  208. package/dist/renderer/entries/device-picker/index.html +28 -0
  209. package/dist/renderer/entries/host-sidebar-default/index.html +6 -5
  210. package/dist/renderer/entries/main/index.html +16 -17
  211. package/dist/renderer/entries/popover/index.html +16 -10
  212. package/dist/renderer/entries/project-create-dialog/index.html +12 -12
  213. package/dist/renderer/entries/settings/index.html +10 -10
  214. package/dist/renderer/entries/tooltip/index.html +5 -5
  215. package/dist/renderer/entries/update-dialog/index.html +10 -10
  216. package/dist/renderer/entries/workbench/index.html +49 -0
  217. package/dist/renderer/entries/workbench-settings/index.html +12 -11
  218. package/dist/service-host/host-env-update.cjs +23 -0
  219. package/dist/service-host/preload.cjs +24 -49
  220. package/dist/service-host/service-message-queue.cjs +71 -0
  221. package/dist/service-host/sync-impls/system-info.js +31 -9
  222. package/dist/shared/compile-mode-state.d.ts +73 -0
  223. package/dist/shared/compile-mode-state.js +100 -0
  224. package/dist/shared/compile-modes.d.ts +152 -0
  225. package/dist/shared/compile-modes.js +237 -0
  226. package/dist/shared/ipc-channels-overlays.d.ts +8 -2
  227. package/dist/shared/ipc-channels-overlays.js +19 -2
  228. package/dist/shared/ipc-channels.d.ts +5 -10
  229. package/dist/shared/ipc-channels.js +17 -14
  230. package/dist/shared/ipc-schemas.d.ts +76 -24
  231. package/dist/shared/ipc-schemas.js +55 -10
  232. package/dist/shared/project-window-types.d.ts +42 -0
  233. package/dist/shared/project-window-types.js +2 -0
  234. package/dist/shared/types.d.ts +43 -17
  235. package/dist/shared/view-ids.d.ts +1 -0
  236. package/dist/shared/view-ids.js +3 -1
  237. package/dist/simulator/assets/bridge-channels-B3JAmRfl.js +2 -0
  238. package/dist/simulator/assets/device-shell-ATEhHV2_.css +1 -0
  239. package/dist/simulator/assets/device-shell-pxnZZp10.js +431 -0
  240. package/dist/simulator/assets/simulator-Dwp7lnvu.js +10 -0
  241. package/dist/simulator/assets/simulator-mini-app-DFo7fhi5.js +2 -0
  242. package/dist/simulator/assets/simulator-ui-B2ddJB1R.js +2 -0
  243. package/dist/simulator/simulator.html +3 -3
  244. package/dist/simulator/temp-files.d.ts +6 -0
  245. package/dist/simulator/temp-files.js +46 -4
  246. package/dist/simulator/types.d.ts +7 -0
  247. package/dist/vscode-workbench/assets/__vite-browser-external-JIkWewFf.js +1 -0
  248. package/dist/vscode-workbench/assets/{dist-CMfmHflW.js → dist-CXG-u1VB.js} +3 -3
  249. package/dist/vscode-workbench/assets/{iconv-lite-umd-Bx8CgaZq.js → iconv-lite-umd-Dxx9Qyb4.js} +1 -1
  250. package/dist/vscode-workbench/assets/{index-CdG6YWhW.js → index-6VJMsaWj.js} +460 -460
  251. package/dist/vscode-workbench/assets/{jschardet-M0qgd2lN.js → jschardet-Ba3D16vt.js} +1 -1
  252. package/dist/vscode-workbench/index.html +1 -1
  253. package/package.json +11 -8
  254. package/dist/renderer/assets/button-D5Q2wkXq.js +0 -2
  255. package/dist/renderer/assets/constants-D7DfVqMp.js +0 -2
  256. package/dist/renderer/assets/constants-D8zsejFq.js +0 -2
  257. package/dist/renderer/assets/dialog-e1TecTOY.js +0 -46
  258. package/dist/renderer/assets/hostSidebarDefault-B3yLfy8j.js +0 -2
  259. package/dist/renderer/assets/index-CsPD68N_.js +0 -5
  260. package/dist/renderer/assets/ipc-channels-overlays-LsDzGAtV.js +0 -2
  261. package/dist/renderer/assets/jsx-runtime-2vXHouwr.css +0 -1
  262. package/dist/renderer/assets/popover-Dix5cm_b.js +0 -2
  263. package/dist/renderer/assets/project-api-k7Oq9iaq.js +0 -2
  264. package/dist/renderer/assets/select-acGb0AmJ.js +0 -2
  265. package/dist/renderer/assets/settings-CQrTMr43.js +0 -2
  266. package/dist/renderer/assets/settings-api-CrUQ9rYV.js +0 -2
  267. package/dist/renderer/assets/settings-tab-bar-Cw1kVIf2.js +0 -2
  268. package/dist/renderer/assets/types-CsEKtFyr.js +0 -2
  269. package/dist/renderer/assets/updateDialog-NsF8223A.js +0 -2
  270. package/dist/renderer/assets/view-api-CLn3rcQE.js +0 -2
  271. package/dist/simulator/assets/bridge-channels-zhsumfky.js +0 -2
  272. package/dist/simulator/assets/device-shell-CmtM1QxP.js +0 -2
  273. package/dist/simulator/assets/device-shell-iFZo1igL.css +0 -1
  274. package/dist/simulator/assets/simulator-CIobn3Mh.js +0 -10
  275. package/dist/simulator/assets/simulator-mini-app-CRe6n9br.js +0 -2
  276. package/dist/simulator/assets/simulator-ui-C_cP602X.js +0 -2
  277. package/dist/vscode-workbench/assets/__vite-browser-external-Bc1vizTf.js +0 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../../../../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react.production.min.js", "../../../../../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react.development.js", "../../../../../node_modules/.pnpm/react@18.3.1/node_modules/react/index.js", "../../../../../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.production.min.js", "../../../../../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.development.js", "../../../../../node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js", "../../../src/preload/windows/main.ts", "../../../../dimina-electron-runtime/src/shared/bridge-channels.ts", "../../../src/preload/runtime/main-api-runner.ts", "../../../src/simulator/simulator-api-helpers.ts", "../../../src/simulator/simulator-api-storage.ts", "../../../src/simulator/simulator-api-device.ts", "../../../src/simulator/event-bridge.ts", "../../../../dimina-electron-runtime/src/shared/node-bindings.ts", "../../../../dimina-electron-runtime/src/shared/vpath.ts", "../../../src/simulator/temp-files.ts", "../../../src/simulator/simulator-api-fs.ts", "../../../src/simulator/simulator-api-media.ts", "../../../src/simulator/simulator-api-fsm.ts", "../../../../dimina-electron-runtime/src/shared/request-core.ts", "../../../src/simulator/simulator-api-network.ts", "../../../../dimina-electron-runtime/src/simulator-ui/miniapp-frame.tsx", "../../../../dimina-electron-runtime/src/simulator-ui/navigation-bar.tsx", "../../../../dimina-electron-runtime/src/simulator-ui/ui-overlay.tsx", "../../../../dimina-electron-runtime/src/simulator-ui/ui-overlay-bus.ts", "../../../src/simulator/simulator-api-ui.ts", "../../../src/simulator/simulator-api.ts"],
4
- "sourcesContent": ["/**\n * @license React\n * react.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var l=Symbol.for(\"react.element\"),n=Symbol.for(\"react.portal\"),p=Symbol.for(\"react.fragment\"),q=Symbol.for(\"react.strict_mode\"),r=Symbol.for(\"react.profiler\"),t=Symbol.for(\"react.provider\"),u=Symbol.for(\"react.context\"),v=Symbol.for(\"react.forward_ref\"),w=Symbol.for(\"react.suspense\"),x=Symbol.for(\"react.memo\"),y=Symbol.for(\"react.lazy\"),z=Symbol.iterator;function A(a){if(null===a||\"object\"!==typeof a)return null;a=z&&a[z]||a[\"@@iterator\"];return\"function\"===typeof a?a:null}\nvar B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,D={};function E(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}E.prototype.isReactComponent={};\nE.prototype.setState=function(a,b){if(\"object\"!==typeof a&&\"function\"!==typeof a&&null!=a)throw Error(\"setState(...): takes an object of state variables to update or a function which returns an object of state variables.\");this.updater.enqueueSetState(this,a,b,\"setState\")};E.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,\"forceUpdate\")};function F(){}F.prototype=E.prototype;function G(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}var H=G.prototype=new F;\nH.constructor=G;C(H,E.prototype);H.isPureReactComponent=!0;var I=Array.isArray,J=Object.prototype.hasOwnProperty,K={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};\nfunction M(a,b,e){var d,c={},k=null,h=null;if(null!=b)for(d in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(k=\"\"+b.key),b)J.call(b,d)&&!L.hasOwnProperty(d)&&(c[d]=b[d]);var g=arguments.length-2;if(1===g)c.children=e;else if(1<g){for(var f=Array(g),m=0;m<g;m++)f[m]=arguments[m+2];c.children=f}if(a&&a.defaultProps)for(d in g=a.defaultProps,g)void 0===c[d]&&(c[d]=g[d]);return{$$typeof:l,type:a,key:k,ref:h,props:c,_owner:K.current}}\nfunction N(a,b){return{$$typeof:l,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}}function O(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===l}function escape(a){var b={\"=\":\"=0\",\":\":\"=2\"};return\"$\"+a.replace(/[=:]/g,function(a){return b[a]})}var P=/\\/+/g;function Q(a,b){return\"object\"===typeof a&&null!==a&&null!=a.key?escape(\"\"+a.key):b.toString(36)}\nfunction R(a,b,e,d,c){var k=typeof a;if(\"undefined\"===k||\"boolean\"===k)a=null;var h=!1;if(null===a)h=!0;else switch(k){case \"string\":case \"number\":h=!0;break;case \"object\":switch(a.$$typeof){case l:case n:h=!0}}if(h)return h=a,c=c(h),a=\"\"===d?\".\"+Q(h,0):d,I(c)?(e=\"\",null!=a&&(e=a.replace(P,\"$&/\")+\"/\"),R(c,b,e,\"\",function(a){return a})):null!=c&&(O(c)&&(c=N(c,e+(!c.key||h&&h.key===c.key?\"\":(\"\"+c.key).replace(P,\"$&/\")+\"/\")+a)),b.push(c)),1;h=0;d=\"\"===d?\".\":d+\":\";if(I(a))for(var g=0;g<a.length;g++){k=\na[g];var f=d+Q(k,g);h+=R(k,b,e,f,c)}else if(f=A(a),\"function\"===typeof f)for(a=f.call(a),g=0;!(k=a.next()).done;)k=k.value,f=d+Q(k,g++),h+=R(k,b,e,f,c);else if(\"object\"===k)throw b=String(a),Error(\"Objects are not valid as a React child (found: \"+(\"[object Object]\"===b?\"object with keys {\"+Object.keys(a).join(\", \")+\"}\":b)+\"). If you meant to render a collection of children, use an array instead.\");return h}\nfunction S(a,b,e){if(null==a)return a;var d=[],c=0;R(a,d,\"\",\"\",function(a){return b.call(e,a,c++)});return d}function T(a){if(-1===a._status){var b=a._result;b=b();b.then(function(b){if(0===a._status||-1===a._status)a._status=1,a._result=b},function(b){if(0===a._status||-1===a._status)a._status=2,a._result=b});-1===a._status&&(a._status=0,a._result=b)}if(1===a._status)return a._result.default;throw a._result;}\nvar U={current:null},V={transition:null},W={ReactCurrentDispatcher:U,ReactCurrentBatchConfig:V,ReactCurrentOwner:K};function X(){throw Error(\"act(...) is not supported in production builds of React.\");}\nexports.Children={map:S,forEach:function(a,b,e){S(a,function(){b.apply(this,arguments)},e)},count:function(a){var b=0;S(a,function(){b++});return b},toArray:function(a){return S(a,function(a){return a})||[]},only:function(a){if(!O(a))throw Error(\"React.Children.only expected to receive a single React element child.\");return a}};exports.Component=E;exports.Fragment=p;exports.Profiler=r;exports.PureComponent=G;exports.StrictMode=q;exports.Suspense=w;\nexports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=W;exports.act=X;\nexports.cloneElement=function(a,b,e){if(null===a||void 0===a)throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \"+a+\".\");var d=C({},a.props),c=a.key,k=a.ref,h=a._owner;if(null!=b){void 0!==b.ref&&(k=b.ref,h=K.current);void 0!==b.key&&(c=\"\"+b.key);if(a.type&&a.type.defaultProps)var g=a.type.defaultProps;for(f in b)J.call(b,f)&&!L.hasOwnProperty(f)&&(d[f]=void 0===b[f]&&void 0!==g?g[f]:b[f])}var f=arguments.length-2;if(1===f)d.children=e;else if(1<f){g=Array(f);\nfor(var m=0;m<f;m++)g[m]=arguments[m+2];d.children=g}return{$$typeof:l,type:a.type,key:c,ref:k,props:d,_owner:h}};exports.createContext=function(a){a={$$typeof:u,_currentValue:a,_currentValue2:a,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};a.Provider={$$typeof:t,_context:a};return a.Consumer=a};exports.createElement=M;exports.createFactory=function(a){var b=M.bind(null,a);b.type=a;return b};exports.createRef=function(){return{current:null}};\nexports.forwardRef=function(a){return{$$typeof:v,render:a}};exports.isValidElement=O;exports.lazy=function(a){return{$$typeof:y,_payload:{_status:-1,_result:a},_init:T}};exports.memo=function(a,b){return{$$typeof:x,type:a,compare:void 0===b?null:b}};exports.startTransition=function(a){var b=V.transition;V.transition={};try{a()}finally{V.transition=b}};exports.unstable_act=X;exports.useCallback=function(a,b){return U.current.useCallback(a,b)};exports.useContext=function(a){return U.current.useContext(a)};\nexports.useDebugValue=function(){};exports.useDeferredValue=function(a){return U.current.useDeferredValue(a)};exports.useEffect=function(a,b){return U.current.useEffect(a,b)};exports.useId=function(){return U.current.useId()};exports.useImperativeHandle=function(a,b,e){return U.current.useImperativeHandle(a,b,e)};exports.useInsertionEffect=function(a,b){return U.current.useInsertionEffect(a,b)};exports.useLayoutEffect=function(a,b){return U.current.useLayoutEffect(a,b)};\nexports.useMemo=function(a,b){return U.current.useMemo(a,b)};exports.useReducer=function(a,b,e){return U.current.useReducer(a,b,e)};exports.useRef=function(a){return U.current.useRef(a)};exports.useState=function(a){return U.current.useState(a)};exports.useSyncExternalStore=function(a,b,e){return U.current.useSyncExternalStore(a,b,e)};exports.useTransition=function(){return U.current.useTransition()};exports.version=\"18.3.1\";\n", "/**\n * @license React\n * react.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n\n 'use strict';\n\n/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\nif (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===\n 'function'\n) {\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());\n}\n var ReactVersion = '18.3.1';\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\n/**\n * Keeps track of the current dispatcher.\n */\nvar ReactCurrentDispatcher = {\n /**\n * @internal\n * @type {ReactComponent}\n */\n current: null\n};\n\n/**\n * Keeps track of the current batch's configuration such as how long an update\n * should suspend for if it needs to.\n */\nvar ReactCurrentBatchConfig = {\n transition: null\n};\n\nvar ReactCurrentActQueue = {\n current: null,\n // Used to reproduce behavior of `batchedUpdates` in legacy mode.\n isBatchingLegacy: false,\n didScheduleLegacyUpdate: false\n};\n\n/**\n * Keeps track of the current owner.\n *\n * The current owner is the component who should own any components that are\n * currently being constructed.\n */\nvar ReactCurrentOwner = {\n /**\n * @internal\n * @type {ReactComponent}\n */\n current: null\n};\n\nvar ReactDebugCurrentFrame = {};\nvar currentExtraStackFrame = null;\nfunction setExtraStackFrame(stack) {\n {\n currentExtraStackFrame = stack;\n }\n}\n\n{\n ReactDebugCurrentFrame.setExtraStackFrame = function (stack) {\n {\n currentExtraStackFrame = stack;\n }\n }; // Stack implementation injected by the current renderer.\n\n\n ReactDebugCurrentFrame.getCurrentStack = null;\n\n ReactDebugCurrentFrame.getStackAddendum = function () {\n var stack = ''; // Add an extra top frame while an element is being validated\n\n if (currentExtraStackFrame) {\n stack += currentExtraStackFrame;\n } // Delegate to the injected renderer-specific implementation\n\n\n var impl = ReactDebugCurrentFrame.getCurrentStack;\n\n if (impl) {\n stack += impl() || '';\n }\n\n return stack;\n };\n}\n\n// -----------------------------------------------------------------------------\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\nvar enableCacheElement = false;\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n// stuff. Intended to enable React core members to more easily debug scheduling\n// issues in DEV builds.\n\nvar enableDebugTracing = false; // Track which Fiber(s) schedule render work.\n\nvar ReactSharedInternals = {\n ReactCurrentDispatcher: ReactCurrentDispatcher,\n ReactCurrentBatchConfig: ReactCurrentBatchConfig,\n ReactCurrentOwner: ReactCurrentOwner\n};\n\n{\n ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;\n ReactSharedInternals.ReactCurrentActQueue = ReactCurrentActQueue;\n}\n\n// by calls to these methods by a Babel plugin.\n//\n// In PROD (or in packages without access to React internals),\n// they are left as they are instead.\n\nfunction warn(format) {\n {\n {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n printWarning('warn', format, args);\n }\n }\n}\nfunction error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\nvar didWarnStateUpdateForUnmountedComponent = {};\n\nfunction warnNoop(publicInstance, callerName) {\n {\n var _constructor = publicInstance.constructor;\n var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';\n var warningKey = componentName + \".\" + callerName;\n\n if (didWarnStateUpdateForUnmountedComponent[warningKey]) {\n return;\n }\n\n error(\"Can't call %s on a component that is not yet mounted. \" + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName);\n\n didWarnStateUpdateForUnmountedComponent[warningKey] = true;\n }\n}\n/**\n * This is the abstract API for an update queue.\n */\n\n\nvar ReactNoopUpdateQueue = {\n /**\n * Checks whether or not this composite component is mounted.\n * @param {ReactClass} publicInstance The instance we want to test.\n * @return {boolean} True if mounted, false otherwise.\n * @protected\n * @final\n */\n isMounted: function (publicInstance) {\n return false;\n },\n\n /**\n * Forces an update. This should only be invoked when it is known with\n * certainty that we are **not** in a DOM transaction.\n *\n * You may want to call this when you know that some deeper aspect of the\n * component's state has changed but `setState` was not called.\n *\n * This will not invoke `shouldComponentUpdate`, but it will invoke\n * `componentWillUpdate` and `componentDidUpdate`.\n *\n * @param {ReactClass} publicInstance The instance that should rerender.\n * @param {?function} callback Called after component is updated.\n * @param {?string} callerName name of the calling function in the public API.\n * @internal\n */\n enqueueForceUpdate: function (publicInstance, callback, callerName) {\n warnNoop(publicInstance, 'forceUpdate');\n },\n\n /**\n * Replaces all of the state. Always use this or `setState` to mutate state.\n * You should treat `this.state` as immutable.\n *\n * There is no guarantee that `this.state` will be immediately updated, so\n * accessing `this.state` after calling this method may return the old value.\n *\n * @param {ReactClass} publicInstance The instance that should rerender.\n * @param {object} completeState Next state.\n * @param {?function} callback Called after component is updated.\n * @param {?string} callerName name of the calling function in the public API.\n * @internal\n */\n enqueueReplaceState: function (publicInstance, completeState, callback, callerName) {\n warnNoop(publicInstance, 'replaceState');\n },\n\n /**\n * Sets a subset of the state. This only exists because _pendingState is\n * internal. This provides a merging strategy that is not available to deep\n * properties which is confusing. TODO: Expose pendingState or don't use it\n * during the merge.\n *\n * @param {ReactClass} publicInstance The instance that should rerender.\n * @param {object} partialState Next partial state to be merged with state.\n * @param {?function} callback Called after component is updated.\n * @param {?string} Name of the calling function in the public API.\n * @internal\n */\n enqueueSetState: function (publicInstance, partialState, callback, callerName) {\n warnNoop(publicInstance, 'setState');\n }\n};\n\nvar assign = Object.assign;\n\nvar emptyObject = {};\n\n{\n Object.freeze(emptyObject);\n}\n/**\n * Base class helpers for the updating state of a component.\n */\n\n\nfunction Component(props, context, updater) {\n this.props = props;\n this.context = context; // If a component has string refs, we will assign a different object later.\n\n this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the\n // renderer.\n\n this.updater = updater || ReactNoopUpdateQueue;\n}\n\nComponent.prototype.isReactComponent = {};\n/**\n * Sets a subset of the state. Always use this to mutate\n * state. You should treat `this.state` as immutable.\n *\n * There is no guarantee that `this.state` will be immediately updated, so\n * accessing `this.state` after calling this method may return the old value.\n *\n * There is no guarantee that calls to `setState` will run synchronously,\n * as they may eventually be batched together. You can provide an optional\n * callback that will be executed when the call to setState is actually\n * completed.\n *\n * When a function is provided to setState, it will be called at some point in\n * the future (not synchronously). It will be called with the up to date\n * component arguments (state, props, context). These values can be different\n * from this.* because your function may be called after receiveProps but before\n * shouldComponentUpdate, and this new state, props, and context will not yet be\n * assigned to this.\n *\n * @param {object|function} partialState Next partial state or function to\n * produce next partial state to be merged with current state.\n * @param {?function} callback Called after state is updated.\n * @final\n * @protected\n */\n\nComponent.prototype.setState = function (partialState, callback) {\n if (typeof partialState !== 'object' && typeof partialState !== 'function' && partialState != null) {\n throw new Error('setState(...): takes an object of state variables to update or a ' + 'function which returns an object of state variables.');\n }\n\n this.updater.enqueueSetState(this, partialState, callback, 'setState');\n};\n/**\n * Forces an update. This should only be invoked when it is known with\n * certainty that we are **not** in a DOM transaction.\n *\n * You may want to call this when you know that some deeper aspect of the\n * component's state has changed but `setState` was not called.\n *\n * This will not invoke `shouldComponentUpdate`, but it will invoke\n * `componentWillUpdate` and `componentDidUpdate`.\n *\n * @param {?function} callback Called after update is complete.\n * @final\n * @protected\n */\n\n\nComponent.prototype.forceUpdate = function (callback) {\n this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');\n};\n/**\n * Deprecated APIs. These APIs used to exist on classic React classes but since\n * we would like to deprecate them, we're not going to move them over to this\n * modern base class. Instead, we define a getter that warns if it's accessed.\n */\n\n\n{\n var deprecatedAPIs = {\n isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],\n replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']\n };\n\n var defineDeprecationWarning = function (methodName, info) {\n Object.defineProperty(Component.prototype, methodName, {\n get: function () {\n warn('%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);\n\n return undefined;\n }\n });\n };\n\n for (var fnName in deprecatedAPIs) {\n if (deprecatedAPIs.hasOwnProperty(fnName)) {\n defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);\n }\n }\n}\n\nfunction ComponentDummy() {}\n\nComponentDummy.prototype = Component.prototype;\n/**\n * Convenience component with default shallow equality check for sCU.\n */\n\nfunction PureComponent(props, context, updater) {\n this.props = props;\n this.context = context; // If a component has string refs, we will assign a different object later.\n\n this.refs = emptyObject;\n this.updater = updater || ReactNoopUpdateQueue;\n}\n\nvar pureComponentPrototype = PureComponent.prototype = new ComponentDummy();\npureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods.\n\nassign(pureComponentPrototype, Component.prototype);\npureComponentPrototype.isPureReactComponent = true;\n\n// an immutable object with a single mutable value\nfunction createRef() {\n var refObject = {\n current: null\n };\n\n {\n Object.seal(refObject);\n }\n\n return refObject;\n}\n\nvar isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare\n\nfunction isArray(a) {\n return isArrayImpl(a);\n}\n\n/*\n * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol\n * and Temporal.* types. See https://github.com/facebook/react/pull/22064.\n *\n * The functions in this module will throw an easier-to-understand,\n * easier-to-debug exception with a clear errors message message explaining the\n * problem. (Instead of a confusing exception thrown inside the implementation\n * of the `value` object).\n */\n// $FlowFixMe only called in DEV, so void return is not possible.\nfunction typeName(value) {\n {\n // toStringTag is needed for namespaced types like Temporal.Instant\n var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;\n var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';\n return type;\n }\n} // $FlowFixMe only called in DEV, so void return is not possible.\n\n\nfunction willCoercionThrow(value) {\n {\n try {\n testStringCoercion(value);\n return false;\n } catch (e) {\n return true;\n }\n }\n}\n\nfunction testStringCoercion(value) {\n // If you ended up here by following an exception call stack, here's what's\n // happened: you supplied an object or symbol value to React (as a prop, key,\n // DOM attribute, CSS property, string ref, etc.) and when React tried to\n // coerce it to a string using `'' + value`, an exception was thrown.\n //\n // The most common types that will cause this exception are `Symbol` instances\n // and Temporal objects like `Temporal.Instant`. But any object that has a\n // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this\n // exception. (Library authors do this to prevent users from using built-in\n // numeric operators like `+` or comparison operators like `>=` because custom\n // methods are needed to perform accurate arithmetic or comparison.)\n //\n // To fix the problem, coerce this object or symbol value to a string before\n // passing it to React. The most reliable way is usually `String(value)`.\n //\n // To find which value is throwing, check the browser or debugger console.\n // Before this exception was thrown, there should be `console.error` output\n // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the\n // problem and how that type was used: key, atrribute, input value prop, etc.\n // In most cases, this console output also shows the component and its\n // ancestor components where the exception happened.\n //\n // eslint-disable-next-line react-internal/safe-string-coercion\n return '' + value;\n}\nfunction checkKeyStringCoercion(value) {\n {\n if (willCoercionThrow(value)) {\n error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));\n\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var displayName = outerType.displayName;\n\n if (displayName) {\n return displayName;\n }\n\n var functionName = innerType.displayName || innerType.name || '';\n return functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName;\n} // Keep in sync with react-reconciler/getComponentNameFromFiber\n\n\nfunction getContextName(type) {\n return type.displayName || 'Context';\n} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.\n\n\nfunction getComponentNameFromType(type) {\n if (type == null) {\n // Host root, text node or just invalid type.\n return null;\n }\n\n {\n if (typeof type.tag === 'number') {\n error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return 'Fragment';\n\n case REACT_PORTAL_TYPE:\n return 'Portal';\n\n case REACT_PROFILER_TYPE:\n return 'Profiler';\n\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList';\n\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_CONTEXT_TYPE:\n var context = type;\n return getContextName(context) + '.Consumer';\n\n case REACT_PROVIDER_TYPE:\n var provider = type;\n return getContextName(provider._context) + '.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n var outerName = type.displayName || null;\n\n if (outerName !== null) {\n return outerName;\n }\n\n return getComponentNameFromType(type.type) || 'Memo';\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n return getComponentNameFromType(init(payload));\n } catch (x) {\n return null;\n }\n }\n\n // eslint-disable-next-line no-fallthrough\n }\n }\n\n return null;\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar RESERVED_PROPS = {\n key: true,\n ref: true,\n __self: true,\n __source: true\n};\nvar specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs;\n\n{\n didWarnAboutStringRefs = {};\n}\n\nfunction hasValidRef(config) {\n {\n if (hasOwnProperty.call(config, 'ref')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.ref !== undefined;\n}\n\nfunction hasValidKey(config) {\n {\n if (hasOwnProperty.call(config, 'key')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'key').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.key !== undefined;\n}\n\nfunction defineKeyPropWarningGetter(props, displayName) {\n var warnAboutAccessingKey = function () {\n {\n if (!specialPropKeyWarningShown) {\n specialPropKeyWarningShown = true;\n\n error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n }\n };\n\n warnAboutAccessingKey.isReactWarning = true;\n Object.defineProperty(props, 'key', {\n get: warnAboutAccessingKey,\n configurable: true\n });\n}\n\nfunction defineRefPropWarningGetter(props, displayName) {\n var warnAboutAccessingRef = function () {\n {\n if (!specialPropRefWarningShown) {\n specialPropRefWarningShown = true;\n\n error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n }\n };\n\n warnAboutAccessingRef.isReactWarning = true;\n Object.defineProperty(props, 'ref', {\n get: warnAboutAccessingRef,\n configurable: true\n });\n}\n\nfunction warnIfStringRefCannotBeAutoConverted(config) {\n {\n if (typeof config.ref === 'string' && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) {\n var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n if (!didWarnAboutStringRefs[componentName]) {\n error('Component \"%s\" contains the string ref \"%s\". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', componentName, config.ref);\n\n didWarnAboutStringRefs[componentName] = true;\n }\n }\n }\n}\n/**\n * Factory method to create a new React element. This no longer adheres to\n * the class pattern, so do not use new to call it. Also, instanceof check\n * will not work. Instead test $$typeof field against Symbol.for('react.element') to check\n * if something is a React Element.\n *\n * @param {*} type\n * @param {*} props\n * @param {*} key\n * @param {string|object} ref\n * @param {*} owner\n * @param {*} self A *temporary* helper to detect places where `this` is\n * different from the `owner` when React.createElement is called, so that we\n * can warn. We want to get rid of owner and replace string `ref`s with arrow\n * functions, and as long as `this` and owner are the same, there will be no\n * change in behavior.\n * @param {*} source An annotation object (added by a transpiler or otherwise)\n * indicating filename, line number, and/or other information.\n * @internal\n */\n\n\nvar ReactElement = function (type, key, ref, self, source, owner, props) {\n var element = {\n // This tag allows us to uniquely identify this as a React Element\n $$typeof: REACT_ELEMENT_TYPE,\n // Built-in properties that belong on the element\n type: type,\n key: key,\n ref: ref,\n props: props,\n // Record the component responsible for creating this element.\n _owner: owner\n };\n\n {\n // The validation flag is currently mutative. We put it on\n // an external backing store so that we can freeze the whole object.\n // This can be replaced with a WeakMap once they are implemented in\n // commonly used development environments.\n element._store = {}; // To make comparing ReactElements easier for testing purposes, we make\n // the validation flag non-enumerable (where possible, which should\n // include every environment we run tests in), so the test framework\n // ignores it.\n\n Object.defineProperty(element._store, 'validated', {\n configurable: false,\n enumerable: false,\n writable: true,\n value: false\n }); // self and source are DEV only properties.\n\n Object.defineProperty(element, '_self', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: self\n }); // Two elements created in two different places should be considered\n // equal for testing purposes and therefore we hide it from enumeration.\n\n Object.defineProperty(element, '_source', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: source\n });\n\n if (Object.freeze) {\n Object.freeze(element.props);\n Object.freeze(element);\n }\n }\n\n return element;\n};\n/**\n * Create and return a new ReactElement of the given type.\n * See https://reactjs.org/docs/react-api.html#createelement\n */\n\nfunction createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}\nfunction cloneAndReplaceKey(oldElement, newKey) {\n var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);\n return newElement;\n}\n/**\n * Clone and return a new ReactElement using element as the starting point.\n * See https://reactjs.org/docs/react-api.html#cloneelement\n */\n\nfunction cloneElement(element, config, children) {\n if (element === null || element === undefined) {\n throw new Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n\n var propName; // Original props are copied\n\n var props = assign({}, element.props); // Reserved names are extracted\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}\n/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a ReactElement.\n * @final\n */\n\nfunction isValidElement(object) {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n}\n\nvar SEPARATOR = '.';\nvar SUBSEPARATOR = ':';\n/**\n * Escape and wrap key so it is safe to use as a reactid\n *\n * @param {string} key to be escaped.\n * @return {string} the escaped key.\n */\n\nfunction escape(key) {\n var escapeRegex = /[=:]/g;\n var escaperLookup = {\n '=': '=0',\n ':': '=2'\n };\n var escapedString = key.replace(escapeRegex, function (match) {\n return escaperLookup[match];\n });\n return '$' + escapedString;\n}\n/**\n * TODO: Test that a single child and an array with one item have the same key\n * pattern.\n */\n\n\nvar didWarnAboutMaps = false;\nvar userProvidedKeyEscapeRegex = /\\/+/g;\n\nfunction escapeUserProvidedKey(text) {\n return text.replace(userProvidedKeyEscapeRegex, '$&/');\n}\n/**\n * Generate a key string that identifies a element within a set.\n *\n * @param {*} element A element that could contain a manual key.\n * @param {number} index Index that is used if a manual key is not provided.\n * @return {string}\n */\n\n\nfunction getElementKey(element, index) {\n // Do some typechecking here since we call this blindly. We want to ensure\n // that we don't block potential future ES APIs.\n if (typeof element === 'object' && element !== null && element.key != null) {\n // Explicit key\n {\n checkKeyStringCoercion(element.key);\n }\n\n return escape('' + element.key);\n } // Implicit key determined by the index in the set\n\n\n return index.toString(36);\n}\n\nfunction mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {\n var type = typeof children;\n\n if (type === 'undefined' || type === 'boolean') {\n // All of the above are perceived as null.\n children = null;\n }\n\n var invokeCallback = false;\n\n if (children === null) {\n invokeCallback = true;\n } else {\n switch (type) {\n case 'string':\n case 'number':\n invokeCallback = true;\n break;\n\n case 'object':\n switch (children.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n invokeCallback = true;\n }\n\n }\n }\n\n if (invokeCallback) {\n var _child = children;\n var mappedChild = callback(_child); // If it's the only child, treat the name as if it was wrapped in an array\n // so that it's consistent if the number of children grows:\n\n var childKey = nameSoFar === '' ? SEPARATOR + getElementKey(_child, 0) : nameSoFar;\n\n if (isArray(mappedChild)) {\n var escapedChildKey = '';\n\n if (childKey != null) {\n escapedChildKey = escapeUserProvidedKey(childKey) + '/';\n }\n\n mapIntoArray(mappedChild, array, escapedChildKey, '', function (c) {\n return c;\n });\n } else if (mappedChild != null) {\n if (isValidElement(mappedChild)) {\n {\n // The `if` statement here prevents auto-disabling of the safe\n // coercion ESLint rule, so we must manually disable it below.\n // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key\n if (mappedChild.key && (!_child || _child.key !== mappedChild.key)) {\n checkKeyStringCoercion(mappedChild.key);\n }\n }\n\n mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as\n // traverseAllChildren used to do for objects as children\n escapedPrefix + ( // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key\n mappedChild.key && (!_child || _child.key !== mappedChild.key) ? // $FlowFixMe Flow incorrectly thinks existing element's key can be a number\n // eslint-disable-next-line react-internal/safe-string-coercion\n escapeUserProvidedKey('' + mappedChild.key) + '/' : '') + childKey);\n }\n\n array.push(mappedChild);\n }\n\n return 1;\n }\n\n var child;\n var nextName;\n var subtreeCount = 0; // Count of children found in the current subtree.\n\n var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;\n\n if (isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n child = children[i];\n nextName = nextNamePrefix + getElementKey(child, i);\n subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);\n }\n } else {\n var iteratorFn = getIteratorFn(children);\n\n if (typeof iteratorFn === 'function') {\n var iterableChildren = children;\n\n {\n // Warn about using Maps as children\n if (iteratorFn === iterableChildren.entries) {\n if (!didWarnAboutMaps) {\n warn('Using Maps as children is not supported. ' + 'Use an array of keyed ReactElements instead.');\n }\n\n didWarnAboutMaps = true;\n }\n }\n\n var iterator = iteratorFn.call(iterableChildren);\n var step;\n var ii = 0;\n\n while (!(step = iterator.next()).done) {\n child = step.value;\n nextName = nextNamePrefix + getElementKey(child, ii++);\n subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);\n }\n } else if (type === 'object') {\n // eslint-disable-next-line react-internal/safe-string-coercion\n var childrenString = String(children);\n throw new Error(\"Objects are not valid as a React child (found: \" + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + \"). \" + 'If you meant to render a collection of children, use an array ' + 'instead.');\n }\n }\n\n return subtreeCount;\n}\n\n/**\n * Maps children that are typically specified as `props.children`.\n *\n * See https://reactjs.org/docs/react-api.html#reactchildrenmap\n *\n * The provided mapFunction(child, index) will be called for each\n * leaf child.\n *\n * @param {?*} children Children tree container.\n * @param {function(*, int)} func The map function.\n * @param {*} context Context for mapFunction.\n * @return {object} Object containing the ordered map of results.\n */\nfunction mapChildren(children, func, context) {\n if (children == null) {\n return children;\n }\n\n var result = [];\n var count = 0;\n mapIntoArray(children, result, '', '', function (child) {\n return func.call(context, child, count++);\n });\n return result;\n}\n/**\n * Count the number of children that are typically specified as\n * `props.children`.\n *\n * See https://reactjs.org/docs/react-api.html#reactchildrencount\n *\n * @param {?*} children Children tree container.\n * @return {number} The number of children.\n */\n\n\nfunction countChildren(children) {\n var n = 0;\n mapChildren(children, function () {\n n++; // Don't return anything\n });\n return n;\n}\n\n/**\n * Iterates through children that are typically specified as `props.children`.\n *\n * See https://reactjs.org/docs/react-api.html#reactchildrenforeach\n *\n * The provided forEachFunc(child, index) will be called for each\n * leaf child.\n *\n * @param {?*} children Children tree container.\n * @param {function(*, int)} forEachFunc\n * @param {*} forEachContext Context for forEachContext.\n */\nfunction forEachChildren(children, forEachFunc, forEachContext) {\n mapChildren(children, function () {\n forEachFunc.apply(this, arguments); // Don't return anything.\n }, forEachContext);\n}\n/**\n * Flatten a children object (typically specified as `props.children`) and\n * return an array with appropriately re-keyed children.\n *\n * See https://reactjs.org/docs/react-api.html#reactchildrentoarray\n */\n\n\nfunction toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}\n/**\n * Returns the first child in a collection of children and verifies that there\n * is only one child in the collection.\n *\n * See https://reactjs.org/docs/react-api.html#reactchildrenonly\n *\n * The current implementation of this function assumes that a single child gets\n * passed without a wrapper, but the purpose of this helper function is to\n * abstract away the particular structure of children.\n *\n * @param {?object} children Child collection structure.\n * @return {ReactElement} The first and only `ReactElement` contained in the\n * structure.\n */\n\n\nfunction onlyChild(children) {\n if (!isValidElement(children)) {\n throw new Error('React.Children.only expected to receive a single React element child.');\n }\n\n return children;\n}\n\nfunction createContext(defaultValue) {\n // TODO: Second argument used to be an optional `calculateChangedBits`\n // function. Warn to reserve for future use?\n var context = {\n $$typeof: REACT_CONTEXT_TYPE,\n // As a workaround to support multiple concurrent renderers, we categorize\n // some renderers as primary and others as secondary. We only expect\n // there to be two concurrent renderers at most: React Native (primary) and\n // Fabric (secondary); React DOM (primary) and React ART (secondary).\n // Secondary renderers store their context values on separate fields.\n _currentValue: defaultValue,\n _currentValue2: defaultValue,\n // Used to track how many concurrent renderers this context currently\n // supports within in a single renderer. Such as parallel server rendering.\n _threadCount: 0,\n // These are circular\n Provider: null,\n Consumer: null,\n // Add these to use same hidden class in VM as ServerContext\n _defaultValue: null,\n _globalName: null\n };\n context.Provider = {\n $$typeof: REACT_PROVIDER_TYPE,\n _context: context\n };\n var hasWarnedAboutUsingNestedContextConsumers = false;\n var hasWarnedAboutUsingConsumerProvider = false;\n var hasWarnedAboutDisplayNameOnConsumer = false;\n\n {\n // A separate object, but proxies back to the original context object for\n // backwards compatibility. It has a different $$typeof, so we can properly\n // warn for the incorrect usage of Context as a Consumer.\n var Consumer = {\n $$typeof: REACT_CONTEXT_TYPE,\n _context: context\n }; // $FlowFixMe: Flow complains about not setting a value, which is intentional here\n\n Object.defineProperties(Consumer, {\n Provider: {\n get: function () {\n if (!hasWarnedAboutUsingConsumerProvider) {\n hasWarnedAboutUsingConsumerProvider = true;\n\n error('Rendering <Context.Consumer.Provider> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Provider> instead?');\n }\n\n return context.Provider;\n },\n set: function (_Provider) {\n context.Provider = _Provider;\n }\n },\n _currentValue: {\n get: function () {\n return context._currentValue;\n },\n set: function (_currentValue) {\n context._currentValue = _currentValue;\n }\n },\n _currentValue2: {\n get: function () {\n return context._currentValue2;\n },\n set: function (_currentValue2) {\n context._currentValue2 = _currentValue2;\n }\n },\n _threadCount: {\n get: function () {\n return context._threadCount;\n },\n set: function (_threadCount) {\n context._threadCount = _threadCount;\n }\n },\n Consumer: {\n get: function () {\n if (!hasWarnedAboutUsingNestedContextConsumers) {\n hasWarnedAboutUsingNestedContextConsumers = true;\n\n error('Rendering <Context.Consumer.Consumer> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');\n }\n\n return context.Consumer;\n }\n },\n displayName: {\n get: function () {\n return context.displayName;\n },\n set: function (displayName) {\n if (!hasWarnedAboutDisplayNameOnConsumer) {\n warn('Setting `displayName` on Context.Consumer has no effect. ' + \"You should set it directly on the context with Context.displayName = '%s'.\", displayName);\n\n hasWarnedAboutDisplayNameOnConsumer = true;\n }\n }\n }\n }); // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty\n\n context.Consumer = Consumer;\n }\n\n {\n context._currentRenderer = null;\n context._currentRenderer2 = null;\n }\n\n return context;\n}\n\nvar Uninitialized = -1;\nvar Pending = 0;\nvar Resolved = 1;\nvar Rejected = 2;\n\nfunction lazyInitializer(payload) {\n if (payload._status === Uninitialized) {\n var ctor = payload._result;\n var thenable = ctor(); // Transition to the next state.\n // This might throw either because it's missing or throws. If so, we treat it\n // as still uninitialized and try again next time. Which is the same as what\n // happens if the ctor or any wrappers processing the ctor throws. This might\n // end up fixing it if the resolution was a concurrency bug.\n\n thenable.then(function (moduleObject) {\n if (payload._status === Pending || payload._status === Uninitialized) {\n // Transition to the next state.\n var resolved = payload;\n resolved._status = Resolved;\n resolved._result = moduleObject;\n }\n }, function (error) {\n if (payload._status === Pending || payload._status === Uninitialized) {\n // Transition to the next state.\n var rejected = payload;\n rejected._status = Rejected;\n rejected._result = error;\n }\n });\n\n if (payload._status === Uninitialized) {\n // In case, we're still uninitialized, then we're waiting for the thenable\n // to resolve. Set it as pending in the meantime.\n var pending = payload;\n pending._status = Pending;\n pending._result = thenable;\n }\n }\n\n if (payload._status === Resolved) {\n var moduleObject = payload._result;\n\n {\n if (moduleObject === undefined) {\n error('lazy: Expected the result of a dynamic imp' + 'ort() call. ' + 'Instead received: %s\\n\\nYour code should look like: \\n ' + // Break up imports to avoid accidentally parsing them as dependencies.\n 'const MyComponent = lazy(() => imp' + \"ort('./MyComponent'))\\n\\n\" + 'Did you accidentally put curly braces around the import?', moduleObject);\n }\n }\n\n {\n if (!('default' in moduleObject)) {\n error('lazy: Expected the result of a dynamic imp' + 'ort() call. ' + 'Instead received: %s\\n\\nYour code should look like: \\n ' + // Break up imports to avoid accidentally parsing them as dependencies.\n 'const MyComponent = lazy(() => imp' + \"ort('./MyComponent'))\", moduleObject);\n }\n }\n\n return moduleObject.default;\n } else {\n throw payload._result;\n }\n}\n\nfunction lazy(ctor) {\n var payload = {\n // We use these fields to store the result.\n _status: Uninitialized,\n _result: ctor\n };\n var lazyType = {\n $$typeof: REACT_LAZY_TYPE,\n _payload: payload,\n _init: lazyInitializer\n };\n\n {\n // In production, this would just set it on the object.\n var defaultProps;\n var propTypes; // $FlowFixMe\n\n Object.defineProperties(lazyType, {\n defaultProps: {\n configurable: true,\n get: function () {\n return defaultProps;\n },\n set: function (newDefaultProps) {\n error('React.lazy(...): It is not supported to assign `defaultProps` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');\n\n defaultProps = newDefaultProps; // Match production behavior more closely:\n // $FlowFixMe\n\n Object.defineProperty(lazyType, 'defaultProps', {\n enumerable: true\n });\n }\n },\n propTypes: {\n configurable: true,\n get: function () {\n return propTypes;\n },\n set: function (newPropTypes) {\n error('React.lazy(...): It is not supported to assign `propTypes` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');\n\n propTypes = newPropTypes; // Match production behavior more closely:\n // $FlowFixMe\n\n Object.defineProperty(lazyType, 'propTypes', {\n enumerable: true\n });\n }\n }\n });\n }\n\n return lazyType;\n}\n\nfunction forwardRef(render) {\n {\n if (render != null && render.$$typeof === REACT_MEMO_TYPE) {\n error('forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).');\n } else if (typeof render !== 'function') {\n error('forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);\n } else {\n if (render.length !== 0 && render.length !== 2) {\n error('forwardRef render functions accept exactly two parameters: props and ref. %s', render.length === 1 ? 'Did you forget to use the ref parameter?' : 'Any additional parameter will be undefined.');\n }\n }\n\n if (render != null) {\n if (render.defaultProps != null || render.propTypes != null) {\n error('forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?');\n }\n }\n }\n\n var elementType = {\n $$typeof: REACT_FORWARD_REF_TYPE,\n render: render\n };\n\n {\n var ownName;\n Object.defineProperty(elementType, 'displayName', {\n enumerable: false,\n configurable: true,\n get: function () {\n return ownName;\n },\n set: function (name) {\n ownName = name; // The inner component shouldn't inherit this display name in most cases,\n // because the component may be used elsewhere.\n // But it's nice for anonymous functions to inherit the name,\n // so that our component-stack generation logic will display their frames.\n // An anonymous function generally suggests a pattern like:\n // React.forwardRef((props, ref) => {...});\n // This kind of inner function is not used elsewhere so the side effect is okay.\n\n if (!render.name && !render.displayName) {\n render.displayName = name;\n }\n }\n });\n }\n\n return elementType;\n}\n\nvar REACT_MODULE_REFERENCE;\n\n{\n REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');\n}\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n return true;\n } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\n\n\n if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {\n return true;\n }\n\n if (typeof type === 'object' && type !== null) {\n if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object\n // types supported by any Flight configuration anywhere since\n // we don't know which Flight build this will end up being used\n // with.\n type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction memo(type, compare) {\n {\n if (!isValidElementType(type)) {\n error('memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);\n }\n }\n\n var elementType = {\n $$typeof: REACT_MEMO_TYPE,\n type: type,\n compare: compare === undefined ? null : compare\n };\n\n {\n var ownName;\n Object.defineProperty(elementType, 'displayName', {\n enumerable: false,\n configurable: true,\n get: function () {\n return ownName;\n },\n set: function (name) {\n ownName = name; // The inner component shouldn't inherit this display name in most cases,\n // because the component may be used elsewhere.\n // But it's nice for anonymous functions to inherit the name,\n // so that our component-stack generation logic will display their frames.\n // An anonymous function generally suggests a pattern like:\n // React.memo((props) => {...});\n // This kind of inner function is not used elsewhere so the side effect is okay.\n\n if (!type.name && !type.displayName) {\n type.displayName = name;\n }\n }\n });\n }\n\n return elementType;\n}\n\nfunction resolveDispatcher() {\n var dispatcher = ReactCurrentDispatcher.current;\n\n {\n if (dispatcher === null) {\n error('Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for' + ' one of the following reasons:\\n' + '1. You might have mismatching versions of React and the renderer (such as React DOM)\\n' + '2. You might be breaking the Rules of Hooks\\n' + '3. You might have more than one copy of React in the same app\\n' + 'See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.');\n }\n } // Will result in a null access error if accessed outside render phase. We\n // intentionally don't throw our own error because this is in a hot path.\n // Also helps ensure this is inlined.\n\n\n return dispatcher;\n}\nfunction useContext(Context) {\n var dispatcher = resolveDispatcher();\n\n {\n // TODO: add a more generic warning for invalid values.\n if (Context._context !== undefined) {\n var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs\n // and nobody should be using this in existing code.\n\n if (realContext.Consumer === Context) {\n error('Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be ' + 'removed in a future major release. Did you mean to call useContext(Context) instead?');\n } else if (realContext.Provider === Context) {\n error('Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?');\n }\n }\n }\n\n return dispatcher.useContext(Context);\n}\nfunction useState(initialState) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useState(initialState);\n}\nfunction useReducer(reducer, initialArg, init) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useReducer(reducer, initialArg, init);\n}\nfunction useRef(initialValue) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useRef(initialValue);\n}\nfunction useEffect(create, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useEffect(create, deps);\n}\nfunction useInsertionEffect(create, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useInsertionEffect(create, deps);\n}\nfunction useLayoutEffect(create, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useLayoutEffect(create, deps);\n}\nfunction useCallback(callback, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useCallback(callback, deps);\n}\nfunction useMemo(create, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useMemo(create, deps);\n}\nfunction useImperativeHandle(ref, create, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useImperativeHandle(ref, create, deps);\n}\nfunction useDebugValue(value, formatterFn) {\n {\n var dispatcher = resolveDispatcher();\n return dispatcher.useDebugValue(value, formatterFn);\n }\n}\nfunction useTransition() {\n var dispatcher = resolveDispatcher();\n return dispatcher.useTransition();\n}\nfunction useDeferredValue(value) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useDeferredValue(value);\n}\nfunction useId() {\n var dispatcher = resolveDispatcher();\n return dispatcher.useId();\n}\nfunction useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\n}\n\n// Helpers to patch console.logs to avoid logging during side-effect free\n// replaying on render function. This currently only patches the object\n// lazily which won't cover if the log function was extracted eagerly.\n// We could also eagerly patch the method.\nvar disabledDepth = 0;\nvar prevLog;\nvar prevInfo;\nvar prevWarn;\nvar prevError;\nvar prevGroup;\nvar prevGroupCollapsed;\nvar prevGroupEnd;\n\nfunction disabledLog() {}\n\ndisabledLog.__reactDisabledLog = true;\nfunction disableLogs() {\n {\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n prevLog = console.log;\n prevInfo = console.info;\n prevWarn = console.warn;\n prevError = console.error;\n prevGroup = console.group;\n prevGroupCollapsed = console.groupCollapsed;\n prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099\n\n var props = {\n configurable: true,\n enumerable: true,\n value: disabledLog,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n info: props,\n log: props,\n warn: props,\n error: props,\n group: props,\n groupCollapsed: props,\n groupEnd: props\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n disabledDepth++;\n }\n}\nfunction reenableLogs() {\n {\n disabledDepth--;\n\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n var props = {\n configurable: true,\n enumerable: true,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n log: assign({}, props, {\n value: prevLog\n }),\n info: assign({}, props, {\n value: prevInfo\n }),\n warn: assign({}, props, {\n value: prevWarn\n }),\n error: assign({}, props, {\n value: prevError\n }),\n group: assign({}, props, {\n value: prevGroup\n }),\n groupCollapsed: assign({}, props, {\n value: prevGroupCollapsed\n }),\n groupEnd: assign({}, props, {\n value: prevGroupEnd\n })\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n if (disabledDepth < 0) {\n error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');\n }\n }\n}\n\nvar ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;\nvar prefix;\nfunction describeBuiltInComponentFrame(name, source, ownerFn) {\n {\n if (prefix === undefined) {\n // Extract the VM specific prefix used by each line.\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(/\\n( *(at )?)/);\n prefix = match && match[1] || '';\n }\n } // We use the prefix to ensure our stacks line up with native stack frames.\n\n\n return '\\n' + prefix + name;\n }\n}\nvar reentry = false;\nvar componentFrameCache;\n\n{\n var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\n componentFrameCache = new PossiblyWeakMap();\n}\n\nfunction describeNativeComponentFrame(fn, construct) {\n // If something asked for a stack inside a fake render, it should get ignored.\n if ( !fn || reentry) {\n return '';\n }\n\n {\n var frame = componentFrameCache.get(fn);\n\n if (frame !== undefined) {\n return frame;\n }\n }\n\n var control;\n reentry = true;\n var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.\n\n Error.prepareStackTrace = undefined;\n var previousDispatcher;\n\n {\n previousDispatcher = ReactCurrentDispatcher$1.current; // Set the dispatcher in DEV because this might be call in the render function\n // for warnings.\n\n ReactCurrentDispatcher$1.current = null;\n disableLogs();\n }\n\n try {\n // This should throw.\n if (construct) {\n // Something should be setting the props in the constructor.\n var Fake = function () {\n throw Error();\n }; // $FlowFixMe\n\n\n Object.defineProperty(Fake.prototype, 'props', {\n set: function () {\n // We use a throwing setter instead of frozen or non-writable props\n // because that won't throw in a non-strict mode function.\n throw Error();\n }\n });\n\n if (typeof Reflect === 'object' && Reflect.construct) {\n // We construct a different control for this case to include any extra\n // frames added by the construct call.\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n control = x;\n }\n\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x) {\n control = x;\n }\n\n fn.call(Fake.prototype);\n }\n } else {\n try {\n throw Error();\n } catch (x) {\n control = x;\n }\n\n fn();\n }\n } catch (sample) {\n // This is inlined manually because closure doesn't do it for us.\n if (sample && control && typeof sample.stack === 'string') {\n // This extracts the first frame from the sample that isn't also in the control.\n // Skipping one frame that we assume is the frame that calls the two.\n var sampleLines = sample.stack.split('\\n');\n var controlLines = control.stack.split('\\n');\n var s = sampleLines.length - 1;\n var c = controlLines.length - 1;\n\n while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {\n // We expect at least one stack frame to be shared.\n // Typically this will be the root most one. However, stack frames may be\n // cut off due to maximum stack limits. In this case, one maybe cut off\n // earlier than the other. We assume that the sample is longer or the same\n // and there for cut off earlier. So we should find the root most frame in\n // the sample somewhere in the control.\n c--;\n }\n\n for (; s >= 1 && c >= 0; s--, c--) {\n // Next we find the first one that isn't the same which should be the\n // frame that called our sample function and the control.\n if (sampleLines[s] !== controlLines[c]) {\n // In V8, the first line is describing the message but other VMs don't.\n // If we're about to return the first line, and the control is also on the same\n // line, that's a pretty good indicator that our sample threw at same line as\n // the control. I.e. before we entered the sample frame. So we ignore this result.\n // This can happen if you passed a class to function component, or non-function.\n if (s !== 1 || c !== 1) {\n do {\n s--;\n c--; // We may still have similar intermediate frames from the construct call.\n // The next one that isn't the same should be our match though.\n\n if (c < 0 || sampleLines[s] !== controlLines[c]) {\n // V8 adds a \"new\" prefix for native classes. Let's remove it to make it prettier.\n var _frame = '\\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled \"<anonymous>\"\n // but we have a user-provided \"displayName\"\n // splice it in to make the stack more readable.\n\n\n if (fn.displayName && _frame.includes('<anonymous>')) {\n _frame = _frame.replace('<anonymous>', fn.displayName);\n }\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, _frame);\n }\n } // Return the line we found.\n\n\n return _frame;\n }\n } while (s >= 1 && c >= 0);\n }\n\n break;\n }\n }\n }\n } finally {\n reentry = false;\n\n {\n ReactCurrentDispatcher$1.current = previousDispatcher;\n reenableLogs();\n }\n\n Error.prepareStackTrace = previousPrepareStackTrace;\n } // Fallback to just using the name if we couldn't make it throw.\n\n\n var name = fn ? fn.displayName || fn.name : '';\n var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, syntheticFrame);\n }\n }\n\n return syntheticFrame;\n}\nfunction describeFunctionComponentFrame(fn, source, ownerFn) {\n {\n return describeNativeComponentFrame(fn, false);\n }\n}\n\nfunction shouldConstruct(Component) {\n var prototype = Component.prototype;\n return !!(prototype && prototype.isReactComponent);\n}\n\nfunction describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {\n\n if (type == null) {\n return '';\n }\n\n if (typeof type === 'function') {\n {\n return describeNativeComponentFrame(type, shouldConstruct(type));\n }\n }\n\n if (typeof type === 'string') {\n return describeBuiltInComponentFrame(type);\n }\n\n switch (type) {\n case REACT_SUSPENSE_TYPE:\n return describeBuiltInComponentFrame('Suspense');\n\n case REACT_SUSPENSE_LIST_TYPE:\n return describeBuiltInComponentFrame('SuspenseList');\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n return describeFunctionComponentFrame(type.render);\n\n case REACT_MEMO_TYPE:\n // Memo may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n // Lazy may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);\n } catch (x) {}\n }\n }\n }\n\n return '';\n}\n\nvar loggedTypeFailures = {};\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame$1.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame$1.setExtraStackFrame(null);\n }\n }\n}\n\nfunction checkPropTypes(typeSpecs, values, location, componentName, element) {\n {\n // $FlowFixMe This is okay but Flow doesn't know it.\n var has = Function.call.bind(hasOwnProperty);\n\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n // eslint-disable-next-line react-internal/prod-error-codes\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n err.name = 'Invariant Violation';\n throw err;\n }\n\n error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\n } catch (ex) {\n error$1 = ex;\n }\n\n if (error$1 && !(error$1 instanceof Error)) {\n setCurrentlyValidatingElement(element);\n\n error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);\n\n setCurrentlyValidatingElement(null);\n }\n\n if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error$1.message] = true;\n setCurrentlyValidatingElement(element);\n\n error('Failed %s type: %s', location, error$1.message);\n\n setCurrentlyValidatingElement(null);\n }\n }\n }\n }\n}\n\nfunction setCurrentlyValidatingElement$1(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n setExtraStackFrame(stack);\n } else {\n setExtraStackFrame(null);\n }\n }\n}\n\nvar propTypesMisspellWarningShown;\n\n{\n propTypesMisspellWarningShown = false;\n}\n\nfunction getDeclarationErrorAddendum() {\n if (ReactCurrentOwner.current) {\n var name = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n if (name) {\n return '\\n\\nCheck the render method of `' + name + '`.';\n }\n }\n\n return '';\n}\n\nfunction getSourceInfoErrorAddendum(source) {\n if (source !== undefined) {\n var fileName = source.fileName.replace(/^.*[\\\\\\/]/, '');\n var lineNumber = source.lineNumber;\n return '\\n\\nCheck your code at ' + fileName + ':' + lineNumber + '.';\n }\n\n return '';\n}\n\nfunction getSourceInfoErrorAddendumForProps(elementProps) {\n if (elementProps !== null && elementProps !== undefined) {\n return getSourceInfoErrorAddendum(elementProps.__source);\n }\n\n return '';\n}\n/**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\n\n\nvar ownerHasKeyUseWarning = {};\n\nfunction getCurrentComponentErrorInfo(parentType) {\n var info = getDeclarationErrorAddendum();\n\n if (!info) {\n var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;\n\n if (parentName) {\n info = \"\\n\\nCheck the top-level render call using <\" + parentName + \">.\";\n }\n }\n\n return info;\n}\n/**\n * Warn if the element doesn't have an explicit key assigned to it.\n * This element is in an array. The array could grow and shrink or be\n * reordered. All children that haven't already been validated are required to\n * have a \"key\" property assigned to it. Error statuses are cached so a warning\n * will only be shown once.\n *\n * @internal\n * @param {ReactElement} element Element that requires a key.\n * @param {*} parentType element's parent's type.\n */\n\n\nfunction validateExplicitKey(element, parentType) {\n if (!element._store || element._store.validated || element.key != null) {\n return;\n }\n\n element._store.validated = true;\n var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);\n\n if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n return;\n }\n\n ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a\n // property, it may be the creator of the child that's responsible for\n // assigning it a key.\n\n var childOwner = '';\n\n if (element && element._owner && element._owner !== ReactCurrentOwner.current) {\n // Give the component that originally created this child.\n childOwner = \" It was passed a child from \" + getComponentNameFromType(element._owner.type) + \".\";\n }\n\n {\n setCurrentlyValidatingElement$1(element);\n\n error('Each child in a list should have a unique \"key\" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);\n\n setCurrentlyValidatingElement$1(null);\n }\n}\n/**\n * Ensure that every element either is passed in a static location, in an\n * array with an explicit keys property defined, or in an object literal\n * with valid key property.\n *\n * @internal\n * @param {ReactNode} node Statically passed child of any type.\n * @param {*} parentType node's parent's type.\n */\n\n\nfunction validateChildKeys(node, parentType) {\n if (typeof node !== 'object') {\n return;\n }\n\n if (isArray(node)) {\n for (var i = 0; i < node.length; i++) {\n var child = node[i];\n\n if (isValidElement(child)) {\n validateExplicitKey(child, parentType);\n }\n }\n } else if (isValidElement(node)) {\n // This element was passed in a valid location.\n if (node._store) {\n node._store.validated = true;\n }\n } else if (node) {\n var iteratorFn = getIteratorFn(node);\n\n if (typeof iteratorFn === 'function') {\n // Entry iterators used to provide implicit keys,\n // but now we print a separate warning for them later.\n if (iteratorFn !== node.entries) {\n var iterator = iteratorFn.call(node);\n var step;\n\n while (!(step = iterator.next()).done) {\n if (isValidElement(step.value)) {\n validateExplicitKey(step.value, parentType);\n }\n }\n }\n }\n }\n}\n/**\n * Given an element, validate that its props follow the propTypes definition,\n * provided by the type.\n *\n * @param {ReactElement} element\n */\n\n\nfunction validatePropTypes(element) {\n {\n var type = element.type;\n\n if (type === null || type === undefined || typeof type === 'string') {\n return;\n }\n\n var propTypes;\n\n if (typeof type === 'function') {\n propTypes = type.propTypes;\n } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.\n // Inner props are checked in the reconciler.\n type.$$typeof === REACT_MEMO_TYPE)) {\n propTypes = type.propTypes;\n } else {\n return;\n }\n\n if (propTypes) {\n // Intentionally inside to avoid triggering lazy initializers:\n var name = getComponentNameFromType(type);\n checkPropTypes(propTypes, element.props, 'prop', name, element);\n } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {\n propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:\n\n var _name = getComponentNameFromType(type);\n\n error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');\n }\n\n if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {\n error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');\n }\n }\n}\n/**\n * Given a fragment, validate that it can only be provided with fragment props\n * @param {ReactElement} fragment\n */\n\n\nfunction validateFragmentProps(fragment) {\n {\n var keys = Object.keys(fragment.props);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (key !== 'children' && key !== 'key') {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);\n\n setCurrentlyValidatingElement$1(null);\n break;\n }\n }\n\n if (fragment.ref !== null) {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid attribute `ref` supplied to `React.Fragment`.');\n\n setCurrentlyValidatingElement$1(null);\n }\n }\n}\nfunction createElementWithValidation(type, props, children) {\n var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to\n // succeed and there will likely be errors in render.\n\n if (!validType) {\n var info = '';\n\n if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and named imports.\";\n }\n\n var sourceInfo = getSourceInfoErrorAddendumForProps(props);\n\n if (sourceInfo) {\n info += sourceInfo;\n } else {\n info += getDeclarationErrorAddendum();\n }\n\n var typeString;\n\n if (type === null) {\n typeString = 'null';\n } else if (isArray(type)) {\n typeString = 'array';\n } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {\n typeString = \"<\" + (getComponentNameFromType(type.type) || 'Unknown') + \" />\";\n info = ' Did you accidentally export a JSX literal instead of a component?';\n } else {\n typeString = typeof type;\n }\n\n {\n error('React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);\n }\n }\n\n var element = createElement.apply(this, arguments); // The result can be nullish if a mock or a custom function is used.\n // TODO: Drop this when these are no longer allowed as the type argument.\n\n if (element == null) {\n return element;\n } // Skip key warning if the type isn't valid since our key validation logic\n // doesn't expect a non-string/function type and can throw confusing errors.\n // We don't want exception behavior to differ between dev and prod.\n // (Rendering will throw with a helpful message and as soon as the type is\n // fixed, the key warnings will appear.)\n\n\n if (validType) {\n for (var i = 2; i < arguments.length; i++) {\n validateChildKeys(arguments[i], type);\n }\n }\n\n if (type === REACT_FRAGMENT_TYPE) {\n validateFragmentProps(element);\n } else {\n validatePropTypes(element);\n }\n\n return element;\n}\nvar didWarnAboutDeprecatedCreateFactory = false;\nfunction createFactoryWithValidation(type) {\n var validatedFactory = createElementWithValidation.bind(null, type);\n validatedFactory.type = type;\n\n {\n if (!didWarnAboutDeprecatedCreateFactory) {\n didWarnAboutDeprecatedCreateFactory = true;\n\n warn('React.createFactory() is deprecated and will be removed in ' + 'a future major release. Consider using JSX ' + 'or use React.createElement() directly instead.');\n } // Legacy hook: remove it\n\n\n Object.defineProperty(validatedFactory, 'type', {\n enumerable: false,\n get: function () {\n warn('Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');\n\n Object.defineProperty(this, 'type', {\n value: type\n });\n return type;\n }\n });\n }\n\n return validatedFactory;\n}\nfunction cloneElementWithValidation(element, props, children) {\n var newElement = cloneElement.apply(this, arguments);\n\n for (var i = 2; i < arguments.length; i++) {\n validateChildKeys(arguments[i], newElement.type);\n }\n\n validatePropTypes(newElement);\n return newElement;\n}\n\nfunction startTransition(scope, options) {\n var prevTransition = ReactCurrentBatchConfig.transition;\n ReactCurrentBatchConfig.transition = {};\n var currentTransition = ReactCurrentBatchConfig.transition;\n\n {\n ReactCurrentBatchConfig.transition._updatedFibers = new Set();\n }\n\n try {\n scope();\n } finally {\n ReactCurrentBatchConfig.transition = prevTransition;\n\n {\n if (prevTransition === null && currentTransition._updatedFibers) {\n var updatedFibersCount = currentTransition._updatedFibers.size;\n\n if (updatedFibersCount > 10) {\n warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.');\n }\n\n currentTransition._updatedFibers.clear();\n }\n }\n }\n}\n\nvar didWarnAboutMessageChannel = false;\nvar enqueueTaskImpl = null;\nfunction enqueueTask(task) {\n if (enqueueTaskImpl === null) {\n try {\n // read require off the module object to get around the bundlers.\n // we don't want them to detect a require and bundle a Node polyfill.\n var requireString = ('require' + Math.random()).slice(0, 7);\n var nodeRequire = module && module[requireString]; // assuming we're in node, let's try to get node's\n // version of setImmediate, bypassing fake timers if any.\n\n enqueueTaskImpl = nodeRequire.call(module, 'timers').setImmediate;\n } catch (_err) {\n // we're in a browser\n // we can't use regular timers because they may still be faked\n // so we try MessageChannel+postMessage instead\n enqueueTaskImpl = function (callback) {\n {\n if (didWarnAboutMessageChannel === false) {\n didWarnAboutMessageChannel = true;\n\n if (typeof MessageChannel === 'undefined') {\n error('This browser does not have a MessageChannel implementation, ' + 'so enqueuing tasks via await act(async () => ...) will fail. ' + 'Please file an issue at https://github.com/facebook/react/issues ' + 'if you encounter this warning.');\n }\n }\n }\n\n var channel = new MessageChannel();\n channel.port1.onmessage = callback;\n channel.port2.postMessage(undefined);\n };\n }\n }\n\n return enqueueTaskImpl(task);\n}\n\nvar actScopeDepth = 0;\nvar didWarnNoAwaitAct = false;\nfunction act(callback) {\n {\n // `act` calls can be nested, so we track the depth. This represents the\n // number of `act` scopes on the stack.\n var prevActScopeDepth = actScopeDepth;\n actScopeDepth++;\n\n if (ReactCurrentActQueue.current === null) {\n // This is the outermost `act` scope. Initialize the queue. The reconciler\n // will detect the queue and use it instead of Scheduler.\n ReactCurrentActQueue.current = [];\n }\n\n var prevIsBatchingLegacy = ReactCurrentActQueue.isBatchingLegacy;\n var result;\n\n try {\n // Used to reproduce behavior of `batchedUpdates` in legacy mode. Only\n // set to `true` while the given callback is executed, not for updates\n // triggered during an async event, because this is how the legacy\n // implementation of `act` behaved.\n ReactCurrentActQueue.isBatchingLegacy = true;\n result = callback(); // Replicate behavior of original `act` implementation in legacy mode,\n // which flushed updates immediately after the scope function exits, even\n // if it's an async function.\n\n if (!prevIsBatchingLegacy && ReactCurrentActQueue.didScheduleLegacyUpdate) {\n var queue = ReactCurrentActQueue.current;\n\n if (queue !== null) {\n ReactCurrentActQueue.didScheduleLegacyUpdate = false;\n flushActQueue(queue);\n }\n }\n } catch (error) {\n popActScope(prevActScopeDepth);\n throw error;\n } finally {\n ReactCurrentActQueue.isBatchingLegacy = prevIsBatchingLegacy;\n }\n\n if (result !== null && typeof result === 'object' && typeof result.then === 'function') {\n var thenableResult = result; // The callback is an async function (i.e. returned a promise). Wait\n // for it to resolve before exiting the current scope.\n\n var wasAwaited = false;\n var thenable = {\n then: function (resolve, reject) {\n wasAwaited = true;\n thenableResult.then(function (returnValue) {\n popActScope(prevActScopeDepth);\n\n if (actScopeDepth === 0) {\n // We've exited the outermost act scope. Recursively flush the\n // queue until there's no remaining work.\n recursivelyFlushAsyncActWork(returnValue, resolve, reject);\n } else {\n resolve(returnValue);\n }\n }, function (error) {\n // The callback threw an error.\n popActScope(prevActScopeDepth);\n reject(error);\n });\n }\n };\n\n {\n if (!didWarnNoAwaitAct && typeof Promise !== 'undefined') {\n // eslint-disable-next-line no-undef\n Promise.resolve().then(function () {}).then(function () {\n if (!wasAwaited) {\n didWarnNoAwaitAct = true;\n\n error('You called act(async () => ...) without await. ' + 'This could lead to unexpected testing behaviour, ' + 'interleaving multiple act calls and mixing their ' + 'scopes. ' + 'You should - await act(async () => ...);');\n }\n });\n }\n }\n\n return thenable;\n } else {\n var returnValue = result; // The callback is not an async function. Exit the current scope\n // immediately, without awaiting.\n\n popActScope(prevActScopeDepth);\n\n if (actScopeDepth === 0) {\n // Exiting the outermost act scope. Flush the queue.\n var _queue = ReactCurrentActQueue.current;\n\n if (_queue !== null) {\n flushActQueue(_queue);\n ReactCurrentActQueue.current = null;\n } // Return a thenable. If the user awaits it, we'll flush again in\n // case additional work was scheduled by a microtask.\n\n\n var _thenable = {\n then: function (resolve, reject) {\n // Confirm we haven't re-entered another `act` scope, in case\n // the user does something weird like await the thenable\n // multiple times.\n if (ReactCurrentActQueue.current === null) {\n // Recursively flush the queue until there's no remaining work.\n ReactCurrentActQueue.current = [];\n recursivelyFlushAsyncActWork(returnValue, resolve, reject);\n } else {\n resolve(returnValue);\n }\n }\n };\n return _thenable;\n } else {\n // Since we're inside a nested `act` scope, the returned thenable\n // immediately resolves. The outer scope will flush the queue.\n var _thenable2 = {\n then: function (resolve, reject) {\n resolve(returnValue);\n }\n };\n return _thenable2;\n }\n }\n }\n}\n\nfunction popActScope(prevActScopeDepth) {\n {\n if (prevActScopeDepth !== actScopeDepth - 1) {\n error('You seem to have overlapping act() calls, this is not supported. ' + 'Be sure to await previous act() calls before making a new one. ');\n }\n\n actScopeDepth = prevActScopeDepth;\n }\n}\n\nfunction recursivelyFlushAsyncActWork(returnValue, resolve, reject) {\n {\n var queue = ReactCurrentActQueue.current;\n\n if (queue !== null) {\n try {\n flushActQueue(queue);\n enqueueTask(function () {\n if (queue.length === 0) {\n // No additional work was scheduled. Finish.\n ReactCurrentActQueue.current = null;\n resolve(returnValue);\n } else {\n // Keep flushing work until there's none left.\n recursivelyFlushAsyncActWork(returnValue, resolve, reject);\n }\n });\n } catch (error) {\n reject(error);\n }\n } else {\n resolve(returnValue);\n }\n }\n}\n\nvar isFlushing = false;\n\nfunction flushActQueue(queue) {\n {\n if (!isFlushing) {\n // Prevent re-entrance.\n isFlushing = true;\n var i = 0;\n\n try {\n for (; i < queue.length; i++) {\n var callback = queue[i];\n\n do {\n callback = callback(true);\n } while (callback !== null);\n }\n\n queue.length = 0;\n } catch (error) {\n // If something throws, leave the remaining callbacks on the queue.\n queue = queue.slice(i + 1);\n throw error;\n } finally {\n isFlushing = false;\n }\n }\n }\n}\n\nvar createElement$1 = createElementWithValidation ;\nvar cloneElement$1 = cloneElementWithValidation ;\nvar createFactory = createFactoryWithValidation ;\nvar Children = {\n map: mapChildren,\n forEach: forEachChildren,\n count: countChildren,\n toArray: toArray,\n only: onlyChild\n};\n\nexports.Children = Children;\nexports.Component = Component;\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.Profiler = REACT_PROFILER_TYPE;\nexports.PureComponent = PureComponent;\nexports.StrictMode = REACT_STRICT_MODE_TYPE;\nexports.Suspense = REACT_SUSPENSE_TYPE;\nexports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals;\nexports.act = act;\nexports.cloneElement = cloneElement$1;\nexports.createContext = createContext;\nexports.createElement = createElement$1;\nexports.createFactory = createFactory;\nexports.createRef = createRef;\nexports.forwardRef = forwardRef;\nexports.isValidElement = isValidElement;\nexports.lazy = lazy;\nexports.memo = memo;\nexports.startTransition = startTransition;\nexports.unstable_act = act;\nexports.useCallback = useCallback;\nexports.useContext = useContext;\nexports.useDebugValue = useDebugValue;\nexports.useDeferredValue = useDeferredValue;\nexports.useEffect = useEffect;\nexports.useId = useId;\nexports.useImperativeHandle = useImperativeHandle;\nexports.useInsertionEffect = useInsertionEffect;\nexports.useLayoutEffect = useLayoutEffect;\nexports.useMemo = useMemo;\nexports.useReducer = useReducer;\nexports.useRef = useRef;\nexports.useState = useState;\nexports.useSyncExternalStore = useSyncExternalStore;\nexports.useTransition = useTransition;\nexports.version = ReactVersion;\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\nif (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===\n 'function'\n) {\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());\n}\n \n })();\n}\n", "'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react.production.min.js');\n} else {\n module.exports = require('./cjs/react.development.js');\n}\n", "/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n", "/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\nvar React = require('react');\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nfunction error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\n// -----------------------------------------------------------------------------\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\nvar enableCacheElement = false;\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n// stuff. Intended to enable React core members to more easily debug scheduling\n// issues in DEV builds.\n\nvar enableDebugTracing = false; // Track which Fiber(s) schedule render work.\n\nvar REACT_MODULE_REFERENCE;\n\n{\n REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');\n}\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n return true;\n } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\n\n\n if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {\n return true;\n }\n\n if (typeof type === 'object' && type !== null) {\n if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object\n // types supported by any Flight configuration anywhere since\n // we don't know which Flight build this will end up being used\n // with.\n type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var displayName = outerType.displayName;\n\n if (displayName) {\n return displayName;\n }\n\n var functionName = innerType.displayName || innerType.name || '';\n return functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName;\n} // Keep in sync with react-reconciler/getComponentNameFromFiber\n\n\nfunction getContextName(type) {\n return type.displayName || 'Context';\n} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.\n\n\nfunction getComponentNameFromType(type) {\n if (type == null) {\n // Host root, text node or just invalid type.\n return null;\n }\n\n {\n if (typeof type.tag === 'number') {\n error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return 'Fragment';\n\n case REACT_PORTAL_TYPE:\n return 'Portal';\n\n case REACT_PROFILER_TYPE:\n return 'Profiler';\n\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList';\n\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_CONTEXT_TYPE:\n var context = type;\n return getContextName(context) + '.Consumer';\n\n case REACT_PROVIDER_TYPE:\n var provider = type;\n return getContextName(provider._context) + '.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n var outerName = type.displayName || null;\n\n if (outerName !== null) {\n return outerName;\n }\n\n return getComponentNameFromType(type.type) || 'Memo';\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n return getComponentNameFromType(init(payload));\n } catch (x) {\n return null;\n }\n }\n\n // eslint-disable-next-line no-fallthrough\n }\n }\n\n return null;\n}\n\nvar assign = Object.assign;\n\n// Helpers to patch console.logs to avoid logging during side-effect free\n// replaying on render function. This currently only patches the object\n// lazily which won't cover if the log function was extracted eagerly.\n// We could also eagerly patch the method.\nvar disabledDepth = 0;\nvar prevLog;\nvar prevInfo;\nvar prevWarn;\nvar prevError;\nvar prevGroup;\nvar prevGroupCollapsed;\nvar prevGroupEnd;\n\nfunction disabledLog() {}\n\ndisabledLog.__reactDisabledLog = true;\nfunction disableLogs() {\n {\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n prevLog = console.log;\n prevInfo = console.info;\n prevWarn = console.warn;\n prevError = console.error;\n prevGroup = console.group;\n prevGroupCollapsed = console.groupCollapsed;\n prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099\n\n var props = {\n configurable: true,\n enumerable: true,\n value: disabledLog,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n info: props,\n log: props,\n warn: props,\n error: props,\n group: props,\n groupCollapsed: props,\n groupEnd: props\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n disabledDepth++;\n }\n}\nfunction reenableLogs() {\n {\n disabledDepth--;\n\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n var props = {\n configurable: true,\n enumerable: true,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n log: assign({}, props, {\n value: prevLog\n }),\n info: assign({}, props, {\n value: prevInfo\n }),\n warn: assign({}, props, {\n value: prevWarn\n }),\n error: assign({}, props, {\n value: prevError\n }),\n group: assign({}, props, {\n value: prevGroup\n }),\n groupCollapsed: assign({}, props, {\n value: prevGroupCollapsed\n }),\n groupEnd: assign({}, props, {\n value: prevGroupEnd\n })\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n if (disabledDepth < 0) {\n error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');\n }\n }\n}\n\nvar ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;\nvar prefix;\nfunction describeBuiltInComponentFrame(name, source, ownerFn) {\n {\n if (prefix === undefined) {\n // Extract the VM specific prefix used by each line.\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(/\\n( *(at )?)/);\n prefix = match && match[1] || '';\n }\n } // We use the prefix to ensure our stacks line up with native stack frames.\n\n\n return '\\n' + prefix + name;\n }\n}\nvar reentry = false;\nvar componentFrameCache;\n\n{\n var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\n componentFrameCache = new PossiblyWeakMap();\n}\n\nfunction describeNativeComponentFrame(fn, construct) {\n // If something asked for a stack inside a fake render, it should get ignored.\n if ( !fn || reentry) {\n return '';\n }\n\n {\n var frame = componentFrameCache.get(fn);\n\n if (frame !== undefined) {\n return frame;\n }\n }\n\n var control;\n reentry = true;\n var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.\n\n Error.prepareStackTrace = undefined;\n var previousDispatcher;\n\n {\n previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function\n // for warnings.\n\n ReactCurrentDispatcher.current = null;\n disableLogs();\n }\n\n try {\n // This should throw.\n if (construct) {\n // Something should be setting the props in the constructor.\n var Fake = function () {\n throw Error();\n }; // $FlowFixMe\n\n\n Object.defineProperty(Fake.prototype, 'props', {\n set: function () {\n // We use a throwing setter instead of frozen or non-writable props\n // because that won't throw in a non-strict mode function.\n throw Error();\n }\n });\n\n if (typeof Reflect === 'object' && Reflect.construct) {\n // We construct a different control for this case to include any extra\n // frames added by the construct call.\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n control = x;\n }\n\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x) {\n control = x;\n }\n\n fn.call(Fake.prototype);\n }\n } else {\n try {\n throw Error();\n } catch (x) {\n control = x;\n }\n\n fn();\n }\n } catch (sample) {\n // This is inlined manually because closure doesn't do it for us.\n if (sample && control && typeof sample.stack === 'string') {\n // This extracts the first frame from the sample that isn't also in the control.\n // Skipping one frame that we assume is the frame that calls the two.\n var sampleLines = sample.stack.split('\\n');\n var controlLines = control.stack.split('\\n');\n var s = sampleLines.length - 1;\n var c = controlLines.length - 1;\n\n while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {\n // We expect at least one stack frame to be shared.\n // Typically this will be the root most one. However, stack frames may be\n // cut off due to maximum stack limits. In this case, one maybe cut off\n // earlier than the other. We assume that the sample is longer or the same\n // and there for cut off earlier. So we should find the root most frame in\n // the sample somewhere in the control.\n c--;\n }\n\n for (; s >= 1 && c >= 0; s--, c--) {\n // Next we find the first one that isn't the same which should be the\n // frame that called our sample function and the control.\n if (sampleLines[s] !== controlLines[c]) {\n // In V8, the first line is describing the message but other VMs don't.\n // If we're about to return the first line, and the control is also on the same\n // line, that's a pretty good indicator that our sample threw at same line as\n // the control. I.e. before we entered the sample frame. So we ignore this result.\n // This can happen if you passed a class to function component, or non-function.\n if (s !== 1 || c !== 1) {\n do {\n s--;\n c--; // We may still have similar intermediate frames from the construct call.\n // The next one that isn't the same should be our match though.\n\n if (c < 0 || sampleLines[s] !== controlLines[c]) {\n // V8 adds a \"new\" prefix for native classes. Let's remove it to make it prettier.\n var _frame = '\\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled \"<anonymous>\"\n // but we have a user-provided \"displayName\"\n // splice it in to make the stack more readable.\n\n\n if (fn.displayName && _frame.includes('<anonymous>')) {\n _frame = _frame.replace('<anonymous>', fn.displayName);\n }\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, _frame);\n }\n } // Return the line we found.\n\n\n return _frame;\n }\n } while (s >= 1 && c >= 0);\n }\n\n break;\n }\n }\n }\n } finally {\n reentry = false;\n\n {\n ReactCurrentDispatcher.current = previousDispatcher;\n reenableLogs();\n }\n\n Error.prepareStackTrace = previousPrepareStackTrace;\n } // Fallback to just using the name if we couldn't make it throw.\n\n\n var name = fn ? fn.displayName || fn.name : '';\n var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, syntheticFrame);\n }\n }\n\n return syntheticFrame;\n}\nfunction describeFunctionComponentFrame(fn, source, ownerFn) {\n {\n return describeNativeComponentFrame(fn, false);\n }\n}\n\nfunction shouldConstruct(Component) {\n var prototype = Component.prototype;\n return !!(prototype && prototype.isReactComponent);\n}\n\nfunction describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {\n\n if (type == null) {\n return '';\n }\n\n if (typeof type === 'function') {\n {\n return describeNativeComponentFrame(type, shouldConstruct(type));\n }\n }\n\n if (typeof type === 'string') {\n return describeBuiltInComponentFrame(type);\n }\n\n switch (type) {\n case REACT_SUSPENSE_TYPE:\n return describeBuiltInComponentFrame('Suspense');\n\n case REACT_SUSPENSE_LIST_TYPE:\n return describeBuiltInComponentFrame('SuspenseList');\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n return describeFunctionComponentFrame(type.render);\n\n case REACT_MEMO_TYPE:\n // Memo may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n // Lazy may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);\n } catch (x) {}\n }\n }\n }\n\n return '';\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar loggedTypeFailures = {};\nvar ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame.setExtraStackFrame(null);\n }\n }\n}\n\nfunction checkPropTypes(typeSpecs, values, location, componentName, element) {\n {\n // $FlowFixMe This is okay but Flow doesn't know it.\n var has = Function.call.bind(hasOwnProperty);\n\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n // eslint-disable-next-line react-internal/prod-error-codes\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n err.name = 'Invariant Violation';\n throw err;\n }\n\n error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\n } catch (ex) {\n error$1 = ex;\n }\n\n if (error$1 && !(error$1 instanceof Error)) {\n setCurrentlyValidatingElement(element);\n\n error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);\n\n setCurrentlyValidatingElement(null);\n }\n\n if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error$1.message] = true;\n setCurrentlyValidatingElement(element);\n\n error('Failed %s type: %s', location, error$1.message);\n\n setCurrentlyValidatingElement(null);\n }\n }\n }\n }\n}\n\nvar isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare\n\nfunction isArray(a) {\n return isArrayImpl(a);\n}\n\n/*\n * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol\n * and Temporal.* types. See https://github.com/facebook/react/pull/22064.\n *\n * The functions in this module will throw an easier-to-understand,\n * easier-to-debug exception with a clear errors message message explaining the\n * problem. (Instead of a confusing exception thrown inside the implementation\n * of the `value` object).\n */\n// $FlowFixMe only called in DEV, so void return is not possible.\nfunction typeName(value) {\n {\n // toStringTag is needed for namespaced types like Temporal.Instant\n var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;\n var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';\n return type;\n }\n} // $FlowFixMe only called in DEV, so void return is not possible.\n\n\nfunction willCoercionThrow(value) {\n {\n try {\n testStringCoercion(value);\n return false;\n } catch (e) {\n return true;\n }\n }\n}\n\nfunction testStringCoercion(value) {\n // If you ended up here by following an exception call stack, here's what's\n // happened: you supplied an object or symbol value to React (as a prop, key,\n // DOM attribute, CSS property, string ref, etc.) and when React tried to\n // coerce it to a string using `'' + value`, an exception was thrown.\n //\n // The most common types that will cause this exception are `Symbol` instances\n // and Temporal objects like `Temporal.Instant`. But any object that has a\n // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this\n // exception. (Library authors do this to prevent users from using built-in\n // numeric operators like `+` or comparison operators like `>=` because custom\n // methods are needed to perform accurate arithmetic or comparison.)\n //\n // To fix the problem, coerce this object or symbol value to a string before\n // passing it to React. The most reliable way is usually `String(value)`.\n //\n // To find which value is throwing, check the browser or debugger console.\n // Before this exception was thrown, there should be `console.error` output\n // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the\n // problem and how that type was used: key, atrribute, input value prop, etc.\n // In most cases, this console output also shows the component and its\n // ancestor components where the exception happened.\n //\n // eslint-disable-next-line react-internal/safe-string-coercion\n return '' + value;\n}\nfunction checkKeyStringCoercion(value) {\n {\n if (willCoercionThrow(value)) {\n error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));\n\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n}\n\nvar ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;\nvar RESERVED_PROPS = {\n key: true,\n ref: true,\n __self: true,\n __source: true\n};\nvar specialPropKeyWarningShown;\nvar specialPropRefWarningShown;\nvar didWarnAboutStringRefs;\n\n{\n didWarnAboutStringRefs = {};\n}\n\nfunction hasValidRef(config) {\n {\n if (hasOwnProperty.call(config, 'ref')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.ref !== undefined;\n}\n\nfunction hasValidKey(config) {\n {\n if (hasOwnProperty.call(config, 'key')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'key').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.key !== undefined;\n}\n\nfunction warnIfStringRefCannotBeAutoConverted(config, self) {\n {\n if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {\n var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n if (!didWarnAboutStringRefs[componentName]) {\n error('Component \"%s\" contains the string ref \"%s\". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);\n\n didWarnAboutStringRefs[componentName] = true;\n }\n }\n }\n}\n\nfunction defineKeyPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingKey = function () {\n if (!specialPropKeyWarningShown) {\n specialPropKeyWarningShown = true;\n\n error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingKey.isReactWarning = true;\n Object.defineProperty(props, 'key', {\n get: warnAboutAccessingKey,\n configurable: true\n });\n }\n}\n\nfunction defineRefPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingRef = function () {\n if (!specialPropRefWarningShown) {\n specialPropRefWarningShown = true;\n\n error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingRef.isReactWarning = true;\n Object.defineProperty(props, 'ref', {\n get: warnAboutAccessingRef,\n configurable: true\n });\n }\n}\n/**\n * Factory method to create a new React element. This no longer adheres to\n * the class pattern, so do not use new to call it. Also, instanceof check\n * will not work. Instead test $$typeof field against Symbol.for('react.element') to check\n * if something is a React Element.\n *\n * @param {*} type\n * @param {*} props\n * @param {*} key\n * @param {string|object} ref\n * @param {*} owner\n * @param {*} self A *temporary* helper to detect places where `this` is\n * different from the `owner` when React.createElement is called, so that we\n * can warn. We want to get rid of owner and replace string `ref`s with arrow\n * functions, and as long as `this` and owner are the same, there will be no\n * change in behavior.\n * @param {*} source An annotation object (added by a transpiler or otherwise)\n * indicating filename, line number, and/or other information.\n * @internal\n */\n\n\nvar ReactElement = function (type, key, ref, self, source, owner, props) {\n var element = {\n // This tag allows us to uniquely identify this as a React Element\n $$typeof: REACT_ELEMENT_TYPE,\n // Built-in properties that belong on the element\n type: type,\n key: key,\n ref: ref,\n props: props,\n // Record the component responsible for creating this element.\n _owner: owner\n };\n\n {\n // The validation flag is currently mutative. We put it on\n // an external backing store so that we can freeze the whole object.\n // This can be replaced with a WeakMap once they are implemented in\n // commonly used development environments.\n element._store = {}; // To make comparing ReactElements easier for testing purposes, we make\n // the validation flag non-enumerable (where possible, which should\n // include every environment we run tests in), so the test framework\n // ignores it.\n\n Object.defineProperty(element._store, 'validated', {\n configurable: false,\n enumerable: false,\n writable: true,\n value: false\n }); // self and source are DEV only properties.\n\n Object.defineProperty(element, '_self', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: self\n }); // Two elements created in two different places should be considered\n // equal for testing purposes and therefore we hide it from enumeration.\n\n Object.defineProperty(element, '_source', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: source\n });\n\n if (Object.freeze) {\n Object.freeze(element.props);\n Object.freeze(element);\n }\n }\n\n return element;\n};\n/**\n * https://github.com/reactjs/rfcs/pull/107\n * @param {*} type\n * @param {object} props\n * @param {string} key\n */\n\nfunction jsxDEV(type, config, maybeKey, source, self) {\n {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null; // Currently, key can be spread in as a prop. This causes a potential\n // issue if key is also explicitly declared (ie. <div {...props} key=\"Hi\" />\n // or <div key=\"Hi\" {...props} /> ). We want to deprecate key spread,\n // but as an intermediary step, we will use jsxDEV for everything except\n // <div {...props} key=\"Hi\" />, because we aren't currently able to tell if\n // key is explicitly declared to be undefined or not.\n\n if (maybeKey !== undefined) {\n {\n checkKeyStringCoercion(maybeKey);\n }\n\n key = '' + maybeKey;\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n }\n\n if (hasValidRef(config)) {\n ref = config.ref;\n warnIfStringRefCannotBeAutoConverted(config, self);\n } // Remaining properties are added to a new props object\n\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }\n}\n\nvar ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement$1(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame$1.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame$1.setExtraStackFrame(null);\n }\n }\n}\n\nvar propTypesMisspellWarningShown;\n\n{\n propTypesMisspellWarningShown = false;\n}\n/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a ReactElement.\n * @final\n */\n\n\nfunction isValidElement(object) {\n {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n }\n}\n\nfunction getDeclarationErrorAddendum() {\n {\n if (ReactCurrentOwner$1.current) {\n var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);\n\n if (name) {\n return '\\n\\nCheck the render method of `' + name + '`.';\n }\n }\n\n return '';\n }\n}\n\nfunction getSourceInfoErrorAddendum(source) {\n {\n if (source !== undefined) {\n var fileName = source.fileName.replace(/^.*[\\\\\\/]/, '');\n var lineNumber = source.lineNumber;\n return '\\n\\nCheck your code at ' + fileName + ':' + lineNumber + '.';\n }\n\n return '';\n }\n}\n/**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\n\n\nvar ownerHasKeyUseWarning = {};\n\nfunction getCurrentComponentErrorInfo(parentType) {\n {\n var info = getDeclarationErrorAddendum();\n\n if (!info) {\n var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;\n\n if (parentName) {\n info = \"\\n\\nCheck the top-level render call using <\" + parentName + \">.\";\n }\n }\n\n return info;\n }\n}\n/**\n * Warn if the element doesn't have an explicit key assigned to it.\n * This element is in an array. The array could grow and shrink or be\n * reordered. All children that haven't already been validated are required to\n * have a \"key\" property assigned to it. Error statuses are cached so a warning\n * will only be shown once.\n *\n * @internal\n * @param {ReactElement} element Element that requires a key.\n * @param {*} parentType element's parent's type.\n */\n\n\nfunction validateExplicitKey(element, parentType) {\n {\n if (!element._store || element._store.validated || element.key != null) {\n return;\n }\n\n element._store.validated = true;\n var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);\n\n if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n return;\n }\n\n ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a\n // property, it may be the creator of the child that's responsible for\n // assigning it a key.\n\n var childOwner = '';\n\n if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {\n // Give the component that originally created this child.\n childOwner = \" It was passed a child from \" + getComponentNameFromType(element._owner.type) + \".\";\n }\n\n setCurrentlyValidatingElement$1(element);\n\n error('Each child in a list should have a unique \"key\" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);\n\n setCurrentlyValidatingElement$1(null);\n }\n}\n/**\n * Ensure that every element either is passed in a static location, in an\n * array with an explicit keys property defined, or in an object literal\n * with valid key property.\n *\n * @internal\n * @param {ReactNode} node Statically passed child of any type.\n * @param {*} parentType node's parent's type.\n */\n\n\nfunction validateChildKeys(node, parentType) {\n {\n if (typeof node !== 'object') {\n return;\n }\n\n if (isArray(node)) {\n for (var i = 0; i < node.length; i++) {\n var child = node[i];\n\n if (isValidElement(child)) {\n validateExplicitKey(child, parentType);\n }\n }\n } else if (isValidElement(node)) {\n // This element was passed in a valid location.\n if (node._store) {\n node._store.validated = true;\n }\n } else if (node) {\n var iteratorFn = getIteratorFn(node);\n\n if (typeof iteratorFn === 'function') {\n // Entry iterators used to provide implicit keys,\n // but now we print a separate warning for them later.\n if (iteratorFn !== node.entries) {\n var iterator = iteratorFn.call(node);\n var step;\n\n while (!(step = iterator.next()).done) {\n if (isValidElement(step.value)) {\n validateExplicitKey(step.value, parentType);\n }\n }\n }\n }\n }\n }\n}\n/**\n * Given an element, validate that its props follow the propTypes definition,\n * provided by the type.\n *\n * @param {ReactElement} element\n */\n\n\nfunction validatePropTypes(element) {\n {\n var type = element.type;\n\n if (type === null || type === undefined || typeof type === 'string') {\n return;\n }\n\n var propTypes;\n\n if (typeof type === 'function') {\n propTypes = type.propTypes;\n } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.\n // Inner props are checked in the reconciler.\n type.$$typeof === REACT_MEMO_TYPE)) {\n propTypes = type.propTypes;\n } else {\n return;\n }\n\n if (propTypes) {\n // Intentionally inside to avoid triggering lazy initializers:\n var name = getComponentNameFromType(type);\n checkPropTypes(propTypes, element.props, 'prop', name, element);\n } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {\n propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:\n\n var _name = getComponentNameFromType(type);\n\n error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');\n }\n\n if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {\n error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');\n }\n }\n}\n/**\n * Given a fragment, validate that it can only be provided with fragment props\n * @param {ReactElement} fragment\n */\n\n\nfunction validateFragmentProps(fragment) {\n {\n var keys = Object.keys(fragment.props);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (key !== 'children' && key !== 'key') {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);\n\n setCurrentlyValidatingElement$1(null);\n break;\n }\n }\n\n if (fragment.ref !== null) {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid attribute `ref` supplied to `React.Fragment`.');\n\n setCurrentlyValidatingElement$1(null);\n }\n }\n}\n\nvar didWarnAboutKeySpread = {};\nfunction jsxWithValidation(type, props, key, isStaticChildren, source, self) {\n {\n var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to\n // succeed and there will likely be errors in render.\n\n if (!validType) {\n var info = '';\n\n if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and named imports.\";\n }\n\n var sourceInfo = getSourceInfoErrorAddendum(source);\n\n if (sourceInfo) {\n info += sourceInfo;\n } else {\n info += getDeclarationErrorAddendum();\n }\n\n var typeString;\n\n if (type === null) {\n typeString = 'null';\n } else if (isArray(type)) {\n typeString = 'array';\n } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {\n typeString = \"<\" + (getComponentNameFromType(type.type) || 'Unknown') + \" />\";\n info = ' Did you accidentally export a JSX literal instead of a component?';\n } else {\n typeString = typeof type;\n }\n\n error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);\n }\n\n var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.\n // TODO: Drop this when these are no longer allowed as the type argument.\n\n if (element == null) {\n return element;\n } // Skip key warning if the type isn't valid since our key validation logic\n // doesn't expect a non-string/function type and can throw confusing errors.\n // We don't want exception behavior to differ between dev and prod.\n // (Rendering will throw with a helpful message and as soon as the type is\n // fixed, the key warnings will appear.)\n\n\n if (validType) {\n var children = props.children;\n\n if (children !== undefined) {\n if (isStaticChildren) {\n if (isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n validateChildKeys(children[i], type);\n }\n\n if (Object.freeze) {\n Object.freeze(children);\n }\n } else {\n error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');\n }\n } else {\n validateChildKeys(children, type);\n }\n }\n }\n\n {\n if (hasOwnProperty.call(props, 'key')) {\n var componentName = getComponentNameFromType(type);\n var keys = Object.keys(props).filter(function (k) {\n return k !== 'key';\n });\n var beforeExample = keys.length > 0 ? '{key: someKey, ' + keys.join(': ..., ') + ': ...}' : '{key: someKey}';\n\n if (!didWarnAboutKeySpread[componentName + beforeExample]) {\n var afterExample = keys.length > 0 ? '{' + keys.join(': ..., ') + ': ...}' : '{}';\n\n error('A props object containing a \"key\" prop is being spread into JSX:\\n' + ' let props = %s;\\n' + ' <%s {...props} />\\n' + 'React keys must be passed directly to JSX without using spread:\\n' + ' let props = %s;\\n' + ' <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);\n\n didWarnAboutKeySpread[componentName + beforeExample] = true;\n }\n }\n }\n\n if (type === REACT_FRAGMENT_TYPE) {\n validateFragmentProps(element);\n } else {\n validatePropTypes(element);\n }\n\n return element;\n }\n} // These two functions exist to still get child warnings in dev\n// even with the prod transform. This means that jsxDEV is purely\n// opt-in behavior for better messages but that we won't stop\n// giving you warnings if you use production apis.\n\nfunction jsxWithValidationStatic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, true);\n }\n}\nfunction jsxWithValidationDynamic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, false);\n }\n}\n\nvar jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.\n// for now we can ship identical prod functions\n\nvar jsxs = jsxWithValidationStatic ;\n\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsx;\nexports.jsxs = jsxs;\n })();\n}\n", "'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n", "/**\n * Preload bridge for the main window, settings window, settings overlay\n * view, and popover overlay view. Exposes a minimal, typed `window.devtools`\n * surface so the renderer never has to call `window.require('electron')`.\n *\n * This file is bundled by esbuild to CJS at `dist/preload/windows/main.js`\n * (see package.json `build:preload`). It must remain a leaf module \u2014 do\n * NOT import other preload files via `.js` ESM specifiers; everything goes\n * through the Electron `contextBridge` / `ipcRenderer` runtime.\n *\n * Channel governance lives in the main process: `sender-policy.ts` plus the\n * per-handler zod schemas decide what's accepted. The preload layer is a\n * thin pass-through \u2014 a renderer inventing channel names will just hit a\n * main-side rejection, so duplicating an allowlist here added no real\n * defense for a devtool that loads user-trusted mini-programs.\n */\nimport { contextBridge, ipcRenderer, type IpcRendererEvent } from 'electron'\nimport { BRIDGE_CHANNELS as C, SIMULATOR_EVENTS as E } from '../../shared/bridge-channels.js'\nimport type {\n ApiCallPayload,\n ApiResponsePayload,\n} from '../../shared/bridge-channels.js'\nimport { runApiAsync } from '../runtime/main-api-runner.js'\nimport { simulatorApis } from '../../simulator/simulator-api.js'\n\nconst api = {\n ipc: {\n invoke: (channel: string, ...args: unknown[]) => ipcRenderer.invoke(channel, ...args),\n // Synchronous round-trip. Blocks the renderer until the main process sets\n // `event.returnValue` \u2014 used only for the editor's beforeunload flush, where\n // the write MUST land before the page is torn down (an async invoke can't).\n sendSync: (channel: string, ...args: unknown[]) => ipcRenderer.sendSync(channel, ...args),\n send: (channel: string, ...args: unknown[]) => {\n ipcRenderer.send(channel, ...args)\n },\n on: (\n channel: string,\n listener: (event: IpcRendererEvent, ...args: unknown[]) => void,\n ) => {\n ipcRenderer.on(channel, listener)\n return () => ipcRenderer.removeListener(channel, listener)\n },\n once: (\n channel: string,\n listener: (event: IpcRendererEvent, ...args: unknown[]) => void,\n ) => {\n ipcRenderer.once(channel, listener)\n },\n removeListener: (\n channel: string,\n listener: (...args: unknown[]) => void,\n ) => {\n ipcRenderer.removeListener(channel, listener)\n },\n },\n}\n\n// All host windows that load this preload run with `contextIsolation: true`\n// (main / settings / view-manager), so `contextBridge` is the path that\n// reaches the renderer's `window`. The simulator <webview> uses a separate\n// preload (`simulator.ts`).\ncontextBridge.exposeInMainWorld('devtools', api)\n\n// Native-host fallback: bridge-router forwards any invokeAPI name not\n// registered in `ctx.simulatorApis` to the simulator's webContents via\n// E.API_CALL. When the *main* window doubles as the simulator (the default\n// path for e2e callers that drive `dmb:spawn` without an explicit\n// simulatorWcId), the listener must live here in the main-window preload\n// because the renderer side has no DeviceShell mounted to install one.\nipcRenderer.on(E.API_CALL, (_event, payload: ApiCallPayload) => {\n void runApiAsync(\n simulatorApis as Record<string, (this: unknown, params?: unknown) => unknown | Promise<unknown>>,\n payload.name,\n payload.params,\n ).then((verdict) => {\n const ack: ApiResponsePayload = {\n appSessionId: payload.appSessionId,\n requestId: payload.requestId,\n ok: verdict.ok,\n result: verdict.result,\n errMsg: verdict.errMsg,\n }\n ipcRenderer.send(C.API_RESPONSE, ack)\n })\n})\n\n// Test-only hatch: e2e helpers emit synthetic IPC events on the renderer's\n// ipcRenderer instance to trigger handlers registered via `devtools.ipc.on`\n// without round-tripping through the main process. Gated on NODE_ENV so\n// production builds never expose it.\nif (process.env.NODE_ENV === 'test') {\n contextBridge.exposeInMainWorld('__testIpc', {\n emit: (channel: string, ...args: unknown[]) => {\n ;(ipcRenderer as unknown as { emit: (c: string, ...a: unknown[]) => void }).emit(channel, ...args)\n },\n })\n}\n\nexport type DevtoolsApi = typeof api\n", "import type { NativeDeviceInfo } from './runtime-types.js'\n\nexport const BRIDGE_CHANNELS = {\n SPAWN: 'dmb:spawn',\n DISPOSE: 'dmb:dispose',\n PAGE_OPEN: 'dmb:page:open',\n PAGE_CLOSE: 'dmb:page:close',\n PAGE_LIFECYCLE: 'dmb:page:lifecycle',\n NAV_CALLBACK: 'dmb:nav:callback',\n SERVICE_INVOKE: 'dmb:service:invoke',\n SERVICE_PUBLISH: 'dmb:service:publish',\n RENDER_INVOKE: 'dmb:render:invoke',\n RENDER_PUBLISH: 'dmb:render:publish',\n TO_SERVICE: 'dmb:to-service',\n TO_RENDER: 'dmb:to-render',\n SIMULATOR_API: 'dmb:simulator-api',\n /** simulator \u2192 main: ack of an API_CALL request (carries success/fail args). */\n API_RESPONSE: 'dmb:api:response',\n /**\n * simulator webview preload \u2192 main (sendSync): \"is native-host mode on?\".\n * The guest preload can't read the launch `process.env`, so it asks main\n * (which can) at install time. Reply is `e.returnValue = boolean`.\n */\n NATIVE_HOST_ENABLED: 'dmb:native-host-enabled',\n /**\n * simulator (DeviceShell) \u2192 main: the visible top-of-stack page bridgeId.\n * Main has no z-order concept \u2014 the active page lives only in DeviceShell's\n * ShellState \u2014 so devtools panels / automation that must target \"the current\n * page's render webContents\" resolve it through this signal. Fire-and-forget.\n */\n ACTIVE_PAGE: 'dmb:active-page',\n /**\n * simulator (DeviceShell) \u2192 main: the FULL ordered page stack (bottom\u2192top)\n * whenever it changes. Main has no stack of its own (it only learns the\n * active bridgeId via ACTIVE_PAGE), so automation's `App.getPageStack` needs\n * this to report multi-page stacks. Fire-and-forget.\n */\n PAGE_STACK: 'dmb:page-stack',\n} as const\n\nexport const SIMULATOR_EVENTS = {\n DOM_READY: 'simulator:dom-ready',\n NAV_BAR: 'simulator:navigation-bar',\n NAV_ACTION: 'simulator:nav-action',\n TAB_ACTION: 'simulator:tab-action',\n /** main \u2192 simulator: invoke a wx.* API on the simulator-resident MiniApp. */\n API_CALL: 'simulator:api-call',\n /**\n * main \u2192 simulator: the renderer toolbar picked a different device. Carries a\n * NativeDeviceInfo; DeviceShell resizes the bezel + re-renders status bar /\n * notch. The race-free INITIAL device rides NativeHostConfig.device (read\n * synchronously at preload bridge-install); this event covers live changes.\n */\n DEVICE_CHANGE: 'simulator:device-change',\n /**\n * main \u2192 simulator: a watcher rebuild finished; boot a NEW app session for\n * the carried url ({@link RelaunchPayload}) IN PLACE, keeping the live\n * DeviceShell painted, and swap once the new session's root page reports\n * DOM_READY (ready-then-swap soft reload). Main sends this only when the\n * shell is live+ready; otherwise the renderer falls back to the hard\n * attachNativeSimulator rebuild.\n */\n RELAUNCH: 'simulator:relaunch',\n} as const\n\n/** Native simulator preload \u2194 owning Electron main-process custom API bridge. */\nexport const SimulatorCustomApiBridgeChannel = {\n Request: 'simulator:custom-apis:bridge-request',\n Response: 'simulator:custom-apis:bridge-response',\n} as const\n\n/**\n * `simulator:relaunch` payload. `url` is a full simulator URL (same format as\n * the simulator page's own location / AttachNative), carrying the appId and\n * the page route the new session must boot at.\n */\nexport interface RelaunchPayload {\n url: string\n}\n\nexport const CHANNELS = BRIDGE_CHANNELS\n\n/**\n * Reply to a `NATIVE_HOST_ENABLED` sendSync. Main supplies render-host asset\n * URLs (preload still needs a `file://` path for the guest preload script).\n * The pageFrame document itself is built per-bridge as `dmb-resource://\u2026`\n * via `buildRenderHostDocumentUrl` \u2014 `renderHostHtmlUrl` is only a legacy\n * placeholder kept for the config shape.\n */\nexport interface NativeHostConfig {\n enabled: boolean\n renderHostHtmlUrl: string\n renderPreloadUrl: string\n /**\n * The currently-selected device, if the renderer already pushed it before the\n * simulator WCV's preload installed (it does \u2014 SetDeviceInfo precedes\n * AttachNative). DeviceShell reads this as its initial device so it never\n * mounts with the wrong bezel size while waiting for the first DEVICE_CHANGE.\n * Absent only on the pre-spawn default path.\n */\n device?: NativeDeviceInfo\n}\n\nexport type BridgeChannel = typeof BRIDGE_CHANNELS[keyof typeof BRIDGE_CHANNELS]\n\nexport type BridgeTarget = 'service' | 'render' | 'container'\n\nexport type BridgeMessageType =\n | 'loadResource'\n | 'serviceResourceLoaded'\n | 'renderResourceLoaded'\n | 'resourceLoaded'\n | 'firstRender'\n | 'appShow'\n | 'appHide'\n | 'stackShow'\n | 'stackHide'\n | 'pageShow'\n | 'pageHide'\n | 'pageReady'\n | 'pageUnload'\n | 'pageScroll'\n | 'pageResize'\n | 'pageRouteDone'\n | 'mC'\n | 'mR'\n | 'mU'\n | 't'\n | 'u'\n | 'ub'\n | 'triggerCallback'\n | 'invokeAPI'\n | 'h5SdkAction'\n | 'componentError'\n | 'domReady'\n | 'print'\n | 'renderHostReady'\n | 'serviceHostError'\n | string\n\nexport interface MessageEnvelope<TBody extends Record<string, unknown> = Record<string, unknown>> {\n type: BridgeMessageType\n target: BridgeTarget\n body: TBody\n}\n\nexport interface HostEnvSnapshot {\n brand: string\n model: string\n platform: string\n system: string\n version: string\n SDKVersion: string\n pixelRatio: number\n screenWidth: number\n screenHeight: number\n windowWidth: number\n windowHeight: number\n statusBarHeight: number\n language: string\n theme: string\n [key: string]: unknown\n}\n\n/**\n * Map the renderer's logical device metrics onto the subset of a\n * HostEnvSnapshot the service-host window's `getSystemInfoSync` consumes.\n * `windowHeight` excludes the status bar (the page area); `windowWidth` has no\n * horizontal chrome. Zoom is intentionally absent \u2014 it is a display scale, not\n * a logical-size change.\n *\n * Single source of truth for the device\u2192host-env mapping, shared by the live\n * `SetDeviceInfo` IPC path (main/ipc/simulator.ts) and the per-spawn host-env\n * seeding (main/ipc/bridge-router.ts). Keeping them identical guarantees a\n * service-host RESPAWN after a device change reports the same dims the live\n * update pushed \u2014 otherwise a respawn would silently revert to the boot device.\n */\nexport function deviceInfoToHostEnv(d: NativeDeviceInfo): Partial<HostEnvSnapshot> {\n return {\n brand: d.brand,\n model: d.model,\n system: d.system,\n platform: d.platform,\n pixelRatio: d.pixelRatio,\n screenWidth: d.screenWidth,\n screenHeight: d.screenHeight,\n windowWidth: d.screenWidth,\n windowHeight: Math.max(0, d.screenHeight - d.statusBarHeight),\n statusBarHeight: d.statusBarHeight,\n }\n}\n\n/**\n * Subset of WeChat page `window` config plus tabBar list, parsed from\n * `app-config.json` (`{app:{window,tabBar,pages,entryPagePath}, modules:{[pagePath]:{...flat page.json fields,root?}}}`).\n * `modules[pagePath]` is FLAT \u2014 the compiler assigns the page's own `.json` file\n * content as-is (see `dimina/fe/packages/compiler/src/env.js` `collectionPageJson()`),\n * not wrapped under a `.window` key. Mirrors mergePageConfig in dimina-fe:\n * page-level keys override app-level.\n */\nexport interface PageWindowConfig {\n navigationBarTitleText?: string\n navigationBarBackgroundColor?: string\n navigationBarTextStyle?: 'black' | 'white'\n navigationStyle?: 'default' | 'custom'\n homeButton?: boolean\n backgroundColor?: string\n backgroundTextStyle?: 'dark' | 'light'\n enablePullDownRefresh?: boolean\n disableScroll?: boolean\n [key: string]: unknown\n}\n\nexport interface TabBarItem {\n pagePath: string\n text?: string\n iconPath?: string\n selectedIconPath?: string\n}\n\nexport interface TabBarConfig {\n color?: string\n selectedColor?: string\n backgroundColor?: string\n borderStyle?: 'black' | 'white'\n position?: 'bottom' | 'top'\n custom?: boolean\n list: TabBarItem[]\n}\n\nexport interface AppManifest {\n entryPagePath: string\n pages: string[]\n tabBar?: TabBarConfig\n /**\n * Provenance of this manifest: `'app-config'` when built from a real\n * compiled `app-config.json` (its `pages` list is authoritative, so mount\n * gates can validate membership against it); `'fallback'` when\n * app-config.json was unreachable and the manifest is a single-page stand-in\n * built from the spawn request. Mount gates only enforce against\n * `'app-config'` \u2014 a `'fallback'` manifest has no compiled truth to check\n * membership against, so it must let every page/nav target through.\n */\n source: 'app-config' | 'fallback'\n}\n\nexport interface SpawnRequest {\n simulatorWcId?: number\n appId: string\n bridgeId?: string\n pagePath?: string\n scene?: number\n query?: Record<string, unknown>\n apiNamespaces?: string[]\n hostEnvSnapshot?: Partial<HostEnvSnapshot>\n pkgRoot?: string\n root?: string\n /**\n * Base URL of the dev server that serves the compiled mini-app, i.e. the\n * SAME origin the simulator page was loaded from (`http://localhost:<port>/`).\n * The dev server statically serves `<appId>/<root>/\u2026` (app-config.json,\n * logic.js, page bundles, styles) \u2014 exactly what the default dimina-fe\n * `<webview>` fetches. The native-host render + service hosts source every\n * resource from here, so we don't need a second resource server or a local\n * compiled-output path. Trailing slash expected.\n */\n resourceBaseUrl?: string\n}\n\nexport interface SpawnResult {\n appSessionId: string\n bridgeId: string\n /** The pagePath originally requested (unchanged even when a fallback applied \u2014 see `resolvedPagePath`). */\n pagePath: string\n /**\n * The pagePath the root PageSession was ACTUALLY spawned with. Equal to\n * `pagePath` unless `pageFallbackApplied` is true, in which case the request\n * was absent from `manifest.pages` and this is `manifest.entryPagePath`\n * (or `manifest.pages[0]` when even that isn't a member). Callers that cache\n * \"the current page\" (e.g. `SimulatorMiniApp`) must reconcile against this,\n * not the original request.\n */\n resolvedPagePath: string\n /** Whether `resolvedPagePath` differs from the request because it was absent from the compiled manifest. Always false for a `'fallback'` manifest (nothing to validate against). */\n pageFallbackApplied: boolean\n serviceWcId: number\n resourceBaseUrl: string\n /** The page's resource root inside the mini-app package (e.g. `'main'`). Threaded to `createRenderHostUrl` so the render-host document URL can encode it \u2014 see `dmb-resource-url.ts`. */\n root: string\n manifest: AppManifest\n rootWindowConfig: PageWindowConfig\n}\n\nexport interface PageOpenRequest {\n appSessionId: string\n pagePath: string\n query?: Record<string, unknown>\n bridgeId?: string\n}\n\nexport interface PageOpenResult {\n bridgeId: string\n pagePath: string\n windowConfig: PageWindowConfig\n isTab: boolean\n}\n\nexport interface PageClosePayload {\n bridgeId: string\n}\n\nexport interface DisposePayload {\n /** AppSession root bridgeId (legacy) or any page bridgeId. */\n bridgeId: string\n}\n\nexport type PageLifecycleEvent =\n | 'pageShow'\n | 'pageHide'\n | 'pageUnload'\n | 'stackShow'\n | 'stackHide'\n | 'appShow'\n | 'appHide'\n\nexport interface PageLifecyclePayload {\n appSessionId: string\n bridgeId: string\n event: PageLifecycleEvent\n}\n\n/**\n * Sent by simulator after a routing action (navigateTo etc.) completes so the\n * main process can call sendCallback() against the original service-issued\n * success/fail/complete ids.\n */\nexport interface NavCallbackPayload {\n appSessionId: string\n ok: boolean\n errMsg: string\n callbacks: { success?: unknown; fail?: unknown; complete?: unknown }\n}\n\nexport interface ServiceInvokePayload {\n bridgeId: string\n msg: MessageEnvelope\n}\n\nexport interface ServicePublishPayload {\n bridgeId: string\n targetBridgeId?: string\n msg: MessageEnvelope\n}\n\n/**\n * `dmb:active-page` \u2014 simulator (DeviceShell) \u2192 main. Records which page is the\n * visible top-of-stack so main-side services (WXML/element-inspect, automation)\n * can resolve \"the active page's render webContents\" by bridgeId.\n */\nexport interface ActivePagePayload {\n appSessionId: string\n bridgeId: string\n}\n\n/**\n * `dmb:page-stack` \u2014 simulator (DeviceShell) \u2192 main. The full ordered page\n * stack (bottom\u2192top) so `App.getPageStack` can report multi-page stacks.\n */\nexport interface PageStackEntry {\n pagePath: string\n query: Record<string, unknown>\n}\n\nexport interface PageStackPayload {\n appSessionId: string\n stack: PageStackEntry[]\n}\n\nexport interface RenderInvokePayload {\n bridgeId: string\n msg: MessageEnvelope\n}\n\nexport interface RenderPublishPayload {\n bridgeId: string\n msg: MessageEnvelope\n}\n\nexport interface ToServicePayload {\n msg: MessageEnvelope\n}\n\nexport interface ToRenderPayload {\n msg: MessageEnvelope\n}\n\nexport interface SimulatorApiInvokePayload {\n bridgeId: string\n name: string\n params: unknown\n}\n\n/**\n * `simulator:nav-action` \u2014 main \u2192 simulator window, carries router/tabBar\n * intentions. Simulator owns the visual stack state and decides whether to\n * push/pop webviews; it then calls back PAGE_LIFECYCLE + NAV_CALLBACK.\n */\nexport interface NavActionPayload {\n appSessionId: string\n bridgeId: string\n name: 'navigateTo' | 'navigateBack' | 'redirectTo' | 'reLaunch' | 'switchTab'\n params: Record<string, unknown>\n callbacks: { success?: unknown; fail?: unknown; complete?: unknown }\n}\n\n/**\n * `simulator:api-call` \u2014 main \u2192 simulator. Fallback path used when an\n * invokeAPI name is not registered in the main-process `ctx.simulatorApis`\n * registry: the simulator-resident MiniApp owns the wx.* handler (it can\n * read DOM, open file pickers, etc.), so we forward the call there and wait\n * for an `API_RESPONSE` ack.\n */\nexport interface ApiCallPayload {\n appSessionId: string\n bridgeId: string\n requestId: string\n name: string\n params: Record<string, unknown>\n callbacks: { success?: unknown; fail?: unknown; complete?: unknown }\n}\n\n/**\n * `dmb:api:response` \u2014 simulator \u2192 main. Ack for an `API_CALL`. Main looks\n * up `requestId` in its pending map and fires the original service-side\n * success/fail/complete callbacks accordingly.\n */\nexport interface ApiResponsePayload {\n appSessionId: string\n requestId: string\n ok: boolean\n /** Argument the simulator-side success/fail callback was invoked with. */\n result?: unknown\n errMsg?: string\n /**\n * Persistent-subscription marker (`keep: true` APIs, e.g.\n * `audioListen`). When set, this response is one of potentially many\n * fires of the same subscription: main re-fires the service-side success\n * callback but keeps the pendingApiCall alive (does not delete it or fire\n * `complete`) so subsequent fires of the same `requestId` are delivered.\n * Cleanup happens on page/app teardown instead.\n */\n keep?: boolean\n /**\n * Handler-received acknowledgement. The simulator sends this as soon as it\n * has located a live handler for the forwarded call \u2014 before the handler\n * produces its verdict. Main disarms the no-handler watchdog but keeps the\n * pending call alive: a slow operation (large disk write, a modal waiting\n * on the user) must not be reported failed while the underlying work still\n * completes. No service-side callback fires for an ack.\n */\n ack?: boolean\n}\n\n/**\n * `simulator:tab-action` \u2014 main \u2192 simulator window, carries dynamic TabBar\n * API calls. Simulator updates TabBar React state and acknowledges via\n * NAV_CALLBACK so the service-side wx.* callback fires.\n */\nexport interface TabActionPayload {\n appSessionId: string\n bridgeId: string\n name:\n | 'setTabBarStyle'\n | 'setTabBarItem'\n | 'showTabBar'\n | 'hideTabBar'\n | 'setTabBarBadge'\n | 'removeTabBarBadge'\n | 'showTabBarRedDot'\n | 'hideTabBarRedDot'\n params: Record<string, unknown>\n callbacks: { success?: unknown; fail?: unknown; complete?: unknown }\n}\n", "/**\n * Native-host API_CALL handler installed inside the main-window preload.\n *\n * Goal: let the main devtools window double as a simulator when the\n * bridge-router forwards `simulator:api-call` to its webContents (the\n * default path in e2e tests, where `dmb:spawn` is invoked from mainWindow\n * directly with no explicit `simulatorWcId`).\n *\n * Unlike `simulator/main.tsx` (which boots a full DeviceShell + SimulatorMiniApp),\n * this runner is renderer-agnostic: it just owns a name\u2192handler table plus\n * a sentinel-based callback capture identical in shape to the simulator's\n * `runApiAsync`. The MiniAppContext stub it constructs is the smallest one\n * the built-in handlers expect (`appId`, `createCallbackFunction`, parent\n * with `el.querySelector` returning the simulated viewport rect).\n */\nimport type { MiniAppContext } from '../../simulator/types.js'\n\n// No `this` parameter: handlers are always invoked through `.call(ctx, \u2026)`\n// below with an explicit context object, so the declared type never needs to\n// constrain (or widen away) the caller's `this`.\ntype LooseApiHandler = (params?: unknown) => unknown | Promise<unknown>\n\nexport interface ApiRunVerdict {\n ok: boolean\n result?: unknown\n errMsg?: string\n}\n\ninterface ApiRunnerContext extends MiniAppContext {\n /** Dummy properties some upstream handlers introspect. */\n appId: string\n}\n\nfunction makeBaseContext(): ApiRunnerContext {\n // Minimal viewport rect: enough for handlers that read\n // `parent.el.querySelector('.dimina-native-webview__root').getBoundingClientRect()`\n // (see simulator-api.ts readWindowMetrics).\n const fakeRect = { width: 390, height: 844, x: 0, y: 0, top: 0, left: 0, right: 390, bottom: 844 }\n const fakeRoot = {\n getBoundingClientRect: () => fakeRect,\n } as unknown as Element\n return {\n appId: '',\n createCallbackFunction: () => undefined,\n parent: {\n el: {\n querySelector: () => fakeRoot,\n } as unknown as Element,\n getStatusBarRect: () => ({ height: 0 }),\n },\n }\n}\n\nexport function runApiAsync(\n handlers: Record<string, LooseApiHandler | undefined>,\n name: string,\n params: unknown,\n): Promise<ApiRunVerdict> {\n const handler = handlers[name]\n if (!handler) {\n return Promise.resolve({ ok: false, errMsg: `${name}:fail no handler` })\n }\n\n return new Promise<ApiRunVerdict>((resolve) => {\n let resolved = false\n const finish = (verdict: ApiRunVerdict): void => {\n if (resolved) return\n resolved = true\n resolve(verdict)\n }\n\n const SUCCESS = Symbol('main-cb-success')\n const FAIL = Symbol('main-cb-fail')\n const COMPLETE = Symbol('main-cb-complete')\n\n const base = makeBaseContext()\n const ctx: ApiRunnerContext = {\n ...base,\n createCallbackFunction(id: unknown) {\n if (id === undefined || id === null) return undefined\n return (...args: unknown[]) => {\n const arg = args[0]\n if (id === SUCCESS) {\n finish({ ok: true, result: arg })\n } else if (id === FAIL) {\n const errMsg =\n arg && typeof arg === 'object' && 'errMsg' in (arg as Record<string, unknown>)\n ? String((arg as { errMsg?: unknown }).errMsg)\n : `${name}:fail`\n finish({ ok: false, errMsg, result: arg })\n }\n }\n },\n }\n\n const userParams =\n params && typeof params === 'object' && !Array.isArray(params)\n ? { ...(params as Record<string, unknown>) }\n : {}\n const hadSuccess = userParams.success !== undefined && userParams.success !== null\n const hadFail = userParams.fail !== undefined && userParams.fail !== null\n const hadComplete = userParams.complete !== undefined && userParams.complete !== null\n\n userParams.success = SUCCESS\n userParams.fail = FAIL\n if (hadComplete) userParams.complete = COMPLETE\n\n try {\n const ret = (handler as LooseApiHandler).call(ctx, userParams)\n if (ret && typeof (ret as PromiseLike<unknown>).then === 'function') {\n Promise.resolve(ret as PromiseLike<unknown>).then(\n (r) => finish({ ok: true, result: r }),\n (err: unknown) => {\n const msg = err instanceof Error ? err.message : String(err)\n finish({ ok: false, errMsg: `${name}:fail ${msg}` })\n },\n )\n return\n }\n if (!hadSuccess && !hadFail) {\n finish({ ok: true, result: ret })\n }\n } catch (err: unknown) {\n const msg = err instanceof Error ? err.message : String(err)\n finish({ ok: false, errMsg: `${name}:fail ${msg}` })\n }\n })\n}\n", "import type { MiniAppContext } from './types'\n\n/**\n * Resolve the success / fail / complete callbacks of a wx.* API options\n * object in one step. Each runs through ctx.createCallbackFunction so it is\n * invoked with the proper this-binding; a missing option yields undefined.\n */\nexport function bindCallbacks(\n ctx: MiniAppContext,\n opts: { success?: unknown; fail?: unknown; complete?: unknown },\n) {\n return {\n onSuccess: ctx.createCallbackFunction(opts.success),\n onFail: ctx.createCallbackFunction(opts.fail),\n onComplete: ctx.createCallbackFunction(opts.complete),\n }\n}\n\n/**\n * Build a wx.* API stub for a capability the simulator cannot provide. The\n * returned function reports `${apiName}:fail not supported in simulator`\n * through the fail callback, then runs complete.\n */\nexport function notSupportedApi(\n apiName: string,\n): (this: MiniAppContext, opts?: { fail?: unknown; complete?: unknown }) => void {\n return function (this: MiniAppContext, opts: { fail?: unknown; complete?: unknown } = {}) {\n const { onFail, onComplete } = bindCallbacks(this, opts)\n onFail?.({ errMsg: `${apiName}:fail not supported in simulator` })\n onComplete?.()\n }\n}\n", "/**\n * DevTools API stubs for wx.xxx storage APIs (sync + async).\n *\n * Each exported function is bound with `this` = MiniApp instance\n * (via AppManager.registerApi \u2192 MiniApp.invokeApi).\n */\n\nimport type { MiniAppContext } from './types'\nimport { bindCallbacks } from './simulator-api-helpers'\n\n// \u2500\u2500\u2500 shared storage primitives \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n//\n// Every sync/async pair below (set/get/remove/clear/info) shares the same\n// underlying localStorage layout: keys are namespaced per appId, values are\n// JSON-encoded objects / stringified primitives. These helpers are the\n// single authority for that layout so the sync and async variants cannot\n// drift apart.\n\nfunction storageKeyOf(appId: string, key: string): string {\n\treturn `${appId}_${key}`\n}\n\n/** Full (still-prefixed) localStorage keys belonging to `appId`. */\nfunction collectAppKeys(appId: string): string[] {\n\tconst prefix = `${appId}_`\n\tconst keys: string[] = []\n\tfor (let i = 0; i < localStorage.length; i++) {\n\t\tconst k = localStorage.key(i)\n\t\tif (k && k.startsWith(prefix)) keys.push(k)\n\t}\n\treturn keys\n}\n\nfunction writeEntry(appId: string, key: string, data: unknown): void {\n\tconst dataString = typeof data === 'object' ? JSON.stringify(data) : String(data)\n\tlocalStorage.setItem(storageKeyOf(appId, key), dataString)\n}\n\n/** Reads one entry, JSON-parsing when possible. `undefined` means the key was never set \u2014 distinct from a stored empty string. */\nfunction readEntry(appId: string, key: string): { data: unknown } | undefined {\n\tconst raw = localStorage.getItem(storageKeyOf(appId, key))\n\tif (raw === null) return undefined\n\ttry { return { data: JSON.parse(raw) as unknown } } catch { return { data: raw } }\n}\n\nfunction clearAppKeys(appId: string): void {\n\tcollectAppKeys(appId).forEach(k => localStorage.removeItem(k))\n}\n\nfunction storageInfoOf(appId: string): { keys: string[]; currentSize: number; limitSize: number } {\n\tconst prefix = `${appId}_`\n\tconst keys: string[] = []\n\tlet currentSize = 0\n\tfor (const fullKey of collectAppKeys(appId)) {\n\t\tkeys.push(fullKey.slice(prefix.length))\n\t\tconst item = localStorage.getItem(fullKey)\n\t\tcurrentSize += item ? item.length * 2 : 0\n\t}\n\treturn { keys, currentSize, limitSize: 10 * 1024 * 1024 }\n}\n\n// \u2500\u2500\u2500 Storage (sync) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport function setStorageSync(this: MiniAppContext, { key, data }: { key: string; data: unknown }) {\n\twriteEntry(this.appId, key, data)\n}\n\nexport function getStorageSync(this: MiniAppContext, { key }: { key: string }) {\n\t// wx \u771F\u673A: a missing key returns {data: ''}, never undefined or a fail.\n\treturn readEntry(this.appId, key) ?? { data: '' }\n}\n\nexport function removeStorageSync(this: MiniAppContext, { key }: { key: string }) {\n\tlocalStorage.removeItem(storageKeyOf(this.appId, key))\n}\n\nexport function clearStorageSync(this: MiniAppContext) {\n\tclearAppKeys(this.appId)\n}\n\nexport function getStorageInfoSync(this: MiniAppContext) {\n\treturn storageInfoOf(this.appId)\n}\n\n// \u2500\u2500\u2500 Storage (async) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport function setStorage(\n\tthis: MiniAppContext,\n\t{ key, data, success, fail, complete }: { key: string; data: unknown; success?: unknown; fail?: unknown; complete?: unknown },\n) {\n\tconst { onSuccess, onFail, onComplete } = bindCallbacks(this, { success, fail, complete })\n\ttry {\n\t\twriteEntry(this.appId, key, data)\n\t\tonSuccess?.({ errMsg: 'setStorage:ok' })\n\t} catch (e) {\n\t\tonFail?.({ errMsg: `setStorage:fail ${(e as Error).message}` })\n\t}\n\tonComplete?.()\n}\n\nexport function getStorage(\n\tthis: MiniAppContext,\n\t{ key, success, fail, complete }: { key: string; success?: unknown; fail?: unknown; complete?: unknown },\n) {\n\tconst { onSuccess, onFail, onComplete } = bindCallbacks(this, { success, fail, complete })\n\t// Unlike getStorageSync, the async variant fails (not {data: ''}) on a\n\t// missing key \u2014 this is the documented wx.getStorage contract.\n\tconst entry = readEntry(this.appId, key)\n\tif (!entry) {\n\t\tonFail?.({ errMsg: 'getStorage:fail data not found' })\n\t} else {\n\t\tonSuccess?.({ data: entry.data, errMsg: 'getStorage:ok' })\n\t}\n\tonComplete?.()\n}\n\nexport function removeStorage(\n\tthis: MiniAppContext,\n\t{ key, success, fail, complete }: { key: string; success?: unknown; fail?: unknown; complete?: unknown },\n) {\n\tconst { onSuccess, onFail, onComplete } = bindCallbacks(this, { success, fail, complete })\n\ttry {\n\t\tlocalStorage.removeItem(storageKeyOf(this.appId, key))\n\t\tonSuccess?.({ errMsg: 'removeStorage:ok' })\n\t} catch (e) {\n\t\tonFail?.({ errMsg: `removeStorage:fail ${(e as Error).message}` })\n\t}\n\tonComplete?.()\n}\n\nexport function clearStorage(this: MiniAppContext, { success, complete }: { success?: unknown; complete?: unknown } = {}) {\n\tconst { onSuccess, onComplete } = bindCallbacks(this, { success, complete })\n\tclearAppKeys(this.appId)\n\tonSuccess?.({ errMsg: 'clearStorage:ok' })\n\tonComplete?.()\n}\n\nexport function getStorageInfo(this: MiniAppContext, { success, complete }: { success?: unknown; complete?: unknown } = {}) {\n\tconst { onSuccess, onComplete } = bindCallbacks(this, { success, complete })\n\tconst info = storageInfoOf(this.appId)\n\tonSuccess?.({ ...info, errMsg: 'getStorageInfo:ok' })\n\tonComplete?.()\n}\n", "/**\n * DevTools API stubs for device-related wx.xxx APIs\n * (keyboard / phone / contact / vibrate / scan).\n *\n * Each exported function is bound with `this` = MiniApp instance\n * (via AppManager.registerApi \u2192 MiniApp.invokeApi).\n */\n\nimport type { MiniAppContext } from './types'\nimport { bindCallbacks, notSupportedApi } from './simulator-api-helpers'\n\n// \u2500\u2500\u2500 Device: Keyboard \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport function hideKeyboard(this: MiniAppContext, { success, complete }: { success?: unknown; complete?: unknown } = {}) {\n\tconst { onSuccess, onComplete } = bindCallbacks(this, { success, complete })\n\t// In web, blur the active element to dismiss virtual keyboard\n\tif (document.activeElement && typeof (document.activeElement as HTMLElement).blur === 'function') {\n\t\t;(document.activeElement as HTMLElement).blur()\n\t}\n\tonSuccess?.({ errMsg: 'hideKeyboard:ok' })\n\tonComplete?.()\n}\n\nexport function adjustPosition(this: MiniAppContext, { success, complete }: { success?: unknown; complete?: unknown } = {}) {\n\tconst { onSuccess, onComplete } = bindCallbacks(this, { success, complete })\n\tonSuccess?.({ errMsg: 'adjustPosition:ok' })\n\tonComplete?.()\n}\n\n// \u2500\u2500\u2500 Device: Phone \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport function makePhoneCall(\n\tthis: MiniAppContext,\n\t{ phoneNumber, success, fail, complete }: { phoneNumber: string; success?: unknown; fail?: unknown; complete?: unknown },\n) {\n\tconst { onSuccess, onFail, onComplete } = bindCallbacks(this, { success, fail, complete })\n\n\ttry {\n\t\twindow.open(`tel:${phoneNumber}`)\n\t\tonSuccess?.({ errMsg: 'makePhoneCall:ok' })\n\t} catch (error) {\n\t\tonFail?.({ errMsg: `makePhoneCall:fail ${(error as Error).message}` })\n\t}\n\tonComplete?.()\n}\n\n// \u2500\u2500\u2500 Device: Contact (stub) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport const chooseContact = notSupportedApi('chooseContact')\n\nexport const addPhoneContact = notSupportedApi('addPhoneContact')\n\n// \u2500\u2500\u2500 Device: Vibrate (stub) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport function vibrateShort(this: MiniAppContext, { success, complete }: { type?: string; success?: unknown; complete?: unknown } = {}) {\n\tconst { onSuccess, onComplete } = bindCallbacks(this, { success, complete })\n\t// Navigator.vibrate is available in some browsers\n\tif (navigator.vibrate) navigator.vibrate(15)\n\tonSuccess?.({ errMsg: 'vibrateShort:ok' })\n\tonComplete?.()\n}\n\nexport function vibrateLong(this: MiniAppContext, { success, complete }: { success?: unknown; complete?: unknown } = {}) {\n\tconst { onSuccess, onComplete } = bindCallbacks(this, { success, complete })\n\tif (navigator.vibrate) navigator.vibrate(400)\n\tonSuccess?.({ errMsg: 'vibrateLong:ok' })\n\tonComplete?.()\n}\n\n// \u2500\u2500\u2500 Device: Scan (stub) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport const scanCode = notSupportedApi('scanCode')\n\n// \u2500\u2500\u2500 Device: Clipboard \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\ninterface ClipboardBridge {\n\treadText(): string\n\twriteText(text: string): void\n}\n\nfunction getClipboardBridge(): ClipboardBridge | undefined {\n\treturn (window as unknown as Record<string, unknown>).__diminaClipboard as ClipboardBridge | undefined\n}\n\nexport function getClipboardData(\n\tthis: MiniAppContext,\n\t{ success, fail, complete }: { success?: unknown; fail?: unknown; complete?: unknown } = {},\n) {\n\tconst { onSuccess, onFail, onComplete } = bindCallbacks(this, { success, fail, complete })\n\tconst bridge = getClipboardBridge()\n\tif (!bridge) {\n\t\tonFail?.({ errMsg: 'getClipboardData:fail clipboard bridge unavailable' })\n\t\tonComplete?.()\n\t\treturn\n\t}\n\ttry {\n\t\tconst data = bridge.readText()\n\t\tonSuccess?.({ data, errMsg: 'getClipboardData:ok' })\n\t} catch (error: unknown) {\n\t\tonFail?.({ errMsg: `getClipboardData:fail ${(error as Error)?.message ?? error}` })\n\t}\n\tonComplete?.()\n}\n\nexport function setClipboardData(\n\tthis: MiniAppContext,\n\t{ data, success, fail, complete }: { data?: string; success?: unknown; fail?: unknown; complete?: unknown } = {},\n) {\n\tconst { onSuccess, onFail, onComplete } = bindCallbacks(this, { success, fail, complete })\n\tif (typeof data !== 'string') {\n\t\tonFail?.({ errMsg: 'setClipboardData:fail data is required' })\n\t\tonComplete?.()\n\t\treturn\n\t}\n\tconst bridge = getClipboardBridge()\n\tif (!bridge) {\n\t\tonFail?.({ errMsg: 'setClipboardData:fail clipboard bridge unavailable' })\n\t\tonComplete?.()\n\t\treturn\n\t}\n\ttry {\n\t\tbridge.writeText(data)\n\t\tonSuccess?.({ errMsg: 'setClipboardData:ok' })\n\t} catch (error: unknown) {\n\t\tonFail?.({ errMsg: `setClipboardData:fail ${(error as Error)?.message ?? error}` })\n\t}\n\tonComplete?.()\n}\n\n// \u2500\u2500\u2500 Device: Network type \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport type NetworkType = 'wifi' | '2g' | '3g' | '4g' | '5g' | 'none' | 'unknown'\n\ninterface NetworkInfo {\n\tonLine: boolean\n\t/** NetworkInformation.type (e.g. 'wifi' / 'ethernet' / 'cellular'). */\n\ttype?: string\n\t/** NetworkInformation.effectiveType (e.g. '4g' / '3g' / '2g' / 'slow-2g'). */\n\teffectiveType?: string\n}\n\nfunction mapEffectiveType(effectiveType?: string): NetworkType {\n\tswitch (effectiveType) {\n\t\tcase '4g':\n\t\t\treturn '4g'\n\t\tcase '3g':\n\t\t\treturn '3g'\n\t\tcase '2g':\n\t\tcase 'slow-2g':\n\t\t\treturn '2g'\n\t\tdefault:\n\t\t\treturn 'unknown'\n\t}\n}\n\n/**\n * Best-effort map from the browser's NetworkInformation to the WeChat\n * `getNetworkType` vocabulary. The host machine is almost always on wifi or\n * ethernet, so an online connection with no finer signal reports 'wifi'.\n */\nexport function resolveNetworkType(info: NetworkInfo): NetworkType {\n\tif (!info.onLine) return 'none'\n\tif (info.type === 'wifi' || info.type === 'ethernet') return 'wifi'\n\tif (info.type === 'cellular') return mapEffectiveType(info.effectiveType)\n\tif (info.effectiveType) return mapEffectiveType(info.effectiveType)\n\treturn 'wifi'\n}\n\nexport function getNetworkType(\n\tthis: MiniAppContext,\n\t{ success, complete }: { success?: unknown; complete?: unknown } = {},\n) {\n\tconst { onSuccess, onComplete } = bindCallbacks(this, { success, complete })\n\tconst connection = (navigator as Navigator & {\n\t\tconnection?: { type?: string; effectiveType?: string }\n\t}).connection\n\tconst networkType = resolveNetworkType({\n\t\tonLine: navigator.onLine,\n\t\ttype: connection?.type,\n\t\teffectiveType: connection?.effectiveType,\n\t})\n\tonSuccess?.({ networkType, errMsg: 'getNetworkType:ok' })\n\tonComplete?.()\n}\n", "/**\n * Generic DOM-event \u2192 service-callback bridge.\n *\n * Container-side media APIs (audio, and in future recorder / video) need to\n * forward DOM media events on an `HTMLMediaElement` out to the mini-program\n * service layer. This helper centralises the \"bind a set of DOM events, build\n * a typed payload, invoke `fire`, return a disposer\" pattern so each media API\n * does not re-implement it.\n */\n\n/**\n * Builds the payload handed to `fire` for a given mini-program event name.\n * Receives the mini-program event name (already mapped from the DOM name) and\n * the DOM event, and returns the object delivered to the service callback.\n */\nexport type PayloadBuilder<P> = (event: string, domEvent: Event) => P\n\n/** Disposer returned by {@link bindDomEvents}; unbinds every listener. */\nexport type EventBridgeDisposer = () => void\n\n/**\n * Bind a batch of DOM events on `target`.\n *\n * @param target The EventTarget (e.g. an `HTMLAudioElement`) to listen on.\n * @param eventMap Map of DOM event name \u2192 mini-program event name.\n * @param fire The service callback; called once per DOM event with the\n * payload produced by `buildPayload`.\n * @param buildPayload Produces the typed payload for `fire`.\n * @returns A disposer that removes every listener registered by this call.\n */\nexport function bindDomEvents<P>(\n\ttarget: EventTarget,\n\teventMap: Record<string, string>,\n\tfire: (payload: P) => void,\n\tbuildPayload: PayloadBuilder<P>,\n): EventBridgeDisposer {\n\tconst registered: Array<[string, EventListener]> = []\n\n\tfor (const [domName, miniName] of Object.entries(eventMap)) {\n\t\tconst listener: EventListener = (domEvent) => {\n\t\t\tfire(buildPayload(miniName, domEvent))\n\t\t}\n\t\ttarget.addEventListener(domName, listener)\n\t\tregistered.push([domName, listener])\n\t}\n\n\treturn () => {\n\t\tfor (const [domName, listener] of registered) {\n\t\t\ttarget.removeEventListener(domName, listener)\n\t\t}\n\t\tregistered.length = 0\n\t}\n}\n", "/**\n * Bridge for real Node built-ins in browser-bundled renderer documents.\n *\n * The simulator document runs with nodeIntegration OFF and its vite bundle\n * stubs `node:*` imports with truthy-but-empty objects, while its preload\n * (sandbox:false + contextIsolation:false \u2014 one shared JS world with the\n * page) has full Node access. The preload publishes the real modules on this\n * global; browser-side consumers (the vpath resolver, the FileSystemManager\n * backends) read them from here.\n *\n * Consumers MUST validate that the member they need is a function \u2014 never\n * trust truthiness, the vite stubs are truthy objects.\n */\n\nexport const NODE_BINDINGS_GLOBAL = '__diminaNodeBindings'\n\nexport interface DiminaNodeBindings {\n\tfs?: typeof import('node:fs')\n\tpath?: typeof import('node:path')\n\tos?: typeof import('node:os')\n\tcrypto?: typeof import('node:crypto')\n\tbuffer?: typeof import('node:buffer')\n}\n\nexport function getNodeBindings(): DiminaNodeBindings {\n\tconst bag = (globalThis as Record<string, unknown>)[NODE_BINDINGS_GLOBAL]\n\treturn (bag && typeof bag === 'object' ? bag : {}) as DiminaNodeBindings\n}\n", "/**\n * Runtime vpath resolver.\n *\n * Spec: `docs/file-system.md` \u2014 single resolver shared by every FSM\n * entry, the renderer-side temp store, and the main-process\n * protocol.handle / disk reader.\n *\n * resolveVPath(url): { kind, writable, realPath? } | null\n *\n * - `difile://_tmp/<id>` \u2192 kind=tmp, writable=false, no realPath\n * - `difile://_store/<id>` \u2192 kind=store, writable=false, realPath in base\n * - `difile://<rel>` \u2192 kind=usr, writable=true, realPath in base\n *\n * Security invariants (the resolver returns `null` instead of throwing):\n * - any non-`difile://` scheme is rejected outright;\n * - any `..` segment (raw or URL-encoded) is rejected before canonicalize;\n * - after `path.normalize` the resulting `realPath` MUST stay inside the\n * sandbox base; otherwise `null`;\n * - reserved prefixes `_tmp/` and `_store/` are case-sensitive \u2014 `_TMP/`,\n * `_Tmp/`, etc. fall through to the user-data namespace.\n */\n\n// Main-process (Node ESM) resolves these natively. The simulator document's\n// vite bundle stubs them with truthy-but-empty objects, and its renderer DOES\n// enter the `store`/`usr` branches (the FileSystemManager backends run\n// there) \u2014 so probe a required function on the static import and fall back to\n// the preload-published node bindings (see ./node-bindings.ts).\nimport osStatic from 'node:os'\nimport pathStatic from 'node:path'\nimport { getNodeBindings } from './node-bindings.js'\n\nconst os: typeof import('os') =\n\ttypeof osStatic?.homedir === 'function' ? osStatic : (getNodeBindings().os ?? osStatic)\nconst path: typeof import('path') =\n\ttypeof pathStatic?.join === 'function' ? pathStatic : (getNodeBindings().path ?? pathStatic)\n\nexport type VPathKind = 'tmp' | 'store' | 'usr'\n\nexport interface ResolvedVPath {\n\tkind: VPathKind\n\t/** `tmp` and `store` are runtime-owned and read-only; `usr` is writable. */\n\twritable: boolean\n\t/**\n\t * Canonical local path on disk for `store` / `usr` kinds (always within the\n\t * USER_DATA_PATH base directory after canonicalize). `tmp` kind has no\n\t * realPath \u2014 the bytes live in the renderer-side Blob Map.\n\t */\n\trealPath?: string\n}\n\nconst DIFILE_PREFIX = 'difile://'\n\n/**\n * USER_DATA_PATH sandbox base. Looked up dynamically on every call so test\n * doubles (e.g. monkey-patching `os.homedir`) and the `DIMINA_HOME` env\n * override apply per invocation. The env override exists for headless test\n * affordance and to keep the renderer/main store sharing one base.\n */\nexport function sandboxBase(): string {\n\tconst env = (typeof process !== 'undefined' && process.env && process.env.DIMINA_HOME) || ''\n\tif (env) {\n\t\treturn path.join(env, 'files')\n\t}\n\treturn path.join(os.homedir(), '.dimina', 'files')\n}\n\nexport function resolveVPath(url: unknown): ResolvedVPath | null {\n\tif (typeof url !== 'string') return null\n\tif (!url.startsWith(DIFILE_PREFIX)) return null\n\n\tconst raw = url.slice(DIFILE_PREFIX.length)\n\tif (raw.length === 0) return null\n\n\t// Decode URL-encoded sequences first so `%2e%2e` style escapes are caught\n\t// by the segment check below.\n\tlet decoded: string\n\ttry {\n\t\tdecoded = decodeURIComponent(raw)\n\t} catch {\n\t\treturn null\n\t}\n\n\t// Reject NUL bytes (raw or %00) \u2014 Node `fs.*` throws TypeError on a NUL\n\t// in the path, bypassing the API's `fail` callback and crashing the\n\t// renderer. Pull the rejection up to the validator.\n\tif (decoded.includes('\\0')) return null\n\n\t// `wx.env.USER_DATA_PATH` is `'difile://usr'` (upstream `core/base`), but\n\t// hand-written paths also arrive as `difile:///foo.txt` (extra slashes\n\t// after the scheme). Strip leading slashes so both spellings path-join\n\t// cleanly under the sandbox base.\n\tdecoded = decoded.replace(/^[/\\\\]+/, '')\n\tif (decoded.length === 0) return null\n\n\t// Reject any '..' or '.' segment after decoding. We split on both '/' and\n\t// '\\\\' so Windows-style separators cannot smuggle a traversal segment past\n\t// the validator on POSIX hosts.\n\tconst segments = decoded.split(/[/\\\\]+/)\n\tif (segments.some(s => s === '..' || s === '.')) return null\n\n\t// Classify by reserved prefix (case-sensitive \u2014 `_TMP/` is a user file).\n\tlet kind: VPathKind\n\tlet writable: boolean\n\tif (decoded.startsWith('_tmp/')) {\n\t\tkind = 'tmp'\n\t\twritable = false\n\t} else if (decoded.startsWith('_store/')) {\n\t\tkind = 'store'\n\t\twritable = false\n\t} else {\n\t\tkind = 'usr'\n\t\twritable = true\n\t}\n\n\t// `tmp` lives in the renderer Blob Map \u2014 no realPath.\n\tif (kind === 'tmp') {\n\t\treturn { kind, writable }\n\t}\n\n\t// `store` / `usr`: anchor under the sandbox base and assert containment\n\t// after normalization. Defense in depth against any traversal that the\n\t// segment check above missed (e.g. backslash trickery on POSIX).\n\tconst base = sandboxBase()\n\tconst joined = path.join(base, decoded)\n\tconst normalized = path.normalize(joined)\n\tif (normalized !== base && !normalized.startsWith(base + path.sep)) return null\n\n\treturn { kind, writable, realPath: normalized }\n}\n", "/**\n * Devtools simulator temp-file registry.\n *\n * The simulator hands `chooseImage` / `chooseMedia` / `chooseVideo` /\n * `compressImage` etc. results back to mini-program code as paths. Historically\n * those paths were `blob:` URLs allocated via `URL.createObjectURL`, but the\n * blob: scheme is local-to-the-renderer and cannot be served back into the\n * webview's `persist:simulator` session through a `protocol.handle`. We switched\n * to a custom `difile://_tmp/{uuid}` scheme so the main process can\n * register a single `difile://` protocol handler and stream the bytes for any\n * path, regardless of which renderer originally produced it.\n *\n * To keep the renderer-side cache and the main-process byte store in sync,\n * `setTempFileSink` lets the preload bridge inject a sink that mirrors every\n * `write` / `revoke` / `revokeAll` over IPC. Tests inject a stub sink.\n */\n\nexport interface TempFileSink {\n\twrite(path: string, blob: Blob): void\n\trevoke(path: string): void\n\trevokeAll(): void\n}\n\nconst tempFiles = new Map<string, Blob>()\nlet activeSink: TempFileSink | null = null\n\nexport function setTempFileSink(sink: TempFileSink | null): void {\n\tactiveSink = sink\n}\n\nfunction cryptoRandomId(): string {\n\tconst c = (globalThis as { crypto?: { randomUUID?: () => string } }).crypto\n\tif (c && typeof c.randomUUID === 'function') return c.randomUUID()\n\treturn `${Date.now()}-${Math.random().toString(36).slice(2)}`\n}\n\nexport function createTempFilePath(blob: Blob): string {\n\tconst path = `difile://_tmp/${cryptoRandomId()}`\n\ttempFiles.set(path, blob)\n\tactiveSink?.write(path, blob)\n\treturn path\n}\n\nexport function registerTempFilePath(path: string, blob: Blob): void {\n\ttempFiles.set(path, blob)\n\tactiveSink?.write(path, blob)\n}\n\nexport function revokeTempFilePath(path: string): void {\n\ttempFiles.delete(path)\n\tactiveSink?.revoke(path)\n}\n\nexport function revokeAllTempFilePaths(): void {\n\ttempFiles.clear()\n\tactiveSink?.revokeAll()\n}\n\nexport async function resolveTempFilePath(path: string): Promise<Blob> {\n\tconst cached = tempFiles.get(path)\n\tif (cached) return cached\n\n\tconst response = await fetch(path)\n\tif (!response.ok) {\n\t\tthrow new Error(`\u65E0\u6CD5\u8BFB\u53D6\u6587\u4EF6 ${path}`)\n\t}\n\tconst blob = await response.blob()\n\t// Cache the freshly fetched blob in-memory so subsequent reads are local.\n\t// We bypass `registerTempFilePath` deliberately: this is a renderer-only\n\t// cache fill, the main-process store already has the bytes (otherwise the\n\t// fetch would not have returned them), so triggering sink.write would\n\t// produce a redundant IPC.\n\ttempFiles.set(path, blob)\n\treturn blob\n}\n\nexport function getTempFileName(path: string, blob: Blob, fallback = 'file'): string {\n\tconst named = blob as Blob & { name?: unknown }\n\tif (typeof named.name === 'string' && named.name.trim()) {\n\t\treturn named.name\n\t}\n\n\ttry {\n\t\tconst url = new URL(path, window.location.href)\n\t\tconst segment = url.pathname.split('/').filter(Boolean).pop()\n\t\tif (segment) return decodeURIComponent(segment)\n\t} catch {\n\t\t// Fall through to the caller-provided fallback.\n\t}\n\n\treturn fallback\n}\n", "/**\n * DevTools API stubs for filesystem wx.xxx APIs\n * (container-side handlers for service-apis/file).\n *\n * Each exported function is bound with `this` = MiniApp instance\n * (via AppManager.registerApi \u2192 MiniApp.invokeApi).\n *\n * Contract (see `docs/file-system.md`):\n * - Every entry point routes its caller-supplied path through `resolveVPath`\n * (single resolver), which rejects non-`difile://` schemes, absolute\n * filesystem paths, and any `..` traversal.\n * - Write-class APIs (writeFile / appendFile / unlink / mkdir / rmdir /\n * truncate / rename(dest) / copyFile(dest)) refuse `difile://_tmp/*` and\n * `difile://_store/*` with `permission denied` \u2014 those namespaces are\n * runtime-owned and read-only, matching wx \u771F\u673A semantics.\n * - `fsSaveFile` returns a `difile://_store/{uuid}.{ext}` vpath, never a\n * real disk path.\n */\n\nimport type { MiniAppContext } from './types'\nimport { bindCallbacks } from './simulator-api-helpers'\nimport { getNodeBindings } from '../shared/node-bindings.js'\nimport { resolveVPath, sandboxBase, type ResolvedVPath } from '../shared/vpath.js'\nimport { resolveTempFilePath } from './temp-files'\n\n/**\n * Dispatch helper: pull a `_tmp/*` Blob out of the renderer Map and hand back\n * its bytes. Throws an ENOENT-shaped Error if the URL is unknown, so callers\n * can surface a `fail` with a real not-found message.\n */\nasync function _tmpBytes(url: string): Promise<Buffer> {\n\ttry {\n\t\tconst blob = await resolveTempFilePath(url)\n\t\treturn await blobToBuffer(blob)\n\t}\n\tcatch (err) {\n\t\tconst msg = err instanceof Error ? err.message : String(err)\n\t\tthrow new Error(`ENOENT: no such file (${url}): ${msg}`, { cause: err })\n\t}\n}\n\nfunction isArrayBuffer(value: unknown): value is ArrayBuffer {\n\treturn Object.prototype.toString.call(value) === '[object ArrayBuffer]'\n}\n\n/**\n * `Buffer` for Blob materialization: the simulator document has no global\n * `Buffer` (nodeIntegration is off and the vite bundle does not polyfill\n * it), so take the constructor from the preload-published node bindings;\n * vitest/node contexts have the global.\n */\nconst BufferImpl: typeof Buffer | undefined =\n\tgetNodeBindings().buffer?.Buffer ?? (typeof Buffer !== 'undefined' ? Buffer : undefined)\n\nasync function blobToBuffer(blob: Blob): Promise<Buffer> {\n\tif (!BufferImpl) {\n\t\tthrow new Error('Buffer binding unavailable')\n\t}\n\tconst readable = blob as Blob & { arrayBuffer?: () => Promise<ArrayBuffer> }\n\tif (typeof readable.arrayBuffer === 'function') {\n\t\tconst ab = await readable.arrayBuffer()\n\t\treturn BufferImpl.from(new Uint8Array(ab))\n\t}\n\n\tif (typeof FileReader !== 'function') {\n\t\tthrow new Error('Blob cannot be read as ArrayBuffer')\n\t}\n\n\treturn new Promise((resolve, reject) => {\n\t\tconst reader = new FileReader()\n\t\treader.onerror = () => reject(reader.error ?? new Error('Blob read failed'))\n\t\treader.onload = () => {\n\t\t\tconst result = reader.result\n\t\t\tif (!isArrayBuffer(result)) {\n\t\t\t\treject(new Error('Blob read did not return an ArrayBuffer'))\n\t\t\t\treturn\n\t\t\t}\n\t\t\tresolve(BufferImpl.from(new Uint8Array(result)))\n\t\t}\n\t\treader.readAsArrayBuffer(blob)\n\t})\n}\n\n/**\n * Real Node built-ins: the preload-published bindings in the simulator\n * document (nodeIntegration is off there and the vite bundle stubs `node:*`\n * imports), `require` under vitest/node. Each candidate is validated by\n * probing a required member function \u2014 the vite stubs are truthy objects, so\n * truthiness alone would wave a dead module through and the guard below\n * (`guardFsAvailable`) would then let calls crash mid-handler.\n */\nfunction resolveNodeModule<T>(fromBindings: T | undefined, name: string, probe: (mod: T) => boolean): T {\n\tif (fromBindings && probe(fromBindings)) return fromBindings\n\tif (typeof require !== 'undefined') {\n\t\t// eslint-disable-next-line @typescript-eslint/no-require-imports\n\t\tconst mod = require(name) as T\n\t\tif (mod && probe(mod)) return mod\n\t}\n\treturn null as unknown as T\n}\n\nconst _fs = resolveNodeModule(getNodeBindings().fs, 'fs', m => typeof m.readFile === 'function')\nconst _path = resolveNodeModule(getNodeBindings().path, 'path', m => typeof m.join === 'function')\nconst _crypto = resolveNodeModule(getNodeBindings().crypto, 'crypto', m => typeof m.createHash === 'function')\n\ntype FsCallbacks = ReturnType<typeof bindCallbacks>\ntype NodeStats = import('fs').Stats\ntype NodeErr = NodeJS.ErrnoException | Error | null\n\n// \u2500\u2500\u2500 shared fs-API scaffolding \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n//\n// Every handler below shares the same skeleton: bail if Node `fs` isn't\n// available, resolve the caller path through the single vpath resolver\n// (bailing on invalid/unsafe paths), optionally reject read-only\n// namespaces for write-class APIs, then run a Node fs call and translate its\n// `(err, ...)` callback into the wx success/fail/complete triad. The helpers\n// below are the single authority for each of those steps so per-API bodies\n// only contain what differs between APIs (the real fs call and any extra\n// success payload fields).\n\n/** Bails with `${apiName}:fail not available in browser context` when the Node `fs` binding is absent (e.g. a browser-only build). */\nfunction guardFsAvailable(apiName: string, cbs: FsCallbacks): boolean {\n\tif (_fs) return false\n\tcbs.onFail?.({ errMsg: `${apiName}:fail not available in browser context` })\n\tcbs.onComplete?.()\n\treturn true\n}\n\n/**\n * True when any path component from the sandbox base down to `realPath` is a\n * symlink. `resolveVPath` validates the requested STRING (no `..`, stays\n * under the base after normalize) but never inspects the disk \u2014 a symlink\n * planted inside `usr/` would otherwise let Node's default follow-symlinks\n * behavior read or write through to a target outside the sandbox. `lstat`\n * (not `stat`/`exists`) sees the link itself, so dangling links \u2014 which\n * `fs.writeFile` would still follow to CREATE the outside target \u2014 are\n * caught too. The base itself may legitimately be a symlink (macOS tmpdir);\n * only components below it are checked.\n */\nfunction containsSymlink(realPath: string): boolean {\n\tconst rel = _path.relative(sandboxBase(), realPath)\n\tif (!rel || rel.startsWith('..')) return false\n\tlet cur = sandboxBase()\n\tfor (const seg of rel.split(_path.sep)) {\n\t\tcur = _path.join(cur, seg)\n\t\tlet entry: import('fs').Stats\n\t\ttry {\n\t\t\tentry = _fs.lstatSync(cur)\n\t\t} catch {\n\t\t\t// Nothing on disk from here down \u2014 nothing left to follow.\n\t\t\treturn false\n\t\t}\n\t\tif (entry.isSymbolicLink()) return true\n\t}\n\treturn false\n}\n\n/**\n * Resolves `p` via `resolveVPath` and asserts the resolved disk path does not\n * pass through a sandbox-internal symlink, or reports `${apiName}:fail\n * invalid or unsafe path` and runs `complete`.\n */\nfunction resolveOrBail(p: unknown, apiName: string, cbs: FsCallbacks): ResolvedVPath | undefined {\n\tconst v = resolveVPath(p)\n\tif (v && (!v.realPath || !_fs || !containsSymlink(v.realPath))) return v\n\tcbs.onFail?.({ errMsg: `${apiName}:fail invalid or unsafe path` })\n\tcbs.onComplete?.()\n\treturn undefined\n}\n\n/**\n * wx `Stats` payload: numeric mode bits, byte size, SECOND-unit epoch\n * timestamps \u2014 wx and the dimina native clients all report seconds, while\n * Node's `atimeMs`/`mtimeMs` are milliseconds.\n */\nfunction toWxStats(s: NodeStats): Record<string, unknown> {\n\treturn {\n\t\tsize: s.size,\n\t\tmode: s.mode,\n\t\tlastAccessedTime: Math.floor(s.atimeMs / 1000),\n\t\tlastModifiedTime: Math.floor(s.mtimeMs / 1000),\n\t\tisFile: s.isFile(),\n\t\tisDirectory: s.isDirectory(),\n\t}\n}\n\n/**\n * Type-guards `v` as writable (narrows `realPath` to `string`), or reports\n * `${apiName}:fail permission denied` and runs `complete`. `_tmp` / `_store`\n * are runtime-owned and read-only, matching wx \u771F\u673A semantics.\n */\nfunction ensureWritable(v: ResolvedVPath, apiName: string, cbs: FsCallbacks): v is ResolvedVPath & { realPath: string } {\n\tif (v.writable && v.realPath) return true\n\tcbs.onFail?.({ errMsg: `${apiName}:fail permission denied` })\n\tcbs.onComplete?.()\n\treturn false\n}\n\n/** Fail handler for a `_tmpBytes(...).then(success, ...)` chain: reports `${apiName}:fail <message>` and runs `complete`. */\nfunction tmpFailHandler(apiName: string, cbs: FsCallbacks) {\n\treturn (err: Error) => {\n\t\tcbs.onFail?.({ errMsg: `${apiName}:fail ${err.message}` })\n\t\tcbs.onComplete?.()\n\t}\n}\n\n/**\n * Builds a Node-style `(err, ...args)` callback that translates into the wx\n * success/fail/complete triad: `err` truthy \u2192 fail with `${apiName}:fail\n * <message>`; otherwise success with `${apiName}:ok` plus whatever\n * `buildOk(...args)` contributes.\n */\nfunction nodeComplete<TArgs extends unknown[] = []>(\n\tapiName: string,\n\tcbs: FsCallbacks,\n\tbuildOk?: (...args: TArgs) => Record<string, unknown> | undefined,\n) {\n\treturn (err: NodeErr, ...args: TArgs) => {\n\t\tif (err) {\n\t\t\tcbs.onFail?.({ errMsg: `${apiName}:fail ${err.message}` })\n\t\t} else {\n\t\t\tcbs.onSuccess?.({ ...(buildOk ? buildOk(...args) : undefined), errMsg: `${apiName}:ok` })\n\t\t}\n\t\tcbs.onComplete?.()\n\t}\n}\n\n/**\n * `mkdir -p` the parent of `destReal`, then run `writeFn` (a `writeFile` /\n * `copyFile` call) through `nodeComplete`. Shared by every API that\n * materializes bytes onto disk under a possibly-not-yet-existing directory\n * (fsWriteFile, fsCopyFile's `_tmp` branch, fsSaveFile).\n */\nfunction mkdirpThenWrite(\n\tdestReal: string,\n\tapiName: string,\n\tcbs: FsCallbacks,\n\twriteFn: (done: (err: NodeErr) => void) => void,\n\tokExtra?: Record<string, unknown>,\n): void {\n\t_fs.mkdir(_path.dirname(destReal), { recursive: true }, (mkdirErr) => {\n\t\tif (mkdirErr) {\n\t\t\tcbs.onFail?.({ errMsg: `${apiName}:fail ${mkdirErr.message}` })\n\t\t\tcbs.onComplete?.()\n\t\t\treturn\n\t\t}\n\t\t// fs.writeFile/copyFile validate their arguments synchronously (a\n\t\t// numeric `data`, an unknown `encoding`); this callback runs after the\n\t\t// wire handler's own try/catch has already returned, so an unguarded\n\t\t// throw here would leave the call with no verdict at all.\n\t\ttry {\n\t\t\twriteFn(nodeComplete(apiName, cbs, () => okExtra))\n\t\t} catch (err) {\n\t\t\tcbs.onFail?.({ errMsg: `${apiName}:fail ${err instanceof Error ? err.message : String(err)}` })\n\t\t\tcbs.onComplete?.()\n\t\t}\n\t})\n}\n\nexport function fsAccess(\n\tthis: MiniAppContext,\n\t{ path, success, fail, complete }: { path: string; success?: unknown; fail?: unknown; complete?: unknown },\n) {\n\tconst cbs = bindCallbacks(this, { success, fail, complete })\n\tconst { onSuccess, onFail, onComplete } = cbs\n\tif (guardFsAvailable('fsAccess', cbs)) return\n\tconst v = resolveOrBail(path, 'fsAccess', cbs)\n\tif (!v) return\n\tif (v.kind === 'tmp') {\n\t\t// _tmp existence check: renderer Map hit \u21D2 ok; miss \u21D2 ENOENT-shaped fail.\n\t\t_tmpBytes(path).then(\n\t\t\t() => { onSuccess?.({ errMsg: 'fsAccess:ok' }); onComplete?.() },\n\t\t\ttmpFailHandler('fsAccess', cbs),\n\t\t)\n\t\treturn\n\t}\n\tif (!v.realPath) {\n\t\tonFail?.({ errMsg: 'fsAccess:fail invalid path' })\n\t\tonComplete?.()\n\t\treturn\n\t}\n\t_fs.access(v.realPath, _fs.constants.F_OK, nodeComplete('fsAccess', cbs))\n}\n\nexport function fsStat(\n\tthis: MiniAppContext,\n\t{ path, recursive = false, success, fail, complete }: {\n\t\tpath: string\n\t\trecursive?: boolean\n\t\tsuccess?: unknown\n\t\tfail?: unknown\n\t\tcomplete?: unknown\n\t},\n) {\n\tconst cbs = bindCallbacks(this, { success, fail, complete })\n\tconst { onSuccess, onFail, onComplete } = cbs\n\tif (guardFsAvailable('fsStat', cbs)) return\n\tconst v = resolveOrBail(path, 'fsStat', cbs)\n\tif (!v) return\n\tif (v.kind === 'tmp') {\n\t\t// _tmp size is known from the Blob; mtime is 0 (no on-disk timestamp).\n\t\t_tmpBytes(path).then(\n\t\t\t(buf) => {\n\t\t\t\tonSuccess?.({\n\t\t\t\t\tstats: {\n\t\t\t\t\t\tsize: buf.length,\n\t\t\t\t\t\tmode: 0,\n\t\t\t\t\t\tlastAccessedTime: 0,\n\t\t\t\t\t\tlastModifiedTime: 0,\n\t\t\t\t\t\tisFile: true,\n\t\t\t\t\t\tisDirectory: false,\n\t\t\t\t\t},\n\t\t\t\t\terrMsg: 'fsStat:ok',\n\t\t\t\t})\n\t\t\t\tonComplete?.()\n\t\t\t},\n\t\t\ttmpFailHandler('fsStat', cbs),\n\t\t)\n\t\treturn\n\t}\n\tif (!v.realPath) {\n\t\tonFail?.({ errMsg: 'fsStat:fail invalid path' })\n\t\tonComplete?.()\n\t\treturn\n\t}\n\tconst resolved = v.realPath\n\tif (recursive) {\n\t\t// Map of RELATIVE path \u2192 stats for the tree, keyed the way wx and the\n\t\t// dimina native clients key it: the queried directory itself as \".\"\n\t\t// plus `relative(root, entry)`-style descendants \u2014 never a host\n\t\t// absolute path (that would leak the sandbox location to mini-program\n\t\t// code). Any readdir/stat error fails the whole call: silently\n\t\t// dropping a failed entry would present an incomplete tree as ok.\n\t\tconst statsMap: Record<string, unknown> = {}\n\t\tlet settled = false\n\t\tconst failOnce = (err: Error) => {\n\t\t\tif (settled) return\n\t\t\tsettled = true\n\t\t\tonFail?.({ errMsg: `fsStat:fail ${err.message}` })\n\t\t\tonComplete?.()\n\t\t}\n\t\tconst okOnce = () => {\n\t\t\tif (settled) return\n\t\t\tsettled = true\n\t\t\tonSuccess?.({ stats: statsMap, errMsg: 'fsStat:ok' })\n\t\t\tonComplete?.()\n\t\t}\n\t\tconst relKey = (full: string): string => {\n\t\t\tconst rel = _path.relative(resolved, full)\n\t\t\treturn rel === '' ? '.' : rel.split(_path.sep).join('/')\n\t\t}\n\t\t// `lstat`, never `stat`: `resolveOrBail`'s symlink fence only inspects\n\t\t// the REQUESTED root path \u2014 a symlink discovered mid-walk would\n\t\t// otherwise be followed (leaking sandbox-external metadata into the\n\t\t// map) while its Dirent still reads as a non-directory (leaving a\n\t\t// truncated tree). A symlink anywhere in the walk fails the whole\n\t\t// call; the recursion decision uses the same lstat result.\n\t\tconst statInto = (full: string, cb: (err: Error | null, isDirectory?: boolean) => void) => {\n\t\t\t_fs.lstat(full, (err, s) => {\n\t\t\t\tif (err) { cb(err); return }\n\t\t\t\tif (s.isSymbolicLink()) {\n\t\t\t\t\tcb(new Error('invalid or unsafe path'))\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tstatsMap[relKey(full)] = toWxStats(s)\n\t\t\t\tcb(null, s.isDirectory())\n\t\t\t})\n\t\t}\n\t\tconst walkDir = (dir: string, cb: (err: Error | null) => void) => {\n\t\t\t_fs.readdir(dir, { withFileTypes: true }, (err, entries) => {\n\t\t\t\tif (err) { cb(err); return }\n\t\t\t\tlet pending = entries.length\n\t\t\t\tif (pending === 0) { cb(null); return }\n\t\t\t\tlet erred = false\n\t\t\t\tconst done = (e: Error | null) => {\n\t\t\t\t\tif (erred) return\n\t\t\t\t\tif (e) { erred = true; cb(e); return }\n\t\t\t\t\tif (--pending === 0) cb(null)\n\t\t\t\t}\n\t\t\t\tfor (const entry of entries) {\n\t\t\t\t\tconst full = _path.join(dir, entry.name)\n\t\t\t\t\tstatInto(full, (statErr, isDirectory) => {\n\t\t\t\t\t\tif (statErr) { done(statErr); return }\n\t\t\t\t\t\tif (isDirectory) walkDir(full, done)\n\t\t\t\t\t\telse done(null)\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t\tstatInto(resolved, (rootErr) => {\n\t\t\tif (rootErr) { failOnce(rootErr); return }\n\t\t\twalkDir(resolved, (err) => {\n\t\t\t\tif (err) failOnce(err)\n\t\t\t\telse okOnce()\n\t\t\t})\n\t\t})\n\t} else {\n\t\t_fs.stat(resolved, nodeComplete('fsStat', cbs, (s: NodeStats) => ({\n\t\t\tstats: toWxStats(s),\n\t\t})))\n\t}\n}\n\nexport function fsReadFile(\n\tthis: MiniAppContext,\n\t{ filePath, encoding, success, fail, complete }: {\n\t\tfilePath: string\n\t\tencoding?: BufferEncoding\n\t\tsuccess?: unknown\n\t\tfail?: unknown\n\t\tcomplete?: unknown\n\t},\n) {\n\tconst cbs = bindCallbacks(this, { success, fail, complete })\n\tconst { onSuccess, onFail, onComplete } = cbs\n\tif (guardFsAvailable('fsReadFile', cbs)) return\n\tconst v = resolveOrBail(filePath, 'fsReadFile', cbs)\n\tif (!v) return\n\tif (v.kind === 'tmp') {\n\t\t_tmpBytes(filePath).then(\n\t\t\t(buf) => {\n\t\t\t\tconst data: Buffer | string = encoding ? buf.toString(encoding) : buf\n\t\t\t\tonSuccess?.({ data, errMsg: 'fsReadFile:ok' })\n\t\t\t\tonComplete?.()\n\t\t\t},\n\t\t\ttmpFailHandler('fsReadFile', cbs),\n\t\t)\n\t\treturn\n\t}\n\tif (!v.realPath) {\n\t\tonFail?.({ errMsg: 'fsReadFile:fail invalid path' })\n\t\tonComplete?.()\n\t\treturn\n\t}\n\t_fs.readFile(v.realPath, encoding || null, nodeComplete('fsReadFile', cbs, (data: Buffer | string) => ({ data })))\n}\n\nexport function fsWriteFile(\n\tthis: MiniAppContext,\n\t{ filePath, data, encoding = 'utf8', success, fail, complete }: {\n\t\tfilePath: string\n\t\tdata: string | Uint8Array\n\t\tencoding?: BufferEncoding\n\t\tsuccess?: unknown\n\t\tfail?: unknown\n\t\tcomplete?: unknown\n\t},\n) {\n\tconst cbs = bindCallbacks(this, { success, fail, complete })\n\tif (guardFsAvailable('fsWriteFile', cbs)) return\n\tconst v = resolveOrBail(filePath, 'fsWriteFile', cbs)\n\tif (!v) return\n\tif (!ensureWritable(v, 'fsWriteFile', cbs)) return\n\tmkdirpThenWrite(v.realPath, 'fsWriteFile', cbs, done => _fs.writeFile(v.realPath, data as string, { encoding }, done))\n}\n\nexport function fsAppendFile(\n\tthis: MiniAppContext,\n\t{ filePath, data, encoding = 'utf8', success, fail, complete }: {\n\t\tfilePath: string\n\t\tdata: string | Uint8Array\n\t\tencoding?: BufferEncoding\n\t\tsuccess?: unknown\n\t\tfail?: unknown\n\t\tcomplete?: unknown\n\t},\n) {\n\tconst cbs = bindCallbacks(this, { success, fail, complete })\n\tif (guardFsAvailable('fsAppendFile', cbs)) return\n\tconst v = resolveOrBail(filePath, 'fsAppendFile', cbs)\n\tif (!v) return\n\tif (!ensureWritable(v, 'fsAppendFile', cbs)) return\n\t_fs.appendFile(v.realPath, data as string, { encoding }, nodeComplete('fsAppendFile', cbs))\n}\n\nexport function fsCopyFile(\n\tthis: MiniAppContext,\n\t{ srcPath, destPath, success, fail, complete }: {\n\t\tsrcPath: string\n\t\tdestPath: string\n\t\tsuccess?: unknown\n\t\tfail?: unknown\n\t\tcomplete?: unknown\n\t},\n) {\n\tconst cbs = bindCallbacks(this, { success, fail, complete })\n\tconst { onFail, onComplete } = cbs\n\tif (guardFsAvailable('fsCopyFile', cbs)) return\n\tconst vSrc = resolveOrBail(srcPath, 'fsCopyFile', cbs)\n\tif (!vSrc) return\n\tconst vDest = resolveOrBail(destPath, 'fsCopyFile', cbs)\n\tif (!vDest) return\n\tif (!ensureWritable(vDest, 'fsCopyFile', cbs)) return\n\tif (vSrc.kind === 'tmp') {\n\t\t// Materialize the renderer Blob into the user-data\n\t\t// area. The dest writable check above already rejected _tmp / _store\n\t\t// destinations \u2014 saveFile is the documented route for tmp\u2192store.\n\t\t_tmpBytes(srcPath).then(\n\t\t\tbuf => mkdirpThenWrite(vDest.realPath, 'fsCopyFile', cbs, done => _fs.writeFile(vDest.realPath, buf, done)),\n\t\t\ttmpFailHandler('fsCopyFile', cbs),\n\t\t)\n\t\treturn\n\t}\n\tif (!vSrc.realPath) {\n\t\tonFail?.({ errMsg: 'fsCopyFile:fail invalid src path' })\n\t\tonComplete?.()\n\t\treturn\n\t}\n\t_fs.copyFile(vSrc.realPath, vDest.realPath, nodeComplete('fsCopyFile', cbs))\n}\n\nexport function fsRename(\n\tthis: MiniAppContext,\n\t{ oldPath, newPath, success, fail, complete }: {\n\t\toldPath: string\n\t\tnewPath: string\n\t\tsuccess?: unknown\n\t\tfail?: unknown\n\t\tcomplete?: unknown\n\t},\n) {\n\tconst cbs = bindCallbacks(this, { success, fail, complete })\n\tif (guardFsAvailable('fsRename', cbs)) return\n\tconst vOld = resolveOrBail(oldPath, 'fsRename', cbs)\n\tif (!vOld) return\n\tconst vNew = resolveOrBail(newPath, 'fsRename', cbs)\n\tif (!vNew) return\n\t// Rename deletes the source \u2014 both sides must be writable. _tmp / _store\n\t// reject under either role.\n\tif (!ensureWritable(vOld, 'fsRename', cbs)) return\n\tif (!ensureWritable(vNew, 'fsRename', cbs)) return\n\t_fs.rename(vOld.realPath, vNew.realPath, nodeComplete('fsRename', cbs))\n}\n\nexport function fsUnlink(\n\tthis: MiniAppContext,\n\t{ filePath, success, fail, complete }: { filePath: string; success?: unknown; fail?: unknown; complete?: unknown },\n) {\n\tconst cbs = bindCallbacks(this, { success, fail, complete })\n\tif (guardFsAvailable('fsUnlink', cbs)) return\n\tconst v = resolveOrBail(filePath, 'fsUnlink', cbs)\n\tif (!v) return\n\tif (!ensureWritable(v, 'fsUnlink', cbs)) return\n\t_fs.unlink(v.realPath, nodeComplete('fsUnlink', cbs))\n}\n\nexport function fsMkdir(\n\tthis: MiniAppContext,\n\t{ dirPath, recursive = false, success, fail, complete }: {\n\t\tdirPath: string\n\t\trecursive?: boolean\n\t\tsuccess?: unknown\n\t\tfail?: unknown\n\t\tcomplete?: unknown\n\t},\n) {\n\tconst cbs = bindCallbacks(this, { success, fail, complete })\n\tif (guardFsAvailable('fsMkdir', cbs)) return\n\tconst v = resolveOrBail(dirPath, 'fsMkdir', cbs)\n\tif (!v) return\n\tif (!ensureWritable(v, 'fsMkdir', cbs)) return\n\t_fs.mkdir(v.realPath, { recursive }, nodeComplete('fsMkdir', cbs))\n}\n\nexport function fsRmdir(\n\tthis: MiniAppContext,\n\t{ dirPath, recursive = false, success, fail, complete }: {\n\t\tdirPath: string\n\t\trecursive?: boolean\n\t\tsuccess?: unknown\n\t\tfail?: unknown\n\t\tcomplete?: unknown\n\t},\n) {\n\tconst cbs = bindCallbacks(this, { success, fail, complete })\n\tif (guardFsAvailable('fsRmdir', cbs)) return\n\tconst v = resolveOrBail(dirPath, 'fsRmdir', cbs)\n\tif (!v) return\n\tif (!ensureWritable(v, 'fsRmdir', cbs)) return\n\t// The two cases need different Node primitives: `fs.rm` without\n\t// `recursive` refuses directories outright (ERR_FS_EISDIR) even when\n\t// empty, while wx's non-recursive rmdir removes an empty directory and\n\t// fails only on a non-empty one \u2014 exactly `fs.rmdir`'s contract.\n\tif (recursive) {\n\t\tconst rmFn = (_fs as typeof _fs & { rm?: typeof _fs.rmdir }).rm ?? _fs.rmdir\n\t\trmFn(v.realPath, { recursive: true } as Parameters<typeof _fs.rmdir>[1], nodeComplete('fsRmdir', cbs))\n\t} else {\n\t\t_fs.rmdir(v.realPath, nodeComplete('fsRmdir', cbs))\n\t}\n}\n\nexport function fsReaddir(\n\tthis: MiniAppContext,\n\t{ dirPath, success, fail, complete }: { dirPath: string; success?: unknown; fail?: unknown; complete?: unknown },\n) {\n\tconst cbs = bindCallbacks(this, { success, fail, complete })\n\tconst { onFail, onComplete } = cbs\n\tif (guardFsAvailable('fsReaddir', cbs)) return\n\tconst v = resolveOrBail(dirPath, 'fsReaddir', cbs)\n\tif (!v) return\n\t// _tmp and _store are flat (id-addressed) namespaces \u2014 readdir is meaningless.\n\tif (v.kind === 'tmp' || v.kind === 'store') {\n\t\tonFail?.({ errMsg: `fsReaddir:fail ${v.kind} is a flat namespace (no dir tree)` })\n\t\tonComplete?.()\n\t\treturn\n\t}\n\tif (!v.realPath) {\n\t\tonFail?.({ errMsg: 'fsReaddir:fail invalid path' })\n\t\tonComplete?.()\n\t\treturn\n\t}\n\t_fs.readdir(v.realPath, nodeComplete('fsReaddir', cbs, (files: string[]) => ({ files })))\n}\n\nexport function fsGetFileInfo(\n\tthis: MiniAppContext,\n\t{ filePath, digestAlgorithm, success, fail, complete }: {\n\t\tfilePath: string\n\t\tdigestAlgorithm?: string\n\t\tsuccess?: unknown\n\t\tfail?: unknown\n\t\tcomplete?: unknown\n\t},\n) {\n\tconst cbs = bindCallbacks(this, { success, fail, complete })\n\tconst { onSuccess, onFail, onComplete } = cbs\n\tif (guardFsAvailable('fsGetFileInfo', cbs)) return\n\tconst v = resolveOrBail(filePath, 'fsGetFileInfo', cbs)\n\tif (!v) return\n\t// wx and every dimina native client default digestAlgorithm to md5 and\n\t// always include the digest \u2014 a missing digest is a fail, not a silently\n\t// smaller success payload.\n\tconst algorithm = digestAlgorithm === 'sha1' ? 'sha1' : 'md5'\n\tif (v.kind === 'tmp') {\n\t\t_tmpBytes(filePath).then(\n\t\t\t(buf) => {\n\t\t\t\ttry {\n\t\t\t\t\tconst hash = _crypto.createHash(algorithm)\n\t\t\t\t\thash.update(buf)\n\t\t\t\t\tonSuccess?.({ size: buf.length, digest: hash.digest('hex'), errMsg: 'fsGetFileInfo:ok' })\n\t\t\t\t\tonComplete?.()\n\t\t\t\t} catch (hashErr) {\n\t\t\t\t\tonFail?.({ errMsg: `fsGetFileInfo:fail ${(hashErr as Error).message}` })\n\t\t\t\t\tonComplete?.()\n\t\t\t\t}\n\t\t\t},\n\t\t\ttmpFailHandler('fsGetFileInfo', cbs),\n\t\t)\n\t\treturn\n\t}\n\tif (!v.realPath) {\n\t\tonFail?.({ errMsg: 'fsGetFileInfo:fail invalid path' })\n\t\tonComplete?.()\n\t\treturn\n\t}\n\tconst resolved = v.realPath\n\t_fs.stat(resolved, (err, s) => {\n\t\tif (err) {\n\t\t\tonFail?.({ errMsg: `fsGetFileInfo:fail ${err.message}` })\n\t\t\tonComplete?.()\n\t\t\treturn\n\t\t}\n\t\ttry {\n\t\t\tconst hash = _crypto.createHash(algorithm)\n\t\t\tconst stream = _fs.createReadStream(resolved)\n\t\t\tstream.on('data', (chunk) => hash.update(chunk as Buffer))\n\t\t\tstream.on('end', () => {\n\t\t\t\tonSuccess?.({ size: s.size, digest: hash.digest('hex'), errMsg: 'fsGetFileInfo:ok' })\n\t\t\t\tonComplete?.()\n\t\t\t})\n\t\t\tstream.on('error', (hashErr) => {\n\t\t\t\tonFail?.({ errMsg: `fsGetFileInfo:fail ${hashErr.message}` })\n\t\t\t\tonComplete?.()\n\t\t\t})\n\t\t} catch (hashErr) {\n\t\t\tonFail?.({ errMsg: `fsGetFileInfo:fail ${(hashErr as Error).message}` })\n\t\t\tonComplete?.()\n\t\t}\n\t})\n}\n\n/**\n * Save a temp file into the read-only `_store/` namespace. Returns a vpath\n * (`difile://_store/{uuid}.{ext}`) rather than a real disk path so callers\n * cannot leak the host filesystem layout.\n *\n * Scope:\n * - source must be a `difile://`-anchored vpath (validator rejects abs paths);\n * - source from `_tmp/` materializes the renderer Blob into `_store/` via the\n * renderer-Blob \u2192 main-fs copy bridge;\n * - source from `_store/` or the user-data area is copied byte-for-byte to a\n * freshly minted `_store/{uuid}.{ext}` entry under the sandbox base.\n */\n/**\n * Resolves the saveFile destination. wx contract: an explicit `filePath`\n * names the exact destination and is echoed back as `savedFilePath` \u2014 it\n * goes through the same validator + writable gate as every other\n * write-class destination, so runtime-owned `_tmp/` / `_store/` targets\n * fail with permission denied. Only when `filePath` is omitted is a fresh\n * `_store/{uuid}` vpath minted. Reports fail + complete and returns\n * undefined when the destination is invalid.\n */\nfunction resolveSaveFileDestination(\n\ttempFilePath: string,\n\tfilePath: string | undefined,\n\tcbs: FsCallbacks,\n): { savedFilePath: string; destReal: string } | undefined {\n\tif (typeof filePath === 'string' && filePath) {\n\t\tconst dest = resolveOrBail(filePath, 'fsSaveFile', cbs)\n\t\tif (!dest) return undefined\n\t\tif (!ensureWritable(dest, 'fsSaveFile', cbs)) return undefined\n\t\treturn { savedFilePath: filePath, destReal: dest.realPath }\n\t}\n\tconst ext = _path.extname(tempFilePath) || ''\n\tconst id = _crypto.randomUUID() + ext\n\tconst savedFilePath = `difile://_store/${id}`\n\tconst destResolved = resolveVPath(savedFilePath)\n\tif (!destResolved || !destResolved.realPath) {\n\t\t// Defensive: a freshly minted vpath must always resolve.\n\t\tcbs.onFail?.({ errMsg: 'fsSaveFile:fail unable to allocate destination' })\n\t\tcbs.onComplete?.()\n\t\treturn undefined\n\t}\n\tif (containsSymlink(destResolved.realPath)) {\n\t\tcbs.onFail?.({ errMsg: 'fsSaveFile:fail invalid or unsafe path' })\n\t\tcbs.onComplete?.()\n\t\treturn undefined\n\t}\n\treturn { savedFilePath, destReal: destResolved.realPath }\n}\n\nexport function fsSaveFile(\n\tthis: MiniAppContext,\n\t{ tempFilePath, filePath, success, fail, complete }: {\n\t\ttempFilePath: string\n\t\tfilePath?: string\n\t\tsuccess?: unknown\n\t\tfail?: unknown\n\t\tcomplete?: unknown\n\t},\n) {\n\tconst cbs = bindCallbacks(this, { success, fail, complete })\n\tconst { onFail, onComplete } = cbs\n\tif (guardFsAvailable('fsSaveFile', cbs)) return\n\tconst src = resolveOrBail(tempFilePath, 'fsSaveFile', cbs)\n\tif (!src) return\n\n\tconst destination = resolveSaveFileDestination(tempFilePath, filePath, cbs)\n\tif (!destination) return\n\tconst { savedFilePath, destReal } = destination\n\n\tif (src.kind === 'tmp') {\n\t\t// Materialize the renderer Blob into _store on disk.\n\t\t_tmpBytes(tempFilePath).then(\n\t\t\tbytes => mkdirpThenWrite(destReal, 'fsSaveFile', cbs, done => _fs.writeFile(destReal, bytes, done), { savedFilePath }),\n\t\t\ttmpFailHandler('fsSaveFile', cbs),\n\t\t)\n\t\treturn\n\t}\n\tif (!src.realPath) {\n\t\tonFail?.({ errMsg: 'fsSaveFile:fail invalid src path' })\n\t\tonComplete?.()\n\t\treturn\n\t}\n\tif (src.realPath === destReal) {\n\t\t// Source and destination normalize to the same file: saving a file\n\t\t// onto itself is a defined no-op success, not whatever the host\n\t\t// Node's same-file copyFile happens to do. Still a no-op only for a\n\t\t// real file \u2014 resolveOrBail validates the path string, not the disk,\n\t\t// so a missing or directory source must fail here like any other save.\n\t\t_fs.stat(src.realPath, (statErr, st) => {\n\t\t\tif (statErr) {\n\t\t\t\tonFail?.({ errMsg: `fsSaveFile:fail ${statErr.message}` })\n\t\t\t\tonComplete?.()\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (!st.isFile()) {\n\t\t\t\tonFail?.({ errMsg: `fsSaveFile:fail illegal operation on a directory, copyfile '${tempFilePath}'` })\n\t\t\t\tonComplete?.()\n\t\t\t\treturn\n\t\t\t}\n\t\t\tcbs.onSuccess?.({ savedFilePath, errMsg: 'fsSaveFile:ok' })\n\t\t\tonComplete?.()\n\t\t})\n\t\treturn\n\t}\n\tmkdirpThenWrite(destReal, 'fsSaveFile', cbs, done => _fs.copyFile(src.realPath!, destReal, done), { savedFilePath })\n}\n\n/**\n * List files previously persisted by `fsSaveFile` \u2014 i.e. anything under the\n * `_store/` namespace. Returned `filePath` entries are vpaths so callers can\n * round-trip through `fsReadFile` / `fsRemoveSavedFile` without ever seeing\n * the host filesystem.\n */\nexport function fsGetSavedFileList(\n\tthis: MiniAppContext,\n\t{ success, fail, complete }: { success?: unknown; fail?: unknown; complete?: unknown } = {},\n) {\n\tconst cbs = bindCallbacks(this, { success, fail, complete })\n\tconst { onSuccess, onFail, onComplete } = cbs\n\tif (guardFsAvailable('fsGetSavedFileList', cbs)) return\n\tconst storeVpath = resolveVPath('difile://_store/')\n\tconst storeDir = storeVpath?.realPath\n\tif (!storeDir) {\n\t\tonSuccess?.({ fileList: [], errMsg: 'fsGetSavedFileList:ok' })\n\t\tonComplete?.()\n\t\treturn\n\t}\n\t_fs.readdir(storeDir, (err, files) => {\n\t\tif (err) {\n\t\t\t// Only \"the store directory does not exist yet\" is a legitimate\n\t\t\t// empty list; any other readdir error (ENOTDIR, EACCES, EIO)\n\t\t\t// masked as an empty success would hide real breakage.\n\t\t\tif ((err as NodeJS.ErrnoException).code === 'ENOENT') {\n\t\t\t\tonSuccess?.({ fileList: [], errMsg: 'fsGetSavedFileList:ok' })\n\t\t\t} else {\n\t\t\t\tonFail?.({ errMsg: `fsGetSavedFileList:fail ${err.message}` })\n\t\t\t}\n\t\t\tonComplete?.()\n\t\t\treturn\n\t\t}\n\t\tlet pending = files.length\n\t\tif (pending === 0) {\n\t\t\tonSuccess?.({ fileList: [], errMsg: 'fsGetSavedFileList:ok' })\n\t\t\tonComplete?.()\n\t\t\treturn\n\t\t}\n\t\tconst fileList: Array<{ filePath: string; size: number; createTime: number }> = []\n\t\tlet settled = false\n\t\tfor (const name of files) {\n\t\t\tconst full = _path.join(storeDir, name)\n\t\t\t_fs.stat(full, (statErr, s) => {\n\t\t\t\tif (settled) return\n\t\t\t\tif (statErr) {\n\t\t\t\t\t// A partial list would misrepresent the store's contents.\n\t\t\t\t\tsettled = true\n\t\t\t\t\tonFail?.({ errMsg: `fsGetSavedFileList:fail ${statErr.message}` })\n\t\t\t\t\tonComplete?.()\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tfileList.push({\n\t\t\t\t\tfilePath: `difile://_store/${name}`,\n\t\t\t\t\tsize: s.size,\n\t\t\t\t\t// wx createTime is a seconds-unit epoch.\n\t\t\t\t\tcreateTime: Math.floor(s.birthtimeMs / 1000),\n\t\t\t\t})\n\t\t\t\tif (--pending === 0) {\n\t\t\t\t\tsettled = true\n\t\t\t\t\tonSuccess?.({ fileList, errMsg: 'fsGetSavedFileList:ok' })\n\t\t\t\t\tonComplete?.()\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t})\n}\n\nexport function fsRemoveSavedFile(\n\tthis: MiniAppContext,\n\t{ filePath, success, fail, complete }: { filePath: string; success?: unknown; fail?: unknown; complete?: unknown },\n) {\n\tconst cbs = bindCallbacks(this, { success, fail, complete })\n\tconst { onFail, onComplete } = cbs\n\tif (guardFsAvailable('fsRemoveSavedFile', cbs)) return\n\tconst v = resolveOrBail(filePath, 'fsRemoveSavedFile', cbs)\n\tif (!v) return\n\t// removeSavedFile is the documented exception to the `_store/` read-only\n\t// rule. Only `_store/*` entries may be removed through this API.\n\tif (v.kind !== 'store' || !v.realPath) {\n\t\tonFail?.({ errMsg: 'fsRemoveSavedFile:fail only _store/ entries may be removed' })\n\t\tonComplete?.()\n\t\treturn\n\t}\n\t_fs.unlink(v.realPath, nodeComplete('fsRemoveSavedFile', cbs))\n}\n\nexport function fsTruncate(\n\tthis: MiniAppContext,\n\t{ filePath, length = 0, success, fail, complete }: {\n\t\tfilePath: string\n\t\tlength?: number\n\t\tsuccess?: unknown\n\t\tfail?: unknown\n\t\tcomplete?: unknown\n\t},\n) {\n\tconst cbs = bindCallbacks(this, { success, fail, complete })\n\tif (guardFsAvailable('fsTruncate', cbs)) return\n\tconst v = resolveOrBail(filePath, 'fsTruncate', cbs)\n\tif (!v) return\n\tif (!ensureWritable(v, 'fsTruncate', cbs)) return\n\t_fs.truncate(v.realPath, length, nodeComplete('fsTruncate', cbs))\n}\n\n/**\n * Synchronous \"vpath \u2192 bytes\" read for consumers that must resolve within one\n * task (saveImageToPhotosAlbum builds its download anchor synchronously so\n * its success/fail verdict precedes `complete`). Returns null when Node fs is\n * unavailable, the vpath does not resolve to a disk-backed file (`_tmp/*`\n * bytes live in the renderer Blob registry \u2014 resolve those through\n * `resolveTempFilePath` instead), the resolved path passes through a\n * sandbox-internal symlink, or the read itself fails.\n */\nexport function readVPathBytesSync(p: unknown): Buffer | null {\n\tif (!_fs) return null\n\tconst v = resolveVPath(p)\n\tif (!v?.realPath) return null\n\tif (containsSymlink(v.realPath)) return null\n\ttry {\n\t\treturn _fs.readFileSync(v.realPath)\n\t} catch {\n\t\treturn null\n\t}\n}\n", "/**\n * DevTools API stubs for media-related wx.xxx APIs\n * (image / video / audio).\n *\n * Each exported function is bound with `this` = MiniApp instance\n * (via AppManager.registerApi \u2192 MiniApp.invokeApi).\n */\n\nimport type { MiniAppContext } from './types'\nimport { bindDomEvents, type EventBridgeDisposer } from './event-bridge'\nimport { bindCallbacks } from './simulator-api-helpers'\nimport { readVPathBytesSync } from './simulator-api-fs'\nimport { createTempFilePath, resolveTempFilePath } from './temp-files'\n\n// \u2500\u2500\u2500 shared file-picker scaffolding \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n//\n// chooseImage / chooseVideo / chooseMedia all drive the browser file picker\n// through a hidden `<input type=file>`: create it, wire accept/multiple/\n// capture from the caller's options, listen for `change`, and report a\n// `${apiName}:fail cancel` when the user closes the dialog without picking\n// anything. `createFilePicker` is the single authority for that scaffold;\n// each API supplies only its accept string, multiplicity, and the\n// (possibly async) processing of the picked files.\n\ntype CancelCallbacks = Pick<ReturnType<typeof bindCallbacks>, 'onFail' | 'onComplete'>\n\ninterface FilePickerConfig {\n\taccept: string\n\tmultiple: boolean\n\t/** `capture` attribute value, or `undefined` to omit it (album source, or no single-camera source requested). */\n\tcapture?: 'user' | 'environment'\n}\n\n/** Resolves the `capture` attribute from `sourceType` + `camera`: only set when the caller asked for camera-only capture. */\nfunction captureAttrFor(sourceType: string[], camera: unknown): 'user' | 'environment' | undefined {\n\tif (sourceType.length !== 1 || sourceType[0] !== 'camera') return undefined\n\treturn camera === 'front' ? 'user' : 'environment'\n}\n\n/**\n * Drives a hidden `<input type=file>` through one pick cycle. Reports\n * `${apiName}:fail cancel` + `complete` when the selection is empty;\n * otherwise hands the raw (un-truncated) `FileList` to `onPick`, which owns\n * success/fail/complete and must call `removeInput` once it is done with the\n * picker element.\n */\nfunction createFilePicker(\n\tapiName: string,\n\tconfig: FilePickerConfig,\n\tcbs: CancelCallbacks,\n\tonPick: (files: File[], removeInput: () => void) => void | Promise<void>,\n): void {\n\tconst input = document.createElement('input')\n\tinput.type = 'file'\n\tinput.accept = config.accept\n\tinput.multiple = config.multiple\n\tif (config.capture) input.setAttribute('capture', config.capture)\n\tinput.style.display = 'none'\n\tdocument.body.appendChild(input)\n\n\tconst removeInput = () => input.remove()\n\n\tinput.addEventListener('change', () => {\n\t\tconst files = Array.from(input.files || [])\n\t\tif (files.length === 0) {\n\t\t\tcbs.onFail?.({ errMsg: `${apiName}:fail cancel` })\n\t\t\tcbs.onComplete?.()\n\t\t\tremoveInput()\n\t\t\treturn\n\t\t}\n\t\tvoid onPick(files, removeInput)\n\t})\n\n\tinput.click()\n}\n\n// \u2500\u2500\u2500 Media: Image \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport function chooseImage(\n\tthis: MiniAppContext,\n\t{ count = 9, sourceType, camera, success, fail, complete }: {\n\t\tcount?: number\n\t\tsizeType?: unknown\n\t\tsourceType?: unknown\n\t\tcamera?: unknown\n\t\tsuccess?: unknown\n\t\tfail?: unknown\n\t\tcomplete?: unknown\n\t},\n) {\n\tconst cbs = bindCallbacks(this, { success, fail, complete })\n\tconst { onSuccess, onComplete } = cbs\n\tconst normalizedCount = normalizeChooseMediaCount(count)\n\tconst normalizedSourceType = normalizeStringArray(sourceType, ['album', 'camera'])\n\n\tcreateFilePicker(\n\t\t'chooseImage',\n\t\t{ accept: 'image/*', multiple: normalizedCount > 1, capture: captureAttrFor(normalizedSourceType, camera) },\n\t\tcbs,\n\t\t(rawFiles, removeInput) => {\n\t\t\tconst files = rawFiles.slice(0, normalizedCount)\n\t\t\tconst tempFilePaths = files.map(f => createTempFilePath(f))\n\t\t\tconst tempFiles = files.map((f, i) => ({ path: tempFilePaths[i], size: f.size }))\n\t\t\tonSuccess?.({ tempFilePaths, tempFiles, errMsg: 'chooseImage:ok' })\n\t\t\tonComplete?.()\n\t\t\tremoveInput()\n\t\t},\n\t)\n}\n\nexport function previewImage(\n\tthis: MiniAppContext,\n\t{ urls, current, success, complete }: { urls?: string[]; current?: string; success?: unknown; complete?: unknown },\n) {\n\tconst { onSuccess, onComplete } = bindCallbacks(this, { success, complete })\n\n\tif (!urls || urls.length === 0) {\n\t\tonComplete?.()\n\t\treturn\n\t}\n\n\t// Simple overlay preview\n\tconst overlay = document.createElement('div')\n\toverlay.style.cssText =\n\t\t'position:fixed;inset:0;z-index:99999;background:rgba(0,0,0,.85);display:flex;align-items:center;justify-content:center;cursor:pointer;'\n\tconst img = document.createElement('img')\n\timg.src = current || urls[0] || ''\n\timg.style.cssText = 'max-width:90%;max-height:90%;object-fit:contain;'\n\toverlay.appendChild(img)\n\toverlay.addEventListener('click', () => overlay.remove())\n\tdocument.body.appendChild(overlay)\n\n\tonSuccess?.({ errMsg: 'previewImage:ok' })\n\tonComplete?.()\n}\n\nexport function compressImage(\n\tthis: MiniAppContext,\n\t{ src, quality = 80, success, fail, complete }: {\n\t\tsrc: string\n\t\tquality?: number\n\t\tsuccess?: unknown\n\t\tfail?: unknown\n\t\tcomplete?: unknown\n\t},\n) {\n\tconst { onSuccess, onFail, onComplete } = bindCallbacks(this, { success, fail, complete })\n\n\tconst img = new Image()\n\timg.crossOrigin = 'anonymous'\n\timg.onload = () => {\n\t\ttry {\n\t\t\tconst canvas = document.createElement('canvas')\n\t\t\tcanvas.width = img.naturalWidth\n\t\t\tcanvas.height = img.naturalHeight\n\t\t\tconst ctx = canvas.getContext('2d')!\n\t\t\tctx.drawImage(img, 0, 0)\n\t\t\tcanvas.toBlob(\n\t\t\t\t(blob) => {\n\t\t\t\t\tif (blob) {\n\t\t\t\t\t\tconst tempFilePath = createTempFilePath(blob)\n\t\t\t\t\t\tonSuccess?.({ tempFilePath, errMsg: 'compressImage:ok' })\n\t\t\t\t\t} else {\n\t\t\t\t\t\tonFail?.({ errMsg: 'compressImage:fail compression error' })\n\t\t\t\t\t}\n\t\t\t\t\tonComplete?.()\n\t\t\t\t},\n\t\t\t\t'image/jpeg',\n\t\t\t\tquality / 100,\n\t\t\t)\n\t\t} catch (error) {\n\t\t\tonFail?.({ errMsg: `compressImage:fail ${(error as Error).message}` })\n\t\t\tonComplete?.()\n\t\t}\n\t}\n\timg.onerror = () => {\n\t\tonFail?.({ errMsg: 'compressImage:fail image load error' })\n\t\tonComplete?.()\n\t}\n\timg.src = src\n}\n\nexport function saveImageToPhotosAlbum(\n\tthis: MiniAppContext,\n\t{ filePath, success, fail, complete }: { filePath: string; success?: unknown; fail?: unknown; complete?: unknown },\n) {\n\tconst { onSuccess, onFail, onComplete } = bindCallbacks(this, { success, fail, complete })\n\n\tconst triggerDownload = (href: string) => {\n\t\tconst a = document.createElement('a')\n\t\ta.href = href\n\t\ta.download = 'image'\n\t\ta.click()\n\t}\n\n\tif (typeof filePath === 'string' && filePath.startsWith('difile://_tmp/')) {\n\t\t// The simulator's temp-file scheme (chooseImage / chooseMedia /\n\t\t// compressImage mint these via createTempFilePath): the bytes live in\n\t\t// the renderer Blob registry, so resolution is async. The async branch\n\t\t// owns its whole verdict \u2014 success/fail strictly before complete.\n\t\tresolveTempFilePath(filePath)\n\t\t\t.then(\n\t\t\t\tblob =>\n\t\t\t\t\tnew Promise<string>((resolve, reject) => {\n\t\t\t\t\t\tconst reader = new FileReader()\n\t\t\t\t\t\treader.onerror = () => reject(reader.error ?? new Error('blob read failed'))\n\t\t\t\t\t\treader.onload = () => resolve(String(reader.result))\n\t\t\t\t\t\treader.readAsDataURL(blob)\n\t\t\t\t\t}),\n\t\t\t)\n\t\t\t.then(\n\t\t\t\t(href) => {\n\t\t\t\t\ttriggerDownload(href)\n\t\t\t\t\tonSuccess?.({ errMsg: 'saveImageToPhotosAlbum:ok' })\n\t\t\t\t\tonComplete?.()\n\t\t\t\t},\n\t\t\t\t(err: unknown) => {\n\t\t\t\t\tconst msg = err instanceof Error ? err.message : String(err)\n\t\t\t\t\tonFail?.({ errMsg: `saveImageToPhotosAlbum:fail ${msg}` })\n\t\t\t\t\tonComplete?.()\n\t\t\t\t},\n\t\t\t)\n\t\treturn\n\t}\n\n\ttry {\n\t\tif (typeof filePath === 'string' && filePath.startsWith('difile://')) {\n\t\t\tconst bytes = readVPathBytesSync(filePath)\n\t\t\tif (bytes) {\n\t\t\t\t// A data: href keeps the whole verdict synchronous (success before\n\t\t\t\t// complete) without needing URL.createObjectURL.\n\t\t\t\ttriggerDownload(`data:application/octet-stream;base64,${bytes.toString('base64')}`)\n\t\t\t\tonSuccess?.({ errMsg: 'saveImageToPhotosAlbum:ok' })\n\t\t\t} else {\n\t\t\t\tonFail?.({ errMsg: 'saveImageToPhotosAlbum:fail no such file' })\n\t\t\t}\n\t\t} else {\n\t\t\t// Real dimina clients (Android / iOS / Harmony) only accept a local\n\t\t\t// file path \u2014 a dataURL, remote http(s) URL, or blob: URL (which no\n\t\t\t// simulator code path ever mints as a filePath) fails on device, so\n\t\t\t// the simulator must not \"succeed\" on it either.\n\t\t\tonFail?.({ errMsg: 'saveImageToPhotosAlbum:fail invalid file path' })\n\t\t}\n\t} catch (error) {\n\t\tonFail?.({ errMsg: `saveImageToPhotosAlbum:fail ${(error as Error).message}` })\n\t}\n\tonComplete?.()\n}\n\nexport function getImageInfo(\n\tthis: MiniAppContext,\n\t{ src, success, fail, complete }: { src: string; success?: unknown; fail?: unknown; complete?: unknown },\n) {\n\tconst { onSuccess, onFail, onComplete } = bindCallbacks(this, { success, fail, complete })\n\n\tconst img = new Image()\n\timg.crossOrigin = 'anonymous'\n\timg.onload = () => {\n\t\tonSuccess?.({\n\t\t\twidth: img.naturalWidth,\n\t\t\theight: img.naturalHeight,\n\t\t\tpath: src,\n\t\t\torientation: 'up',\n\t\t\ttype: 'unknown',\n\t\t\terrMsg: 'getImageInfo:ok',\n\t\t})\n\t\tonComplete?.()\n\t}\n\timg.onerror = () => {\n\t\tonFail?.({ errMsg: 'getImageInfo:fail image load error' })\n\t\tonComplete?.()\n\t}\n\timg.src = src\n}\n\n// \u2500\u2500\u2500 Media: Video \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\ntype MediaFileType = 'image' | 'video'\ntype ChooseMediaCamera = 'back' | 'front'\n\nconst VIDEO_METADATA_TIMEOUT_MS = 5000\nconst VIDEO_THUMBNAIL_TIMEOUT_MS = 500\n\ninterface ChooseMediaTempFile {\n\ttempFilePath: string\n\tsize: number\n\tduration: number\n\theight: number\n\twidth: number\n\tthumbTempFilePath: string\n\tfileType: MediaFileType\n\toriginalFileObj: File\n}\n\nfunction normalizeStringArray(value: unknown, fallback: string[]): string[] {\n\treturn Array.isArray(value)\n\t\t? value.filter((item): item is string => typeof item === 'string')\n\t\t: fallback\n}\n\nfunction normalizeChooseMediaCount(value: unknown): number {\n\tconst n = Number(value)\n\tif (!Number.isFinite(n)) return 9\n\treturn Math.max(1, Math.min(20, Math.floor(n)))\n}\n\nfunction getChooseMediaAccept(mediaType: string[]): string {\n\tconst wantsMix = mediaType.includes('mix')\n\tconst wantsImage = wantsMix || mediaType.includes('image')\n\tconst wantsVideo = wantsMix || mediaType.includes('video')\n\tif (wantsImage && wantsVideo) return 'image/*,video/*'\n\treturn wantsVideo ? 'video/*' : 'image/*'\n}\n\nfunction getChooseMediaResultType(files: ChooseMediaTempFile[]): 'image' | 'video' | 'mix' {\n\tconst types = new Set(files.map(file => file.fileType))\n\tif (types.size > 1) return 'mix'\n\treturn files[0]?.fileType ?? 'image'\n}\n\nfunction readImageMetadata(src: string): Promise<{ width: number; height: number }> {\n\treturn new Promise((resolve) => {\n\t\tconst img = new Image()\n\t\timg.onload = () => resolve({ width: img.naturalWidth || 0, height: img.naturalHeight || 0 })\n\t\timg.onerror = () => resolve({ width: 0, height: 0 })\n\t\timg.src = src\n\t})\n}\n\nfunction readVideoMetadata(src: string): Promise<{ width: number; height: number; duration: number; thumbTempFilePath: string }> {\n\treturn new Promise((resolve) => {\n\t\tconst video = document.createElement('video')\n\t\tlet settled = false\n\t\tlet seekTimer: ReturnType<typeof setTimeout> | undefined\n\t\tconst finish = (metadata: { width: number; height: number; duration: number; thumbTempFilePath: string }) => {\n\t\t\tif (settled) return\n\t\t\tsettled = true\n\t\t\tclearTimeout(timer)\n\t\t\tif (seekTimer) clearTimeout(seekTimer)\n\t\t\t// Detach handlers so any late-firing DOM events (e.g. onseeked from a\n\t\t\t// previously queued currentTime change) cannot reach into the now-\n\t\t\t// resolved promise and allocate fresh blob: URLs.\n\t\t\tvideo.onloadedmetadata = null\n\t\t\tvideo.onseeked = null\n\t\t\tvideo.onerror = null\n\t\t\tvideo.removeAttribute('src')\n\t\t\tvideo.load()\n\t\t\tresolve(metadata)\n\t\t}\n\t\tconst drawThumbnail = (width: number, height: number): Promise<string> => {\n\t\t\treturn new Promise((resolveThumb) => {\n\t\t\t\tlet resolved = false\n\t\t\t\tconst done = (value: string) => {\n\t\t\t\t\tif (resolved) return\n\t\t\t\t\tresolved = true\n\t\t\t\t\tresolveThumb(value)\n\t\t\t\t}\n\t\t\t\tlet canvas: HTMLCanvasElement\n\t\t\t\ttry {\n\t\t\t\t\tcanvas = document.createElement('canvas')\n\t\t\t\t\tcanvas.width = width || 1\n\t\t\t\t\tcanvas.height = height || 1\n\t\t\t\t\tconst ctx = canvas.getContext('2d')\n\t\t\t\t\tctx?.drawImage(video, 0, 0, canvas.width, canvas.height)\n\t\t\t\t} catch {\n\t\t\t\t\tdone('')\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tconst toDataUrlFallback = () => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tdone(canvas.toDataURL('image/jpeg', 0.8))\n\t\t\t\t\t} catch {\n\t\t\t\t\t\tdone('')\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst fallbackTimer = setTimeout(toDataUrlFallback, VIDEO_THUMBNAIL_TIMEOUT_MS)\n\t\t\t\ttry {\n\t\t\t\t\tcanvas.toBlob(\n\t\t\t\t\t\t(blob) => {\n\t\t\t\t\t\t\tclearTimeout(fallbackTimer)\n\t\t\t\t\t\t\t// If the outer readVideoMetadata promise already settled\n\t\t\t\t\t\t\t// (e.g. the seekTimer fired before toBlob's async callback\n\t\t\t\t\t\t\t// arrived), we MUST NOT call createTempFilePath here \u2014 that\n\t\t\t\t\t\t\t// would allocate a fresh blob: URL and register it in the\n\t\t\t\t\t\t\t// temp-files Map with no one ever revoking it. Just drop\n\t\t\t\t\t\t\t// the blob on the floor; the resolved thumbTempFilePath\n\t\t\t\t\t\t\t// has already been chosen by the timeout path.\n\t\t\t\t\t\t\tif (settled || resolved) return\n\t\t\t\t\t\t\tif (blob) {\n\t\t\t\t\t\t\t\tdone(createTempFilePath(blob))\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ttoDataUrlFallback()\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t'image/jpeg',\n\t\t\t\t\t\t0.8,\n\t\t\t\t\t)\n\t\t\t\t} catch {\n\t\t\t\t\tclearTimeout(fallbackTimer)\n\t\t\t\t\ttoDataUrlFallback()\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t\tconst timer = setTimeout(() => finish({ width: 0, height: 0, duration: 0, thumbTempFilePath: '' }), VIDEO_METADATA_TIMEOUT_MS)\n\n\t\tvideo.preload = 'metadata'\n\t\tvideo.muted = true\n\t\tvideo.onloadedmetadata = () => {\n\t\t\tconst width = video.videoWidth || 0\n\t\t\tconst height = video.videoHeight || 0\n\t\t\tconst duration = Number.isFinite(video.duration) ? video.duration : 0\n\t\t\tconst metadata = { width, height, duration, thumbTempFilePath: '' }\n\t\t\tif (!width || !height || duration <= 0) {\n\t\t\t\tfinish(metadata)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tvideo.onseeked = async () => {\n\t\t\t\tif (seekTimer) {\n\t\t\t\t\tclearTimeout(seekTimer)\n\t\t\t\t\tseekTimer = undefined\n\t\t\t\t}\n\t\t\t\tconst thumbTempFilePath = await drawThumbnail(width, height)\n\t\t\t\tfinish({ ...metadata, thumbTempFilePath })\n\t\t\t}\n\t\t\tseekTimer = setTimeout(() => finish(metadata), VIDEO_THUMBNAIL_TIMEOUT_MS)\n\t\t\ttry {\n\t\t\t\tvideo.currentTime = Math.min(0.1, Math.max(0, duration - 0.01))\n\t\t\t} catch {\n\t\t\t\tfinish(metadata)\n\t\t\t}\n\t\t}\n\t\tvideo.onerror = () => finish({ width: 0, height: 0, duration: 0, thumbTempFilePath: '' })\n\t\tvideo.src = src\n\t})\n}\n\nasync function buildChooseMediaTempFile(file: File): Promise<ChooseMediaTempFile> {\n\tconst tempFilePath = createTempFilePath(file)\n\tconst fileType: MediaFileType = file.type.startsWith('video') ? 'video' : 'image'\n\n\tif (fileType === 'video') {\n\t\tconst metadata = await readVideoMetadata(tempFilePath)\n\t\treturn {\n\t\t\ttempFilePath,\n\t\t\tsize: file.size,\n\t\t\tduration: metadata.duration,\n\t\t\theight: metadata.height,\n\t\t\twidth: metadata.width,\n\t\t\tthumbTempFilePath: metadata.thumbTempFilePath,\n\t\t\tfileType,\n\t\t\toriginalFileObj: file,\n\t\t}\n\t}\n\n\tconst metadata = await readImageMetadata(tempFilePath)\n\treturn {\n\t\ttempFilePath,\n\t\tsize: file.size,\n\t\tduration: 0,\n\t\theight: metadata.height,\n\t\twidth: metadata.width,\n\t\tthumbTempFilePath: '',\n\t\tfileType,\n\t\toriginalFileObj: file,\n\t}\n}\n\nexport function chooseMedia(\n\tthis: MiniAppContext,\n\t{ count = 9, mediaType = ['image', 'video'], sourceType = ['album', 'camera'], camera = 'back', success, fail, complete }: {\n\t\tcount?: number\n\t\tmediaType?: unknown\n\t\tsourceType?: unknown\n\t\tmaxDuration?: unknown\n\t\tsizeType?: unknown\n\t\tcamera?: ChooseMediaCamera\n\t\tsuccess?: unknown\n\t\tfail?: unknown\n\t\tcomplete?: unknown\n\t},\n) {\n\tconst cbs = bindCallbacks(this, { success, fail, complete })\n\tconst { onSuccess, onFail, onComplete } = cbs\n\tconst normalizedCount = normalizeChooseMediaCount(count)\n\tconst normalizedMediaType = normalizeStringArray(mediaType, ['image', 'video'])\n\tconst normalizedSourceType = normalizeStringArray(sourceType, ['album', 'camera'])\n\n\tcreateFilePicker(\n\t\t'chooseMedia',\n\t\t{\n\t\t\taccept: getChooseMediaAccept(normalizedMediaType),\n\t\t\tmultiple: normalizedCount > 1,\n\t\t\tcapture: captureAttrFor(normalizedSourceType, camera),\n\t\t},\n\t\tcbs,\n\t\tasync (rawFiles, removeInput) => {\n\t\t\tconst files = rawFiles.slice(0, normalizedCount)\n\t\t\ttry {\n\t\t\t\tconst tempFiles = await Promise.all(files.map(buildChooseMediaTempFile))\n\t\t\t\tonSuccess?.({\n\t\t\t\t\ttempFiles,\n\t\t\t\t\ttype: getChooseMediaResultType(tempFiles),\n\t\t\t\t\tfailedCount: 0,\n\t\t\t\t\terrMsg: 'chooseMedia:ok',\n\t\t\t\t})\n\t\t\t} catch (error) {\n\t\t\t\tonFail?.({ errMsg: `chooseMedia:fail ${(error as Error).message}` })\n\t\t\t} finally {\n\t\t\t\tonComplete?.()\n\t\t\t\tremoveInput()\n\t\t\t}\n\t\t},\n\t)\n}\n\nexport function chooseVideo(\n\tthis: MiniAppContext,\n\t{ sourceType, camera, success, fail, complete }: {\n\t\tsourceType?: unknown\n\t\tcompressed?: unknown\n\t\tmaxDuration?: unknown\n\t\tcamera?: unknown\n\t\tsuccess?: unknown\n\t\tfail?: unknown\n\t\tcomplete?: unknown\n\t},\n) {\n\tconst cbs = bindCallbacks(this, { success, fail, complete })\n\tconst { onSuccess, onComplete } = cbs\n\tconst normalizedSourceType = normalizeStringArray(sourceType, ['album', 'camera'])\n\n\tcreateFilePicker(\n\t\t'chooseVideo',\n\t\t{ accept: 'video/*', multiple: false, capture: captureAttrFor(normalizedSourceType, camera) },\n\t\tcbs,\n\t\tasync (files, removeInput) => {\n\t\t\tconst file = files[0]!\n\t\t\tconst tempFilePath = createTempFilePath(file)\n\t\t\tconst metadata = await readVideoMetadata(tempFilePath)\n\t\t\tonSuccess?.({\n\t\t\t\ttempFilePath,\n\t\t\t\tduration: metadata.duration,\n\t\t\t\tsize: file.size,\n\t\t\t\twidth: metadata.width,\n\t\t\t\theight: metadata.height,\n\t\t\t\terrMsg: 'chooseVideo:ok',\n\t\t\t})\n\t\t\tonComplete?.()\n\t\t\tremoveInput()\n\t\t},\n\t)\n}\n\n// \u2500\u2500\u2500 Media: Audio (container-side handlers for service-apis/audio) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n// service-apis/audio/index.js (injected into the service Worker by the dimina\n// container bundle) calls invokeAPI('audioCreate', { audioId }), etc. DOM media\n// events on the container's HTMLAudioElement are bridged back to the service\n// layer via the `audioListen` handler.\n\n/** Payload delivered to the service-side dispatcher on every audio event. */\ninterface AudioEventPayload {\n\tevent: string\n\tcurrentTime: number\n\tduration: number\n\tbuffered: number\n\tpaused: boolean\n}\n\n/** DOM media event name \u2192 mini-program audio event name. */\nconst AUDIO_EVENT_MAP: Record<string, string> = {\n\tplay: 'play',\n\tpause: 'pause',\n\tended: 'ended',\n\terror: 'error',\n\ttimeupdate: 'timeUpdate',\n\twaiting: 'waiting',\n\tseeking: 'seeking',\n\tseeked: 'seeked',\n\tcanplay: 'canplay',\n}\n\nconst _newAudioInstances = new Map<number, HTMLAudioElement>()\n/** Disposers that unbind the DOM event bridge for a given audio instance. */\nconst _audioEventDisposers = new Map<number, EventBridgeDisposer>()\n/** The service-side dispatcher callback for a given audio instance. */\nconst _audioFire = new Map<number, (payload: AudioEventPayload) => void>()\n\n/** Snapshot the current playback state of an audio element. */\nfunction audioSnapshot(audio: HTMLAudioElement, event: string): AudioEventPayload {\n\treturn {\n\t\tevent,\n\t\tcurrentTime: audio.currentTime || 0,\n\t\tduration: Number.isFinite(audio.duration) ? audio.duration : 0,\n\t\tbuffered: audio.buffered.length ? audio.buffered.end(audio.buffered.length - 1) : 0,\n\t\tpaused: audio.paused,\n\t}\n}\n\nexport function audioCreate(this: MiniAppContext, { audioId }: { audioId: number }) {\n\t_newAudioInstances.set(audioId, new Audio())\n}\n\n/**\n * Persistent event-bridge registration. The service-side InnerAudioContext\n * calls this once at construction with a `keep: true` callback; the container\n * resolves a `fire` callback and binds the DOM media events of the matching\n * audio element to it.\n *\n * The dimina service `invokeAPI` runs every callback through\n * `callback.store(success, keep, evtId)` and delivers the resulting callback\n * id under the `success` field of `params` \u2014 `evtId` itself is consumed by\n * `callback.store` and never reaches the container payload. So the handler\n * resolves `fire` from `success`, exactly like every other media API.\n */\nexport function audioListen(this: MiniAppContext, { audioId, success }: { audioId: number; success: unknown }) {\n\tconst audio = _newAudioInstances.get(audioId)\n\tconst fire = this.createCallbackFunction(success) as ((payload: AudioEventPayload) => void) | undefined\n\tif (!audio || !fire) return\n\n\t_audioFire.set(audioId, fire)\n\n\t// Rebind cleanly if audioListen is somehow called twice for one instance.\n\t_audioEventDisposers.get(audioId)?.()\n\tconst dispose = bindDomEvents<AudioEventPayload>(\n\t\taudio,\n\t\tAUDIO_EVENT_MAP,\n\t\tfire,\n\t\tevent => audioSnapshot(audio, event),\n\t)\n\t_audioEventDisposers.set(audioId, dispose)\n}\n\nexport function audioSetProp(\n\tthis: MiniAppContext,\n\t{ audioId, prop, value, startTime, loop, volume, playbackRate, autoplay }: {\n\t\taudioId: number\n\t\tprop: string\n\t\tvalue: unknown\n\t\tstartTime?: number\n\t\tloop?: boolean\n\t\tvolume?: number\n\t\tplaybackRate?: number\n\t\tautoplay?: boolean\n\t},\n) {\n\tconst audio = _newAudioInstances.get(audioId)\n\tif (!audio) return\n\tswitch (prop) {\n\t\tcase 'src':\n\t\t\taudio.src = value as string\n\t\t\tif (startTime != null) audio.currentTime = startTime\n\t\t\tif (loop != null) audio.loop = loop\n\t\t\tif (volume != null) audio.volume = Math.max(0, Math.min(1, volume))\n\t\t\tif (playbackRate != null) audio.playbackRate = playbackRate\n\t\t\tif (autoplay) audio.play().catch(() => {})\n\t\t\tbreak\n\t\tcase 'startTime': audio.currentTime = Number(value) || 0; break\n\t\tcase 'autoplay': audio.autoplay = !!value; break\n\t\tcase 'loop': audio.loop = !!value; break\n\t\tcase 'volume': audio.volume = Math.max(0, Math.min(1, Number(value) || 0)); break\n\t\tcase 'playbackRate': audio.playbackRate = Number(value) || 1; break\n\t}\n}\n\nexport function audioPlay(this: MiniAppContext, { audioId, src }: { audioId: number; src?: string }) {\n\tconst audio = _newAudioInstances.get(audioId)\n\tif (!audio) return\n\tif (src && audio.src !== src) audio.src = src\n\taudio.play().catch(() => {})\n}\n\nexport function audioPause(this: MiniAppContext, { audioId }: { audioId: number }) {\n\t_newAudioInstances.get(audioId)?.pause()\n}\n\nexport function audioStop(this: MiniAppContext, { audioId }: { audioId: number }) {\n\tconst audio = _newAudioInstances.get(audioId)\n\tif (!audio) return\n\taudio.pause()\n\taudio.currentTime = 0\n\t// `stop` has no DOM equivalent \u2014 synthesise it through the bridge.\n\t_audioFire.get(audioId)?.(audioSnapshot(audio, 'stop'))\n}\n\nexport function audioSeek(this: MiniAppContext, { audioId, position }: { audioId: number; position: number }) {\n\tconst audio = _newAudioInstances.get(audioId)\n\tif (!audio) return\n\taudio.currentTime = position\n}\n\nexport function audioDestroy(this: MiniAppContext, { audioId }: { audioId: number }) {\n\t_audioEventDisposers.get(audioId)?.()\n\t_audioEventDisposers.delete(audioId)\n\t_audioFire.delete(audioId)\n\n\tconst audio = _newAudioInstances.get(audioId)\n\tif (!audio) return\n\taudio.pause()\n\taudio.removeAttribute('src')\n\taudio.load()\n\t_newAudioInstances.delete(audioId)\n}\n", "/**\n * Container-side handlers for the `FileSystemManager.*` invokeAPI wire names.\n *\n * The service thread's FileSystemManager (upstream\n * `service/src/api/core/file/index.js`, overlaid by the devtools\n * `service-apis/file/index.js` shim at container build time) invokes the\n * container with dotted wire names \u2014 `FileSystemManager.writeFile`, \u2026 \u2014 and\n * speaks the upstream transport protocol:\n *\n * - write-class `data` arrives either as a plain string or as a\n * `{ __diminaFileDataType: 'base64', __diminaFileDataBase64 }` sentinel\n * (the service side's postMessage-safe ArrayBuffer encoding);\n * - binary `readFile` results travel back as `{ __diminaArrayBufferBase64 }`\n * for the service side to decode into an ArrayBuffer;\n * - errMsg uses the wx short name (`writeFile:ok`), matching what real\n * dimina clients (Android / iOS / Harmony FileSystemManager backends)\n * report to mini-program code.\n *\n * Each handler adapts that wire shape onto the `fs*` implementations in\n * `simulator-api-fs.ts`, which own path resolution (single vpath resolver)\n * and the actual Node fs work.\n */\n\nimport type { MiniAppContext } from './types'\nimport { getNodeBindings } from '../shared/node-bindings.js'\nimport { bindCallbacks } from './simulator-api-helpers'\nimport {\n\tfsAccess,\n\tfsStat,\n\tfsReadFile,\n\tfsWriteFile,\n\tfsAppendFile,\n\tfsCopyFile,\n\tfsRename,\n\tfsUnlink,\n\tfsMkdir,\n\tfsRmdir,\n\tfsReaddir,\n\tfsGetFileInfo,\n\tfsSaveFile,\n\tfsGetSavedFileList,\n\tfsRemoveSavedFile,\n\tfsTruncate,\n} from './simulator-api-fs'\n\n/** Sentinel keys of the service-side transport protocol (see upstream `service/src/api/core/file/index.js`). */\nconst ARRAY_BUFFER_BASE64_KEY = '__diminaArrayBufferBase64'\nconst FILE_DATA_TYPE_KEY = '__diminaFileDataType'\nconst FILE_DATA_BASE64_KEY = '__diminaFileDataBase64'\n\ntype WireParams = Record<string, unknown>\n\n/**\n * An `fs*` impl as seen from the untyped wire boundary. Each impl validates\n * its own fields (path resolution, data types), so the adapter hands the\n * whole params object through unchecked.\n */\ntype FsHandler = (this: MiniAppContext, opts: WireParams) => void\n\ninterface FsmAdapterSpec {\n\t/** wx short method name \u2014 also the errMsg prefix the service side expects. */\n\tshort: string\n\timpl: FsHandler\n\t/** Decode a base64 write-payload sentinel in `data` before the impl runs. */\n\tdecodeWriteData?: boolean\n\t/** Encode a binary success `data` into the ArrayBuffer base64 sentinel. */\n\tencodeReadResult?: boolean\n}\n\nconst FSM_ADAPTERS: FsmAdapterSpec[] = [\n\t{ short: 'access', impl: fsAccess as FsHandler },\n\t{ short: 'stat', impl: fsStat as FsHandler },\n\t{ short: 'readFile', impl: fsReadFile as FsHandler, encodeReadResult: true },\n\t{ short: 'writeFile', impl: fsWriteFile as FsHandler, decodeWriteData: true },\n\t{ short: 'appendFile', impl: fsAppendFile as FsHandler, decodeWriteData: true },\n\t{ short: 'copyFile', impl: fsCopyFile as FsHandler },\n\t{ short: 'rename', impl: fsRename as FsHandler },\n\t{ short: 'unlink', impl: fsUnlink as FsHandler },\n\t{ short: 'mkdir', impl: fsMkdir as FsHandler },\n\t{ short: 'rmdir', impl: fsRmdir as FsHandler },\n\t{ short: 'readdir', impl: fsReaddir as FsHandler },\n\t{ short: 'getFileInfo', impl: fsGetFileInfo as FsHandler },\n\t{ short: 'saveFile', impl: fsSaveFile as FsHandler },\n\t{ short: 'getSavedFileList', impl: fsGetSavedFileList as FsHandler },\n\t{ short: 'removeSavedFile', impl: fsRemoveSavedFile as FsHandler },\n\t{ short: 'truncate', impl: fsTruncate as FsHandler },\n]\n\n/** The `fs*` impls report `fsWriteFile:ok` \u2014 the legacy internal prefix for a given wx short name. */\nfunction legacyPrefix(short: string): string {\n\treturn `fs${short[0]!.toUpperCase()}${short.slice(1)}`\n}\n\n/** Rewrites a payload's `errMsg` from the internal `fs*` prefix to the wx short name. */\nfunction renameErrMsg(payload: unknown, legacy: string, short: string): unknown {\n\tif (!payload || typeof payload !== 'object') return payload\n\tconst rec = payload as WireParams\n\tif (typeof rec.errMsg === 'string' && rec.errMsg.startsWith(`${legacy}:`)) {\n\t\treturn { ...rec, errMsg: `${short}:${rec.errMsg.slice(legacy.length + 1)}` }\n\t}\n\treturn payload\n}\n\n/**\n * `Buffer` for the base64 codec: the simulator document has no global\n * `Buffer` (nodeIntegration is off), so take it from the preload-published\n * node bindings; vitest/node contexts have the global.\n */\nconst BufferImpl: typeof Buffer | undefined =\n\tgetNodeBindings().buffer?.Buffer ?? (typeof Buffer !== 'undefined' ? Buffer : undefined)\n\n/** Decodes the service side's base64 write-payload sentinel into bytes; passes any other value through. */\nfunction decodeFileData(data: unknown): unknown {\n\tif (!BufferImpl) return data\n\tif (!data || typeof data !== 'object') return data\n\tconst rec = data as WireParams\n\tif (rec[FILE_DATA_TYPE_KEY] !== 'base64' || typeof rec[FILE_DATA_BASE64_KEY] !== 'string') return data\n\treturn BufferImpl.from(rec[FILE_DATA_BASE64_KEY] as string, 'base64')\n}\n\n/**\n * Wraps a binary success `data` (Buffer/typed array) in the ArrayBuffer\n * base64 sentinel; strings pass through. `ArrayBuffer.isView` is a brand\n * check that holds across realms \u2014 an `instanceof Uint8Array` test would\n * miss Node `Buffer`s when this module is evaluated under a DOM realm.\n */\nfunction encodeReadResult(payload: unknown): unknown {\n\tif (!BufferImpl) return payload\n\tif (!payload || typeof payload !== 'object') return payload\n\tconst rec = payload as WireParams\n\tconst data = rec.data\n\tif (typeof data === 'string' || !ArrayBuffer.isView(data)) return payload\n\tconst bytes = BufferImpl.from(data.buffer, data.byteOffset, data.byteLength)\n\treturn { ...rec, data: { [ARRAY_BUFFER_BASE64_KEY]: bytes.toString('base64') } }\n}\n\nfunction makeFsmHandler(spec: FsmAdapterSpec): (this: MiniAppContext, params?: unknown) => void {\n\tconst legacy = legacyPrefix(spec.short)\n\treturn function (this: MiniAppContext, params?: unknown) {\n\t\tconst raw: WireParams =\n\t\t\tparams && typeof params === 'object' && !Array.isArray(params)\n\t\t\t\t? { ...(params as WireParams) }\n\t\t\t\t: {}\n\t\tconst { success, fail, complete, ...rest } = raw\n\t\t// Resolve the caller's callbacks through THIS context (on the production\n\t\t// bridge they are sentinel ids only runApiAsync's patched\n\t\t// createCallbackFunction understands).\n\t\tconst cbs = bindCallbacks(this, { success, fail, complete })\n\n\t\tconst opts: WireParams = rest\n\t\tif (spec.decodeWriteData && 'data' in opts) {\n\t\t\topts.data = decodeFileData(opts.data)\n\t\t}\n\t\t// Terminal guards: exactly one success/fail verdict and one complete per\n\t\t// call. A synchronous throw inside the impl (e.g. Node fs rejecting an\n\t\t// invalid `data` type) must surface as a short-name fail through the wx\n\t\t// callbacks \u2014 never propagate as an exception (the bridge would stamp it\n\t\t// with the dotted wire name) \u2014 and any late async callback the impl\n\t\t// still fires after that is dropped here.\n\t\tlet verdictFired = false\n\t\tlet completeFired = false\n\t\tconst fireSuccess = (out: unknown) => {\n\t\t\tif (verdictFired) return\n\t\t\tverdictFired = true\n\t\t\tcbs.onSuccess?.(out)\n\t\t}\n\t\tconst fireFail = (out: unknown) => {\n\t\t\tif (verdictFired) return\n\t\t\tverdictFired = true\n\t\t\tcbs.onFail?.(out)\n\t\t}\n\t\tconst fireComplete = () => {\n\t\t\tif (completeFired) return\n\t\t\tcompleteFired = true\n\t\t\tcbs.onComplete?.()\n\t\t}\n\t\topts.success = (res: unknown) => {\n\t\t\tlet out = renameErrMsg(res, legacy, spec.short)\n\t\t\tif (spec.encodeReadResult) out = encodeReadResult(out)\n\t\t\tfireSuccess(out)\n\t\t}\n\t\topts.fail = (res: unknown) => {\n\t\t\tfireFail(renameErrMsg(res, legacy, spec.short))\n\t\t}\n\t\topts.complete = fireComplete\n\n\t\t// The impl re-resolves its callbacks via ctx.createCallbackFunction, and\n\t\t// the production bridge's patched createCallbackFunction only understands\n\t\t// sentinel ids \u2014 hand the impl a derived context that passes the plain\n\t\t// interceptor functions above straight through.\n\t\tconst innerCtx = Object.create(this as object) as MiniAppContext\n\t\tinnerCtx.createCallbackFunction = (fn: unknown) =>\n\t\t\ttypeof fn === 'function' ? (fn as (...args: unknown[]) => void) : undefined\n\t\ttry {\n\t\t\tspec.impl.call(innerCtx, opts)\n\t\t} catch (err) {\n\t\t\tconst msg = err instanceof Error ? err.message : String(err)\n\t\t\tfireFail({ errMsg: `${spec.short}:fail ${msg}` })\n\t\t\tfireComplete()\n\t\t}\n\t}\n}\n\nconst handlers: Record<string, (this: MiniAppContext, params?: unknown) => void> = {}\nfor (const spec of FSM_ADAPTERS) {\n\thandlers[`FileSystemManager.${spec.short}`] = makeFsmHandler(spec)\n}\n\n/** Registered 1:1 into `simulatorApis` \u2014 the keys are the invokeAPI wire names. */\nexport const fileSystemManagerApis = handlers\n", "/**\n * Runtime-owned authoritative implementation of wx.request network semantics, shared\n * by every request surface (simulator `directRequest`, preload api-compat\n * `wx.request` shim). Keeping the semantics in one module is what prevents the\n * surfaces from drifting apart on the core contract.\n *\n * The contract (official wx.request semantics):\n * - success vs fail is decided ONLY by whether a server response was\n * received. Any HTTP response \u2014 200, 401, 500 \u2014 resolves via `success`\n * with `{ data, statusCode, header, errMsg: 'request:ok' }`; callers\n * branch on `statusCode` (e.g. 401 \u2192 re-login).\n * - `fail` fires only for network-layer failures and always carries a\n * non-empty errMsg: 'request:fail timeout' (deadline hit),\n * 'request:fail abort' (caller aborted), 'request:fail <reason>' (DNS/\n * connection/protocol errors).\n * - `timeout` defaults to 60000ms (the wx default) when omitted or\n * non-positive \u2014 a request never hangs indefinitely.\n * - `dataType` (default 'json') controls body decoding: 'json' attempts\n * JSON.parse with raw-text fallback; anything else keeps raw text.\n * `responseType: 'arraybuffer'` (or the legacy `dataType: 'arraybuffer'`\n * spelling) yields an ArrayBuffer instead.\n * - Outgoing headers merge case-insensitively via `Headers` so a caller's\n * `content-type` in any casing wins exactly once; the `application/json`\n * default applies only when the caller supplied none. Plain-object merges\n * would keep both casings as distinct keys and comma-join them on the wire.\n * - GET/HEAD serialize object `data` into URL query params (no body);\n * other methods send string data verbatim, form-encode objects under\n * application/x-www-form-urlencoded, and JSON-encode otherwise.\n * - `complete` fires exactly once, after success or fail, with that same\n * result object.\n *\n * Not provided: `cookies` on the success result \u2014 fetch() cannot read\n * Set-Cookie response headers, so surfacing a fabricated list would lie.\n */\n\nexport interface RequestSuccessResult {\n data: unknown\n statusCode: number\n header: Record<string, string>\n errMsg: 'request:ok'\n}\n\nexport interface RequestFailResult {\n errMsg: string\n errno?: number\n}\n\nexport interface RequestHandle {\n abort(): void\n}\n\nexport interface RequestCoreOptions {\n url: string\n data?: unknown\n header?: Record<string, string>\n timeout?: number\n method?: string\n dataType?: string\n responseType?: string\n}\n\nexport interface RequestCoreCallbacks {\n success?: (res: RequestSuccessResult) => void\n fail?: (err: RequestFailResult) => void\n complete?: (res: RequestSuccessResult | RequestFailResult) => void\n}\n\n/**\n * The wx.request default timeout budget. Exported as the single source of\n * truth for every layer that reasons about a request's time budget \u2014 the\n * bridge-router watchdog (apiCallWatchdogMs in simulator-api-metadata.ts)\n * derives its window from this so the two cannot drift apart.\n */\nexport const DEFAULT_REQUEST_TIMEOUT_MS = 60_000\n\n/**\n * Largest delay setTimeout honours (2^31-1 ms). Anything above overflows the\n * signed-32-bit timer register and fires ~immediately (~1ms) instead of late \u2014\n * so an oversized caller timeout must be rejected, never passed through.\n */\nexport const MAX_TIMEOUT_MS = 2_147_483_647\n\n/**\n * Resolve a caller-supplied wx timeout into a usable budget: a finite positive\n * number within setTimeout's range is honoured; anything else (absent, 0,\n * negative, NaN, Infinity, overflowing) falls back to the wx default. Shared\n * by performRequest and the bridge-router watchdog (apiCallWatchdogMs) so the\n * two layers can never disagree on what a valid timeout is.\n */\nexport function resolveTimeoutBudgetMs(timeout: unknown): number {\n const t = Number(timeout)\n return Number.isFinite(t) && t > 0 && t <= MAX_TIMEOUT_MS ? t : DEFAULT_REQUEST_TIMEOUT_MS\n}\n\nfunction buildHeaders(header: Record<string, string> | undefined): Headers {\n const headers = new Headers()\n for (const [key, value] of Object.entries(header ?? {})) {\n if (value != null) headers.set(key, String(value))\n }\n if (!headers.has('content-type')) headers.set('content-type', 'application/json')\n return headers\n}\n\nfunction appendQueryParams(url: string, data: Record<string, unknown>): string {\n // Resolve against the current document when available so page-relative URLs\n // keep working in the render-window shim.\n const base = typeof location !== 'undefined' ? location.href : undefined\n const resolved = new URL(url, base)\n for (const [key, value] of Object.entries(data)) {\n resolved.searchParams.append(key, String(value))\n }\n return resolved.toString()\n}\n\nfunction encodeBody(data: unknown, contentType: string): BodyInit {\n if (typeof data === 'string') return data\n if (contentType.includes('application/x-www-form-urlencoded')) {\n const form = new URLSearchParams()\n for (const [key, value] of Object.entries(data as Record<string, unknown>)) {\n form.append(key, String(value))\n }\n return form.toString()\n }\n return JSON.stringify(data)\n}\n\nasync function decodeResponseData(\n response: Response,\n dataType: string,\n responseType: string,\n): Promise<unknown> {\n if (responseType === 'arraybuffer' || dataType === 'arraybuffer') {\n return response.arrayBuffer()\n }\n const text = await response.text()\n if (dataType !== 'json') return text\n try {\n return JSON.parse(text)\n } catch {\n return text\n }\n}\n\nexport function performRequest(\n opts: RequestCoreOptions,\n callbacks: RequestCoreCallbacks,\n): RequestHandle {\n const method = (opts.method || 'GET').toUpperCase()\n const canHaveBody = method !== 'GET' && method !== 'HEAD'\n const headers = buildHeaders(opts.header)\n\n let url = opts.url\n const init: RequestInit = { method, headers }\n\n if (!canHaveBody) {\n if (opts.data && typeof opts.data === 'object') {\n url = appendQueryParams(url, opts.data as Record<string, unknown>)\n }\n } else if (opts.data != null) {\n init.body = encodeBody(opts.data, headers.get('content-type') ?? '')\n }\n\n const controller = new AbortController()\n init.signal = controller.signal\n\n // First verdict wins: a timeout/abort settles the call even though the fetch\n // promise is still pending, and the fetch's own late resolution/AbortError\n // rejection must not fire a second callback round.\n let settled = false\n\n function settleSuccess(res: RequestSuccessResult): void {\n if (settled) return\n settled = true\n clearTimeout(timer)\n callbacks.success?.(res)\n callbacks.complete?.(res)\n }\n\n function settleFail(err: RequestFailResult): void {\n if (settled) return\n settled = true\n clearTimeout(timer)\n callbacks.fail?.(err)\n callbacks.complete?.(err)\n }\n\n const timeoutMs = resolveTimeoutBudgetMs(opts.timeout)\n const timer = setTimeout(() => {\n settleFail({ errMsg: 'request:fail timeout' })\n controller.abort()\n }, timeoutMs)\n\n const dataType = opts.dataType ?? 'json'\n const responseType = opts.responseType ?? 'text'\n\n fetch(url, init)\n .then(async (response) => {\n const header: Record<string, string> = {}\n response.headers.forEach((value, key) => {\n header[key] = value\n })\n const data = await decodeResponseData(response, dataType, responseType)\n settleSuccess({ data, statusCode: response.status, header, errMsg: 'request:ok' })\n })\n .catch((error: unknown) => {\n const reason = error instanceof Error ? error.message : String(error)\n settleFail({ errMsg: `request:fail ${reason || 'network error'}` })\n })\n\n return {\n abort() {\n settleFail({ errMsg: 'request:fail abort' })\n controller.abort()\n },\n }\n}\n", "/**\n * DevTools API stubs for network-related wx.xxx APIs.\n *\n * Each exported function is bound with `this` = MiniApp instance\n * (via AppManager.registerApi -> MiniApp.invokeApi).\n */\n\nimport type { MiniAppContext } from './types'\nimport { bindCallbacks } from './simulator-api-helpers'\nimport { resolveTimeoutBudgetMs } from '../shared/request-core'\nimport { createTempFilePath, getTempFileName, resolveTempFilePath } from './temp-files'\n\nexport function downloadFile(\n\tthis: MiniAppContext,\n\t{ url, header = {}, filePath, timeout, success, fail, complete }: {\n\t\turl: string\n\t\theader?: Record<string, string>\n\t\tfilePath?: string\n\t\ttimeout?: number\n\t\tsuccess?: unknown\n\t\tfail?: unknown\n\t\tcomplete?: unknown\n\t},\n) {\n\tconst { onSuccess, onFail, onComplete } = bindCallbacks(this, { success, fail, complete })\n\n\t// The handler owns its own deadline: the bridge's no-handler watchdog is\n\t// disarmed by the handler-received ack, so a stalled network must be\n\t// bounded here (wx budget semantics, same authority as `request`). First\n\t// verdict wins \u2014 a late fetch settlement after the timeout fired must not\n\t// resurrect success or double-fire complete.\n\tlet settled = false\n\tconst settleFail = (errMsg: string) => {\n\t\tif (settled) return\n\t\tsettled = true\n\t\tclearTimeout(timer)\n\t\tonFail?.({ errMsg })\n\t\tonComplete?.()\n\t}\n\tconst settleOk = (result: Record<string, unknown>) => {\n\t\tif (settled) return\n\t\tsettled = true\n\t\tclearTimeout(timer)\n\t\tonSuccess?.(result)\n\t\tonComplete?.()\n\t}\n\tconst controller = new AbortController()\n\tconst timer = setTimeout(() => {\n\t\tsettleFail('downloadFile:fail timeout')\n\t\tcontroller.abort()\n\t}, resolveTimeoutBudgetMs(timeout))\n\n\tfetch(url, { headers: header, signal: controller.signal })\n\t\t.then(async (response) => {\n\t\t\tif (!response.ok) {\n\t\t\t\t// statusText is frequently empty (HTTP/2 has none) \u2014 the status\n\t\t\t\t// code is the reliable part of the failure reason.\n\t\t\t\tsettleFail(\n\t\t\t\t\t`downloadFile:fail HTTP ${response.status}${response.statusText ? ` ${response.statusText}` : ''}`,\n\t\t\t\t)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst blob = await response.blob()\n\t\t\tconst tempFilePath = createTempFilePath(blob)\n\t\t\tsettleOk({\n\t\t\t\ttempFilePath,\n\t\t\t\tfilePath: filePath || tempFilePath,\n\t\t\t\tstatusCode: response.status,\n\t\t\t\terrMsg: 'downloadFile:ok',\n\t\t\t})\n\t\t})\n\t\t.catch((error: Error) => {\n\t\t\tsettleFail(`downloadFile:fail ${error.message}`)\n\t\t})\n}\n\ntype UploadFileOptions = {\n\turl: string\n\tfilePath: string\n\tname: string\n\theader?: Record<string, string>\n\tformData?: Record<string, unknown>\n\ttimeout?: number\n\tuploadId?: string\n\tprogress?: unknown\n\theadersReceived?: unknown\n\tsuccess?: unknown\n\tfail?: unknown\n\tcomplete?: unknown\n}\n\nconst uploadRequests = new Map<string, XMLHttpRequest>()\nconst uploadPendingResolves = new Set<string>()\nconst uploadAbortedBeforeStart = new Set<string>()\nlet nextUploadId = 1\n\nfunction createUploadId(): string {\n\treturn `upload_${Date.now()}_${nextUploadId++}`\n}\n\nfunction parseResponseHeaders(raw: string): Record<string, string> {\n\tconst headers: Record<string, string> = {}\n\tfor (const line of raw.trim().split(/[\\r\\n]+/)) {\n\t\tif (!line) continue\n\t\tconst index = line.indexOf(':')\n\t\tif (index <= 0) continue\n\t\tconst key = line.slice(0, index).trim()\n\t\tconst value = line.slice(index + 1).trim()\n\t\tif (key) headers[key] = value\n\t}\n\treturn headers\n}\n\nfunction appendFormData(form: FormData, formData: Record<string, unknown>): void {\n\tfor (const [key, value] of Object.entries(formData)) {\n\t\tif (value == null) continue\n\t\tif (value instanceof Blob) {\n\t\t\tform.append(key, value)\n\t\t} else if (typeof value === 'object') {\n\t\t\t// JSON.stringify for plain objects/arrays; Map/Set/RegExp/TypedArray\n\t\t\t// fall through here too and become '{}' or similar \u2014 caller should\n\t\t\t// pre-stringify if they need a specific form.\n\t\t\tform.append(key, JSON.stringify(value))\n\t\t} else {\n\t\t\tform.append(key, String(value))\n\t\t}\n\t}\n}\n\nexport function uploadFile(\n\tthis: MiniAppContext,\n\t{\n\t\turl,\n\t\tfilePath,\n\t\tname,\n\t\theader = {},\n\t\tformData = {},\n\t\ttimeout,\n\t\tuploadId = createUploadId(),\n\t\tprogress,\n\t\theadersReceived,\n\t\tsuccess,\n\t\tfail,\n\t\tcomplete,\n\t}: UploadFileOptions,\n) {\n\tconst { onSuccess, onFail, onComplete } = bindCallbacks(this, { success, fail, complete })\n\tconst onProgress = this.createCallbackFunction(progress)\n\tconst onHeadersReceived = this.createCallbackFunction(headersReceived)\n\n\tconst cleanup = () => {\n\t\tuploadRequests.delete(uploadId)\n\t\tuploadPendingResolves.delete(uploadId)\n\t\tuploadAbortedBeforeStart.delete(uploadId)\n\t}\n\tconst finishFail = (message: string) => {\n\t\tcleanup()\n\t\tconst result = { errMsg: `uploadFile:fail ${message}` }\n\t\tonFail?.(result)\n\t\tonComplete?.(result)\n\t}\n\n\tuploadPendingResolves.add(uploadId)\n\tvoid resolveTempFilePath(filePath)\n\t\t.then((blob) => {\n\t\t\tuploadPendingResolves.delete(uploadId)\n\t\t\tif (uploadAbortedBeforeStart.has(uploadId)) {\n\t\t\t\tfinishFail('abort')\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst xhr = new XMLHttpRequest()\n\t\t\tlet settled = false\n\t\t\tlet deliveredHeaders = false\n\t\t\tuploadRequests.set(uploadId, xhr)\n\n\t\t\tconst finishSuccess = () => {\n\t\t\t\tif (settled) return\n\t\t\t\tsettled = true\n\t\t\t\tconst headers = parseResponseHeaders(xhr.getAllResponseHeaders())\n\t\t\t\tcleanup()\n\t\t\t\tconst result = {\n\t\t\t\t\tdata: typeof xhr.response === 'string' ? xhr.response : xhr.responseText,\n\t\t\t\t\tstatusCode: xhr.status,\n\t\t\t\t\theader: headers,\n\t\t\t\t\terrMsg: 'uploadFile:ok',\n\t\t\t\t}\n\t\t\t\tonSuccess?.(result)\n\t\t\t\tonComplete?.(result)\n\t\t\t}\n\t\t\tconst finishXhrFail = (message: string) => {\n\t\t\t\tif (settled) return\n\t\t\t\tsettled = true\n\t\t\t\tfinishFail(message)\n\t\t\t}\n\t\t\tconst emitHeaders = () => {\n\t\t\t\tif (deliveredHeaders) return\n\t\t\t\tdeliveredHeaders = true\n\t\t\t\tonHeadersReceived?.({ header: parseResponseHeaders(xhr.getAllResponseHeaders()) })\n\t\t\t}\n\n\t\t\txhr.open('POST', url, true)\n\t\t\tif (timeout === undefined) {\n\t\t\t\txhr.timeout = 60_000\n\t\t\t} else if (Number(timeout) > 0) {\n\t\t\t\txhr.timeout = Number(timeout)\n\t\t\t}\n\t\t\tfor (const [key, value] of Object.entries(header)) {\n\t\t\t\tif (/^(referer|content-type)$/i.test(key)) continue\n\t\t\t\txhr.setRequestHeader(key, String(value))\n\t\t\t}\n\t\t\txhr.upload.onprogress = (event) => {\n\t\t\t\tconst totalBytesExpectedToSend = event.lengthComputable ? event.total : blob.size\n\t\t\t\tconst progressValue = totalBytesExpectedToSend > 0\n\t\t\t\t\t? Math.round((event.loaded / totalBytesExpectedToSend) * 100)\n\t\t\t\t\t: 0\n\t\t\t\tonProgress?.({\n\t\t\t\t\tprogress: Math.max(0, Math.min(100, progressValue)),\n\t\t\t\t\ttotalBytesSent: event.loaded,\n\t\t\t\t\ttotalBytesExpectedToSend,\n\t\t\t\t})\n\t\t\t}\n\t\t\txhr.onreadystatechange = () => {\n\t\t\t\tif (xhr.readyState >= XMLHttpRequest.HEADERS_RECEIVED) emitHeaders()\n\t\t\t}\n\t\t\txhr.onload = () => {\n\t\t\t\temitHeaders()\n\t\t\t\tfinishSuccess()\n\t\t\t}\n\t\t\txhr.onerror = () => finishXhrFail('network error')\n\t\t\txhr.ontimeout = () => finishXhrFail('timeout')\n\t\t\txhr.onabort = () => finishXhrFail('abort')\n\n\t\t\tconst body = new FormData()\n\t\t\tappendFormData(body, formData)\n\t\t\tbody.append(name, blob, getTempFileName(filePath, blob, name || 'file'))\n\t\t\txhr.send(body)\n\t\t})\n\t\t.catch((error: Error) => {\n\t\t\tfinishFail(error.message)\n\t\t})\n}\n\nexport function uploadFileAbort(this: MiniAppContext, { uploadId }: { uploadId?: string } = {}) {\n\tif (!uploadId) return\n\tconst xhr = uploadRequests.get(uploadId)\n\tif (xhr) {\n\t\txhr.abort()\n\t\treturn\n\t}\n\tif (uploadPendingResolves.has(uploadId)) {\n\t\tuploadAbortedBeforeStart.add(uploadId)\n\t}\n}\n", "/**\n * The mini-app itself: navigation bar, the page stack rendered as render-host\n * guests, the tabBar, and the native interaction overlays \u2014 plus the routing\n * queue and state machines that drive them.\n *\n * Everything device-shaped is the host's: bezel, notch, status bar, home\n * indicator and screen geometry never appear here. What the frame needs of them\n * arrives as two numbers (`statusBarHeight`, `bottomInset`) and two slots the\n * host fills with its own chrome, so the same mini-app renders identically\n * whether it is installed into a simulated phone, a plain window, or a host app\n * with no device pretense at all.\n *\n * Renders a fragment rather than a container of its own: the host owns the box\n * these children lay out in (its size, corners and clipping ARE the device), so\n * imposing a wrapper here would only fight it.\n */\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react'\nimport type { ReactNode } from 'react'\nimport { SIMULATOR_EVENTS as E } from '../shared/bridge-channels.js'\nimport type {\n NavActionPayload,\n TabActionPayload,\n} from '../shared/bridge-channels.js'\nimport type { MiniAppHost } from './miniapp-host.js'\nimport { NavigationBar } from './navigation-bar.js'\nimport type { NavBarPlatform, NavigationBarTextStyle } from './navigation-bar.js'\nimport { TabBar } from './tab-bar.js'\nimport { UiOverlay } from './ui-overlay.js'\nimport { applyTabAction, makeInitialTabBarState } from './tab-bar-state.js'\nimport {\n enumerateMounted,\n makeInitialShellState,\n mutatePageNavBar,\n navBarFromConfig,\n normalizePath,\n pageBackgroundColor,\n reduceNavBar,\n type PageEntry,\n type SideEffect,\n} from './page-stack-controller.js'\nimport { shouldShowHomeButton } from './navigate-home.js'\nimport {\n commitShell,\n commitTabBar,\n doNavigateBack,\n doNavigateHome,\n doNavigateTo,\n doReLaunch,\n doRedirectTo,\n doSwitchTab,\n type MiniAppFrameState,\n type ShellNavPayload,\n} from './miniapp-routing.js'\nimport './miniapp-frame.css'\n\nconst NAV_BAR_HEIGHT = 44\n\n/** What the capsule's \"more\" button hands the host when there is nothing built in to do. */\nexport interface CapsuleMoreContext {\n appId: string\n /** The active page's title, falling back to the appId when it has none. */\n appName: string\n pagePath: string\n}\n\n/**\n * Page chrome state the host's own overlays need. A status bar drawn over the\n * mini-app has to follow the active page's `navigationBarTextStyle` \u2014 white\n * glyphs over a dark page, black over a light one \u2014 and only the frame knows\n * which page is active.\n */\nexport interface FrameChromeState {\n textStyle: NavigationBarTextStyle\n}\n\nexport interface MiniAppFrameProps {\n host: MiniAppHost\n /** The bridgeId of the page the host already spawned \u2014 the stack bottom. */\n bridgeId: string\n /** Whose navigation-bar conventions to follow (title centered vs leading). */\n platform?: NavBarPlatform\n /**\n * Chrome height the host reserves above the mini-app. The nav bar pads itself\n * by this much so a default bar blends its background up into that strip and\n * a custom bar shows the page through it. 0 when the host draws no status bar.\n */\n statusBarHeight?: number\n /**\n * Bottom safe area. The tabBar's background extends through it (WeChat /\n * Android / Harmony parity) so the home-indicator strip takes the tabBar's\n * color. 0 when the host has no bottom inset.\n */\n bottomInset?: number\n /** Capsule \"more\" handler. Without one the button still renders but does nothing. */\n onMore?: (context: CapsuleMoreContext) => void\n /**\n * Host chrome drawn above the nav bar \u2014 a status bar, a notch. A function so\n * it can follow the active page's chrome state; see `FrameChromeState`.\n */\n statusBar?: (chrome: FrameChromeState) => ReactNode\n /** Host chrome drawn above everything \u2014 extension layers, a home indicator. */\n deviceOverlay?: ReactNode\n}\n\nexport function MiniAppFrame({\n host,\n bridgeId,\n platform = 'ios',\n statusBarHeight = 0,\n bottomInset = 0,\n onMore,\n statusBar,\n deviceOverlay,\n}: MiniAppFrameProps) {\n const preload = useMemo(() => host.getRenderPreloadUrl(), [host])\n const tabBarConfig = useMemo(() => host.getTabBarConfig(), [host])\n\n const initialEntry = useMemo<PageEntry>(() => {\n const pagePath = normalizePath(host.pagePath)\n const windowConfig = host.rootWindowConfig ?? {}\n const isTab = !!host.getTabBarConfig()?.list.some(\n item => normalizePath(item.pagePath) === pagePath,\n )\n return {\n bridgeId,\n pagePath,\n query: { ...host.query },\n isTab,\n windowConfig,\n // The launch page is the stack bottom, so a non-home, non-tab launch\n // page gets the home button by the automatic rule.\n navBar: navBarFromConfig(windowConfig, host.appId, {\n homeButtonVisible: shouldShowHomeButton({\n pagePath,\n homePagePath: host.getHomePagePath(),\n isTab,\n isStackBottom: true,\n forcedByConfig: windowConfig.homeButton === true,\n }),\n }),\n }\n }, [host, bridgeId])\n\n const [{ shell, tabBar }, setState] = useState<MiniAppFrameState>(() => ({\n shell: makeInitialShellState(initialEntry),\n tabBar: makeInitialTabBarState(tabBarConfig),\n }))\n\n // Authoritative state for the bridge-event handlers and the async routing\n // controllers. Written SYNCHRONOUSLY by commitShell/commitTabBar, never by a\n // passive effect: bridge events arrive outside React's batching, so an\n // effect-synced mirror lags one commit behind and would drag this ref back to\n // the pre-event snapshot \u2014 the next event then reduces from stale state and\n // overwrites the one before it. React state is only the render mirror.\n const stateRef = useRef<MiniAppFrameState>({ shell, tabBar })\n\n const applySideEffects = useCallback((effects: SideEffect[]) => {\n for (const effect of effects) {\n if (effect.kind === 'lifecycle') {\n host.notifyLifecycle(effect.bridgeId, effect.event)\n } else if (effect.kind === 'closePage') {\n host.closePage(effect.bridgeId)\n }\n }\n }, [host])\n\n // \u2500\u2500 NavigationBar dynamic updates \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n useEffect(() => {\n const listener = (\n payload: { bridgeId: string; name: string; params: Record<string, unknown> },\n ) => {\n commitShell(\n stateRef,\n setState,\n mutatePageNavBar(stateRef.current.shell, payload.bridgeId, navBar =>\n reduceNavBar(navBar, payload.name, payload.params),\n ),\n )\n }\n return host.onSimulatorEvent(E.NAV_BAR, listener)\n }, [host])\n\n // \u2500\u2500 TabBar dynamic API \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n useEffect(() => {\n const listener = (payload: TabActionPayload) => {\n const next = applyTabAction(stateRef.current.tabBar, {\n kind: 'apply',\n name: payload.name,\n params: payload.params,\n })\n commitTabBar(stateRef, setState, next.state)\n host.notifyNavCallback({\n ok: next.ok,\n errMsg: next.errMsg,\n callbacks: payload.callbacks,\n })\n }\n return host.onSessionEvent(E.TAB_ACTION, listener)\n }, [host])\n\n // \u2500\u2500 Routing controller (navigateTo / Back / redirectTo / reLaunch / switchTab / Home) \u2500\n // Every routing operation opens its page asynchronously and only then reads\n // `stateRef` to compute the next stack, so two overlapping actions would both\n // decide from the same pre-action snapshot: the loser's freshly-opened page\n // survives in neither the visible stack nor any tab substack and is never\n // closed. Actions therefore run one at a time \u2014 a tail-chained promise is the\n // single gate every entry point (service NAV_ACTION and the nav-bar buttons)\n // goes through. A failing action never blocks the next one.\n const navQueueRef = useRef<Promise<void>>(Promise.resolve())\n // Monotonic stamp that retires the whole queue when this frame goes away. A\n // queued action can still be waiting on its PAGE_OPEN when a soft reload\n // swaps in a new frame and disposes this session; resuming it afterwards\n // would commit into an unmounted tree and reduce from a stack nobody owns.\n // Each action captures the stamp and re-checks it after every await.\n const navEpochRef = useRef(0)\n useEffect(() => () => { navEpochRef.current += 1 }, [])\n\n const runNavAction = useCallback(\n async (payload: ShellNavPayload) => {\n const ack = (ok: boolean, errMsg: string): void =>\n host.notifyNavCallback({ ok, errMsg, callbacks: payload.callbacks })\n\n try {\n switch (payload.name) {\n case 'navigateTo':\n await doNavigateTo(host, stateRef, setState, applySideEffects, payload, ack)\n break\n case 'navigateBack':\n doNavigateBack(stateRef, setState, applySideEffects, payload, ack)\n break\n case 'redirectTo':\n await doRedirectTo(host, stateRef, setState, applySideEffects, payload, ack)\n break\n case 'reLaunch':\n await doReLaunch(host, stateRef, setState, applySideEffects, payload, ack)\n break\n case 'switchTab':\n await doSwitchTab(host, stateRef, setState, applySideEffects, payload, ack)\n break\n case 'navigateHome':\n await doNavigateHome(host, stateRef, setState, applySideEffects, payload, ack)\n break\n }\n } catch (err) {\n ack(false, `${payload.name}:fail ${err instanceof Error ? err.message : String(err)}`)\n }\n },\n [host, applySideEffects],\n )\n\n const performNavAction = useCallback(\n (payload: ShellNavPayload): Promise<void> => {\n const epoch = navEpochRef.current\n const queued = navQueueRef.current.then(() => {\n // Retired while this one waited its turn \u2014 the frame it would act on is\n // gone. An action already past this point when the frame went away\n // still finishes, but every outbound call it makes is dropped by the\n // host's own cleared-session guards.\n if (navEpochRef.current !== epoch) return\n return runNavAction(payload)\n })\n navQueueRef.current = queued.catch(() => {})\n return queued\n },\n [runNavAction],\n )\n\n useEffect(() => {\n const listener = (payload: NavActionPayload) => {\n void performNavAction(payload)\n }\n return host.onSessionEvent(E.NAV_ACTION, listener)\n }, [performNavAction, host])\n\n // \u2500\u2500 Click handlers (back arrow + tab item) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n const handleBack = useCallback(() => {\n if (stateRef.current.shell.stack.length <= 1) return\n const stack = stateRef.current.shell.stack\n void performNavAction({\n appSessionId: host.appSessionId ?? '',\n bridgeId: stack[stack.length - 1].bridgeId,\n name: 'navigateBack',\n params: { delta: 1 },\n callbacks: {},\n })\n }, [host, performNavAction])\n\n // The home button only dispatches; `navigateHome` (miniapp-routing) is the\n // single authority that picks the routing verb, mirroring each native\n // platform's navigateHome primitive.\n const handleHome = useCallback(() => {\n const stack = stateRef.current.shell.stack\n void performNavAction({\n appSessionId: host.appSessionId ?? '',\n bridgeId: stack[stack.length - 1].bridgeId,\n name: 'navigateHome',\n params: {},\n callbacks: {},\n })\n }, [host, performNavAction])\n\n const handleTabClick = useCallback((pagePath: string) => {\n const sh = stateRef.current.shell\n if (pagePath === sh.currentTabPath && sh.stack.length === 1) return\n void performNavAction({\n appSessionId: host.appSessionId ?? '',\n bridgeId: sh.stack[sh.stack.length - 1].bridgeId,\n name: 'switchTab',\n params: { url: `/${pagePath}` },\n callbacks: {},\n })\n }, [host, performNavAction])\n\n // \u2500\u2500 Rendering \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n const top = shell.stack[shell.stack.length - 1]\n const mounted = enumerateMounted(shell)\n const handleMore = useCallback(() => {\n onMore?.({\n appId: host.appId,\n appName: top.navBar.title || host.appId,\n pagePath: top.pagePath,\n })\n }, [onMore, host, top.navBar.title, top.pagePath])\n\n // Report the full ordered stack (bottom\u2192top) on every stack change so\n // automation's App.getPageStack can return a multi-page stack \u2014 main only\n // tracks the active bridgeId on its own.\n //\n // Declared BEFORE the active-page report on purpose, and the two must stay in\n // this order: ACTIVE_PAGE is what releases automation's wait-for-navigation,\n // and main drops its stored stack the moment a page closes, so an active-page\n // signal arriving first lets App.getPageStack answer from its single-page\n // fallback while the real stack is still in flight. A top change always comes\n // with a new stack array (`top` is derived from it), so both effects run in\n // the same commit and React fires them in declaration order.\n useEffect(() => {\n host.notifyPageStack(shell.stack.map((e) => ({ pagePath: e.pagePath, query: e.query })))\n }, [host, shell.stack])\n\n // Tell main which page is the visible top-of-stack so main-side panels\n // (WXML/element-inspect) and automation can target the active render\n // webContents \u2014 main has no z-order concept of its own. Fires on every\n // top change (navigate / back / switchTab).\n useEffect(() => {\n host.notifyActivePage(top.bridgeId)\n }, [host, top.bridgeId])\n\n return (\n <>\n {statusBar?.({ textStyle: top.navBar.textStyle })}\n {/*\n Default nav-bar is in-flow (reserves its own height); custom nav-bar\n is an absolute overlay and the webview renders full-bleed beneath it.\n So the viewport needs no nav-height padding \u2014 see navigation-bar.css.\n */}\n <NavigationBar\n state={top.navBar}\n stackDepth={shell.stack.length}\n platform={platform}\n statusBarHeight={statusBarHeight}\n navBarHeight={NAV_BAR_HEIGHT}\n onBack={handleBack}\n onHome={handleHome}\n onMore={handleMore}\n />\n <div className=\"device-shell__viewport\">\n {mounted.map(({ entry, visible }) => (\n <webview\n key={entry.bridgeId}\n className=\"device-shell__webview\"\n src={host.createRenderHostUrl(entry.bridgeId, entry.pagePath, entry.isTab, pageBackgroundColor(entry.windowConfig))}\n preload={preload}\n // No static partition here: the renderer doesn't know the\n // per-project partition \u2014 the host WCV's `will-attach-webview`\n // handler stamps every render-host guest onto this project's\n // `persist:miniapp-<key>` partition instead.\n allowpopups=\"true\"\n style={{\n display: visible ? 'flex' : 'none',\n zIndex: visible ? 100 : 1,\n // White-flash fix (WeChat/Android/Harmony parity): host-painted primer.\n backgroundColor: pageBackgroundColor(entry.windowConfig),\n }}\n />\n ))}\n </div>\n {top.isTab && (\n <TabBar\n state={tabBar}\n currentPath={shell.currentTabPath}\n resourceBaseUrl={host.resourceBaseUrl}\n appId={host.appId}\n onSwitch={handleTabClick}\n bottomInset={bottomInset}\n />\n )}\n {/* Native interaction overlays (toast / loading / modal / action sheet).\n After the page and tabBar so it layers above both. */}\n <UiOverlay />\n {deviceOverlay}\n </>\n )\n}\n", "import { useMemo } from 'react'\nimport { MenuCapsule } from './menu-capsule.js'\nimport './navigation-bar.css'\n\nexport type NavigationBarTextStyle = 'white' | 'black'\nexport type NavigationStyle = 'default' | 'custom'\nexport type NavBarPlatform = 'ios' | 'android'\n\nexport interface NavigationBarState {\n title: string\n backgroundColor: string\n textStyle: NavigationBarTextStyle\n style: NavigationStyle\n loading: boolean\n homeButtonVisible: boolean\n /**\n * Optional CSS transition duration set by `wx.setNavigationBarColor`.\n * WeChat supports linear / easeIn / easeOut / easeInOut.\n */\n colorAnimation?: {\n durationMs: number\n timingFunc: 'linear' | 'easeIn' | 'easeOut' | 'easeInOut'\n }\n}\n\nexport interface NavigationBarProps {\n state: NavigationBarState\n /** Page stack depth \u2014 when >1 a back arrow appears. */\n stackDepth: number\n platform: NavBarPlatform\n statusBarHeight: number\n /** Total nav bar height (excluding status bar). 44 by spec. */\n navBarHeight: number\n onBack?: () => void\n onHome?: () => void\n onMore?: () => void\n}\n\nconst TIMING_FUNC_MAP: Record<NonNullable<NavigationBarState['colorAnimation']>['timingFunc'], string> = {\n linear: 'linear',\n easeIn: 'ease-in',\n easeOut: 'ease-out',\n easeInOut: 'ease-in-out',\n}\n\n// Native back-arrow glyphs are filled wedges, not a stroked chevron.\n// iOS: exact path from Assets.xcassets/arrow-back-{dark,light}.imageset (both\n// color variants share this path). Android: Icons.AutoMirrored.Filled.KeyboardArrowLeft\n// is a compiled androidx vector with no source in this repo to read; its path is\n// the standard Material Design \"keyboard_arrow_left\" glyph, verified against\n// google/material-design-icons (src/hardware/keyboard_arrow_left/materialicons/24px.svg)\n// rather than reproduced from memory.\nconst BACK_ARROW_PATH: Record<NavBarPlatform, string> = {\n ios: 'M17.51 3.87L15.73 2.1 5.84 12l9.9 9.9 1.77-1.77L9.38 12l8.13-8.13z',\n android: 'M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z',\n}\n\n/**\n * Simulator navigation bar aligned with WeChat MiniProgram spec\n * (see packages/devtools/docs/native-bridge-protocol.md NavigationBar section):\n *\n * - `style: custom` hides the bar entirely, capsule stays.\n * - Title default-center on iOS, default-left on Android (per official guidance).\n * - Back arrow appears when stackDepth > 1; the home button follows\n * `homeButtonVisible` independently and can coexist with the arrow.\n * - `textStyle` drives both title color AND status bar foreground (handled by parent).\n * - Color transitions follow `wx.setNavigationBarColor.animation` semantics.\n */\nexport function NavigationBar({\n state,\n stackDepth,\n platform,\n statusBarHeight,\n navBarHeight,\n onBack,\n onHome,\n onMore,\n}: NavigationBarProps) {\n const transition = useMemo(() => {\n if (!state.colorAnimation || state.colorAnimation.durationMs <= 0) return undefined\n const timing = TIMING_FUNC_MAP[state.colorAnimation.timingFunc] ?? 'linear'\n return `background-color ${state.colorAnimation.durationMs}ms ${timing}, color ${state.colorAnimation.durationMs}ms ${timing}`\n }, [state.colorAnimation])\n\n const isCustom = state.style === 'custom'\n const showBack = stackDepth > 1\n // Back arrow and home button coexist: an opted-in (`homeButton: true`) inner\n // page shows both, matching real WeChat. The visibility exclusions live in\n // shouldShowHomeButton, not here.\n const showHome = state.homeButtonVisible\n const titleAlign = platform === 'ios' ? 'center' : 'left'\n // Native back-arrow icon size differs per platform: iOS's arrow-back\n // SVG asset renders at its 24pt viewBox; Android's\n // Icons.AutoMirrored.Filled.KeyboardArrowLeft is explicitly sized 30dp\n // (DiminaActivity.kt CenterAlignedTopAppBar navigationIcon).\n const backIconSize = platform === 'android' ? 30 : 24\n\n const containerStyle: React.CSSProperties = {\n backgroundColor: state.backgroundColor,\n color: state.textStyle === 'white' ? '#ffffff' : '#000000',\n height: statusBarHeight + navBarHeight,\n paddingTop: statusBarHeight,\n transition,\n }\n\n return (\n <header\n className={`nav-bar nav-bar--${platform} nav-bar--${state.textStyle}${isCustom ? ' nav-bar--custom' : ''}`}\n style={containerStyle}\n aria-hidden={isCustom}\n >\n {!isCustom && (\n <div\n className=\"nav-bar__row\"\n style={{ height: navBarHeight, justifyContent: titleAlign === 'center' ? 'center' : 'flex-start' }}\n >\n {(showBack || showHome) && (\n <div className=\"nav-bar__leading\">\n {showBack && (\n <button\n type=\"button\"\n className=\"nav-bar__back\"\n aria-label=\"Back\"\n onClick={onBack}\n >\n <svg viewBox=\"0 0 24 24\" width={backIconSize} height={backIconSize} aria-hidden=\"true\">\n <path d={BACK_ARROW_PATH[platform]} fill=\"currentColor\" />\n </svg>\n </button>\n )}\n {showHome && (\n <button\n type=\"button\"\n className=\"nav-bar__home\"\n aria-label=\"Home\"\n onClick={onHome}\n >\n {/* Material Icons `home` \u2014 the icon family dimina's back\n arrows already come from on every platform */}\n <svg viewBox=\"0 0 24 24\" width=\"24\" height=\"24\" aria-hidden=\"true\">\n <path d=\"M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z\" fill=\"currentColor\" />\n </svg>\n </button>\n )}\n </div>\n )}\n <div\n className={`nav-bar__title nav-bar__title--${titleAlign}${showBack && showHome ? ' nav-bar__title--leading-pair' : ''}`}\n style={{ color: state.textStyle === 'white' ? '#ffffff' : '#000000' }}\n >\n {state.loading && (\n <span className=\"nav-bar__spinner\" aria-hidden=\"true\" />\n )}\n <span className=\"nav-bar__title-text\">{state.title}</span>\n </div>\n </div>\n )}\n <MenuCapsule\n platform={platform}\n statusBarHeight={statusBarHeight}\n onMore={onMore}\n />\n </header>\n )\n}\n\nexport function makeDefaultNavigationBarState(initial?: Partial<NavigationBarState>): NavigationBarState {\n return {\n title: initial?.title ?? '',\n backgroundColor: initial?.backgroundColor ?? '#000000',\n textStyle: initial?.textStyle ?? 'white',\n style: initial?.style ?? 'default',\n loading: initial?.loading ?? false,\n homeButtonVisible: initial?.homeButtonVisible ?? false,\n colorAnimation: initial?.colorAnimation,\n }\n}\n", "import { useEffect, useRef, useState } from 'react'\nimport {\n uiOverlayBus,\n type ActionSheetDialogState,\n type ModalDialogState,\n type ToastState,\n type UiOverlayState,\n} from './ui-overlay-bus.js'\nimport './ui-overlay.css'\n\n/**\n * Renders the native interaction overlays (toast / loading / modal / action\n * sheet). Subscribes to `uiOverlayBus`, which the wx.* handlers running in the\n * same document push into \u2014 they cannot touch React state directly.\n *\n * MiniAppFrame mounts this after the page and the tabBar, so it layers above\n * both and is clipped to whatever box the host draws around the mini-app.\n */\nexport function UiOverlay() {\n const [{ toast, dialog }, setState] = useState<UiOverlayState>(() => uiOverlayBus.getState())\n useEffect(() => uiOverlayBus.subscribe(setState), [])\n\n return (\n <>\n {toast && <ToastView toast={toast} />}\n {dialog?.kind === 'modal' && <ModalView dialog={dialog} />}\n {dialog?.kind === 'actionSheet' && <ActionSheetView dialog={dialog} />}\n </>\n )\n}\n\n// \u2500\u2500\u2500 Toast / Loading \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction ToastView({ toast }: { toast: ToastState }) {\n // Auto-dismiss after `duration` (showLoading uses Infinity \u2192 no timer; it is\n // cleared explicitly by hideLoading/hideToast). Re-armed whenever the toast\n // identity changes (a second showToast resets the countdown).\n useEffect(() => {\n if (!Number.isFinite(toast.duration)) return\n const id = window.setTimeout(() => uiOverlayBus.dismissToast(toast), toast.duration)\n return () => window.clearTimeout(id)\n }, [toast])\n\n const hasIndicator = toast.icon !== 'none' || !!toast.image\n return (\n <div className=\"dmui-overlay\" aria-live=\"polite\">\n {toast.mask && <div className=\"dmui-mask dmui-mask--transparent\" />}\n <div className={`dmui-toast${hasIndicator ? '' : ' dmui-toast--text'}`} role=\"alert\">\n {toast.image ? (\n <img className=\"dmui-toast__image\" src={toast.image} alt=\"\" />\n ) : (\n <ToastIcon icon={toast.icon} />\n )}\n {toast.title && <div className=\"dmui-toast__title\">{toast.title}</div>}\n </div>\n </div>\n )\n}\n\nfunction ToastIcon({ icon }: { icon: ToastState['icon'] }) {\n if (icon === 'success') {\n return (\n <svg className=\"dmui-toast__icon\" viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <path d=\"M5 13l4 4L19 7\" />\n </svg>\n )\n }\n if (icon === 'error') {\n return (\n <svg className=\"dmui-toast__icon\" viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <path d=\"M6 6l12 12M18 6L6 18\" />\n </svg>\n )\n }\n if (icon === 'loading') {\n return <span className=\"dmui-toast__spinner\" aria-hidden=\"true\" />\n }\n return null\n}\n\n// \u2500\u2500\u2500 Modal \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction ModalView({ dialog }: { dialog: ModalDialogState }) {\n const [value, setValue] = useState('')\n const inputRef = useRef<HTMLInputElement>(null)\n useEffect(() => {\n if (dialog.editable) inputRef.current?.focus()\n }, [dialog.editable])\n\n return (\n <div className=\"dmui-overlay\">\n <div className=\"dmui-mask\" />\n <div className=\"dmui-modal\" role=\"dialog\" aria-modal=\"true\">\n {dialog.title && <div className=\"dmui-modal__title\">{dialog.title}</div>}\n {dialog.editable ? (\n <input\n ref={inputRef}\n className=\"dmui-modal__input\"\n value={value}\n placeholder={dialog.placeholderText}\n onChange={(e) => setValue(e.target.value)}\n />\n ) : (\n dialog.content && <div className=\"dmui-modal__content\">{dialog.content}</div>\n )}\n <div className=\"dmui-modal__actions\">\n {dialog.showCancel && (\n <button\n type=\"button\"\n className=\"dmui-modal__button\"\n style={{ color: dialog.cancelColor }}\n onClick={() => dialog.onResult(false)}\n >\n {dialog.cancelText}\n </button>\n )}\n <button\n type=\"button\"\n className=\"dmui-modal__button\"\n style={{ color: dialog.confirmColor }}\n onClick={() => dialog.onResult(true, value)}\n >\n {dialog.confirmText}\n </button>\n </div>\n </div>\n </div>\n )\n}\n\n// \u2500\u2500\u2500 Action sheet \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction ActionSheetView({ dialog }: { dialog: ActionSheetDialogState }) {\n return (\n <div className=\"dmui-overlay\">\n <div className=\"dmui-mask\" onClick={() => dialog.onSelect(-1)} />\n <div className=\"dmui-action-sheet\" role=\"menu\">\n <div className=\"dmui-action-sheet__items\">\n {dialog.itemList.map((item, index) => (\n <button\n type=\"button\"\n key={index}\n className=\"dmui-action-sheet__item\"\n style={{ color: dialog.itemColor }}\n onClick={() => dialog.onSelect(index)}\n >\n {item}\n </button>\n ))}\n </div>\n <button\n type=\"button\"\n className=\"dmui-action-sheet__cancel\"\n onClick={() => dialog.onSelect(-1)}\n >\n \u53D6\u6D88\n </button>\n </div>\n </div>\n )\n}\n", "/**\n * In-renderer pub/sub store for the simulator's native UI overlays (toast,\n * loading, modal, action sheet).\n *\n * The wx.* UI handlers in `simulator-api-ui.ts` run inside the simulator\n * renderer (via runApiAsync) but cannot touch React state directly. They push\n * the desired overlay into this singleton; the `MiniAppFrame`-resident\n * `<UiOverlay>` subscribes and renders it inside the device frame (above the\n * page <webview>, clipped to the bezel \u2014 the same layering the status/nav bar\n * already use). User interaction (modal confirm/cancel, action-sheet tap) is\n * routed back to the handler through the `onResult` / `onSelect` callbacks the\n * handler attaches to the dialog state.\n */\n\nexport interface ToastState {\n title: string\n icon: 'success' | 'error' | 'loading' | 'none'\n image?: string\n /** ms before auto-dismiss; Infinity for showLoading (dismissed explicitly). */\n duration: number\n mask: boolean\n}\n\nexport interface ModalDialogState {\n kind: 'modal'\n title: string\n content: string\n showCancel: boolean\n cancelText: string\n cancelColor: string\n confirmText: string\n confirmColor: string\n editable: boolean\n placeholderText: string\n /** The renderer calls this when the user taps confirm/cancel. */\n onResult: (confirmed: boolean, content?: string) => void\n}\n\nexport interface ActionSheetDialogState {\n kind: 'actionSheet'\n itemList: string[]\n itemColor: string\n /** The renderer calls this with the tapped index, or -1 to cancel. */\n onSelect: (index: number) => void\n}\n\nexport type DialogState = ModalDialogState | ActionSheetDialogState\n\nexport interface UiOverlayState {\n toast: ToastState | null\n dialog: DialogState | null\n}\n\ntype Listener = (state: UiOverlayState) => void\n\nclass UiOverlayBus {\n private state: UiOverlayState = { toast: null, dialog: null }\n private readonly listeners = new Set<Listener>()\n\n getState(): UiOverlayState {\n return this.state\n }\n\n subscribe(listener: Listener): () => void {\n this.listeners.add(listener)\n return () => {\n this.listeners.delete(listener)\n }\n }\n\n showToast(toast: ToastState): void {\n this.set({ ...this.state, toast })\n }\n\n hideToast(): void {\n this.set({ ...this.state, toast: null })\n }\n\n /**\n * Clear `toast` only if it is still the active one. The toast auto-dismiss\n * timer holds a reference to the toast it scheduled; a newer showToast may\n * have replaced it in the meantime, and a blind `hideToast()` from the stale\n * timer would wrongly clear the new toast.\n */\n dismissToast(toast: ToastState): void {\n if (this.state.toast === toast) this.hideToast()\n }\n\n showDialog(dialog: DialogState): void {\n this.set({ ...this.state, dialog })\n }\n\n hideDialog(): void {\n this.set({ ...this.state, dialog: null })\n }\n\n private set(next: UiOverlayState): void {\n this.state = next\n for (const listener of this.listeners) listener(next)\n }\n}\n\nexport const uiOverlayBus = new UiOverlayBus()\n", "/**\n * DevTools implementations for the WeChat-style interaction APIs that native\n * platforms (iOS / Android / Harmony) provide but the web container lacks:\n * showToast / hideToast / showLoading / hideLoading / showModal /\n * showActionSheet.\n *\n * Each handler is bound with `this` = MiniApp instance (via\n * AppManager.registerApi \u2192 MiniApp.invokeApi). The overlay is rendered by the\n * DeviceShell-resident `<UiOverlay>`; these handlers only push state into\n * `uiOverlayBus` and fire the success/fail/complete callbacks \u2014 immediately for\n * toast/loading, and on user interaction for modal/actionSheet (defaults and\n * verdict strings mirror the Android `InteractionApi`).\n */\n\nimport type { MiniAppContext } from './types'\nimport { bindCallbacks } from './simulator-api-helpers'\nimport { uiOverlayBus } from '@dimina-kit/electron-runtime/simulator-ui'\n\ninterface ToastOpts {\n title?: string\n icon?: 'success' | 'error' | 'loading' | 'none'\n image?: string\n duration?: number\n mask?: boolean\n success?: unknown\n fail?: unknown\n complete?: unknown\n}\n\nexport function showToast(this: MiniAppContext, opts: ToastOpts = {}) {\n const { onSuccess, onComplete } = bindCallbacks(this, opts)\n uiOverlayBus.showToast({\n title: opts.title ?? '',\n icon: opts.icon ?? 'success',\n image: opts.image,\n duration: opts.duration ?? 1500,\n mask: opts.mask ?? false,\n })\n onSuccess?.({ errMsg: 'showToast:ok' })\n onComplete?.()\n}\n\nexport function hideToast(this: MiniAppContext, opts: { success?: unknown; complete?: unknown } = {}) {\n const { onSuccess, onComplete } = bindCallbacks(this, opts)\n uiOverlayBus.hideToast()\n onSuccess?.({ errMsg: 'hideToast:ok' })\n onComplete?.()\n}\n\nexport function showLoading(\n this: MiniAppContext,\n opts: { title?: string; mask?: boolean; success?: unknown; complete?: unknown } = {},\n) {\n const { onSuccess, onComplete } = bindCallbacks(this, opts)\n uiOverlayBus.showToast({\n title: opts.title ?? '',\n icon: 'loading',\n duration: Infinity,\n mask: opts.mask ?? false,\n })\n onSuccess?.({ errMsg: 'showLoading:ok' })\n onComplete?.()\n}\n\nexport function hideLoading(this: MiniAppContext, opts: { success?: unknown; complete?: unknown } = {}) {\n const { onSuccess, onComplete } = bindCallbacks(this, opts)\n uiOverlayBus.hideToast()\n onSuccess?.({ errMsg: 'hideLoading:ok' })\n onComplete?.()\n}\n\ninterface ModalOpts {\n title?: string\n content?: string\n showCancel?: boolean\n cancelText?: string\n cancelColor?: string\n confirmText?: string\n confirmColor?: string\n editable?: boolean\n placeholderText?: string\n success?: unknown\n fail?: unknown\n complete?: unknown\n}\n\nexport function showModal(this: MiniAppContext, opts: ModalOpts = {}) {\n const { onSuccess, onComplete } = bindCallbacks(this, opts)\n const editable = opts.editable ?? false\n // Guard against a double resolution (rapid double-tap / a re-render firing the\n // handler twice) settling the callbacks more than once.\n let settled = false\n uiOverlayBus.showDialog({\n kind: 'modal',\n title: opts.title ?? '',\n content: opts.content ?? '',\n showCancel: opts.showCancel ?? true,\n cancelText: opts.cancelText ?? '\u53D6\u6D88',\n cancelColor: opts.cancelColor ?? '#000000',\n confirmText: opts.confirmText ?? '\u786E\u5B9A',\n confirmColor: opts.confirmColor ?? '#576B95',\n editable,\n placeholderText: opts.placeholderText ?? '',\n onResult: (confirmed, content) => {\n if (settled) return\n settled = true\n uiOverlayBus.hideDialog()\n const result: Record<string, unknown> = {\n confirm: confirmed,\n cancel: !confirmed,\n errMsg: 'showModal:ok',\n }\n if (editable) result.content = content ?? ''\n onSuccess?.(result)\n onComplete?.()\n },\n })\n}\n\ninterface ActionSheetOpts {\n itemList?: string[]\n itemColor?: string\n success?: unknown\n fail?: unknown\n complete?: unknown\n}\n\nexport function showActionSheet(this: MiniAppContext, opts: ActionSheetOpts = {}) {\n const { onSuccess, onFail, onComplete } = bindCallbacks(this, opts)\n let settled = false\n uiOverlayBus.showDialog({\n kind: 'actionSheet',\n itemList: opts.itemList ?? [],\n itemColor: opts.itemColor ?? '#000000',\n onSelect: (index) => {\n if (settled) return\n settled = true\n uiOverlayBus.hideDialog()\n if (index === -1) {\n onFail?.({ errMsg: 'showActionSheet:fail cancel' })\n } else {\n onSuccess?.({ tapIndex: index, errMsg: 'showActionSheet:ok' })\n }\n onComplete?.()\n },\n })\n}\n", "/**\n * DevTools API stubs for wx.xxx APIs that exist on native platforms\n * (iOS / Android / Harmony) but are missing in the web container.\n *\n * Each exported function is bound with `this` = MiniApp instance\n * (via AppManager.registerApi \u2192 MiniApp.invokeApi).\n */\n\nimport type { MiniAppContext } from './types'\nimport { bindCallbacks } from './simulator-api-helpers'\nimport {\n\tsetStorageSync,\n\tgetStorageSync,\n\tremoveStorageSync,\n\tclearStorageSync,\n\tgetStorageInfoSync,\n\tsetStorage,\n\tgetStorage,\n\tremoveStorage,\n\tclearStorage,\n\tgetStorageInfo,\n} from './simulator-api-storage'\nimport {\n\thideKeyboard,\n\tadjustPosition,\n\tmakePhoneCall,\n\tchooseContact,\n\taddPhoneContact,\n\tvibrateShort,\n\tvibrateLong,\n\tscanCode,\n\tgetClipboardData,\n\tsetClipboardData,\n\tgetNetworkType,\n} from './simulator-api-device'\nimport {\n\tchooseImage,\n\tpreviewImage,\n\tcompressImage,\n\tsaveImageToPhotosAlbum,\n\tgetImageInfo,\n\tchooseMedia,\n\tchooseVideo,\n\taudioCreate,\n\taudioListen,\n\taudioSetProp,\n\taudioPlay,\n\taudioPause,\n\taudioStop,\n\taudioSeek,\n\taudioDestroy,\n} from './simulator-api-media'\nimport { fileSystemManagerApis } from './simulator-api-fsm'\nimport {\n\tdownloadFile,\n\tuploadFile,\n\tuploadFileAbort,\n} from './simulator-api-network'\nexport {\n\tdownloadFile,\n\tuploadFile,\n\tuploadFileAbort,\n} from './simulator-api-network'\nimport {\n\tshowToast,\n\thideToast,\n\tshowLoading,\n\thideLoading,\n\tshowModal,\n\tshowActionSheet,\n} from './simulator-api-ui'\n\n// \u2500\u2500\u2500 Base \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport function canIUse(this: MiniAppContext, { success, complete }: { success?: unknown; complete?: unknown }) {\n\tconst { onSuccess, onComplete } = bindCallbacks(this, { success, complete })\n\t// In devtools all standard APIs are considered available.\n\tonSuccess?.(true)\n\tonComplete?.()\n\t// Also return synchronously for callers that use the return value.\n\treturn true\n}\n\nexport function getWindowInfo(this: MiniAppContext, { success, complete }: { success?: unknown; complete?: unknown } = {}) {\n\tconst { onSuccess, onComplete } = bindCallbacks(this, { success, complete })\n\n\tconst { wb, di, dev, pixelRatio, screenWidth, screenHeight, windowWidth, windowHeight } = readWindowMetrics(this)\n\tconst bar = this.parent?.getStatusBarRect?.() ?? { height: dev?.statusBarHeight ?? 0 }\n\tconst statusBarHeight = (di['statusBarHeight'] as number | undefined) ?? bar.height\n\n\tconst info = {\n\t\tpixelRatio, screenWidth, screenHeight, windowWidth, windowHeight,\n\t\tstatusBarHeight,\n\t\tsafeArea: {\n\t\t\twidth: wb.width,\n\t\t\theight: wb.height - statusBarHeight,\n\t\t\ttop: statusBarHeight,\n\t\t\tbottom: wb.height,\n\t\t\tleft: 0,\n\t\t\tright: wb.width,\n\t\t},\n\t}\n\tonSuccess?.(info)\n\tonComplete?.()\n\treturn info\n}\n\nexport function getSystemSetting(this: MiniAppContext, { success, complete }: { success?: unknown; complete?: unknown } = {}) {\n\tconst { onSuccess, onComplete } = bindCallbacks(this, { success, complete })\n\n\tconst info = {\n\t\tbluetoothEnabled: false,\n\t\tlocationEnabled: true,\n\t\twifiEnabled: true,\n\t\tdeviceOrientation: 'portrait',\n\t}\n\tonSuccess?.(info)\n\tonComplete?.()\n\treturn info\n}\n\n// \u2500\u2500\u2500 System Info \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction readWindowMetrics(miniApp: MiniAppContext) {\n\t// Priority unchanged: __deviceInfo \u2192 host DOM rect. Only the last-resort\n\t// fallback follows the CURRENTLY emulated device (SimulatorMiniApp tracks\n\t// boot config device + live DEVICE_CHANGE) instead of a hardcoded 375x812.\n\tconst dev = miniApp.getDeviceMetrics?.()\n\tconst wb = miniApp.parent?.el?.querySelector('.dimina-native-webview__root')?.getBoundingClientRect()\n\t\t?? { width: dev?.screenWidth ?? 375, height: dev?.screenHeight ?? 812 }\n\tconst di = (window as Window & { __deviceInfo?: Record<string, unknown> }).__deviceInfo || {}\n\treturn {\n\t\twb,\n\t\tdi,\n\t\tdev,\n\t\tpixelRatio: (di['pixelRatio'] as number | undefined) || dev?.pixelRatio || window.devicePixelRatio || 2,\n\t\tscreenWidth: (di['screenWidth'] as number | undefined) || wb.width,\n\t\tscreenHeight: (di['screenHeight'] as number | undefined) || wb.height,\n\t\twindowWidth: wb.width,\n\t\twindowHeight: wb.height,\n\t}\n}\n\nfunction buildSystemInfo(miniApp: MiniAppContext) {\n\tconst { wb, di, dev, pixelRatio, screenWidth, screenHeight, windowWidth, windowHeight } = readWindowMetrics(miniApp)\n\tconst statusBarHeight = (di['statusBarHeight'] as number | undefined) ?? dev?.statusBarHeight ?? 0\n\t// Bottom inset sourced from safeAreaInsets.bottom (the single source \u2014 the\n\t// legacy flat `safeAreaBottom` field is decommissioned).\n\tconst bottomInset = (di['safeAreaInsets'] as { bottom?: number } | undefined)?.bottom\n\t\t?? dev?.safeAreaInsets?.bottom ?? 0\n\n\treturn {\n\t\tbrand: di['brand'] || 'devtools',\n\t\tmodel: di['model'] || 'devtools',\n\t\tpixelRatio, screenWidth, screenHeight, windowWidth, windowHeight,\n\t\tstatusBarHeight,\n\t\tlanguage: 'zh_CN',\n\t\tversion: '8.0.5',\n\t\tsystem: di['system'] || 'iOS 16.0',\n\t\tplatform: di['platform'] || 'ios',\n\t\tfontSizeSetting: 16,\n\t\tSDKVersion: '3.0.0',\n\t\tdeviceOrientation: 'portrait',\n\t\tsafeArea: {\n\t\t\twidth: wb.width,\n\t\t\theight: wb.height - statusBarHeight - bottomInset,\n\t\t\ttop: statusBarHeight,\n\t\t\tbottom: wb.height - bottomInset,\n\t\t\tleft: 0,\n\t\t\tright: wb.width,\n\t\t},\n\t}\n}\n\nexport function getSystemInfoAsync(this: MiniAppContext, opts: { success?: unknown; complete?: unknown }) {\n\tconst { success, complete } = opts\n\tconst { onSuccess, onComplete } = bindCallbacks(this, { success, complete })\n\tonSuccess?.(buildSystemInfo(this))\n\tonComplete?.()\n}\n\nexport function getSystemInfo(this: MiniAppContext, opts: { success?: unknown; complete?: unknown }) {\n\tgetSystemInfoAsync.call(this, opts)\n}\n\nexport function getSystemInfoSync(this: MiniAppContext) {\n\treturn buildSystemInfo(this)\n}\n\n// \u2500\u2500\u2500 Open API: Account Info \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport function getAccountInfoSync(this: MiniAppContext) {\n\treturn {\n\t\tminiProgram: {\n\t\t\tappId: this.appId || '',\n\t\t\tenvVersion: 'develop',\n\t\t\tversion: '',\n\t\t},\n\t}\n}\n\n// \u2500\u2500\u2500 Collect all APIs into a map \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n// `opts: never` (not the wider `unknown`) so every handler below \u2014 each typed\n// with its OWN specific opts shape (`getSystemInfoAsync`'s `{ success?, complete? }`,\n// `canIUse`'s `string`, \u2026) \u2014 remains assignable into this map: a function\n// parameter is checked contravariantly, and `never` is assignable into any\n// concrete opts type, whereas `unknown` (the caller-side \"any value\" type)\n// would reject every narrower handler signature here. Callers of this map\n// always cast to a caller-appropriate handler type before invoking (see\n// simulator-app.tsx / main-api-runner.ts) \u2014 this declaration only has to\n// typecheck the object literal itself.\nexport const simulatorApis: Record<string, (this: MiniAppContext, opts: never) => unknown> = {\n\t// Base\n\tcanIUse,\n\tgetSystemInfo,\n\tgetSystemInfoAsync,\n\tgetSystemInfoSync,\n\tgetWindowInfo,\n\tgetSystemSetting,\n\t// UI: interaction\n\tshowToast,\n\thideToast,\n\tshowLoading,\n\thideLoading,\n\tshowModal,\n\tshowActionSheet,\n\t// Network\n\tdownloadFile,\n\tuploadFile,\n\tuploadFileAbort,\n\t// Storage (sync)\n\tsetStorageSync,\n\tgetStorageSync,\n\tremoveStorageSync,\n\tclearStorageSync,\n\tgetStorageInfoSync,\n\t// Storage (async)\n\tsetStorage,\n\tgetStorage,\n\tremoveStorage,\n\tclearStorage,\n\tgetStorageInfo,\n\t// Open API\n\tgetAccountInfoSync,\n\t// Device\n\thideKeyboard,\n\tadjustPosition,\n\tmakePhoneCall,\n\tchooseContact,\n\taddPhoneContact,\n\tvibrateShort,\n\tvibrateLong,\n\tscanCode,\n\tgetClipboardData,\n\tsetClipboardData,\n\tgetNetworkType,\n\t// Media: Image\n\tchooseImage,\n\tpreviewImage,\n\tcompressImage,\n\tsaveImageToPhotosAlbum,\n\tgetImageInfo,\n\t// Media: Video\n\tchooseMedia,\n\tchooseVideo,\n\t// Media: Audio (service-apis/audio)\n\taudioCreate,\n\taudioListen,\n\taudioSetProp,\n\taudioPlay,\n\taudioPause,\n\taudioStop,\n\taudioSeek,\n\taudioDestroy,\n\t// Filesystem: the service thread invokes the dotted FileSystemManager.*\n\t// wire names (see simulator-api-fsm.ts).\n\t...fileSystemManagerApis,\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,yFAAAA,UAAA;AAAA;AASa,QAAI,IAAE,uBAAO,IAAI,eAAe;AAAhC,QAAkC,IAAE,uBAAO,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useRef", "useEffect", "useCallback", "useMemo", "Component", "location", "returnValue", "exports", "module", "exports", "exports", "ReactDebugCurrentFrame", "location", "exports", "module", "handlers", "osStatic", "pathStatic", "path", "path", "path", "tempFiles", "metadata", "BufferImpl", "import_react", "import_react"]
3
+ "sources": ["../../../../../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react.production.min.js", "../../../../../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react.development.js", "../../../../../node_modules/.pnpm/react@18.3.1/node_modules/react/index.js", "../../../../../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.production.min.js", "../../../../../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.development.js", "../../../../../node_modules/.pnpm/react@18.3.1/node_modules/react/jsx-runtime.js", "../../../src/preload/windows/main.ts", "../../../../dimina-electron-runtime/src/shared/host-env.ts", "../../../../dimina-electron-runtime/src/shared/bridge-channels.ts", "../../../src/preload/runtime/main-api-runner.ts", "../../../src/simulator/simulator-api-helpers.ts", "../../../src/simulator/simulator-api-storage.ts", "../../../src/simulator/simulator-api-device.ts", "../../../src/simulator/event-bridge.ts", "../../../../dimina-electron-runtime/src/shared/node-bindings.ts", "../../../../dimina-electron-runtime/src/shared/vpath.ts", "../../../src/simulator/temp-files.ts", "../../../src/simulator/simulator-api-fs.ts", "../../../src/simulator/simulator-api-media.ts", "../../../src/simulator/simulator-api-fsm.ts", "../../../../dimina-electron-runtime/src/shared/request-core.ts", "../../../src/simulator/simulator-api-network.ts", "../../../../dimina-electron-runtime/src/simulator-ui/miniapp-frame.tsx", "../../../../dimina-electron-runtime/src/simulator-ui/navigation-bar.tsx", "../../../../dimina-electron-runtime/src/simulator-ui/ui-overlay.tsx", "../../../../dimina-electron-runtime/src/simulator-ui/ui-overlay-bus.ts", "../../../src/simulator/simulator-api-ui.ts", "../../../src/simulator/simulator-api.ts"],
4
+ "sourcesContent": ["/**\n * @license React\n * react.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var l=Symbol.for(\"react.element\"),n=Symbol.for(\"react.portal\"),p=Symbol.for(\"react.fragment\"),q=Symbol.for(\"react.strict_mode\"),r=Symbol.for(\"react.profiler\"),t=Symbol.for(\"react.provider\"),u=Symbol.for(\"react.context\"),v=Symbol.for(\"react.forward_ref\"),w=Symbol.for(\"react.suspense\"),x=Symbol.for(\"react.memo\"),y=Symbol.for(\"react.lazy\"),z=Symbol.iterator;function A(a){if(null===a||\"object\"!==typeof a)return null;a=z&&a[z]||a[\"@@iterator\"];return\"function\"===typeof a?a:null}\nvar B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,D={};function E(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}E.prototype.isReactComponent={};\nE.prototype.setState=function(a,b){if(\"object\"!==typeof a&&\"function\"!==typeof a&&null!=a)throw Error(\"setState(...): takes an object of state variables to update or a function which returns an object of state variables.\");this.updater.enqueueSetState(this,a,b,\"setState\")};E.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,\"forceUpdate\")};function F(){}F.prototype=E.prototype;function G(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}var H=G.prototype=new F;\nH.constructor=G;C(H,E.prototype);H.isPureReactComponent=!0;var I=Array.isArray,J=Object.prototype.hasOwnProperty,K={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};\nfunction M(a,b,e){var d,c={},k=null,h=null;if(null!=b)for(d in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(k=\"\"+b.key),b)J.call(b,d)&&!L.hasOwnProperty(d)&&(c[d]=b[d]);var g=arguments.length-2;if(1===g)c.children=e;else if(1<g){for(var f=Array(g),m=0;m<g;m++)f[m]=arguments[m+2];c.children=f}if(a&&a.defaultProps)for(d in g=a.defaultProps,g)void 0===c[d]&&(c[d]=g[d]);return{$$typeof:l,type:a,key:k,ref:h,props:c,_owner:K.current}}\nfunction N(a,b){return{$$typeof:l,type:a.type,key:b,ref:a.ref,props:a.props,_owner:a._owner}}function O(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===l}function escape(a){var b={\"=\":\"=0\",\":\":\"=2\"};return\"$\"+a.replace(/[=:]/g,function(a){return b[a]})}var P=/\\/+/g;function Q(a,b){return\"object\"===typeof a&&null!==a&&null!=a.key?escape(\"\"+a.key):b.toString(36)}\nfunction R(a,b,e,d,c){var k=typeof a;if(\"undefined\"===k||\"boolean\"===k)a=null;var h=!1;if(null===a)h=!0;else switch(k){case \"string\":case \"number\":h=!0;break;case \"object\":switch(a.$$typeof){case l:case n:h=!0}}if(h)return h=a,c=c(h),a=\"\"===d?\".\"+Q(h,0):d,I(c)?(e=\"\",null!=a&&(e=a.replace(P,\"$&/\")+\"/\"),R(c,b,e,\"\",function(a){return a})):null!=c&&(O(c)&&(c=N(c,e+(!c.key||h&&h.key===c.key?\"\":(\"\"+c.key).replace(P,\"$&/\")+\"/\")+a)),b.push(c)),1;h=0;d=\"\"===d?\".\":d+\":\";if(I(a))for(var g=0;g<a.length;g++){k=\na[g];var f=d+Q(k,g);h+=R(k,b,e,f,c)}else if(f=A(a),\"function\"===typeof f)for(a=f.call(a),g=0;!(k=a.next()).done;)k=k.value,f=d+Q(k,g++),h+=R(k,b,e,f,c);else if(\"object\"===k)throw b=String(a),Error(\"Objects are not valid as a React child (found: \"+(\"[object Object]\"===b?\"object with keys {\"+Object.keys(a).join(\", \")+\"}\":b)+\"). If you meant to render a collection of children, use an array instead.\");return h}\nfunction S(a,b,e){if(null==a)return a;var d=[],c=0;R(a,d,\"\",\"\",function(a){return b.call(e,a,c++)});return d}function T(a){if(-1===a._status){var b=a._result;b=b();b.then(function(b){if(0===a._status||-1===a._status)a._status=1,a._result=b},function(b){if(0===a._status||-1===a._status)a._status=2,a._result=b});-1===a._status&&(a._status=0,a._result=b)}if(1===a._status)return a._result.default;throw a._result;}\nvar U={current:null},V={transition:null},W={ReactCurrentDispatcher:U,ReactCurrentBatchConfig:V,ReactCurrentOwner:K};function X(){throw Error(\"act(...) is not supported in production builds of React.\");}\nexports.Children={map:S,forEach:function(a,b,e){S(a,function(){b.apply(this,arguments)},e)},count:function(a){var b=0;S(a,function(){b++});return b},toArray:function(a){return S(a,function(a){return a})||[]},only:function(a){if(!O(a))throw Error(\"React.Children.only expected to receive a single React element child.\");return a}};exports.Component=E;exports.Fragment=p;exports.Profiler=r;exports.PureComponent=G;exports.StrictMode=q;exports.Suspense=w;\nexports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=W;exports.act=X;\nexports.cloneElement=function(a,b,e){if(null===a||void 0===a)throw Error(\"React.cloneElement(...): The argument must be a React element, but you passed \"+a+\".\");var d=C({},a.props),c=a.key,k=a.ref,h=a._owner;if(null!=b){void 0!==b.ref&&(k=b.ref,h=K.current);void 0!==b.key&&(c=\"\"+b.key);if(a.type&&a.type.defaultProps)var g=a.type.defaultProps;for(f in b)J.call(b,f)&&!L.hasOwnProperty(f)&&(d[f]=void 0===b[f]&&void 0!==g?g[f]:b[f])}var f=arguments.length-2;if(1===f)d.children=e;else if(1<f){g=Array(f);\nfor(var m=0;m<f;m++)g[m]=arguments[m+2];d.children=g}return{$$typeof:l,type:a.type,key:c,ref:k,props:d,_owner:h}};exports.createContext=function(a){a={$$typeof:u,_currentValue:a,_currentValue2:a,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null};a.Provider={$$typeof:t,_context:a};return a.Consumer=a};exports.createElement=M;exports.createFactory=function(a){var b=M.bind(null,a);b.type=a;return b};exports.createRef=function(){return{current:null}};\nexports.forwardRef=function(a){return{$$typeof:v,render:a}};exports.isValidElement=O;exports.lazy=function(a){return{$$typeof:y,_payload:{_status:-1,_result:a},_init:T}};exports.memo=function(a,b){return{$$typeof:x,type:a,compare:void 0===b?null:b}};exports.startTransition=function(a){var b=V.transition;V.transition={};try{a()}finally{V.transition=b}};exports.unstable_act=X;exports.useCallback=function(a,b){return U.current.useCallback(a,b)};exports.useContext=function(a){return U.current.useContext(a)};\nexports.useDebugValue=function(){};exports.useDeferredValue=function(a){return U.current.useDeferredValue(a)};exports.useEffect=function(a,b){return U.current.useEffect(a,b)};exports.useId=function(){return U.current.useId()};exports.useImperativeHandle=function(a,b,e){return U.current.useImperativeHandle(a,b,e)};exports.useInsertionEffect=function(a,b){return U.current.useInsertionEffect(a,b)};exports.useLayoutEffect=function(a,b){return U.current.useLayoutEffect(a,b)};\nexports.useMemo=function(a,b){return U.current.useMemo(a,b)};exports.useReducer=function(a,b,e){return U.current.useReducer(a,b,e)};exports.useRef=function(a){return U.current.useRef(a)};exports.useState=function(a){return U.current.useState(a)};exports.useSyncExternalStore=function(a,b,e){return U.current.useSyncExternalStore(a,b,e)};exports.useTransition=function(){return U.current.useTransition()};exports.version=\"18.3.1\";\n", "/**\n * @license React\n * react.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n\n 'use strict';\n\n/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\nif (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===\n 'function'\n) {\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());\n}\n var ReactVersion = '18.3.1';\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\n/**\n * Keeps track of the current dispatcher.\n */\nvar ReactCurrentDispatcher = {\n /**\n * @internal\n * @type {ReactComponent}\n */\n current: null\n};\n\n/**\n * Keeps track of the current batch's configuration such as how long an update\n * should suspend for if it needs to.\n */\nvar ReactCurrentBatchConfig = {\n transition: null\n};\n\nvar ReactCurrentActQueue = {\n current: null,\n // Used to reproduce behavior of `batchedUpdates` in legacy mode.\n isBatchingLegacy: false,\n didScheduleLegacyUpdate: false\n};\n\n/**\n * Keeps track of the current owner.\n *\n * The current owner is the component who should own any components that are\n * currently being constructed.\n */\nvar ReactCurrentOwner = {\n /**\n * @internal\n * @type {ReactComponent}\n */\n current: null\n};\n\nvar ReactDebugCurrentFrame = {};\nvar currentExtraStackFrame = null;\nfunction setExtraStackFrame(stack) {\n {\n currentExtraStackFrame = stack;\n }\n}\n\n{\n ReactDebugCurrentFrame.setExtraStackFrame = function (stack) {\n {\n currentExtraStackFrame = stack;\n }\n }; // Stack implementation injected by the current renderer.\n\n\n ReactDebugCurrentFrame.getCurrentStack = null;\n\n ReactDebugCurrentFrame.getStackAddendum = function () {\n var stack = ''; // Add an extra top frame while an element is being validated\n\n if (currentExtraStackFrame) {\n stack += currentExtraStackFrame;\n } // Delegate to the injected renderer-specific implementation\n\n\n var impl = ReactDebugCurrentFrame.getCurrentStack;\n\n if (impl) {\n stack += impl() || '';\n }\n\n return stack;\n };\n}\n\n// -----------------------------------------------------------------------------\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\nvar enableCacheElement = false;\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n// stuff. Intended to enable React core members to more easily debug scheduling\n// issues in DEV builds.\n\nvar enableDebugTracing = false; // Track which Fiber(s) schedule render work.\n\nvar ReactSharedInternals = {\n ReactCurrentDispatcher: ReactCurrentDispatcher,\n ReactCurrentBatchConfig: ReactCurrentBatchConfig,\n ReactCurrentOwner: ReactCurrentOwner\n};\n\n{\n ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;\n ReactSharedInternals.ReactCurrentActQueue = ReactCurrentActQueue;\n}\n\n// by calls to these methods by a Babel plugin.\n//\n// In PROD (or in packages without access to React internals),\n// they are left as they are instead.\n\nfunction warn(format) {\n {\n {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n printWarning('warn', format, args);\n }\n }\n}\nfunction error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\nvar didWarnStateUpdateForUnmountedComponent = {};\n\nfunction warnNoop(publicInstance, callerName) {\n {\n var _constructor = publicInstance.constructor;\n var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';\n var warningKey = componentName + \".\" + callerName;\n\n if (didWarnStateUpdateForUnmountedComponent[warningKey]) {\n return;\n }\n\n error(\"Can't call %s on a component that is not yet mounted. \" + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName);\n\n didWarnStateUpdateForUnmountedComponent[warningKey] = true;\n }\n}\n/**\n * This is the abstract API for an update queue.\n */\n\n\nvar ReactNoopUpdateQueue = {\n /**\n * Checks whether or not this composite component is mounted.\n * @param {ReactClass} publicInstance The instance we want to test.\n * @return {boolean} True if mounted, false otherwise.\n * @protected\n * @final\n */\n isMounted: function (publicInstance) {\n return false;\n },\n\n /**\n * Forces an update. This should only be invoked when it is known with\n * certainty that we are **not** in a DOM transaction.\n *\n * You may want to call this when you know that some deeper aspect of the\n * component's state has changed but `setState` was not called.\n *\n * This will not invoke `shouldComponentUpdate`, but it will invoke\n * `componentWillUpdate` and `componentDidUpdate`.\n *\n * @param {ReactClass} publicInstance The instance that should rerender.\n * @param {?function} callback Called after component is updated.\n * @param {?string} callerName name of the calling function in the public API.\n * @internal\n */\n enqueueForceUpdate: function (publicInstance, callback, callerName) {\n warnNoop(publicInstance, 'forceUpdate');\n },\n\n /**\n * Replaces all of the state. Always use this or `setState` to mutate state.\n * You should treat `this.state` as immutable.\n *\n * There is no guarantee that `this.state` will be immediately updated, so\n * accessing `this.state` after calling this method may return the old value.\n *\n * @param {ReactClass} publicInstance The instance that should rerender.\n * @param {object} completeState Next state.\n * @param {?function} callback Called after component is updated.\n * @param {?string} callerName name of the calling function in the public API.\n * @internal\n */\n enqueueReplaceState: function (publicInstance, completeState, callback, callerName) {\n warnNoop(publicInstance, 'replaceState');\n },\n\n /**\n * Sets a subset of the state. This only exists because _pendingState is\n * internal. This provides a merging strategy that is not available to deep\n * properties which is confusing. TODO: Expose pendingState or don't use it\n * during the merge.\n *\n * @param {ReactClass} publicInstance The instance that should rerender.\n * @param {object} partialState Next partial state to be merged with state.\n * @param {?function} callback Called after component is updated.\n * @param {?string} Name of the calling function in the public API.\n * @internal\n */\n enqueueSetState: function (publicInstance, partialState, callback, callerName) {\n warnNoop(publicInstance, 'setState');\n }\n};\n\nvar assign = Object.assign;\n\nvar emptyObject = {};\n\n{\n Object.freeze(emptyObject);\n}\n/**\n * Base class helpers for the updating state of a component.\n */\n\n\nfunction Component(props, context, updater) {\n this.props = props;\n this.context = context; // If a component has string refs, we will assign a different object later.\n\n this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the\n // renderer.\n\n this.updater = updater || ReactNoopUpdateQueue;\n}\n\nComponent.prototype.isReactComponent = {};\n/**\n * Sets a subset of the state. Always use this to mutate\n * state. You should treat `this.state` as immutable.\n *\n * There is no guarantee that `this.state` will be immediately updated, so\n * accessing `this.state` after calling this method may return the old value.\n *\n * There is no guarantee that calls to `setState` will run synchronously,\n * as they may eventually be batched together. You can provide an optional\n * callback that will be executed when the call to setState is actually\n * completed.\n *\n * When a function is provided to setState, it will be called at some point in\n * the future (not synchronously). It will be called with the up to date\n * component arguments (state, props, context). These values can be different\n * from this.* because your function may be called after receiveProps but before\n * shouldComponentUpdate, and this new state, props, and context will not yet be\n * assigned to this.\n *\n * @param {object|function} partialState Next partial state or function to\n * produce next partial state to be merged with current state.\n * @param {?function} callback Called after state is updated.\n * @final\n * @protected\n */\n\nComponent.prototype.setState = function (partialState, callback) {\n if (typeof partialState !== 'object' && typeof partialState !== 'function' && partialState != null) {\n throw new Error('setState(...): takes an object of state variables to update or a ' + 'function which returns an object of state variables.');\n }\n\n this.updater.enqueueSetState(this, partialState, callback, 'setState');\n};\n/**\n * Forces an update. This should only be invoked when it is known with\n * certainty that we are **not** in a DOM transaction.\n *\n * You may want to call this when you know that some deeper aspect of the\n * component's state has changed but `setState` was not called.\n *\n * This will not invoke `shouldComponentUpdate`, but it will invoke\n * `componentWillUpdate` and `componentDidUpdate`.\n *\n * @param {?function} callback Called after update is complete.\n * @final\n * @protected\n */\n\n\nComponent.prototype.forceUpdate = function (callback) {\n this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');\n};\n/**\n * Deprecated APIs. These APIs used to exist on classic React classes but since\n * we would like to deprecate them, we're not going to move them over to this\n * modern base class. Instead, we define a getter that warns if it's accessed.\n */\n\n\n{\n var deprecatedAPIs = {\n isMounted: ['isMounted', 'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'],\n replaceState: ['replaceState', 'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).']\n };\n\n var defineDeprecationWarning = function (methodName, info) {\n Object.defineProperty(Component.prototype, methodName, {\n get: function () {\n warn('%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);\n\n return undefined;\n }\n });\n };\n\n for (var fnName in deprecatedAPIs) {\n if (deprecatedAPIs.hasOwnProperty(fnName)) {\n defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);\n }\n }\n}\n\nfunction ComponentDummy() {}\n\nComponentDummy.prototype = Component.prototype;\n/**\n * Convenience component with default shallow equality check for sCU.\n */\n\nfunction PureComponent(props, context, updater) {\n this.props = props;\n this.context = context; // If a component has string refs, we will assign a different object later.\n\n this.refs = emptyObject;\n this.updater = updater || ReactNoopUpdateQueue;\n}\n\nvar pureComponentPrototype = PureComponent.prototype = new ComponentDummy();\npureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods.\n\nassign(pureComponentPrototype, Component.prototype);\npureComponentPrototype.isPureReactComponent = true;\n\n// an immutable object with a single mutable value\nfunction createRef() {\n var refObject = {\n current: null\n };\n\n {\n Object.seal(refObject);\n }\n\n return refObject;\n}\n\nvar isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare\n\nfunction isArray(a) {\n return isArrayImpl(a);\n}\n\n/*\n * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol\n * and Temporal.* types. See https://github.com/facebook/react/pull/22064.\n *\n * The functions in this module will throw an easier-to-understand,\n * easier-to-debug exception with a clear errors message message explaining the\n * problem. (Instead of a confusing exception thrown inside the implementation\n * of the `value` object).\n */\n// $FlowFixMe only called in DEV, so void return is not possible.\nfunction typeName(value) {\n {\n // toStringTag is needed for namespaced types like Temporal.Instant\n var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;\n var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';\n return type;\n }\n} // $FlowFixMe only called in DEV, so void return is not possible.\n\n\nfunction willCoercionThrow(value) {\n {\n try {\n testStringCoercion(value);\n return false;\n } catch (e) {\n return true;\n }\n }\n}\n\nfunction testStringCoercion(value) {\n // If you ended up here by following an exception call stack, here's what's\n // happened: you supplied an object or symbol value to React (as a prop, key,\n // DOM attribute, CSS property, string ref, etc.) and when React tried to\n // coerce it to a string using `'' + value`, an exception was thrown.\n //\n // The most common types that will cause this exception are `Symbol` instances\n // and Temporal objects like `Temporal.Instant`. But any object that has a\n // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this\n // exception. (Library authors do this to prevent users from using built-in\n // numeric operators like `+` or comparison operators like `>=` because custom\n // methods are needed to perform accurate arithmetic or comparison.)\n //\n // To fix the problem, coerce this object or symbol value to a string before\n // passing it to React. The most reliable way is usually `String(value)`.\n //\n // To find which value is throwing, check the browser or debugger console.\n // Before this exception was thrown, there should be `console.error` output\n // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the\n // problem and how that type was used: key, atrribute, input value prop, etc.\n // In most cases, this console output also shows the component and its\n // ancestor components where the exception happened.\n //\n // eslint-disable-next-line react-internal/safe-string-coercion\n return '' + value;\n}\nfunction checkKeyStringCoercion(value) {\n {\n if (willCoercionThrow(value)) {\n error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));\n\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var displayName = outerType.displayName;\n\n if (displayName) {\n return displayName;\n }\n\n var functionName = innerType.displayName || innerType.name || '';\n return functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName;\n} // Keep in sync with react-reconciler/getComponentNameFromFiber\n\n\nfunction getContextName(type) {\n return type.displayName || 'Context';\n} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.\n\n\nfunction getComponentNameFromType(type) {\n if (type == null) {\n // Host root, text node or just invalid type.\n return null;\n }\n\n {\n if (typeof type.tag === 'number') {\n error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return 'Fragment';\n\n case REACT_PORTAL_TYPE:\n return 'Portal';\n\n case REACT_PROFILER_TYPE:\n return 'Profiler';\n\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList';\n\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_CONTEXT_TYPE:\n var context = type;\n return getContextName(context) + '.Consumer';\n\n case REACT_PROVIDER_TYPE:\n var provider = type;\n return getContextName(provider._context) + '.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n var outerName = type.displayName || null;\n\n if (outerName !== null) {\n return outerName;\n }\n\n return getComponentNameFromType(type.type) || 'Memo';\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n return getComponentNameFromType(init(payload));\n } catch (x) {\n return null;\n }\n }\n\n // eslint-disable-next-line no-fallthrough\n }\n }\n\n return null;\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar RESERVED_PROPS = {\n key: true,\n ref: true,\n __self: true,\n __source: true\n};\nvar specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs;\n\n{\n didWarnAboutStringRefs = {};\n}\n\nfunction hasValidRef(config) {\n {\n if (hasOwnProperty.call(config, 'ref')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.ref !== undefined;\n}\n\nfunction hasValidKey(config) {\n {\n if (hasOwnProperty.call(config, 'key')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'key').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.key !== undefined;\n}\n\nfunction defineKeyPropWarningGetter(props, displayName) {\n var warnAboutAccessingKey = function () {\n {\n if (!specialPropKeyWarningShown) {\n specialPropKeyWarningShown = true;\n\n error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n }\n };\n\n warnAboutAccessingKey.isReactWarning = true;\n Object.defineProperty(props, 'key', {\n get: warnAboutAccessingKey,\n configurable: true\n });\n}\n\nfunction defineRefPropWarningGetter(props, displayName) {\n var warnAboutAccessingRef = function () {\n {\n if (!specialPropRefWarningShown) {\n specialPropRefWarningShown = true;\n\n error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n }\n };\n\n warnAboutAccessingRef.isReactWarning = true;\n Object.defineProperty(props, 'ref', {\n get: warnAboutAccessingRef,\n configurable: true\n });\n}\n\nfunction warnIfStringRefCannotBeAutoConverted(config) {\n {\n if (typeof config.ref === 'string' && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) {\n var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n if (!didWarnAboutStringRefs[componentName]) {\n error('Component \"%s\" contains the string ref \"%s\". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', componentName, config.ref);\n\n didWarnAboutStringRefs[componentName] = true;\n }\n }\n }\n}\n/**\n * Factory method to create a new React element. This no longer adheres to\n * the class pattern, so do not use new to call it. Also, instanceof check\n * will not work. Instead test $$typeof field against Symbol.for('react.element') to check\n * if something is a React Element.\n *\n * @param {*} type\n * @param {*} props\n * @param {*} key\n * @param {string|object} ref\n * @param {*} owner\n * @param {*} self A *temporary* helper to detect places where `this` is\n * different from the `owner` when React.createElement is called, so that we\n * can warn. We want to get rid of owner and replace string `ref`s with arrow\n * functions, and as long as `this` and owner are the same, there will be no\n * change in behavior.\n * @param {*} source An annotation object (added by a transpiler or otherwise)\n * indicating filename, line number, and/or other information.\n * @internal\n */\n\n\nvar ReactElement = function (type, key, ref, self, source, owner, props) {\n var element = {\n // This tag allows us to uniquely identify this as a React Element\n $$typeof: REACT_ELEMENT_TYPE,\n // Built-in properties that belong on the element\n type: type,\n key: key,\n ref: ref,\n props: props,\n // Record the component responsible for creating this element.\n _owner: owner\n };\n\n {\n // The validation flag is currently mutative. We put it on\n // an external backing store so that we can freeze the whole object.\n // This can be replaced with a WeakMap once they are implemented in\n // commonly used development environments.\n element._store = {}; // To make comparing ReactElements easier for testing purposes, we make\n // the validation flag non-enumerable (where possible, which should\n // include every environment we run tests in), so the test framework\n // ignores it.\n\n Object.defineProperty(element._store, 'validated', {\n configurable: false,\n enumerable: false,\n writable: true,\n value: false\n }); // self and source are DEV only properties.\n\n Object.defineProperty(element, '_self', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: self\n }); // Two elements created in two different places should be considered\n // equal for testing purposes and therefore we hide it from enumeration.\n\n Object.defineProperty(element, '_source', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: source\n });\n\n if (Object.freeze) {\n Object.freeze(element.props);\n Object.freeze(element);\n }\n }\n\n return element;\n};\n/**\n * Create and return a new ReactElement of the given type.\n * See https://reactjs.org/docs/react-api.html#createelement\n */\n\nfunction createElement(type, config, children) {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null;\n var self = null;\n var source = null;\n\n if (config != null) {\n if (hasValidRef(config)) {\n ref = config.ref;\n\n {\n warnIfStringRefCannotBeAutoConverted(config);\n }\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n }\n\n self = config.__self === undefined ? null : config.__self;\n source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n {\n if (Object.freeze) {\n Object.freeze(childArray);\n }\n }\n\n props.children = childArray;\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n {\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n}\nfunction cloneAndReplaceKey(oldElement, newKey) {\n var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);\n return newElement;\n}\n/**\n * Clone and return a new ReactElement using element as the starting point.\n * See https://reactjs.org/docs/react-api.html#cloneelement\n */\n\nfunction cloneElement(element, config, children) {\n if (element === null || element === undefined) {\n throw new Error(\"React.cloneElement(...): The argument must be a React element, but you passed \" + element + \".\");\n }\n\n var propName; // Original props are copied\n\n var props = assign({}, element.props); // Reserved names are extracted\n\n var key = element.key;\n var ref = element.ref; // Self is preserved since the owner is preserved.\n\n var self = element._self; // Source is preserved since cloneElement is unlikely to be targeted by a\n // transpiler, and the original source is probably a better indicator of the\n // true owner.\n\n var source = element._source; // Owner will be preserved, unless ref is overridden\n\n var owner = element._owner;\n\n if (config != null) {\n if (hasValidRef(config)) {\n // Silently steal the ref from the parent.\n ref = config.ref;\n owner = ReactCurrentOwner.current;\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n } // Remaining properties override existing props\n\n\n var defaultProps;\n\n if (element.type && element.type.defaultProps) {\n defaultProps = element.type.defaultProps;\n }\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n if (config[propName] === undefined && defaultProps !== undefined) {\n // Resolve default props\n props[propName] = defaultProps[propName];\n } else {\n props[propName] = config[propName];\n }\n }\n }\n } // Children can be more than one argument, and those are transferred onto\n // the newly allocated props object.\n\n\n var childrenLength = arguments.length - 2;\n\n if (childrenLength === 1) {\n props.children = children;\n } else if (childrenLength > 1) {\n var childArray = Array(childrenLength);\n\n for (var i = 0; i < childrenLength; i++) {\n childArray[i] = arguments[i + 2];\n }\n\n props.children = childArray;\n }\n\n return ReactElement(element.type, key, ref, self, source, owner, props);\n}\n/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a ReactElement.\n * @final\n */\n\nfunction isValidElement(object) {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n}\n\nvar SEPARATOR = '.';\nvar SUBSEPARATOR = ':';\n/**\n * Escape and wrap key so it is safe to use as a reactid\n *\n * @param {string} key to be escaped.\n * @return {string} the escaped key.\n */\n\nfunction escape(key) {\n var escapeRegex = /[=:]/g;\n var escaperLookup = {\n '=': '=0',\n ':': '=2'\n };\n var escapedString = key.replace(escapeRegex, function (match) {\n return escaperLookup[match];\n });\n return '$' + escapedString;\n}\n/**\n * TODO: Test that a single child and an array with one item have the same key\n * pattern.\n */\n\n\nvar didWarnAboutMaps = false;\nvar userProvidedKeyEscapeRegex = /\\/+/g;\n\nfunction escapeUserProvidedKey(text) {\n return text.replace(userProvidedKeyEscapeRegex, '$&/');\n}\n/**\n * Generate a key string that identifies a element within a set.\n *\n * @param {*} element A element that could contain a manual key.\n * @param {number} index Index that is used if a manual key is not provided.\n * @return {string}\n */\n\n\nfunction getElementKey(element, index) {\n // Do some typechecking here since we call this blindly. We want to ensure\n // that we don't block potential future ES APIs.\n if (typeof element === 'object' && element !== null && element.key != null) {\n // Explicit key\n {\n checkKeyStringCoercion(element.key);\n }\n\n return escape('' + element.key);\n } // Implicit key determined by the index in the set\n\n\n return index.toString(36);\n}\n\nfunction mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {\n var type = typeof children;\n\n if (type === 'undefined' || type === 'boolean') {\n // All of the above are perceived as null.\n children = null;\n }\n\n var invokeCallback = false;\n\n if (children === null) {\n invokeCallback = true;\n } else {\n switch (type) {\n case 'string':\n case 'number':\n invokeCallback = true;\n break;\n\n case 'object':\n switch (children.$$typeof) {\n case REACT_ELEMENT_TYPE:\n case REACT_PORTAL_TYPE:\n invokeCallback = true;\n }\n\n }\n }\n\n if (invokeCallback) {\n var _child = children;\n var mappedChild = callback(_child); // If it's the only child, treat the name as if it was wrapped in an array\n // so that it's consistent if the number of children grows:\n\n var childKey = nameSoFar === '' ? SEPARATOR + getElementKey(_child, 0) : nameSoFar;\n\n if (isArray(mappedChild)) {\n var escapedChildKey = '';\n\n if (childKey != null) {\n escapedChildKey = escapeUserProvidedKey(childKey) + '/';\n }\n\n mapIntoArray(mappedChild, array, escapedChildKey, '', function (c) {\n return c;\n });\n } else if (mappedChild != null) {\n if (isValidElement(mappedChild)) {\n {\n // The `if` statement here prevents auto-disabling of the safe\n // coercion ESLint rule, so we must manually disable it below.\n // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key\n if (mappedChild.key && (!_child || _child.key !== mappedChild.key)) {\n checkKeyStringCoercion(mappedChild.key);\n }\n }\n\n mappedChild = cloneAndReplaceKey(mappedChild, // Keep both the (mapped) and old keys if they differ, just as\n // traverseAllChildren used to do for objects as children\n escapedPrefix + ( // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key\n mappedChild.key && (!_child || _child.key !== mappedChild.key) ? // $FlowFixMe Flow incorrectly thinks existing element's key can be a number\n // eslint-disable-next-line react-internal/safe-string-coercion\n escapeUserProvidedKey('' + mappedChild.key) + '/' : '') + childKey);\n }\n\n array.push(mappedChild);\n }\n\n return 1;\n }\n\n var child;\n var nextName;\n var subtreeCount = 0; // Count of children found in the current subtree.\n\n var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;\n\n if (isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n child = children[i];\n nextName = nextNamePrefix + getElementKey(child, i);\n subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);\n }\n } else {\n var iteratorFn = getIteratorFn(children);\n\n if (typeof iteratorFn === 'function') {\n var iterableChildren = children;\n\n {\n // Warn about using Maps as children\n if (iteratorFn === iterableChildren.entries) {\n if (!didWarnAboutMaps) {\n warn('Using Maps as children is not supported. ' + 'Use an array of keyed ReactElements instead.');\n }\n\n didWarnAboutMaps = true;\n }\n }\n\n var iterator = iteratorFn.call(iterableChildren);\n var step;\n var ii = 0;\n\n while (!(step = iterator.next()).done) {\n child = step.value;\n nextName = nextNamePrefix + getElementKey(child, ii++);\n subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);\n }\n } else if (type === 'object') {\n // eslint-disable-next-line react-internal/safe-string-coercion\n var childrenString = String(children);\n throw new Error(\"Objects are not valid as a React child (found: \" + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + \"). \" + 'If you meant to render a collection of children, use an array ' + 'instead.');\n }\n }\n\n return subtreeCount;\n}\n\n/**\n * Maps children that are typically specified as `props.children`.\n *\n * See https://reactjs.org/docs/react-api.html#reactchildrenmap\n *\n * The provided mapFunction(child, index) will be called for each\n * leaf child.\n *\n * @param {?*} children Children tree container.\n * @param {function(*, int)} func The map function.\n * @param {*} context Context for mapFunction.\n * @return {object} Object containing the ordered map of results.\n */\nfunction mapChildren(children, func, context) {\n if (children == null) {\n return children;\n }\n\n var result = [];\n var count = 0;\n mapIntoArray(children, result, '', '', function (child) {\n return func.call(context, child, count++);\n });\n return result;\n}\n/**\n * Count the number of children that are typically specified as\n * `props.children`.\n *\n * See https://reactjs.org/docs/react-api.html#reactchildrencount\n *\n * @param {?*} children Children tree container.\n * @return {number} The number of children.\n */\n\n\nfunction countChildren(children) {\n var n = 0;\n mapChildren(children, function () {\n n++; // Don't return anything\n });\n return n;\n}\n\n/**\n * Iterates through children that are typically specified as `props.children`.\n *\n * See https://reactjs.org/docs/react-api.html#reactchildrenforeach\n *\n * The provided forEachFunc(child, index) will be called for each\n * leaf child.\n *\n * @param {?*} children Children tree container.\n * @param {function(*, int)} forEachFunc\n * @param {*} forEachContext Context for forEachContext.\n */\nfunction forEachChildren(children, forEachFunc, forEachContext) {\n mapChildren(children, function () {\n forEachFunc.apply(this, arguments); // Don't return anything.\n }, forEachContext);\n}\n/**\n * Flatten a children object (typically specified as `props.children`) and\n * return an array with appropriately re-keyed children.\n *\n * See https://reactjs.org/docs/react-api.html#reactchildrentoarray\n */\n\n\nfunction toArray(children) {\n return mapChildren(children, function (child) {\n return child;\n }) || [];\n}\n/**\n * Returns the first child in a collection of children and verifies that there\n * is only one child in the collection.\n *\n * See https://reactjs.org/docs/react-api.html#reactchildrenonly\n *\n * The current implementation of this function assumes that a single child gets\n * passed without a wrapper, but the purpose of this helper function is to\n * abstract away the particular structure of children.\n *\n * @param {?object} children Child collection structure.\n * @return {ReactElement} The first and only `ReactElement` contained in the\n * structure.\n */\n\n\nfunction onlyChild(children) {\n if (!isValidElement(children)) {\n throw new Error('React.Children.only expected to receive a single React element child.');\n }\n\n return children;\n}\n\nfunction createContext(defaultValue) {\n // TODO: Second argument used to be an optional `calculateChangedBits`\n // function. Warn to reserve for future use?\n var context = {\n $$typeof: REACT_CONTEXT_TYPE,\n // As a workaround to support multiple concurrent renderers, we categorize\n // some renderers as primary and others as secondary. We only expect\n // there to be two concurrent renderers at most: React Native (primary) and\n // Fabric (secondary); React DOM (primary) and React ART (secondary).\n // Secondary renderers store their context values on separate fields.\n _currentValue: defaultValue,\n _currentValue2: defaultValue,\n // Used to track how many concurrent renderers this context currently\n // supports within in a single renderer. Such as parallel server rendering.\n _threadCount: 0,\n // These are circular\n Provider: null,\n Consumer: null,\n // Add these to use same hidden class in VM as ServerContext\n _defaultValue: null,\n _globalName: null\n };\n context.Provider = {\n $$typeof: REACT_PROVIDER_TYPE,\n _context: context\n };\n var hasWarnedAboutUsingNestedContextConsumers = false;\n var hasWarnedAboutUsingConsumerProvider = false;\n var hasWarnedAboutDisplayNameOnConsumer = false;\n\n {\n // A separate object, but proxies back to the original context object for\n // backwards compatibility. It has a different $$typeof, so we can properly\n // warn for the incorrect usage of Context as a Consumer.\n var Consumer = {\n $$typeof: REACT_CONTEXT_TYPE,\n _context: context\n }; // $FlowFixMe: Flow complains about not setting a value, which is intentional here\n\n Object.defineProperties(Consumer, {\n Provider: {\n get: function () {\n if (!hasWarnedAboutUsingConsumerProvider) {\n hasWarnedAboutUsingConsumerProvider = true;\n\n error('Rendering <Context.Consumer.Provider> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Provider> instead?');\n }\n\n return context.Provider;\n },\n set: function (_Provider) {\n context.Provider = _Provider;\n }\n },\n _currentValue: {\n get: function () {\n return context._currentValue;\n },\n set: function (_currentValue) {\n context._currentValue = _currentValue;\n }\n },\n _currentValue2: {\n get: function () {\n return context._currentValue2;\n },\n set: function (_currentValue2) {\n context._currentValue2 = _currentValue2;\n }\n },\n _threadCount: {\n get: function () {\n return context._threadCount;\n },\n set: function (_threadCount) {\n context._threadCount = _threadCount;\n }\n },\n Consumer: {\n get: function () {\n if (!hasWarnedAboutUsingNestedContextConsumers) {\n hasWarnedAboutUsingNestedContextConsumers = true;\n\n error('Rendering <Context.Consumer.Consumer> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');\n }\n\n return context.Consumer;\n }\n },\n displayName: {\n get: function () {\n return context.displayName;\n },\n set: function (displayName) {\n if (!hasWarnedAboutDisplayNameOnConsumer) {\n warn('Setting `displayName` on Context.Consumer has no effect. ' + \"You should set it directly on the context with Context.displayName = '%s'.\", displayName);\n\n hasWarnedAboutDisplayNameOnConsumer = true;\n }\n }\n }\n }); // $FlowFixMe: Flow complains about missing properties because it doesn't understand defineProperty\n\n context.Consumer = Consumer;\n }\n\n {\n context._currentRenderer = null;\n context._currentRenderer2 = null;\n }\n\n return context;\n}\n\nvar Uninitialized = -1;\nvar Pending = 0;\nvar Resolved = 1;\nvar Rejected = 2;\n\nfunction lazyInitializer(payload) {\n if (payload._status === Uninitialized) {\n var ctor = payload._result;\n var thenable = ctor(); // Transition to the next state.\n // This might throw either because it's missing or throws. If so, we treat it\n // as still uninitialized and try again next time. Which is the same as what\n // happens if the ctor or any wrappers processing the ctor throws. This might\n // end up fixing it if the resolution was a concurrency bug.\n\n thenable.then(function (moduleObject) {\n if (payload._status === Pending || payload._status === Uninitialized) {\n // Transition to the next state.\n var resolved = payload;\n resolved._status = Resolved;\n resolved._result = moduleObject;\n }\n }, function (error) {\n if (payload._status === Pending || payload._status === Uninitialized) {\n // Transition to the next state.\n var rejected = payload;\n rejected._status = Rejected;\n rejected._result = error;\n }\n });\n\n if (payload._status === Uninitialized) {\n // In case, we're still uninitialized, then we're waiting for the thenable\n // to resolve. Set it as pending in the meantime.\n var pending = payload;\n pending._status = Pending;\n pending._result = thenable;\n }\n }\n\n if (payload._status === Resolved) {\n var moduleObject = payload._result;\n\n {\n if (moduleObject === undefined) {\n error('lazy: Expected the result of a dynamic imp' + 'ort() call. ' + 'Instead received: %s\\n\\nYour code should look like: \\n ' + // Break up imports to avoid accidentally parsing them as dependencies.\n 'const MyComponent = lazy(() => imp' + \"ort('./MyComponent'))\\n\\n\" + 'Did you accidentally put curly braces around the import?', moduleObject);\n }\n }\n\n {\n if (!('default' in moduleObject)) {\n error('lazy: Expected the result of a dynamic imp' + 'ort() call. ' + 'Instead received: %s\\n\\nYour code should look like: \\n ' + // Break up imports to avoid accidentally parsing them as dependencies.\n 'const MyComponent = lazy(() => imp' + \"ort('./MyComponent'))\", moduleObject);\n }\n }\n\n return moduleObject.default;\n } else {\n throw payload._result;\n }\n}\n\nfunction lazy(ctor) {\n var payload = {\n // We use these fields to store the result.\n _status: Uninitialized,\n _result: ctor\n };\n var lazyType = {\n $$typeof: REACT_LAZY_TYPE,\n _payload: payload,\n _init: lazyInitializer\n };\n\n {\n // In production, this would just set it on the object.\n var defaultProps;\n var propTypes; // $FlowFixMe\n\n Object.defineProperties(lazyType, {\n defaultProps: {\n configurable: true,\n get: function () {\n return defaultProps;\n },\n set: function (newDefaultProps) {\n error('React.lazy(...): It is not supported to assign `defaultProps` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');\n\n defaultProps = newDefaultProps; // Match production behavior more closely:\n // $FlowFixMe\n\n Object.defineProperty(lazyType, 'defaultProps', {\n enumerable: true\n });\n }\n },\n propTypes: {\n configurable: true,\n get: function () {\n return propTypes;\n },\n set: function (newPropTypes) {\n error('React.lazy(...): It is not supported to assign `propTypes` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');\n\n propTypes = newPropTypes; // Match production behavior more closely:\n // $FlowFixMe\n\n Object.defineProperty(lazyType, 'propTypes', {\n enumerable: true\n });\n }\n }\n });\n }\n\n return lazyType;\n}\n\nfunction forwardRef(render) {\n {\n if (render != null && render.$$typeof === REACT_MEMO_TYPE) {\n error('forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).');\n } else if (typeof render !== 'function') {\n error('forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);\n } else {\n if (render.length !== 0 && render.length !== 2) {\n error('forwardRef render functions accept exactly two parameters: props and ref. %s', render.length === 1 ? 'Did you forget to use the ref parameter?' : 'Any additional parameter will be undefined.');\n }\n }\n\n if (render != null) {\n if (render.defaultProps != null || render.propTypes != null) {\n error('forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?');\n }\n }\n }\n\n var elementType = {\n $$typeof: REACT_FORWARD_REF_TYPE,\n render: render\n };\n\n {\n var ownName;\n Object.defineProperty(elementType, 'displayName', {\n enumerable: false,\n configurable: true,\n get: function () {\n return ownName;\n },\n set: function (name) {\n ownName = name; // The inner component shouldn't inherit this display name in most cases,\n // because the component may be used elsewhere.\n // But it's nice for anonymous functions to inherit the name,\n // so that our component-stack generation logic will display their frames.\n // An anonymous function generally suggests a pattern like:\n // React.forwardRef((props, ref) => {...});\n // This kind of inner function is not used elsewhere so the side effect is okay.\n\n if (!render.name && !render.displayName) {\n render.displayName = name;\n }\n }\n });\n }\n\n return elementType;\n}\n\nvar REACT_MODULE_REFERENCE;\n\n{\n REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');\n}\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n return true;\n } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\n\n\n if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {\n return true;\n }\n\n if (typeof type === 'object' && type !== null) {\n if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object\n // types supported by any Flight configuration anywhere since\n // we don't know which Flight build this will end up being used\n // with.\n type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction memo(type, compare) {\n {\n if (!isValidElementType(type)) {\n error('memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);\n }\n }\n\n var elementType = {\n $$typeof: REACT_MEMO_TYPE,\n type: type,\n compare: compare === undefined ? null : compare\n };\n\n {\n var ownName;\n Object.defineProperty(elementType, 'displayName', {\n enumerable: false,\n configurable: true,\n get: function () {\n return ownName;\n },\n set: function (name) {\n ownName = name; // The inner component shouldn't inherit this display name in most cases,\n // because the component may be used elsewhere.\n // But it's nice for anonymous functions to inherit the name,\n // so that our component-stack generation logic will display their frames.\n // An anonymous function generally suggests a pattern like:\n // React.memo((props) => {...});\n // This kind of inner function is not used elsewhere so the side effect is okay.\n\n if (!type.name && !type.displayName) {\n type.displayName = name;\n }\n }\n });\n }\n\n return elementType;\n}\n\nfunction resolveDispatcher() {\n var dispatcher = ReactCurrentDispatcher.current;\n\n {\n if (dispatcher === null) {\n error('Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for' + ' one of the following reasons:\\n' + '1. You might have mismatching versions of React and the renderer (such as React DOM)\\n' + '2. You might be breaking the Rules of Hooks\\n' + '3. You might have more than one copy of React in the same app\\n' + 'See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.');\n }\n } // Will result in a null access error if accessed outside render phase. We\n // intentionally don't throw our own error because this is in a hot path.\n // Also helps ensure this is inlined.\n\n\n return dispatcher;\n}\nfunction useContext(Context) {\n var dispatcher = resolveDispatcher();\n\n {\n // TODO: add a more generic warning for invalid values.\n if (Context._context !== undefined) {\n var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs\n // and nobody should be using this in existing code.\n\n if (realContext.Consumer === Context) {\n error('Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be ' + 'removed in a future major release. Did you mean to call useContext(Context) instead?');\n } else if (realContext.Provider === Context) {\n error('Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?');\n }\n }\n }\n\n return dispatcher.useContext(Context);\n}\nfunction useState(initialState) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useState(initialState);\n}\nfunction useReducer(reducer, initialArg, init) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useReducer(reducer, initialArg, init);\n}\nfunction useRef(initialValue) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useRef(initialValue);\n}\nfunction useEffect(create, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useEffect(create, deps);\n}\nfunction useInsertionEffect(create, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useInsertionEffect(create, deps);\n}\nfunction useLayoutEffect(create, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useLayoutEffect(create, deps);\n}\nfunction useCallback(callback, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useCallback(callback, deps);\n}\nfunction useMemo(create, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useMemo(create, deps);\n}\nfunction useImperativeHandle(ref, create, deps) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useImperativeHandle(ref, create, deps);\n}\nfunction useDebugValue(value, formatterFn) {\n {\n var dispatcher = resolveDispatcher();\n return dispatcher.useDebugValue(value, formatterFn);\n }\n}\nfunction useTransition() {\n var dispatcher = resolveDispatcher();\n return dispatcher.useTransition();\n}\nfunction useDeferredValue(value) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useDeferredValue(value);\n}\nfunction useId() {\n var dispatcher = resolveDispatcher();\n return dispatcher.useId();\n}\nfunction useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {\n var dispatcher = resolveDispatcher();\n return dispatcher.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);\n}\n\n// Helpers to patch console.logs to avoid logging during side-effect free\n// replaying on render function. This currently only patches the object\n// lazily which won't cover if the log function was extracted eagerly.\n// We could also eagerly patch the method.\nvar disabledDepth = 0;\nvar prevLog;\nvar prevInfo;\nvar prevWarn;\nvar prevError;\nvar prevGroup;\nvar prevGroupCollapsed;\nvar prevGroupEnd;\n\nfunction disabledLog() {}\n\ndisabledLog.__reactDisabledLog = true;\nfunction disableLogs() {\n {\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n prevLog = console.log;\n prevInfo = console.info;\n prevWarn = console.warn;\n prevError = console.error;\n prevGroup = console.group;\n prevGroupCollapsed = console.groupCollapsed;\n prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099\n\n var props = {\n configurable: true,\n enumerable: true,\n value: disabledLog,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n info: props,\n log: props,\n warn: props,\n error: props,\n group: props,\n groupCollapsed: props,\n groupEnd: props\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n disabledDepth++;\n }\n}\nfunction reenableLogs() {\n {\n disabledDepth--;\n\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n var props = {\n configurable: true,\n enumerable: true,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n log: assign({}, props, {\n value: prevLog\n }),\n info: assign({}, props, {\n value: prevInfo\n }),\n warn: assign({}, props, {\n value: prevWarn\n }),\n error: assign({}, props, {\n value: prevError\n }),\n group: assign({}, props, {\n value: prevGroup\n }),\n groupCollapsed: assign({}, props, {\n value: prevGroupCollapsed\n }),\n groupEnd: assign({}, props, {\n value: prevGroupEnd\n })\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n if (disabledDepth < 0) {\n error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');\n }\n }\n}\n\nvar ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;\nvar prefix;\nfunction describeBuiltInComponentFrame(name, source, ownerFn) {\n {\n if (prefix === undefined) {\n // Extract the VM specific prefix used by each line.\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(/\\n( *(at )?)/);\n prefix = match && match[1] || '';\n }\n } // We use the prefix to ensure our stacks line up with native stack frames.\n\n\n return '\\n' + prefix + name;\n }\n}\nvar reentry = false;\nvar componentFrameCache;\n\n{\n var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\n componentFrameCache = new PossiblyWeakMap();\n}\n\nfunction describeNativeComponentFrame(fn, construct) {\n // If something asked for a stack inside a fake render, it should get ignored.\n if ( !fn || reentry) {\n return '';\n }\n\n {\n var frame = componentFrameCache.get(fn);\n\n if (frame !== undefined) {\n return frame;\n }\n }\n\n var control;\n reentry = true;\n var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.\n\n Error.prepareStackTrace = undefined;\n var previousDispatcher;\n\n {\n previousDispatcher = ReactCurrentDispatcher$1.current; // Set the dispatcher in DEV because this might be call in the render function\n // for warnings.\n\n ReactCurrentDispatcher$1.current = null;\n disableLogs();\n }\n\n try {\n // This should throw.\n if (construct) {\n // Something should be setting the props in the constructor.\n var Fake = function () {\n throw Error();\n }; // $FlowFixMe\n\n\n Object.defineProperty(Fake.prototype, 'props', {\n set: function () {\n // We use a throwing setter instead of frozen or non-writable props\n // because that won't throw in a non-strict mode function.\n throw Error();\n }\n });\n\n if (typeof Reflect === 'object' && Reflect.construct) {\n // We construct a different control for this case to include any extra\n // frames added by the construct call.\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n control = x;\n }\n\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x) {\n control = x;\n }\n\n fn.call(Fake.prototype);\n }\n } else {\n try {\n throw Error();\n } catch (x) {\n control = x;\n }\n\n fn();\n }\n } catch (sample) {\n // This is inlined manually because closure doesn't do it for us.\n if (sample && control && typeof sample.stack === 'string') {\n // This extracts the first frame from the sample that isn't also in the control.\n // Skipping one frame that we assume is the frame that calls the two.\n var sampleLines = sample.stack.split('\\n');\n var controlLines = control.stack.split('\\n');\n var s = sampleLines.length - 1;\n var c = controlLines.length - 1;\n\n while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {\n // We expect at least one stack frame to be shared.\n // Typically this will be the root most one. However, stack frames may be\n // cut off due to maximum stack limits. In this case, one maybe cut off\n // earlier than the other. We assume that the sample is longer or the same\n // and there for cut off earlier. So we should find the root most frame in\n // the sample somewhere in the control.\n c--;\n }\n\n for (; s >= 1 && c >= 0; s--, c--) {\n // Next we find the first one that isn't the same which should be the\n // frame that called our sample function and the control.\n if (sampleLines[s] !== controlLines[c]) {\n // In V8, the first line is describing the message but other VMs don't.\n // If we're about to return the first line, and the control is also on the same\n // line, that's a pretty good indicator that our sample threw at same line as\n // the control. I.e. before we entered the sample frame. So we ignore this result.\n // This can happen if you passed a class to function component, or non-function.\n if (s !== 1 || c !== 1) {\n do {\n s--;\n c--; // We may still have similar intermediate frames from the construct call.\n // The next one that isn't the same should be our match though.\n\n if (c < 0 || sampleLines[s] !== controlLines[c]) {\n // V8 adds a \"new\" prefix for native classes. Let's remove it to make it prettier.\n var _frame = '\\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled \"<anonymous>\"\n // but we have a user-provided \"displayName\"\n // splice it in to make the stack more readable.\n\n\n if (fn.displayName && _frame.includes('<anonymous>')) {\n _frame = _frame.replace('<anonymous>', fn.displayName);\n }\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, _frame);\n }\n } // Return the line we found.\n\n\n return _frame;\n }\n } while (s >= 1 && c >= 0);\n }\n\n break;\n }\n }\n }\n } finally {\n reentry = false;\n\n {\n ReactCurrentDispatcher$1.current = previousDispatcher;\n reenableLogs();\n }\n\n Error.prepareStackTrace = previousPrepareStackTrace;\n } // Fallback to just using the name if we couldn't make it throw.\n\n\n var name = fn ? fn.displayName || fn.name : '';\n var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, syntheticFrame);\n }\n }\n\n return syntheticFrame;\n}\nfunction describeFunctionComponentFrame(fn, source, ownerFn) {\n {\n return describeNativeComponentFrame(fn, false);\n }\n}\n\nfunction shouldConstruct(Component) {\n var prototype = Component.prototype;\n return !!(prototype && prototype.isReactComponent);\n}\n\nfunction describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {\n\n if (type == null) {\n return '';\n }\n\n if (typeof type === 'function') {\n {\n return describeNativeComponentFrame(type, shouldConstruct(type));\n }\n }\n\n if (typeof type === 'string') {\n return describeBuiltInComponentFrame(type);\n }\n\n switch (type) {\n case REACT_SUSPENSE_TYPE:\n return describeBuiltInComponentFrame('Suspense');\n\n case REACT_SUSPENSE_LIST_TYPE:\n return describeBuiltInComponentFrame('SuspenseList');\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n return describeFunctionComponentFrame(type.render);\n\n case REACT_MEMO_TYPE:\n // Memo may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n // Lazy may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);\n } catch (x) {}\n }\n }\n }\n\n return '';\n}\n\nvar loggedTypeFailures = {};\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame$1.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame$1.setExtraStackFrame(null);\n }\n }\n}\n\nfunction checkPropTypes(typeSpecs, values, location, componentName, element) {\n {\n // $FlowFixMe This is okay but Flow doesn't know it.\n var has = Function.call.bind(hasOwnProperty);\n\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n // eslint-disable-next-line react-internal/prod-error-codes\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n err.name = 'Invariant Violation';\n throw err;\n }\n\n error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\n } catch (ex) {\n error$1 = ex;\n }\n\n if (error$1 && !(error$1 instanceof Error)) {\n setCurrentlyValidatingElement(element);\n\n error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);\n\n setCurrentlyValidatingElement(null);\n }\n\n if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error$1.message] = true;\n setCurrentlyValidatingElement(element);\n\n error('Failed %s type: %s', location, error$1.message);\n\n setCurrentlyValidatingElement(null);\n }\n }\n }\n }\n}\n\nfunction setCurrentlyValidatingElement$1(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n setExtraStackFrame(stack);\n } else {\n setExtraStackFrame(null);\n }\n }\n}\n\nvar propTypesMisspellWarningShown;\n\n{\n propTypesMisspellWarningShown = false;\n}\n\nfunction getDeclarationErrorAddendum() {\n if (ReactCurrentOwner.current) {\n var name = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n if (name) {\n return '\\n\\nCheck the render method of `' + name + '`.';\n }\n }\n\n return '';\n}\n\nfunction getSourceInfoErrorAddendum(source) {\n if (source !== undefined) {\n var fileName = source.fileName.replace(/^.*[\\\\\\/]/, '');\n var lineNumber = source.lineNumber;\n return '\\n\\nCheck your code at ' + fileName + ':' + lineNumber + '.';\n }\n\n return '';\n}\n\nfunction getSourceInfoErrorAddendumForProps(elementProps) {\n if (elementProps !== null && elementProps !== undefined) {\n return getSourceInfoErrorAddendum(elementProps.__source);\n }\n\n return '';\n}\n/**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\n\n\nvar ownerHasKeyUseWarning = {};\n\nfunction getCurrentComponentErrorInfo(parentType) {\n var info = getDeclarationErrorAddendum();\n\n if (!info) {\n var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;\n\n if (parentName) {\n info = \"\\n\\nCheck the top-level render call using <\" + parentName + \">.\";\n }\n }\n\n return info;\n}\n/**\n * Warn if the element doesn't have an explicit key assigned to it.\n * This element is in an array. The array could grow and shrink or be\n * reordered. All children that haven't already been validated are required to\n * have a \"key\" property assigned to it. Error statuses are cached so a warning\n * will only be shown once.\n *\n * @internal\n * @param {ReactElement} element Element that requires a key.\n * @param {*} parentType element's parent's type.\n */\n\n\nfunction validateExplicitKey(element, parentType) {\n if (!element._store || element._store.validated || element.key != null) {\n return;\n }\n\n element._store.validated = true;\n var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);\n\n if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n return;\n }\n\n ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a\n // property, it may be the creator of the child that's responsible for\n // assigning it a key.\n\n var childOwner = '';\n\n if (element && element._owner && element._owner !== ReactCurrentOwner.current) {\n // Give the component that originally created this child.\n childOwner = \" It was passed a child from \" + getComponentNameFromType(element._owner.type) + \".\";\n }\n\n {\n setCurrentlyValidatingElement$1(element);\n\n error('Each child in a list should have a unique \"key\" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);\n\n setCurrentlyValidatingElement$1(null);\n }\n}\n/**\n * Ensure that every element either is passed in a static location, in an\n * array with an explicit keys property defined, or in an object literal\n * with valid key property.\n *\n * @internal\n * @param {ReactNode} node Statically passed child of any type.\n * @param {*} parentType node's parent's type.\n */\n\n\nfunction validateChildKeys(node, parentType) {\n if (typeof node !== 'object') {\n return;\n }\n\n if (isArray(node)) {\n for (var i = 0; i < node.length; i++) {\n var child = node[i];\n\n if (isValidElement(child)) {\n validateExplicitKey(child, parentType);\n }\n }\n } else if (isValidElement(node)) {\n // This element was passed in a valid location.\n if (node._store) {\n node._store.validated = true;\n }\n } else if (node) {\n var iteratorFn = getIteratorFn(node);\n\n if (typeof iteratorFn === 'function') {\n // Entry iterators used to provide implicit keys,\n // but now we print a separate warning for them later.\n if (iteratorFn !== node.entries) {\n var iterator = iteratorFn.call(node);\n var step;\n\n while (!(step = iterator.next()).done) {\n if (isValidElement(step.value)) {\n validateExplicitKey(step.value, parentType);\n }\n }\n }\n }\n }\n}\n/**\n * Given an element, validate that its props follow the propTypes definition,\n * provided by the type.\n *\n * @param {ReactElement} element\n */\n\n\nfunction validatePropTypes(element) {\n {\n var type = element.type;\n\n if (type === null || type === undefined || typeof type === 'string') {\n return;\n }\n\n var propTypes;\n\n if (typeof type === 'function') {\n propTypes = type.propTypes;\n } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.\n // Inner props are checked in the reconciler.\n type.$$typeof === REACT_MEMO_TYPE)) {\n propTypes = type.propTypes;\n } else {\n return;\n }\n\n if (propTypes) {\n // Intentionally inside to avoid triggering lazy initializers:\n var name = getComponentNameFromType(type);\n checkPropTypes(propTypes, element.props, 'prop', name, element);\n } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {\n propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:\n\n var _name = getComponentNameFromType(type);\n\n error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');\n }\n\n if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {\n error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');\n }\n }\n}\n/**\n * Given a fragment, validate that it can only be provided with fragment props\n * @param {ReactElement} fragment\n */\n\n\nfunction validateFragmentProps(fragment) {\n {\n var keys = Object.keys(fragment.props);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (key !== 'children' && key !== 'key') {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);\n\n setCurrentlyValidatingElement$1(null);\n break;\n }\n }\n\n if (fragment.ref !== null) {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid attribute `ref` supplied to `React.Fragment`.');\n\n setCurrentlyValidatingElement$1(null);\n }\n }\n}\nfunction createElementWithValidation(type, props, children) {\n var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to\n // succeed and there will likely be errors in render.\n\n if (!validType) {\n var info = '';\n\n if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and named imports.\";\n }\n\n var sourceInfo = getSourceInfoErrorAddendumForProps(props);\n\n if (sourceInfo) {\n info += sourceInfo;\n } else {\n info += getDeclarationErrorAddendum();\n }\n\n var typeString;\n\n if (type === null) {\n typeString = 'null';\n } else if (isArray(type)) {\n typeString = 'array';\n } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {\n typeString = \"<\" + (getComponentNameFromType(type.type) || 'Unknown') + \" />\";\n info = ' Did you accidentally export a JSX literal instead of a component?';\n } else {\n typeString = typeof type;\n }\n\n {\n error('React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);\n }\n }\n\n var element = createElement.apply(this, arguments); // The result can be nullish if a mock or a custom function is used.\n // TODO: Drop this when these are no longer allowed as the type argument.\n\n if (element == null) {\n return element;\n } // Skip key warning if the type isn't valid since our key validation logic\n // doesn't expect a non-string/function type and can throw confusing errors.\n // We don't want exception behavior to differ between dev and prod.\n // (Rendering will throw with a helpful message and as soon as the type is\n // fixed, the key warnings will appear.)\n\n\n if (validType) {\n for (var i = 2; i < arguments.length; i++) {\n validateChildKeys(arguments[i], type);\n }\n }\n\n if (type === REACT_FRAGMENT_TYPE) {\n validateFragmentProps(element);\n } else {\n validatePropTypes(element);\n }\n\n return element;\n}\nvar didWarnAboutDeprecatedCreateFactory = false;\nfunction createFactoryWithValidation(type) {\n var validatedFactory = createElementWithValidation.bind(null, type);\n validatedFactory.type = type;\n\n {\n if (!didWarnAboutDeprecatedCreateFactory) {\n didWarnAboutDeprecatedCreateFactory = true;\n\n warn('React.createFactory() is deprecated and will be removed in ' + 'a future major release. Consider using JSX ' + 'or use React.createElement() directly instead.');\n } // Legacy hook: remove it\n\n\n Object.defineProperty(validatedFactory, 'type', {\n enumerable: false,\n get: function () {\n warn('Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');\n\n Object.defineProperty(this, 'type', {\n value: type\n });\n return type;\n }\n });\n }\n\n return validatedFactory;\n}\nfunction cloneElementWithValidation(element, props, children) {\n var newElement = cloneElement.apply(this, arguments);\n\n for (var i = 2; i < arguments.length; i++) {\n validateChildKeys(arguments[i], newElement.type);\n }\n\n validatePropTypes(newElement);\n return newElement;\n}\n\nfunction startTransition(scope, options) {\n var prevTransition = ReactCurrentBatchConfig.transition;\n ReactCurrentBatchConfig.transition = {};\n var currentTransition = ReactCurrentBatchConfig.transition;\n\n {\n ReactCurrentBatchConfig.transition._updatedFibers = new Set();\n }\n\n try {\n scope();\n } finally {\n ReactCurrentBatchConfig.transition = prevTransition;\n\n {\n if (prevTransition === null && currentTransition._updatedFibers) {\n var updatedFibersCount = currentTransition._updatedFibers.size;\n\n if (updatedFibersCount > 10) {\n warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.');\n }\n\n currentTransition._updatedFibers.clear();\n }\n }\n }\n}\n\nvar didWarnAboutMessageChannel = false;\nvar enqueueTaskImpl = null;\nfunction enqueueTask(task) {\n if (enqueueTaskImpl === null) {\n try {\n // read require off the module object to get around the bundlers.\n // we don't want them to detect a require and bundle a Node polyfill.\n var requireString = ('require' + Math.random()).slice(0, 7);\n var nodeRequire = module && module[requireString]; // assuming we're in node, let's try to get node's\n // version of setImmediate, bypassing fake timers if any.\n\n enqueueTaskImpl = nodeRequire.call(module, 'timers').setImmediate;\n } catch (_err) {\n // we're in a browser\n // we can't use regular timers because they may still be faked\n // so we try MessageChannel+postMessage instead\n enqueueTaskImpl = function (callback) {\n {\n if (didWarnAboutMessageChannel === false) {\n didWarnAboutMessageChannel = true;\n\n if (typeof MessageChannel === 'undefined') {\n error('This browser does not have a MessageChannel implementation, ' + 'so enqueuing tasks via await act(async () => ...) will fail. ' + 'Please file an issue at https://github.com/facebook/react/issues ' + 'if you encounter this warning.');\n }\n }\n }\n\n var channel = new MessageChannel();\n channel.port1.onmessage = callback;\n channel.port2.postMessage(undefined);\n };\n }\n }\n\n return enqueueTaskImpl(task);\n}\n\nvar actScopeDepth = 0;\nvar didWarnNoAwaitAct = false;\nfunction act(callback) {\n {\n // `act` calls can be nested, so we track the depth. This represents the\n // number of `act` scopes on the stack.\n var prevActScopeDepth = actScopeDepth;\n actScopeDepth++;\n\n if (ReactCurrentActQueue.current === null) {\n // This is the outermost `act` scope. Initialize the queue. The reconciler\n // will detect the queue and use it instead of Scheduler.\n ReactCurrentActQueue.current = [];\n }\n\n var prevIsBatchingLegacy = ReactCurrentActQueue.isBatchingLegacy;\n var result;\n\n try {\n // Used to reproduce behavior of `batchedUpdates` in legacy mode. Only\n // set to `true` while the given callback is executed, not for updates\n // triggered during an async event, because this is how the legacy\n // implementation of `act` behaved.\n ReactCurrentActQueue.isBatchingLegacy = true;\n result = callback(); // Replicate behavior of original `act` implementation in legacy mode,\n // which flushed updates immediately after the scope function exits, even\n // if it's an async function.\n\n if (!prevIsBatchingLegacy && ReactCurrentActQueue.didScheduleLegacyUpdate) {\n var queue = ReactCurrentActQueue.current;\n\n if (queue !== null) {\n ReactCurrentActQueue.didScheduleLegacyUpdate = false;\n flushActQueue(queue);\n }\n }\n } catch (error) {\n popActScope(prevActScopeDepth);\n throw error;\n } finally {\n ReactCurrentActQueue.isBatchingLegacy = prevIsBatchingLegacy;\n }\n\n if (result !== null && typeof result === 'object' && typeof result.then === 'function') {\n var thenableResult = result; // The callback is an async function (i.e. returned a promise). Wait\n // for it to resolve before exiting the current scope.\n\n var wasAwaited = false;\n var thenable = {\n then: function (resolve, reject) {\n wasAwaited = true;\n thenableResult.then(function (returnValue) {\n popActScope(prevActScopeDepth);\n\n if (actScopeDepth === 0) {\n // We've exited the outermost act scope. Recursively flush the\n // queue until there's no remaining work.\n recursivelyFlushAsyncActWork(returnValue, resolve, reject);\n } else {\n resolve(returnValue);\n }\n }, function (error) {\n // The callback threw an error.\n popActScope(prevActScopeDepth);\n reject(error);\n });\n }\n };\n\n {\n if (!didWarnNoAwaitAct && typeof Promise !== 'undefined') {\n // eslint-disable-next-line no-undef\n Promise.resolve().then(function () {}).then(function () {\n if (!wasAwaited) {\n didWarnNoAwaitAct = true;\n\n error('You called act(async () => ...) without await. ' + 'This could lead to unexpected testing behaviour, ' + 'interleaving multiple act calls and mixing their ' + 'scopes. ' + 'You should - await act(async () => ...);');\n }\n });\n }\n }\n\n return thenable;\n } else {\n var returnValue = result; // The callback is not an async function. Exit the current scope\n // immediately, without awaiting.\n\n popActScope(prevActScopeDepth);\n\n if (actScopeDepth === 0) {\n // Exiting the outermost act scope. Flush the queue.\n var _queue = ReactCurrentActQueue.current;\n\n if (_queue !== null) {\n flushActQueue(_queue);\n ReactCurrentActQueue.current = null;\n } // Return a thenable. If the user awaits it, we'll flush again in\n // case additional work was scheduled by a microtask.\n\n\n var _thenable = {\n then: function (resolve, reject) {\n // Confirm we haven't re-entered another `act` scope, in case\n // the user does something weird like await the thenable\n // multiple times.\n if (ReactCurrentActQueue.current === null) {\n // Recursively flush the queue until there's no remaining work.\n ReactCurrentActQueue.current = [];\n recursivelyFlushAsyncActWork(returnValue, resolve, reject);\n } else {\n resolve(returnValue);\n }\n }\n };\n return _thenable;\n } else {\n // Since we're inside a nested `act` scope, the returned thenable\n // immediately resolves. The outer scope will flush the queue.\n var _thenable2 = {\n then: function (resolve, reject) {\n resolve(returnValue);\n }\n };\n return _thenable2;\n }\n }\n }\n}\n\nfunction popActScope(prevActScopeDepth) {\n {\n if (prevActScopeDepth !== actScopeDepth - 1) {\n error('You seem to have overlapping act() calls, this is not supported. ' + 'Be sure to await previous act() calls before making a new one. ');\n }\n\n actScopeDepth = prevActScopeDepth;\n }\n}\n\nfunction recursivelyFlushAsyncActWork(returnValue, resolve, reject) {\n {\n var queue = ReactCurrentActQueue.current;\n\n if (queue !== null) {\n try {\n flushActQueue(queue);\n enqueueTask(function () {\n if (queue.length === 0) {\n // No additional work was scheduled. Finish.\n ReactCurrentActQueue.current = null;\n resolve(returnValue);\n } else {\n // Keep flushing work until there's none left.\n recursivelyFlushAsyncActWork(returnValue, resolve, reject);\n }\n });\n } catch (error) {\n reject(error);\n }\n } else {\n resolve(returnValue);\n }\n }\n}\n\nvar isFlushing = false;\n\nfunction flushActQueue(queue) {\n {\n if (!isFlushing) {\n // Prevent re-entrance.\n isFlushing = true;\n var i = 0;\n\n try {\n for (; i < queue.length; i++) {\n var callback = queue[i];\n\n do {\n callback = callback(true);\n } while (callback !== null);\n }\n\n queue.length = 0;\n } catch (error) {\n // If something throws, leave the remaining callbacks on the queue.\n queue = queue.slice(i + 1);\n throw error;\n } finally {\n isFlushing = false;\n }\n }\n }\n}\n\nvar createElement$1 = createElementWithValidation ;\nvar cloneElement$1 = cloneElementWithValidation ;\nvar createFactory = createFactoryWithValidation ;\nvar Children = {\n map: mapChildren,\n forEach: forEachChildren,\n count: countChildren,\n toArray: toArray,\n only: onlyChild\n};\n\nexports.Children = Children;\nexports.Component = Component;\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.Profiler = REACT_PROFILER_TYPE;\nexports.PureComponent = PureComponent;\nexports.StrictMode = REACT_STRICT_MODE_TYPE;\nexports.Suspense = REACT_SUSPENSE_TYPE;\nexports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals;\nexports.act = act;\nexports.cloneElement = cloneElement$1;\nexports.createContext = createContext;\nexports.createElement = createElement$1;\nexports.createFactory = createFactory;\nexports.createRef = createRef;\nexports.forwardRef = forwardRef;\nexports.isValidElement = isValidElement;\nexports.lazy = lazy;\nexports.memo = memo;\nexports.startTransition = startTransition;\nexports.unstable_act = act;\nexports.useCallback = useCallback;\nexports.useContext = useContext;\nexports.useDebugValue = useDebugValue;\nexports.useDeferredValue = useDeferredValue;\nexports.useEffect = useEffect;\nexports.useId = useId;\nexports.useImperativeHandle = useImperativeHandle;\nexports.useInsertionEffect = useInsertionEffect;\nexports.useLayoutEffect = useLayoutEffect;\nexports.useMemo = useMemo;\nexports.useReducer = useReducer;\nexports.useRef = useRef;\nexports.useState = useState;\nexports.useSyncExternalStore = useSyncExternalStore;\nexports.useTransition = useTransition;\nexports.version = ReactVersion;\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\nif (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===\n 'function'\n) {\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());\n}\n \n })();\n}\n", "'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react.production.min.js');\n} else {\n module.exports = require('./cjs/react.development.js');\n}\n", "/**\n * @license React\n * react-jsx-runtime.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var f=require(\"react\"),k=Symbol.for(\"react.element\"),l=Symbol.for(\"react.fragment\"),m=Object.prototype.hasOwnProperty,n=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};\nfunction q(c,a,g){var b,d={},e=null,h=null;void 0!==g&&(e=\"\"+g);void 0!==a.key&&(e=\"\"+a.key);void 0!==a.ref&&(h=a.ref);for(b in a)m.call(a,b)&&!p.hasOwnProperty(b)&&(d[b]=a[b]);if(c&&c.defaultProps)for(b in a=c.defaultProps,a)void 0===d[b]&&(d[b]=a[b]);return{$$typeof:k,type:c,key:e,ref:h,props:d,_owner:n.current}}exports.Fragment=l;exports.jsx=q;exports.jsxs=q;\n", "/**\n * @license React\n * react-jsx-runtime.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\nvar React = require('react');\n\n// ATTENTION\n// When adding new symbols to this file,\n// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'\n// The Symbol used to tag the ReactElement-like types.\nvar REACT_ELEMENT_TYPE = Symbol.for('react.element');\nvar REACT_PORTAL_TYPE = Symbol.for('react.portal');\nvar REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');\nvar REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');\nvar REACT_PROFILER_TYPE = Symbol.for('react.profiler');\nvar REACT_PROVIDER_TYPE = Symbol.for('react.provider');\nvar REACT_CONTEXT_TYPE = Symbol.for('react.context');\nvar REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');\nvar REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');\nvar REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');\nvar REACT_MEMO_TYPE = Symbol.for('react.memo');\nvar REACT_LAZY_TYPE = Symbol.for('react.lazy');\nvar REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');\nvar MAYBE_ITERATOR_SYMBOL = Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nfunction error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\n// -----------------------------------------------------------------------------\n\nvar enableScopeAPI = false; // Experimental Create Event Handle API.\nvar enableCacheElement = false;\nvar enableTransitionTracing = false; // No known bugs, but needs performance testing\n\nvar enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber\n// stuff. Intended to enable React core members to more easily debug scheduling\n// issues in DEV builds.\n\nvar enableDebugTracing = false; // Track which Fiber(s) schedule render work.\n\nvar REACT_MODULE_REFERENCE;\n\n{\n REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');\n}\n\nfunction isValidElementType(type) {\n if (typeof type === 'string' || typeof type === 'function') {\n return true;\n } // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).\n\n\n if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {\n return true;\n }\n\n if (typeof type === 'object' && type !== null) {\n if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object\n // types supported by any Flight configuration anywhere since\n // we don't know which Flight build this will end up being used\n // with.\n type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var displayName = outerType.displayName;\n\n if (displayName) {\n return displayName;\n }\n\n var functionName = innerType.displayName || innerType.name || '';\n return functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName;\n} // Keep in sync with react-reconciler/getComponentNameFromFiber\n\n\nfunction getContextName(type) {\n return type.displayName || 'Context';\n} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.\n\n\nfunction getComponentNameFromType(type) {\n if (type == null) {\n // Host root, text node or just invalid type.\n return null;\n }\n\n {\n if (typeof type.tag === 'number') {\n error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return 'Fragment';\n\n case REACT_PORTAL_TYPE:\n return 'Portal';\n\n case REACT_PROFILER_TYPE:\n return 'Profiler';\n\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList';\n\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_CONTEXT_TYPE:\n var context = type;\n return getContextName(context) + '.Consumer';\n\n case REACT_PROVIDER_TYPE:\n var provider = type;\n return getContextName(provider._context) + '.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n var outerName = type.displayName || null;\n\n if (outerName !== null) {\n return outerName;\n }\n\n return getComponentNameFromType(type.type) || 'Memo';\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n return getComponentNameFromType(init(payload));\n } catch (x) {\n return null;\n }\n }\n\n // eslint-disable-next-line no-fallthrough\n }\n }\n\n return null;\n}\n\nvar assign = Object.assign;\n\n// Helpers to patch console.logs to avoid logging during side-effect free\n// replaying on render function. This currently only patches the object\n// lazily which won't cover if the log function was extracted eagerly.\n// We could also eagerly patch the method.\nvar disabledDepth = 0;\nvar prevLog;\nvar prevInfo;\nvar prevWarn;\nvar prevError;\nvar prevGroup;\nvar prevGroupCollapsed;\nvar prevGroupEnd;\n\nfunction disabledLog() {}\n\ndisabledLog.__reactDisabledLog = true;\nfunction disableLogs() {\n {\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n prevLog = console.log;\n prevInfo = console.info;\n prevWarn = console.warn;\n prevError = console.error;\n prevGroup = console.group;\n prevGroupCollapsed = console.groupCollapsed;\n prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099\n\n var props = {\n configurable: true,\n enumerable: true,\n value: disabledLog,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n info: props,\n log: props,\n warn: props,\n error: props,\n group: props,\n groupCollapsed: props,\n groupEnd: props\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n disabledDepth++;\n }\n}\nfunction reenableLogs() {\n {\n disabledDepth--;\n\n if (disabledDepth === 0) {\n /* eslint-disable react-internal/no-production-logging */\n var props = {\n configurable: true,\n enumerable: true,\n writable: true\n }; // $FlowFixMe Flow thinks console is immutable.\n\n Object.defineProperties(console, {\n log: assign({}, props, {\n value: prevLog\n }),\n info: assign({}, props, {\n value: prevInfo\n }),\n warn: assign({}, props, {\n value: prevWarn\n }),\n error: assign({}, props, {\n value: prevError\n }),\n group: assign({}, props, {\n value: prevGroup\n }),\n groupCollapsed: assign({}, props, {\n value: prevGroupCollapsed\n }),\n groupEnd: assign({}, props, {\n value: prevGroupEnd\n })\n });\n /* eslint-enable react-internal/no-production-logging */\n }\n\n if (disabledDepth < 0) {\n error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');\n }\n }\n}\n\nvar ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;\nvar prefix;\nfunction describeBuiltInComponentFrame(name, source, ownerFn) {\n {\n if (prefix === undefined) {\n // Extract the VM specific prefix used by each line.\n try {\n throw Error();\n } catch (x) {\n var match = x.stack.trim().match(/\\n( *(at )?)/);\n prefix = match && match[1] || '';\n }\n } // We use the prefix to ensure our stacks line up with native stack frames.\n\n\n return '\\n' + prefix + name;\n }\n}\nvar reentry = false;\nvar componentFrameCache;\n\n{\n var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\n componentFrameCache = new PossiblyWeakMap();\n}\n\nfunction describeNativeComponentFrame(fn, construct) {\n // If something asked for a stack inside a fake render, it should get ignored.\n if ( !fn || reentry) {\n return '';\n }\n\n {\n var frame = componentFrameCache.get(fn);\n\n if (frame !== undefined) {\n return frame;\n }\n }\n\n var control;\n reentry = true;\n var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.\n\n Error.prepareStackTrace = undefined;\n var previousDispatcher;\n\n {\n previousDispatcher = ReactCurrentDispatcher.current; // Set the dispatcher in DEV because this might be call in the render function\n // for warnings.\n\n ReactCurrentDispatcher.current = null;\n disableLogs();\n }\n\n try {\n // This should throw.\n if (construct) {\n // Something should be setting the props in the constructor.\n var Fake = function () {\n throw Error();\n }; // $FlowFixMe\n\n\n Object.defineProperty(Fake.prototype, 'props', {\n set: function () {\n // We use a throwing setter instead of frozen or non-writable props\n // because that won't throw in a non-strict mode function.\n throw Error();\n }\n });\n\n if (typeof Reflect === 'object' && Reflect.construct) {\n // We construct a different control for this case to include any extra\n // frames added by the construct call.\n try {\n Reflect.construct(Fake, []);\n } catch (x) {\n control = x;\n }\n\n Reflect.construct(fn, [], Fake);\n } else {\n try {\n Fake.call();\n } catch (x) {\n control = x;\n }\n\n fn.call(Fake.prototype);\n }\n } else {\n try {\n throw Error();\n } catch (x) {\n control = x;\n }\n\n fn();\n }\n } catch (sample) {\n // This is inlined manually because closure doesn't do it for us.\n if (sample && control && typeof sample.stack === 'string') {\n // This extracts the first frame from the sample that isn't also in the control.\n // Skipping one frame that we assume is the frame that calls the two.\n var sampleLines = sample.stack.split('\\n');\n var controlLines = control.stack.split('\\n');\n var s = sampleLines.length - 1;\n var c = controlLines.length - 1;\n\n while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {\n // We expect at least one stack frame to be shared.\n // Typically this will be the root most one. However, stack frames may be\n // cut off due to maximum stack limits. In this case, one maybe cut off\n // earlier than the other. We assume that the sample is longer or the same\n // and there for cut off earlier. So we should find the root most frame in\n // the sample somewhere in the control.\n c--;\n }\n\n for (; s >= 1 && c >= 0; s--, c--) {\n // Next we find the first one that isn't the same which should be the\n // frame that called our sample function and the control.\n if (sampleLines[s] !== controlLines[c]) {\n // In V8, the first line is describing the message but other VMs don't.\n // If we're about to return the first line, and the control is also on the same\n // line, that's a pretty good indicator that our sample threw at same line as\n // the control. I.e. before we entered the sample frame. So we ignore this result.\n // This can happen if you passed a class to function component, or non-function.\n if (s !== 1 || c !== 1) {\n do {\n s--;\n c--; // We may still have similar intermediate frames from the construct call.\n // The next one that isn't the same should be our match though.\n\n if (c < 0 || sampleLines[s] !== controlLines[c]) {\n // V8 adds a \"new\" prefix for native classes. Let's remove it to make it prettier.\n var _frame = '\\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled \"<anonymous>\"\n // but we have a user-provided \"displayName\"\n // splice it in to make the stack more readable.\n\n\n if (fn.displayName && _frame.includes('<anonymous>')) {\n _frame = _frame.replace('<anonymous>', fn.displayName);\n }\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, _frame);\n }\n } // Return the line we found.\n\n\n return _frame;\n }\n } while (s >= 1 && c >= 0);\n }\n\n break;\n }\n }\n }\n } finally {\n reentry = false;\n\n {\n ReactCurrentDispatcher.current = previousDispatcher;\n reenableLogs();\n }\n\n Error.prepareStackTrace = previousPrepareStackTrace;\n } // Fallback to just using the name if we couldn't make it throw.\n\n\n var name = fn ? fn.displayName || fn.name : '';\n var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';\n\n {\n if (typeof fn === 'function') {\n componentFrameCache.set(fn, syntheticFrame);\n }\n }\n\n return syntheticFrame;\n}\nfunction describeFunctionComponentFrame(fn, source, ownerFn) {\n {\n return describeNativeComponentFrame(fn, false);\n }\n}\n\nfunction shouldConstruct(Component) {\n var prototype = Component.prototype;\n return !!(prototype && prototype.isReactComponent);\n}\n\nfunction describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {\n\n if (type == null) {\n return '';\n }\n\n if (typeof type === 'function') {\n {\n return describeNativeComponentFrame(type, shouldConstruct(type));\n }\n }\n\n if (typeof type === 'string') {\n return describeBuiltInComponentFrame(type);\n }\n\n switch (type) {\n case REACT_SUSPENSE_TYPE:\n return describeBuiltInComponentFrame('Suspense');\n\n case REACT_SUSPENSE_LIST_TYPE:\n return describeBuiltInComponentFrame('SuspenseList');\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_FORWARD_REF_TYPE:\n return describeFunctionComponentFrame(type.render);\n\n case REACT_MEMO_TYPE:\n // Memo may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);\n\n case REACT_LAZY_TYPE:\n {\n var lazyComponent = type;\n var payload = lazyComponent._payload;\n var init = lazyComponent._init;\n\n try {\n // Lazy may contain any component type so we recursively resolve it.\n return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);\n } catch (x) {}\n }\n }\n }\n\n return '';\n}\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar loggedTypeFailures = {};\nvar ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame.setExtraStackFrame(null);\n }\n }\n}\n\nfunction checkPropTypes(typeSpecs, values, location, componentName, element) {\n {\n // $FlowFixMe This is okay but Flow doesn't know it.\n var has = Function.call.bind(hasOwnProperty);\n\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n // eslint-disable-next-line react-internal/prod-error-codes\n var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');\n err.name = 'Invariant Violation';\n throw err;\n }\n\n error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');\n } catch (ex) {\n error$1 = ex;\n }\n\n if (error$1 && !(error$1 instanceof Error)) {\n setCurrentlyValidatingElement(element);\n\n error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);\n\n setCurrentlyValidatingElement(null);\n }\n\n if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error$1.message] = true;\n setCurrentlyValidatingElement(element);\n\n error('Failed %s type: %s', location, error$1.message);\n\n setCurrentlyValidatingElement(null);\n }\n }\n }\n }\n}\n\nvar isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare\n\nfunction isArray(a) {\n return isArrayImpl(a);\n}\n\n/*\n * The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol\n * and Temporal.* types. See https://github.com/facebook/react/pull/22064.\n *\n * The functions in this module will throw an easier-to-understand,\n * easier-to-debug exception with a clear errors message message explaining the\n * problem. (Instead of a confusing exception thrown inside the implementation\n * of the `value` object).\n */\n// $FlowFixMe only called in DEV, so void return is not possible.\nfunction typeName(value) {\n {\n // toStringTag is needed for namespaced types like Temporal.Instant\n var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;\n var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';\n return type;\n }\n} // $FlowFixMe only called in DEV, so void return is not possible.\n\n\nfunction willCoercionThrow(value) {\n {\n try {\n testStringCoercion(value);\n return false;\n } catch (e) {\n return true;\n }\n }\n}\n\nfunction testStringCoercion(value) {\n // If you ended up here by following an exception call stack, here's what's\n // happened: you supplied an object or symbol value to React (as a prop, key,\n // DOM attribute, CSS property, string ref, etc.) and when React tried to\n // coerce it to a string using `'' + value`, an exception was thrown.\n //\n // The most common types that will cause this exception are `Symbol` instances\n // and Temporal objects like `Temporal.Instant`. But any object that has a\n // `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this\n // exception. (Library authors do this to prevent users from using built-in\n // numeric operators like `+` or comparison operators like `>=` because custom\n // methods are needed to perform accurate arithmetic or comparison.)\n //\n // To fix the problem, coerce this object or symbol value to a string before\n // passing it to React. The most reliable way is usually `String(value)`.\n //\n // To find which value is throwing, check the browser or debugger console.\n // Before this exception was thrown, there should be `console.error` output\n // that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the\n // problem and how that type was used: key, atrribute, input value prop, etc.\n // In most cases, this console output also shows the component and its\n // ancestor components where the exception happened.\n //\n // eslint-disable-next-line react-internal/safe-string-coercion\n return '' + value;\n}\nfunction checkKeyStringCoercion(value) {\n {\n if (willCoercionThrow(value)) {\n error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));\n\n return testStringCoercion(value); // throw (to help callers find troubleshooting comments)\n }\n }\n}\n\nvar ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;\nvar RESERVED_PROPS = {\n key: true,\n ref: true,\n __self: true,\n __source: true\n};\nvar specialPropKeyWarningShown;\nvar specialPropRefWarningShown;\nvar didWarnAboutStringRefs;\n\n{\n didWarnAboutStringRefs = {};\n}\n\nfunction hasValidRef(config) {\n {\n if (hasOwnProperty.call(config, 'ref')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.ref !== undefined;\n}\n\nfunction hasValidKey(config) {\n {\n if (hasOwnProperty.call(config, 'key')) {\n var getter = Object.getOwnPropertyDescriptor(config, 'key').get;\n\n if (getter && getter.isReactWarning) {\n return false;\n }\n }\n }\n\n return config.key !== undefined;\n}\n\nfunction warnIfStringRefCannotBeAutoConverted(config, self) {\n {\n if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {\n var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);\n\n if (!didWarnAboutStringRefs[componentName]) {\n error('Component \"%s\" contains the string ref \"%s\". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);\n\n didWarnAboutStringRefs[componentName] = true;\n }\n }\n }\n}\n\nfunction defineKeyPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingKey = function () {\n if (!specialPropKeyWarningShown) {\n specialPropKeyWarningShown = true;\n\n error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingKey.isReactWarning = true;\n Object.defineProperty(props, 'key', {\n get: warnAboutAccessingKey,\n configurable: true\n });\n }\n}\n\nfunction defineRefPropWarningGetter(props, displayName) {\n {\n var warnAboutAccessingRef = function () {\n if (!specialPropRefWarningShown) {\n specialPropRefWarningShown = true;\n\n error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);\n }\n };\n\n warnAboutAccessingRef.isReactWarning = true;\n Object.defineProperty(props, 'ref', {\n get: warnAboutAccessingRef,\n configurable: true\n });\n }\n}\n/**\n * Factory method to create a new React element. This no longer adheres to\n * the class pattern, so do not use new to call it. Also, instanceof check\n * will not work. Instead test $$typeof field against Symbol.for('react.element') to check\n * if something is a React Element.\n *\n * @param {*} type\n * @param {*} props\n * @param {*} key\n * @param {string|object} ref\n * @param {*} owner\n * @param {*} self A *temporary* helper to detect places where `this` is\n * different from the `owner` when React.createElement is called, so that we\n * can warn. We want to get rid of owner and replace string `ref`s with arrow\n * functions, and as long as `this` and owner are the same, there will be no\n * change in behavior.\n * @param {*} source An annotation object (added by a transpiler or otherwise)\n * indicating filename, line number, and/or other information.\n * @internal\n */\n\n\nvar ReactElement = function (type, key, ref, self, source, owner, props) {\n var element = {\n // This tag allows us to uniquely identify this as a React Element\n $$typeof: REACT_ELEMENT_TYPE,\n // Built-in properties that belong on the element\n type: type,\n key: key,\n ref: ref,\n props: props,\n // Record the component responsible for creating this element.\n _owner: owner\n };\n\n {\n // The validation flag is currently mutative. We put it on\n // an external backing store so that we can freeze the whole object.\n // This can be replaced with a WeakMap once they are implemented in\n // commonly used development environments.\n element._store = {}; // To make comparing ReactElements easier for testing purposes, we make\n // the validation flag non-enumerable (where possible, which should\n // include every environment we run tests in), so the test framework\n // ignores it.\n\n Object.defineProperty(element._store, 'validated', {\n configurable: false,\n enumerable: false,\n writable: true,\n value: false\n }); // self and source are DEV only properties.\n\n Object.defineProperty(element, '_self', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: self\n }); // Two elements created in two different places should be considered\n // equal for testing purposes and therefore we hide it from enumeration.\n\n Object.defineProperty(element, '_source', {\n configurable: false,\n enumerable: false,\n writable: false,\n value: source\n });\n\n if (Object.freeze) {\n Object.freeze(element.props);\n Object.freeze(element);\n }\n }\n\n return element;\n};\n/**\n * https://github.com/reactjs/rfcs/pull/107\n * @param {*} type\n * @param {object} props\n * @param {string} key\n */\n\nfunction jsxDEV(type, config, maybeKey, source, self) {\n {\n var propName; // Reserved names are extracted\n\n var props = {};\n var key = null;\n var ref = null; // Currently, key can be spread in as a prop. This causes a potential\n // issue if key is also explicitly declared (ie. <div {...props} key=\"Hi\" />\n // or <div key=\"Hi\" {...props} /> ). We want to deprecate key spread,\n // but as an intermediary step, we will use jsxDEV for everything except\n // <div {...props} key=\"Hi\" />, because we aren't currently able to tell if\n // key is explicitly declared to be undefined or not.\n\n if (maybeKey !== undefined) {\n {\n checkKeyStringCoercion(maybeKey);\n }\n\n key = '' + maybeKey;\n }\n\n if (hasValidKey(config)) {\n {\n checkKeyStringCoercion(config.key);\n }\n\n key = '' + config.key;\n }\n\n if (hasValidRef(config)) {\n ref = config.ref;\n warnIfStringRefCannotBeAutoConverted(config, self);\n } // Remaining properties are added to a new props object\n\n\n for (propName in config) {\n if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {\n props[propName] = config[propName];\n }\n } // Resolve default props\n\n\n if (type && type.defaultProps) {\n var defaultProps = type.defaultProps;\n\n for (propName in defaultProps) {\n if (props[propName] === undefined) {\n props[propName] = defaultProps[propName];\n }\n }\n }\n\n if (key || ref) {\n var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;\n\n if (key) {\n defineKeyPropWarningGetter(props, displayName);\n }\n\n if (ref) {\n defineRefPropWarningGetter(props, displayName);\n }\n }\n\n return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);\n }\n}\n\nvar ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;\nvar ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction setCurrentlyValidatingElement$1(element) {\n {\n if (element) {\n var owner = element._owner;\n var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);\n ReactDebugCurrentFrame$1.setExtraStackFrame(stack);\n } else {\n ReactDebugCurrentFrame$1.setExtraStackFrame(null);\n }\n }\n}\n\nvar propTypesMisspellWarningShown;\n\n{\n propTypesMisspellWarningShown = false;\n}\n/**\n * Verifies the object is a ReactElement.\n * See https://reactjs.org/docs/react-api.html#isvalidelement\n * @param {?object} object\n * @return {boolean} True if `object` is a ReactElement.\n * @final\n */\n\n\nfunction isValidElement(object) {\n {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n }\n}\n\nfunction getDeclarationErrorAddendum() {\n {\n if (ReactCurrentOwner$1.current) {\n var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);\n\n if (name) {\n return '\\n\\nCheck the render method of `' + name + '`.';\n }\n }\n\n return '';\n }\n}\n\nfunction getSourceInfoErrorAddendum(source) {\n {\n if (source !== undefined) {\n var fileName = source.fileName.replace(/^.*[\\\\\\/]/, '');\n var lineNumber = source.lineNumber;\n return '\\n\\nCheck your code at ' + fileName + ':' + lineNumber + '.';\n }\n\n return '';\n }\n}\n/**\n * Warn if there's no key explicitly set on dynamic arrays of children or\n * object keys are not valid. This allows us to keep track of children between\n * updates.\n */\n\n\nvar ownerHasKeyUseWarning = {};\n\nfunction getCurrentComponentErrorInfo(parentType) {\n {\n var info = getDeclarationErrorAddendum();\n\n if (!info) {\n var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;\n\n if (parentName) {\n info = \"\\n\\nCheck the top-level render call using <\" + parentName + \">.\";\n }\n }\n\n return info;\n }\n}\n/**\n * Warn if the element doesn't have an explicit key assigned to it.\n * This element is in an array. The array could grow and shrink or be\n * reordered. All children that haven't already been validated are required to\n * have a \"key\" property assigned to it. Error statuses are cached so a warning\n * will only be shown once.\n *\n * @internal\n * @param {ReactElement} element Element that requires a key.\n * @param {*} parentType element's parent's type.\n */\n\n\nfunction validateExplicitKey(element, parentType) {\n {\n if (!element._store || element._store.validated || element.key != null) {\n return;\n }\n\n element._store.validated = true;\n var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);\n\n if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {\n return;\n }\n\n ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a\n // property, it may be the creator of the child that's responsible for\n // assigning it a key.\n\n var childOwner = '';\n\n if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {\n // Give the component that originally created this child.\n childOwner = \" It was passed a child from \" + getComponentNameFromType(element._owner.type) + \".\";\n }\n\n setCurrentlyValidatingElement$1(element);\n\n error('Each child in a list should have a unique \"key\" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);\n\n setCurrentlyValidatingElement$1(null);\n }\n}\n/**\n * Ensure that every element either is passed in a static location, in an\n * array with an explicit keys property defined, or in an object literal\n * with valid key property.\n *\n * @internal\n * @param {ReactNode} node Statically passed child of any type.\n * @param {*} parentType node's parent's type.\n */\n\n\nfunction validateChildKeys(node, parentType) {\n {\n if (typeof node !== 'object') {\n return;\n }\n\n if (isArray(node)) {\n for (var i = 0; i < node.length; i++) {\n var child = node[i];\n\n if (isValidElement(child)) {\n validateExplicitKey(child, parentType);\n }\n }\n } else if (isValidElement(node)) {\n // This element was passed in a valid location.\n if (node._store) {\n node._store.validated = true;\n }\n } else if (node) {\n var iteratorFn = getIteratorFn(node);\n\n if (typeof iteratorFn === 'function') {\n // Entry iterators used to provide implicit keys,\n // but now we print a separate warning for them later.\n if (iteratorFn !== node.entries) {\n var iterator = iteratorFn.call(node);\n var step;\n\n while (!(step = iterator.next()).done) {\n if (isValidElement(step.value)) {\n validateExplicitKey(step.value, parentType);\n }\n }\n }\n }\n }\n }\n}\n/**\n * Given an element, validate that its props follow the propTypes definition,\n * provided by the type.\n *\n * @param {ReactElement} element\n */\n\n\nfunction validatePropTypes(element) {\n {\n var type = element.type;\n\n if (type === null || type === undefined || typeof type === 'string') {\n return;\n }\n\n var propTypes;\n\n if (typeof type === 'function') {\n propTypes = type.propTypes;\n } else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.\n // Inner props are checked in the reconciler.\n type.$$typeof === REACT_MEMO_TYPE)) {\n propTypes = type.propTypes;\n } else {\n return;\n }\n\n if (propTypes) {\n // Intentionally inside to avoid triggering lazy initializers:\n var name = getComponentNameFromType(type);\n checkPropTypes(propTypes, element.props, 'prop', name, element);\n } else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {\n propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:\n\n var _name = getComponentNameFromType(type);\n\n error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');\n }\n\n if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {\n error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');\n }\n }\n}\n/**\n * Given a fragment, validate that it can only be provided with fragment props\n * @param {ReactElement} fragment\n */\n\n\nfunction validateFragmentProps(fragment) {\n {\n var keys = Object.keys(fragment.props);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n\n if (key !== 'children' && key !== 'key') {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);\n\n setCurrentlyValidatingElement$1(null);\n break;\n }\n }\n\n if (fragment.ref !== null) {\n setCurrentlyValidatingElement$1(fragment);\n\n error('Invalid attribute `ref` supplied to `React.Fragment`.');\n\n setCurrentlyValidatingElement$1(null);\n }\n }\n}\n\nvar didWarnAboutKeySpread = {};\nfunction jsxWithValidation(type, props, key, isStaticChildren, source, self) {\n {\n var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to\n // succeed and there will likely be errors in render.\n\n if (!validType) {\n var info = '';\n\n if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {\n info += ' You likely forgot to export your component from the file ' + \"it's defined in, or you might have mixed up default and named imports.\";\n }\n\n var sourceInfo = getSourceInfoErrorAddendum(source);\n\n if (sourceInfo) {\n info += sourceInfo;\n } else {\n info += getDeclarationErrorAddendum();\n }\n\n var typeString;\n\n if (type === null) {\n typeString = 'null';\n } else if (isArray(type)) {\n typeString = 'array';\n } else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {\n typeString = \"<\" + (getComponentNameFromType(type.type) || 'Unknown') + \" />\";\n info = ' Did you accidentally export a JSX literal instead of a component?';\n } else {\n typeString = typeof type;\n }\n\n error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);\n }\n\n var element = jsxDEV(type, props, key, source, self); // The result can be nullish if a mock or a custom function is used.\n // TODO: Drop this when these are no longer allowed as the type argument.\n\n if (element == null) {\n return element;\n } // Skip key warning if the type isn't valid since our key validation logic\n // doesn't expect a non-string/function type and can throw confusing errors.\n // We don't want exception behavior to differ between dev and prod.\n // (Rendering will throw with a helpful message and as soon as the type is\n // fixed, the key warnings will appear.)\n\n\n if (validType) {\n var children = props.children;\n\n if (children !== undefined) {\n if (isStaticChildren) {\n if (isArray(children)) {\n for (var i = 0; i < children.length; i++) {\n validateChildKeys(children[i], type);\n }\n\n if (Object.freeze) {\n Object.freeze(children);\n }\n } else {\n error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');\n }\n } else {\n validateChildKeys(children, type);\n }\n }\n }\n\n {\n if (hasOwnProperty.call(props, 'key')) {\n var componentName = getComponentNameFromType(type);\n var keys = Object.keys(props).filter(function (k) {\n return k !== 'key';\n });\n var beforeExample = keys.length > 0 ? '{key: someKey, ' + keys.join(': ..., ') + ': ...}' : '{key: someKey}';\n\n if (!didWarnAboutKeySpread[componentName + beforeExample]) {\n var afterExample = keys.length > 0 ? '{' + keys.join(': ..., ') + ': ...}' : '{}';\n\n error('A props object containing a \"key\" prop is being spread into JSX:\\n' + ' let props = %s;\\n' + ' <%s {...props} />\\n' + 'React keys must be passed directly to JSX without using spread:\\n' + ' let props = %s;\\n' + ' <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);\n\n didWarnAboutKeySpread[componentName + beforeExample] = true;\n }\n }\n }\n\n if (type === REACT_FRAGMENT_TYPE) {\n validateFragmentProps(element);\n } else {\n validatePropTypes(element);\n }\n\n return element;\n }\n} // These two functions exist to still get child warnings in dev\n// even with the prod transform. This means that jsxDEV is purely\n// opt-in behavior for better messages but that we won't stop\n// giving you warnings if you use production apis.\n\nfunction jsxWithValidationStatic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, true);\n }\n}\nfunction jsxWithValidationDynamic(type, props, key) {\n {\n return jsxWithValidation(type, props, key, false);\n }\n}\n\nvar jsx = jsxWithValidationDynamic ; // we may want to special case jsxs internally to take advantage of static children.\n// for now we can ship identical prod functions\n\nvar jsxs = jsxWithValidationStatic ;\n\nexports.Fragment = REACT_FRAGMENT_TYPE;\nexports.jsx = jsx;\nexports.jsxs = jsxs;\n })();\n}\n", "'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-jsx-runtime.production.min.js');\n} else {\n module.exports = require('./cjs/react-jsx-runtime.development.js');\n}\n", "/**\n * Preload bridge for the main window, settings window, settings overlay\n * view, and popover overlay view. Exposes a minimal, typed `window.devtools`\n * surface so the renderer never has to call `window.require('electron')`.\n *\n * This file is bundled by esbuild to CJS at `dist/preload/windows/main.js`\n * (see package.json `build:preload`). It must remain a leaf module \u2014 do\n * NOT import other preload files via `.js` ESM specifiers; everything goes\n * through the Electron `contextBridge` / `ipcRenderer` runtime.\n *\n * Channel governance lives in the main process: `sender-policy.ts` plus the\n * per-handler zod schemas decide what's accepted. The preload layer is a\n * thin pass-through \u2014 a renderer inventing channel names will just hit a\n * main-side rejection, so duplicating an allowlist here added no real\n * defense for a devtool that loads user-trusted mini-programs.\n */\nimport { contextBridge, ipcRenderer, type IpcRendererEvent } from 'electron'\nimport { BRIDGE_CHANNELS as C, SIMULATOR_EVENTS as E } from '../../shared/bridge-channels.js'\nimport type {\n ApiCallPayload,\n ApiResponsePayload,\n} from '../../shared/bridge-channels.js'\nimport { runApiAsync } from '../runtime/main-api-runner.js'\nimport { simulatorApis } from '../../simulator/simulator-api.js'\n\nconst api = {\n ipc: {\n invoke: (channel: string, ...args: unknown[]) => ipcRenderer.invoke(channel, ...args),\n // Synchronous round-trip. Blocks the renderer until the main process sets\n // `event.returnValue` \u2014 used only for the editor's beforeunload flush, where\n // the write MUST land before the page is torn down (an async invoke can't).\n sendSync: (channel: string, ...args: unknown[]) => ipcRenderer.sendSync(channel, ...args),\n send: (channel: string, ...args: unknown[]) => {\n ipcRenderer.send(channel, ...args)\n },\n on: (\n channel: string,\n listener: (event: IpcRendererEvent, ...args: unknown[]) => void,\n ) => {\n ipcRenderer.on(channel, listener)\n return () => ipcRenderer.removeListener(channel, listener)\n },\n once: (\n channel: string,\n listener: (event: IpcRendererEvent, ...args: unknown[]) => void,\n ) => {\n ipcRenderer.once(channel, listener)\n },\n removeListener: (\n channel: string,\n listener: (...args: unknown[]) => void,\n ) => {\n ipcRenderer.removeListener(channel, listener)\n },\n },\n}\n\n// All host windows that load this preload run with `contextIsolation: true`\n// (main / settings / view-manager), so `contextBridge` is the path that\n// reaches the renderer's `window`. The simulator <webview> uses a separate\n// preload (`simulator.ts`).\ncontextBridge.exposeInMainWorld('devtools', api)\n\n// Native-host fallback: bridge-router forwards any invokeAPI name not\n// registered in `ctx.simulatorApis` to the simulator's webContents via\n// E.API_CALL. When the *main* window doubles as the simulator (the default\n// path for e2e callers that drive `dmb:spawn` without an explicit\n// simulatorWcId), the listener must live here in the main-window preload\n// because the renderer side has no DeviceShell mounted to install one.\nipcRenderer.on(E.API_CALL, (_event, payload: ApiCallPayload) => {\n void runApiAsync(\n simulatorApis as Record<string, (this: unknown, params?: unknown) => unknown | Promise<unknown>>,\n payload.name,\n payload.params,\n ).then((verdict) => {\n const ack: ApiResponsePayload = {\n appSessionId: payload.appSessionId,\n requestId: payload.requestId,\n ok: verdict.ok,\n result: verdict.result,\n errMsg: verdict.errMsg,\n }\n ipcRenderer.send(C.API_RESPONSE, ack)\n })\n})\n\n// Test-only hatch: e2e helpers emit synthetic IPC events on the renderer's\n// ipcRenderer instance to trigger handlers registered via `devtools.ipc.on`\n// without round-tripping through the main process. Gated on NODE_ENV so\n// production builds never expose it.\nif (process.env.NODE_ENV === 'test') {\n contextBridge.exposeInMainWorld('__testIpc', {\n emit: (channel: string, ...args: unknown[]) => {\n ;(ipcRenderer as unknown as { emit: (c: string, ...a: unknown[]) => void }).emit(channel, ...args)\n },\n })\n}\n\nexport type DevtoolsApi = typeof api\n", "/**\n * The window information every mini-program surface reports, and the single\n * derivation that turns a selected device into it.\n *\n * Kept out of `bridge-channels.ts` so the sync service-host binding, the async\n * simulator handler and the per-spawn host-env all import the derivation from\n * one leaf module with no channel/protocol dependencies.\n */\nimport type { DeviceOrientation, NativeDeviceInfo, SafeAreaInsets } from './runtime-types.js'\n\n/**\n * The page area as a SCREEN-coordinate rect: `right`/`bottom` are measured\n * from the screen origin (not from the far edge), matching WeChat's\n * `safeArea` and dimina's native containers (iOS `DMPUIManager.swift`).\n */\nexport interface SafeAreaRect {\n left: number\n top: number\n right: number\n bottom: number\n width: number\n height: number\n}\n\nexport interface HostEnvSnapshot {\n brand: string\n model: string\n platform: string\n system: string\n version: string\n SDKVersion: string\n pixelRatio: number\n screenWidth: number\n screenHeight: number\n windowWidth: number\n windowHeight: number\n statusBarHeight: number\n language: string\n theme: string\n safeAreaInsets?: SafeAreaInsets\n deviceOrientation?: DeviceOrientation\n safeArea?: SafeAreaRect\n /** Screen-coordinate top of the window \u2014 the status bar height. Distinct\n * from `safeArea.top`: a device can draw its status bar shorter than the\n * cutout inset it sits in. */\n screenTop?: number\n [key: string]: unknown\n}\n\n/**\n * The ONE place a device's numbers become window metrics. Every mini-program\n * surface that answers `wx.getWindowInfo` / `getSystemInfo(Sync)` \u2014 the sync\n * service-host binding, the async simulator-resident handler, the per-spawn\n * host-env \u2014 carries this result rather than deriving its own, so the three\n * can't disagree.\n *\n * `windowHeight` is the screen minus BOTH vertical safe-area insets, which is\n * what dimina's native containers report (iOS `DMPUIManager.swift`, Android\n * `Utils.kt`, Harmony `DMPDeviceUtils.ets`); the status bar overlays the page\n * rather than shrinking it. `windowWidth` has no horizontal chrome. Zoom is\n * intentionally absent \u2014 it is a display scale, not a logical-size change.\n */\nexport function deviceInfoToHostEnv(d: NativeDeviceInfo): Partial<HostEnvSnapshot> {\n const insets = d.safeAreaInsets\n const windowHeight = Math.max(0, d.screenHeight - insets.top - insets.bottom)\n const left = insets.left\n const right = d.screenWidth - insets.right\n return {\n brand: d.brand,\n model: d.model,\n system: d.system,\n platform: d.platform,\n pixelRatio: d.pixelRatio,\n screenWidth: d.screenWidth,\n screenHeight: d.screenHeight,\n windowWidth: d.screenWidth,\n windowHeight,\n statusBarHeight: d.statusBarHeight,\n safeAreaInsets: insets,\n deviceOrientation: d.orientation,\n safeArea: {\n left,\n top: insets.top,\n right,\n bottom: d.screenHeight - insets.bottom,\n width: Math.max(0, right - left),\n height: windowHeight,\n },\n screenTop: d.statusBarHeight,\n }\n}\n\n/** Structurally a `MessageEnvelope` (bridge-channels.ts), spelled out here so\n * this module stays a leaf the protocol file can re-export. */\nexport interface HostEnvUpdateMessage {\n type: 'hostEnvUpdate'\n target: 'service'\n body: { systemInfo: HostEnvSnapshot }\n}\n\n/**\n * The `hostEnvUpdate` envelope dimina's service runtime consumes\n * (`fe/packages/service/src/index.js` \u2192 `hostEnv.update(patch)`): the envelope\n * body IS the patch, so the full merged snapshot rides under `systemInfo`.\n * Pure \u2014 the caller owns storing the merged snapshot so a later spawn seeds\n * from the same values this pushed to the running service.\n */\nexport function makeHostEnvUpdateMessage(\n prev: HostEnvSnapshot,\n device: NativeDeviceInfo,\n): HostEnvUpdateMessage {\n return {\n type: 'hostEnvUpdate',\n target: 'service',\n body: { systemInfo: { ...prev, ...deviceInfoToHostEnv(device) } },\n }\n}\n", "import type { NativeDeviceInfo } from './runtime-types.js'\nimport type { HostEnvSnapshot } from './host-env.js'\n\nexport * from './host-env.js'\n\nexport const BRIDGE_CHANNELS = {\n SPAWN: 'dmb:spawn',\n DISPOSE: 'dmb:dispose',\n PAGE_OPEN: 'dmb:page:open',\n PAGE_CLOSE: 'dmb:page:close',\n PAGE_LIFECYCLE: 'dmb:page:lifecycle',\n NAV_CALLBACK: 'dmb:nav:callback',\n SERVICE_INVOKE: 'dmb:service:invoke',\n SERVICE_PUBLISH: 'dmb:service:publish',\n RENDER_INVOKE: 'dmb:render:invoke',\n RENDER_PUBLISH: 'dmb:render:publish',\n TO_SERVICE: 'dmb:to-service',\n TO_RENDER: 'dmb:to-render',\n SIMULATOR_API: 'dmb:simulator-api',\n /** simulator \u2192 main: ack of an API_CALL request (carries success/fail args). */\n API_RESPONSE: 'dmb:api:response',\n /**\n * simulator webview preload \u2192 main (sendSync): \"is native-host mode on?\".\n * The guest preload can't read the launch `process.env`, so it asks main\n * (which can) at install time. Reply is `e.returnValue = boolean`.\n */\n NATIVE_HOST_ENABLED: 'dmb:native-host-enabled',\n /**\n * simulator (DeviceShell) \u2192 main: the visible top-of-stack page bridgeId.\n * Main has no z-order concept \u2014 the active page lives only in DeviceShell's\n * ShellState \u2014 so devtools panels / automation that must target \"the current\n * page's render webContents\" resolve it through this signal. Fire-and-forget.\n */\n ACTIVE_PAGE: 'dmb:active-page',\n /**\n * simulator (DeviceShell) \u2192 main: the FULL ordered page stack (bottom\u2192top)\n * whenever it changes. Main has no stack of its own (it only learns the\n * active bridgeId via ACTIVE_PAGE), so automation's `App.getPageStack` needs\n * this to report multi-page stacks. Fire-and-forget.\n */\n PAGE_STACK: 'dmb:page-stack',\n} as const\n\nexport const SIMULATOR_EVENTS = {\n DOM_READY: 'simulator:dom-ready',\n NAV_BAR: 'simulator:navigation-bar',\n NAV_ACTION: 'simulator:nav-action',\n TAB_ACTION: 'simulator:tab-action',\n /** main \u2192 simulator: invoke a wx.* API on the simulator-resident MiniApp. */\n API_CALL: 'simulator:api-call',\n /**\n * main \u2192 simulator: the renderer toolbar picked a different device. Carries a\n * NativeDeviceInfo; DeviceShell resizes the bezel + re-renders status bar /\n * notch. The race-free INITIAL device rides NativeHostConfig.device (read\n * synchronously at preload bridge-install); this event covers live changes.\n */\n DEVICE_CHANGE: 'simulator:device-change',\n /**\n * main \u2192 simulator: a watcher rebuild finished; boot a NEW app session for\n * the carried url ({@link RelaunchPayload}) IN PLACE, keeping the live\n * DeviceShell painted, and swap once the new session's root page reports\n * DOM_READY (ready-then-swap soft reload). Main sends this only when the\n * shell is live+ready; otherwise the renderer falls back to the hard\n * attachNativeSimulator rebuild.\n */\n RELAUNCH: 'simulator:relaunch',\n} as const\n\n/** Native simulator preload \u2194 owning Electron main-process custom API bridge. */\nexport const SimulatorCustomApiBridgeChannel = {\n Request: 'simulator:custom-apis:bridge-request',\n Response: 'simulator:custom-apis:bridge-response',\n} as const\n\n/**\n * `simulator:relaunch` payload. `url` is a full simulator URL (same format as\n * the simulator page's own location / AttachNative), carrying the appId and\n * the page route the new session must boot at.\n */\nexport interface RelaunchPayload {\n url: string\n}\n\nexport const CHANNELS = BRIDGE_CHANNELS\n\n/**\n * Reply to a `NATIVE_HOST_ENABLED` sendSync. Main supplies render-host asset\n * URLs (preload still needs a `file://` path for the guest preload script).\n * The pageFrame document itself is built per-bridge as `dmb-resource://\u2026`\n * via `buildRenderHostDocumentUrl` \u2014 `renderHostHtmlUrl` is only a legacy\n * placeholder kept for the config shape.\n */\nexport interface NativeHostConfig {\n enabled: boolean\n renderHostHtmlUrl: string\n renderPreloadUrl: string\n /**\n * The currently-selected device, if the renderer already pushed it before the\n * simulator WCV's preload installed (it does \u2014 SetDeviceInfo precedes\n * AttachNative). DeviceShell reads this as its initial device so it never\n * mounts with the wrong bezel size while waiting for the first DEVICE_CHANGE.\n * Absent only on the pre-spawn default path.\n */\n device?: NativeDeviceInfo\n}\n\nexport type BridgeChannel = typeof BRIDGE_CHANNELS[keyof typeof BRIDGE_CHANNELS]\n\nexport type BridgeTarget = 'service' | 'render' | 'container'\n\nexport type BridgeMessageType =\n | 'loadResource'\n | 'serviceResourceLoaded'\n | 'renderResourceLoaded'\n | 'resourceLoaded'\n | 'firstRender'\n | 'appShow'\n | 'appHide'\n | 'stackShow'\n | 'stackHide'\n | 'pageShow'\n | 'pageHide'\n | 'pageReady'\n | 'pageUnload'\n | 'pageScroll'\n | 'pageResize'\n | 'pageRouteDone'\n | 'hostEnvUpdate' // Main \u2192 service: full HostEnvSnapshot after setDevice(), since hostEnv is otherwise frozen at spawn\n | 'mC'\n | 'mR'\n | 'mU'\n | 't'\n | 'u'\n | 'ub'\n | 'triggerCallback'\n | 'invokeAPI'\n | 'h5SdkAction'\n | 'componentError'\n | 'domReady'\n | 'print'\n | 'renderHostReady'\n | 'serviceHostError'\n | string\n\nexport interface MessageEnvelope<TBody extends Record<string, unknown> = Record<string, unknown>> {\n type: BridgeMessageType\n target: BridgeTarget\n body: TBody\n}\n\n/**\n * Subset of WeChat page `window` config plus tabBar list, parsed from\n * `app-config.json` (`{app:{window,tabBar,pages,entryPagePath}, modules:{[pagePath]:{...flat page.json fields,root?}}}`).\n * `modules[pagePath]` is FLAT \u2014 the compiler assigns the page's own `.json` file\n * content as-is (see `dimina/fe/packages/compiler/src/env.js` `collectionPageJson()`),\n * not wrapped under a `.window` key. Mirrors mergePageConfig in dimina-fe:\n * page-level keys override app-level.\n */\nexport interface PageWindowConfig {\n navigationBarTitleText?: string\n navigationBarBackgroundColor?: string\n navigationBarTextStyle?: 'black' | 'white'\n navigationStyle?: 'default' | 'custom'\n homeButton?: boolean\n backgroundColor?: string\n backgroundTextStyle?: 'dark' | 'light'\n enablePullDownRefresh?: boolean\n disableScroll?: boolean\n [key: string]: unknown\n}\n\nexport interface TabBarItem {\n pagePath: string\n text?: string\n iconPath?: string\n selectedIconPath?: string\n}\n\nexport interface TabBarConfig {\n color?: string\n selectedColor?: string\n backgroundColor?: string\n borderStyle?: 'black' | 'white'\n position?: 'bottom' | 'top'\n custom?: boolean\n list: TabBarItem[]\n}\n\nexport interface AppManifest {\n entryPagePath: string\n pages: string[]\n tabBar?: TabBarConfig\n /**\n * Provenance of this manifest: `'app-config'` when built from a real\n * compiled `app-config.json` (its `pages` list is authoritative, so mount\n * gates can validate membership against it); `'fallback'` when\n * app-config.json was unreachable and the manifest is a single-page stand-in\n * built from the spawn request. Mount gates only enforce against\n * `'app-config'` \u2014 a `'fallback'` manifest has no compiled truth to check\n * membership against, so it must let every page/nav target through.\n */\n source: 'app-config' | 'fallback'\n}\n\nexport interface SpawnRequest {\n simulatorWcId?: number\n appId: string\n bridgeId?: string\n pagePath?: string\n scene?: number\n query?: Record<string, unknown>\n apiNamespaces?: string[]\n hostEnvSnapshot?: Partial<HostEnvSnapshot>\n pkgRoot?: string\n root?: string\n /**\n * Base URL of the dev server that serves the compiled mini-app, i.e. the\n * SAME origin the simulator page was loaded from (`http://localhost:<port>/`).\n * The dev server statically serves `<appId>/<root>/\u2026` (app-config.json,\n * logic.js, page bundles, styles) \u2014 exactly what the default dimina-fe\n * `<webview>` fetches. The native-host render + service hosts source every\n * resource from here, so we don't need a second resource server or a local\n * compiled-output path. Trailing slash expected.\n */\n resourceBaseUrl?: string\n}\n\nexport interface SpawnResult {\n appSessionId: string\n bridgeId: string\n /** The pagePath originally requested (unchanged even when a fallback applied \u2014 see `resolvedPagePath`). */\n pagePath: string\n /**\n * The pagePath the root PageSession was ACTUALLY spawned with. Equal to\n * `pagePath` unless `pageFallbackApplied` is true, in which case the request\n * was absent from `manifest.pages` and this is `manifest.entryPagePath`\n * (or `manifest.pages[0]` when even that isn't a member). Callers that cache\n * \"the current page\" (e.g. `SimulatorMiniApp`) must reconcile against this,\n * not the original request.\n */\n resolvedPagePath: string\n /** Whether `resolvedPagePath` differs from the request because it was absent from the compiled manifest. Always false for a `'fallback'` manifest (nothing to validate against). */\n pageFallbackApplied: boolean\n serviceWcId: number\n resourceBaseUrl: string\n /** The page's resource root inside the mini-app package (e.g. `'main'`). Threaded to `createRenderHostUrl` so the render-host document URL can encode it \u2014 see `dmb-resource-url.ts`. */\n root: string\n manifest: AppManifest\n rootWindowConfig: PageWindowConfig\n}\n\nexport interface PageOpenRequest {\n appSessionId: string\n pagePath: string\n query?: Record<string, unknown>\n bridgeId?: string\n}\n\nexport interface PageOpenResult {\n bridgeId: string\n pagePath: string\n windowConfig: PageWindowConfig\n isTab: boolean\n}\n\nexport interface PageClosePayload {\n bridgeId: string\n}\n\nexport interface DisposePayload {\n /** AppSession root bridgeId (legacy) or any page bridgeId. */\n bridgeId: string\n}\n\nexport type PageLifecycleEvent =\n | 'pageShow'\n | 'pageHide'\n | 'pageUnload'\n | 'stackShow'\n | 'stackHide'\n | 'appShow'\n | 'appHide'\n\nexport interface PageLifecyclePayload {\n appSessionId: string\n bridgeId: string\n event: PageLifecycleEvent\n}\n\n/**\n * Sent by simulator after a routing action (navigateTo etc.) completes so the\n * main process can call sendCallback() against the original service-issued\n * success/fail/complete ids.\n */\nexport interface NavCallbackPayload {\n appSessionId: string\n ok: boolean\n errMsg: string\n callbacks: { success?: unknown; fail?: unknown; complete?: unknown }\n}\n\n/**\n * `dmb:service:invoke` \u2014 service host \u2192 main.\n *\n * Carries no source page id on purpose. One service host serves a session's\n * whole page stack and outlives any single page in it, so it has no page\n * identity to stamp; the sending webContents identifies the app session, and a\n * message that concerns one page names it in `msg.body.bridgeId`.\n */\nexport interface ServiceInvokePayload {\n msg: MessageEnvelope\n}\n\n/**\n * `dmb:service:publish` \u2014 service host \u2192 main, forwarded to a render guest.\n * `targetBridgeId` names the destination page. No source page id, for the same\n * reason as `ServiceInvokePayload`.\n */\nexport interface ServicePublishPayload {\n targetBridgeId?: string\n msg: MessageEnvelope\n}\n\n/**\n * `dmb:active-page` \u2014 simulator (DeviceShell) \u2192 main. Records which page is the\n * visible top-of-stack so main-side services (WXML/element-inspect, automation)\n * can resolve \"the active page's render webContents\" by bridgeId.\n */\nexport interface ActivePagePayload {\n appSessionId: string\n bridgeId: string\n}\n\n/**\n * `dmb:page-stack` \u2014 simulator (DeviceShell) \u2192 main. The full ordered page\n * stack (bottom\u2192top) so `App.getPageStack` can report multi-page stacks.\n */\nexport interface PageStackEntry {\n pagePath: string\n query: Record<string, unknown>\n}\n\nexport interface PageStackPayload {\n appSessionId: string\n stack: PageStackEntry[]\n}\n\nexport interface RenderInvokePayload {\n bridgeId: string\n msg: MessageEnvelope\n}\n\nexport interface RenderPublishPayload {\n bridgeId: string\n msg: MessageEnvelope\n}\n\nexport interface ToServicePayload {\n msg: MessageEnvelope\n}\n\nexport interface ToRenderPayload {\n msg: MessageEnvelope\n}\n\nexport interface SimulatorApiInvokePayload {\n bridgeId: string\n name: string\n params: unknown\n}\n\n/**\n * `simulator:nav-action` \u2014 main \u2192 simulator window, carries router/tabBar\n * intentions. Simulator owns the visual stack state and decides whether to\n * push/pop webviews; it then calls back PAGE_LIFECYCLE + NAV_CALLBACK.\n */\nexport interface NavActionPayload {\n appSessionId: string\n bridgeId: string\n name: 'navigateTo' | 'navigateBack' | 'redirectTo' | 'reLaunch' | 'switchTab'\n params: Record<string, unknown>\n callbacks: { success?: unknown; fail?: unknown; complete?: unknown }\n}\n\n/**\n * `simulator:api-call` \u2014 main \u2192 simulator. Fallback path used when an\n * invokeAPI name is not registered in the main-process `ctx.simulatorApis`\n * registry: the simulator-resident MiniApp owns the wx.* handler (it can\n * read DOM, open file pickers, etc.), so we forward the call there and wait\n * for an `API_RESPONSE` ack.\n */\nexport interface ApiCallPayload {\n appSessionId: string\n bridgeId: string\n requestId: string\n name: string\n params: Record<string, unknown>\n callbacks: { success?: unknown; fail?: unknown; complete?: unknown }\n}\n\n/**\n * `dmb:api:response` \u2014 simulator \u2192 main. Ack for an `API_CALL`. Main looks\n * up `requestId` in its pending map and fires the original service-side\n * success/fail/complete callbacks accordingly.\n */\nexport interface ApiResponsePayload {\n appSessionId: string\n requestId: string\n ok: boolean\n /** Argument the simulator-side success/fail callback was invoked with. */\n result?: unknown\n errMsg?: string\n /**\n * Persistent-subscription marker (`keep: true` APIs, e.g.\n * `audioListen`). When set, this response is one of potentially many\n * fires of the same subscription: main re-fires the service-side success\n * callback but keeps the pendingApiCall alive (does not delete it or fire\n * `complete`) so subsequent fires of the same `requestId` are delivered.\n * Cleanup happens on page/app teardown instead.\n */\n keep?: boolean\n /**\n * Handler-received acknowledgement. The simulator sends this as soon as it\n * has located a live handler for the forwarded call \u2014 before the handler\n * produces its verdict. Main disarms the no-handler watchdog but keeps the\n * pending call alive: a slow operation (large disk write, a modal waiting\n * on the user) must not be reported failed while the underlying work still\n * completes. No service-side callback fires for an ack.\n */\n ack?: boolean\n}\n\n/**\n * `simulator:tab-action` \u2014 main \u2192 simulator window, carries dynamic TabBar\n * API calls. Simulator updates TabBar React state and acknowledges via\n * NAV_CALLBACK so the service-side wx.* callback fires.\n */\nexport interface TabActionPayload {\n appSessionId: string\n bridgeId: string\n name:\n | 'setTabBarStyle'\n | 'setTabBarItem'\n | 'showTabBar'\n | 'hideTabBar'\n | 'setTabBarBadge'\n | 'removeTabBarBadge'\n | 'showTabBarRedDot'\n | 'hideTabBarRedDot'\n params: Record<string, unknown>\n callbacks: { success?: unknown; fail?: unknown; complete?: unknown }\n}\n", "/**\n * Native-host API_CALL handler installed inside the main-window preload.\n *\n * Goal: let the main devtools window double as a simulator when the\n * bridge-router forwards `simulator:api-call` to its webContents (the\n * default path in e2e tests, where `dmb:spawn` is invoked from mainWindow\n * directly with no explicit `simulatorWcId`).\n *\n * Unlike `simulator/main.tsx` (which boots a full DeviceShell + SimulatorMiniApp),\n * this runner is renderer-agnostic: it just owns a name\u2192handler table plus\n * a sentinel-based callback capture identical in shape to the simulator's\n * `runApiAsync`. The MiniAppContext stub it constructs is the smallest one\n * the built-in handlers expect (`appId`, `createCallbackFunction`, parent\n * with `el.querySelector` returning the simulated viewport rect).\n */\nimport type { MiniAppContext } from '../../simulator/types.js'\n\n// No `this` parameter: handlers are always invoked through `.call(ctx, \u2026)`\n// below with an explicit context object, so the declared type never needs to\n// constrain (or widen away) the caller's `this`.\ntype LooseApiHandler = (params?: unknown) => unknown | Promise<unknown>\n\nexport interface ApiRunVerdict {\n ok: boolean\n result?: unknown\n errMsg?: string\n}\n\ninterface ApiRunnerContext extends MiniAppContext {\n /** Dummy properties some upstream handlers introspect. */\n appId: string\n}\n\nfunction makeBaseContext(): ApiRunnerContext {\n // Minimal viewport rect: enough for handlers that read\n // `parent.el.querySelector('.dimina-native-webview__root').getBoundingClientRect()`\n // (see simulator-api.ts readWindowMetrics).\n const fakeRect = { width: 390, height: 844, x: 0, y: 0, top: 0, left: 0, right: 390, bottom: 844 }\n const fakeRoot = {\n getBoundingClientRect: () => fakeRect,\n } as unknown as Element\n return {\n appId: '',\n createCallbackFunction: () => undefined,\n parent: {\n el: {\n querySelector: () => fakeRoot,\n } as unknown as Element,\n getStatusBarRect: () => ({ height: 0 }),\n },\n }\n}\n\nexport function runApiAsync(\n handlers: Record<string, LooseApiHandler | undefined>,\n name: string,\n params: unknown,\n): Promise<ApiRunVerdict> {\n const handler = handlers[name]\n if (!handler) {\n return Promise.resolve({ ok: false, errMsg: `${name}:fail no handler` })\n }\n\n return new Promise<ApiRunVerdict>((resolve) => {\n let resolved = false\n const finish = (verdict: ApiRunVerdict): void => {\n if (resolved) return\n resolved = true\n resolve(verdict)\n }\n\n const SUCCESS = Symbol('main-cb-success')\n const FAIL = Symbol('main-cb-fail')\n const COMPLETE = Symbol('main-cb-complete')\n\n const base = makeBaseContext()\n const ctx: ApiRunnerContext = {\n ...base,\n createCallbackFunction(id: unknown) {\n if (id === undefined || id === null) return undefined\n return (...args: unknown[]) => {\n const arg = args[0]\n if (id === SUCCESS) {\n finish({ ok: true, result: arg })\n } else if (id === FAIL) {\n const errMsg =\n arg && typeof arg === 'object' && 'errMsg' in (arg as Record<string, unknown>)\n ? String((arg as { errMsg?: unknown }).errMsg)\n : `${name}:fail`\n finish({ ok: false, errMsg, result: arg })\n }\n }\n },\n }\n\n const userParams =\n params && typeof params === 'object' && !Array.isArray(params)\n ? { ...(params as Record<string, unknown>) }\n : {}\n const hadSuccess = userParams.success !== undefined && userParams.success !== null\n const hadFail = userParams.fail !== undefined && userParams.fail !== null\n const hadComplete = userParams.complete !== undefined && userParams.complete !== null\n\n userParams.success = SUCCESS\n userParams.fail = FAIL\n if (hadComplete) userParams.complete = COMPLETE\n\n try {\n const ret = (handler as LooseApiHandler).call(ctx, userParams)\n if (ret && typeof (ret as PromiseLike<unknown>).then === 'function') {\n Promise.resolve(ret as PromiseLike<unknown>).then(\n (r) => finish({ ok: true, result: r }),\n (err: unknown) => {\n const msg = err instanceof Error ? err.message : String(err)\n finish({ ok: false, errMsg: `${name}:fail ${msg}` })\n },\n )\n return\n }\n if (!hadSuccess && !hadFail) {\n finish({ ok: true, result: ret })\n }\n } catch (err: unknown) {\n const msg = err instanceof Error ? err.message : String(err)\n finish({ ok: false, errMsg: `${name}:fail ${msg}` })\n }\n })\n}\n", "import type { MiniAppContext } from './types'\n\n/**\n * Resolve the success / fail / complete callbacks of a wx.* API options\n * object in one step. Each runs through ctx.createCallbackFunction so it is\n * invoked with the proper this-binding; a missing option yields undefined.\n */\nexport function bindCallbacks(\n ctx: MiniAppContext,\n opts: { success?: unknown; fail?: unknown; complete?: unknown },\n) {\n return {\n onSuccess: ctx.createCallbackFunction(opts.success),\n onFail: ctx.createCallbackFunction(opts.fail),\n onComplete: ctx.createCallbackFunction(opts.complete),\n }\n}\n\n/**\n * Build a wx.* API stub for a capability the simulator cannot provide. The\n * returned function reports `${apiName}:fail not supported in simulator`\n * through the fail callback, then runs complete.\n */\nexport function notSupportedApi(\n apiName: string,\n): (this: MiniAppContext, opts?: { fail?: unknown; complete?: unknown }) => void {\n return function (this: MiniAppContext, opts: { fail?: unknown; complete?: unknown } = {}) {\n const { onFail, onComplete } = bindCallbacks(this, opts)\n onFail?.({ errMsg: `${apiName}:fail not supported in simulator` })\n onComplete?.()\n }\n}\n", "/**\n * DevTools API stubs for wx.xxx storage APIs (sync + async).\n *\n * Each exported function is bound with `this` = MiniApp instance\n * (via AppManager.registerApi \u2192 MiniApp.invokeApi).\n */\n\nimport type { MiniAppContext } from './types'\nimport { bindCallbacks } from './simulator-api-helpers'\n\n// \u2500\u2500\u2500 shared storage primitives \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n//\n// Every sync/async pair below (set/get/remove/clear/info) shares the same\n// underlying localStorage layout: keys are namespaced per appId, values are\n// JSON-encoded objects / stringified primitives. These helpers are the\n// single authority for that layout so the sync and async variants cannot\n// drift apart.\n\nfunction storageKeyOf(appId: string, key: string): string {\n\treturn `${appId}_${key}`\n}\n\n/** Full (still-prefixed) localStorage keys belonging to `appId`. */\nfunction collectAppKeys(appId: string): string[] {\n\tconst prefix = `${appId}_`\n\tconst keys: string[] = []\n\tfor (let i = 0; i < localStorage.length; i++) {\n\t\tconst k = localStorage.key(i)\n\t\tif (k && k.startsWith(prefix)) keys.push(k)\n\t}\n\treturn keys\n}\n\nfunction writeEntry(appId: string, key: string, data: unknown): void {\n\tconst dataString = typeof data === 'object' ? JSON.stringify(data) : String(data)\n\tlocalStorage.setItem(storageKeyOf(appId, key), dataString)\n}\n\n/** Reads one entry, JSON-parsing when possible. `undefined` means the key was never set \u2014 distinct from a stored empty string. */\nfunction readEntry(appId: string, key: string): { data: unknown } | undefined {\n\tconst raw = localStorage.getItem(storageKeyOf(appId, key))\n\tif (raw === null) return undefined\n\ttry { return { data: JSON.parse(raw) as unknown } } catch { return { data: raw } }\n}\n\nfunction clearAppKeys(appId: string): void {\n\tcollectAppKeys(appId).forEach(k => localStorage.removeItem(k))\n}\n\nfunction storageInfoOf(appId: string): { keys: string[]; currentSize: number; limitSize: number } {\n\tconst prefix = `${appId}_`\n\tconst keys: string[] = []\n\tlet currentSize = 0\n\tfor (const fullKey of collectAppKeys(appId)) {\n\t\tkeys.push(fullKey.slice(prefix.length))\n\t\tconst item = localStorage.getItem(fullKey)\n\t\tcurrentSize += item ? item.length * 2 : 0\n\t}\n\treturn { keys, currentSize, limitSize: 10 * 1024 * 1024 }\n}\n\n// \u2500\u2500\u2500 Storage (sync) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport function setStorageSync(this: MiniAppContext, { key, data }: { key: string; data: unknown }) {\n\twriteEntry(this.appId, key, data)\n}\n\nexport function getStorageSync(this: MiniAppContext, { key }: { key: string }) {\n\t// wx \u771F\u673A: a missing key returns {data: ''}, never undefined or a fail.\n\treturn readEntry(this.appId, key) ?? { data: '' }\n}\n\nexport function removeStorageSync(this: MiniAppContext, { key }: { key: string }) {\n\tlocalStorage.removeItem(storageKeyOf(this.appId, key))\n}\n\nexport function clearStorageSync(this: MiniAppContext) {\n\tclearAppKeys(this.appId)\n}\n\nexport function getStorageInfoSync(this: MiniAppContext) {\n\treturn storageInfoOf(this.appId)\n}\n\n// \u2500\u2500\u2500 Storage (async) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport function setStorage(\n\tthis: MiniAppContext,\n\t{ key, data, success, fail, complete }: { key: string; data: unknown; success?: unknown; fail?: unknown; complete?: unknown },\n) {\n\tconst { onSuccess, onFail, onComplete } = bindCallbacks(this, { success, fail, complete })\n\ttry {\n\t\twriteEntry(this.appId, key, data)\n\t\tonSuccess?.({ errMsg: 'setStorage:ok' })\n\t} catch (e) {\n\t\tonFail?.({ errMsg: `setStorage:fail ${(e as Error).message}` })\n\t}\n\tonComplete?.()\n}\n\nexport function getStorage(\n\tthis: MiniAppContext,\n\t{ key, success, fail, complete }: { key: string; success?: unknown; fail?: unknown; complete?: unknown },\n) {\n\tconst { onSuccess, onFail, onComplete } = bindCallbacks(this, { success, fail, complete })\n\t// Unlike getStorageSync, the async variant fails (not {data: ''}) on a\n\t// missing key \u2014 this is the documented wx.getStorage contract.\n\tconst entry = readEntry(this.appId, key)\n\tif (!entry) {\n\t\tonFail?.({ errMsg: 'getStorage:fail data not found' })\n\t} else {\n\t\tonSuccess?.({ data: entry.data, errMsg: 'getStorage:ok' })\n\t}\n\tonComplete?.()\n}\n\nexport function removeStorage(\n\tthis: MiniAppContext,\n\t{ key, success, fail, complete }: { key: string; success?: unknown; fail?: unknown; complete?: unknown },\n) {\n\tconst { onSuccess, onFail, onComplete } = bindCallbacks(this, { success, fail, complete })\n\ttry {\n\t\tlocalStorage.removeItem(storageKeyOf(this.appId, key))\n\t\tonSuccess?.({ errMsg: 'removeStorage:ok' })\n\t} catch (e) {\n\t\tonFail?.({ errMsg: `removeStorage:fail ${(e as Error).message}` })\n\t}\n\tonComplete?.()\n}\n\nexport function clearStorage(this: MiniAppContext, { success, complete }: { success?: unknown; complete?: unknown } = {}) {\n\tconst { onSuccess, onComplete } = bindCallbacks(this, { success, complete })\n\tclearAppKeys(this.appId)\n\tonSuccess?.({ errMsg: 'clearStorage:ok' })\n\tonComplete?.()\n}\n\nexport function getStorageInfo(this: MiniAppContext, { success, complete }: { success?: unknown; complete?: unknown } = {}) {\n\tconst { onSuccess, onComplete } = bindCallbacks(this, { success, complete })\n\tconst info = storageInfoOf(this.appId)\n\tonSuccess?.({ ...info, errMsg: 'getStorageInfo:ok' })\n\tonComplete?.()\n}\n", "/**\n * DevTools API stubs for device-related wx.xxx APIs\n * (keyboard / phone / contact / vibrate / scan).\n *\n * Each exported function is bound with `this` = MiniApp instance\n * (via AppManager.registerApi \u2192 MiniApp.invokeApi).\n */\n\nimport type { MiniAppContext } from './types'\nimport { bindCallbacks, notSupportedApi } from './simulator-api-helpers'\n\n// \u2500\u2500\u2500 Device: Keyboard \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport function hideKeyboard(this: MiniAppContext, { success, complete }: { success?: unknown; complete?: unknown } = {}) {\n\tconst { onSuccess, onComplete } = bindCallbacks(this, { success, complete })\n\t// In web, blur the active element to dismiss virtual keyboard\n\tif (document.activeElement && typeof (document.activeElement as HTMLElement).blur === 'function') {\n\t\t;(document.activeElement as HTMLElement).blur()\n\t}\n\tonSuccess?.({ errMsg: 'hideKeyboard:ok' })\n\tonComplete?.()\n}\n\nexport function adjustPosition(this: MiniAppContext, { success, complete }: { success?: unknown; complete?: unknown } = {}) {\n\tconst { onSuccess, onComplete } = bindCallbacks(this, { success, complete })\n\tonSuccess?.({ errMsg: 'adjustPosition:ok' })\n\tonComplete?.()\n}\n\n// \u2500\u2500\u2500 Device: Phone \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport function makePhoneCall(\n\tthis: MiniAppContext,\n\t{ phoneNumber, success, fail, complete }: { phoneNumber: string; success?: unknown; fail?: unknown; complete?: unknown },\n) {\n\tconst { onSuccess, onFail, onComplete } = bindCallbacks(this, { success, fail, complete })\n\n\ttry {\n\t\twindow.open(`tel:${phoneNumber}`)\n\t\tonSuccess?.({ errMsg: 'makePhoneCall:ok' })\n\t} catch (error) {\n\t\tonFail?.({ errMsg: `makePhoneCall:fail ${(error as Error).message}` })\n\t}\n\tonComplete?.()\n}\n\n// \u2500\u2500\u2500 Device: Contact (stub) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport const chooseContact = notSupportedApi('chooseContact')\n\nexport const addPhoneContact = notSupportedApi('addPhoneContact')\n\n// \u2500\u2500\u2500 Device: Vibrate (stub) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport function vibrateShort(this: MiniAppContext, { success, complete }: { type?: string; success?: unknown; complete?: unknown } = {}) {\n\tconst { onSuccess, onComplete } = bindCallbacks(this, { success, complete })\n\t// Navigator.vibrate is available in some browsers\n\tif (navigator.vibrate) navigator.vibrate(15)\n\tonSuccess?.({ errMsg: 'vibrateShort:ok' })\n\tonComplete?.()\n}\n\nexport function vibrateLong(this: MiniAppContext, { success, complete }: { success?: unknown; complete?: unknown } = {}) {\n\tconst { onSuccess, onComplete } = bindCallbacks(this, { success, complete })\n\tif (navigator.vibrate) navigator.vibrate(400)\n\tonSuccess?.({ errMsg: 'vibrateLong:ok' })\n\tonComplete?.()\n}\n\n// \u2500\u2500\u2500 Device: Scan (stub) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport const scanCode = notSupportedApi('scanCode')\n\n// \u2500\u2500\u2500 Device: Clipboard \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\ninterface ClipboardBridge {\n\treadText(): string\n\twriteText(text: string): void\n}\n\nfunction getClipboardBridge(): ClipboardBridge | undefined {\n\treturn (window as unknown as Record<string, unknown>).__diminaClipboard as ClipboardBridge | undefined\n}\n\nexport function getClipboardData(\n\tthis: MiniAppContext,\n\t{ success, fail, complete }: { success?: unknown; fail?: unknown; complete?: unknown } = {},\n) {\n\tconst { onSuccess, onFail, onComplete } = bindCallbacks(this, { success, fail, complete })\n\tconst bridge = getClipboardBridge()\n\tif (!bridge) {\n\t\tonFail?.({ errMsg: 'getClipboardData:fail clipboard bridge unavailable' })\n\t\tonComplete?.()\n\t\treturn\n\t}\n\ttry {\n\t\tconst data = bridge.readText()\n\t\tonSuccess?.({ data, errMsg: 'getClipboardData:ok' })\n\t} catch (error: unknown) {\n\t\tonFail?.({ errMsg: `getClipboardData:fail ${(error as Error)?.message ?? error}` })\n\t}\n\tonComplete?.()\n}\n\nexport function setClipboardData(\n\tthis: MiniAppContext,\n\t{ data, success, fail, complete }: { data?: string; success?: unknown; fail?: unknown; complete?: unknown } = {},\n) {\n\tconst { onSuccess, onFail, onComplete } = bindCallbacks(this, { success, fail, complete })\n\tif (typeof data !== 'string') {\n\t\tonFail?.({ errMsg: 'setClipboardData:fail data is required' })\n\t\tonComplete?.()\n\t\treturn\n\t}\n\tconst bridge = getClipboardBridge()\n\tif (!bridge) {\n\t\tonFail?.({ errMsg: 'setClipboardData:fail clipboard bridge unavailable' })\n\t\tonComplete?.()\n\t\treturn\n\t}\n\ttry {\n\t\tbridge.writeText(data)\n\t\tonSuccess?.({ errMsg: 'setClipboardData:ok' })\n\t} catch (error: unknown) {\n\t\tonFail?.({ errMsg: `setClipboardData:fail ${(error as Error)?.message ?? error}` })\n\t}\n\tonComplete?.()\n}\n\n// \u2500\u2500\u2500 Device: Network type \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport type NetworkType = 'wifi' | '2g' | '3g' | '4g' | '5g' | 'none' | 'unknown'\n\ninterface NetworkInfo {\n\tonLine: boolean\n\t/** NetworkInformation.type (e.g. 'wifi' / 'ethernet' / 'cellular'). */\n\ttype?: string\n\t/** NetworkInformation.effectiveType (e.g. '4g' / '3g' / '2g' / 'slow-2g'). */\n\teffectiveType?: string\n}\n\nfunction mapEffectiveType(effectiveType?: string): NetworkType {\n\tswitch (effectiveType) {\n\t\tcase '4g':\n\t\t\treturn '4g'\n\t\tcase '3g':\n\t\t\treturn '3g'\n\t\tcase '2g':\n\t\tcase 'slow-2g':\n\t\t\treturn '2g'\n\t\tdefault:\n\t\t\treturn 'unknown'\n\t}\n}\n\n/**\n * Best-effort map from the browser's NetworkInformation to the WeChat\n * `getNetworkType` vocabulary. The host machine is almost always on wifi or\n * ethernet, so an online connection with no finer signal reports 'wifi'.\n */\nexport function resolveNetworkType(info: NetworkInfo): NetworkType {\n\tif (!info.onLine) return 'none'\n\tif (info.type === 'wifi' || info.type === 'ethernet') return 'wifi'\n\tif (info.type === 'cellular') return mapEffectiveType(info.effectiveType)\n\tif (info.effectiveType) return mapEffectiveType(info.effectiveType)\n\treturn 'wifi'\n}\n\nexport function getNetworkType(\n\tthis: MiniAppContext,\n\t{ success, complete }: { success?: unknown; complete?: unknown } = {},\n) {\n\tconst { onSuccess, onComplete } = bindCallbacks(this, { success, complete })\n\tconst connection = (navigator as Navigator & {\n\t\tconnection?: { type?: string; effectiveType?: string }\n\t}).connection\n\tconst networkType = resolveNetworkType({\n\t\tonLine: navigator.onLine,\n\t\ttype: connection?.type,\n\t\teffectiveType: connection?.effectiveType,\n\t})\n\tonSuccess?.({ networkType, errMsg: 'getNetworkType:ok' })\n\tonComplete?.()\n}\n", "/**\n * Generic DOM-event \u2192 service-callback bridge.\n *\n * Container-side media APIs (audio, and in future recorder / video) need to\n * forward DOM media events on an `HTMLMediaElement` out to the mini-program\n * service layer. This helper centralises the \"bind a set of DOM events, build\n * a typed payload, invoke `fire`, return a disposer\" pattern so each media API\n * does not re-implement it.\n */\n\n/**\n * Builds the payload handed to `fire` for a given mini-program event name.\n * Receives the mini-program event name (already mapped from the DOM name) and\n * the DOM event, and returns the object delivered to the service callback.\n */\nexport type PayloadBuilder<P> = (event: string, domEvent: Event) => P\n\n/** Disposer returned by {@link bindDomEvents}; unbinds every listener. */\nexport type EventBridgeDisposer = () => void\n\n/**\n * Bind a batch of DOM events on `target`.\n *\n * @param target The EventTarget (e.g. an `HTMLAudioElement`) to listen on.\n * @param eventMap Map of DOM event name \u2192 mini-program event name.\n * @param fire The service callback; called once per DOM event with the\n * payload produced by `buildPayload`.\n * @param buildPayload Produces the typed payload for `fire`.\n * @returns A disposer that removes every listener registered by this call.\n */\nexport function bindDomEvents<P>(\n\ttarget: EventTarget,\n\teventMap: Record<string, string>,\n\tfire: (payload: P) => void,\n\tbuildPayload: PayloadBuilder<P>,\n): EventBridgeDisposer {\n\tconst registered: Array<[string, EventListener]> = []\n\n\tfor (const [domName, miniName] of Object.entries(eventMap)) {\n\t\tconst listener: EventListener = (domEvent) => {\n\t\t\tfire(buildPayload(miniName, domEvent))\n\t\t}\n\t\ttarget.addEventListener(domName, listener)\n\t\tregistered.push([domName, listener])\n\t}\n\n\treturn () => {\n\t\tfor (const [domName, listener] of registered) {\n\t\t\ttarget.removeEventListener(domName, listener)\n\t\t}\n\t\tregistered.length = 0\n\t}\n}\n", "/**\n * Bridge for real Node built-ins in browser-bundled renderer documents.\n *\n * The simulator document runs with nodeIntegration OFF and its vite bundle\n * stubs `node:*` imports with truthy-but-empty objects, while its preload\n * (sandbox:false + contextIsolation:false \u2014 one shared JS world with the\n * page) has full Node access. The preload publishes the real modules on this\n * global; browser-side consumers (the vpath resolver, the FileSystemManager\n * backends) read them from here.\n *\n * Consumers MUST validate that the member they need is a function \u2014 never\n * trust truthiness, the vite stubs are truthy objects.\n */\n\nexport const NODE_BINDINGS_GLOBAL = '__diminaNodeBindings'\n\nexport interface DiminaNodeBindings {\n\tfs?: typeof import('node:fs')\n\tpath?: typeof import('node:path')\n\tos?: typeof import('node:os')\n\tcrypto?: typeof import('node:crypto')\n\tbuffer?: typeof import('node:buffer')\n}\n\nexport function getNodeBindings(): DiminaNodeBindings {\n\tconst bag = (globalThis as Record<string, unknown>)[NODE_BINDINGS_GLOBAL]\n\treturn (bag && typeof bag === 'object' ? bag : {}) as DiminaNodeBindings\n}\n", "/**\n * Runtime vpath resolver.\n *\n * Spec: `docs/file-system.md` \u2014 single resolver shared by every FSM\n * entry, the renderer-side temp store, and the main-process\n * protocol.handle / disk reader.\n *\n * resolveVPath(url): { kind, writable, realPath? } | null\n *\n * - `difile://_tmp/<id>` \u2192 kind=tmp, writable=false, no realPath\n * - `difile://_store/<id>` \u2192 kind=store, writable=false, realPath in base\n * - `difile://<rel>` \u2192 kind=usr, writable=true, realPath in base\n *\n * Security invariants (the resolver returns `null` instead of throwing):\n * - any non-`difile://` scheme is rejected outright;\n * - any `..` segment (raw or URL-encoded) is rejected before canonicalize;\n * - after `path.normalize` the resulting `realPath` MUST stay inside the\n * sandbox base; otherwise `null`;\n * - reserved prefixes `_tmp/` and `_store/` are case-sensitive \u2014 `_TMP/`,\n * `_Tmp/`, etc. fall through to the user-data namespace.\n */\n\n// Main-process (Node ESM) resolves these natively. The simulator document's\n// vite bundle stubs them with truthy-but-empty objects, and its renderer DOES\n// enter the `store`/`usr` branches (the FileSystemManager backends run\n// there) \u2014 so probe a required function on the static import and fall back to\n// the preload-published node bindings (see ./node-bindings.ts).\nimport osStatic from 'node:os'\nimport pathStatic from 'node:path'\nimport { getNodeBindings } from './node-bindings.js'\n\nconst os: typeof import('os') =\n\ttypeof osStatic?.homedir === 'function' ? osStatic : (getNodeBindings().os ?? osStatic)\nconst path: typeof import('path') =\n\ttypeof pathStatic?.join === 'function' ? pathStatic : (getNodeBindings().path ?? pathStatic)\n\nexport type VPathKind = 'tmp' | 'store' | 'usr'\n\nexport interface ResolvedVPath {\n\tkind: VPathKind\n\t/** `tmp` and `store` are runtime-owned and read-only; `usr` is writable. */\n\twritable: boolean\n\t/**\n\t * Canonical local path on disk for `store` / `usr` kinds (always within the\n\t * USER_DATA_PATH base directory after canonicalize). `tmp` kind has no\n\t * realPath \u2014 the bytes live in the renderer-side Blob Map.\n\t */\n\trealPath?: string\n}\n\nconst DIFILE_PREFIX = 'difile://'\n\n/**\n * USER_DATA_PATH sandbox base. Looked up dynamically on every call so test\n * doubles (e.g. monkey-patching `os.homedir`) and the `DIMINA_HOME` env\n * override apply per invocation. The env override exists for headless test\n * affordance and to keep the renderer/main store sharing one base.\n */\nexport function sandboxBase(): string {\n\tconst env = (typeof process !== 'undefined' && process.env && process.env.DIMINA_HOME) || ''\n\tif (env) {\n\t\treturn path.join(env, 'files')\n\t}\n\treturn path.join(os.homedir(), '.dimina', 'files')\n}\n\nexport function resolveVPath(url: unknown): ResolvedVPath | null {\n\tif (typeof url !== 'string') return null\n\tif (!url.startsWith(DIFILE_PREFIX)) return null\n\n\tconst raw = url.slice(DIFILE_PREFIX.length)\n\tif (raw.length === 0) return null\n\n\t// Decode URL-encoded sequences first so `%2e%2e` style escapes are caught\n\t// by the segment check below.\n\tlet decoded: string\n\ttry {\n\t\tdecoded = decodeURIComponent(raw)\n\t} catch {\n\t\treturn null\n\t}\n\n\t// Reject NUL bytes (raw or %00) \u2014 Node `fs.*` throws TypeError on a NUL\n\t// in the path, bypassing the API's `fail` callback and crashing the\n\t// renderer. Pull the rejection up to the validator.\n\tif (decoded.includes('\\0')) return null\n\n\t// `wx.env.USER_DATA_PATH` is `'difile://usr'` (upstream `core/base`), but\n\t// hand-written paths also arrive as `difile:///foo.txt` (extra slashes\n\t// after the scheme). Strip leading slashes so both spellings path-join\n\t// cleanly under the sandbox base.\n\tdecoded = decoded.replace(/^[/\\\\]+/, '')\n\tif (decoded.length === 0) return null\n\n\t// Reject any '..' or '.' segment after decoding. We split on both '/' and\n\t// '\\\\' so Windows-style separators cannot smuggle a traversal segment past\n\t// the validator on POSIX hosts.\n\tconst segments = decoded.split(/[/\\\\]+/)\n\tif (segments.some(s => s === '..' || s === '.')) return null\n\n\t// Classify by reserved prefix (case-sensitive \u2014 `_TMP/` is a user file).\n\tlet kind: VPathKind\n\tlet writable: boolean\n\tif (decoded.startsWith('_tmp/')) {\n\t\tkind = 'tmp'\n\t\twritable = false\n\t} else if (decoded.startsWith('_store/')) {\n\t\tkind = 'store'\n\t\twritable = false\n\t} else {\n\t\tkind = 'usr'\n\t\twritable = true\n\t}\n\n\t// `tmp` lives in the renderer Blob Map \u2014 no realPath.\n\tif (kind === 'tmp') {\n\t\treturn { kind, writable }\n\t}\n\n\t// `store` / `usr`: anchor under the sandbox base and assert containment\n\t// after normalization. Defense in depth against any traversal that the\n\t// segment check above missed (e.g. backslash trickery on POSIX).\n\tconst base = sandboxBase()\n\tconst joined = path.join(base, decoded)\n\tconst normalized = path.normalize(joined)\n\tif (normalized !== base && !normalized.startsWith(base + path.sep)) return null\n\n\treturn { kind, writable, realPath: normalized }\n}\n", "/**\n * Devtools simulator temp-file registry.\n *\n * The simulator hands `chooseImage` / `chooseMedia` / `chooseVideo` /\n * `compressImage` etc. results back to mini-program code as paths. Historically\n * those paths were `blob:` URLs allocated via `URL.createObjectURL`, but the\n * blob: scheme is local-to-the-renderer and cannot be served back into the\n * webview's `persist:simulator` session through a `protocol.handle`. We switched\n * to a custom `difile://_tmp/{uuid}` scheme so the main process can\n * register a single `difile://` protocol handler and stream the bytes for any\n * path, regardless of which renderer originally produced it.\n *\n * To keep the renderer-side cache and the main-process byte store in sync,\n * `setTempFileSink` lets the preload bridge inject a sink that mirrors every\n * `write` / `revoke` / `revokeAll` over IPC. Tests inject a stub sink.\n */\n\nexport interface TempFileSink {\n\twrite(path: string, blob: Blob): void\n\twriteAndWait?(path: string, blob: Blob): Promise<void>\n\trevoke(path: string): void\n\trevokeAll(): void\n}\n\n/**\n * \u548C\u4E3B\u8FDB\u7A0B\u90A3\u4EFD\u5B58\u50A8\u7528\u540C\u4E00\u4E2A\u4E0A\u9650\uFF08dimina-electron-runtime \u7684 `MAX_STORE_ENTRIES`\uFF09\uFF0C\u540C\u6837\u6309\n * \u63D2\u5165\u987A\u5E8F\u6DD8\u6C70\u3002renderer \u8FD9\u4EFD\u53EA\u662F\u540C\u4E00\u6279\u5B57\u8282\u7684\u526F\u672C\uFF1A\u4E3B\u8FDB\u7A0B\u8D85\u51FA\u4E0A\u9650\u5C31\u628A\u8001\u7684\u6254\u4E86\uFF0C\u8FD9\u8FB9\u7559\u66F4\u591A\n * \u4EFD\u4E5F\u8BFB\u4E0D\u51FA\u522B\u7684\u4E1C\u897F\uFF0C\u53EA\u662F\u767D\u5360\u5185\u5B58\u2014\u2014\u4E00\u6B21 canvas \u5BFC\u51FA\u5C31\u53EF\u80FD\u6709 32MB\u3002\u88AB\u6DD8\u6C70\u7684\u8DEF\u5F84\u4E0B\u6B21\u8BFB\u4F1A\n * \u8D70 fetch \u56DE\u4E3B\u8FDB\u7A0B\uFF0C\u62FF\u4E0D\u5230\u624D\u7B97\u771F\u7684\u8FC7\u671F\u3002\n */\nconst MAX_TEMP_FILE_ENTRIES = 200\n\nconst tempFiles = new Map<string, Blob>()\nlet activeSink: TempFileSink | null = null\n\nfunction rememberTempFile(path: string, blob: Blob): void {\n\ttempFiles.set(path, blob)\n\twhile (tempFiles.size > MAX_TEMP_FILE_ENTRIES) {\n\t\tconst oldest = tempFiles.keys().next()\n\t\tif (oldest.done) break\n\t\ttempFiles.delete(oldest.value)\n\t}\n}\n\nexport function setTempFileSink(sink: TempFileSink | null): void {\n\tactiveSink = sink\n}\n\nfunction cryptoRandomId(): string {\n\tconst c = (globalThis as { crypto?: { randomUUID?: () => string } }).crypto\n\tif (c && typeof c.randomUUID === 'function') return c.randomUUID()\n\treturn `${Date.now()}-${Math.random().toString(36).slice(2)}`\n}\n\nfunction allocateTempFilePath(blob: Blob): string {\n\tconst path = `difile://_tmp/${cryptoRandomId()}`\n\trememberTempFile(path, blob)\n\treturn path\n}\n\nexport function createTempFilePath(blob: Blob): string {\n\tconst path = allocateTempFilePath(blob)\n\tactiveSink?.write(path, blob)\n\treturn path\n}\n\n/**\n * \u8FD4\u56DE\u8DEF\u5F84\u524D\u7B49\u5F85\u4E3B\u8FDB\u7A0B\u786E\u8BA4\u5B57\u8282\u5DF2\u7ECF\u767B\u8BB0\u3002\u9700\u8981\u201C\u6210\u529F\u56DE\u8C03\u540E\u8DEF\u5F84\u7ACB\u5373\u53EF\u8BFB\u201D\u7684 API \u4F7F\u7528\u6B64\u5165\u53E3\uFF1B\n * \u65E7\u7684\u540C\u6B65\u521B\u5EFA\u5165\u53E3\u4FDD\u6301\u4E0D\u53D8\uFF0C\u907F\u514D\u6539\u53D8 chooseImage \u7B49\u73B0\u6709 API \u7684\u7B7E\u540D\u3002\n */\nexport async function createTempFilePathAsync(blob: Blob): Promise<string> {\n\tconst path = allocateTempFilePath(blob)\n\ttry {\n\t\tif (activeSink?.writeAndWait) {\n\t\t\tawait activeSink.writeAndWait(path, blob)\n\t\t}\n\t\telse {\n\t\t\tactiveSink?.write(path, blob)\n\t\t}\n\t}\n\tcatch (error) {\n\t\t// \u5199\u5165\u6CA1\u6210\u529F\uFF0C\u8FD9\u4E2A\u8DEF\u5F84\u5C31\u6C38\u8FDC\u4E0D\u4F1A\u4EA4\u5230\u5C0F\u7A0B\u5E8F\u624B\u91CC\uFF0C\u4E5F\u5C31\u6CA1\u6709\u4EBA\u518D\u6765 revoke \u5B83\u3002\n\t\t// \u7559\u7740 renderer \u4FA7\u8FD9\u4EFD\u526F\u672C\u53EA\u4F1A\u4E00\u76F4\u5360\u5185\u5B58\u2014\u2014canvas \u5BFC\u51FA\u5355\u4EFD\u5C31\u53EF\u80FD\u6709 32MB\u3002\n\t\ttempFiles.delete(path)\n\t\tthrow error\n\t}\n\treturn path\n}\n\nexport function registerTempFilePath(path: string, blob: Blob): void {\n\trememberTempFile(path, blob)\n\tactiveSink?.write(path, blob)\n}\n\nexport function revokeTempFilePath(path: string): void {\n\ttempFiles.delete(path)\n\tactiveSink?.revoke(path)\n}\n\nexport function revokeAllTempFilePaths(): void {\n\ttempFiles.clear()\n\tactiveSink?.revokeAll()\n}\n\nexport async function resolveTempFilePath(path: string): Promise<Blob> {\n\tconst cached = tempFiles.get(path)\n\tif (cached) return cached\n\n\tconst response = await fetch(path)\n\tif (!response.ok) {\n\t\tthrow new Error(`\u65E0\u6CD5\u8BFB\u53D6\u6587\u4EF6 ${path}`)\n\t}\n\tconst blob = await response.blob()\n\t// Cache the freshly fetched blob in-memory so subsequent reads are local.\n\t// We bypass `registerTempFilePath` deliberately: this is a renderer-only\n\t// cache fill, the main-process store already has the bytes (otherwise the\n\t// fetch would not have returned them), so triggering sink.write would\n\t// produce a redundant IPC.\n\trememberTempFile(path, blob)\n\treturn blob\n}\n\nexport function getTempFileName(path: string, blob: Blob, fallback = 'file'): string {\n\tconst named = blob as Blob & { name?: unknown }\n\tif (typeof named.name === 'string' && named.name.trim()) {\n\t\treturn named.name\n\t}\n\n\ttry {\n\t\tconst url = new URL(path, window.location.href)\n\t\tconst segment = url.pathname.split('/').filter(Boolean).pop()\n\t\tif (segment) return decodeURIComponent(segment)\n\t} catch {\n\t\t// Fall through to the caller-provided fallback.\n\t}\n\n\treturn fallback\n}\n", "/**\n * DevTools API stubs for filesystem wx.xxx APIs\n * (container-side handlers for service-apis/file).\n *\n * Each exported function is bound with `this` = MiniApp instance\n * (via AppManager.registerApi \u2192 MiniApp.invokeApi).\n *\n * Contract (see `docs/file-system.md`):\n * - Every entry point routes its caller-supplied path through `resolveVPath`\n * (single resolver), which rejects non-`difile://` schemes, absolute\n * filesystem paths, and any `..` traversal.\n * - Write-class APIs (writeFile / appendFile / unlink / mkdir / rmdir /\n * truncate / rename(dest) / copyFile(dest)) refuse `difile://_tmp/*` and\n * `difile://_store/*` with `permission denied` \u2014 those namespaces are\n * runtime-owned and read-only, matching wx \u771F\u673A semantics.\n * - `fsSaveFile` returns a `difile://_store/{uuid}.{ext}` vpath, never a\n * real disk path.\n */\n\nimport type { MiniAppContext } from './types'\nimport { bindCallbacks } from './simulator-api-helpers'\nimport { getNodeBindings } from '../shared/node-bindings.js'\nimport { resolveVPath, sandboxBase, type ResolvedVPath } from '../shared/vpath.js'\nimport { resolveTempFilePath } from './temp-files'\n\n/**\n * Dispatch helper: pull a `_tmp/*` Blob out of the renderer Map and hand back\n * its bytes. Throws an ENOENT-shaped Error if the URL is unknown, so callers\n * can surface a `fail` with a real not-found message.\n */\nasync function _tmpBytes(url: string): Promise<Buffer> {\n\ttry {\n\t\tconst blob = await resolveTempFilePath(url)\n\t\treturn await blobToBuffer(blob)\n\t}\n\tcatch (err) {\n\t\tconst msg = err instanceof Error ? err.message : String(err)\n\t\tthrow new Error(`ENOENT: no such file (${url}): ${msg}`, { cause: err })\n\t}\n}\n\nfunction isArrayBuffer(value: unknown): value is ArrayBuffer {\n\treturn Object.prototype.toString.call(value) === '[object ArrayBuffer]'\n}\n\n/**\n * `Buffer` for Blob materialization: the simulator document has no global\n * `Buffer` (nodeIntegration is off and the vite bundle does not polyfill\n * it), so take the constructor from the preload-published node bindings;\n * vitest/node contexts have the global.\n */\nconst BufferImpl: typeof Buffer | undefined =\n\tgetNodeBindings().buffer?.Buffer ?? (typeof Buffer !== 'undefined' ? Buffer : undefined)\n\nasync function blobToBuffer(blob: Blob): Promise<Buffer> {\n\tif (!BufferImpl) {\n\t\tthrow new Error('Buffer binding unavailable')\n\t}\n\tconst readable = blob as Blob & { arrayBuffer?: () => Promise<ArrayBuffer> }\n\tif (typeof readable.arrayBuffer === 'function') {\n\t\tconst ab = await readable.arrayBuffer()\n\t\treturn BufferImpl.from(new Uint8Array(ab))\n\t}\n\n\tif (typeof FileReader !== 'function') {\n\t\tthrow new Error('Blob cannot be read as ArrayBuffer')\n\t}\n\n\treturn new Promise((resolve, reject) => {\n\t\tconst reader = new FileReader()\n\t\treader.onerror = () => reject(reader.error ?? new Error('Blob read failed'))\n\t\treader.onload = () => {\n\t\t\tconst result = reader.result\n\t\t\tif (!isArrayBuffer(result)) {\n\t\t\t\treject(new Error('Blob read did not return an ArrayBuffer'))\n\t\t\t\treturn\n\t\t\t}\n\t\t\tresolve(BufferImpl.from(new Uint8Array(result)))\n\t\t}\n\t\treader.readAsArrayBuffer(blob)\n\t})\n}\n\n/**\n * Real Node built-ins: the preload-published bindings in the simulator\n * document (nodeIntegration is off there and the vite bundle stubs `node:*`\n * imports), `require` under vitest/node. Each candidate is validated by\n * probing a required member function \u2014 the vite stubs are truthy objects, so\n * truthiness alone would wave a dead module through and the guard below\n * (`guardFsAvailable`) would then let calls crash mid-handler.\n */\nfunction resolveNodeModule<T>(fromBindings: T | undefined, name: string, probe: (mod: T) => boolean): T {\n\tif (fromBindings && probe(fromBindings)) return fromBindings\n\tif (typeof require !== 'undefined') {\n\t\t// eslint-disable-next-line @typescript-eslint/no-require-imports\n\t\tconst mod = require(name) as T\n\t\tif (mod && probe(mod)) return mod\n\t}\n\treturn null as unknown as T\n}\n\nconst _fs = resolveNodeModule(getNodeBindings().fs, 'fs', m => typeof m.readFile === 'function')\nconst _path = resolveNodeModule(getNodeBindings().path, 'path', m => typeof m.join === 'function')\nconst _crypto = resolveNodeModule(getNodeBindings().crypto, 'crypto', m => typeof m.createHash === 'function')\n\ntype FsCallbacks = ReturnType<typeof bindCallbacks>\ntype NodeStats = import('fs').Stats\ntype NodeErr = NodeJS.ErrnoException | Error | null\n\n// \u2500\u2500\u2500 shared fs-API scaffolding \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n//\n// Every handler below shares the same skeleton: bail if Node `fs` isn't\n// available, resolve the caller path through the single vpath resolver\n// (bailing on invalid/unsafe paths), optionally reject read-only\n// namespaces for write-class APIs, then run a Node fs call and translate its\n// `(err, ...)` callback into the wx success/fail/complete triad. The helpers\n// below are the single authority for each of those steps so per-API bodies\n// only contain what differs between APIs (the real fs call and any extra\n// success payload fields).\n\n/** Bails with `${apiName}:fail not available in browser context` when the Node `fs` binding is absent (e.g. a browser-only build). */\nfunction guardFsAvailable(apiName: string, cbs: FsCallbacks): boolean {\n\tif (_fs) return false\n\tcbs.onFail?.({ errMsg: `${apiName}:fail not available in browser context` })\n\tcbs.onComplete?.()\n\treturn true\n}\n\n/**\n * True when any path component from the sandbox base down to `realPath` is a\n * symlink. `resolveVPath` validates the requested STRING (no `..`, stays\n * under the base after normalize) but never inspects the disk \u2014 a symlink\n * planted inside `usr/` would otherwise let Node's default follow-symlinks\n * behavior read or write through to a target outside the sandbox. `lstat`\n * (not `stat`/`exists`) sees the link itself, so dangling links \u2014 which\n * `fs.writeFile` would still follow to CREATE the outside target \u2014 are\n * caught too. The base itself may legitimately be a symlink (macOS tmpdir);\n * only components below it are checked.\n */\nfunction containsSymlink(realPath: string): boolean {\n\tconst rel = _path.relative(sandboxBase(), realPath)\n\tif (!rel || rel.startsWith('..')) return false\n\tlet cur = sandboxBase()\n\tfor (const seg of rel.split(_path.sep)) {\n\t\tcur = _path.join(cur, seg)\n\t\tlet entry: import('fs').Stats\n\t\ttry {\n\t\t\tentry = _fs.lstatSync(cur)\n\t\t} catch {\n\t\t\t// Nothing on disk from here down \u2014 nothing left to follow.\n\t\t\treturn false\n\t\t}\n\t\tif (entry.isSymbolicLink()) return true\n\t}\n\treturn false\n}\n\n/**\n * Resolves `p` via `resolveVPath` and asserts the resolved disk path does not\n * pass through a sandbox-internal symlink, or reports `${apiName}:fail\n * invalid or unsafe path` and runs `complete`.\n */\nfunction resolveOrBail(p: unknown, apiName: string, cbs: FsCallbacks): ResolvedVPath | undefined {\n\tconst v = resolveVPath(p)\n\tif (v && (!v.realPath || !_fs || !containsSymlink(v.realPath))) return v\n\tcbs.onFail?.({ errMsg: `${apiName}:fail invalid or unsafe path` })\n\tcbs.onComplete?.()\n\treturn undefined\n}\n\n/**\n * wx `Stats` payload: numeric mode bits, byte size, SECOND-unit epoch\n * timestamps \u2014 wx and the dimina native clients all report seconds, while\n * Node's `atimeMs`/`mtimeMs` are milliseconds.\n */\nfunction toWxStats(s: NodeStats): Record<string, unknown> {\n\treturn {\n\t\tsize: s.size,\n\t\tmode: s.mode,\n\t\tlastAccessedTime: Math.floor(s.atimeMs / 1000),\n\t\tlastModifiedTime: Math.floor(s.mtimeMs / 1000),\n\t\tisFile: s.isFile(),\n\t\tisDirectory: s.isDirectory(),\n\t}\n}\n\n/**\n * Type-guards `v` as writable (narrows `realPath` to `string`), or reports\n * `${apiName}:fail permission denied` and runs `complete`. `_tmp` / `_store`\n * are runtime-owned and read-only, matching wx \u771F\u673A semantics.\n */\nfunction ensureWritable(v: ResolvedVPath, apiName: string, cbs: FsCallbacks): v is ResolvedVPath & { realPath: string } {\n\tif (v.writable && v.realPath) return true\n\tcbs.onFail?.({ errMsg: `${apiName}:fail permission denied` })\n\tcbs.onComplete?.()\n\treturn false\n}\n\n/** Fail handler for a `_tmpBytes(...).then(success, ...)` chain: reports `${apiName}:fail <message>` and runs `complete`. */\nfunction tmpFailHandler(apiName: string, cbs: FsCallbacks) {\n\treturn (err: Error) => {\n\t\tcbs.onFail?.({ errMsg: `${apiName}:fail ${err.message}` })\n\t\tcbs.onComplete?.()\n\t}\n}\n\n/**\n * Builds a Node-style `(err, ...args)` callback that translates into the wx\n * success/fail/complete triad: `err` truthy \u2192 fail with `${apiName}:fail\n * <message>`; otherwise success with `${apiName}:ok` plus whatever\n * `buildOk(...args)` contributes.\n */\nfunction nodeComplete<TArgs extends unknown[] = []>(\n\tapiName: string,\n\tcbs: FsCallbacks,\n\tbuildOk?: (...args: TArgs) => Record<string, unknown> | undefined,\n) {\n\treturn (err: NodeErr, ...args: TArgs) => {\n\t\tif (err) {\n\t\t\tcbs.onFail?.({ errMsg: `${apiName}:fail ${err.message}` })\n\t\t} else {\n\t\t\tcbs.onSuccess?.({ ...(buildOk ? buildOk(...args) : undefined), errMsg: `${apiName}:ok` })\n\t\t}\n\t\tcbs.onComplete?.()\n\t}\n}\n\n/**\n * `mkdir -p` the parent of `destReal`, then run `writeFn` (a `writeFile` /\n * `copyFile` call) through `nodeComplete`. Shared by every API that\n * materializes bytes onto disk under a possibly-not-yet-existing directory\n * (fsWriteFile, fsCopyFile's `_tmp` branch, fsSaveFile).\n */\nfunction mkdirpThenWrite(\n\tdestReal: string,\n\tapiName: string,\n\tcbs: FsCallbacks,\n\twriteFn: (done: (err: NodeErr) => void) => void,\n\tokExtra?: Record<string, unknown>,\n): void {\n\t_fs.mkdir(_path.dirname(destReal), { recursive: true }, (mkdirErr) => {\n\t\tif (mkdirErr) {\n\t\t\tcbs.onFail?.({ errMsg: `${apiName}:fail ${mkdirErr.message}` })\n\t\t\tcbs.onComplete?.()\n\t\t\treturn\n\t\t}\n\t\t// fs.writeFile/copyFile validate their arguments synchronously (a\n\t\t// numeric `data`, an unknown `encoding`); this callback runs after the\n\t\t// wire handler's own try/catch has already returned, so an unguarded\n\t\t// throw here would leave the call with no verdict at all.\n\t\ttry {\n\t\t\twriteFn(nodeComplete(apiName, cbs, () => okExtra))\n\t\t} catch (err) {\n\t\t\tcbs.onFail?.({ errMsg: `${apiName}:fail ${err instanceof Error ? err.message : String(err)}` })\n\t\t\tcbs.onComplete?.()\n\t\t}\n\t})\n}\n\nexport function fsAccess(\n\tthis: MiniAppContext,\n\t{ path, success, fail, complete }: { path: string; success?: unknown; fail?: unknown; complete?: unknown },\n) {\n\tconst cbs = bindCallbacks(this, { success, fail, complete })\n\tconst { onSuccess, onFail, onComplete } = cbs\n\tif (guardFsAvailable('fsAccess', cbs)) return\n\tconst v = resolveOrBail(path, 'fsAccess', cbs)\n\tif (!v) return\n\tif (v.kind === 'tmp') {\n\t\t// _tmp existence check: renderer Map hit \u21D2 ok; miss \u21D2 ENOENT-shaped fail.\n\t\t_tmpBytes(path).then(\n\t\t\t() => { onSuccess?.({ errMsg: 'fsAccess:ok' }); onComplete?.() },\n\t\t\ttmpFailHandler('fsAccess', cbs),\n\t\t)\n\t\treturn\n\t}\n\tif (!v.realPath) {\n\t\tonFail?.({ errMsg: 'fsAccess:fail invalid path' })\n\t\tonComplete?.()\n\t\treturn\n\t}\n\t_fs.access(v.realPath, _fs.constants.F_OK, nodeComplete('fsAccess', cbs))\n}\n\nexport function fsStat(\n\tthis: MiniAppContext,\n\t{ path, recursive = false, success, fail, complete }: {\n\t\tpath: string\n\t\trecursive?: boolean\n\t\tsuccess?: unknown\n\t\tfail?: unknown\n\t\tcomplete?: unknown\n\t},\n) {\n\tconst cbs = bindCallbacks(this, { success, fail, complete })\n\tconst { onSuccess, onFail, onComplete } = cbs\n\tif (guardFsAvailable('fsStat', cbs)) return\n\tconst v = resolveOrBail(path, 'fsStat', cbs)\n\tif (!v) return\n\tif (v.kind === 'tmp') {\n\t\t// _tmp size is known from the Blob; mtime is 0 (no on-disk timestamp).\n\t\t_tmpBytes(path).then(\n\t\t\t(buf) => {\n\t\t\t\tonSuccess?.({\n\t\t\t\t\tstats: {\n\t\t\t\t\t\tsize: buf.length,\n\t\t\t\t\t\tmode: 0,\n\t\t\t\t\t\tlastAccessedTime: 0,\n\t\t\t\t\t\tlastModifiedTime: 0,\n\t\t\t\t\t\tisFile: true,\n\t\t\t\t\t\tisDirectory: false,\n\t\t\t\t\t},\n\t\t\t\t\terrMsg: 'fsStat:ok',\n\t\t\t\t})\n\t\t\t\tonComplete?.()\n\t\t\t},\n\t\t\ttmpFailHandler('fsStat', cbs),\n\t\t)\n\t\treturn\n\t}\n\tif (!v.realPath) {\n\t\tonFail?.({ errMsg: 'fsStat:fail invalid path' })\n\t\tonComplete?.()\n\t\treturn\n\t}\n\tconst resolved = v.realPath\n\tif (recursive) {\n\t\t// Map of RELATIVE path \u2192 stats for the tree, keyed the way wx and the\n\t\t// dimina native clients key it: the queried directory itself as \".\"\n\t\t// plus `relative(root, entry)`-style descendants \u2014 never a host\n\t\t// absolute path (that would leak the sandbox location to mini-program\n\t\t// code). Any readdir/stat error fails the whole call: silently\n\t\t// dropping a failed entry would present an incomplete tree as ok.\n\t\tconst statsMap: Record<string, unknown> = {}\n\t\tlet settled = false\n\t\tconst failOnce = (err: Error) => {\n\t\t\tif (settled) return\n\t\t\tsettled = true\n\t\t\tonFail?.({ errMsg: `fsStat:fail ${err.message}` })\n\t\t\tonComplete?.()\n\t\t}\n\t\tconst okOnce = () => {\n\t\t\tif (settled) return\n\t\t\tsettled = true\n\t\t\tonSuccess?.({ stats: statsMap, errMsg: 'fsStat:ok' })\n\t\t\tonComplete?.()\n\t\t}\n\t\tconst relKey = (full: string): string => {\n\t\t\tconst rel = _path.relative(resolved, full)\n\t\t\treturn rel === '' ? '.' : rel.split(_path.sep).join('/')\n\t\t}\n\t\t// `lstat`, never `stat`: `resolveOrBail`'s symlink fence only inspects\n\t\t// the REQUESTED root path \u2014 a symlink discovered mid-walk would\n\t\t// otherwise be followed (leaking sandbox-external metadata into the\n\t\t// map) while its Dirent still reads as a non-directory (leaving a\n\t\t// truncated tree). A symlink anywhere in the walk fails the whole\n\t\t// call; the recursion decision uses the same lstat result.\n\t\tconst statInto = (full: string, cb: (err: Error | null, isDirectory?: boolean) => void) => {\n\t\t\t_fs.lstat(full, (err, s) => {\n\t\t\t\tif (err) { cb(err); return }\n\t\t\t\tif (s.isSymbolicLink()) {\n\t\t\t\t\tcb(new Error('invalid or unsafe path'))\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tstatsMap[relKey(full)] = toWxStats(s)\n\t\t\t\tcb(null, s.isDirectory())\n\t\t\t})\n\t\t}\n\t\tconst walkDir = (dir: string, cb: (err: Error | null) => void) => {\n\t\t\t_fs.readdir(dir, { withFileTypes: true }, (err, entries) => {\n\t\t\t\tif (err) { cb(err); return }\n\t\t\t\tlet pending = entries.length\n\t\t\t\tif (pending === 0) { cb(null); return }\n\t\t\t\tlet erred = false\n\t\t\t\tconst done = (e: Error | null) => {\n\t\t\t\t\tif (erred) return\n\t\t\t\t\tif (e) { erred = true; cb(e); return }\n\t\t\t\t\tif (--pending === 0) cb(null)\n\t\t\t\t}\n\t\t\t\tfor (const entry of entries) {\n\t\t\t\t\tconst full = _path.join(dir, entry.name)\n\t\t\t\t\tstatInto(full, (statErr, isDirectory) => {\n\t\t\t\t\t\tif (statErr) { done(statErr); return }\n\t\t\t\t\t\tif (isDirectory) walkDir(full, done)\n\t\t\t\t\t\telse done(null)\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t\tstatInto(resolved, (rootErr) => {\n\t\t\tif (rootErr) { failOnce(rootErr); return }\n\t\t\twalkDir(resolved, (err) => {\n\t\t\t\tif (err) failOnce(err)\n\t\t\t\telse okOnce()\n\t\t\t})\n\t\t})\n\t} else {\n\t\t_fs.stat(resolved, nodeComplete('fsStat', cbs, (s: NodeStats) => ({\n\t\t\tstats: toWxStats(s),\n\t\t})))\n\t}\n}\n\nexport function fsReadFile(\n\tthis: MiniAppContext,\n\t{ filePath, encoding, success, fail, complete }: {\n\t\tfilePath: string\n\t\tencoding?: BufferEncoding\n\t\tsuccess?: unknown\n\t\tfail?: unknown\n\t\tcomplete?: unknown\n\t},\n) {\n\tconst cbs = bindCallbacks(this, { success, fail, complete })\n\tconst { onSuccess, onFail, onComplete } = cbs\n\tif (guardFsAvailable('fsReadFile', cbs)) return\n\tconst v = resolveOrBail(filePath, 'fsReadFile', cbs)\n\tif (!v) return\n\tif (v.kind === 'tmp') {\n\t\t_tmpBytes(filePath).then(\n\t\t\t(buf) => {\n\t\t\t\tconst data: Buffer | string = encoding ? buf.toString(encoding) : buf\n\t\t\t\tonSuccess?.({ data, errMsg: 'fsReadFile:ok' })\n\t\t\t\tonComplete?.()\n\t\t\t},\n\t\t\ttmpFailHandler('fsReadFile', cbs),\n\t\t)\n\t\treturn\n\t}\n\tif (!v.realPath) {\n\t\tonFail?.({ errMsg: 'fsReadFile:fail invalid path' })\n\t\tonComplete?.()\n\t\treturn\n\t}\n\t_fs.readFile(v.realPath, encoding || null, nodeComplete('fsReadFile', cbs, (data: Buffer | string) => ({ data })))\n}\n\nexport function fsWriteFile(\n\tthis: MiniAppContext,\n\t{ filePath, data, encoding = 'utf8', success, fail, complete }: {\n\t\tfilePath: string\n\t\tdata: string | Uint8Array\n\t\tencoding?: BufferEncoding\n\t\tsuccess?: unknown\n\t\tfail?: unknown\n\t\tcomplete?: unknown\n\t},\n) {\n\tconst cbs = bindCallbacks(this, { success, fail, complete })\n\tif (guardFsAvailable('fsWriteFile', cbs)) return\n\tconst v = resolveOrBail(filePath, 'fsWriteFile', cbs)\n\tif (!v) return\n\tif (!ensureWritable(v, 'fsWriteFile', cbs)) return\n\tmkdirpThenWrite(v.realPath, 'fsWriteFile', cbs, done => _fs.writeFile(v.realPath, data as string, { encoding }, done))\n}\n\nexport function fsAppendFile(\n\tthis: MiniAppContext,\n\t{ filePath, data, encoding = 'utf8', success, fail, complete }: {\n\t\tfilePath: string\n\t\tdata: string | Uint8Array\n\t\tencoding?: BufferEncoding\n\t\tsuccess?: unknown\n\t\tfail?: unknown\n\t\tcomplete?: unknown\n\t},\n) {\n\tconst cbs = bindCallbacks(this, { success, fail, complete })\n\tif (guardFsAvailable('fsAppendFile', cbs)) return\n\tconst v = resolveOrBail(filePath, 'fsAppendFile', cbs)\n\tif (!v) return\n\tif (!ensureWritable(v, 'fsAppendFile', cbs)) return\n\t_fs.appendFile(v.realPath, data as string, { encoding }, nodeComplete('fsAppendFile', cbs))\n}\n\nexport function fsCopyFile(\n\tthis: MiniAppContext,\n\t{ srcPath, destPath, success, fail, complete }: {\n\t\tsrcPath: string\n\t\tdestPath: string\n\t\tsuccess?: unknown\n\t\tfail?: unknown\n\t\tcomplete?: unknown\n\t},\n) {\n\tconst cbs = bindCallbacks(this, { success, fail, complete })\n\tconst { onFail, onComplete } = cbs\n\tif (guardFsAvailable('fsCopyFile', cbs)) return\n\tconst vSrc = resolveOrBail(srcPath, 'fsCopyFile', cbs)\n\tif (!vSrc) return\n\tconst vDest = resolveOrBail(destPath, 'fsCopyFile', cbs)\n\tif (!vDest) return\n\tif (!ensureWritable(vDest, 'fsCopyFile', cbs)) return\n\tif (vSrc.kind === 'tmp') {\n\t\t// Materialize the renderer Blob into the user-data\n\t\t// area. The dest writable check above already rejected _tmp / _store\n\t\t// destinations \u2014 saveFile is the documented route for tmp\u2192store.\n\t\t_tmpBytes(srcPath).then(\n\t\t\tbuf => mkdirpThenWrite(vDest.realPath, 'fsCopyFile', cbs, done => _fs.writeFile(vDest.realPath, buf, done)),\n\t\t\ttmpFailHandler('fsCopyFile', cbs),\n\t\t)\n\t\treturn\n\t}\n\tif (!vSrc.realPath) {\n\t\tonFail?.({ errMsg: 'fsCopyFile:fail invalid src path' })\n\t\tonComplete?.()\n\t\treturn\n\t}\n\t_fs.copyFile(vSrc.realPath, vDest.realPath, nodeComplete('fsCopyFile', cbs))\n}\n\nexport function fsRename(\n\tthis: MiniAppContext,\n\t{ oldPath, newPath, success, fail, complete }: {\n\t\toldPath: string\n\t\tnewPath: string\n\t\tsuccess?: unknown\n\t\tfail?: unknown\n\t\tcomplete?: unknown\n\t},\n) {\n\tconst cbs = bindCallbacks(this, { success, fail, complete })\n\tif (guardFsAvailable('fsRename', cbs)) return\n\tconst vOld = resolveOrBail(oldPath, 'fsRename', cbs)\n\tif (!vOld) return\n\tconst vNew = resolveOrBail(newPath, 'fsRename', cbs)\n\tif (!vNew) return\n\t// Rename deletes the source \u2014 both sides must be writable. _tmp / _store\n\t// reject under either role.\n\tif (!ensureWritable(vOld, 'fsRename', cbs)) return\n\tif (!ensureWritable(vNew, 'fsRename', cbs)) return\n\t_fs.rename(vOld.realPath, vNew.realPath, nodeComplete('fsRename', cbs))\n}\n\nexport function fsUnlink(\n\tthis: MiniAppContext,\n\t{ filePath, success, fail, complete }: { filePath: string; success?: unknown; fail?: unknown; complete?: unknown },\n) {\n\tconst cbs = bindCallbacks(this, { success, fail, complete })\n\tif (guardFsAvailable('fsUnlink', cbs)) return\n\tconst v = resolveOrBail(filePath, 'fsUnlink', cbs)\n\tif (!v) return\n\tif (!ensureWritable(v, 'fsUnlink', cbs)) return\n\t_fs.unlink(v.realPath, nodeComplete('fsUnlink', cbs))\n}\n\nexport function fsMkdir(\n\tthis: MiniAppContext,\n\t{ dirPath, recursive = false, success, fail, complete }: {\n\t\tdirPath: string\n\t\trecursive?: boolean\n\t\tsuccess?: unknown\n\t\tfail?: unknown\n\t\tcomplete?: unknown\n\t},\n) {\n\tconst cbs = bindCallbacks(this, { success, fail, complete })\n\tif (guardFsAvailable('fsMkdir', cbs)) return\n\tconst v = resolveOrBail(dirPath, 'fsMkdir', cbs)\n\tif (!v) return\n\tif (!ensureWritable(v, 'fsMkdir', cbs)) return\n\t_fs.mkdir(v.realPath, { recursive }, nodeComplete('fsMkdir', cbs))\n}\n\nexport function fsRmdir(\n\tthis: MiniAppContext,\n\t{ dirPath, recursive = false, success, fail, complete }: {\n\t\tdirPath: string\n\t\trecursive?: boolean\n\t\tsuccess?: unknown\n\t\tfail?: unknown\n\t\tcomplete?: unknown\n\t},\n) {\n\tconst cbs = bindCallbacks(this, { success, fail, complete })\n\tif (guardFsAvailable('fsRmdir', cbs)) return\n\tconst v = resolveOrBail(dirPath, 'fsRmdir', cbs)\n\tif (!v) return\n\tif (!ensureWritable(v, 'fsRmdir', cbs)) return\n\t// The two cases need different Node primitives: `fs.rm` without\n\t// `recursive` refuses directories outright (ERR_FS_EISDIR) even when\n\t// empty, while wx's non-recursive rmdir removes an empty directory and\n\t// fails only on a non-empty one \u2014 exactly `fs.rmdir`'s contract.\n\tif (recursive) {\n\t\tconst rmFn = (_fs as typeof _fs & { rm?: typeof _fs.rmdir }).rm ?? _fs.rmdir\n\t\trmFn(v.realPath, { recursive: true } as Parameters<typeof _fs.rmdir>[1], nodeComplete('fsRmdir', cbs))\n\t} else {\n\t\t_fs.rmdir(v.realPath, nodeComplete('fsRmdir', cbs))\n\t}\n}\n\nexport function fsReaddir(\n\tthis: MiniAppContext,\n\t{ dirPath, success, fail, complete }: { dirPath: string; success?: unknown; fail?: unknown; complete?: unknown },\n) {\n\tconst cbs = bindCallbacks(this, { success, fail, complete })\n\tconst { onFail, onComplete } = cbs\n\tif (guardFsAvailable('fsReaddir', cbs)) return\n\tconst v = resolveOrBail(dirPath, 'fsReaddir', cbs)\n\tif (!v) return\n\t// _tmp and _store are flat (id-addressed) namespaces \u2014 readdir is meaningless.\n\tif (v.kind === 'tmp' || v.kind === 'store') {\n\t\tonFail?.({ errMsg: `fsReaddir:fail ${v.kind} is a flat namespace (no dir tree)` })\n\t\tonComplete?.()\n\t\treturn\n\t}\n\tif (!v.realPath) {\n\t\tonFail?.({ errMsg: 'fsReaddir:fail invalid path' })\n\t\tonComplete?.()\n\t\treturn\n\t}\n\t_fs.readdir(v.realPath, nodeComplete('fsReaddir', cbs, (files: string[]) => ({ files })))\n}\n\nexport function fsGetFileInfo(\n\tthis: MiniAppContext,\n\t{ filePath, digestAlgorithm, success, fail, complete }: {\n\t\tfilePath: string\n\t\tdigestAlgorithm?: string\n\t\tsuccess?: unknown\n\t\tfail?: unknown\n\t\tcomplete?: unknown\n\t},\n) {\n\tconst cbs = bindCallbacks(this, { success, fail, complete })\n\tconst { onSuccess, onFail, onComplete } = cbs\n\tif (guardFsAvailable('fsGetFileInfo', cbs)) return\n\tconst v = resolveOrBail(filePath, 'fsGetFileInfo', cbs)\n\tif (!v) return\n\t// wx and every dimina native client default digestAlgorithm to md5 and\n\t// always include the digest \u2014 a missing digest is a fail, not a silently\n\t// smaller success payload.\n\tconst algorithm = digestAlgorithm === 'sha1' ? 'sha1' : 'md5'\n\tif (v.kind === 'tmp') {\n\t\t_tmpBytes(filePath).then(\n\t\t\t(buf) => {\n\t\t\t\ttry {\n\t\t\t\t\tconst hash = _crypto.createHash(algorithm)\n\t\t\t\t\thash.update(buf)\n\t\t\t\t\tonSuccess?.({ size: buf.length, digest: hash.digest('hex'), errMsg: 'fsGetFileInfo:ok' })\n\t\t\t\t\tonComplete?.()\n\t\t\t\t} catch (hashErr) {\n\t\t\t\t\tonFail?.({ errMsg: `fsGetFileInfo:fail ${(hashErr as Error).message}` })\n\t\t\t\t\tonComplete?.()\n\t\t\t\t}\n\t\t\t},\n\t\t\ttmpFailHandler('fsGetFileInfo', cbs),\n\t\t)\n\t\treturn\n\t}\n\tif (!v.realPath) {\n\t\tonFail?.({ errMsg: 'fsGetFileInfo:fail invalid path' })\n\t\tonComplete?.()\n\t\treturn\n\t}\n\tconst resolved = v.realPath\n\t_fs.stat(resolved, (err, s) => {\n\t\tif (err) {\n\t\t\tonFail?.({ errMsg: `fsGetFileInfo:fail ${err.message}` })\n\t\t\tonComplete?.()\n\t\t\treturn\n\t\t}\n\t\ttry {\n\t\t\tconst hash = _crypto.createHash(algorithm)\n\t\t\tconst stream = _fs.createReadStream(resolved)\n\t\t\tstream.on('data', (chunk) => hash.update(chunk as Buffer))\n\t\t\tstream.on('end', () => {\n\t\t\t\tonSuccess?.({ size: s.size, digest: hash.digest('hex'), errMsg: 'fsGetFileInfo:ok' })\n\t\t\t\tonComplete?.()\n\t\t\t})\n\t\t\tstream.on('error', (hashErr) => {\n\t\t\t\tonFail?.({ errMsg: `fsGetFileInfo:fail ${hashErr.message}` })\n\t\t\t\tonComplete?.()\n\t\t\t})\n\t\t} catch (hashErr) {\n\t\t\tonFail?.({ errMsg: `fsGetFileInfo:fail ${(hashErr as Error).message}` })\n\t\t\tonComplete?.()\n\t\t}\n\t})\n}\n\n/**\n * Save a temp file into the read-only `_store/` namespace. Returns a vpath\n * (`difile://_store/{uuid}.{ext}`) rather than a real disk path so callers\n * cannot leak the host filesystem layout.\n *\n * Scope:\n * - source must be a `difile://`-anchored vpath (validator rejects abs paths);\n * - source from `_tmp/` materializes the renderer Blob into `_store/` via the\n * renderer-Blob \u2192 main-fs copy bridge;\n * - source from `_store/` or the user-data area is copied byte-for-byte to a\n * freshly minted `_store/{uuid}.{ext}` entry under the sandbox base.\n */\n/**\n * Resolves the saveFile destination. wx contract: an explicit `filePath`\n * names the exact destination and is echoed back as `savedFilePath` \u2014 it\n * goes through the same validator + writable gate as every other\n * write-class destination, so runtime-owned `_tmp/` / `_store/` targets\n * fail with permission denied. Only when `filePath` is omitted is a fresh\n * `_store/{uuid}` vpath minted. Reports fail + complete and returns\n * undefined when the destination is invalid.\n */\nfunction resolveSaveFileDestination(\n\ttempFilePath: string,\n\tfilePath: string | undefined,\n\tcbs: FsCallbacks,\n): { savedFilePath: string; destReal: string } | undefined {\n\tif (typeof filePath === 'string' && filePath) {\n\t\tconst dest = resolveOrBail(filePath, 'fsSaveFile', cbs)\n\t\tif (!dest) return undefined\n\t\tif (!ensureWritable(dest, 'fsSaveFile', cbs)) return undefined\n\t\treturn { savedFilePath: filePath, destReal: dest.realPath }\n\t}\n\tconst ext = _path.extname(tempFilePath) || ''\n\tconst id = _crypto.randomUUID() + ext\n\tconst savedFilePath = `difile://_store/${id}`\n\tconst destResolved = resolveVPath(savedFilePath)\n\tif (!destResolved || !destResolved.realPath) {\n\t\t// Defensive: a freshly minted vpath must always resolve.\n\t\tcbs.onFail?.({ errMsg: 'fsSaveFile:fail unable to allocate destination' })\n\t\tcbs.onComplete?.()\n\t\treturn undefined\n\t}\n\tif (containsSymlink(destResolved.realPath)) {\n\t\tcbs.onFail?.({ errMsg: 'fsSaveFile:fail invalid or unsafe path' })\n\t\tcbs.onComplete?.()\n\t\treturn undefined\n\t}\n\treturn { savedFilePath, destReal: destResolved.realPath }\n}\n\nexport function fsSaveFile(\n\tthis: MiniAppContext,\n\t{ tempFilePath, filePath, success, fail, complete }: {\n\t\ttempFilePath: string\n\t\tfilePath?: string\n\t\tsuccess?: unknown\n\t\tfail?: unknown\n\t\tcomplete?: unknown\n\t},\n) {\n\tconst cbs = bindCallbacks(this, { success, fail, complete })\n\tconst { onFail, onComplete } = cbs\n\tif (guardFsAvailable('fsSaveFile', cbs)) return\n\tconst src = resolveOrBail(tempFilePath, 'fsSaveFile', cbs)\n\tif (!src) return\n\n\tconst destination = resolveSaveFileDestination(tempFilePath, filePath, cbs)\n\tif (!destination) return\n\tconst { savedFilePath, destReal } = destination\n\n\tif (src.kind === 'tmp') {\n\t\t// Materialize the renderer Blob into _store on disk.\n\t\t_tmpBytes(tempFilePath).then(\n\t\t\tbytes => mkdirpThenWrite(destReal, 'fsSaveFile', cbs, done => _fs.writeFile(destReal, bytes, done), { savedFilePath }),\n\t\t\ttmpFailHandler('fsSaveFile', cbs),\n\t\t)\n\t\treturn\n\t}\n\tif (!src.realPath) {\n\t\tonFail?.({ errMsg: 'fsSaveFile:fail invalid src path' })\n\t\tonComplete?.()\n\t\treturn\n\t}\n\tif (src.realPath === destReal) {\n\t\t// Source and destination normalize to the same file: saving a file\n\t\t// onto itself is a defined no-op success, not whatever the host\n\t\t// Node's same-file copyFile happens to do. Still a no-op only for a\n\t\t// real file \u2014 resolveOrBail validates the path string, not the disk,\n\t\t// so a missing or directory source must fail here like any other save.\n\t\t_fs.stat(src.realPath, (statErr, st) => {\n\t\t\tif (statErr) {\n\t\t\t\tonFail?.({ errMsg: `fsSaveFile:fail ${statErr.message}` })\n\t\t\t\tonComplete?.()\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif (!st.isFile()) {\n\t\t\t\tonFail?.({ errMsg: `fsSaveFile:fail illegal operation on a directory, copyfile '${tempFilePath}'` })\n\t\t\t\tonComplete?.()\n\t\t\t\treturn\n\t\t\t}\n\t\t\tcbs.onSuccess?.({ savedFilePath, errMsg: 'fsSaveFile:ok' })\n\t\t\tonComplete?.()\n\t\t})\n\t\treturn\n\t}\n\tmkdirpThenWrite(destReal, 'fsSaveFile', cbs, done => _fs.copyFile(src.realPath!, destReal, done), { savedFilePath })\n}\n\n/**\n * List files previously persisted by `fsSaveFile` \u2014 i.e. anything under the\n * `_store/` namespace. Returned `filePath` entries are vpaths so callers can\n * round-trip through `fsReadFile` / `fsRemoveSavedFile` without ever seeing\n * the host filesystem.\n */\nexport function fsGetSavedFileList(\n\tthis: MiniAppContext,\n\t{ success, fail, complete }: { success?: unknown; fail?: unknown; complete?: unknown } = {},\n) {\n\tconst cbs = bindCallbacks(this, { success, fail, complete })\n\tconst { onSuccess, onFail, onComplete } = cbs\n\tif (guardFsAvailable('fsGetSavedFileList', cbs)) return\n\tconst storeVpath = resolveVPath('difile://_store/')\n\tconst storeDir = storeVpath?.realPath\n\tif (!storeDir) {\n\t\tonSuccess?.({ fileList: [], errMsg: 'fsGetSavedFileList:ok' })\n\t\tonComplete?.()\n\t\treturn\n\t}\n\t_fs.readdir(storeDir, (err, files) => {\n\t\tif (err) {\n\t\t\t// Only \"the store directory does not exist yet\" is a legitimate\n\t\t\t// empty list; any other readdir error (ENOTDIR, EACCES, EIO)\n\t\t\t// masked as an empty success would hide real breakage.\n\t\t\tif ((err as NodeJS.ErrnoException).code === 'ENOENT') {\n\t\t\t\tonSuccess?.({ fileList: [], errMsg: 'fsGetSavedFileList:ok' })\n\t\t\t} else {\n\t\t\t\tonFail?.({ errMsg: `fsGetSavedFileList:fail ${err.message}` })\n\t\t\t}\n\t\t\tonComplete?.()\n\t\t\treturn\n\t\t}\n\t\tlet pending = files.length\n\t\tif (pending === 0) {\n\t\t\tonSuccess?.({ fileList: [], errMsg: 'fsGetSavedFileList:ok' })\n\t\t\tonComplete?.()\n\t\t\treturn\n\t\t}\n\t\tconst fileList: Array<{ filePath: string; size: number; createTime: number }> = []\n\t\tlet settled = false\n\t\tfor (const name of files) {\n\t\t\tconst full = _path.join(storeDir, name)\n\t\t\t_fs.stat(full, (statErr, s) => {\n\t\t\t\tif (settled) return\n\t\t\t\tif (statErr) {\n\t\t\t\t\t// A partial list would misrepresent the store's contents.\n\t\t\t\t\tsettled = true\n\t\t\t\t\tonFail?.({ errMsg: `fsGetSavedFileList:fail ${statErr.message}` })\n\t\t\t\t\tonComplete?.()\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tfileList.push({\n\t\t\t\t\tfilePath: `difile://_store/${name}`,\n\t\t\t\t\tsize: s.size,\n\t\t\t\t\t// wx createTime is a seconds-unit epoch.\n\t\t\t\t\tcreateTime: Math.floor(s.birthtimeMs / 1000),\n\t\t\t\t})\n\t\t\t\tif (--pending === 0) {\n\t\t\t\t\tsettled = true\n\t\t\t\t\tonSuccess?.({ fileList, errMsg: 'fsGetSavedFileList:ok' })\n\t\t\t\t\tonComplete?.()\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t})\n}\n\nexport function fsRemoveSavedFile(\n\tthis: MiniAppContext,\n\t{ filePath, success, fail, complete }: { filePath: string; success?: unknown; fail?: unknown; complete?: unknown },\n) {\n\tconst cbs = bindCallbacks(this, { success, fail, complete })\n\tconst { onFail, onComplete } = cbs\n\tif (guardFsAvailable('fsRemoveSavedFile', cbs)) return\n\tconst v = resolveOrBail(filePath, 'fsRemoveSavedFile', cbs)\n\tif (!v) return\n\t// removeSavedFile is the documented exception to the `_store/` read-only\n\t// rule. Only `_store/*` entries may be removed through this API.\n\tif (v.kind !== 'store' || !v.realPath) {\n\t\tonFail?.({ errMsg: 'fsRemoveSavedFile:fail only _store/ entries may be removed' })\n\t\tonComplete?.()\n\t\treturn\n\t}\n\t_fs.unlink(v.realPath, nodeComplete('fsRemoveSavedFile', cbs))\n}\n\nexport function fsTruncate(\n\tthis: MiniAppContext,\n\t{ filePath, length = 0, success, fail, complete }: {\n\t\tfilePath: string\n\t\tlength?: number\n\t\tsuccess?: unknown\n\t\tfail?: unknown\n\t\tcomplete?: unknown\n\t},\n) {\n\tconst cbs = bindCallbacks(this, { success, fail, complete })\n\tif (guardFsAvailable('fsTruncate', cbs)) return\n\tconst v = resolveOrBail(filePath, 'fsTruncate', cbs)\n\tif (!v) return\n\tif (!ensureWritable(v, 'fsTruncate', cbs)) return\n\t_fs.truncate(v.realPath, length, nodeComplete('fsTruncate', cbs))\n}\n\n/**\n * Synchronous \"vpath \u2192 bytes\" read for consumers that must resolve within one\n * task (saveImageToPhotosAlbum builds its download anchor synchronously so\n * its success/fail verdict precedes `complete`). Returns null when Node fs is\n * unavailable, the vpath does not resolve to a disk-backed file (`_tmp/*`\n * bytes live in the renderer Blob registry \u2014 resolve those through\n * `resolveTempFilePath` instead), the resolved path passes through a\n * sandbox-internal symlink, or the read itself fails.\n */\nexport function readVPathBytesSync(p: unknown): Buffer | null {\n\tif (!_fs) return null\n\tconst v = resolveVPath(p)\n\tif (!v?.realPath) return null\n\tif (containsSymlink(v.realPath)) return null\n\ttry {\n\t\treturn _fs.readFileSync(v.realPath)\n\t} catch {\n\t\treturn null\n\t}\n}\n", "/**\n * DevTools API stubs for media-related wx.xxx APIs\n * (image / video / audio).\n *\n * Each exported function is bound with `this` = MiniApp instance\n * (via AppManager.registerApi \u2192 MiniApp.invokeApi).\n */\n\nimport type { MiniAppContext } from './types'\nimport { bindDomEvents, type EventBridgeDisposer } from './event-bridge'\nimport { bindCallbacks } from './simulator-api-helpers'\nimport { readVPathBytesSync } from './simulator-api-fs'\nimport { createTempFilePath, createTempFilePathAsync, resolveTempFilePath } from './temp-files'\n\n// \u2500\u2500\u2500 shared file-picker scaffolding \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n//\n// chooseImage / chooseVideo / chooseMedia all drive the browser file picker\n// through a hidden `<input type=file>`: create it, wire accept/multiple/\n// capture from the caller's options, listen for `change`, and report a\n// `${apiName}:fail cancel` when the user closes the dialog without picking\n// anything. `createFilePicker` is the single authority for that scaffold;\n// each API supplies only its accept string, multiplicity, and the\n// (possibly async) processing of the picked files.\n\ntype CancelCallbacks = Pick<ReturnType<typeof bindCallbacks>, 'onFail' | 'onComplete'>\n\ninterface FilePickerConfig {\n\taccept: string\n\tmultiple: boolean\n\t/** `capture` attribute value, or `undefined` to omit it (album source, or no single-camera source requested). */\n\tcapture?: 'user' | 'environment'\n}\n\n/** Resolves the `capture` attribute from `sourceType` + `camera`: only set when the caller asked for camera-only capture. */\nfunction captureAttrFor(sourceType: string[], camera: unknown): 'user' | 'environment' | undefined {\n\tif (sourceType.length !== 1 || sourceType[0] !== 'camera') return undefined\n\treturn camera === 'front' ? 'user' : 'environment'\n}\n\n/**\n * Drives a hidden `<input type=file>` through one pick cycle. Reports\n * `${apiName}:fail cancel` + `complete` when the selection is empty;\n * otherwise hands the raw (un-truncated) `FileList` to `onPick`, which owns\n * success/fail/complete and must call `removeInput` once it is done with the\n * picker element.\n */\nfunction createFilePicker(\n\tapiName: string,\n\tconfig: FilePickerConfig,\n\tcbs: CancelCallbacks,\n\tonPick: (files: File[], removeInput: () => void) => void | Promise<void>,\n): void {\n\tconst input = document.createElement('input')\n\tinput.type = 'file'\n\tinput.accept = config.accept\n\tinput.multiple = config.multiple\n\tif (config.capture) input.setAttribute('capture', config.capture)\n\tinput.style.display = 'none'\n\tdocument.body.appendChild(input)\n\n\tconst removeInput = () => input.remove()\n\n\tinput.addEventListener('change', () => {\n\t\tconst files = Array.from(input.files || [])\n\t\tif (files.length === 0) {\n\t\t\tcbs.onFail?.({ errMsg: `${apiName}:fail cancel` })\n\t\t\tcbs.onComplete?.()\n\t\t\tremoveInput()\n\t\t\treturn\n\t\t}\n\t\tvoid onPick(files, removeInput)\n\t})\n\n\tinput.click()\n}\n\n// \u2500\u2500\u2500 Media: Image \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport function chooseImage(\n\tthis: MiniAppContext,\n\t{ count = 9, sourceType, camera, success, fail, complete }: {\n\t\tcount?: number\n\t\tsizeType?: unknown\n\t\tsourceType?: unknown\n\t\tcamera?: unknown\n\t\tsuccess?: unknown\n\t\tfail?: unknown\n\t\tcomplete?: unknown\n\t},\n) {\n\tconst cbs = bindCallbacks(this, { success, fail, complete })\n\tconst { onSuccess, onComplete } = cbs\n\tconst normalizedCount = normalizeChooseMediaCount(count)\n\tconst normalizedSourceType = normalizeStringArray(sourceType, ['album', 'camera'])\n\n\tcreateFilePicker(\n\t\t'chooseImage',\n\t\t{ accept: 'image/*', multiple: normalizedCount > 1, capture: captureAttrFor(normalizedSourceType, camera) },\n\t\tcbs,\n\t\t(rawFiles, removeInput) => {\n\t\t\tconst files = rawFiles.slice(0, normalizedCount)\n\t\t\tconst tempFilePaths = files.map(f => createTempFilePath(f))\n\t\t\tconst tempFiles = files.map((f, i) => ({ path: tempFilePaths[i], size: f.size }))\n\t\t\tonSuccess?.({ tempFilePaths, tempFiles, errMsg: 'chooseImage:ok' })\n\t\t\tonComplete?.()\n\t\t\tremoveInput()\n\t\t},\n\t)\n}\n\nexport function previewImage(\n\tthis: MiniAppContext,\n\t{ urls, current, success, complete }: { urls?: string[]; current?: string; success?: unknown; complete?: unknown },\n) {\n\tconst { onSuccess, onComplete } = bindCallbacks(this, { success, complete })\n\n\tif (!urls || urls.length === 0) {\n\t\tonComplete?.()\n\t\treturn\n\t}\n\n\t// Simple overlay preview\n\tconst overlay = document.createElement('div')\n\toverlay.style.cssText =\n\t\t'position:fixed;inset:0;z-index:99999;background:rgba(0,0,0,.85);display:flex;align-items:center;justify-content:center;cursor:pointer;'\n\tconst img = document.createElement('img')\n\timg.src = current || urls[0] || ''\n\timg.style.cssText = 'max-width:90%;max-height:90%;object-fit:contain;'\n\toverlay.appendChild(img)\n\toverlay.addEventListener('click', () => overlay.remove())\n\tdocument.body.appendChild(overlay)\n\n\tonSuccess?.({ errMsg: 'previewImage:ok' })\n\tonComplete?.()\n}\n\nexport function compressImage(\n\tthis: MiniAppContext,\n\t{ src, quality = 80, success, fail, complete }: {\n\t\tsrc: string\n\t\tquality?: number\n\t\tsuccess?: unknown\n\t\tfail?: unknown\n\t\tcomplete?: unknown\n\t},\n) {\n\tconst { onSuccess, onFail, onComplete } = bindCallbacks(this, { success, fail, complete })\n\n\tconst img = new Image()\n\timg.crossOrigin = 'anonymous'\n\timg.onload = () => {\n\t\ttry {\n\t\t\tconst canvas = document.createElement('canvas')\n\t\t\tcanvas.width = img.naturalWidth\n\t\t\tcanvas.height = img.naturalHeight\n\t\t\tconst ctx = canvas.getContext('2d')!\n\t\t\tctx.drawImage(img, 0, 0)\n\t\t\tcanvas.toBlob(\n\t\t\t\t(blob) => {\n\t\t\t\t\tif (blob) {\n\t\t\t\t\t\tconst tempFilePath = createTempFilePath(blob)\n\t\t\t\t\t\tonSuccess?.({ tempFilePath, errMsg: 'compressImage:ok' })\n\t\t\t\t\t} else {\n\t\t\t\t\t\tonFail?.({ errMsg: 'compressImage:fail compression error' })\n\t\t\t\t\t}\n\t\t\t\t\tonComplete?.()\n\t\t\t\t},\n\t\t\t\t'image/jpeg',\n\t\t\t\tquality / 100,\n\t\t\t)\n\t\t} catch (error) {\n\t\t\tonFail?.({ errMsg: `compressImage:fail ${(error as Error).message}` })\n\t\t\tonComplete?.()\n\t\t}\n\t}\n\timg.onerror = () => {\n\t\tonFail?.({ errMsg: 'compressImage:fail image load error' })\n\t\tonComplete?.()\n\t}\n\timg.src = src\n}\n\n// Same ceiling the three native containers enforce on a canvas export (android\n// ImageApi.kt, iOS ImageAPI.swift, harmony DMPContainerBridgesModule+Canvas.ets), so\n// an export that a device would reject does not quietly succeed in the simulator.\n// The base64 form is only a cheap pre-filter: base64 runs a third longer than the\n// bytes it carries, so a payload can pass it and still decode past the byte ceiling.\nexport const MAX_CANVAS_IMAGE_BYTES = 32 * 1024 * 1024\nexport const MAX_CANVAS_BASE64_CHARS = Math.floor(MAX_CANVAS_IMAGE_BYTES * 4 / 3) + 8\n\n// A file named .png that is not a PNG is useless to whoever reads the temp file back,\n// so the native containers check the signature before writing and report the payload\n// as invalid rather than minting a broken file.\nconst PNG_SIGNATURE = [0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A]\nfunction matchesImageType(bytes: Uint8Array, fileType: 'png' | 'jpg'): boolean {\n\tif (fileType === 'png') {\n\t\treturn bytes.length >= PNG_SIGNATURE.length && PNG_SIGNATURE.every((byte, i) => bytes[i] === byte)\n\t}\n\treturn bytes.length >= 3 && bytes[0] === 0xFF && bytes[1] === 0xD8 && bytes[2] === 0xFF\n}\n\n// The render layer strips the data-URL prefix before it invokes the container, so a\n// prefix reaching here comes from a hand-built payload; the native containers accept\n// it only for the image types canvas can produce.\nconst CANVAS_DATA_URL_PREFIX = /^data:image\\/(png|jpeg|jpg);base64,/\nconst STRICT_BASE64 = /^[A-Za-z0-9+/]*={0,2}$/\n\n// The three containers put the appId straight into a sandbox path, so they reject one\n// that could climb out of it. The simulator names temp files by uuid and never builds a\n// path from the appId, but a mini program branches on errMsg, so an appId the containers\n// refuse must be refused here too rather than exporting fine only in the simulator.\nconst SAFE_CANVAS_APP_ID = /^[A-Za-z0-9._-]+$/\nfunction isValidCanvasAppId(appId: unknown): boolean {\n\treturn typeof appId === 'string' && SAFE_CANVAS_APP_ID.test(appId) && appId !== '.' && appId !== '..'\n}\n\n// Rejects a payload whose declared shape can't have come out of a canvas, and hands\n// back the base64 body once it can.\nfunction readCanvasDataURL(\n\tdataURL: string,\n\tfileType: string,\n\tappId: unknown,\n): { reason: string } | { base64Data: string; fileType: 'png' | 'jpg' } {\n\tif (!dataURL || typeof dataURL !== 'string') return { reason: 'dataURL is required' }\n\tif (fileType !== 'png' && fileType !== 'jpg') return { reason: 'invalid file type' }\n\tif (!isValidCanvasAppId(appId)) return { reason: 'invalid appId' }\n\n\tconst prefix = CANVAS_DATA_URL_PREFIX.exec(dataURL)\n\tif (dataURL.startsWith('data:') && !prefix) return { reason: 'invalid dataURL' }\n\tconst declaredType = prefix?.[1]\n\tif (declaredType && declaredType !== fileType && !(declaredType === 'jpeg' && fileType === 'jpg')) {\n\t\treturn { reason: 'file type mismatch' }\n\t}\n\n\treturn { base64Data: prefix ? dataURL.slice(prefix[0].length) : dataURL, fileType }\n}\n\n// Node/browser `atob` follows WHATWG forgiving-base64: a payload whose length leaves a\n// remainder of 2 or 3 still decodes. The native decoders reject it, so the length and\n// the alphabet are checked here rather than left to a throw.\nfunction isStrictBase64(base64Data: string): boolean {\n\treturn !!base64Data && base64Data.length % 4 === 0 && STRICT_BASE64.test(base64Data)\n}\n\n// Same in-flight budget the three containers apply per appId (android\n// MAX_IN_FLIGHT_CANVAS_EXPORTS / MAX_PENDING_CANVAS_BASE64_CHARS, iOS\n// maxInFlightCanvasExports, harmony CanvasExportJobRegistry): one export writing while a\n// second waits is fine, past that it is just piling up. Each waiting export still holds\n// its own copy of the payload, so the budget counts base64 characters, not just calls,\n// and it is claimed before anything else takes a reference to the bytes.\nconst MAX_IN_FLIGHT_CANVAS_EXPORTS = 2\nconst MAX_PENDING_CANVAS_BASE64_CHARS = MAX_IN_FLIGHT_CANVAS_EXPORTS * MAX_CANVAS_BASE64_CHARS\nconst pendingCanvasExports = new Map<string, { count: number; chars: number }>()\n\nfunction reserveCanvasExport(appId: string, chars: number): boolean {\n\tconst state = pendingCanvasExports.get(appId) ?? { count: 0, chars: 0 }\n\tif (state.count >= MAX_IN_FLIGHT_CANVAS_EXPORTS) return false\n\tif (state.chars + chars > MAX_PENDING_CANVAS_BASE64_CHARS) return false\n\tstate.count += 1\n\tstate.chars += chars\n\tpendingCanvasExports.set(appId, state)\n\treturn true\n}\n\nfunction releaseCanvasExport(appId: string, chars: number): void {\n\tconst state = pendingCanvasExports.get(appId)\n\tif (!state) return\n\tstate.count -= 1\n\tstate.chars -= chars\n\tif (state.count <= 0) pendingCanvasExports.delete(appId)\n}\n\n// Decodes the reserved payload and holds it to the same content rules as the containers:\n// the base64 ceiling is only a pre-filter, so the byte count and the file signature are\n// checked on the real bytes.\nfunction decodeCanvasBytes(base64Data: string, fileType: 'png' | 'jpg'): { reason: string } | { blob: Blob } {\n\tlet bytes: Uint8Array<ArrayBuffer>\n\ttry {\n\t\tconst byteChars = atob(base64Data)\n\t\tbytes = new Uint8Array(byteChars.length)\n\t\tfor (let i = 0; i < byteChars.length; i++) {\n\t\t\tbytes[i] = byteChars.charCodeAt(i)\n\t\t}\n\t} catch {\n\t\treturn { reason: 'base64 decode failed' }\n\t}\n\n\tif (bytes.length > MAX_CANVAS_IMAGE_BYTES) return { reason: 'data too large' }\n\tif (!matchesImageType(bytes, fileType)) return { reason: 'invalid image data' }\n\n\treturn { blob: new Blob([bytes], { type: fileType === 'jpg' ? 'image/jpeg' : 'image/png' }) }\n}\n\nexport async function saveCanvasTempFile(\n\tthis: MiniAppContext,\n\t{ dataURL, fileType = 'png', success, fail, complete }: { dataURL: string; fileType?: string; success?: unknown; fail?: unknown; complete?: unknown },\n) {\n\tconst { onSuccess, onFail, onComplete } = bindCallbacks(this, { success, fail, complete })\n\n\tconst failWith = (reason: string) => {\n\t\tconst result = { errMsg: `canvasToTempFilePath:fail ${reason}` }\n\t\tonFail?.(result)\n\t\tonComplete?.(result)\n\t}\n\n\t// Order and wording of every rejection mirror the native containers (android\n\t// ImageApi.kt, iOS ImageAPI.swift, harmony DMPContainerBridgesModule+Canvas.ets):\n\t// the errMsg is what a mini program branches on, so it must not differ per host.\n\tconst head = readCanvasDataURL(dataURL, fileType, this.appId)\n\tif ('reason' in head) {\n\t\tfailWith(head.reason)\n\t\treturn\n\t}\n\tconst { base64Data, fileType: imageType } = head\n\n\tif (base64Data.length > MAX_CANVAS_BASE64_CHARS) {\n\t\tfailWith('data too large')\n\t\treturn\n\t}\n\tif (!isStrictBase64(base64Data)) {\n\t\tfailWith('base64 decode failed')\n\t\treturn\n\t}\n\t// Claimed before the decode allocates anything, so a rejected export costs nothing.\n\tif (!reserveCanvasExport(this.appId, base64Data.length)) {\n\t\tfailWith('too many pending exports')\n\t\treturn\n\t}\n\n\ttry {\n\t\tconst decoded = decodeCanvasBytes(base64Data, imageType)\n\t\tif ('reason' in decoded) {\n\t\t\tfailWith(decoded.reason)\n\t\t\treturn\n\t\t}\n\t\tconst tempFilePath = await createTempFilePathAsync(decoded.blob)\n\t\tconst result = { tempFilePath, errMsg: 'canvasToTempFilePath:ok' }\n\t\tonSuccess?.(result)\n\t\tonComplete?.(result)\n\t} catch (error) {\n\t\t// The store's own error text (a disposed runtime, a rejected IPC) says nothing\n\t\t// to a mini program, and native reports every write failure the same way \u2014 keep\n\t\t// the cause in the devtools console instead of in errMsg.\n\t\tconsole.warn('[simulator] canvas temp file write failed', error)\n\t\tfailWith('write failed')\n\t} finally {\n\t\treleaseCanvasExport(this.appId, base64Data.length)\n\t}\n}\n\nexport function saveImageToPhotosAlbum(\n\tthis: MiniAppContext,\n\t{ filePath, success, fail, complete }: { filePath: string; success?: unknown; fail?: unknown; complete?: unknown },\n) {\n\tconst { onSuccess, onFail, onComplete } = bindCallbacks(this, { success, fail, complete })\n\n\tconst triggerDownload = (href: string) => {\n\t\tconst a = document.createElement('a')\n\t\ta.href = href\n\t\ta.download = 'image'\n\t\ta.click()\n\t}\n\n\tif (typeof filePath === 'string' && filePath.startsWith('difile://_tmp/')) {\n\t\t// The simulator's temp-file scheme (chooseImage / chooseMedia /\n\t\t// compressImage mint these via createTempFilePath): the bytes live in\n\t\t// the renderer Blob registry, so resolution is async. The async branch\n\t\t// owns its whole verdict \u2014 success/fail strictly before complete.\n\t\tresolveTempFilePath(filePath)\n\t\t\t.then(\n\t\t\t\tblob =>\n\t\t\t\t\tnew Promise<string>((resolve, reject) => {\n\t\t\t\t\t\tconst reader = new FileReader()\n\t\t\t\t\t\treader.onerror = () => reject(reader.error ?? new Error('blob read failed'))\n\t\t\t\t\t\treader.onload = () => resolve(String(reader.result))\n\t\t\t\t\t\treader.readAsDataURL(blob)\n\t\t\t\t\t}),\n\t\t\t)\n\t\t\t.then(\n\t\t\t\t(href) => {\n\t\t\t\t\ttriggerDownload(href)\n\t\t\t\t\tonSuccess?.({ errMsg: 'saveImageToPhotosAlbum:ok' })\n\t\t\t\t\tonComplete?.()\n\t\t\t\t},\n\t\t\t\t(err: unknown) => {\n\t\t\t\t\tconst msg = err instanceof Error ? err.message : String(err)\n\t\t\t\t\tonFail?.({ errMsg: `saveImageToPhotosAlbum:fail ${msg}` })\n\t\t\t\t\tonComplete?.()\n\t\t\t\t},\n\t\t\t)\n\t\treturn\n\t}\n\n\ttry {\n\t\tif (typeof filePath === 'string' && filePath.startsWith('difile://')) {\n\t\t\tconst bytes = readVPathBytesSync(filePath)\n\t\t\tif (bytes) {\n\t\t\t\t// A data: href keeps the whole verdict synchronous (success before\n\t\t\t\t// complete) without needing URL.createObjectURL.\n\t\t\t\ttriggerDownload(`data:application/octet-stream;base64,${bytes.toString('base64')}`)\n\t\t\t\tonSuccess?.({ errMsg: 'saveImageToPhotosAlbum:ok' })\n\t\t\t} else {\n\t\t\t\tonFail?.({ errMsg: 'saveImageToPhotosAlbum:fail no such file' })\n\t\t\t}\n\t\t} else {\n\t\t\t// Real dimina clients (Android / iOS / Harmony) only accept a local\n\t\t\t// file path \u2014 a dataURL, remote http(s) URL, or blob: URL (which no\n\t\t\t// simulator code path ever mints as a filePath) fails on device, so\n\t\t\t// the simulator must not \"succeed\" on it either.\n\t\t\tonFail?.({ errMsg: 'saveImageToPhotosAlbum:fail invalid file path' })\n\t\t}\n\t} catch (error) {\n\t\tonFail?.({ errMsg: `saveImageToPhotosAlbum:fail ${(error as Error).message}` })\n\t}\n\tonComplete?.()\n}\n\nexport function getImageInfo(\n\tthis: MiniAppContext,\n\t{ src, success, fail, complete }: { src: string; success?: unknown; fail?: unknown; complete?: unknown },\n) {\n\tconst { onSuccess, onFail, onComplete } = bindCallbacks(this, { success, fail, complete })\n\n\tconst img = new Image()\n\timg.crossOrigin = 'anonymous'\n\timg.onload = () => {\n\t\tonSuccess?.({\n\t\t\twidth: img.naturalWidth,\n\t\t\theight: img.naturalHeight,\n\t\t\tpath: src,\n\t\t\torientation: 'up',\n\t\t\ttype: 'unknown',\n\t\t\terrMsg: 'getImageInfo:ok',\n\t\t})\n\t\tonComplete?.()\n\t}\n\timg.onerror = () => {\n\t\tonFail?.({ errMsg: 'getImageInfo:fail image load error' })\n\t\tonComplete?.()\n\t}\n\timg.src = src\n}\n\n// \u2500\u2500\u2500 Media: Video \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\ntype MediaFileType = 'image' | 'video'\ntype ChooseMediaCamera = 'back' | 'front'\n\nconst VIDEO_METADATA_TIMEOUT_MS = 5000\nconst VIDEO_THUMBNAIL_TIMEOUT_MS = 500\n\ninterface ChooseMediaTempFile {\n\ttempFilePath: string\n\tsize: number\n\tduration: number\n\theight: number\n\twidth: number\n\tthumbTempFilePath: string\n\tfileType: MediaFileType\n\toriginalFileObj: File\n}\n\nfunction normalizeStringArray(value: unknown, fallback: string[]): string[] {\n\treturn Array.isArray(value)\n\t\t? value.filter((item): item is string => typeof item === 'string')\n\t\t: fallback\n}\n\nfunction normalizeChooseMediaCount(value: unknown): number {\n\tconst n = Number(value)\n\tif (!Number.isFinite(n)) return 9\n\treturn Math.max(1, Math.min(20, Math.floor(n)))\n}\n\nfunction getChooseMediaAccept(mediaType: string[]): string {\n\tconst wantsMix = mediaType.includes('mix')\n\tconst wantsImage = wantsMix || mediaType.includes('image')\n\tconst wantsVideo = wantsMix || mediaType.includes('video')\n\tif (wantsImage && wantsVideo) return 'image/*,video/*'\n\treturn wantsVideo ? 'video/*' : 'image/*'\n}\n\nfunction getChooseMediaResultType(files: ChooseMediaTempFile[]): 'image' | 'video' | 'mix' {\n\tconst types = new Set(files.map(file => file.fileType))\n\tif (types.size > 1) return 'mix'\n\treturn files[0]?.fileType ?? 'image'\n}\n\nfunction readImageMetadata(src: string): Promise<{ width: number; height: number }> {\n\treturn new Promise((resolve) => {\n\t\tconst img = new Image()\n\t\timg.onload = () => resolve({ width: img.naturalWidth || 0, height: img.naturalHeight || 0 })\n\t\timg.onerror = () => resolve({ width: 0, height: 0 })\n\t\timg.src = src\n\t})\n}\n\nfunction readVideoMetadata(src: string): Promise<{ width: number; height: number; duration: number; thumbTempFilePath: string }> {\n\treturn new Promise((resolve) => {\n\t\tconst video = document.createElement('video')\n\t\tlet settled = false\n\t\tlet seekTimer: ReturnType<typeof setTimeout> | undefined\n\t\tconst finish = (metadata: { width: number; height: number; duration: number; thumbTempFilePath: string }) => {\n\t\t\tif (settled) return\n\t\t\tsettled = true\n\t\t\tclearTimeout(timer)\n\t\t\tif (seekTimer) clearTimeout(seekTimer)\n\t\t\t// Detach handlers so any late-firing DOM events (e.g. onseeked from a\n\t\t\t// previously queued currentTime change) cannot reach into the now-\n\t\t\t// resolved promise and allocate fresh blob: URLs.\n\t\t\tvideo.onloadedmetadata = null\n\t\t\tvideo.onseeked = null\n\t\t\tvideo.onerror = null\n\t\t\tvideo.removeAttribute('src')\n\t\t\tvideo.load()\n\t\t\tresolve(metadata)\n\t\t}\n\t\tconst drawThumbnail = (width: number, height: number): Promise<string> => {\n\t\t\treturn new Promise((resolveThumb) => {\n\t\t\t\tlet resolved = false\n\t\t\t\tconst done = (value: string) => {\n\t\t\t\t\tif (resolved) return\n\t\t\t\t\tresolved = true\n\t\t\t\t\tresolveThumb(value)\n\t\t\t\t}\n\t\t\t\tlet canvas: HTMLCanvasElement\n\t\t\t\ttry {\n\t\t\t\t\tcanvas = document.createElement('canvas')\n\t\t\t\t\tcanvas.width = width || 1\n\t\t\t\t\tcanvas.height = height || 1\n\t\t\t\t\tconst ctx = canvas.getContext('2d')\n\t\t\t\t\tctx?.drawImage(video, 0, 0, canvas.width, canvas.height)\n\t\t\t\t} catch {\n\t\t\t\t\tdone('')\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tconst toDataUrlFallback = () => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tdone(canvas.toDataURL('image/jpeg', 0.8))\n\t\t\t\t\t} catch {\n\t\t\t\t\t\tdone('')\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst fallbackTimer = setTimeout(toDataUrlFallback, VIDEO_THUMBNAIL_TIMEOUT_MS)\n\t\t\t\ttry {\n\t\t\t\t\tcanvas.toBlob(\n\t\t\t\t\t\t(blob) => {\n\t\t\t\t\t\t\tclearTimeout(fallbackTimer)\n\t\t\t\t\t\t\t// If the outer readVideoMetadata promise already settled\n\t\t\t\t\t\t\t// (e.g. the seekTimer fired before toBlob's async callback\n\t\t\t\t\t\t\t// arrived), we MUST NOT call createTempFilePath here \u2014 that\n\t\t\t\t\t\t\t// would allocate a fresh blob: URL and register it in the\n\t\t\t\t\t\t\t// temp-files Map with no one ever revoking it. Just drop\n\t\t\t\t\t\t\t// the blob on the floor; the resolved thumbTempFilePath\n\t\t\t\t\t\t\t// has already been chosen by the timeout path.\n\t\t\t\t\t\t\tif (settled || resolved) return\n\t\t\t\t\t\t\tif (blob) {\n\t\t\t\t\t\t\t\tdone(createTempFilePath(blob))\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\ttoDataUrlFallback()\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\t'image/jpeg',\n\t\t\t\t\t\t0.8,\n\t\t\t\t\t)\n\t\t\t\t} catch {\n\t\t\t\t\tclearTimeout(fallbackTimer)\n\t\t\t\t\ttoDataUrlFallback()\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t\tconst timer = setTimeout(() => finish({ width: 0, height: 0, duration: 0, thumbTempFilePath: '' }), VIDEO_METADATA_TIMEOUT_MS)\n\n\t\tvideo.preload = 'metadata'\n\t\tvideo.muted = true\n\t\tvideo.onloadedmetadata = () => {\n\t\t\tconst width = video.videoWidth || 0\n\t\t\tconst height = video.videoHeight || 0\n\t\t\tconst duration = Number.isFinite(video.duration) ? video.duration : 0\n\t\t\tconst metadata = { width, height, duration, thumbTempFilePath: '' }\n\t\t\tif (!width || !height || duration <= 0) {\n\t\t\t\tfinish(metadata)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tvideo.onseeked = async () => {\n\t\t\t\tif (seekTimer) {\n\t\t\t\t\tclearTimeout(seekTimer)\n\t\t\t\t\tseekTimer = undefined\n\t\t\t\t}\n\t\t\t\tconst thumbTempFilePath = await drawThumbnail(width, height)\n\t\t\t\tfinish({ ...metadata, thumbTempFilePath })\n\t\t\t}\n\t\t\tseekTimer = setTimeout(() => finish(metadata), VIDEO_THUMBNAIL_TIMEOUT_MS)\n\t\t\ttry {\n\t\t\t\tvideo.currentTime = Math.min(0.1, Math.max(0, duration - 0.01))\n\t\t\t} catch {\n\t\t\t\tfinish(metadata)\n\t\t\t}\n\t\t}\n\t\tvideo.onerror = () => finish({ width: 0, height: 0, duration: 0, thumbTempFilePath: '' })\n\t\tvideo.src = src\n\t})\n}\n\nasync function buildChooseMediaTempFile(file: File): Promise<ChooseMediaTempFile> {\n\tconst tempFilePath = createTempFilePath(file)\n\tconst fileType: MediaFileType = file.type.startsWith('video') ? 'video' : 'image'\n\n\tif (fileType === 'video') {\n\t\tconst metadata = await readVideoMetadata(tempFilePath)\n\t\treturn {\n\t\t\ttempFilePath,\n\t\t\tsize: file.size,\n\t\t\tduration: metadata.duration,\n\t\t\theight: metadata.height,\n\t\t\twidth: metadata.width,\n\t\t\tthumbTempFilePath: metadata.thumbTempFilePath,\n\t\t\tfileType,\n\t\t\toriginalFileObj: file,\n\t\t}\n\t}\n\n\tconst metadata = await readImageMetadata(tempFilePath)\n\treturn {\n\t\ttempFilePath,\n\t\tsize: file.size,\n\t\tduration: 0,\n\t\theight: metadata.height,\n\t\twidth: metadata.width,\n\t\tthumbTempFilePath: '',\n\t\tfileType,\n\t\toriginalFileObj: file,\n\t}\n}\n\nexport function chooseMedia(\n\tthis: MiniAppContext,\n\t{ count = 9, mediaType = ['image', 'video'], sourceType = ['album', 'camera'], camera = 'back', success, fail, complete }: {\n\t\tcount?: number\n\t\tmediaType?: unknown\n\t\tsourceType?: unknown\n\t\tmaxDuration?: unknown\n\t\tsizeType?: unknown\n\t\tcamera?: ChooseMediaCamera\n\t\tsuccess?: unknown\n\t\tfail?: unknown\n\t\tcomplete?: unknown\n\t},\n) {\n\tconst cbs = bindCallbacks(this, { success, fail, complete })\n\tconst { onSuccess, onFail, onComplete } = cbs\n\tconst normalizedCount = normalizeChooseMediaCount(count)\n\tconst normalizedMediaType = normalizeStringArray(mediaType, ['image', 'video'])\n\tconst normalizedSourceType = normalizeStringArray(sourceType, ['album', 'camera'])\n\n\tcreateFilePicker(\n\t\t'chooseMedia',\n\t\t{\n\t\t\taccept: getChooseMediaAccept(normalizedMediaType),\n\t\t\tmultiple: normalizedCount > 1,\n\t\t\tcapture: captureAttrFor(normalizedSourceType, camera),\n\t\t},\n\t\tcbs,\n\t\tasync (rawFiles, removeInput) => {\n\t\t\tconst files = rawFiles.slice(0, normalizedCount)\n\t\t\ttry {\n\t\t\t\tconst tempFiles = await Promise.all(files.map(buildChooseMediaTempFile))\n\t\t\t\tonSuccess?.({\n\t\t\t\t\ttempFiles,\n\t\t\t\t\ttype: getChooseMediaResultType(tempFiles),\n\t\t\t\t\tfailedCount: 0,\n\t\t\t\t\terrMsg: 'chooseMedia:ok',\n\t\t\t\t})\n\t\t\t} catch (error) {\n\t\t\t\tonFail?.({ errMsg: `chooseMedia:fail ${(error as Error).message}` })\n\t\t\t} finally {\n\t\t\t\tonComplete?.()\n\t\t\t\tremoveInput()\n\t\t\t}\n\t\t},\n\t)\n}\n\nexport function chooseVideo(\n\tthis: MiniAppContext,\n\t{ sourceType, camera, success, fail, complete }: {\n\t\tsourceType?: unknown\n\t\tcompressed?: unknown\n\t\tmaxDuration?: unknown\n\t\tcamera?: unknown\n\t\tsuccess?: unknown\n\t\tfail?: unknown\n\t\tcomplete?: unknown\n\t},\n) {\n\tconst cbs = bindCallbacks(this, { success, fail, complete })\n\tconst { onSuccess, onComplete } = cbs\n\tconst normalizedSourceType = normalizeStringArray(sourceType, ['album', 'camera'])\n\n\tcreateFilePicker(\n\t\t'chooseVideo',\n\t\t{ accept: 'video/*', multiple: false, capture: captureAttrFor(normalizedSourceType, camera) },\n\t\tcbs,\n\t\tasync (files, removeInput) => {\n\t\t\tconst file = files[0]!\n\t\t\tconst tempFilePath = createTempFilePath(file)\n\t\t\tconst metadata = await readVideoMetadata(tempFilePath)\n\t\t\tonSuccess?.({\n\t\t\t\ttempFilePath,\n\t\t\t\tduration: metadata.duration,\n\t\t\t\tsize: file.size,\n\t\t\t\twidth: metadata.width,\n\t\t\t\theight: metadata.height,\n\t\t\t\terrMsg: 'chooseVideo:ok',\n\t\t\t})\n\t\t\tonComplete?.()\n\t\t\tremoveInput()\n\t\t},\n\t)\n}\n\n// \u2500\u2500\u2500 Media: Audio (container-side handlers for service-apis/audio) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n// service-apis/audio/index.js (injected into the service Worker by the dimina\n// container bundle) calls invokeAPI('audioCreate', { audioId }), etc. DOM media\n// events on the container's HTMLAudioElement are bridged back to the service\n// layer via the `audioListen` handler.\n\n/** Payload delivered to the service-side dispatcher on every audio event. */\ninterface AudioEventPayload {\n\tevent: string\n\tcurrentTime: number\n\tduration: number\n\tbuffered: number\n\tpaused: boolean\n}\n\n/** DOM media event name \u2192 mini-program audio event name. */\nconst AUDIO_EVENT_MAP: Record<string, string> = {\n\tplay: 'play',\n\tpause: 'pause',\n\tended: 'ended',\n\terror: 'error',\n\ttimeupdate: 'timeUpdate',\n\twaiting: 'waiting',\n\tseeking: 'seeking',\n\tseeked: 'seeked',\n\tcanplay: 'canplay',\n}\n\nconst _newAudioInstances = new Map<number, HTMLAudioElement>()\n/** Disposers that unbind the DOM event bridge for a given audio instance. */\nconst _audioEventDisposers = new Map<number, EventBridgeDisposer>()\n/** The service-side dispatcher callback for a given audio instance. */\nconst _audioFire = new Map<number, (payload: AudioEventPayload) => void>()\n\n/** Snapshot the current playback state of an audio element. */\nfunction audioSnapshot(audio: HTMLAudioElement, event: string): AudioEventPayload {\n\treturn {\n\t\tevent,\n\t\tcurrentTime: audio.currentTime || 0,\n\t\tduration: Number.isFinite(audio.duration) ? audio.duration : 0,\n\t\tbuffered: audio.buffered.length ? audio.buffered.end(audio.buffered.length - 1) : 0,\n\t\tpaused: audio.paused,\n\t}\n}\n\nexport function audioCreate(this: MiniAppContext, { audioId }: { audioId: number }) {\n\t_newAudioInstances.set(audioId, new Audio())\n}\n\n/**\n * Persistent event-bridge registration. The service-side InnerAudioContext\n * calls this once at construction with a `keep: true` callback; the container\n * resolves a `fire` callback and binds the DOM media events of the matching\n * audio element to it.\n *\n * The dimina service `invokeAPI` runs every callback through\n * `callback.store(success, keep, evtId)` and delivers the resulting callback\n * id under the `success` field of `params` \u2014 `evtId` itself is consumed by\n * `callback.store` and never reaches the container payload. So the handler\n * resolves `fire` from `success`, exactly like every other media API.\n */\nexport function audioListen(this: MiniAppContext, { audioId, success }: { audioId: number; success: unknown }) {\n\tconst audio = _newAudioInstances.get(audioId)\n\tconst fire = this.createCallbackFunction(success) as ((payload: AudioEventPayload) => void) | undefined\n\tif (!audio || !fire) return\n\n\t_audioFire.set(audioId, fire)\n\n\t// Rebind cleanly if audioListen is somehow called twice for one instance.\n\t_audioEventDisposers.get(audioId)?.()\n\tconst dispose = bindDomEvents<AudioEventPayload>(\n\t\taudio,\n\t\tAUDIO_EVENT_MAP,\n\t\tfire,\n\t\tevent => audioSnapshot(audio, event),\n\t)\n\t_audioEventDisposers.set(audioId, dispose)\n}\n\nexport function audioSetProp(\n\tthis: MiniAppContext,\n\t{ audioId, prop, value, startTime, loop, volume, playbackRate, autoplay }: {\n\t\taudioId: number\n\t\tprop: string\n\t\tvalue: unknown\n\t\tstartTime?: number\n\t\tloop?: boolean\n\t\tvolume?: number\n\t\tplaybackRate?: number\n\t\tautoplay?: boolean\n\t},\n) {\n\tconst audio = _newAudioInstances.get(audioId)\n\tif (!audio) return\n\tswitch (prop) {\n\t\tcase 'src':\n\t\t\taudio.src = value as string\n\t\t\tif (startTime != null) audio.currentTime = startTime\n\t\t\tif (loop != null) audio.loop = loop\n\t\t\tif (volume != null) audio.volume = Math.max(0, Math.min(1, volume))\n\t\t\tif (playbackRate != null) audio.playbackRate = playbackRate\n\t\t\tif (autoplay) audio.play().catch(() => {})\n\t\t\tbreak\n\t\tcase 'startTime': audio.currentTime = Number(value) || 0; break\n\t\tcase 'autoplay': audio.autoplay = !!value; break\n\t\tcase 'loop': audio.loop = !!value; break\n\t\tcase 'volume': audio.volume = Math.max(0, Math.min(1, Number(value) || 0)); break\n\t\tcase 'playbackRate': audio.playbackRate = Number(value) || 1; break\n\t}\n}\n\nexport function audioPlay(this: MiniAppContext, { audioId, src }: { audioId: number; src?: string }) {\n\tconst audio = _newAudioInstances.get(audioId)\n\tif (!audio) return\n\tif (src && audio.src !== src) audio.src = src\n\taudio.play().catch(() => {})\n}\n\nexport function audioPause(this: MiniAppContext, { audioId }: { audioId: number }) {\n\t_newAudioInstances.get(audioId)?.pause()\n}\n\nexport function audioStop(this: MiniAppContext, { audioId }: { audioId: number }) {\n\tconst audio = _newAudioInstances.get(audioId)\n\tif (!audio) return\n\taudio.pause()\n\taudio.currentTime = 0\n\t// `stop` has no DOM equivalent \u2014 synthesise it through the bridge.\n\t_audioFire.get(audioId)?.(audioSnapshot(audio, 'stop'))\n}\n\nexport function audioSeek(this: MiniAppContext, { audioId, position }: { audioId: number; position: number }) {\n\tconst audio = _newAudioInstances.get(audioId)\n\tif (!audio) return\n\taudio.currentTime = position\n}\n\nexport function audioDestroy(this: MiniAppContext, { audioId }: { audioId: number }) {\n\t_audioEventDisposers.get(audioId)?.()\n\t_audioEventDisposers.delete(audioId)\n\t_audioFire.delete(audioId)\n\n\tconst audio = _newAudioInstances.get(audioId)\n\tif (!audio) return\n\taudio.pause()\n\taudio.removeAttribute('src')\n\taudio.load()\n\t_newAudioInstances.delete(audioId)\n}\n", "/**\n * Container-side handlers for the `FileSystemManager.*` invokeAPI wire names.\n *\n * The service thread's FileSystemManager (upstream\n * `service/src/api/core/file/index.js`, overlaid by the devtools\n * `service-apis/file/index.js` shim at container build time) invokes the\n * container with dotted wire names \u2014 `FileSystemManager.writeFile`, \u2026 \u2014 and\n * speaks the upstream transport protocol:\n *\n * - write-class `data` arrives either as a plain string or as a\n * `{ __diminaFileDataType: 'base64', __diminaFileDataBase64 }` sentinel\n * (the service side's postMessage-safe ArrayBuffer encoding);\n * - binary `readFile` results travel back as `{ __diminaArrayBufferBase64 }`\n * for the service side to decode into an ArrayBuffer;\n * - errMsg uses the wx short name (`writeFile:ok`), matching what real\n * dimina clients (Android / iOS / Harmony FileSystemManager backends)\n * report to mini-program code.\n *\n * Each handler adapts that wire shape onto the `fs*` implementations in\n * `simulator-api-fs.ts`, which own path resolution (single vpath resolver)\n * and the actual Node fs work.\n */\n\nimport type { MiniAppContext } from './types'\nimport { getNodeBindings } from '../shared/node-bindings.js'\nimport { bindCallbacks } from './simulator-api-helpers'\nimport {\n\tfsAccess,\n\tfsStat,\n\tfsReadFile,\n\tfsWriteFile,\n\tfsAppendFile,\n\tfsCopyFile,\n\tfsRename,\n\tfsUnlink,\n\tfsMkdir,\n\tfsRmdir,\n\tfsReaddir,\n\tfsGetFileInfo,\n\tfsSaveFile,\n\tfsGetSavedFileList,\n\tfsRemoveSavedFile,\n\tfsTruncate,\n} from './simulator-api-fs'\n\n/** Sentinel keys of the service-side transport protocol (see upstream `service/src/api/core/file/index.js`). */\nconst ARRAY_BUFFER_BASE64_KEY = '__diminaArrayBufferBase64'\nconst FILE_DATA_TYPE_KEY = '__diminaFileDataType'\nconst FILE_DATA_BASE64_KEY = '__diminaFileDataBase64'\n\ntype WireParams = Record<string, unknown>\n\n/**\n * An `fs*` impl as seen from the untyped wire boundary. Each impl validates\n * its own fields (path resolution, data types), so the adapter hands the\n * whole params object through unchecked.\n */\ntype FsHandler = (this: MiniAppContext, opts: WireParams) => void\n\ninterface FsmAdapterSpec {\n\t/** wx short method name \u2014 also the errMsg prefix the service side expects. */\n\tshort: string\n\timpl: FsHandler\n\t/** Decode a base64 write-payload sentinel in `data` before the impl runs. */\n\tdecodeWriteData?: boolean\n\t/** Encode a binary success `data` into the ArrayBuffer base64 sentinel. */\n\tencodeReadResult?: boolean\n}\n\nconst FSM_ADAPTERS: FsmAdapterSpec[] = [\n\t{ short: 'access', impl: fsAccess as FsHandler },\n\t{ short: 'stat', impl: fsStat as FsHandler },\n\t{ short: 'readFile', impl: fsReadFile as FsHandler, encodeReadResult: true },\n\t{ short: 'writeFile', impl: fsWriteFile as FsHandler, decodeWriteData: true },\n\t{ short: 'appendFile', impl: fsAppendFile as FsHandler, decodeWriteData: true },\n\t{ short: 'copyFile', impl: fsCopyFile as FsHandler },\n\t{ short: 'rename', impl: fsRename as FsHandler },\n\t{ short: 'unlink', impl: fsUnlink as FsHandler },\n\t{ short: 'mkdir', impl: fsMkdir as FsHandler },\n\t{ short: 'rmdir', impl: fsRmdir as FsHandler },\n\t{ short: 'readdir', impl: fsReaddir as FsHandler },\n\t{ short: 'getFileInfo', impl: fsGetFileInfo as FsHandler },\n\t{ short: 'saveFile', impl: fsSaveFile as FsHandler },\n\t{ short: 'getSavedFileList', impl: fsGetSavedFileList as FsHandler },\n\t{ short: 'removeSavedFile', impl: fsRemoveSavedFile as FsHandler },\n\t{ short: 'truncate', impl: fsTruncate as FsHandler },\n]\n\n/** The `fs*` impls report `fsWriteFile:ok` \u2014 the legacy internal prefix for a given wx short name. */\nfunction legacyPrefix(short: string): string {\n\treturn `fs${short[0]!.toUpperCase()}${short.slice(1)}`\n}\n\n/** Rewrites a payload's `errMsg` from the internal `fs*` prefix to the wx short name. */\nfunction renameErrMsg(payload: unknown, legacy: string, short: string): unknown {\n\tif (!payload || typeof payload !== 'object') return payload\n\tconst rec = payload as WireParams\n\tif (typeof rec.errMsg === 'string' && rec.errMsg.startsWith(`${legacy}:`)) {\n\t\treturn { ...rec, errMsg: `${short}:${rec.errMsg.slice(legacy.length + 1)}` }\n\t}\n\treturn payload\n}\n\n/**\n * `Buffer` for the base64 codec: the simulator document has no global\n * `Buffer` (nodeIntegration is off), so take it from the preload-published\n * node bindings; vitest/node contexts have the global.\n */\nconst BufferImpl: typeof Buffer | undefined =\n\tgetNodeBindings().buffer?.Buffer ?? (typeof Buffer !== 'undefined' ? Buffer : undefined)\n\n/** Decodes the service side's base64 write-payload sentinel into bytes; passes any other value through. */\nfunction decodeFileData(data: unknown): unknown {\n\tif (!BufferImpl) return data\n\tif (!data || typeof data !== 'object') return data\n\tconst rec = data as WireParams\n\tif (rec[FILE_DATA_TYPE_KEY] !== 'base64' || typeof rec[FILE_DATA_BASE64_KEY] !== 'string') return data\n\treturn BufferImpl.from(rec[FILE_DATA_BASE64_KEY] as string, 'base64')\n}\n\n/**\n * Wraps a binary success `data` (Buffer/typed array) in the ArrayBuffer\n * base64 sentinel; strings pass through. `ArrayBuffer.isView` is a brand\n * check that holds across realms \u2014 an `instanceof Uint8Array` test would\n * miss Node `Buffer`s when this module is evaluated under a DOM realm.\n */\nfunction encodeReadResult(payload: unknown): unknown {\n\tif (!BufferImpl) return payload\n\tif (!payload || typeof payload !== 'object') return payload\n\tconst rec = payload as WireParams\n\tconst data = rec.data\n\tif (typeof data === 'string' || !ArrayBuffer.isView(data)) return payload\n\tconst bytes = BufferImpl.from(data.buffer, data.byteOffset, data.byteLength)\n\treturn { ...rec, data: { [ARRAY_BUFFER_BASE64_KEY]: bytes.toString('base64') } }\n}\n\nfunction makeFsmHandler(spec: FsmAdapterSpec): (this: MiniAppContext, params?: unknown) => void {\n\tconst legacy = legacyPrefix(spec.short)\n\treturn function (this: MiniAppContext, params?: unknown) {\n\t\tconst raw: WireParams =\n\t\t\tparams && typeof params === 'object' && !Array.isArray(params)\n\t\t\t\t? { ...(params as WireParams) }\n\t\t\t\t: {}\n\t\tconst { success, fail, complete, ...rest } = raw\n\t\t// Resolve the caller's callbacks through THIS context (on the production\n\t\t// bridge they are sentinel ids only runApiAsync's patched\n\t\t// createCallbackFunction understands).\n\t\tconst cbs = bindCallbacks(this, { success, fail, complete })\n\n\t\tconst opts: WireParams = rest\n\t\tif (spec.decodeWriteData && 'data' in opts) {\n\t\t\topts.data = decodeFileData(opts.data)\n\t\t}\n\t\t// Terminal guards: exactly one success/fail verdict and one complete per\n\t\t// call. A synchronous throw inside the impl (e.g. Node fs rejecting an\n\t\t// invalid `data` type) must surface as a short-name fail through the wx\n\t\t// callbacks \u2014 never propagate as an exception (the bridge would stamp it\n\t\t// with the dotted wire name) \u2014 and any late async callback the impl\n\t\t// still fires after that is dropped here.\n\t\tlet verdictFired = false\n\t\tlet completeFired = false\n\t\tconst fireSuccess = (out: unknown) => {\n\t\t\tif (verdictFired) return\n\t\t\tverdictFired = true\n\t\t\tcbs.onSuccess?.(out)\n\t\t}\n\t\tconst fireFail = (out: unknown) => {\n\t\t\tif (verdictFired) return\n\t\t\tverdictFired = true\n\t\t\tcbs.onFail?.(out)\n\t\t}\n\t\tconst fireComplete = () => {\n\t\t\tif (completeFired) return\n\t\t\tcompleteFired = true\n\t\t\tcbs.onComplete?.()\n\t\t}\n\t\topts.success = (res: unknown) => {\n\t\t\tlet out = renameErrMsg(res, legacy, spec.short)\n\t\t\tif (spec.encodeReadResult) out = encodeReadResult(out)\n\t\t\tfireSuccess(out)\n\t\t}\n\t\topts.fail = (res: unknown) => {\n\t\t\tfireFail(renameErrMsg(res, legacy, spec.short))\n\t\t}\n\t\topts.complete = fireComplete\n\n\t\t// The impl re-resolves its callbacks via ctx.createCallbackFunction, and\n\t\t// the production bridge's patched createCallbackFunction only understands\n\t\t// sentinel ids \u2014 hand the impl a derived context that passes the plain\n\t\t// interceptor functions above straight through.\n\t\tconst innerCtx = Object.create(this as object) as MiniAppContext\n\t\tinnerCtx.createCallbackFunction = (fn: unknown) =>\n\t\t\ttypeof fn === 'function' ? (fn as (...args: unknown[]) => void) : undefined\n\t\ttry {\n\t\t\tspec.impl.call(innerCtx, opts)\n\t\t} catch (err) {\n\t\t\tconst msg = err instanceof Error ? err.message : String(err)\n\t\t\tfireFail({ errMsg: `${spec.short}:fail ${msg}` })\n\t\t\tfireComplete()\n\t\t}\n\t}\n}\n\nconst handlers: Record<string, (this: MiniAppContext, params?: unknown) => void> = {}\nfor (const spec of FSM_ADAPTERS) {\n\thandlers[`FileSystemManager.${spec.short}`] = makeFsmHandler(spec)\n}\n\n/** Registered 1:1 into `simulatorApis` \u2014 the keys are the invokeAPI wire names. */\nexport const fileSystemManagerApis = handlers\n", "/**\n * Runtime-owned authoritative implementation of wx.request network semantics, shared\n * by every request surface (simulator `directRequest`, preload api-compat\n * `wx.request` shim). Keeping the semantics in one module is what prevents the\n * surfaces from drifting apart on the core contract.\n *\n * The contract (official wx.request semantics):\n * - success vs fail is decided ONLY by whether a server response was\n * received. Any HTTP response \u2014 200, 401, 500 \u2014 resolves via `success`\n * with `{ data, statusCode, header, errMsg: 'request:ok' }`; callers\n * branch on `statusCode` (e.g. 401 \u2192 re-login).\n * - `fail` fires only for network-layer failures and always carries a\n * non-empty errMsg: 'request:fail timeout' (deadline hit),\n * 'request:fail abort' (caller aborted), 'request:fail <reason>' (DNS/\n * connection/protocol errors).\n * - `timeout` defaults to 60000ms (the wx default) when omitted or\n * non-positive \u2014 a request never hangs indefinitely.\n * - `dataType` (default 'json') controls body decoding: 'json' attempts\n * JSON.parse with raw-text fallback; anything else keeps raw text.\n * `responseType: 'arraybuffer'` (or the legacy `dataType: 'arraybuffer'`\n * spelling) yields an ArrayBuffer instead.\n * - Outgoing headers merge case-insensitively via `Headers` so a caller's\n * `content-type` in any casing wins exactly once; the `application/json`\n * default applies only when the caller supplied none. Plain-object merges\n * would keep both casings as distinct keys and comma-join them on the wire.\n * - GET/HEAD serialize object `data` into URL query params (no body);\n * other methods send string data verbatim, form-encode objects under\n * application/x-www-form-urlencoded, and JSON-encode otherwise.\n * - `complete` fires exactly once, after success or fail, with that same\n * result object.\n *\n * Not provided: `cookies` on the success result \u2014 fetch() cannot read\n * Set-Cookie response headers, so surfacing a fabricated list would lie.\n */\n\nexport interface RequestSuccessResult {\n data: unknown\n statusCode: number\n header: Record<string, string>\n errMsg: 'request:ok'\n}\n\nexport interface RequestFailResult {\n errMsg: string\n errno?: number\n}\n\nexport interface RequestHandle {\n abort(): void\n}\n\nexport interface RequestCoreOptions {\n url: string\n data?: unknown\n header?: Record<string, string>\n timeout?: number\n method?: string\n dataType?: string\n responseType?: string\n}\n\nexport interface RequestCoreCallbacks {\n success?: (res: RequestSuccessResult) => void\n fail?: (err: RequestFailResult) => void\n complete?: (res: RequestSuccessResult | RequestFailResult) => void\n}\n\n/**\n * The wx.request default timeout budget. Exported as the single source of\n * truth for every layer that reasons about a request's time budget \u2014 the\n * bridge-router watchdog (apiCallWatchdogMs in simulator-api-metadata.ts)\n * derives its window from this so the two cannot drift apart.\n */\nexport const DEFAULT_REQUEST_TIMEOUT_MS = 60_000\n\n/**\n * Largest delay setTimeout honours (2^31-1 ms). Anything above overflows the\n * signed-32-bit timer register and fires ~immediately (~1ms) instead of late \u2014\n * so an oversized caller timeout must be rejected, never passed through.\n */\nexport const MAX_TIMEOUT_MS = 2_147_483_647\n\n/**\n * Resolve a caller-supplied wx timeout into a usable budget: a finite positive\n * number within setTimeout's range is honoured; anything else (absent, 0,\n * negative, NaN, Infinity, overflowing) falls back to the wx default. Shared\n * by performRequest and the bridge-router watchdog (apiCallWatchdogMs) so the\n * two layers can never disagree on what a valid timeout is.\n */\nexport function resolveTimeoutBudgetMs(timeout: unknown): number {\n const t = Number(timeout)\n return Number.isFinite(t) && t > 0 && t <= MAX_TIMEOUT_MS ? t : DEFAULT_REQUEST_TIMEOUT_MS\n}\n\nfunction buildHeaders(header: Record<string, string> | undefined): Headers {\n const headers = new Headers()\n for (const [key, value] of Object.entries(header ?? {})) {\n if (value != null) headers.set(key, String(value))\n }\n if (!headers.has('content-type')) headers.set('content-type', 'application/json')\n return headers\n}\n\nfunction appendQueryParams(url: string, data: Record<string, unknown>): string {\n // Resolve against the current document when available so page-relative URLs\n // keep working in the render-window shim.\n const base = typeof location !== 'undefined' ? location.href : undefined\n const resolved = new URL(url, base)\n for (const [key, value] of Object.entries(data)) {\n resolved.searchParams.append(key, String(value))\n }\n return resolved.toString()\n}\n\nfunction encodeBody(data: unknown, contentType: string): BodyInit {\n if (typeof data === 'string') return data\n if (contentType.includes('application/x-www-form-urlencoded')) {\n const form = new URLSearchParams()\n for (const [key, value] of Object.entries(data as Record<string, unknown>)) {\n form.append(key, String(value))\n }\n return form.toString()\n }\n return JSON.stringify(data)\n}\n\nasync function decodeResponseData(\n response: Response,\n dataType: string,\n responseType: string,\n): Promise<unknown> {\n if (responseType === 'arraybuffer' || dataType === 'arraybuffer') {\n return response.arrayBuffer()\n }\n const text = await response.text()\n if (dataType !== 'json') return text\n try {\n return JSON.parse(text)\n } catch {\n return text\n }\n}\n\nexport function performRequest(\n opts: RequestCoreOptions,\n callbacks: RequestCoreCallbacks,\n): RequestHandle {\n const method = (opts.method || 'GET').toUpperCase()\n const canHaveBody = method !== 'GET' && method !== 'HEAD'\n const headers = buildHeaders(opts.header)\n\n let url = opts.url\n const init: RequestInit = { method, headers }\n\n if (!canHaveBody) {\n if (opts.data && typeof opts.data === 'object') {\n url = appendQueryParams(url, opts.data as Record<string, unknown>)\n }\n } else if (opts.data != null) {\n init.body = encodeBody(opts.data, headers.get('content-type') ?? '')\n }\n\n const controller = new AbortController()\n init.signal = controller.signal\n\n // First verdict wins: a timeout/abort settles the call even though the fetch\n // promise is still pending, and the fetch's own late resolution/AbortError\n // rejection must not fire a second callback round.\n let settled = false\n\n function settleSuccess(res: RequestSuccessResult): void {\n if (settled) return\n settled = true\n clearTimeout(timer)\n callbacks.success?.(res)\n callbacks.complete?.(res)\n }\n\n function settleFail(err: RequestFailResult): void {\n if (settled) return\n settled = true\n clearTimeout(timer)\n callbacks.fail?.(err)\n callbacks.complete?.(err)\n }\n\n const timeoutMs = resolveTimeoutBudgetMs(opts.timeout)\n const timer = setTimeout(() => {\n settleFail({ errMsg: 'request:fail timeout' })\n controller.abort()\n }, timeoutMs)\n\n const dataType = opts.dataType ?? 'json'\n const responseType = opts.responseType ?? 'text'\n\n fetch(url, init)\n .then(async (response) => {\n const header: Record<string, string> = {}\n response.headers.forEach((value, key) => {\n header[key] = value\n })\n const data = await decodeResponseData(response, dataType, responseType)\n settleSuccess({ data, statusCode: response.status, header, errMsg: 'request:ok' })\n })\n .catch((error: unknown) => {\n const reason = error instanceof Error ? error.message : String(error)\n settleFail({ errMsg: `request:fail ${reason || 'network error'}` })\n })\n\n return {\n abort() {\n settleFail({ errMsg: 'request:fail abort' })\n controller.abort()\n },\n }\n}\n", "/**\n * DevTools API stubs for network-related wx.xxx APIs.\n *\n * Each exported function is bound with `this` = MiniApp instance\n * (via AppManager.registerApi -> MiniApp.invokeApi).\n */\n\nimport type { MiniAppContext } from './types'\nimport { bindCallbacks } from './simulator-api-helpers'\nimport { resolveTimeoutBudgetMs } from '../shared/request-core'\nimport { createTempFilePath, getTempFileName, resolveTempFilePath } from './temp-files'\n\nexport function downloadFile(\n\tthis: MiniAppContext,\n\t{ url, header = {}, filePath, timeout, success, fail, complete }: {\n\t\turl: string\n\t\theader?: Record<string, string>\n\t\tfilePath?: string\n\t\ttimeout?: number\n\t\tsuccess?: unknown\n\t\tfail?: unknown\n\t\tcomplete?: unknown\n\t},\n) {\n\tconst { onSuccess, onFail, onComplete } = bindCallbacks(this, { success, fail, complete })\n\n\t// The handler owns its own deadline: the bridge's no-handler watchdog is\n\t// disarmed by the handler-received ack, so a stalled network must be\n\t// bounded here (wx budget semantics, same authority as `request`). First\n\t// verdict wins \u2014 a late fetch settlement after the timeout fired must not\n\t// resurrect success or double-fire complete.\n\tlet settled = false\n\tconst settleFail = (errMsg: string) => {\n\t\tif (settled) return\n\t\tsettled = true\n\t\tclearTimeout(timer)\n\t\tonFail?.({ errMsg })\n\t\tonComplete?.()\n\t}\n\tconst settleOk = (result: Record<string, unknown>) => {\n\t\tif (settled) return\n\t\tsettled = true\n\t\tclearTimeout(timer)\n\t\tonSuccess?.(result)\n\t\tonComplete?.()\n\t}\n\tconst controller = new AbortController()\n\tconst timer = setTimeout(() => {\n\t\tsettleFail('downloadFile:fail timeout')\n\t\tcontroller.abort()\n\t}, resolveTimeoutBudgetMs(timeout))\n\n\tfetch(url, { headers: header, signal: controller.signal })\n\t\t.then(async (response) => {\n\t\t\tif (!response.ok) {\n\t\t\t\t// statusText is frequently empty (HTTP/2 has none) \u2014 the status\n\t\t\t\t// code is the reliable part of the failure reason.\n\t\t\t\tsettleFail(\n\t\t\t\t\t`downloadFile:fail HTTP ${response.status}${response.statusText ? ` ${response.statusText}` : ''}`,\n\t\t\t\t)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconst blob = await response.blob()\n\t\t\tconst tempFilePath = createTempFilePath(blob)\n\t\t\tsettleOk({\n\t\t\t\ttempFilePath,\n\t\t\t\tfilePath: filePath || tempFilePath,\n\t\t\t\tstatusCode: response.status,\n\t\t\t\terrMsg: 'downloadFile:ok',\n\t\t\t})\n\t\t})\n\t\t.catch((error: Error) => {\n\t\t\tsettleFail(`downloadFile:fail ${error.message}`)\n\t\t})\n}\n\ntype UploadFileOptions = {\n\turl: string\n\tfilePath: string\n\tname: string\n\theader?: Record<string, string>\n\tformData?: Record<string, unknown>\n\ttimeout?: number\n\tuploadId?: string\n\tprogress?: unknown\n\theadersReceived?: unknown\n\tsuccess?: unknown\n\tfail?: unknown\n\tcomplete?: unknown\n}\n\nconst uploadRequests = new Map<string, XMLHttpRequest>()\nconst uploadPendingResolves = new Set<string>()\nconst uploadAbortedBeforeStart = new Set<string>()\nlet nextUploadId = 1\n\nfunction createUploadId(): string {\n\treturn `upload_${Date.now()}_${nextUploadId++}`\n}\n\nfunction parseResponseHeaders(raw: string): Record<string, string> {\n\tconst headers: Record<string, string> = {}\n\tfor (const line of raw.trim().split(/[\\r\\n]+/)) {\n\t\tif (!line) continue\n\t\tconst index = line.indexOf(':')\n\t\tif (index <= 0) continue\n\t\tconst key = line.slice(0, index).trim()\n\t\tconst value = line.slice(index + 1).trim()\n\t\tif (key) headers[key] = value\n\t}\n\treturn headers\n}\n\nfunction appendFormData(form: FormData, formData: Record<string, unknown>): void {\n\tfor (const [key, value] of Object.entries(formData)) {\n\t\tif (value == null) continue\n\t\tif (value instanceof Blob) {\n\t\t\tform.append(key, value)\n\t\t} else if (typeof value === 'object') {\n\t\t\t// JSON.stringify for plain objects/arrays; Map/Set/RegExp/TypedArray\n\t\t\t// fall through here too and become '{}' or similar \u2014 caller should\n\t\t\t// pre-stringify if they need a specific form.\n\t\t\tform.append(key, JSON.stringify(value))\n\t\t} else {\n\t\t\tform.append(key, String(value))\n\t\t}\n\t}\n}\n\nexport function uploadFile(\n\tthis: MiniAppContext,\n\t{\n\t\turl,\n\t\tfilePath,\n\t\tname,\n\t\theader = {},\n\t\tformData = {},\n\t\ttimeout,\n\t\tuploadId = createUploadId(),\n\t\tprogress,\n\t\theadersReceived,\n\t\tsuccess,\n\t\tfail,\n\t\tcomplete,\n\t}: UploadFileOptions,\n) {\n\tconst { onSuccess, onFail, onComplete } = bindCallbacks(this, { success, fail, complete })\n\tconst onProgress = this.createCallbackFunction(progress)\n\tconst onHeadersReceived = this.createCallbackFunction(headersReceived)\n\n\tconst cleanup = () => {\n\t\tuploadRequests.delete(uploadId)\n\t\tuploadPendingResolves.delete(uploadId)\n\t\tuploadAbortedBeforeStart.delete(uploadId)\n\t}\n\tconst finishFail = (message: string) => {\n\t\tcleanup()\n\t\tconst result = { errMsg: `uploadFile:fail ${message}` }\n\t\tonFail?.(result)\n\t\tonComplete?.(result)\n\t}\n\n\tuploadPendingResolves.add(uploadId)\n\tvoid resolveTempFilePath(filePath)\n\t\t.then((blob) => {\n\t\t\tuploadPendingResolves.delete(uploadId)\n\t\t\tif (uploadAbortedBeforeStart.has(uploadId)) {\n\t\t\t\tfinishFail('abort')\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tconst xhr = new XMLHttpRequest()\n\t\t\tlet settled = false\n\t\t\tlet deliveredHeaders = false\n\t\t\tuploadRequests.set(uploadId, xhr)\n\n\t\t\tconst finishSuccess = () => {\n\t\t\t\tif (settled) return\n\t\t\t\tsettled = true\n\t\t\t\tconst headers = parseResponseHeaders(xhr.getAllResponseHeaders())\n\t\t\t\tcleanup()\n\t\t\t\tconst result = {\n\t\t\t\t\tdata: typeof xhr.response === 'string' ? xhr.response : xhr.responseText,\n\t\t\t\t\tstatusCode: xhr.status,\n\t\t\t\t\theader: headers,\n\t\t\t\t\terrMsg: 'uploadFile:ok',\n\t\t\t\t}\n\t\t\t\tonSuccess?.(result)\n\t\t\t\tonComplete?.(result)\n\t\t\t}\n\t\t\tconst finishXhrFail = (message: string) => {\n\t\t\t\tif (settled) return\n\t\t\t\tsettled = true\n\t\t\t\tfinishFail(message)\n\t\t\t}\n\t\t\tconst emitHeaders = () => {\n\t\t\t\tif (deliveredHeaders) return\n\t\t\t\tdeliveredHeaders = true\n\t\t\t\tonHeadersReceived?.({ header: parseResponseHeaders(xhr.getAllResponseHeaders()) })\n\t\t\t}\n\n\t\t\txhr.open('POST', url, true)\n\t\t\tif (timeout === undefined) {\n\t\t\t\txhr.timeout = 60_000\n\t\t\t} else if (Number(timeout) > 0) {\n\t\t\t\txhr.timeout = Number(timeout)\n\t\t\t}\n\t\t\tfor (const [key, value] of Object.entries(header)) {\n\t\t\t\tif (/^(referer|content-type)$/i.test(key)) continue\n\t\t\t\txhr.setRequestHeader(key, String(value))\n\t\t\t}\n\t\t\txhr.upload.onprogress = (event) => {\n\t\t\t\tconst totalBytesExpectedToSend = event.lengthComputable ? event.total : blob.size\n\t\t\t\tconst progressValue = totalBytesExpectedToSend > 0\n\t\t\t\t\t? Math.round((event.loaded / totalBytesExpectedToSend) * 100)\n\t\t\t\t\t: 0\n\t\t\t\tonProgress?.({\n\t\t\t\t\tprogress: Math.max(0, Math.min(100, progressValue)),\n\t\t\t\t\ttotalBytesSent: event.loaded,\n\t\t\t\t\ttotalBytesExpectedToSend,\n\t\t\t\t})\n\t\t\t}\n\t\t\txhr.onreadystatechange = () => {\n\t\t\t\tif (xhr.readyState >= XMLHttpRequest.HEADERS_RECEIVED) emitHeaders()\n\t\t\t}\n\t\t\txhr.onload = () => {\n\t\t\t\temitHeaders()\n\t\t\t\tfinishSuccess()\n\t\t\t}\n\t\t\txhr.onerror = () => finishXhrFail('network error')\n\t\t\txhr.ontimeout = () => finishXhrFail('timeout')\n\t\t\txhr.onabort = () => finishXhrFail('abort')\n\n\t\t\tconst body = new FormData()\n\t\t\tappendFormData(body, formData)\n\t\t\tbody.append(name, blob, getTempFileName(filePath, blob, name || 'file'))\n\t\t\txhr.send(body)\n\t\t})\n\t\t.catch((error: Error) => {\n\t\t\tfinishFail(error.message)\n\t\t})\n}\n\nexport function uploadFileAbort(this: MiniAppContext, { uploadId }: { uploadId?: string } = {}) {\n\tif (!uploadId) return\n\tconst xhr = uploadRequests.get(uploadId)\n\tif (xhr) {\n\t\txhr.abort()\n\t\treturn\n\t}\n\tif (uploadPendingResolves.has(uploadId)) {\n\t\tuploadAbortedBeforeStart.add(uploadId)\n\t}\n}\n", "/**\n * The mini-app itself: navigation bar, the page stack rendered as render-host\n * guests, the tabBar, and the native interaction overlays \u2014 plus the routing\n * queue and state machines that drive them.\n *\n * Everything device-shaped is the host's: bezel, notch, status bar, home\n * indicator and screen geometry never appear here. What the frame needs of them\n * arrives as two numbers (`statusBarHeight`, `bottomInset`) and two slots the\n * host fills with its own chrome, so the same mini-app renders identically\n * whether it is installed into a simulated phone, a plain window, or a host app\n * with no device pretense at all.\n *\n * Renders a fragment rather than a container of its own: the host owns the box\n * these children lay out in (its size, corners and clipping ARE the device), so\n * imposing a wrapper here would only fight it.\n */\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react'\nimport type { ReactNode } from 'react'\nimport { SIMULATOR_EVENTS as E } from '../shared/bridge-channels.js'\nimport type {\n NavActionPayload,\n TabActionPayload,\n} from '../shared/bridge-channels.js'\nimport type { MiniAppHost } from './miniapp-host.js'\nimport { NavigationBar } from './navigation-bar.js'\nimport type { NavBarPlatform, NavigationBarTextStyle } from './navigation-bar.js'\nimport { TabBar } from './tab-bar.js'\nimport { UiOverlay } from './ui-overlay.js'\nimport { applyTabAction, makeInitialTabBarState } from './tab-bar-state.js'\nimport {\n enumerateMounted,\n makeInitialShellState,\n mutatePageNavBar,\n navBarFromConfig,\n normalizePath,\n revealTopEffects,\n pageBackgroundColor,\n reduceNavBar,\n type PageEntry,\n type SideEffect,\n} from './page-stack-controller.js'\nimport { shouldShowHomeButton } from './navigate-home.js'\nimport {\n commitShell,\n commitTabBar,\n doNavigateBack,\n doNavigateHome,\n doNavigateTo,\n doReLaunch,\n doRedirectTo,\n doSwitchTab,\n type MiniAppFrameState,\n type ShellNavPayload,\n} from './miniapp-routing.js'\nimport './miniapp-frame.css'\n\nconst NAV_BAR_HEIGHT = 44\n\n/** What the capsule's \"more\" button hands the host when there is nothing built in to do. */\nexport interface CapsuleMoreContext {\n appId: string\n /** The active page's title, falling back to the appId when it has none. */\n appName: string\n pagePath: string\n}\n\n/**\n * Page chrome state the host's own overlays need. A status bar drawn over the\n * mini-app has to follow the active page's `navigationBarTextStyle` \u2014 white\n * glyphs over a dark page, black over a light one \u2014 and only the frame knows\n * which page is active.\n */\nexport interface FrameChromeState {\n textStyle: NavigationBarTextStyle\n}\n\nexport interface MiniAppFrameProps {\n host: MiniAppHost\n /** The bridgeId of the page the host already spawned \u2014 the stack bottom. */\n bridgeId: string\n /** Whose navigation-bar conventions to follow (title centered vs leading). */\n platform?: NavBarPlatform\n /**\n * Chrome height the host reserves above the mini-app. The nav bar pads itself\n * by this much so a default bar blends its background up into that strip and\n * a custom bar shows the page through it. 0 when the host draws no status bar.\n */\n statusBarHeight?: number\n /**\n * Bottom safe area. The tabBar's background extends through it (WeChat /\n * Android / Harmony parity) so the home-indicator strip takes the tabBar's\n * color. 0 when the host has no bottom inset.\n */\n bottomInset?: number\n /** Capsule \"more\" handler. Without one the button still renders but does nothing. */\n onMore?: (context: CapsuleMoreContext) => void\n /**\n * Host chrome drawn above the nav bar \u2014 a status bar, a notch. A function so\n * it can follow the active page's chrome state; see `FrameChromeState`.\n */\n statusBar?: (chrome: FrameChromeState) => ReactNode\n /** Host chrome drawn above everything \u2014 extension layers, a home indicator. */\n deviceOverlay?: ReactNode\n /**\n * Whether the user can see this frame. A host that mounts a frame hidden\n * (devtools' soft reload boots the next app invisibly and swaps it in once\n * its first page is ready) passes false until the swap; the launch page's\n * pageShow \u2014 hence onShow/onReady \u2014 waits for that. Default true.\n */\n active?: boolean\n}\n\nexport function MiniAppFrame({\n host,\n bridgeId,\n platform = 'ios',\n statusBarHeight = 0,\n bottomInset = 0,\n onMore,\n statusBar,\n deviceOverlay,\n active = true,\n}: MiniAppFrameProps) {\n const preload = useMemo(() => host.getRenderPreloadUrl(), [host])\n const tabBarConfig = useMemo(() => host.getTabBarConfig(), [host])\n\n const initialEntry = useMemo<PageEntry>(() => {\n const pagePath = normalizePath(host.pagePath)\n const windowConfig = host.rootWindowConfig ?? {}\n const isTab = !!host.getTabBarConfig()?.list.some(\n item => normalizePath(item.pagePath) === pagePath,\n )\n return {\n bridgeId,\n pagePath,\n query: { ...host.query },\n isTab,\n windowConfig,\n // The launch page is the stack bottom, so a non-home, non-tab launch\n // page gets the home button by the automatic rule.\n navBar: navBarFromConfig(windowConfig, host.appId, {\n homeButtonVisible: shouldShowHomeButton({\n pagePath,\n homePagePath: host.getHomePagePath(),\n isTab,\n isStackBottom: true,\n forcedByConfig: windowConfig.homeButton === true,\n }),\n }),\n }\n }, [host, bridgeId])\n\n const [{ shell, tabBar }, setState] = useState<MiniAppFrameState>(() => ({\n shell: makeInitialShellState(initialEntry),\n tabBar: makeInitialTabBarState(tabBarConfig),\n }))\n\n // Authoritative state for the bridge-event handlers and the async routing\n // controllers. Written SYNCHRONOUSLY by commitShell/commitTabBar, never by a\n // passive effect: bridge events arrive outside React's batching, so an\n // effect-synced mirror lags one commit behind and would drag this ref back to\n // the pre-event snapshot \u2014 the next event then reduces from stale state and\n // overwrites the one before it. React state is only the render mirror.\n const stateRef = useRef<MiniAppFrameState>({ shell, tabBar })\n\n // False until the frame is first active: a hidden frame (pending soft reload) must not tell\n // service its pages are showing or hiding, only that they unload. Activation is one-way.\n const visibleRef = useRef(false)\n const applySideEffects = useCallback((effects: SideEffect[]) => {\n for (const effect of effects) {\n if (effect.kind === 'lifecycle') {\n const isVisibility = effect.event === 'pageShow' || effect.event === 'pageHide'\n if (isVisibility && !visibleRef.current) continue\n host.notifyLifecycle(effect.bridgeId, effect.event)\n } else if (effect.kind === 'closePage') {\n host.closePage(effect.bridgeId)\n }\n }\n }, [host])\n\n // The launch page becomes stack top the moment this frame mounts, but no\n // reducer call produced that transition \u2014 makeInitialShellState built it\n // directly. Without this, service never learns the launch page is visible\n // until some later navigation restores it from a tab cache. It fires the\n // first time the frame is `active` (a hidden pending boot waits for its\n // promotion), exactly once per bridgeId: the ref survives later\n // active toggles and unrelated re-renders, while a soft-reload remount (new\n // host, new bridgeId) gets its own.\n useEffect(() => {\n if (!active || visibleRef.current) return\n visibleRef.current = true\n applySideEffects(revealTopEffects(stateRef.current.shell))\n }, [active, applySideEffects])\n\n // \u2500\u2500 NavigationBar dynamic updates \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n useEffect(() => {\n const listener = (\n payload: { bridgeId: string; name: string; params: Record<string, unknown> },\n ) => {\n commitShell(\n stateRef,\n setState,\n mutatePageNavBar(stateRef.current.shell, payload.bridgeId, navBar =>\n reduceNavBar(navBar, payload.name, payload.params),\n ),\n )\n }\n return host.onSimulatorEvent(E.NAV_BAR, listener)\n }, [host])\n\n // \u2500\u2500 TabBar dynamic API \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n useEffect(() => {\n const listener = (payload: TabActionPayload) => {\n const next = applyTabAction(stateRef.current.tabBar, {\n kind: 'apply',\n name: payload.name,\n params: payload.params,\n })\n commitTabBar(stateRef, setState, next.state)\n host.notifyNavCallback({\n ok: next.ok,\n errMsg: next.errMsg,\n callbacks: payload.callbacks,\n })\n }\n return host.onSessionEvent(E.TAB_ACTION, listener)\n }, [host])\n\n // \u2500\u2500 Routing controller (navigateTo / Back / redirectTo / reLaunch / switchTab / Home) \u2500\n // Every routing operation opens its page asynchronously and only then reads\n // `stateRef` to compute the next stack, so two overlapping actions would both\n // decide from the same pre-action snapshot: the loser's freshly-opened page\n // survives in neither the visible stack nor any tab substack and is never\n // closed. Actions therefore run one at a time \u2014 a tail-chained promise is the\n // single gate every entry point (service NAV_ACTION and the nav-bar buttons)\n // goes through. A failing action never blocks the next one.\n const navQueueRef = useRef<Promise<void>>(Promise.resolve())\n // Monotonic stamp that retires the whole queue when this frame goes away. A\n // queued action can still be waiting on its PAGE_OPEN when a soft reload\n // swaps in a new frame and disposes this session; resuming it afterwards\n // would commit into an unmounted tree and reduce from a stack nobody owns.\n // Each action captures the stamp and re-checks it after every await.\n const navEpochRef = useRef(0)\n useEffect(() => () => { navEpochRef.current += 1 }, [])\n\n const runNavAction = useCallback(\n async (payload: ShellNavPayload) => {\n const ack = (ok: boolean, errMsg: string): void =>\n host.notifyNavCallback({ ok, errMsg, callbacks: payload.callbacks })\n\n try {\n switch (payload.name) {\n case 'navigateTo':\n await doNavigateTo(host, stateRef, setState, applySideEffects, payload, ack)\n break\n case 'navigateBack':\n doNavigateBack(stateRef, setState, applySideEffects, payload, ack)\n break\n case 'redirectTo':\n await doRedirectTo(host, stateRef, setState, applySideEffects, payload, ack)\n break\n case 'reLaunch':\n await doReLaunch(host, stateRef, setState, applySideEffects, payload, ack)\n break\n case 'switchTab':\n await doSwitchTab(host, stateRef, setState, applySideEffects, payload, ack)\n break\n case 'navigateHome':\n await doNavigateHome(host, stateRef, setState, applySideEffects, payload, ack)\n break\n }\n } catch (err) {\n ack(false, `${payload.name}:fail ${err instanceof Error ? err.message : String(err)}`)\n }\n },\n [host, applySideEffects],\n )\n\n const performNavAction = useCallback(\n (payload: ShellNavPayload): Promise<void> => {\n const epoch = navEpochRef.current\n const queued = navQueueRef.current.then(() => {\n // Retired while this one waited its turn \u2014 the frame it would act on is\n // gone. An action already past this point when the frame went away\n // still finishes, but every outbound call it makes is dropped by the\n // host's own cleared-session guards.\n if (navEpochRef.current !== epoch) return\n return runNavAction(payload)\n })\n navQueueRef.current = queued.catch(() => {})\n return queued\n },\n [runNavAction],\n )\n\n useEffect(() => {\n const listener = (payload: NavActionPayload) => {\n void performNavAction(payload)\n }\n return host.onSessionEvent(E.NAV_ACTION, listener)\n }, [performNavAction, host])\n\n // \u2500\u2500 Click handlers (back arrow + tab item) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n const handleBack = useCallback(() => {\n if (stateRef.current.shell.stack.length <= 1) return\n const stack = stateRef.current.shell.stack\n void performNavAction({\n appSessionId: host.appSessionId ?? '',\n bridgeId: stack[stack.length - 1].bridgeId,\n name: 'navigateBack',\n params: { delta: 1 },\n callbacks: {},\n })\n }, [host, performNavAction])\n\n // The home button only dispatches; `navigateHome` (miniapp-routing) is the\n // single authority that picks the routing verb, mirroring each native\n // platform's navigateHome primitive.\n const handleHome = useCallback(() => {\n const stack = stateRef.current.shell.stack\n void performNavAction({\n appSessionId: host.appSessionId ?? '',\n bridgeId: stack[stack.length - 1].bridgeId,\n name: 'navigateHome',\n params: {},\n callbacks: {},\n })\n }, [host, performNavAction])\n\n const handleTabClick = useCallback((pagePath: string) => {\n const sh = stateRef.current.shell\n if (pagePath === sh.currentTabPath && sh.stack.length === 1) return\n void performNavAction({\n appSessionId: host.appSessionId ?? '',\n bridgeId: sh.stack[sh.stack.length - 1].bridgeId,\n name: 'switchTab',\n params: { url: `/${pagePath}` },\n callbacks: {},\n })\n }, [host, performNavAction])\n\n // \u2500\u2500 Rendering \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n const top = shell.stack[shell.stack.length - 1]\n const mounted = enumerateMounted(shell)\n const handleMore = useCallback(() => {\n onMore?.({\n appId: host.appId,\n appName: top.navBar.title || host.appId,\n pagePath: top.pagePath,\n })\n }, [onMore, host, top.navBar.title, top.pagePath])\n\n // Report the full ordered stack (bottom\u2192top) on every stack change so\n // automation's App.getPageStack can return a multi-page stack \u2014 main only\n // tracks the active bridgeId on its own.\n //\n // Declared BEFORE the active-page report on purpose, and the two must stay in\n // this order: ACTIVE_PAGE is what releases automation's wait-for-navigation,\n // and main drops its stored stack the moment a page closes, so an active-page\n // signal arriving first lets App.getPageStack answer from its single-page\n // fallback while the real stack is still in flight. A top change always comes\n // with a new stack array (`top` is derived from it), so both effects run in\n // the same commit and React fires them in declaration order.\n useEffect(() => {\n host.notifyPageStack(shell.stack.map((e) => ({ pagePath: e.pagePath, query: e.query })))\n }, [host, shell.stack])\n\n // Tell main which page is the visible top-of-stack so main-side panels\n // (WXML/element-inspect) and automation can target the active render\n // webContents \u2014 main has no z-order concept of its own. Fires on every\n // top change (navigate / back / switchTab).\n useEffect(() => {\n host.notifyActivePage(top.bridgeId)\n }, [host, top.bridgeId])\n\n return (\n <>\n {statusBar?.({ textStyle: top.navBar.textStyle })}\n {/*\n Default nav-bar is in-flow (reserves its own height); custom nav-bar\n is an absolute overlay and the webview renders full-bleed beneath it.\n So the viewport needs no nav-height padding \u2014 see navigation-bar.css.\n */}\n <NavigationBar\n state={top.navBar}\n stackDepth={shell.stack.length}\n platform={platform}\n statusBarHeight={statusBarHeight}\n navBarHeight={NAV_BAR_HEIGHT}\n onBack={handleBack}\n onHome={handleHome}\n onMore={handleMore}\n />\n <div className=\"device-shell__viewport\">\n {mounted.map(({ entry, visible }) => (\n <webview\n key={entry.bridgeId}\n className=\"device-shell__webview\"\n src={host.createRenderHostUrl(\n entry.bridgeId,\n entry.pagePath,\n entry.isTab,\n pageBackgroundColor(entry.windowConfig),\n entry.windowConfig?.navigationStyle,\n )}\n preload={preload}\n // No static partition here: the renderer doesn't know the\n // per-project partition \u2014 the host WCV's `will-attach-webview`\n // handler stamps every render-host guest onto this project's\n // `persist:miniapp-<key>` partition instead.\n allowpopups=\"true\"\n style={{\n display: visible ? 'flex' : 'none',\n zIndex: visible ? 100 : 1,\n // White-flash fix (WeChat/Android/Harmony parity): host-painted primer.\n backgroundColor: pageBackgroundColor(entry.windowConfig),\n }}\n />\n ))}\n </div>\n {top.isTab && (\n <TabBar\n state={tabBar}\n currentPath={shell.currentTabPath}\n resourceBaseUrl={host.resourceBaseUrl}\n appId={host.appId}\n onSwitch={handleTabClick}\n bottomInset={bottomInset}\n />\n )}\n {/* Native interaction overlays (toast / loading / modal / action sheet).\n After the page and tabBar so it layers above both. */}\n <UiOverlay />\n {deviceOverlay}\n </>\n )\n}\n", "import { useMemo } from 'react'\nimport { MenuCapsule } from './menu-capsule.js'\nimport './navigation-bar.css'\n\nexport type NavigationBarTextStyle = 'white' | 'black'\nexport type NavigationStyle = 'default' | 'custom'\nexport type NavBarPlatform = 'ios' | 'android'\n\nexport interface NavigationBarState {\n title: string\n backgroundColor: string\n textStyle: NavigationBarTextStyle\n style: NavigationStyle\n loading: boolean\n homeButtonVisible: boolean\n /**\n * Optional CSS transition duration set by `wx.setNavigationBarColor`.\n * WeChat supports linear / easeIn / easeOut / easeInOut.\n */\n colorAnimation?: {\n durationMs: number\n timingFunc: 'linear' | 'easeIn' | 'easeOut' | 'easeInOut'\n }\n}\n\nexport interface NavigationBarProps {\n state: NavigationBarState\n /** Page stack depth \u2014 when >1 a back arrow appears. */\n stackDepth: number\n platform: NavBarPlatform\n statusBarHeight: number\n /** Total nav bar height (excluding status bar). 44 by spec. */\n navBarHeight: number\n onBack?: () => void\n onHome?: () => void\n onMore?: () => void\n}\n\nconst TIMING_FUNC_MAP: Record<NonNullable<NavigationBarState['colorAnimation']>['timingFunc'], string> = {\n linear: 'linear',\n easeIn: 'ease-in',\n easeOut: 'ease-out',\n easeInOut: 'ease-in-out',\n}\n\n// Native back-arrow glyphs are filled wedges, not a stroked chevron.\n// iOS: exact path from Assets.xcassets/arrow-back-{dark,light}.imageset (both\n// color variants share this path). Android: Icons.AutoMirrored.Filled.KeyboardArrowLeft\n// is a compiled androidx vector with no source in this repo to read; its path is\n// the standard Material Design \"keyboard_arrow_left\" glyph, verified against\n// google/material-design-icons (src/hardware/keyboard_arrow_left/materialicons/24px.svg)\n// rather than reproduced from memory.\nconst BACK_ARROW_PATH: Record<NavBarPlatform, string> = {\n ios: 'M17.51 3.87L15.73 2.1 5.84 12l9.9 9.9 1.77-1.77L9.38 12l8.13-8.13z',\n android: 'M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z',\n}\n\n/**\n * Simulator navigation bar aligned with WeChat MiniProgram spec\n * (see packages/devtools/docs/native-bridge-protocol.md NavigationBar section):\n *\n * - `style: custom` hides the bar entirely, capsule stays.\n * - Title default-center on iOS, default-left on Android (per official guidance).\n * - Back arrow appears when stackDepth > 1; the home button follows\n * `homeButtonVisible` independently and can coexist with the arrow.\n * - `textStyle` drives both title color AND status bar foreground (handled by parent).\n * - Color transitions follow `wx.setNavigationBarColor.animation` semantics.\n */\nexport function NavigationBar({\n state,\n stackDepth,\n platform,\n statusBarHeight,\n navBarHeight,\n onBack,\n onHome,\n onMore,\n}: NavigationBarProps) {\n const transition = useMemo(() => {\n if (!state.colorAnimation || state.colorAnimation.durationMs <= 0) return undefined\n const timing = TIMING_FUNC_MAP[state.colorAnimation.timingFunc] ?? 'linear'\n return `background-color ${state.colorAnimation.durationMs}ms ${timing}, color ${state.colorAnimation.durationMs}ms ${timing}`\n }, [state.colorAnimation])\n\n const isCustom = state.style === 'custom'\n const showBack = stackDepth > 1\n // Back arrow and home button coexist: an opted-in (`homeButton: true`) inner\n // page shows both, matching real WeChat. The visibility exclusions live in\n // shouldShowHomeButton, not here.\n const showHome = state.homeButtonVisible\n const titleAlign = platform === 'ios' ? 'center' : 'left'\n // Native back-arrow icon size differs per platform: iOS's arrow-back\n // SVG asset renders at its 24pt viewBox; Android's\n // Icons.AutoMirrored.Filled.KeyboardArrowLeft is explicitly sized 30dp\n // (DiminaActivity.kt CenterAlignedTopAppBar navigationIcon).\n const backIconSize = platform === 'android' ? 30 : 24\n\n const containerStyle: React.CSSProperties = {\n backgroundColor: state.backgroundColor,\n color: state.textStyle === 'white' ? '#ffffff' : '#000000',\n height: statusBarHeight + navBarHeight,\n paddingTop: statusBarHeight,\n transition,\n }\n\n return (\n <header\n className={`nav-bar nav-bar--${platform} nav-bar--${state.textStyle}${isCustom ? ' nav-bar--custom' : ''}`}\n style={containerStyle}\n aria-hidden={isCustom}\n >\n {!isCustom && (\n <div\n className=\"nav-bar__row\"\n style={{ height: navBarHeight, justifyContent: titleAlign === 'center' ? 'center' : 'flex-start' }}\n >\n {(showBack || showHome) && (\n <div className=\"nav-bar__leading\">\n {showBack && (\n <button\n type=\"button\"\n className=\"nav-bar__back\"\n aria-label=\"Back\"\n onClick={onBack}\n >\n <svg viewBox=\"0 0 24 24\" width={backIconSize} height={backIconSize} aria-hidden=\"true\">\n <path d={BACK_ARROW_PATH[platform]} fill=\"currentColor\" />\n </svg>\n </button>\n )}\n {showHome && (\n <button\n type=\"button\"\n className=\"nav-bar__home\"\n aria-label=\"Home\"\n onClick={onHome}\n >\n {/* Material Icons `home` \u2014 the icon family dimina's back\n arrows already come from on every platform */}\n <svg viewBox=\"0 0 24 24\" width=\"24\" height=\"24\" aria-hidden=\"true\">\n <path d=\"M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z\" fill=\"currentColor\" />\n </svg>\n </button>\n )}\n </div>\n )}\n <div\n className={`nav-bar__title nav-bar__title--${titleAlign}${showBack && showHome ? ' nav-bar__title--leading-pair' : ''}`}\n style={{ color: state.textStyle === 'white' ? '#ffffff' : '#000000' }}\n >\n {state.loading && (\n <span className=\"nav-bar__spinner\" aria-hidden=\"true\" />\n )}\n <span className=\"nav-bar__title-text\">{state.title}</span>\n </div>\n </div>\n )}\n <MenuCapsule\n platform={platform}\n statusBarHeight={statusBarHeight}\n onMore={onMore}\n />\n </header>\n )\n}\n\nexport function makeDefaultNavigationBarState(initial?: Partial<NavigationBarState>): NavigationBarState {\n return {\n title: initial?.title ?? '',\n backgroundColor: initial?.backgroundColor ?? '#000000',\n textStyle: initial?.textStyle ?? 'white',\n style: initial?.style ?? 'default',\n loading: initial?.loading ?? false,\n homeButtonVisible: initial?.homeButtonVisible ?? false,\n colorAnimation: initial?.colorAnimation,\n }\n}\n", "import { useEffect, useRef, useState } from 'react'\nimport {\n uiOverlayBus,\n type ActionSheetDialogState,\n type ModalDialogState,\n type ToastState,\n type UiOverlayState,\n} from './ui-overlay-bus.js'\nimport './ui-overlay.css'\n\n/**\n * Renders the native interaction overlays (toast / loading / modal / action\n * sheet). Subscribes to `uiOverlayBus`, which the wx.* handlers running in the\n * same document push into \u2014 they cannot touch React state directly.\n *\n * MiniAppFrame mounts this after the page and the tabBar, so it layers above\n * both and is clipped to whatever box the host draws around the mini-app.\n */\nexport function UiOverlay() {\n const [{ toast, dialog }, setState] = useState<UiOverlayState>(() => uiOverlayBus.getState())\n useEffect(() => uiOverlayBus.subscribe(setState), [])\n\n return (\n <>\n {toast && <ToastView toast={toast} />}\n {dialog?.kind === 'modal' && <ModalView dialog={dialog} />}\n {dialog?.kind === 'actionSheet' && <ActionSheetView dialog={dialog} />}\n </>\n )\n}\n\n// \u2500\u2500\u2500 Toast / Loading \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction ToastView({ toast }: { toast: ToastState }) {\n // Auto-dismiss after `duration` (showLoading uses Infinity \u2192 no timer; it is\n // cleared explicitly by hideLoading/hideToast). Re-armed whenever the toast\n // identity changes (a second showToast resets the countdown).\n useEffect(() => {\n if (!Number.isFinite(toast.duration)) return\n const id = window.setTimeout(() => uiOverlayBus.dismissToast(toast), toast.duration)\n return () => window.clearTimeout(id)\n }, [toast])\n\n const hasIndicator = toast.icon !== 'none' || !!toast.image\n return (\n <div className=\"dmui-overlay\" aria-live=\"polite\">\n {toast.mask && <div className=\"dmui-mask dmui-mask--transparent\" />}\n <div className={`dmui-toast${hasIndicator ? '' : ' dmui-toast--text'}`} role=\"alert\">\n {toast.image ? (\n <img className=\"dmui-toast__image\" src={toast.image} alt=\"\" />\n ) : (\n <ToastIcon icon={toast.icon} />\n )}\n {toast.title && <div className=\"dmui-toast__title\">{toast.title}</div>}\n </div>\n </div>\n )\n}\n\nfunction ToastIcon({ icon }: { icon: ToastState['icon'] }) {\n if (icon === 'success') {\n return (\n <svg className=\"dmui-toast__icon\" viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <path d=\"M5 13l4 4L19 7\" />\n </svg>\n )\n }\n if (icon === 'error') {\n return (\n <svg className=\"dmui-toast__icon\" viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <path d=\"M6 6l12 12M18 6L6 18\" />\n </svg>\n )\n }\n if (icon === 'loading') {\n return <span className=\"dmui-toast__spinner\" aria-hidden=\"true\" />\n }\n return null\n}\n\n// \u2500\u2500\u2500 Modal \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction ModalView({ dialog }: { dialog: ModalDialogState }) {\n const [value, setValue] = useState('')\n const inputRef = useRef<HTMLInputElement>(null)\n useEffect(() => {\n if (dialog.editable) inputRef.current?.focus()\n }, [dialog.editable])\n\n return (\n <div className=\"dmui-overlay\">\n <div className=\"dmui-mask\" />\n <div className=\"dmui-modal\" role=\"dialog\" aria-modal=\"true\">\n {dialog.title && <div className=\"dmui-modal__title\">{dialog.title}</div>}\n {dialog.editable ? (\n <input\n ref={inputRef}\n className=\"dmui-modal__input\"\n value={value}\n placeholder={dialog.placeholderText}\n onChange={(e) => setValue(e.target.value)}\n />\n ) : (\n dialog.content && <div className=\"dmui-modal__content\">{dialog.content}</div>\n )}\n <div className=\"dmui-modal__actions\">\n {dialog.showCancel && (\n <button\n type=\"button\"\n className=\"dmui-modal__button\"\n style={{ color: dialog.cancelColor }}\n onClick={() => dialog.onResult(false)}\n >\n {dialog.cancelText}\n </button>\n )}\n <button\n type=\"button\"\n className=\"dmui-modal__button\"\n style={{ color: dialog.confirmColor }}\n onClick={() => dialog.onResult(true, value)}\n >\n {dialog.confirmText}\n </button>\n </div>\n </div>\n </div>\n )\n}\n\n// \u2500\u2500\u2500 Action sheet \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction ActionSheetView({ dialog }: { dialog: ActionSheetDialogState }) {\n return (\n <div className=\"dmui-overlay\">\n <div className=\"dmui-mask\" onClick={() => dialog.onSelect(-1)} />\n <div className=\"dmui-action-sheet\" role=\"menu\">\n <div className=\"dmui-action-sheet__items\">\n {dialog.itemList.map((item, index) => (\n <button\n type=\"button\"\n key={index}\n className=\"dmui-action-sheet__item\"\n style={{ color: dialog.itemColor }}\n onClick={() => dialog.onSelect(index)}\n >\n {item}\n </button>\n ))}\n </div>\n <button\n type=\"button\"\n className=\"dmui-action-sheet__cancel\"\n onClick={() => dialog.onSelect(-1)}\n >\n \u53D6\u6D88\n </button>\n </div>\n </div>\n )\n}\n", "/**\n * In-renderer pub/sub store for the simulator's native UI overlays (toast,\n * loading, modal, action sheet).\n *\n * The wx.* UI handlers in `simulator-api-ui.ts` run inside the simulator\n * renderer (via runApiAsync) but cannot touch React state directly. They push\n * the desired overlay into this singleton; the `MiniAppFrame`-resident\n * `<UiOverlay>` subscribes and renders it inside the device frame (above the\n * page <webview>, clipped to the bezel \u2014 the same layering the status/nav bar\n * already use). User interaction (modal confirm/cancel, action-sheet tap) is\n * routed back to the handler through the `onResult` / `onSelect` callbacks the\n * handler attaches to the dialog state.\n */\n\nexport interface ToastState {\n title: string\n icon: 'success' | 'error' | 'loading' | 'none'\n image?: string\n /** ms before auto-dismiss; Infinity for showLoading (dismissed explicitly). */\n duration: number\n mask: boolean\n}\n\nexport interface ModalDialogState {\n kind: 'modal'\n title: string\n content: string\n showCancel: boolean\n cancelText: string\n cancelColor: string\n confirmText: string\n confirmColor: string\n editable: boolean\n placeholderText: string\n /** The renderer calls this when the user taps confirm/cancel. */\n onResult: (confirmed: boolean, content?: string) => void\n}\n\nexport interface ActionSheetDialogState {\n kind: 'actionSheet'\n itemList: string[]\n itemColor: string\n /** The renderer calls this with the tapped index, or -1 to cancel. */\n onSelect: (index: number) => void\n}\n\nexport type DialogState = ModalDialogState | ActionSheetDialogState\n\nexport interface UiOverlayState {\n toast: ToastState | null\n dialog: DialogState | null\n}\n\ntype Listener = (state: UiOverlayState) => void\n\nclass UiOverlayBus {\n private state: UiOverlayState = { toast: null, dialog: null }\n private readonly listeners = new Set<Listener>()\n\n getState(): UiOverlayState {\n return this.state\n }\n\n subscribe(listener: Listener): () => void {\n this.listeners.add(listener)\n return () => {\n this.listeners.delete(listener)\n }\n }\n\n showToast(toast: ToastState): void {\n this.set({ ...this.state, toast })\n }\n\n hideToast(): void {\n this.set({ ...this.state, toast: null })\n }\n\n /**\n * Clear `toast` only if it is still the active one. The toast auto-dismiss\n * timer holds a reference to the toast it scheduled; a newer showToast may\n * have replaced it in the meantime, and a blind `hideToast()` from the stale\n * timer would wrongly clear the new toast.\n */\n dismissToast(toast: ToastState): void {\n if (this.state.toast === toast) this.hideToast()\n }\n\n showDialog(dialog: DialogState): void {\n this.set({ ...this.state, dialog })\n }\n\n hideDialog(): void {\n this.set({ ...this.state, dialog: null })\n }\n\n private set(next: UiOverlayState): void {\n this.state = next\n for (const listener of this.listeners) listener(next)\n }\n}\n\nexport const uiOverlayBus = new UiOverlayBus()\n", "/**\n * DevTools implementations for the WeChat-style interaction APIs that native\n * platforms (iOS / Android / Harmony) provide but the web container lacks:\n * showToast / hideToast / showLoading / hideLoading / showModal /\n * showActionSheet.\n *\n * Each handler is bound with `this` = MiniApp instance (via\n * AppManager.registerApi \u2192 MiniApp.invokeApi). The overlay is rendered by the\n * DeviceShell-resident `<UiOverlay>`; these handlers only push state into\n * `uiOverlayBus` and fire the success/fail/complete callbacks \u2014 immediately for\n * toast/loading, and on user interaction for modal/actionSheet (defaults and\n * verdict strings mirror the Android `InteractionApi`).\n */\n\nimport type { MiniAppContext } from './types'\nimport { bindCallbacks } from './simulator-api-helpers'\nimport { uiOverlayBus } from '@dimina-kit/electron-runtime/simulator-ui'\n\ninterface ToastOpts {\n title?: string\n icon?: 'success' | 'error' | 'loading' | 'none'\n image?: string\n duration?: number\n mask?: boolean\n success?: unknown\n fail?: unknown\n complete?: unknown\n}\n\nexport function showToast(this: MiniAppContext, opts: ToastOpts = {}) {\n const { onSuccess, onComplete } = bindCallbacks(this, opts)\n uiOverlayBus.showToast({\n title: opts.title ?? '',\n icon: opts.icon ?? 'success',\n image: opts.image,\n duration: opts.duration ?? 1500,\n mask: opts.mask ?? false,\n })\n onSuccess?.({ errMsg: 'showToast:ok' })\n onComplete?.()\n}\n\nexport function hideToast(this: MiniAppContext, opts: { success?: unknown; complete?: unknown } = {}) {\n const { onSuccess, onComplete } = bindCallbacks(this, opts)\n uiOverlayBus.hideToast()\n onSuccess?.({ errMsg: 'hideToast:ok' })\n onComplete?.()\n}\n\nexport function showLoading(\n this: MiniAppContext,\n opts: { title?: string; mask?: boolean; success?: unknown; complete?: unknown } = {},\n) {\n const { onSuccess, onComplete } = bindCallbacks(this, opts)\n uiOverlayBus.showToast({\n title: opts.title ?? '',\n icon: 'loading',\n duration: Infinity,\n mask: opts.mask ?? false,\n })\n onSuccess?.({ errMsg: 'showLoading:ok' })\n onComplete?.()\n}\n\nexport function hideLoading(this: MiniAppContext, opts: { success?: unknown; complete?: unknown } = {}) {\n const { onSuccess, onComplete } = bindCallbacks(this, opts)\n uiOverlayBus.hideToast()\n onSuccess?.({ errMsg: 'hideLoading:ok' })\n onComplete?.()\n}\n\ninterface ModalOpts {\n title?: string\n content?: string\n showCancel?: boolean\n cancelText?: string\n cancelColor?: string\n confirmText?: string\n confirmColor?: string\n editable?: boolean\n placeholderText?: string\n success?: unknown\n fail?: unknown\n complete?: unknown\n}\n\nexport function showModal(this: MiniAppContext, opts: ModalOpts = {}) {\n const { onSuccess, onComplete } = bindCallbacks(this, opts)\n const editable = opts.editable ?? false\n // Guard against a double resolution (rapid double-tap / a re-render firing the\n // handler twice) settling the callbacks more than once.\n let settled = false\n uiOverlayBus.showDialog({\n kind: 'modal',\n title: opts.title ?? '',\n content: opts.content ?? '',\n showCancel: opts.showCancel ?? true,\n cancelText: opts.cancelText ?? '\u53D6\u6D88',\n cancelColor: opts.cancelColor ?? '#000000',\n confirmText: opts.confirmText ?? '\u786E\u5B9A',\n confirmColor: opts.confirmColor ?? '#576B95',\n editable,\n placeholderText: opts.placeholderText ?? '',\n onResult: (confirmed, content) => {\n if (settled) return\n settled = true\n uiOverlayBus.hideDialog()\n const result: Record<string, unknown> = {\n confirm: confirmed,\n cancel: !confirmed,\n errMsg: 'showModal:ok',\n }\n if (editable) result.content = content ?? ''\n onSuccess?.(result)\n onComplete?.()\n },\n })\n}\n\ninterface ActionSheetOpts {\n itemList?: string[]\n itemColor?: string\n success?: unknown\n fail?: unknown\n complete?: unknown\n}\n\nexport function showActionSheet(this: MiniAppContext, opts: ActionSheetOpts = {}) {\n const { onSuccess, onFail, onComplete } = bindCallbacks(this, opts)\n let settled = false\n uiOverlayBus.showDialog({\n kind: 'actionSheet',\n itemList: opts.itemList ?? [],\n itemColor: opts.itemColor ?? '#000000',\n onSelect: (index) => {\n if (settled) return\n settled = true\n uiOverlayBus.hideDialog()\n if (index === -1) {\n onFail?.({ errMsg: 'showActionSheet:fail cancel' })\n } else {\n onSuccess?.({ tapIndex: index, errMsg: 'showActionSheet:ok' })\n }\n onComplete?.()\n },\n })\n}\n", "/**\n * DevTools API stubs for wx.xxx APIs that exist on native platforms\n * (iOS / Android / Harmony) but are missing in the web container.\n *\n * Each exported function is bound with `this` = MiniApp instance\n * (via AppManager.registerApi \u2192 MiniApp.invokeApi).\n */\n\nimport type { MiniAppContext } from './types'\nimport { deviceInfoToHostEnv } from '../shared/bridge-channels'\nimport { bindCallbacks } from './simulator-api-helpers'\nimport {\n\tsetStorageSync,\n\tgetStorageSync,\n\tremoveStorageSync,\n\tclearStorageSync,\n\tgetStorageInfoSync,\n\tsetStorage,\n\tgetStorage,\n\tremoveStorage,\n\tclearStorage,\n\tgetStorageInfo,\n} from './simulator-api-storage'\nimport {\n\thideKeyboard,\n\tadjustPosition,\n\tmakePhoneCall,\n\tchooseContact,\n\taddPhoneContact,\n\tvibrateShort,\n\tvibrateLong,\n\tscanCode,\n\tgetClipboardData,\n\tsetClipboardData,\n\tgetNetworkType,\n} from './simulator-api-device'\nimport {\n\tchooseImage,\n\tpreviewImage,\n\tcompressImage,\n\tsaveImageToPhotosAlbum,\n\tsaveCanvasTempFile,\n\tgetImageInfo,\n\tchooseMedia,\n\tchooseVideo,\n\taudioCreate,\n\taudioListen,\n\taudioSetProp,\n\taudioPlay,\n\taudioPause,\n\taudioStop,\n\taudioSeek,\n\taudioDestroy,\n} from './simulator-api-media'\nimport { fileSystemManagerApis } from './simulator-api-fsm'\nimport {\n\tdownloadFile,\n\tuploadFile,\n\tuploadFileAbort,\n} from './simulator-api-network'\nexport {\n\tdownloadFile,\n\tuploadFile,\n\tuploadFileAbort,\n} from './simulator-api-network'\nimport {\n\tshowToast,\n\thideToast,\n\tshowLoading,\n\thideLoading,\n\tshowModal,\n\tshowActionSheet,\n} from './simulator-api-ui'\n\n// \u2500\u2500\u2500 Base \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport function canIUse(this: MiniAppContext, { success, complete }: { success?: unknown; complete?: unknown }) {\n\tconst { onSuccess, onComplete } = bindCallbacks(this, { success, complete })\n\t// In devtools all standard APIs are considered available.\n\tonSuccess?.(true)\n\tonComplete?.()\n\t// Also return synchronously for callers that use the return value.\n\treturn true\n}\n\nexport function getWindowInfo(this: MiniAppContext, { success, complete }: { success?: unknown; complete?: unknown } = {}) {\n\tconst { onSuccess, onComplete } = bindCallbacks(this, { success, complete })\n\n\tconst { wb, di, dev, pixelRatio, screenWidth, screenHeight, windowWidth, windowHeight } = readWindowMetrics(this)\n\tconst bar = this.parent?.getStatusBarRect?.() ?? { height: dev?.statusBarHeight ?? 0 }\n\tconst statusBarHeight = (di['statusBarHeight'] as number | undefined) ?? bar.height\n\n\tconst info = {\n\t\tpixelRatio, screenWidth, screenHeight, windowWidth, windowHeight,\n\t\tstatusBarHeight,\n\t\tsafeArea: {\n\t\t\twidth: wb.width,\n\t\t\theight: wb.height - statusBarHeight,\n\t\t\ttop: statusBarHeight,\n\t\t\tbottom: wb.height,\n\t\t\tleft: 0,\n\t\t\tright: wb.width,\n\t\t},\n\t}\n\tonSuccess?.(info)\n\tonComplete?.()\n\treturn info\n}\n\nexport function getSystemSetting(this: MiniAppContext, { success, complete }: { success?: unknown; complete?: unknown } = {}) {\n\tconst { onSuccess, onComplete } = bindCallbacks(this, { success, complete })\n\n\t// Orientation is derived from the selected device through\n\t// `deviceInfoToHostEnv`, the same single source the sync service-host path\n\t// reads via hostEnvSnapshot \u2014 a constant here would contradict\n\t// getSystemInfo inside one onResize callback. 'portrait' only stands in\n\t// while no device has been selected yet.\n\tconst device = this.getCurrentDevice?.()\n\tconst info = {\n\t\tbluetoothEnabled: false,\n\t\tlocationEnabled: true,\n\t\twifiEnabled: true,\n\t\tdeviceOrientation: (device && deviceInfoToHostEnv(device).deviceOrientation) || 'portrait',\n\t}\n\tonSuccess?.(info)\n\tonComplete?.()\n\treturn info\n}\n\n// \u2500\u2500\u2500 System Info \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nfunction readWindowMetrics(miniApp: MiniAppContext) {\n\t// Priority unchanged: __deviceInfo \u2192 host DOM rect. Only the last-resort\n\t// fallback follows the CURRENTLY emulated device (SimulatorMiniApp tracks\n\t// boot config device + live DEVICE_CHANGE) instead of a hardcoded 375x812.\n\tconst dev = miniApp.getDeviceMetrics?.()\n\tconst wb = miniApp.parent?.el?.querySelector('.dimina-native-webview__root')?.getBoundingClientRect()\n\t\t?? { width: dev?.screenWidth ?? 375, height: dev?.screenHeight ?? 812 }\n\tconst di = (window as Window & { __deviceInfo?: Record<string, unknown> }).__deviceInfo || {}\n\treturn {\n\t\twb,\n\t\tdi,\n\t\tdev,\n\t\tpixelRatio: (di['pixelRatio'] as number | undefined) || dev?.pixelRatio || window.devicePixelRatio || 2,\n\t\tscreenWidth: (di['screenWidth'] as number | undefined) || wb.width,\n\t\tscreenHeight: (di['screenHeight'] as number | undefined) || wb.height,\n\t\twindowWidth: wb.width,\n\t\twindowHeight: wb.height,\n\t}\n}\n\nfunction buildSystemInfo(miniApp: MiniAppContext) {\n\t// With a device selected, the runtime's deviceInfoToHostEnv owns every\n\t// window metric, so this forwarded async path reports exactly what the sync\n\t// service-host binding and the per-spawn host-env snapshot report. Only the\n\t// pre-selection default still measures the host DOM below.\n\tconst device = miniApp.getCurrentDevice?.()\n\tif (device) {\n\t\treturn {\n\t\t\t...deviceInfoToHostEnv(device),\n\t\t\tlanguage: 'zh_CN',\n\t\t\tversion: '8.0.5',\n\t\t\tSDKVersion: '3.0.0',\n\t\t\tfontSizeSetting: 16,\n\t\t\ttheme: window.matchMedia?.('(prefers-color-scheme: dark)').matches ? 'dark' : 'light',\n\t\t}\n\t}\n\tconst { wb, di, dev, pixelRatio, screenWidth, screenHeight, windowWidth, windowHeight } = readWindowMetrics(miniApp)\n\tconst statusBarHeight = (di['statusBarHeight'] as number | undefined) ?? dev?.statusBarHeight ?? 0\n\t// Bottom inset sourced from safeAreaInsets.bottom (the single source \u2014 the\n\t// legacy flat `safeAreaBottom` field is decommissioned).\n\tconst bottomInset = (di['safeAreaInsets'] as { bottom?: number } | undefined)?.bottom\n\t\t?? dev?.safeAreaInsets?.bottom ?? 0\n\n\treturn {\n\t\tbrand: di['brand'] || 'devtools',\n\t\tmodel: di['model'] || 'devtools',\n\t\tpixelRatio, screenWidth, screenHeight, windowWidth, windowHeight,\n\t\tstatusBarHeight,\n\t\tlanguage: 'zh_CN',\n\t\tversion: '8.0.5',\n\t\tsystem: di['system'] || 'iOS 16.0',\n\t\tplatform: di['platform'] || 'ios',\n\t\tfontSizeSetting: 16,\n\t\tSDKVersion: '3.0.0',\n\t\tdeviceOrientation: 'portrait',\n\t\tsafeArea: {\n\t\t\twidth: wb.width,\n\t\t\theight: wb.height - statusBarHeight - bottomInset,\n\t\t\ttop: statusBarHeight,\n\t\t\tbottom: wb.height - bottomInset,\n\t\t\tleft: 0,\n\t\t\tright: wb.width,\n\t\t},\n\t}\n}\n\nexport function getSystemInfoAsync(this: MiniAppContext, opts: { success?: unknown; complete?: unknown }) {\n\tconst { success, complete } = opts\n\tconst { onSuccess, onComplete } = bindCallbacks(this, { success, complete })\n\tonSuccess?.(buildSystemInfo(this))\n\tonComplete?.()\n}\n\nexport function getSystemInfo(this: MiniAppContext, opts: { success?: unknown; complete?: unknown }) {\n\tgetSystemInfoAsync.call(this, opts)\n}\n\nexport function getSystemInfoSync(this: MiniAppContext) {\n\treturn buildSystemInfo(this)\n}\n\n// \u2500\u2500\u2500 Open API: Account Info \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nexport function getAccountInfoSync(this: MiniAppContext) {\n\treturn {\n\t\tminiProgram: {\n\t\t\tappId: this.appId || '',\n\t\t\tenvVersion: 'develop',\n\t\t\tversion: '',\n\t\t},\n\t}\n}\n\n// \u2500\u2500\u2500 Collect all APIs into a map \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n// `opts: never` (not the wider `unknown`) so every handler below \u2014 each typed\n// with its OWN specific opts shape (`getSystemInfoAsync`'s `{ success?, complete? }`,\n// `canIUse`'s `string`, \u2026) \u2014 remains assignable into this map: a function\n// parameter is checked contravariantly, and `never` is assignable into any\n// concrete opts type, whereas `unknown` (the caller-side \"any value\" type)\n// would reject every narrower handler signature here. Callers of this map\n// always cast to a caller-appropriate handler type before invoking (see\n// simulator-app.tsx / main-api-runner.ts) \u2014 this declaration only has to\n// typecheck the object literal itself.\nexport const simulatorApis: Record<string, (this: MiniAppContext, opts: never) => unknown> = {\n\t// Base\n\tcanIUse,\n\tgetSystemInfo,\n\tgetSystemInfoAsync,\n\tgetSystemInfoSync,\n\tgetWindowInfo,\n\tgetSystemSetting,\n\t// UI: interaction\n\tshowToast,\n\thideToast,\n\tshowLoading,\n\thideLoading,\n\tshowModal,\n\tshowActionSheet,\n\t// Network\n\tdownloadFile,\n\tuploadFile,\n\tuploadFileAbort,\n\t// Storage (sync)\n\tsetStorageSync,\n\tgetStorageSync,\n\tremoveStorageSync,\n\tclearStorageSync,\n\tgetStorageInfoSync,\n\t// Storage (async)\n\tsetStorage,\n\tgetStorage,\n\tremoveStorage,\n\tclearStorage,\n\tgetStorageInfo,\n\t// Open API\n\tgetAccountInfoSync,\n\t// Device\n\thideKeyboard,\n\tadjustPosition,\n\tmakePhoneCall,\n\tchooseContact,\n\taddPhoneContact,\n\tvibrateShort,\n\tvibrateLong,\n\tscanCode,\n\tgetClipboardData,\n\tsetClipboardData,\n\tgetNetworkType,\n\t// Media: Image\n\tchooseImage,\n\tpreviewImage,\n\tcompressImage,\n\tsaveImageToPhotosAlbum,\n\tsaveCanvasTempFile,\n\tgetImageInfo,\n\t// Media: Video\n\tchooseMedia,\n\tchooseVideo,\n\t// Media: Audio (service-apis/audio)\n\taudioCreate,\n\taudioListen,\n\taudioSetProp,\n\taudioPlay,\n\taudioPause,\n\taudioStop,\n\taudioSeek,\n\taudioDestroy,\n\t// Filesystem: the service thread invokes the dotted FileSystemManager.*\n\t// wire names (see simulator-api-fsm.ts).\n\t...fileSystemManagerApis,\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,yFAAAA,UAAA;AAAA;AASa,QAAI,IAAE,uBAAO,IAAI,eAAe;AAAhC,QAAkC,IAAE,uBAAO,IAAI,cAAc;AAA7D,QAA+D,IAAE,uBAAO,IAAI,gBAAgB;AAA5F,QAA8F,IAAE,uBAAO,IAAI,mBAAmB;AAA9H,QAAgI,IAAE,uBAAO,IAAI,gBAAgB;AAA7J,QAA+J,IAAE,uBAAO,IAAI,gBAAgB;AAA5L,QAA8L,IAAE,uBAAO,IAAI,eAAe;AAA1N,QAA4N,IAAE,uBAAO,IAAI,mBAAmB;AAA5P,QAA8P,IAAE,uBAAO,IAAI,gBAAgB;AAA3R,QAA6R,IAAE,uBAAO,IAAI,YAAY;AAAtT,QAAwT,IAAE,uBAAO,IAAI,YAAY;AAAjV,QAAmV,IAAE,OAAO;AAAS,aAAS,EAAE,GAAE;AAAC,UAAG,SAAO,KAAG,aAAW,OAAO,EAAE,QAAO;AAAK,UAAE,KAAG,EAAE,CAAC,KAAG,EAAE,YAAY;AAAE,aAAM,eAAa,OAAO,IAAE,IAAE;AAAA,IAAI;AAC1e,QAAI,IAAE,EAAC,WAAU,WAAU;AAAC,aAAM;AAAA,IAAE,GAAE,oBAAmB,WAAU;AAAA,IAAC,GAAE,qBAAoB,WAAU;AAAA,IAAC,GAAE,iBAAgB,WA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R,QAAQ;AAAA,EACV,EAAE,KAAK,CAAC,YAAY;AAClB,UAAM,MAA0B;AAAA,MAC9B,cAAc,QAAQ;AAAA,MACtB,WAAW,QAAQ;AAAA,MACnB,IAAI,QAAQ;AAAA,MACZ,QAAQ,QAAQ;AAAA,MAChB,QAAQ,QAAQ;AAAA,IAClB;AACA,gCAAY,KAAK,gBAAE,cAAc,GAAG;AAAA,EACtC,CAAC;AACH,CAAC;AAMD,IAAI,QAAQ,IAAI,aAAa,QAAQ;AACnC,gCAAc,kBAAkB,aAAa;AAAA,IAC3C,MAAM,CAAC,YAAoB,SAAoB;AAC7C;AAAC,MAAC,4BAA0E,KAAK,SAAS,GAAG,IAAI;AAAA,IACnG;AAAA,EACF,CAAC;AACH;",
6
+ "names": ["exports", "a", "b", "exports", "module", "ReactDebugCurrentFrame", "moduleObject", "error", "useState", "useRef", "useEffect", "useCallback", "useMemo", "Component", "location", "returnValue", "exports", "module", "exports", "exports", "ReactDebugCurrentFrame", "location", "exports", "module", "handlers", "osStatic", "pathStatic", "path", "path", "path", "path", "tempFiles", "metadata", "BufferImpl", "import_react", "import_react"]
7
7
  }