@semiont/frontend 0.2.36 → 0.2.39

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 (180) hide show
  1. package/package.json +1 -1
  2. package/standalone/apps/frontend/.next/BUILD_ID +1 -1
  3. package/standalone/apps/frontend/.next/app-build-manifest.json +122 -122
  4. package/standalone/apps/frontend/.next/app-path-routes-manifest.json +8 -8
  5. package/standalone/apps/frontend/.next/build-manifest.json +6 -6
  6. package/standalone/apps/frontend/.next/prerender-manifest.json +3 -3
  7. package/standalone/apps/frontend/.next/required-server-files.json +4 -4
  8. package/standalone/apps/frontend/.next/server/app/[locale]/about/page.js +35 -35
  9. package/standalone/apps/frontend/.next/server/app/[locale]/about/page.js.nft.json +1 -1
  10. package/standalone/apps/frontend/.next/server/app/[locale]/about/page_client-reference-manifest.js +1 -1
  11. package/standalone/apps/frontend/.next/server/app/[locale]/admin/devops/page.js +49 -49
  12. package/standalone/apps/frontend/.next/server/app/[locale]/admin/devops/page.js.nft.json +1 -1
  13. package/standalone/apps/frontend/.next/server/app/[locale]/admin/devops/page_client-reference-manifest.js +1 -1
  14. package/standalone/apps/frontend/.next/server/app/[locale]/admin/page.js +69 -69
  15. package/standalone/apps/frontend/.next/server/app/[locale]/admin/page.js.nft.json +1 -1
  16. package/standalone/apps/frontend/.next/server/app/[locale]/admin/page_client-reference-manifest.js +1 -1
  17. package/standalone/apps/frontend/.next/server/app/[locale]/admin/security/page.js +158 -158
  18. package/standalone/apps/frontend/.next/server/app/[locale]/admin/security/page.js.nft.json +1 -1
  19. package/standalone/apps/frontend/.next/server/app/[locale]/admin/security/page_client-reference-manifest.js +1 -1
  20. package/standalone/apps/frontend/.next/server/app/[locale]/admin/users/page.js +121 -121
  21. package/standalone/apps/frontend/.next/server/app/[locale]/admin/users/page.js.nft.json +1 -1
  22. package/standalone/apps/frontend/.next/server/app/[locale]/admin/users/page_client-reference-manifest.js +1 -1
  23. package/standalone/apps/frontend/.next/server/app/[locale]/auth/error/page.js +440 -440
  24. package/standalone/apps/frontend/.next/server/app/[locale]/auth/error/page.js.nft.json +1 -1
  25. package/standalone/apps/frontend/.next/server/app/[locale]/auth/error/page_client-reference-manifest.js +1 -1
  26. package/standalone/apps/frontend/.next/server/app/[locale]/auth/mcp-setup/route.js +62 -62
  27. package/standalone/apps/frontend/.next/server/app/[locale]/auth/mcp-setup/route.js.nft.json +1 -1
  28. package/standalone/apps/frontend/.next/server/app/[locale]/auth/mcp-setup/route_client-reference-manifest.js +1 -1
  29. package/standalone/apps/frontend/.next/server/app/[locale]/auth/signin/page.js +25 -25
  30. package/standalone/apps/frontend/.next/server/app/[locale]/auth/signin/page.js.nft.json +1 -1
  31. package/standalone/apps/frontend/.next/server/app/[locale]/auth/signin/page_client-reference-manifest.js +1 -1
  32. package/standalone/apps/frontend/.next/server/app/[locale]/auth/signup/page.js +270 -270
  33. package/standalone/apps/frontend/.next/server/app/[locale]/auth/signup/page.js.nft.json +1 -1
  34. package/standalone/apps/frontend/.next/server/app/[locale]/auth/signup/page_client-reference-manifest.js +1 -1
  35. package/standalone/apps/frontend/.next/server/app/[locale]/auth/welcome/page.js +250 -250
  36. package/standalone/apps/frontend/.next/server/app/[locale]/auth/welcome/page.js.nft.json +1 -1
  37. package/standalone/apps/frontend/.next/server/app/[locale]/auth/welcome/page_client-reference-manifest.js +1 -1
  38. package/standalone/apps/frontend/.next/server/app/[locale]/know/compose/page.js +46 -46
  39. package/standalone/apps/frontend/.next/server/app/[locale]/know/compose/page.js.nft.json +1 -1
  40. package/standalone/apps/frontend/.next/server/app/[locale]/know/compose/page_client-reference-manifest.js +1 -1
  41. package/standalone/apps/frontend/.next/server/app/[locale]/know/discover/page.js +18 -18
  42. package/standalone/apps/frontend/.next/server/app/[locale]/know/discover/page.js.nft.json +1 -1
  43. package/standalone/apps/frontend/.next/server/app/[locale]/know/discover/page_client-reference-manifest.js +1 -1
  44. package/standalone/apps/frontend/.next/server/app/[locale]/know/page.js +135 -135
  45. package/standalone/apps/frontend/.next/server/app/[locale]/know/page.js.nft.json +1 -1
  46. package/standalone/apps/frontend/.next/server/app/[locale]/know/page_client-reference-manifest.js +1 -1
  47. package/standalone/apps/frontend/.next/server/app/[locale]/know/resource/[id]/page.js +1454 -1454
  48. package/standalone/apps/frontend/.next/server/app/[locale]/know/resource/[id]/page.js.nft.json +1 -1
  49. package/standalone/apps/frontend/.next/server/app/[locale]/know/resource/[id]/page_client-reference-manifest.js +1 -1
  50. package/standalone/apps/frontend/.next/server/app/[locale]/moderate/entity-tags/page.js +1440 -1440
  51. package/standalone/apps/frontend/.next/server/app/[locale]/moderate/entity-tags/page.js.nft.json +1 -1
  52. package/standalone/apps/frontend/.next/server/app/[locale]/moderate/entity-tags/page_client-reference-manifest.js +1 -1
  53. package/standalone/apps/frontend/.next/server/app/[locale]/moderate/page.js +632 -632
  54. package/standalone/apps/frontend/.next/server/app/[locale]/moderate/page.js.nft.json +1 -1
  55. package/standalone/apps/frontend/.next/server/app/[locale]/moderate/page_client-reference-manifest.js +1 -1
  56. package/standalone/apps/frontend/.next/server/app/[locale]/moderate/recent/page.js +79 -79
  57. package/standalone/apps/frontend/.next/server/app/[locale]/moderate/recent/page.js.nft.json +1 -1
  58. package/standalone/apps/frontend/.next/server/app/[locale]/moderate/recent/page_client-reference-manifest.js +1 -1
  59. package/standalone/apps/frontend/.next/server/app/[locale]/moderate/tag-schemas/page.js +1613 -1613
  60. package/standalone/apps/frontend/.next/server/app/[locale]/moderate/tag-schemas/page.js.nft.json +1 -1
  61. package/standalone/apps/frontend/.next/server/app/[locale]/moderate/tag-schemas/page_client-reference-manifest.js +1 -1
  62. package/standalone/apps/frontend/.next/server/app/[locale]/page.js +262 -262
  63. package/standalone/apps/frontend/.next/server/app/[locale]/page.js.nft.json +1 -1
  64. package/standalone/apps/frontend/.next/server/app/[locale]/page_client-reference-manifest.js +1 -1
  65. package/standalone/apps/frontend/.next/server/app/[locale]/privacy/page.js +125 -125
  66. package/standalone/apps/frontend/.next/server/app/[locale]/privacy/page.js.nft.json +1 -1
  67. package/standalone/apps/frontend/.next/server/app/[locale]/privacy/page_client-reference-manifest.js +1 -1
  68. package/standalone/apps/frontend/.next/server/app/[locale]/terms/page.js +604 -604
  69. package/standalone/apps/frontend/.next/server/app/[locale]/terms/page.js.nft.json +1 -1
  70. package/standalone/apps/frontend/.next/server/app/[locale]/terms/page_client-reference-manifest.js +1 -1
  71. package/standalone/apps/frontend/.next/server/app/_not-found/page.js +358 -358
  72. package/standalone/apps/frontend/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  73. package/standalone/apps/frontend/.next/server/app/_not-found.html +1 -1
  74. package/standalone/apps/frontend/.next/server/app/_not-found.rsc +3 -3
  75. package/standalone/apps/frontend/.next/server/app/api/auth/[...nextauth]/route.js +113 -113
  76. package/standalone/apps/frontend/.next/server/app/api/auth/[...nextauth]/route.js.nft.json +1 -1
  77. package/standalone/apps/frontend/.next/server/app/api/auth/[...nextauth]/route_client-reference-manifest.js +1 -1
  78. package/standalone/apps/frontend/.next/server/app/api/cookies/consent/route.js +64 -64
  79. package/standalone/apps/frontend/.next/server/app/api/cookies/consent/route.js.nft.json +1 -1
  80. package/standalone/apps/frontend/.next/server/app/api/cookies/consent/route_client-reference-manifest.js +1 -1
  81. package/standalone/apps/frontend/.next/server/app/api/cookies/export/route.js +42 -42
  82. package/standalone/apps/frontend/.next/server/app/api/cookies/export/route.js.nft.json +1 -1
  83. package/standalone/apps/frontend/.next/server/app/api/cookies/export/route_client-reference-manifest.js +1 -1
  84. package/standalone/apps/frontend/.next/server/app/api/resources/[id]/route.js +111 -111
  85. package/standalone/apps/frontend/.next/server/app/api/resources/[id]/route.js.nft.json +1 -1
  86. package/standalone/apps/frontend/.next/server/app/api/resources/[id]/route_client-reference-manifest.js +1 -1
  87. package/standalone/apps/frontend/.next/server/app-paths-manifest.json +8 -8
  88. package/standalone/apps/frontend/.next/server/chunks/1037.js +4 -4
  89. package/standalone/apps/frontend/.next/server/chunks/1854.js +55 -55
  90. package/standalone/apps/frontend/.next/server/chunks/1940.js +388 -388
  91. package/standalone/apps/frontend/.next/server/chunks/{5137.js → 5015.js} +20 -20
  92. package/standalone/apps/frontend/.next/server/chunks/{4331.js → 5919.js} +12 -12
  93. package/standalone/apps/frontend/.next/server/chunks/7912.js +195 -195
  94. package/standalone/apps/frontend/.next/server/chunks/{255.js → 8387.js} +127 -127
  95. package/standalone/apps/frontend/.next/server/middleware-build-manifest.js +1 -1
  96. package/standalone/apps/frontend/.next/server/middleware-manifest.json +5 -5
  97. package/standalone/apps/frontend/.next/server/next-font-manifest.js +1 -1
  98. package/standalone/apps/frontend/.next/server/next-font-manifest.json +1 -1
  99. package/standalone/apps/frontend/.next/server/pages/404.html +1 -1
  100. package/standalone/apps/frontend/.next/server/pages/500.html +1 -1
  101. package/standalone/apps/frontend/.next/server/server-reference-manifest.json +1 -1
  102. package/standalone/apps/frontend/.next/server/src/middleware.js +10636 -10636
  103. package/standalone/apps/frontend/.next/static/chunks/app/[locale]/about/page-28023b5ae5e22ad9.js +1 -0
  104. package/standalone/apps/frontend/.next/static/chunks/app/[locale]/admin/devops/{page-a9093490466b2b37.js → page-da9614b9f1606d7b.js} +1 -1
  105. package/standalone/apps/frontend/.next/static/chunks/app/[locale]/admin/{layout-5af3f431ec0b3338.js → layout-62ef934e6bcc18b1.js} +1 -1
  106. package/standalone/apps/frontend/.next/static/chunks/app/[locale]/admin/page-fc5e1da86912c64f.js +1 -0
  107. package/standalone/apps/frontend/.next/static/chunks/app/[locale]/admin/security/page-8031d11e8dccef6c.js +1 -0
  108. package/standalone/apps/frontend/.next/static/chunks/app/[locale]/admin/users/{page-1952f839f1e5aec3.js → page-a978206777229291.js} +1 -1
  109. package/standalone/apps/frontend/.next/static/chunks/app/[locale]/auth/error/{page-c72ec26a8cc98e35.js → page-4e5ee1553c6d8ebe.js} +1 -1
  110. package/standalone/apps/frontend/.next/static/chunks/app/[locale]/auth/mcp-setup/route-e1d196e7f8d38edd.js +1 -0
  111. package/standalone/apps/frontend/.next/static/chunks/app/[locale]/auth/signin/{page-180f998c19826597.js → page-c878d25b0ae5069c.js} +1 -1
  112. package/standalone/apps/frontend/.next/static/chunks/app/[locale]/auth/signup/{page-f1ccc995126a89a8.js → page-1292f2664ce93b63.js} +1 -1
  113. package/standalone/apps/frontend/.next/static/chunks/app/[locale]/auth/welcome/{page-f57e39b176753cc4.js → page-7e79cf1f705618db.js} +1 -1
  114. package/standalone/apps/frontend/.next/static/chunks/app/[locale]/know/compose/{page-9b4223dae15c8d0c.js → page-7c16ece328eb4a91.js} +1 -1
  115. package/standalone/apps/frontend/.next/static/chunks/app/[locale]/know/discover/{page-926f8f5f5569695e.js → page-f9d0032f45241437.js} +1 -1
  116. package/standalone/apps/frontend/.next/static/chunks/app/[locale]/know/{layout-5ab3b200e60ffd91.js → layout-83fe577a1460d915.js} +1 -1
  117. package/standalone/apps/frontend/.next/static/chunks/app/[locale]/know/{page-55d3c0928a59e55f.js → page-5349aaee3976e1bb.js} +1 -1
  118. package/standalone/apps/frontend/.next/static/chunks/app/[locale]/know/resource/[id]/page-4cb67f9bf8be8f1a.js +1 -0
  119. package/standalone/apps/frontend/.next/static/chunks/app/[locale]/{layout-a298c8dc1488a191.js → layout-2f6c82f89ff0fb38.js} +1 -1
  120. package/standalone/apps/frontend/.next/static/chunks/app/[locale]/moderate/entity-tags/page-f76e2312764ebe0c.js +1 -0
  121. package/standalone/apps/frontend/.next/static/chunks/app/[locale]/moderate/{layout-fceb080211969ed7.js → layout-63abc0b7153c03d3.js} +1 -1
  122. package/standalone/apps/frontend/.next/static/chunks/app/[locale]/moderate/{page-3d971aeb0ca1324a.js → page-7bc1b2215ffcdde0.js} +1 -1
  123. package/standalone/apps/frontend/.next/static/chunks/app/[locale]/moderate/recent/{page-3a7a7a375c4338f5.js → page-a00695b21e364495.js} +1 -1
  124. package/standalone/apps/frontend/.next/static/chunks/app/[locale]/moderate/tag-schemas/{page-47f0c2c1cfb3e969.js → page-874ddff1c67dd96a.js} +1 -1
  125. package/standalone/apps/frontend/.next/static/chunks/app/[locale]/{not-found-cd4d3962209aaa67.js → not-found-9338290efe925a85.js} +1 -1
  126. package/standalone/apps/frontend/.next/static/chunks/app/[locale]/{page-e6857bdeef2ade5e.js → page-46fad01f54cffcaf.js} +1 -1
  127. package/standalone/apps/frontend/.next/static/chunks/app/[locale]/privacy/{page-2018e48e55ecea79.js → page-7034c8af05b702cd.js} +1 -1
  128. package/standalone/apps/frontend/.next/static/chunks/app/[locale]/terms/{page-87dc1af32b067913.js → page-fbfecd018ce6acdd.js} +1 -1
  129. package/standalone/apps/frontend/.next/static/chunks/app/api/auth/[...nextauth]/route-24502971e8577474.js +1 -0
  130. package/standalone/apps/frontend/.next/static/chunks/app/api/cookies/consent/route-680f8e085df19751.js +1 -0
  131. package/standalone/apps/frontend/.next/static/chunks/app/api/cookies/export/route-5c5bd56c39187fd1.js +1 -0
  132. package/standalone/apps/frontend/.next/static/chunks/app/api/resources/[id]/{route-41d8347af9354a15.js → route-e5f4f3f1353c7a86.js} +1 -1
  133. package/standalone/apps/frontend/.next/static/chunks/app/{error-092a0e51a706052b.js → error-4ec2f52abc66bc6c.js} +1 -1
  134. package/standalone/apps/frontend/.next/static/chunks/app/global-error-c894441824fc03d1.js +1 -0
  135. package/standalone/apps/frontend/.next/static/chunks/{common-cafbbd01b1c3775d.js → common-d8e3aad4ef182cd5.js} +1 -1
  136. package/standalone/apps/frontend/.next/static/chunks/main-app-4616290e0bdaf4ae.js +1 -0
  137. package/standalone/apps/frontend/package.json +3 -3
  138. package/standalone/apps/frontend/server.js +1 -1
  139. package/standalone/node_modules/@img/{sharp-libvips-darwin-arm64/lib/libvips-cpp.8.17.3.dylib → sharp-libvips-linux-x64/lib/libvips-cpp.so.8.17.3} +0 -0
  140. package/standalone/node_modules/@img/{sharp-libvips-darwin-arm64 → sharp-libvips-linux-x64}/package.json +11 -5
  141. package/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/index.js +1 -0
  142. package/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/lib/libvips-cpp.so.8.17.3 +0 -0
  143. package/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/package.json +42 -0
  144. package/standalone/node_modules/@img/sharp-libvips-linuxmusl-x64/versions.json +30 -0
  145. package/standalone/node_modules/@img/sharp-linux-x64/lib/sharp-linux-x64.node +0 -0
  146. package/standalone/node_modules/@img/{sharp-darwin-arm64 → sharp-linux-x64}/package.json +13 -7
  147. package/standalone/node_modules/@img/sharp-linuxmusl-x64/LICENSE +191 -0
  148. package/standalone/node_modules/@img/sharp-linuxmusl-x64/lib/sharp-linuxmusl-x64.node +0 -0
  149. package/standalone/node_modules/@img/sharp-linuxmusl-x64/package.json +46 -0
  150. package/standalone/package.json +4 -2
  151. package/standalone/packages/core/package.json +1 -1
  152. package/standalone/apps/frontend/.next/static/chunks/app/[locale]/about/page-d8aed1a2b6034adb.js +0 -1
  153. package/standalone/apps/frontend/.next/static/chunks/app/[locale]/admin/page-b8a11ecf0fc92f87.js +0 -1
  154. package/standalone/apps/frontend/.next/static/chunks/app/[locale]/admin/security/page-d36785d6e4d45d3a.js +0 -1
  155. package/standalone/apps/frontend/.next/static/chunks/app/[locale]/auth/mcp-setup/route-d3c1c9e26edf790a.js +0 -1
  156. package/standalone/apps/frontend/.next/static/chunks/app/[locale]/know/resource/[id]/page-0de67bf833ae4a3f.js +0 -1
  157. package/standalone/apps/frontend/.next/static/chunks/app/[locale]/moderate/entity-tags/page-a245859e2ddd4e05.js +0 -1
  158. package/standalone/apps/frontend/.next/static/chunks/app/api/auth/[...nextauth]/route-7469fd42a9044d71.js +0 -1
  159. package/standalone/apps/frontend/.next/static/chunks/app/api/cookies/consent/route-b6458d3daaa96918.js +0 -1
  160. package/standalone/apps/frontend/.next/static/chunks/app/api/cookies/export/route-78e35b60a682d097.js +0 -1
  161. package/standalone/apps/frontend/.next/static/chunks/app/global-error-6d117072fb9faa75.js +0 -1
  162. package/standalone/apps/frontend/.next/static/chunks/main-app-49c62e2894aa25dd.js +0 -1
  163. package/standalone/apps/frontend/public/android-chrome-192x192.png +0 -0
  164. package/standalone/apps/frontend/public/android-chrome-512x512.png +0 -0
  165. package/standalone/apps/frontend/public/apple-touch-icon.png +0 -0
  166. package/standalone/apps/frontend/public/favicon-128x128.png +0 -0
  167. package/standalone/apps/frontend/public/favicon-16x16.png +0 -0
  168. package/standalone/apps/frontend/public/favicon-32x32.png +0 -0
  169. package/standalone/apps/frontend/public/favicon-48x48.png +0 -0
  170. package/standalone/apps/frontend/public/favicon-64x64.png +0 -0
  171. package/standalone/apps/frontend/public/favicon-96x96.png +0 -0
  172. package/standalone/apps/frontend/public/favicon.ico +0 -0
  173. package/standalone/apps/frontend/public/favicon.svg +0 -47
  174. package/standalone/apps/frontend/public/site.webmanifest +0 -19
  175. package/standalone/node_modules/@img/sharp-darwin-arm64/lib/sharp-darwin-arm64.node +0 -0
  176. /package/standalone/apps/frontend/.next/static/{OpFkYY-cw7w7h5hHBfiKG → guJTVgKDvrNJVGaUPYdEy}/_buildManifest.js +0 -0
  177. /package/standalone/apps/frontend/.next/static/{OpFkYY-cw7w7h5hHBfiKG → guJTVgKDvrNJVGaUPYdEy}/_ssgManifest.js +0 -0
  178. /package/standalone/node_modules/@img/{sharp-libvips-darwin-arm64 → sharp-libvips-linux-x64}/lib/index.js +0 -0
  179. /package/standalone/node_modules/@img/{sharp-libvips-darwin-arm64 → sharp-libvips-linux-x64}/versions.json +0 -0
  180. /package/standalone/node_modules/@img/{sharp-darwin-arm64 → sharp-linux-x64}/LICENSE +0 -0
@@ -296,1542 +296,1550 @@ var routing = __webpack_require__(1915);
296
296
 
297
297
  /***/ }),
298
298
 
299
- /***/ 6804:
300
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
299
+ /***/ 8990:
300
+ /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
301
301
 
302
- "use strict";
303
- __webpack_require__.r(__webpack_exports__);
304
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
305
- /* harmony export */ GlobalError: () => (/* reexport safe */ _Users_pingel_git_repos_github_com_The_AI_Alliance_semiont_apps_frontend_src_app_global_error_tsx__WEBPACK_IMPORTED_MODULE_25__["default"]),
306
- /* harmony export */ __next_app__: () => (/* binding */ __next_app__),
307
- /* harmony export */ handler: () => (/* binding */ handler),
308
- /* harmony export */ pages: () => (/* binding */ pages),
309
- /* harmony export */ routeModule: () => (/* binding */ routeModule),
310
- /* harmony export */ tree: () => (/* binding */ tree)
311
- /* harmony export */ });
312
- /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73653);
313
- /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__);
314
- /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97714);
315
- /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85250);
316
- /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37587);
317
- /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__);
318
- /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22369);
319
- /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__);
320
- /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1889);
321
- /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__);
322
- /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96232);
323
- /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22841);
324
- /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(46537);
325
- /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__);
326
- /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46027);
327
- /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__);
328
- /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78559);
329
- /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(75928);
330
- /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__);
331
- /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(19374);
332
- /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__);
333
- /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65971);
334
- /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__);
335
- /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(261);
336
- /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__);
337
- /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79898);
338
- /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__);
339
- /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32967);
340
- /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__);
341
- /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26713);
342
- /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__);
343
- /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40139);
344
- /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__);
345
- /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14248);
346
- /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__);
347
- /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(59580);
348
- /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57749);
349
- /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__);
350
- /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(53123);
351
- /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89745);
352
- /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__);
353
- /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(86439);
354
- /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__);
355
- /* harmony import */ var _Users_pingel_git_repos_github_com_The_AI_Alliance_semiont_apps_frontend_src_app_global_error_tsx__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(90488);
356
- /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18283);
357
- /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__);
358
- /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(39818);
359
- /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__);
360
- /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};
361
- /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__[__WEBPACK_IMPORT_KEY__]
362
- /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
363
- const module0 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570));
364
- const module1 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 26412));
365
- const module2 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 90488));
366
- const module3 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506));
367
- const module4 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23));
368
- const module5 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23));
369
- const module6 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 82778));
370
- const module7 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 71743));
371
- const module8 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 91305));
372
- const page9 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 37103));
302
+ Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 37103));
373
303
 
374
304
 
305
+ /***/ }),
375
306
 
307
+ /***/ 10846:
308
+ /***/ ((module) => {
376
309
 
310
+ "use strict";
311
+ module.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js");
377
312
 
313
+ /***/ }),
378
314
 
315
+ /***/ 19121:
316
+ /***/ ((module) => {
379
317
 
318
+ "use strict";
319
+ module.exports = require("next/dist/server/app-render/action-async-storage.external.js");
380
320
 
321
+ /***/ }),
381
322
 
323
+ /***/ 19771:
324
+ /***/ ((module) => {
382
325
 
326
+ "use strict";
327
+ module.exports = require("process");
383
328
 
329
+ /***/ }),
384
330
 
331
+ /***/ 26713:
332
+ /***/ ((module) => {
385
333
 
334
+ "use strict";
335
+ module.exports = require("next/dist/shared/lib/router/utils/is-bot");
386
336
 
337
+ /***/ }),
387
338
 
339
+ /***/ 28354:
340
+ /***/ ((module) => {
388
341
 
342
+ "use strict";
343
+ module.exports = require("util");
389
344
 
345
+ /***/ }),
390
346
 
347
+ /***/ 29294:
348
+ /***/ ((module) => {
391
349
 
350
+ "use strict";
351
+ module.exports = require("next/dist/server/app-render/work-async-storage.external.js");
392
352
 
353
+ /***/ }),
393
354
 
355
+ /***/ 33873:
356
+ /***/ ((module) => {
394
357
 
358
+ "use strict";
359
+ module.exports = require("path");
395
360
 
361
+ /***/ }),
396
362
 
363
+ /***/ 37103:
364
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
397
365
 
398
- // We inject the tree and pages here so that we can use them in the route
399
- // module.
400
- const tree = {
401
- children: [
402
- '',
403
- {
404
- children: [
405
- '[locale]',
406
- {
407
- children: [
408
- 'know',
409
- {
410
- children: [
411
- 'resource',
412
- {
413
- children: [
414
- '[id]',
415
- {
416
- children: ['__PAGE__', {}, {
417
- page: [page9, "/Users/pingel/git_repos/github.com/The-AI-Alliance/semiont/apps/frontend/src/app/[locale]/know/resource/[id]/page.tsx"],
418
-
419
- }]
420
- },
421
- {
422
-
423
-
424
- }
425
- ]
426
- },
427
- {
428
-
429
-
430
- }
431
- ]
432
- },
433
- {
434
- 'layout': [module8, "/Users/pingel/git_repos/github.com/The-AI-Alliance/semiont/apps/frontend/src/app/[locale]/know/layout.tsx"],
435
-
436
- }
437
- ]
438
- },
439
- {
440
- 'layout': [module6, "/Users/pingel/git_repos/github.com/The-AI-Alliance/semiont/apps/frontend/src/app/[locale]/layout.tsx"],
441
- 'not-found': [module7, "/Users/pingel/git_repos/github.com/The-AI-Alliance/semiont/apps/frontend/src/app/[locale]/not-found.tsx"],
442
-
443
- }
444
- ]
445
- },
446
- {
447
- 'layout': [module0, "/Users/pingel/git_repos/github.com/The-AI-Alliance/semiont/apps/frontend/src/app/layout.tsx"],
448
- 'error': [module1, "/Users/pingel/git_repos/github.com/The-AI-Alliance/semiont/apps/frontend/src/app/error.tsx"],
449
- 'global-error': [module2, "/Users/pingel/git_repos/github.com/The-AI-Alliance/semiont/apps/frontend/src/app/global-error.tsx"],
450
- 'not-found': [module3, "/Users/pingel/git_repos/github.com/The-AI-Alliance/semiont/apps/frontend/src/app/not-found.tsx"],
451
- 'forbidden': [module4, "next/dist/client/components/builtin/forbidden.js"],
452
- 'unauthorized': [module5, "next/dist/client/components/builtin/unauthorized.js"],
453
-
454
- }
455
- ]
456
- }.children;
457
- const pages = ["/Users/pingel/git_repos/github.com/The-AI-Alliance/semiont/apps/frontend/src/app/[locale]/know/resource/[id]/page.tsx"];
366
+ "use strict";
367
+ __webpack_require__.r(__webpack_exports__);
368
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
369
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
370
+ /* harmony export */ });
371
+ /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459);
372
+ /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__);
373
+ // This file is generated by the Webpack next-flight-loader.
458
374
 
375
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)(
376
+ function() { throw new Error("Attempted to call the default export of \"/home/runner/work/semiont/semiont/apps/frontend/src/app/[locale]/know/resource/[id]/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); },
377
+ "/home/runner/work/semiont/semiont/apps/frontend/src/app/[locale]/know/resource/[id]/page.tsx",
378
+ "default",
379
+ ));
459
380
 
460
381
 
461
- const __next_app_require__ = __webpack_require__
462
- const __next_app_load_chunk__ = () => Promise.resolve()
463
- const __next_app__ = {
464
- require: __next_app_require__,
465
- loadChunk: __next_app_load_chunk__
466
- };
382
+ /***/ }),
467
383
 
384
+ /***/ 41025:
385
+ /***/ ((module) => {
468
386
 
387
+ "use strict";
388
+ module.exports = require("next/dist/server/app-render/dynamic-access-async-storage.external.js");
469
389
 
470
- // Create and export the route module that will be consumed.
471
- const routeModule = new next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModule({
472
- definition: {
473
- kind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE,
474
- page: "/[locale]/know/resource/[id]/page",
475
- pathname: "/[locale]/know/resource/[id]",
476
- // The following aren't used in production.
477
- bundlePath: '',
478
- filename: '',
479
- appPaths: []
480
- },
481
- userland: {
482
- loaderTree: tree
483
- },
484
- distDir: ".next" || 0,
485
- relativeProjectDir: false || ''
390
+ /***/ }),
391
+
392
+ /***/ 62459:
393
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
394
+
395
+ "use strict";
396
+ // ESM COMPAT FLAG
397
+ __webpack_require__.r(__webpack_exports__);
398
+
399
+ // EXPORTS
400
+ __webpack_require__.d(__webpack_exports__, {
401
+ "default": () => (/* binding */ KnowledgeResourcePage)
486
402
  });
487
- async function handler(req, res, ctx) {
488
- var _this;
489
- let srcPage = "/[locale]/know/resource/[id]/page";
490
- // turbopack doesn't normalize `/index` in the page name
491
- // so we need to to process dynamic routes properly
492
- // TODO: fix turbopack providing differing value from webpack
493
- if (false) {} else if (srcPage === '/index') {
494
- // we always normalize /index specifically
495
- srcPage = '/';
496
- }
497
- const multiZoneDraftMode = false;
498
- const initialPostponed = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'postponed');
499
- // TODO: replace with more specific flags
500
- const minimalMode = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'minimalMode');
501
- const prepareResult = await routeModule.prepare(req, res, {
502
- srcPage,
503
- multiZoneDraftMode
504
- });
505
- if (!prepareResult) {
506
- res.statusCode = 400;
507
- res.end('Bad Request');
508
- ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());
509
- return null;
510
- }
511
- const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult;
512
- const pathname = parsedUrl.pathname || '/';
513
- const normalizedSrcPage = (0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)(srcPage);
514
- let { isOnDemandRevalidate } = prepareResult;
515
- const prerenderInfo = routeModule.match(pathname, prerenderManifest);
516
- const isPrerendered = !!prerenderManifest.routes[resolvedPathname];
517
- let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]);
518
- const userAgent = req.headers['user-agent'] || '';
519
- const botType = (0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)(userAgent);
520
- const isHtmlBot = (0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)(req);
521
- /**
522
- * If true, this indicates that the request being made is for an app
523
- * prefetch request.
524
- */ const isPrefetchRSCRequest = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'isPrefetchRSCRequest') ?? req.headers[next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2'
525
- ;
526
- // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later
527
- const isRSCRequest = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'isRSCRequest') ?? Boolean(req.headers[next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADER]);
528
- const isPossibleServerAction = (0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)(req);
529
- /**
530
- * If the route being rendered is an app page, and the ppr feature has been
531
- * enabled, then the given route _could_ support PPR.
532
- */ const couldSupportPPR = (0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)(nextConfig.experimental.ppr);
533
- // When enabled, this will allow the use of the `?__nextppronly` query to
534
- // enable debugging of the static shell.
535
- const hasDebugStaticShellQuery = false && 0;
536
- // When enabled, this will allow the use of the `?__nextppronly` query
537
- // to enable debugging of the fallback shell.
538
- const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback';
539
- // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the
540
- // prerender manifest and this is an app page.
541
- const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR
542
- // enabled or not, but that would require plumbing the appConfig through
543
- // to the server during development. We assume that the page supports it
544
- // but only during development.
545
- hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true));
546
- const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled;
547
- // We should enable debugging dynamic accesses when the static shell
548
- // debugging has been enabled and we're also in development mode.
549
- const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true;
550
- const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled;
551
- // If we're in minimal mode, then try to get the postponed information from
552
- // the request metadata. If available, use it for resuming the postponed
553
- // render.
554
- const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined;
555
- // If PPR is enabled, and this is a RSC request (but not a prefetch), then
556
- // we can use this fact to only generate the flight data for the request
557
- // because we can't cache the HTML (as it's also dynamic).
558
- const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest;
559
- // Need to read this before it's stripped by stripFlightHeaders. We don't
560
- // need to transfer it to the request meta because it's only read
561
- // within this function; the static segment data should have already been
562
- // generated, so we will always either return a static response or a 404.
563
- const segmentPrefetchHeader = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'segmentPrefetchRSCRequest');
564
- // TODO: investigate existing bug with shouldServeStreamingMetadata always
565
- // being true for a revalidate due to modifying the base-server this.renderOpts
566
- // when fixing this to correct logic it causes hydration issue since we set
567
- // serveStreamingMetadata to true during export
568
- let serveStreamingMetadata = !userAgent ? true : (0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)(userAgent, nextConfig.htmlLimitedBots);
569
- if (isHtmlBot && isRoutePPREnabled) {
570
- isSSG = false;
571
- serveStreamingMetadata = false;
572
- }
573
- // In development, we always want to generate dynamic HTML.
574
- let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's
575
- // a data request, in which case we only produce static HTML.
576
- routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports
577
- // dynamic HTML.
578
- !isSSG || // If this request has provided postponed data, it supports dynamic
579
- // HTML.
580
- typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic
581
- // HTML (it's dynamic).
582
- isDynamicRSCRequest;
583
- // When html bots request PPR page, perform the full dynamic rendering.
584
- const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled;
585
- let ssgCacheKey = null;
586
- if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) {
587
- ssgCacheKey = resolvedPathname;
588
- }
589
- // the staticPathKey differs from ssgCacheKey since
590
- // ssgCacheKey is null in dev since we're always in "dynamic"
591
- // mode in dev to bypass the cache, but we still need to honor
592
- // dynamicParams = false in dev mode
593
- let staticPathKey = ssgCacheKey;
594
- if (!staticPathKey && routeModule.isDev) {
595
- staticPathKey = resolvedPathname;
596
- }
597
- // If this is a request for an app path that should be statically generated
598
- // and we aren't in the edge runtime, strip the flight headers so it will
599
- // generate the static response.
600
- if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) {
601
- (0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)(req.headers);
602
- }
603
- const ComponentMod = {
604
- ...next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__,
605
- tree,
606
- pages,
607
- GlobalError: _Users_pingel_git_repos_github_com_The_AI_Alliance_semiont_apps_frontend_src_app_global_error_tsx__WEBPACK_IMPORTED_MODULE_25__["default"],
608
- handler,
609
- routeModule,
610
- __next_app__
611
- };
612
- // Before rendering (which initializes component tree modules), we have to
613
- // set the reference manifests to our global store so Server Action's
614
- // encryption util can access to them at the top level of the page module.
615
- if (serverActionsManifest && clientReferenceManifest) {
616
- (0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)({
617
- page: srcPage,
618
- clientReferenceManifest,
619
- serverActionsManifest,
620
- serverModuleMap: (0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)({
621
- serverActionsManifest
622
- })
403
+
404
+ // EXTERNAL MODULE: ../../node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-runtime.js
405
+ var react_jsx_runtime = __webpack_require__(78157);
406
+ // EXTERNAL MODULE: ../../node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react.js
407
+ var react = __webpack_require__(31768);
408
+ // EXTERNAL MODULE: ../../node_modules/next/dist/api/navigation.js
409
+ var navigation = __webpack_require__(71159);
410
+ // EXTERNAL MODULE: ../../node_modules/use-intl/dist/esm/production/react.js + 17 modules
411
+ var production_react = __webpack_require__(16917);
412
+ // EXTERNAL MODULE: ../../packages/react-ui/dist/index.mjs + 27 modules
413
+ var dist = __webpack_require__(30658);
414
+ ;// __barrel_optimize__?names=useResources!=!../../packages/react-ui/dist/index.mjs
415
+
416
+
417
+ // EXTERNAL MODULE: ../../packages/core/dist/index.js
418
+ var core_dist = __webpack_require__(33301);
419
+ // EXTERNAL MODULE: ./src/lib/routing.ts
420
+ var routing = __webpack_require__(32302);
421
+ ;// __barrel_optimize__?names=ResourceErrorState,ResourceLoadingState,ResourceViewerPage!=!../../packages/react-ui/dist/index.mjs
422
+
423
+
424
+ // EXTERNAL MODULE: ./src/components/toolbar/ToolbarPanels.tsx + 4 modules
425
+ var ToolbarPanels = __webpack_require__(3591);
426
+ ;// __barrel_optimize__?names=ResourceSearchModal!=!../../packages/react-ui/dist/index.mjs
427
+
428
+
429
+ // EXTERNAL MODULE: ../../node_modules/next-intl/dist/esm/production/react-client/index.js
430
+ var react_client = __webpack_require__(72668);
431
+ ;// ./src/components/modals/SearchResourcesModal.tsx
432
+ /* __next_internal_client_entry_do_not_use__ SearchResourcesModal auto */
433
+
434
+
435
+
436
+ function SearchResourcesModal({ isOpen, onClose, onSelect, searchTerm = '' }) {
437
+ const t = (0,react_client/* useTranslations */.c)('SearchResources');
438
+ return /*#__PURE__*/ (0,react_jsx_runtime.jsx)(dist.ResourceSearchModal, {
439
+ isOpen: isOpen,
440
+ onClose: onClose,
441
+ onSelect: onSelect,
442
+ searchTerm: searchTerm,
443
+ translations: {
444
+ title: t('title'),
445
+ placeholder: t('placeholder'),
446
+ searching: t('searching'),
447
+ noResults: t('noResults'),
448
+ close: t('close')
449
+ }
450
+ });
451
+ }
452
+
453
+ // EXTERNAL MODULE: ../../node_modules/@headlessui/react/dist/components/transition/transition.js + 2 modules
454
+ var transition = __webpack_require__(15750);
455
+ // EXTERNAL MODULE: ../../node_modules/@headlessui/react/dist/components/dialog/dialog.js + 41 modules
456
+ var dialog = __webpack_require__(89789);
457
+ // EXTERNAL MODULE: __barrel_optimize__?names=LOCALES!=!../../packages/api-client/dist/index.js
458
+ var api_client_dist = __webpack_require__(55257);
459
+ ;// ./src/components/modals/GenerationConfigModal.tsx
460
+ /* __next_internal_client_entry_do_not_use__ GenerationConfigModal auto */
461
+
462
+
463
+
464
+
465
+
466
+ function GenerationConfigModal({ isOpen, onClose, onGenerate, defaultTitle, context, contextLoading, contextError }) {
467
+ const t = (0,react_client/* useTranslations */.c)('GenerationConfigModal');
468
+ const currentLocale = (0,production_react/* useLocale */.Ym)();
469
+ const [title, setTitle] = (0,react.useState)(defaultTitle);
470
+ const [prompt, setPrompt] = (0,react.useState)('');
471
+ const [language, setLanguage] = (0,react.useState)(currentLocale);
472
+ const [temperature, setTemperature] = (0,react.useState)(0.7);
473
+ const [maxTokens, setMaxTokens] = (0,react.useState)(500);
474
+ // Reset form when modal opens
475
+ process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react.useEffect)(()=>{
476
+ if (isOpen) {
477
+ setTitle(defaultTitle);
478
+ setPrompt('');
479
+ setLanguage(currentLocale);
480
+ setTemperature(0.7);
481
+ setMaxTokens(500);
482
+ }
483
+ }, [
484
+ isOpen,
485
+ defaultTitle,
486
+ currentLocale
487
+ ]);
488
+ const handleSubmit = (e)=>{
489
+ e.preventDefault();
490
+ // Context must be loaded before we can generate
491
+ if (!context) {
492
+ console.error('Cannot generate without context');
493
+ return;
494
+ }
495
+ const trimmedPrompt = prompt.trim();
496
+ onGenerate({
497
+ title,
498
+ ...trimmedPrompt ? {
499
+ prompt: trimmedPrompt
500
+ } : {},
501
+ language,
502
+ temperature,
503
+ maxTokens,
504
+ context
623
505
  });
624
- }
625
- const method = req.method || 'GET';
626
- const tracer = (0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)();
627
- const activeSpan = tracer.getActiveScopeSpan();
628
- try {
629
- const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns);
630
- res.setHeader('Vary', varyHeader);
631
- const invokeRouteModule = async (span, context)=>{
632
- const nextReq = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequest(req);
633
- const nextRes = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponse(res);
634
- // TODO: adapt for putting the RDC inside the postponed data
635
- // If we're in dev, and this isn't a prefetch or a server action,
636
- // we should seed the resume data cache.
637
- if (false) {}
638
- return routeModule.render(nextReq, nextRes, context).finally(()=>{
639
- if (!span) return;
640
- span.setAttributes({
641
- 'http.status_code': res.statusCode,
642
- 'next.rsc': false
643
- });
644
- const rootSpanAttributes = tracer.getRootSpanAttributes();
645
- // We were unable to get attributes, probably OTEL is not enabled
646
- if (!rootSpanAttributes) {
647
- return;
648
- }
649
- if (rootSpanAttributes.get('next.span_type') !== next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpan.handleRequest) {
650
- console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);
651
- return;
652
- }
653
- const route = rootSpanAttributes.get('next.route');
654
- if (route) {
655
- const name = `${method} ${route}`;
656
- span.setAttributes({
657
- 'next.route': route,
658
- 'http.route': route,
659
- 'next.span_name': name
660
- });
661
- span.updateName(name);
662
- } else {
663
- span.updateName(`${method} ${req.url}`);
664
- }
665
- });
666
- };
667
- const doRender = async ({ span, postponed, fallbackRouteParams })=>{
668
- const context = {
669
- query,
670
- params,
671
- page: normalizedSrcPage,
672
- sharedContext: {
673
- buildId
674
- },
675
- serverComponentsHmrCache: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'serverComponentsHmrCache'),
676
- fallbackRouteParams,
677
- renderOpts: {
678
- App: ()=>null,
679
- Document: ()=>null,
680
- pageConfig: {},
681
- ComponentMod,
682
- Component: (0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)(ComponentMod),
683
- params,
684
- routeModule,
685
- page: srcPage,
686
- postponed,
687
- shouldWaitOnAllReady,
688
- serveStreamingMetadata,
689
- supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse,
690
- buildManifest,
691
- nextFontManifest,
692
- reactLoadableManifest,
693
- subresourceIntegrityManifest,
694
- serverActionsManifest,
695
- clientReferenceManifest,
696
- setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus,
697
- dir: true ? (__webpack_require__(33873).join)(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : 0,
698
- isDraftMode,
699
- isRevalidate: isSSG && !postponed && !isDynamicRSCRequest,
700
- botType,
701
- isOnDemandRevalidate,
702
- isPossibleServerAction,
703
- assetPrefix: nextConfig.assetPrefix,
704
- nextConfigOutput: nextConfig.output,
705
- crossOrigin: nextConfig.crossOrigin,
706
- trailingSlash: nextConfig.trailingSlash,
707
- previewProps: prerenderManifest.preview,
708
- deploymentId: nextConfig.deploymentId,
709
- enableTainting: nextConfig.experimental.taint,
710
- htmlLimitedBots: nextConfig.htmlLimitedBots,
711
- devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer,
712
- reactMaxHeadersLength: nextConfig.reactMaxHeadersLength,
713
- multiZoneDraftMode,
714
- incrementalCache: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'incrementalCache'),
715
- cacheLifeProfiles: nextConfig.experimental.cacheLife,
716
- basePath: nextConfig.basePath,
717
- serverActions: nextConfig.experimental.serverActions,
718
- ...isDebugStaticShell || isDebugDynamicAccesses ? {
719
- nextExport: true,
720
- supportsDynamicResponse: false,
721
- isStaticGeneration: true,
722
- isRevalidate: true,
723
- isDebugDynamicAccesses: isDebugDynamicAccesses
724
- } : {},
725
- experimental: {
726
- isRoutePPREnabled,
727
- expireTime: nextConfig.expireTime,
728
- staleTimes: nextConfig.experimental.staleTimes,
729
- cacheComponents: Boolean(nextConfig.experimental.cacheComponents),
730
- clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache),
731
- clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing),
732
- dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover),
733
- inlineCss: Boolean(nextConfig.experimental.inlineCss),
734
- authInterrupts: Boolean(nextConfig.experimental.authInterrupts),
735
- clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || []
736
- },
737
- waitUntil: ctx.waitUntil,
738
- onClose: (cb)=>{
739
- res.on('close', cb);
740
- },
741
- onAfterTaskError: ()=>{},
742
- onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext),
743
- err: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'invokeError'),
744
- dev: routeModule.isDev
745
- }
746
- };
747
- const result = await invokeRouteModule(span, context);
748
- const { metadata } = result;
749
- const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers.
750
- fetchTags: cacheTags } = metadata;
751
- if (cacheTags) {
752
- headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER] = cacheTags;
753
- }
754
- // Pull any fetch metrics from the render onto the request.
755
- ;
756
- req.fetchMetrics = metadata.fetchMetrics;
757
- // we don't throw static to dynamic errors in dev as isSSG
758
- // is a best guess in dev since we don't have the prerender pass
759
- // to know whether the path is actually static or not
760
- if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) {
761
- const staticBailoutInfo = metadata.staticBailoutInfo;
762
- const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", {
763
- value: "E132",
764
- enumerable: false,
765
- configurable: true
766
- });
767
- if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) {
768
- const stack = staticBailoutInfo.stack;
769
- err.stack = err.message + stack.substring(stack.indexOf('\n'));
770
- }
771
- throw err;
772
- }
773
- return {
774
- value: {
775
- kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE,
776
- html: result,
777
- headers,
778
- rscData: metadata.flightData,
779
- postponed: metadata.postponed,
780
- status: metadata.statusCode,
781
- segmentData: metadata.segmentData
782
- },
783
- cacheControl
784
- };
785
- };
786
- const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{
787
- const isProduction = routeModule.isDev === false;
788
- const didRespond = hasResolved || res.writableEnded;
789
- // skip on-demand revalidate if cache is not present and
790
- // revalidate-if-generated is set
791
- if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) {
792
- if (routerServerContext == null ? void 0 : routerServerContext.render404) {
793
- await routerServerContext.render404(req, res);
794
- } else {
795
- res.statusCode = 404;
796
- res.end('This page could not be found');
797
- }
798
- return null;
799
- }
800
- let fallbackMode;
801
- if (prerenderInfo) {
802
- fallbackMode = (0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)(prerenderInfo.fallback);
803
- }
804
- // When serving a HTML bot request, we want to serve a blocking render and
805
- // not the prerendered page. This ensures that the correct content is served
806
- // to the bot in the head.
807
- if (fallbackMode === next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.PRERENDER && (0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)(userAgent)) {
808
- if (!isRoutePPREnabled || isHtmlBot) {
809
- fallbackMode = next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.BLOCKING_STATIC_RENDER;
810
- }
811
- }
812
- if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) {
813
- isOnDemandRevalidate = true;
814
- }
815
- // TODO: adapt for PPR
816
- // only allow on-demand revalidate for fallback: true/blocking
817
- // or for prerendered fallback: false paths
818
- if (isOnDemandRevalidate && (fallbackMode !== next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.NOT_FOUND || previousCacheEntry)) {
819
- fallbackMode = next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.BLOCKING_STATIC_RENDER;
820
- }
821
- if (!minimalMode && fallbackMode !== next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) {
822
- // if the page has dynamicParams: false and this pathname wasn't
823
- // prerendered trigger the no fallback handling
824
- if (// In development, fall through to render to handle missing
825
- // getStaticPaths.
826
- (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404
827
- fallbackMode === next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.NOT_FOUND) {
828
- throw new next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackError();
829
- }
830
- let fallbackResponse;
831
- if (isRoutePPREnabled && !isRSCRequest) {
832
- const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null;
833
- // We use the response cache here to handle the revalidation and
834
- // management of the fallback shell.
835
- fallbackResponse = await routeModule.handleResponse({
836
- cacheKey,
837
- req,
838
- nextConfig,
839
- routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE,
840
- isFallback: true,
841
- prerenderManifest,
842
- isRoutePPREnabled,
843
- responseGenerator: async ()=>doRender({
844
- span,
845
- // We pass `undefined` as rendering a fallback isn't resumed
846
- // here.
847
- postponed: undefined,
848
- fallbackRouteParams: // If we're in production or we're debugging the fallback
849
- // shell then we should postpone when dynamic params are
850
- // accessed.
851
- isProduction || isDebugFallbackShell ? (0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)(normalizedSrcPage) : null
852
- }),
853
- waitUntil: ctx.waitUntil
854
- });
855
- // If the fallback response was set to null, then we should return null.
856
- if (fallbackResponse === null) return null;
857
- // Otherwise, if we did get a fallback response, we should return it.
858
- if (fallbackResponse) {
859
- // Remove the cache control from the response to prevent it from being
860
- // used in the surrounding cache.
861
- delete fallbackResponse.cacheControl;
862
- return fallbackResponse;
863
- }
864
- }
865
- }
866
- // Only requests that aren't revalidating can be resumed. If we have the
867
- // minimal postponed data, then we should resume the render with it.
868
- const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined;
869
- // When we're in minimal mode, if we're trying to debug the static shell,
870
- // we should just return nothing instead of resuming the dynamic render.
871
- if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') {
872
- return {
873
- cacheControl: {
874
- revalidate: 1,
875
- expire: undefined
876
- },
877
- value: {
878
- kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.PAGES,
879
- html: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].EMPTY,
880
- pageData: {},
881
- headers: undefined,
882
- status: undefined
883
- }
884
- };
885
- }
886
- // If this is a dynamic route with PPR enabled and the default route
887
- // matches were set, then we should pass the fallback route params to
888
- // the renderer as this is a fallback revalidation request.
889
- const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && ((0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'renderFallbackShell') || isDebugFallbackShell) ? (0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)(pathname) : null;
890
- // Perform the render.
891
- return doRender({
892
- span,
893
- postponed,
894
- fallbackRouteParams
895
- });
896
- };
897
- const handleResponse = async (span)=>{
898
- var _cacheEntry_value, _cachedData_headers;
899
- const cacheEntry = await routeModule.handleResponse({
900
- cacheKey: ssgCacheKey,
901
- responseGenerator: (c)=>responseGenerator({
902
- span,
903
- ...c
904
- }),
905
- routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE,
906
- isOnDemandRevalidate,
907
- isRoutePPREnabled,
908
- req,
909
- nextConfig,
910
- prerenderManifest,
911
- waitUntil: ctx.waitUntil
912
- });
913
- if (isDraftMode) {
914
- res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');
915
- }
916
- // In dev, we should not cache pages for any reason.
917
- if (routeModule.isDev) {
918
- res.setHeader('Cache-Control', 'no-store, must-revalidate');
919
- }
920
- if (!cacheEntry) {
921
- if (ssgCacheKey) {
922
- // A cache entry might not be generated if a response is written
923
- // in `getInitialProps` or `getServerSideProps`, but those shouldn't
924
- // have a cache key. If we do have a cache key but we don't end up
925
- // with a cache entry, then either Next.js or the application has a
926
- // bug that needs fixing.
927
- throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", {
928
- value: "E62",
929
- enumerable: false,
930
- configurable: true
931
- });
932
- }
933
- return null;
934
- }
935
- if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE) {
936
- var _cacheEntry_value1;
937
- throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", {
938
- value: "E707",
939
- enumerable: false,
940
- configurable: true
941
- });
942
- }
943
- const didPostpone = typeof cacheEntry.value.postponed === 'string';
944
- if (isSSG && // We don't want to send a cache header for requests that contain dynamic
945
- // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC
946
- // request, then we should set the cache header.
947
- !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) {
948
- if (!minimalMode) {
949
- // set x-nextjs-cache header to match the header
950
- // we set for the image-optimizer
951
- res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');
952
- }
953
- // Set a header used by the client router to signal the response is static
954
- // and should respect the `static` cache staleTime value.
955
- res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADER, '1');
956
- }
957
- const { value: cachedData } = cacheEntry;
958
- // Coerce the cache control parameter from the render.
959
- let cacheControl;
960
- // If this is a resume request in minimal mode it is streamed with dynamic
961
- // content and should not be cached.
962
- if (minimalPostponed) {
963
- cacheControl = {
964
- revalidate: 0,
965
- expire: undefined
966
- };
967
- } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) {
968
- cacheControl = {
969
- revalidate: 0,
970
- expire: undefined
971
- };
972
- } else if (!routeModule.isDev) {
973
- // If this is a preview mode request, we shouldn't cache it
974
- if (isDraftMode) {
975
- cacheControl = {
976
- revalidate: 0,
977
- expire: undefined
978
- };
979
- } else if (!isSSG) {
980
- if (!res.getHeader('Cache-Control')) {
981
- cacheControl = {
982
- revalidate: 0,
983
- expire: undefined
984
- };
985
- }
986
- } else if (cacheEntry.cacheControl) {
987
- // If the cache entry has a cache control with a revalidate value that's
988
- // a number, use it.
989
- if (typeof cacheEntry.cacheControl.revalidate === 'number') {
990
- var _cacheEntry_cacheControl;
991
- if (cacheEntry.cacheControl.revalidate < 1) {
992
- throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", {
993
- value: "E22",
994
- enumerable: false,
995
- configurable: true
996
- });
997
- }
998
- cacheControl = {
999
- revalidate: cacheEntry.cacheControl.revalidate,
1000
- expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime
1001
- };
1002
- } else {
1003
- cacheControl = {
1004
- revalidate: next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEAR,
1005
- expire: undefined
1006
- };
1007
- }
1008
- }
1009
- }
1010
- cacheEntry.cacheControl = cacheControl;
1011
- if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE && cachedData.segmentData) {
1012
- var _cachedData_headers1;
1013
- // This is a prefetch request issued by the client Segment Cache. These
1014
- // should never reach the application layer (lambda). We should either
1015
- // respond from the cache (HIT) or respond with 204 No Content (MISS).
1016
- // Set a header to indicate that PPR is enabled for this route. This
1017
- // lets the client distinguish between a regular cache miss and a cache
1018
- // miss due to PPR being disabled. In other contexts this header is used
1019
- // to indicate that the response contains dynamic data, but here we're
1020
- // only using it to indicate that the feature is enabled — the segment
1021
- // response itself contains whether the data is dynamic.
1022
- res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADER, '2');
1023
- // Add the cache tags header to the response if it exists and we're in
1024
- // minimal mode while rendering a static page.
1025
- const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER];
1026
- if (minimalMode && isSSG && tags && typeof tags === 'string') {
1027
- res.setHeader(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER, tags);
1028
- }
1029
- const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader);
1030
- if (matchedSegment !== undefined) {
1031
- // Cache hit
1032
- return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({
1033
- req,
1034
- res,
1035
- generateEtags: nextConfig.generateEtags,
1036
- poweredByHeader: nextConfig.poweredByHeader,
1037
- result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].fromStatic(matchedSegment, next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADER),
1038
- cacheControl: cacheEntry.cacheControl
1039
- });
1040
- }
1041
- // Cache miss. Either a cache entry for this route has not been generated
1042
- // (which technically should not be possible when PPR is enabled, because
1043
- // at a minimum there should always be a fallback entry) or there's no
1044
- // match for the requested segment. Respond with a 204 No Content. We
1045
- // don't bother to respond with 404, because these requests are only
1046
- // issued as part of a prefetch.
1047
- res.statusCode = 204;
1048
- return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({
1049
- req,
1050
- res,
1051
- generateEtags: nextConfig.generateEtags,
1052
- poweredByHeader: nextConfig.poweredByHeader,
1053
- result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].EMPTY,
1054
- cacheControl: cacheEntry.cacheControl
1055
- });
1056
- }
1057
- // If there's a callback for `onCacheEntry`, call it with the cache entry
1058
- // and the revalidate options.
1059
- const onCacheEntry = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'onCacheEntry');
1060
- if (onCacheEntry) {
1061
- const finished = await onCacheEntry({
1062
- ...cacheEntry,
1063
- // TODO: remove this when upstream doesn't
1064
- // always expect this value to be "PAGE"
1065
- value: {
1066
- ...cacheEntry.value,
1067
- kind: 'PAGE'
1068
- }
1069
- }, {
1070
- url: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'initURL')
1071
- });
1072
- if (finished) {
1073
- // TODO: maybe we have to end the request?
1074
- return null;
1075
- }
1076
- }
1077
- // If the request has a postponed state and it's a resume request we
1078
- // should error.
1079
- if (didPostpone && minimalPostponed) {
1080
- throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", {
1081
- value: "E396",
1082
- enumerable: false,
1083
- configurable: true
1084
- });
1085
- }
1086
- if (cachedData.headers) {
1087
- const headers = {
1088
- ...cachedData.headers
1089
- };
1090
- if (!minimalMode || !isSSG) {
1091
- delete headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER];
1092
- }
1093
- for (let [key, value] of Object.entries(headers)){
1094
- if (typeof value === 'undefined') continue;
1095
- if (Array.isArray(value)) {
1096
- for (const v of value){
1097
- res.appendHeader(key, v);
1098
- }
1099
- } else if (typeof value === 'number') {
1100
- value = value.toString();
1101
- res.appendHeader(key, value);
1102
- } else {
1103
- res.appendHeader(key, value);
1104
- }
1105
- }
1106
- }
1107
- // Add the cache tags header to the response if it exists and we're in
1108
- // minimal mode while rendering a static page.
1109
- const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER];
1110
- if (minimalMode && isSSG && tags && typeof tags === 'string') {
1111
- res.setHeader(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER, tags);
1112
- }
1113
- // If the request is a data request, then we shouldn't set the status code
1114
- // from the response because it should always be 200. This should be gated
1115
- // behind the experimental PPR flag.
1116
- if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) {
1117
- res.statusCode = cachedData.status;
1118
- }
1119
- // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes
1120
- if (!minimalMode && cachedData.status && next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCode[cachedData.status] && isRSCRequest) {
1121
- res.statusCode = 200;
1122
- }
1123
- // Mark that the request did postpone.
1124
- if (didPostpone) {
1125
- res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADER, '1');
1126
- }
1127
- // we don't go through this block when preview mode is true
1128
- // as preview mode is a dynamic request (bypasses cache) and doesn't
1129
- // generate both HTML and payloads in the same request so continue to just
1130
- // return the generated payload
1131
- if (isRSCRequest && !isDraftMode) {
1132
- // If this is a dynamic RSC request, then stream the response.
1133
- if (typeof cachedData.rscData === 'undefined') {
1134
- if (cachedData.postponed) {
1135
- throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", {
1136
- value: "E372",
1137
- enumerable: false,
1138
- configurable: true
1139
- });
1140
- }
1141
- return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({
1142
- req,
1143
- res,
1144
- generateEtags: nextConfig.generateEtags,
1145
- poweredByHeader: nextConfig.poweredByHeader,
1146
- result: cachedData.html,
1147
- // Dynamic RSC responses cannot be cached, even if they're
1148
- // configured with `force-static` because we have no way of
1149
- // distinguishing between `force-static` and pages that have no
1150
- // postponed state.
1151
- // TODO: distinguish `force-static` from pages with no postponed state (static)
1152
- cacheControl: isDynamicRSCRequest ? {
1153
- revalidate: 0,
1154
- expire: undefined
1155
- } : cacheEntry.cacheControl
1156
- });
1157
- }
1158
- // As this isn't a prefetch request, we should serve the static flight
1159
- // data.
1160
- return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({
1161
- req,
1162
- res,
1163
- generateEtags: nextConfig.generateEtags,
1164
- poweredByHeader: nextConfig.poweredByHeader,
1165
- result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].fromStatic(cachedData.rscData, next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADER),
1166
- cacheControl: cacheEntry.cacheControl
1167
- });
1168
- }
1169
- // This is a request for HTML data.
1170
- let body = cachedData.html;
1171
- // If there's no postponed state, we should just serve the HTML. This
1172
- // should also be the case for a resume request because it's completed
1173
- // as a server render (rather than a static render).
1174
- if (!didPostpone || minimalMode || isRSCRequest) {
1175
- // If we're in test mode, we should add a sentinel chunk to the response
1176
- // that's between the static and dynamic parts so we can compare the
1177
- // chunks and add assertions.
1178
- if (false) {}
1179
- return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({
1180
- req,
1181
- res,
1182
- generateEtags: nextConfig.generateEtags,
1183
- poweredByHeader: nextConfig.poweredByHeader,
1184
- result: body,
1185
- cacheControl: cacheEntry.cacheControl
1186
- });
1187
- }
1188
- // If we're debugging the static shell or the dynamic API accesses, we
1189
- // should just serve the HTML without resuming the render. The returned
1190
- // HTML will be the static shell so all the Dynamic API's will be used
1191
- // during static generation.
1192
- if (isDebugStaticShell || isDebugDynamicAccesses) {
1193
- // Since we're not resuming the render, we need to at least add the
1194
- // closing body and html tags to create valid HTML.
1195
- body.push(new ReadableStream({
1196
- start (controller) {
1197
- controller.enqueue(next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGS.CLOSED.BODY_AND_HTML);
1198
- controller.close();
1199
- }
1200
- }));
1201
- return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({
1202
- req,
1203
- res,
1204
- generateEtags: nextConfig.generateEtags,
1205
- poweredByHeader: nextConfig.poweredByHeader,
1206
- result: body,
1207
- cacheControl: {
1208
- revalidate: 0,
1209
- expire: undefined
1210
- }
1211
- });
1212
- }
1213
- // If we're in test mode, we should add a sentinel chunk to the response
1214
- // that's between the static and dynamic parts so we can compare the
1215
- // chunks and add assertions.
1216
- if (false) {}
1217
- // This request has postponed, so let's create a new transformer that the
1218
- // dynamic data can pipe to that will attach the dynamic data to the end
1219
- // of the response.
1220
- const transformer = new TransformStream();
1221
- body.push(transformer.readable);
1222
- // Perform the render again, but this time, provide the postponed state.
1223
- // We don't await because we want the result to start streaming now, and
1224
- // we've already chained the transformer's readable to the render result.
1225
- doRender({
1226
- span,
1227
- postponed: cachedData.postponed,
1228
- // This is a resume render, not a fallback render, so we don't need to
1229
- // set this.
1230
- fallbackRouteParams: null
1231
- }).then(async (result)=>{
1232
- var _result_value;
1233
- if (!result) {
1234
- throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", {
1235
- value: "E463",
1236
- enumerable: false,
1237
- configurable: true
1238
- });
1239
- }
1240
- if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE) {
1241
- var _result_value1;
1242
- throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", {
1243
- value: "E305",
1244
- enumerable: false,
1245
- configurable: true
1246
- });
1247
- }
1248
- // Pipe the resume result to the transformer.
1249
- await result.value.html.pipeTo(transformer.writable);
1250
- }).catch((err)=>{
1251
- // An error occurred during piping or preparing the render, abort
1252
- // the transformers writer so we can terminate the stream.
1253
- transformer.writable.abort(err).catch((e)=>{
1254
- console.error("couldn't abort transformer", e);
1255
- });
1256
- });
1257
- return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({
1258
- req,
1259
- res,
1260
- generateEtags: nextConfig.generateEtags,
1261
- poweredByHeader: nextConfig.poweredByHeader,
1262
- result: body,
1263
- // We don't want to cache the response if it has postponed data because
1264
- // the response being sent to the client it's dynamic parts are streamed
1265
- // to the client on the same request.
1266
- cacheControl: {
1267
- revalidate: 0,
1268
- expire: undefined
1269
- }
1270
- });
1271
- };
1272
- // TODO: activeSpan code path is for when wrapped by
1273
- // next-server can be removed when this is no longer used
1274
- if (activeSpan) {
1275
- await handleResponse(activeSpan);
1276
- } else {
1277
- return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpan.handleRequest, {
1278
- spanName: `${method} ${req.url}`,
1279
- kind: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKind.SERVER,
1280
- attributes: {
1281
- 'http.method': method,
1282
- 'http.target': req.url
1283
- }
1284
- }, handleResponse));
1285
- }
1286
- } catch (err) {
1287
- if (!(err instanceof next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackError)) {
1288
- await routeModule.onRequestError(req, err, {
1289
- routerKind: 'App Router',
1290
- routePath: srcPage,
1291
- routeType: 'render',
1292
- revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)({
1293
- isRevalidate: isSSG,
1294
- isOnDemandRevalidate
506
+ onClose();
507
+ };
508
+ const sourceContext = context?.sourceContext;
509
+ const hasContext = sourceContext && (sourceContext.before || sourceContext.after);
510
+ return /*#__PURE__*/ (0,react_jsx_runtime.jsx)(transition/* Transition */.e, {
511
+ appear: true,
512
+ show: isOpen,
513
+ as: react.Fragment,
514
+ children: /*#__PURE__*/ (0,react_jsx_runtime.jsxs)(dialog/* Dialog */.lG, {
515
+ as: "div",
516
+ className: "relative z-[1001]",
517
+ onClose: onClose,
518
+ children: [
519
+ /*#__PURE__*/ (0,react_jsx_runtime.jsx)(transition/* TransitionChild */._, {
520
+ as: react.Fragment,
521
+ enter: "ease-out duration-200",
522
+ enterFrom: "opacity-0",
523
+ enterTo: "opacity-100",
524
+ leave: "ease-in duration-150",
525
+ leaveFrom: "opacity-100",
526
+ leaveTo: "opacity-0",
527
+ children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("div", {
528
+ className: "fixed inset-0 bg-black/30 backdrop-blur-sm"
529
+ })
530
+ }),
531
+ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("div", {
532
+ className: "fixed inset-0 overflow-y-auto",
533
+ children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("div", {
534
+ className: "flex min-h-full items-center justify-center p-4",
535
+ children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)(transition/* TransitionChild */._, {
536
+ as: react.Fragment,
537
+ enter: "ease-out duration-200",
538
+ enterFrom: "opacity-0 scale-95",
539
+ enterTo: "opacity-100 scale-100",
540
+ leave: "ease-in duration-150",
541
+ leaveFrom: "opacity-100 scale-100",
542
+ leaveTo: "opacity-0 scale-95",
543
+ children: /*#__PURE__*/ (0,react_jsx_runtime.jsxs)(dialog/* DialogPanel */.Lj, {
544
+ className: "w-full max-w-[700px] transform overflow-hidden rounded-lg bg-white dark:bg-gray-800 shadow-xl border border-gray-200 dark:border-gray-700 p-6 transition-all",
545
+ children: [
546
+ /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", {
547
+ className: "flex items-center justify-between mb-4",
548
+ children: [
549
+ /*#__PURE__*/ (0,react_jsx_runtime.jsx)(dialog/* DialogTitle */.L3, {
550
+ className: "text-lg font-semibold text-gray-900 dark:text-white",
551
+ children: t('title')
552
+ }),
553
+ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("button", {
554
+ onClick: onClose,
555
+ className: "text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-300",
556
+ children: "✕"
557
+ })
558
+ ]
559
+ }),
560
+ /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("form", {
561
+ onSubmit: handleSubmit,
562
+ className: "space-y-4",
563
+ children: [
564
+ /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", {
565
+ children: [
566
+ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("label", {
567
+ className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",
568
+ children: t('sourceContext')
569
+ }),
570
+ contextLoading && /*#__PURE__*/ (0,react_jsx_runtime.jsx)("div", {
571
+ className: "text-center py-4 text-gray-600 dark:text-gray-400",
572
+ children: t('loadingContext')
573
+ }),
574
+ !!contextError && /*#__PURE__*/ (0,react_jsx_runtime.jsx)("div", {
575
+ className: "text-center py-4 text-red-600 dark:text-red-400",
576
+ children: t('failedContext')
577
+ }),
578
+ hasContext && /*#__PURE__*/ (0,react_jsx_runtime.jsx)("div", {
579
+ className: "p-3 bg-gray-50 dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-700 max-h-[200px] overflow-y-auto",
580
+ children: /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", {
581
+ className: "text-sm font-mono whitespace-pre-wrap text-gray-600 dark:text-gray-400",
582
+ children: [
583
+ sourceContext.before && /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", {
584
+ children: sourceContext.before
585
+ }),
586
+ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", {
587
+ className: "bg-blue-100 dark:bg-blue-900/40 px-1 font-semibold text-blue-900 dark:text-blue-200",
588
+ children: sourceContext.selected
589
+ }),
590
+ sourceContext.after && /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", {
591
+ children: sourceContext.after
592
+ })
593
+ ]
594
+ })
595
+ }),
596
+ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("p", {
597
+ className: "text-xs text-gray-500 dark:text-gray-400 mt-1",
598
+ children: t('contextHelp')
599
+ })
600
+ ]
601
+ }),
602
+ /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", {
603
+ children: [
604
+ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("label", {
605
+ htmlFor: "title",
606
+ className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",
607
+ children: t('resourceTitle')
608
+ }),
609
+ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("input", {
610
+ id: "title",
611
+ type: "text",
612
+ value: title,
613
+ onChange: (e)=>setTitle(e.target.value),
614
+ required: true,
615
+ className: "w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg dark:bg-gray-700 text-gray-900 dark:text-white",
616
+ placeholder: t('resourceTitlePlaceholder')
617
+ })
618
+ ]
619
+ }),
620
+ /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", {
621
+ children: [
622
+ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("label", {
623
+ htmlFor: "prompt",
624
+ className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",
625
+ children: t('additionalInstructions')
626
+ }),
627
+ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("textarea", {
628
+ id: "prompt",
629
+ value: prompt,
630
+ onChange: (e)=>setPrompt(e.target.value),
631
+ rows: 3,
632
+ className: "w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg dark:bg-gray-700 text-gray-900 dark:text-white",
633
+ placeholder: t('additionalInstructionsPlaceholder')
634
+ })
635
+ ]
636
+ }),
637
+ /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", {
638
+ children: [
639
+ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("label", {
640
+ htmlFor: "language",
641
+ className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",
642
+ children: t('language')
643
+ }),
644
+ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("select", {
645
+ id: "language",
646
+ value: language,
647
+ onChange: (e)=>setLanguage(e.target.value),
648
+ className: "w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg dark:bg-gray-700 text-gray-900 dark:text-white",
649
+ children: api_client_dist/* LOCALES */.YZ.map((lang)=>/*#__PURE__*/ (0,react_jsx_runtime.jsx)("option", {
650
+ value: lang.code,
651
+ children: lang.nativeName
652
+ }, lang.code))
653
+ }),
654
+ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("p", {
655
+ className: "text-xs text-gray-500 dark:text-gray-400 mt-1",
656
+ children: t('languageHelp')
657
+ })
658
+ ]
659
+ }),
660
+ /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", {
661
+ children: [
662
+ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("label", {
663
+ htmlFor: "temperature",
664
+ className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",
665
+ children: t('creativity', {
666
+ value: temperature.toFixed(1)
667
+ })
668
+ }),
669
+ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("input", {
670
+ id: "temperature",
671
+ type: "range",
672
+ min: "0",
673
+ max: "1",
674
+ step: "0.1",
675
+ value: temperature,
676
+ onChange: (e)=>setTemperature(parseFloat(e.target.value)),
677
+ className: "w-full"
678
+ }),
679
+ /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", {
680
+ className: "flex justify-between text-xs text-gray-500 dark:text-gray-400 mt-1",
681
+ children: [
682
+ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", {
683
+ children: t('creativityFocused')
684
+ }),
685
+ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", {
686
+ children: t('creativityCreative')
687
+ })
688
+ ]
689
+ })
690
+ ]
691
+ }),
692
+ /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", {
693
+ children: [
694
+ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("label", {
695
+ htmlFor: "maxTokens",
696
+ className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",
697
+ children: t('maxLength')
698
+ }),
699
+ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("input", {
700
+ id: "maxTokens",
701
+ type: "number",
702
+ min: "100",
703
+ max: "4000",
704
+ step: "100",
705
+ value: maxTokens,
706
+ onChange: (e)=>setMaxTokens(parseInt(e.target.value)),
707
+ className: "w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg dark:bg-gray-700 text-gray-900 dark:text-white"
708
+ }),
709
+ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("p", {
710
+ className: "text-xs text-gray-500 dark:text-gray-400 mt-1",
711
+ children: t('maxLengthHelp')
712
+ })
713
+ ]
714
+ }),
715
+ /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", {
716
+ className: "flex gap-3 pt-2",
717
+ children: [
718
+ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("button", {
719
+ type: "button",
720
+ onClick: onClose,
721
+ className: "flex-1 px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors",
722
+ children: t('cancel')
723
+ }),
724
+ /*#__PURE__*/ (0,react_jsx_runtime.jsx)("button", {
725
+ type: "submit",
726
+ disabled: contextLoading || !context,
727
+ className: "flex-1 px-4 py-2 bg-gradient-to-r from-blue-600 to-cyan-600 hover:from-blue-700 hover:to-cyan-700 text-white rounded-lg font-medium transition-all disabled:opacity-50 disabled:cursor-not-allowed",
728
+ children: t('generate')
729
+ })
730
+ ]
731
+ })
732
+ ]
733
+ })
734
+ ]
735
+ })
736
+ })
737
+ })
1295
738
  })
1296
- }, routerServerContext);
1297
- }
1298
- // rethrow so that we can handle serving error page
1299
- throw err;
1300
- }
1301
- }
1302
- // TODO: omit this from production builds, only test builds should include it
1303
- /**
1304
- * Creates a readable stream that emits a PPR boundary sentinel.
1305
- *
1306
- * @returns A readable stream that emits a PPR boundary sentinel.
1307
- */ function createPPRBoundarySentinel() {
1308
- return new ReadableStream({
1309
- start (controller) {
1310
- controller.enqueue(new TextEncoder().encode('<!-- PPR_BOUNDARY_SENTINEL -->'));
1311
- controller.close();
1312
- }
739
+ ]
740
+ })
1313
741
  });
1314
742
  }
1315
743
 
1316
- //# sourceMappingURL=app-page.js.map
1317
-
1318
-
1319
- /***/ }),
1320
-
1321
- /***/ 10846:
1322
- /***/ ((module) => {
1323
-
1324
- "use strict";
1325
- module.exports = require("next/dist/compiled/next-server/app-page.runtime.prod.js");
1326
-
1327
- /***/ }),
1328
-
1329
- /***/ 19121:
1330
- /***/ ((module) => {
744
+ ;// ./src/app/[locale]/know/resource/[id]/page.tsx
745
+ /* __next_internal_client_entry_do_not_use__ default auto */
746
+ /**
747
+ * Resource Viewer Page - Minimal Next.js routing wrapper
748
+ *
749
+ * Handles only Next.js routing and initial resource loading.
750
+ * All other concerns (data loading, events, UI state) are handled by ResourceViewerPage.
751
+ */
1331
752
 
1332
- "use strict";
1333
- module.exports = require("next/dist/server/app-render/action-async-storage.external.js");
1334
753
 
1335
- /***/ }),
1336
754
 
1337
- /***/ 19771:
1338
- /***/ ((module) => {
1339
755
 
1340
- "use strict";
1341
- module.exports = require("process");
1342
756
 
1343
- /***/ }),
757
+ // Feature components
1344
758
 
1345
- /***/ 26713:
1346
- /***/ ((module) => {
1347
759
 
1348
- "use strict";
1349
- module.exports = require("next/dist/shared/lib/router/utils/is-bot");
1350
760
 
1351
- /***/ }),
1352
761
 
1353
- /***/ 28354:
1354
- /***/ ((module) => {
762
+ /**
763
+ * Main page component - handles only routing and initial resource load
764
+ */ function KnowledgeResourcePage() {
765
+ const params = (0,navigation.useParams)();
766
+ const locale = (0,production_react/* useLocale */.Ym)();
767
+ // Construct resource URI from URL param
768
+ const initialUri = (0,core_dist/* resourceUri */.N)(`${ false ? 0 : 'http://localhost'}/resources/${params?.id}`);
769
+ // Load only the resource descriptor - everything else is loaded by ResourceViewerPage
770
+ const resources = (0,dist.useResources)();
771
+ const { data: docData, isLoading, isError, error, refetch: refetchDocument } = resources.get.useQuery(initialUri);
772
+ // Log error for debugging
773
+ process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react.useEffect)(()=>{
774
+ if (isError && !isLoading) {
775
+ console.error(`[Document] Failed to load resource ${initialUri}:`, error);
776
+ }
777
+ }, [
778
+ isError,
779
+ isLoading,
780
+ initialUri,
781
+ error
782
+ ]);
783
+ // Early return: Loading state
784
+ if (isLoading || !docData) {
785
+ return /*#__PURE__*/ (0,react_jsx_runtime.jsx)(dist.ResourceLoadingState, {});
786
+ }
787
+ // Early return: Error state
788
+ if (isError) {
789
+ return /*#__PURE__*/ (0,react_jsx_runtime.jsx)(dist.ResourceErrorState, {
790
+ error: error,
791
+ onRetry: ()=>refetchDocument()
792
+ });
793
+ }
794
+ // Early return: ResourceDescriptor not found
795
+ if (!docData.resource) {
796
+ return /*#__PURE__*/ (0,react_jsx_runtime.jsx)(dist.ResourceErrorState, {
797
+ error: new Error('Resource not found'),
798
+ onRetry: ()=>refetchDocument()
799
+ });
800
+ }
801
+ const resource = docData.resource;
802
+ const canonicalUri = (0,core_dist/* resourceUri */.N)(resource['@id']);
803
+ // Warn if URI mismatch
804
+ if (canonicalUri !== initialUri) {
805
+ console.warn(`[Document] URI mismatch:\n` + ` Constructed: ${initialUri}\n` + ` Canonical: ${canonicalUri}\n` + `This may indicate environment misconfiguration.`);
806
+ }
807
+ // Render with minimal props - all data loading/events handled inside ResourceViewerPage
808
+ return /*#__PURE__*/ (0,react_jsx_runtime.jsx)(dist.ResourceViewerPage, {
809
+ resource: resource,
810
+ rUri: canonicalUri,
811
+ locale: locale,
812
+ Link: routing/* Link */.N,
813
+ routes: routing/* routes */.J,
814
+ ToolbarPanels: ToolbarPanels/* ToolbarPanels */.t,
815
+ SearchResourcesModal: SearchResourcesModal,
816
+ GenerationConfigModal: GenerationConfigModal,
817
+ refetchDocument: refetchDocument
818
+ });
819
+ }
1355
820
 
1356
- "use strict";
1357
- module.exports = require("util");
1358
821
 
1359
822
  /***/ }),
1360
823
 
1361
- /***/ 29294:
1362
- /***/ ((module) => {
824
+ /***/ 62893:
825
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1363
826
 
1364
827
  "use strict";
1365
- module.exports = require("next/dist/server/app-render/work-async-storage.external.js");
1366
-
1367
- /***/ }),
828
+ __webpack_require__.r(__webpack_exports__);
829
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
830
+ /* harmony export */ GlobalError: () => (/* reexport safe */ _home_runner_work_semiont_semiont_apps_frontend_src_app_global_error_tsx__WEBPACK_IMPORTED_MODULE_25__["default"]),
831
+ /* harmony export */ __next_app__: () => (/* binding */ __next_app__),
832
+ /* harmony export */ handler: () => (/* binding */ handler),
833
+ /* harmony export */ pages: () => (/* binding */ pages),
834
+ /* harmony export */ routeModule: () => (/* binding */ routeModule),
835
+ /* harmony export */ tree: () => (/* binding */ tree)
836
+ /* harmony export */ });
837
+ /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(73653);
838
+ /* harmony import */ var next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__);
839
+ /* harmony import */ var next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(97714);
840
+ /* harmony import */ var next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(85250);
841
+ /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(37587);
842
+ /* harmony import */ var next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__);
843
+ /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22369);
844
+ /* harmony import */ var next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__);
845
+ /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(1889);
846
+ /* harmony import */ var next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__);
847
+ /* harmony import */ var next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(96232);
848
+ /* harmony import */ var next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(22841);
849
+ /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(46537);
850
+ /* harmony import */ var next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__);
851
+ /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(46027);
852
+ /* harmony import */ var next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__);
853
+ /* harmony import */ var next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(78559);
854
+ /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(75928);
855
+ /* harmony import */ var next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__);
856
+ /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(19374);
857
+ /* harmony import */ var next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__);
858
+ /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(65971);
859
+ /* harmony import */ var next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__);
860
+ /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(261);
861
+ /* harmony import */ var next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__);
862
+ /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(79898);
863
+ /* harmony import */ var next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__);
864
+ /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(32967);
865
+ /* harmony import */ var next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__);
866
+ /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(26713);
867
+ /* harmony import */ var next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__);
868
+ /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(40139);
869
+ /* harmony import */ var next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__);
870
+ /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(14248);
871
+ /* harmony import */ var next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__);
872
+ /* harmony import */ var next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(59580);
873
+ /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(57749);
874
+ /* harmony import */ var next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__);
875
+ /* harmony import */ var next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(53123);
876
+ /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(89745);
877
+ /* harmony import */ var next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__);
878
+ /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(86439);
879
+ /* harmony import */ var next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__);
880
+ /* harmony import */ var _home_runner_work_semiont_semiont_apps_frontend_src_app_global_error_tsx__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(90488);
881
+ /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(18283);
882
+ /* harmony import */ var next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__);
883
+ /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(39818);
884
+ /* harmony import */ var next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__);
885
+ /* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};
886
+ /* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__) if(["default","tree","pages","GlobalError","__next_app__","routeModule","handler"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__[__WEBPACK_IMPORT_KEY__]
887
+ /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
888
+ const module0 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 47570));
889
+ const module1 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 26412));
890
+ const module2 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 90488));
891
+ const module3 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 33506));
892
+ const module4 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 15034, 23));
893
+ const module5 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 54693, 23));
894
+ const module6 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 82778));
895
+ const module7 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 71743));
896
+ const module8 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 91305));
897
+ const page9 = () => Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 37103));
1368
898
 
1369
- /***/ 33873:
1370
- /***/ ((module) => {
1371
899
 
1372
- "use strict";
1373
- module.exports = require("path");
1374
900
 
1375
- /***/ }),
1376
901
 
1377
- /***/ 37103:
1378
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1379
902
 
1380
- "use strict";
1381
- __webpack_require__.r(__webpack_exports__);
1382
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
1383
- /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
1384
- /* harmony export */ });
1385
- /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(25459);
1386
- /* harmony import */ var react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__);
1387
- // This file is generated by the Webpack next-flight-loader.
1388
903
 
1389
- /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,react_server_dom_webpack_server__WEBPACK_IMPORTED_MODULE_0__.registerClientReference)(
1390
- function() { throw new Error("Attempted to call the default export of \"/Users/pingel/git_repos/github.com/The-AI-Alliance/semiont/apps/frontend/src/app/[locale]/know/resource/[id]/page.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component."); },
1391
- "/Users/pingel/git_repos/github.com/The-AI-Alliance/semiont/apps/frontend/src/app/[locale]/know/resource/[id]/page.tsx",
1392
- "default",
1393
- ));
1394
904
 
1395
905
 
1396
- /***/ }),
1397
906
 
1398
- /***/ 41025:
1399
- /***/ ((module) => {
1400
907
 
1401
- "use strict";
1402
- module.exports = require("next/dist/server/app-render/dynamic-access-async-storage.external.js");
1403
908
 
1404
- /***/ }),
1405
909
 
1406
- /***/ 62459:
1407
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1408
910
 
1409
- "use strict";
1410
- // ESM COMPAT FLAG
1411
- __webpack_require__.r(__webpack_exports__);
1412
911
 
1413
- // EXPORTS
1414
- __webpack_require__.d(__webpack_exports__, {
1415
- "default": () => (/* binding */ KnowledgeResourcePage)
1416
- });
1417
912
 
1418
- // EXTERNAL MODULE: ../../node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-runtime.js
1419
- var react_jsx_runtime = __webpack_require__(78157);
1420
- // EXTERNAL MODULE: ../../node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react.js
1421
- var react = __webpack_require__(31768);
1422
- // EXTERNAL MODULE: ../../node_modules/next/dist/api/navigation.js
1423
- var navigation = __webpack_require__(71159);
1424
- // EXTERNAL MODULE: ../../node_modules/use-intl/dist/esm/production/react.js + 17 modules
1425
- var production_react = __webpack_require__(16917);
1426
- // EXTERNAL MODULE: ../../packages/react-ui/dist/index.mjs + 27 modules
1427
- var dist = __webpack_require__(30658);
1428
- ;// __barrel_optimize__?names=useResources!=!../../packages/react-ui/dist/index.mjs
1429
913
 
1430
914
 
1431
- // EXTERNAL MODULE: ../../packages/core/dist/index.js
1432
- var core_dist = __webpack_require__(33301);
1433
- // EXTERNAL MODULE: ./src/lib/routing.ts
1434
- var routing = __webpack_require__(32302);
1435
- ;// __barrel_optimize__?names=ResourceErrorState,ResourceLoadingState,ResourceViewerPage!=!../../packages/react-ui/dist/index.mjs
1436
915
 
1437
916
 
1438
- // EXTERNAL MODULE: ./src/components/toolbar/ToolbarPanels.tsx + 4 modules
1439
- var ToolbarPanels = __webpack_require__(3591);
1440
- ;// __barrel_optimize__?names=ResourceSearchModal!=!../../packages/react-ui/dist/index.mjs
1441
917
 
1442
918
 
1443
- // EXTERNAL MODULE: ../../node_modules/next-intl/dist/esm/production/react-client/index.js
1444
- var react_client = __webpack_require__(72668);
1445
- ;// ./src/components/modals/SearchResourcesModal.tsx
1446
- /* __next_internal_client_entry_do_not_use__ SearchResourcesModal auto */
1447
919
 
1448
920
 
1449
921
 
1450
- function SearchResourcesModal({ isOpen, onClose, onSelect, searchTerm = '' }) {
1451
- const t = (0,react_client/* useTranslations */.c)('SearchResources');
1452
- return /*#__PURE__*/ (0,react_jsx_runtime.jsx)(dist.ResourceSearchModal, {
1453
- isOpen: isOpen,
1454
- onClose: onClose,
1455
- onSelect: onSelect,
1456
- searchTerm: searchTerm,
1457
- translations: {
1458
- title: t('title'),
1459
- placeholder: t('placeholder'),
1460
- searching: t('searching'),
1461
- noResults: t('noResults'),
1462
- close: t('close')
1463
- }
1464
- });
1465
- }
1466
922
 
1467
- // EXTERNAL MODULE: ../../node_modules/@headlessui/react/dist/components/transition/transition.js + 2 modules
1468
- var transition = __webpack_require__(15750);
1469
- // EXTERNAL MODULE: ../../node_modules/@headlessui/react/dist/components/dialog/dialog.js + 41 modules
1470
- var dialog = __webpack_require__(89789);
1471
- // EXTERNAL MODULE: __barrel_optimize__?names=LOCALES!=!../../packages/api-client/dist/index.js
1472
- var api_client_dist = __webpack_require__(55257);
1473
- ;// ./src/components/modals/GenerationConfigModal.tsx
1474
- /* __next_internal_client_entry_do_not_use__ GenerationConfigModal auto */
923
+ // We inject the tree and pages here so that we can use them in the route
924
+ // module.
925
+ const tree = {
926
+ children: [
927
+ '',
928
+ {
929
+ children: [
930
+ '[locale]',
931
+ {
932
+ children: [
933
+ 'know',
934
+ {
935
+ children: [
936
+ 'resource',
937
+ {
938
+ children: [
939
+ '[id]',
940
+ {
941
+ children: ['__PAGE__', {}, {
942
+ page: [page9, "/home/runner/work/semiont/semiont/apps/frontend/src/app/[locale]/know/resource/[id]/page.tsx"],
943
+
944
+ }]
945
+ },
946
+ {
947
+
948
+
949
+ }
950
+ ]
951
+ },
952
+ {
953
+
954
+
955
+ }
956
+ ]
957
+ },
958
+ {
959
+ 'layout': [module8, "/home/runner/work/semiont/semiont/apps/frontend/src/app/[locale]/know/layout.tsx"],
960
+
961
+ }
962
+ ]
963
+ },
964
+ {
965
+ 'layout': [module6, "/home/runner/work/semiont/semiont/apps/frontend/src/app/[locale]/layout.tsx"],
966
+ 'not-found': [module7, "/home/runner/work/semiont/semiont/apps/frontend/src/app/[locale]/not-found.tsx"],
967
+
968
+ }
969
+ ]
970
+ },
971
+ {
972
+ 'layout': [module0, "/home/runner/work/semiont/semiont/apps/frontend/src/app/layout.tsx"],
973
+ 'error': [module1, "/home/runner/work/semiont/semiont/apps/frontend/src/app/error.tsx"],
974
+ 'global-error': [module2, "/home/runner/work/semiont/semiont/apps/frontend/src/app/global-error.tsx"],
975
+ 'not-found': [module3, "/home/runner/work/semiont/semiont/apps/frontend/src/app/not-found.tsx"],
976
+ 'forbidden': [module4, "next/dist/client/components/builtin/forbidden.js"],
977
+ 'unauthorized': [module5, "next/dist/client/components/builtin/unauthorized.js"],
978
+
979
+ }
980
+ ]
981
+ }.children;
982
+ const pages = ["/home/runner/work/semiont/semiont/apps/frontend/src/app/[locale]/know/resource/[id]/page.tsx"];
1475
983
 
1476
984
 
1477
985
 
986
+ const __next_app_require__ = __webpack_require__
987
+ const __next_app_load_chunk__ = () => Promise.resolve()
988
+ const __next_app__ = {
989
+ require: __next_app_require__,
990
+ loadChunk: __next_app_load_chunk__
991
+ };
1478
992
 
1479
993
 
1480
- function GenerationConfigModal({ isOpen, onClose, onGenerate, defaultTitle, context, contextLoading, contextError }) {
1481
- const t = (0,react_client/* useTranslations */.c)('GenerationConfigModal');
1482
- const currentLocale = (0,production_react/* useLocale */.Ym)();
1483
- const [title, setTitle] = (0,react.useState)(defaultTitle);
1484
- const [prompt, setPrompt] = (0,react.useState)('');
1485
- const [language, setLanguage] = (0,react.useState)(currentLocale);
1486
- const [temperature, setTemperature] = (0,react.useState)(0.7);
1487
- const [maxTokens, setMaxTokens] = (0,react.useState)(500);
1488
- // Reset form when modal opens
1489
- process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react.useEffect)(()=>{
1490
- if (isOpen) {
1491
- setTitle(defaultTitle);
1492
- setPrompt('');
1493
- setLanguage(currentLocale);
1494
- setTemperature(0.7);
1495
- setMaxTokens(500);
1496
- }
1497
- }, [
1498
- isOpen,
1499
- defaultTitle,
1500
- currentLocale
1501
- ]);
1502
- const handleSubmit = (e)=>{
1503
- e.preventDefault();
1504
- // Context must be loaded before we can generate
1505
- if (!context) {
1506
- console.error('Cannot generate without context');
1507
- return;
1508
- }
1509
- const trimmedPrompt = prompt.trim();
1510
- onGenerate({
1511
- title,
1512
- ...trimmedPrompt ? {
1513
- prompt: trimmedPrompt
1514
- } : {},
1515
- language,
1516
- temperature,
1517
- maxTokens,
1518
- context
1519
- });
1520
- onClose();
994
+
995
+ // Create and export the route module that will be consumed.
996
+ const routeModule = new next_dist_server_route_modules_app_page_module_compiled__WEBPACK_IMPORTED_MODULE_0__.AppPageRouteModule({
997
+ definition: {
998
+ kind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE,
999
+ page: "/[locale]/know/resource/[id]/page",
1000
+ pathname: "/[locale]/know/resource/[id]",
1001
+ // The following aren't used in production.
1002
+ bundlePath: '',
1003
+ filename: '',
1004
+ appPaths: []
1005
+ },
1006
+ userland: {
1007
+ loaderTree: tree
1008
+ },
1009
+ distDir: ".next" || 0,
1010
+ relativeProjectDir: false || ''
1011
+ });
1012
+ async function handler(req, res, ctx) {
1013
+ var _this;
1014
+ let srcPage = "/[locale]/know/resource/[id]/page";
1015
+ // turbopack doesn't normalize `/index` in the page name
1016
+ // so we need to to process dynamic routes properly
1017
+ // TODO: fix turbopack providing differing value from webpack
1018
+ if (false) {} else if (srcPage === '/index') {
1019
+ // we always normalize /index specifically
1020
+ srcPage = '/';
1021
+ }
1022
+ const multiZoneDraftMode = false;
1023
+ const initialPostponed = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'postponed');
1024
+ // TODO: replace with more specific flags
1025
+ const minimalMode = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'minimalMode');
1026
+ const prepareResult = await routeModule.prepare(req, res, {
1027
+ srcPage,
1028
+ multiZoneDraftMode
1029
+ });
1030
+ if (!prepareResult) {
1031
+ res.statusCode = 400;
1032
+ res.end('Bad Request');
1033
+ ctx.waitUntil == null ? void 0 : ctx.waitUntil.call(ctx, Promise.resolve());
1034
+ return null;
1035
+ }
1036
+ const { buildId, query, params, parsedUrl, pageIsDynamic, buildManifest, nextFontManifest, reactLoadableManifest, serverActionsManifest, clientReferenceManifest, subresourceIntegrityManifest, prerenderManifest, isDraftMode, resolvedPathname, revalidateOnlyGenerated, routerServerContext, nextConfig, interceptionRoutePatterns } = prepareResult;
1037
+ const pathname = parsedUrl.pathname || '/';
1038
+ const normalizedSrcPage = (0,next_dist_shared_lib_router_utils_app_paths__WEBPACK_IMPORTED_MODULE_14__.normalizeAppPath)(srcPage);
1039
+ let { isOnDemandRevalidate } = prepareResult;
1040
+ const prerenderInfo = routeModule.match(pathname, prerenderManifest);
1041
+ const isPrerendered = !!prerenderManifest.routes[resolvedPathname];
1042
+ let isSSG = Boolean(prerenderInfo || isPrerendered || prerenderManifest.routes[normalizedSrcPage]);
1043
+ const userAgent = req.headers['user-agent'] || '';
1044
+ const botType = (0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.getBotType)(userAgent);
1045
+ const isHtmlBot = (0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.isHtmlBotRequest)(req);
1046
+ /**
1047
+ * If true, this indicates that the request being made is for an app
1048
+ * prefetch request.
1049
+ */ const isPrefetchRSCRequest = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'isPrefetchRSCRequest') ?? req.headers[next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_ROUTER_PREFETCH_HEADER] === '1' // exclude runtime prefetches, which use '2'
1050
+ ;
1051
+ // NOTE: Don't delete headers[RSC] yet, it still needs to be used in renderToHTML later
1052
+ const isRSCRequest = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'isRSCRequest') ?? Boolean(req.headers[next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_HEADER]);
1053
+ const isPossibleServerAction = (0,next_dist_server_lib_server_action_request_meta__WEBPACK_IMPORTED_MODULE_15__.getIsPossibleServerAction)(req);
1054
+ /**
1055
+ * If the route being rendered is an app page, and the ppr feature has been
1056
+ * enabled, then the given route _could_ support PPR.
1057
+ */ const couldSupportPPR = (0,next_dist_server_lib_experimental_ppr__WEBPACK_IMPORTED_MODULE_9__.checkIsAppPPREnabled)(nextConfig.experimental.ppr);
1058
+ // When enabled, this will allow the use of the `?__nextppronly` query to
1059
+ // enable debugging of the static shell.
1060
+ const hasDebugStaticShellQuery = false && 0;
1061
+ // When enabled, this will allow the use of the `?__nextppronly` query
1062
+ // to enable debugging of the fallback shell.
1063
+ const hasDebugFallbackShellQuery = hasDebugStaticShellQuery && query.__nextppronly === 'fallback';
1064
+ // This page supports PPR if it is marked as being `PARTIALLY_STATIC` in the
1065
+ // prerender manifest and this is an app page.
1066
+ const isRoutePPREnabled = couldSupportPPR && (((_this = prerenderManifest.routes[normalizedSrcPage] ?? prerenderManifest.dynamicRoutes[normalizedSrcPage]) == null ? void 0 : _this.renderingMode) === 'PARTIALLY_STATIC' || // Ideally we'd want to check the appConfig to see if this page has PPR
1067
+ // enabled or not, but that would require plumbing the appConfig through
1068
+ // to the server during development. We assume that the page supports it
1069
+ // but only during development.
1070
+ hasDebugStaticShellQuery && (routeModule.isDev === true || (routerServerContext == null ? void 0 : routerServerContext.experimentalTestProxy) === true));
1071
+ const isDebugStaticShell = hasDebugStaticShellQuery && isRoutePPREnabled;
1072
+ // We should enable debugging dynamic accesses when the static shell
1073
+ // debugging has been enabled and we're also in development mode.
1074
+ const isDebugDynamicAccesses = isDebugStaticShell && routeModule.isDev === true;
1075
+ const isDebugFallbackShell = hasDebugFallbackShellQuery && isRoutePPREnabled;
1076
+ // If we're in minimal mode, then try to get the postponed information from
1077
+ // the request metadata. If available, use it for resuming the postponed
1078
+ // render.
1079
+ const minimalPostponed = isRoutePPREnabled ? initialPostponed : undefined;
1080
+ // If PPR is enabled, and this is a RSC request (but not a prefetch), then
1081
+ // we can use this fact to only generate the flight data for the request
1082
+ // because we can't cache the HTML (as it's also dynamic).
1083
+ const isDynamicRSCRequest = isRoutePPREnabled && isRSCRequest && !isPrefetchRSCRequest;
1084
+ // Need to read this before it's stripped by stripFlightHeaders. We don't
1085
+ // need to transfer it to the request meta because it's only read
1086
+ // within this function; the static segment data should have already been
1087
+ // generated, so we will always either return a static response or a 404.
1088
+ const segmentPrefetchHeader = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'segmentPrefetchRSCRequest');
1089
+ // TODO: investigate existing bug with shouldServeStreamingMetadata always
1090
+ // being true for a revalidate due to modifying the base-server this.renderOpts
1091
+ // when fixing this to correct logic it causes hydration issue since we set
1092
+ // serveStreamingMetadata to true during export
1093
+ let serveStreamingMetadata = !userAgent ? true : (0,next_dist_server_lib_streaming_metadata__WEBPACK_IMPORTED_MODULE_12__.shouldServeStreamingMetadata)(userAgent, nextConfig.htmlLimitedBots);
1094
+ if (isHtmlBot && isRoutePPREnabled) {
1095
+ isSSG = false;
1096
+ serveStreamingMetadata = false;
1097
+ }
1098
+ // In development, we always want to generate dynamic HTML.
1099
+ let supportsDynamicResponse = // If we're in development, we always support dynamic HTML, unless it's
1100
+ // a data request, in which case we only produce static HTML.
1101
+ routeModule.isDev === true || // If this is not SSG or does not have static paths, then it supports
1102
+ // dynamic HTML.
1103
+ !isSSG || // If this request has provided postponed data, it supports dynamic
1104
+ // HTML.
1105
+ typeof initialPostponed === 'string' || // If this is a dynamic RSC request, then this render supports dynamic
1106
+ // HTML (it's dynamic).
1107
+ isDynamicRSCRequest;
1108
+ // When html bots request PPR page, perform the full dynamic rendering.
1109
+ const shouldWaitOnAllReady = isHtmlBot && isRoutePPREnabled;
1110
+ let ssgCacheKey = null;
1111
+ if (!isDraftMode && isSSG && !supportsDynamicResponse && !isPossibleServerAction && !minimalPostponed && !isDynamicRSCRequest) {
1112
+ ssgCacheKey = resolvedPathname;
1113
+ }
1114
+ // the staticPathKey differs from ssgCacheKey since
1115
+ // ssgCacheKey is null in dev since we're always in "dynamic"
1116
+ // mode in dev to bypass the cache, but we still need to honor
1117
+ // dynamicParams = false in dev mode
1118
+ let staticPathKey = ssgCacheKey;
1119
+ if (!staticPathKey && routeModule.isDev) {
1120
+ staticPathKey = resolvedPathname;
1121
+ }
1122
+ // If this is a request for an app path that should be statically generated
1123
+ // and we aren't in the edge runtime, strip the flight headers so it will
1124
+ // generate the static response.
1125
+ if (!routeModule.isDev && !isDraftMode && isSSG && isRSCRequest && !isDynamicRSCRequest) {
1126
+ (0,next_dist_server_app_render_strip_flight_headers__WEBPACK_IMPORTED_MODULE_7__/* .stripFlightHeaders */ .d)(req.headers);
1127
+ }
1128
+ const ComponentMod = {
1129
+ ...next_dist_server_app_render_entry_base__WEBPACK_IMPORTED_MODULE_26__,
1130
+ tree,
1131
+ pages,
1132
+ GlobalError: _home_runner_work_semiont_semiont_apps_frontend_src_app_global_error_tsx__WEBPACK_IMPORTED_MODULE_25__["default"],
1133
+ handler,
1134
+ routeModule,
1135
+ __next_app__
1521
1136
  };
1522
- const sourceContext = context?.sourceContext;
1523
- const hasContext = sourceContext && (sourceContext.before || sourceContext.after);
1524
- return /*#__PURE__*/ (0,react_jsx_runtime.jsx)(transition/* Transition */.e, {
1525
- appear: true,
1526
- show: isOpen,
1527
- as: react.Fragment,
1528
- children: /*#__PURE__*/ (0,react_jsx_runtime.jsxs)(dialog/* Dialog */.lG, {
1529
- as: "div",
1530
- className: "relative z-[1001]",
1531
- onClose: onClose,
1532
- children: [
1533
- /*#__PURE__*/ (0,react_jsx_runtime.jsx)(transition/* TransitionChild */._, {
1534
- as: react.Fragment,
1535
- enter: "ease-out duration-200",
1536
- enterFrom: "opacity-0",
1537
- enterTo: "opacity-100",
1538
- leave: "ease-in duration-150",
1539
- leaveFrom: "opacity-100",
1540
- leaveTo: "opacity-0",
1541
- children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("div", {
1542
- className: "fixed inset-0 bg-black/30 backdrop-blur-sm"
1543
- })
1544
- }),
1545
- /*#__PURE__*/ (0,react_jsx_runtime.jsx)("div", {
1546
- className: "fixed inset-0 overflow-y-auto",
1547
- children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)("div", {
1548
- className: "flex min-h-full items-center justify-center p-4",
1549
- children: /*#__PURE__*/ (0,react_jsx_runtime.jsx)(transition/* TransitionChild */._, {
1550
- as: react.Fragment,
1551
- enter: "ease-out duration-200",
1552
- enterFrom: "opacity-0 scale-95",
1553
- enterTo: "opacity-100 scale-100",
1554
- leave: "ease-in duration-150",
1555
- leaveFrom: "opacity-100 scale-100",
1556
- leaveTo: "opacity-0 scale-95",
1557
- children: /*#__PURE__*/ (0,react_jsx_runtime.jsxs)(dialog/* DialogPanel */.Lj, {
1558
- className: "w-full max-w-[700px] transform overflow-hidden rounded-lg bg-white dark:bg-gray-800 shadow-xl border border-gray-200 dark:border-gray-700 p-6 transition-all",
1559
- children: [
1560
- /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", {
1561
- className: "flex items-center justify-between mb-4",
1562
- children: [
1563
- /*#__PURE__*/ (0,react_jsx_runtime.jsx)(dialog/* DialogTitle */.L3, {
1564
- className: "text-lg font-semibold text-gray-900 dark:text-white",
1565
- children: t('title')
1566
- }),
1567
- /*#__PURE__*/ (0,react_jsx_runtime.jsx)("button", {
1568
- onClick: onClose,
1569
- className: "text-gray-600 hover:text-gray-900 dark:text-gray-400 dark:hover:text-gray-300",
1570
- children: "✕"
1571
- })
1572
- ]
1573
- }),
1574
- /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("form", {
1575
- onSubmit: handleSubmit,
1576
- className: "space-y-4",
1577
- children: [
1578
- /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", {
1579
- children: [
1580
- /*#__PURE__*/ (0,react_jsx_runtime.jsx)("label", {
1581
- className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2",
1582
- children: t('sourceContext')
1583
- }),
1584
- contextLoading && /*#__PURE__*/ (0,react_jsx_runtime.jsx)("div", {
1585
- className: "text-center py-4 text-gray-600 dark:text-gray-400",
1586
- children: t('loadingContext')
1587
- }),
1588
- !!contextError && /*#__PURE__*/ (0,react_jsx_runtime.jsx)("div", {
1589
- className: "text-center py-4 text-red-600 dark:text-red-400",
1590
- children: t('failedContext')
1591
- }),
1592
- hasContext && /*#__PURE__*/ (0,react_jsx_runtime.jsx)("div", {
1593
- className: "p-3 bg-gray-50 dark:bg-gray-900 rounded-lg border border-gray-200 dark:border-gray-700 max-h-[200px] overflow-y-auto",
1594
- children: /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", {
1595
- className: "text-sm font-mono whitespace-pre-wrap text-gray-600 dark:text-gray-400",
1596
- children: [
1597
- sourceContext.before && /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", {
1598
- children: sourceContext.before
1599
- }),
1600
- /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", {
1601
- className: "bg-blue-100 dark:bg-blue-900/40 px-1 font-semibold text-blue-900 dark:text-blue-200",
1602
- children: sourceContext.selected
1603
- }),
1604
- sourceContext.after && /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", {
1605
- children: sourceContext.after
1606
- })
1607
- ]
1608
- })
1609
- }),
1610
- /*#__PURE__*/ (0,react_jsx_runtime.jsx)("p", {
1611
- className: "text-xs text-gray-500 dark:text-gray-400 mt-1",
1612
- children: t('contextHelp')
1613
- })
1614
- ]
1615
- }),
1616
- /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", {
1617
- children: [
1618
- /*#__PURE__*/ (0,react_jsx_runtime.jsx)("label", {
1619
- htmlFor: "title",
1620
- className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",
1621
- children: t('resourceTitle')
1622
- }),
1623
- /*#__PURE__*/ (0,react_jsx_runtime.jsx)("input", {
1624
- id: "title",
1625
- type: "text",
1626
- value: title,
1627
- onChange: (e)=>setTitle(e.target.value),
1628
- required: true,
1629
- className: "w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg dark:bg-gray-700 text-gray-900 dark:text-white",
1630
- placeholder: t('resourceTitlePlaceholder')
1631
- })
1632
- ]
1633
- }),
1634
- /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", {
1635
- children: [
1636
- /*#__PURE__*/ (0,react_jsx_runtime.jsx)("label", {
1637
- htmlFor: "prompt",
1638
- className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",
1639
- children: t('additionalInstructions')
1640
- }),
1641
- /*#__PURE__*/ (0,react_jsx_runtime.jsx)("textarea", {
1642
- id: "prompt",
1643
- value: prompt,
1644
- onChange: (e)=>setPrompt(e.target.value),
1645
- rows: 3,
1646
- className: "w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg dark:bg-gray-700 text-gray-900 dark:text-white",
1647
- placeholder: t('additionalInstructionsPlaceholder')
1648
- })
1649
- ]
1650
- }),
1651
- /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", {
1652
- children: [
1653
- /*#__PURE__*/ (0,react_jsx_runtime.jsx)("label", {
1654
- htmlFor: "language",
1655
- className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",
1656
- children: t('language')
1657
- }),
1658
- /*#__PURE__*/ (0,react_jsx_runtime.jsx)("select", {
1659
- id: "language",
1660
- value: language,
1661
- onChange: (e)=>setLanguage(e.target.value),
1662
- className: "w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg dark:bg-gray-700 text-gray-900 dark:text-white",
1663
- children: api_client_dist/* LOCALES */.YZ.map((lang)=>/*#__PURE__*/ (0,react_jsx_runtime.jsx)("option", {
1664
- value: lang.code,
1665
- children: lang.nativeName
1666
- }, lang.code))
1667
- }),
1668
- /*#__PURE__*/ (0,react_jsx_runtime.jsx)("p", {
1669
- className: "text-xs text-gray-500 dark:text-gray-400 mt-1",
1670
- children: t('languageHelp')
1671
- })
1672
- ]
1673
- }),
1674
- /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", {
1675
- children: [
1676
- /*#__PURE__*/ (0,react_jsx_runtime.jsx)("label", {
1677
- htmlFor: "temperature",
1678
- className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",
1679
- children: t('creativity', {
1680
- value: temperature.toFixed(1)
1681
- })
1682
- }),
1683
- /*#__PURE__*/ (0,react_jsx_runtime.jsx)("input", {
1684
- id: "temperature",
1685
- type: "range",
1686
- min: "0",
1687
- max: "1",
1688
- step: "0.1",
1689
- value: temperature,
1690
- onChange: (e)=>setTemperature(parseFloat(e.target.value)),
1691
- className: "w-full"
1692
- }),
1693
- /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", {
1694
- className: "flex justify-between text-xs text-gray-500 dark:text-gray-400 mt-1",
1695
- children: [
1696
- /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", {
1697
- children: t('creativityFocused')
1698
- }),
1699
- /*#__PURE__*/ (0,react_jsx_runtime.jsx)("span", {
1700
- children: t('creativityCreative')
1701
- })
1702
- ]
1703
- })
1704
- ]
1705
- }),
1706
- /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", {
1707
- children: [
1708
- /*#__PURE__*/ (0,react_jsx_runtime.jsx)("label", {
1709
- htmlFor: "maxTokens",
1710
- className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",
1711
- children: t('maxLength')
1712
- }),
1713
- /*#__PURE__*/ (0,react_jsx_runtime.jsx)("input", {
1714
- id: "maxTokens",
1715
- type: "number",
1716
- min: "100",
1717
- max: "4000",
1718
- step: "100",
1719
- value: maxTokens,
1720
- onChange: (e)=>setMaxTokens(parseInt(e.target.value)),
1721
- className: "w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg dark:bg-gray-700 text-gray-900 dark:text-white"
1722
- }),
1723
- /*#__PURE__*/ (0,react_jsx_runtime.jsx)("p", {
1724
- className: "text-xs text-gray-500 dark:text-gray-400 mt-1",
1725
- children: t('maxLengthHelp')
1726
- })
1727
- ]
1728
- }),
1729
- /*#__PURE__*/ (0,react_jsx_runtime.jsxs)("div", {
1730
- className: "flex gap-3 pt-2",
1731
- children: [
1732
- /*#__PURE__*/ (0,react_jsx_runtime.jsx)("button", {
1733
- type: "button",
1734
- onClick: onClose,
1735
- className: "flex-1 px-4 py-2 border border-gray-300 dark:border-gray-600 rounded-lg text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors",
1736
- children: t('cancel')
1737
- }),
1738
- /*#__PURE__*/ (0,react_jsx_runtime.jsx)("button", {
1739
- type: "submit",
1740
- disabled: contextLoading || !context,
1741
- className: "flex-1 px-4 py-2 bg-gradient-to-r from-blue-600 to-cyan-600 hover:from-blue-700 hover:to-cyan-700 text-white rounded-lg font-medium transition-all disabled:opacity-50 disabled:cursor-not-allowed",
1742
- children: t('generate')
1743
- })
1744
- ]
1745
- })
1746
- ]
1747
- })
1748
- ]
1749
- })
1750
- })
1751
- })
1137
+ // Before rendering (which initializes component tree modules), we have to
1138
+ // set the reference manifests to our global store so Server Action's
1139
+ // encryption util can access to them at the top level of the page module.
1140
+ if (serverActionsManifest && clientReferenceManifest) {
1141
+ (0,next_dist_server_app_render_encryption_utils__WEBPACK_IMPORTED_MODULE_11__.setReferenceManifestsSingleton)({
1142
+ page: srcPage,
1143
+ clientReferenceManifest,
1144
+ serverActionsManifest,
1145
+ serverModuleMap: (0,next_dist_server_app_render_action_utils__WEBPACK_IMPORTED_MODULE_13__.createServerModuleMap)({
1146
+ serverActionsManifest
1147
+ })
1148
+ });
1149
+ }
1150
+ const method = req.method || 'GET';
1151
+ const tracer = (0,next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.getTracer)();
1152
+ const activeSpan = tracer.getActiveScopeSpan();
1153
+ try {
1154
+ const varyHeader = routeModule.getVaryHeader(resolvedPathname, interceptionRoutePatterns);
1155
+ res.setHeader('Vary', varyHeader);
1156
+ const invokeRouteModule = async (span, context)=>{
1157
+ const nextReq = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextRequest(req);
1158
+ const nextRes = new next_dist_server_base_http_node__WEBPACK_IMPORTED_MODULE_8__.NodeNextResponse(res);
1159
+ // TODO: adapt for putting the RDC inside the postponed data
1160
+ // If we're in dev, and this isn't a prefetch or a server action,
1161
+ // we should seed the resume data cache.
1162
+ if (false) {}
1163
+ return routeModule.render(nextReq, nextRes, context).finally(()=>{
1164
+ if (!span) return;
1165
+ span.setAttributes({
1166
+ 'http.status_code': res.statusCode,
1167
+ 'next.rsc': false
1168
+ });
1169
+ const rootSpanAttributes = tracer.getRootSpanAttributes();
1170
+ // We were unable to get attributes, probably OTEL is not enabled
1171
+ if (!rootSpanAttributes) {
1172
+ return;
1173
+ }
1174
+ if (rootSpanAttributes.get('next.span_type') !== next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpan.handleRequest) {
1175
+ console.warn(`Unexpected root span type '${rootSpanAttributes.get('next.span_type')}'. Please report this Next.js issue https://github.com/vercel/next.js`);
1176
+ return;
1177
+ }
1178
+ const route = rootSpanAttributes.get('next.route');
1179
+ if (route) {
1180
+ const name = `${method} ${route}`;
1181
+ span.setAttributes({
1182
+ 'next.route': route,
1183
+ 'http.route': route,
1184
+ 'next.span_name': name
1185
+ });
1186
+ span.updateName(name);
1187
+ } else {
1188
+ span.updateName(`${method} ${req.url}`);
1189
+ }
1190
+ });
1191
+ };
1192
+ const doRender = async ({ span, postponed, fallbackRouteParams })=>{
1193
+ const context = {
1194
+ query,
1195
+ params,
1196
+ page: normalizedSrcPage,
1197
+ sharedContext: {
1198
+ buildId
1199
+ },
1200
+ serverComponentsHmrCache: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'serverComponentsHmrCache'),
1201
+ fallbackRouteParams,
1202
+ renderOpts: {
1203
+ App: ()=>null,
1204
+ Document: ()=>null,
1205
+ pageConfig: {},
1206
+ ComponentMod,
1207
+ Component: (0,next_dist_server_app_render_interop_default__WEBPACK_IMPORTED_MODULE_6__/* .interopDefault */ .T)(ComponentMod),
1208
+ params,
1209
+ routeModule,
1210
+ page: srcPage,
1211
+ postponed,
1212
+ shouldWaitOnAllReady,
1213
+ serveStreamingMetadata,
1214
+ supportsDynamicResponse: typeof postponed === 'string' || supportsDynamicResponse,
1215
+ buildManifest,
1216
+ nextFontManifest,
1217
+ reactLoadableManifest,
1218
+ subresourceIntegrityManifest,
1219
+ serverActionsManifest,
1220
+ clientReferenceManifest,
1221
+ setIsrStatus: routerServerContext == null ? void 0 : routerServerContext.setIsrStatus,
1222
+ dir: true ? (__webpack_require__(33873).join)(/* turbopackIgnore: true */ process.cwd(), routeModule.relativeProjectDir) : 0,
1223
+ isDraftMode,
1224
+ isRevalidate: isSSG && !postponed && !isDynamicRSCRequest,
1225
+ botType,
1226
+ isOnDemandRevalidate,
1227
+ isPossibleServerAction,
1228
+ assetPrefix: nextConfig.assetPrefix,
1229
+ nextConfigOutput: nextConfig.output,
1230
+ crossOrigin: nextConfig.crossOrigin,
1231
+ trailingSlash: nextConfig.trailingSlash,
1232
+ previewProps: prerenderManifest.preview,
1233
+ deploymentId: nextConfig.deploymentId,
1234
+ enableTainting: nextConfig.experimental.taint,
1235
+ htmlLimitedBots: nextConfig.htmlLimitedBots,
1236
+ devtoolSegmentExplorer: nextConfig.experimental.devtoolSegmentExplorer,
1237
+ reactMaxHeadersLength: nextConfig.reactMaxHeadersLength,
1238
+ multiZoneDraftMode,
1239
+ incrementalCache: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'incrementalCache'),
1240
+ cacheLifeProfiles: nextConfig.experimental.cacheLife,
1241
+ basePath: nextConfig.basePath,
1242
+ serverActions: nextConfig.experimental.serverActions,
1243
+ ...isDebugStaticShell || isDebugDynamicAccesses ? {
1244
+ nextExport: true,
1245
+ supportsDynamicResponse: false,
1246
+ isStaticGeneration: true,
1247
+ isRevalidate: true,
1248
+ isDebugDynamicAccesses: isDebugDynamicAccesses
1249
+ } : {},
1250
+ experimental: {
1251
+ isRoutePPREnabled,
1252
+ expireTime: nextConfig.expireTime,
1253
+ staleTimes: nextConfig.experimental.staleTimes,
1254
+ cacheComponents: Boolean(nextConfig.experimental.cacheComponents),
1255
+ clientSegmentCache: Boolean(nextConfig.experimental.clientSegmentCache),
1256
+ clientParamParsing: Boolean(nextConfig.experimental.clientParamParsing),
1257
+ dynamicOnHover: Boolean(nextConfig.experimental.dynamicOnHover),
1258
+ inlineCss: Boolean(nextConfig.experimental.inlineCss),
1259
+ authInterrupts: Boolean(nextConfig.experimental.authInterrupts),
1260
+ clientTraceMetadata: nextConfig.experimental.clientTraceMetadata || []
1261
+ },
1262
+ waitUntil: ctx.waitUntil,
1263
+ onClose: (cb)=>{
1264
+ res.on('close', cb);
1265
+ },
1266
+ onAfterTaskError: ()=>{},
1267
+ onInstrumentationRequestError: (error, _request, errorContext)=>routeModule.onRequestError(req, error, errorContext, routerServerContext),
1268
+ err: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'invokeError'),
1269
+ dev: routeModule.isDev
1270
+ }
1271
+ };
1272
+ const result = await invokeRouteModule(span, context);
1273
+ const { metadata } = result;
1274
+ const { cacheControl, headers = {}, // Add any fetch tags that were on the page to the response headers.
1275
+ fetchTags: cacheTags } = metadata;
1276
+ if (cacheTags) {
1277
+ headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER] = cacheTags;
1278
+ }
1279
+ // Pull any fetch metrics from the render onto the request.
1280
+ ;
1281
+ req.fetchMetrics = metadata.fetchMetrics;
1282
+ // we don't throw static to dynamic errors in dev as isSSG
1283
+ // is a best guess in dev since we don't have the prerender pass
1284
+ // to know whether the path is actually static or not
1285
+ if (isSSG && (cacheControl == null ? void 0 : cacheControl.revalidate) === 0 && !routeModule.isDev && !isRoutePPREnabled) {
1286
+ const staticBailoutInfo = metadata.staticBailoutInfo;
1287
+ const err = Object.defineProperty(new Error(`Page changed from static to dynamic at runtime ${resolvedPathname}${(staticBailoutInfo == null ? void 0 : staticBailoutInfo.description) ? `, reason: ${staticBailoutInfo.description}` : ``}` + `\nsee more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`), "__NEXT_ERROR_CODE", {
1288
+ value: "E132",
1289
+ enumerable: false,
1290
+ configurable: true
1291
+ });
1292
+ if (staticBailoutInfo == null ? void 0 : staticBailoutInfo.stack) {
1293
+ const stack = staticBailoutInfo.stack;
1294
+ err.stack = err.message + stack.substring(stack.indexOf('\n'));
1295
+ }
1296
+ throw err;
1297
+ }
1298
+ return {
1299
+ value: {
1300
+ kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE,
1301
+ html: result,
1302
+ headers,
1303
+ rscData: metadata.flightData,
1304
+ postponed: metadata.postponed,
1305
+ status: metadata.statusCode,
1306
+ segmentData: metadata.segmentData
1307
+ },
1308
+ cacheControl
1309
+ };
1310
+ };
1311
+ const responseGenerator = async ({ hasResolved, previousCacheEntry, isRevalidating, span })=>{
1312
+ const isProduction = routeModule.isDev === false;
1313
+ const didRespond = hasResolved || res.writableEnded;
1314
+ // skip on-demand revalidate if cache is not present and
1315
+ // revalidate-if-generated is set
1316
+ if (isOnDemandRevalidate && revalidateOnlyGenerated && !previousCacheEntry && !minimalMode) {
1317
+ if (routerServerContext == null ? void 0 : routerServerContext.render404) {
1318
+ await routerServerContext.render404(req, res);
1319
+ } else {
1320
+ res.statusCode = 404;
1321
+ res.end('This page could not be found');
1322
+ }
1323
+ return null;
1324
+ }
1325
+ let fallbackMode;
1326
+ if (prerenderInfo) {
1327
+ fallbackMode = (0,next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.parseFallbackField)(prerenderInfo.fallback);
1328
+ }
1329
+ // When serving a HTML bot request, we want to serve a blocking render and
1330
+ // not the prerendered page. This ensures that the correct content is served
1331
+ // to the bot in the head.
1332
+ if (fallbackMode === next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.PRERENDER && (0,next_dist_shared_lib_router_utils_is_bot__WEBPACK_IMPORTED_MODULE_17__.isBot)(userAgent)) {
1333
+ if (!isRoutePPREnabled || isHtmlBot) {
1334
+ fallbackMode = next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.BLOCKING_STATIC_RENDER;
1335
+ }
1336
+ }
1337
+ if ((previousCacheEntry == null ? void 0 : previousCacheEntry.isStale) === -1) {
1338
+ isOnDemandRevalidate = true;
1339
+ }
1340
+ // TODO: adapt for PPR
1341
+ // only allow on-demand revalidate for fallback: true/blocking
1342
+ // or for prerendered fallback: false paths
1343
+ if (isOnDemandRevalidate && (fallbackMode !== next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.NOT_FOUND || previousCacheEntry)) {
1344
+ fallbackMode = next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.BLOCKING_STATIC_RENDER;
1345
+ }
1346
+ if (!minimalMode && fallbackMode !== next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.BLOCKING_STATIC_RENDER && staticPathKey && !didRespond && !isDraftMode && pageIsDynamic && (isProduction || !isPrerendered)) {
1347
+ // if the page has dynamicParams: false and this pathname wasn't
1348
+ // prerendered trigger the no fallback handling
1349
+ if (// In development, fall through to render to handle missing
1350
+ // getStaticPaths.
1351
+ (isProduction || prerenderInfo) && // When fallback isn't present, abort this render so we 404
1352
+ fallbackMode === next_dist_lib_fallback__WEBPACK_IMPORTED_MODULE_19__.FallbackMode.NOT_FOUND) {
1353
+ throw new next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackError();
1354
+ }
1355
+ let fallbackResponse;
1356
+ if (isRoutePPREnabled && !isRSCRequest) {
1357
+ const cacheKey = typeof (prerenderInfo == null ? void 0 : prerenderInfo.fallback) === 'string' ? prerenderInfo.fallback : isProduction ? normalizedSrcPage : null;
1358
+ // We use the response cache here to handle the revalidation and
1359
+ // management of the fallback shell.
1360
+ fallbackResponse = await routeModule.handleResponse({
1361
+ cacheKey,
1362
+ req,
1363
+ nextConfig,
1364
+ routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE,
1365
+ isFallback: true,
1366
+ prerenderManifest,
1367
+ isRoutePPREnabled,
1368
+ responseGenerator: async ()=>doRender({
1369
+ span,
1370
+ // We pass `undefined` as rendering a fallback isn't resumed
1371
+ // here.
1372
+ postponed: undefined,
1373
+ fallbackRouteParams: // If we're in production or we're debugging the fallback
1374
+ // shell then we should postpone when dynamic params are
1375
+ // accessed.
1376
+ isProduction || isDebugFallbackShell ? (0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)(normalizedSrcPage) : null
1377
+ }),
1378
+ waitUntil: ctx.waitUntil
1379
+ });
1380
+ // If the fallback response was set to null, then we should return null.
1381
+ if (fallbackResponse === null) return null;
1382
+ // Otherwise, if we did get a fallback response, we should return it.
1383
+ if (fallbackResponse) {
1384
+ // Remove the cache control from the response to prevent it from being
1385
+ // used in the surrounding cache.
1386
+ delete fallbackResponse.cacheControl;
1387
+ return fallbackResponse;
1388
+ }
1389
+ }
1390
+ }
1391
+ // Only requests that aren't revalidating can be resumed. If we have the
1392
+ // minimal postponed data, then we should resume the render with it.
1393
+ const postponed = !isOnDemandRevalidate && !isRevalidating && minimalPostponed ? minimalPostponed : undefined;
1394
+ // When we're in minimal mode, if we're trying to debug the static shell,
1395
+ // we should just return nothing instead of resuming the dynamic render.
1396
+ if ((isDebugStaticShell || isDebugDynamicAccesses) && typeof postponed !== 'undefined') {
1397
+ return {
1398
+ cacheControl: {
1399
+ revalidate: 1,
1400
+ expire: undefined
1401
+ },
1402
+ value: {
1403
+ kind: next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.PAGES,
1404
+ html: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].EMPTY,
1405
+ pageData: {},
1406
+ headers: undefined,
1407
+ status: undefined
1408
+ }
1409
+ };
1410
+ }
1411
+ // If this is a dynamic route with PPR enabled and the default route
1412
+ // matches were set, then we should pass the fallback route params to
1413
+ // the renderer as this is a fallback revalidation request.
1414
+ const fallbackRouteParams = pageIsDynamic && isRoutePPREnabled && ((0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'renderFallbackShell') || isDebugFallbackShell) ? (0,next_dist_server_request_fallback_params__WEBPACK_IMPORTED_MODULE_10__/* .getFallbackRouteParams */ .u)(pathname) : null;
1415
+ // Perform the render.
1416
+ return doRender({
1417
+ span,
1418
+ postponed,
1419
+ fallbackRouteParams
1420
+ });
1421
+ };
1422
+ const handleResponse = async (span)=>{
1423
+ var _cacheEntry_value, _cachedData_headers;
1424
+ const cacheEntry = await routeModule.handleResponse({
1425
+ cacheKey: ssgCacheKey,
1426
+ responseGenerator: (c)=>responseGenerator({
1427
+ span,
1428
+ ...c
1429
+ }),
1430
+ routeKind: next_dist_server_route_kind__WEBPACK_IMPORTED_MODULE_1__.RouteKind.APP_PAGE,
1431
+ isOnDemandRevalidate,
1432
+ isRoutePPREnabled,
1433
+ req,
1434
+ nextConfig,
1435
+ prerenderManifest,
1436
+ waitUntil: ctx.waitUntil
1437
+ });
1438
+ if (isDraftMode) {
1439
+ res.setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');
1440
+ }
1441
+ // In dev, we should not cache pages for any reason.
1442
+ if (routeModule.isDev) {
1443
+ res.setHeader('Cache-Control', 'no-store, must-revalidate');
1444
+ }
1445
+ if (!cacheEntry) {
1446
+ if (ssgCacheKey) {
1447
+ // A cache entry might not be generated if a response is written
1448
+ // in `getInitialProps` or `getServerSideProps`, but those shouldn't
1449
+ // have a cache key. If we do have a cache key but we don't end up
1450
+ // with a cache entry, then either Next.js or the application has a
1451
+ // bug that needs fixing.
1452
+ throw Object.defineProperty(new Error('invariant: cache entry required but not generated'), "__NEXT_ERROR_CODE", {
1453
+ value: "E62",
1454
+ enumerable: false,
1455
+ configurable: true
1456
+ });
1457
+ }
1458
+ return null;
1459
+ }
1460
+ if (((_cacheEntry_value = cacheEntry.value) == null ? void 0 : _cacheEntry_value.kind) !== next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE) {
1461
+ var _cacheEntry_value1;
1462
+ throw Object.defineProperty(new Error(`Invariant app-page handler received invalid cache entry ${(_cacheEntry_value1 = cacheEntry.value) == null ? void 0 : _cacheEntry_value1.kind}`), "__NEXT_ERROR_CODE", {
1463
+ value: "E707",
1464
+ enumerable: false,
1465
+ configurable: true
1466
+ });
1467
+ }
1468
+ const didPostpone = typeof cacheEntry.value.postponed === 'string';
1469
+ if (isSSG && // We don't want to send a cache header for requests that contain dynamic
1470
+ // data. If this is a Dynamic RSC request or wasn't a Prefetch RSC
1471
+ // request, then we should set the cache header.
1472
+ !isDynamicRSCRequest && (!didPostpone || isPrefetchRSCRequest)) {
1473
+ if (!minimalMode) {
1474
+ // set x-nextjs-cache header to match the header
1475
+ // we set for the image-optimizer
1476
+ res.setHeader('x-nextjs-cache', isOnDemandRevalidate ? 'REVALIDATED' : cacheEntry.isMiss ? 'MISS' : cacheEntry.isStale ? 'STALE' : 'HIT');
1477
+ }
1478
+ // Set a header used by the client router to signal the response is static
1479
+ // and should respect the `static` cache staleTime value.
1480
+ res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_IS_PRERENDER_HEADER, '1');
1481
+ }
1482
+ const { value: cachedData } = cacheEntry;
1483
+ // Coerce the cache control parameter from the render.
1484
+ let cacheControl;
1485
+ // If this is a resume request in minimal mode it is streamed with dynamic
1486
+ // content and should not be cached.
1487
+ if (minimalPostponed) {
1488
+ cacheControl = {
1489
+ revalidate: 0,
1490
+ expire: undefined
1491
+ };
1492
+ } else if (minimalMode && isRSCRequest && !isPrefetchRSCRequest && isRoutePPREnabled) {
1493
+ cacheControl = {
1494
+ revalidate: 0,
1495
+ expire: undefined
1496
+ };
1497
+ } else if (!routeModule.isDev) {
1498
+ // If this is a preview mode request, we shouldn't cache it
1499
+ if (isDraftMode) {
1500
+ cacheControl = {
1501
+ revalidate: 0,
1502
+ expire: undefined
1503
+ };
1504
+ } else if (!isSSG) {
1505
+ if (!res.getHeader('Cache-Control')) {
1506
+ cacheControl = {
1507
+ revalidate: 0,
1508
+ expire: undefined
1509
+ };
1510
+ }
1511
+ } else if (cacheEntry.cacheControl) {
1512
+ // If the cache entry has a cache control with a revalidate value that's
1513
+ // a number, use it.
1514
+ if (typeof cacheEntry.cacheControl.revalidate === 'number') {
1515
+ var _cacheEntry_cacheControl;
1516
+ if (cacheEntry.cacheControl.revalidate < 1) {
1517
+ throw Object.defineProperty(new Error(`Invalid revalidate configuration provided: ${cacheEntry.cacheControl.revalidate} < 1`), "__NEXT_ERROR_CODE", {
1518
+ value: "E22",
1519
+ enumerable: false,
1520
+ configurable: true
1521
+ });
1522
+ }
1523
+ cacheControl = {
1524
+ revalidate: cacheEntry.cacheControl.revalidate,
1525
+ expire: ((_cacheEntry_cacheControl = cacheEntry.cacheControl) == null ? void 0 : _cacheEntry_cacheControl.expire) ?? nextConfig.expireTime
1526
+ };
1527
+ } else {
1528
+ cacheControl = {
1529
+ revalidate: next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.CACHE_ONE_YEAR,
1530
+ expire: undefined
1531
+ };
1532
+ }
1533
+ }
1534
+ }
1535
+ cacheEntry.cacheControl = cacheControl;
1536
+ if (typeof segmentPrefetchHeader === 'string' && (cachedData == null ? void 0 : cachedData.kind) === next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE && cachedData.segmentData) {
1537
+ var _cachedData_headers1;
1538
+ // This is a prefetch request issued by the client Segment Cache. These
1539
+ // should never reach the application layer (lambda). We should either
1540
+ // respond from the cache (HIT) or respond with 204 No Content (MISS).
1541
+ // Set a header to indicate that PPR is enabled for this route. This
1542
+ // lets the client distinguish between a regular cache miss and a cache
1543
+ // miss due to PPR being disabled. In other contexts this header is used
1544
+ // to indicate that the response contains dynamic data, but here we're
1545
+ // only using it to indicate that the feature is enabled — the segment
1546
+ // response itself contains whether the data is dynamic.
1547
+ res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADER, '2');
1548
+ // Add the cache tags header to the response if it exists and we're in
1549
+ // minimal mode while rendering a static page.
1550
+ const tags = (_cachedData_headers1 = cachedData.headers) == null ? void 0 : _cachedData_headers1[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER];
1551
+ if (minimalMode && isSSG && tags && typeof tags === 'string') {
1552
+ res.setHeader(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER, tags);
1553
+ }
1554
+ const matchedSegment = cachedData.segmentData.get(segmentPrefetchHeader);
1555
+ if (matchedSegment !== undefined) {
1556
+ // Cache hit
1557
+ return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({
1558
+ req,
1559
+ res,
1560
+ generateEtags: nextConfig.generateEtags,
1561
+ poweredByHeader: nextConfig.poweredByHeader,
1562
+ result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].fromStatic(matchedSegment, next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADER),
1563
+ cacheControl: cacheEntry.cacheControl
1564
+ });
1565
+ }
1566
+ // Cache miss. Either a cache entry for this route has not been generated
1567
+ // (which technically should not be possible when PPR is enabled, because
1568
+ // at a minimum there should always be a fallback entry) or there's no
1569
+ // match for the requested segment. Respond with a 204 No Content. We
1570
+ // don't bother to respond with 404, because these requests are only
1571
+ // issued as part of a prefetch.
1572
+ res.statusCode = 204;
1573
+ return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({
1574
+ req,
1575
+ res,
1576
+ generateEtags: nextConfig.generateEtags,
1577
+ poweredByHeader: nextConfig.poweredByHeader,
1578
+ result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].EMPTY,
1579
+ cacheControl: cacheEntry.cacheControl
1580
+ });
1581
+ }
1582
+ // If there's a callback for `onCacheEntry`, call it with the cache entry
1583
+ // and the revalidate options.
1584
+ const onCacheEntry = (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'onCacheEntry');
1585
+ if (onCacheEntry) {
1586
+ const finished = await onCacheEntry({
1587
+ ...cacheEntry,
1588
+ // TODO: remove this when upstream doesn't
1589
+ // always expect this value to be "PAGE"
1590
+ value: {
1591
+ ...cacheEntry.value,
1592
+ kind: 'PAGE'
1593
+ }
1594
+ }, {
1595
+ url: (0,next_dist_server_request_meta__WEBPACK_IMPORTED_MODULE_4__.getRequestMeta)(req, 'initURL')
1596
+ });
1597
+ if (finished) {
1598
+ // TODO: maybe we have to end the request?
1599
+ return null;
1600
+ }
1601
+ }
1602
+ // If the request has a postponed state and it's a resume request we
1603
+ // should error.
1604
+ if (didPostpone && minimalPostponed) {
1605
+ throw Object.defineProperty(new Error('Invariant: postponed state should not be present on a resume request'), "__NEXT_ERROR_CODE", {
1606
+ value: "E396",
1607
+ enumerable: false,
1608
+ configurable: true
1609
+ });
1610
+ }
1611
+ if (cachedData.headers) {
1612
+ const headers = {
1613
+ ...cachedData.headers
1614
+ };
1615
+ if (!minimalMode || !isSSG) {
1616
+ delete headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER];
1617
+ }
1618
+ for (let [key, value] of Object.entries(headers)){
1619
+ if (typeof value === 'undefined') continue;
1620
+ if (Array.isArray(value)) {
1621
+ for (const v of value){
1622
+ res.appendHeader(key, v);
1623
+ }
1624
+ } else if (typeof value === 'number') {
1625
+ value = value.toString();
1626
+ res.appendHeader(key, value);
1627
+ } else {
1628
+ res.appendHeader(key, value);
1629
+ }
1630
+ }
1631
+ }
1632
+ // Add the cache tags header to the response if it exists and we're in
1633
+ // minimal mode while rendering a static page.
1634
+ const tags = (_cachedData_headers = cachedData.headers) == null ? void 0 : _cachedData_headers[next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER];
1635
+ if (minimalMode && isSSG && tags && typeof tags === 'string') {
1636
+ res.setHeader(next_dist_lib_constants__WEBPACK_IMPORTED_MODULE_21__.NEXT_CACHE_TAGS_HEADER, tags);
1637
+ }
1638
+ // If the request is a data request, then we shouldn't set the status code
1639
+ // from the response because it should always be 200. This should be gated
1640
+ // behind the experimental PPR flag.
1641
+ if (cachedData.status && (!isRSCRequest || !isRoutePPREnabled)) {
1642
+ res.statusCode = cachedData.status;
1643
+ }
1644
+ // Redirect information is encoded in RSC payload, so we don't need to use redirect status codes
1645
+ if (!minimalMode && cachedData.status && next_dist_client_components_redirect_status_code__WEBPACK_IMPORTED_MODULE_27__.RedirectStatusCode[cachedData.status] && isRSCRequest) {
1646
+ res.statusCode = 200;
1647
+ }
1648
+ // Mark that the request did postpone.
1649
+ if (didPostpone) {
1650
+ res.setHeader(next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.NEXT_DID_POSTPONE_HEADER, '1');
1651
+ }
1652
+ // we don't go through this block when preview mode is true
1653
+ // as preview mode is a dynamic request (bypasses cache) and doesn't
1654
+ // generate both HTML and payloads in the same request so continue to just
1655
+ // return the generated payload
1656
+ if (isRSCRequest && !isDraftMode) {
1657
+ // If this is a dynamic RSC request, then stream the response.
1658
+ if (typeof cachedData.rscData === 'undefined') {
1659
+ if (cachedData.postponed) {
1660
+ throw Object.defineProperty(new Error('Invariant: Expected postponed to be undefined'), "__NEXT_ERROR_CODE", {
1661
+ value: "E372",
1662
+ enumerable: false,
1663
+ configurable: true
1664
+ });
1665
+ }
1666
+ return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({
1667
+ req,
1668
+ res,
1669
+ generateEtags: nextConfig.generateEtags,
1670
+ poweredByHeader: nextConfig.poweredByHeader,
1671
+ result: cachedData.html,
1672
+ // Dynamic RSC responses cannot be cached, even if they're
1673
+ // configured with `force-static` because we have no way of
1674
+ // distinguishing between `force-static` and pages that have no
1675
+ // postponed state.
1676
+ // TODO: distinguish `force-static` from pages with no postponed state (static)
1677
+ cacheControl: isDynamicRSCRequest ? {
1678
+ revalidate: 0,
1679
+ expire: undefined
1680
+ } : cacheEntry.cacheControl
1681
+ });
1682
+ }
1683
+ // As this isn't a prefetch request, we should serve the static flight
1684
+ // data.
1685
+ return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({
1686
+ req,
1687
+ res,
1688
+ generateEtags: nextConfig.generateEtags,
1689
+ poweredByHeader: nextConfig.poweredByHeader,
1690
+ result: next_dist_server_render_result__WEBPACK_IMPORTED_MODULE_20__["default"].fromStatic(cachedData.rscData, next_dist_client_components_app_router_headers__WEBPACK_IMPORTED_MODULE_16__.RSC_CONTENT_TYPE_HEADER),
1691
+ cacheControl: cacheEntry.cacheControl
1692
+ });
1693
+ }
1694
+ // This is a request for HTML data.
1695
+ let body = cachedData.html;
1696
+ // If there's no postponed state, we should just serve the HTML. This
1697
+ // should also be the case for a resume request because it's completed
1698
+ // as a server render (rather than a static render).
1699
+ if (!didPostpone || minimalMode || isRSCRequest) {
1700
+ // If we're in test mode, we should add a sentinel chunk to the response
1701
+ // that's between the static and dynamic parts so we can compare the
1702
+ // chunks and add assertions.
1703
+ if (false) {}
1704
+ return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({
1705
+ req,
1706
+ res,
1707
+ generateEtags: nextConfig.generateEtags,
1708
+ poweredByHeader: nextConfig.poweredByHeader,
1709
+ result: body,
1710
+ cacheControl: cacheEntry.cacheControl
1711
+ });
1712
+ }
1713
+ // If we're debugging the static shell or the dynamic API accesses, we
1714
+ // should just serve the HTML without resuming the render. The returned
1715
+ // HTML will be the static shell so all the Dynamic API's will be used
1716
+ // during static generation.
1717
+ if (isDebugStaticShell || isDebugDynamicAccesses) {
1718
+ // Since we're not resuming the render, we need to at least add the
1719
+ // closing body and html tags to create valid HTML.
1720
+ body.push(new ReadableStream({
1721
+ start (controller) {
1722
+ controller.enqueue(next_dist_server_stream_utils_encoded_tags__WEBPACK_IMPORTED_MODULE_22__.ENCODED_TAGS.CLOSED.BODY_AND_HTML);
1723
+ controller.close();
1724
+ }
1725
+ }));
1726
+ return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({
1727
+ req,
1728
+ res,
1729
+ generateEtags: nextConfig.generateEtags,
1730
+ poweredByHeader: nextConfig.poweredByHeader,
1731
+ result: body,
1732
+ cacheControl: {
1733
+ revalidate: 0,
1734
+ expire: undefined
1735
+ }
1736
+ });
1737
+ }
1738
+ // If we're in test mode, we should add a sentinel chunk to the response
1739
+ // that's between the static and dynamic parts so we can compare the
1740
+ // chunks and add assertions.
1741
+ if (false) {}
1742
+ // This request has postponed, so let's create a new transformer that the
1743
+ // dynamic data can pipe to that will attach the dynamic data to the end
1744
+ // of the response.
1745
+ const transformer = new TransformStream();
1746
+ body.push(transformer.readable);
1747
+ // Perform the render again, but this time, provide the postponed state.
1748
+ // We don't await because we want the result to start streaming now, and
1749
+ // we've already chained the transformer's readable to the render result.
1750
+ doRender({
1751
+ span,
1752
+ postponed: cachedData.postponed,
1753
+ // This is a resume render, not a fallback render, so we don't need to
1754
+ // set this.
1755
+ fallbackRouteParams: null
1756
+ }).then(async (result)=>{
1757
+ var _result_value;
1758
+ if (!result) {
1759
+ throw Object.defineProperty(new Error('Invariant: expected a result to be returned'), "__NEXT_ERROR_CODE", {
1760
+ value: "E463",
1761
+ enumerable: false,
1762
+ configurable: true
1763
+ });
1764
+ }
1765
+ if (((_result_value = result.value) == null ? void 0 : _result_value.kind) !== next_dist_server_response_cache__WEBPACK_IMPORTED_MODULE_18__.CachedRouteKind.APP_PAGE) {
1766
+ var _result_value1;
1767
+ throw Object.defineProperty(new Error(`Invariant: expected a page response, got ${(_result_value1 = result.value) == null ? void 0 : _result_value1.kind}`), "__NEXT_ERROR_CODE", {
1768
+ value: "E305",
1769
+ enumerable: false,
1770
+ configurable: true
1771
+ });
1772
+ }
1773
+ // Pipe the resume result to the transformer.
1774
+ await result.value.html.pipeTo(transformer.writable);
1775
+ }).catch((err)=>{
1776
+ // An error occurred during piping or preparing the render, abort
1777
+ // the transformers writer so we can terminate the stream.
1778
+ transformer.writable.abort(err).catch((e)=>{
1779
+ console.error("couldn't abort transformer", e);
1780
+ });
1781
+ });
1782
+ return (0,next_dist_server_send_payload__WEBPACK_IMPORTED_MODULE_23__.sendRenderResult)({
1783
+ req,
1784
+ res,
1785
+ generateEtags: nextConfig.generateEtags,
1786
+ poweredByHeader: nextConfig.poweredByHeader,
1787
+ result: body,
1788
+ // We don't want to cache the response if it has postponed data because
1789
+ // the response being sent to the client it's dynamic parts are streamed
1790
+ // to the client on the same request.
1791
+ cacheControl: {
1792
+ revalidate: 0,
1793
+ expire: undefined
1794
+ }
1795
+ });
1796
+ };
1797
+ // TODO: activeSpan code path is for when wrapped by
1798
+ // next-server can be removed when this is no longer used
1799
+ if (activeSpan) {
1800
+ await handleResponse(activeSpan);
1801
+ } else {
1802
+ return await tracer.withPropagatedContext(req.headers, ()=>tracer.trace(next_dist_server_lib_trace_constants__WEBPACK_IMPORTED_MODULE_5__.BaseServerSpan.handleRequest, {
1803
+ spanName: `${method} ${req.url}`,
1804
+ kind: next_dist_server_lib_trace_tracer__WEBPACK_IMPORTED_MODULE_3__.SpanKind.SERVER,
1805
+ attributes: {
1806
+ 'http.method': method,
1807
+ 'http.target': req.url
1808
+ }
1809
+ }, handleResponse));
1810
+ }
1811
+ } catch (err) {
1812
+ if (!(err instanceof next_dist_shared_lib_no_fallback_error_external__WEBPACK_IMPORTED_MODULE_24__.NoFallbackError)) {
1813
+ await routeModule.onRequestError(req, err, {
1814
+ routerKind: 'App Router',
1815
+ routePath: srcPage,
1816
+ routeType: 'render',
1817
+ revalidateReason: (0,next_dist_server_instrumentation_utils__WEBPACK_IMPORTED_MODULE_2__/* .getRevalidateReason */ .c)({
1818
+ isRevalidate: isSSG,
1819
+ isOnDemandRevalidate
1752
1820
  })
1753
- ]
1754
- })
1755
- });
1821
+ }, routerServerContext);
1822
+ }
1823
+ // rethrow so that we can handle serving error page
1824
+ throw err;
1825
+ }
1756
1826
  }
1757
-
1758
- ;// ./src/app/[locale]/know/resource/[id]/page.tsx
1759
- /* __next_internal_client_entry_do_not_use__ default auto */
1827
+ // TODO: omit this from production builds, only test builds should include it
1760
1828
  /**
1761
- * Resource Viewer Page - Minimal Next.js routing wrapper
1829
+ * Creates a readable stream that emits a PPR boundary sentinel.
1762
1830
  *
1763
- * Handles only Next.js routing and initial resource loading.
1764
- * All other concerns (data loading, events, UI state) are handled by ResourceViewerPage.
1765
- */
1766
-
1767
-
1768
-
1769
-
1770
-
1771
- // Feature components
1772
-
1773
-
1774
-
1775
-
1776
- /**
1777
- * Main page component - handles only routing and initial resource load
1778
- */ function KnowledgeResourcePage() {
1779
- const params = (0,navigation.useParams)();
1780
- const locale = (0,production_react/* useLocale */.Ym)();
1781
- // Construct resource URI from URL param
1782
- const initialUri = (0,core_dist/* resourceUri */.N)(`${ false ? 0 : 'http://localhost'}/resources/${params?.id}`);
1783
- // Load only the resource descriptor - everything else is loaded by ResourceViewerPage
1784
- const resources = (0,dist.useResources)();
1785
- const { data: docData, isLoading, isError, error, refetch: refetchDocument } = resources.get.useQuery(initialUri);
1786
- // Log error for debugging
1787
- process.env.__NEXT_PRIVATE_MINIMIZE_MACRO_FALSE && (0,react.useEffect)(()=>{
1788
- if (isError && !isLoading) {
1789
- console.error(`[Document] Failed to load resource ${initialUri}:`, error);
1831
+ * @returns A readable stream that emits a PPR boundary sentinel.
1832
+ */ function createPPRBoundarySentinel() {
1833
+ return new ReadableStream({
1834
+ start (controller) {
1835
+ controller.enqueue(new TextEncoder().encode('<!-- PPR_BOUNDARY_SENTINEL -->'));
1836
+ controller.close();
1790
1837
  }
1791
- }, [
1792
- isError,
1793
- isLoading,
1794
- initialUri,
1795
- error
1796
- ]);
1797
- // Early return: Loading state
1798
- if (isLoading || !docData) {
1799
- return /*#__PURE__*/ (0,react_jsx_runtime.jsx)(dist.ResourceLoadingState, {});
1800
- }
1801
- // Early return: Error state
1802
- if (isError) {
1803
- return /*#__PURE__*/ (0,react_jsx_runtime.jsx)(dist.ResourceErrorState, {
1804
- error: error,
1805
- onRetry: ()=>refetchDocument()
1806
- });
1807
- }
1808
- // Early return: ResourceDescriptor not found
1809
- if (!docData.resource) {
1810
- return /*#__PURE__*/ (0,react_jsx_runtime.jsx)(dist.ResourceErrorState, {
1811
- error: new Error('Resource not found'),
1812
- onRetry: ()=>refetchDocument()
1813
- });
1814
- }
1815
- const resource = docData.resource;
1816
- const canonicalUri = (0,core_dist/* resourceUri */.N)(resource['@id']);
1817
- // Warn if URI mismatch
1818
- if (canonicalUri !== initialUri) {
1819
- console.warn(`[Document] URI mismatch:\n` + ` Constructed: ${initialUri}\n` + ` Canonical: ${canonicalUri}\n` + `This may indicate environment misconfiguration.`);
1820
- }
1821
- // Render with minimal props - all data loading/events handled inside ResourceViewerPage
1822
- return /*#__PURE__*/ (0,react_jsx_runtime.jsx)(dist.ResourceViewerPage, {
1823
- resource: resource,
1824
- rUri: canonicalUri,
1825
- locale: locale,
1826
- Link: routing/* Link */.N,
1827
- routes: routing/* routes */.J,
1828
- ToolbarPanels: ToolbarPanels/* ToolbarPanels */.t,
1829
- SearchResourcesModal: SearchResourcesModal,
1830
- GenerationConfigModal: GenerationConfigModal,
1831
- refetchDocument: refetchDocument
1832
1838
  });
1833
1839
  }
1834
1840
 
1841
+ //# sourceMappingURL=app-page.js.map
1842
+
1835
1843
 
1836
1844
  /***/ }),
1837
1845
 
@@ -1843,7 +1851,7 @@ module.exports = require("next/dist/server/app-render/work-unit-async-storage.ex
1843
1851
 
1844
1852
  /***/ }),
1845
1853
 
1846
- /***/ 79293:
1854
+ /***/ 77446:
1847
1855
  /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
1848
1856
 
1849
1857
  Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 62459));
@@ -1857,14 +1865,6 @@ Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_re
1857
1865
  "use strict";
1858
1866
  module.exports = require("url");
1859
1867
 
1860
- /***/ }),
1861
-
1862
- /***/ 84029:
1863
- /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
1864
-
1865
- Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 37103));
1866
-
1867
-
1868
1868
  /***/ }),
1869
1869
 
1870
1870
  /***/ 86439:
@@ -1882,7 +1882,7 @@ module.exports = require("next/dist/shared/lib/no-fallback-error.external");
1882
1882
  var __webpack_require__ = require("../../../../../webpack-runtime.js");
1883
1883
  __webpack_require__.C(exports);
1884
1884
  var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
1885
- var __webpack_exports__ = __webpack_require__.X(0, [4725,1854,1940,1037,4729,3832,7912,255,580,5137], () => (__webpack_exec__(6804)));
1885
+ var __webpack_exports__ = __webpack_require__.X(0, [4725,1854,1940,1037,4729,3832,7912,8387,580,5015], () => (__webpack_exec__(62893)));
1886
1886
  module.exports = __webpack_exports__;
1887
1887
 
1888
1888
  })();