@rubytech/create-maxy-code 0.1.571 → 0.1.573

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 (1057) hide show
  1. package/package.json +1 -1
  2. package/payload/platform/config/brand.json +3 -2
  3. package/payload/platform/lib/dispatch-read/dist/config.d.ts +35 -0
  4. package/payload/platform/lib/dispatch-read/dist/config.d.ts.map +1 -0
  5. package/payload/platform/lib/dispatch-read/dist/config.js +84 -0
  6. package/payload/platform/lib/dispatch-read/dist/config.js.map +1 -0
  7. package/payload/platform/lib/dispatch-read/dist/index.d.ts +22 -0
  8. package/payload/platform/lib/dispatch-read/dist/index.d.ts.map +1 -0
  9. package/payload/platform/lib/dispatch-read/dist/index.js +56 -0
  10. package/payload/platform/lib/dispatch-read/dist/index.js.map +1 -0
  11. package/payload/platform/lib/dispatch-read/dist/read.d.ts +107 -0
  12. package/payload/platform/lib/dispatch-read/dist/read.d.ts.map +1 -0
  13. package/payload/platform/lib/dispatch-read/dist/read.js +436 -0
  14. package/payload/platform/lib/dispatch-read/dist/read.js.map +1 -0
  15. package/payload/platform/lib/dispatch-read/dist/session.d.ts +6 -0
  16. package/payload/platform/lib/dispatch-read/dist/session.d.ts.map +1 -0
  17. package/payload/platform/lib/dispatch-read/dist/session.js +52 -0
  18. package/payload/platform/lib/dispatch-read/dist/session.js.map +1 -0
  19. package/payload/platform/lib/dispatch-read/dist/types.d.ts +173 -0
  20. package/payload/platform/lib/dispatch-read/dist/types.d.ts.map +1 -0
  21. package/payload/platform/lib/dispatch-read/dist/types.js +15 -0
  22. package/payload/platform/lib/dispatch-read/dist/types.js.map +1 -0
  23. package/payload/platform/lib/dispatch-read/dist/window.d.ts +48 -0
  24. package/payload/platform/lib/dispatch-read/dist/window.d.ts.map +1 -0
  25. package/payload/platform/lib/dispatch-read/dist/window.js +120 -0
  26. package/payload/platform/lib/dispatch-read/dist/window.js.map +1 -0
  27. package/payload/platform/lib/dispatch-read/dist/zone.d.ts +18 -0
  28. package/payload/platform/lib/dispatch-read/dist/zone.d.ts.map +1 -0
  29. package/payload/platform/lib/dispatch-read/dist/zone.js +41 -0
  30. package/payload/platform/lib/dispatch-read/dist/zone.js.map +1 -0
  31. package/payload/platform/lib/dispatch-read/src/__tests__/config.test.ts +62 -0
  32. package/payload/platform/lib/dispatch-read/src/__tests__/read.test.ts +181 -0
  33. package/payload/platform/lib/dispatch-read/src/__tests__/window.test.ts +137 -0
  34. package/payload/platform/lib/dispatch-read/src/__tests__/worker-day.test.ts +141 -0
  35. package/payload/platform/lib/dispatch-read/src/config.d.ts +26 -0
  36. package/payload/platform/lib/dispatch-read/src/config.d.ts.map +1 -0
  37. package/payload/platform/lib/dispatch-read/src/config.ts +85 -0
  38. package/payload/platform/lib/dispatch-read/src/index.ts +54 -0
  39. package/payload/platform/lib/dispatch-read/src/read.ts +562 -0
  40. package/payload/platform/lib/dispatch-read/src/session.ts +50 -0
  41. package/payload/platform/lib/dispatch-read/src/types.d.ts +143 -0
  42. package/payload/platform/lib/dispatch-read/src/types.d.ts.map +1 -0
  43. package/payload/platform/lib/dispatch-read/src/types.ts +188 -0
  44. package/payload/platform/lib/dispatch-read/src/window.ts +131 -0
  45. package/payload/platform/lib/dispatch-read/src/zone.ts +43 -0
  46. package/payload/platform/lib/dispatch-read/tsconfig.json +9 -0
  47. package/payload/platform/lib/dispatch-read/vitest.config.ts +9 -0
  48. package/payload/platform/lib/dispatch-write/dist/index.d.ts +17 -0
  49. package/payload/platform/lib/dispatch-write/dist/index.d.ts.map +1 -0
  50. package/payload/platform/lib/dispatch-write/dist/index.js +26 -0
  51. package/payload/platform/lib/dispatch-write/dist/index.js.map +1 -0
  52. package/payload/platform/lib/dispatch-write/dist/lifecycle.d.ts +57 -0
  53. package/payload/platform/lib/dispatch-write/dist/lifecycle.d.ts.map +1 -0
  54. package/payload/platform/lib/dispatch-write/dist/lifecycle.js +77 -0
  55. package/payload/platform/lib/dispatch-write/dist/lifecycle.js.map +1 -0
  56. package/payload/platform/lib/dispatch-write/dist/write.d.ts +112 -0
  57. package/payload/platform/lib/dispatch-write/dist/write.d.ts.map +1 -0
  58. package/payload/platform/lib/dispatch-write/dist/write.js +195 -0
  59. package/payload/platform/lib/dispatch-write/dist/write.js.map +1 -0
  60. package/payload/platform/lib/dispatch-write/src/__tests__/lifecycle.test.ts +67 -0
  61. package/payload/platform/lib/dispatch-write/src/__tests__/write.test.ts +158 -0
  62. package/payload/platform/lib/dispatch-write/src/index.ts +37 -0
  63. package/payload/platform/lib/dispatch-write/src/lifecycle.ts +128 -0
  64. package/payload/platform/lib/dispatch-write/src/write.ts +389 -0
  65. package/payload/platform/lib/dispatch-write/tsconfig.json +9 -0
  66. package/payload/platform/lib/graph-style/dist/index.d.ts.map +1 -1
  67. package/payload/platform/lib/graph-style/dist/index.js +8 -0
  68. package/payload/platform/lib/graph-style/dist/index.js.map +1 -1
  69. package/payload/platform/lib/graph-style/src/index.ts +8 -0
  70. package/payload/platform/lib/routine-templates/dist/index.d.ts +2 -2
  71. package/payload/platform/lib/routine-templates/dist/index.d.ts.map +1 -1
  72. package/payload/platform/lib/routine-templates/dist/index.js +9 -1
  73. package/payload/platform/lib/routine-templates/dist/index.js.map +1 -1
  74. package/payload/platform/lib/routine-templates/src/index.ts +14 -2
  75. package/payload/platform/package.json +2 -2
  76. package/payload/platform/plugins/.claude-plugin/marketplace.json +5 -0
  77. package/payload/platform/plugins/admin/hooks/lib/maxy-mcp-plugins.txt +1 -0
  78. package/payload/platform/plugins/admin/mcp/dist/index.js +4 -1
  79. package/payload/platform/plugins/admin/mcp/dist/index.js.map +1 -1
  80. package/payload/platform/plugins/admin/skills/platform-architecture/SKILL.md +203 -48
  81. package/payload/platform/plugins/admin/skills/whats-new/SKILL.md +16 -0
  82. package/payload/platform/plugins/dispatch/.claude-plugin/plugin.json +21 -0
  83. package/payload/platform/plugins/dispatch/PLUGIN.md +116 -0
  84. package/payload/platform/plugins/dispatch/lib/mcp-spawn-tee/index.js +204 -0
  85. package/payload/platform/plugins/dispatch/lib/mcp-spawn-tee/package.json +3 -0
  86. package/payload/platform/plugins/dispatch/mcp/dist/index.d.ts +2 -0
  87. package/payload/platform/plugins/dispatch/mcp/dist/index.d.ts.map +1 -0
  88. package/payload/platform/plugins/dispatch/mcp/dist/index.js +277 -0
  89. package/payload/platform/plugins/dispatch/mcp/dist/index.js.map +1 -0
  90. package/payload/platform/plugins/dispatch/mcp/dist/lib/allocate.d.ts +62 -0
  91. package/payload/platform/plugins/dispatch/mcp/dist/lib/allocate.d.ts.map +1 -0
  92. package/payload/platform/plugins/dispatch/mcp/dist/lib/allocate.js +36 -0
  93. package/payload/platform/plugins/dispatch/mcp/dist/lib/allocate.js.map +1 -0
  94. package/payload/platform/plugins/dispatch/mcp/dist/lib/config.d.ts +38 -0
  95. package/payload/platform/plugins/dispatch/mcp/dist/lib/config.d.ts.map +1 -0
  96. package/payload/platform/plugins/dispatch/mcp/dist/lib/config.js +371 -0
  97. package/payload/platform/plugins/dispatch/mcp/dist/lib/config.js.map +1 -0
  98. package/payload/platform/plugins/dispatch/mcp/dist/lib/ids.d.ts +7 -0
  99. package/payload/platform/plugins/dispatch/mcp/dist/lib/ids.d.ts.map +1 -0
  100. package/payload/platform/plugins/dispatch/mcp/dist/lib/ids.js +16 -0
  101. package/payload/platform/plugins/dispatch/mcp/dist/lib/ids.js.map +1 -0
  102. package/payload/platform/plugins/dispatch/mcp/dist/lib/lifecycle.d.ts +11 -0
  103. package/payload/platform/plugins/dispatch/mcp/dist/lib/lifecycle.d.ts.map +1 -0
  104. package/payload/platform/plugins/dispatch/mcp/dist/lib/lifecycle.js +10 -0
  105. package/payload/platform/plugins/dispatch/mcp/dist/lib/lifecycle.js.map +1 -0
  106. package/payload/platform/plugins/dispatch/mcp/dist/lib/neo4j.d.ts +5 -0
  107. package/payload/platform/plugins/dispatch/mcp/dist/lib/neo4j.d.ts.map +1 -0
  108. package/payload/platform/plugins/dispatch/mcp/dist/lib/neo4j.js +40 -0
  109. package/payload/platform/plugins/dispatch/mcp/dist/lib/neo4j.js.map +1 -0
  110. package/payload/platform/plugins/dispatch/mcp/dist/lib/read.d.ts +11 -0
  111. package/payload/platform/plugins/dispatch/mcp/dist/lib/read.d.ts.map +1 -0
  112. package/payload/platform/plugins/dispatch/mcp/dist/lib/read.js +10 -0
  113. package/payload/platform/plugins/dispatch/mcp/dist/lib/read.js.map +1 -0
  114. package/payload/platform/plugins/dispatch/mcp/dist/lib/types.d.ts +134 -0
  115. package/payload/platform/plugins/dispatch/mcp/dist/lib/types.d.ts.map +1 -0
  116. package/payload/platform/plugins/dispatch/mcp/dist/lib/types.js +12 -0
  117. package/payload/platform/plugins/dispatch/mcp/dist/lib/types.js.map +1 -0
  118. package/payload/platform/plugins/dispatch/mcp/dist/tools/allocate.d.ts +38 -0
  119. package/payload/platform/plugins/dispatch/mcp/dist/tools/allocate.d.ts.map +1 -0
  120. package/payload/platform/plugins/dispatch/mcp/dist/tools/allocate.js +167 -0
  121. package/payload/platform/plugins/dispatch/mcp/dist/tools/allocate.js.map +1 -0
  122. package/payload/platform/plugins/dispatch/mcp/dist/tools/config-get.d.ts +15 -0
  123. package/payload/platform/plugins/dispatch/mcp/dist/tools/config-get.d.ts.map +1 -0
  124. package/payload/platform/plugins/dispatch/mcp/dist/tools/config-get.js +24 -0
  125. package/payload/platform/plugins/dispatch/mcp/dist/tools/config-get.js.map +1 -0
  126. package/payload/platform/plugins/dispatch/mcp/dist/tools/job-create.d.ts +30 -0
  127. package/payload/platform/plugins/dispatch/mcp/dist/tools/job-create.d.ts.map +1 -0
  128. package/payload/platform/plugins/dispatch/mcp/dist/tools/job-create.js +53 -0
  129. package/payload/platform/plugins/dispatch/mcp/dist/tools/job-create.js.map +1 -0
  130. package/payload/platform/plugins/dispatch/mcp/dist/tools/reads.d.ts +38 -0
  131. package/payload/platform/plugins/dispatch/mcp/dist/tools/reads.d.ts.map +1 -0
  132. package/payload/platform/plugins/dispatch/mcp/dist/tools/reads.js +63 -0
  133. package/payload/platform/plugins/dispatch/mcp/dist/tools/reads.js.map +1 -0
  134. package/payload/platform/plugins/dispatch/mcp/dist/tools/result.d.ts +17 -0
  135. package/payload/platform/plugins/dispatch/mcp/dist/tools/result.d.ts.map +1 -0
  136. package/payload/platform/plugins/dispatch/mcp/dist/tools/result.js +7 -0
  137. package/payload/platform/plugins/dispatch/mcp/dist/tools/result.js.map +1 -0
  138. package/payload/platform/plugins/dispatch/mcp/dist/tools/visit-record.d.ts +13 -0
  139. package/payload/platform/plugins/dispatch/mcp/dist/tools/visit-record.d.ts.map +1 -0
  140. package/payload/platform/plugins/dispatch/mcp/dist/tools/visit-record.js +15 -0
  141. package/payload/platform/plugins/dispatch/mcp/dist/tools/visit-record.js.map +1 -0
  142. package/payload/platform/plugins/dispatch/mcp/dist/tools/visit-status-set.d.ts +13 -0
  143. package/payload/platform/plugins/dispatch/mcp/dist/tools/visit-status-set.d.ts.map +1 -0
  144. package/payload/platform/plugins/dispatch/mcp/dist/tools/visit-status-set.js +15 -0
  145. package/payload/platform/plugins/dispatch/mcp/dist/tools/visit-status-set.js.map +1 -0
  146. package/payload/platform/plugins/dispatch/mcp/package.json +21 -0
  147. package/payload/platform/plugins/dispatch/skills/dispatch-setup/SKILL.md +64 -0
  148. package/payload/platform/plugins/docs/references/channel-wake-and-prompt.md +15 -47
  149. package/payload/platform/plugins/docs/references/dispatch.md +159 -0
  150. package/payload/platform/plugins/docs/references/telegram-guide.md +23 -0
  151. package/payload/platform/plugins/email/.claude-plugin/plugin.json +1 -1
  152. package/payload/platform/plugins/email/PLUGIN.md +3 -3
  153. package/payload/platform/plugins/email/mcp/dist/__tests__/email-delete.test.js +126 -4
  154. package/payload/platform/plugins/email/mcp/dist/__tests__/email-delete.test.js.map +1 -1
  155. package/payload/platform/plugins/email/mcp/dist/__tests__/email-draft-send.test.js +36 -5
  156. package/payload/platform/plugins/email/mcp/dist/__tests__/email-draft-send.test.js.map +1 -1
  157. package/payload/platform/plugins/email/mcp/dist/__tests__/imap-drafts.test.js +10 -5
  158. package/payload/platform/plugins/email/mcp/dist/__tests__/imap-drafts.test.js.map +1 -1
  159. package/payload/platform/plugins/email/mcp/dist/index.js +4 -3
  160. package/payload/platform/plugins/email/mcp/dist/index.js.map +1 -1
  161. package/payload/platform/plugins/email/mcp/dist/lib/imap.d.ts +30 -9
  162. package/payload/platform/plugins/email/mcp/dist/lib/imap.d.ts.map +1 -1
  163. package/payload/platform/plugins/email/mcp/dist/lib/imap.js +46 -14
  164. package/payload/platform/plugins/email/mcp/dist/lib/imap.js.map +1 -1
  165. package/payload/platform/plugins/email/mcp/dist/tools/email-delete.d.ts +6 -3
  166. package/payload/platform/plugins/email/mcp/dist/tools/email-delete.d.ts.map +1 -1
  167. package/payload/platform/plugins/email/mcp/dist/tools/email-delete.js +11 -5
  168. package/payload/platform/plugins/email/mcp/dist/tools/email-delete.js.map +1 -1
  169. package/payload/platform/plugins/email/mcp/dist/tools/email-draft-send.d.ts.map +1 -1
  170. package/payload/platform/plugins/email/mcp/dist/tools/email-draft-send.js +41 -10
  171. package/payload/platform/plugins/email/mcp/dist/tools/email-draft-send.js.map +1 -1
  172. package/payload/platform/plugins/email/references/email-reference.md +16 -2
  173. package/payload/platform/plugins/email/skills/email-composition/SKILL.md +4 -3
  174. package/payload/platform/plugins/memory/PLUGIN.md +1 -0
  175. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/dispatch-vertical-coverage.test.d.ts +2 -0
  176. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/dispatch-vertical-coverage.test.d.ts.map +1 -0
  177. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/dispatch-vertical-coverage.test.js +212 -0
  178. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/dispatch-vertical-coverage.test.js.map +1 -0
  179. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/enabled-plugins.test.d.ts +2 -0
  180. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/enabled-plugins.test.d.ts.map +1 -0
  181. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/enabled-plugins.test.js +50 -0
  182. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/enabled-plugins.test.js.map +1 -0
  183. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/ledger-vertical-coverage.test.js +5 -1
  184. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/ledger-vertical-coverage.test.js.map +1 -1
  185. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/phase-estate-census.test.js +3 -1
  186. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/phase-estate-census.test.js.map +1 -1
  187. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/relationship-patterns.test.js +56 -6
  188. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/relationship-patterns.test.js.map +1 -1
  189. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/resolve-active-vertical.test.js +138 -7
  190. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/resolve-active-vertical.test.js.map +1 -1
  191. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-validator.test.js +19 -17
  192. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-validator.test.js.map +1 -1
  193. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-write-path-task802.test.js +16 -5
  194. package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-write-path-task802.test.js.map +1 -1
  195. package/payload/platform/plugins/memory/mcp/dist/lib/dream-cycle/phase-estate-census.d.ts.map +1 -1
  196. package/payload/platform/plugins/memory/mcp/dist/lib/dream-cycle/phase-estate-census.js +7 -3
  197. package/payload/platform/plugins/memory/mcp/dist/lib/dream-cycle/phase-estate-census.js.map +1 -1
  198. package/payload/platform/plugins/memory/mcp/dist/lib/enabled-plugins.d.ts +4 -0
  199. package/payload/platform/plugins/memory/mcp/dist/lib/enabled-plugins.d.ts.map +1 -0
  200. package/payload/platform/plugins/memory/mcp/dist/lib/enabled-plugins.js +44 -0
  201. package/payload/platform/plugins/memory/mcp/dist/lib/enabled-plugins.js.map +1 -0
  202. package/payload/platform/plugins/memory/mcp/dist/lib/relationship-patterns.d.ts +9 -7
  203. package/payload/platform/plugins/memory/mcp/dist/lib/relationship-patterns.d.ts.map +1 -1
  204. package/payload/platform/plugins/memory/mcp/dist/lib/relationship-patterns.js +11 -10
  205. package/payload/platform/plugins/memory/mcp/dist/lib/relationship-patterns.js.map +1 -1
  206. package/payload/platform/plugins/memory/mcp/dist/lib/resolve-active-vertical.d.ts +46 -10
  207. package/payload/platform/plugins/memory/mcp/dist/lib/resolve-active-vertical.d.ts.map +1 -1
  208. package/payload/platform/plugins/memory/mcp/dist/lib/resolve-active-vertical.js +46 -11
  209. package/payload/platform/plugins/memory/mcp/dist/lib/resolve-active-vertical.js.map +1 -1
  210. package/payload/platform/plugins/memory/mcp/dist/lib/schema-validator.d.ts.map +1 -1
  211. package/payload/platform/plugins/memory/mcp/dist/lib/schema-validator.js +16 -18
  212. package/payload/platform/plugins/memory/mcp/dist/lib/schema-validator.js.map +1 -1
  213. package/payload/platform/plugins/memory/mcp/dist/tools/memory-edge.d.ts.map +1 -1
  214. package/payload/platform/plugins/memory/mcp/dist/tools/memory-edge.js +4 -2
  215. package/payload/platform/plugins/memory/mcp/dist/tools/memory-edge.js.map +1 -1
  216. package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.d.ts.map +1 -1
  217. package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.js +8 -5
  218. package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.js.map +1 -1
  219. package/payload/platform/plugins/memory/references/schema-construction.md +51 -75
  220. package/payload/platform/plugins/memory/references/schema-dispatch.md +178 -0
  221. package/payload/platform/plugins/scheduling/PLUGIN.md +4 -0
  222. package/payload/platform/plugins/scheduling/mcp/dist/tools/__tests__/schedule-gate-write.test.js +78 -5
  223. package/payload/platform/plugins/scheduling/mcp/dist/tools/__tests__/schedule-gate-write.test.js.map +1 -1
  224. package/payload/platform/plugins/scheduling/mcp/dist/tools/__tests__/scheduling-gate.test.js +133 -2
  225. package/payload/platform/plugins/scheduling/mcp/dist/tools/__tests__/scheduling-gate.test.js.map +1 -1
  226. package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-event.d.ts +11 -0
  227. package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-event.d.ts.map +1 -1
  228. package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-event.js +30 -1
  229. package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-event.js.map +1 -1
  230. package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-update.d.ts.map +1 -1
  231. package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-update.js +8 -0
  232. package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-update.js.map +1 -1
  233. package/payload/platform/plugins/scheduling/mcp/dist/tools/scheduling-gate.d.ts.map +1 -1
  234. package/payload/platform/plugins/scheduling/mcp/dist/tools/scheduling-gate.js +37 -6
  235. package/payload/platform/plugins/scheduling/mcp/dist/tools/scheduling-gate.js.map +1 -1
  236. package/payload/platform/plugins/telegram/.claude-plugin/plugin.json +1 -1
  237. package/payload/platform/plugins/telegram/PLUGIN.md +18 -2
  238. package/payload/platform/plugins/telegram/mcp/dist/__tests__/api-census.test.d.ts +2 -0
  239. package/payload/platform/plugins/telegram/mcp/dist/__tests__/api-census.test.d.ts.map +1 -0
  240. package/payload/platform/plugins/telegram/mcp/dist/__tests__/api-census.test.js +77 -0
  241. package/payload/platform/plugins/telegram/mcp/dist/__tests__/api-census.test.js.map +1 -0
  242. package/payload/platform/plugins/telegram/mcp/dist/__tests__/api-guard.test.d.ts +2 -0
  243. package/payload/platform/plugins/telegram/mcp/dist/__tests__/api-guard.test.d.ts.map +1 -0
  244. package/payload/platform/plugins/telegram/mcp/dist/__tests__/api-guard.test.js +49 -0
  245. package/payload/platform/plugins/telegram/mcp/dist/__tests__/api-guard.test.js.map +1 -0
  246. package/payload/platform/plugins/telegram/mcp/dist/__tests__/api-methods.test.d.ts +2 -0
  247. package/payload/platform/plugins/telegram/mcp/dist/__tests__/api-methods.test.d.ts.map +1 -0
  248. package/payload/platform/plugins/telegram/mcp/dist/__tests__/api-methods.test.js +25 -0
  249. package/payload/platform/plugins/telegram/mcp/dist/__tests__/api-methods.test.js.map +1 -0
  250. package/payload/platform/plugins/telegram/mcp/dist/__tests__/api-tool.test.d.ts +2 -0
  251. package/payload/platform/plugins/telegram/mcp/dist/__tests__/api-tool.test.d.ts.map +1 -0
  252. package/payload/platform/plugins/telegram/mcp/dist/__tests__/api-tool.test.js +115 -0
  253. package/payload/platform/plugins/telegram/mcp/dist/__tests__/api-tool.test.js.map +1 -0
  254. package/payload/platform/plugins/telegram/mcp/dist/__tests__/bot-api.test.d.ts +2 -0
  255. package/payload/platform/plugins/telegram/mcp/dist/__tests__/bot-api.test.d.ts.map +1 -0
  256. package/payload/platform/plugins/telegram/mcp/dist/__tests__/bot-api.test.js +83 -0
  257. package/payload/platform/plugins/telegram/mcp/dist/__tests__/bot-api.test.js.map +1 -0
  258. package/payload/platform/plugins/telegram/mcp/dist/__tests__/menu-button.test.d.ts +2 -0
  259. package/payload/platform/plugins/telegram/mcp/dist/__tests__/menu-button.test.d.ts.map +1 -0
  260. package/payload/platform/plugins/telegram/mcp/dist/__tests__/menu-button.test.js +51 -0
  261. package/payload/platform/plugins/telegram/mcp/dist/__tests__/menu-button.test.js.map +1 -0
  262. package/payload/platform/plugins/telegram/mcp/dist/index.js +93 -1
  263. package/payload/platform/plugins/telegram/mcp/dist/index.js.map +1 -1
  264. package/payload/platform/plugins/telegram/mcp/dist/lib/api-census.d.ts +32 -0
  265. package/payload/platform/plugins/telegram/mcp/dist/lib/api-census.d.ts.map +1 -0
  266. package/payload/platform/plugins/telegram/mcp/dist/lib/api-census.js +59 -0
  267. package/payload/platform/plugins/telegram/mcp/dist/lib/api-census.js.map +1 -0
  268. package/payload/platform/plugins/telegram/mcp/dist/lib/api-guard.d.ts +18 -0
  269. package/payload/platform/plugins/telegram/mcp/dist/lib/api-guard.d.ts.map +1 -0
  270. package/payload/platform/plugins/telegram/mcp/dist/lib/api-guard.js +35 -0
  271. package/payload/platform/plugins/telegram/mcp/dist/lib/api-guard.js.map +1 -0
  272. package/payload/platform/plugins/telegram/mcp/dist/lib/api-methods.d.ts +38 -0
  273. package/payload/platform/plugins/telegram/mcp/dist/lib/api-methods.d.ts.map +1 -0
  274. package/payload/platform/plugins/telegram/mcp/dist/lib/api-methods.js +21 -0
  275. package/payload/platform/plugins/telegram/mcp/dist/lib/api-methods.js.map +1 -0
  276. package/payload/platform/plugins/telegram/mcp/dist/lib/bot-api.d.ts +24 -0
  277. package/payload/platform/plugins/telegram/mcp/dist/lib/bot-api.d.ts.map +1 -0
  278. package/payload/platform/plugins/telegram/mcp/dist/lib/bot-api.js +57 -0
  279. package/payload/platform/plugins/telegram/mcp/dist/lib/bot-api.js.map +1 -0
  280. package/payload/platform/plugins/telegram/mcp/dist/lib/menu-button.d.ts +32 -0
  281. package/payload/platform/plugins/telegram/mcp/dist/lib/menu-button.d.ts.map +1 -0
  282. package/payload/platform/plugins/telegram/mcp/dist/lib/menu-button.js +56 -0
  283. package/payload/platform/plugins/telegram/mcp/dist/lib/menu-button.js.map +1 -0
  284. package/payload/platform/plugins/telegram/mcp/dist/lib/telegram.d.ts +26 -0
  285. package/payload/platform/plugins/telegram/mcp/dist/lib/telegram.d.ts.map +1 -1
  286. package/payload/platform/plugins/telegram/mcp/dist/lib/telegram.js +16 -0
  287. package/payload/platform/plugins/telegram/mcp/dist/lib/telegram.js.map +1 -1
  288. package/payload/platform/plugins/telegram/mcp/dist/tools/api-census.d.ts +16 -0
  289. package/payload/platform/plugins/telegram/mcp/dist/tools/api-census.d.ts.map +1 -0
  290. package/payload/platform/plugins/telegram/mcp/dist/tools/api-census.js +34 -0
  291. package/payload/platform/plugins/telegram/mcp/dist/tools/api-census.js.map +1 -0
  292. package/payload/platform/plugins/telegram/mcp/dist/tools/api.d.ts +26 -0
  293. package/payload/platform/plugins/telegram/mcp/dist/tools/api.d.ts.map +1 -0
  294. package/payload/platform/plugins/telegram/mcp/dist/tools/api.js +80 -0
  295. package/payload/platform/plugins/telegram/mcp/dist/tools/api.js.map +1 -0
  296. package/payload/platform/plugins/telegram/mcp/dist/tools/message.d.ts +2 -5
  297. package/payload/platform/plugins/telegram/mcp/dist/tools/message.d.ts.map +1 -1
  298. package/payload/platform/plugins/telegram/mcp/dist/tools/message.js +4 -11
  299. package/payload/platform/plugins/telegram/mcp/dist/tools/message.js.map +1 -1
  300. package/payload/platform/plugins/telegram/skills/build/SKILL.md +110 -0
  301. package/payload/platform/plugins/telegram/skills/build/references/methods.md +219 -0
  302. package/payload/platform/scripts/check-no-esm-require.mjs +4 -0
  303. package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.d.ts.map +1 -1
  304. package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js +14 -0
  305. package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js.map +1 -1
  306. package/payload/platform/services/claude-session-manager/dist/http-server.d.ts.map +1 -1
  307. package/payload/platform/services/claude-session-manager/dist/http-server.js +32 -5
  308. package/payload/platform/services/claude-session-manager/dist/http-server.js.map +1 -1
  309. package/payload/platform/services/claude-session-manager/dist/pty-spawner.d.ts +12 -1
  310. package/payload/platform/services/claude-session-manager/dist/pty-spawner.d.ts.map +1 -1
  311. package/payload/platform/services/claude-session-manager/dist/pty-spawner.js +13 -1
  312. package/payload/platform/services/claude-session-manager/dist/pty-spawner.js.map +1 -1
  313. package/payload/platform/services/telegram-channel/dist/jsonl.d.ts +8 -0
  314. package/payload/platform/services/telegram-channel/dist/jsonl.d.ts.map +1 -0
  315. package/payload/platform/services/telegram-channel/dist/jsonl.js +42 -0
  316. package/payload/platform/services/telegram-channel/dist/jsonl.js.map +1 -0
  317. package/payload/platform/services/telegram-channel/dist/notification.d.ts +0 -31
  318. package/payload/platform/services/telegram-channel/dist/notification.d.ts.map +1 -1
  319. package/payload/platform/services/telegram-channel/dist/notification.js +4 -33
  320. package/payload/platform/services/telegram-channel/dist/notification.js.map +1 -1
  321. package/payload/platform/services/telegram-channel/dist/server.d.ts +0 -5
  322. package/payload/platform/services/telegram-channel/dist/server.d.ts.map +1 -1
  323. package/payload/platform/services/telegram-channel/dist/server.js +7 -101
  324. package/payload/platform/services/telegram-channel/dist/server.js.map +1 -1
  325. package/payload/platform/services/whatsapp-channel/dist/notification.d.ts +0 -66
  326. package/payload/platform/services/whatsapp-channel/dist/notification.d.ts.map +1 -1
  327. package/payload/platform/services/whatsapp-channel/dist/notification.js +2 -64
  328. package/payload/platform/services/whatsapp-channel/dist/notification.js.map +1 -1
  329. package/payload/platform/services/whatsapp-channel/dist/server.d.ts +0 -12
  330. package/payload/platform/services/whatsapp-channel/dist/server.d.ts.map +1 -1
  331. package/payload/platform/services/whatsapp-channel/dist/server.js +15 -268
  332. package/payload/platform/services/whatsapp-channel/dist/server.js.map +1 -1
  333. package/payload/server/chunk-6DQCFP2E.js +4868 -0
  334. package/payload/server/maxy-edge.js +1 -1
  335. package/payload/server/public/activity.html +8 -6
  336. package/payload/server/public/agents.html +7 -5
  337. package/payload/server/public/assets/AdminLoginScreens-Dp6k1XgD.js +1 -0
  338. package/payload/server/public/assets/AdminLoginScreens-Dp6k1XgD.js.br +0 -0
  339. package/payload/server/public/assets/AdminLoginScreens-Dp6k1XgD.js.gz +0 -0
  340. package/payload/server/public/assets/AdminShell-D-wB90c3.js +3 -0
  341. package/payload/server/public/assets/AdminShell-D-wB90c3.js.br +0 -0
  342. package/payload/server/public/assets/AdminShell-D-wB90c3.js.gz +0 -0
  343. package/payload/server/public/assets/activity-BJxhblz-.js +1 -0
  344. package/payload/server/public/assets/activity-BJxhblz-.js.br +0 -0
  345. package/payload/server/public/assets/activity-BJxhblz-.js.gz +0 -0
  346. package/payload/server/public/assets/admin-DzEi8shs.js +1 -0
  347. package/payload/server/public/assets/admin-DzEi8shs.js.br +0 -0
  348. package/payload/server/public/assets/admin-DzEi8shs.js.gz +0 -0
  349. package/payload/server/public/assets/agents-DTL8kjfD.js +1 -0
  350. package/payload/server/public/assets/agents-DTL8kjfD.js.br +0 -0
  351. package/payload/server/public/assets/agents-DTL8kjfD.js.gz +0 -0
  352. package/payload/server/public/assets/arc-CWXBKNZd.js +1 -0
  353. package/payload/server/public/assets/arc-CWXBKNZd.js.br +0 -0
  354. package/payload/server/public/assets/arc-CWXBKNZd.js.gz +0 -0
  355. package/payload/server/public/assets/architecture-YZFGNWBL-CIL4I0fc.js +1 -0
  356. package/payload/server/public/assets/architecture-YZFGNWBL-CIL4I0fc.js.br +0 -0
  357. package/payload/server/public/assets/architectureDiagram-Q4EWVU46-C-KPMyG4.js +36 -0
  358. package/payload/server/public/assets/architectureDiagram-Q4EWVU46-C-KPMyG4.js.br +0 -0
  359. package/payload/server/public/assets/architectureDiagram-Q4EWVU46-C-KPMyG4.js.gz +0 -0
  360. package/payload/server/public/assets/blockDiagram-DXYQGD6D-DkYbV9Sf.js +132 -0
  361. package/payload/server/public/assets/blockDiagram-DXYQGD6D-DkYbV9Sf.js.br +0 -0
  362. package/payload/server/public/assets/blockDiagram-DXYQGD6D-DkYbV9Sf.js.gz +0 -0
  363. package/payload/server/public/assets/browser-UZp75zhx.js +1 -0
  364. package/payload/server/public/assets/browser-UZp75zhx.js.br +0 -0
  365. package/payload/server/public/assets/browser-UZp75zhx.js.gz +0 -0
  366. package/payload/server/public/assets/c4Diagram-AHTNJAMY-EYW4kdlx.js +10 -0
  367. package/payload/server/public/assets/c4Diagram-AHTNJAMY-EYW4kdlx.js.br +0 -0
  368. package/payload/server/public/assets/c4Diagram-AHTNJAMY-EYW4kdlx.js.gz +0 -0
  369. package/payload/server/public/assets/calendar-Dfo0O2K_.js +1 -0
  370. package/payload/server/public/assets/calendar-Dfo0O2K_.js.br +0 -0
  371. package/payload/server/public/assets/calendar-Dfo0O2K_.js.gz +0 -0
  372. package/payload/server/public/assets/channel-CbHmRjy_.js +1 -0
  373. package/payload/server/public/assets/channel-CbHmRjy_.js.br +0 -0
  374. package/payload/server/public/assets/chat-ByJAvEWZ.js +1 -0
  375. package/payload/server/public/assets/chat-ByJAvEWZ.js.br +0 -0
  376. package/payload/server/public/assets/chat-ByJAvEWZ.js.gz +0 -0
  377. package/payload/server/public/assets/chevron-left-iG7sYNm7.js +1 -0
  378. package/payload/server/public/assets/chevron-left-iG7sYNm7.js.br +0 -0
  379. package/payload/server/public/assets/chunk-2KRD3SAO-CmAF1UmH.js +1 -0
  380. package/payload/server/public/assets/chunk-2KRD3SAO-CmAF1UmH.js.br +0 -0
  381. package/payload/server/public/assets/chunk-2KRD3SAO-CmAF1UmH.js.gz +0 -0
  382. package/payload/server/public/assets/chunk-336JU56O-CyhmJeMM.js +2 -0
  383. package/payload/server/public/assets/chunk-336JU56O-CyhmJeMM.js.br +0 -0
  384. package/payload/server/public/assets/chunk-336JU56O-CyhmJeMM.js.gz +0 -0
  385. package/payload/server/public/assets/chunk-426QAEUC-C2tnHCM7.js +1 -0
  386. package/payload/server/public/assets/chunk-426QAEUC-C2tnHCM7.js.br +0 -0
  387. package/payload/server/public/assets/chunk-426QAEUC-C2tnHCM7.js.gz +0 -0
  388. package/payload/server/public/assets/chunk-4BX2VUAB-DCzC40-Y.js +1 -0
  389. package/payload/server/public/assets/chunk-4BX2VUAB-DCzC40-Y.js.br +0 -0
  390. package/payload/server/public/assets/chunk-4BX2VUAB-DCzC40-Y.js.gz +0 -0
  391. package/payload/server/public/assets/chunk-4TB4RGXK-D9BXrSA_.js +206 -0
  392. package/payload/server/public/assets/chunk-4TB4RGXK-D9BXrSA_.js.br +0 -0
  393. package/payload/server/public/assets/chunk-4TB4RGXK-D9BXrSA_.js.gz +0 -0
  394. package/payload/server/public/assets/chunk-55IACEB6-BwXC-qTZ.js +1 -0
  395. package/payload/server/public/assets/chunk-55IACEB6-BwXC-qTZ.js.br +0 -0
  396. package/payload/server/public/assets/chunk-55IACEB6-BwXC-qTZ.js.gz +0 -0
  397. package/payload/server/public/assets/chunk-5FUZZQ4R-De7QtXxM.js +62 -0
  398. package/payload/server/public/assets/chunk-5FUZZQ4R-De7QtXxM.js.br +0 -0
  399. package/payload/server/public/assets/chunk-5FUZZQ4R-De7QtXxM.js.gz +0 -0
  400. package/payload/server/public/assets/chunk-5PVQY5BW-B5tsJiCq.js +2 -0
  401. package/payload/server/public/assets/chunk-5PVQY5BW-B5tsJiCq.js.br +0 -0
  402. package/payload/server/public/assets/chunk-5PVQY5BW-B5tsJiCq.js.gz +0 -0
  403. package/payload/server/public/assets/chunk-67CJDMHE-BjTh9STV.js +1 -0
  404. package/payload/server/public/assets/chunk-67CJDMHE-BjTh9STV.js.br +0 -0
  405. package/payload/server/public/assets/chunk-67CJDMHE-BjTh9STV.js.gz +0 -0
  406. package/payload/server/public/assets/chunk-7N4EOEYR-91klRswn.js +1 -0
  407. package/payload/server/public/assets/chunk-7N4EOEYR-91klRswn.js.br +0 -0
  408. package/payload/server/public/assets/chunk-7N4EOEYR-91klRswn.js.gz +0 -0
  409. package/payload/server/public/assets/chunk-AA7GKIK3-XFPGEoBu.js +1 -0
  410. package/payload/server/public/assets/chunk-AA7GKIK3-XFPGEoBu.js.br +3 -0
  411. package/payload/server/public/assets/chunk-AA7GKIK3-XFPGEoBu.js.gz +0 -0
  412. package/payload/server/public/assets/chunk-BSJP7CBP-B7wgMyWq.js +1 -0
  413. package/payload/server/public/assets/chunk-BSJP7CBP-B7wgMyWq.js.br +0 -0
  414. package/payload/server/public/assets/chunk-BSJP7CBP-B7wgMyWq.js.gz +0 -0
  415. package/payload/server/public/assets/chunk-CIAEETIT-WPy9vcOo.js +1 -0
  416. package/payload/server/public/assets/chunk-CIAEETIT-WPy9vcOo.js.br +0 -0
  417. package/payload/server/public/assets/chunk-CIAEETIT-WPy9vcOo.js.gz +0 -0
  418. package/payload/server/public/assets/chunk-EDXVE4YY-D_2JIFFG.js +1 -0
  419. package/payload/server/public/assets/chunk-EDXVE4YY-D_2JIFFG.js.br +0 -0
  420. package/payload/server/public/assets/chunk-EDXVE4YY-D_2JIFFG.js.gz +0 -0
  421. package/payload/server/public/assets/chunk-ENJZ2VHE-xORReRt0.js +10 -0
  422. package/payload/server/public/assets/chunk-ENJZ2VHE-xORReRt0.js.br +0 -0
  423. package/payload/server/public/assets/chunk-ENJZ2VHE-xORReRt0.js.gz +0 -0
  424. package/payload/server/public/assets/chunk-FMBD7UC4-BZsDu4nl.js +15 -0
  425. package/payload/server/public/assets/chunk-FMBD7UC4-BZsDu4nl.js.br +0 -0
  426. package/payload/server/public/assets/chunk-FMBD7UC4-BZsDu4nl.js.gz +0 -0
  427. package/payload/server/public/assets/chunk-FOC6F5B3-QzUp8wXX.js +1 -0
  428. package/payload/server/public/assets/chunk-FOC6F5B3-QzUp8wXX.js.br +0 -0
  429. package/payload/server/public/assets/chunk-FOC6F5B3-QzUp8wXX.js.gz +0 -0
  430. package/payload/server/public/assets/chunk-ICPOFSXX-B64S7i7x.js +122 -0
  431. package/payload/server/public/assets/chunk-ICPOFSXX-B64S7i7x.js.br +0 -0
  432. package/payload/server/public/assets/chunk-ICPOFSXX-B64S7i7x.js.gz +0 -0
  433. package/payload/server/public/assets/chunk-K5T4RW27-DzPc6X1_.js +94 -0
  434. package/payload/server/public/assets/chunk-K5T4RW27-DzPc6X1_.js.br +0 -0
  435. package/payload/server/public/assets/chunk-K5T4RW27-DzPc6X1_.js.gz +0 -0
  436. package/payload/server/public/assets/chunk-KGLVRYIC-A2rPnD7k.js +1 -0
  437. package/payload/server/public/assets/chunk-KGLVRYIC-A2rPnD7k.js.br +1 -0
  438. package/payload/server/public/assets/chunk-KGLVRYIC-A2rPnD7k.js.gz +0 -0
  439. package/payload/server/public/assets/chunk-LIHQZDEY-CaWX327m.js +1 -0
  440. package/payload/server/public/assets/chunk-LIHQZDEY-CaWX327m.js.br +0 -0
  441. package/payload/server/public/assets/chunk-LIHQZDEY-CaWX327m.js.gz +0 -0
  442. package/payload/server/public/assets/chunk-ORNJ4GCN-zrWhdmnc.js +1 -0
  443. package/payload/server/public/assets/chunk-ORNJ4GCN-zrWhdmnc.js.br +0 -0
  444. package/payload/server/public/assets/chunk-ORNJ4GCN-zrWhdmnc.js.gz +0 -0
  445. package/payload/server/public/assets/chunk-OYMX7WX6-B_2qQir6.js +231 -0
  446. package/payload/server/public/assets/chunk-OYMX7WX6-B_2qQir6.js.br +0 -0
  447. package/payload/server/public/assets/chunk-OYMX7WX6-B_2qQir6.js.gz +0 -0
  448. package/payload/server/public/assets/chunk-QZHKN3VN-BzgrgCTo.js +1 -0
  449. package/payload/server/public/assets/chunk-QZHKN3VN-BzgrgCTo.js.br +0 -0
  450. package/payload/server/public/assets/chunk-QZHKN3VN-BzgrgCTo.js.gz +0 -0
  451. package/payload/server/public/assets/chunk-U2HBQHQK-B-IYgxsc.js +70 -0
  452. package/payload/server/public/assets/chunk-U2HBQHQK-B-IYgxsc.js.br +0 -0
  453. package/payload/server/public/assets/chunk-U2HBQHQK-B-IYgxsc.js.gz +0 -0
  454. package/payload/server/public/assets/chunk-X2U36JSP-Y9Y1_EuG.js +1 -0
  455. package/payload/server/public/assets/chunk-X2U36JSP-Y9Y1_EuG.js.br +0 -0
  456. package/payload/server/public/assets/chunk-X2U36JSP-Y9Y1_EuG.js.gz +0 -0
  457. package/payload/server/public/assets/chunk-XPW4576I-C-6yETG_.js +32 -0
  458. package/payload/server/public/assets/chunk-XPW4576I-C-6yETG_.js.br +0 -0
  459. package/payload/server/public/assets/chunk-XPW4576I-C-6yETG_.js.gz +0 -0
  460. package/payload/server/public/assets/chunk-YZCP3GAM-KAuQIU5n.js +1 -0
  461. package/payload/server/public/assets/chunk-YZCP3GAM-KAuQIU5n.js.br +0 -0
  462. package/payload/server/public/assets/chunk-YZCP3GAM-KAuQIU5n.js.gz +0 -0
  463. package/payload/server/public/assets/chunk-ZZ45TVLE-BJcH3KDH.js +1 -0
  464. package/payload/server/public/assets/chunk-ZZ45TVLE-BJcH3KDH.js.br +0 -0
  465. package/payload/server/public/assets/chunk-ZZ45TVLE-BJcH3KDH.js.gz +0 -0
  466. package/payload/server/public/assets/classDiagram-6PBFFD2Q-BxvqeBEj.js +1 -0
  467. package/payload/server/public/assets/classDiagram-6PBFFD2Q-BxvqeBEj.js.br +0 -0
  468. package/payload/server/public/assets/classDiagram-6PBFFD2Q-BxvqeBEj.js.gz +0 -0
  469. package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-R3-NzMRG.js +1 -0
  470. package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-R3-NzMRG.js.br +0 -0
  471. package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-R3-NzMRG.js.gz +0 -0
  472. package/payload/server/public/assets/clock-xSs0UF10.js +1 -0
  473. package/payload/server/public/assets/clock-xSs0UF10.js.br +0 -0
  474. package/payload/server/public/assets/clock-xSs0UF10.js.gz +0 -0
  475. package/payload/server/public/assets/clone-QdOE5SXR.js +1 -0
  476. package/payload/server/public/assets/copy-CGI2jioK.js +1 -0
  477. package/payload/server/public/assets/copy-CGI2jioK.js.br +0 -0
  478. package/payload/server/public/assets/copy-CGI2jioK.js.gz +0 -0
  479. package/payload/server/public/assets/cose-bilkent-S5V4N54A-CcXj8vHa.js +1 -0
  480. package/payload/server/public/assets/cose-bilkent-S5V4N54A-CcXj8vHa.js.br +0 -0
  481. package/payload/server/public/assets/cose-bilkent-S5V4N54A-CcXj8vHa.js.gz +0 -0
  482. package/payload/server/public/assets/dagre-DOtq9kYX.js +1 -0
  483. package/payload/server/public/assets/dagre-DOtq9kYX.js.br +0 -0
  484. package/payload/server/public/assets/dagre-DOtq9kYX.js.gz +0 -0
  485. package/payload/server/public/assets/dagre-KV5264BT-BOhQs4rS.js +4 -0
  486. package/payload/server/public/assets/dagre-KV5264BT-BOhQs4rS.js.br +0 -0
  487. package/payload/server/public/assets/dagre-KV5264BT-BOhQs4rS.js.gz +0 -0
  488. package/payload/server/public/assets/data-dvwK4BcP.js +1 -0
  489. package/payload/server/public/assets/data-dvwK4BcP.js.br +0 -0
  490. package/payload/server/public/assets/data-dvwK4BcP.js.gz +0 -0
  491. package/payload/server/public/assets/diagram-5BDNPKRD-CqJFt5ZM.js +10 -0
  492. package/payload/server/public/assets/diagram-5BDNPKRD-CqJFt5ZM.js.br +0 -0
  493. package/payload/server/public/assets/diagram-5BDNPKRD-CqJFt5ZM.js.gz +0 -0
  494. package/payload/server/public/assets/diagram-G4DWMVQ6-WQIyAZMn.js +24 -0
  495. package/payload/server/public/assets/diagram-G4DWMVQ6-WQIyAZMn.js.br +0 -0
  496. package/payload/server/public/assets/diagram-G4DWMVQ6-WQIyAZMn.js.gz +0 -0
  497. package/payload/server/public/assets/diagram-MMDJMWI5-jcKc4a2w.js +43 -0
  498. package/payload/server/public/assets/diagram-MMDJMWI5-jcKc4a2w.js.br +0 -0
  499. package/payload/server/public/assets/diagram-MMDJMWI5-jcKc4a2w.js.gz +0 -0
  500. package/payload/server/public/assets/diagram-TYMM5635-Bbt2KuWe.js +24 -0
  501. package/payload/server/public/assets/diagram-TYMM5635-Bbt2KuWe.js.br +0 -0
  502. package/payload/server/public/assets/diagram-TYMM5635-Bbt2KuWe.js.gz +0 -0
  503. package/payload/server/public/assets/dispatch-Dx9-ty1K.js +1 -0
  504. package/payload/server/public/assets/dispatch-Dx9-ty1K.js.br +0 -0
  505. package/payload/server/public/assets/dispatch-Dx9-ty1K.js.gz +0 -0
  506. package/payload/server/public/assets/dist-9RiN6lky.js +1 -0
  507. package/payload/server/public/assets/dist-9RiN6lky.js.br +0 -0
  508. package/payload/server/public/assets/dist-9RiN6lky.js.gz +0 -0
  509. package/payload/server/public/assets/erDiagram-SMLLAGMA-BBm6azPJ.js +85 -0
  510. package/payload/server/public/assets/erDiagram-SMLLAGMA-BBm6azPJ.js.br +0 -0
  511. package/payload/server/public/assets/erDiagram-SMLLAGMA-BBm6azPJ.js.gz +0 -0
  512. package/payload/server/public/assets/field-D-P6CsWA.js +1 -0
  513. package/payload/server/public/assets/field-D-P6CsWA.js.br +0 -0
  514. package/payload/server/public/assets/field-D-P6CsWA.js.gz +0 -0
  515. package/payload/server/public/assets/file-text-RWintp9q.js +1 -0
  516. package/payload/server/public/assets/file-text-RWintp9q.js.br +0 -0
  517. package/payload/server/public/assets/file-text-RWintp9q.js.gz +0 -0
  518. package/payload/server/public/assets/flatten-BurGKeIy.js +1 -0
  519. package/payload/server/public/assets/flatten-BurGKeIy.js.br +0 -0
  520. package/payload/server/public/assets/flatten-BurGKeIy.js.gz +0 -0
  521. package/payload/server/public/assets/flowDiagram-DWJPFMVM-_r45DYJ8.js +162 -0
  522. package/payload/server/public/assets/flowDiagram-DWJPFMVM-_r45DYJ8.js.br +0 -0
  523. package/payload/server/public/assets/flowDiagram-DWJPFMVM-_r45DYJ8.js.gz +0 -0
  524. package/payload/server/public/assets/ganttDiagram-T4ZO3ILL-Bjgj9Bej.js +292 -0
  525. package/payload/server/public/assets/ganttDiagram-T4ZO3ILL-Bjgj9Bej.js.br +0 -0
  526. package/payload/server/public/assets/ganttDiagram-T4ZO3ILL-Bjgj9Bej.js.gz +0 -0
  527. package/payload/server/public/assets/gitGraph-7Q5UKJZL-DdbK59od.js +1 -0
  528. package/payload/server/public/assets/gitGraph-7Q5UKJZL-DdbK59od.js.br +0 -0
  529. package/payload/server/public/assets/gitGraphDiagram-UUTBAWPF-DTRdhGJA.js +106 -0
  530. package/payload/server/public/assets/gitGraphDiagram-UUTBAWPF-DTRdhGJA.js.br +0 -0
  531. package/payload/server/public/assets/gitGraphDiagram-UUTBAWPF-DTRdhGJA.js.gz +0 -0
  532. package/payload/server/public/assets/graph-CpBlfYrJ.js +51 -0
  533. package/payload/server/public/assets/graph-CpBlfYrJ.js.br +0 -0
  534. package/payload/server/public/assets/graph-CpBlfYrJ.js.gz +0 -0
  535. package/payload/server/public/assets/graph-labels-BOMyPppX.js +1 -0
  536. package/payload/server/public/assets/graph-labels-BOMyPppX.js.br +0 -0
  537. package/payload/server/public/assets/graph-labels-BOMyPppX.js.gz +0 -0
  538. package/payload/server/public/assets/graphlib-DT4h6-4N.js +1 -0
  539. package/payload/server/public/assets/graphlib-DT4h6-4N.js.br +0 -0
  540. package/payload/server/public/assets/graphlib-DT4h6-4N.js.gz +0 -0
  541. package/payload/server/public/assets/info-OMHHGYJF-BR8gm0wj.js +1 -0
  542. package/payload/server/public/assets/info-OMHHGYJF-BR8gm0wj.js.br +0 -0
  543. package/payload/server/public/assets/infoDiagram-42DDH7IO-Cr3Efss6.js +2 -0
  544. package/payload/server/public/assets/infoDiagram-42DDH7IO-Cr3Efss6.js.br +0 -0
  545. package/payload/server/public/assets/infoDiagram-42DDH7IO-Cr3Efss6.js.gz +0 -0
  546. package/payload/server/public/assets/isEmpty-C5v0-EY7.js +1 -0
  547. package/payload/server/public/assets/isEmpty-C5v0-EY7.js.br +0 -0
  548. package/payload/server/public/assets/isEmpty-C5v0-EY7.js.gz +0 -0
  549. package/payload/server/public/assets/ishikawaDiagram-UXIWVN3A-BklHzVHm.js +70 -0
  550. package/payload/server/public/assets/ishikawaDiagram-UXIWVN3A-BklHzVHm.js.br +0 -0
  551. package/payload/server/public/assets/ishikawaDiagram-UXIWVN3A-BklHzVHm.js.gz +0 -0
  552. package/payload/server/public/assets/journeyDiagram-VCZTEJTY-Ckxx2CmV.js +139 -0
  553. package/payload/server/public/assets/journeyDiagram-VCZTEJTY-Ckxx2CmV.js.br +0 -0
  554. package/payload/server/public/assets/journeyDiagram-VCZTEJTY-Ckxx2CmV.js.gz +0 -0
  555. package/payload/server/public/assets/jsx-runtime-5lmxFBIw.js +9 -0
  556. package/payload/server/public/assets/jsx-runtime-5lmxFBIw.js.br +0 -0
  557. package/payload/server/public/assets/jsx-runtime-5lmxFBIw.js.gz +0 -0
  558. package/payload/server/public/assets/jsx-runtime-DxsQ5Y-z.css +1 -0
  559. package/payload/server/public/assets/jsx-runtime-DxsQ5Y-z.css.br +0 -0
  560. package/payload/server/public/assets/jsx-runtime-DxsQ5Y-z.css.gz +0 -0
  561. package/payload/server/public/assets/kanban-definition-6JOO6SKY-BLELXpqn.js +89 -0
  562. package/payload/server/public/assets/kanban-definition-6JOO6SKY-BLELXpqn.js.br +0 -0
  563. package/payload/server/public/assets/kanban-definition-6JOO6SKY-BLELXpqn.js.gz +0 -0
  564. package/payload/server/public/assets/line-BkI5icOY.js +1 -0
  565. package/payload/server/public/assets/line-BkI5icOY.js.br +0 -0
  566. package/payload/server/public/assets/line-BkI5icOY.js.gz +0 -0
  567. package/payload/server/public/assets/linear-B64ANRVs.js +1 -0
  568. package/payload/server/public/assets/linear-B64ANRVs.js.br +0 -0
  569. package/payload/server/public/assets/linear-B64ANRVs.js.gz +0 -0
  570. package/payload/server/public/assets/mermaid-parser.core-qXPKkdJe.js +4 -0
  571. package/payload/server/public/assets/mermaid-parser.core-qXPKkdJe.js.br +0 -0
  572. package/payload/server/public/assets/mermaid-parser.core-qXPKkdJe.js.gz +0 -0
  573. package/payload/server/public/assets/mermaid.core-BMsz65Wy.js +11 -0
  574. package/payload/server/public/assets/mermaid.core-BMsz65Wy.js.br +0 -0
  575. package/payload/server/public/assets/mermaid.core-BMsz65Wy.js.gz +0 -0
  576. package/payload/server/public/assets/mindmap-definition-QFDTVHPH-DhFTS2sx.js +96 -0
  577. package/payload/server/public/assets/mindmap-definition-QFDTVHPH-DhFTS2sx.js.br +0 -0
  578. package/payload/server/public/assets/mindmap-definition-QFDTVHPH-DhFTS2sx.js.gz +0 -0
  579. package/payload/server/public/assets/operator-DFgW6GiH.js +1 -0
  580. package/payload/server/public/assets/operator-DFgW6GiH.js.br +0 -0
  581. package/payload/server/public/assets/operator-DFgW6GiH.js.gz +0 -0
  582. package/payload/server/public/assets/ordinal-CJ_pL32Z.js +1 -0
  583. package/payload/server/public/assets/ordinal-CJ_pL32Z.js.br +0 -0
  584. package/payload/server/public/assets/ordinal-CJ_pL32Z.js.gz +0 -0
  585. package/payload/server/public/assets/packet-4T2RLAQJ-B31PbAeA.js +1 -0
  586. package/payload/server/public/assets/packet-4T2RLAQJ-B31PbAeA.js.br +0 -0
  587. package/payload/server/public/assets/page-BRShHSH0.js +1 -0
  588. package/payload/server/public/assets/page-BRShHSH0.js.br +0 -0
  589. package/payload/server/public/assets/page-BRShHSH0.js.gz +0 -0
  590. package/payload/server/public/assets/page-BbBCu9iP.js +32 -0
  591. package/payload/server/public/assets/page-BbBCu9iP.js.br +0 -0
  592. package/payload/server/public/assets/page-BbBCu9iP.js.gz +0 -0
  593. package/payload/server/public/assets/pdf-render-ynIPXfRA.js +11 -0
  594. package/payload/server/public/assets/pdf-render-ynIPXfRA.js.br +0 -0
  595. package/payload/server/public/assets/pdf-render-ynIPXfRA.js.gz +0 -0
  596. package/payload/server/public/assets/pie-ZZUOXDRM-BbSc1VXl.js +1 -0
  597. package/payload/server/public/assets/pie-ZZUOXDRM-BbSc1VXl.js.br +0 -0
  598. package/payload/server/public/assets/pieDiagram-DEJITSTG-B2TxkbHK.js +30 -0
  599. package/payload/server/public/assets/pieDiagram-DEJITSTG-B2TxkbHK.js.br +0 -0
  600. package/payload/server/public/assets/pieDiagram-DEJITSTG-B2TxkbHK.js.gz +0 -0
  601. package/payload/server/public/assets/play-BJxUaf6-.js +1 -0
  602. package/payload/server/public/assets/play-BJxUaf6-.js.br +0 -0
  603. package/payload/server/public/assets/play-BJxUaf6-.js.gz +0 -0
  604. package/payload/server/public/assets/public-DkObqkzL.js +1 -0
  605. package/payload/server/public/assets/public-DkObqkzL.js.br +0 -0
  606. package/payload/server/public/assets/public-DkObqkzL.js.gz +0 -0
  607. package/payload/server/public/assets/quadrantDiagram-34T5L4WZ-GsMxIJuS.js +7 -0
  608. package/payload/server/public/assets/quadrantDiagram-34T5L4WZ-GsMxIJuS.js.br +0 -0
  609. package/payload/server/public/assets/quadrantDiagram-34T5L4WZ-GsMxIJuS.js.gz +0 -0
  610. package/payload/server/public/assets/radar-PYXPWWZC-B0La8_mZ.js +1 -0
  611. package/payload/server/public/assets/radar-PYXPWWZC-B0La8_mZ.js.br +0 -0
  612. package/payload/server/public/assets/reduce-CfkEiHc9.js +1 -0
  613. package/payload/server/public/assets/reduce-CfkEiHc9.js.br +0 -0
  614. package/payload/server/public/assets/reduce-CfkEiHc9.js.gz +0 -0
  615. package/payload/server/public/assets/requirementDiagram-MS252O5E-DqNprm-1.js +84 -0
  616. package/payload/server/public/assets/requirementDiagram-MS252O5E-DqNprm-1.js.br +0 -0
  617. package/payload/server/public/assets/requirementDiagram-MS252O5E-DqNprm-1.js.gz +0 -0
  618. package/payload/server/public/assets/rotate-ccw-DgMO69nh.js +1 -0
  619. package/payload/server/public/assets/rotate-ccw-DgMO69nh.js.br +0 -0
  620. package/payload/server/public/assets/rotate-ccw-DgMO69nh.js.gz +0 -0
  621. package/payload/server/public/assets/routines-D9kvg_Xu.js +2 -0
  622. package/payload/server/public/assets/routines-D9kvg_Xu.js.br +0 -0
  623. package/payload/server/public/assets/routines-D9kvg_Xu.js.gz +0 -0
  624. package/payload/server/public/assets/sankeyDiagram-XADWPNL6-B-kRuiuz.js +10 -0
  625. package/payload/server/public/assets/sankeyDiagram-XADWPNL6-B-kRuiuz.js.br +0 -0
  626. package/payload/server/public/assets/sankeyDiagram-XADWPNL6-B-kRuiuz.js.gz +0 -0
  627. package/payload/server/public/assets/sequenceDiagram-FGHM5R23-DEhL9g3K.js +157 -0
  628. package/payload/server/public/assets/sequenceDiagram-FGHM5R23-DEhL9g3K.js.br +0 -0
  629. package/payload/server/public/assets/sequenceDiagram-FGHM5R23-DEhL9g3K.js.gz +0 -0
  630. package/payload/server/public/assets/skills-l5I9HZ3D.js +1 -0
  631. package/payload/server/public/assets/skills-l5I9HZ3D.js.br +0 -0
  632. package/payload/server/public/assets/skills-l5I9HZ3D.js.gz +0 -0
  633. package/payload/server/public/assets/src-BrAT6wKv.js +1 -0
  634. package/payload/server/public/assets/src-BrAT6wKv.js.br +0 -0
  635. package/payload/server/public/assets/src-BrAT6wKv.js.gz +0 -0
  636. package/payload/server/public/assets/stateDiagram-FHFEXIEX-Q-g6BHdz.js +1 -0
  637. package/payload/server/public/assets/stateDiagram-FHFEXIEX-Q-g6BHdz.js.br +0 -0
  638. package/payload/server/public/assets/stateDiagram-FHFEXIEX-Q-g6BHdz.js.gz +0 -0
  639. package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-ssRWItVj.js +1 -0
  640. package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-ssRWItVj.js.br +0 -0
  641. package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-ssRWItVj.js.gz +0 -0
  642. package/payload/server/public/assets/tasks-C2qJMv6i.js +3 -0
  643. package/payload/server/public/assets/tasks-C2qJMv6i.js.br +0 -0
  644. package/payload/server/public/assets/tasks-C2qJMv6i.js.gz +0 -0
  645. package/payload/server/public/assets/timeline-definition-GMOUNBTQ-B3-52q4Q.js +120 -0
  646. package/payload/server/public/assets/timeline-definition-GMOUNBTQ-B3-52q4Q.js.br +0 -0
  647. package/payload/server/public/assets/timeline-definition-GMOUNBTQ-B3-52q4Q.js.gz +0 -0
  648. package/payload/server/public/assets/treeView-SZITEDCU-BBR3hu9P.js +1 -0
  649. package/payload/server/public/assets/treeView-SZITEDCU-BBR3hu9P.js.br +0 -0
  650. package/payload/server/public/assets/treemap-W4RFUUIX-wSQMuzBT.js +1 -0
  651. package/payload/server/public/assets/treemap-W4RFUUIX-wSQMuzBT.js.br +0 -0
  652. package/payload/server/public/assets/triangle-alert-BnC67uSs.js +1 -0
  653. package/payload/server/public/assets/triangle-alert-BnC67uSs.js.br +0 -0
  654. package/payload/server/public/assets/triangle-alert-BnC67uSs.js.gz +0 -0
  655. package/payload/server/public/assets/useCopyFeedback-1RmgkTFh.js +1 -0
  656. package/payload/server/public/assets/useCopyFeedback-1RmgkTFh.js.br +0 -0
  657. package/payload/server/public/assets/useCopyFeedback-1RmgkTFh.js.gz +0 -0
  658. package/payload/server/public/assets/useMediaQuery-BQslddHQ.js +6 -0
  659. package/payload/server/public/assets/useMediaQuery-BQslddHQ.js.br +0 -0
  660. package/payload/server/public/assets/useMediaQuery-BQslddHQ.js.gz +0 -0
  661. package/payload/server/public/assets/useMediaQuery-DXAuc8G-.css +1 -0
  662. package/payload/server/public/assets/useMediaQuery-DXAuc8G-.css.br +0 -0
  663. package/payload/server/public/assets/useMediaQuery-DXAuc8G-.css.gz +0 -0
  664. package/payload/server/public/assets/useVoiceRecorder-BeZNQEC4.js +2 -0
  665. package/payload/server/public/assets/useVoiceRecorder-BeZNQEC4.js.br +0 -0
  666. package/payload/server/public/assets/useVoiceRecorder-BeZNQEC4.js.gz +0 -0
  667. package/payload/server/public/assets/vennDiagram-DHZGUBPP-Bzm1VDi1.js +34 -0
  668. package/payload/server/public/assets/vennDiagram-DHZGUBPP-Bzm1VDi1.js.br +0 -0
  669. package/payload/server/public/assets/vennDiagram-DHZGUBPP-Bzm1VDi1.js.gz +0 -0
  670. package/payload/server/public/assets/wardley-RL74JXVD-3QaECtQN.js +1 -0
  671. package/payload/server/public/assets/wardley-RL74JXVD-3QaECtQN.js.br +0 -0
  672. package/payload/server/public/assets/wardleyDiagram-NUSXRM2D-DIqGZr4v.js +20 -0
  673. package/payload/server/public/assets/wardleyDiagram-NUSXRM2D-DIqGZr4v.js.br +0 -0
  674. package/payload/server/public/assets/wardleyDiagram-NUSXRM2D-DIqGZr4v.js.gz +0 -0
  675. package/payload/server/public/assets/wrench-D4ufQG6C.js +1 -0
  676. package/payload/server/public/assets/wrench-D4ufQG6C.js.br +0 -0
  677. package/payload/server/public/assets/wrench-D4ufQG6C.js.gz +0 -0
  678. package/payload/server/public/assets/xychartDiagram-5P7HB3ND-0W2L2hQA.js +7 -0
  679. package/payload/server/public/assets/xychartDiagram-5P7HB3ND-0W2L2hQA.js.br +0 -0
  680. package/payload/server/public/assets/xychartDiagram-5P7HB3ND-0W2L2hQA.js.gz +0 -0
  681. package/payload/server/public/browser.html +7 -5
  682. package/payload/server/public/calendar.html +10 -8
  683. package/payload/server/public/chat.html +17 -15
  684. package/payload/server/public/data.html +16 -14
  685. package/payload/server/public/dispatch.html +20 -0
  686. package/payload/server/public/field.html +17 -0
  687. package/payload/server/public/graph.html +12 -10
  688. package/payload/server/public/index.html +18 -16
  689. package/payload/server/public/operator.html +18 -16
  690. package/payload/server/public/public.html +17 -15
  691. package/payload/server/public/routines.html +11 -9
  692. package/payload/server/public/skills.html +8 -6
  693. package/payload/server/public/tasks.html +9 -7
  694. package/payload/server/server.js +4265 -1567
  695. package/payload/server/chunk-Y4NH2KLF.js +0 -4844
  696. package/payload/server/public/assets/AdminLoginScreens-CKyVm5aW.js +0 -1
  697. package/payload/server/public/assets/AdminLoginScreens-CKyVm5aW.js.br +0 -0
  698. package/payload/server/public/assets/AdminLoginScreens-CKyVm5aW.js.gz +0 -0
  699. package/payload/server/public/assets/AdminShell-slZzNEDR.js +0 -3
  700. package/payload/server/public/assets/AdminShell-slZzNEDR.js.br +0 -0
  701. package/payload/server/public/assets/AdminShell-slZzNEDR.js.gz +0 -0
  702. package/payload/server/public/assets/activity-6DhWjVwg.js +0 -1
  703. package/payload/server/public/assets/activity-6DhWjVwg.js.br +0 -0
  704. package/payload/server/public/assets/activity-6DhWjVwg.js.gz +0 -0
  705. package/payload/server/public/assets/admin-BB8DoIb_.js +0 -1
  706. package/payload/server/public/assets/admin-BB8DoIb_.js.br +0 -0
  707. package/payload/server/public/assets/admin-BB8DoIb_.js.gz +0 -0
  708. package/payload/server/public/assets/agents-D-28pUk7.js +0 -1
  709. package/payload/server/public/assets/agents-D-28pUk7.js.br +0 -0
  710. package/payload/server/public/assets/agents-D-28pUk7.js.gz +0 -0
  711. package/payload/server/public/assets/arc-DaI5MLTq.js +0 -1
  712. package/payload/server/public/assets/arc-DaI5MLTq.js.br +0 -0
  713. package/payload/server/public/assets/arc-DaI5MLTq.js.gz +0 -0
  714. package/payload/server/public/assets/architecture-YZFGNWBL-DWZIX5aV.js +0 -1
  715. package/payload/server/public/assets/architecture-YZFGNWBL-DWZIX5aV.js.br +0 -0
  716. package/payload/server/public/assets/architectureDiagram-Q4EWVU46-xZ0gDnJQ.js +0 -36
  717. package/payload/server/public/assets/architectureDiagram-Q4EWVU46-xZ0gDnJQ.js.br +0 -0
  718. package/payload/server/public/assets/architectureDiagram-Q4EWVU46-xZ0gDnJQ.js.gz +0 -0
  719. package/payload/server/public/assets/blockDiagram-DXYQGD6D-DwWtWBJp.js +0 -132
  720. package/payload/server/public/assets/blockDiagram-DXYQGD6D-DwWtWBJp.js.br +0 -0
  721. package/payload/server/public/assets/blockDiagram-DXYQGD6D-DwWtWBJp.js.gz +0 -0
  722. package/payload/server/public/assets/browser-BGJPx931.js +0 -1
  723. package/payload/server/public/assets/browser-BGJPx931.js.br +0 -0
  724. package/payload/server/public/assets/browser-BGJPx931.js.gz +0 -0
  725. package/payload/server/public/assets/c4Diagram-AHTNJAMY-qRseEjtL.js +0 -10
  726. package/payload/server/public/assets/c4Diagram-AHTNJAMY-qRseEjtL.js.br +0 -0
  727. package/payload/server/public/assets/c4Diagram-AHTNJAMY-qRseEjtL.js.gz +0 -0
  728. package/payload/server/public/assets/calendar-CP7u15G9.js +0 -1
  729. package/payload/server/public/assets/calendar-CP7u15G9.js.br +0 -0
  730. package/payload/server/public/assets/calendar-CP7u15G9.js.gz +0 -0
  731. package/payload/server/public/assets/channel-DnchwXmx.js +0 -1
  732. package/payload/server/public/assets/chat-C0wgXTz3.js +0 -1
  733. package/payload/server/public/assets/chat-C0wgXTz3.js.br +0 -0
  734. package/payload/server/public/assets/chat-C0wgXTz3.js.gz +0 -0
  735. package/payload/server/public/assets/chevron-left-CKe1u6eC.js +0 -1
  736. package/payload/server/public/assets/chevron-left-CKe1u6eC.js.br +0 -0
  737. package/payload/server/public/assets/chunk-2KRD3SAO-B6koUoB7.js +0 -1
  738. package/payload/server/public/assets/chunk-2KRD3SAO-B6koUoB7.js.br +0 -0
  739. package/payload/server/public/assets/chunk-2KRD3SAO-B6koUoB7.js.gz +0 -0
  740. package/payload/server/public/assets/chunk-336JU56O-ByZrJI-3.js +0 -2
  741. package/payload/server/public/assets/chunk-336JU56O-ByZrJI-3.js.br +0 -0
  742. package/payload/server/public/assets/chunk-336JU56O-ByZrJI-3.js.gz +0 -0
  743. package/payload/server/public/assets/chunk-426QAEUC-fNi5i3SA.js +0 -1
  744. package/payload/server/public/assets/chunk-426QAEUC-fNi5i3SA.js.br +0 -0
  745. package/payload/server/public/assets/chunk-426QAEUC-fNi5i3SA.js.gz +0 -0
  746. package/payload/server/public/assets/chunk-4BX2VUAB-7sO95xR2.js +0 -1
  747. package/payload/server/public/assets/chunk-4BX2VUAB-7sO95xR2.js.br +0 -0
  748. package/payload/server/public/assets/chunk-4BX2VUAB-7sO95xR2.js.gz +0 -0
  749. package/payload/server/public/assets/chunk-4TB4RGXK-KqKMvkA_.js +0 -206
  750. package/payload/server/public/assets/chunk-4TB4RGXK-KqKMvkA_.js.br +0 -0
  751. package/payload/server/public/assets/chunk-4TB4RGXK-KqKMvkA_.js.gz +0 -0
  752. package/payload/server/public/assets/chunk-55IACEB6-ggIJf_TC.js +0 -1
  753. package/payload/server/public/assets/chunk-55IACEB6-ggIJf_TC.js.br +0 -0
  754. package/payload/server/public/assets/chunk-55IACEB6-ggIJf_TC.js.gz +0 -0
  755. package/payload/server/public/assets/chunk-5FUZZQ4R-CEIokxZS.js +0 -62
  756. package/payload/server/public/assets/chunk-5FUZZQ4R-CEIokxZS.js.br +0 -0
  757. package/payload/server/public/assets/chunk-5FUZZQ4R-CEIokxZS.js.gz +0 -0
  758. package/payload/server/public/assets/chunk-5PVQY5BW-BEsb0aTb.js +0 -2
  759. package/payload/server/public/assets/chunk-5PVQY5BW-BEsb0aTb.js.br +0 -0
  760. package/payload/server/public/assets/chunk-5PVQY5BW-BEsb0aTb.js.gz +0 -0
  761. package/payload/server/public/assets/chunk-67CJDMHE-LS8rUbii.js +0 -1
  762. package/payload/server/public/assets/chunk-67CJDMHE-LS8rUbii.js.br +0 -2
  763. package/payload/server/public/assets/chunk-67CJDMHE-LS8rUbii.js.gz +0 -0
  764. package/payload/server/public/assets/chunk-7N4EOEYR-JKOVngS0.js +0 -1
  765. package/payload/server/public/assets/chunk-7N4EOEYR-JKOVngS0.js.br +0 -2
  766. package/payload/server/public/assets/chunk-7N4EOEYR-JKOVngS0.js.gz +0 -0
  767. package/payload/server/public/assets/chunk-AA7GKIK3-CoXnTVK6.js +0 -1
  768. package/payload/server/public/assets/chunk-AA7GKIK3-CoXnTVK6.js.br +0 -0
  769. package/payload/server/public/assets/chunk-AA7GKIK3-CoXnTVK6.js.gz +0 -0
  770. package/payload/server/public/assets/chunk-BSJP7CBP-CcsqObFg.js +0 -1
  771. package/payload/server/public/assets/chunk-BSJP7CBP-CcsqObFg.js.br +0 -0
  772. package/payload/server/public/assets/chunk-BSJP7CBP-CcsqObFg.js.gz +0 -0
  773. package/payload/server/public/assets/chunk-CIAEETIT-CpsybR7q.js +0 -1
  774. package/payload/server/public/assets/chunk-CIAEETIT-CpsybR7q.js.br +0 -0
  775. package/payload/server/public/assets/chunk-CIAEETIT-CpsybR7q.js.gz +0 -0
  776. package/payload/server/public/assets/chunk-EDXVE4YY-CCCHYEbG.js +0 -1
  777. package/payload/server/public/assets/chunk-EDXVE4YY-CCCHYEbG.js.br +0 -2
  778. package/payload/server/public/assets/chunk-EDXVE4YY-CCCHYEbG.js.gz +0 -0
  779. package/payload/server/public/assets/chunk-ENJZ2VHE-yVekovt2.js +0 -10
  780. package/payload/server/public/assets/chunk-ENJZ2VHE-yVekovt2.js.br +0 -0
  781. package/payload/server/public/assets/chunk-ENJZ2VHE-yVekovt2.js.gz +0 -0
  782. package/payload/server/public/assets/chunk-FMBD7UC4-D27VnSCa.js +0 -15
  783. package/payload/server/public/assets/chunk-FMBD7UC4-D27VnSCa.js.br +0 -0
  784. package/payload/server/public/assets/chunk-FMBD7UC4-D27VnSCa.js.gz +0 -0
  785. package/payload/server/public/assets/chunk-FOC6F5B3-C0tU2UFl.js +0 -1
  786. package/payload/server/public/assets/chunk-FOC6F5B3-C0tU2UFl.js.br +0 -0
  787. package/payload/server/public/assets/chunk-FOC6F5B3-C0tU2UFl.js.gz +0 -0
  788. package/payload/server/public/assets/chunk-ICPOFSXX-BmWvYe_5.js +0 -122
  789. package/payload/server/public/assets/chunk-ICPOFSXX-BmWvYe_5.js.br +0 -0
  790. package/payload/server/public/assets/chunk-ICPOFSXX-BmWvYe_5.js.gz +0 -0
  791. package/payload/server/public/assets/chunk-K5T4RW27-DIKxqyYw.js +0 -94
  792. package/payload/server/public/assets/chunk-K5T4RW27-DIKxqyYw.js.br +0 -0
  793. package/payload/server/public/assets/chunk-K5T4RW27-DIKxqyYw.js.gz +0 -0
  794. package/payload/server/public/assets/chunk-KGLVRYIC-CiL4YVLo.js +0 -1
  795. package/payload/server/public/assets/chunk-KGLVRYIC-CiL4YVLo.js.br +0 -0
  796. package/payload/server/public/assets/chunk-KGLVRYIC-CiL4YVLo.js.gz +0 -0
  797. package/payload/server/public/assets/chunk-LIHQZDEY-ejKezVlD.js +0 -1
  798. package/payload/server/public/assets/chunk-LIHQZDEY-ejKezVlD.js.br +0 -0
  799. package/payload/server/public/assets/chunk-LIHQZDEY-ejKezVlD.js.gz +0 -0
  800. package/payload/server/public/assets/chunk-ORNJ4GCN-Cc0vqc-D.js +0 -1
  801. package/payload/server/public/assets/chunk-ORNJ4GCN-Cc0vqc-D.js.br +0 -0
  802. package/payload/server/public/assets/chunk-ORNJ4GCN-Cc0vqc-D.js.gz +0 -0
  803. package/payload/server/public/assets/chunk-OYMX7WX6-BE4b8qC9.js +0 -231
  804. package/payload/server/public/assets/chunk-OYMX7WX6-BE4b8qC9.js.br +0 -0
  805. package/payload/server/public/assets/chunk-OYMX7WX6-BE4b8qC9.js.gz +0 -0
  806. package/payload/server/public/assets/chunk-QZHKN3VN-Dhlh7Pkk.js +0 -1
  807. package/payload/server/public/assets/chunk-QZHKN3VN-Dhlh7Pkk.js.br +0 -0
  808. package/payload/server/public/assets/chunk-QZHKN3VN-Dhlh7Pkk.js.gz +0 -0
  809. package/payload/server/public/assets/chunk-U2HBQHQK-DcEL3so-.js +0 -70
  810. package/payload/server/public/assets/chunk-U2HBQHQK-DcEL3so-.js.br +0 -0
  811. package/payload/server/public/assets/chunk-U2HBQHQK-DcEL3so-.js.gz +0 -0
  812. package/payload/server/public/assets/chunk-X2U36JSP-D0X5qpg6.js +0 -1
  813. package/payload/server/public/assets/chunk-X2U36JSP-D0X5qpg6.js.br +0 -0
  814. package/payload/server/public/assets/chunk-X2U36JSP-D0X5qpg6.js.gz +0 -0
  815. package/payload/server/public/assets/chunk-XPW4576I-DZqqB9Zi.js +0 -32
  816. package/payload/server/public/assets/chunk-XPW4576I-DZqqB9Zi.js.br +0 -0
  817. package/payload/server/public/assets/chunk-XPW4576I-DZqqB9Zi.js.gz +0 -0
  818. package/payload/server/public/assets/chunk-YZCP3GAM-BTxWHFTx.js +0 -1
  819. package/payload/server/public/assets/chunk-YZCP3GAM-BTxWHFTx.js.br +0 -0
  820. package/payload/server/public/assets/chunk-YZCP3GAM-BTxWHFTx.js.gz +0 -0
  821. package/payload/server/public/assets/chunk-ZZ45TVLE-D8nE76c5.js +0 -1
  822. package/payload/server/public/assets/chunk-ZZ45TVLE-D8nE76c5.js.br +0 -0
  823. package/payload/server/public/assets/chunk-ZZ45TVLE-D8nE76c5.js.gz +0 -0
  824. package/payload/server/public/assets/classDiagram-6PBFFD2Q-D9OvkaTQ.js +0 -1
  825. package/payload/server/public/assets/classDiagram-6PBFFD2Q-D9OvkaTQ.js.br +0 -0
  826. package/payload/server/public/assets/classDiagram-6PBFFD2Q-D9OvkaTQ.js.gz +0 -0
  827. package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-BEuoBAgN.js +0 -1
  828. package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-BEuoBAgN.js.br +0 -0
  829. package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-BEuoBAgN.js.gz +0 -0
  830. package/payload/server/public/assets/clock-D8MegkDy.js +0 -1
  831. package/payload/server/public/assets/clock-D8MegkDy.js.br +0 -0
  832. package/payload/server/public/assets/clone-C-YfAPQ_.js +0 -1
  833. package/payload/server/public/assets/copy-Cu819JFC.js +0 -1
  834. package/payload/server/public/assets/copy-Cu819JFC.js.br +0 -0
  835. package/payload/server/public/assets/copy-Cu819JFC.js.gz +0 -0
  836. package/payload/server/public/assets/cose-bilkent-S5V4N54A-D-95BzXL.js +0 -1
  837. package/payload/server/public/assets/cose-bilkent-S5V4N54A-D-95BzXL.js.br +0 -0
  838. package/payload/server/public/assets/cose-bilkent-S5V4N54A-D-95BzXL.js.gz +0 -0
  839. package/payload/server/public/assets/dagre-CrjQCEN9.js +0 -1
  840. package/payload/server/public/assets/dagre-CrjQCEN9.js.br +0 -0
  841. package/payload/server/public/assets/dagre-CrjQCEN9.js.gz +0 -0
  842. package/payload/server/public/assets/dagre-KV5264BT-mcGXOajA.js +0 -4
  843. package/payload/server/public/assets/dagre-KV5264BT-mcGXOajA.js.br +0 -0
  844. package/payload/server/public/assets/dagre-KV5264BT-mcGXOajA.js.gz +0 -0
  845. package/payload/server/public/assets/data-B7W5Ocvt.js +0 -1
  846. package/payload/server/public/assets/data-B7W5Ocvt.js.br +0 -0
  847. package/payload/server/public/assets/data-B7W5Ocvt.js.gz +0 -0
  848. package/payload/server/public/assets/diagram-5BDNPKRD-Colq2XR9.js +0 -10
  849. package/payload/server/public/assets/diagram-5BDNPKRD-Colq2XR9.js.br +0 -0
  850. package/payload/server/public/assets/diagram-5BDNPKRD-Colq2XR9.js.gz +0 -0
  851. package/payload/server/public/assets/diagram-G4DWMVQ6-DafrIgN8.js +0 -24
  852. package/payload/server/public/assets/diagram-G4DWMVQ6-DafrIgN8.js.br +0 -0
  853. package/payload/server/public/assets/diagram-G4DWMVQ6-DafrIgN8.js.gz +0 -0
  854. package/payload/server/public/assets/diagram-MMDJMWI5-CD9pSd2z.js +0 -43
  855. package/payload/server/public/assets/diagram-MMDJMWI5-CD9pSd2z.js.br +0 -0
  856. package/payload/server/public/assets/diagram-MMDJMWI5-CD9pSd2z.js.gz +0 -0
  857. package/payload/server/public/assets/diagram-TYMM5635-DqhsN-Il.js +0 -24
  858. package/payload/server/public/assets/diagram-TYMM5635-DqhsN-Il.js.br +0 -0
  859. package/payload/server/public/assets/diagram-TYMM5635-DqhsN-Il.js.gz +0 -0
  860. package/payload/server/public/assets/dist-QvbmK1IP.js +0 -1
  861. package/payload/server/public/assets/dist-QvbmK1IP.js.br +0 -0
  862. package/payload/server/public/assets/dist-QvbmK1IP.js.gz +0 -0
  863. package/payload/server/public/assets/erDiagram-SMLLAGMA-mf9kQrIs.js +0 -85
  864. package/payload/server/public/assets/erDiagram-SMLLAGMA-mf9kQrIs.js.br +0 -0
  865. package/payload/server/public/assets/erDiagram-SMLLAGMA-mf9kQrIs.js.gz +0 -0
  866. package/payload/server/public/assets/file-text-BoiZDy84.js +0 -1
  867. package/payload/server/public/assets/file-text-BoiZDy84.js.br +0 -0
  868. package/payload/server/public/assets/file-text-BoiZDy84.js.gz +0 -0
  869. package/payload/server/public/assets/flatten-BtIc9jX7.js +0 -1
  870. package/payload/server/public/assets/flatten-BtIc9jX7.js.br +0 -0
  871. package/payload/server/public/assets/flatten-BtIc9jX7.js.gz +0 -0
  872. package/payload/server/public/assets/flowDiagram-DWJPFMVM-CJLkGmFm.js +0 -162
  873. package/payload/server/public/assets/flowDiagram-DWJPFMVM-CJLkGmFm.js.br +0 -0
  874. package/payload/server/public/assets/flowDiagram-DWJPFMVM-CJLkGmFm.js.gz +0 -0
  875. package/payload/server/public/assets/ganttDiagram-T4ZO3ILL-JV6PUFic.js +0 -292
  876. package/payload/server/public/assets/ganttDiagram-T4ZO3ILL-JV6PUFic.js.br +0 -0
  877. package/payload/server/public/assets/ganttDiagram-T4ZO3ILL-JV6PUFic.js.gz +0 -0
  878. package/payload/server/public/assets/gitGraph-7Q5UKJZL-C-FvNTHZ.js +0 -1
  879. package/payload/server/public/assets/gitGraph-7Q5UKJZL-C-FvNTHZ.js.br +0 -0
  880. package/payload/server/public/assets/gitGraphDiagram-UUTBAWPF-JhiumTtl.js +0 -106
  881. package/payload/server/public/assets/gitGraphDiagram-UUTBAWPF-JhiumTtl.js.br +0 -0
  882. package/payload/server/public/assets/gitGraphDiagram-UUTBAWPF-JhiumTtl.js.gz +0 -0
  883. package/payload/server/public/assets/graph-Dr6uIMgA.js +0 -51
  884. package/payload/server/public/assets/graph-Dr6uIMgA.js.br +0 -0
  885. package/payload/server/public/assets/graph-Dr6uIMgA.js.gz +0 -0
  886. package/payload/server/public/assets/graph-labels-9y5-8Rc_.js +0 -1
  887. package/payload/server/public/assets/graph-labels-9y5-8Rc_.js.br +0 -0
  888. package/payload/server/public/assets/graph-labels-9y5-8Rc_.js.gz +0 -0
  889. package/payload/server/public/assets/graphlib-Z7cApv13.js +0 -1
  890. package/payload/server/public/assets/graphlib-Z7cApv13.js.br +0 -0
  891. package/payload/server/public/assets/graphlib-Z7cApv13.js.gz +0 -0
  892. package/payload/server/public/assets/info-OMHHGYJF-BjLPgHAC.js +0 -1
  893. package/payload/server/public/assets/info-OMHHGYJF-BjLPgHAC.js.br +0 -0
  894. package/payload/server/public/assets/infoDiagram-42DDH7IO-B-6k2hmd.js +0 -2
  895. package/payload/server/public/assets/infoDiagram-42DDH7IO-B-6k2hmd.js.br +0 -0
  896. package/payload/server/public/assets/infoDiagram-42DDH7IO-B-6k2hmd.js.gz +0 -0
  897. package/payload/server/public/assets/isEmpty-Bu4fZ8Kf.js +0 -1
  898. package/payload/server/public/assets/isEmpty-Bu4fZ8Kf.js.br +0 -0
  899. package/payload/server/public/assets/isEmpty-Bu4fZ8Kf.js.gz +0 -0
  900. package/payload/server/public/assets/ishikawaDiagram-UXIWVN3A-CQIGY8NI.js +0 -70
  901. package/payload/server/public/assets/ishikawaDiagram-UXIWVN3A-CQIGY8NI.js.br +0 -0
  902. package/payload/server/public/assets/ishikawaDiagram-UXIWVN3A-CQIGY8NI.js.gz +0 -0
  903. package/payload/server/public/assets/journeyDiagram-VCZTEJTY-O5rEHC1o.js +0 -139
  904. package/payload/server/public/assets/journeyDiagram-VCZTEJTY-O5rEHC1o.js.br +0 -0
  905. package/payload/server/public/assets/journeyDiagram-VCZTEJTY-O5rEHC1o.js.gz +0 -0
  906. package/payload/server/public/assets/kanban-definition-6JOO6SKY-BS7huuG7.js +0 -89
  907. package/payload/server/public/assets/kanban-definition-6JOO6SKY-BS7huuG7.js.br +0 -0
  908. package/payload/server/public/assets/kanban-definition-6JOO6SKY-BS7huuG7.js.gz +0 -0
  909. package/payload/server/public/assets/line-DjHTnO_W.js +0 -1
  910. package/payload/server/public/assets/line-DjHTnO_W.js.br +0 -0
  911. package/payload/server/public/assets/line-DjHTnO_W.js.gz +0 -0
  912. package/payload/server/public/assets/linear-RvwZxFzh.js +0 -1
  913. package/payload/server/public/assets/linear-RvwZxFzh.js.br +0 -0
  914. package/payload/server/public/assets/linear-RvwZxFzh.js.gz +0 -0
  915. package/payload/server/public/assets/mermaid-parser.core-CUoZE61Z.js +0 -4
  916. package/payload/server/public/assets/mermaid-parser.core-CUoZE61Z.js.br +0 -0
  917. package/payload/server/public/assets/mermaid-parser.core-CUoZE61Z.js.gz +0 -0
  918. package/payload/server/public/assets/mermaid.core-CHquUUrw.js +0 -11
  919. package/payload/server/public/assets/mermaid.core-CHquUUrw.js.br +0 -0
  920. package/payload/server/public/assets/mermaid.core-CHquUUrw.js.gz +0 -0
  921. package/payload/server/public/assets/mindmap-definition-QFDTVHPH-pHUJa3IP.js +0 -96
  922. package/payload/server/public/assets/mindmap-definition-QFDTVHPH-pHUJa3IP.js.br +0 -0
  923. package/payload/server/public/assets/mindmap-definition-QFDTVHPH-pHUJa3IP.js.gz +0 -0
  924. package/payload/server/public/assets/operator-Cn5P5yqu.js +0 -1
  925. package/payload/server/public/assets/operator-Cn5P5yqu.js.br +0 -0
  926. package/payload/server/public/assets/operator-Cn5P5yqu.js.gz +0 -0
  927. package/payload/server/public/assets/ordinal-C2TEWKNu.js +0 -1
  928. package/payload/server/public/assets/ordinal-C2TEWKNu.js.br +0 -0
  929. package/payload/server/public/assets/ordinal-C2TEWKNu.js.gz +0 -0
  930. package/payload/server/public/assets/packet-4T2RLAQJ-BBAZASfb.js +0 -1
  931. package/payload/server/public/assets/packet-4T2RLAQJ-BBAZASfb.js.br +0 -0
  932. package/payload/server/public/assets/page-DqnWu9Aj.js +0 -1
  933. package/payload/server/public/assets/page-DqnWu9Aj.js.br +0 -0
  934. package/payload/server/public/assets/page-DqnWu9Aj.js.gz +0 -0
  935. package/payload/server/public/assets/page-VTcDQ8qS.js +0 -32
  936. package/payload/server/public/assets/page-VTcDQ8qS.js.br +0 -0
  937. package/payload/server/public/assets/page-VTcDQ8qS.js.gz +0 -0
  938. package/payload/server/public/assets/pdf-render-Bwg_xv1L.js +0 -11
  939. package/payload/server/public/assets/pdf-render-Bwg_xv1L.js.br +0 -0
  940. package/payload/server/public/assets/pdf-render-Bwg_xv1L.js.gz +0 -0
  941. package/payload/server/public/assets/pie-ZZUOXDRM-CCJUnMeG.js +0 -1
  942. package/payload/server/public/assets/pie-ZZUOXDRM-CCJUnMeG.js.br +0 -0
  943. package/payload/server/public/assets/pieDiagram-DEJITSTG-DRIRqqhQ.js +0 -30
  944. package/payload/server/public/assets/pieDiagram-DEJITSTG-DRIRqqhQ.js.br +0 -0
  945. package/payload/server/public/assets/pieDiagram-DEJITSTG-DRIRqqhQ.js.gz +0 -0
  946. package/payload/server/public/assets/play-Dp6K3szP.js +0 -1
  947. package/payload/server/public/assets/play-Dp6K3szP.js.br +0 -0
  948. package/payload/server/public/assets/play-Dp6K3szP.js.gz +0 -0
  949. package/payload/server/public/assets/public-HlWIQCkl.js +0 -1
  950. package/payload/server/public/assets/public-HlWIQCkl.js.br +0 -0
  951. package/payload/server/public/assets/public-HlWIQCkl.js.gz +0 -0
  952. package/payload/server/public/assets/quadrantDiagram-34T5L4WZ-7WHBrI_9.js +0 -7
  953. package/payload/server/public/assets/quadrantDiagram-34T5L4WZ-7WHBrI_9.js.br +0 -0
  954. package/payload/server/public/assets/quadrantDiagram-34T5L4WZ-7WHBrI_9.js.gz +0 -0
  955. package/payload/server/public/assets/radar-PYXPWWZC-BsRU8Aep.js +0 -1
  956. package/payload/server/public/assets/radar-PYXPWWZC-BsRU8Aep.js.br +0 -0
  957. package/payload/server/public/assets/reduce-BGpN5lgn.js +0 -1
  958. package/payload/server/public/assets/reduce-BGpN5lgn.js.br +0 -0
  959. package/payload/server/public/assets/reduce-BGpN5lgn.js.gz +0 -0
  960. package/payload/server/public/assets/requirementDiagram-MS252O5E-CatBEoHm.js +0 -84
  961. package/payload/server/public/assets/requirementDiagram-MS252O5E-CatBEoHm.js.br +0 -0
  962. package/payload/server/public/assets/requirementDiagram-MS252O5E-CatBEoHm.js.gz +0 -0
  963. package/payload/server/public/assets/rotate-ccw-kpEqIj4T.js +0 -1
  964. package/payload/server/public/assets/rotate-ccw-kpEqIj4T.js.br +0 -0
  965. package/payload/server/public/assets/rotate-ccw-kpEqIj4T.js.gz +0 -0
  966. package/payload/server/public/assets/routines-CvDzjwtZ.js +0 -2
  967. package/payload/server/public/assets/routines-CvDzjwtZ.js.br +0 -0
  968. package/payload/server/public/assets/routines-CvDzjwtZ.js.gz +0 -0
  969. package/payload/server/public/assets/sankeyDiagram-XADWPNL6-DfefvhQ6.js +0 -10
  970. package/payload/server/public/assets/sankeyDiagram-XADWPNL6-DfefvhQ6.js.br +0 -0
  971. package/payload/server/public/assets/sankeyDiagram-XADWPNL6-DfefvhQ6.js.gz +0 -0
  972. package/payload/server/public/assets/sequenceDiagram-FGHM5R23-51FmBwFt.js +0 -157
  973. package/payload/server/public/assets/sequenceDiagram-FGHM5R23-51FmBwFt.js.br +0 -0
  974. package/payload/server/public/assets/sequenceDiagram-FGHM5R23-51FmBwFt.js.gz +0 -0
  975. package/payload/server/public/assets/skills-Bom76JQv.js +0 -1
  976. package/payload/server/public/assets/skills-Bom76JQv.js.br +0 -0
  977. package/payload/server/public/assets/skills-Bom76JQv.js.gz +0 -0
  978. package/payload/server/public/assets/src-C2WwTWSY.js +0 -1
  979. package/payload/server/public/assets/src-C2WwTWSY.js.br +0 -0
  980. package/payload/server/public/assets/src-C2WwTWSY.js.gz +0 -0
  981. package/payload/server/public/assets/stateDiagram-FHFEXIEX-CPgxX16e.js +0 -1
  982. package/payload/server/public/assets/stateDiagram-FHFEXIEX-CPgxX16e.js.br +0 -0
  983. package/payload/server/public/assets/stateDiagram-FHFEXIEX-CPgxX16e.js.gz +0 -0
  984. package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-DrQl9xC9.js +0 -1
  985. package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-DrQl9xC9.js.br +0 -0
  986. package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-DrQl9xC9.js.gz +0 -0
  987. package/payload/server/public/assets/tasks-DCiTDQ-r.js +0 -3
  988. package/payload/server/public/assets/tasks-DCiTDQ-r.js.br +0 -0
  989. package/payload/server/public/assets/tasks-DCiTDQ-r.js.gz +0 -0
  990. package/payload/server/public/assets/timeline-definition-GMOUNBTQ-DC4gTR2m.js +0 -120
  991. package/payload/server/public/assets/timeline-definition-GMOUNBTQ-DC4gTR2m.js.br +0 -0
  992. package/payload/server/public/assets/timeline-definition-GMOUNBTQ-DC4gTR2m.js.gz +0 -0
  993. package/payload/server/public/assets/treeView-SZITEDCU-BDzhKA6v.js +0 -1
  994. package/payload/server/public/assets/treeView-SZITEDCU-BDzhKA6v.js.br +0 -0
  995. package/payload/server/public/assets/treemap-W4RFUUIX-epHpdeWa.js +0 -1
  996. package/payload/server/public/assets/treemap-W4RFUUIX-epHpdeWa.js.br +0 -0
  997. package/payload/server/public/assets/triangle-alert-DBSoNN4T.js +0 -1
  998. package/payload/server/public/assets/triangle-alert-DBSoNN4T.js.br +0 -0
  999. package/payload/server/public/assets/triangle-alert-DBSoNN4T.js.gz +0 -0
  1000. package/payload/server/public/assets/useCopyFeedback-Do4uNxoZ.js +0 -1
  1001. package/payload/server/public/assets/useCopyFeedback-Do4uNxoZ.js.br +0 -0
  1002. package/payload/server/public/assets/useCopyFeedback-Do4uNxoZ.js.gz +0 -0
  1003. package/payload/server/public/assets/useMediaQuery-6vKHR1CS.js +0 -14
  1004. package/payload/server/public/assets/useMediaQuery-6vKHR1CS.js.br +0 -0
  1005. package/payload/server/public/assets/useMediaQuery-6vKHR1CS.js.gz +0 -0
  1006. package/payload/server/public/assets/useMediaQuery-BbG7Ar0P.css +0 -1
  1007. package/payload/server/public/assets/useMediaQuery-BbG7Ar0P.css.br +0 -0
  1008. package/payload/server/public/assets/useMediaQuery-BbG7Ar0P.css.gz +0 -0
  1009. package/payload/server/public/assets/useVoiceRecorder-BzezRxgT.js +0 -2
  1010. package/payload/server/public/assets/useVoiceRecorder-BzezRxgT.js.br +0 -0
  1011. package/payload/server/public/assets/useVoiceRecorder-BzezRxgT.js.gz +0 -0
  1012. package/payload/server/public/assets/vennDiagram-DHZGUBPP-CADQLMv_.js +0 -34
  1013. package/payload/server/public/assets/vennDiagram-DHZGUBPP-CADQLMv_.js.br +0 -0
  1014. package/payload/server/public/assets/vennDiagram-DHZGUBPP-CADQLMv_.js.gz +0 -0
  1015. package/payload/server/public/assets/wardley-RL74JXVD-DNSZCrxV.js +0 -1
  1016. package/payload/server/public/assets/wardley-RL74JXVD-DNSZCrxV.js.br +0 -0
  1017. package/payload/server/public/assets/wardleyDiagram-NUSXRM2D-Cs5AyyGo.js +0 -20
  1018. package/payload/server/public/assets/wardleyDiagram-NUSXRM2D-Cs5AyyGo.js.br +0 -0
  1019. package/payload/server/public/assets/wardleyDiagram-NUSXRM2D-Cs5AyyGo.js.gz +0 -0
  1020. package/payload/server/public/assets/wrench-BmLFQPJb.js +0 -1
  1021. package/payload/server/public/assets/wrench-BmLFQPJb.js.br +0 -0
  1022. package/payload/server/public/assets/wrench-BmLFQPJb.js.gz +0 -0
  1023. package/payload/server/public/assets/xychartDiagram-5P7HB3ND-Bp_VDbBp.js +0 -7
  1024. package/payload/server/public/assets/xychartDiagram-5P7HB3ND-Bp_VDbBp.js.br +0 -0
  1025. package/payload/server/public/assets/xychartDiagram-5P7HB3ND-Bp_VDbBp.js.gz +0 -0
  1026. /package/payload/server/public/assets/{_baseFor-Be3EKK3K.js → _baseFor-D1duyODO.js} +0 -0
  1027. /package/payload/server/public/assets/{_baseFor-Be3EKK3K.js.br → _baseFor-D1duyODO.js.br} +0 -0
  1028. /package/payload/server/public/assets/{_baseFor-Be3EKK3K.js.gz → _baseFor-D1duyODO.js.gz} +0 -0
  1029. /package/payload/server/public/assets/{array-X0JlPOfd.js → array-j7Xa9Fap.js} +0 -0
  1030. /package/payload/server/public/assets/{array-X0JlPOfd.js.br → array-j7Xa9Fap.js.br} +0 -0
  1031. /package/payload/server/public/assets/{chunk-CltuBf4Z.js → chunk-DlZTsV_O.js} +0 -0
  1032. /package/payload/server/public/assets/{chunk-CltuBf4Z.js.br → chunk-DlZTsV_O.js.br} +0 -0
  1033. /package/payload/server/public/assets/{chunk-CltuBf4Z.js.gz → chunk-DlZTsV_O.js.gz} +0 -0
  1034. /package/payload/server/public/assets/{cytoscape.esm-CI2IWMLB.js → cytoscape.esm-Dob3eilA.js} +0 -0
  1035. /package/payload/server/public/assets/{cytoscape.esm-CI2IWMLB.js.br → cytoscape.esm-Dob3eilA.js.br} +0 -0
  1036. /package/payload/server/public/assets/{cytoscape.esm-CI2IWMLB.js.gz → cytoscape.esm-Dob3eilA.js.gz} +0 -0
  1037. /package/payload/server/public/assets/{defaultLocale-B6RGN4id.js → defaultLocale-BNILPWh2.js} +0 -0
  1038. /package/payload/server/public/assets/{defaultLocale-B6RGN4id.js.br → defaultLocale-BNILPWh2.js.br} +0 -0
  1039. /package/payload/server/public/assets/{defaultLocale-B6RGN4id.js.gz → defaultLocale-BNILPWh2.js.gz} +0 -0
  1040. /package/payload/server/public/assets/{file-download-DiQesOd2.js → file-download-CN4H4Eih.js} +0 -0
  1041. /package/payload/server/public/assets/{file-download-DiQesOd2.js.br → file-download-CN4H4Eih.js.br} +0 -0
  1042. /package/payload/server/public/assets/{file-download-DiQesOd2.js.gz → file-download-CN4H4Eih.js.gz} +0 -0
  1043. /package/payload/server/public/assets/{init-BmUWJJHz.js → init-ve51bpJo.js} +0 -0
  1044. /package/payload/server/public/assets/{init-BmUWJJHz.js.br → init-ve51bpJo.js.br} +0 -0
  1045. /package/payload/server/public/assets/{init-BmUWJJHz.js.gz → init-ve51bpJo.js.gz} +0 -0
  1046. /package/payload/server/public/assets/{katex-BjZuzSQn.js → katex-CJNaolDQ.js} +0 -0
  1047. /package/payload/server/public/assets/{katex-BjZuzSQn.js.br → katex-CJNaolDQ.js.br} +0 -0
  1048. /package/payload/server/public/assets/{katex-BjZuzSQn.js.gz → katex-CJNaolDQ.js.gz} +0 -0
  1049. /package/payload/server/public/assets/{path-CoPyR7c2.js → path-B4emajHp.js} +0 -0
  1050. /package/payload/server/public/assets/{path-CoPyR7c2.js.br → path-B4emajHp.js.br} +0 -0
  1051. /package/payload/server/public/assets/{path-CoPyR7c2.js.gz → path-B4emajHp.js.gz} +0 -0
  1052. /package/payload/server/public/assets/{preload-helper-BJ2zoBc3.js → preload-helper-3YNEDsJZ.js} +0 -0
  1053. /package/payload/server/public/assets/{preload-helper-BJ2zoBc3.js.br → preload-helper-3YNEDsJZ.js.br} +0 -0
  1054. /package/payload/server/public/assets/{preload-helper-BJ2zoBc3.js.gz → preload-helper-3YNEDsJZ.js.gz} +0 -0
  1055. /package/payload/server/public/assets/{rough.esm-jSt7UMyi.js → rough.esm-zabqYs6f.js} +0 -0
  1056. /package/payload/server/public/assets/{rough.esm-jSt7UMyi.js.br → rough.esm-zabqYs6f.js.br} +0 -0
  1057. /package/payload/server/public/assets/{rough.esm-jSt7UMyi.js.gz → rough.esm-zabqYs6f.js.gz} +0 -0
@@ -0,0 +1,4868 @@
1
+ import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
2
+ import {
3
+ BRAND_NAME,
4
+ BUNDLE_ALLOWLIST,
5
+ BUNDLE_MODE,
6
+ LOG_DIR,
7
+ MAXY_DIR,
8
+ PLATFORM_ROOT,
9
+ REMOTE_PASSWORD_FILE,
10
+ REMOTE_SESSION_SECRET_FILE,
11
+ USERS_FILE,
12
+ getConversationOwner,
13
+ init_account,
14
+ init_loop_registry,
15
+ init_neo4j_store,
16
+ init_paths,
17
+ isValidAccountId,
18
+ registerLoop
19
+ } from "./chunk-PGGGWUBM.js";
20
+ import {
21
+ __esm
22
+ } from "./chunk-KVR2FT6O.js";
23
+
24
+ // node_modules/hono/dist/compose.js
25
+ var compose;
26
+ var init_compose = __esm({
27
+ "node_modules/hono/dist/compose.js"() {
28
+ "use strict";
29
+ compose = (middleware, onError, onNotFound) => {
30
+ return (context, next) => {
31
+ let index = -1;
32
+ return dispatch(0);
33
+ async function dispatch(i) {
34
+ if (i <= index) {
35
+ throw new Error("next() called multiple times");
36
+ }
37
+ index = i;
38
+ let res;
39
+ let isError = false;
40
+ let handler;
41
+ if (middleware[i]) {
42
+ handler = middleware[i][0][0];
43
+ context.req.routeIndex = i;
44
+ } else {
45
+ handler = i === middleware.length && next || void 0;
46
+ }
47
+ if (handler) {
48
+ try {
49
+ res = await handler(context, () => dispatch(i + 1));
50
+ } catch (err) {
51
+ if (err instanceof Error && onError) {
52
+ context.error = err;
53
+ res = await onError(err, context);
54
+ isError = true;
55
+ } else {
56
+ throw err;
57
+ }
58
+ }
59
+ } else {
60
+ if (context.finalized === false && onNotFound) {
61
+ res = await onNotFound(context);
62
+ }
63
+ }
64
+ if (res && (context.finalized === false || isError)) {
65
+ context.res = res;
66
+ }
67
+ return context;
68
+ }
69
+ };
70
+ };
71
+ }
72
+ });
73
+
74
+ // node_modules/hono/dist/http-exception.js
75
+ var HTTPException;
76
+ var init_http_exception = __esm({
77
+ "node_modules/hono/dist/http-exception.js"() {
78
+ "use strict";
79
+ HTTPException = class extends Error {
80
+ res;
81
+ status;
82
+ /**
83
+ * Creates an instance of `HTTPException`.
84
+ * @param status - HTTP status code for the exception. Defaults to 500.
85
+ * @param options - Additional options for the exception.
86
+ */
87
+ constructor(status = 500, options) {
88
+ super(options?.message, { cause: options?.cause });
89
+ this.res = options?.res;
90
+ this.status = status;
91
+ }
92
+ /**
93
+ * Returns the response object associated with the exception.
94
+ * If a response object is not provided, a new response is created with the error message and status code.
95
+ * @returns The response object.
96
+ */
97
+ getResponse() {
98
+ if (this.res) {
99
+ const newResponse = new Response(this.res.body, {
100
+ status: this.status,
101
+ headers: this.res.headers
102
+ });
103
+ return newResponse;
104
+ }
105
+ return new Response(this.message, {
106
+ status: this.status
107
+ });
108
+ }
109
+ };
110
+ }
111
+ });
112
+
113
+ // node_modules/hono/dist/request/constants.js
114
+ var GET_MATCH_RESULT;
115
+ var init_constants = __esm({
116
+ "node_modules/hono/dist/request/constants.js"() {
117
+ "use strict";
118
+ GET_MATCH_RESULT = /* @__PURE__ */ Symbol();
119
+ }
120
+ });
121
+
122
+ // node_modules/hono/dist/utils/body.js
123
+ async function parseFormData(request, options) {
124
+ const formData = await request.formData();
125
+ if (formData) {
126
+ return convertFormDataToBodyData(formData, options);
127
+ }
128
+ return {};
129
+ }
130
+ function convertFormDataToBodyData(formData, options) {
131
+ const form = /* @__PURE__ */ Object.create(null);
132
+ formData.forEach((value, key) => {
133
+ const shouldParseAllValues = options.all || key.endsWith("[]");
134
+ if (!shouldParseAllValues) {
135
+ form[key] = value;
136
+ } else {
137
+ handleParsingAllValues(form, key, value);
138
+ }
139
+ });
140
+ if (options.dot) {
141
+ Object.entries(form).forEach(([key, value]) => {
142
+ const shouldParseDotValues = key.includes(".");
143
+ if (shouldParseDotValues) {
144
+ handleParsingNestedValues(form, key, value);
145
+ delete form[key];
146
+ }
147
+ });
148
+ }
149
+ return form;
150
+ }
151
+ var parseBody, handleParsingAllValues, handleParsingNestedValues;
152
+ var init_body = __esm({
153
+ "node_modules/hono/dist/utils/body.js"() {
154
+ "use strict";
155
+ init_request();
156
+ parseBody = async (request, options = /* @__PURE__ */ Object.create(null)) => {
157
+ const { all = false, dot = false } = options;
158
+ const headers = request instanceof HonoRequest ? request.raw.headers : request.headers;
159
+ const contentType = headers.get("Content-Type");
160
+ if (contentType?.startsWith("multipart/form-data") || contentType?.startsWith("application/x-www-form-urlencoded")) {
161
+ return parseFormData(request, { all, dot });
162
+ }
163
+ return {};
164
+ };
165
+ handleParsingAllValues = (form, key, value) => {
166
+ if (form[key] !== void 0) {
167
+ if (Array.isArray(form[key])) {
168
+ ;
169
+ form[key].push(value);
170
+ } else {
171
+ form[key] = [form[key], value];
172
+ }
173
+ } else {
174
+ if (!key.endsWith("[]")) {
175
+ form[key] = value;
176
+ } else {
177
+ form[key] = [value];
178
+ }
179
+ }
180
+ };
181
+ handleParsingNestedValues = (form, key, value) => {
182
+ if (/(?:^|\.)__proto__\./.test(key)) {
183
+ return;
184
+ }
185
+ let nestedForm = form;
186
+ const keys = key.split(".");
187
+ keys.forEach((key2, index) => {
188
+ if (index === keys.length - 1) {
189
+ nestedForm[key2] = value;
190
+ } else {
191
+ if (!nestedForm[key2] || typeof nestedForm[key2] !== "object" || Array.isArray(nestedForm[key2]) || nestedForm[key2] instanceof File) {
192
+ nestedForm[key2] = /* @__PURE__ */ Object.create(null);
193
+ }
194
+ nestedForm = nestedForm[key2];
195
+ }
196
+ });
197
+ };
198
+ }
199
+ });
200
+
201
+ // node_modules/hono/dist/utils/url.js
202
+ var splitPath, splitRoutingPath, extractGroupsFromPath, replaceGroupMarks, patternCache, getPattern, tryDecode, tryDecodeURI, getPath, getPathNoStrict, mergePath, checkOptionalParameter, _decodeURI, _getQueryParam, getQueryParam, getQueryParams, decodeURIComponent_;
203
+ var init_url = __esm({
204
+ "node_modules/hono/dist/utils/url.js"() {
205
+ "use strict";
206
+ splitPath = (path) => {
207
+ const paths = path.split("/");
208
+ if (paths[0] === "") {
209
+ paths.shift();
210
+ }
211
+ return paths;
212
+ };
213
+ splitRoutingPath = (routePath) => {
214
+ const { groups, path } = extractGroupsFromPath(routePath);
215
+ const paths = splitPath(path);
216
+ return replaceGroupMarks(paths, groups);
217
+ };
218
+ extractGroupsFromPath = (path) => {
219
+ const groups = [];
220
+ path = path.replace(/\{[^}]+\}/g, (match2, index) => {
221
+ const mark = `@${index}`;
222
+ groups.push([mark, match2]);
223
+ return mark;
224
+ });
225
+ return { groups, path };
226
+ };
227
+ replaceGroupMarks = (paths, groups) => {
228
+ for (let i = groups.length - 1; i >= 0; i--) {
229
+ const [mark] = groups[i];
230
+ for (let j = paths.length - 1; j >= 0; j--) {
231
+ if (paths[j].includes(mark)) {
232
+ paths[j] = paths[j].replace(mark, groups[i][1]);
233
+ break;
234
+ }
235
+ }
236
+ }
237
+ return paths;
238
+ };
239
+ patternCache = {};
240
+ getPattern = (label, next) => {
241
+ if (label === "*") {
242
+ return "*";
243
+ }
244
+ const match2 = label.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/);
245
+ if (match2) {
246
+ const cacheKey2 = `${label}#${next}`;
247
+ if (!patternCache[cacheKey2]) {
248
+ if (match2[2]) {
249
+ patternCache[cacheKey2] = next && next[0] !== ":" && next[0] !== "*" ? [cacheKey2, match2[1], new RegExp(`^${match2[2]}(?=/${next})`)] : [label, match2[1], new RegExp(`^${match2[2]}$`)];
250
+ } else {
251
+ patternCache[cacheKey2] = [label, match2[1], true];
252
+ }
253
+ }
254
+ return patternCache[cacheKey2];
255
+ }
256
+ return null;
257
+ };
258
+ tryDecode = (str, decoder) => {
259
+ try {
260
+ return decoder(str);
261
+ } catch {
262
+ return str.replace(/(?:%[0-9A-Fa-f]{2})+/g, (match2) => {
263
+ try {
264
+ return decoder(match2);
265
+ } catch {
266
+ return match2;
267
+ }
268
+ });
269
+ }
270
+ };
271
+ tryDecodeURI = (str) => tryDecode(str, decodeURI);
272
+ getPath = (request) => {
273
+ const url = request.url;
274
+ const start = url.indexOf("/", url.indexOf(":") + 4);
275
+ let i = start;
276
+ for (; i < url.length; i++) {
277
+ const charCode = url.charCodeAt(i);
278
+ if (charCode === 37) {
279
+ const queryIndex = url.indexOf("?", i);
280
+ const hashIndex = url.indexOf("#", i);
281
+ const end = queryIndex === -1 ? hashIndex === -1 ? void 0 : hashIndex : hashIndex === -1 ? queryIndex : Math.min(queryIndex, hashIndex);
282
+ const path = url.slice(start, end);
283
+ return tryDecodeURI(path.includes("%25") ? path.replace(/%25/g, "%2525") : path);
284
+ } else if (charCode === 63 || charCode === 35) {
285
+ break;
286
+ }
287
+ }
288
+ return url.slice(start, i);
289
+ };
290
+ getPathNoStrict = (request) => {
291
+ const result = getPath(request);
292
+ return result.length > 1 && result.at(-1) === "/" ? result.slice(0, -1) : result;
293
+ };
294
+ mergePath = (base, sub, ...rest) => {
295
+ if (rest.length) {
296
+ sub = mergePath(sub, ...rest);
297
+ }
298
+ return `${base?.[0] === "/" ? "" : "/"}${base}${sub === "/" ? "" : `${base?.at(-1) === "/" ? "" : "/"}${sub?.[0] === "/" ? sub.slice(1) : sub}`}`;
299
+ };
300
+ checkOptionalParameter = (path) => {
301
+ if (path.charCodeAt(path.length - 1) !== 63 || !path.includes(":")) {
302
+ return null;
303
+ }
304
+ const segments = path.split("/");
305
+ const results = [];
306
+ let basePath = "";
307
+ segments.forEach((segment) => {
308
+ if (segment !== "" && !/\:/.test(segment)) {
309
+ basePath += "/" + segment;
310
+ } else if (/\:/.test(segment)) {
311
+ if (/\?/.test(segment)) {
312
+ if (results.length === 0 && basePath === "") {
313
+ results.push("/");
314
+ } else {
315
+ results.push(basePath);
316
+ }
317
+ const optionalSegment = segment.replace("?", "");
318
+ basePath += "/" + optionalSegment;
319
+ results.push(basePath);
320
+ } else {
321
+ basePath += "/" + segment;
322
+ }
323
+ }
324
+ });
325
+ return results.filter((v, i, a) => a.indexOf(v) === i);
326
+ };
327
+ _decodeURI = (value) => {
328
+ if (!/[%+]/.test(value)) {
329
+ return value;
330
+ }
331
+ if (value.indexOf("+") !== -1) {
332
+ value = value.replace(/\+/g, " ");
333
+ }
334
+ return value.indexOf("%") !== -1 ? tryDecode(value, decodeURIComponent_) : value;
335
+ };
336
+ _getQueryParam = (url, key, multiple) => {
337
+ let encoded;
338
+ if (!multiple && key && !/[%+]/.test(key)) {
339
+ let keyIndex2 = url.indexOf("?", 8);
340
+ if (keyIndex2 === -1) {
341
+ return void 0;
342
+ }
343
+ if (!url.startsWith(key, keyIndex2 + 1)) {
344
+ keyIndex2 = url.indexOf(`&${key}`, keyIndex2 + 1);
345
+ }
346
+ while (keyIndex2 !== -1) {
347
+ const trailingKeyCode = url.charCodeAt(keyIndex2 + key.length + 1);
348
+ if (trailingKeyCode === 61) {
349
+ const valueIndex = keyIndex2 + key.length + 2;
350
+ const endIndex = url.indexOf("&", valueIndex);
351
+ return _decodeURI(url.slice(valueIndex, endIndex === -1 ? void 0 : endIndex));
352
+ } else if (trailingKeyCode == 38 || isNaN(trailingKeyCode)) {
353
+ return "";
354
+ }
355
+ keyIndex2 = url.indexOf(`&${key}`, keyIndex2 + 1);
356
+ }
357
+ encoded = /[%+]/.test(url);
358
+ if (!encoded) {
359
+ return void 0;
360
+ }
361
+ }
362
+ const results = {};
363
+ encoded ??= /[%+]/.test(url);
364
+ let keyIndex = url.indexOf("?", 8);
365
+ while (keyIndex !== -1) {
366
+ const nextKeyIndex = url.indexOf("&", keyIndex + 1);
367
+ let valueIndex = url.indexOf("=", keyIndex);
368
+ if (valueIndex > nextKeyIndex && nextKeyIndex !== -1) {
369
+ valueIndex = -1;
370
+ }
371
+ let name = url.slice(
372
+ keyIndex + 1,
373
+ valueIndex === -1 ? nextKeyIndex === -1 ? void 0 : nextKeyIndex : valueIndex
374
+ );
375
+ if (encoded) {
376
+ name = _decodeURI(name);
377
+ }
378
+ keyIndex = nextKeyIndex;
379
+ if (name === "") {
380
+ continue;
381
+ }
382
+ let value;
383
+ if (valueIndex === -1) {
384
+ value = "";
385
+ } else {
386
+ value = url.slice(valueIndex + 1, nextKeyIndex === -1 ? void 0 : nextKeyIndex);
387
+ if (encoded) {
388
+ value = _decodeURI(value);
389
+ }
390
+ }
391
+ if (multiple) {
392
+ if (!(results[name] && Array.isArray(results[name]))) {
393
+ results[name] = [];
394
+ }
395
+ ;
396
+ results[name].push(value);
397
+ } else {
398
+ results[name] ??= value;
399
+ }
400
+ }
401
+ return key ? results[key] : results;
402
+ };
403
+ getQueryParam = _getQueryParam;
404
+ getQueryParams = (url, key) => {
405
+ return _getQueryParam(url, key, true);
406
+ };
407
+ decodeURIComponent_ = decodeURIComponent;
408
+ }
409
+ });
410
+
411
+ // node_modules/hono/dist/request.js
412
+ var tryDecodeURIComponent, HonoRequest;
413
+ var init_request = __esm({
414
+ "node_modules/hono/dist/request.js"() {
415
+ "use strict";
416
+ init_http_exception();
417
+ init_constants();
418
+ init_body();
419
+ init_url();
420
+ tryDecodeURIComponent = (str) => tryDecode(str, decodeURIComponent_);
421
+ HonoRequest = class {
422
+ /**
423
+ * `.raw` can get the raw Request object.
424
+ *
425
+ * @see {@link https://hono.dev/docs/api/request#raw}
426
+ *
427
+ * @example
428
+ * ```ts
429
+ * // For Cloudflare Workers
430
+ * app.post('/', async (c) => {
431
+ * const metadata = c.req.raw.cf?.hostMetadata?
432
+ * ...
433
+ * })
434
+ * ```
435
+ */
436
+ raw;
437
+ #validatedData;
438
+ // Short name of validatedData
439
+ #matchResult;
440
+ routeIndex = 0;
441
+ /**
442
+ * `.path` can get the pathname of the request.
443
+ *
444
+ * @see {@link https://hono.dev/docs/api/request#path}
445
+ *
446
+ * @example
447
+ * ```ts
448
+ * app.get('/about/me', (c) => {
449
+ * const pathname = c.req.path // `/about/me`
450
+ * })
451
+ * ```
452
+ */
453
+ path;
454
+ bodyCache = {};
455
+ constructor(request, path = "/", matchResult = [[]]) {
456
+ this.raw = request;
457
+ this.path = path;
458
+ this.#matchResult = matchResult;
459
+ this.#validatedData = {};
460
+ }
461
+ param(key) {
462
+ return key ? this.#getDecodedParam(key) : this.#getAllDecodedParams();
463
+ }
464
+ #getDecodedParam(key) {
465
+ const paramKey = this.#matchResult[0][this.routeIndex][1][key];
466
+ const param = this.#getParamValue(paramKey);
467
+ return param && /\%/.test(param) ? tryDecodeURIComponent(param) : param;
468
+ }
469
+ #getAllDecodedParams() {
470
+ const decoded = {};
471
+ const keys = Object.keys(this.#matchResult[0][this.routeIndex][1]);
472
+ for (const key of keys) {
473
+ const value = this.#getParamValue(this.#matchResult[0][this.routeIndex][1][key]);
474
+ if (value !== void 0) {
475
+ decoded[key] = /\%/.test(value) ? tryDecodeURIComponent(value) : value;
476
+ }
477
+ }
478
+ return decoded;
479
+ }
480
+ #getParamValue(paramKey) {
481
+ return this.#matchResult[1] ? this.#matchResult[1][paramKey] : paramKey;
482
+ }
483
+ query(key) {
484
+ return getQueryParam(this.url, key);
485
+ }
486
+ queries(key) {
487
+ return getQueryParams(this.url, key);
488
+ }
489
+ header(name) {
490
+ if (name) {
491
+ return this.raw.headers.get(name) ?? void 0;
492
+ }
493
+ const headerData = {};
494
+ this.raw.headers.forEach((value, key) => {
495
+ headerData[key] = value;
496
+ });
497
+ return headerData;
498
+ }
499
+ async parseBody(options) {
500
+ return this.bodyCache.parsedBody ??= await parseBody(this, options);
501
+ }
502
+ #cachedBody = (key) => {
503
+ const { bodyCache, raw: raw2 } = this;
504
+ const cachedBody = bodyCache[key];
505
+ if (cachedBody) {
506
+ return cachedBody;
507
+ }
508
+ const anyCachedKey = Object.keys(bodyCache)[0];
509
+ if (anyCachedKey) {
510
+ return bodyCache[anyCachedKey].then((body) => {
511
+ if (anyCachedKey === "json") {
512
+ body = JSON.stringify(body);
513
+ }
514
+ return new Response(body)[key]();
515
+ });
516
+ }
517
+ return bodyCache[key] = raw2[key]();
518
+ };
519
+ /**
520
+ * `.json()` can parse Request body of type `application/json`
521
+ *
522
+ * @see {@link https://hono.dev/docs/api/request#json}
523
+ *
524
+ * @example
525
+ * ```ts
526
+ * app.post('/entry', async (c) => {
527
+ * const body = await c.req.json()
528
+ * })
529
+ * ```
530
+ */
531
+ json() {
532
+ return this.#cachedBody("text").then((text) => JSON.parse(text));
533
+ }
534
+ /**
535
+ * `.text()` can parse Request body of type `text/plain`
536
+ *
537
+ * @see {@link https://hono.dev/docs/api/request#text}
538
+ *
539
+ * @example
540
+ * ```ts
541
+ * app.post('/entry', async (c) => {
542
+ * const body = await c.req.text()
543
+ * })
544
+ * ```
545
+ */
546
+ text() {
547
+ return this.#cachedBody("text");
548
+ }
549
+ /**
550
+ * `.arrayBuffer()` parse Request body as an `ArrayBuffer`
551
+ *
552
+ * @see {@link https://hono.dev/docs/api/request#arraybuffer}
553
+ *
554
+ * @example
555
+ * ```ts
556
+ * app.post('/entry', async (c) => {
557
+ * const body = await c.req.arrayBuffer()
558
+ * })
559
+ * ```
560
+ */
561
+ arrayBuffer() {
562
+ return this.#cachedBody("arrayBuffer");
563
+ }
564
+ /**
565
+ * Parses the request body as a `Blob`.
566
+ * @example
567
+ * ```ts
568
+ * app.post('/entry', async (c) => {
569
+ * const body = await c.req.blob();
570
+ * });
571
+ * ```
572
+ * @see https://hono.dev/docs/api/request#blob
573
+ */
574
+ blob() {
575
+ return this.#cachedBody("blob");
576
+ }
577
+ /**
578
+ * Parses the request body as `FormData`.
579
+ * @example
580
+ * ```ts
581
+ * app.post('/entry', async (c) => {
582
+ * const body = await c.req.formData();
583
+ * });
584
+ * ```
585
+ * @see https://hono.dev/docs/api/request#formdata
586
+ */
587
+ formData() {
588
+ return this.#cachedBody("formData");
589
+ }
590
+ /**
591
+ * Adds validated data to the request.
592
+ *
593
+ * @param target - The target of the validation.
594
+ * @param data - The validated data to add.
595
+ */
596
+ addValidatedData(target, data) {
597
+ this.#validatedData[target] = data;
598
+ }
599
+ valid(target) {
600
+ return this.#validatedData[target];
601
+ }
602
+ /**
603
+ * `.url()` can get the request url strings.
604
+ *
605
+ * @see {@link https://hono.dev/docs/api/request#url}
606
+ *
607
+ * @example
608
+ * ```ts
609
+ * app.get('/about/me', (c) => {
610
+ * const url = c.req.url // `http://localhost:8787/about/me`
611
+ * ...
612
+ * })
613
+ * ```
614
+ */
615
+ get url() {
616
+ return this.raw.url;
617
+ }
618
+ /**
619
+ * `.method()` can get the method name of the request.
620
+ *
621
+ * @see {@link https://hono.dev/docs/api/request#method}
622
+ *
623
+ * @example
624
+ * ```ts
625
+ * app.get('/about/me', (c) => {
626
+ * const method = c.req.method // `GET`
627
+ * })
628
+ * ```
629
+ */
630
+ get method() {
631
+ return this.raw.method;
632
+ }
633
+ get [GET_MATCH_RESULT]() {
634
+ return this.#matchResult;
635
+ }
636
+ /**
637
+ * `.matchedRoutes()` can return a matched route in the handler
638
+ *
639
+ * @deprecated
640
+ *
641
+ * Use matchedRoutes helper defined in "hono/route" instead.
642
+ *
643
+ * @see {@link https://hono.dev/docs/api/request#matchedroutes}
644
+ *
645
+ * @example
646
+ * ```ts
647
+ * app.use('*', async function logger(c, next) {
648
+ * await next()
649
+ * c.req.matchedRoutes.forEach(({ handler, method, path }, i) => {
650
+ * const name = handler.name || (handler.length < 2 ? '[handler]' : '[middleware]')
651
+ * console.log(
652
+ * method,
653
+ * ' ',
654
+ * path,
655
+ * ' '.repeat(Math.max(10 - path.length, 0)),
656
+ * name,
657
+ * i === c.req.routeIndex ? '<- respond from here' : ''
658
+ * )
659
+ * })
660
+ * })
661
+ * ```
662
+ */
663
+ get matchedRoutes() {
664
+ return this.#matchResult[0].map(([[, route]]) => route);
665
+ }
666
+ /**
667
+ * `routePath()` can retrieve the path registered within the handler
668
+ *
669
+ * @deprecated
670
+ *
671
+ * Use routePath helper defined in "hono/route" instead.
672
+ *
673
+ * @see {@link https://hono.dev/docs/api/request#routepath}
674
+ *
675
+ * @example
676
+ * ```ts
677
+ * app.get('/posts/:id', (c) => {
678
+ * return c.json({ path: c.req.routePath })
679
+ * })
680
+ * ```
681
+ */
682
+ get routePath() {
683
+ return this.#matchResult[0].map(([[, route]]) => route)[this.routeIndex].path;
684
+ }
685
+ };
686
+ }
687
+ });
688
+
689
+ // node_modules/hono/dist/utils/html.js
690
+ var HtmlEscapedCallbackPhase, raw, resolveCallback;
691
+ var init_html = __esm({
692
+ "node_modules/hono/dist/utils/html.js"() {
693
+ "use strict";
694
+ HtmlEscapedCallbackPhase = {
695
+ Stringify: 1,
696
+ BeforeStream: 2,
697
+ Stream: 3
698
+ };
699
+ raw = (value, callbacks) => {
700
+ const escapedString = new String(value);
701
+ escapedString.isEscaped = true;
702
+ escapedString.callbacks = callbacks;
703
+ return escapedString;
704
+ };
705
+ resolveCallback = async (str, phase, preserveCallbacks, context, buffer) => {
706
+ if (typeof str === "object" && !(str instanceof String)) {
707
+ if (!(str instanceof Promise)) {
708
+ str = str.toString();
709
+ }
710
+ if (str instanceof Promise) {
711
+ str = await str;
712
+ }
713
+ }
714
+ const callbacks = str.callbacks;
715
+ if (!callbacks?.length) {
716
+ return Promise.resolve(str);
717
+ }
718
+ if (buffer) {
719
+ buffer[0] += str;
720
+ } else {
721
+ buffer = [str];
722
+ }
723
+ const resStr = Promise.all(callbacks.map((c) => c({ phase, buffer, context }))).then(
724
+ (res) => Promise.all(
725
+ res.filter(Boolean).map((str2) => resolveCallback(str2, phase, false, context, buffer))
726
+ ).then(() => buffer[0])
727
+ );
728
+ if (preserveCallbacks) {
729
+ return raw(await resStr, callbacks);
730
+ } else {
731
+ return resStr;
732
+ }
733
+ };
734
+ }
735
+ });
736
+
737
+ // node_modules/hono/dist/context.js
738
+ var TEXT_PLAIN, setDefaultContentType, createResponseInstance, Context;
739
+ var init_context = __esm({
740
+ "node_modules/hono/dist/context.js"() {
741
+ "use strict";
742
+ init_request();
743
+ init_html();
744
+ TEXT_PLAIN = "text/plain; charset=UTF-8";
745
+ setDefaultContentType = (contentType, headers) => {
746
+ return {
747
+ "Content-Type": contentType,
748
+ ...headers
749
+ };
750
+ };
751
+ createResponseInstance = (body, init) => new Response(body, init);
752
+ Context = class {
753
+ #rawRequest;
754
+ #req;
755
+ /**
756
+ * `.env` can get bindings (environment variables, secrets, KV namespaces, D1 database, R2 bucket etc.) in Cloudflare Workers.
757
+ *
758
+ * @see {@link https://hono.dev/docs/api/context#env}
759
+ *
760
+ * @example
761
+ * ```ts
762
+ * // Environment object for Cloudflare Workers
763
+ * app.get('*', async c => {
764
+ * const counter = c.env.COUNTER
765
+ * })
766
+ * ```
767
+ */
768
+ env = {};
769
+ #var;
770
+ finalized = false;
771
+ /**
772
+ * `.error` can get the error object from the middleware if the Handler throws an error.
773
+ *
774
+ * @see {@link https://hono.dev/docs/api/context#error}
775
+ *
776
+ * @example
777
+ * ```ts
778
+ * app.use('*', async (c, next) => {
779
+ * await next()
780
+ * if (c.error) {
781
+ * // do something...
782
+ * }
783
+ * })
784
+ * ```
785
+ */
786
+ error;
787
+ #status;
788
+ #executionCtx;
789
+ #res;
790
+ #layout;
791
+ #renderer;
792
+ #notFoundHandler;
793
+ #preparedHeaders;
794
+ #matchResult;
795
+ #path;
796
+ /**
797
+ * Creates an instance of the Context class.
798
+ *
799
+ * @param req - The Request object.
800
+ * @param options - Optional configuration options for the context.
801
+ */
802
+ constructor(req, options) {
803
+ this.#rawRequest = req;
804
+ if (options) {
805
+ this.#executionCtx = options.executionCtx;
806
+ this.env = options.env;
807
+ this.#notFoundHandler = options.notFoundHandler;
808
+ this.#path = options.path;
809
+ this.#matchResult = options.matchResult;
810
+ }
811
+ }
812
+ /**
813
+ * `.req` is the instance of {@link HonoRequest}.
814
+ */
815
+ get req() {
816
+ this.#req ??= new HonoRequest(this.#rawRequest, this.#path, this.#matchResult);
817
+ return this.#req;
818
+ }
819
+ /**
820
+ * @see {@link https://hono.dev/docs/api/context#event}
821
+ * The FetchEvent associated with the current request.
822
+ *
823
+ * @throws Will throw an error if the context does not have a FetchEvent.
824
+ */
825
+ get event() {
826
+ if (this.#executionCtx && "respondWith" in this.#executionCtx) {
827
+ return this.#executionCtx;
828
+ } else {
829
+ throw Error("This context has no FetchEvent");
830
+ }
831
+ }
832
+ /**
833
+ * @see {@link https://hono.dev/docs/api/context#executionctx}
834
+ * The ExecutionContext associated with the current request.
835
+ *
836
+ * @throws Will throw an error if the context does not have an ExecutionContext.
837
+ */
838
+ get executionCtx() {
839
+ if (this.#executionCtx) {
840
+ return this.#executionCtx;
841
+ } else {
842
+ throw Error("This context has no ExecutionContext");
843
+ }
844
+ }
845
+ /**
846
+ * @see {@link https://hono.dev/docs/api/context#res}
847
+ * The Response object for the current request.
848
+ */
849
+ get res() {
850
+ return this.#res ||= createResponseInstance(null, {
851
+ headers: this.#preparedHeaders ??= new Headers()
852
+ });
853
+ }
854
+ /**
855
+ * Sets the Response object for the current request.
856
+ *
857
+ * @param _res - The Response object to set.
858
+ */
859
+ set res(_res) {
860
+ if (this.#res && _res) {
861
+ _res = createResponseInstance(_res.body, _res);
862
+ for (const [k, v] of this.#res.headers.entries()) {
863
+ if (k === "content-type") {
864
+ continue;
865
+ }
866
+ if (k === "set-cookie") {
867
+ const cookies = this.#res.headers.getSetCookie();
868
+ _res.headers.delete("set-cookie");
869
+ for (const cookie of cookies) {
870
+ _res.headers.append("set-cookie", cookie);
871
+ }
872
+ } else {
873
+ _res.headers.set(k, v);
874
+ }
875
+ }
876
+ }
877
+ this.#res = _res;
878
+ this.finalized = true;
879
+ }
880
+ /**
881
+ * `.render()` can create a response within a layout.
882
+ *
883
+ * @see {@link https://hono.dev/docs/api/context#render-setrenderer}
884
+ *
885
+ * @example
886
+ * ```ts
887
+ * app.get('/', (c) => {
888
+ * return c.render('Hello!')
889
+ * })
890
+ * ```
891
+ */
892
+ render = (...args) => {
893
+ this.#renderer ??= (content) => this.html(content);
894
+ return this.#renderer(...args);
895
+ };
896
+ /**
897
+ * Sets the layout for the response.
898
+ *
899
+ * @param layout - The layout to set.
900
+ * @returns The layout function.
901
+ */
902
+ setLayout = (layout) => this.#layout = layout;
903
+ /**
904
+ * Gets the current layout for the response.
905
+ *
906
+ * @returns The current layout function.
907
+ */
908
+ getLayout = () => this.#layout;
909
+ /**
910
+ * `.setRenderer()` can set the layout in the custom middleware.
911
+ *
912
+ * @see {@link https://hono.dev/docs/api/context#render-setrenderer}
913
+ *
914
+ * @example
915
+ * ```tsx
916
+ * app.use('*', async (c, next) => {
917
+ * c.setRenderer((content) => {
918
+ * return c.html(
919
+ * <html>
920
+ * <body>
921
+ * <p>{content}</p>
922
+ * </body>
923
+ * </html>
924
+ * )
925
+ * })
926
+ * await next()
927
+ * })
928
+ * ```
929
+ */
930
+ setRenderer = (renderer) => {
931
+ this.#renderer = renderer;
932
+ };
933
+ /**
934
+ * `.header()` can set headers.
935
+ *
936
+ * @see {@link https://hono.dev/docs/api/context#header}
937
+ *
938
+ * @example
939
+ * ```ts
940
+ * app.get('/welcome', (c) => {
941
+ * // Set headers
942
+ * c.header('X-Message', 'Hello!')
943
+ * c.header('Content-Type', 'text/plain')
944
+ *
945
+ * return c.body('Thank you for coming')
946
+ * })
947
+ * ```
948
+ */
949
+ header = (name, value, options) => {
950
+ if (this.finalized) {
951
+ this.#res = createResponseInstance(this.#res.body, this.#res);
952
+ }
953
+ const headers = this.#res ? this.#res.headers : this.#preparedHeaders ??= new Headers();
954
+ if (value === void 0) {
955
+ headers.delete(name);
956
+ } else if (options?.append) {
957
+ headers.append(name, value);
958
+ } else {
959
+ headers.set(name, value);
960
+ }
961
+ };
962
+ status = (status) => {
963
+ this.#status = status;
964
+ };
965
+ /**
966
+ * `.set()` can set the value specified by the key.
967
+ *
968
+ * @see {@link https://hono.dev/docs/api/context#set-get}
969
+ *
970
+ * @example
971
+ * ```ts
972
+ * app.use('*', async (c, next) => {
973
+ * c.set('message', 'Hono is hot!!')
974
+ * await next()
975
+ * })
976
+ * ```
977
+ */
978
+ set = (key, value) => {
979
+ this.#var ??= /* @__PURE__ */ new Map();
980
+ this.#var.set(key, value);
981
+ };
982
+ /**
983
+ * `.get()` can use the value specified by the key.
984
+ *
985
+ * @see {@link https://hono.dev/docs/api/context#set-get}
986
+ *
987
+ * @example
988
+ * ```ts
989
+ * app.get('/', (c) => {
990
+ * const message = c.get('message')
991
+ * return c.text(`The message is "${message}"`)
992
+ * })
993
+ * ```
994
+ */
995
+ get = (key) => {
996
+ return this.#var ? this.#var.get(key) : void 0;
997
+ };
998
+ /**
999
+ * `.var` can access the value of a variable.
1000
+ *
1001
+ * @see {@link https://hono.dev/docs/api/context#var}
1002
+ *
1003
+ * @example
1004
+ * ```ts
1005
+ * const result = c.var.client.oneMethod()
1006
+ * ```
1007
+ */
1008
+ // c.var.propName is a read-only
1009
+ get var() {
1010
+ if (!this.#var) {
1011
+ return {};
1012
+ }
1013
+ return Object.fromEntries(this.#var);
1014
+ }
1015
+ #newResponse(data, arg, headers) {
1016
+ const responseHeaders = this.#res ? new Headers(this.#res.headers) : this.#preparedHeaders ?? new Headers();
1017
+ if (typeof arg === "object" && "headers" in arg) {
1018
+ const argHeaders = arg.headers instanceof Headers ? arg.headers : new Headers(arg.headers);
1019
+ for (const [key, value] of argHeaders) {
1020
+ if (key.toLowerCase() === "set-cookie") {
1021
+ responseHeaders.append(key, value);
1022
+ } else {
1023
+ responseHeaders.set(key, value);
1024
+ }
1025
+ }
1026
+ }
1027
+ if (headers) {
1028
+ for (const [k, v] of Object.entries(headers)) {
1029
+ if (typeof v === "string") {
1030
+ responseHeaders.set(k, v);
1031
+ } else {
1032
+ responseHeaders.delete(k);
1033
+ for (const v2 of v) {
1034
+ responseHeaders.append(k, v2);
1035
+ }
1036
+ }
1037
+ }
1038
+ }
1039
+ const status = typeof arg === "number" ? arg : arg?.status ?? this.#status;
1040
+ return createResponseInstance(data, { status, headers: responseHeaders });
1041
+ }
1042
+ newResponse = (...args) => this.#newResponse(...args);
1043
+ /**
1044
+ * `.body()` can return the HTTP response.
1045
+ * You can set headers with `.header()` and set HTTP status code with `.status`.
1046
+ * This can also be set in `.text()`, `.json()` and so on.
1047
+ *
1048
+ * @see {@link https://hono.dev/docs/api/context#body}
1049
+ *
1050
+ * @example
1051
+ * ```ts
1052
+ * app.get('/welcome', (c) => {
1053
+ * // Set headers
1054
+ * c.header('X-Message', 'Hello!')
1055
+ * c.header('Content-Type', 'text/plain')
1056
+ * // Set HTTP status code
1057
+ * c.status(201)
1058
+ *
1059
+ * // Return the response body
1060
+ * return c.body('Thank you for coming')
1061
+ * })
1062
+ * ```
1063
+ */
1064
+ body = (data, arg, headers) => this.#newResponse(data, arg, headers);
1065
+ /**
1066
+ * `.text()` can render text as `Content-Type:text/plain`.
1067
+ *
1068
+ * @see {@link https://hono.dev/docs/api/context#text}
1069
+ *
1070
+ * @example
1071
+ * ```ts
1072
+ * app.get('/say', (c) => {
1073
+ * return c.text('Hello!')
1074
+ * })
1075
+ * ```
1076
+ */
1077
+ text = (text, arg, headers) => {
1078
+ return !this.#preparedHeaders && !this.#status && !arg && !headers && !this.finalized ? new Response(text) : this.#newResponse(
1079
+ text,
1080
+ arg,
1081
+ setDefaultContentType(TEXT_PLAIN, headers)
1082
+ );
1083
+ };
1084
+ /**
1085
+ * `.json()` can render JSON as `Content-Type:application/json`.
1086
+ *
1087
+ * @see {@link https://hono.dev/docs/api/context#json}
1088
+ *
1089
+ * @example
1090
+ * ```ts
1091
+ * app.get('/api', (c) => {
1092
+ * return c.json({ message: 'Hello!' })
1093
+ * })
1094
+ * ```
1095
+ */
1096
+ json = (object, arg, headers) => {
1097
+ return this.#newResponse(
1098
+ JSON.stringify(object),
1099
+ arg,
1100
+ setDefaultContentType("application/json", headers)
1101
+ );
1102
+ };
1103
+ html = (html, arg, headers) => {
1104
+ const res = (html2) => this.#newResponse(html2, arg, setDefaultContentType("text/html; charset=UTF-8", headers));
1105
+ return typeof html === "object" ? resolveCallback(html, HtmlEscapedCallbackPhase.Stringify, false, {}).then(res) : res(html);
1106
+ };
1107
+ /**
1108
+ * `.redirect()` can Redirect, default status code is 302.
1109
+ *
1110
+ * @see {@link https://hono.dev/docs/api/context#redirect}
1111
+ *
1112
+ * @example
1113
+ * ```ts
1114
+ * app.get('/redirect', (c) => {
1115
+ * return c.redirect('/')
1116
+ * })
1117
+ * app.get('/redirect-permanently', (c) => {
1118
+ * return c.redirect('/', 301)
1119
+ * })
1120
+ * ```
1121
+ */
1122
+ redirect = (location, status) => {
1123
+ const locationString = String(location);
1124
+ this.header(
1125
+ "Location",
1126
+ // Multibyes should be encoded
1127
+ // eslint-disable-next-line no-control-regex
1128
+ !/[^\x00-\xFF]/.test(locationString) ? locationString : encodeURI(locationString)
1129
+ );
1130
+ return this.newResponse(null, status ?? 302);
1131
+ };
1132
+ /**
1133
+ * `.notFound()` can return the Not Found Response.
1134
+ *
1135
+ * @see {@link https://hono.dev/docs/api/context#notfound}
1136
+ *
1137
+ * @example
1138
+ * ```ts
1139
+ * app.get('/notfound', (c) => {
1140
+ * return c.notFound()
1141
+ * })
1142
+ * ```
1143
+ */
1144
+ notFound = () => {
1145
+ this.#notFoundHandler ??= () => createResponseInstance();
1146
+ return this.#notFoundHandler(this);
1147
+ };
1148
+ };
1149
+ }
1150
+ });
1151
+
1152
+ // node_modules/hono/dist/router.js
1153
+ var METHOD_NAME_ALL, METHOD_NAME_ALL_LOWERCASE, METHODS, MESSAGE_MATCHER_IS_ALREADY_BUILT, UnsupportedPathError;
1154
+ var init_router = __esm({
1155
+ "node_modules/hono/dist/router.js"() {
1156
+ "use strict";
1157
+ METHOD_NAME_ALL = "ALL";
1158
+ METHOD_NAME_ALL_LOWERCASE = "all";
1159
+ METHODS = ["get", "post", "put", "delete", "options", "patch"];
1160
+ MESSAGE_MATCHER_IS_ALREADY_BUILT = "Can not add a route since the matcher is already built.";
1161
+ UnsupportedPathError = class extends Error {
1162
+ };
1163
+ }
1164
+ });
1165
+
1166
+ // node_modules/hono/dist/utils/constants.js
1167
+ var COMPOSED_HANDLER;
1168
+ var init_constants2 = __esm({
1169
+ "node_modules/hono/dist/utils/constants.js"() {
1170
+ "use strict";
1171
+ COMPOSED_HANDLER = "__COMPOSED_HANDLER";
1172
+ }
1173
+ });
1174
+
1175
+ // node_modules/hono/dist/hono-base.js
1176
+ var notFoundHandler, errorHandler, Hono;
1177
+ var init_hono_base = __esm({
1178
+ "node_modules/hono/dist/hono-base.js"() {
1179
+ "use strict";
1180
+ init_compose();
1181
+ init_context();
1182
+ init_router();
1183
+ init_constants2();
1184
+ init_url();
1185
+ notFoundHandler = (c) => {
1186
+ return c.text("404 Not Found", 404);
1187
+ };
1188
+ errorHandler = (err, c) => {
1189
+ if ("getResponse" in err) {
1190
+ const res = err.getResponse();
1191
+ return c.newResponse(res.body, res);
1192
+ }
1193
+ console.error(err);
1194
+ return c.text("Internal Server Error", 500);
1195
+ };
1196
+ Hono = class _Hono {
1197
+ get;
1198
+ post;
1199
+ put;
1200
+ delete;
1201
+ options;
1202
+ patch;
1203
+ all;
1204
+ on;
1205
+ use;
1206
+ /*
1207
+ This class is like an abstract class and does not have a router.
1208
+ To use it, inherit the class and implement router in the constructor.
1209
+ */
1210
+ router;
1211
+ getPath;
1212
+ // Cannot use `#` because it requires visibility at JavaScript runtime.
1213
+ _basePath = "/";
1214
+ #path = "/";
1215
+ routes = [];
1216
+ constructor(options = {}) {
1217
+ const allMethods = [...METHODS, METHOD_NAME_ALL_LOWERCASE];
1218
+ allMethods.forEach((method) => {
1219
+ this[method] = (args1, ...args) => {
1220
+ if (typeof args1 === "string") {
1221
+ this.#path = args1;
1222
+ } else {
1223
+ this.#addRoute(method, this.#path, args1);
1224
+ }
1225
+ args.forEach((handler) => {
1226
+ this.#addRoute(method, this.#path, handler);
1227
+ });
1228
+ return this;
1229
+ };
1230
+ });
1231
+ this.on = (method, path, ...handlers) => {
1232
+ for (const p of [path].flat()) {
1233
+ this.#path = p;
1234
+ for (const m of [method].flat()) {
1235
+ handlers.map((handler) => {
1236
+ this.#addRoute(m.toUpperCase(), this.#path, handler);
1237
+ });
1238
+ }
1239
+ }
1240
+ return this;
1241
+ };
1242
+ this.use = (arg1, ...handlers) => {
1243
+ if (typeof arg1 === "string") {
1244
+ this.#path = arg1;
1245
+ } else {
1246
+ this.#path = "*";
1247
+ handlers.unshift(arg1);
1248
+ }
1249
+ handlers.forEach((handler) => {
1250
+ this.#addRoute(METHOD_NAME_ALL, this.#path, handler);
1251
+ });
1252
+ return this;
1253
+ };
1254
+ const { strict, ...optionsWithoutStrict } = options;
1255
+ Object.assign(this, optionsWithoutStrict);
1256
+ this.getPath = strict ?? true ? options.getPath ?? getPath : getPathNoStrict;
1257
+ }
1258
+ #clone() {
1259
+ const clone = new _Hono({
1260
+ router: this.router,
1261
+ getPath: this.getPath
1262
+ });
1263
+ clone.errorHandler = this.errorHandler;
1264
+ clone.#notFoundHandler = this.#notFoundHandler;
1265
+ clone.routes = this.routes;
1266
+ return clone;
1267
+ }
1268
+ #notFoundHandler = notFoundHandler;
1269
+ // Cannot use `#` because it requires visibility at JavaScript runtime.
1270
+ errorHandler = errorHandler;
1271
+ /**
1272
+ * `.route()` allows grouping other Hono instance in routes.
1273
+ *
1274
+ * @see {@link https://hono.dev/docs/api/routing#grouping}
1275
+ *
1276
+ * @param {string} path - base Path
1277
+ * @param {Hono} app - other Hono instance
1278
+ * @returns {Hono} routed Hono instance
1279
+ *
1280
+ * @example
1281
+ * ```ts
1282
+ * const app = new Hono()
1283
+ * const app2 = new Hono()
1284
+ *
1285
+ * app2.get("/user", (c) => c.text("user"))
1286
+ * app.route("/api", app2) // GET /api/user
1287
+ * ```
1288
+ */
1289
+ route(path, app) {
1290
+ const subApp = this.basePath(path);
1291
+ app.routes.map((r) => {
1292
+ let handler;
1293
+ if (app.errorHandler === errorHandler) {
1294
+ handler = r.handler;
1295
+ } else {
1296
+ handler = async (c, next) => (await compose([], app.errorHandler)(c, () => r.handler(c, next))).res;
1297
+ handler[COMPOSED_HANDLER] = r.handler;
1298
+ }
1299
+ subApp.#addRoute(r.method, r.path, handler);
1300
+ });
1301
+ return this;
1302
+ }
1303
+ /**
1304
+ * `.basePath()` allows base paths to be specified.
1305
+ *
1306
+ * @see {@link https://hono.dev/docs/api/routing#base-path}
1307
+ *
1308
+ * @param {string} path - base Path
1309
+ * @returns {Hono} changed Hono instance
1310
+ *
1311
+ * @example
1312
+ * ```ts
1313
+ * const api = new Hono().basePath('/api')
1314
+ * ```
1315
+ */
1316
+ basePath(path) {
1317
+ const subApp = this.#clone();
1318
+ subApp._basePath = mergePath(this._basePath, path);
1319
+ return subApp;
1320
+ }
1321
+ /**
1322
+ * `.onError()` handles an error and returns a customized Response.
1323
+ *
1324
+ * @see {@link https://hono.dev/docs/api/hono#error-handling}
1325
+ *
1326
+ * @param {ErrorHandler} handler - request Handler for error
1327
+ * @returns {Hono} changed Hono instance
1328
+ *
1329
+ * @example
1330
+ * ```ts
1331
+ * app.onError((err, c) => {
1332
+ * console.error(`${err}`)
1333
+ * return c.text('Custom Error Message', 500)
1334
+ * })
1335
+ * ```
1336
+ */
1337
+ onError = (handler) => {
1338
+ this.errorHandler = handler;
1339
+ return this;
1340
+ };
1341
+ /**
1342
+ * `.notFound()` allows you to customize a Not Found Response.
1343
+ *
1344
+ * @see {@link https://hono.dev/docs/api/hono#not-found}
1345
+ *
1346
+ * @param {NotFoundHandler} handler - request handler for not-found
1347
+ * @returns {Hono} changed Hono instance
1348
+ *
1349
+ * @example
1350
+ * ```ts
1351
+ * app.notFound((c) => {
1352
+ * return c.text('Custom 404 Message', 404)
1353
+ * })
1354
+ * ```
1355
+ */
1356
+ notFound = (handler) => {
1357
+ this.#notFoundHandler = handler;
1358
+ return this;
1359
+ };
1360
+ /**
1361
+ * `.mount()` allows you to mount applications built with other frameworks into your Hono application.
1362
+ *
1363
+ * @see {@link https://hono.dev/docs/api/hono#mount}
1364
+ *
1365
+ * @param {string} path - base Path
1366
+ * @param {Function} applicationHandler - other Request Handler
1367
+ * @param {MountOptions} [options] - options of `.mount()`
1368
+ * @returns {Hono} mounted Hono instance
1369
+ *
1370
+ * @example
1371
+ * ```ts
1372
+ * import { Router as IttyRouter } from 'itty-router'
1373
+ * import { Hono } from 'hono'
1374
+ * // Create itty-router application
1375
+ * const ittyRouter = IttyRouter()
1376
+ * // GET /itty-router/hello
1377
+ * ittyRouter.get('/hello', () => new Response('Hello from itty-router'))
1378
+ *
1379
+ * const app = new Hono()
1380
+ * app.mount('/itty-router', ittyRouter.handle)
1381
+ * ```
1382
+ *
1383
+ * @example
1384
+ * ```ts
1385
+ * const app = new Hono()
1386
+ * // Send the request to another application without modification.
1387
+ * app.mount('/app', anotherApp, {
1388
+ * replaceRequest: (req) => req,
1389
+ * })
1390
+ * ```
1391
+ */
1392
+ mount(path, applicationHandler, options) {
1393
+ let replaceRequest;
1394
+ let optionHandler;
1395
+ if (options) {
1396
+ if (typeof options === "function") {
1397
+ optionHandler = options;
1398
+ } else {
1399
+ optionHandler = options.optionHandler;
1400
+ if (options.replaceRequest === false) {
1401
+ replaceRequest = (request) => request;
1402
+ } else {
1403
+ replaceRequest = options.replaceRequest;
1404
+ }
1405
+ }
1406
+ }
1407
+ const getOptions = optionHandler ? (c) => {
1408
+ const options2 = optionHandler(c);
1409
+ return Array.isArray(options2) ? options2 : [options2];
1410
+ } : (c) => {
1411
+ let executionContext = void 0;
1412
+ try {
1413
+ executionContext = c.executionCtx;
1414
+ } catch {
1415
+ }
1416
+ return [c.env, executionContext];
1417
+ };
1418
+ replaceRequest ||= (() => {
1419
+ const mergedPath = mergePath(this._basePath, path);
1420
+ const pathPrefixLength = mergedPath === "/" ? 0 : mergedPath.length;
1421
+ return (request) => {
1422
+ const url = new URL(request.url);
1423
+ url.pathname = url.pathname.slice(pathPrefixLength) || "/";
1424
+ return new Request(url, request);
1425
+ };
1426
+ })();
1427
+ const handler = async (c, next) => {
1428
+ const res = await applicationHandler(replaceRequest(c.req.raw), ...getOptions(c));
1429
+ if (res) {
1430
+ return res;
1431
+ }
1432
+ await next();
1433
+ };
1434
+ this.#addRoute(METHOD_NAME_ALL, mergePath(path, "*"), handler);
1435
+ return this;
1436
+ }
1437
+ #addRoute(method, path, handler) {
1438
+ method = method.toUpperCase();
1439
+ path = mergePath(this._basePath, path);
1440
+ const r = { basePath: this._basePath, path, method, handler };
1441
+ this.router.add(method, path, [handler, r]);
1442
+ this.routes.push(r);
1443
+ }
1444
+ #handleError(err, c) {
1445
+ if (err instanceof Error) {
1446
+ return this.errorHandler(err, c);
1447
+ }
1448
+ throw err;
1449
+ }
1450
+ #dispatch(request, executionCtx, env, method) {
1451
+ if (method === "HEAD") {
1452
+ return (async () => new Response(null, await this.#dispatch(request, executionCtx, env, "GET")))();
1453
+ }
1454
+ const path = this.getPath(request, { env });
1455
+ const matchResult = this.router.match(method, path);
1456
+ const c = new Context(request, {
1457
+ path,
1458
+ matchResult,
1459
+ env,
1460
+ executionCtx,
1461
+ notFoundHandler: this.#notFoundHandler
1462
+ });
1463
+ if (matchResult[0].length === 1) {
1464
+ let res;
1465
+ try {
1466
+ res = matchResult[0][0][0][0](c, async () => {
1467
+ c.res = await this.#notFoundHandler(c);
1468
+ });
1469
+ } catch (err) {
1470
+ return this.#handleError(err, c);
1471
+ }
1472
+ return res instanceof Promise ? res.then(
1473
+ (resolved) => resolved || (c.finalized ? c.res : this.#notFoundHandler(c))
1474
+ ).catch((err) => this.#handleError(err, c)) : res ?? this.#notFoundHandler(c);
1475
+ }
1476
+ const composed = compose(matchResult[0], this.errorHandler, this.#notFoundHandler);
1477
+ return (async () => {
1478
+ try {
1479
+ const context = await composed(c);
1480
+ if (!context.finalized) {
1481
+ throw new Error(
1482
+ "Context is not finalized. Did you forget to return a Response object or `await next()`?"
1483
+ );
1484
+ }
1485
+ return context.res;
1486
+ } catch (err) {
1487
+ return this.#handleError(err, c);
1488
+ }
1489
+ })();
1490
+ }
1491
+ /**
1492
+ * `.fetch()` will be entry point of your app.
1493
+ *
1494
+ * @see {@link https://hono.dev/docs/api/hono#fetch}
1495
+ *
1496
+ * @param {Request} request - request Object of request
1497
+ * @param {Env} Env - env Object
1498
+ * @param {ExecutionContext} - context of execution
1499
+ * @returns {Response | Promise<Response>} response of request
1500
+ *
1501
+ */
1502
+ fetch = (request, ...rest) => {
1503
+ return this.#dispatch(request, rest[1], rest[0], request.method);
1504
+ };
1505
+ /**
1506
+ * `.request()` is a useful method for testing.
1507
+ * You can pass a URL or pathname to send a GET request.
1508
+ * app will return a Response object.
1509
+ * ```ts
1510
+ * test('GET /hello is ok', async () => {
1511
+ * const res = await app.request('/hello')
1512
+ * expect(res.status).toBe(200)
1513
+ * })
1514
+ * ```
1515
+ * @see https://hono.dev/docs/api/hono#request
1516
+ */
1517
+ request = (input, requestInit, Env, executionCtx) => {
1518
+ if (input instanceof Request) {
1519
+ return this.fetch(requestInit ? new Request(input, requestInit) : input, Env, executionCtx);
1520
+ }
1521
+ input = input.toString();
1522
+ return this.fetch(
1523
+ new Request(
1524
+ /^https?:\/\//.test(input) ? input : `http://localhost${mergePath("/", input)}`,
1525
+ requestInit
1526
+ ),
1527
+ Env,
1528
+ executionCtx
1529
+ );
1530
+ };
1531
+ /**
1532
+ * `.fire()` automatically adds a global fetch event listener.
1533
+ * This can be useful for environments that adhere to the Service Worker API, such as non-ES module Cloudflare Workers.
1534
+ * @deprecated
1535
+ * Use `fire` from `hono/service-worker` instead.
1536
+ * ```ts
1537
+ * import { Hono } from 'hono'
1538
+ * import { fire } from 'hono/service-worker'
1539
+ *
1540
+ * const app = new Hono()
1541
+ * // ...
1542
+ * fire(app)
1543
+ * ```
1544
+ * @see https://hono.dev/docs/api/hono#fire
1545
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API
1546
+ * @see https://developers.cloudflare.com/workers/reference/migrate-to-module-workers/
1547
+ */
1548
+ fire = () => {
1549
+ addEventListener("fetch", (event) => {
1550
+ event.respondWith(this.#dispatch(event.request, event, void 0, event.request.method));
1551
+ });
1552
+ };
1553
+ };
1554
+ }
1555
+ });
1556
+
1557
+ // node_modules/hono/dist/router/reg-exp-router/matcher.js
1558
+ function match(method, path) {
1559
+ const matchers = this.buildAllMatchers();
1560
+ const match2 = ((method2, path2) => {
1561
+ const matcher = matchers[method2] || matchers[METHOD_NAME_ALL];
1562
+ const staticMatch = matcher[2][path2];
1563
+ if (staticMatch) {
1564
+ return staticMatch;
1565
+ }
1566
+ const match3 = path2.match(matcher[0]);
1567
+ if (!match3) {
1568
+ return [[], emptyParam];
1569
+ }
1570
+ const index = match3.indexOf("", 1);
1571
+ return [matcher[1][index], match3];
1572
+ });
1573
+ this.match = match2;
1574
+ return match2(method, path);
1575
+ }
1576
+ var emptyParam;
1577
+ var init_matcher = __esm({
1578
+ "node_modules/hono/dist/router/reg-exp-router/matcher.js"() {
1579
+ "use strict";
1580
+ init_router();
1581
+ emptyParam = [];
1582
+ }
1583
+ });
1584
+
1585
+ // node_modules/hono/dist/router/reg-exp-router/node.js
1586
+ function compareKey(a, b) {
1587
+ if (a.length === 1) {
1588
+ return b.length === 1 ? a < b ? -1 : 1 : -1;
1589
+ }
1590
+ if (b.length === 1) {
1591
+ return 1;
1592
+ }
1593
+ if (a === ONLY_WILDCARD_REG_EXP_STR || a === TAIL_WILDCARD_REG_EXP_STR) {
1594
+ return 1;
1595
+ } else if (b === ONLY_WILDCARD_REG_EXP_STR || b === TAIL_WILDCARD_REG_EXP_STR) {
1596
+ return -1;
1597
+ }
1598
+ if (a === LABEL_REG_EXP_STR) {
1599
+ return 1;
1600
+ } else if (b === LABEL_REG_EXP_STR) {
1601
+ return -1;
1602
+ }
1603
+ return a.length === b.length ? a < b ? -1 : 1 : b.length - a.length;
1604
+ }
1605
+ var LABEL_REG_EXP_STR, ONLY_WILDCARD_REG_EXP_STR, TAIL_WILDCARD_REG_EXP_STR, PATH_ERROR, regExpMetaChars, Node;
1606
+ var init_node = __esm({
1607
+ "node_modules/hono/dist/router/reg-exp-router/node.js"() {
1608
+ "use strict";
1609
+ LABEL_REG_EXP_STR = "[^/]+";
1610
+ ONLY_WILDCARD_REG_EXP_STR = ".*";
1611
+ TAIL_WILDCARD_REG_EXP_STR = "(?:|/.*)";
1612
+ PATH_ERROR = /* @__PURE__ */ Symbol();
1613
+ regExpMetaChars = new Set(".\\+*[^]$()");
1614
+ Node = class _Node {
1615
+ #index;
1616
+ #varIndex;
1617
+ #children = /* @__PURE__ */ Object.create(null);
1618
+ insert(tokens, index, paramMap, context, pathErrorCheckOnly) {
1619
+ if (tokens.length === 0) {
1620
+ if (this.#index !== void 0) {
1621
+ throw PATH_ERROR;
1622
+ }
1623
+ if (pathErrorCheckOnly) {
1624
+ return;
1625
+ }
1626
+ this.#index = index;
1627
+ return;
1628
+ }
1629
+ const [token, ...restTokens] = tokens;
1630
+ const pattern = token === "*" ? restTokens.length === 0 ? ["", "", ONLY_WILDCARD_REG_EXP_STR] : ["", "", LABEL_REG_EXP_STR] : token === "/*" ? ["", "", TAIL_WILDCARD_REG_EXP_STR] : token.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/);
1631
+ let node;
1632
+ if (pattern) {
1633
+ const name = pattern[1];
1634
+ let regexpStr = pattern[2] || LABEL_REG_EXP_STR;
1635
+ if (name && pattern[2]) {
1636
+ if (regexpStr === ".*") {
1637
+ throw PATH_ERROR;
1638
+ }
1639
+ regexpStr = regexpStr.replace(/^\((?!\?:)(?=[^)]+\)$)/, "(?:");
1640
+ if (/\((?!\?:)/.test(regexpStr)) {
1641
+ throw PATH_ERROR;
1642
+ }
1643
+ }
1644
+ node = this.#children[regexpStr];
1645
+ if (!node) {
1646
+ if (Object.keys(this.#children).some(
1647
+ (k) => k !== ONLY_WILDCARD_REG_EXP_STR && k !== TAIL_WILDCARD_REG_EXP_STR
1648
+ )) {
1649
+ throw PATH_ERROR;
1650
+ }
1651
+ if (pathErrorCheckOnly) {
1652
+ return;
1653
+ }
1654
+ node = this.#children[regexpStr] = new _Node();
1655
+ if (name !== "") {
1656
+ node.#varIndex = context.varIndex++;
1657
+ }
1658
+ }
1659
+ if (!pathErrorCheckOnly && name !== "") {
1660
+ paramMap.push([name, node.#varIndex]);
1661
+ }
1662
+ } else {
1663
+ node = this.#children[token];
1664
+ if (!node) {
1665
+ if (Object.keys(this.#children).some(
1666
+ (k) => k.length > 1 && k !== ONLY_WILDCARD_REG_EXP_STR && k !== TAIL_WILDCARD_REG_EXP_STR
1667
+ )) {
1668
+ throw PATH_ERROR;
1669
+ }
1670
+ if (pathErrorCheckOnly) {
1671
+ return;
1672
+ }
1673
+ node = this.#children[token] = new _Node();
1674
+ }
1675
+ }
1676
+ node.insert(restTokens, index, paramMap, context, pathErrorCheckOnly);
1677
+ }
1678
+ buildRegExpStr() {
1679
+ const childKeys = Object.keys(this.#children).sort(compareKey);
1680
+ const strList = childKeys.map((k) => {
1681
+ const c = this.#children[k];
1682
+ return (typeof c.#varIndex === "number" ? `(${k})@${c.#varIndex}` : regExpMetaChars.has(k) ? `\\${k}` : k) + c.buildRegExpStr();
1683
+ });
1684
+ if (typeof this.#index === "number") {
1685
+ strList.unshift(`#${this.#index}`);
1686
+ }
1687
+ if (strList.length === 0) {
1688
+ return "";
1689
+ }
1690
+ if (strList.length === 1) {
1691
+ return strList[0];
1692
+ }
1693
+ return "(?:" + strList.join("|") + ")";
1694
+ }
1695
+ };
1696
+ }
1697
+ });
1698
+
1699
+ // node_modules/hono/dist/router/reg-exp-router/trie.js
1700
+ var Trie;
1701
+ var init_trie = __esm({
1702
+ "node_modules/hono/dist/router/reg-exp-router/trie.js"() {
1703
+ "use strict";
1704
+ init_node();
1705
+ Trie = class {
1706
+ #context = { varIndex: 0 };
1707
+ #root = new Node();
1708
+ insert(path, index, pathErrorCheckOnly) {
1709
+ const paramAssoc = [];
1710
+ const groups = [];
1711
+ for (let i = 0; ; ) {
1712
+ let replaced = false;
1713
+ path = path.replace(/\{[^}]+\}/g, (m) => {
1714
+ const mark = `@\\${i}`;
1715
+ groups[i] = [mark, m];
1716
+ i++;
1717
+ replaced = true;
1718
+ return mark;
1719
+ });
1720
+ if (!replaced) {
1721
+ break;
1722
+ }
1723
+ }
1724
+ const tokens = path.match(/(?::[^\/]+)|(?:\/\*$)|./g) || [];
1725
+ for (let i = groups.length - 1; i >= 0; i--) {
1726
+ const [mark] = groups[i];
1727
+ for (let j = tokens.length - 1; j >= 0; j--) {
1728
+ if (tokens[j].indexOf(mark) !== -1) {
1729
+ tokens[j] = tokens[j].replace(mark, groups[i][1]);
1730
+ break;
1731
+ }
1732
+ }
1733
+ }
1734
+ this.#root.insert(tokens, index, paramAssoc, this.#context, pathErrorCheckOnly);
1735
+ return paramAssoc;
1736
+ }
1737
+ buildRegExp() {
1738
+ let regexp = this.#root.buildRegExpStr();
1739
+ if (regexp === "") {
1740
+ return [/^$/, [], []];
1741
+ }
1742
+ let captureIndex = 0;
1743
+ const indexReplacementMap = [];
1744
+ const paramReplacementMap = [];
1745
+ regexp = regexp.replace(/#(\d+)|@(\d+)|\.\*\$/g, (_, handlerIndex, paramIndex) => {
1746
+ if (handlerIndex !== void 0) {
1747
+ indexReplacementMap[++captureIndex] = Number(handlerIndex);
1748
+ return "$()";
1749
+ }
1750
+ if (paramIndex !== void 0) {
1751
+ paramReplacementMap[Number(paramIndex)] = ++captureIndex;
1752
+ return "";
1753
+ }
1754
+ return "";
1755
+ });
1756
+ return [new RegExp(`^${regexp}`), indexReplacementMap, paramReplacementMap];
1757
+ }
1758
+ };
1759
+ }
1760
+ });
1761
+
1762
+ // node_modules/hono/dist/router/reg-exp-router/router.js
1763
+ function buildWildcardRegExp(path) {
1764
+ return wildcardRegExpCache[path] ??= new RegExp(
1765
+ path === "*" ? "" : `^${path.replace(
1766
+ /\/\*$|([.\\+*[^\]$()])/g,
1767
+ (_, metaChar) => metaChar ? `\\${metaChar}` : "(?:|/.*)"
1768
+ )}$`
1769
+ );
1770
+ }
1771
+ function clearWildcardRegExpCache() {
1772
+ wildcardRegExpCache = /* @__PURE__ */ Object.create(null);
1773
+ }
1774
+ function buildMatcherFromPreprocessedRoutes(routes) {
1775
+ const trie = new Trie();
1776
+ const handlerData = [];
1777
+ if (routes.length === 0) {
1778
+ return nullMatcher;
1779
+ }
1780
+ const routesWithStaticPathFlag = routes.map(
1781
+ (route) => [!/\*|\/:/.test(route[0]), ...route]
1782
+ ).sort(
1783
+ ([isStaticA, pathA], [isStaticB, pathB]) => isStaticA ? 1 : isStaticB ? -1 : pathA.length - pathB.length
1784
+ );
1785
+ const staticMap = /* @__PURE__ */ Object.create(null);
1786
+ for (let i = 0, j = -1, len = routesWithStaticPathFlag.length; i < len; i++) {
1787
+ const [pathErrorCheckOnly, path, handlers] = routesWithStaticPathFlag[i];
1788
+ if (pathErrorCheckOnly) {
1789
+ staticMap[path] = [handlers.map(([h]) => [h, /* @__PURE__ */ Object.create(null)]), emptyParam];
1790
+ } else {
1791
+ j++;
1792
+ }
1793
+ let paramAssoc;
1794
+ try {
1795
+ paramAssoc = trie.insert(path, j, pathErrorCheckOnly);
1796
+ } catch (e) {
1797
+ throw e === PATH_ERROR ? new UnsupportedPathError(path) : e;
1798
+ }
1799
+ if (pathErrorCheckOnly) {
1800
+ continue;
1801
+ }
1802
+ handlerData[j] = handlers.map(([h, paramCount]) => {
1803
+ const paramIndexMap = /* @__PURE__ */ Object.create(null);
1804
+ paramCount -= 1;
1805
+ for (; paramCount >= 0; paramCount--) {
1806
+ const [key, value] = paramAssoc[paramCount];
1807
+ paramIndexMap[key] = value;
1808
+ }
1809
+ return [h, paramIndexMap];
1810
+ });
1811
+ }
1812
+ const [regexp, indexReplacementMap, paramReplacementMap] = trie.buildRegExp();
1813
+ for (let i = 0, len = handlerData.length; i < len; i++) {
1814
+ for (let j = 0, len2 = handlerData[i].length; j < len2; j++) {
1815
+ const map = handlerData[i][j]?.[1];
1816
+ if (!map) {
1817
+ continue;
1818
+ }
1819
+ const keys = Object.keys(map);
1820
+ for (let k = 0, len3 = keys.length; k < len3; k++) {
1821
+ map[keys[k]] = paramReplacementMap[map[keys[k]]];
1822
+ }
1823
+ }
1824
+ }
1825
+ const handlerMap = [];
1826
+ for (const i in indexReplacementMap) {
1827
+ handlerMap[i] = handlerData[indexReplacementMap[i]];
1828
+ }
1829
+ return [regexp, handlerMap, staticMap];
1830
+ }
1831
+ function findMiddleware(middleware, path) {
1832
+ if (!middleware) {
1833
+ return void 0;
1834
+ }
1835
+ for (const k of Object.keys(middleware).sort((a, b) => b.length - a.length)) {
1836
+ if (buildWildcardRegExp(k).test(path)) {
1837
+ return [...middleware[k]];
1838
+ }
1839
+ }
1840
+ return void 0;
1841
+ }
1842
+ var nullMatcher, wildcardRegExpCache, RegExpRouter;
1843
+ var init_router2 = __esm({
1844
+ "node_modules/hono/dist/router/reg-exp-router/router.js"() {
1845
+ "use strict";
1846
+ init_router();
1847
+ init_url();
1848
+ init_matcher();
1849
+ init_node();
1850
+ init_trie();
1851
+ nullMatcher = [/^$/, [], /* @__PURE__ */ Object.create(null)];
1852
+ wildcardRegExpCache = /* @__PURE__ */ Object.create(null);
1853
+ RegExpRouter = class {
1854
+ name = "RegExpRouter";
1855
+ #middleware;
1856
+ #routes;
1857
+ constructor() {
1858
+ this.#middleware = { [METHOD_NAME_ALL]: /* @__PURE__ */ Object.create(null) };
1859
+ this.#routes = { [METHOD_NAME_ALL]: /* @__PURE__ */ Object.create(null) };
1860
+ }
1861
+ add(method, path, handler) {
1862
+ const middleware = this.#middleware;
1863
+ const routes = this.#routes;
1864
+ if (!middleware || !routes) {
1865
+ throw new Error(MESSAGE_MATCHER_IS_ALREADY_BUILT);
1866
+ }
1867
+ if (!middleware[method]) {
1868
+ ;
1869
+ [middleware, routes].forEach((handlerMap) => {
1870
+ handlerMap[method] = /* @__PURE__ */ Object.create(null);
1871
+ Object.keys(handlerMap[METHOD_NAME_ALL]).forEach((p) => {
1872
+ handlerMap[method][p] = [...handlerMap[METHOD_NAME_ALL][p]];
1873
+ });
1874
+ });
1875
+ }
1876
+ if (path === "/*") {
1877
+ path = "*";
1878
+ }
1879
+ const paramCount = (path.match(/\/:/g) || []).length;
1880
+ if (/\*$/.test(path)) {
1881
+ const re = buildWildcardRegExp(path);
1882
+ if (method === METHOD_NAME_ALL) {
1883
+ Object.keys(middleware).forEach((m) => {
1884
+ middleware[m][path] ||= findMiddleware(middleware[m], path) || findMiddleware(middleware[METHOD_NAME_ALL], path) || [];
1885
+ });
1886
+ } else {
1887
+ middleware[method][path] ||= findMiddleware(middleware[method], path) || findMiddleware(middleware[METHOD_NAME_ALL], path) || [];
1888
+ }
1889
+ Object.keys(middleware).forEach((m) => {
1890
+ if (method === METHOD_NAME_ALL || method === m) {
1891
+ Object.keys(middleware[m]).forEach((p) => {
1892
+ re.test(p) && middleware[m][p].push([handler, paramCount]);
1893
+ });
1894
+ }
1895
+ });
1896
+ Object.keys(routes).forEach((m) => {
1897
+ if (method === METHOD_NAME_ALL || method === m) {
1898
+ Object.keys(routes[m]).forEach(
1899
+ (p) => re.test(p) && routes[m][p].push([handler, paramCount])
1900
+ );
1901
+ }
1902
+ });
1903
+ return;
1904
+ }
1905
+ const paths = checkOptionalParameter(path) || [path];
1906
+ for (let i = 0, len = paths.length; i < len; i++) {
1907
+ const path2 = paths[i];
1908
+ Object.keys(routes).forEach((m) => {
1909
+ if (method === METHOD_NAME_ALL || method === m) {
1910
+ routes[m][path2] ||= [
1911
+ ...findMiddleware(middleware[m], path2) || findMiddleware(middleware[METHOD_NAME_ALL], path2) || []
1912
+ ];
1913
+ routes[m][path2].push([handler, paramCount - len + i + 1]);
1914
+ }
1915
+ });
1916
+ }
1917
+ }
1918
+ match = match;
1919
+ buildAllMatchers() {
1920
+ const matchers = /* @__PURE__ */ Object.create(null);
1921
+ Object.keys(this.#routes).concat(Object.keys(this.#middleware)).forEach((method) => {
1922
+ matchers[method] ||= this.#buildMatcher(method);
1923
+ });
1924
+ this.#middleware = this.#routes = void 0;
1925
+ clearWildcardRegExpCache();
1926
+ return matchers;
1927
+ }
1928
+ #buildMatcher(method) {
1929
+ const routes = [];
1930
+ let hasOwnRoute = method === METHOD_NAME_ALL;
1931
+ [this.#middleware, this.#routes].forEach((r) => {
1932
+ const ownRoute = r[method] ? Object.keys(r[method]).map((path) => [path, r[method][path]]) : [];
1933
+ if (ownRoute.length !== 0) {
1934
+ hasOwnRoute ||= true;
1935
+ routes.push(...ownRoute);
1936
+ } else if (method !== METHOD_NAME_ALL) {
1937
+ routes.push(
1938
+ ...Object.keys(r[METHOD_NAME_ALL]).map((path) => [path, r[METHOD_NAME_ALL][path]])
1939
+ );
1940
+ }
1941
+ });
1942
+ if (!hasOwnRoute) {
1943
+ return null;
1944
+ } else {
1945
+ return buildMatcherFromPreprocessedRoutes(routes);
1946
+ }
1947
+ }
1948
+ };
1949
+ }
1950
+ });
1951
+
1952
+ // node_modules/hono/dist/router/reg-exp-router/prepared-router.js
1953
+ var init_prepared_router = __esm({
1954
+ "node_modules/hono/dist/router/reg-exp-router/prepared-router.js"() {
1955
+ "use strict";
1956
+ init_router();
1957
+ init_matcher();
1958
+ init_router2();
1959
+ }
1960
+ });
1961
+
1962
+ // node_modules/hono/dist/router/reg-exp-router/index.js
1963
+ var init_reg_exp_router = __esm({
1964
+ "node_modules/hono/dist/router/reg-exp-router/index.js"() {
1965
+ "use strict";
1966
+ init_router2();
1967
+ init_prepared_router();
1968
+ }
1969
+ });
1970
+
1971
+ // node_modules/hono/dist/router/smart-router/router.js
1972
+ var SmartRouter;
1973
+ var init_router3 = __esm({
1974
+ "node_modules/hono/dist/router/smart-router/router.js"() {
1975
+ "use strict";
1976
+ init_router();
1977
+ SmartRouter = class {
1978
+ name = "SmartRouter";
1979
+ #routers = [];
1980
+ #routes = [];
1981
+ constructor(init) {
1982
+ this.#routers = init.routers;
1983
+ }
1984
+ add(method, path, handler) {
1985
+ if (!this.#routes) {
1986
+ throw new Error(MESSAGE_MATCHER_IS_ALREADY_BUILT);
1987
+ }
1988
+ this.#routes.push([method, path, handler]);
1989
+ }
1990
+ match(method, path) {
1991
+ if (!this.#routes) {
1992
+ throw new Error("Fatal error");
1993
+ }
1994
+ const routers = this.#routers;
1995
+ const routes = this.#routes;
1996
+ const len = routers.length;
1997
+ let i = 0;
1998
+ let res;
1999
+ for (; i < len; i++) {
2000
+ const router = routers[i];
2001
+ try {
2002
+ for (let i2 = 0, len2 = routes.length; i2 < len2; i2++) {
2003
+ router.add(...routes[i2]);
2004
+ }
2005
+ res = router.match(method, path);
2006
+ } catch (e) {
2007
+ if (e instanceof UnsupportedPathError) {
2008
+ continue;
2009
+ }
2010
+ throw e;
2011
+ }
2012
+ this.match = router.match.bind(router);
2013
+ this.#routers = [router];
2014
+ this.#routes = void 0;
2015
+ break;
2016
+ }
2017
+ if (i === len) {
2018
+ throw new Error("Fatal error");
2019
+ }
2020
+ this.name = `SmartRouter + ${this.activeRouter.name}`;
2021
+ return res;
2022
+ }
2023
+ get activeRouter() {
2024
+ if (this.#routes || this.#routers.length !== 1) {
2025
+ throw new Error("No active router has been determined yet.");
2026
+ }
2027
+ return this.#routers[0];
2028
+ }
2029
+ };
2030
+ }
2031
+ });
2032
+
2033
+ // node_modules/hono/dist/router/smart-router/index.js
2034
+ var init_smart_router = __esm({
2035
+ "node_modules/hono/dist/router/smart-router/index.js"() {
2036
+ "use strict";
2037
+ init_router3();
2038
+ }
2039
+ });
2040
+
2041
+ // node_modules/hono/dist/router/trie-router/node.js
2042
+ var emptyParams, hasChildren, Node2;
2043
+ var init_node2 = __esm({
2044
+ "node_modules/hono/dist/router/trie-router/node.js"() {
2045
+ "use strict";
2046
+ init_router();
2047
+ init_url();
2048
+ emptyParams = /* @__PURE__ */ Object.create(null);
2049
+ hasChildren = (children) => {
2050
+ for (const _ in children) {
2051
+ return true;
2052
+ }
2053
+ return false;
2054
+ };
2055
+ Node2 = class _Node2 {
2056
+ #methods;
2057
+ #children;
2058
+ #patterns;
2059
+ #order = 0;
2060
+ #params = emptyParams;
2061
+ constructor(method, handler, children) {
2062
+ this.#children = children || /* @__PURE__ */ Object.create(null);
2063
+ this.#methods = [];
2064
+ if (method && handler) {
2065
+ const m = /* @__PURE__ */ Object.create(null);
2066
+ m[method] = { handler, possibleKeys: [], score: 0 };
2067
+ this.#methods = [m];
2068
+ }
2069
+ this.#patterns = [];
2070
+ }
2071
+ insert(method, path, handler) {
2072
+ this.#order = ++this.#order;
2073
+ let curNode = this;
2074
+ const parts = splitRoutingPath(path);
2075
+ const possibleKeys = [];
2076
+ for (let i = 0, len = parts.length; i < len; i++) {
2077
+ const p = parts[i];
2078
+ const nextP = parts[i + 1];
2079
+ const pattern = getPattern(p, nextP);
2080
+ const key = Array.isArray(pattern) ? pattern[0] : p;
2081
+ if (key in curNode.#children) {
2082
+ curNode = curNode.#children[key];
2083
+ if (pattern) {
2084
+ possibleKeys.push(pattern[1]);
2085
+ }
2086
+ continue;
2087
+ }
2088
+ curNode.#children[key] = new _Node2();
2089
+ if (pattern) {
2090
+ curNode.#patterns.push(pattern);
2091
+ possibleKeys.push(pattern[1]);
2092
+ }
2093
+ curNode = curNode.#children[key];
2094
+ }
2095
+ curNode.#methods.push({
2096
+ [method]: {
2097
+ handler,
2098
+ possibleKeys: possibleKeys.filter((v, i, a) => a.indexOf(v) === i),
2099
+ score: this.#order
2100
+ }
2101
+ });
2102
+ return curNode;
2103
+ }
2104
+ #pushHandlerSets(handlerSets, node, method, nodeParams, params) {
2105
+ for (let i = 0, len = node.#methods.length; i < len; i++) {
2106
+ const m = node.#methods[i];
2107
+ const handlerSet = m[method] || m[METHOD_NAME_ALL];
2108
+ const processedSet = {};
2109
+ if (handlerSet !== void 0) {
2110
+ handlerSet.params = /* @__PURE__ */ Object.create(null);
2111
+ handlerSets.push(handlerSet);
2112
+ if (nodeParams !== emptyParams || params && params !== emptyParams) {
2113
+ for (let i2 = 0, len2 = handlerSet.possibleKeys.length; i2 < len2; i2++) {
2114
+ const key = handlerSet.possibleKeys[i2];
2115
+ const processed = processedSet[handlerSet.score];
2116
+ handlerSet.params[key] = params?.[key] && !processed ? params[key] : nodeParams[key] ?? params?.[key];
2117
+ processedSet[handlerSet.score] = true;
2118
+ }
2119
+ }
2120
+ }
2121
+ }
2122
+ }
2123
+ search(method, path) {
2124
+ const handlerSets = [];
2125
+ this.#params = emptyParams;
2126
+ const curNode = this;
2127
+ let curNodes = [curNode];
2128
+ const parts = splitPath(path);
2129
+ const curNodesQueue = [];
2130
+ const len = parts.length;
2131
+ let partOffsets = null;
2132
+ for (let i = 0; i < len; i++) {
2133
+ const part = parts[i];
2134
+ const isLast = i === len - 1;
2135
+ const tempNodes = [];
2136
+ for (let j = 0, len2 = curNodes.length; j < len2; j++) {
2137
+ const node = curNodes[j];
2138
+ const nextNode = node.#children[part];
2139
+ if (nextNode) {
2140
+ nextNode.#params = node.#params;
2141
+ if (isLast) {
2142
+ if (nextNode.#children["*"]) {
2143
+ this.#pushHandlerSets(handlerSets, nextNode.#children["*"], method, node.#params);
2144
+ }
2145
+ this.#pushHandlerSets(handlerSets, nextNode, method, node.#params);
2146
+ } else {
2147
+ tempNodes.push(nextNode);
2148
+ }
2149
+ }
2150
+ for (let k = 0, len3 = node.#patterns.length; k < len3; k++) {
2151
+ const pattern = node.#patterns[k];
2152
+ const params = node.#params === emptyParams ? {} : { ...node.#params };
2153
+ if (pattern === "*") {
2154
+ const astNode = node.#children["*"];
2155
+ if (astNode) {
2156
+ this.#pushHandlerSets(handlerSets, astNode, method, node.#params);
2157
+ astNode.#params = params;
2158
+ tempNodes.push(astNode);
2159
+ }
2160
+ continue;
2161
+ }
2162
+ const [key, name, matcher] = pattern;
2163
+ if (!part && !(matcher instanceof RegExp)) {
2164
+ continue;
2165
+ }
2166
+ const child = node.#children[key];
2167
+ if (matcher instanceof RegExp) {
2168
+ if (partOffsets === null) {
2169
+ partOffsets = new Array(len);
2170
+ let offset = path[0] === "/" ? 1 : 0;
2171
+ for (let p = 0; p < len; p++) {
2172
+ partOffsets[p] = offset;
2173
+ offset += parts[p].length + 1;
2174
+ }
2175
+ }
2176
+ const restPathString = path.substring(partOffsets[i]);
2177
+ const m = matcher.exec(restPathString);
2178
+ if (m) {
2179
+ params[name] = m[0];
2180
+ this.#pushHandlerSets(handlerSets, child, method, node.#params, params);
2181
+ if (hasChildren(child.#children)) {
2182
+ child.#params = params;
2183
+ const componentCount = m[0].match(/\//)?.length ?? 0;
2184
+ const targetCurNodes = curNodesQueue[componentCount] ||= [];
2185
+ targetCurNodes.push(child);
2186
+ }
2187
+ continue;
2188
+ }
2189
+ }
2190
+ if (matcher === true || matcher.test(part)) {
2191
+ params[name] = part;
2192
+ if (isLast) {
2193
+ this.#pushHandlerSets(handlerSets, child, method, params, node.#params);
2194
+ if (child.#children["*"]) {
2195
+ this.#pushHandlerSets(
2196
+ handlerSets,
2197
+ child.#children["*"],
2198
+ method,
2199
+ params,
2200
+ node.#params
2201
+ );
2202
+ }
2203
+ } else {
2204
+ child.#params = params;
2205
+ tempNodes.push(child);
2206
+ }
2207
+ }
2208
+ }
2209
+ }
2210
+ const shifted = curNodesQueue.shift();
2211
+ curNodes = shifted ? tempNodes.concat(shifted) : tempNodes;
2212
+ }
2213
+ if (handlerSets.length > 1) {
2214
+ handlerSets.sort((a, b) => {
2215
+ return a.score - b.score;
2216
+ });
2217
+ }
2218
+ return [handlerSets.map(({ handler, params }) => [handler, params])];
2219
+ }
2220
+ };
2221
+ }
2222
+ });
2223
+
2224
+ // node_modules/hono/dist/router/trie-router/router.js
2225
+ var TrieRouter;
2226
+ var init_router4 = __esm({
2227
+ "node_modules/hono/dist/router/trie-router/router.js"() {
2228
+ "use strict";
2229
+ init_url();
2230
+ init_node2();
2231
+ TrieRouter = class {
2232
+ name = "TrieRouter";
2233
+ #node;
2234
+ constructor() {
2235
+ this.#node = new Node2();
2236
+ }
2237
+ add(method, path, handler) {
2238
+ const results = checkOptionalParameter(path);
2239
+ if (results) {
2240
+ for (let i = 0, len = results.length; i < len; i++) {
2241
+ this.#node.insert(method, results[i], handler);
2242
+ }
2243
+ return;
2244
+ }
2245
+ this.#node.insert(method, path, handler);
2246
+ }
2247
+ match(method, path) {
2248
+ return this.#node.search(method, path);
2249
+ }
2250
+ };
2251
+ }
2252
+ });
2253
+
2254
+ // node_modules/hono/dist/router/trie-router/index.js
2255
+ var init_trie_router = __esm({
2256
+ "node_modules/hono/dist/router/trie-router/index.js"() {
2257
+ "use strict";
2258
+ init_router4();
2259
+ }
2260
+ });
2261
+
2262
+ // node_modules/hono/dist/hono.js
2263
+ var Hono2;
2264
+ var init_hono = __esm({
2265
+ "node_modules/hono/dist/hono.js"() {
2266
+ "use strict";
2267
+ init_hono_base();
2268
+ init_reg_exp_router();
2269
+ init_smart_router();
2270
+ init_trie_router();
2271
+ Hono2 = class extends Hono {
2272
+ /**
2273
+ * Creates an instance of the Hono class.
2274
+ *
2275
+ * @param options - Optional configuration options for the Hono instance.
2276
+ */
2277
+ constructor(options = {}) {
2278
+ super(options);
2279
+ this.router = options.router ?? new SmartRouter({
2280
+ routers: [new RegExpRouter(), new TrieRouter()]
2281
+ });
2282
+ }
2283
+ };
2284
+ }
2285
+ });
2286
+
2287
+ // node_modules/hono/dist/index.js
2288
+ var init_dist = __esm({
2289
+ "node_modules/hono/dist/index.js"() {
2290
+ "use strict";
2291
+ init_hono();
2292
+ }
2293
+ });
2294
+
2295
+ // ../lib/require-port-env/src/index.ts
2296
+ function requirePortEnv(envName, options = {}) {
2297
+ const tag = options.tag ?? "port-env";
2298
+ const failLine = options.failLine ?? "missing-port-env";
2299
+ const raw2 = process.env[envName];
2300
+ if (raw2 === void 0 || raw2 === "") {
2301
+ const msg = `[${tag}] ${failLine} reason=missing-env env=${envName}`;
2302
+ throw new MissingPortEnvError(envName, tag, failLine, msg);
2303
+ }
2304
+ const parsed = Number.parseInt(raw2, 10);
2305
+ if (!Number.isInteger(parsed) || parsed < VALID_PORT_MIN || parsed > VALID_PORT_MAX || String(parsed) !== raw2.trim()) {
2306
+ const msg = `[${tag}] ${failLine} reason=invalid-port-env env=${envName} value=${JSON.stringify(raw2)}`;
2307
+ throw new MissingPortEnvError(envName, tag, failLine, msg);
2308
+ }
2309
+ return parsed;
2310
+ }
2311
+ var MissingPortEnvError, VALID_PORT_MIN, VALID_PORT_MAX;
2312
+ var init_src = __esm({
2313
+ "../lib/require-port-env/src/index.ts"() {
2314
+ "use strict";
2315
+ MissingPortEnvError = class extends Error {
2316
+ envName;
2317
+ tag;
2318
+ failLine;
2319
+ constructor(envName, tag, failLine, message) {
2320
+ super(message);
2321
+ this.name = "MissingPortEnvError";
2322
+ this.envName = envName;
2323
+ this.tag = tag;
2324
+ this.failLine = failLine;
2325
+ }
2326
+ };
2327
+ VALID_PORT_MIN = 1;
2328
+ VALID_PORT_MAX = 65535;
2329
+ }
2330
+ });
2331
+
2332
+ // app/lib/claude-agent/session-store.ts
2333
+ import { createHash } from "crypto";
2334
+ function fingerprintSessionKey(raw2) {
2335
+ if (typeof raw2 !== "string" || !raw2) return raw2;
2336
+ if (/^sk_[a-f0-9]{16}$/.test(raw2)) return raw2;
2337
+ if (!raw2.startsWith("v1.")) return raw2;
2338
+ return `sk_${createHash("sha256").update(raw2).digest("hex").slice(0, 16)}`;
2339
+ }
2340
+ function registerSession(cacheKey2, agentType, accountId, _unused, userId, userName, role) {
2341
+ const existing = sessionStore.get(cacheKey2);
2342
+ if (existing) {
2343
+ existing.agentType = agentType;
2344
+ existing.accountId = accountId;
2345
+ existing.userId = userId ?? existing.userId;
2346
+ existing.userName = userName ?? existing.userName;
2347
+ existing.role = role ?? existing.role;
2348
+ return;
2349
+ }
2350
+ sessionStore.set(cacheKey2, { agentType, createdAt: Date.now(), accountId, userId, userName, role });
2351
+ }
2352
+ function validateSession(cacheKey2, agentType, _signedSessionToken) {
2353
+ const session = sessionStore.get(cacheKey2);
2354
+ if (!session) return { ok: false, reason: "session-not-registered" };
2355
+ if (session.agentType !== agentType) return { ok: false, reason: "agent-type-mismatch" };
2356
+ if (Date.now() - session.createdAt > SESSION_TTL_MS) {
2357
+ sessionStore.delete(cacheKey2);
2358
+ return { ok: false, reason: "session-expired-age" };
2359
+ }
2360
+ return { ok: true };
2361
+ }
2362
+ function getAccountIdForSession(cacheKey2) {
2363
+ return sessionStore.get(cacheKey2)?.accountId;
2364
+ }
2365
+ function getUserIdForSession(cacheKey2) {
2366
+ return sessionStore.get(cacheKey2)?.userId;
2367
+ }
2368
+ function getUserNameForSession(cacheKey2) {
2369
+ return sessionStore.get(cacheKey2)?.userName;
2370
+ }
2371
+ function getRoleForSession(cacheKey2) {
2372
+ return sessionStore.get(cacheKey2)?.role;
2373
+ }
2374
+ function getSessionIdForSession(cacheKey2) {
2375
+ return sessionStore.get(cacheKey2)?.sessionId;
2376
+ }
2377
+ function setSessionIdForSession(cacheKey2, sessionId) {
2378
+ const session = sessionStore.get(cacheKey2);
2379
+ if (!session) return false;
2380
+ session.sessionId = sessionId;
2381
+ return true;
2382
+ }
2383
+ function setWantsPriorConversation(cacheKey2) {
2384
+ const session = sessionStore.get(cacheKey2);
2385
+ if (session) session.wantsPriorConversation = true;
2386
+ }
2387
+ function unregisterSession(cacheKey2) {
2388
+ return sessionStore.delete(cacheKey2);
2389
+ }
2390
+ function getSessionKeyBySessionId(_sessionId) {
2391
+ return void 0;
2392
+ }
2393
+ var SESSION_TTL_MS, sessionStore;
2394
+ var init_session_store = __esm({
2395
+ "app/lib/claude-agent/session-store.ts"() {
2396
+ "use strict";
2397
+ SESSION_TTL_MS = 24 * 60 * 60 * 1e3;
2398
+ sessionStore = /* @__PURE__ */ new Map();
2399
+ }
2400
+ });
2401
+
2402
+ // ../lib/admin-access-password/src/index.ts
2403
+ import { scrypt, randomBytes, timingSafeEqual } from "crypto";
2404
+ import { existsSync, readFileSync, writeFileSync, renameSync, unlinkSync, appendFileSync as appendFileSync2, mkdirSync as mkdirSync2 } from "fs";
2405
+ import { dirname } from "path";
2406
+ function id8(value) {
2407
+ return value.slice(0, 8);
2408
+ }
2409
+ function rowIds(users) {
2410
+ return users.map((u) => id8(u.userId)).join(",");
2411
+ }
2412
+ function appendUsersAuditLine(audit, fields) {
2413
+ const sess = audit.session ? ` session=${id8(audit.session)}` : "";
2414
+ const actor = audit.actor.includes("-") ? id8(audit.actor) : audit.actor;
2415
+ const targetFields = audit.target !== void 0 ? ` target=${audit.target.includes("-") ? id8(audit.target) : audit.target} explicitUserId=${audit.explicitUserId ? "true" : "false"}` : "";
2416
+ const line = `[users-audit] action=${fields.action} actor=${actor}${targetFields}${sess} field=${fields.field} rowsBefore=${fields.rowsBefore} rowsAfter=${fields.rowsAfter} ts=${(/* @__PURE__ */ new Date()).toISOString()}
2417
+ `;
2418
+ try {
2419
+ mkdirSync2(dirname(audit.logFile), { recursive: true, mode: 448 });
2420
+ appendFileSync2(audit.logFile, line, { mode: 384 });
2421
+ } catch (err) {
2422
+ console.error(
2423
+ `[users-audit] op=write-failed logFile=${audit.logFile} error=${err instanceof Error ? err.message : String(err)}`
2424
+ );
2425
+ }
2426
+ }
2427
+ function scryptAsync(password, salt) {
2428
+ return new Promise((resolve4, reject) => {
2429
+ scrypt(password, salt, SCRYPT_KEYLEN, { N: SCRYPT_N, r: SCRYPT_R, p: SCRYPT_P }, (err, key) => {
2430
+ if (err) reject(err);
2431
+ else resolve4(key);
2432
+ });
2433
+ });
2434
+ }
2435
+ async function hashAccessPassword(password) {
2436
+ const salt = randomBytes(32);
2437
+ const hash = await scryptAsync(password, salt);
2438
+ return `${salt.toString("hex")}:${hash.toString("hex")}`;
2439
+ }
2440
+ async function matchesHash(password, stored) {
2441
+ const colon = stored.indexOf(":");
2442
+ if (colon === -1) return false;
2443
+ const salt = Buffer.from(stored.slice(0, colon), "hex");
2444
+ const storedHash = Buffer.from(stored.slice(colon + 1), "hex");
2445
+ if (storedHash.length !== SCRYPT_KEYLEN) return false;
2446
+ let computed;
2447
+ try {
2448
+ computed = await scryptAsync(password, salt);
2449
+ } catch {
2450
+ return false;
2451
+ }
2452
+ return timingSafeEqual(computed, storedHash);
2453
+ }
2454
+ function readUsers(usersFile) {
2455
+ if (!existsSync(usersFile)) return [];
2456
+ const raw2 = readFileSync(usersFile, "utf-8").trim();
2457
+ if (!raw2) return [];
2458
+ const parsed = JSON.parse(raw2);
2459
+ if (!Array.isArray(parsed)) throw new Error("users.json is not an array");
2460
+ return parsed;
2461
+ }
2462
+ function writeUsersAtomic(usersFile, users) {
2463
+ const tmp = `${usersFile}.tmp-${process.pid}`;
2464
+ writeFileSync(tmp, JSON.stringify(users, null, 2) + "\n", { mode: 384 });
2465
+ renameSync(tmp, usersFile);
2466
+ }
2467
+ async function setAccessPassword(userId, password, usersFile, audit) {
2468
+ const users = readUsers(usersFile);
2469
+ const idx = users.findIndex((u) => u.userId === userId);
2470
+ if (idx === -1) throw new Error(`no users.json record for userId=${userId}`);
2471
+ if (await accessPasswordCollides(password, usersFile, userId)) {
2472
+ throw new Error("accessHash collision: password already in use by another admin");
2473
+ }
2474
+ const rows = rowIds(users);
2475
+ users[idx] = { ...users[idx], accessHash: await hashAccessPassword(password) };
2476
+ writeUsersAtomic(usersFile, users);
2477
+ appendUsersAuditLine(audit, { action: "set-access", field: "accessHash", rowsBefore: rows, rowsAfter: rows });
2478
+ }
2479
+ async function verifyAccessPassword(password, usersFile) {
2480
+ let users;
2481
+ try {
2482
+ users = readUsers(usersFile);
2483
+ } catch {
2484
+ return null;
2485
+ }
2486
+ for (const u of users) {
2487
+ if (typeof u.accessHash === "string" && await matchesHash(password, u.accessHash)) {
2488
+ return u.userId;
2489
+ }
2490
+ }
2491
+ return null;
2492
+ }
2493
+ async function accessPasswordCollides(password, usersFile, excludeUserId) {
2494
+ let users;
2495
+ try {
2496
+ users = readUsers(usersFile);
2497
+ } catch {
2498
+ return false;
2499
+ }
2500
+ for (const u of users) {
2501
+ if (u.userId === excludeUserId) continue;
2502
+ if (typeof u.accessHash === "string" && await matchesHash(password, u.accessHash)) {
2503
+ return true;
2504
+ }
2505
+ }
2506
+ return false;
2507
+ }
2508
+ function anyAccessPasswordConfigured(usersFile) {
2509
+ let users;
2510
+ try {
2511
+ users = readUsers(usersFile);
2512
+ } catch {
2513
+ return false;
2514
+ }
2515
+ return users.some((u) => typeof u.accessHash === "string" && u.accessHash.length > 0);
2516
+ }
2517
+ function accessStoreUnreadable(usersFile) {
2518
+ if (!existsSync(usersFile)) return false;
2519
+ try {
2520
+ readUsers(usersFile);
2521
+ return false;
2522
+ } catch {
2523
+ return true;
2524
+ }
2525
+ }
2526
+ function migrateLegacyRemotePassword(usersFile, legacyFile, ownerUserId, audit) {
2527
+ if (!existsSync(legacyFile)) return "noop-no-legacy";
2528
+ const legacy = readFileSync(legacyFile, "utf-8").trim();
2529
+ const users = readUsers(usersFile);
2530
+ const idx = users.findIndex((u) => u.userId === ownerUserId);
2531
+ if (idx === -1) return "noop-no-owner";
2532
+ const existing = users[idx].accessHash;
2533
+ if (typeof existing === "string" && existing.length > 0) {
2534
+ unlinkSync(legacyFile);
2535
+ return "noop-owner-has-hash";
2536
+ }
2537
+ if (!legacy.includes(":")) {
2538
+ unlinkSync(legacyFile);
2539
+ return "noop-no-legacy";
2540
+ }
2541
+ const rows = rowIds(users);
2542
+ users[idx] = { ...users[idx], accessHash: legacy };
2543
+ writeUsersAtomic(usersFile, users);
2544
+ unlinkSync(legacyFile);
2545
+ appendUsersAuditLine(audit, { action: "migrate", field: "accessHash", rowsBefore: rows, rowsAfter: rows });
2546
+ return "migrated";
2547
+ }
2548
+ function readLegacyRemoteHash(legacyFile) {
2549
+ if (!existsSync(legacyFile)) return null;
2550
+ const raw2 = readFileSync(legacyFile, "utf-8").trim();
2551
+ return raw2.includes(":") ? raw2 : null;
2552
+ }
2553
+ var SCRYPT_N, SCRYPT_R, SCRYPT_P, SCRYPT_KEYLEN;
2554
+ var init_src2 = __esm({
2555
+ "../lib/admin-access-password/src/index.ts"() {
2556
+ "use strict";
2557
+ SCRYPT_N = 16384;
2558
+ SCRYPT_R = 8;
2559
+ SCRYPT_P = 1;
2560
+ SCRYPT_KEYLEN = 64;
2561
+ }
2562
+ });
2563
+
2564
+ // app/lib/password-strength.ts
2565
+ function validatePasswordStrength(password) {
2566
+ return [
2567
+ { key: "length", label: "At least 8 characters", met: password.length >= 8 },
2568
+ { key: "number", label: "Contains a number", met: /\d/.test(password) },
2569
+ { key: "special", label: "Contains a special character", met: /[^A-Za-z0-9]/.test(password) },
2570
+ { key: "whitespace", label: "No spaces", met: password.length > 0 && !/\s/.test(password) }
2571
+ ];
2572
+ }
2573
+ function isPasswordValid(password) {
2574
+ return validatePasswordStrength(password).every((r) => r.met);
2575
+ }
2576
+ var init_password_strength = __esm({
2577
+ "app/lib/password-strength.ts"() {
2578
+ "use strict";
2579
+ }
2580
+ });
2581
+
2582
+ // app/lib/remote-auth.ts
2583
+ import { scrypt as scrypt2, randomBytes as randomBytes2, timingSafeEqual as timingSafeEqual2, createHmac } from "crypto";
2584
+ import { readFileSync as readFileSync2, writeFileSync as writeFileSync2, mkdirSync as mkdirSync3 } from "fs";
2585
+ import { dirname as dirname2 } from "path";
2586
+ function scryptAsync2(password, salt) {
2587
+ return new Promise((resolve4, reject) => {
2588
+ scrypt2(password, salt, SCRYPT_KEYLEN2, { N: SCRYPT_N2, r: SCRYPT_R2, p: SCRYPT_P2 }, (err, key) => {
2589
+ if (err) reject(err);
2590
+ else resolve4(key);
2591
+ });
2592
+ });
2593
+ }
2594
+ async function hashPassword(password) {
2595
+ const salt = randomBytes2(32);
2596
+ const hash = await scryptAsync2(password, salt);
2597
+ return `${salt.toString("hex")}:${hash.toString("hex")}`;
2598
+ }
2599
+ function isRemoteAuthConfigured() {
2600
+ if (anyAccessPasswordConfigured(USERS_FILE)) return true;
2601
+ if (accessStoreUnreadable(USERS_FILE)) return true;
2602
+ return readLegacyRemoteHash(REMOTE_PASSWORD_FILE) !== null;
2603
+ }
2604
+ async function setRemotePassword(password) {
2605
+ const hash = await hashPassword(password);
2606
+ writeFileSync2(REMOTE_PASSWORD_FILE, hash, "utf-8");
2607
+ }
2608
+ async function verifyRemotePassword(password) {
2609
+ const matchedUserId = await verifyAccessPassword(password, USERS_FILE);
2610
+ if (matchedUserId) return { ok: true, hashBytes: SCRYPT_KEYLEN2, userId: matchedUserId };
2611
+ const legacy = readLegacyRemoteHash(REMOTE_PASSWORD_FILE);
2612
+ if (legacy && await matchesHash(password, legacy)) {
2613
+ return { ok: true, hashBytes: SCRYPT_KEYLEN2, userId: null };
2614
+ }
2615
+ const configured = anyAccessPasswordConfigured(USERS_FILE) || legacy !== null;
2616
+ return { ok: false, why: configured ? "password-mismatch" : "no-password-file", hashBytes: 0 };
2617
+ }
2618
+ function getSecret() {
2619
+ if (cachedSecret) return cachedSecret;
2620
+ try {
2621
+ const hex2 = readFileSync2(REMOTE_SESSION_SECRET_FILE, "utf-8").trim();
2622
+ if (hex2.length === SECRET_BYTES * 2) {
2623
+ cachedSecret = Buffer.from(hex2, "hex");
2624
+ return cachedSecret;
2625
+ }
2626
+ } catch {
2627
+ }
2628
+ const fresh = randomBytes2(SECRET_BYTES).toString("hex");
2629
+ try {
2630
+ mkdirSync3(dirname2(REMOTE_SESSION_SECRET_FILE), { recursive: true, mode: 448 });
2631
+ writeFileSync2(REMOTE_SESSION_SECRET_FILE, fresh, { mode: 384, flag: "wx" });
2632
+ } catch {
2633
+ }
2634
+ const hex = readFileSync2(REMOTE_SESSION_SECRET_FILE, "utf-8").trim();
2635
+ cachedSecret = Buffer.from(hex, "hex");
2636
+ return cachedSecret;
2637
+ }
2638
+ function base64urlEncode(buf) {
2639
+ return buf.toString("base64").replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
2640
+ }
2641
+ function base64urlDecode(s) {
2642
+ const padded = s.replace(/-/g, "+").replace(/_/g, "/") + "=".repeat((4 - s.length % 4) % 4);
2643
+ return Buffer.from(padded, "base64");
2644
+ }
2645
+ function signPayload(payloadJson, secret) {
2646
+ return base64urlEncode(createHmac("sha256", secret).update(payloadJson).digest());
2647
+ }
2648
+ function createRemoteSession(opts = {}) {
2649
+ const payload = { c: opts.now ?? Date.now(), n: randomBytes2(NONCE_BYTES).toString("hex") };
2650
+ const payloadJson = JSON.stringify(payload);
2651
+ const payloadB64 = base64urlEncode(Buffer.from(payloadJson, "utf-8"));
2652
+ const sig = signPayload(payloadJson, getSecret());
2653
+ return `${TOKEN_PREFIX}${payloadB64}.${sig}`;
2654
+ }
2655
+ function parseToken(token) {
2656
+ if (!token.startsWith(TOKEN_PREFIX)) return null;
2657
+ const rest = token.slice(TOKEN_PREFIX.length);
2658
+ const dot = rest.indexOf(".");
2659
+ if (dot === -1) return null;
2660
+ const payloadB64 = rest.slice(0, dot);
2661
+ const sigB64 = rest.slice(dot + 1);
2662
+ if (!payloadB64 || !sigB64) return null;
2663
+ let payloadJson;
2664
+ try {
2665
+ payloadJson = base64urlDecode(payloadB64).toString("utf-8");
2666
+ } catch {
2667
+ return null;
2668
+ }
2669
+ const expected = signPayload(payloadJson, getSecret());
2670
+ const expectedBuf = Buffer.from(expected, "utf-8");
2671
+ const provBuf = Buffer.from(sigB64, "utf-8");
2672
+ const signatureValid = expectedBuf.length === provBuf.length && timingSafeEqual2(expectedBuf, provBuf);
2673
+ let payload;
2674
+ try {
2675
+ payload = JSON.parse(payloadJson);
2676
+ } catch {
2677
+ return null;
2678
+ }
2679
+ if (!payload || typeof payload !== "object" || typeof payload.c !== "number" || typeof payload.n !== "string") {
2680
+ return null;
2681
+ }
2682
+ return { payload, signatureValid };
2683
+ }
2684
+ function validateRemoteSession(token, now = Date.now()) {
2685
+ if (!token) return false;
2686
+ const parsed = parseToken(token);
2687
+ if (!parsed || !parsed.signatureValid) return false;
2688
+ return now - parsed.payload.c <= SESSION_TTL_MS2;
2689
+ }
2690
+ function describeRemoteSession(token, now = Date.now()) {
2691
+ if (!token) return { present: false, expired: false };
2692
+ const parsed = parseToken(token);
2693
+ if (!parsed || !parsed.signatureValid) return { present: false, expired: false };
2694
+ return { present: true, expired: now - parsed.payload.c > SESSION_TTL_MS2 };
2695
+ }
2696
+ function normalizeIp(ip) {
2697
+ if (!ip) return void 0;
2698
+ const trimmed = ip.trim();
2699
+ if (trimmed.startsWith("::ffff:")) return trimmed.slice(7);
2700
+ return trimmed;
2701
+ }
2702
+ function isLoopback(ip) {
2703
+ return ip === "127.0.0.1" || ip.startsWith("127.") || ip === "::1";
2704
+ }
2705
+ function isPrivateIp(ip) {
2706
+ const parts = ip.split(".");
2707
+ if (parts.length !== 4) return false;
2708
+ const a = parseInt(parts[0], 10);
2709
+ const b = parseInt(parts[1], 10);
2710
+ if (Number.isNaN(a) || Number.isNaN(b)) return false;
2711
+ if (a === 10) return true;
2712
+ if (a === 172 && b >= 16 && b <= 31) return true;
2713
+ if (a === 192 && b === 168) return true;
2714
+ if (a === 169 && b === 254) return true;
2715
+ return false;
2716
+ }
2717
+ function classifyNormalizedIp(ip) {
2718
+ if (isLoopback(ip) || isPrivateIp(ip)) return "lan";
2719
+ return "external";
2720
+ }
2721
+ function resolveClientIp(remoteAddress, xForwardedFor) {
2722
+ const remote = normalizeIp(remoteAddress);
2723
+ if (!remote) return { ip: "", kind: "unknown" };
2724
+ if (isLoopback(remote) && xForwardedFor) {
2725
+ const firstIp = normalizeIp(xForwardedFor.split(",")[0]?.trim());
2726
+ if (firstIp) {
2727
+ return { ip: firstIp, kind: classifyNormalizedIp(firstIp) };
2728
+ }
2729
+ }
2730
+ return { ip: remote, kind: classifyNormalizedIp(remote) };
2731
+ }
2732
+ function bucketKey(client) {
2733
+ return client.kind === "external" ? client.ip : LOCAL_BUCKET;
2734
+ }
2735
+ function checkRateLimit(client) {
2736
+ const key = bucketKey(client);
2737
+ const rec = rateLimitMap.get(key);
2738
+ if (!rec) return null;
2739
+ if (rec.lockedUntil > Date.now()) {
2740
+ const remaining = Math.ceil((rec.lockedUntil - Date.now()) / 1e3);
2741
+ return `Too many attempts. Try again in ${remaining}s`;
2742
+ }
2743
+ if (rec.lockedUntil > 0) {
2744
+ rateLimitMap.delete(key);
2745
+ }
2746
+ return null;
2747
+ }
2748
+ function recordFailedAttempt(client) {
2749
+ const key = bucketKey(client);
2750
+ const rec = rateLimitMap.get(key) ?? { count: 0, lockedUntil: 0 };
2751
+ rec.count++;
2752
+ if (rec.count >= MAX_ATTEMPTS) {
2753
+ rec.lockedUntil = Date.now() + LOCKOUT_MS;
2754
+ rec.count = 0;
2755
+ }
2756
+ rateLimitMap.set(key, rec);
2757
+ }
2758
+ function clearRateLimit(client) {
2759
+ rateLimitMap.delete(bucketKey(client));
2760
+ }
2761
+ function renderLoginPage(opts) {
2762
+ const error = opts?.error ?? "";
2763
+ const lockout = opts?.lockoutSeconds ?? 0;
2764
+ const redirect = opts?.redirect ?? "/";
2765
+ const mode = opts?.mode ?? "login";
2766
+ const changeError = opts?.changeError ?? "";
2767
+ const success = opts?.success ?? "";
2768
+ const setupError = opts?.setupError ?? "";
2769
+ const primaryColor = opts?.primaryColor ?? "#7C8C72";
2770
+ const primaryHoverColor = opts?.primaryHoverColor ?? "#6A7A62";
2771
+ const primarySubtle = opts?.primarySubtle ?? "rgba(124,140,114,0.08)";
2772
+ const productName = opts?.productName ?? "Maxy";
2773
+ const logoPath = opts?.logoPath ?? "/brand/maxy-monochrome.png";
2774
+ const faviconPath = opts?.faviconPath ?? "/favicon.ico";
2775
+ const displayFont = opts?.displayFont ?? "'Newsreader', Georgia, serif";
2776
+ const bodyFont = opts?.bodyFont ?? "'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif";
2777
+ const logoContainsName = opts?.logoContainsName ?? false;
2778
+ const tagline = opts?.tagline ?? "";
2779
+ const origin = opts?.origin ?? "";
2780
+ const ogCardPath = opts?.ogCardPath ?? "";
2781
+ const manifestPath = opts?.manifestPath ?? "";
2782
+ const appleTouchIconPath = opts?.appleTouchIconPath ?? "";
2783
+ const pwaThemeColor = opts?.themeColor ?? "";
2784
+ const ogBlock = origin && ogCardPath ? [
2785
+ `<meta property="og:title" content="Sign in \u2014 ${escapeHtml(productName)}">`,
2786
+ `<meta property="og:description" content="${escapeHtml(tagline)}">`,
2787
+ `<meta property="og:type" content="website">`,
2788
+ `<meta property="og:url" content="${escapeHtml(origin)}">`,
2789
+ `<meta property="og:image" content="${escapeHtml(origin + ogCardPath)}">`,
2790
+ `<meta property="og:image:width" content="1200">`,
2791
+ `<meta property="og:image:height" content="630">`,
2792
+ `<meta name="twitter:card" content="summary_large_image">`,
2793
+ `<meta name="twitter:title" content="Sign in \u2014 ${escapeHtml(productName)}">`,
2794
+ `<meta name="twitter:description" content="${escapeHtml(tagline)}">`,
2795
+ `<meta name="twitter:image" content="${escapeHtml(origin + ogCardPath)}">`
2796
+ ].join("\n ") : "";
2797
+ const pwaInstallBlock = manifestPath && appleTouchIconPath ? [
2798
+ `<link rel="manifest" href="${escapeHtml(manifestPath)}">`,
2799
+ `<link rel="apple-touch-icon" href="${escapeHtml(appleTouchIconPath)}">`,
2800
+ `<meta name="mobile-web-app-capable" content="yes">`,
2801
+ `<meta name="apple-mobile-web-app-capable" content="yes">`,
2802
+ pwaThemeColor ? `<meta name="theme-color" content="${escapeHtml(pwaThemeColor)}">` : ""
2803
+ ].filter(Boolean).join("\n ") : "";
2804
+ const errorHtml = error ? `<p class="msg msg--error">${escapeHtml(error)}</p>` : "";
2805
+ const changeErrorHtml = changeError ? `<p class="msg msg--error">${escapeHtml(changeError)}</p>` : "";
2806
+ const successHtml = success ? `<p class="msg msg--success">${escapeHtml(success)}</p>` : "";
2807
+ const lockoutHtml = lockout > 0 ? `<p class="msg msg--error">Too many attempts. Try again in <span id="countdown">${lockout}</span>s</p>
2808
+ <script>
2809
+ (function() {
2810
+ var s = ${lockout};
2811
+ var el = document.getElementById('countdown');
2812
+ var iv = setInterval(function() { s--; el.textContent = s; if (s <= 0) { clearInterval(iv); location.reload(); } }, 1000);
2813
+ })();
2814
+ </script>` : "";
2815
+ const setupErrorHtml = setupError ? `<p class="msg msg--error">${escapeHtml(setupError)}</p>` : "";
2816
+ const formDisabled = lockout > 0 ? "disabled" : "";
2817
+ const loginDisplay = mode === "login" ? "block" : "none";
2818
+ const changeDisplay = mode === "change" ? "block" : "none";
2819
+ const setupDisplay = mode === "setup" ? "block" : "none";
2820
+ const successDisplay = mode === "success" ? "block" : "none";
2821
+ const subtitleText = mode === "setup" ? "Set your remote password" : "Remote access";
2822
+ const displayFontName = displayFont.match(/^'([^']+)'/)?.[1] ?? "";
2823
+ const bodyFontName = bodyFont.match(/^'([^']+)'/)?.[1] ?? "";
2824
+ const googleFontsLink = displayFontName || bodyFontName ? [
2825
+ '<link rel="preconnect" href="https://fonts.googleapis.com">',
2826
+ '<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>',
2827
+ '<link href="https://fonts.googleapis.com/css2?' + [
2828
+ displayFontName ? `family=${displayFontName.replace(/ /g, "+")}:wght@300;400` : "",
2829
+ bodyFontName ? `family=${bodyFontName.replace(/ /g, "+")}:wght@400;500` : ""
2830
+ ].filter(Boolean).join("&") + '&display=swap" rel="stylesheet">'
2831
+ ].join("\n ") : "";
2832
+ return `<!DOCTYPE html>
2833
+ <html lang="en">
2834
+ <head>
2835
+ <meta charset="utf-8">
2836
+ <meta name="viewport" content="width=device-width, initial-scale=1">
2837
+ <title>Sign in \u2014 ${escapeHtml(productName)}</title>
2838
+ <link rel="icon" href="${escapeHtml(faviconPath)}">
2839
+ ${pwaInstallBlock}
2840
+ ${ogBlock}
2841
+ ${googleFontsLink}
2842
+ <style>
2843
+ * { margin: 0; padding: 0; box-sizing: border-box; }
2844
+ body {
2845
+ font-family: ${bodyFont};
2846
+ background: #F6F5F2;
2847
+ color: #2A2D38;
2848
+ min-height: 100vh;
2849
+ display: flex;
2850
+ align-items: center;
2851
+ justify-content: center;
2852
+ }
2853
+ .page {
2854
+ display: flex;
2855
+ flex-direction: column;
2856
+ align-items: center;
2857
+ gap: 24px;
2858
+ max-width: 420px;
2859
+ width: 100%;
2860
+ padding: 40px 20px;
2861
+ }
2862
+ .logo-img {
2863
+ width: 110px;
2864
+ height: 110px;
2865
+ margin: -11px;
2866
+ object-fit: contain;
2867
+ }
2868
+ .title {
2869
+ font-family: ${displayFont};
2870
+ font-weight: 300;
2871
+ font-size: 28px;
2872
+ color: #2A2D38;
2873
+ text-align: center;
2874
+ letter-spacing: -0.01em;
2875
+ line-height: 1.3;
2876
+ }
2877
+ .subtitle {
2878
+ font-size: 15px;
2879
+ color: #4A4D58;
2880
+ text-align: center;
2881
+ margin-top: -8px;
2882
+ }
2883
+ .form-wrap {
2884
+ width: 100%;
2885
+ max-width: 300px;
2886
+ }
2887
+ .field { margin-bottom: 12px; }
2888
+ .field-label {
2889
+ display: block;
2890
+ font-size: 13px;
2891
+ font-weight: 500;
2892
+ color: #4A4D58;
2893
+ margin-bottom: 6px;
2894
+ }
2895
+ .field-input {
2896
+ width: 100%;
2897
+ padding: 10px 12px;
2898
+ border: 1px solid #E4E3DE;
2899
+ border-radius: 8px;
2900
+ font-size: 15px;
2901
+ font-family: inherit;
2902
+ outline: none;
2903
+ background: #fff;
2904
+ transition: border-color 0.15s, box-shadow 0.15s;
2905
+ }
2906
+ .field-input:focus {
2907
+ border-color: ${primaryColor};
2908
+ box-shadow: 0 0 0 3px ${primarySubtle};
2909
+ }
2910
+ .options {
2911
+ display: flex;
2912
+ align-items: center;
2913
+ justify-content: space-between;
2914
+ gap: 12px;
2915
+ margin-top: 8px;
2916
+ }
2917
+
2918
+ /* Checkbox \u2014 matches Maxy shared checkbox (asterisk-in-square) */
2919
+ .check {
2920
+ position: relative;
2921
+ display: flex;
2922
+ align-items: center;
2923
+ gap: 8px;
2924
+ cursor: pointer;
2925
+ user-select: none;
2926
+ }
2927
+ .check input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
2928
+ .check-box {
2929
+ width: 14px;
2930
+ height: 14px;
2931
+ border: 1px solid #E4E3DE;
2932
+ border-radius: 2px;
2933
+ display: flex;
2934
+ align-items: center;
2935
+ justify-content: center;
2936
+ font-size: 10px;
2937
+ color: transparent;
2938
+ transition: border-color 0.15s, color 0.15s;
2939
+ flex-shrink: 0;
2940
+ }
2941
+ .check input:checked + .check-box {
2942
+ border-color: ${primaryColor};
2943
+ color: ${primaryColor};
2944
+ }
2945
+ .check-label {
2946
+ font-size: 13px;
2947
+ color: #4A4D58;
2948
+ }
2949
+
2950
+ /* Ghost button \u2014 matches Maxy ghost variant */
2951
+ .ghost {
2952
+ background: none;
2953
+ border: none;
2954
+ font-family: inherit;
2955
+ font-size: 13px;
2956
+ color: #4A4D58;
2957
+ cursor: pointer;
2958
+ padding: 4px 0;
2959
+ transition: color 0.15s;
2960
+ }
2961
+ .ghost:hover { color: #2A2D38; }
2962
+
2963
+ /* Primary button */
2964
+ .btn {
2965
+ width: 100%;
2966
+ padding: 12px;
2967
+ margin-top: 16px;
2968
+ background: ${primaryColor};
2969
+ color: #fff;
2970
+ border: none;
2971
+ border-radius: 10px;
2972
+ font-size: 15px;
2973
+ font-weight: 500;
2974
+ font-family: inherit;
2975
+ cursor: pointer;
2976
+ transition: background 0.15s;
2977
+ }
2978
+ .btn:hover:not(:disabled) { background: ${primaryHoverColor}; }
2979
+ .btn:disabled { opacity: 0.5; cursor: not-allowed; }
2980
+
2981
+ /* Messages */
2982
+ .msg {
2983
+ font-size: 13px;
2984
+ text-align: center;
2985
+ margin-top: 8px;
2986
+ }
2987
+ .msg--error { color: #c44; }
2988
+ .msg--success { color: ${primaryColor}; }
2989
+
2990
+ /* Strength checklist (setup mode) */
2991
+ .strength-checklist { margin: 8px 0; }
2992
+ .strength-item {
2993
+ font-size: 13px;
2994
+ color: #4A4D58;
2995
+ padding: 2px 0;
2996
+ transition: color 0.15s;
2997
+ }
2998
+ .strength-icon {
2999
+ display: inline-block;
3000
+ width: 16px;
3001
+ text-align: center;
3002
+ }
3003
+
3004
+ @media (max-width: 440px) {
3005
+ .page { padding: 24px 16px; }
3006
+ }
3007
+ </style>
3008
+ </head>
3009
+ <body>
3010
+ <div class="page">
3011
+ <img src="${escapeHtml(logoPath)}" alt="${escapeHtml(productName)}" class="logo-img">
3012
+ <h1 class="title"${logoContainsName ? ' style="display:none"' : ""}>${escapeHtml(productName)}</h1>
3013
+ <p class="subtitle">${escapeHtml(subtitleText)}</p>
3014
+
3015
+ ${successHtml}
3016
+
3017
+ <!-- Login -->
3018
+ <div id="login-section" class="form-wrap" style="display:${loginDisplay}">
3019
+ <form method="POST" action="/__remote-auth/login">
3020
+ <input type="hidden" name="redirect" value="${escapeHtml(redirect)}">
3021
+ <div class="field">
3022
+ <label class="field-label" for="password">Password</label>
3023
+ <input class="field-input" type="password" id="password" name="password" required autofocus ${formDisabled}>
3024
+ </div>
3025
+ <div class="options">
3026
+ <label class="check">
3027
+ <input type="checkbox" id="show-login-pw">
3028
+ <span class="check-box">\u2731</span>
3029
+ <span class="check-label">Show password</span>
3030
+ </label>
3031
+ <button type="button" class="ghost" onclick="toggleMode('change')">Change password</button>
3032
+ </div>
3033
+ <button type="submit" class="btn" ${formDisabled}>Sign in</button>
3034
+ </form>
3035
+ ${errorHtml}
3036
+ ${lockoutHtml}
3037
+ </div>
3038
+
3039
+ <!-- Change password -->
3040
+ <div id="change-section" class="form-wrap" style="display:${changeDisplay}">
3041
+ <form method="POST" action="/__remote-auth/change-password">
3042
+ <input type="hidden" name="redirect" value="${escapeHtml(redirect)}">
3043
+ <div class="field">
3044
+ <label class="field-label" for="current_password">Current password</label>
3045
+ <input class="field-input" type="password" id="current_password" name="current_password" required ${formDisabled}>
3046
+ </div>
3047
+ <div class="field">
3048
+ <label class="field-label" for="new_password">New password</label>
3049
+ <input class="field-input" type="password" id="new_password" name="new_password" required ${formDisabled}>
3050
+ </div>
3051
+ <div class="field">
3052
+ <label class="field-label" for="confirm_password">Confirm new password</label>
3053
+ <input class="field-input" type="password" id="confirm_password" name="confirm_password" required ${formDisabled}>
3054
+ </div>
3055
+ <div class="options">
3056
+ <label class="check">
3057
+ <input type="checkbox" id="show-change-pw">
3058
+ <span class="check-box">\u2731</span>
3059
+ <span class="check-label">Show passwords</span>
3060
+ </label>
3061
+ <button type="button" class="ghost" onclick="toggleMode('login')">Back to sign in</button>
3062
+ </div>
3063
+ <button type="submit" class="btn" ${formDisabled}>Change password</button>
3064
+ </form>
3065
+ ${changeErrorHtml}
3066
+ </div>
3067
+
3068
+ <!-- Setup (initial password) -->
3069
+ <div id="setup-section" class="form-wrap" style="display:${setupDisplay}">
3070
+ <form method="POST" action="/__remote-auth/set-initial-password">
3071
+ <div class="field">
3072
+ <label class="field-label" for="setup_password">Password</label>
3073
+ <input class="field-input" type="password" id="setup_password" name="password" required autofocus>
3074
+ </div>
3075
+ <div class="field">
3076
+ <label class="field-label" for="setup_confirm">Confirm password</label>
3077
+ <input class="field-input" type="password" id="setup_confirm" name="confirm_password" required>
3078
+ </div>
3079
+ <div id="strength-checklist" class="strength-checklist">
3080
+ <div class="strength-item" id="req-length"><span class="strength-icon">\u25CB</span> At least 8 characters</div>
3081
+ <div class="strength-item" id="req-number"><span class="strength-icon">\u25CB</span> Contains a number</div>
3082
+ <div class="strength-item" id="req-special"><span class="strength-icon">\u25CB</span> Contains a special character</div>
3083
+ <div class="strength-item" id="req-spaces"><span class="strength-icon">\u25CB</span> No spaces</div>
3084
+ </div>
3085
+ <div class="options">
3086
+ <label class="check">
3087
+ <input type="checkbox" id="show-setup-pw">
3088
+ <span class="check-box">\u2731</span>
3089
+ <span class="check-label">Show passwords</span>
3090
+ </label>
3091
+ </div>
3092
+ <button type="submit" class="btn" id="setup-submit" disabled>Set password</button>
3093
+ </form>
3094
+ ${setupErrorHtml}
3095
+ </div>
3096
+
3097
+ <!-- Success (after initial password set) -->
3098
+ <div id="success-section" class="form-wrap" style="display:${successDisplay}">
3099
+ <p class="msg msg--success" style="font-size:15px;margin-bottom:4px;">\u2713 Password set</p>
3100
+ <p style="font-size:14px;color:#4A4D58;text-align:center;">You can close this tab and return to the onboarding tab.</p>
3101
+ <a href="/" style="display:block;text-align:center;margin-top:16px;font-size:13px;color:#4A4D58;text-decoration:none;" onmouseover="this.style.color='#2A2D38'" onmouseout="this.style.color='#4A4D58'">Sign in \u2192</a>
3102
+ <script>
3103
+ (function() {
3104
+ try {
3105
+ var ch = new BroadcastChannel('platform-onboarding');
3106
+ setTimeout(function() {
3107
+ ch.postMessage({ type: 'remote-password-set' });
3108
+ ch.close();
3109
+ }, 2500);
3110
+ } catch(e) {}
3111
+ })();
3112
+ </script>
3113
+ </div>
3114
+ </div>
3115
+
3116
+ <script>
3117
+ /* Toggle between login and change-password modes */
3118
+ function toggleMode(mode) {
3119
+ document.getElementById('login-section').style.display = mode === 'login' ? 'block' : 'none';
3120
+ document.getElementById('change-section').style.display = mode === 'change' ? 'block' : 'none';
3121
+ /* Focus first input in the active section */
3122
+ var id = mode === 'login' ? 'password' : 'current_password';
3123
+ var el = document.getElementById(id);
3124
+ if (el) el.focus();
3125
+ }
3126
+
3127
+ /* Show/hide password toggles */
3128
+ function bindShowHide(checkboxId, inputIds) {
3129
+ var cb = document.getElementById(checkboxId);
3130
+ if (!cb) return;
3131
+ cb.addEventListener('change', function() {
3132
+ var type = cb.checked ? 'text' : 'password';
3133
+ inputIds.forEach(function(id) {
3134
+ var el = document.getElementById(id);
3135
+ if (el) el.type = type;
3136
+ });
3137
+ });
3138
+ }
3139
+ bindShowHide('show-login-pw', ['password']);
3140
+ bindShowHide('show-change-pw', ['current_password', 'new_password', 'confirm_password']);
3141
+ bindShowHide('show-setup-pw', ['setup_password', 'setup_confirm']);
3142
+
3143
+ /* Explicit Enter-to-submit for the login password field */
3144
+ var loginPw = document.getElementById('password');
3145
+ if (loginPw) {
3146
+ loginPw.addEventListener('keydown', function(e) {
3147
+ if (e.key === 'Enter') {
3148
+ e.preventDefault();
3149
+ this.closest('form').requestSubmit();
3150
+ }
3151
+ });
3152
+ }
3153
+
3154
+ /* Live password strength validation (setup mode) */
3155
+ (function() {
3156
+ var pw = document.getElementById('setup_password');
3157
+ var confirm = document.getElementById('setup_confirm');
3158
+ var btn = document.getElementById('setup-submit');
3159
+ if (!pw || !confirm || !btn) return;
3160
+
3161
+ var rules = [
3162
+ { id: 'req-length', test: function(p) { return p.length >= 8; } },
3163
+ { id: 'req-number', test: function(p) { return /\\d/.test(p); } },
3164
+ { id: 'req-special', test: function(p) { return /[^A-Za-z0-9]/.test(p); } },
3165
+ { id: 'req-spaces', test: function(p) { return p.length > 0 && !/\\s/.test(p); } }
3166
+ ];
3167
+
3168
+ function check() {
3169
+ var p = pw.value;
3170
+ var allMet = true;
3171
+ rules.forEach(function(r) {
3172
+ var el = document.getElementById(r.id);
3173
+ var met = r.test(p);
3174
+ if (!met) allMet = false;
3175
+ el.querySelector('.strength-icon').textContent = met ? '\\u2713' : '\\u25CB';
3176
+ el.style.color = met ? '${primaryColor}' : '#4A4D58';
3177
+ });
3178
+ var match = p.length > 0 && p === confirm.value;
3179
+ btn.disabled = !(allMet && match);
3180
+ }
3181
+
3182
+ pw.addEventListener('input', check);
3183
+ confirm.addEventListener('input', check);
3184
+ })();
3185
+ </script>
3186
+ </body>
3187
+ </html>`;
3188
+ }
3189
+ function escapeHtml(str) {
3190
+ return str.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
3191
+ }
3192
+ var SCRYPT_N2, SCRYPT_R2, SCRYPT_P2, SCRYPT_KEYLEN2, SESSION_TTL_MS2, TOKEN_PREFIX, SECRET_BYTES, NONCE_BYTES, cachedSecret, MAX_ATTEMPTS, LOCKOUT_MS, LOCAL_BUCKET, rateLimitMap;
3193
+ var init_remote_auth = __esm({
3194
+ "app/lib/remote-auth.ts"() {
3195
+ "use strict";
3196
+ init_paths();
3197
+ init_loop_registry();
3198
+ init_src2();
3199
+ init_password_strength();
3200
+ SCRYPT_N2 = 16384;
3201
+ SCRYPT_R2 = 8;
3202
+ SCRYPT_P2 = 1;
3203
+ SCRYPT_KEYLEN2 = 64;
3204
+ SESSION_TTL_MS2 = 24 * 60 * 60 * 1e3;
3205
+ TOKEN_PREFIX = "v1.";
3206
+ SECRET_BYTES = 32;
3207
+ NONCE_BYTES = 16;
3208
+ cachedSecret = null;
3209
+ MAX_ATTEMPTS = 5;
3210
+ LOCKOUT_MS = 15 * 60 * 1e3;
3211
+ LOCAL_BUCKET = "__local__";
3212
+ rateLimitMap = /* @__PURE__ */ new Map();
3213
+ registerLoop({
3214
+ name: "rate-limit-cleanup",
3215
+ intervalMs: 15 * 60 * 1e3,
3216
+ run: () => {
3217
+ const now = Date.now();
3218
+ let purged = 0;
3219
+ for (const [key, rec] of rateLimitMap) {
3220
+ if (rec.lockedUntil > 0 && rec.lockedUntil <= now) {
3221
+ rateLimitMap.delete(key);
3222
+ purged += 1;
3223
+ }
3224
+ }
3225
+ return `purged ${purged}, ${rateLimitMap.size} tracked`;
3226
+ }
3227
+ });
3228
+ }
3229
+ });
3230
+
3231
+ // app/lib/pwa.ts
3232
+ function pwaSurfaceForShell(file) {
3233
+ return PWA_SURFACES.find((s) => s.shellFile === file);
3234
+ }
3235
+ function buildManifest(s, b) {
3236
+ const name = `${b.productName}${s.nameSuffix}`;
3237
+ return {
3238
+ id: s.id,
3239
+ name,
3240
+ short_name: name,
3241
+ start_url: s.startUrl,
3242
+ scope: s.scope,
3243
+ display: "standalone",
3244
+ theme_color: b.themeColor,
3245
+ background_color: b.backgroundColor,
3246
+ // Explicit 192/512 `any` icons (iOS/macOS composite transparency onto black,
3247
+ // so these are opaque) plus a wider-safe-zone `maskable` entry for Android's
3248
+ // circular crop. background_color sets only the splash; the tile background
3249
+ // is baked into the PNGs.
3250
+ icons: [
3251
+ { src: b.appIcon192, sizes: "192x192", purpose: "any" },
3252
+ { src: b.appIcon512, sizes: "512x512", purpose: "any" },
3253
+ { src: b.maskableIcon, sizes: "512x512", purpose: "maskable" }
3254
+ ]
3255
+ };
3256
+ }
3257
+ function escAttr(s) {
3258
+ return s.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
3259
+ }
3260
+ function swRegisterScript(s) {
3261
+ return [
3262
+ "<script>",
3263
+ "if('serviceWorker' in navigator){navigator.serviceWorker.register('/sw.js').catch(function(e){",
3264
+ `try{fetch('/api/_client-error',{method:'POST',headers:{'content-type':'application/json'},body:JSON.stringify({kind:'event',source:'pwa',op:'sw-register-fail',surface:'${s.surface}',scope:'${s.scope}',err:String((e&&e.message)||e)}),keepalive:true}).catch(function(){});}catch(_){}`,
3265
+ "});}",
3266
+ "</script>"
3267
+ ].join("\n");
3268
+ }
3269
+ function installHeadLines(manifestPath, b) {
3270
+ return [
3271
+ `<link rel="manifest" href="${escAttr(manifestPath)}">`,
3272
+ `<link rel="apple-touch-icon" href="${escAttr(b.appleTouchIcon)}">`,
3273
+ // Both the standards-based and the legacy Apple capable meta: Chromium
3274
+ // deprecates `apple-mobile-web-app-capable` in favour of
3275
+ // `mobile-web-app-capable`, while iOS Safari still reads the apple one.
3276
+ '<meta name="mobile-web-app-capable" content="yes">',
3277
+ '<meta name="apple-mobile-web-app-capable" content="yes">',
3278
+ `<meta name="theme-color" content="${escAttr(b.themeColor)}">`
3279
+ ];
3280
+ }
3281
+ function pwaHeadTags(s, b) {
3282
+ return [...installHeadLines(s.manifestPath, b), swRegisterScript(s)].join("\n");
3283
+ }
3284
+ function pwaCensus(d) {
3285
+ const manifestLinked = PWA_SURFACES.filter((s) => {
3286
+ const html = d.shellHtml(s.shellFile);
3287
+ return html != null && html.includes(`"${s.manifestPath}"`);
3288
+ }).length;
3289
+ const iconsPresent = d.iconExists() ? PWA_SURFACES.length : 0;
3290
+ return { surfaces: PWA_SURFACES.length, manifestLinked, iconsPresent };
3291
+ }
3292
+ var PWA_SURFACES, MANIFEST_CONTENT_TYPE, SW_CONTENT_TYPE;
3293
+ var init_pwa = __esm({
3294
+ "app/lib/pwa.ts"() {
3295
+ "use strict";
3296
+ PWA_SURFACES = [
3297
+ {
3298
+ surface: "admin",
3299
+ shellFile: "index.html",
3300
+ manifestPath: "/manifest-admin.webmanifest",
3301
+ nameSuffix: "",
3302
+ startUrl: "/",
3303
+ scope: "/",
3304
+ id: "/?pwa=admin"
3305
+ },
3306
+ {
3307
+ surface: "operator",
3308
+ shellFile: "operator.html",
3309
+ manifestPath: "/manifest-operator.webmanifest",
3310
+ nameSuffix: " Operator",
3311
+ startUrl: "/",
3312
+ scope: "/",
3313
+ id: "/?pwa=operator"
3314
+ },
3315
+ {
3316
+ surface: "chat",
3317
+ shellFile: "chat.html",
3318
+ manifestPath: "/manifest-chat.webmanifest",
3319
+ nameSuffix: " Chat",
3320
+ startUrl: "/chat",
3321
+ scope: "/chat",
3322
+ id: "/chat?pwa=chat"
3323
+ }
3324
+ ];
3325
+ MANIFEST_CONTENT_TYPE = "application/manifest+json";
3326
+ SW_CONTENT_TYPE = "application/javascript";
3327
+ }
3328
+ });
3329
+
3330
+ // app/lib/auth-gate.ts
3331
+ function canAccessAdmin(input) {
3332
+ const client = resolveClientIp(input.remoteAddress, input.xForwardedFor);
3333
+ if (input.isPublicHost(input.host)) {
3334
+ return { allow: false, reason: "public-host", client };
3335
+ }
3336
+ if (client.kind !== "external") {
3337
+ return { allow: true, client };
3338
+ }
3339
+ if (!isRemoteAuthConfigured()) {
3340
+ return { allow: false, reason: "remote-unconfigured", client };
3341
+ }
3342
+ const token = parseCookieValue(input.cookieHeader, "__remote_session");
3343
+ if (token && validateRemoteSession(token)) {
3344
+ return { allow: true, client };
3345
+ }
3346
+ return { allow: false, reason: "unauthorized", client };
3347
+ }
3348
+ function parseCookieValue(cookieHeader, name) {
3349
+ if (!cookieHeader) return null;
3350
+ const match2 = cookieHeader.match(new RegExp(`(?:^|;\\s*)${name}=([^;]*)`));
3351
+ if (!match2) return null;
3352
+ try {
3353
+ return decodeURIComponent(match2[1]);
3354
+ } catch {
3355
+ return null;
3356
+ }
3357
+ }
3358
+ function isApiRequestPath(path) {
3359
+ return path.startsWith("/api/");
3360
+ }
3361
+ function isRemoteAuthBypassPath(path) {
3362
+ return path === "/favicon.ico" || path.startsWith("/assets/") || path.startsWith("/brand/") || // Public free/busy is read by the booking page (a separate Cloudflare Pages
3363
+ // origin) against the brand host with no admin cookie. It is public by
3364
+ // design — open slots only, no :Meeting detail — so it bypasses the gate
3365
+ // exactly like /brand/. The detail-leak guard lives in the route + its test.
3366
+ path === "/api/calendar/free-busy" || // Task 2365 — Telegram POSTs the webhook from its own servers, which hold
3367
+ // no __remote_session cookie and can never obtain one, so every delivery
3368
+ // was answered 401 here before the route ever ran. The route authenticates
3369
+ // the request itself against the per-account secret header
3370
+ // (server/routes/telegram.ts), exactly the request-borne-auth precedent the
3371
+ // free-busy entry above sets. The trailing slash keeps a sibling path such
3372
+ // as /api/telegram-admin/ outside the exemption.
3373
+ path.startsWith("/api/telegram/") || // Task 2502 — the field job sheet runs inside Telegram's webview on a
3374
+ // worker's phone, which reaches the brand host over the public tunnel and
3375
+ // holds no __remote_session cookie. The route authenticates every request
3376
+ // itself against the bot's own token (server/routes/field.ts), exactly the
3377
+ // request-borne-auth precedent the two entries above set. The document is
3378
+ // exempt as well as the API because it is the page Telegram opens, and it
3379
+ // carries no data of its own.
3380
+ //
3381
+ // The trailing slash on the API prefix is load-bearing: without it a
3382
+ // sibling such as /api/field-admin/ would be exempted by accident.
3383
+ path === "/field" || path.startsWith("/api/field/") || PWA_PUBLIC_PATHS.has(path);
3384
+ }
3385
+ var PWA_PUBLIC_PATHS;
3386
+ var init_auth_gate = __esm({
3387
+ "app/lib/auth-gate.ts"() {
3388
+ "use strict";
3389
+ init_remote_auth();
3390
+ init_pwa();
3391
+ PWA_PUBLIC_PATHS = /* @__PURE__ */ new Set(["/sw.js", ...PWA_SURFACES.map((s) => s.manifestPath)]);
3392
+ }
3393
+ });
3394
+
3395
+ // app/lib/claude-agent/plugin-manifest.ts
3396
+ import { resolve as resolve3, join } from "path";
3397
+ import {
3398
+ readFileSync as readFileSync4,
3399
+ writeFileSync as writeFileSync4,
3400
+ readdirSync,
3401
+ existsSync as existsSync3,
3402
+ statSync,
3403
+ rmSync
3404
+ } from "fs";
3405
+ import { createHash as createHash2 } from "crypto";
3406
+ function isMissingPluginDir(pluginDir) {
3407
+ const pluginRoot = resolve3(PLATFORM_ROOT, "plugins", pluginDir);
3408
+ if (existsSync3(resolve3(pluginRoot, "PLUGIN.md"))) return false;
3409
+ if (existsSync3(resolve3(pluginRoot, "mcp/dist/index.js"))) return false;
3410
+ return true;
3411
+ }
3412
+ function findMissingPlugins(enabledPlugins) {
3413
+ if (!Array.isArray(enabledPlugins) || enabledPlugins.length === 0) return [];
3414
+ return enabledPlugins.filter(isMissingPluginDir);
3415
+ }
3416
+ function readBundleSubPlugins(bundlePath) {
3417
+ if (!existsSync3(bundlePath)) return [];
3418
+ let raw2;
3419
+ try {
3420
+ raw2 = readFileSync4(bundlePath, "utf-8");
3421
+ } catch {
3422
+ return [];
3423
+ }
3424
+ const fm = raw2.match(/^---\n([\s\S]*?)\n---/);
3425
+ if (!fm) return [];
3426
+ const subs = [];
3427
+ let inPlugins = false;
3428
+ for (const line of fm[1].split("\n")) {
3429
+ if (/^plugins:/.test(line)) {
3430
+ inPlugins = true;
3431
+ continue;
3432
+ }
3433
+ if (inPlugins) {
3434
+ const m = line.match(/^\s+- (.+)/);
3435
+ if (m) subs.push(m[1].trim());
3436
+ else break;
3437
+ }
3438
+ }
3439
+ return subs;
3440
+ }
3441
+ function walkPremiumBundles() {
3442
+ const TAG = "[premium-auto-deliver]";
3443
+ if (BUNDLE_MODE === "none") {
3444
+ console.log(`${TAG} gate brand=${BRAND_NAME} mode=none bundles=[]`);
3445
+ return [];
3446
+ }
3447
+ const onDisk = walkPremiumBundlesOnDisk();
3448
+ if (BUNDLE_MODE === "all") {
3449
+ console.log(`${TAG} gate brand=${BRAND_NAME} mode=all bundles=[${onDisk.map((b) => b.bundle).join(",")}]`);
3450
+ return onDisk;
3451
+ }
3452
+ const allow = new Set(BUNDLE_ALLOWLIST);
3453
+ const kept = onDisk.filter((b) => allow.has(b.bundle));
3454
+ const onDiskNames = new Set(onDisk.map((b) => b.bundle));
3455
+ const missing = BUNDLE_ALLOWLIST.filter((name) => !onDiskNames.has(name));
3456
+ console.log(
3457
+ `${TAG} gate brand=${BRAND_NAME} mode=allowlist bundles=[${kept.map((b) => b.bundle).join(",")}]` + (missing.length > 0 ? ` missing=[${missing.join(",")}]` : "")
3458
+ );
3459
+ return kept;
3460
+ }
3461
+ function walkPremiumBundlesOnDisk() {
3462
+ const stagingRoot = resolve3(PLATFORM_ROOT, "../premium-plugins");
3463
+ if (!existsSync3(stagingRoot)) return [];
3464
+ let entries;
3465
+ try {
3466
+ entries = readdirSync(stagingRoot);
3467
+ } catch {
3468
+ return [];
3469
+ }
3470
+ const result = [];
3471
+ for (const bundle of entries) {
3472
+ if (bundle.startsWith(".")) continue;
3473
+ const bundleDir = resolve3(stagingRoot, bundle);
3474
+ try {
3475
+ if (!statSync(bundleDir).isDirectory()) continue;
3476
+ } catch {
3477
+ continue;
3478
+ }
3479
+ const declared = readBundleSubPlugins(join(bundleDir, "BUNDLE.md"));
3480
+ result.push({ bundle, subs: declared.length > 0 ? declared : [bundle] });
3481
+ }
3482
+ return result;
3483
+ }
3484
+ function reapDuplicateFlatPremiumSubs(bundles, stagingRoot, pluginsDir) {
3485
+ const TAG = "[premium-auto-deliver]";
3486
+ for (const { bundle, subs } of bundles) {
3487
+ const isBundle = existsSync3(join(stagingRoot, bundle, "BUNDLE.md"));
3488
+ for (const sub of subs) {
3489
+ const premiumManifest = isBundle ? resolve3(stagingRoot, bundle, "plugins", sub, "PLUGIN.md") : resolve3(stagingRoot, bundle, "PLUGIN.md");
3490
+ const flatDir = resolve3(pluginsDir, sub);
3491
+ const flatManifest = resolve3(flatDir, "PLUGIN.md");
3492
+ if (!existsSync3(premiumManifest) || !existsSync3(flatManifest)) continue;
3493
+ const premiumSha = createHash2("sha256").update(readFileSync4(premiumManifest)).digest("hex");
3494
+ const flatSha = createHash2("sha256").update(readFileSync4(flatManifest)).digest("hex");
3495
+ if (isBundle) {
3496
+ if (premiumSha === flatSha) {
3497
+ try {
3498
+ rmSync(flatDir, { recursive: true });
3499
+ console.log(`${TAG} reaped sub=${sub} reason=duplicate-of-premium-tree`);
3500
+ } catch (err) {
3501
+ console.log(`${TAG} reap-failed sub=${sub} err=${err instanceof Error ? err.message : String(err)}`);
3502
+ }
3503
+ } else {
3504
+ console.log(`${TAG} flat-copy-divergent sub=${sub} action=skip-keep`);
3505
+ }
3506
+ } else {
3507
+ try {
3508
+ rmSync(flatDir, { recursive: true });
3509
+ console.log(`${TAG} reaped standalone=${sub} matches-source=${flatSha === premiumSha}`);
3510
+ } catch (err) {
3511
+ console.log(`${TAG} reap-failed standalone=${sub} err=${err instanceof Error ? err.message : String(err)}`);
3512
+ }
3513
+ }
3514
+ }
3515
+ }
3516
+ }
3517
+ function autoDeliverPremiumPlugins() {
3518
+ const bundles = walkPremiumBundles();
3519
+ if (bundles.length === 0) return;
3520
+ const stagingRoot = resolve3(PLATFORM_ROOT, "../premium-plugins");
3521
+ const pluginsDir = resolve3(PLATFORM_ROOT, "plugins");
3522
+ reapDuplicateFlatPremiumSubs(bundles, stagingRoot, pluginsDir);
3523
+ }
3524
+ function reconcileEnabledPlugins(accountDir, config, accountId) {
3525
+ const TAG = "[premium-auto-deliver]";
3526
+ if (!accountDir || !config) return;
3527
+ const bundles = walkPremiumBundles();
3528
+ const stagingRoot = resolve3(PLATFORM_ROOT, "../premium-plugins");
3529
+ const bundleNames = [];
3530
+ const allSubs = [];
3531
+ for (const { bundle, subs } of bundles) {
3532
+ bundleNames.push(bundle);
3533
+ const bundlePath = join(stagingRoot, bundle, "BUNDLE.md");
3534
+ const isBundle = existsSync3(bundlePath);
3535
+ for (const sub of subs) {
3536
+ const subManifest = isBundle ? resolve3(stagingRoot, bundle, "plugins", sub, "PLUGIN.md") : resolve3(stagingRoot, bundle, "PLUGIN.md");
3537
+ if (!existsSync3(subManifest)) continue;
3538
+ allSubs.push(sub);
3539
+ }
3540
+ }
3541
+ const current = Array.isArray(config.enabledPlugins) ? config.enabledPlugins : [];
3542
+ const currentSet = new Set(current);
3543
+ const added = [];
3544
+ for (const sub of allSubs) {
3545
+ if (currentSet.has(sub)) continue;
3546
+ currentSet.add(sub);
3547
+ added.push(sub);
3548
+ }
3549
+ console.log(
3550
+ `${TAG} stamp accountId=${accountId ?? "unknown"} brand=${BRAND_NAME} mode=${BUNDLE_MODE} bundles=[${bundleNames.join(",")}] added=[${added.join(",")}]`
3551
+ );
3552
+ if (added.length === 0) return;
3553
+ const merged = [...currentSet];
3554
+ const configPath = resolve3(accountDir, "account.json");
3555
+ try {
3556
+ const raw2 = readFileSync4(configPath, "utf-8");
3557
+ const parsed = JSON.parse(raw2);
3558
+ parsed.enabledPlugins = merged;
3559
+ writeFileSync4(configPath, JSON.stringify(parsed, null, 2) + "\n");
3560
+ config.enabledPlugins = merged;
3561
+ } catch (err) {
3562
+ console.error(`${TAG} enabled-stamp write failed: ${err instanceof Error ? err.message : String(err)}`);
3563
+ }
3564
+ }
3565
+ function reconcileEnabledPluginsForAccounts(accounts) {
3566
+ for (const acct of accounts) {
3567
+ reconcileEnabledPlugins(acct.accountDir, acct.config, acct.accountId);
3568
+ }
3569
+ }
3570
+ function cleanupLeakedPremiumSubs(accountDir, config, accountId) {
3571
+ const TAG = "[premium-auto-deliver]";
3572
+ if (!accountDir || !config) return;
3573
+ if (BUNDLE_MODE === "all") return;
3574
+ const current = Array.isArray(config.enabledPlugins) ? config.enabledPlugins : [];
3575
+ if (current.length === 0) return;
3576
+ const allow = new Set(BUNDLE_ALLOWLIST);
3577
+ const leakedNames = /* @__PURE__ */ new Set();
3578
+ for (const { bundle, subs } of walkPremiumBundlesOnDisk()) {
3579
+ if (BUNDLE_MODE === "allowlist" && allow.has(bundle)) continue;
3580
+ for (const sub of subs) leakedNames.add(sub);
3581
+ }
3582
+ if (leakedNames.size === 0) return;
3583
+ const removed = [];
3584
+ const kept = [];
3585
+ for (const name of current) {
3586
+ if (leakedNames.has(name)) removed.push(name);
3587
+ else kept.push(name);
3588
+ }
3589
+ if (removed.length === 0) return;
3590
+ const configPath = resolve3(accountDir, "account.json");
3591
+ try {
3592
+ const raw2 = readFileSync4(configPath, "utf-8");
3593
+ const parsed = JSON.parse(raw2);
3594
+ parsed.enabledPlugins = kept;
3595
+ writeFileSync4(configPath, JSON.stringify(parsed, null, 2) + "\n");
3596
+ config.enabledPlugins = kept;
3597
+ console.log(`${TAG} cleanup accountId=${accountId ?? "unknown"} removed=[${removed.join(",")}]`);
3598
+ } catch (err) {
3599
+ console.error(`${TAG} cleanup write failed accountId=${accountId ?? "unknown"}: ${err instanceof Error ? err.message : String(err)}`);
3600
+ }
3601
+ }
3602
+ var init_plugin_manifest = __esm({
3603
+ "app/lib/claude-agent/plugin-manifest.ts"() {
3604
+ "use strict";
3605
+ init_account();
3606
+ init_paths();
3607
+ }
3608
+ });
3609
+
3610
+ // app/lib/claude-agent/logging.ts
3611
+ var emitMissingOnResolve;
3612
+ var init_logging = __esm({
3613
+ "app/lib/claude-agent/logging.ts"() {
3614
+ "use strict";
3615
+ emitMissingOnResolve = (..._args) => null;
3616
+ }
3617
+ });
3618
+
3619
+ // app/lib/claude-agent/stream-log-writer.ts
3620
+ var init_stream_log_writer = __esm({
3621
+ "app/lib/claude-agent/stream-log-writer.ts"() {
3622
+ "use strict";
3623
+ }
3624
+ });
3625
+
3626
+ // app/lib/claude-agent/summary-helpers.ts
3627
+ var stripAttachmentMetaSuffix;
3628
+ var init_summary_helpers = __esm({
3629
+ "app/lib/claude-agent/summary-helpers.ts"() {
3630
+ "use strict";
3631
+ stripAttachmentMetaSuffix = (..._args) => null;
3632
+ }
3633
+ });
3634
+
3635
+ // app/lib/claude-agent.ts
3636
+ var init_claude_agent = __esm({
3637
+ "app/lib/claude-agent.ts"() {
3638
+ "use strict";
3639
+ init_account();
3640
+ init_session_store();
3641
+ init_plugin_manifest();
3642
+ init_logging();
3643
+ init_stream_log_writer();
3644
+ init_summary_helpers();
3645
+ }
3646
+ });
3647
+
3648
+ // server/routes/_helpers.ts
3649
+ async function safeJson(c) {
3650
+ try {
3651
+ return await c.req.json();
3652
+ } catch {
3653
+ return null;
3654
+ }
3655
+ }
3656
+ async function resolveCacheKey(c) {
3657
+ const raw2 = await resolveRawSessionKey(c);
3658
+ if (!raw2) return { fingerprint: "", signedSessionToken: "" };
3659
+ return { fingerprint: fingerprintSessionKey(raw2), signedSessionToken: raw2 };
3660
+ }
3661
+ async function resolveRawSessionKey(c) {
3662
+ const fromQuery = c.req.query("session_key");
3663
+ if (fromQuery) return fromQuery;
3664
+ const contentType = c.req.header("content-type") ?? "";
3665
+ if (contentType.includes("application/json")) {
3666
+ try {
3667
+ const body = await c.req.json();
3668
+ if (body && typeof body.session_key === "string" && body.session_key) {
3669
+ return body.session_key;
3670
+ }
3671
+ } catch {
3672
+ }
3673
+ }
3674
+ if (contentType.includes("multipart/form-data") || contentType.includes("application/x-www-form-urlencoded")) {
3675
+ try {
3676
+ const form = await c.req.formData();
3677
+ const sk = form.get("session_key");
3678
+ if (typeof sk === "string" && sk) return sk;
3679
+ } catch {
3680
+ }
3681
+ }
3682
+ return "";
3683
+ }
3684
+ async function tryCookieBridgeForConversation(c, cacheKey2, sessionId) {
3685
+ const path = c.req.path;
3686
+ const sk8 = cacheKey2.slice(0, 8);
3687
+ const cid8 = sessionId.slice(0, 8);
3688
+ const client = resolveClientIp(
3689
+ c.env?.incoming?.socket?.remoteAddress,
3690
+ c.req.header("x-forwarded-for")
3691
+ );
3692
+ if (client.kind === "external") {
3693
+ const cookieToken = parseCookieValue(c.req.header("cookie"), "__remote_session");
3694
+ if (!cookieToken) {
3695
+ console.error(`[session] cookie-bridge-rejected reason=no-cookie path=${path} cacheKey=${sk8}\u2026 sessionId=${cid8}\u2026`);
3696
+ return { ok: false, reason: "no-cookie" };
3697
+ }
3698
+ const desc = describeRemoteSession(cookieToken);
3699
+ if (!desc.present) {
3700
+ console.error(`[session] cookie-bridge-rejected reason=cookie-invalid path=${path} cacheKey=${sk8}\u2026 sessionId=${cid8}\u2026`);
3701
+ return { ok: false, reason: "cookie-invalid" };
3702
+ }
3703
+ if (desc.expired) {
3704
+ console.error(`[session] cookie-bridge-rejected reason=cookie-expired path=${path} cacheKey=${sk8}\u2026 sessionId=${cid8}\u2026`);
3705
+ return { ok: false, reason: "cookie-expired" };
3706
+ }
3707
+ }
3708
+ const owner = await getConversationOwner(sessionId);
3709
+ if (!owner) {
3710
+ console.error(`[session] cookie-bridge-rejected reason=conversation-not-found path=${path} cacheKey=${sk8}\u2026 sessionId=${cid8}\u2026`);
3711
+ return { ok: false, reason: "conversation-not-found" };
3712
+ }
3713
+ if (!isValidAccountId(owner.accountId)) {
3714
+ console.error(`[session] cookie-bridge-rejected reason=account-mismatch path=${path} cacheKey=${sk8}\u2026 sessionId=${cid8}\u2026 conversationAccountId=${owner.accountId.slice(0, 8)}\u2026`);
3715
+ return { ok: false, reason: "account-mismatch" };
3716
+ }
3717
+ registerSession(cacheKey2, "admin", owner.accountId, void 0, owner.userId ?? void 0);
3718
+ console.log(`[session] cookie-bridge accountId=${owner.accountId.slice(0, 8)}\u2026 cacheKey=${sk8}\u2026 sessionId=${cid8}\u2026 path=${path}`);
3719
+ return { ok: true };
3720
+ }
3721
+ function requireAdminCookie(isPublicHost) {
3722
+ return async (c, next) => {
3723
+ const host = (c.req.header("host") ?? "").split(":")[0];
3724
+ const decision = canAccessAdmin({
3725
+ host,
3726
+ remoteAddress: c.env?.incoming?.socket?.remoteAddress,
3727
+ xForwardedFor: c.req.header("x-forwarded-for"),
3728
+ cookieHeader: c.req.header("cookie"),
3729
+ isPublicHost
3730
+ });
3731
+ if (decision.allow) {
3732
+ await next();
3733
+ return;
3734
+ }
3735
+ if (decision.reason === "public-host") {
3736
+ return c.json({ error: "Not found" }, 404);
3737
+ }
3738
+ const clientIp = c.var.clientIp ?? "unknown";
3739
+ console.error(`[admin-cookie] reject reason=${decision.reason} ip=${clientIp} path=${c.req.path}`);
3740
+ return c.json({ error: "Unauthorized" }, 401);
3741
+ };
3742
+ }
3743
+ var requireAdminSession, clientIpMiddleware;
3744
+ var init_helpers = __esm({
3745
+ "server/routes/_helpers.ts"() {
3746
+ "use strict";
3747
+ init_claude_agent();
3748
+ init_remote_auth();
3749
+ init_auth_gate();
3750
+ init_neo4j_store();
3751
+ requireAdminSession = async (c, next) => {
3752
+ const { fingerprint, signedSessionToken } = await resolveCacheKey(c);
3753
+ if (!fingerprint) {
3754
+ console.error(`[admin-auth] outcome=reject status=400 code=session-missing path=${c.req.path}`);
3755
+ return c.json({ error: "session_key required", code: "session-missing" }, 400);
3756
+ }
3757
+ const result = validateSession(fingerprint, "admin", signedSessionToken);
3758
+ if (!result.ok) {
3759
+ const code = result.reason === "agent-type-mismatch" ? "session-not-registered" : result.reason;
3760
+ const tail = fingerprint.slice(0, 8);
3761
+ console.error(`[admin-auth] outcome=reject status=401 code=${code} path=${c.req.path} cacheKey=${tail}\u2026`);
3762
+ return c.json({ error: "Invalid or expired admin session", code }, 401);
3763
+ }
3764
+ c.set("cacheKey", fingerprint);
3765
+ c.set("signedSessionToken", signedSessionToken);
3766
+ console.log(`[admin-auth] outcome=accept path=${c.req.path} cacheKey=${fingerprint.slice(0, 8)}\u2026`);
3767
+ await next();
3768
+ };
3769
+ clientIpMiddleware = async (c, next) => {
3770
+ const client = resolveClientIp(
3771
+ c.env?.incoming?.socket?.remoteAddress,
3772
+ c.req.header("x-forwarded-for")
3773
+ );
3774
+ c.set("clientIp", client.ip);
3775
+ await next();
3776
+ };
3777
+ }
3778
+ });
3779
+
3780
+ // node_modules/@hono/node-server/dist/index.mjs
3781
+ import { createServer as createServerHTTP } from "http";
3782
+ import { Http2ServerRequest as Http2ServerRequest2 } from "http2";
3783
+ import { Http2ServerRequest } from "http2";
3784
+ import { Readable } from "stream";
3785
+ import crypto from "crypto";
3786
+ var RequestError = class extends Error {
3787
+ constructor(message, options) {
3788
+ super(message, options);
3789
+ this.name = "RequestError";
3790
+ }
3791
+ };
3792
+ var toRequestError = (e) => {
3793
+ if (e instanceof RequestError) {
3794
+ return e;
3795
+ }
3796
+ return new RequestError(e.message, { cause: e });
3797
+ };
3798
+ var GlobalRequest = global.Request;
3799
+ var Request2 = class extends GlobalRequest {
3800
+ constructor(input, options) {
3801
+ if (typeof input === "object" && getRequestCache in input) {
3802
+ input = input[getRequestCache]();
3803
+ }
3804
+ if (typeof options?.body?.getReader !== "undefined") {
3805
+ ;
3806
+ options.duplex ??= "half";
3807
+ }
3808
+ super(input, options);
3809
+ }
3810
+ };
3811
+ var newHeadersFromIncoming = (incoming) => {
3812
+ const headerRecord = [];
3813
+ const rawHeaders = incoming.rawHeaders;
3814
+ for (let i = 0; i < rawHeaders.length; i += 2) {
3815
+ const { [i]: key, [i + 1]: value } = rawHeaders;
3816
+ if (key.charCodeAt(0) !== /*:*/
3817
+ 58) {
3818
+ headerRecord.push([key, value]);
3819
+ }
3820
+ }
3821
+ return new Headers(headerRecord);
3822
+ };
3823
+ var wrapBodyStream = /* @__PURE__ */ Symbol("wrapBodyStream");
3824
+ var newRequestFromIncoming = (method, url, headers, incoming, abortController) => {
3825
+ const init = {
3826
+ method,
3827
+ headers,
3828
+ signal: abortController.signal
3829
+ };
3830
+ if (method === "TRACE") {
3831
+ init.method = "GET";
3832
+ const req = new Request2(url, init);
3833
+ Object.defineProperty(req, "method", {
3834
+ get() {
3835
+ return "TRACE";
3836
+ }
3837
+ });
3838
+ return req;
3839
+ }
3840
+ if (!(method === "GET" || method === "HEAD")) {
3841
+ if ("rawBody" in incoming && incoming.rawBody instanceof Buffer) {
3842
+ init.body = new ReadableStream({
3843
+ start(controller) {
3844
+ controller.enqueue(incoming.rawBody);
3845
+ controller.close();
3846
+ }
3847
+ });
3848
+ } else if (incoming[wrapBodyStream]) {
3849
+ let reader;
3850
+ init.body = new ReadableStream({
3851
+ async pull(controller) {
3852
+ try {
3853
+ reader ||= Readable.toWeb(incoming).getReader();
3854
+ const { done, value } = await reader.read();
3855
+ if (done) {
3856
+ controller.close();
3857
+ } else {
3858
+ controller.enqueue(value);
3859
+ }
3860
+ } catch (error) {
3861
+ controller.error(error);
3862
+ }
3863
+ }
3864
+ });
3865
+ } else {
3866
+ init.body = Readable.toWeb(incoming);
3867
+ }
3868
+ }
3869
+ return new Request2(url, init);
3870
+ };
3871
+ var getRequestCache = /* @__PURE__ */ Symbol("getRequestCache");
3872
+ var requestCache = /* @__PURE__ */ Symbol("requestCache");
3873
+ var incomingKey = /* @__PURE__ */ Symbol("incomingKey");
3874
+ var urlKey = /* @__PURE__ */ Symbol("urlKey");
3875
+ var headersKey = /* @__PURE__ */ Symbol("headersKey");
3876
+ var abortControllerKey = /* @__PURE__ */ Symbol("abortControllerKey");
3877
+ var getAbortController = /* @__PURE__ */ Symbol("getAbortController");
3878
+ var requestPrototype = {
3879
+ get method() {
3880
+ return this[incomingKey].method || "GET";
3881
+ },
3882
+ get url() {
3883
+ return this[urlKey];
3884
+ },
3885
+ get headers() {
3886
+ return this[headersKey] ||= newHeadersFromIncoming(this[incomingKey]);
3887
+ },
3888
+ [getAbortController]() {
3889
+ this[getRequestCache]();
3890
+ return this[abortControllerKey];
3891
+ },
3892
+ [getRequestCache]() {
3893
+ this[abortControllerKey] ||= new AbortController();
3894
+ return this[requestCache] ||= newRequestFromIncoming(
3895
+ this.method,
3896
+ this[urlKey],
3897
+ this.headers,
3898
+ this[incomingKey],
3899
+ this[abortControllerKey]
3900
+ );
3901
+ }
3902
+ };
3903
+ [
3904
+ "body",
3905
+ "bodyUsed",
3906
+ "cache",
3907
+ "credentials",
3908
+ "destination",
3909
+ "integrity",
3910
+ "mode",
3911
+ "redirect",
3912
+ "referrer",
3913
+ "referrerPolicy",
3914
+ "signal",
3915
+ "keepalive"
3916
+ ].forEach((k) => {
3917
+ Object.defineProperty(requestPrototype, k, {
3918
+ get() {
3919
+ return this[getRequestCache]()[k];
3920
+ }
3921
+ });
3922
+ });
3923
+ ["arrayBuffer", "blob", "clone", "formData", "json", "text"].forEach((k) => {
3924
+ Object.defineProperty(requestPrototype, k, {
3925
+ value: function() {
3926
+ return this[getRequestCache]()[k]();
3927
+ }
3928
+ });
3929
+ });
3930
+ Object.setPrototypeOf(requestPrototype, Request2.prototype);
3931
+ var newRequest = (incoming, defaultHostname) => {
3932
+ const req = Object.create(requestPrototype);
3933
+ req[incomingKey] = incoming;
3934
+ const incomingUrl = incoming.url || "";
3935
+ if (incomingUrl[0] !== "/" && // short-circuit for performance. most requests are relative URL.
3936
+ (incomingUrl.startsWith("http://") || incomingUrl.startsWith("https://"))) {
3937
+ if (incoming instanceof Http2ServerRequest) {
3938
+ throw new RequestError("Absolute URL for :path is not allowed in HTTP/2");
3939
+ }
3940
+ try {
3941
+ const url2 = new URL(incomingUrl);
3942
+ req[urlKey] = url2.href;
3943
+ } catch (e) {
3944
+ throw new RequestError("Invalid absolute URL", { cause: e });
3945
+ }
3946
+ return req;
3947
+ }
3948
+ const host = (incoming instanceof Http2ServerRequest ? incoming.authority : incoming.headers.host) || defaultHostname;
3949
+ if (!host) {
3950
+ throw new RequestError("Missing host header");
3951
+ }
3952
+ let scheme;
3953
+ if (incoming instanceof Http2ServerRequest) {
3954
+ scheme = incoming.scheme;
3955
+ if (!(scheme === "http" || scheme === "https")) {
3956
+ throw new RequestError("Unsupported scheme");
3957
+ }
3958
+ } else {
3959
+ scheme = incoming.socket && incoming.socket.encrypted ? "https" : "http";
3960
+ }
3961
+ const url = new URL(`${scheme}://${host}${incomingUrl}`);
3962
+ if (url.hostname.length !== host.length && url.hostname !== host.replace(/:\d+$/, "")) {
3963
+ throw new RequestError("Invalid host header");
3964
+ }
3965
+ req[urlKey] = url.href;
3966
+ return req;
3967
+ };
3968
+ var responseCache = /* @__PURE__ */ Symbol("responseCache");
3969
+ var getResponseCache = /* @__PURE__ */ Symbol("getResponseCache");
3970
+ var cacheKey = /* @__PURE__ */ Symbol("cache");
3971
+ var GlobalResponse = global.Response;
3972
+ var Response2 = class _Response {
3973
+ #body;
3974
+ #init;
3975
+ [getResponseCache]() {
3976
+ delete this[cacheKey];
3977
+ return this[responseCache] ||= new GlobalResponse(this.#body, this.#init);
3978
+ }
3979
+ constructor(body, init) {
3980
+ let headers;
3981
+ this.#body = body;
3982
+ if (init instanceof _Response) {
3983
+ const cachedGlobalResponse = init[responseCache];
3984
+ if (cachedGlobalResponse) {
3985
+ this.#init = cachedGlobalResponse;
3986
+ this[getResponseCache]();
3987
+ return;
3988
+ } else {
3989
+ this.#init = init.#init;
3990
+ headers = new Headers(init.#init.headers);
3991
+ }
3992
+ } else {
3993
+ this.#init = init;
3994
+ }
3995
+ if (typeof body === "string" || typeof body?.getReader !== "undefined" || body instanceof Blob || body instanceof Uint8Array) {
3996
+ ;
3997
+ this[cacheKey] = [init?.status || 200, body, headers || init?.headers];
3998
+ }
3999
+ }
4000
+ get headers() {
4001
+ const cache = this[cacheKey];
4002
+ if (cache) {
4003
+ if (!(cache[2] instanceof Headers)) {
4004
+ cache[2] = new Headers(
4005
+ cache[2] || { "content-type": "text/plain; charset=UTF-8" }
4006
+ );
4007
+ }
4008
+ return cache[2];
4009
+ }
4010
+ return this[getResponseCache]().headers;
4011
+ }
4012
+ get status() {
4013
+ return this[cacheKey]?.[0] ?? this[getResponseCache]().status;
4014
+ }
4015
+ get ok() {
4016
+ const status = this.status;
4017
+ return status >= 200 && status < 300;
4018
+ }
4019
+ };
4020
+ ["body", "bodyUsed", "redirected", "statusText", "trailers", "type", "url"].forEach((k) => {
4021
+ Object.defineProperty(Response2.prototype, k, {
4022
+ get() {
4023
+ return this[getResponseCache]()[k];
4024
+ }
4025
+ });
4026
+ });
4027
+ ["arrayBuffer", "blob", "clone", "formData", "json", "text"].forEach((k) => {
4028
+ Object.defineProperty(Response2.prototype, k, {
4029
+ value: function() {
4030
+ return this[getResponseCache]()[k]();
4031
+ }
4032
+ });
4033
+ });
4034
+ Object.setPrototypeOf(Response2, GlobalResponse);
4035
+ Object.setPrototypeOf(Response2.prototype, GlobalResponse.prototype);
4036
+ async function readWithoutBlocking(readPromise) {
4037
+ return Promise.race([readPromise, Promise.resolve().then(() => Promise.resolve(void 0))]);
4038
+ }
4039
+ function writeFromReadableStreamDefaultReader(reader, writable, currentReadPromise) {
4040
+ const cancel = (error) => {
4041
+ reader.cancel(error).catch(() => {
4042
+ });
4043
+ };
4044
+ writable.on("close", cancel);
4045
+ writable.on("error", cancel);
4046
+ (currentReadPromise ?? reader.read()).then(flow, handleStreamError);
4047
+ return reader.closed.finally(() => {
4048
+ writable.off("close", cancel);
4049
+ writable.off("error", cancel);
4050
+ });
4051
+ function handleStreamError(error) {
4052
+ if (error) {
4053
+ writable.destroy(error);
4054
+ }
4055
+ }
4056
+ function onDrain() {
4057
+ reader.read().then(flow, handleStreamError);
4058
+ }
4059
+ function flow({ done, value }) {
4060
+ try {
4061
+ if (done) {
4062
+ writable.end();
4063
+ } else if (!writable.write(value)) {
4064
+ writable.once("drain", onDrain);
4065
+ } else {
4066
+ return reader.read().then(flow, handleStreamError);
4067
+ }
4068
+ } catch (e) {
4069
+ handleStreamError(e);
4070
+ }
4071
+ }
4072
+ }
4073
+ function writeFromReadableStream(stream, writable) {
4074
+ if (stream.locked) {
4075
+ throw new TypeError("ReadableStream is locked.");
4076
+ } else if (writable.destroyed) {
4077
+ return;
4078
+ }
4079
+ return writeFromReadableStreamDefaultReader(stream.getReader(), writable);
4080
+ }
4081
+ var buildOutgoingHttpHeaders = (headers) => {
4082
+ const res = {};
4083
+ if (!(headers instanceof Headers)) {
4084
+ headers = new Headers(headers ?? void 0);
4085
+ }
4086
+ const cookies = [];
4087
+ for (const [k, v] of headers) {
4088
+ if (k === "set-cookie") {
4089
+ cookies.push(v);
4090
+ } else {
4091
+ res[k] = v;
4092
+ }
4093
+ }
4094
+ if (cookies.length > 0) {
4095
+ res["set-cookie"] = cookies;
4096
+ }
4097
+ res["content-type"] ??= "text/plain; charset=UTF-8";
4098
+ return res;
4099
+ };
4100
+ var X_ALREADY_SENT = "x-hono-already-sent";
4101
+ if (typeof global.crypto === "undefined") {
4102
+ global.crypto = crypto;
4103
+ }
4104
+ var outgoingEnded = /* @__PURE__ */ Symbol("outgoingEnded");
4105
+ var handleRequestError = () => new Response(null, {
4106
+ status: 400
4107
+ });
4108
+ var handleFetchError = (e) => new Response(null, {
4109
+ status: e instanceof Error && (e.name === "TimeoutError" || e.constructor.name === "TimeoutError") ? 504 : 500
4110
+ });
4111
+ var handleResponseError = (e, outgoing) => {
4112
+ const err = e instanceof Error ? e : new Error("unknown error", { cause: e });
4113
+ if (err.code === "ERR_STREAM_PREMATURE_CLOSE") {
4114
+ console.info("The user aborted a request.");
4115
+ } else {
4116
+ console.error(e);
4117
+ if (!outgoing.headersSent) {
4118
+ outgoing.writeHead(500, { "Content-Type": "text/plain" });
4119
+ }
4120
+ outgoing.end(`Error: ${err.message}`);
4121
+ outgoing.destroy(err);
4122
+ }
4123
+ };
4124
+ var flushHeaders = (outgoing) => {
4125
+ if ("flushHeaders" in outgoing && outgoing.writable) {
4126
+ outgoing.flushHeaders();
4127
+ }
4128
+ };
4129
+ var responseViaCache = async (res, outgoing) => {
4130
+ let [status, body, header] = res[cacheKey];
4131
+ let hasContentLength = false;
4132
+ if (!header) {
4133
+ header = { "content-type": "text/plain; charset=UTF-8" };
4134
+ } else if (header instanceof Headers) {
4135
+ hasContentLength = header.has("content-length");
4136
+ header = buildOutgoingHttpHeaders(header);
4137
+ } else if (Array.isArray(header)) {
4138
+ const headerObj = new Headers(header);
4139
+ hasContentLength = headerObj.has("content-length");
4140
+ header = buildOutgoingHttpHeaders(headerObj);
4141
+ } else {
4142
+ for (const key in header) {
4143
+ if (key.length === 14 && key.toLowerCase() === "content-length") {
4144
+ hasContentLength = true;
4145
+ break;
4146
+ }
4147
+ }
4148
+ }
4149
+ if (!hasContentLength) {
4150
+ if (typeof body === "string") {
4151
+ header["Content-Length"] = Buffer.byteLength(body);
4152
+ } else if (body instanceof Uint8Array) {
4153
+ header["Content-Length"] = body.byteLength;
4154
+ } else if (body instanceof Blob) {
4155
+ header["Content-Length"] = body.size;
4156
+ }
4157
+ }
4158
+ outgoing.writeHead(status, header);
4159
+ if (typeof body === "string" || body instanceof Uint8Array) {
4160
+ outgoing.end(body);
4161
+ } else if (body instanceof Blob) {
4162
+ outgoing.end(new Uint8Array(await body.arrayBuffer()));
4163
+ } else {
4164
+ flushHeaders(outgoing);
4165
+ await writeFromReadableStream(body, outgoing)?.catch(
4166
+ (e) => handleResponseError(e, outgoing)
4167
+ );
4168
+ }
4169
+ ;
4170
+ outgoing[outgoingEnded]?.();
4171
+ };
4172
+ var isPromise = (res) => typeof res.then === "function";
4173
+ var responseViaResponseObject = async (res, outgoing, options = {}) => {
4174
+ if (isPromise(res)) {
4175
+ if (options.errorHandler) {
4176
+ try {
4177
+ res = await res;
4178
+ } catch (err) {
4179
+ const errRes = await options.errorHandler(err);
4180
+ if (!errRes) {
4181
+ return;
4182
+ }
4183
+ res = errRes;
4184
+ }
4185
+ } else {
4186
+ res = await res.catch(handleFetchError);
4187
+ }
4188
+ }
4189
+ if (cacheKey in res) {
4190
+ return responseViaCache(res, outgoing);
4191
+ }
4192
+ const resHeaderRecord = buildOutgoingHttpHeaders(res.headers);
4193
+ if (res.body) {
4194
+ const reader = res.body.getReader();
4195
+ const values = [];
4196
+ let done = false;
4197
+ let currentReadPromise = void 0;
4198
+ if (resHeaderRecord["transfer-encoding"] !== "chunked") {
4199
+ let maxReadCount = 2;
4200
+ for (let i = 0; i < maxReadCount; i++) {
4201
+ currentReadPromise ||= reader.read();
4202
+ const chunk = await readWithoutBlocking(currentReadPromise).catch((e) => {
4203
+ console.error(e);
4204
+ done = true;
4205
+ });
4206
+ if (!chunk) {
4207
+ if (i === 1) {
4208
+ await new Promise((resolve4) => setTimeout(resolve4));
4209
+ maxReadCount = 3;
4210
+ continue;
4211
+ }
4212
+ break;
4213
+ }
4214
+ currentReadPromise = void 0;
4215
+ if (chunk.value) {
4216
+ values.push(chunk.value);
4217
+ }
4218
+ if (chunk.done) {
4219
+ done = true;
4220
+ break;
4221
+ }
4222
+ }
4223
+ if (done && !("content-length" in resHeaderRecord)) {
4224
+ resHeaderRecord["content-length"] = values.reduce((acc, value) => acc + value.length, 0);
4225
+ }
4226
+ }
4227
+ outgoing.writeHead(res.status, resHeaderRecord);
4228
+ values.forEach((value) => {
4229
+ ;
4230
+ outgoing.write(value);
4231
+ });
4232
+ if (done) {
4233
+ outgoing.end();
4234
+ } else {
4235
+ if (values.length === 0) {
4236
+ flushHeaders(outgoing);
4237
+ }
4238
+ await writeFromReadableStreamDefaultReader(reader, outgoing, currentReadPromise);
4239
+ }
4240
+ } else if (resHeaderRecord[X_ALREADY_SENT]) {
4241
+ } else {
4242
+ outgoing.writeHead(res.status, resHeaderRecord);
4243
+ outgoing.end();
4244
+ }
4245
+ ;
4246
+ outgoing[outgoingEnded]?.();
4247
+ };
4248
+ var getRequestListener = (fetchCallback, options = {}) => {
4249
+ const autoCleanupIncoming = options.autoCleanupIncoming ?? true;
4250
+ if (options.overrideGlobalObjects !== false && global.Request !== Request2) {
4251
+ Object.defineProperty(global, "Request", {
4252
+ value: Request2
4253
+ });
4254
+ Object.defineProperty(global, "Response", {
4255
+ value: Response2
4256
+ });
4257
+ }
4258
+ return async (incoming, outgoing) => {
4259
+ let res, req;
4260
+ try {
4261
+ req = newRequest(incoming, options.hostname);
4262
+ let incomingEnded = !autoCleanupIncoming || incoming.method === "GET" || incoming.method === "HEAD";
4263
+ if (!incomingEnded) {
4264
+ ;
4265
+ incoming[wrapBodyStream] = true;
4266
+ incoming.on("end", () => {
4267
+ incomingEnded = true;
4268
+ });
4269
+ if (incoming instanceof Http2ServerRequest2) {
4270
+ ;
4271
+ outgoing[outgoingEnded] = () => {
4272
+ if (!incomingEnded) {
4273
+ setTimeout(() => {
4274
+ if (!incomingEnded) {
4275
+ setTimeout(() => {
4276
+ incoming.destroy();
4277
+ outgoing.destroy();
4278
+ });
4279
+ }
4280
+ });
4281
+ }
4282
+ };
4283
+ }
4284
+ }
4285
+ outgoing.on("close", () => {
4286
+ const abortController = req[abortControllerKey];
4287
+ if (abortController) {
4288
+ if (incoming.errored) {
4289
+ req[abortControllerKey].abort(incoming.errored.toString());
4290
+ } else if (!outgoing.writableFinished) {
4291
+ req[abortControllerKey].abort("Client connection prematurely closed.");
4292
+ }
4293
+ }
4294
+ if (!incomingEnded) {
4295
+ setTimeout(() => {
4296
+ if (!incomingEnded) {
4297
+ setTimeout(() => {
4298
+ incoming.destroy();
4299
+ });
4300
+ }
4301
+ });
4302
+ }
4303
+ });
4304
+ res = fetchCallback(req, { incoming, outgoing });
4305
+ if (cacheKey in res) {
4306
+ return responseViaCache(res, outgoing);
4307
+ }
4308
+ } catch (e) {
4309
+ if (!res) {
4310
+ if (options.errorHandler) {
4311
+ res = await options.errorHandler(req ? e : toRequestError(e));
4312
+ if (!res) {
4313
+ return;
4314
+ }
4315
+ } else if (!req) {
4316
+ res = handleRequestError();
4317
+ } else {
4318
+ res = handleFetchError(e);
4319
+ }
4320
+ } else {
4321
+ return handleResponseError(e, outgoing);
4322
+ }
4323
+ }
4324
+ try {
4325
+ return await responseViaResponseObject(res, outgoing, options);
4326
+ } catch (e) {
4327
+ return handleResponseError(e, outgoing);
4328
+ }
4329
+ };
4330
+ };
4331
+ var createAdaptorServer = (options) => {
4332
+ const fetchCallback = options.fetch;
4333
+ const requestListener = getRequestListener(fetchCallback, {
4334
+ hostname: options.hostname,
4335
+ overrideGlobalObjects: options.overrideGlobalObjects,
4336
+ autoCleanupIncoming: options.autoCleanupIncoming
4337
+ });
4338
+ const createServer = options.createServer || createServerHTTP;
4339
+ const server = createServer(options.serverOptions || {}, requestListener);
4340
+ return server;
4341
+ };
4342
+ var serve = (options, listeningListener) => {
4343
+ const server = createAdaptorServer(options);
4344
+ server.listen(options?.port ?? 3e3, options.hostname, () => {
4345
+ const serverInfo = server.address();
4346
+ listeningListener && listeningListener(serverInfo);
4347
+ });
4348
+ return server;
4349
+ };
4350
+
4351
+ // app/lib/vnc-logger.ts
4352
+ init_paths();
4353
+ import { appendFileSync, mkdirSync } from "fs";
4354
+ import { resolve } from "path";
4355
+ var VNC_LOG_FILE = resolve(LOG_DIR, "vnc-boot.log");
4356
+ try {
4357
+ mkdirSync(LOG_DIR, { recursive: true });
4358
+ } catch (err) {
4359
+ console.error(`[vnc-log-fail] mkdir ${LOG_DIR} failed: ${err.message}`);
4360
+ }
4361
+ function vncLog(phase, fields = {}) {
4362
+ const ts = (/* @__PURE__ */ new Date()).toISOString();
4363
+ const kv = Object.entries(fields).map(([k, v]) => `${k}=${JSON.stringify(v)}`).join(" ");
4364
+ const line = kv.length > 0 ? `[${ts}] [${phase}] ${kv}
4365
+ ` : `[${ts}] [${phase}]
4366
+ `;
4367
+ try {
4368
+ appendFileSync(VNC_LOG_FILE, line);
4369
+ } catch (err) {
4370
+ console.error(`[vnc-log-fail] ${err.message} \u2014 dropped: ${line.slice(0, 300).trim()}`);
4371
+ }
4372
+ }
4373
+ var corrCounter = 0;
4374
+ function newCorrId() {
4375
+ corrCounter = corrCounter + 1 & 4294967295;
4376
+ const counterHex = corrCounter.toString(16).padStart(8, "0");
4377
+ const randomHex = Math.floor(Math.random() * 16777215).toString(16).padStart(6, "0");
4378
+ return `${counterHex}-${randomHex}`;
4379
+ }
4380
+ function sanitizeClientCorrId(raw2) {
4381
+ if (!raw2) return null;
4382
+ if (raw2.length > 32) return null;
4383
+ if (!/^[A-Za-z0-9_-]+$/.test(raw2)) return null;
4384
+ return raw2;
4385
+ }
4386
+ function formatKv(fields) {
4387
+ return Object.entries(fields).filter(([, v]) => v !== void 0).map(([k, v]) => `${k}=${JSON.stringify(v)}`).join(" ");
4388
+ }
4389
+ function httpLog(fields) {
4390
+ console.error(`[http] ${formatKv(fields)}`);
4391
+ }
4392
+ function websockifyLog(event, fields = {}) {
4393
+ console.error(`[websockify] ${formatKv({ event, ...fields })}`);
4394
+ }
4395
+
4396
+ // app/lib/agent-slug-pattern.ts
4397
+ var AGENT_SLUG_PATTERN = /^\/([a-z][a-z0-9-]{2,49})$/;
4398
+
4399
+ // server/public-host-gate.ts
4400
+ var PUBLIC_ALLOWED_PREFIXES = [
4401
+ "/api/session",
4402
+ "/api/chat",
4403
+ // Task 873 — the detooled public surface's visitor-authed reader (pointer +
4404
+ // server-filtered SSE stream). Reached by the visitor browser on the public
4405
+ // host; authenticated by the __access_session grant inside the route.
4406
+ "/api/public-reader/",
4407
+ "/api/access/",
4408
+ "/api/health",
4409
+ // Public free/busy for the booking page. Open slots only, no :Meeting detail
4410
+ // (server/routes/calendar-public.ts). Admitted on public hosts; on the brand
4411
+ // host the remote-auth gate bypasses the same path (server/index.ts).
4412
+ "/api/calendar/free-busy",
4413
+ "/api/telegram/",
4414
+ // Task 1881 — the data portal's device-held-file fetch. Reached by the edge
4415
+ // Pages Function's signed HEAD/GET probe on the public host; authenticated by
4416
+ // the per-account HMAC signature the route re-verifies (portal-fetch.ts), not
4417
+ // the remote-auth gate. Pointing PORTAL_INSTALL_ORIGIN at the admin host
4418
+ // instead made every download 503 (remote-auth-required on the probe).
4419
+ "/api/portal/fetch",
4420
+ // QuickBooks OAuth consent callback. Intuit redirects the operator's browser
4421
+ // here with no admin cookie; the route authenticates by validating the OAuth
4422
+ // `state` nonce, not the remote-auth gate (same model as /api/telegram/).
4423
+ "/api/quickbooks/",
4424
+ // Task 2502 — the dispatch field job sheet's API. Reached by a worker's phone
4425
+ // inside Telegram's webview, which holds no admin cookie and can never obtain
4426
+ // one; the route verifies the Telegram initData signature itself
4427
+ // (server/routes/field.ts), the same request-borne-auth model as
4428
+ // /api/telegram/ above. Both gates need the entry: this one admits it on a
4429
+ // public host, and isRemoteAuthBypassPath in app/lib/auth-gate.ts admits it on
4430
+ // the brand host. Listing it in only one makes the sheet reachable on whichever
4431
+ // host the operator happened to point the menu button at, and dead on the
4432
+ // other. __tests__/field-gates-agree.test.ts asserts they stay in step.
4433
+ "/api/field/",
4434
+ "/assets/",
4435
+ "/brand/",
4436
+ "/agent-assets/",
4437
+ "/generated/",
4438
+ "/g/",
4439
+ "/sites/"
4440
+ ];
4441
+ var PUBLIC_ALLOWED_EXACT = [
4442
+ "/favicon.ico",
4443
+ "/brand-defaults.css",
4444
+ // Task 2502 — the field job sheet's document. Exact rather than a prefix: the
4445
+ // page is one path and carries no dispatch data of its own, so nothing below
4446
+ // it needs admitting. Its bundle already arrives through /assets/.
4447
+ "/field"
4448
+ ];
4449
+ function isPublicPathAllowed(path) {
4450
+ if (path === "/") return true;
4451
+ if (PUBLIC_ALLOWED_EXACT.includes(path)) return true;
4452
+ if (PUBLIC_ALLOWED_PREFIXES.some((prefix) => path.startsWith(prefix))) return true;
4453
+ return AGENT_SLUG_PATTERN.test(path);
4454
+ }
4455
+ function isOperatorHost(host, operatorDomains2) {
4456
+ return operatorDomains2.has(host);
4457
+ }
4458
+ function classifyHost(host, operatorDomains2, isPublicHost) {
4459
+ if (operatorDomains2.has(host)) return "operator";
4460
+ if (isPublicHost(host)) return "public";
4461
+ return "admin";
4462
+ }
4463
+
4464
+ // server/operator-domains-reader.ts
4465
+ import { watchFile } from "fs";
4466
+
4467
+ // app/lib/operator-domains.ts
4468
+ init_paths();
4469
+ import { existsSync as existsSync2, mkdirSync as mkdirSync4, readFileSync as readFileSync3, writeFileSync as writeFileSync3 } from "fs";
4470
+ import { dirname as dirname3, resolve as resolve2 } from "path";
4471
+ var OPERATOR_DOMAINS_PATH = resolve2(MAXY_DIR, "operator-domains.json");
4472
+ function loadOperatorDomains() {
4473
+ if (!existsSync2(OPERATOR_DOMAINS_PATH)) return /* @__PURE__ */ new Set();
4474
+ try {
4475
+ const parsed = JSON.parse(readFileSync3(OPERATOR_DOMAINS_PATH, "utf-8"));
4476
+ if (!Array.isArray(parsed)) return /* @__PURE__ */ new Set();
4477
+ return new Set(parsed.filter((h) => typeof h === "string"));
4478
+ } catch {
4479
+ return /* @__PURE__ */ new Set();
4480
+ }
4481
+ }
4482
+
4483
+ // server/operator-domains-reader.ts
4484
+ var operatorDomains = loadOperatorDomains();
4485
+ if (operatorDomains.size > 0) {
4486
+ console.log(
4487
+ `[operator-domains] loaded ${operatorDomains.size} operator domain(s): ${[...operatorDomains].join(", ")}`
4488
+ );
4489
+ }
4490
+ watchFile(OPERATOR_DOMAINS_PATH, { interval: 2e3 }, () => {
4491
+ operatorDomains = loadOperatorDomains();
4492
+ console.log(
4493
+ `[operator-domains] reloaded ${operatorDomains.size} operator domain(s): ${[...operatorDomains].join(", ")}`
4494
+ );
4495
+ });
4496
+ function getOperatorDomains() {
4497
+ return operatorDomains;
4498
+ }
4499
+
4500
+ // app/lib/cdp-screencast.ts
4501
+ var CDP_WS_PATH = "/cdp-screencast";
4502
+ var TARGET_ID_RE = /^[0-9A-Fa-f]{32}$/;
4503
+ function selectPageTargets(parsed) {
4504
+ if (!Array.isArray(parsed)) return [];
4505
+ const out = [];
4506
+ for (const raw2 of parsed) {
4507
+ if (raw2?.type !== "page") continue;
4508
+ const id = typeof raw2.id === "string" ? raw2.id : "";
4509
+ if (!TARGET_ID_RE.test(id)) continue;
4510
+ const url = typeof raw2.url === "string" ? raw2.url : "";
4511
+ const title = typeof raw2.title === "string" && raw2.title.length > 0 ? raw2.title : url;
4512
+ out.push({ id, title, url });
4513
+ }
4514
+ return out;
4515
+ }
4516
+ var CLIENT_SCREENCAST_OPS = [
4517
+ "request",
4518
+ "screencast-started",
4519
+ "start-failed",
4520
+ "send-failed",
4521
+ "frame",
4522
+ "input",
4523
+ "teardown",
4524
+ // Task 2264 — the chrome's own ops. They belong on this side of the allowlist
4525
+ // because each is an action the browser observes itself taking, not a decision
4526
+ // the server made; admitting them cannot let a client forge a security line.
4527
+ "navigate",
4528
+ "history",
4529
+ "chrome-mounted"
4530
+ ];
4531
+ function isClientScreencastOp(v) {
4532
+ return typeof v === "string" && CLIENT_SCREENCAST_OPS.includes(v);
4533
+ }
4534
+
4535
+ // app/lib/cdp-screencast-server.ts
4536
+ var HOP_BY_HOP = /* @__PURE__ */ new Set([
4537
+ "connection",
4538
+ "keep-alive",
4539
+ "proxy-authenticate",
4540
+ "proxy-authorization",
4541
+ "te",
4542
+ "trailer",
4543
+ "transfer-encoding",
4544
+ "upgrade"
4545
+ ]);
4546
+ var DROP_UPSTREAM = /* @__PURE__ */ new Set(["origin", "cookie"]);
4547
+ function decideCdpUpgrade(input) {
4548
+ const corrId = newCorrId();
4549
+ const qsIndex = input.url.indexOf("?");
4550
+ const pathname = qsIndex === -1 ? input.url : input.url.slice(0, qsIndex);
4551
+ const query = qsIndex === -1 ? "" : input.url.slice(qsIndex + 1);
4552
+ const sid = sanitizeClientCorrId(parseQueryParam(query, "sid"));
4553
+ if (pathname !== CDP_WS_PATH) {
4554
+ return { allow: false, reason: "wrong-path", status: 0, sid, corrId };
4555
+ }
4556
+ const access = input.canAccess({
4557
+ host: input.host,
4558
+ remoteAddress: input.remoteAddress,
4559
+ xForwardedFor: input.xForwardedFor,
4560
+ cookieHeader: input.cookieHeader,
4561
+ isPublicHost: input.isPublicHost
4562
+ });
4563
+ if (!access.allow) {
4564
+ const publicHost = access.reason === "public-host";
4565
+ return {
4566
+ allow: false,
4567
+ reason: publicHost ? "public-host" : "unauthorized",
4568
+ status: publicHost ? 404 : 401,
4569
+ sid,
4570
+ corrId
4571
+ };
4572
+ }
4573
+ const originHost = parseOriginHost(input.origin);
4574
+ if (!originHost) {
4575
+ return { allow: false, reason: "origin-missing-or-invalid", status: 403, sid, corrId };
4576
+ }
4577
+ if (originHost !== input.host) {
4578
+ return { allow: false, reason: "origin-mismatch", status: 403, sid, corrId };
4579
+ }
4580
+ if (input.isPublicHost(originHost)) {
4581
+ return { allow: false, reason: "origin-public-host", status: 403, sid, corrId };
4582
+ }
4583
+ if (input.isOperatorHost(originHost)) {
4584
+ return { allow: false, reason: "origin-operator-host", status: 403, sid, corrId };
4585
+ }
4586
+ const targetId = parseQueryParam(query, "targetId");
4587
+ if (!targetId || !TARGET_ID_RE.test(targetId)) {
4588
+ return { allow: false, reason: "target-id-invalid", status: 400, sid, corrId };
4589
+ }
4590
+ return { allow: true, targetId, sid, corrId };
4591
+ }
4592
+ function buildCdpUpstreamRequest(input) {
4593
+ const lines = [];
4594
+ lines.push(`${input.method} /devtools/page/${input.targetId} HTTP/${input.httpVersion}`);
4595
+ lines.push(`host: ${input.upstreamHost}:${input.upstreamPort}`);
4596
+ for (const [rawName, value] of Object.entries(input.headers)) {
4597
+ const name = rawName.toLowerCase();
4598
+ if (name === "host") continue;
4599
+ if (HOP_BY_HOP.has(name)) continue;
4600
+ if (DROP_UPSTREAM.has(name)) continue;
4601
+ if (value == null) continue;
4602
+ if (Array.isArray(value)) {
4603
+ for (const v of value) lines.push(`${name}: ${v}`);
4604
+ } else {
4605
+ lines.push(`${name}: ${value}`);
4606
+ }
4607
+ }
4608
+ const upgrade = headerString(input.headers.upgrade);
4609
+ const connection = headerString(input.headers.connection);
4610
+ if (upgrade) lines.push(`upgrade: ${upgrade}`);
4611
+ if (connection) lines.push(`connection: ${connection}`);
4612
+ return lines.join("\r\n") + "\r\n\r\n";
4613
+ }
4614
+ async function fetchPageTargets(deps) {
4615
+ if (deps.platform !== "linux") {
4616
+ return {
4617
+ ok: false,
4618
+ status: 501,
4619
+ error: "The device browser is available on the Linux display stack only."
4620
+ };
4621
+ }
4622
+ let res;
4623
+ try {
4624
+ res = await deps.fetchImpl(`http://127.0.0.1:${deps.cdpPort}/json/list`, {
4625
+ signal: AbortSignal.timeout(5e3)
4626
+ });
4627
+ } catch {
4628
+ return { ok: false, status: 502, error: "Chromium is not reachable on this device." };
4629
+ }
4630
+ if (!res.ok) {
4631
+ return { ok: false, status: 502, error: `CDP /json/list returned ${res.status}` };
4632
+ }
4633
+ let parsed;
4634
+ try {
4635
+ parsed = await res.json();
4636
+ } catch {
4637
+ return { ok: false, status: 502, error: "CDP /json/list response was not JSON." };
4638
+ }
4639
+ return { ok: true, targets: selectPageTargets(parsed) };
4640
+ }
4641
+ var EVENT_DETAIL_KEYS = [
4642
+ "seq",
4643
+ "kind",
4644
+ "count",
4645
+ "format",
4646
+ "everyNthFrame",
4647
+ "stopSent",
4648
+ "ackMs",
4649
+ "err",
4650
+ "method",
4651
+ // Task 2264 — `host` is the navigate target's HOST ONLY. A full URL is the
4652
+ // operator's private browsing and server.log is not the place for it, which is
4653
+ // why the client sends the host rather than the log line truncating one.
4654
+ // `surface` and `chrome` carry the mount marker that detects a stale bundle.
4655
+ "host",
4656
+ "dir",
4657
+ "outcome",
4658
+ "surface",
4659
+ "chrome"
4660
+ ];
4661
+ var DETAIL_MAX_LEN = 128;
4662
+ function parseScreencastEvent(body) {
4663
+ if (typeof body !== "object" || body === null) return { ok: false };
4664
+ const raw2 = body;
4665
+ if (!isClientScreencastOp(raw2.op)) return { ok: false };
4666
+ const detail = {
4667
+ sid: sanitizeClientCorrId(typeof raw2.sid === "string" ? raw2.sid : null)
4668
+ };
4669
+ for (const key of EVENT_DETAIL_KEYS) {
4670
+ const v = raw2[key];
4671
+ if (typeof v === "number" || typeof v === "boolean") {
4672
+ detail[key] = v;
4673
+ } else if (typeof v === "string") {
4674
+ detail[key] = sanitizeLogValue(v);
4675
+ }
4676
+ }
4677
+ return { ok: true, op: raw2.op, detail };
4678
+ }
4679
+ function sanitizeLogValue(v) {
4680
+ return v.replace(/[\r\n]+/g, " ").slice(0, DETAIL_MAX_LEN);
4681
+ }
4682
+ function renderFields(fields) {
4683
+ return Object.entries(fields).filter(([, v]) => v !== void 0).map(([k, v]) => {
4684
+ const s = v === null ? "null" : String(v);
4685
+ return `${k}=${sanitizeLogValue(s)}`;
4686
+ }).join(" ");
4687
+ }
4688
+ function screencastLog(op, fields = {}) {
4689
+ const rendered = renderFields(fields);
4690
+ console.error(`[browser/screencast] op=${sanitizeLogValue(op)}${rendered ? " " + rendered : ""}`);
4691
+ }
4692
+ function cdpWsCensusLog(fields) {
4693
+ console.error(`[cdp-ws-census] ${renderFields(fields)}`);
4694
+ }
4695
+ function parseQueryParam(query, key) {
4696
+ if (!query) return null;
4697
+ for (const pair of query.split("&")) {
4698
+ const eq = pair.indexOf("=");
4699
+ const k = eq === -1 ? pair : pair.slice(0, eq);
4700
+ if (k !== key) continue;
4701
+ const v = eq === -1 ? "" : pair.slice(eq + 1);
4702
+ try {
4703
+ return decodeURIComponent(v);
4704
+ } catch {
4705
+ return null;
4706
+ }
4707
+ }
4708
+ return null;
4709
+ }
4710
+ function headerString(value) {
4711
+ if (value == null) return void 0;
4712
+ return Array.isArray(value) ? value[0] : value;
4713
+ }
4714
+ function parseOriginHost(origin) {
4715
+ if (!origin) return null;
4716
+ try {
4717
+ return new URL(origin).hostname;
4718
+ } catch {
4719
+ return null;
4720
+ }
4721
+ }
4722
+ function tabsLog(op, fields = {}) {
4723
+ const rendered = renderFields(fields);
4724
+ console.error(`[admin/browser/tabs] op=${sanitizeLogValue(op)}${rendered ? " " + rendered : ""}`);
4725
+ }
4726
+ async function createPageTarget(deps) {
4727
+ if (deps.platform !== "linux") {
4728
+ return { ok: false, status: 501, error: "The device browser is available on the Linux display stack only." };
4729
+ }
4730
+ let res;
4731
+ try {
4732
+ res = await deps.fetchImpl(`http://127.0.0.1:${deps.cdpPort}/json/new`, {
4733
+ method: "PUT",
4734
+ signal: AbortSignal.timeout(5e3)
4735
+ });
4736
+ } catch {
4737
+ return { ok: false, status: 502, error: "Chromium is not reachable on this device." };
4738
+ }
4739
+ if (!res.ok) return { ok: false, status: 502, error: `CDP /json/new returned ${res.status}` };
4740
+ let parsed;
4741
+ try {
4742
+ parsed = await res.json();
4743
+ } catch {
4744
+ return { ok: false, status: 502, error: "CDP /json/new response was not JSON." };
4745
+ }
4746
+ const id = typeof parsed.id === "string" ? parsed.id : "";
4747
+ if (!TARGET_ID_RE.test(id)) {
4748
+ return { ok: false, status: 502, error: "CDP /json/new returned no usable target id." };
4749
+ }
4750
+ return { ok: true, id };
4751
+ }
4752
+ async function closePageTarget(deps, targetId) {
4753
+ if (deps.platform !== "linux") {
4754
+ return { ok: false, status: 501, error: "The device browser is available on the Linux display stack only." };
4755
+ }
4756
+ if (!TARGET_ID_RE.test(targetId)) {
4757
+ return { ok: false, status: 400, error: "Not a target id." };
4758
+ }
4759
+ let res;
4760
+ try {
4761
+ res = await deps.fetchImpl(`http://127.0.0.1:${deps.cdpPort}/json/close/${targetId}`, {
4762
+ method: "PUT",
4763
+ signal: AbortSignal.timeout(5e3)
4764
+ });
4765
+ } catch {
4766
+ return { ok: false, status: 502, error: "Chromium is not reachable on this device." };
4767
+ }
4768
+ if (!res.ok) return { ok: false, status: 502, error: `CDP /json/close returned ${res.status}` };
4769
+ return { ok: true };
4770
+ }
4771
+
4772
+ export {
4773
+ HTTPException,
4774
+ init_http_exception,
4775
+ HtmlEscapedCallbackPhase,
4776
+ resolveCallback,
4777
+ init_html,
4778
+ init_context,
4779
+ Hono2 as Hono,
4780
+ init_dist,
4781
+ getRequestListener,
4782
+ serve,
4783
+ requirePortEnv,
4784
+ init_src,
4785
+ fingerprintSessionKey,
4786
+ registerSession,
4787
+ validateSession,
4788
+ getAccountIdForSession,
4789
+ getUserIdForSession,
4790
+ getUserNameForSession,
4791
+ getRoleForSession,
4792
+ getSessionIdForSession,
4793
+ setSessionIdForSession,
4794
+ setWantsPriorConversation,
4795
+ unregisterSession,
4796
+ getSessionKeyBySessionId,
4797
+ init_session_store,
4798
+ vncLog,
4799
+ newCorrId,
4800
+ sanitizeClientCorrId,
4801
+ httpLog,
4802
+ websockifyLog,
4803
+ setAccessPassword,
4804
+ accessPasswordCollides,
4805
+ migrateLegacyRemotePassword,
4806
+ init_src2,
4807
+ validatePasswordStrength,
4808
+ isPasswordValid,
4809
+ isRemoteAuthConfigured,
4810
+ setRemotePassword,
4811
+ verifyRemotePassword,
4812
+ createRemoteSession,
4813
+ describeRemoteSession,
4814
+ resolveClientIp,
4815
+ checkRateLimit,
4816
+ recordFailedAttempt,
4817
+ clearRateLimit,
4818
+ renderLoginPage,
4819
+ init_remote_auth,
4820
+ PWA_SURFACES,
4821
+ MANIFEST_CONTENT_TYPE,
4822
+ SW_CONTENT_TYPE,
4823
+ pwaSurfaceForShell,
4824
+ buildManifest,
4825
+ pwaHeadTags,
4826
+ pwaCensus,
4827
+ init_pwa,
4828
+ canAccessAdmin,
4829
+ parseCookieValue,
4830
+ isApiRequestPath,
4831
+ isRemoteAuthBypassPath,
4832
+ init_auth_gate,
4833
+ AGENT_SLUG_PATTERN,
4834
+ PUBLIC_ALLOWED_PREFIXES,
4835
+ PUBLIC_ALLOWED_EXACT,
4836
+ isPublicPathAllowed,
4837
+ isOperatorHost,
4838
+ classifyHost,
4839
+ getOperatorDomains,
4840
+ findMissingPlugins,
4841
+ walkPremiumBundles,
4842
+ autoDeliverPremiumPlugins,
4843
+ reconcileEnabledPluginsForAccounts,
4844
+ cleanupLeakedPremiumSubs,
4845
+ init_plugin_manifest,
4846
+ emitMissingOnResolve,
4847
+ init_logging,
4848
+ stripAttachmentMetaSuffix,
4849
+ init_summary_helpers,
4850
+ init_claude_agent,
4851
+ safeJson,
4852
+ resolveCacheKey,
4853
+ requireAdminSession,
4854
+ tryCookieBridgeForConversation,
4855
+ requireAdminCookie,
4856
+ clientIpMiddleware,
4857
+ init_helpers,
4858
+ CDP_WS_PATH,
4859
+ decideCdpUpgrade,
4860
+ buildCdpUpstreamRequest,
4861
+ fetchPageTargets,
4862
+ parseScreencastEvent,
4863
+ screencastLog,
4864
+ cdpWsCensusLog,
4865
+ tabsLog,
4866
+ createPageTarget,
4867
+ closePageTarget
4868
+ };