@surething/cockpit 1.0.227 → 1.0.229

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 (205) hide show
  1. package/.next-prod/BUILD_ID +1 -1
  2. package/.next-prod/app-path-routes-manifest.json +1 -1
  3. package/.next-prod/build-manifest.json +3 -3
  4. package/.next-prod/prerender-manifest.json +3 -3
  5. package/.next-prod/react-loadable-manifest.json +1 -1
  6. package/.next-prod/server/app/_global-error/page.js.nft.json +1 -1
  7. package/.next-prod/server/app/_global-error/page_client-reference-manifest.js +1 -1
  8. package/.next-prod/server/app/_global-error.html +1 -1
  9. package/.next-prod/server/app/_global-error.rsc +1 -1
  10. package/.next-prod/server/app/_global-error.segments/_full.segment.rsc +1 -1
  11. package/.next-prod/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  12. package/.next-prod/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  13. package/.next-prod/server/app/_global-error.segments/_head.segment.rsc +1 -1
  14. package/.next-prod/server/app/_global-error.segments/_index.segment.rsc +1 -1
  15. package/.next-prod/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  16. package/.next-prod/server/app/_not-found/page.js +1 -1
  17. package/.next-prod/server/app/_not-found/page.js.nft.json +1 -1
  18. package/.next-prod/server/app/_not-found/page_client-reference-manifest.js +1 -1
  19. package/.next-prod/server/app/_not-found.html +2 -2
  20. package/.next-prod/server/app/_not-found.rsc +3 -3
  21. package/.next-prod/server/app/_not-found.segments/_full.segment.rsc +3 -3
  22. package/.next-prod/server/app/_not-found.segments/_head.segment.rsc +1 -1
  23. package/.next-prod/server/app/_not-found.segments/_index.segment.rsc +3 -3
  24. package/.next-prod/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  25. package/.next-prod/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  26. package/.next-prod/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  27. package/.next-prod/server/app/api/agent/test/route.js.nft.json +1 -1
  28. package/.next-prod/server/app/api/bash/route.js.nft.json +1 -1
  29. package/.next-prod/server/app/api/chat/codex/route.js.nft.json +1 -1
  30. package/.next-prod/server/app/api/chat/deepseek/route.js.nft.json +1 -1
  31. package/.next-prod/server/app/api/chat/kimi/route.js.nft.json +1 -1
  32. package/.next-prod/server/app/api/chat/ollama/route.js.nft.json +1 -1
  33. package/.next-prod/server/app/api/chat/pty-input/route.js.nft.json +1 -1
  34. package/.next-prod/server/app/api/chat/route.js.nft.json +1 -1
  35. package/.next-prod/server/app/api/chat/stop/route.js.nft.json +1 -1
  36. package/.next-prod/server/app/api/claude-stats/route.js.nft.json +1 -1
  37. package/.next-prod/server/app/api/commands/route.js.nft.json +1 -1
  38. package/.next-prod/server/app/api/comments/route.js.nft.json +1 -1
  39. package/.next-prod/server/app/api/db/columns/route.js.nft.json +1 -1
  40. package/.next-prod/server/app/api/db/connect/route.js.nft.json +1 -1
  41. package/.next-prod/server/app/api/db/disconnect/route.js.nft.json +1 -1
  42. package/.next-prod/server/app/api/db/export/route.js.nft.json +1 -1
  43. package/.next-prod/server/app/api/db/query/route.js.nft.json +1 -1
  44. package/.next-prod/server/app/api/db/schemas/route.js.nft.json +1 -1
  45. package/.next-prod/server/app/api/dev/spans/route.js.nft.json +1 -1
  46. package/.next-prod/server/app/api/extension/version/route.js.nft.json +1 -1
  47. package/.next-prod/server/app/api/file/route.js.nft.json +1 -1
  48. package/.next-prod/server/app/api/files/blame/route.js.nft.json +1 -1
  49. package/.next-prod/server/app/api/files/clipboard/route.js.nft.json +1 -1
  50. package/.next-prod/server/app/api/files/copy/route.js.nft.json +1 -1
  51. package/.next-prod/server/app/api/files/delete/route.js.nft.json +1 -1
  52. package/.next-prod/server/app/api/files/expanded/route.js.nft.json +1 -1
  53. package/.next-prod/server/app/api/files/index/route.js.nft.json +1 -1
  54. package/.next-prod/server/app/api/files/init/route.js.nft.json +1 -1
  55. package/.next-prod/server/app/api/files/paste/route.js.nft.json +1 -1
  56. package/.next-prod/server/app/api/files/read/route.js.nft.json +1 -1
  57. package/.next-prod/server/app/api/files/readdir/route.js.nft.json +1 -1
  58. package/.next-prod/server/app/api/files/recent/route.js.nft.json +1 -1
  59. package/.next-prod/server/app/api/files/save/route.js.nft.json +1 -1
  60. package/.next-prod/server/app/api/files/search/route.js.nft.json +1 -1
  61. package/.next-prod/server/app/api/files/stat/route.js.nft.json +1 -1
  62. package/.next-prod/server/app/api/files/text/route.js.nft.json +1 -1
  63. package/.next-prod/server/app/api/git/branch-diff/route.js.nft.json +1 -1
  64. package/.next-prod/server/app/api/git/branches/route.js.nft.json +1 -1
  65. package/.next-prod/server/app/api/git/commit-diff/route.js.nft.json +1 -1
  66. package/.next-prod/server/app/api/git/commits/route.js.nft.json +1 -1
  67. package/.next-prod/server/app/api/git/current-branch/route.js.nft.json +1 -1
  68. package/.next-prod/server/app/api/git/diff/route.js.nft.json +1 -1
  69. package/.next-prod/server/app/api/git/discard/route.js.nft.json +1 -1
  70. package/.next-prod/server/app/api/git/stage/route.js.nft.json +1 -1
  71. package/.next-prod/server/app/api/git/status/route.js.nft.json +1 -1
  72. package/.next-prod/server/app/api/git/unstage/route.js.nft.json +1 -1
  73. package/.next-prod/server/app/api/git/worktree/route.js.nft.json +1 -1
  74. package/.next-prod/server/app/api/global-state/route.js +1 -1
  75. package/.next-prod/server/app/api/global-state/route.js.nft.json +1 -1
  76. package/.next-prod/server/app/api/health/route.js.nft.json +1 -1
  77. package/.next-prod/server/app/api/jupyter/load/route.js.nft.json +1 -1
  78. package/.next-prod/server/app/api/jupyter/save/route.js.nft.json +1 -1
  79. package/.next-prod/server/app/api/jupyter/shutdown/route.js.nft.json +1 -1
  80. package/.next-prod/server/app/api/lsp/definition/route.js.nft.json +1 -1
  81. package/.next-prod/server/app/api/lsp/hover/route.js.nft.json +1 -1
  82. package/.next-prod/server/app/api/lsp/references/route.js.nft.json +1 -1
  83. package/.next-prod/server/app/api/lsp/status/route.js.nft.json +1 -1
  84. package/.next-prod/server/app/api/lsp/warmup/route.js.nft.json +1 -1
  85. package/.next-prod/server/app/api/mysql/columns/route.js.nft.json +1 -1
  86. package/.next-prod/server/app/api/mysql/connect/route.js.nft.json +1 -1
  87. package/.next-prod/server/app/api/mysql/disconnect/route.js.nft.json +1 -1
  88. package/.next-prod/server/app/api/mysql/export/route.js.nft.json +1 -1
  89. package/.next-prod/server/app/api/mysql/query/route.js.nft.json +1 -1
  90. package/.next-prod/server/app/api/mysql/schemas/route.js.nft.json +1 -1
  91. package/.next-prod/server/app/api/neo4j/connect/route.js.nft.json +1 -1
  92. package/.next-prod/server/app/api/neo4j/disconnect/route.js.nft.json +1 -1
  93. package/.next-prod/server/app/api/neo4j/query/route.js.nft.json +1 -1
  94. package/.next-prod/server/app/api/neo4j/schema/route.js.nft.json +1 -1
  95. package/.next-prod/server/app/api/note/route.js.nft.json +1 -1
  96. package/.next-prod/server/app/api/ollama/models/route.js.nft.json +1 -1
  97. package/.next-prod/server/app/api/ollama/start/route.js.nft.json +1 -1
  98. package/.next-prod/server/app/api/open-cursor/route.js.nft.json +1 -1
  99. package/.next-prod/server/app/api/open-vscode/route.js.nft.json +1 -1
  100. package/.next-prod/server/app/api/pick-folder/route.js.nft.json +1 -1
  101. package/.next-prod/server/app/api/pinned-sessions/route.js.nft.json +1 -1
  102. package/.next-prod/server/app/api/project-settings/route.js.nft.json +1 -1
  103. package/.next-prod/server/app/api/project-state/route.js.nft.json +1 -1
  104. package/.next-prod/server/app/api/projectGraph/affected/route.js.nft.json +1 -1
  105. package/.next-prod/server/app/api/projectGraph/callees/route.js.nft.json +1 -1
  106. package/.next-prod/server/app/api/projectGraph/callers/route.js.nft.json +1 -1
  107. package/.next-prod/server/app/api/projectGraph/coedit/route.js.nft.json +1 -1
  108. package/.next-prod/server/app/api/projectGraph/context/route.js.nft.json +1 -1
  109. package/.next-prod/server/app/api/projectGraph/file/route.js.nft.json +1 -1
  110. package/.next-prod/server/app/api/projectGraph/file-functions/route.js.nft.json +1 -1
  111. package/.next-prod/server/app/api/projectGraph/impact/route.js.nft.json +1 -1
  112. package/.next-prod/server/app/api/projectGraph/related/route.js.nft.json +1 -1
  113. package/.next-prod/server/app/api/projectGraph/risk/route.js.nft.json +1 -1
  114. package/.next-prod/server/app/api/projectGraph/search/route.js.nft.json +1 -1
  115. package/.next-prod/server/app/api/projects/route.js.nft.json +1 -1
  116. package/.next-prod/server/app/api/push/public-key/route.js.nft.json +1 -1
  117. package/.next-prod/server/app/api/push/subscribe/route.js.nft.json +1 -1
  118. package/.next-prod/server/app/api/push/unsubscribe/route.js.nft.json +1 -1
  119. package/.next-prod/server/app/api/redis/command/route.js.nft.json +1 -1
  120. package/.next-prod/server/app/api/redis/connect/route.js.nft.json +1 -1
  121. package/.next-prod/server/app/api/redis/delete/route.js.nft.json +1 -1
  122. package/.next-prod/server/app/api/redis/disconnect/route.js.nft.json +1 -1
  123. package/.next-prod/server/app/api/redis/get/route.js.nft.json +1 -1
  124. package/.next-prod/server/app/api/redis/keys/route.js.nft.json +1 -1
  125. package/.next-prod/server/app/api/redis/set/route.js.nft.json +1 -1
  126. package/.next-prod/server/app/api/review/[id]/comments/route.js.nft.json +1 -1
  127. package/.next-prod/server/app/api/review/[id]/replies/route.js.nft.json +1 -1
  128. package/.next-prod/server/app/api/review/[id]/route.js.nft.json +1 -1
  129. package/.next-prod/server/app/api/review/identify/route.js.nft.json +1 -1
  130. package/.next-prod/server/app/api/review/order/route.js.nft.json +1 -1
  131. package/.next-prod/server/app/api/review/route.js.nft.json +1 -1
  132. package/.next-prod/server/app/api/review/share-info/route.js.nft.json +1 -1
  133. package/.next-prod/server/app/api/review/users/route.js.nft.json +1 -1
  134. package/.next-prod/server/app/api/scheduled-tasks/route.js.nft.json +1 -1
  135. package/.next-prod/server/app/api/services/config/route.js.nft.json +1 -1
  136. package/.next-prod/server/app/api/services/scripts/route.js.nft.json +1 -1
  137. package/.next-prod/server/app/api/session/[sessionId]/fork/route.js.nft.json +1 -1
  138. package/.next-prod/server/app/api/session/[sessionId]/history/route.js.nft.json +1 -1
  139. package/.next-prod/server/app/api/session-by-path/route.js.nft.json +1 -1
  140. package/.next-prod/server/app/api/sessions/projects/[encodedPath]/route.js.nft.json +1 -1
  141. package/.next-prod/server/app/api/sessions/projects/route.js.nft.json +1 -1
  142. package/.next-prod/server/app/api/sessions/route.js.nft.json +1 -1
  143. package/.next-prod/server/app/api/settings/route.js.nft.json +1 -1
  144. package/.next-prod/server/app/api/skills/[id]/route.js.nft.json +1 -1
  145. package/.next-prod/server/app/api/skills/content/route.js.nft.json +1 -1
  146. package/.next-prod/server/app/api/skills/route.js.nft.json +1 -1
  147. package/.next-prod/server/app/api/terminal/aliases/route.js.nft.json +1 -1
  148. package/.next-prod/server/app/api/terminal/autocomplete/route.js.nft.json +1 -1
  149. package/.next-prod/server/app/api/terminal/bubble-order/route.js.nft.json +1 -1
  150. package/.next-prod/server/app/api/terminal/env/route.js.nft.json +1 -1
  151. package/.next-prod/server/app/api/terminal/history/route.js +1 -1
  152. package/.next-prod/server/app/api/terminal/history/route.js.nft.json +1 -1
  153. package/.next-prod/server/app/api/version/route.js.nft.json +1 -1
  154. package/.next-prod/server/app/favicon.ico/route.js.nft.json +1 -1
  155. package/.next-prod/server/app/m/page.js +1 -1
  156. package/.next-prod/server/app/m/page.js.nft.json +1 -1
  157. package/.next-prod/server/app/m/page_client-reference-manifest.js +1 -1
  158. package/.next-prod/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  159. package/.next-prod/server/app/page.js +1 -1
  160. package/.next-prod/server/app/page.js.nft.json +1 -1
  161. package/.next-prod/server/app/page_client-reference-manifest.js +1 -1
  162. package/.next-prod/server/app/project/page.js +1 -1
  163. package/.next-prod/server/app/project/page.js.nft.json +1 -1
  164. package/.next-prod/server/app/project/page_client-reference-manifest.js +1 -1
  165. package/.next-prod/server/app/review/[id]/page.js +2 -2
  166. package/.next-prod/server/app/review/[id]/page.js.nft.json +1 -1
  167. package/.next-prod/server/app/review/[id]/page_client-reference-manifest.js +1 -1
  168. package/.next-prod/server/app-paths-manifest.json +1 -1
  169. package/.next-prod/server/chunks/3633.js +1 -1
  170. package/.next-prod/server/chunks/{5337.js → 4257.js} +3 -3
  171. package/.next-prod/server/chunks/8916.js +1 -1
  172. package/.next-prod/server/chunks/9658.js +5 -5
  173. package/.next-prod/server/middleware-build-manifest.js +1 -1
  174. package/.next-prod/server/middleware-react-loadable-manifest.js +1 -1
  175. package/.next-prod/server/pages/404.html +2 -2
  176. package/.next-prod/server/pages/500.html +1 -1
  177. package/.next-prod/server/server-reference-manifest.json +1 -1
  178. package/.next-prod/static/chunks/{217-259a6d7d3cac75d8.js → 217-d644348194c14361.js} +2 -2
  179. package/.next-prod/static/chunks/{2576-26748a4d5cfa8668.js → 2576-49c4aeffa6a6b95e.js} +8 -8
  180. package/.next-prod/static/chunks/{327-9ffab8f0b2b0b4cd.js → 2625-bc4748f0cd7db618.js} +10 -10
  181. package/.next-prod/static/chunks/327.8ecab0b86d52b597.js +1 -0
  182. package/.next-prod/static/chunks/{471-7c4fab47613ffe5c.js → 471-504b396c8302f4f2.js} +1 -1
  183. package/.next-prod/static/chunks/6784-b644510a0e060aac.js +0 -0
  184. package/.next-prod/static/chunks/app/{layout-edef27fb2f6b346e.js → layout-03c738d41e660f72.js} +1 -1
  185. package/.next-prod/static/chunks/app/m/{page-50afaa8bd837e768.js → page-8b1af6f31b60c485.js} +1 -1
  186. package/.next-prod/static/chunks/app/{page-49470b6c107b5dee.js → page-677439ad5fd63732.js} +1 -1
  187. package/.next-prod/static/chunks/app/project/{page-49470b6c107b5dee.js → page-677439ad5fd63732.js} +1 -1
  188. package/.next-prod/static/chunks/app/review/[id]/{page-31d70fd518d4c7e6.js → page-39fa3a843adf617e.js} +1 -1
  189. package/.next-prod/static/chunks/webpack-dbba7fa77ee1faa4.js +1 -0
  190. package/.next-prod/static/css/1d4a0de85e617fe5.css +1 -0
  191. package/.next-prod/trace +13 -13
  192. package/.next-prod/trace-build +1 -1
  193. package/dist/{chunk-R564FMS3.mjs → chunk-RJMSCVG5.mjs} +31 -0
  194. package/dist/{chunk-J5B4FIW5.mjs → chunk-XW5CKMXI.mjs} +7 -2
  195. package/dist/httpApi.mjs +1 -1
  196. package/dist/scheduledTasks.mjs +1 -1
  197. package/dist/{server-J7ZUYRI6.mjs → server-K4DO2GUO.mjs} +3 -1
  198. package/dist/wsServer.mjs +3 -3
  199. package/package.json +4 -1
  200. package/.next-prod/static/chunks/2708.7263182a029113c8.js +0 -1
  201. package/.next-prod/static/chunks/9469-7902249e8fbf7955.js +0 -14
  202. package/.next-prod/static/chunks/webpack-2404d47da29b5b14.js +0 -1
  203. package/.next-prod/static/css/330d330a9236397f.css +0 -1
  204. /package/.next-prod/static/{t45T3Imr0gQh7MYDeURiy → fLCxsDN9EciQYDYw-OdS3}/_buildManifest.js +0 -0
  205. /package/.next-prod/static/{t45T3Imr0gQh7MYDeURiy → fLCxsDN9EciQYDYw-OdS3}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{7815:e=>{e.exports={style:{fontFamily:"'Lora', 'Lora Fallback'",fontStyle:"normal"},className:"__className_c1a059",variable:"__variable_c1a059"}},36791:e=>{e.exports={style:{fontFamily:"'Inter', 'Inter Fallback'",fontStyle:"normal"},className:"__className_f367f3",variable:"__variable_f367f3"}},51743:()=>{},66924:e=>{e.exports={style:{fontFamily:"'JetBrains Mono', 'JetBrains Mono Fallback'",fontStyle:"normal"},className:"__className_3c557b",variable:"__variable_3c557b"}},86343:(e,s,o)=>{Promise.resolve().then(o.t.bind(o,36791,23)),Promise.resolve().then(o.t.bind(o,7815,23)),Promise.resolve().then(o.t.bind(o,66924,23)),Promise.resolve().then(o.bind(o,76288)),Promise.resolve().then(o.bind(o,47617)),Promise.resolve().then(o.bind(o,8648)),Promise.resolve().then(o.bind(o,76043)),Promise.resolve().then(o.bind(o,2228)),Promise.resolve().then(o.bind(o,32460)),Promise.resolve().then(o.bind(o,84310)),Promise.resolve().then(o.bind(o,83678)),Promise.resolve().then(o.bind(o,21484)),Promise.resolve().then(o.bind(o,24058)),Promise.resolve().then(o.bind(o,1700)),Promise.resolve().then(o.bind(o,76412)),Promise.resolve().then(o.bind(o,89039)),Promise.resolve().then(o.bind(o,63048)),Promise.resolve().then(o.t.bind(o,51743,23))}},e=>{e.O(0,[8225,8653,3334,7330,8216,4281,3888,5004,277,327,471,9428,9469,217,2032,2576,8441,3794,7358],()=>e(e.s=86343)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{7815:e=>{e.exports={style:{fontFamily:"'Lora', 'Lora Fallback'",fontStyle:"normal"},className:"__className_c1a059",variable:"__variable_c1a059"}},36791:e=>{e.exports={style:{fontFamily:"'Inter', 'Inter Fallback'",fontStyle:"normal"},className:"__className_f367f3",variable:"__variable_f367f3"}},51743:()=>{},66924:e=>{e.exports={style:{fontFamily:"'JetBrains Mono', 'JetBrains Mono Fallback'",fontStyle:"normal"},className:"__className_3c557b",variable:"__variable_3c557b"}},86343:(e,s,o)=>{Promise.resolve().then(o.t.bind(o,36791,23)),Promise.resolve().then(o.t.bind(o,7815,23)),Promise.resolve().then(o.t.bind(o,66924,23)),Promise.resolve().then(o.bind(o,76288)),Promise.resolve().then(o.bind(o,47617)),Promise.resolve().then(o.bind(o,8648)),Promise.resolve().then(o.bind(o,76043)),Promise.resolve().then(o.bind(o,2228)),Promise.resolve().then(o.bind(o,42701)),Promise.resolve().then(o.bind(o,84310)),Promise.resolve().then(o.bind(o,83678)),Promise.resolve().then(o.bind(o,21484)),Promise.resolve().then(o.bind(o,24058)),Promise.resolve().then(o.bind(o,1700)),Promise.resolve().then(o.bind(o,76412)),Promise.resolve().then(o.bind(o,89039)),Promise.resolve().then(o.bind(o,63048)),Promise.resolve().then(o.t.bind(o,51743,23))}},e=>{e.O(0,[8225,8653,3334,7330,8216,4281,3888,5004,277,2625,471,9428,6784,217,2032,2576,8441,3794,7358],()=>e(e.s=86343)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4302],{12550:(e,t,s)=>{Promise.resolve().then(s.bind(s,69234))},69234:(e,t,s)=>{"use strict";s.d(t,{default:()=>R});var n=s(95155),a=s(12115),r=s(79114),i=s(90425);let l=(0,i.A)("bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]),o=(0,i.A)("bell-off",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742",key:"178tsu"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05",key:"1hqiys"}]]),c=(0,i.A)("pin",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]);var d=s(2111),u=s(3292),h=s(34075),f=s(69809);let m="/push-sw.js";function x({onOpen:e,onUseDesktop:t}){let{t:s}=(0,r.Bd)(),[i,p]=(0,a.useState)("recent"),[g,v]=(0,a.useState)([]),[w,y]=(0,a.useState)(()=>Date.now()),{pinnedSessions:k}=(0,u.P)(),{supported:j,isSubscribed:N,busy:S,subscribe:C,unsubscribe:M}=function(){let[e,t]=(0,a.useState)(!1),[s,n]=(0,a.useState)("default"),[r,i]=(0,a.useState)(!1),[l,o]=(0,a.useState)(!1);(0,a.useEffect)(()=>{let e="serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window;(t(e),e)?(n(Notification.permission),navigator.serviceWorker.getRegistration(m).then(e=>e?.pushManager.getSubscription()).then(e=>i(!!e)).catch(()=>{})):n("unsupported")},[]);let c=(0,a.useCallback)(async()=>{if(e&&!l){o(!0);try{let e=await Notification.requestPermission();if(n(e),"granted"!==e)return;let t=await navigator.serviceWorker.register(m);await navigator.serviceWorker.ready;let s=await fetch("/api/push/public-key");if(!s.ok)throw Error(`public-key HTTP ${s.status}`);let{publicKey:a}=await s.json();if(!a)throw Error("missing VAPID public key");let r=await t.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:function(e){let t="=".repeat((4-e.length%4)%4),s=atob((e+t).replace(/-/g,"+").replace(/_/g,"/")),n=new Uint8Array(s.length);for(let e=0;e<s.length;e++)n[e]=s.charCodeAt(e);return n}(a)}),l=await fetch("/api/push/subscribe",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({subscription:r})});if(!l.ok)throw Error(`subscribe HTTP ${l.status}`);i(!0)}catch(e){console.error("push subscribe failed",e),(0,h.oR)(f.A.t("mobile.notifyError",{defaultValue:"Could not enable notifications"}),"error")}finally{o(!1)}}},[e,l]),d=(0,a.useCallback)(async()=>{if(e&&!l){o(!0);try{let e=await navigator.serviceWorker.getRegistration(m),t=await e?.pushManager.getSubscription();t&&(await fetch("/api/push/unsubscribe",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({endpoint:t.endpoint})}),await t.unsubscribe()),i(!1)}catch(e){console.error("push unsubscribe failed",e)}finally{o(!1)}}},[e,l]);return{supported:e,permission:s,isSubscribed:r,busy:l,subscribe:c,unsubscribe:d}}(),E=(0,a.useCallback)(e=>{"task-fired"===e.type||e.data&&(v(e.data.sessions||[]),y(Date.now()))},[]);(0,d.h)({url:"/ws/global-state",onMessage:E});let A=(0,a.useCallback)(e=>{let t=Math.floor((w-e)/6e4);if(t<1)return s("common.justNow");if(t<60)return s("common.minutesAgo",{count:t});let n=Math.floor(t/60);return n<24?s("common.hoursAgo",{count:n}):s("common.daysAgo",{count:Math.floor(n/24)})},[w,s]),I=e=>e.split("/").pop()||e,R=g.filter(e=>"loading"===e.status).length,L=(e,t)=>(0,n.jsx)("button",{type:"button",onClick:()=>p(e),className:`flex-1 rounded-md py-1.5 text-sm font-medium transition-colors ${i===e?"bg-card text-foreground shadow-sm":"text-muted-foreground"}`,children:t});return(0,n.jsxs)("div",{className:"flex h-[100dvh] flex-col bg-card",children:[(0,n.jsxs)("div",{className:"flex flex-shrink-0 items-center gap-3 border-b border-border px-3 py-2.5 pt-[max(0.625rem,env(safe-area-inset-top))]",children:[(0,n.jsxs)("div",{className:"flex flex-1 items-center gap-1 rounded-lg bg-accent p-0.5",children:[L("recent",s("sessions.recentSessions")),L("pinned",s("sessions.pinnedSessions"))]}),j&&(0,n.jsx)("button",{type:"button",onClick:N?M:C,disabled:S,"aria-label":N?s("mobile.disableNotifications",{defaultValue:"Disable notifications"}):s("mobile.enableNotifications",{defaultValue:"Enable notifications"}),className:`flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-lg active:bg-accent disabled:opacity-40 ${N?"text-brand":"text-muted-foreground"}`,children:N?(0,n.jsx)(l,{className:"h-4 w-4"}):(0,n.jsx)(o,{className:"h-4 w-4"})}),(0,n.jsx)("button",{type:"button",onClick:t,className:"flex-shrink-0 rounded-lg px-2 py-1 text-xs text-muted-foreground active:bg-accent",children:s("mobile.useDesktop")})]}),"recent"===i&&R>0&&(0,n.jsx)("div",{className:"flex-shrink-0 border-b border-border/50 px-4 py-1.5 text-xs text-orange-11",children:s("sessions.runningCount",{count:R})}),(0,n.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto",children:"recent"===i?0===g.length?(0,n.jsx)(b,{text:s("sessions.noSessions")}):g.map(t=>(0,n.jsxs)("button",{onClick:()=>e({cwd:t.cwd,sessionId:t.sessionId,title:t.title}),className:"flex w-full items-start gap-3 border-b border-border/50 px-4 py-3.5 text-left active:bg-accent",children:[(0,n.jsx)("span",{className:`mt-1.5 h-2.5 w-2.5 flex-shrink-0 rounded-full ${"loading"===t.status?"animate-pulse bg-orange-9":"unread"===t.status?"bg-red-500":"bg-muted-foreground/30"}`}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{className:"truncate text-sm font-medium",children:I(t.cwd)}),"loading"===t.status&&(0,n.jsx)("span",{className:"flex-shrink-0 text-xs text-orange-11",children:s("sessions.running")}),"unread"===t.status&&(0,n.jsx)("span",{className:"flex-shrink-0 text-xs text-red-500",children:s("sessions.done")}),(0,n.jsx)("span",{className:"ml-auto flex-shrink-0 text-xs text-muted-foreground",children:A(t.lastActive)})]}),(t.lastUserMessage||t.title)&&(0,n.jsx)("div",{className:"mt-0.5 truncate text-xs text-foreground/70",children:t.lastUserMessage||t.title})]})]},`${t.cwd}-${t.sessionId}`)):0===k.length?(0,n.jsx)(b,{text:s("sessions.noPinnedSessions")}):k.map(t=>(0,n.jsxs)("button",{onClick:()=>e({cwd:t.cwd,sessionId:t.sessionId,title:t.customTitle}),className:"flex w-full items-start gap-3 border-b border-border/50 px-4 py-3.5 text-left active:bg-accent",children:[(0,n.jsx)(c,{className:"mt-0.5 h-4 w-4 flex-shrink-0 text-brand"}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsx)("div",{className:"truncate text-sm font-medium",children:t.customTitle||I(t.cwd)}),(0,n.jsx)("div",{className:"truncate text-xs text-muted-foreground",children:I(t.cwd)})]})]},`${t.cwd}-${t.sessionId}`))})]})}function b({text:e}){return(0,n.jsx)("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:e})}let p=(0,i.A)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);var g=s(49433),v=s(86957),w=s(82680),y=s(85839),k=s(20917),j=s(65153),N=s(8988),S=s(36201),C=s(56204);function M({onSend:e,onStop:t,isRunning:s,disabled:i}){let{t:l}=(0,r.Bd)(),[o,c]=(0,a.useState)(""),d=(0,a.useRef)(null);(0,a.useLayoutEffect)(()=>{let e=d.current;e&&(e.style.height="auto",e.style.height=`${Math.min(e.scrollHeight,140)}px`)},[o]);let u=(0,a.useCallback)(()=>{let t=o.trim();t&&!i&&(e(t),c(""))},[o,i,e]),h=(0,a.useCallback)(e=>{"Enter"===e.key&&(e.metaKey||e.ctrlKey)&&!e.nativeEvent.isComposing&&(e.preventDefault(),u())},[u]);return(0,n.jsxs)("div",{className:"flex items-end gap-2 border-t border-border bg-card px-3 py-2 pb-[max(0.5rem,env(safe-area-inset-bottom))]",children:[(0,n.jsx)("textarea",{ref:d,value:o,onChange:e=>c(e.target.value),onKeyDown:h,rows:1,placeholder:l("mobile.messagePlaceholder"),className:"flex-1 resize-none rounded-2xl border border-border bg-background px-4 py-2.5 text-base leading-snug outline-none focus:border-brand"}),s?(0,n.jsx)("button",{type:"button",onClick:t,"aria-label":l("mobile.stop"),className:"flex h-11 w-11 flex-shrink-0 items-center justify-center rounded-full bg-red-500 text-white active:scale-95",children:(0,n.jsx)(S.A,{className:"h-5 w-5",fill:"currentColor"})}):(0,n.jsx)("button",{type:"button",onClick:u,disabled:i||!o.trim(),"aria-label":l("mobile.send"),className:"flex h-11 w-11 flex-shrink-0 items-center justify-center rounded-full bg-brand text-white active:scale-95 disabled:opacity-40",children:(0,n.jsx)(C.A,{className:"h-5 w-5"})})]})}function E({cwd:e,initialSessionId:t,initialTitle:s,onBack:r,isActive:i=!0}){let[l,o]=(0,a.useState)([]),[c,d]=(0,a.useState)(null),[u,h]=(0,a.useState)(s??""),[f,m]=(0,a.useState)({}),x=(0,a.useRef)(null);(0,a.useEffect)(()=>{let s=g.tryPromise({try:async()=>{let t=await fetch(`/api/project-state?cwd=${encodeURIComponent(e)}`);return t.ok?await t.json():null},catch:e=>new w.uV({message:"loadProjectState failed",cause:e})});v.t4.runPromiseExit(s).then(e=>{if("Success"===e._tag&&e.value){let s=e.value;m({engine:s.engines?.[t],ollamaModel:s.ollamaModels?.[t],deepseekModel:s.deepseekModels?.[t]})}})},[e,t]);let[b,S]=(0,a.useState)(!1),C=(0,a.useRef)(!1);(0,a.useEffect)(()=>{C.current=b},[b]);let{isLoadingHistory:A,isLoadingMore:I,hasMoreHistory:R,loadMoreHistory:L,loadHistoryByCwdAndSessionId:P,loadedSessionId:T,loadedEngine:$}=(0,y.m)(l,o,c,{cwd:e,initialSessionId:t,onSessionId:d,onTitleChange:h,liveRunningRef:C}),D=f.engine??$??void 0,O=(0,a.useCallback)(()=>{},[]),{isLoading:V,apiRetryInfo:W,ptyNotice:_,handleSend:X,handleStop:H}=(0,k.e)(l,o,{sessionId:c,cwd:e,engine:D,chatMode:"sdk",planMode:!1,ollamaModel:f.ollamaModel,deepseekModel:f.deepseekModel,onSessionId:d,onFetchTitle:O}),B=T||c,U=!V&&!!B;(0,j.u)(B,o,U,D,{onRunningChange:e=>{C.current=e,S(e)},onComplete:()=>{B&&P(e,B,!0)}}),(0,a.useEffect)(()=>{U||S(!1)},[U]);let z=V||b,K=(0,a.useCallback)(e=>{X(e)},[X]);return(0,n.jsxs)("div",{className:"flex h-[100dvh] flex-col bg-card",children:[(0,n.jsxs)("div",{className:"flex flex-shrink-0 items-center gap-1 border-b border-border bg-card px-2 py-2 pt-[max(0.5rem,env(safe-area-inset-top))]",children:[(0,n.jsx)("button",{type:"button",onClick:r,"aria-label":"Back",className:"flex h-9 w-9 items-center justify-center rounded-lg text-muted-foreground active:bg-accent",children:(0,n.jsx)(p,{className:"h-6 w-6"})}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsx)("div",{className:"truncate text-sm font-medium",children:u||"…"}),(0,n.jsx)("div",{className:"truncate text-xs text-muted-foreground",children:e.split("/").pop()})]})]}),A?(0,n.jsx)("div",{className:"flex flex-1 items-center justify-center text-muted-foreground",children:"…"}):(0,n.jsx)(N.M,{ref:x,messages:l,isLoading:z,cwd:e,sessionId:c,engine:D,apiRetryInfo:W,ptyNotice:_,hasMoreHistory:R,isLoadingMore:I,onLoadMore:L,isActive:i}),(0,n.jsx)(M,{onSend:K,onStop:H,isRunning:z,disabled:z})]})}let A="cockpitMobileChat";function I({initialCwd:e,initialSessionId:t}){let[s,r]=(0,a.useState)(e&&t?{cwd:e,sessionId:t}:null),[i,l]=(0,a.useState)(!!(e&&t)),[o,c]=(0,a.useState)(0),[d,u]=(0,a.useState)(!1),[h,f]=(0,a.useState)(0),m=(0,a.useRef)(!1),b=(0,a.useRef)(null),p=(0,a.useRef)(i);p.current=i;let g=(0,a.useRef)(s);g.current=s;let v=(0,a.useRef)(h);v.current=h;let w=(0,a.useCallback)(()=>{g.current&&(l(!0),m.current||(window.history.pushState({[A]:g.current},""),m.current=!0))},[]),y=(0,a.useCallback)(()=>{l(!1),m.current&&(m.current=!1,window.history.back())},[]),k=(0,a.useCallback)(e=>{let t={cwd:e.cwd,sessionId:e.sessionId,title:e.title};r(t),l(!0),window.history.pushState({[A]:t},""),m.current=!0},[]),j=(0,a.useCallback)(()=>{try{localStorage.setItem("cockpit-force-desktop","1")}catch{}window.location.href="/"},[]);(0,a.useEffect)(()=>{e&&t&&(window.history.pushState({[A]:{cwd:e,sessionId:t}},""),m.current=!0)},[e,t]),(0,a.useEffect)(()=>{let e=e=>{let t=e.state?.[A];t?(r({cwd:t.cwd,sessionId:t.sessionId,title:t.title}),l(!0),m.current=!0):(l(!1),m.current=!1),c(0)};return window.addEventListener("popstate",e),()=>window.removeEventListener("popstate",e)},[]),(0,a.useEffect)(()=>{let e=b.current;if(!e)return;let t=new ResizeObserver(e=>{for(let t of e)f(t.contentRect.width)});return f(e.clientWidth),t.observe(e),()=>t.disconnect()},[]),(0,a.useEffect)(()=>{let e=b.current;if(!e)return;let t=0,s=0,n="?",a=e=>{1===e.touches.length&&(t=e.touches[0].clientX,s=e.touches[0].clientY,n="?")},r=a=>{if("v"===n||1!==a.touches.length)return;let r=a.touches[0].clientX-t,i=a.touches[0].clientY-s;if("?"===n){if(8>Math.abs(r)&&8>Math.abs(i)||"h"!=(n=Math.abs(r)>Math.abs(i)?"h":"v"))return;u(!0)}a.preventDefault();let l=v.current||e.clientWidth,o=!!g.current,d=r;p.current?(d<0&&(d=0),d>l&&(d=l)):((d>0||!o)&&(d=0),d<-l&&(d=-l)),c(d)},i=s=>{if("h"!==n){n="?";return}u(!1),c(0);let a=v.current||e.clientWidth,r=(s.changedTouches[0]?.clientX??t)-t,i=.25*a;p.current?r>i&&y():r<-i&&g.current&&w(),n="?"};return e.addEventListener("touchstart",a,{passive:!0}),e.addEventListener("touchmove",r,{passive:!1}),e.addEventListener("touchend",i,{passive:!0}),e.addEventListener("touchcancel",i,{passive:!0}),()=>{e.removeEventListener("touchstart",a),e.removeEventListener("touchmove",r),e.removeEventListener("touchend",i),e.removeEventListener("touchcancel",i)}},[w,y]);let N=i?-h:0;return(0,n.jsx)("div",{ref:b,className:"relative h-[100dvh] w-full overflow-hidden",style:{overscrollBehaviorX:"none",touchAction:"pan-y"},children:(0,n.jsxs)("div",{className:"flex h-full",style:{width:"200%",transform:h?`translateX(${N+o}px)`:i?"translateX(-50%)":"translateX(0)",transition:d?"none":"transform 220ms ease-out",willChange:"transform"},children:[(0,n.jsx)("div",{className:"h-full w-1/2 overflow-hidden",children:(0,n.jsx)(x,{onOpen:k,onUseDesktop:j})}),(0,n.jsx)("div",{className:"h-full w-1/2 overflow-hidden",children:s&&(0,n.jsx)(E,{cwd:s.cwd,initialSessionId:s.sessionId,initialTitle:s.title,onBack:y,isActive:i},`${s.cwd}-${s.sessionId}`)})]})})}function R(e){return(0,n.jsx)(I,{...e})}}},e=>{e.O(0,[8653,7330,8216,4281,3888,327,471,9469,217,8441,3794,7358],()=>e(e.s=12550)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4302],{12550:(e,t,s)=>{Promise.resolve().then(s.bind(s,69234))},69234:(e,t,s)=>{"use strict";s.d(t,{default:()=>R});var n=s(95155),a=s(12115),r=s(79114),i=s(90425);let l=(0,i.A)("bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]),o=(0,i.A)("bell-off",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742",key:"178tsu"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05",key:"1hqiys"}]]),c=(0,i.A)("pin",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]);var d=s(2111),u=s(3292),h=s(34075),f=s(69809);let m="/push-sw.js";function x({onOpen:e,onUseDesktop:t}){let{t:s}=(0,r.Bd)(),[i,p]=(0,a.useState)("recent"),[g,v]=(0,a.useState)([]),[w,y]=(0,a.useState)(()=>Date.now()),{pinnedSessions:k}=(0,u.P)(),{supported:j,isSubscribed:N,busy:S,subscribe:C,unsubscribe:M}=function(){let[e,t]=(0,a.useState)(!1),[s,n]=(0,a.useState)("default"),[r,i]=(0,a.useState)(!1),[l,o]=(0,a.useState)(!1);(0,a.useEffect)(()=>{let e="serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window;(t(e),e)?(n(Notification.permission),navigator.serviceWorker.getRegistration(m).then(e=>e?.pushManager.getSubscription()).then(e=>i(!!e)).catch(()=>{})):n("unsupported")},[]);let c=(0,a.useCallback)(async()=>{if(e&&!l){o(!0);try{let e=await Notification.requestPermission();if(n(e),"granted"!==e)return;let t=await navigator.serviceWorker.register(m);await navigator.serviceWorker.ready;let s=await fetch("/api/push/public-key");if(!s.ok)throw Error(`public-key HTTP ${s.status}`);let{publicKey:a}=await s.json();if(!a)throw Error("missing VAPID public key");let r=await t.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:function(e){let t="=".repeat((4-e.length%4)%4),s=atob((e+t).replace(/-/g,"+").replace(/_/g,"/")),n=new Uint8Array(s.length);for(let e=0;e<s.length;e++)n[e]=s.charCodeAt(e);return n}(a)}),l=await fetch("/api/push/subscribe",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({subscription:r})});if(!l.ok)throw Error(`subscribe HTTP ${l.status}`);i(!0)}catch(e){console.error("push subscribe failed",e),(0,h.oR)(f.A.t("mobile.notifyError",{defaultValue:"Could not enable notifications"}),"error")}finally{o(!1)}}},[e,l]),d=(0,a.useCallback)(async()=>{if(e&&!l){o(!0);try{let e=await navigator.serviceWorker.getRegistration(m),t=await e?.pushManager.getSubscription();t&&(await fetch("/api/push/unsubscribe",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({endpoint:t.endpoint})}),await t.unsubscribe()),i(!1)}catch(e){console.error("push unsubscribe failed",e)}finally{o(!1)}}},[e,l]);return{supported:e,permission:s,isSubscribed:r,busy:l,subscribe:c,unsubscribe:d}}(),E=(0,a.useCallback)(e=>{"task-fired"===e.type||e.data&&(v(e.data.sessions||[]),y(Date.now()))},[]);(0,d.h)({url:"/ws/global-state",onMessage:E});let A=(0,a.useCallback)(e=>{let t=Math.floor((w-e)/6e4);if(t<1)return s("common.justNow");if(t<60)return s("common.minutesAgo",{count:t});let n=Math.floor(t/60);return n<24?s("common.hoursAgo",{count:n}):s("common.daysAgo",{count:Math.floor(n/24)})},[w,s]),I=e=>e.split("/").pop()||e,R=g.filter(e=>"loading"===e.status).length,L=(e,t)=>(0,n.jsx)("button",{type:"button",onClick:()=>p(e),className:`flex-1 rounded-md py-1.5 text-sm font-medium transition-colors ${i===e?"bg-card text-foreground shadow-sm":"text-muted-foreground"}`,children:t});return(0,n.jsxs)("div",{className:"flex h-[100dvh] flex-col bg-card",children:[(0,n.jsxs)("div",{className:"flex flex-shrink-0 items-center gap-3 border-b border-border px-3 py-2.5 pt-[max(0.625rem,env(safe-area-inset-top))]",children:[(0,n.jsxs)("div",{className:"flex flex-1 items-center gap-1 rounded-lg bg-accent p-0.5",children:[L("recent",s("sessions.recentSessions")),L("pinned",s("sessions.pinnedSessions"))]}),j&&(0,n.jsx)("button",{type:"button",onClick:N?M:C,disabled:S,"aria-label":N?s("mobile.disableNotifications",{defaultValue:"Disable notifications"}):s("mobile.enableNotifications",{defaultValue:"Enable notifications"}),className:`flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-lg active:bg-accent disabled:opacity-40 ${N?"text-brand":"text-muted-foreground"}`,children:N?(0,n.jsx)(l,{className:"h-4 w-4"}):(0,n.jsx)(o,{className:"h-4 w-4"})}),(0,n.jsx)("button",{type:"button",onClick:t,className:"flex-shrink-0 rounded-lg px-2 py-1 text-xs text-muted-foreground active:bg-accent",children:s("mobile.useDesktop")})]}),"recent"===i&&R>0&&(0,n.jsx)("div",{className:"flex-shrink-0 border-b border-border/50 px-4 py-1.5 text-xs text-orange-11",children:s("sessions.runningCount",{count:R})}),(0,n.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto",children:"recent"===i?0===g.length?(0,n.jsx)(b,{text:s("sessions.noSessions")}):g.map(t=>(0,n.jsxs)("button",{onClick:()=>e({cwd:t.cwd,sessionId:t.sessionId,title:t.title}),className:"flex w-full items-start gap-3 border-b border-border/50 px-4 py-3.5 text-left active:bg-accent",children:[(0,n.jsx)("span",{className:`mt-1.5 h-2.5 w-2.5 flex-shrink-0 rounded-full ${"loading"===t.status?"animate-pulse bg-orange-9":"unread"===t.status?"bg-red-500":"bg-muted-foreground/30"}`}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{className:"truncate text-sm font-medium",children:I(t.cwd)}),"loading"===t.status&&(0,n.jsx)("span",{className:"flex-shrink-0 text-xs text-orange-11",children:s("sessions.running")}),"unread"===t.status&&(0,n.jsx)("span",{className:"flex-shrink-0 text-xs text-red-500",children:s("sessions.done")}),(0,n.jsx)("span",{className:"ml-auto flex-shrink-0 text-xs text-muted-foreground",children:A(t.lastActive)})]}),(t.lastUserMessage||t.title)&&(0,n.jsx)("div",{className:"mt-0.5 truncate text-xs text-foreground/70",children:t.lastUserMessage||t.title})]})]},`${t.cwd}-${t.sessionId}`)):0===k.length?(0,n.jsx)(b,{text:s("sessions.noPinnedSessions")}):k.map(t=>(0,n.jsxs)("button",{onClick:()=>e({cwd:t.cwd,sessionId:t.sessionId,title:t.customTitle}),className:"flex w-full items-start gap-3 border-b border-border/50 px-4 py-3.5 text-left active:bg-accent",children:[(0,n.jsx)(c,{className:"mt-0.5 h-4 w-4 flex-shrink-0 text-brand"}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsx)("div",{className:"truncate text-sm font-medium",children:t.customTitle||I(t.cwd)}),(0,n.jsx)("div",{className:"truncate text-xs text-muted-foreground",children:I(t.cwd)})]})]},`${t.cwd}-${t.sessionId}`))})]})}function b({text:e}){return(0,n.jsx)("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:e})}let p=(0,i.A)("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);var g=s(49433),v=s(86957),w=s(82680),y=s(85839),k=s(20917),j=s(65153),N=s(8988),S=s(36201),C=s(56204);function M({onSend:e,onStop:t,isRunning:s,disabled:i}){let{t:l}=(0,r.Bd)(),[o,c]=(0,a.useState)(""),d=(0,a.useRef)(null);(0,a.useLayoutEffect)(()=>{let e=d.current;e&&(e.style.height="auto",e.style.height=`${Math.min(e.scrollHeight,140)}px`)},[o]);let u=(0,a.useCallback)(()=>{let t=o.trim();t&&!i&&(e(t),c(""))},[o,i,e]),h=(0,a.useCallback)(e=>{"Enter"===e.key&&(e.metaKey||e.ctrlKey)&&!e.nativeEvent.isComposing&&(e.preventDefault(),u())},[u]);return(0,n.jsxs)("div",{className:"flex items-end gap-2 border-t border-border bg-card px-3 py-2 pb-[max(0.5rem,env(safe-area-inset-bottom))]",children:[(0,n.jsx)("textarea",{ref:d,value:o,onChange:e=>c(e.target.value),onKeyDown:h,rows:1,placeholder:l("mobile.messagePlaceholder"),className:"flex-1 resize-none rounded-2xl border border-border bg-background px-4 py-2.5 text-base leading-snug outline-none focus:border-brand"}),s?(0,n.jsx)("button",{type:"button",onClick:t,"aria-label":l("mobile.stop"),className:"flex h-11 w-11 flex-shrink-0 items-center justify-center rounded-full bg-red-500 text-white active:scale-95",children:(0,n.jsx)(S.A,{className:"h-5 w-5",fill:"currentColor"})}):(0,n.jsx)("button",{type:"button",onClick:u,disabled:i||!o.trim(),"aria-label":l("mobile.send"),className:"flex h-11 w-11 flex-shrink-0 items-center justify-center rounded-full bg-brand text-white active:scale-95 disabled:opacity-40",children:(0,n.jsx)(C.A,{className:"h-5 w-5"})})]})}function E({cwd:e,initialSessionId:t,initialTitle:s,onBack:r,isActive:i=!0}){let[l,o]=(0,a.useState)([]),[c,d]=(0,a.useState)(null),[u,h]=(0,a.useState)(s??""),[f,m]=(0,a.useState)({}),x=(0,a.useRef)(null);(0,a.useEffect)(()=>{let s=g.tryPromise({try:async()=>{let t=await fetch(`/api/project-state?cwd=${encodeURIComponent(e)}`);return t.ok?await t.json():null},catch:e=>new w.uV({message:"loadProjectState failed",cause:e})});v.t4.runPromiseExit(s).then(e=>{if("Success"===e._tag&&e.value){let s=e.value;m({engine:s.engines?.[t],ollamaModel:s.ollamaModels?.[t],deepseekModel:s.deepseekModels?.[t]})}})},[e,t]);let[b,S]=(0,a.useState)(!1),C=(0,a.useRef)(!1);(0,a.useEffect)(()=>{C.current=b},[b]);let{isLoadingHistory:A,isLoadingMore:I,hasMoreHistory:R,loadMoreHistory:L,loadHistoryByCwdAndSessionId:P,loadedSessionId:T,loadedEngine:$}=(0,y.m)(l,o,c,{cwd:e,initialSessionId:t,onSessionId:d,onTitleChange:h,liveRunningRef:C}),D=f.engine??$??void 0,O=(0,a.useCallback)(()=>{},[]),{isLoading:V,apiRetryInfo:W,ptyNotice:_,handleSend:X,handleStop:H}=(0,k.e)(l,o,{sessionId:c,cwd:e,engine:D,chatMode:"sdk",planMode:!1,ollamaModel:f.ollamaModel,deepseekModel:f.deepseekModel,onSessionId:d,onFetchTitle:O}),B=T||c,U=!V&&!!B;(0,j.u)(B,o,U,D,{onRunningChange:e=>{C.current=e,S(e)},onComplete:()=>{B&&P(e,B,!0)}}),(0,a.useEffect)(()=>{U||S(!1)},[U]);let z=V||b,K=(0,a.useCallback)(e=>{X(e)},[X]);return(0,n.jsxs)("div",{className:"flex h-[100dvh] flex-col bg-card",children:[(0,n.jsxs)("div",{className:"flex flex-shrink-0 items-center gap-1 border-b border-border bg-card px-2 py-2 pt-[max(0.5rem,env(safe-area-inset-top))]",children:[(0,n.jsx)("button",{type:"button",onClick:r,"aria-label":"Back",className:"flex h-9 w-9 items-center justify-center rounded-lg text-muted-foreground active:bg-accent",children:(0,n.jsx)(p,{className:"h-6 w-6"})}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsx)("div",{className:"truncate text-sm font-medium",children:u||"…"}),(0,n.jsx)("div",{className:"truncate text-xs text-muted-foreground",children:e.split("/").pop()})]})]}),A?(0,n.jsx)("div",{className:"flex flex-1 items-center justify-center text-muted-foreground",children:"…"}):(0,n.jsx)(N.M,{ref:x,messages:l,isLoading:z,cwd:e,sessionId:c,engine:D,apiRetryInfo:W,ptyNotice:_,hasMoreHistory:R,isLoadingMore:I,onLoadMore:L,isActive:i}),(0,n.jsx)(M,{onSend:K,onStop:H,isRunning:z,disabled:z})]})}let A="cockpitMobileChat";function I({initialCwd:e,initialSessionId:t}){let[s,r]=(0,a.useState)(e&&t?{cwd:e,sessionId:t}:null),[i,l]=(0,a.useState)(!!(e&&t)),[o,c]=(0,a.useState)(0),[d,u]=(0,a.useState)(!1),[h,f]=(0,a.useState)(0),m=(0,a.useRef)(!1),b=(0,a.useRef)(null),p=(0,a.useRef)(i);p.current=i;let g=(0,a.useRef)(s);g.current=s;let v=(0,a.useRef)(h);v.current=h;let w=(0,a.useCallback)(()=>{g.current&&(l(!0),m.current||(window.history.pushState({[A]:g.current},""),m.current=!0))},[]),y=(0,a.useCallback)(()=>{l(!1),m.current&&(m.current=!1,window.history.back())},[]),k=(0,a.useCallback)(e=>{let t={cwd:e.cwd,sessionId:e.sessionId,title:e.title};r(t),l(!0),window.history.pushState({[A]:t},""),m.current=!0},[]),j=(0,a.useCallback)(()=>{try{localStorage.setItem("cockpit-force-desktop","1")}catch{}window.location.href="/"},[]);(0,a.useEffect)(()=>{e&&t&&(window.history.pushState({[A]:{cwd:e,sessionId:t}},""),m.current=!0)},[e,t]),(0,a.useEffect)(()=>{let e=e=>{let t=e.state?.[A];t?(r({cwd:t.cwd,sessionId:t.sessionId,title:t.title}),l(!0),m.current=!0):(l(!1),m.current=!1),c(0)};return window.addEventListener("popstate",e),()=>window.removeEventListener("popstate",e)},[]),(0,a.useEffect)(()=>{let e=b.current;if(!e)return;let t=new ResizeObserver(e=>{for(let t of e)f(t.contentRect.width)});return f(e.clientWidth),t.observe(e),()=>t.disconnect()},[]),(0,a.useEffect)(()=>{let e=b.current;if(!e)return;let t=0,s=0,n="?",a=e=>{1===e.touches.length&&(t=e.touches[0].clientX,s=e.touches[0].clientY,n="?")},r=a=>{if("v"===n||1!==a.touches.length)return;let r=a.touches[0].clientX-t,i=a.touches[0].clientY-s;if("?"===n){if(8>Math.abs(r)&&8>Math.abs(i)||"h"!=(n=Math.abs(r)>Math.abs(i)?"h":"v"))return;u(!0)}a.preventDefault();let l=v.current||e.clientWidth,o=!!g.current,d=r;p.current?(d<0&&(d=0),d>l&&(d=l)):((d>0||!o)&&(d=0),d<-l&&(d=-l)),c(d)},i=s=>{if("h"!==n){n="?";return}u(!1),c(0);let a=v.current||e.clientWidth,r=(s.changedTouches[0]?.clientX??t)-t,i=.25*a;p.current?r>i&&y():r<-i&&g.current&&w(),n="?"};return e.addEventListener("touchstart",a,{passive:!0}),e.addEventListener("touchmove",r,{passive:!1}),e.addEventListener("touchend",i,{passive:!0}),e.addEventListener("touchcancel",i,{passive:!0}),()=>{e.removeEventListener("touchstart",a),e.removeEventListener("touchmove",r),e.removeEventListener("touchend",i),e.removeEventListener("touchcancel",i)}},[w,y]);let N=i?-h:0;return(0,n.jsx)("div",{ref:b,className:"relative h-[100dvh] w-full overflow-hidden",style:{overscrollBehaviorX:"none",touchAction:"pan-y"},children:(0,n.jsxs)("div",{className:"flex h-full",style:{width:"200%",transform:h?`translateX(${N+o}px)`:i?"translateX(-50%)":"translateX(0)",transition:d?"none":"transform 220ms ease-out",willChange:"transform"},children:[(0,n.jsx)("div",{className:"h-full w-1/2 overflow-hidden",children:(0,n.jsx)(x,{onOpen:k,onUseDesktop:j})}),(0,n.jsx)("div",{className:"h-full w-1/2 overflow-hidden",children:s&&(0,n.jsx)(E,{cwd:s.cwd,initialSessionId:s.sessionId,initialTitle:s.title,onBack:y,isActive:i},`${s.cwd}-${s.sessionId}`)})]})})}function R(e){return(0,n.jsx)(I,{...e})}}},e=>{e.O(0,[8653,7330,8216,4281,3888,2625,471,6784,217,8441,3794,7358],()=>e(e.s=12550)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6500,8974],{39823:(e,s,n)=>{Promise.resolve().then(n.bind(n,76288)),Promise.resolve().then(n.bind(n,47617)),Promise.resolve().then(n.bind(n,8648)),Promise.resolve().then(n.bind(n,76043)),Promise.resolve().then(n.bind(n,2228)),Promise.resolve().then(n.bind(n,32460)),Promise.resolve().then(n.bind(n,84310)),Promise.resolve().then(n.bind(n,83678)),Promise.resolve().then(n.bind(n,21484)),Promise.resolve().then(n.bind(n,24058)),Promise.resolve().then(n.bind(n,1700)),Promise.resolve().then(n.bind(n,76412)),Promise.resolve().then(n.bind(n,89039)),Promise.resolve().then(n.bind(n,63048))}},e=>{e.O(0,[8653,7330,8216,4281,3888,5004,277,327,471,9428,9469,217,2032,2576,8441,3794,7358],()=>e(e.s=39823)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6500,8974],{39823:(e,s,n)=>{Promise.resolve().then(n.bind(n,76288)),Promise.resolve().then(n.bind(n,47617)),Promise.resolve().then(n.bind(n,8648)),Promise.resolve().then(n.bind(n,76043)),Promise.resolve().then(n.bind(n,2228)),Promise.resolve().then(n.bind(n,42701)),Promise.resolve().then(n.bind(n,84310)),Promise.resolve().then(n.bind(n,83678)),Promise.resolve().then(n.bind(n,21484)),Promise.resolve().then(n.bind(n,24058)),Promise.resolve().then(n.bind(n,1700)),Promise.resolve().then(n.bind(n,76412)),Promise.resolve().then(n.bind(n,89039)),Promise.resolve().then(n.bind(n,63048))}},e=>{e.O(0,[8653,7330,8216,4281,3888,5004,277,2625,471,9428,6784,217,2032,2576,8441,3794,7358],()=>e(e.s=39823)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6500,8974],{39823:(e,s,n)=>{Promise.resolve().then(n.bind(n,76288)),Promise.resolve().then(n.bind(n,47617)),Promise.resolve().then(n.bind(n,8648)),Promise.resolve().then(n.bind(n,76043)),Promise.resolve().then(n.bind(n,2228)),Promise.resolve().then(n.bind(n,32460)),Promise.resolve().then(n.bind(n,84310)),Promise.resolve().then(n.bind(n,83678)),Promise.resolve().then(n.bind(n,21484)),Promise.resolve().then(n.bind(n,24058)),Promise.resolve().then(n.bind(n,1700)),Promise.resolve().then(n.bind(n,76412)),Promise.resolve().then(n.bind(n,89039)),Promise.resolve().then(n.bind(n,63048))}},e=>{e.O(0,[8653,7330,8216,4281,3888,5004,277,327,471,9428,9469,217,2032,2576,8441,3794,7358],()=>e(e.s=39823)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6500,8974],{39823:(e,s,n)=>{Promise.resolve().then(n.bind(n,76288)),Promise.resolve().then(n.bind(n,47617)),Promise.resolve().then(n.bind(n,8648)),Promise.resolve().then(n.bind(n,76043)),Promise.resolve().then(n.bind(n,2228)),Promise.resolve().then(n.bind(n,42701)),Promise.resolve().then(n.bind(n,84310)),Promise.resolve().then(n.bind(n,83678)),Promise.resolve().then(n.bind(n,21484)),Promise.resolve().then(n.bind(n,24058)),Promise.resolve().then(n.bind(n,1700)),Promise.resolve().then(n.bind(n,76412)),Promise.resolve().then(n.bind(n,89039)),Promise.resolve().then(n.bind(n,63048))}},e=>{e.O(0,[8653,7330,8216,4281,3888,5004,277,2625,471,9428,6784,217,2032,2576,8441,3794,7358],()=>e(e.s=39823)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2951],{15335:(e,t,r)=>{Promise.resolve().then(r.bind(r,99324)),Promise.resolve().then(r.bind(r,93975)),Promise.resolve().then(r.bind(r,19736)),Promise.resolve().then(r.bind(r,82032)),Promise.resolve().then(r.bind(r,28898)),Promise.resolve().then(r.bind(r,83519)),Promise.resolve().then(r.bind(r,62177)),Promise.resolve().then(r.bind(r,79968))},28898:(e,t,r)=>{"use strict";r.d(t,{ReviewIdentitySettings:()=>i});var n=r(95155),o=r(12115),s=r(79114);function i({identity:e}){let{t}=(0,s.Bd)(),[r,l]=(0,o.useState)(!1),[a,d]=(0,o.useState)(""),c=(0,o.useRef)(null);(0,o.useEffect)(()=>{if(!r)return;let e=e=>{c.current&&!c.current.contains(e.target)&&l(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[r]);let u=()=>{let t=a.trim();t&&t!==e.name&&e.confirmName(t),l(!1)};return(0,n.jsxs)("div",{className:"relative",ref:c,children:[(0,n.jsxs)("button",{onClick:()=>{r||d(e.name),l(!r)},className:"px-2 py-1 text-xs rounded hover:bg-accent transition-colors flex items-center gap-1",title:t("review.identitySettings"),children:[(0,n.jsx)("span",{className:"w-5 h-5 rounded-full bg-brand/20 text-brand flex items-center justify-center text-[10px] font-bold",children:e.name.charAt(0)}),(0,n.jsx)("span",{className:"text-muted-foreground",children:e.name})]}),r&&(0,n.jsxs)("div",{className:"absolute right-0 top-full mt-1 w-56 bg-card border border-border rounded-lg shadow-lg p-3 z-50",children:[(0,n.jsx)("div",{className:"text-xs text-muted-foreground mb-2",children:t("review.reviewNickname")}),(0,n.jsx)("input",{type:"text",value:a,onChange:e=>d(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.nativeEvent.isComposing||u()},className:"w-full px-2 py-1 text-sm bg-secondary border border-border rounded focus:outline-none focus:border-brand",autoFocus:!0}),(0,n.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[(0,n.jsx)("button",{onClick:()=>{e.randomize(),l(!1)},className:"px-2 py-1 text-xs rounded hover:bg-accent transition-colors text-muted-foreground",children:t("review.random")}),(0,n.jsx)("div",{className:"flex-1"}),(0,n.jsx)("button",{onClick:()=>l(!1),className:"px-2 py-1 text-xs rounded hover:bg-accent transition-colors text-muted-foreground",children:t("common.cancel")}),(0,n.jsx)("button",{onClick:u,className:"px-2 py-1 text-xs rounded bg-brand text-white hover:bg-brand/90 transition-colors",children:t("common.save")})]})]})]})}},62177:(e,t,r)=>{"use strict";r.d(t,{ReviewPage:()=>I});var n=r(95155),o=r(12115),s=r(79114),i=r(45048),l=r(47176),a=r(3238),d=r(97251);function c({selectedText:e,position:t,onSubmit:r,onCancel:i}){let{t:l}=(0,s.Bd)(),[a,d]=(0,o.useState)(""),u=(0,o.useRef)(null),x=(0,o.useRef)(null);(0,o.useEffect)(()=>{u.current?.focus()},[]),(0,o.useEffect)(()=>{let e=e=>{"Escape"===e.key&&i()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[i]),(0,o.useEffect)(()=>{let e=e=>{!x.current||x.current.contains(e.target)||a.trim()||i()};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[a,i]);let m=()=>{let e=a.trim();e&&r(e)},h=e.length>60?e.slice(0,57)+"...":e;return(0,n.jsxs)("div",{ref:x,className:"absolute z-50 w-96 bg-card border border-border rounded-lg shadow-lg",style:{top:t.top,left:Math.max(8,t.left-192)},children:[(0,n.jsxs)("div",{className:"px-3 pt-3 pb-2",children:[(0,n.jsx)("div",{className:"text-xs text-muted-foreground mb-1",children:l("review.selectedText")}),(0,n.jsx)("div",{className:"text-xs bg-yellow-500/10 border-l-2 border-yellow-500 px-2 py-1 rounded-r truncate",children:h})]}),(0,n.jsx)("div",{className:"px-3 pb-2",children:(0,n.jsx)("textarea",{ref:u,value:a,onChange:e=>d(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||e.nativeEvent.isComposing||(e.preventDefault(),m())},placeholder:l("review.addCommentPlaceholder"),className:"w-full px-2 py-1.5 text-sm bg-secondary border border-border rounded resize-none focus:outline-none focus:border-brand",rows:4})}),(0,n.jsxs)("div",{className:"px-3 pb-3 flex items-center justify-between",children:[(0,n.jsx)("span",{className:"text-[10px] text-muted-foreground",children:l("review.enterSubmitHint")}),(0,n.jsxs)("div",{className:"flex gap-1",children:[(0,n.jsx)("button",{onClick:i,className:"px-2 py-1 text-xs rounded hover:bg-accent transition-colors text-muted-foreground",children:l("common.cancel")}),(0,n.jsx)("button",{onClick:m,disabled:!a.trim(),className:"px-2 py-1 text-xs rounded bg-brand text-white hover:bg-brand/90 transition-colors disabled:opacity-40",children:l("review.commentBtn")})]})]})]})}let u={bg:"rgba(234, 179, 8, 0.15)",bgActive:"rgba(234, 179, 8, 0.4)",bgPending:"rgba(234, 179, 8, 0.3)",border:"rgba(234, 179, 8, 0.7)",borderPending:"rgba(234, 179, 8, 0.9)"},x={bg:"rgba(234, 179, 8, 0.1)",bgActive:"rgba(234, 179, 8, 0.3)",bgPending:"rgba(234, 179, 8, 0.2)",border:"rgba(234, 179, 8, 0.5)",borderPending:"rgba(234, 179, 8, 0.7)"};function m({rects:e,activeCommentId:t,pendingCommentId:r,isDark:o}){if(0===e.length)return null;let s=o?x:u;return(0,n.jsx)("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:0,overflow:"visible",pointerEvents:"none",zIndex:5},children:e.map((e,o)=>{let i=e.commentId===t,l=e.commentId===r,a=s.bg;return l?a=s.bgPending:i&&(a=s.bgActive),(0,n.jsx)("div",{"data-comment-id":e.commentId,style:{position:"absolute",top:e.top,left:e.left,width:e.width,height:e.height,backgroundColor:a,borderBottom:`1px solid ${l?s.borderPending:s.border}`,borderRadius:1,pointerEvents:"none"}},`${e.commentId}-${o}`)})})}var h=r(99324);let f=[d.W];function p({content:e,comments:t,activeCommentId:r,isActive:s,onAddComment:d,onHighlightClick:u,scrollToHighlightRef:x}){let{resolvedTheme:v}=(0,a.D)(),g=(0,o.useRef)(null),b=(0,o.useRef)(null),[w,j]=(0,o.useState)(null),y=(0,o.useMemo)(()=>w?[...t,{id:"__pending__",author:"",authorId:"",content:"",anchor:w.anchor,createdAt:0,replies:[]}]:t,[t,w]),{rects:k,scrollToHighlight:C}=(0,h.useReviewHighlights)(g,b,y,r);(0,o.useEffect)(()=>{x.current=C},[C,x]);let N=(0,o.useRef)(k);(0,o.useEffect)(()=>{N.current=k},[k]);let E=(0,o.useCallback)(e=>{let t=window.getSelection(),r=t&&!t.isCollapsed;if(r&&s&&g.current){let r=t.getRangeAt(0);if(g.current.contains(r.startContainer)&&g.current.contains(r.endContainer)){let n=function(e,t){let r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),n=0,o=-1,s=-1;for(;r.nextNode();){let e=r.currentNode,i=e.textContent?.length||0;if(e===t.startContainer&&(o=n+t.startOffset),e===t.endContainer){s=n+t.endOffset;break}n+=i}if(-1===o||-1===s||o>=s)return null;let i=e.textContent?.slice(o,s)||"";return i.trim()?{startOffset:o,endOffset:s,selectedText:i}:null}(g.current,r);if(n){let r=b.current??g.current.parentElement,o=r.getBoundingClientRect();j({anchor:n,position:{top:e.clientY-o.top+r.scrollTop+8,left:e.clientX-o.left}}),t.removeAllRanges();return}}}if(!r&&!w){let t=b.current;if(!t)return;let r=t.getBoundingClientRect(),n=e.clientX-r.left+t.scrollLeft,o=e.clientY-r.top+t.scrollTop;for(let e of N.current)if("__pending__"!==e.commentId&&n>=e.left&&n<=e.left+e.width&&o>=e.top&&o<=e.top+e.height)return void u(e.commentId)}},[s,w,u]),R=(0,o.useCallback)(e=>{w&&(d(e,w.anchor),j(null),window.getSelection()?.removeAllRanges())},[w,d]),S=(0,o.useCallback)(()=>{j(null),window.getSelection()?.removeAllRanges()},[]);return(0,n.jsxs)("div",{className:"h-full flex bg-card",children:[(0,n.jsx)(l.l,{content:e,containerRef:b}),(0,n.jsxs)("div",{ref:b,className:"flex-1 overflow-auto relative",onMouseUp:E,children:[(0,n.jsx)("div",{ref:g,className:"p-6 review-markdown-container",children:(0,n.jsx)(i.T,{content:e,rehypePlugins:f})}),(0,n.jsx)(m,{rects:k,activeCommentId:r,pendingCommentId:w?"__pending__":null,isDark:"dark"===v}),w&&(0,n.jsx)(c,{selectedText:w.anchor.selectedText,position:w.position,onSubmit:R,onCancel:S})]})]})}var v=r(69809);function g(e){let t=new Date(e),r=Math.floor((new Date().getTime()-t.getTime())/6e4);if(r<1)return v.A.t("common.justNow");if(r<60)return v.A.t("common.minutesAgo",{count:r});let n=Math.floor(r/60);if(n<24)return v.A.t("common.hoursAgo",{count:n});let o=Math.floor(n/24);return o<7?v.A.t("common.daysAgo",{count:o}):t.toLocaleDateString()}let b=(0,o.forwardRef)(function({comment:e,isActive:t,isOwnComment:r,isAdmin:i,currentAuthorId:l,canInteract:a,userNameMap:d,onClick:c,onDelete:u,onEdit:x,onToggleClosed:m,onAddReply:h,onDeleteReply:f,onEditReply:p},v){let{t:b}=(0,s.Bd)(),w=(e,t)=>d[e]||t,[j,y]=(0,o.useState)(""),[k,C]=(0,o.useState)(!1),[N,E]=(0,o.useState)(!1),[R,S]=(0,o.useState)(""),[I,L]=(0,o.useState)(null),[P,A]=(0,o.useState)(""),T=()=>{let e=j.trim();e&&(h(e),y(""),C(!1))},M=()=>{let t=R.trim();t&&t!==e.content&&x(t),E(!1)},D=()=>{if(!I)return;let t=P.trim(),r=e.replies.find(e=>e.id===I);!t||r&&t===r.content||p(I,t),L(null)},_=e.anchor.selectedText.length>80?e.anchor.selectedText.slice(0,77)+"...":e.anchor.selectedText,F=i||r||a;return e.closed?(0,n.jsxs)("div",{ref:v,className:"rounded-lg border border-border/50 bg-card/50 opacity-60 hover:opacity-80 transition-all cursor-pointer px-3 py-2 flex items-center gap-2",onClick:c,children:[(0,n.jsx)("span",{className:"w-4 h-4 rounded-full bg-brand/20 text-brand flex items-center justify-center text-[9px] font-bold flex-shrink-0",children:w(e.authorId,e.author).charAt(0)}),(0,n.jsx)("span",{className:"text-xs text-muted-foreground truncate flex-1",children:_}),(0,n.jsx)("span",{className:"text-[10px] text-muted-foreground/50 flex-shrink-0",children:b("review.closedLabel")}),F&&(0,n.jsx)("button",{onClick:e=>{e.stopPropagation(),m(!1)},className:"text-[10px] text-muted-foreground hover:text-foreground transition-colors flex-shrink-0",title:b("review.reopenReview"),children:b("review.reopen")}),(r&&a||i)&&(0,n.jsx)("button",{onClick:e=>{e.stopPropagation(),u()},className:"text-[10px] text-muted-foreground hover:text-red-500 transition-colors flex-shrink-0",title:b("review.deleteComment"),children:b("common.delete")})]}):(0,n.jsxs)("div",{ref:v,className:`rounded-lg border transition-all cursor-pointer ${t?"border-brand bg-brand/5 shadow-sm":"border-border bg-card hover:border-muted-foreground/30"}`,onClick:c,children:[(0,n.jsx)("div",{className:"px-3 pt-3 pb-1",children:(0,n.jsx)("div",{className:"text-xs bg-yellow-500/10 border-l-2 border-yellow-500 px-2 py-1 rounded-r text-muted-foreground truncate",children:_})}),(0,n.jsxs)("div",{className:"px-3 pt-2 flex items-center gap-2",children:[(0,n.jsx)("span",{className:"w-5 h-5 rounded-full bg-brand/20 text-brand flex items-center justify-center text-[10px] font-bold flex-shrink-0",children:w(e.authorId,e.author).charAt(0)}),(0,n.jsx)("span",{className:"text-xs font-medium",children:w(e.authorId,e.author)}),(0,n.jsx)("span",{className:"text-[10px] text-muted-foreground",children:g(e.createdAt)}),(0,n.jsx)("div",{className:"flex-1"}),!N&&(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[F&&(0,n.jsx)("button",{onClick:e=>{e.stopPropagation(),m(!0)},className:"text-[10px] text-muted-foreground hover:text-foreground transition-colors",title:b("review.closeComment"),children:b("review.closeComment")}),r&&a&&(0,n.jsx)("button",{onClick:t=>{t.stopPropagation(),S(e.content),E(!0)},className:"text-[10px] text-muted-foreground hover:text-foreground transition-colors",title:b("review.editComment"),children:b("common.edit")}),(r&&a||i)&&(0,n.jsx)("button",{onClick:e=>{e.stopPropagation(),u()},className:"text-[10px] text-muted-foreground hover:text-red-500 transition-colors",title:b("review.deleteComment"),children:b("common.delete")})]})]}),(0,n.jsx)("div",{className:"px-3 pt-1 pb-2",children:N?(0,n.jsxs)("div",{onClick:e=>e.stopPropagation(),children:[(0,n.jsx)("textarea",{value:R,onChange:e=>S(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||e.nativeEvent.isComposing||(e.preventDefault(),M()),"Escape"===e.key&&E(!1)},className:"w-full px-2 py-1.5 text-sm bg-secondary border border-border rounded resize-none focus:outline-none focus:border-brand",rows:3,autoFocus:!0}),(0,n.jsxs)("div",{className:"flex items-center justify-end gap-1 mt-1",children:[(0,n.jsx)("button",{onClick:()=>E(!1),className:"px-2 py-0.5 text-xs rounded hover:bg-accent transition-colors text-muted-foreground",children:b("common.cancel")}),(0,n.jsx)("button",{onClick:M,disabled:!R.trim(),className:"px-2 py-0.5 text-xs rounded bg-brand text-white hover:bg-brand/90 transition-colors disabled:opacity-40",children:b("common.save")})]})]}):(0,n.jsxs)("div",{className:"text-sm whitespace-pre-wrap",children:[e.content,e.edited&&(0,n.jsx)("span",{className:"text-[10px] text-muted-foreground ml-1",children:b("review.edited")})]})}),e.replies.length>0&&(0,n.jsx)("div",{className:"mx-3 border-t border-border",children:e.replies.map(e=>(0,n.jsxs)("div",{className:"py-2 border-b border-border last:border-b-0",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{className:"w-4 h-4 rounded-full bg-accent text-muted-foreground flex items-center justify-center text-[9px] font-bold flex-shrink-0",children:w(e.authorId,e.author).charAt(0)}),(0,n.jsx)("span",{className:"text-xs font-medium",children:w(e.authorId,e.author)}),(0,n.jsx)("span",{className:"text-[10px] text-muted-foreground",children:g(e.createdAt)}),(0,n.jsx)("div",{className:"flex-1"}),I!==e.id&&(e.authorId===l&&a||i)&&(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[e.authorId===l&&a&&(0,n.jsx)("button",{onClick:t=>{var r;t.stopPropagation(),r=e.id,A(e.content),L(r)},className:"text-[10px] text-muted-foreground hover:text-foreground transition-colors",title:b("review.editReply"),children:b("common.edit")}),(0,n.jsx)("button",{onClick:t=>{t.stopPropagation(),f(e.id)},className:"text-[10px] text-muted-foreground hover:text-red-500 transition-colors",title:b("review.deleteReply"),children:b("common.delete")})]})]}),I===e.id?(0,n.jsxs)("div",{className:"mt-1 pl-6",onClick:e=>e.stopPropagation(),children:[(0,n.jsx)("textarea",{value:P,onChange:e=>A(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||e.nativeEvent.isComposing||(e.preventDefault(),D()),"Escape"===e.key&&L(null)},className:"w-full px-2 py-1 text-sm bg-secondary border border-border rounded resize-none focus:outline-none focus:border-brand",rows:2,autoFocus:!0}),(0,n.jsxs)("div",{className:"flex items-center justify-end gap-1 mt-1",children:[(0,n.jsx)("button",{onClick:()=>L(null),className:"px-2 py-0.5 text-xs rounded hover:bg-accent transition-colors text-muted-foreground",children:b("common.cancel")}),(0,n.jsx)("button",{onClick:D,disabled:!P.trim(),className:"px-2 py-0.5 text-xs rounded bg-brand text-white hover:bg-brand/90 transition-colors disabled:opacity-40",children:b("common.save")})]})]}):(0,n.jsxs)("div",{className:"text-sm mt-0.5 pl-6 whitespace-pre-wrap",children:[e.content,e.edited&&(0,n.jsx)("span",{className:"text-[10px] text-muted-foreground ml-1",children:b("review.edited")})]})]},e.id))}),(0,n.jsx)("div",{className:"px-3 pb-2 pt-1",children:k?(0,n.jsxs)("div",{className:"mt-1",onClick:e=>e.stopPropagation(),children:[(0,n.jsx)("textarea",{value:j,onChange:e=>y(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||e.nativeEvent.isComposing||(e.preventDefault(),T()),"Escape"===e.key&&C(!1)},placeholder:b("review.replyPlaceholder"),className:"w-full px-2 py-1 text-sm bg-secondary border border-border rounded resize-none focus:outline-none focus:border-brand",rows:2,autoFocus:!0}),(0,n.jsxs)("div",{className:"flex items-center justify-end gap-1 mt-1",children:[(0,n.jsx)("button",{onClick:()=>C(!1),className:"px-2 py-0.5 text-xs rounded hover:bg-accent transition-colors text-muted-foreground",children:b("common.cancel")}),(0,n.jsx)("button",{onClick:T,disabled:!j.trim(),className:"px-2 py-0.5 text-xs rounded bg-brand text-white hover:bg-brand/90 transition-colors disabled:opacity-40",children:b("review.reply")})]})]}):a&&(0,n.jsx)("button",{onClick:e=>{e.stopPropagation(),C(!0)},className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:b("review.reply")})})]})});function w({comments:e,activeCommentId:t,currentAuthorId:r,isActive:i,isAdmin:l,userNameMap:a,onCommentClick:d,onNavigateComment:c,onDeleteComment:u,onEditComment:x,onToggleCommentClosed:m,onAddReply:h,onDeleteReply:f,onEditReply:p,scrollToCommentRef:v}){let{t:g}=(0,s.Bd)(),j=(0,o.useRef)(new Map),y=(0,o.useRef)(null),k=(0,o.useCallback)(e=>{let t=j.current.get(e);t&&t.scrollIntoView({behavior:"smooth",block:"center"})},[]);(0,o.useEffect)(()=>{v.current=k},[k,v]);let C=[...e].sort((e,t)=>e.anchor.startOffset-t.anchor.startOffset);return(0,n.jsxs)("div",{ref:y,className:"h-full flex flex-col bg-card",children:[(0,n.jsxs)("div",{className:"px-4 py-2 bg-secondary border-b border-border flex-shrink-0 flex items-center",children:[(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:0===e.length?g("review.selectTextToComment"):t?g("review.commentsNavCount",{current:C.findIndex(e=>e.id===t)+1,total:e.length}):g("review.commentsCount",{count:e.length})}),e.length>0&&(0,n.jsxs)("div",{className:"flex items-center gap-1 ml-2",children:[(0,n.jsxs)("button",{onClick:()=>c("prev"),className:"px-1.5 py-0.5 text-[11px] text-muted-foreground hover:text-foreground hover:bg-accent rounded transition-colors flex items-center gap-0.5",title:g("review.prevComment"),children:[(0,n.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("polyline",{points:"15 18 9 12 15 6"})}),g("review.prevComment")]}),(0,n.jsxs)("button",{onClick:()=>c("next"),className:"px-1.5 py-0.5 text-[11px] text-muted-foreground hover:text-foreground hover:bg-accent rounded transition-colors flex items-center gap-0.5",title:g("review.nextComment"),children:[g("review.nextComment"),(0,n.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("polyline",{points:"9 18 15 12 9 6"})})]})]})]}),(0,n.jsx)("div",{className:"flex-1 overflow-auto",children:0===C.length?(0,n.jsx)("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:(0,n.jsxs)("div",{className:"text-center",children:[(0,n.jsx)("div",{className:"text-2xl mb-2",children:"\uD83D\uDCAC"}),(0,n.jsx)("div",{children:g("review.selectTextHint")})]})}):(0,n.jsx)("div",{className:"p-3 space-y-3",children:C.map(e=>(0,n.jsx)(b,{ref:t=>{t?j.current.set(e.id,t):j.current.delete(e.id)},comment:e,isActive:e.id===t,isOwnComment:e.authorId===r,isAdmin:l,currentAuthorId:r,canInteract:i,userNameMap:a,onClick:()=>d(e.id),onDelete:()=>u(e.id),onEdit:t=>x(e.id,t),onToggleClosed:t=>m(e.id,t),onAddReply:t=>h(e.id,t),onDeleteReply:t=>f(e.id,t),onEditReply:(t,r)=>p(e.id,t,r)},e.id))})})]})}var j=r(28898),y=r(83519);function k({currentName:e,onConfirm:t,onSkip:r}){let{t:i}=(0,s.Bd)(),[l,a]=(0,o.useState)(e),d=(0,o.useRef)(null);(0,o.useEffect)(()=>{d.current?.select()},[]);let c=()=>{let e=l.trim();e&&t(e)};return(0,n.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:(0,n.jsxs)("div",{className:"bg-card border border-border rounded-xl shadow-2xl w-80 p-5",children:[(0,n.jsx)("h2",{className:"text-base font-semibold mb-1",children:i("review.setNickname")}),(0,n.jsx)("p",{className:"text-xs text-muted-foreground mb-4",children:i("review.nicknameHint")}),(0,n.jsx)("input",{ref:d,type:"text",value:l,onChange:e=>a(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.nativeEvent.isComposing||c(),"Escape"===e.key&&r()},placeholder:i("review.nicknamePlaceholder"),maxLength:20,className:"w-full px-3 py-2 text-sm bg-secondary border border-border rounded-lg focus:outline-none focus:border-brand",autoFocus:!0}),(0,n.jsxs)("div",{className:"flex items-center justify-end gap-2 mt-4",children:[(0,n.jsx)("button",{onClick:r,className:"px-3 py-1.5 text-xs rounded-lg hover:bg-accent transition-colors text-muted-foreground",children:i("review.skipForNow")}),(0,n.jsx)("button",{onClick:c,disabled:!l.trim(),className:"px-4 py-1.5 text-xs rounded-lg bg-brand text-white hover:bg-brand/90 transition-colors disabled:opacity-40",children:i("common.save")})]})]})})}var C=r(19736),N=r(93975),E=r(34075),R=r(86957),S=r(90420);function I({reviewId:e}){let{t}=(0,s.Bd)(),[r,i]=(0,o.useState)(e),[l,d]=(0,o.useState)(null),[c,u]=(0,o.useState)(!0),[x,m]=(0,o.useState)(null),[h,f]=(0,o.useState)(null),[v,g]=(0,o.useState)(!1),b=(0,N.useReviewIdentity)(),{resolvedTheme:L,setTheme:P}=(0,a.D)(),[A,T]=(0,o.useState)({}),[M,D]=(0,o.useState)(!1),[_,F]=(0,o.useState)(!1),B=(0,o.useCallback)(async()=>{let e=await R.t4.runPromiseExit((0,S.BL)());if("Success"===e._tag){let t={};for(let[r,n]of Object.entries(e.value.users))t[r]=n.name;T(t)}},[]);(0,o.useEffect)(()=>{B()},[B]),(0,o.useEffect)(()=>{b.loading||!b.authorId||b.nameConfirmed||D(!0)},[b.loading,b.authorId,b.nameConfirmed]),(0,o.useEffect)(()=>{g("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname)},[]),(0,o.useEffect)(()=>{let e=localStorage.getItem("theme");e&&"system"!==e||P("dark")},[P]);let O=(0,o.useRef)(void 0),W=(0,o.useRef)(void 0),z=(0,o.useCallback)(e=>{e!==r&&(i(e),m(null),f(null),window.history.replaceState(null,"",`/review/${e}`))},[r]),$=(0,o.useCallback)(async()=>{let e=await R.t4.runPromiseExit((0,S.JK)(r));if("Success"===e._tag)d(e.value.review),m(null);else{let r="Fail"===e.cause._tag?e.cause.error:null;r&&"NotFoundError"===r._tag?m(t("review.reviewNotExist")):r&&"AppError"===r._tag?m(t("review.loadFailed")):m(t("review.networkError"))}u(!1)},[r,t]);(0,o.useEffect)(()=>{$()},[$]),(0,o.useEffect)(()=>{let e=setInterval(()=>{$(),B()},1e4);return()=>clearInterval(e)},[$,B]);let H=(0,o.useCallback)(async(e,r)=>{"Success"===(await R.t4.runPromiseExit(e))._tag?await $():(0,E.oR)(t(r),"error")},[$,t]),K=(0,o.useCallback)(async(e,t)=>{b.authorId&&await H((0,S.dU)(r,{author:b.name,authorId:b.authorId,content:e,anchor:t}),"toast.addCommentFailed")},[r,b,H]),V=(0,o.useCallback)(e=>H((0,S.jw)(r,e),"toast.deleteCommentFailed"),[r,H]),Y=(0,o.useCallback)((e,t)=>H((0,S.Y8)(r,{commentId:e,content:t}),"toast.editCommentFailed"),[r,H]),q=(0,o.useCallback)((e,t)=>H((0,S.Y8)(r,{commentId:e,closed:t}),"toast.operationFailed"),[r,H]),U=(0,o.useCallback)(async(e,t)=>{b.authorId&&await H((0,S.mu)(r,{commentId:e,author:b.name,authorId:b.authorId,content:t}),"toast.addReplyFailed")},[r,b,H]),X=(0,o.useCallback)((e,t)=>H((0,S.i7)(r,e,t),"toast.deleteReplyFailed"),[r,H]),J=(0,o.useCallback)((e,t,n)=>H((0,S.vy)(r,{commentId:e,replyId:t,content:n}),"toast.editReplyFailed"),[r,H]),G=(0,o.useCallback)(async()=>{let e=await R.t4.runPromiseExit((0,S._c)());if("Success"===e._tag){let n=e.value.shareBase?`${e.value.shareBase}/review/${r}`:window.location.href;try{await navigator.clipboard.writeText(n),(0,E.oR)(t("toast.linkCopied"),"success")}catch{(0,E.oR)(t("toast.copyFailed"),"error")}}else(0,E.oR)(t("toast.copyFailed"),"error")},[r,t]),Q=(0,o.useCallback)(e=>{f(e),W.current?.(e)},[]),Z=(0,o.useCallback)(e=>{f(e),O.current?.(e)},[]),ee=(0,o.useCallback)(e=>{let t;if(!l||0===l.comments.length)return;let r=[...l.comments].sort((e,t)=>e.anchor.startOffset-t.anchor.startOffset),n=h?r.findIndex(e=>e.id===h):-1;t="next"===e?n<r.length-1?n+1:0:n>0?n-1:r.length-1;let o=r[t];f(o.id),W.current?.(o.id),O.current?.(o.id)},[l,h]);return(0,n.jsxs)("div",{className:"h-screen flex flex-col bg-background text-foreground overflow-hidden",children:[M&&(0,n.jsx)(k,{currentName:b.name,onConfirm:e=>{b.confirmName(e),D(!1),B()},onSkip:()=>D(!1)}),l&&(0,n.jsx)(C.ReviewCommentsListModal,{isOpen:_,onClose:()=>F(!1),comments:l.comments,reviewTitle:l.title,userNameMap:A,onCommentClick:e=>{f(e),W.current?.(e),O.current?.(e)}}),l&&(0,n.jsx)("div",{className:"py-2 bg-secondary border-b border-border flex-shrink-0 flex justify-center",children:(0,n.jsxs)("div",{className:"w-full max-w-[1800px] px-4 flex items-center gap-3",children:[(0,n.jsx)("h1",{className:"text-sm font-semibold truncate",children:l.title}),(0,n.jsx)("span",{className:"text-[11px] text-muted-foreground flex-shrink-0",children:t("review.updatedAt",{date:new Date(l.updatedAt||l.createdAt).toLocaleDateString(void 0,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})})}),(0,n.jsx)("span",{className:"flex-1"}),!v&&(0,n.jsx)("span",{className:`px-2 py-0.5 text-xs rounded-full ${l.active?"bg-green-500/15 text-green-600 dark:text-green-400":"bg-muted text-muted-foreground"}`,children:l.active?t("review.active"):t("review.closed")}),(0,n.jsxs)("button",{onClick:()=>F(!0),className:"px-2 py-1 text-xs rounded hover:bg-accent transition-colors text-muted-foreground flex items-center gap-1",title:t("review.viewAllComments"),children:[(0,n.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("path",{d:"M7 8h10M7 12h4m1 8l-4-4H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-3l-4 4z"})}),t("review.viewCommentBtn")]}),(0,n.jsx)("button",{onClick:G,className:"px-2 py-1 text-xs rounded hover:bg-accent transition-colors text-muted-foreground",children:t("review.copyLink")}),(0,n.jsx)("button",{onClick:()=>P("dark"===L?"light":"dark"),className:"p-1 text-muted-foreground hover:text-foreground hover:bg-accent rounded transition-colors",title:"dark"===L?t("settings.switchLight"):t("settings.switchDark"),children:"dark"===L?(0,n.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("circle",{cx:"12",cy:"12",r:"5"}),(0,n.jsx)("line",{x1:"12",y1:"1",x2:"12",y2:"3"}),(0,n.jsx)("line",{x1:"12",y1:"21",x2:"12",y2:"23"}),(0,n.jsx)("line",{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"}),(0,n.jsx)("line",{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"}),(0,n.jsx)("line",{x1:"1",y1:"12",x2:"3",y2:"12"}),(0,n.jsx)("line",{x1:"21",y1:"12",x2:"23",y2:"12"}),(0,n.jsx)("line",{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"}),(0,n.jsx)("line",{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"})]}):(0,n.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})})}),(0,n.jsx)(j.ReviewIdentitySettings,{identity:b})]})}),(0,n.jsx)("div",{className:"flex-1 flex justify-center overflow-hidden",children:(0,n.jsxs)("div",{className:"w-full max-w-[1800px] flex overflow-hidden",children:[(0,n.jsx)(y.ReviewListPanel,{currentReviewId:r,onSelect:z,readOnly:!v,refreshTrigger:l?.comments.length,onViewComments:e=>{e!==r&&z(e),F(!0)}}),c?(0,n.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,n.jsx)("div",{className:"text-muted-foreground",children:t("common.loading")})}):x||!l?(0,n.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,n.jsxs)("div",{className:"text-center",children:[(0,n.jsx)("div",{className:"text-xl mb-2",children:x||t("review.reviewNotFound")}),(0,n.jsx)("div",{className:"text-sm text-muted-foreground",children:t("review.checkLink")})]})}):(0,n.jsxs)("div",{className:"flex-1 flex overflow-hidden",children:[(0,n.jsx)("div",{className:"flex-1 h-full border-r border-border overflow-hidden",children:(0,n.jsx)(p,{content:l.content,comments:l.comments,activeCommentId:h,isActive:l.active,onAddComment:K,onHighlightClick:Z,scrollToHighlightRef:W})}),(0,n.jsx)("div",{className:"w-[360px] h-full overflow-hidden flex-shrink-0",children:(0,n.jsx)(w,{comments:l.comments,activeCommentId:h,currentAuthorId:b.authorId,isActive:l.active,isAdmin:v,userNameMap:A,onCommentClick:Q,onNavigateComment:ee,onDeleteComment:V,onEditComment:Y,onToggleCommentClosed:q,onAddReply:U,onDeleteReply:X,onEditReply:J,scrollToCommentRef:O})})]})]})})]})}},83519:(e,t,r)=>{"use strict";r.d(t,{ReviewListPanel:()=>d});var n=r(95155),o=r(12115),s=r(79114),i=r(86957),l=r(49433),a=r(90420);function d({currentReviewId:e,onSelect:t,readOnly:r,refreshTrigger:c,onViewComments:u}){let{t:x}=(0,s.Bd)(),[m,h]=(0,o.useState)([]),[f,p]=(0,o.useState)(null),[v,g]=(0,o.useState)(null),[b,w]=(0,o.useState)(!1),[j,y]=(0,o.useState)(null),k=(0,o.useRef)(null),[C,N]=(0,o.useState)(null),E=(0,o.useCallback)(async()=>{let e=await i.t4.runPromiseExit((0,a.Y_)());"Success"===e._tag&&h(e.value.reviews??[])},[]);(0,o.useEffect)(()=>{queueMicrotask(()=>E())},[E]),(0,o.useEffect)(()=>{queueMicrotask(()=>E())},[e,c,E]);let R=(0,o.useCallback)(async(e,t,r)=>{e.stopPropagation(),v||(g(t),"Success"===(await i.t4.runPromiseExit((0,a.Gm)(t,{active:!r})))._tag&&h(e=>e.map(e=>e.id===t?{...e,active:!r}:e)),g(null))},[v]),S=(0,o.useCallback)(async(r,n)=>{if(r.stopPropagation(),!f){if(p(n),"Success"===(await i.t4.runPromiseExit((0,a.Wr)(n)))._tag&&(h(e=>e.filter(e=>e.id!==n)),n===e)){let e=m.filter(e=>e.id!==n);e.length>0&&t(e[0].id)}p(null)}},[f,e,m,t]),I=(0,o.useCallback)((e,t)=>{k.current=t,e.dataTransfer.effectAllowed="move";let r=e.currentTarget;requestAnimationFrame(()=>r.classList.add("opacity-30"))},[]),L=(0,o.useCallback)(e=>{k.current=null,N(null),e.currentTarget instanceof HTMLElement&&e.currentTarget.classList.remove("opacity-30")},[]),P=(0,o.useCallback)((e,t)=>{e.preventDefault(),e.dataTransfer.dropEffect="move",k.current&&k.current!==t&&N(t)},[]),A=(0,o.useCallback)(async(e,t)=>{e.preventDefault(),N(null);let r=k.current;k.current=null,r&&r!==t&&h(e=>{let n=[...e],o=n.findIndex(e=>e.id===r),s=n.findIndex(e=>e.id===t);if(-1===o||-1===s)return e;let[d]=n.splice(o,1);n.splice(s,0,d);let c=n.map(e=>e.id);return i.t4.runFork((0,a.z1)(c).pipe(l.orElse(()=>l.void))),n})},[]),T=r?m.filter(e=>e.active):m,M=!r;return b?(0,n.jsxs)("div",{className:"h-full flex flex-col items-center bg-secondary/50 w-9 flex-shrink-0 border-r border-border",children:[(0,n.jsx)("button",{onClick:()=>w(!1),className:"p-1.5 mt-2 text-muted-foreground hover:text-foreground hover:bg-accent rounded transition-colors",title:x("review.expandList"),children:(0,n.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("polyline",{points:"9 18 15 12 9 6"})})}),(0,n.jsx)("span",{className:"text-[10px] text-muted-foreground/50 mt-2",style:{writingMode:"vertical-rl"},children:r?x("review.nDocs",{count:T.length}):x("review.nReviews",{count:T.length})})]}):(0,n.jsxs)("div",{className:"h-full flex flex-col bg-secondary/50 w-[200px] flex-shrink-0 border-r border-border",children:[(0,n.jsxs)("div",{className:"px-3 py-2 border-b border-border flex-shrink-0 flex items-center justify-between",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:r?x("review.docList"):x("review.allReviewsList")}),(0,n.jsx)("span",{className:"text-xs text-muted-foreground/60 ml-1.5",children:T.length})]}),(0,n.jsx)("button",{onClick:()=>w(!0),className:"p-0.5 text-muted-foreground hover:text-foreground hover:bg-accent rounded transition-colors",title:x("review.collapseList"),children:(0,n.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("polyline",{points:"15 18 9 12 15 6"})})})]}),(0,n.jsxs)("div",{className:"flex-1 overflow-y-auto",children:[T.map(o=>(0,n.jsxs)("div",{draggable:M,onDragStart:M?e=>I(e,o.id):void 0,onDragEnd:M?L:void 0,onDragOver:M?e=>P(e,o.id):void 0,onDrop:M?e=>A(e,o.id):void 0,onMouseEnter:e=>{let t=e.currentTarget.getBoundingClientRect();y({id:o.id,text:o.title,top:t.top+t.height/2,left:t.right})},onMouseLeave:()=>y(e=>e?.id===o.id?null:e),onClick:()=>t(o.id),className:`group px-3 py-2 cursor-pointer border-b transition-colors ${C===o.id?"border-b-brand border-t border-t-transparent":"border-b-border/50"} ${o.id===e?"bg-accent/60":"hover:bg-accent/30"}`,children:[(0,n.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[!r&&(0,n.jsx)("span",{className:`w-1.5 h-1.5 rounded-full flex-shrink-0 ${o.active?"bg-green-500":"bg-muted-foreground/40"}`}),(0,n.jsx)("span",{className:"text-xs truncate flex-1",children:o.title}),o.commentCount>0&&u&&(0,n.jsx)("button",{onClick:e=>{e.stopPropagation(),u(o.id)},className:"flex-shrink-0 p-0.5 rounded text-muted-foreground/0 group-hover:text-muted-foreground/60 hover:!text-brand hover:!bg-brand/10 transition-colors",title:x("review.viewComments"),children:(0,n.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("path",{d:"M7 8h10M7 12h4m1 8l-4-4H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-3l-4 4z"})})}),!r&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{onClick:e=>R(e,o.id,o.active),className:`flex-shrink-0 p-0.5 rounded text-muted-foreground/0 group-hover:text-muted-foreground/60 hover:!text-foreground hover:!bg-accent transition-colors ${v===o.id?"opacity-50 pointer-events-none":""}`,title:o.active?x("review.closeReview"):x("review.reopenReview"),children:o.active?(0,n.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("path",{d:"M18.36 6.64a9 9 0 1 1-12.73 0"}),(0,n.jsx)("line",{x1:"12",y1:"2",x2:"12",y2:"12"})]}):(0,n.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("path",{d:"M18.36 6.64A9 9 0 0 1 12 21 9 9 0 0 1 5.64 6.64"}),(0,n.jsx)("line",{x1:"12",y1:"2",x2:"12",y2:"12"})]})}),(0,n.jsx)("button",{onClick:e=>S(e,o.id),className:`flex-shrink-0 p-0.5 rounded text-muted-foreground/0 group-hover:text-muted-foreground/60 hover:!text-red-500 hover:!bg-red-500/10 transition-colors ${f===o.id?"opacity-50 pointer-events-none":""}`,title:x("review.deleteReview"),children:(0,n.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,n.jsx)("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})})]})]}),o.commentCount>0&&(0,n.jsx)("div",{className:`text-[10px] text-muted-foreground/50 mt-0.5 ${r?"":"pl-3"}`,children:x("review.nComments",{count:o.commentCount})})]},o.id)),0===T.length&&(0,n.jsx)("div",{className:"px-3 py-4 text-xs text-muted-foreground/50 text-center",children:r?x("review.noOpenDocs"):x("review.noReviews")})]}),j&&(0,n.jsx)("div",{className:"fixed z-50 px-2 py-1 text-xs bg-popover text-popover-foreground border border-border rounded shadow-md whitespace-nowrap pointer-events-none",style:{top:j.top,left:j.left+8,transform:"translateY(-50%)"},children:j.text})]})}},93975:(e,t,r)=>{"use strict";r.d(t,{useReviewIdentity:()=>d});var n=r(12115);r(34015);var o=r(69809);function s(){let e=o.A.t("reviewUtils.adjectives",{returnObjects:!0}),t=o.A.t("reviewUtils.nouns",{returnObjects:!0}),r=e[Math.floor(Math.random()*e.length)],n=t[Math.floor(Math.random()*t.length)];return`${r}${n}`}var i=r(49433),l=r(86957),a=r(82680);function d(){let[e,t]=(0,n.useState)(""),[r,o]=(0,n.useState)(""),[d,c]=(0,n.useState)(!1),[u,x]=(0,n.useState)(!0);(0,n.useEffect)(()=>{let e=i.tryPromise({try:async()=>{let e=await fetch("/api/review/identify");return e.ok?await e.json():null},catch:e=>new a.uV({message:"review identify failed",cause:e})}),r=()=>{t(Math.random().toString(36).slice(2,10)),o(s()),c(!1)};l.t4.runPromise(e.pipe(i.match({onSuccess:e=>{e?.authorId?(t(e.authorId),e.name?(o(e.name),c(!0)):(o(s()),c(!1))):r()},onFailure:r}))).finally(()=>x(!1))},[]);let m=(0,n.useCallback)(e=>{let t=i.tryPromise({try:async()=>{await fetch("/api/review/identify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e})})},catch:e=>new a.uV({message:"review identify POST failed",cause:e})});l.t4.runFork(t.pipe(i.orElse(()=>i.void)))},[]),h=(0,n.useCallback)(e=>{let t=e.trim();t&&(o(t),c(!0),m(t))},[m]);return{authorId:e,name:r,nameConfirmed:d,loading:u,setName:(0,n.useCallback)(e=>{let t=e.trim();t&&(o(t),m(t))},[m]),confirmName:h,randomize:(0,n.useCallback)(()=>{o(s())},[])}}},99324:(e,t,r)=>{"use strict";r.d(t,{useReviewHighlights:()=>o});var n=r(12115);function o(e,t,r,o){let[s,i]=(0,n.useState)([]),l=(0,n.useRef)(0),a=(0,n.useRef)(r);(0,n.useEffect)(()=>{a.current=r},[r]);let d=(0,n.useCallback)(()=>{l.current&&cancelAnimationFrame(l.current),l.current=requestAnimationFrame(()=>{let r=e.current,n=t.current;if(!r||!n)return;let o=function(e,t,r){let n=[],o=t.getBoundingClientRect(),s=function(e){let t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),n=0;for(;r.nextNode();){let e=r.currentNode,o=e.textContent?.length||0;t.push({node:e,start:n,end:n+o}),n+=o}return t}(e);if(0===s.length)return n;for(let e of r){let{startOffset:r,endOffset:i}=e.anchor;if(r>=i)continue;let l=null,a=0,d=null,c=0;for(let{node:e,start:t,end:n}of s)if(!l&&r>=t&&r<n&&(l=e,a=r-t),i>t&&i<=n){d=e,c=i-t;break}if(!l||!d)continue;let u=document.createRange();try{u.setStart(l,a),u.setEnd(d,c)}catch{continue}for(let r of u.getClientRects())r.width<1||r.height<1||n.push({commentId:e.id,top:r.top-o.top+t.scrollTop,left:r.left-o.left+t.scrollLeft,width:r.width,height:r.height})}return n}(r,n,a.current);i(e=>e.length===o.length&&e.every((e,t)=>e.commentId===o[t].commentId&&.5>Math.abs(e.top-o[t].top)&&.5>Math.abs(e.left-o[t].left)&&.5>Math.abs(e.width-o[t].width)&&.5>Math.abs(e.height-o[t].height))?e:o)})},[e,t]);(0,n.useEffect)(()=>{d()},[r,o,d]),(0,n.useEffect)(()=>{let t=e.current;if(!t)return;let r=new MutationObserver(()=>d());return r.observe(t,{childList:!0,subtree:!0,characterData:!0}),()=>r.disconnect()},[e,d]),(0,n.useEffect)(()=>{let t=e.current;if(!t)return;let r=new ResizeObserver(()=>d());return r.observe(t),()=>r.disconnect()},[e,d]),(0,n.useEffect)(()=>()=>{l.current&&cancelAnimationFrame(l.current)},[]);let c=(0,n.useCallback)(e=>{let r=t.current;if(!r)return;let n=s.find(t=>t.commentId===e);if(!n)return;let o=r.clientHeight;r.scrollTo({top:n.top-o/2+n.height/2,behavior:"smooth"})},[t,s]);return{rects:s,scrollToHighlight:c}}}},e=>{e.O(0,[8653,7330,8216,4281,9268,327,2171,9469,2032,8441,3794,7358],()=>e(e.s=15335)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2951],{15335:(e,t,r)=>{Promise.resolve().then(r.bind(r,99324)),Promise.resolve().then(r.bind(r,93975)),Promise.resolve().then(r.bind(r,19736)),Promise.resolve().then(r.bind(r,82032)),Promise.resolve().then(r.bind(r,28898)),Promise.resolve().then(r.bind(r,83519)),Promise.resolve().then(r.bind(r,62177)),Promise.resolve().then(r.bind(r,79968))},28898:(e,t,r)=>{"use strict";r.d(t,{ReviewIdentitySettings:()=>i});var n=r(95155),o=r(12115),s=r(79114);function i({identity:e}){let{t}=(0,s.Bd)(),[r,l]=(0,o.useState)(!1),[a,d]=(0,o.useState)(""),c=(0,o.useRef)(null);(0,o.useEffect)(()=>{if(!r)return;let e=e=>{c.current&&!c.current.contains(e.target)&&l(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[r]);let u=()=>{let t=a.trim();t&&t!==e.name&&e.confirmName(t),l(!1)};return(0,n.jsxs)("div",{className:"relative",ref:c,children:[(0,n.jsxs)("button",{onClick:()=>{r||d(e.name),l(!r)},className:"px-2 py-1 text-xs rounded hover:bg-accent transition-colors flex items-center gap-1",title:t("review.identitySettings"),children:[(0,n.jsx)("span",{className:"w-5 h-5 rounded-full bg-brand/20 text-brand flex items-center justify-center text-[10px] font-bold",children:e.name.charAt(0)}),(0,n.jsx)("span",{className:"text-muted-foreground",children:e.name})]}),r&&(0,n.jsxs)("div",{className:"absolute right-0 top-full mt-1 w-56 bg-card border border-border rounded-lg shadow-lg p-3 z-50",children:[(0,n.jsx)("div",{className:"text-xs text-muted-foreground mb-2",children:t("review.reviewNickname")}),(0,n.jsx)("input",{type:"text",value:a,onChange:e=>d(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.nativeEvent.isComposing||u()},className:"w-full px-2 py-1 text-sm bg-secondary border border-border rounded focus:outline-none focus:border-brand",autoFocus:!0}),(0,n.jsxs)("div",{className:"flex items-center gap-2 mt-2",children:[(0,n.jsx)("button",{onClick:()=>{e.randomize(),l(!1)},className:"px-2 py-1 text-xs rounded hover:bg-accent transition-colors text-muted-foreground",children:t("review.random")}),(0,n.jsx)("div",{className:"flex-1"}),(0,n.jsx)("button",{onClick:()=>l(!1),className:"px-2 py-1 text-xs rounded hover:bg-accent transition-colors text-muted-foreground",children:t("common.cancel")}),(0,n.jsx)("button",{onClick:u,className:"px-2 py-1 text-xs rounded bg-brand text-white hover:bg-brand/90 transition-colors",children:t("common.save")})]})]})]})}},62177:(e,t,r)=>{"use strict";r.d(t,{ReviewPage:()=>I});var n=r(95155),o=r(12115),s=r(79114),i=r(13219),l=r(47176),a=r(3238),d=r(97251);function c({selectedText:e,position:t,onSubmit:r,onCancel:i}){let{t:l}=(0,s.Bd)(),[a,d]=(0,o.useState)(""),u=(0,o.useRef)(null),x=(0,o.useRef)(null);(0,o.useEffect)(()=>{u.current?.focus()},[]),(0,o.useEffect)(()=>{let e=e=>{"Escape"===e.key&&i()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[i]),(0,o.useEffect)(()=>{let e=e=>{!x.current||x.current.contains(e.target)||a.trim()||i()};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[a,i]);let m=()=>{let e=a.trim();e&&r(e)},h=e.length>60?e.slice(0,57)+"...":e;return(0,n.jsxs)("div",{ref:x,className:"absolute z-50 w-96 bg-card border border-border rounded-lg shadow-lg",style:{top:t.top,left:Math.max(8,t.left-192)},children:[(0,n.jsxs)("div",{className:"px-3 pt-3 pb-2",children:[(0,n.jsx)("div",{className:"text-xs text-muted-foreground mb-1",children:l("review.selectedText")}),(0,n.jsx)("div",{className:"text-xs bg-yellow-500/10 border-l-2 border-yellow-500 px-2 py-1 rounded-r truncate",children:h})]}),(0,n.jsx)("div",{className:"px-3 pb-2",children:(0,n.jsx)("textarea",{ref:u,value:a,onChange:e=>d(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||e.nativeEvent.isComposing||(e.preventDefault(),m())},placeholder:l("review.addCommentPlaceholder"),className:"w-full px-2 py-1.5 text-sm bg-secondary border border-border rounded resize-none focus:outline-none focus:border-brand",rows:4})}),(0,n.jsxs)("div",{className:"px-3 pb-3 flex items-center justify-between",children:[(0,n.jsx)("span",{className:"text-[10px] text-muted-foreground",children:l("review.enterSubmitHint")}),(0,n.jsxs)("div",{className:"flex gap-1",children:[(0,n.jsx)("button",{onClick:i,className:"px-2 py-1 text-xs rounded hover:bg-accent transition-colors text-muted-foreground",children:l("common.cancel")}),(0,n.jsx)("button",{onClick:m,disabled:!a.trim(),className:"px-2 py-1 text-xs rounded bg-brand text-white hover:bg-brand/90 transition-colors disabled:opacity-40",children:l("review.commentBtn")})]})]})]})}let u={bg:"rgba(234, 179, 8, 0.15)",bgActive:"rgba(234, 179, 8, 0.4)",bgPending:"rgba(234, 179, 8, 0.3)",border:"rgba(234, 179, 8, 0.7)",borderPending:"rgba(234, 179, 8, 0.9)"},x={bg:"rgba(234, 179, 8, 0.1)",bgActive:"rgba(234, 179, 8, 0.3)",bgPending:"rgba(234, 179, 8, 0.2)",border:"rgba(234, 179, 8, 0.5)",borderPending:"rgba(234, 179, 8, 0.7)"};function m({rects:e,activeCommentId:t,pendingCommentId:r,isDark:o}){if(0===e.length)return null;let s=o?x:u;return(0,n.jsx)("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:0,overflow:"visible",pointerEvents:"none",zIndex:5},children:e.map((e,o)=>{let i=e.commentId===t,l=e.commentId===r,a=s.bg;return l?a=s.bgPending:i&&(a=s.bgActive),(0,n.jsx)("div",{"data-comment-id":e.commentId,style:{position:"absolute",top:e.top,left:e.left,width:e.width,height:e.height,backgroundColor:a,borderBottom:`1px solid ${l?s.borderPending:s.border}`,borderRadius:1,pointerEvents:"none"}},`${e.commentId}-${o}`)})})}var h=r(99324);let f=[d.W];function p({content:e,comments:t,activeCommentId:r,isActive:s,onAddComment:d,onHighlightClick:u,scrollToHighlightRef:x}){let{resolvedTheme:v}=(0,a.D)(),g=(0,o.useRef)(null),b=(0,o.useRef)(null),[w,j]=(0,o.useState)(null),y=(0,o.useMemo)(()=>w?[...t,{id:"__pending__",author:"",authorId:"",content:"",anchor:w.anchor,createdAt:0,replies:[]}]:t,[t,w]),{rects:k,scrollToHighlight:C}=(0,h.useReviewHighlights)(g,b,y,r);(0,o.useEffect)(()=>{x.current=C},[C,x]);let N=(0,o.useRef)(k);(0,o.useEffect)(()=>{N.current=k},[k]);let E=(0,o.useCallback)(e=>{let t=window.getSelection(),r=t&&!t.isCollapsed;if(r&&s&&g.current){let r=t.getRangeAt(0);if(g.current.contains(r.startContainer)&&g.current.contains(r.endContainer)){let n=function(e,t){let r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),n=0,o=-1,s=-1;for(;r.nextNode();){let e=r.currentNode,i=e.textContent?.length||0;if(e===t.startContainer&&(o=n+t.startOffset),e===t.endContainer){s=n+t.endOffset;break}n+=i}if(-1===o||-1===s||o>=s)return null;let i=e.textContent?.slice(o,s)||"";return i.trim()?{startOffset:o,endOffset:s,selectedText:i}:null}(g.current,r);if(n){let r=b.current??g.current.parentElement,o=r.getBoundingClientRect();j({anchor:n,position:{top:e.clientY-o.top+r.scrollTop+8,left:e.clientX-o.left}}),t.removeAllRanges();return}}}if(!r&&!w){let t=b.current;if(!t)return;let r=t.getBoundingClientRect(),n=e.clientX-r.left+t.scrollLeft,o=e.clientY-r.top+t.scrollTop;for(let e of N.current)if("__pending__"!==e.commentId&&n>=e.left&&n<=e.left+e.width&&o>=e.top&&o<=e.top+e.height)return void u(e.commentId)}},[s,w,u]),R=(0,o.useCallback)(e=>{w&&(d(e,w.anchor),j(null),window.getSelection()?.removeAllRanges())},[w,d]),S=(0,o.useCallback)(()=>{j(null),window.getSelection()?.removeAllRanges()},[]);return(0,n.jsxs)("div",{className:"h-full flex bg-card",children:[(0,n.jsx)(l.l,{content:e,containerRef:b}),(0,n.jsxs)("div",{ref:b,className:"flex-1 overflow-auto relative",onMouseUp:E,children:[(0,n.jsx)("div",{ref:g,className:"p-6 review-markdown-container",children:(0,n.jsx)(i.T,{content:e,rehypePlugins:f})}),(0,n.jsx)(m,{rects:k,activeCommentId:r,pendingCommentId:w?"__pending__":null,isDark:"dark"===v}),w&&(0,n.jsx)(c,{selectedText:w.anchor.selectedText,position:w.position,onSubmit:R,onCancel:S})]})]})}var v=r(69809);function g(e){let t=new Date(e),r=Math.floor((new Date().getTime()-t.getTime())/6e4);if(r<1)return v.A.t("common.justNow");if(r<60)return v.A.t("common.minutesAgo",{count:r});let n=Math.floor(r/60);if(n<24)return v.A.t("common.hoursAgo",{count:n});let o=Math.floor(n/24);return o<7?v.A.t("common.daysAgo",{count:o}):t.toLocaleDateString()}let b=(0,o.forwardRef)(function({comment:e,isActive:t,isOwnComment:r,isAdmin:i,currentAuthorId:l,canInteract:a,userNameMap:d,onClick:c,onDelete:u,onEdit:x,onToggleClosed:m,onAddReply:h,onDeleteReply:f,onEditReply:p},v){let{t:b}=(0,s.Bd)(),w=(e,t)=>d[e]||t,[j,y]=(0,o.useState)(""),[k,C]=(0,o.useState)(!1),[N,E]=(0,o.useState)(!1),[R,S]=(0,o.useState)(""),[I,L]=(0,o.useState)(null),[P,A]=(0,o.useState)(""),T=()=>{let e=j.trim();e&&(h(e),y(""),C(!1))},M=()=>{let t=R.trim();t&&t!==e.content&&x(t),E(!1)},D=()=>{if(!I)return;let t=P.trim(),r=e.replies.find(e=>e.id===I);!t||r&&t===r.content||p(I,t),L(null)},_=e.anchor.selectedText.length>80?e.anchor.selectedText.slice(0,77)+"...":e.anchor.selectedText,F=i||r||a;return e.closed?(0,n.jsxs)("div",{ref:v,className:"rounded-lg border border-border/50 bg-card/50 opacity-60 hover:opacity-80 transition-all cursor-pointer px-3 py-2 flex items-center gap-2",onClick:c,children:[(0,n.jsx)("span",{className:"w-4 h-4 rounded-full bg-brand/20 text-brand flex items-center justify-center text-[9px] font-bold flex-shrink-0",children:w(e.authorId,e.author).charAt(0)}),(0,n.jsx)("span",{className:"text-xs text-muted-foreground truncate flex-1",children:_}),(0,n.jsx)("span",{className:"text-[10px] text-muted-foreground/50 flex-shrink-0",children:b("review.closedLabel")}),F&&(0,n.jsx)("button",{onClick:e=>{e.stopPropagation(),m(!1)},className:"text-[10px] text-muted-foreground hover:text-foreground transition-colors flex-shrink-0",title:b("review.reopenReview"),children:b("review.reopen")}),(r&&a||i)&&(0,n.jsx)("button",{onClick:e=>{e.stopPropagation(),u()},className:"text-[10px] text-muted-foreground hover:text-red-500 transition-colors flex-shrink-0",title:b("review.deleteComment"),children:b("common.delete")})]}):(0,n.jsxs)("div",{ref:v,className:`rounded-lg border transition-all cursor-pointer ${t?"border-brand bg-brand/5 shadow-sm":"border-border bg-card hover:border-muted-foreground/30"}`,onClick:c,children:[(0,n.jsx)("div",{className:"px-3 pt-3 pb-1",children:(0,n.jsx)("div",{className:"text-xs bg-yellow-500/10 border-l-2 border-yellow-500 px-2 py-1 rounded-r text-muted-foreground truncate",children:_})}),(0,n.jsxs)("div",{className:"px-3 pt-2 flex items-center gap-2",children:[(0,n.jsx)("span",{className:"w-5 h-5 rounded-full bg-brand/20 text-brand flex items-center justify-center text-[10px] font-bold flex-shrink-0",children:w(e.authorId,e.author).charAt(0)}),(0,n.jsx)("span",{className:"text-xs font-medium",children:w(e.authorId,e.author)}),(0,n.jsx)("span",{className:"text-[10px] text-muted-foreground",children:g(e.createdAt)}),(0,n.jsx)("div",{className:"flex-1"}),!N&&(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[F&&(0,n.jsx)("button",{onClick:e=>{e.stopPropagation(),m(!0)},className:"text-[10px] text-muted-foreground hover:text-foreground transition-colors",title:b("review.closeComment"),children:b("review.closeComment")}),r&&a&&(0,n.jsx)("button",{onClick:t=>{t.stopPropagation(),S(e.content),E(!0)},className:"text-[10px] text-muted-foreground hover:text-foreground transition-colors",title:b("review.editComment"),children:b("common.edit")}),(r&&a||i)&&(0,n.jsx)("button",{onClick:e=>{e.stopPropagation(),u()},className:"text-[10px] text-muted-foreground hover:text-red-500 transition-colors",title:b("review.deleteComment"),children:b("common.delete")})]})]}),(0,n.jsx)("div",{className:"px-3 pt-1 pb-2",children:N?(0,n.jsxs)("div",{onClick:e=>e.stopPropagation(),children:[(0,n.jsx)("textarea",{value:R,onChange:e=>S(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||e.nativeEvent.isComposing||(e.preventDefault(),M()),"Escape"===e.key&&E(!1)},className:"w-full px-2 py-1.5 text-sm bg-secondary border border-border rounded resize-none focus:outline-none focus:border-brand",rows:3,autoFocus:!0}),(0,n.jsxs)("div",{className:"flex items-center justify-end gap-1 mt-1",children:[(0,n.jsx)("button",{onClick:()=>E(!1),className:"px-2 py-0.5 text-xs rounded hover:bg-accent transition-colors text-muted-foreground",children:b("common.cancel")}),(0,n.jsx)("button",{onClick:M,disabled:!R.trim(),className:"px-2 py-0.5 text-xs rounded bg-brand text-white hover:bg-brand/90 transition-colors disabled:opacity-40",children:b("common.save")})]})]}):(0,n.jsxs)("div",{className:"text-sm whitespace-pre-wrap",children:[e.content,e.edited&&(0,n.jsx)("span",{className:"text-[10px] text-muted-foreground ml-1",children:b("review.edited")})]})}),e.replies.length>0&&(0,n.jsx)("div",{className:"mx-3 border-t border-border",children:e.replies.map(e=>(0,n.jsxs)("div",{className:"py-2 border-b border-border last:border-b-0",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{className:"w-4 h-4 rounded-full bg-accent text-muted-foreground flex items-center justify-center text-[9px] font-bold flex-shrink-0",children:w(e.authorId,e.author).charAt(0)}),(0,n.jsx)("span",{className:"text-xs font-medium",children:w(e.authorId,e.author)}),(0,n.jsx)("span",{className:"text-[10px] text-muted-foreground",children:g(e.createdAt)}),(0,n.jsx)("div",{className:"flex-1"}),I!==e.id&&(e.authorId===l&&a||i)&&(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[e.authorId===l&&a&&(0,n.jsx)("button",{onClick:t=>{var r;t.stopPropagation(),r=e.id,A(e.content),L(r)},className:"text-[10px] text-muted-foreground hover:text-foreground transition-colors",title:b("review.editReply"),children:b("common.edit")}),(0,n.jsx)("button",{onClick:t=>{t.stopPropagation(),f(e.id)},className:"text-[10px] text-muted-foreground hover:text-red-500 transition-colors",title:b("review.deleteReply"),children:b("common.delete")})]})]}),I===e.id?(0,n.jsxs)("div",{className:"mt-1 pl-6",onClick:e=>e.stopPropagation(),children:[(0,n.jsx)("textarea",{value:P,onChange:e=>A(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||e.nativeEvent.isComposing||(e.preventDefault(),D()),"Escape"===e.key&&L(null)},className:"w-full px-2 py-1 text-sm bg-secondary border border-border rounded resize-none focus:outline-none focus:border-brand",rows:2,autoFocus:!0}),(0,n.jsxs)("div",{className:"flex items-center justify-end gap-1 mt-1",children:[(0,n.jsx)("button",{onClick:()=>L(null),className:"px-2 py-0.5 text-xs rounded hover:bg-accent transition-colors text-muted-foreground",children:b("common.cancel")}),(0,n.jsx)("button",{onClick:D,disabled:!P.trim(),className:"px-2 py-0.5 text-xs rounded bg-brand text-white hover:bg-brand/90 transition-colors disabled:opacity-40",children:b("common.save")})]})]}):(0,n.jsxs)("div",{className:"text-sm mt-0.5 pl-6 whitespace-pre-wrap",children:[e.content,e.edited&&(0,n.jsx)("span",{className:"text-[10px] text-muted-foreground ml-1",children:b("review.edited")})]})]},e.id))}),(0,n.jsx)("div",{className:"px-3 pb-2 pt-1",children:k?(0,n.jsxs)("div",{className:"mt-1",onClick:e=>e.stopPropagation(),children:[(0,n.jsx)("textarea",{value:j,onChange:e=>y(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||e.nativeEvent.isComposing||(e.preventDefault(),T()),"Escape"===e.key&&C(!1)},placeholder:b("review.replyPlaceholder"),className:"w-full px-2 py-1 text-sm bg-secondary border border-border rounded resize-none focus:outline-none focus:border-brand",rows:2,autoFocus:!0}),(0,n.jsxs)("div",{className:"flex items-center justify-end gap-1 mt-1",children:[(0,n.jsx)("button",{onClick:()=>C(!1),className:"px-2 py-0.5 text-xs rounded hover:bg-accent transition-colors text-muted-foreground",children:b("common.cancel")}),(0,n.jsx)("button",{onClick:T,disabled:!j.trim(),className:"px-2 py-0.5 text-xs rounded bg-brand text-white hover:bg-brand/90 transition-colors disabled:opacity-40",children:b("review.reply")})]})]}):a&&(0,n.jsx)("button",{onClick:e=>{e.stopPropagation(),C(!0)},className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:b("review.reply")})})]})});function w({comments:e,activeCommentId:t,currentAuthorId:r,isActive:i,isAdmin:l,userNameMap:a,onCommentClick:d,onNavigateComment:c,onDeleteComment:u,onEditComment:x,onToggleCommentClosed:m,onAddReply:h,onDeleteReply:f,onEditReply:p,scrollToCommentRef:v}){let{t:g}=(0,s.Bd)(),j=(0,o.useRef)(new Map),y=(0,o.useRef)(null),k=(0,o.useCallback)(e=>{let t=j.current.get(e);t&&t.scrollIntoView({behavior:"smooth",block:"center"})},[]);(0,o.useEffect)(()=>{v.current=k},[k,v]);let C=[...e].sort((e,t)=>e.anchor.startOffset-t.anchor.startOffset);return(0,n.jsxs)("div",{ref:y,className:"h-full flex flex-col bg-card",children:[(0,n.jsxs)("div",{className:"px-4 py-2 bg-secondary border-b border-border flex-shrink-0 flex items-center",children:[(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:0===e.length?g("review.selectTextToComment"):t?g("review.commentsNavCount",{current:C.findIndex(e=>e.id===t)+1,total:e.length}):g("review.commentsCount",{count:e.length})}),e.length>0&&(0,n.jsxs)("div",{className:"flex items-center gap-1 ml-2",children:[(0,n.jsxs)("button",{onClick:()=>c("prev"),className:"px-1.5 py-0.5 text-[11px] text-muted-foreground hover:text-foreground hover:bg-accent rounded transition-colors flex items-center gap-0.5",title:g("review.prevComment"),children:[(0,n.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("polyline",{points:"15 18 9 12 15 6"})}),g("review.prevComment")]}),(0,n.jsxs)("button",{onClick:()=>c("next"),className:"px-1.5 py-0.5 text-[11px] text-muted-foreground hover:text-foreground hover:bg-accent rounded transition-colors flex items-center gap-0.5",title:g("review.nextComment"),children:[g("review.nextComment"),(0,n.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("polyline",{points:"9 18 15 12 9 6"})})]})]})]}),(0,n.jsx)("div",{className:"flex-1 overflow-auto",children:0===C.length?(0,n.jsx)("div",{className:"flex items-center justify-center h-full text-muted-foreground text-sm",children:(0,n.jsxs)("div",{className:"text-center",children:[(0,n.jsx)("div",{className:"text-2xl mb-2",children:"\uD83D\uDCAC"}),(0,n.jsx)("div",{children:g("review.selectTextHint")})]})}):(0,n.jsx)("div",{className:"p-3 space-y-3",children:C.map(e=>(0,n.jsx)(b,{ref:t=>{t?j.current.set(e.id,t):j.current.delete(e.id)},comment:e,isActive:e.id===t,isOwnComment:e.authorId===r,isAdmin:l,currentAuthorId:r,canInteract:i,userNameMap:a,onClick:()=>d(e.id),onDelete:()=>u(e.id),onEdit:t=>x(e.id,t),onToggleClosed:t=>m(e.id,t),onAddReply:t=>h(e.id,t),onDeleteReply:t=>f(e.id,t),onEditReply:(t,r)=>p(e.id,t,r)},e.id))})})]})}var j=r(28898),y=r(83519);function k({currentName:e,onConfirm:t,onSkip:r}){let{t:i}=(0,s.Bd)(),[l,a]=(0,o.useState)(e),d=(0,o.useRef)(null);(0,o.useEffect)(()=>{d.current?.select()},[]);let c=()=>{let e=l.trim();e&&t(e)};return(0,n.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",children:(0,n.jsxs)("div",{className:"bg-card border border-border rounded-xl shadow-2xl w-80 p-5",children:[(0,n.jsx)("h2",{className:"text-base font-semibold mb-1",children:i("review.setNickname")}),(0,n.jsx)("p",{className:"text-xs text-muted-foreground mb-4",children:i("review.nicknameHint")}),(0,n.jsx)("input",{ref:d,type:"text",value:l,onChange:e=>a(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.nativeEvent.isComposing||c(),"Escape"===e.key&&r()},placeholder:i("review.nicknamePlaceholder"),maxLength:20,className:"w-full px-3 py-2 text-sm bg-secondary border border-border rounded-lg focus:outline-none focus:border-brand",autoFocus:!0}),(0,n.jsxs)("div",{className:"flex items-center justify-end gap-2 mt-4",children:[(0,n.jsx)("button",{onClick:r,className:"px-3 py-1.5 text-xs rounded-lg hover:bg-accent transition-colors text-muted-foreground",children:i("review.skipForNow")}),(0,n.jsx)("button",{onClick:c,disabled:!l.trim(),className:"px-4 py-1.5 text-xs rounded-lg bg-brand text-white hover:bg-brand/90 transition-colors disabled:opacity-40",children:i("common.save")})]})]})})}var C=r(19736),N=r(93975),E=r(34075),R=r(86957),S=r(90420);function I({reviewId:e}){let{t}=(0,s.Bd)(),[r,i]=(0,o.useState)(e),[l,d]=(0,o.useState)(null),[c,u]=(0,o.useState)(!0),[x,m]=(0,o.useState)(null),[h,f]=(0,o.useState)(null),[v,g]=(0,o.useState)(!1),b=(0,N.useReviewIdentity)(),{resolvedTheme:L,setTheme:P}=(0,a.D)(),[A,T]=(0,o.useState)({}),[M,D]=(0,o.useState)(!1),[_,F]=(0,o.useState)(!1),B=(0,o.useCallback)(async()=>{let e=await R.t4.runPromiseExit((0,S.BL)());if("Success"===e._tag){let t={};for(let[r,n]of Object.entries(e.value.users))t[r]=n.name;T(t)}},[]);(0,o.useEffect)(()=>{B()},[B]),(0,o.useEffect)(()=>{b.loading||!b.authorId||b.nameConfirmed||D(!0)},[b.loading,b.authorId,b.nameConfirmed]),(0,o.useEffect)(()=>{g("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname)},[]),(0,o.useEffect)(()=>{let e=localStorage.getItem("theme");e&&"system"!==e||P("dark")},[P]);let O=(0,o.useRef)(void 0),W=(0,o.useRef)(void 0),z=(0,o.useCallback)(e=>{e!==r&&(i(e),m(null),f(null),window.history.replaceState(null,"",`/review/${e}`))},[r]),$=(0,o.useCallback)(async()=>{let e=await R.t4.runPromiseExit((0,S.JK)(r));if("Success"===e._tag)d(e.value.review),m(null);else{let r="Fail"===e.cause._tag?e.cause.error:null;r&&"NotFoundError"===r._tag?m(t("review.reviewNotExist")):r&&"AppError"===r._tag?m(t("review.loadFailed")):m(t("review.networkError"))}u(!1)},[r,t]);(0,o.useEffect)(()=>{$()},[$]),(0,o.useEffect)(()=>{let e=setInterval(()=>{$(),B()},1e4);return()=>clearInterval(e)},[$,B]);let H=(0,o.useCallback)(async(e,r)=>{"Success"===(await R.t4.runPromiseExit(e))._tag?await $():(0,E.oR)(t(r),"error")},[$,t]),K=(0,o.useCallback)(async(e,t)=>{b.authorId&&await H((0,S.dU)(r,{author:b.name,authorId:b.authorId,content:e,anchor:t}),"toast.addCommentFailed")},[r,b,H]),V=(0,o.useCallback)(e=>H((0,S.jw)(r,e),"toast.deleteCommentFailed"),[r,H]),Y=(0,o.useCallback)((e,t)=>H((0,S.Y8)(r,{commentId:e,content:t}),"toast.editCommentFailed"),[r,H]),q=(0,o.useCallback)((e,t)=>H((0,S.Y8)(r,{commentId:e,closed:t}),"toast.operationFailed"),[r,H]),U=(0,o.useCallback)(async(e,t)=>{b.authorId&&await H((0,S.mu)(r,{commentId:e,author:b.name,authorId:b.authorId,content:t}),"toast.addReplyFailed")},[r,b,H]),X=(0,o.useCallback)((e,t)=>H((0,S.i7)(r,e,t),"toast.deleteReplyFailed"),[r,H]),J=(0,o.useCallback)((e,t,n)=>H((0,S.vy)(r,{commentId:e,replyId:t,content:n}),"toast.editReplyFailed"),[r,H]),G=(0,o.useCallback)(async()=>{let e=await R.t4.runPromiseExit((0,S._c)());if("Success"===e._tag){let n=e.value.shareBase?`${e.value.shareBase}/review/${r}`:window.location.href;try{await navigator.clipboard.writeText(n),(0,E.oR)(t("toast.linkCopied"),"success")}catch{(0,E.oR)(t("toast.copyFailed"),"error")}}else(0,E.oR)(t("toast.copyFailed"),"error")},[r,t]),Q=(0,o.useCallback)(e=>{f(e),W.current?.(e)},[]),Z=(0,o.useCallback)(e=>{f(e),O.current?.(e)},[]),ee=(0,o.useCallback)(e=>{let t;if(!l||0===l.comments.length)return;let r=[...l.comments].sort((e,t)=>e.anchor.startOffset-t.anchor.startOffset),n=h?r.findIndex(e=>e.id===h):-1;t="next"===e?n<r.length-1?n+1:0:n>0?n-1:r.length-1;let o=r[t];f(o.id),W.current?.(o.id),O.current?.(o.id)},[l,h]);return(0,n.jsxs)("div",{className:"h-screen flex flex-col bg-background text-foreground overflow-hidden",children:[M&&(0,n.jsx)(k,{currentName:b.name,onConfirm:e=>{b.confirmName(e),D(!1),B()},onSkip:()=>D(!1)}),l&&(0,n.jsx)(C.ReviewCommentsListModal,{isOpen:_,onClose:()=>F(!1),comments:l.comments,reviewTitle:l.title,userNameMap:A,onCommentClick:e=>{f(e),W.current?.(e),O.current?.(e)}}),l&&(0,n.jsx)("div",{className:"py-2 bg-secondary border-b border-border flex-shrink-0 flex justify-center",children:(0,n.jsxs)("div",{className:"w-full max-w-[1800px] px-4 flex items-center gap-3",children:[(0,n.jsx)("h1",{className:"text-sm font-semibold truncate",children:l.title}),(0,n.jsx)("span",{className:"text-[11px] text-muted-foreground flex-shrink-0",children:t("review.updatedAt",{date:new Date(l.updatedAt||l.createdAt).toLocaleDateString(void 0,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})})}),(0,n.jsx)("span",{className:"flex-1"}),!v&&(0,n.jsx)("span",{className:`px-2 py-0.5 text-xs rounded-full ${l.active?"bg-green-500/15 text-green-600 dark:text-green-400":"bg-muted text-muted-foreground"}`,children:l.active?t("review.active"):t("review.closed")}),(0,n.jsxs)("button",{onClick:()=>F(!0),className:"px-2 py-1 text-xs rounded hover:bg-accent transition-colors text-muted-foreground flex items-center gap-1",title:t("review.viewAllComments"),children:[(0,n.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("path",{d:"M7 8h10M7 12h4m1 8l-4-4H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-3l-4 4z"})}),t("review.viewCommentBtn")]}),(0,n.jsx)("button",{onClick:G,className:"px-2 py-1 text-xs rounded hover:bg-accent transition-colors text-muted-foreground",children:t("review.copyLink")}),(0,n.jsx)("button",{onClick:()=>P("dark"===L?"light":"dark"),className:"p-1 text-muted-foreground hover:text-foreground hover:bg-accent rounded transition-colors",title:"dark"===L?t("settings.switchLight"):t("settings.switchDark"),children:"dark"===L?(0,n.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("circle",{cx:"12",cy:"12",r:"5"}),(0,n.jsx)("line",{x1:"12",y1:"1",x2:"12",y2:"3"}),(0,n.jsx)("line",{x1:"12",y1:"21",x2:"12",y2:"23"}),(0,n.jsx)("line",{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"}),(0,n.jsx)("line",{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"}),(0,n.jsx)("line",{x1:"1",y1:"12",x2:"3",y2:"12"}),(0,n.jsx)("line",{x1:"21",y1:"12",x2:"23",y2:"12"}),(0,n.jsx)("line",{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"}),(0,n.jsx)("line",{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"})]}):(0,n.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})})}),(0,n.jsx)(j.ReviewIdentitySettings,{identity:b})]})}),(0,n.jsx)("div",{className:"flex-1 flex justify-center overflow-hidden",children:(0,n.jsxs)("div",{className:"w-full max-w-[1800px] flex overflow-hidden",children:[(0,n.jsx)(y.ReviewListPanel,{currentReviewId:r,onSelect:z,readOnly:!v,refreshTrigger:l?.comments.length,onViewComments:e=>{e!==r&&z(e),F(!0)}}),c?(0,n.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,n.jsx)("div",{className:"text-muted-foreground",children:t("common.loading")})}):x||!l?(0,n.jsx)("div",{className:"flex-1 flex items-center justify-center",children:(0,n.jsxs)("div",{className:"text-center",children:[(0,n.jsx)("div",{className:"text-xl mb-2",children:x||t("review.reviewNotFound")}),(0,n.jsx)("div",{className:"text-sm text-muted-foreground",children:t("review.checkLink")})]})}):(0,n.jsxs)("div",{className:"flex-1 flex overflow-hidden",children:[(0,n.jsx)("div",{className:"flex-1 h-full border-r border-border overflow-hidden",children:(0,n.jsx)(p,{content:l.content,comments:l.comments,activeCommentId:h,isActive:l.active,onAddComment:K,onHighlightClick:Z,scrollToHighlightRef:W})}),(0,n.jsx)("div",{className:"w-[360px] h-full overflow-hidden flex-shrink-0",children:(0,n.jsx)(w,{comments:l.comments,activeCommentId:h,currentAuthorId:b.authorId,isActive:l.active,isAdmin:v,userNameMap:A,onCommentClick:Q,onNavigateComment:ee,onDeleteComment:V,onEditComment:Y,onToggleCommentClosed:q,onAddReply:U,onDeleteReply:X,onEditReply:J,scrollToCommentRef:O})})]})]})})]})}},83519:(e,t,r)=>{"use strict";r.d(t,{ReviewListPanel:()=>d});var n=r(95155),o=r(12115),s=r(79114),i=r(86957),l=r(49433),a=r(90420);function d({currentReviewId:e,onSelect:t,readOnly:r,refreshTrigger:c,onViewComments:u}){let{t:x}=(0,s.Bd)(),[m,h]=(0,o.useState)([]),[f,p]=(0,o.useState)(null),[v,g]=(0,o.useState)(null),[b,w]=(0,o.useState)(!1),[j,y]=(0,o.useState)(null),k=(0,o.useRef)(null),[C,N]=(0,o.useState)(null),E=(0,o.useCallback)(async()=>{let e=await i.t4.runPromiseExit((0,a.Y_)());"Success"===e._tag&&h(e.value.reviews??[])},[]);(0,o.useEffect)(()=>{queueMicrotask(()=>E())},[E]),(0,o.useEffect)(()=>{queueMicrotask(()=>E())},[e,c,E]);let R=(0,o.useCallback)(async(e,t,r)=>{e.stopPropagation(),v||(g(t),"Success"===(await i.t4.runPromiseExit((0,a.Gm)(t,{active:!r})))._tag&&h(e=>e.map(e=>e.id===t?{...e,active:!r}:e)),g(null))},[v]),S=(0,o.useCallback)(async(r,n)=>{if(r.stopPropagation(),!f){if(p(n),"Success"===(await i.t4.runPromiseExit((0,a.Wr)(n)))._tag&&(h(e=>e.filter(e=>e.id!==n)),n===e)){let e=m.filter(e=>e.id!==n);e.length>0&&t(e[0].id)}p(null)}},[f,e,m,t]),I=(0,o.useCallback)((e,t)=>{k.current=t,e.dataTransfer.effectAllowed="move";let r=e.currentTarget;requestAnimationFrame(()=>r.classList.add("opacity-30"))},[]),L=(0,o.useCallback)(e=>{k.current=null,N(null),e.currentTarget instanceof HTMLElement&&e.currentTarget.classList.remove("opacity-30")},[]),P=(0,o.useCallback)((e,t)=>{e.preventDefault(),e.dataTransfer.dropEffect="move",k.current&&k.current!==t&&N(t)},[]),A=(0,o.useCallback)(async(e,t)=>{e.preventDefault(),N(null);let r=k.current;k.current=null,r&&r!==t&&h(e=>{let n=[...e],o=n.findIndex(e=>e.id===r),s=n.findIndex(e=>e.id===t);if(-1===o||-1===s)return e;let[d]=n.splice(o,1);n.splice(s,0,d);let c=n.map(e=>e.id);return i.t4.runFork((0,a.z1)(c).pipe(l.orElse(()=>l.void))),n})},[]),T=r?m.filter(e=>e.active):m,M=!r;return b?(0,n.jsxs)("div",{className:"h-full flex flex-col items-center bg-secondary/50 w-9 flex-shrink-0 border-r border-border",children:[(0,n.jsx)("button",{onClick:()=>w(!1),className:"p-1.5 mt-2 text-muted-foreground hover:text-foreground hover:bg-accent rounded transition-colors",title:x("review.expandList"),children:(0,n.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("polyline",{points:"9 18 15 12 9 6"})})}),(0,n.jsx)("span",{className:"text-[10px] text-muted-foreground/50 mt-2",style:{writingMode:"vertical-rl"},children:r?x("review.nDocs",{count:T.length}):x("review.nReviews",{count:T.length})})]}):(0,n.jsxs)("div",{className:"h-full flex flex-col bg-secondary/50 w-[200px] flex-shrink-0 border-r border-border",children:[(0,n.jsxs)("div",{className:"px-3 py-2 border-b border-border flex-shrink-0 flex items-center justify-between",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:r?x("review.docList"):x("review.allReviewsList")}),(0,n.jsx)("span",{className:"text-xs text-muted-foreground/60 ml-1.5",children:T.length})]}),(0,n.jsx)("button",{onClick:()=>w(!0),className:"p-0.5 text-muted-foreground hover:text-foreground hover:bg-accent rounded transition-colors",title:x("review.collapseList"),children:(0,n.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("polyline",{points:"15 18 9 12 15 6"})})})]}),(0,n.jsxs)("div",{className:"flex-1 overflow-y-auto",children:[T.map(o=>(0,n.jsxs)("div",{draggable:M,onDragStart:M?e=>I(e,o.id):void 0,onDragEnd:M?L:void 0,onDragOver:M?e=>P(e,o.id):void 0,onDrop:M?e=>A(e,o.id):void 0,onMouseEnter:e=>{let t=e.currentTarget.getBoundingClientRect();y({id:o.id,text:o.title,top:t.top+t.height/2,left:t.right})},onMouseLeave:()=>y(e=>e?.id===o.id?null:e),onClick:()=>t(o.id),className:`group px-3 py-2 cursor-pointer border-b transition-colors ${C===o.id?"border-b-brand border-t border-t-transparent":"border-b-border/50"} ${o.id===e?"bg-accent/60":"hover:bg-accent/30"}`,children:[(0,n.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[!r&&(0,n.jsx)("span",{className:`w-1.5 h-1.5 rounded-full flex-shrink-0 ${o.active?"bg-green-500":"bg-muted-foreground/40"}`}),(0,n.jsx)("span",{className:"text-xs truncate flex-1",children:o.title}),o.commentCount>0&&u&&(0,n.jsx)("button",{onClick:e=>{e.stopPropagation(),u(o.id)},className:"flex-shrink-0 p-0.5 rounded text-muted-foreground/0 group-hover:text-muted-foreground/60 hover:!text-brand hover:!bg-brand/10 transition-colors",title:x("review.viewComments"),children:(0,n.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("path",{d:"M7 8h10M7 12h4m1 8l-4-4H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-3l-4 4z"})})}),!r&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{onClick:e=>R(e,o.id,o.active),className:`flex-shrink-0 p-0.5 rounded text-muted-foreground/0 group-hover:text-muted-foreground/60 hover:!text-foreground hover:!bg-accent transition-colors ${v===o.id?"opacity-50 pointer-events-none":""}`,title:o.active?x("review.closeReview"):x("review.reopenReview"),children:o.active?(0,n.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("path",{d:"M18.36 6.64a9 9 0 1 1-12.73 0"}),(0,n.jsx)("line",{x1:"12",y1:"2",x2:"12",y2:"12"})]}):(0,n.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("path",{d:"M18.36 6.64A9 9 0 0 1 12 21 9 9 0 0 1 5.64 6.64"}),(0,n.jsx)("line",{x1:"12",y1:"2",x2:"12",y2:"12"})]})}),(0,n.jsx)("button",{onClick:e=>S(e,o.id),className:`flex-shrink-0 p-0.5 rounded text-muted-foreground/0 group-hover:text-muted-foreground/60 hover:!text-red-500 hover:!bg-red-500/10 transition-colors ${f===o.id?"opacity-50 pointer-events-none":""}`,title:x("review.deleteReview"),children:(0,n.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,n.jsx)("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})})]})]}),o.commentCount>0&&(0,n.jsx)("div",{className:`text-[10px] text-muted-foreground/50 mt-0.5 ${r?"":"pl-3"}`,children:x("review.nComments",{count:o.commentCount})})]},o.id)),0===T.length&&(0,n.jsx)("div",{className:"px-3 py-4 text-xs text-muted-foreground/50 text-center",children:r?x("review.noOpenDocs"):x("review.noReviews")})]}),j&&(0,n.jsx)("div",{className:"fixed z-50 px-2 py-1 text-xs bg-popover text-popover-foreground border border-border rounded shadow-md whitespace-nowrap pointer-events-none",style:{top:j.top,left:j.left+8,transform:"translateY(-50%)"},children:j.text})]})}},93975:(e,t,r)=>{"use strict";r.d(t,{useReviewIdentity:()=>d});var n=r(12115);r(34015);var o=r(69809);function s(){let e=o.A.t("reviewUtils.adjectives",{returnObjects:!0}),t=o.A.t("reviewUtils.nouns",{returnObjects:!0}),r=e[Math.floor(Math.random()*e.length)],n=t[Math.floor(Math.random()*t.length)];return`${r}${n}`}var i=r(49433),l=r(86957),a=r(82680);function d(){let[e,t]=(0,n.useState)(""),[r,o]=(0,n.useState)(""),[d,c]=(0,n.useState)(!1),[u,x]=(0,n.useState)(!0);(0,n.useEffect)(()=>{let e=i.tryPromise({try:async()=>{let e=await fetch("/api/review/identify");return e.ok?await e.json():null},catch:e=>new a.uV({message:"review identify failed",cause:e})}),r=()=>{t(Math.random().toString(36).slice(2,10)),o(s()),c(!1)};l.t4.runPromise(e.pipe(i.match({onSuccess:e=>{e?.authorId?(t(e.authorId),e.name?(o(e.name),c(!0)):(o(s()),c(!1))):r()},onFailure:r}))).finally(()=>x(!1))},[]);let m=(0,n.useCallback)(e=>{let t=i.tryPromise({try:async()=>{await fetch("/api/review/identify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e})})},catch:e=>new a.uV({message:"review identify POST failed",cause:e})});l.t4.runFork(t.pipe(i.orElse(()=>i.void)))},[]),h=(0,n.useCallback)(e=>{let t=e.trim();t&&(o(t),c(!0),m(t))},[m]);return{authorId:e,name:r,nameConfirmed:d,loading:u,setName:(0,n.useCallback)(e=>{let t=e.trim();t&&(o(t),m(t))},[m]),confirmName:h,randomize:(0,n.useCallback)(()=>{o(s())},[])}}},99324:(e,t,r)=>{"use strict";r.d(t,{useReviewHighlights:()=>o});var n=r(12115);function o(e,t,r,o){let[s,i]=(0,n.useState)([]),l=(0,n.useRef)(0),a=(0,n.useRef)(r);(0,n.useEffect)(()=>{a.current=r},[r]);let d=(0,n.useCallback)(()=>{l.current&&cancelAnimationFrame(l.current),l.current=requestAnimationFrame(()=>{let r=e.current,n=t.current;if(!r||!n)return;let o=function(e,t,r){let n=[],o=t.getBoundingClientRect(),s=function(e){let t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),n=0;for(;r.nextNode();){let e=r.currentNode,o=e.textContent?.length||0;t.push({node:e,start:n,end:n+o}),n+=o}return t}(e);if(0===s.length)return n;for(let e of r){let{startOffset:r,endOffset:i}=e.anchor;if(r>=i)continue;let l=null,a=0,d=null,c=0;for(let{node:e,start:t,end:n}of s)if(!l&&r>=t&&r<n&&(l=e,a=r-t),i>t&&i<=n){d=e,c=i-t;break}if(!l||!d)continue;let u=document.createRange();try{u.setStart(l,a),u.setEnd(d,c)}catch{continue}for(let r of u.getClientRects())r.width<1||r.height<1||n.push({commentId:e.id,top:r.top-o.top+t.scrollTop,left:r.left-o.left+t.scrollLeft,width:r.width,height:r.height})}return n}(r,n,a.current);i(e=>e.length===o.length&&e.every((e,t)=>e.commentId===o[t].commentId&&.5>Math.abs(e.top-o[t].top)&&.5>Math.abs(e.left-o[t].left)&&.5>Math.abs(e.width-o[t].width)&&.5>Math.abs(e.height-o[t].height))?e:o)})},[e,t]);(0,n.useEffect)(()=>{d()},[r,o,d]),(0,n.useEffect)(()=>{let t=e.current;if(!t)return;let r=new MutationObserver(()=>d());return r.observe(t,{childList:!0,subtree:!0,characterData:!0}),()=>r.disconnect()},[e,d]),(0,n.useEffect)(()=>{let t=e.current;if(!t)return;let r=new ResizeObserver(()=>d());return r.observe(t),()=>r.disconnect()},[e,d]),(0,n.useEffect)(()=>()=>{l.current&&cancelAnimationFrame(l.current)},[]);let c=(0,n.useCallback)(e=>{let r=t.current;if(!r)return;let n=s.find(t=>t.commentId===e);if(!n)return;let o=r.clientHeight;r.scrollTo({top:n.top-o/2+n.height/2,behavior:"smooth"})},[t,s]);return{rects:s,scrollToHighlight:c}}}},e=>{e.O(0,[8653,7330,8216,4281,9268,2625,2171,6784,2032,8441,3794,7358],()=>e(e.s=15335)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (()=>{"use strict";var e,a,f,c,d,b,t,r,o={},n={};function i(e){var a=n[e];if(void 0!==a)return a.exports;var f=n[e]={exports:{}},c=!0;try{o[e].call(f.exports,f,f.exports,i),c=!1}finally{c&&delete n[e]}return f.exports}i.m=o,e=[],i.O=(a,f,c,d)=>{if(f){d=d||0;for(var b=e.length;b>0&&e[b-1][2]>d;b--)e[b]=e[b-1];e[b]=[f,c,d];return}for(var t=1/0,b=0;b<e.length;b++){for(var[f,c,d]=e[b],r=!0,o=0;o<f.length;o++)(!1&d||t>=d)&&Object.keys(i.O).every(e=>i.O[e](f[o]))?f.splice(o--,1):(r=!1,d<t&&(t=d));if(r){e.splice(b--,1);var n=c();void 0!==n&&(a=n)}}return a},i.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return i.d(a,{a:a}),a},f=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,i.t=function(e,c){if(1&c&&(e=this(e)),8&c||"object"==typeof e&&e&&(4&c&&e.__esModule||16&c&&"function"==typeof e.then))return e;var d=Object.create(null);i.r(d);var b={};a=a||[null,f({}),f([]),f(f)];for(var t=2&c&&e;"object"==typeof t&&!~a.indexOf(t);t=f(t))Object.getOwnPropertyNames(t).forEach(a=>b[a]=()=>e[a]);return b.default=()=>e,i.d(d,b),d},i.d=(e,a)=>{for(var f in a)i.o(a,f)&&!i.o(e,f)&&Object.defineProperty(e,f,{enumerable:!0,get:a[f]})},i.f={},i.e=e=>Promise.all(Object.keys(i.f).reduce((a,f)=>(i.f[f](e,a),a),[])),i.u=e=>"static/chunks/"+(({535:"4ca0cff5",1290:"cee15710",1630:"53c1bd3f",2577:"d1c28714",3879:"cfdf2ac7",4763:"4402d2ac",4814:"799ebd4e",6666:"570e4624",6814:"7d29de82",7442:"92e53eb0",8835:"ce16f5a9",9312:"1cd6e1d3"})[e]||e)+"."+({10:"6cf001c181ce1098",34:"ce581867cf95e24b",36:"b4a553bf2106f6d3",123:"d6fe9c2353baf42b",194:"76dbdc07cdc2311d",214:"f6bba63dfa159e01",252:"a9e22657cbf67b42",327:"8ecab0b86d52b597",376:"9e742ff6919b2b54",392:"3cad93691f1b7360",400:"59979e0d3ae126e4",425:"9a3434a28926566a",480:"60af76ef919bafc9",535:"07efe2bc8f09d72e",541:"cfa15b606745131a",579:"33fc87fb95163c6a",583:"5061a2f9e7b7e97d",624:"2dd909fbfce98c5e",640:"5bf1e25d0bddf875",698:"e0dda03fd303b96b",794:"06b1ae4fc9cc10a9",816:"f909c891b91aa79f",830:"e49b226c07876df4",840:"a9c535f8868cc4bd",862:"fe3b86ecfb9c0716",893:"c469257bbbbca4f5",966:"57e4cd93c2368d34",968:"237f19aca13543fe",1078:"02294b2934d5bf21",1142:"8248bfb76c695146",1161:"06b33878b495da50",1184:"e80a999422621ed9",1188:"1d4ce94ddc297119",1198:"2a5c215f01a8b74d",1215:"88ed89521e915107",1219:"e27b0bd10b029e40",1247:"64e212daa5bb3925",1248:"36af3903f037c1f5",1274:"ce6906b1fe2e04b8",1280:"1651bb5167170457",1290:"869cef5f741d40c2",1335:"716cc5924662708e",1365:"d7391145ca7f8791",1379:"03e1e0f31bdaa2cc",1410:"276ad7bf15452d27",1413:"117c5958c59cc695",1453:"3c24c777a3deca2d",1456:"217c3832b3e76b7f",1501:"549af2c91a889a08",1534:"918a25b2e3daab22",1556:"96abc9ff91b0c383",1583:"03a06dbdde85ac56",1595:"ee61519fde230f60",1630:"2911e2bac119d910",1656:"a9efc78185a5a85f",1664:"6d5b5e3112b66906",1898:"e07b2b1c5e789b06",1932:"b0aea9b52cabe5e8",1959:"698f1d1accabcbe6",1977:"a06c8e8d2198f765",2013:"598558c40e51e107",2031:"3877441c49bff5cd",2041:"00f4fa0ab26c6ba5",2062:"4a0ab3400fea0e34",2107:"c627112b02b9e1c8",2130:"441ae0f68863efeb",2160:"e38d781fd5c4cde0",2179:"1bf5fe315e6e132c",2215:"9d2d6fbe90ffcc80",2278:"0b14de1cb2041bfd",2349:"ca15d465c4260b4b",2374:"7560cc5c4b8ed6b0",2403:"3dda71b6482dce3b",2485:"3188870375e9fbee",2489:"fcc70bd67329a70e",2501:"4e65b56602faa956",2503:"bb9d3528c3c7ccae",2577:"f52cffdd449a2d14",2580:"69af80de5bcfcefe",2614:"8349e4b407470a30",2710:"fe0656d4ebae4d30",2728:"5fed9ac13dfcd1d1",2735:"5a3e65a580bd5af9",2747:"1d85d388314f2904",2765:"2c6d9772af50feed",2783:"e8bbf2c794ef9750",2812:"dcd8179a6b1d76c9",2839:"c9a657d5b4031a19",2895:"0339e755e79ee794",2954:"7d8daeae6410d4a4",2964:"1a0e15f7327680a2",3072:"b6da96c10080c967",3074:"911584369786c26c",3077:"bf82c0c332cc9fec",3082:"159e4ab8f0572597",3095:"8cd478c42cee505a",3111:"1cf85db2faeb20cc",3175:"538ce7aec634bddb",3186:"3665756f8aae3eb7",3194:"5a331fb5e3dc34e9",3229:"5e91f7d0b135266b",3274:"858f7f9216c8b074",3286:"196c508356bb0b66",3288:"f210cd6796271d4f",3290:"b5ba2646ad49c9fd",3304:"16305e84f4ff6598",3313:"471138e5504646a9",3324:"85e21e3313d0901c",3392:"460f5a753531f501",3419:"78b520dab7e2f96d",3437:"0ad1ecc8c5b8a679",3476:"246c30b47bded3b7",3483:"fc2a0b1185dbaa5d",3492:"ca55498822ad7796",3526:"2d446315a022bc48",3633:"17e30dbc99941b40",3782:"8de9ba0149339c0c",3787:"78ebe68a043f50ce",3860:"be5b243bf7d6618c",3873:"72a9a21509f713f7",3879:"4506d3f72b310564",3942:"085da8d58242eeab",3979:"cea8623f6e9f83ea",4053:"90d71fcbe4ffd852",4080:"08a21dae9e93c547",4163:"c6ebefdd9aa5c358",4174:"b6ff75dd91a2a32e",4223:"c10556cd92fc8018",4242:"3a66c58375424a5b",4275:"8f2e531757c2a813",4295:"6c0f4838b0c9c69d",4309:"a887a10e84c44f9e",4350:"b9d80827e8eee01a",4357:"3fe2cd657f69ff7b",4358:"f89b14cf7a988731",4367:"2610339aa03a9fb3",4370:"ac13b62c811f7ede",4474:"053807fa34066566",4539:"559c223da16b0282",4540:"03df20c499bca840",4553:"a16dba8d6d03226c",4567:"7dc81a6e1c7df565",4583:"2a5df6eb3a6ea30b",4593:"676ac488744e1af5",4608:"1ff246d6b4c771f8",4634:"0332a56fdb8e26c0",4650:"61aec912b756287b",4659:"0b14de1cb2041bfd",4678:"867dfae26694be02",4763:"d0d1b1777a45e0b2",4814:"ccb85c56e9216a38",4823:"907850963b2bcb70",4829:"402ec60139d36417",4900:"b723a916eafdf743",4903:"004f583a12223dac",4963:"0f6678151a159143",4969:"1cb10af9489ea295",4976:"8870319ffbd1c31f",5005:"73745d7fcae6989e",5025:"b597364f0cf8b85a",5061:"025d30c3123eeaf6",5136:"ac897c2a56ee392f",5183:"2e5c895a2be76262",5269:"2e771096652dc113",5318:"d48b9096df0171df",5320:"50f81e2e2f74ba52",5331:"4d5d42e5253dbee2",5338:"76f7773c317f3142",5347:"3192e0021174aaa8",5375:"ebc026e6140b52f1",5424:"4d62f7ee887cd8b9",5482:"0907421e6bf5eeec",5491:"5cc285c4b84dac30",5498:"fa0a196807d6cd2f",5518:"6c3dc9afe81a566b",5520:"eab85d7487e77510",5553:"75df19e3cc1246d6",5575:"3d90c643343a1329",5645:"0b86853ae26d9ee3",5670:"2a1b27a6fdb7aa6b",5690:"d30877807cf5c7eb",5712:"574fca2d5f06483a",5728:"8ef773d61765855e",5750:"aa57d25b74640d23",5755:"00015c284ed6fb39",5920:"9db223329ee9e11a",5922:"ce56021f8cc6ebbc",5937:"0827b5b3eb831ff0",5968:"63d5869783fad06f",5997:"226c07d9e6c496e0",6046:"00d36aea7fd5b147",6089:"2dd351186ec85cc3",6099:"43e6595fcf24fc33",6110:"5ce3f75fced27aaf",6144:"f967a8228bcdf663",6155:"e6cf0ef7c818caa9",6166:"ecd82a9dcb484b97",6290:"e14cf4fc52dd4539",6293:"5914fa73a9f7e777",6311:"5b9c1f74df9a8f67",6331:"758f2f66b92cada9",6339:"bc9301cc22898be0",6358:"8c64eb45ea2b4418",6360:"ff0a9063773daeeb",6402:"a0070d7688ed986b",6412:"089ee787a294d10b",6455:"12b78a2660d609eb",6563:"5d618b608750f4dc",6572:"ca2463823b9b01a0",6580:"75d53830b434451f",6588:"0fbca957af7d9e6a",6647:"584c5d5cd8dfdb5a",6666:"a82467c542429379",6686:"796c782c33ab8ca9",6701:"bff0efb979f71a17",6704:"f280f0ad0f5d8644",6729:"77a5381ac8f5c9ae",6741:"06fdaf122961074e",6814:"30ff86a90cbfd921",6846:"91283f709c40802c",6859:"bacad166ee995fe0",6887:"6c81234d73740fb9",6927:"aa3914b5fb0d14d4",6931:"3c90e9fe0f7f1e66",6938:"0ccf683bd8aa8410",6948:"2719ed8731963209",6959:"5a803faf27f88e9f",7021:"b71240b1d5f6fbe4",7040:"0b14de1cb2041bfd",7041:"174bf29bd837f06d",7082:"fc816f91214026d7",7113:"39704408fef3d26e",7130:"8d24694735826c22",7142:"dbd2cf8141eece5e",7152:"c7b7f1f5e9622f21",7182:"b747e3ef1524157a",7227:"a6b2f01487bb3d9d",7258:"6cbe24c3bcb63d1d",7425:"8b47c8e398a12dd8",7442:"097194be4a0e7d55",7455:"71d54397710b923c",7465:"867e8ff655666413",7524:"9528295a19a5837a",7525:"f433aaf1fe40c90a",7557:"bdc743175125b3d8",7562:"8fdc3abdd45c77ab",7610:"b1439345dbcf285d",7625:"ab66bd50d2fb61a4",7635:"166d83de1d29e758",7636:"bf91320a9ff695af",7785:"1402a4110c300764",7799:"40b047a634f96a24",7819:"3c56f48c0dc5ad5d",7844:"2bb29faa262f313e",7846:"c9705c044ab8f87a",7884:"390ae2efbbf230c4",7889:"af3e581842f34c28",7921:"c361f794cc208e06",7977:"80e4daa080a79c39",8113:"907baefc7227cfb8",8132:"74491162f08af899",8192:"5918d83ac6a0e2dc",8243:"1450514f8390977e",8257:"dd8f651f1a43fee2",8288:"9bd1d26060cb00a1",8318:"81c7ac586fcbb728",8406:"955ccfbb4b70b8c3",8430:"b1f802dcffa41626",8432:"bd66ac287c569996",8457:"b61d96d8d30215fc",8496:"046efd6301dd804f",8545:"be0c9eea6aae5971",8555:"ab3ee6358f1d64da",8656:"2ceb4e5ff5df2fca",8670:"90ede75068758e82",8704:"a1003918da6654da",8773:"614f1f4f0f845c5e",8835:"5c7821b201f35593",8848:"1e41678a18f85af6",8947:"31d3d834d8281fd9",8977:"01b9c429327004e9",9005:"33cf91e617920d4f",9006:"11537833945ec4b8",9012:"6ed079104670001d",9015:"c4e40321a6503a1b",9136:"191be42a2fee842c",9178:"48a90097ee3f0b0c",9186:"3af6fcd13ab752fa",9189:"3e9d29bf275ec462",9220:"bc767ebb5adb9f49",9224:"401f9320ee58570b",9240:"d38ddbe94e0bf128",9261:"303cbbe69262a995",9267:"fbfd65ea31e7448c",9294:"a20485f3282321b3",9302:"726b065f2df0323a",9312:"8121a74b2042bff3",9377:"f9db706e76f04afe",9382:"bc0e11ecc88dd62c",9421:"a5c1dbcfbfdd8f52",9448:"2668b3cd408e86de",9466:"3dacf5969d47ba2c",9521:"e1240eb862eb32dc",9547:"7729788fff21926f",9565:"8de0671f99d12abe",9569:"2f36b2b1c2f838d7",9615:"3b62c13af671f714",9617:"d038e8ea9fc93e24",9648:"8235b6fea7087b3a",9666:"a515fa6d89a71f1c",9680:"d5ceac8967e0b6a8",9690:"7773c72f0eff6dec",9841:"422321143547591a",9842:"3b71b65b30d8ef2a",9996:"18b7bca2f0ab222e"})[e]+".js",i.miniCssF=e=>{},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),c={},i.l=(e,a,f,d)=>{if(c[e])return void c[e].push(a);if(void 0!==f)for(var b,t,r=document.getElementsByTagName("script"),o=0;o<r.length;o++){var n=r[o];if(n.getAttribute("src")==e||n.getAttribute("data-webpack")=="_N_E:"+f){b=n;break}}b||(t=!0,(b=document.createElement("script")).charset="utf-8",b.timeout=120,i.nc&&b.setAttribute("nonce",i.nc),b.setAttribute("data-webpack","_N_E:"+f),b.src=i.tu(e)),c[e]=[a];var u=(a,f)=>{b.onerror=b.onload=null,clearTimeout(l);var d=c[e];if(delete c[e],b.parentNode&&b.parentNode.removeChild(b),d&&d.forEach(e=>e(f)),a)return a(f)},l=setTimeout(u.bind(null,void 0,{type:"timeout",target:b}),12e4);b.onerror=u.bind(null,b.onerror),b.onload=u.bind(null,b.onload),t&&document.head.appendChild(b)},i.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.U=function(e){var a=new URL(e,"x:/"),f={};for(var c in a)f[c]=a[c];for(var c in f.href=e,f.pathname=e.replace(/[?#].*/,""),f.origin=f.protocol="",f.toString=f.toJSON=()=>e,f)Object.defineProperty(this,c,{enumerable:!0,configurable:!0,value:f[c]})},i.U.prototype=URL.prototype,i.tt=()=>(void 0===d&&(d={createScriptURL:e=>e},"u">typeof trustedTypes&&trustedTypes.createPolicy&&(d=trustedTypes.createPolicy("nextjs#bundler",d))),d),i.tu=e=>i.tt().createScriptURL(e),i.p="/_next/",b={8068:0,8225:0,8653:0,3334:0},i.f.j=(e,a)=>{var f=i.o(b,e)?b[e]:void 0;if(0!==f)if(f)a.push(f[2]);else if(/^(8(068|225|653)|3334)$/.test(e))b[e]=0;else{var c=new Promise((a,c)=>f=b[e]=[a,c]);a.push(f[2]=c);var d=i.p+i.u(e),t=Error();i.l(d,a=>{if(i.o(b,e)&&(0!==(f=b[e])&&(b[e]=void 0),f)){var c=a&&("load"===a.type?"missing":a.type),d=a&&a.target&&a.target.src;t.message="Loading chunk "+e+" failed.\n("+c+": "+d+")",t.name="ChunkLoadError",t.type=c,t.request=d,f[1](t)}},"chunk-"+e,e)}},i.O.j=e=>0===b[e],t=(e,a)=>{var f,c,[d,t,r]=a,o=0;if(d.some(e=>0!==b[e])){for(f in t)i.o(t,f)&&(i.m[f]=t[f]);if(r)var n=r(i)}for(e&&e(a);o<d.length;o++)c=d[o],i.o(b,c)&&b[c]&&b[c][0](),b[c]=0;return i.O(n)},(r=self.webpackChunk_N_E=self.webpackChunk_N_E||[]).forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();