yepanywhere 0.9.1 → 0.9.2

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 (361) hide show
  1. package/bundled/@yep-anywhere/shared/dist/__tests__/model-prices.test.js +12 -0
  2. package/bundled/@yep-anywhere/shared/dist/__tests__/model-prices.test.js.map +1 -1
  3. package/bundled/@yep-anywhere/shared/dist/app-types.d.ts +2 -2
  4. package/bundled/@yep-anywhere/shared/dist/app-types.d.ts.map +1 -1
  5. package/bundled/@yep-anywhere/shared/dist/app-types.js +5 -5
  6. package/bundled/@yep-anywhere/shared/dist/app-types.js.map +1 -1
  7. package/bundled/@yep-anywhere/shared/dist/artifact-viewer.d.ts +21 -0
  8. package/bundled/@yep-anywhere/shared/dist/artifact-viewer.d.ts.map +1 -1
  9. package/bundled/@yep-anywhere/shared/dist/artifact-viewer.js +22 -1
  10. package/bundled/@yep-anywhere/shared/dist/artifact-viewer.js.map +1 -1
  11. package/bundled/@yep-anywhere/shared/dist/claude-sdk-schema/tool/ToolResultSchemas.d.ts +2 -2
  12. package/bundled/@yep-anywhere/shared/dist/find/documentFind.d.ts +41 -0
  13. package/bundled/@yep-anywhere/shared/dist/find/documentFind.d.ts.map +1 -0
  14. package/bundled/@yep-anywhere/shared/dist/find/documentFind.js +280 -0
  15. package/bundled/@yep-anywhere/shared/dist/find/documentFind.js.map +1 -0
  16. package/bundled/@yep-anywhere/shared/dist/find/frameFindAgent.d.ts +2 -0
  17. package/bundled/@yep-anywhere/shared/dist/find/frameFindAgent.d.ts.map +1 -0
  18. package/bundled/@yep-anywhere/shared/dist/find/frameFindAgent.generated.d.ts +2 -0
  19. package/bundled/@yep-anywhere/shared/dist/find/frameFindAgent.generated.d.ts.map +1 -0
  20. package/bundled/@yep-anywhere/shared/dist/find/frameFindAgent.generated.js +5 -0
  21. package/bundled/@yep-anywhere/shared/dist/find/frameFindAgent.generated.js.map +1 -0
  22. package/bundled/@yep-anywhere/shared/dist/find/frameFindAgent.js +59 -0
  23. package/bundled/@yep-anywhere/shared/dist/find/frameFindAgent.js.map +1 -0
  24. package/bundled/@yep-anywhere/shared/dist/find/protocol.d.ts +46 -0
  25. package/bundled/@yep-anywhere/shared/dist/find/protocol.d.ts.map +1 -0
  26. package/bundled/@yep-anywhere/shared/dist/find/protocol.js +45 -0
  27. package/bundled/@yep-anywhere/shared/dist/find/protocol.js.map +1 -0
  28. package/bundled/@yep-anywhere/shared/dist/index.d.ts +4 -2
  29. package/bundled/@yep-anywhere/shared/dist/index.d.ts.map +1 -1
  30. package/bundled/@yep-anywhere/shared/dist/index.js +3 -1
  31. package/bundled/@yep-anywhere/shared/dist/index.js.map +1 -1
  32. package/bundled/@yep-anywhere/shared/dist/model-prices.d.ts.map +1 -1
  33. package/bundled/@yep-anywhere/shared/dist/model-prices.js +9 -2
  34. package/bundled/@yep-anywhere/shared/dist/model-prices.js.map +1 -1
  35. package/bundled/@yep-anywhere/shared/dist/pdfjs.d.ts +7 -0
  36. package/bundled/@yep-anywhere/shared/dist/pdfjs.d.ts.map +1 -0
  37. package/bundled/@yep-anywhere/shared/dist/pdfjs.js +7 -0
  38. package/bundled/@yep-anywhere/shared/dist/pdfjs.js.map +1 -0
  39. package/bundled/@yep-anywhere/shared/dist/skill-invocations.d.ts.map +1 -1
  40. package/bundled/@yep-anywhere/shared/dist/skill-invocations.js +7 -10
  41. package/bundled/@yep-anywhere/shared/dist/skill-invocations.js.map +1 -1
  42. package/bundled/@yep-anywhere/shared/package.json +1 -1
  43. package/client-dist/assets/{AboutSettings-CHsaLshd.js → AboutSettings-CCzudbSj.js} +1 -1
  44. package/client-dist/assets/{ActivityPage-CBVcBckm.js → ActivityPage-Bn0LbMgE.js} +1 -1
  45. package/client-dist/assets/{AgentContextSettings-DLLaiwUX.js → AgentContextSettings-DI8jQVIx.js} +1 -1
  46. package/client-dist/assets/{AgentsPage-C3_U9MGs.js → AgentsPage-Ci_iJt8T.js} +1 -1
  47. package/client-dist/assets/App-rFnK5pnF.js +2 -0
  48. package/client-dist/assets/AppearanceSettings-DTYVt0W5.js +2 -0
  49. package/client-dist/assets/{AppsSettings-B1BIWKaz.js → AppsSettings-hbh_sguk.js} +1 -1
  50. package/client-dist/assets/{AttachmentChip-CQTl9l1O.js → AttachmentChip-BFve3lTD.js} +1 -1
  51. package/client-dist/assets/{AuthContext-BQK10GgC.js → AuthContext-DmXjW0be.js} +1 -1
  52. package/client-dist/assets/{BangCommandDisplayObject-BDGW0BZN.js → BangCommandDisplayObject-BH2KRGnc.js} +1 -1
  53. package/client-dist/assets/{BangCommandsPage-C1-n2iHi.js → BangCommandsPage-MfkuL8yS.js} +1 -1
  54. package/client-dist/assets/{BrowserDebugToolbarButton-CRE47FFy.js → BrowserDebugToolbarButton-BPghQu17.js} +1 -1
  55. package/client-dist/assets/{CacheMissBillingSettings-BspB12sl.js → CacheMissBillingSettings-rUgC-_DD.js} +1 -1
  56. package/client-dist/assets/{CodexUpdatePrompt-BXTqvclk.js → CodexUpdatePrompt-mT9K-f1e.js} +1 -1
  57. package/client-dist/assets/{CommittedRangeInput-bK7EXtAc.js → CommittedRangeInput-BwuV6Q6c.js} +1 -1
  58. package/client-dist/assets/{CommittedRangeNumberInput-bGOjN2Xv.js → CommittedRangeNumberInput-C5YSVltB.js} +1 -1
  59. package/client-dist/assets/{ComputerControlSettings-BLA4wsEA.js → ComputerControlSettings-MWIdP7SS.js} +1 -1
  60. package/client-dist/assets/{ConversationPreviewPage-rxHQQOck.js → ConversationPreviewPage-B47r7mUF.js} +2 -2
  61. package/client-dist/assets/{DevelopmentSettings-CFo3ctnP.js → DevelopmentSettings-BEAy_xq-.js} +1 -1
  62. package/client-dist/assets/{DevicesSettings-DPdJOmEQ.js → DevicesSettings-DKQOZkRN.js} +1 -1
  63. package/client-dist/assets/{EmulatorPage-RPHDvihL.js → EmulatorPage-DlsPq3nR.js} +1 -1
  64. package/client-dist/assets/{EmulatorSettings-8dHy0xqk.js → EmulatorSettings-C6Ye1k_Y.js} +1 -1
  65. package/client-dist/assets/{EnvironmentSettings-DaFyodJV.js → EnvironmentSettings-ou8UNqTa.js} +1 -1
  66. package/client-dist/assets/{FilePage-BwbKyIGF.js → FilePage-Cw2PaO5H.js} +1 -1
  67. package/client-dist/assets/{FilterDropdown-BiB5gAUh.js → FilterDropdown-CACc6ysA.js} +1 -1
  68. package/client-dist/assets/{FloatingActionButton-DEiaqWhv.js → FloatingActionButton-Bl1Eumxh.js} +1 -1
  69. package/client-dist/assets/{GitStatusPage-CSXr__tv.js → GitStatusPage-CLTkgnDI.js} +1 -1
  70. package/client-dist/assets/{GlobalSessionsPage-C-CbcZjC.js → GlobalSessionsPage-Bvzs4zmW.js} +1 -1
  71. package/client-dist/assets/{HeartbeatTextArea-DWZZh0eE.js → HeartbeatTextArea-CtP5kx9R.js} +1 -1
  72. package/client-dist/assets/{HostIdentityContext-DbEx7dor.js → HostIdentityContext-DA7dMF-y.js} +1 -1
  73. package/client-dist/assets/{HostsPage-BRlkrB-8.js → HostsPage-CBOYGC2-.js} +1 -1
  74. package/client-dist/assets/{InboxContext-DtjKccKZ.js → InboxContext-8PXoTbK1.js} +1 -1
  75. package/client-dist/assets/{InboxPage-DFaLlFm5.js → InboxPage-DWl7uzdw.js} +1 -1
  76. package/client-dist/assets/{IssueSettings-CHjLBTZK.js → IssueSettings-BVljRpuD.js} +1 -1
  77. package/client-dist/assets/{IssuesPage-CfYD-jwK.js → IssuesPage-BFxgsMkf.js} +1 -1
  78. package/client-dist/assets/{LifecycleWebhooksSettings-Ir3_1MvY.js → LifecycleWebhooksSettings-Qw_dN3F3.js} +1 -1
  79. package/client-dist/assets/{LocalAccessSettings-BVh3wBDY.js → LocalAccessSettings-SWirs75o.js} +1 -1
  80. package/client-dist/assets/LocalMediaModal-B3KXtyEB.css +1 -0
  81. package/client-dist/assets/LocalMediaModal-B9eHVx6y.js +14 -0
  82. package/client-dist/assets/{LoginPage-irZxKYu1.js → LoginPage-CYWqVJ95.js} +1 -1
  83. package/client-dist/assets/{MessageAge-CKdiBg7K.js → MessageAge-CaPpa1nH.js} +1 -1
  84. package/client-dist/assets/{MessageDeliverySettings-BJ6Hgu1F.js → MessageDeliverySettings-BUSuGKlc.js} +1 -1
  85. package/client-dist/assets/MessageInput-a13ZPAHv.js +3 -0
  86. package/client-dist/assets/{MessageInputToolbar-CvUMMGJv.js → MessageInputToolbar-CQGTnVea.js} +3 -3
  87. package/client-dist/assets/MessageList-C7kAuWKg.js +4 -0
  88. package/client-dist/assets/{Modal-DOzUIhWU.js → Modal-ClSjJagX.js} +2 -2
  89. package/client-dist/assets/{ModelSettings-SWaaTKgm.js → ModelSettings-Dnd4yzmI.js} +1 -1
  90. package/client-dist/assets/{NavigationLayout-D8BMwd7T.js → NavigationLayout-BTFsWVtE.js} +2 -2
  91. package/client-dist/assets/{NewSessionPage-BBFzYBNs.js → NewSessionPage-BfiAS-Mo.js} +1 -1
  92. package/client-dist/assets/{NotificationsSettings-0iotA0wy.js → NotificationsSettings-B1ugQIp-.js} +1 -1
  93. package/client-dist/assets/{PageHeader-Ca3PbaMb.js → PageHeader-BjwH2pWD.js} +1 -1
  94. package/client-dist/assets/{PerformanceSettings-BgDJMjlN.js → PerformanceSettings-jJYF9SPY.js} +1 -1
  95. package/client-dist/assets/{ProjectSessionDefaultsModal-LEaPwpSM.js → ProjectSessionDefaultsModal-G_0uxJEv.js} +1 -1
  96. package/client-dist/assets/{ProjectTemplatesSettings-fPlh8ZpJ.js → ProjectTemplatesSettings-BQTCV3-3.js} +1 -1
  97. package/client-dist/assets/{ProjectsPage-CiQ3rBB_.js → ProjectsPage-suTd8s9l.js} +1 -1
  98. package/client-dist/assets/ProviderBadge-P0VTI71n.js +1 -0
  99. package/client-dist/assets/{ProviderChildSessionDetail-CSAbaZtr.js → ProviderChildSessionDetail-D0472EW8.js} +13 -13
  100. package/client-dist/assets/ProviderChildSessionPage-9__sgY14.js +1 -0
  101. package/client-dist/assets/{ProvidersSettings-B327MdUT.js → ProvidersSettings-Bwzy73Rk.js} +1 -1
  102. package/client-dist/assets/{RecapAfterSecondsControl-DWG9fB4u.js → RecapAfterSecondsControl-CxuXyFSr.js} +1 -1
  103. package/client-dist/assets/{RelayProtocol-DOWXVB0k.js → RelayProtocol-BpdH0COG.js} +1 -1
  104. package/client-dist/assets/{RemoteAccessSettings-CBSIP-qP.js → RemoteAccessSettings-Dn7KB5nK.js} +1 -1
  105. package/client-dist/assets/{RemoteExecutorsSettings-DDAqEB42.js → RemoteExecutorsSettings-Cjl4Y2rB.js} +1 -1
  106. package/client-dist/assets/{SchemaValidationContext-DLNGXai_.js → SchemaValidationContext-57RCj4c4.js} +1 -1
  107. package/client-dist/assets/{SearchPreview-BCP67hKg.js → SearchPreview-OzVFWPJZ.js} +1 -1
  108. package/client-dist/assets/{SessionHeader.module-CHO2T3eQ.js → SessionHeader.module-BpaFAQ-S.js} +1 -1
  109. package/client-dist/assets/SessionPage-BYthaEfZ.js +50 -0
  110. package/client-dist/assets/SessionPage-CXXEAwu2.css +1 -0
  111. package/client-dist/assets/{SettingsItem-BWF_CyTI.js → SettingsItem-C9Vh5p7F.js} +1 -1
  112. package/client-dist/assets/{SettingsSection-DbOwfvBD.js → SettingsSection-BaPzETK6.js} +1 -1
  113. package/client-dist/assets/{SourceControlSettings-BopLkzc6.js → SourceControlSettings-DnqLg0db.js} +1 -1
  114. package/client-dist/assets/{SourceFileHeaderActions-HoUciheJ.js → SourceFileHeaderActions-PjhUGnn6.js} +1 -1
  115. package/client-dist/assets/SpeechControlMenu-BYVdEa3C.js +2 -0
  116. package/client-dist/assets/{SpeechSettings-B4mB2LIj.js → SpeechSettings-B6LkqfSK.js} +1 -1
  117. package/client-dist/assets/{SpeechSmartTurnControls-tb5zP_85.js → SpeechSmartTurnControls-LPq9wBaM.js} +1 -1
  118. package/client-dist/assets/{StorageSettings-B5A0CtTo.js → StorageSettings-DtsJnYaz.js} +1 -1
  119. package/client-dist/assets/{ThinkingControls-BEweLRqu.js → ThinkingControls-DXbxdJRi.js} +1 -1
  120. package/client-dist/assets/{ToolbarSettings-CJbxOope.js → ToolbarSettings-Nb2BKpnk.js} +1 -1
  121. package/client-dist/assets/{UsersSettings-NWqRSGov.js → UsersSettings-BdvqmyqK.js} +1 -1
  122. package/client-dist/assets/ViewerModePage-DzRIpuYF.js +1 -0
  123. package/client-dist/assets/{VoiceInputButton-0BzvkjjK.js → VoiceInputButton-CCgovfyf.js} +1 -1
  124. package/client-dist/assets/{WorkstreamsPage-oM6jTLsK.js → WorkstreamsPage-dlEUllSL.js} +1 -1
  125. package/client-dist/assets/{YaServerProvider-BNTM9_P9.js → YaServerProvider-CN3tC5UL.js} +1 -1
  126. package/client-dist/assets/{YepAnywhereLogo-C4H1sg3q.js → YepAnywhereLogo-5zFKWjQq.js} +1 -1
  127. package/client-dist/assets/{abnfDiagram-VCTEODGH-DIBSwOuB.js → abnfDiagram-VCTEODGH-BWHUBcV3.js} +1 -1
  128. package/client-dist/assets/{arc-Blz12Cef.js → arc-DKsIJWGD.js} +1 -1
  129. package/client-dist/assets/{architectureDiagram-5GKGNRK7-CtTnQhBI.js → architectureDiagram-5GKGNRK7-BuLImqW3.js} +1 -1
  130. package/client-dist/assets/{attachmentFileNames-DwaA5IPB.js → attachmentFileNames-CBV_5g65.js} +1 -1
  131. package/client-dist/assets/{blockDiagram-I7D4REHJ-BanTkGM6.js → blockDiagram-I7D4REHJ-CJ4Gh6sL.js} +1 -1
  132. package/client-dist/assets/{c4Diagram-7LVT6UL2-C4p1KgTp.js → c4Diagram-7LVT6UL2-WR43XvCI.js} +1 -1
  133. package/client-dist/assets/channel-PV8AAsuo.js +1 -0
  134. package/client-dist/assets/{chunk-2Q5K7J3B-CJSvy8go.js → chunk-2Q5K7J3B-CiP4m_EA.js} +1 -1
  135. package/client-dist/assets/{chunk-5VM5RSS4-BVg02Giz.js → chunk-5VM5RSS4-BUAhj1h9.js} +1 -1
  136. package/client-dist/assets/{chunk-F27PBJKO-f_VOUJ8l.js → chunk-F27PBJKO-BUZNwiGx.js} +1 -1
  137. package/client-dist/assets/{chunk-IMKFNOWR-P5H0uE4d.js → chunk-IMKFNOWR-CX1a0BCE.js} +1 -1
  138. package/client-dist/assets/{chunk-JWPE2WC7-BpEGNu2X.js → chunk-JWPE2WC7-C6tL-mLF.js} +1 -1
  139. package/client-dist/assets/{chunk-POPQ4Y6H-oZudgMt7.js → chunk-POPQ4Y6H-BzijGGWv.js} +1 -1
  140. package/client-dist/assets/{chunk-SVP7TREG-dMWNgoWs.js → chunk-SVP7TREG-CsZImJKI.js} +1 -1
  141. package/client-dist/assets/{chunk-TICWLB2K-D8VqJUFw.js → chunk-TICWLB2K-TwCtuDc1.js} +1 -1
  142. package/client-dist/assets/{chunk-XXDRQBXY-ZwkKkcDz.js → chunk-XXDRQBXY-C-2EoNns.js} +1 -1
  143. package/client-dist/assets/classDiagram-ZZMXUADV-DvtSxfma.js +1 -0
  144. package/client-dist/assets/classDiagram-v2-VYDZK3BY-DvtSxfma.js +1 -0
  145. package/client-dist/assets/{client-D_ikArFV.js → client-Ci_HPGfl.js} +1 -1
  146. package/client-dist/assets/{compactSettingsControls-CzgNQCH3.js → compactSettingsControls-C9mLZh5H.js} +1 -1
  147. package/client-dist/assets/{cose-bilkent-JH36ORCC-DrtmDj3A.js → cose-bilkent-JH36ORCC-CmbEx2jT.js} +1 -1
  148. package/client-dist/assets/{cynefin-OW5HDTMX-CYhxgFq5.js → cynefin-OW5HDTMX-BSQHHXFU.js} +1 -1
  149. package/client-dist/assets/{cynefinDiagram-5FMLGOSQ-BXvBp5eq.js → cynefinDiagram-5FMLGOSQ-C-62JZJD.js} +1 -1
  150. package/client-dist/assets/{dagre-GXQ25YYZ-CdvzhCPS.js → dagre-GXQ25YYZ-BBERQe_A.js} +1 -1
  151. package/client-dist/assets/{diagram-S7CK7UJ4-DSGzzHN1.js → diagram-S7CK7UJ4-muw11lmG.js} +1 -1
  152. package/client-dist/assets/{diagram-UQ7AKVKN-Bk4fbl1S.js → diagram-UQ7AKVKN-DpePWzAe.js} +1 -1
  153. package/client-dist/assets/{diagram-VSXAHHWV-BAOCj4oX.js → diagram-VSXAHHWV-DHX6AHUY.js} +1 -1
  154. package/client-dist/assets/{diagram-VX7I27RA-KHmeuEjq.js → diagram-VX7I27RA-DYmR6NH_.js} +1 -1
  155. package/client-dist/assets/{diagram-Z3DM3KII-D6GpIAdx.js → diagram-Z3DM3KII-BC1SenHB.js} +1 -1
  156. package/client-dist/assets/{ebnfDiagram-PWID7BFC-Bm_JuhNL.js → ebnfDiagram-PWID7BFC-EVpri6Ma.js} +1 -1
  157. package/client-dist/assets/{erDiagram-RLTQ6QDP-u5Ryj9Z_.js → erDiagram-RLTQ6QDP-DthztUaa.js} +1 -1
  158. package/client-dist/assets/{flowDiagram-HODETNUW-C9A7e1yC.js → flowDiagram-HODETNUW-DEpC5nMx.js} +1 -1
  159. package/client-dist/assets/{frontendReload-DN8qVYjF.js → frontendReload-CBdyvvdy.js} +1 -1
  160. package/client-dist/assets/{ganttDiagram-EL5Y4UJY-BEIN_FhZ.js → ganttDiagram-EL5Y4UJY-Csqji8t1.js} +1 -1
  161. package/client-dist/assets/{gitGraphDiagram-WWUBYQGX-Cu5ow6Ls.js → gitGraphDiagram-WWUBYQGX-DVX1SDIE.js} +1 -1
  162. package/client-dist/assets/{hostStorage-C37tOOJa.js → hostStorage-D1KAm3U1.js} +1 -1
  163. package/client-dist/assets/{index-_2WVhpKj.js → index-BESqiBDI.js} +1 -1
  164. package/client-dist/assets/index-BkOdUxq4.js +2 -0
  165. package/client-dist/assets/index-CPb-36gi.css +1 -0
  166. package/client-dist/assets/{index-YAR5D3xY.js → index-CoR-vzsb.js} +1 -1
  167. package/client-dist/assets/index-Cv3tQXyE.js +1 -0
  168. package/client-dist/assets/{index-LT-lzpNS.js → index-DSFMItgO.js} +1 -1
  169. package/client-dist/assets/index-umZg0LZ6.js +81 -0
  170. package/client-dist/assets/{infoDiagram-27XIBGKW-ILfv0Qu_.js → infoDiagram-27XIBGKW-CHm3qsd2.js} +1 -1
  171. package/client-dist/assets/{ishikawaDiagram-5VMMS53U-D1P8nenz.js → ishikawaDiagram-5VMMS53U-tBRZwz-_.js} +1 -1
  172. package/client-dist/assets/{journeyDiagram-3NMN7TZE-CXP61NqX.js → journeyDiagram-3NMN7TZE-EJic7nqD.js} +1 -1
  173. package/client-dist/assets/{kanban-definition-UXKFOSKX-2x79Nimu.js → kanban-definition-UXKFOSKX-DtzL6eeO.js} +1 -1
  174. package/client-dist/assets/{layout-D7AfOq-G.js → layout-gb-Axsoq.js} +1 -1
  175. package/client-dist/assets/{linear-B_4Bripc.js → linear-CAe4xGbR.js} +1 -1
  176. package/client-dist/assets/{mermaid.core-y_avJe8E.js → mermaid.core-BCu1nv8H.js} +5 -5
  177. package/client-dist/assets/{mindmap-definition-YA3MSWOX-DwMJuV6d.js → mindmap-definition-YA3MSWOX-C7-KSPtJ.js} +1 -1
  178. package/client-dist/assets/{pegDiagram-XKGWAZYB-43LaxzRF.js → pegDiagram-XKGWAZYB-iWVH9rbY.js} +1 -1
  179. package/client-dist/assets/{pieDiagram-E7YTZNPT-DAOi_afd.js → pieDiagram-E7YTZNPT-VKD6PLHa.js} +1 -1
  180. package/client-dist/assets/{providerChildSessions-BpJF5D9s.css → providerChildSessions-Cd7oK6KQ.css} +1 -1
  181. package/client-dist/assets/providerChildSessions-DbLFSybt.js +77 -0
  182. package/client-dist/assets/{quadrantDiagram-AXDQQJYC-BRPBWWpv.js → quadrantDiagram-AXDQQJYC-AXFugcFl.js} +1 -1
  183. package/client-dist/assets/{railroadDiagram-O6MQD6OU-xAuDG62P.js → railroadDiagram-O6MQD6OU-D6oZy6Al.js} +1 -1
  184. package/client-dist/assets/{recentProjectPathLinks-B6pQxzWg.js → recentProjectPathLinks-D0Dx6YXT.js} +1 -1
  185. package/client-dist/assets/{registerServiceWorker-fKJh5dWO.js → registerServiceWorker-B8K2KVOY.js} +1 -1
  186. package/client-dist/assets/{relayEndpoints-DRyKx83V.js → relayEndpoints-BTq9xppf.js} +1 -1
  187. package/client-dist/assets/{remoteRoutePaths-BxKY1U2z.js → remoteRoutePaths-D8htA0xa.js} +1 -1
  188. package/client-dist/assets/{requirementDiagram-BXWQKSXE-BJvybhuU.js → requirementDiagram-BXWQKSXE-Eqtb74It.js} +1 -1
  189. package/client-dist/assets/{sankeyDiagram-P5KCCOFB-aAAflmwo.js → sankeyDiagram-P5KCCOFB-CxvDiZ1R.js} +1 -1
  190. package/client-dist/assets/{sequenceDiagram-WJ2MYXX4-CP3BPtU-.js → sequenceDiagram-WJ2MYXX4-BbpkgW2L.js} +1 -1
  191. package/client-dist/assets/{sessionNavigationState-MSOOrZi4.js → sessionNavigationState-BXejf2ZW.js} +1 -1
  192. package/client-dist/assets/sessionRouteLayer-D9T2QT8G.js +1 -0
  193. package/client-dist/assets/{sizeCapture-INFHLROL-BwAQ5zb3.js → sizeCapture-INFHLROL-DcuwWD5r.js} +1 -1
  194. package/client-dist/assets/{sourceControlNavigationState-t_nQLZvO.js → sourceControlNavigationState-BJbTzWTE.js} +1 -1
  195. package/client-dist/assets/{speechDraftTransaction-8sgF4uer.js → speechDraftTransaction-WhqFE1h9.js} +1 -1
  196. package/client-dist/assets/{stateDiagram-D77RDMKH-B8llvNN3.js → stateDiagram-D77RDMKH-Cidpq73w.js} +1 -1
  197. package/client-dist/assets/stateDiagram-v2-MP3YSRHH-DFqKXxjz.js +1 -0
  198. package/client-dist/assets/{swimlanes-42K2YHIH-qqdgDD32.js → swimlanes-42K2YHIH-Ba8C7MwG.js} +1 -1
  199. package/client-dist/assets/swimlanesDiagram-VR7AAH4N-3pW2TcAt.js +8 -0
  200. package/client-dist/assets/{timeline-definition-24CTP7MA-EBxDGVBl.js → timeline-definition-24CTP7MA-CKefGvUK.js} +1 -1
  201. package/client-dist/assets/{useAcliCommentarySetting-JMx-BSAu.js → useAcliCommentarySetting-CBKAl7qr.js} +2 -2
  202. package/client-dist/assets/{useActivityBusState-CnG-LXsr.js → useActivityBusState-C0dor9p7.js} +1 -1
  203. package/client-dist/assets/{useBackgroundRevalidation-7vLWDD_M.js → useBackgroundRevalidation-C79HAUP3.js} +1 -1
  204. package/client-dist/assets/{useCodexUpdateStatus-CAR1HkyO.js → useCodexUpdateStatus-CEZO_f2Y.js} +1 -1
  205. package/client-dist/assets/{useConnectedDevices-DxgKt21O.js → useConnectedDevices-Ds-DuUDc.js} +1 -1
  206. package/client-dist/assets/{useDocumentTitle-bldu9XOq.js → useDocumentTitle-Xz5t-nlB.js} +1 -1
  207. package/client-dist/assets/{useEmulators-BPiSdRjQ.js → useEmulators-qS_cCZ3I.js} +1 -1
  208. package/client-dist/assets/{useFileActivity-D0JXhEz7.js → useFileActivity-BoW4X3DY.js} +1 -1
  209. package/client-dist/assets/{useFloatingActionButtonEnabled-Dp_hZuYb.js → useFloatingActionButtonEnabled-2_hw7nSa.js} +1 -1
  210. package/client-dist/assets/{useForkSummaryAutoOpen-Cty_gTm1.js → useForkSummaryAutoOpen-CS33Irpf.js} +1 -1
  211. package/client-dist/assets/{useGeneratedTitleLength-BpbPYGRf.js → useGeneratedTitleLength-D856ktVg.js} +1 -1
  212. package/client-dist/assets/{useKeepMobileKeyboardOpenAfterDelivery-BWCiVVkU.js → useKeepMobileKeyboardOpenAfterDelivery-Ba77SbWF.js} +1 -1
  213. package/client-dist/assets/{useModelSettings-CeABGid0.js → useModelSettings-BdlYk1DT.js} +1 -1
  214. package/client-dist/assets/{useNotifyInApp-CuUBcZeR.js → useNotifyInApp-DcWe3dh4.js} +1 -1
  215. package/client-dist/assets/{useOnboarding-BDCBf2Fp.js → useOnboarding-CoE3WF8a.js} +1 -1
  216. package/client-dist/assets/{useProviders-45TZLkhy.js → useProviders-CeN1PclA.js} +1 -1
  217. package/client-dist/assets/{useQuestionAsideSetting-B0bjoe-z.js → useQuestionAsideSetting-CPFw1u0y.js} +1 -1
  218. package/client-dist/assets/{useRecentSessions-COrEGQJH.js → useRecentSessions-ieTzzJu4.js} +1 -1
  219. package/client-dist/assets/{useRelativeNow-XM1dKxcx.js → useRelativeNow-Ca6QGcPa.js} +1 -1
  220. package/client-dist/assets/{useReloadNotifications-JBj22syT.js → useReloadNotifications-Dm1jmdIb.js} +1 -1
  221. package/client-dist/assets/{useRemoteExecutors-Bzvi8gRe.js → useRemoteExecutors-zBAQnQXH.js} +1 -1
  222. package/client-dist/assets/{useSidebarWidth-CITe0sSV.js → useSidebarWidth-CBCcbSLg.js} +1 -1
  223. package/client-dist/assets/{useSourceControlCleanLanding-B-8NTKPa.js → useSourceControlCleanLanding-VDlft5tr.js} +1 -1
  224. package/client-dist/assets/{useStableToolPreviewRendering-CeH1PY9S.js → useStableToolPreviewRendering-hbVp38Jd.js} +1 -1
  225. package/client-dist/assets/{useStreamingEnabled-C535nHwb.js → useStreamingEnabled-hU1g8i7_.js} +1 -1
  226. package/client-dist/assets/{useTabTitleActivityPreference-NekVdSEZ.js → useTabTitleActivityPreference-DhREY7m2.js} +1 -1
  227. package/client-dist/assets/{useVhostAccess-CHT40zJ3.js → useVhostAccess-DUtn_sH1.js} +1 -1
  228. package/client-dist/assets/{useWorkflowTags-Bl7Czynw.js → useWorkflowTags-DxbEBqtf.js} +1 -1
  229. package/client-dist/assets/{vennDiagram-4TSXK5OY-BRLuM0pk.js → vennDiagram-4TSXK5OY-CSGBq-Ur.js} +1 -1
  230. package/client-dist/assets/{wardleyDiagram-VM6X3IG4-D5cPV-h-.js → wardleyDiagram-VM6X3IG4-DIMvcaMb.js} +1 -1
  231. package/client-dist/assets/{xychartDiagram-S5SC5T6Z-M2QslymW.js → xychartDiagram-S5SC5T6Z-TYXSqT3w.js} +1 -1
  232. package/client-dist/index.html +3 -3
  233. package/dist/app.d.ts.map +1 -1
  234. package/dist/app.js +19 -10
  235. package/dist/app.js.map +1 -1
  236. package/dist/artifacts/ArtifactServer.d.ts +0 -1
  237. package/dist/artifacts/ArtifactServer.d.ts.map +1 -1
  238. package/dist/artifacts/ArtifactServer.js +41 -9
  239. package/dist/artifacts/ArtifactServer.js.map +1 -1
  240. package/dist/auth/limitedUserPolicy.d.ts +9 -5
  241. package/dist/auth/limitedUserPolicy.d.ts.map +1 -1
  242. package/dist/auth/limitedUserPolicy.js +64 -35
  243. package/dist/auth/limitedUserPolicy.js.map +1 -1
  244. package/dist/auth/principal.d.ts +6 -0
  245. package/dist/auth/principal.d.ts.map +1 -1
  246. package/dist/auth/principal.js +6 -0
  247. package/dist/auth/principal.js.map +1 -1
  248. package/dist/frontend/static.d.ts.map +1 -1
  249. package/dist/frontend/static.js +2 -1
  250. package/dist/frontend/static.js.map +1 -1
  251. package/dist/middleware/authenticated-transport.d.ts +13 -0
  252. package/dist/middleware/authenticated-transport.d.ts.map +1 -1
  253. package/dist/middleware/authenticated-transport.js +12 -0
  254. package/dist/middleware/authenticated-transport.js.map +1 -1
  255. package/dist/middleware/limited-users.d.ts +9 -5
  256. package/dist/middleware/limited-users.d.ts.map +1 -1
  257. package/dist/middleware/limited-users.js +37 -23
  258. package/dist/middleware/limited-users.js.map +1 -1
  259. package/dist/routes/file-edit.d.ts +4 -1
  260. package/dist/routes/file-edit.d.ts.map +1 -1
  261. package/dist/routes/file-edit.js +22 -6
  262. package/dist/routes/file-edit.js.map +1 -1
  263. package/dist/routes/files.d.ts.map +1 -1
  264. package/dist/routes/files.js +19 -5
  265. package/dist/routes/files.js.map +1 -1
  266. package/dist/routes/pdfjs.d.ts +9 -0
  267. package/dist/routes/pdfjs.d.ts.map +1 -0
  268. package/dist/routes/pdfjs.js +34 -0
  269. package/dist/routes/pdfjs.js.map +1 -0
  270. package/dist/routes/recents.d.ts +4 -1
  271. package/dist/routes/recents.d.ts.map +1 -1
  272. package/dist/routes/recents.js +7 -0
  273. package/dist/routes/recents.js.map +1 -1
  274. package/dist/routes/settings.d.ts +7 -2
  275. package/dist/routes/settings.d.ts.map +1 -1
  276. package/dist/routes/settings.js +43 -1
  277. package/dist/routes/settings.js.map +1 -1
  278. package/dist/routes/ws-relay-handlers.d.ts +12 -0
  279. package/dist/routes/ws-relay-handlers.d.ts.map +1 -1
  280. package/dist/routes/ws-relay-handlers.js +25 -4
  281. package/dist/routes/ws-relay-handlers.js.map +1 -1
  282. package/dist/routes/ws-relay.d.ts.map +1 -1
  283. package/dist/routes/ws-relay.js +8 -0
  284. package/dist/routes/ws-relay.js.map +1 -1
  285. package/dist/sdk/providers/codex-model-catalog.d.ts.map +1 -1
  286. package/dist/sdk/providers/codex-model-catalog.js +5 -3
  287. package/dist/sdk/providers/codex-model-catalog.js.map +1 -1
  288. package/dist/sdk/providers/codex-protocol/generated/ContentItem.d.ts +4 -1
  289. package/dist/sdk/providers/codex-protocol/generated/ContentItem.d.ts.map +1 -1
  290. package/dist/sdk/providers/codex-protocol/generated/FunctionCallOutputContentItem.d.ts +4 -1
  291. package/dist/sdk/providers/codex-protocol/generated/FunctionCallOutputContentItem.d.ts.map +1 -1
  292. package/dist/sdk/providers/codex-protocol/generated/Personality.d.ts +3 -0
  293. package/dist/sdk/providers/codex-protocol/generated/Personality.d.ts.map +1 -1
  294. package/dist/sdk/providers/codex-protocol/generated/v2/McpAppDisplayMode.d.ts +2 -0
  295. package/dist/sdk/providers/codex-protocol/generated/v2/McpAppDisplayMode.d.ts.map +1 -0
  296. package/dist/sdk/providers/codex-protocol/generated/v2/{ThreadRollbackParams.js → McpAppDisplayMode.js} +1 -1
  297. package/dist/sdk/providers/codex-protocol/generated/v2/McpAppDisplayMode.js.map +1 -0
  298. package/dist/sdk/providers/codex-protocol/generated/v2/McpAppUi.d.ts +9 -0
  299. package/dist/sdk/providers/codex-protocol/generated/v2/McpAppUi.d.ts.map +1 -0
  300. package/dist/sdk/providers/codex-protocol/generated/v2/{ThreadRollbackResponse.js → McpAppUi.js} +1 -1
  301. package/dist/sdk/providers/codex-protocol/generated/v2/McpAppUi.js.map +1 -0
  302. package/dist/sdk/providers/codex-protocol/generated/v2/Thread.d.ts +1 -1
  303. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadForkResponse.d.ts +4 -0
  304. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadForkResponse.d.ts.map +1 -1
  305. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadItem.d.ts +6 -1
  306. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadItem.d.ts.map +1 -1
  307. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadResumeParams.d.ts +4 -0
  308. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadResumeParams.d.ts.map +1 -1
  309. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadResumeResponse.d.ts +9 -0
  310. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadResumeResponse.d.ts.map +1 -1
  311. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadStartParams.d.ts +9 -0
  312. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadStartParams.d.ts.map +1 -1
  313. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadStartResponse.d.ts +4 -0
  314. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadStartResponse.d.ts.map +1 -1
  315. package/dist/sdk/providers/codex-protocol/generated/v2/TurnStartParams.d.ts +7 -1
  316. package/dist/sdk/providers/codex-protocol/generated/v2/TurnStartParams.d.ts.map +1 -1
  317. package/dist/sdk/providers/codex-protocol/generated/v2/UserInput.d.ts +3 -0
  318. package/dist/sdk/providers/codex-protocol/generated/v2/UserInput.d.ts.map +1 -1
  319. package/dist/sdk/providers/codex-protocol/index.d.ts +0 -2
  320. package/dist/sdk/providers/codex-protocol/index.d.ts.map +1 -1
  321. package/dist/sdk/providers/codex.d.ts +7 -2
  322. package/dist/sdk/providers/codex.d.ts.map +1 -1
  323. package/dist/sdk/providers/codex.js +21 -20
  324. package/dist/sdk/providers/codex.js.map +1 -1
  325. package/dist/services/ArtifactRebuildService.d.ts +11 -14
  326. package/dist/services/ArtifactRebuildService.d.ts.map +1 -1
  327. package/dist/services/ArtifactRebuildService.js +15 -7
  328. package/dist/services/ArtifactRebuildService.js.map +1 -1
  329. package/dist/services/PdfjsAssetCache.d.ts +20 -0
  330. package/dist/services/PdfjsAssetCache.d.ts.map +1 -0
  331. package/dist/services/PdfjsAssetCache.js +131 -0
  332. package/dist/services/PdfjsAssetCache.js.map +1 -0
  333. package/package.json +3 -3
  334. package/client-dist/assets/App-DYWU2-wq.js +0 -2
  335. package/client-dist/assets/AppearanceSettings-Ci0wlAx3.js +0 -2
  336. package/client-dist/assets/LocalMediaModal-DOcizK52.css +0 -1
  337. package/client-dist/assets/LocalMediaModal-DyDpC0dk.js +0 -12
  338. package/client-dist/assets/MessageInput-leX__dbU.js +0 -3
  339. package/client-dist/assets/MessageList-DDA4Q_Gj.js +0 -4
  340. package/client-dist/assets/ProviderBadge-BKZVllDn.js +0 -1
  341. package/client-dist/assets/ProviderChildSessionPage-vpu5u3YA.js +0 -1
  342. package/client-dist/assets/SessionPage-BJ5qaa-G.js +0 -50
  343. package/client-dist/assets/SessionPage-BiV0X3n1.css +0 -1
  344. package/client-dist/assets/SpeechControlMenu-DEDIWl9h.js +0 -2
  345. package/client-dist/assets/ViewerModePage-Dyq_I7ws.js +0 -1
  346. package/client-dist/assets/channel-DwT-nHaK.js +0 -1
  347. package/client-dist/assets/classDiagram-ZZMXUADV-DdlhZ-2W.js +0 -1
  348. package/client-dist/assets/classDiagram-v2-VYDZK3BY-DdlhZ-2W.js +0 -1
  349. package/client-dist/assets/index-BY-TgOY-.js +0 -81
  350. package/client-dist/assets/index-BgkZrNQv.js +0 -1
  351. package/client-dist/assets/index-BrCZcBcO.js +0 -2
  352. package/client-dist/assets/index-wA2zlxt-.css +0 -1
  353. package/client-dist/assets/providerChildSessions-DVWCZpC4.js +0 -78
  354. package/client-dist/assets/stateDiagram-v2-MP3YSRHH-CD7vRqY6.js +0 -1
  355. package/client-dist/assets/swimlanesDiagram-VR7AAH4N-NBdWyLIY.js +0 -8
  356. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadRollbackParams.d.ts +0 -14
  357. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadRollbackParams.d.ts.map +0 -1
  358. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadRollbackParams.js.map +0 -1
  359. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadRollbackResponse.d.ts +0 -12
  360. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadRollbackResponse.d.ts.map +0 -1
  361. package/dist/sdk/providers/codex-protocol/generated/v2/ThreadRollbackResponse.js.map +0 -1
@@ -1 +1 @@
1
- import{j as t,u as A,r as n,aK as Q,L as W}from"./index-BY-TgOY-.js";import{b as B,e as F}from"./Modal-DOzUIhWU.js";import{C as T}from"./CommittedRangeNumberInput-bGOjN2Xv.js";import{S as I}from"./SettingsSection-DbOwfvBD.js";import{u as X}from"./useVhostAccess-CHT40zJ3.js";import{s as Y}from"./LocalMediaModal-DyDpC0dk.js";import{u as Z}from"./index-BrCZcBcO.js";import"./react-runtime-D-UPQ57m.js";import"./client-D_ikArFV.js";import"./RelayProtocol-DOWXVB0k.js";import"./remoteRoutePaths-BxKY1U2z.js";import"./CommittedRangeInput-bK7EXtAc.js";import"./newSessionPrefill-DKcy0abh.js";import"./appHref-ByaEnJGJ.js";import"./PageHeader-Ca3PbaMb.js";import"./SessionHeader.module-CHO2T3eQ.js";import"./HostIdentityContext-DbEx7dor.js";import"./frontendReload-DN8qVYjF.js";import"./NavigationLayout-D8BMwd7T.js";import"./useSidebarWidth-CITe0sSV.js";import"./useFileActivity-D0JXhEz7.js";import"./providerChildSessions-DVWCZpC4.js";import"./katex-Dv2p4YRM.js";import"./index-YAR5D3xY.js";import"./relay-url-j3kYm5KO.js";import"./ProviderBadge-BKZVllDn.js";import"./YepAnywhereLogo-C4H1sg3q.js";import"./index-BgkZrNQv.js";const tt="_fields_lti5t_1",et="_toggle_lti5t_18",st="_vhostRow_lti5t_23",it="_expiry_lti5t_42",rt="_vhosts_lti5t_60",ot="_vhostHeading_lti5t_67",at="_access_lti5t_85",h={fields:tt,toggle:et,vhostRow:st,expiry:it,vhosts:rt,vhostHeading:ot,access:at};function nt(){const{sourceKey:i}=B(),{version:d,refetch:e}=F(),g=d==null?void 0:d.artifactViewer;return g?t.jsx(ct,{status:g,onSaved:e},i):null}function ct({status:i,onSaved:d}){const{t:e}=A(),{transport:g}=B(),u=X(i),v=n.useId(),[k,U]=n.useState(!!i.localOrigin),[S,K]=n.useState(i.localOrigin??i.defaultLocalOrigin),[R,$]=n.useState(i.publicOrigin??""),[C,J]=n.useState(String(i.port)),[L,M]=n.useState(i.expiryHours),[w,q]=n.useState(i.expiryDays),[_,z]=n.useState(i.vhostPublicRoot??""),[E,G]=n.useState(i.alwaysRewriteVhostLinks===!0),[y,f]=n.useState(()=>(i.vhosts??[]).map(s=>({...s}))),[P,b]=n.useState(!1),[H,m]=n.useState(""),O=i.vhosts!==void 0,N=n.useRef(Promise.resolve()),j=n.useRef(0),V=n.useRef(void 0);async function c(s={}){if(i.locked)return;const l={localEnabled:k,expiryDays:w,expiryHours:L,vhosts:y,alwaysRewriteVhostLinks:E,...s};m("");try{if([l.localEnabled?S:"",R].filter(Boolean).some(o=>new URL(o).hostname===window.location.hostname))throw new Error(e("artifactSeparateHost"));const r=JSON.stringify({port:Number(C),localOrigin:l.localEnabled?S.trim():"",publicOrigin:R.trim(),...l.expiryDays===void 0?{expiryHours:l.expiryHours}:{expiryDays:l.expiryDays},...O?{vhostPublicRoot:_.trim(),alwaysRewriteVhostLinks:l.alwaysRewriteVhostLinks,vhosts:l.vhosts.map(o=>{var D;return{name:o.name.trim(),port:o.port,...(D=o.env)!=null&&D.trim()?{env:o.env.trim()}:{},...u.supported?{public:o.public===!0}:{}}})}:{}});if(r===V.current)return;V.current=r;const p=++j.current;b(!0);const a=N.current.then(async()=>{await g.fetch("/artifacts/config",{method:"PUT",body:r}),await d()});N.current=a.catch(()=>{});try{await a,p===j.current&&m(e("artifactSaved"))}catch(o){p===j.current&&(V.current=void 0,m(o instanceof Error?o.message:String(o)))}finally{p===j.current&&b(!1)}}catch(x){m(x instanceof Error?x.message:String(x))}}return t.jsxs(I,{title:e("artifactSettingsTitle"),description:e("artifactSettingsDescription"),onSubmit:s=>{s.preventDefault(),c()},children:[t.jsx("p",{children:e("appsSettingsAutosave")}),t.jsxs("fieldset",{className:h.fields,disabled:i.locked,children:[t.jsxs("label",{className:h.toggle,children:[t.jsx("input",{type:"checkbox",checked:k,onChange:s=>{U(s.target.checked),c({localEnabled:s.target.checked})}}),e("artifactLocalEnabled")]}),k&&t.jsxs("label",{children:[e("artifactLocalOrigin"),t.jsx("input",{type:"url",value:S,onBlur:()=>void c(),onChange:s=>K(s.target.value)})]}),t.jsxs("label",{children:[e("artifactPublicOrigin"),t.jsx("input",{type:"url",value:R,onBlur:()=>void c(),onChange:s=>$(s.target.value)})]}),t.jsx("p",{children:e("artifactPublicHint")}),t.jsxs("label",{children:[e("artifactPort"),t.jsx("input",{type:"number",min:1,max:65535,value:C,onBlur:()=>void c(),onChange:s=>J(s.target.value)})]}),t.jsx("p",{children:e("artifactPortHint")}),w!==void 0?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:h.expiry,children:[t.jsx("label",{htmlFor:v,children:e("artifactExpiryDaysLabel")}),t.jsx(T,{id:v,min:1,max:30,step:1,value:w,ariaLabel:e("artifactExpiryDaysLabel"),onCommit:s=>{q(s),c({expiryDays:s})}})]}),t.jsx("p",{children:e("artifactExpiryDaysHint")}),t.jsx("p",{children:e("artifactDeleteOnExpiryHint")})]}):L!==void 0&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:h.expiry,children:[t.jsx("label",{htmlFor:v,children:e("artifactExpiryLabel")}),t.jsx(T,{id:v,min:1,max:168,step:1,value:L,ariaLabel:e("artifactExpiryLabel"),onCommit:s=>{M(s),c({expiryHours:s})}})]}),t.jsx("p",{children:e("artifactExpiryHint")})]}),O&&t.jsxs(t.Fragment,{children:[t.jsxs("label",{children:[e("artifactVhostPublicRoot"),t.jsx("input",{type:"text",value:_,onBlur:()=>void c(),autoComplete:"off",spellCheck:!1,onChange:s=>z(s.target.value)})]}),t.jsx("p",{children:e("artifactVhostPublicRootHint",{port:C})}),t.jsxs("label",{className:h.toggle,children:[t.jsx("input",{type:"checkbox",checked:E,onChange:s=>{G(s.target.checked),c({alwaysRewriteVhostLinks:s.target.checked})}}),e("artifactAlwaysRewriteVhostLinks")]}),t.jsx("p",{children:e("artifactAlwaysRewriteVhostLinksHint")}),t.jsxs("div",{className:h.vhosts,children:[t.jsx("span",{className:h.vhostHeading,children:e("artifactVhostTableTitle")}),t.jsx("p",{children:e("artifactVhostTableHint")}),t.jsx("p",{children:e(u.supported?"appAccessHint":"appAccessUnavailable")}),u.error&&t.jsx("p",{role:"alert",children:u.error}),y.map((s,l)=>{var x;return t.jsxs("div",{className:h.vhostRow,children:[t.jsxs("label",{children:[e("artifactVhostName"),t.jsx("input",{type:"text",value:s.name,onBlur:()=>void c(),autoComplete:"off",spellCheck:!1,onChange:r=>f(p=>p.map((a,o)=>o===l?{...a,name:r.target.value}:a))})]}),t.jsxs("label",{children:[e("artifactVhostPort"),t.jsx("input",{type:"number",min:1,max:65535,value:s.port||"",onBlur:()=>void c(),onChange:r=>f(p=>p.map((a,o)=>o===l?{...a,port:Number(r.target.value)}:a))})]}),t.jsxs("label",{children:[e("artifactVhostEnv"),t.jsx("input",{type:"text",value:s.env??"",onBlur:()=>void c(),placeholder:"PLANNOTATOR_PORT",autoComplete:"off",spellCheck:!1,onChange:r=>f(p=>p.map((a,o)=>o===l?{...a,env:r.target.value}:a))})]}),t.jsx("button",{type:"button",onClick:()=>{const r=y.filter((p,a)=>a!==l);f(r),c({vhosts:r})},children:e("artifactVhostRemove")}),u.supported&&t.jsxs("div",{className:h.access,children:[t.jsxs("label",{className:h.toggle,children:[t.jsx("input",{type:"checkbox",checked:s.public===!0,onChange:r=>{const p=y.map((a,o)=>o===l?{...a,public:r.target.checked}:a);f(p),c({vhosts:p})}}),e("appAccessPublic")]}),((x=i.vhosts)==null?void 0:x.some(r=>r.name===s.name&&r.port===s.port))&&t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",disabled:!u.config,onClick:async()=>{const r=Y(`http://localhost:${s.port}/`,u.config,window.location.href,i.vhostPublicRoot?"public":void 0);m(r&&await Q(r.url)?e("fileViewerCopied"):e("viewerCopyLinkFailed"))},children:e("appAccessCopy")}),t.jsx("button",{type:"button",disabled:P,onClick:async()=>{b(!0);try{await g.fetch(`/artifacts/vhosts/${encodeURIComponent(s.name)}/revoke`,{method:"POST"}),u.refresh(),m(e("appAccessRevoked"))}catch(r){m(r instanceof Error?r.message:String(r))}finally{b(!1)}},children:e("appAccessRevoke")})]})]})]},l)}),t.jsx("button",{type:"button",onClick:()=>f(s=>[...s,{name:"",port:19432}]),children:e("artifactVhostAdd")})]})]})]}),i.locked&&t.jsx("p",{children:e("artifactLocked")}),P&&t.jsx("p",{role:"status",children:e("artifactSaving")}),H&&t.jsx("p",{role:"status",children:H})]})}function Tt(){const{t:i}=A(),{version:d}=F();return Z(i("settingsAppsTitle")),t.jsx(I,{description:i("settingsAppsDescription"),children:d!=null&&d.artifactViewer?t.jsx(nt,{}):t.jsx("p",{children:i("settingsAppsUnavailable")})})}function Bt(){const{t:i}=A();return t.jsx(W,{to:"/settings/apps",children:i("settingsAppsLink")})}export{Tt as AppsSettings,Bt as AppsSettingsLink};
1
+ import{j as t,u as A,r as n,aK as Q,L as W}from"./index-umZg0LZ6.js";import{b as B,e as F}from"./Modal-ClSjJagX.js";import{C as T}from"./CommittedRangeNumberInput-C5YSVltB.js";import{S as I}from"./SettingsSection-BaPzETK6.js";import{u as X}from"./useVhostAccess-DUtn_sH1.js";import{s as Y}from"./LocalMediaModal-B9eHVx6y.js";import{u as Z}from"./index-BkOdUxq4.js";import"./react-runtime-D-UPQ57m.js";import"./client-Ci_HPGfl.js";import"./RelayProtocol-BpdH0COG.js";import"./remoteRoutePaths-D8htA0xa.js";import"./CommittedRangeInput-BwuV6Q6c.js";import"./newSessionPrefill-DKcy0abh.js";import"./relay-url-j3kYm5KO.js";import"./appHref-ByaEnJGJ.js";import"./PageHeader-BjwH2pWD.js";import"./SessionHeader.module-BpaFAQ-S.js";import"./HostIdentityContext-DA7dMF-y.js";import"./frontendReload-CBdyvvdy.js";import"./NavigationLayout-BTFsWVtE.js";import"./useSidebarWidth-CBCcbSLg.js";import"./useFileActivity-BoW4X3DY.js";import"./providerChildSessions-DbLFSybt.js";import"./katex-Dv2p4YRM.js";import"./index-CoR-vzsb.js";import"./ProviderBadge-P0VTI71n.js";import"./YepAnywhereLogo-5zFKWjQq.js";import"./index-Cv3tQXyE.js";const tt="_fields_lti5t_1",et="_toggle_lti5t_18",st="_vhostRow_lti5t_23",it="_expiry_lti5t_42",rt="_vhosts_lti5t_60",ot="_vhostHeading_lti5t_67",at="_access_lti5t_85",h={fields:tt,toggle:et,vhostRow:st,expiry:it,vhosts:rt,vhostHeading:ot,access:at};function nt(){const{sourceKey:i}=B(),{version:d,refetch:e}=F(),g=d==null?void 0:d.artifactViewer;return g?t.jsx(ct,{status:g,onSaved:e},i):null}function ct({status:i,onSaved:d}){const{t:e}=A(),{transport:g}=B(),u=X(i),v=n.useId(),[k,U]=n.useState(!!i.localOrigin),[S,K]=n.useState(i.localOrigin??i.defaultLocalOrigin),[R,$]=n.useState(i.publicOrigin??""),[C,J]=n.useState(String(i.port)),[L,M]=n.useState(i.expiryHours),[w,q]=n.useState(i.expiryDays),[_,z]=n.useState(i.vhostPublicRoot??""),[E,G]=n.useState(i.alwaysRewriteVhostLinks===!0),[y,f]=n.useState(()=>(i.vhosts??[]).map(s=>({...s}))),[P,b]=n.useState(!1),[H,m]=n.useState(""),O=i.vhosts!==void 0,N=n.useRef(Promise.resolve()),j=n.useRef(0),V=n.useRef(void 0);async function c(s={}){if(i.locked)return;const l={localEnabled:k,expiryDays:w,expiryHours:L,vhosts:y,alwaysRewriteVhostLinks:E,...s};m("");try{if([l.localEnabled?S:"",R].filter(Boolean).some(o=>new URL(o).hostname===window.location.hostname))throw new Error(e("artifactSeparateHost"));const r=JSON.stringify({port:Number(C),localOrigin:l.localEnabled?S.trim():"",publicOrigin:R.trim(),...l.expiryDays===void 0?{expiryHours:l.expiryHours}:{expiryDays:l.expiryDays},...O?{vhostPublicRoot:_.trim(),alwaysRewriteVhostLinks:l.alwaysRewriteVhostLinks,vhosts:l.vhosts.map(o=>{var D;return{name:o.name.trim(),port:o.port,...(D=o.env)!=null&&D.trim()?{env:o.env.trim()}:{},...u.supported?{public:o.public===!0}:{}}})}:{}});if(r===V.current)return;V.current=r;const p=++j.current;b(!0);const a=N.current.then(async()=>{await g.fetch("/artifacts/config",{method:"PUT",body:r}),await d()});N.current=a.catch(()=>{});try{await a,p===j.current&&m(e("artifactSaved"))}catch(o){p===j.current&&(V.current=void 0,m(o instanceof Error?o.message:String(o)))}finally{p===j.current&&b(!1)}}catch(x){m(x instanceof Error?x.message:String(x))}}return t.jsxs(I,{title:e("artifactSettingsTitle"),description:e("artifactSettingsDescription"),onSubmit:s=>{s.preventDefault(),c()},children:[t.jsx("p",{children:e("appsSettingsAutosave")}),t.jsxs("fieldset",{className:h.fields,disabled:i.locked,children:[t.jsxs("label",{className:h.toggle,children:[t.jsx("input",{type:"checkbox",checked:k,onChange:s=>{U(s.target.checked),c({localEnabled:s.target.checked})}}),e("artifactLocalEnabled")]}),k&&t.jsxs("label",{children:[e("artifactLocalOrigin"),t.jsx("input",{type:"url",value:S,onBlur:()=>void c(),onChange:s=>K(s.target.value)})]}),t.jsxs("label",{children:[e("artifactPublicOrigin"),t.jsx("input",{type:"url",value:R,onBlur:()=>void c(),onChange:s=>$(s.target.value)})]}),t.jsx("p",{children:e("artifactPublicHint")}),t.jsxs("label",{children:[e("artifactPort"),t.jsx("input",{type:"number",min:1,max:65535,value:C,onBlur:()=>void c(),onChange:s=>J(s.target.value)})]}),t.jsx("p",{children:e("artifactPortHint")}),w!==void 0?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:h.expiry,children:[t.jsx("label",{htmlFor:v,children:e("artifactExpiryDaysLabel")}),t.jsx(T,{id:v,min:1,max:30,step:1,value:w,ariaLabel:e("artifactExpiryDaysLabel"),onCommit:s=>{q(s),c({expiryDays:s})}})]}),t.jsx("p",{children:e("artifactExpiryDaysHint")}),t.jsx("p",{children:e("artifactDeleteOnExpiryHint")})]}):L!==void 0&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:h.expiry,children:[t.jsx("label",{htmlFor:v,children:e("artifactExpiryLabel")}),t.jsx(T,{id:v,min:1,max:168,step:1,value:L,ariaLabel:e("artifactExpiryLabel"),onCommit:s=>{M(s),c({expiryHours:s})}})]}),t.jsx("p",{children:e("artifactExpiryHint")})]}),O&&t.jsxs(t.Fragment,{children:[t.jsxs("label",{children:[e("artifactVhostPublicRoot"),t.jsx("input",{type:"text",value:_,onBlur:()=>void c(),autoComplete:"off",spellCheck:!1,onChange:s=>z(s.target.value)})]}),t.jsx("p",{children:e("artifactVhostPublicRootHint",{port:C})}),t.jsxs("label",{className:h.toggle,children:[t.jsx("input",{type:"checkbox",checked:E,onChange:s=>{G(s.target.checked),c({alwaysRewriteVhostLinks:s.target.checked})}}),e("artifactAlwaysRewriteVhostLinks")]}),t.jsx("p",{children:e("artifactAlwaysRewriteVhostLinksHint")}),t.jsxs("div",{className:h.vhosts,children:[t.jsx("span",{className:h.vhostHeading,children:e("artifactVhostTableTitle")}),t.jsx("p",{children:e("artifactVhostTableHint")}),t.jsx("p",{children:e(u.supported?"appAccessHint":"appAccessUnavailable")}),u.error&&t.jsx("p",{role:"alert",children:u.error}),y.map((s,l)=>{var x;return t.jsxs("div",{className:h.vhostRow,children:[t.jsxs("label",{children:[e("artifactVhostName"),t.jsx("input",{type:"text",value:s.name,onBlur:()=>void c(),autoComplete:"off",spellCheck:!1,onChange:r=>f(p=>p.map((a,o)=>o===l?{...a,name:r.target.value}:a))})]}),t.jsxs("label",{children:[e("artifactVhostPort"),t.jsx("input",{type:"number",min:1,max:65535,value:s.port||"",onBlur:()=>void c(),onChange:r=>f(p=>p.map((a,o)=>o===l?{...a,port:Number(r.target.value)}:a))})]}),t.jsxs("label",{children:[e("artifactVhostEnv"),t.jsx("input",{type:"text",value:s.env??"",onBlur:()=>void c(),placeholder:"PLANNOTATOR_PORT",autoComplete:"off",spellCheck:!1,onChange:r=>f(p=>p.map((a,o)=>o===l?{...a,env:r.target.value}:a))})]}),t.jsx("button",{type:"button",onClick:()=>{const r=y.filter((p,a)=>a!==l);f(r),c({vhosts:r})},children:e("artifactVhostRemove")}),u.supported&&t.jsxs("div",{className:h.access,children:[t.jsxs("label",{className:h.toggle,children:[t.jsx("input",{type:"checkbox",checked:s.public===!0,onChange:r=>{const p=y.map((a,o)=>o===l?{...a,public:r.target.checked}:a);f(p),c({vhosts:p})}}),e("appAccessPublic")]}),((x=i.vhosts)==null?void 0:x.some(r=>r.name===s.name&&r.port===s.port))&&t.jsxs(t.Fragment,{children:[t.jsx("button",{type:"button",disabled:!u.config,onClick:async()=>{const r=Y(`http://localhost:${s.port}/`,u.config,window.location.href,i.vhostPublicRoot?"public":void 0);m(r&&await Q(r.url)?e("fileViewerCopied"):e("viewerCopyLinkFailed"))},children:e("appAccessCopy")}),t.jsx("button",{type:"button",disabled:P,onClick:async()=>{b(!0);try{await g.fetch(`/artifacts/vhosts/${encodeURIComponent(s.name)}/revoke`,{method:"POST"}),u.refresh(),m(e("appAccessRevoked"))}catch(r){m(r instanceof Error?r.message:String(r))}finally{b(!1)}},children:e("appAccessRevoke")})]})]})]},l)}),t.jsx("button",{type:"button",onClick:()=>f(s=>[...s,{name:"",port:19432}]),children:e("artifactVhostAdd")})]})]})]}),i.locked&&t.jsx("p",{children:e("artifactLocked")}),P&&t.jsx("p",{role:"status",children:e("artifactSaving")}),H&&t.jsx("p",{role:"status",children:H})]})}function Tt(){const{t:i}=A(),{version:d}=F();return Z(i("settingsAppsTitle")),t.jsx(I,{description:i("settingsAppsDescription"),children:d!=null&&d.artifactViewer?t.jsx(nt,{}):t.jsx("p",{children:i("settingsAppsUnavailable")})})}function Bt(){const{t:i}=A();return t.jsx(W,{to:"/settings/apps",children:i("settingsAppsLink")})}export{Tt as AppsSettings,Bt as AppsSettingsLink};
@@ -1 +1 @@
1
- import{r as l,j as d,u as ae,ax as ve}from"./index-BY-TgOY-.js";import{d as be,e as ge,f as Ae,h as _e,j as te}from"./LocalMediaModal-DyDpC0dk.js";import{b as xe,M as Re}from"./Modal-DOzUIhWU.js";import"./client-D_ikArFV.js";import{n as Ue}from"./providerChildSessions-DVWCZpC4.js";import{p as y,o as je,g as ne}from"./index-YAR5D3xY.js";const O=32,Y=2,le="image/png";function K(e,t){const n=e/t>Y,i=t,o=n?i*Y:e,s=n?Math.max(0,Math.floor((e-o)/2)):0,a=0,c=Math.max(1,Math.round(o/i*O));return{sourceX:s,sourceY:a,sourceWidth:o,sourceHeight:i,width:c,height:O,croppedWide:n}}const Ee="yep-anywhere-attachment-previews",Ce=2,x="images",re=128*1024*1024,J=`thumb:v3:${O}:${Y}:${le}`;function D(e){return e!==null&&"aliasFor"in e}function ue(e){return{aliasFor:e,totalBytes:0,lastAccessedAt:Date.now()}}let q=null;const N=new Map;function Me(e){return e.startsWith("image/")}function he(){return q||(q=je(Ee,Ce,(e,t)=>{if(!e.objectStoreNames.contains(x))e.createObjectStore(x).createIndex("byLastAccessedAt","lastAccessedAt");else{const r=t.objectStore(x);r.indexNames.contains("byLastAccessedAt")||r.createIndex("byLastAccessedAt","lastAccessedAt")}})),q}async function de(e){if(typeof createImageBitmap=="function")try{const t=await createImageBitmap(e),r=K(t.width,t.height),n=document.createElement("canvas");n.width=r.width,n.height=r.height;const i=n.getContext("2d");if(!i){t.close();return}i.drawImage(t,r.sourceX,r.sourceY,r.sourceWidth,r.sourceHeight,0,0,r.width,r.height),t.close();const o=await new Promise(s=>{n.toBlob(a=>s(a??void 0),le)});return o?{blob:o,width:r.width,height:r.height}:void 0}catch{return}}function Ie(e){return e.thumbnailVariant!==J}async function Te(e){const n=e.transaction(x,"readonly").objectStore(x).getAll();return(await new Promise((o,s)=>{n.onsuccess=()=>o(n.result),n.onerror=()=>s(n.error)})??[]).reduce((o,s)=>o+(s.totalBytes??0),0)}async function Se(e,t){if(t<=0)return;const r=e.transaction(x,"readwrite"),n=r.objectStore(x),i=n.index("byLastAccessedAt");let o=0;await new Promise((s,a)=>{const c=i.openCursor();c.onerror=()=>a(c.error),c.onsuccess=()=>{const h=c.result;if(!h||o>=t){s();return}const u=h.value;if(D(u)){h.continue();return}if(o+=u.totalBytes??0,h.delete(),u.path&&u.path!==u.attachmentId){const p=n.get(u.path);p.onerror=()=>a(p.error),p.onsuccess=()=>{const v=p.result;v&&D(v)&&v.aliasFor===u.attachmentId&&n.delete(u.path),h.continue()};return}h.continue()}}),await new Promise((s,a)=>{r.oncomplete=()=>s(),r.onerror=()=>a(r.error),r.onabort=()=>a(r.error??new Error("Transaction aborted"))})}async function se(e,t){const r=await ne(e,x,t);if(!r)return null;if(!D(r))return{key:t,preview:r,viaAlias:!1};const n=await ne(e,x,r.aliasFor);return n&&!D(n)?{key:r.aliasFor,preview:n,viaAlias:!0}:null}function oe(e){N.set(e.attachmentId,e),e.path&&e.path!==e.attachmentId&&N.set(e.path,e)}function Le(e){N.delete(e.attachmentId),e.path&&N.delete(e.path)}async function lt(e,t){if(!Me(e.mimeType))return;const r=e.width!==void 0&&e.height!==void 0?K(e.width,e.height):void 0,n=t.slice(0,t.size,t.type),i=Date.now(),o={attachmentId:e.id,path:e.path,originalName:e.originalName,mimeType:e.mimeType,size:e.size,thumbnailVariant:J,thumbnailWidth:(r==null?void 0:r.width)??O,thumbnailHeight:(r==null?void 0:r.height)??O,fullBlob:n,totalBytes:n.size,createdAt:i,lastAccessedAt:i};oe(o);try{const s=await de(t),a=n.size+((s==null?void 0:s.blob.size)??0),c=await he(),h={...o,thumbnailWidth:(s==null?void 0:s.width)??o.thumbnailWidth,thumbnailHeight:(s==null?void 0:s.height)??o.thumbnailHeight,thumbnailBlob:s==null?void 0:s.blob,totalBytes:a,lastAccessedAt:Date.now()};oe(h),await y(c,x,e.id,h),e.path!==e.id&&await y(c,x,e.path,ue(e.id)).catch(()=>{});const u=await Te(c);u>re&&await Se(c,u-re)}finally{Le(o)}}async function Pe(e,t){const r=N.get(e)??(t&&t!==e?N.get(t):void 0);if(r)return{...r,lastAccessedAt:Date.now()};const n=await he(),i=await se(n,e)??(t&&t!==e?await se(n,t):null);if(!i)return null;let o=i.key,s=i.preview;if(!i.viaAlias&&o!==e&&(s={...s,attachmentId:e},await y(n,x,e,s),await y(n,x,o,ue(e)).catch(()=>{}),o=e),Ie(s)){const c=await de(s.fullBlob);c&&(s={...s,thumbnailWidth:c.width,thumbnailHeight:c.height,thumbnailBlob:c.blob,thumbnailVariant:J},await y(n,x,o,s))}const a={...s,lastAccessedAt:Date.now()};return await y(n,x,o,a),a}function ye(e,t=!0,r){const[n,i]=l.useState(null),[o,s]=l.useState(!1),[a,c]=l.useState(null),h=l.useRef(null),u=xe().transport,p=!r&&u.capabilities.sameOriginUrls;return l.useEffect(()=>{const v=()=>{h.current&&(URL.revokeObjectURL(h.current),h.current=null)};if(!e||!t){v(),i(null),c(null);return}if(p){v(),i(null),s(!1),c(null);return}let b=!1;return s(!0),c(null),v(),i(null),(r?r(e):u.fetchBlob(be(e))).then(w=>{if(b)return;const C=URL.createObjectURL(w);h.current=C,i(C),s(!1)}).catch(w=>{b||(console.error("[useRemoteImage] Failed to fetch image:",w),c(w instanceof Error?w.message:"Failed to load image"),s(!1))}),()=>{b=!0,v()}},[e,p,t,u,r]),e?p?{url:e,loading:!1,error:null}:{url:n,loading:o,error:a}:{url:null,loading:!1,error:null}}const Ne=12,He=8;function G(e,t,r){return r<t?t:Math.min(r,Math.max(t,e))}function B(e,t,r,n){if(r<1||n<1)return null;const i=Math.max(1,e),o=Math.max(1,t),s=Math.min(1,r/i,n/o);return{width:Math.max(1,i*s),height:Math.max(1,o*s)}}function T(e){return e.width*e.height}function ie(e,t,r,n){return G(e,r,n-r-t)}function Be({anchor:e,imageWidth:t,imageHeight:r,viewportWidth:n,viewportHeight:i,margin:o=Ne,gap:s=He}){const a=Math.max(1,n-o*2),c=Math.max(1,i-o*2),h=B(t,r,a,c)??{width:1,height:1},u=T(h)*.5,p=e.left+e.width/2,v=e.top+e.height/2,b=[],U=i-o-(e.top+e.height+s),w=B(t,r,a,U);w&&b.push({size:w,useful:T(w)>=u,box:{top:e.top+e.height+s,left:ie(p-w.width/2,w.width,o,n),width:w.width,height:w.height}});const C=e.top-s-o,g=B(t,r,a,C);g&&b.push({size:g,useful:T(g)>=u,box:{top:e.top-s-g.height,left:ie(p-g.width/2,g.width,o,n),width:g.width,height:g.height}});const M=n-o-(e.left+e.width+s),f=B(t,r,M,c);f&&b.push({size:f,useful:T(f)>=u,box:{top:G(v-f.height/2,o,i-o-f.height),left:e.left+e.width+s,width:f.width,height:f.height}});const A=e.left-s-o,m=B(t,r,A,c);m&&b.push({size:m,useful:T(m)>=u,box:{top:G(v-m.height/2,o,i-o-m.height),left:e.left-s-m.width,width:m.width,height:m.height}});const L=b.find(j=>j.useful)??b.reduce((j,_)=>!j||T(_.size)>T(j.size)?_:j,null);return L?L.box:{top:o,left:o,width:h.width,height:h.height}}const $e="_chip_1e5od_1",Oe="_imageChip_1e5od_13",ke="_main_1e5od_18",ze="_preview_1e5od_33",We="_previewFallback_1e5od_52",Ve="_hoverPreview_1e5od_57",De="_uploading_1e5od_73",Fe="_name_1e5od_77",Xe="_size_1e5od_87",qe="_progress_1e5od_92",Ye="_remove_1e5od_98",R={chip:$e,imageChip:Oe,main:ke,preview:ze,previewFallback:We,hoverPreview:Ve,uploading:De,name:Fe,size:Xe,progress:qe,remove:Ye},Ge=450,fe=/^([0-9a-f-]{36})_/i;function Ke(e){return e.startsWith("image/")}const $=24,Je=8;function ce(e){return e==="-"||e==="_"||e===" "}function me(e){const t=e.trim();if(t.length<=$)return t;const r=$+Je;for(let n=$;n<t.length;n+=1)if(ce(t[n])){if(n<=r)return`${t.slice(0,n).replace(/[ -_]+$/u,"")}...`;break}for(let n=$-1;n>=0;n-=1)if(ce(t[n]))return`${t.slice(0,n).replace(/[ -_]+$/u,"")}...`;return`${t.slice(0,$).replace(/[ -_]+$/u,"")}...`}function Qe(e){if(!e)return null;const t=e.split(/[\\/]/).pop()??"",r=fe.exec(t);return(r==null?void 0:r[1])??null}function Ze(e,t){if(!e)return null;const r=e.includes("\\")?"\\":"/",n=e.split(/[\\/]/);if(n.length<3)return null;const i=n[n.length-1],o=n[n.length-2],s=n[n.length-3];if(!i||!o||!s||!fe.test(i))return null;if(t)return`/api/projects/${encodeURIComponent(t)}/sessions/${encodeURIComponent(o)}/upload/${encodeURIComponent(i)}`;if(s===".attachments"){const a=n.slice(0,-3).join(r);return a?`/api/projects/${te(a)}/sessions/${encodeURIComponent(o)}/upload/${encodeURIComponent(i)}`:null}if(s==="attachments"&&n[n.length-4]===".yep"){const a=n.slice(0,-4).join(r);return a?`/api/projects/${te(a)}/sessions/${encodeURIComponent(o)}/upload/${encodeURIComponent(i)}`:null}return s==="attachments"?null:`/api/projects/${s}/sessions/${encodeURIComponent(o)}/upload/${encodeURIComponent(i)}`}function et(e,t,r,n,i){const[o,s]=l.useState(null),[a,c]=l.useState(null),[h,u]=l.useState(null),[p,v]=l.useState(null),[b,U]=l.useState(!1),[w,C]=l.useState(null),[g,M]=l.useState(!1),f=l.useRef(null),A=l.useRef(null),m=Ae(),S=l.useMemo(()=>m?t?_e(m,t):null:Ze(t,i),[t,i,m]),L=l.useMemo(()=>m?_=>Ue({path:_,relayUrl:m.relayUrl,relayUsername:m.relayUsername}):void 0,[m]);l.useEffect(()=>{let _=!1;if(C(null),s(null),c(null),u(null),v(null),m){U(!1),M(!0);return}return n?(U(!1),M(!1),()=>{f.current&&(URL.revokeObjectURL(f.current),f.current=null),A.current&&(URL.revokeObjectURL(A.current),A.current=null)}):!t&&!e?(U(!1),M(!1),()=>{f.current&&(URL.revokeObjectURL(f.current),f.current=null),A.current&&(URL.revokeObjectURL(A.current),A.current=null)}):(U(!0),M(!1),Pe(e,t).then(E=>{if(_)return;if(!E){U(!1),M(!0);return}const k=E.thumbnailBlob??E.fullBlob,z=URL.createObjectURL(k),W=URL.createObjectURL(E.fullBlob);f.current=z,A.current=W,s(z),c(W),u(E.thumbnailWidth??null),v(E.thumbnailHeight??null),U(!1)}).catch(E=>{_||(S?(C(null),M(!0)):C(E instanceof Error?E.message:"Failed to load attachment preview"),U(!1))}),()=>{_=!0,f.current&&(URL.revokeObjectURL(f.current),f.current=null),A.current&&(URL.revokeObjectURL(A.current),A.current=null)})},[e,t,n,S,m]);const j=ye(S,r&&g&&!n,L);return{previewUrl:n??o??j.url,fullUrl:n??a??j.url,previewWidth:h,previewHeight:p,loading:b||j.loading,error:w??j.error}}function tt({originalName:e,path:t,mimeType:r,sizeLabel:n,onRemove:i}){const{t:o}=ae();return d.jsxs("span",{className:R.chip,title:`${r}, ${n}`,children:[d.jsx("span",{className:R.previewFallback,"aria-hidden":"true",children:"📎"}),d.jsx("span",{className:R.name,title:t??e,children:me(e)}),d.jsx("span",{className:R.size,children:n}),i&&d.jsx("button",{type:"button",className:R.remove,onClick:i,"aria-label":o("attachmentRemove",{name:e}),children:"x"})]})}function nt({attachmentId:e,originalName:t,path:r,mimeType:n,sizeLabel:i,imageWidth:o,imageHeight:s,previewUrl:a,projectId:c,onRemove:h}){const{t:u}=ae(),p=ge(),v=c??(p==null?void 0:p.projectId),[b,U]=l.useState(!1),[w,C]=l.useState(!1),[g,M]=l.useState(null),f=l.useRef(null),A=l.useRef(null),m=l.useRef(null),S=Qe(r),L=e??S??r??t,{previewUrl:j,fullUrl:_,previewWidth:E,previewHeight:k,loading:z,error:W}=et(L,r,b||w,a,v),V=l.useCallback(()=>{f.current!==null&&(window.clearTimeout(f.current),f.current=null)},[]);l.useEffect(()=>V,[V]);const we=()=>{V(),f.current=window.setTimeout(()=>{C(!0)},Ge)},F=()=>{V(),C(!1),M(null)},I=l.useCallback(()=>{var ee;const H=(ee=A.current)==null?void 0:ee.getBoundingClientRect();if(!H)return;const P=m.current,Q=o??(P&&P.naturalWidth>0?P.naturalWidth:null),Z=s??(P&&P.naturalHeight>0?P.naturalHeight:null);!Q||!Z||M(Be({anchor:{top:H.top,left:H.left,width:H.width,height:H.height},imageWidth:Q,imageHeight:Z,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight}))},[s,o]);l.useLayoutEffect(()=>{if(!(!w||!_))return I(),window.addEventListener("resize",I),window.addEventListener("scroll",I,!0),()=>{window.removeEventListener("resize",I),window.removeEventListener("scroll",I,!0)}},[_,w,I]);const X=E&&k?{width:E,height:k}:o&&s?K(o,s):null,pe=X?{width:`${X.width}px`,height:`${X.height}px`}:void 0;return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:`${R.chip} ${R.imageChip}`,children:[d.jsxs("button",{ref:A,type:"button",className:R.main,onClick:()=>{F(),U(!0)},onMouseEnter:we,onMouseLeave:F,onBlur:F,"aria-label":`Open ${t}`,title:`${n}, ${i}`,children:[d.jsx("span",{className:R.preview,"aria-hidden":"true",style:pe,children:j?d.jsx("img",{src:j,alt:""}):d.jsx("span",{className:R.previewFallback,children:"📎"})}),d.jsx("span",{className:R.name,title:r??t,children:me(t)}),d.jsx("span",{className:R.size,children:i})]}),h&&d.jsx("button",{type:"button",className:R.remove,onClick:h,"aria-label":u("attachmentRemove",{name:t}),children:"x"})]}),w&&!b&&_&&ve.createPortal(d.jsx("div",{className:R.hoverPreview,"data-testid":"attachment-hover-preview","aria-hidden":"true",style:g?{top:g.top,left:g.left,width:g.width,height:g.height}:{visibility:"hidden"},children:d.jsx("img",{ref:m,src:_,alt:"",onLoad:I})}),document.body),b&&d.jsx(Re,{title:t,onClose:()=>U(!1),children:d.jsxs("div",{className:"uploaded-image-modal",children:[z&&d.jsx("div",{className:"image-loading",children:"Loading..."}),W&&d.jsx("div",{className:"image-error",children:"Failed to load image"}),_&&d.jsx("img",{src:_,alt:t})]})})]})}function ut(e){return Ke(e.mimeType)?d.jsx(nt,{...e}):d.jsx(tt,{...e})}export{ut as A,R as c,lt as s,ye as u};
1
+ import{r as l,j as d,u as ae,ax as ve}from"./index-umZg0LZ6.js";import{d as be,e as ge,f as Ae,h as _e,j as te}from"./LocalMediaModal-B9eHVx6y.js";import{b as xe,M as Re}from"./Modal-ClSjJagX.js";import"./client-Ci_HPGfl.js";import{o as Ue}from"./providerChildSessions-DbLFSybt.js";import{p as y,o as je,g as ne}from"./index-CoR-vzsb.js";const O=32,Y=2,le="image/png";function K(e,t){const n=e/t>Y,i=t,o=n?i*Y:e,s=n?Math.max(0,Math.floor((e-o)/2)):0,a=0,c=Math.max(1,Math.round(o/i*O));return{sourceX:s,sourceY:a,sourceWidth:o,sourceHeight:i,width:c,height:O,croppedWide:n}}const Ee="yep-anywhere-attachment-previews",Ce=2,x="images",re=128*1024*1024,J=`thumb:v3:${O}:${Y}:${le}`;function D(e){return e!==null&&"aliasFor"in e}function ue(e){return{aliasFor:e,totalBytes:0,lastAccessedAt:Date.now()}}let q=null;const N=new Map;function Me(e){return e.startsWith("image/")}function he(){return q||(q=je(Ee,Ce,(e,t)=>{if(!e.objectStoreNames.contains(x))e.createObjectStore(x).createIndex("byLastAccessedAt","lastAccessedAt");else{const r=t.objectStore(x);r.indexNames.contains("byLastAccessedAt")||r.createIndex("byLastAccessedAt","lastAccessedAt")}})),q}async function de(e){if(typeof createImageBitmap=="function")try{const t=await createImageBitmap(e),r=K(t.width,t.height),n=document.createElement("canvas");n.width=r.width,n.height=r.height;const i=n.getContext("2d");if(!i){t.close();return}i.drawImage(t,r.sourceX,r.sourceY,r.sourceWidth,r.sourceHeight,0,0,r.width,r.height),t.close();const o=await new Promise(s=>{n.toBlob(a=>s(a??void 0),le)});return o?{blob:o,width:r.width,height:r.height}:void 0}catch{return}}function Ie(e){return e.thumbnailVariant!==J}async function Te(e){const n=e.transaction(x,"readonly").objectStore(x).getAll();return(await new Promise((o,s)=>{n.onsuccess=()=>o(n.result),n.onerror=()=>s(n.error)})??[]).reduce((o,s)=>o+(s.totalBytes??0),0)}async function Se(e,t){if(t<=0)return;const r=e.transaction(x,"readwrite"),n=r.objectStore(x),i=n.index("byLastAccessedAt");let o=0;await new Promise((s,a)=>{const c=i.openCursor();c.onerror=()=>a(c.error),c.onsuccess=()=>{const h=c.result;if(!h||o>=t){s();return}const u=h.value;if(D(u)){h.continue();return}if(o+=u.totalBytes??0,h.delete(),u.path&&u.path!==u.attachmentId){const p=n.get(u.path);p.onerror=()=>a(p.error),p.onsuccess=()=>{const v=p.result;v&&D(v)&&v.aliasFor===u.attachmentId&&n.delete(u.path),h.continue()};return}h.continue()}}),await new Promise((s,a)=>{r.oncomplete=()=>s(),r.onerror=()=>a(r.error),r.onabort=()=>a(r.error??new Error("Transaction aborted"))})}async function se(e,t){const r=await ne(e,x,t);if(!r)return null;if(!D(r))return{key:t,preview:r,viaAlias:!1};const n=await ne(e,x,r.aliasFor);return n&&!D(n)?{key:r.aliasFor,preview:n,viaAlias:!0}:null}function oe(e){N.set(e.attachmentId,e),e.path&&e.path!==e.attachmentId&&N.set(e.path,e)}function Le(e){N.delete(e.attachmentId),e.path&&N.delete(e.path)}async function lt(e,t){if(!Me(e.mimeType))return;const r=e.width!==void 0&&e.height!==void 0?K(e.width,e.height):void 0,n=t.slice(0,t.size,t.type),i=Date.now(),o={attachmentId:e.id,path:e.path,originalName:e.originalName,mimeType:e.mimeType,size:e.size,thumbnailVariant:J,thumbnailWidth:(r==null?void 0:r.width)??O,thumbnailHeight:(r==null?void 0:r.height)??O,fullBlob:n,totalBytes:n.size,createdAt:i,lastAccessedAt:i};oe(o);try{const s=await de(t),a=n.size+((s==null?void 0:s.blob.size)??0),c=await he(),h={...o,thumbnailWidth:(s==null?void 0:s.width)??o.thumbnailWidth,thumbnailHeight:(s==null?void 0:s.height)??o.thumbnailHeight,thumbnailBlob:s==null?void 0:s.blob,totalBytes:a,lastAccessedAt:Date.now()};oe(h),await y(c,x,e.id,h),e.path!==e.id&&await y(c,x,e.path,ue(e.id)).catch(()=>{});const u=await Te(c);u>re&&await Se(c,u-re)}finally{Le(o)}}async function Pe(e,t){const r=N.get(e)??(t&&t!==e?N.get(t):void 0);if(r)return{...r,lastAccessedAt:Date.now()};const n=await he(),i=await se(n,e)??(t&&t!==e?await se(n,t):null);if(!i)return null;let o=i.key,s=i.preview;if(!i.viaAlias&&o!==e&&(s={...s,attachmentId:e},await y(n,x,e,s),await y(n,x,o,ue(e)).catch(()=>{}),o=e),Ie(s)){const c=await de(s.fullBlob);c&&(s={...s,thumbnailWidth:c.width,thumbnailHeight:c.height,thumbnailBlob:c.blob,thumbnailVariant:J},await y(n,x,o,s))}const a={...s,lastAccessedAt:Date.now()};return await y(n,x,o,a),a}function ye(e,t=!0,r){const[n,i]=l.useState(null),[o,s]=l.useState(!1),[a,c]=l.useState(null),h=l.useRef(null),u=xe().transport,p=!r&&u.capabilities.sameOriginUrls;return l.useEffect(()=>{const v=()=>{h.current&&(URL.revokeObjectURL(h.current),h.current=null)};if(!e||!t){v(),i(null),c(null);return}if(p){v(),i(null),s(!1),c(null);return}let b=!1;return s(!0),c(null),v(),i(null),(r?r(e):u.fetchBlob(be(e))).then(w=>{if(b)return;const C=URL.createObjectURL(w);h.current=C,i(C),s(!1)}).catch(w=>{b||(console.error("[useRemoteImage] Failed to fetch image:",w),c(w instanceof Error?w.message:"Failed to load image"),s(!1))}),()=>{b=!0,v()}},[e,p,t,u,r]),e?p?{url:e,loading:!1,error:null}:{url:n,loading:o,error:a}:{url:null,loading:!1,error:null}}const Ne=12,He=8;function G(e,t,r){return r<t?t:Math.min(r,Math.max(t,e))}function B(e,t,r,n){if(r<1||n<1)return null;const i=Math.max(1,e),o=Math.max(1,t),s=Math.min(1,r/i,n/o);return{width:Math.max(1,i*s),height:Math.max(1,o*s)}}function T(e){return e.width*e.height}function ie(e,t,r,n){return G(e,r,n-r-t)}function Be({anchor:e,imageWidth:t,imageHeight:r,viewportWidth:n,viewportHeight:i,margin:o=Ne,gap:s=He}){const a=Math.max(1,n-o*2),c=Math.max(1,i-o*2),h=B(t,r,a,c)??{width:1,height:1},u=T(h)*.5,p=e.left+e.width/2,v=e.top+e.height/2,b=[],U=i-o-(e.top+e.height+s),w=B(t,r,a,U);w&&b.push({size:w,useful:T(w)>=u,box:{top:e.top+e.height+s,left:ie(p-w.width/2,w.width,o,n),width:w.width,height:w.height}});const C=e.top-s-o,g=B(t,r,a,C);g&&b.push({size:g,useful:T(g)>=u,box:{top:e.top-s-g.height,left:ie(p-g.width/2,g.width,o,n),width:g.width,height:g.height}});const M=n-o-(e.left+e.width+s),f=B(t,r,M,c);f&&b.push({size:f,useful:T(f)>=u,box:{top:G(v-f.height/2,o,i-o-f.height),left:e.left+e.width+s,width:f.width,height:f.height}});const A=e.left-s-o,m=B(t,r,A,c);m&&b.push({size:m,useful:T(m)>=u,box:{top:G(v-m.height/2,o,i-o-m.height),left:e.left-s-m.width,width:m.width,height:m.height}});const L=b.find(j=>j.useful)??b.reduce((j,_)=>!j||T(_.size)>T(j.size)?_:j,null);return L?L.box:{top:o,left:o,width:h.width,height:h.height}}const $e="_chip_1e5od_1",Oe="_imageChip_1e5od_13",ke="_main_1e5od_18",ze="_preview_1e5od_33",We="_previewFallback_1e5od_52",Ve="_hoverPreview_1e5od_57",De="_uploading_1e5od_73",Fe="_name_1e5od_77",Xe="_size_1e5od_87",qe="_progress_1e5od_92",Ye="_remove_1e5od_98",R={chip:$e,imageChip:Oe,main:ke,preview:ze,previewFallback:We,hoverPreview:Ve,uploading:De,name:Fe,size:Xe,progress:qe,remove:Ye},Ge=450,fe=/^([0-9a-f-]{36})_/i;function Ke(e){return e.startsWith("image/")}const $=24,Je=8;function ce(e){return e==="-"||e==="_"||e===" "}function me(e){const t=e.trim();if(t.length<=$)return t;const r=$+Je;for(let n=$;n<t.length;n+=1)if(ce(t[n])){if(n<=r)return`${t.slice(0,n).replace(/[ -_]+$/u,"")}...`;break}for(let n=$-1;n>=0;n-=1)if(ce(t[n]))return`${t.slice(0,n).replace(/[ -_]+$/u,"")}...`;return`${t.slice(0,$).replace(/[ -_]+$/u,"")}...`}function Qe(e){if(!e)return null;const t=e.split(/[\\/]/).pop()??"",r=fe.exec(t);return(r==null?void 0:r[1])??null}function Ze(e,t){if(!e)return null;const r=e.includes("\\")?"\\":"/",n=e.split(/[\\/]/);if(n.length<3)return null;const i=n[n.length-1],o=n[n.length-2],s=n[n.length-3];if(!i||!o||!s||!fe.test(i))return null;if(t)return`/api/projects/${encodeURIComponent(t)}/sessions/${encodeURIComponent(o)}/upload/${encodeURIComponent(i)}`;if(s===".attachments"){const a=n.slice(0,-3).join(r);return a?`/api/projects/${te(a)}/sessions/${encodeURIComponent(o)}/upload/${encodeURIComponent(i)}`:null}if(s==="attachments"&&n[n.length-4]===".yep"){const a=n.slice(0,-4).join(r);return a?`/api/projects/${te(a)}/sessions/${encodeURIComponent(o)}/upload/${encodeURIComponent(i)}`:null}return s==="attachments"?null:`/api/projects/${s}/sessions/${encodeURIComponent(o)}/upload/${encodeURIComponent(i)}`}function et(e,t,r,n,i){const[o,s]=l.useState(null),[a,c]=l.useState(null),[h,u]=l.useState(null),[p,v]=l.useState(null),[b,U]=l.useState(!1),[w,C]=l.useState(null),[g,M]=l.useState(!1),f=l.useRef(null),A=l.useRef(null),m=Ae(),S=l.useMemo(()=>m?t?_e(m,t):null:Ze(t,i),[t,i,m]),L=l.useMemo(()=>m?_=>Ue({path:_,relayUrl:m.relayUrl,relayUsername:m.relayUsername}):void 0,[m]);l.useEffect(()=>{let _=!1;if(C(null),s(null),c(null),u(null),v(null),m){U(!1),M(!0);return}return n?(U(!1),M(!1),()=>{f.current&&(URL.revokeObjectURL(f.current),f.current=null),A.current&&(URL.revokeObjectURL(A.current),A.current=null)}):!t&&!e?(U(!1),M(!1),()=>{f.current&&(URL.revokeObjectURL(f.current),f.current=null),A.current&&(URL.revokeObjectURL(A.current),A.current=null)}):(U(!0),M(!1),Pe(e,t).then(E=>{if(_)return;if(!E){U(!1),M(!0);return}const k=E.thumbnailBlob??E.fullBlob,z=URL.createObjectURL(k),W=URL.createObjectURL(E.fullBlob);f.current=z,A.current=W,s(z),c(W),u(E.thumbnailWidth??null),v(E.thumbnailHeight??null),U(!1)}).catch(E=>{_||(S?(C(null),M(!0)):C(E instanceof Error?E.message:"Failed to load attachment preview"),U(!1))}),()=>{_=!0,f.current&&(URL.revokeObjectURL(f.current),f.current=null),A.current&&(URL.revokeObjectURL(A.current),A.current=null)})},[e,t,n,S,m]);const j=ye(S,r&&g&&!n,L);return{previewUrl:n??o??j.url,fullUrl:n??a??j.url,previewWidth:h,previewHeight:p,loading:b||j.loading,error:w??j.error}}function tt({originalName:e,path:t,mimeType:r,sizeLabel:n,onRemove:i}){const{t:o}=ae();return d.jsxs("span",{className:R.chip,title:`${r}, ${n}`,children:[d.jsx("span",{className:R.previewFallback,"aria-hidden":"true",children:"📎"}),d.jsx("span",{className:R.name,title:t??e,children:me(e)}),d.jsx("span",{className:R.size,children:n}),i&&d.jsx("button",{type:"button",className:R.remove,onClick:i,"aria-label":o("attachmentRemove",{name:e}),children:"x"})]})}function nt({attachmentId:e,originalName:t,path:r,mimeType:n,sizeLabel:i,imageWidth:o,imageHeight:s,previewUrl:a,projectId:c,onRemove:h}){const{t:u}=ae(),p=ge(),v=c??(p==null?void 0:p.projectId),[b,U]=l.useState(!1),[w,C]=l.useState(!1),[g,M]=l.useState(null),f=l.useRef(null),A=l.useRef(null),m=l.useRef(null),S=Qe(r),L=e??S??r??t,{previewUrl:j,fullUrl:_,previewWidth:E,previewHeight:k,loading:z,error:W}=et(L,r,b||w,a,v),V=l.useCallback(()=>{f.current!==null&&(window.clearTimeout(f.current),f.current=null)},[]);l.useEffect(()=>V,[V]);const we=()=>{V(),f.current=window.setTimeout(()=>{C(!0)},Ge)},F=()=>{V(),C(!1),M(null)},I=l.useCallback(()=>{var ee;const H=(ee=A.current)==null?void 0:ee.getBoundingClientRect();if(!H)return;const P=m.current,Q=o??(P&&P.naturalWidth>0?P.naturalWidth:null),Z=s??(P&&P.naturalHeight>0?P.naturalHeight:null);!Q||!Z||M(Be({anchor:{top:H.top,left:H.left,width:H.width,height:H.height},imageWidth:Q,imageHeight:Z,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight}))},[s,o]);l.useLayoutEffect(()=>{if(!(!w||!_))return I(),window.addEventListener("resize",I),window.addEventListener("scroll",I,!0),()=>{window.removeEventListener("resize",I),window.removeEventListener("scroll",I,!0)}},[_,w,I]);const X=E&&k?{width:E,height:k}:o&&s?K(o,s):null,pe=X?{width:`${X.width}px`,height:`${X.height}px`}:void 0;return d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:`${R.chip} ${R.imageChip}`,children:[d.jsxs("button",{ref:A,type:"button",className:R.main,onClick:()=>{F(),U(!0)},onMouseEnter:we,onMouseLeave:F,onBlur:F,"aria-label":`Open ${t}`,title:`${n}, ${i}`,children:[d.jsx("span",{className:R.preview,"aria-hidden":"true",style:pe,children:j?d.jsx("img",{src:j,alt:""}):d.jsx("span",{className:R.previewFallback,children:"📎"})}),d.jsx("span",{className:R.name,title:r??t,children:me(t)}),d.jsx("span",{className:R.size,children:i})]}),h&&d.jsx("button",{type:"button",className:R.remove,onClick:h,"aria-label":u("attachmentRemove",{name:t}),children:"x"})]}),w&&!b&&_&&ve.createPortal(d.jsx("div",{className:R.hoverPreview,"data-testid":"attachment-hover-preview","aria-hidden":"true",style:g?{top:g.top,left:g.left,width:g.width,height:g.height}:{visibility:"hidden"},children:d.jsx("img",{ref:m,src:_,alt:"",onLoad:I})}),document.body),b&&d.jsx(Re,{title:t,onClose:()=>U(!1),children:d.jsxs("div",{className:"uploaded-image-modal",children:[z&&d.jsx("div",{className:"image-loading",children:"Loading..."}),W&&d.jsx("div",{className:"image-error",children:"Failed to load image"}),_&&d.jsx("img",{src:_,alt:t})]})})]})}function ut(e){return Ke(e.mimeType)?d.jsx(nt,{...e}):d.jsx(tt,{...e})}export{ut as A,R as c,lt as s,ye as u};
@@ -1 +1 @@
1
- import{r as e,d as j,e as B,c as b,j as F}from"./index-BY-TgOY-.js";import{a as s}from"./client-D_ikArFV.js";const A=e.createContext(null);function M({children:o}){const[l,a]=e.useState(!1),[k,n]=e.useState(!1),[i,w]=e.useState(!0),[r,u]=e.useState(!1),[h,g]=e.useState(!1),[y,C]=e.useState(""),[E,S]=e.useState(!1),[m,p]=e.useState(!1),c=j(),f=B(),d=e.useCallback(async()=>{try{const t=await s.getAuthStatus();u(t.enabled),g(t.disabledByEnv),C(t.authFilePath),a(t.authenticated),n(t.setupRequired),S(t.hasDesktopToken??!1),p(t.localhostOpen??!1)}catch(t){console.warn("[Auth] Auth check failed, assuming auth not enabled:",t),a(!0),n(!1),u(!1),g(!1)}finally{w(!1)}},[]);e.useEffect(()=>{d()},[d]),e.useEffect(()=>b.onLoginRequired(()=>{console.log("[Auth] Login required signal received"),a(!1)}),[]),e.useEffect(()=>{!i&&!l&&r&&!h&&f.pathname!=="/login"&&c("/login",{state:{from:f.pathname}})},[i,l,r,h,f.pathname,c]);const v=e.useCallback(async(t,R)=>{await s.login(t,R),a(!0),n(!1),b.clearLoginRequired()},[]),x=e.useCallback(async()=>{await s.logout(),a(!1),c("/login")},[c]),L=e.useCallback(async t=>{await s.enableAuth(t),u(!0),a(!1),n(!1)},[]),P=e.useCallback(async()=>{await s.disableAuth(),u(!1),a(!0)},[]),q=e.useCallback(async t=>{await s.setupAccount(t),u(!0),a(!0),n(!1),b.clearLoginRequired()},[]),D=e.useCallback(async t=>{await s.changePassword(t)},[]),O=e.useCallback(async t=>{await s.setLocalhostAccess(t),p(t)},[]);return F.jsx(A.Provider,{value:{isAuthenticated:l,isSetupMode:k,isLoading:i,authEnabled:r,authDisabledByEnv:h,authFilePath:y,hasDesktopToken:E,localhostOpen:m,login:v,logout:x,enableAuth:L,disableAuth:P,setupAccount:q,changePassword:D,setLocalhostOpen:O,checkAuth:d},children:o})}function H(){const o=e.useContext(A);if(!o)throw new Error("useAuth must be used within an AuthProvider");return o}function N(){return e.useContext(A)}export{M as A,N as a,H as u};
1
+ import{r as e,d as j,e as B,c as b,j as F}from"./index-umZg0LZ6.js";import{a as s}from"./client-Ci_HPGfl.js";const A=e.createContext(null);function M({children:o}){const[l,a]=e.useState(!1),[k,n]=e.useState(!1),[i,w]=e.useState(!0),[r,u]=e.useState(!1),[h,g]=e.useState(!1),[y,C]=e.useState(""),[E,S]=e.useState(!1),[m,p]=e.useState(!1),c=j(),f=B(),d=e.useCallback(async()=>{try{const t=await s.getAuthStatus();u(t.enabled),g(t.disabledByEnv),C(t.authFilePath),a(t.authenticated),n(t.setupRequired),S(t.hasDesktopToken??!1),p(t.localhostOpen??!1)}catch(t){console.warn("[Auth] Auth check failed, assuming auth not enabled:",t),a(!0),n(!1),u(!1),g(!1)}finally{w(!1)}},[]);e.useEffect(()=>{d()},[d]),e.useEffect(()=>b.onLoginRequired(()=>{console.log("[Auth] Login required signal received"),a(!1)}),[]),e.useEffect(()=>{!i&&!l&&r&&!h&&f.pathname!=="/login"&&c("/login",{state:{from:f.pathname}})},[i,l,r,h,f.pathname,c]);const v=e.useCallback(async(t,R)=>{await s.login(t,R),a(!0),n(!1),b.clearLoginRequired()},[]),x=e.useCallback(async()=>{await s.logout(),a(!1),c("/login")},[c]),L=e.useCallback(async t=>{await s.enableAuth(t),u(!0),a(!1),n(!1)},[]),P=e.useCallback(async()=>{await s.disableAuth(),u(!1),a(!0)},[]),q=e.useCallback(async t=>{await s.setupAccount(t),u(!0),a(!0),n(!1),b.clearLoginRequired()},[]),D=e.useCallback(async t=>{await s.changePassword(t)},[]),O=e.useCallback(async t=>{await s.setLocalhostAccess(t),p(t)},[]);return F.jsx(A.Provider,{value:{isAuthenticated:l,isSetupMode:k,isLoading:i,authEnabled:r,authDisabledByEnv:h,authFilePath:y,hasDesktopToken:E,localhostOpen:m,login:v,logout:x,enableAuth:L,disableAuth:P,setupAccount:q,changePassword:D,setLocalhostOpen:O,checkAuth:d},children:o})}function H(){const o=e.useContext(A);if(!o)throw new Error("useAuth must be used within an AuthProvider");return o}function N(){return e.useContext(A)}export{M as A,N as a,H as u};
@@ -1,2 +1,2 @@
1
- import{u as P,r as c,j as s}from"./index-BY-TgOY-.js";import{M as B}from"./providerChildSessions-DVWCZpC4.js";const T="_root_1798n_1",$="_error_1798n_12",z="_killed_1798n_13",A="_header_1798n_21",F="_glyph_1798n_28",H="_line_1798n_34",K="_meta_1798n_41",I="_running_1798n_51",q="_spinner_1798n_57",G="_exitNonzero_1798n_73",J="_preview_1798n_82",Q="_output_1798n_94",U="_stderr_1798n_98",V="_truncated_1798n_104",W="_actions_1798n_110",X="_action_1798n_110",Y="_actionDelete_1798n_133",i={root:T,error:$,killed:z,header:A,glyph:F,line:H,meta:K,running:I,spinner:q,exitNonzero:G,preview:J,output:Q,stderr:U,truncated:V,actions:W,action:X,actionDelete:Y};function Z(n){if(n<1e3)return`${n}ms`;const t=Math.round(n/1e3),l=Math.floor(t/60),u=t%60;return l>0?`${l}m${String(u).padStart(2,"0")}s`:`${u}s`}const j={running:void 0,done:void 0,error:i.error,killed:i.killed};function nt({object:n,handlers:t,outputExpanded:l,onOutputExpandedChange:u}){const{t:o}=P(),[a,N]=c.useState(null),[b,C]=c.useState(()=>{var e;return((e=t==null?void 0:t.shouldExpandOutput)==null?void 0:e.call(t,n.id))??n.status==="running"}),[v,d]=c.useState(!1),[w,_]=c.useState(!1),[D,O]=c.useState(0),[y,R]=c.useState(!1),m=c.useRef(null),r=n.status!=="running",p=t==null?void 0:t.fetchOutput,x=l??b,E=e=>{l===void 0&&C(e),u==null||u(e)};c.useEffect(()=>{if(!x){m.current=null,N(null),d(!1),_(!1),R(!1);return}if(!r||!p)return;const e=`${n.id}:${n.status}`;if(m.current===e)return;m.current=e,d(!0),_(!1);let g=!1;return p(n.id).then(M=>{g||(N(M),d(!1))},()=>{g||(m.current=null,d(!1),_(!0))}),()=>{g=!0}},[x,r,p,n.id,n.status,D]);const k=(a==null?void 0:a.stderr)??n.stderrPreview??"",L=(a==null?void 0:a.stdout)??n.stdoutPreview??"",f=(a==null?void 0:a.stdoutHtml)??"",S=n.exitCode!==void 0?o("bangExitCode",{code:String(n.exitCode)}):null;return s.jsxs("div",{className:[i.root,j[n.status]].filter(Boolean).join(" "),role:"group","aria-label":o("bangBlockAriaLabel"),children:[s.jsxs("div",{className:i.header,children:[s.jsx("span",{className:i.glyph,"aria-hidden":"true",children:"!!"}),s.jsx("code",{className:i.line,title:n.cwd,children:n.command}),s.jsxs("span",{className:i.meta,children:[n.status==="running"&&s.jsxs("span",{className:i.running,children:[s.jsx("span",{className:i.spinner,"aria-hidden":"true"}),o("bangRunning")]}),S&&s.jsx("span",{className:n.exitCode===0?void 0:i.exitNonzero,children:S}),n.durationMs!==void 0&&s.jsx("span",{children:Z(n.durationMs)})]})]}),n.error&&s.jsx("div",{className:i.error,role:"alert",children:n.error}),n.status==="running"?(n.stdoutPreview||n.stderrPreview)&&s.jsx("pre",{className:i.preview,children:[n.stdoutPreview,n.stderrPreview].filter(Boolean).join(`
1
+ import{u as P,r as c,j as s}from"./index-umZg0LZ6.js";import{M as B}from"./providerChildSessions-DbLFSybt.js";const T="_root_1798n_1",$="_error_1798n_12",z="_killed_1798n_13",A="_header_1798n_21",F="_glyph_1798n_28",H="_line_1798n_34",K="_meta_1798n_41",I="_running_1798n_51",q="_spinner_1798n_57",G="_exitNonzero_1798n_73",J="_preview_1798n_82",Q="_output_1798n_94",U="_stderr_1798n_98",V="_truncated_1798n_104",W="_actions_1798n_110",X="_action_1798n_110",Y="_actionDelete_1798n_133",i={root:T,error:$,killed:z,header:A,glyph:F,line:H,meta:K,running:I,spinner:q,exitNonzero:G,preview:J,output:Q,stderr:U,truncated:V,actions:W,action:X,actionDelete:Y};function Z(n){if(n<1e3)return`${n}ms`;const t=Math.round(n/1e3),l=Math.floor(t/60),u=t%60;return l>0?`${l}m${String(u).padStart(2,"0")}s`:`${u}s`}const j={running:void 0,done:void 0,error:i.error,killed:i.killed};function nt({object:n,handlers:t,outputExpanded:l,onOutputExpandedChange:u}){const{t:o}=P(),[a,N]=c.useState(null),[b,C]=c.useState(()=>{var e;return((e=t==null?void 0:t.shouldExpandOutput)==null?void 0:e.call(t,n.id))??n.status==="running"}),[v,d]=c.useState(!1),[w,_]=c.useState(!1),[D,O]=c.useState(0),[y,R]=c.useState(!1),m=c.useRef(null),r=n.status!=="running",p=t==null?void 0:t.fetchOutput,x=l??b,E=e=>{l===void 0&&C(e),u==null||u(e)};c.useEffect(()=>{if(!x){m.current=null,N(null),d(!1),_(!1),R(!1);return}if(!r||!p)return;const e=`${n.id}:${n.status}`;if(m.current===e)return;m.current=e,d(!0),_(!1);let g=!1;return p(n.id).then(M=>{g||(N(M),d(!1))},()=>{g||(m.current=null,d(!1),_(!0))}),()=>{g=!0}},[x,r,p,n.id,n.status,D]);const k=(a==null?void 0:a.stderr)??n.stderrPreview??"",L=(a==null?void 0:a.stdout)??n.stdoutPreview??"",f=(a==null?void 0:a.stdoutHtml)??"",S=n.exitCode!==void 0?o("bangExitCode",{code:String(n.exitCode)}):null;return s.jsxs("div",{className:[i.root,j[n.status]].filter(Boolean).join(" "),role:"group","aria-label":o("bangBlockAriaLabel"),children:[s.jsxs("div",{className:i.header,children:[s.jsx("span",{className:i.glyph,"aria-hidden":"true",children:"!!"}),s.jsx("code",{className:i.line,title:n.cwd,children:n.command}),s.jsxs("span",{className:i.meta,children:[n.status==="running"&&s.jsxs("span",{className:i.running,children:[s.jsx("span",{className:i.spinner,"aria-hidden":"true"}),o("bangRunning")]}),S&&s.jsx("span",{className:n.exitCode===0?void 0:i.exitNonzero,children:S}),n.durationMs!==void 0&&s.jsx("span",{children:Z(n.durationMs)})]})]}),n.error&&s.jsx("div",{className:i.error,role:"alert",children:n.error}),n.status==="running"?(n.stdoutPreview||n.stderrPreview)&&s.jsx("pre",{className:i.preview,children:[n.stdoutPreview,n.stderrPreview].filter(Boolean).join(`
2
2
  `)}):f&&!y?s.jsx(B,{className:i.output,html:f,ariaLabel:o("bangOutputAriaLabel")}):L?s.jsx("pre",{className:i.preview,children:L}):null,r&&k.trim()&&s.jsxs("details",{className:i.stderr,open:!0,children:[s.jsx("summary",{children:o("bangStderrLabel")}),s.jsx("pre",{className:i.preview,children:k})]}),(n.stdoutTruncated||(a==null?void 0:a.responseTruncated))&&s.jsx("div",{className:i.truncated,children:o("bangTruncatedNote")}),s.jsxs("div",{className:i.actions,children:[n.status==="running"&&(t==null?void 0:t.onKill)&&s.jsx("button",{type:"button",className:i.action,onClick:()=>{var e;return(e=t.onKill)==null?void 0:e.call(t,n.id)},children:o("bangCancel")}),r&&f&&s.jsx("button",{type:"button",className:i.action,onClick:()=>R(e=>!e),children:o(y?"bangRendered":"bangRaw")}),r&&p&&s.jsx("button",{type:"button",className:i.action,disabled:v,onClick:()=>{w?(_(!1),O(e=>e+1)):E(!x)},children:o(v?"bangLoadingOutput":w?"bangRetryOutput":x?"bangHideOutput":"bangLoadOutput")}),(t==null?void 0:t.onRecall)&&s.jsx("button",{type:"button",className:i.action,onClick:()=>{var e;return(e=t.onRecall)==null?void 0:e.call(t,n.command)},title:o("bangRecallTitle"),children:o("bangRecall")}),r&&(t==null?void 0:t.onRerun)&&s.jsx("button",{type:"button",className:i.action,onClick:()=>{var e;return(e=t.onRerun)==null?void 0:e.call(t,n.command)},children:o("bangRerun")}),r&&(t==null?void 0:t.onEcho)&&s.jsx("button",{type:"button",className:i.action,onClick:()=>{var e;return(e=t.onEcho)==null?void 0:e.call(t,n)},title:o("bangEchoTitle"),children:o("bangEcho")}),r&&(t==null?void 0:t.onDelete)&&s.jsx("button",{type:"button",className:[i.action,i.actionDelete].join(" "),onClick:()=>{var e;return(e=t.onDelete)==null?void 0:e.call(t,n.id)},children:o("bangDelete")})]})]})}export{nt as B};
@@ -1 +1 @@
1
- import{u as x,r as u,j as e,L as y,d as g}from"./index-BY-TgOY-.js";import{a as j}from"./client-D_ikArFV.js";import{B as b}from"./BangCommandDisplayObject-BDGW0BZN.js";import{P as f}from"./PageHeader-Ca3PbaMb.js";import{u as _}from"./Modal-DOzUIhWU.js";import{MainContent as A}from"./index-BgkZrNQv.js";import{u as k}from"./NavigationLayout-D8BMwd7T.js";import{c as h}from"./sessionNavigationState-MSOOrZi4.js";import"./react-runtime-D-UPQ57m.js";import"./RelayProtocol-DOWXVB0k.js";import"./providerChildSessions-DVWCZpC4.js";import"./LocalMediaModal-DyDpC0dk.js";import"./newSessionPrefill-DKcy0abh.js";import"./appHref-ByaEnJGJ.js";import"./katex-Dv2p4YRM.js";import"./remoteRoutePaths-BxKY1U2z.js";import"./index-YAR5D3xY.js";import"./relay-url-j3kYm5KO.js";import"./ProviderBadge-BKZVllDn.js";import"./SessionHeader.module-CHO2T3eQ.js";import"./HostIdentityContext-DbEx7dor.js";import"./frontendReload-DN8qVYjF.js";import"./useSidebarWidth-CITe0sSV.js";import"./useFileActivity-D0JXhEz7.js";import"./YepAnywhereLogo-C4H1sg3q.js";import"./types-BHkriVjU.js";const v="_page_znn8x_16",N="_empty_znn8x_21",I="_entry_znn8x_26",C="_entryMeta_znn8x_30",E="_entrySession_znn8x_38",S="_entryActions_znn8x_48",w="_entryAction_znn8x_48",o={page:v,empty:N,entry:I,entryMeta:C,entrySession:E,entryActions:S,entryAction:w};function H({projectId:i,sessionId:p,command:l,objectId:m,basePath:s}){const{t:n}=x(),r=g(),a=`${s}/projects/${i}/sessions/${p}`;return e.jsxs("span",{className:o.entryActions,children:[e.jsx("button",{type:"button",className:o.entryAction,"aria-label":n("bangHistoryActionEdit"),title:n("bangHistoryActionEdit"),onClick:()=>r(a,{state:h({composerPrefill:`!!${l}`})}),children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e.jsx("path",{d:"M11 2.5l2.5 2.5L6 12.5 3 13l.5-3z"})})}),e.jsx("button",{type:"button",className:o.entryAction,"aria-label":n("bangHistoryActionNew"),title:n("bangHistoryActionNew"),onClick:()=>r(a,{state:h({focusComposer:!0})}),children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e.jsx("path",{d:"M8 3.5v9M3.5 8h9"})})}),e.jsx("button",{type:"button",className:o.entryAction,"aria-label":n("bangHistoryActionJump"),title:n("bangHistoryActionJump"),onClick:()=>r(a,{state:h({scrollToRenderId:m})}),children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e.jsx("path",{d:"M8 2.5v7M4.5 6l3.5 3.5L11.5 6M3 13h10"})})})]})}function st(){const{t:i}=x(),p=_(),{openSidebar:l,isWideScreen:m}=k(),[s,n]=u.useState(null),[r,a]=u.useState(null);return u.useEffect(()=>{let t=!1;return j.fetchBangCommandHistory().then(c=>{t||n(c.entries.filter(d=>d.object.kind==="bang-command"))},()=>{t||n([])}),()=>{t=!0}},[]),e.jsxs(A,{isWideScreen:m,children:[e.jsx(f,{title:i("bangHistoryTitle"),onOpenSidebar:l}),e.jsxs("div",{className:o.page,children:[s!==null&&s.length===0&&e.jsx("div",{className:o.empty,children:i("bangHistoryEmpty")}),s==null?void 0:s.map(t=>{const c=`${t.sessionId}-${t.object.id}`;return e.jsxs("div",{className:o.entry,children:[e.jsxs("div",{className:o.entryMeta,children:[e.jsx("span",{className:"bang-history-entry-time",children:new Date(t.object.createdAt).toLocaleString()}),e.jsx("span",{className:"bang-history-entry-cwd",title:t.object.cwd,children:t.object.cwd.split("/").pop()}),t.projectId&&e.jsx(y,{to:`${p}/projects/${t.projectId}/sessions/${t.sessionId}`,className:o.entrySession,children:i("bangHistoryOpenSession")}),t.projectId&&e.jsx(H,{projectId:t.projectId,sessionId:t.sessionId,command:t.object.command,objectId:t.object.id,basePath:p})]}),e.jsx(b,{object:t.object,outputExpanded:r===c,onOutputExpandedChange:d=>{a(d?c:null)},handlers:t.projectId?{fetchOutput:d=>j.fetchBangCommandOutput(t.projectId,t.sessionId,d)}:void 0})]},c)})]})]})}export{st as BangCommandsPage};
1
+ import{u as x,r as u,j as e,L as y,d as g}from"./index-umZg0LZ6.js";import{a as j}from"./client-Ci_HPGfl.js";import{B as b}from"./BangCommandDisplayObject-BH2KRGnc.js";import{P as f}from"./PageHeader-BjwH2pWD.js";import{u as _}from"./Modal-ClSjJagX.js";import{MainContent as A}from"./index-Cv3tQXyE.js";import{u as k}from"./NavigationLayout-BTFsWVtE.js";import{c as h}from"./sessionNavigationState-BXejf2ZW.js";import"./react-runtime-D-UPQ57m.js";import"./RelayProtocol-BpdH0COG.js";import"./providerChildSessions-DbLFSybt.js";import"./LocalMediaModal-B9eHVx6y.js";import"./newSessionPrefill-DKcy0abh.js";import"./relay-url-j3kYm5KO.js";import"./appHref-ByaEnJGJ.js";import"./katex-Dv2p4YRM.js";import"./remoteRoutePaths-D8htA0xa.js";import"./index-CoR-vzsb.js";import"./ProviderBadge-P0VTI71n.js";import"./SessionHeader.module-BpaFAQ-S.js";import"./HostIdentityContext-DA7dMF-y.js";import"./frontendReload-CBdyvvdy.js";import"./useSidebarWidth-CBCcbSLg.js";import"./useFileActivity-BoW4X3DY.js";import"./YepAnywhereLogo-5zFKWjQq.js";import"./types-BHkriVjU.js";const v="_page_znn8x_16",N="_empty_znn8x_21",I="_entry_znn8x_26",C="_entryMeta_znn8x_30",E="_entrySession_znn8x_38",S="_entryActions_znn8x_48",w="_entryAction_znn8x_48",o={page:v,empty:N,entry:I,entryMeta:C,entrySession:E,entryActions:S,entryAction:w};function H({projectId:i,sessionId:p,command:l,objectId:m,basePath:s}){const{t:n}=x(),r=g(),a=`${s}/projects/${i}/sessions/${p}`;return e.jsxs("span",{className:o.entryActions,children:[e.jsx("button",{type:"button",className:o.entryAction,"aria-label":n("bangHistoryActionEdit"),title:n("bangHistoryActionEdit"),onClick:()=>r(a,{state:h({composerPrefill:`!!${l}`})}),children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e.jsx("path",{d:"M11 2.5l2.5 2.5L6 12.5 3 13l.5-3z"})})}),e.jsx("button",{type:"button",className:o.entryAction,"aria-label":n("bangHistoryActionNew"),title:n("bangHistoryActionNew"),onClick:()=>r(a,{state:h({focusComposer:!0})}),children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e.jsx("path",{d:"M8 3.5v9M3.5 8h9"})})}),e.jsx("button",{type:"button",className:o.entryAction,"aria-label":n("bangHistoryActionJump"),title:n("bangHistoryActionJump"),onClick:()=>r(a,{state:h({scrollToRenderId:m})}),children:e.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:e.jsx("path",{d:"M8 2.5v7M4.5 6l3.5 3.5L11.5 6M3 13h10"})})})]})}function st(){const{t:i}=x(),p=_(),{openSidebar:l,isWideScreen:m}=k(),[s,n]=u.useState(null),[r,a]=u.useState(null);return u.useEffect(()=>{let t=!1;return j.fetchBangCommandHistory().then(c=>{t||n(c.entries.filter(d=>d.object.kind==="bang-command"))},()=>{t||n([])}),()=>{t=!0}},[]),e.jsxs(A,{isWideScreen:m,children:[e.jsx(f,{title:i("bangHistoryTitle"),onOpenSidebar:l}),e.jsxs("div",{className:o.page,children:[s!==null&&s.length===0&&e.jsx("div",{className:o.empty,children:i("bangHistoryEmpty")}),s==null?void 0:s.map(t=>{const c=`${t.sessionId}-${t.object.id}`;return e.jsxs("div",{className:o.entry,children:[e.jsxs("div",{className:o.entryMeta,children:[e.jsx("span",{className:"bang-history-entry-time",children:new Date(t.object.createdAt).toLocaleString()}),e.jsx("span",{className:"bang-history-entry-cwd",title:t.object.cwd,children:t.object.cwd.split("/").pop()}),t.projectId&&e.jsx(y,{to:`${p}/projects/${t.projectId}/sessions/${t.sessionId}`,className:o.entrySession,children:i("bangHistoryOpenSession")}),t.projectId&&e.jsx(H,{projectId:t.projectId,sessionId:t.sessionId,command:t.object.command,objectId:t.object.id,basePath:p})]}),e.jsx(b,{object:t.object,outputExpanded:r===c,onOutputExpandedChange:d=>{a(d?c:null)},handlers:t.projectId?{fetchOutput:d=>j.fetchBangCommandOutput(t.projectId,t.sessionId,d)}:void 0})]},c)})]})]})}export{st as BangCommandsPage};
@@ -1 +1 @@
1
- import{r as m,j as a}from"./index-BY-TgOY-.js";import{u as f}from"./providerChildSessions-DVWCZpC4.js";import"./react-runtime-D-UPQ57m.js";import"./client-D_ikArFV.js";import"./RelayProtocol-DOWXVB0k.js";import"./Modal-DOzUIhWU.js";import"./remoteRoutePaths-BxKY1U2z.js";import"./LocalMediaModal-DyDpC0dk.js";import"./newSessionPrefill-DKcy0abh.js";import"./appHref-ByaEnJGJ.js";import"./katex-Dv2p4YRM.js";import"./index-YAR5D3xY.js";import"./relay-url-j3kYm5KO.js";import"./ProviderBadge-BKZVllDn.js";const p="browser-debug";function K({t:e,active:r,connected:u,disabled:l,className:c,title:b,menuItem:x=!1,onToggle:o,onReactivate:n,onReload:i,children:B,dataAttributes:w}){const t=f(e,{dismiss:e("toolbarBrowserDebugDismissMenu"),menu:e("toolbarBrowserDebugMenu")}),s=m.useMemo(()=>r?[{label:e("toolbarBrowserDebugReload"),onSelect:i},{label:e("toolbarBrowserDebugReactivate"),onSelect:n,disabled:u},{label:e("toolbarBrowserDebugDisableNow"),onSelect:o,separatorBefore:!0}]:[{label:e("toolbarBrowserDebugEnable"),onSelect:o}],[r,u,n,i,o,e]);m.useEffect(()=>{t.refreshOpenActions(p,s)},[s,t.refreshOpenActions]);const D=x?{role:"menuitemcheckbox","aria-checked":r}:{"aria-pressed":r};return a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:c,...w,...t.targetProps(s,o,{contextKey:p}),...D,title:b,"aria-label":b,disabled:l,"data-browser-debug-context-menu":"true",children:B}),t.menu]})}export{K as BrowserDebugToolbarButton};
1
+ import{r as m,j as a}from"./index-umZg0LZ6.js";import{u as f}from"./providerChildSessions-DbLFSybt.js";import"./react-runtime-D-UPQ57m.js";import"./client-Ci_HPGfl.js";import"./RelayProtocol-BpdH0COG.js";import"./Modal-ClSjJagX.js";import"./remoteRoutePaths-D8htA0xa.js";import"./LocalMediaModal-B9eHVx6y.js";import"./newSessionPrefill-DKcy0abh.js";import"./relay-url-j3kYm5KO.js";import"./appHref-ByaEnJGJ.js";import"./katex-Dv2p4YRM.js";import"./index-CoR-vzsb.js";import"./ProviderBadge-P0VTI71n.js";const p="browser-debug";function K({t:e,active:r,connected:u,disabled:l,className:c,title:b,menuItem:x=!1,onToggle:o,onReactivate:n,onReload:i,children:B,dataAttributes:w}){const t=f(e,{dismiss:e("toolbarBrowserDebugDismissMenu"),menu:e("toolbarBrowserDebugMenu")}),s=m.useMemo(()=>r?[{label:e("toolbarBrowserDebugReload"),onSelect:i},{label:e("toolbarBrowserDebugReactivate"),onSelect:n,disabled:u},{label:e("toolbarBrowserDebugDisableNow"),onSelect:o,separatorBefore:!0}]:[{label:e("toolbarBrowserDebugEnable"),onSelect:o}],[r,u,n,i,o,e]);m.useEffect(()=>{t.refreshOpenActions(p,s)},[s,t.refreshOpenActions]);const D=x?{role:"menuitemcheckbox","aria-checked":r}:{"aria-pressed":r};return a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button",className:c,...w,...t.targetProps(s,o,{contextKey:p}),...D,title:b,"aria-label":b,disabled:l,"data-browser-debug-context-menu":"true",children:B}),t.menu]})}export{K as BrowserDebugToolbarButton};
@@ -1,4 +1,4 @@
1
- import{r as v,h as de,U as me,u as A,j as e,L as he,s as z,aV as pe,aW as xe,f as J}from"./index-BY-TgOY-.js";import{j as K}from"./types-BHkriVjU.js";import{a as ve}from"./client-D_ikArFV.js";import{u as se}from"./useRelativeNow-XM1dKxcx.js";import{e as ge,u as Me}from"./Modal-DOzUIhWU.js";import{a as fe}from"./frontendReload-DN8qVYjF.js";import{M as _e}from"./MessageAge-CKdiBg7K.js";import{S as w}from"./SettingsItem-BWF_CyTI.js";import{u as be,b as je,H as Te}from"./index-BrCZcBcO.js";import{S as W}from"./SettingsSection-DbOwfvBD.js";import"./react-runtime-D-UPQ57m.js";import"./RelayProtocol-DOWXVB0k.js";import"./remoteRoutePaths-BxKY1U2z.js";import"./PageHeader-Ca3PbaMb.js";import"./LocalMediaModal-DyDpC0dk.js";import"./newSessionPrefill-DKcy0abh.js";import"./appHref-ByaEnJGJ.js";import"./SessionHeader.module-CHO2T3eQ.js";import"./HostIdentityContext-DbEx7dor.js";import"./NavigationLayout-D8BMwd7T.js";import"./useSidebarWidth-CITe0sSV.js";import"./useFileActivity-D0JXhEz7.js";import"./providerChildSessions-DVWCZpC4.js";import"./katex-Dv2p4YRM.js";import"./index-YAR5D3xY.js";import"./relay-url-j3kYm5KO.js";import"./ProviderBadge-BKZVllDn.js";import"./YepAnywhereLogo-C4H1sg3q.js";import"./index-BgkZrNQv.js";const ye="_tokenInput_12zei_8",Ee="_evidence_12zei_12",we="_recencyControl_12zei_19",Ce="_chartPanel_12zei_20",Ne="_recencyHeader_12zei_27",Se="_eventTableSection_12zei_36",Ie="_recencyInputs_12zei_58",ke="_expectedExpiryToggle_12zei_65",Be="_sliderStack_12zei_92",Fe="_sliderLabels_12zei_104",Re="_recencyTextInput_12zei_113",Le="_chartGrid_12zei_126",_={tokenInput:ye,evidence:Ee,recencyControl:we,chartPanel:Ce,recencyHeader:Ne,eventTableSection:Se,recencyInputs:Ie,expectedExpiryToggle:ke,sliderStack:Be,sliderLabels:Fe,recencyTextInput:Re,chartGrid:Le},$e=["misses","hits","all"],te="misses";function Ae(s){return $e.includes(s)?s:void 0}const $=de(me.cacheMissEventOutcomeFilter,te,Ae);$.set;$.reset;function He(){return{outcomeFilter:v.useSyncExternalStore($.subscribe,$.read,()=>te),setOutcomeFilter:$.set}}const Pe="_viewer_v96yw_1",De="_toolbar_v96yw_8",We="_filterControls_v96yw_17",Ve="_filterLabel_v96yw_25",Ue="_outcomeLabel_v96yw_34",Ge="_matchCount_v96yw_55",Oe="_scroller_v96yw_62",ze="_table_v96yw_67",Je="_tupleColumn_v96yw_93",Ke="_eventTimeColumn_v96yw_97",Ye="_resultColumn_v96yw_101",Xe="_kindColumn_v96yw_102",qe="_gapColumn_v96yw_106",Qe="_openColumn_v96yw_110",Ze="_tokensColumn_v96yw_114",es="_messageColumn_v96yw_118",ss="_groupRow_v96yw_122",ts="_groupButton_v96yw_126",ns="_groupSummary_v96yw_141",is="_eventRow_v96yw_146",cs="_numeric_v96yw_163",as="_age_v96yw_168",rs="_messageReference_v96yw_169",ls="_eventTimestamp_v96yw_178",os="_sessionMarker_v96yw_195",us="_messageJump_v96yw_204",ds="_miss_v96yw_219",ms="_hit_v96yw_224",hs="_expectedMiss_v96yw_229",ps="_openLink_v96yw_234",h={viewer:Pe,toolbar:De,filterControls:We,filterLabel:Ve,outcomeLabel:Ue,matchCount:Ge,scroller:Oe,table:ze,tupleColumn:Je,eventTimeColumn:Ke,resultColumn:Ye,kindColumn:Xe,gapColumn:qe,openColumn:Qe,tokensColumn:Ze,messageColumn:es,groupRow:ss,groupButton:ts,groupSummary:ns,eventRow:is,numeric:cs,age:as,messageReference:rs,eventTimestamp:ls,sessionMarker:os,messageJump:us,miss:ds,hit:ms,expectedMiss:hs,openLink:ps};function xs(s,n){var i;return`${s.provider} / ${((i=s.model)==null?void 0:i.trim())||n}`}function U(s){return s.outcome!=="expected-cache-hit"}function vs(s,n){const i=new Map;for(const t of s){const r=xs(t,n),a=Date.parse(t.timestamp),l=i.get(r)??{key:r,tuple:r,events:[],misses:0,newestTimestampMs:0};l.events.push(t),U(t)&&(l.misses+=1),Number.isFinite(a)&&(l.newestTimestampMs=Math.max(l.newestTimestampMs,a)),i.set(r,l)}return[...i.values()].map(t=>({...t,events:t.events.sort((r,a)=>a.timestamp.localeCompare(r.timestamp))})).sort((t,r)=>r.newestTimestampMs-t.newestTimestampMs)}function gs(s){return new Intl.NumberFormat(void 0,{maximumFractionDigits:0}).format(s)}function Ms(s){return U(s)?s.wastedInputTokens:s.observedUsage.cacheReadTokens??0}function fs(s){const n=Date.parse(s);if(!Number.isFinite(n))return{date:s,time:"",title:s};const i=new Date(n);return{date:new Intl.DateTimeFormat(void 0,{year:"numeric",month:"short",day:"numeric"}).format(i),time:new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"2-digit",second:"2-digit"}).format(i),title:i.toLocaleString()}}function _s(s){if(s===void 0)return"—";if(s<6e4)return"<1m";const n=Math.floor(s/6e4);if(n<60)return`${n}m`;const i=Math.floor(n/60),t=n%60;return t>0?`${i}h ${t}m`:`${i}h`}function Y(s){return s.messageIndex!==void 0?`#${s.messageIndex}`:s.messageId?s.messageId.length>8?`${s.messageId.slice(0,8)}…`:s.messageId:"—"}function bs(s,n){return n==="all"?!0:n==="misses"?U(s):s.outcome==="expected-cache-hit"}function js(s){const n=[...new Set(s.map(i=>i.sessionId))].sort();return new Map(n.map((i,t)=>[i,{"--cache-session-color":`hsl(${(t*137.508+12)%360} 70% 52%)`}]))}function Ts(s,n){return s.messageIndex!==void 0&&n.messageIndex!==void 0&&s.messageIndex!==n.messageIndex?n.messageIndex-s.messageIndex:n.timestamp.localeCompare(s.timestamp)}function ys({events:s,basePath:n,recencyHours:i}){const{t}=A(),r=se(6e4),{outcomeFilter:a,setOutcomeFilter:l}=He(),[b,C]=v.useState(""),[H,R]=v.useState(()=>new Set),[N,S]=v.useState(null),E=v.useRef(new Map),j=v.useMemo(()=>s.filter(o=>bs(o,a)),[s,a]),T=v.useMemo(()=>{const o=b.trim().toLocaleLowerCase();return vs(j,t("cacheMissUnknownModel")).filter(p=>!o||p.tuple.toLocaleLowerCase().includes(o))},[j,t,b]),I=v.useMemo(()=>js(s),[s]),k=v.useMemo(()=>{const o=new Map,p=new Map;for(const M of T)for(const g of M.events){if(p.set(g.id,M.key),g.messageIndex===void 0)continue;const c=o.get(g.sessionId)??[];c.push(g),o.set(g.sessionId,c)}const d=new Map;for(const M of o.values()){M.sort(Ts);for(let g=0;g+1<M.length;g+=1){const c=M[g],u=M[g+1];c&&u&&d.set(c.id,u.id)}}return{groupByEventId:p,previousByEventId:d}},[T]);v.useEffect(()=>{var p;if(!N)return;const o=E.current.get(N);if(!o){S(null);return}(p=o.scrollIntoView)==null||p.call(o,{block:"center"}),o.focus({preventScroll:!0}),S(null)},[N]);const P=o=>{R(p=>{const d=new Set(p);return d.has(o)?d.delete(o):d.add(o),d})},D=o=>{const p=k.previousByEventId.get(o);if(!p)return;const d=k.groupByEventId.get(p);d&&R(M=>{if(!M.has(d))return M;const g=new Set(M);return g.delete(d),g}),S(p)},m=T.reduce((o,p)=>o+p.events.length,0),y=i===null?t("cacheMissEventVisibleCount",{shown:m,total:s.length}):t("cacheMissEventVisibleCountRecent",{shown:m,total:s.length,hours:i});return e.jsxs("div",{className:h.viewer,children:[e.jsxs("div",{className:h.toolbar,children:[e.jsxs("div",{className:h.filterControls,children:[e.jsxs("label",{className:h.outcomeLabel,children:[e.jsx("span",{children:t("cacheMissEventResultHeader")}),e.jsxs("select",{value:a,onChange:o=>l(o.currentTarget.value),children:[e.jsx("option",{value:"misses",children:t("cacheMissEventResultMiss")}),e.jsx("option",{value:"hits",children:t("cacheMissEventResultHit")}),e.jsx("option",{value:"all",children:t("cacheMissEventResultAll")})]})]}),e.jsxs("label",{className:h.filterLabel,children:[e.jsx("span",{children:t("cacheMissEventFilterLabel")}),e.jsx("input",{type:"search",value:b,onChange:o=>C(o.currentTarget.value),placeholder:t("cacheMissEventFilterPlaceholder")})]})]}),e.jsx("span",{className:h.matchCount,children:y})]}),T.length===0?e.jsx("p",{className:"settings-empty",children:s.length===0?t("cacheMissBillingEventsEmpty"):j.length===0?t("activityNoMatches"):t("cacheMissEventFilterEmpty")}):e.jsx("div",{className:h.scroller,children:e.jsxs("table",{className:h.table,children:[e.jsxs("colgroup",{children:[e.jsx("col",{className:h.tupleColumn}),e.jsx("col",{className:h.eventTimeColumn}),e.jsx("col",{className:h.resultColumn}),e.jsx("col",{className:h.gapColumn}),e.jsx("col",{className:h.tokensColumn}),e.jsx("col",{className:h.kindColumn}),e.jsx("col",{className:h.messageColumn}),e.jsx("col",{className:h.openColumn})]}),e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{title:t("cacheMissEventTupleHeaderTitle"),children:t("cacheMissEventTupleHeader")}),e.jsx("th",{title:t("cacheMissEventAgeHeaderTitle"),children:t("cacheMissEventAgeHeader")}),e.jsx("th",{title:t("cacheMissEventResultHeaderTitle"),children:t("cacheMissEventResultHeader")}),e.jsx("th",{title:t("cacheMissEventIdleHeaderTitle"),children:t("cacheMissEventIdleHeader")}),e.jsx("th",{title:t("cacheMissEventTokensHeaderTitle"),children:t("cacheMissEventTokensHeader")}),e.jsx("th",{title:t("cacheMissEventKindHeaderTitle"),children:t("cacheMissEventKindHeader")}),e.jsx("th",{title:t("cacheMissEventMessageHeaderTitle"),children:t("cacheMissEventMessageHeader")}),e.jsx("th",{title:t("cacheMissEventSessionHeaderTitle"),children:t("cacheMissEventSessionHeader")})]})}),T.map(o=>{const p=H.has(o.key);return e.jsxs("tbody",{children:[e.jsxs("tr",{className:h.groupRow,children:[e.jsx("th",{scope:"rowgroup",children:e.jsxs("button",{type:"button",className:h.groupButton,"aria-expanded":!p,"aria-label":t(p?"cacheMissEventExpandGroup":"cacheMissEventCollapseGroup",{tuple:o.tuple}),onClick:()=>P(o.key),children:[e.jsx("span",{"aria-hidden":"true",children:p?"▸":"▾"}),e.jsx("span",{children:o.tuple})]})}),e.jsxs("td",{colSpan:7,className:h.groupSummary,children:[t("cacheMissEventGroupSummary",{count:o.events.length,misses:o.misses}),o.newestTimestampMs>0&&e.jsxs(e.Fragment,{children:[" · ",e.jsx(_e,{timestampMs:o.newestTimestampMs,nowMs:r,className:h.age,formatLabel:d=>d==="now"?t("cacheMissEventNewestNow"):t("cacheMissEventNewestAge",{age:d})})]})]})]}),!p&&o.events.map(d=>{const M=fs(d.timestamp),g=k.previousByEventId.get(d.id),c=g?t("cacheMissPrev"):void 0,u=[d.messageId,c].filter(Boolean).join(`
1
+ import{r as v,h as de,U as me,u as A,j as e,L as he,s as z,aV as pe,aW as xe,f as J}from"./index-umZg0LZ6.js";import{j as K}from"./types-BHkriVjU.js";import{a as ve}from"./client-Ci_HPGfl.js";import{u as se}from"./useRelativeNow-Ca6QGcPa.js";import{e as ge,u as Me}from"./Modal-ClSjJagX.js";import{a as fe}from"./frontendReload-CBdyvvdy.js";import{M as _e}from"./MessageAge-CaPpa1nH.js";import{S as w}from"./SettingsItem-C9Vh5p7F.js";import{u as be,b as je,H as Te}from"./index-BkOdUxq4.js";import{S as W}from"./SettingsSection-BaPzETK6.js";import"./react-runtime-D-UPQ57m.js";import"./RelayProtocol-BpdH0COG.js";import"./remoteRoutePaths-D8htA0xa.js";import"./PageHeader-BjwH2pWD.js";import"./LocalMediaModal-B9eHVx6y.js";import"./newSessionPrefill-DKcy0abh.js";import"./relay-url-j3kYm5KO.js";import"./appHref-ByaEnJGJ.js";import"./SessionHeader.module-BpaFAQ-S.js";import"./HostIdentityContext-DA7dMF-y.js";import"./NavigationLayout-BTFsWVtE.js";import"./useSidebarWidth-CBCcbSLg.js";import"./useFileActivity-BoW4X3DY.js";import"./providerChildSessions-DbLFSybt.js";import"./katex-Dv2p4YRM.js";import"./index-CoR-vzsb.js";import"./ProviderBadge-P0VTI71n.js";import"./YepAnywhereLogo-5zFKWjQq.js";import"./index-Cv3tQXyE.js";const ye="_tokenInput_12zei_8",Ee="_evidence_12zei_12",we="_recencyControl_12zei_19",Ce="_chartPanel_12zei_20",Ne="_recencyHeader_12zei_27",Se="_eventTableSection_12zei_36",Ie="_recencyInputs_12zei_58",ke="_expectedExpiryToggle_12zei_65",Be="_sliderStack_12zei_92",Fe="_sliderLabels_12zei_104",Re="_recencyTextInput_12zei_113",Le="_chartGrid_12zei_126",_={tokenInput:ye,evidence:Ee,recencyControl:we,chartPanel:Ce,recencyHeader:Ne,eventTableSection:Se,recencyInputs:Ie,expectedExpiryToggle:ke,sliderStack:Be,sliderLabels:Fe,recencyTextInput:Re,chartGrid:Le},$e=["misses","hits","all"],te="misses";function Ae(s){return $e.includes(s)?s:void 0}const $=de(me.cacheMissEventOutcomeFilter,te,Ae);$.set;$.reset;function He(){return{outcomeFilter:v.useSyncExternalStore($.subscribe,$.read,()=>te),setOutcomeFilter:$.set}}const Pe="_viewer_v96yw_1",De="_toolbar_v96yw_8",We="_filterControls_v96yw_17",Ve="_filterLabel_v96yw_25",Ue="_outcomeLabel_v96yw_34",Ge="_matchCount_v96yw_55",Oe="_scroller_v96yw_62",ze="_table_v96yw_67",Je="_tupleColumn_v96yw_93",Ke="_eventTimeColumn_v96yw_97",Ye="_resultColumn_v96yw_101",Xe="_kindColumn_v96yw_102",qe="_gapColumn_v96yw_106",Qe="_openColumn_v96yw_110",Ze="_tokensColumn_v96yw_114",es="_messageColumn_v96yw_118",ss="_groupRow_v96yw_122",ts="_groupButton_v96yw_126",ns="_groupSummary_v96yw_141",is="_eventRow_v96yw_146",cs="_numeric_v96yw_163",as="_age_v96yw_168",rs="_messageReference_v96yw_169",ls="_eventTimestamp_v96yw_178",os="_sessionMarker_v96yw_195",us="_messageJump_v96yw_204",ds="_miss_v96yw_219",ms="_hit_v96yw_224",hs="_expectedMiss_v96yw_229",ps="_openLink_v96yw_234",h={viewer:Pe,toolbar:De,filterControls:We,filterLabel:Ve,outcomeLabel:Ue,matchCount:Ge,scroller:Oe,table:ze,tupleColumn:Je,eventTimeColumn:Ke,resultColumn:Ye,kindColumn:Xe,gapColumn:qe,openColumn:Qe,tokensColumn:Ze,messageColumn:es,groupRow:ss,groupButton:ts,groupSummary:ns,eventRow:is,numeric:cs,age:as,messageReference:rs,eventTimestamp:ls,sessionMarker:os,messageJump:us,miss:ds,hit:ms,expectedMiss:hs,openLink:ps};function xs(s,n){var i;return`${s.provider} / ${((i=s.model)==null?void 0:i.trim())||n}`}function U(s){return s.outcome!=="expected-cache-hit"}function vs(s,n){const i=new Map;for(const t of s){const r=xs(t,n),a=Date.parse(t.timestamp),l=i.get(r)??{key:r,tuple:r,events:[],misses:0,newestTimestampMs:0};l.events.push(t),U(t)&&(l.misses+=1),Number.isFinite(a)&&(l.newestTimestampMs=Math.max(l.newestTimestampMs,a)),i.set(r,l)}return[...i.values()].map(t=>({...t,events:t.events.sort((r,a)=>a.timestamp.localeCompare(r.timestamp))})).sort((t,r)=>r.newestTimestampMs-t.newestTimestampMs)}function gs(s){return new Intl.NumberFormat(void 0,{maximumFractionDigits:0}).format(s)}function Ms(s){return U(s)?s.wastedInputTokens:s.observedUsage.cacheReadTokens??0}function fs(s){const n=Date.parse(s);if(!Number.isFinite(n))return{date:s,time:"",title:s};const i=new Date(n);return{date:new Intl.DateTimeFormat(void 0,{year:"numeric",month:"short",day:"numeric"}).format(i),time:new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"2-digit",second:"2-digit"}).format(i),title:i.toLocaleString()}}function _s(s){if(s===void 0)return"—";if(s<6e4)return"<1m";const n=Math.floor(s/6e4);if(n<60)return`${n}m`;const i=Math.floor(n/60),t=n%60;return t>0?`${i}h ${t}m`:`${i}h`}function Y(s){return s.messageIndex!==void 0?`#${s.messageIndex}`:s.messageId?s.messageId.length>8?`${s.messageId.slice(0,8)}…`:s.messageId:"—"}function bs(s,n){return n==="all"?!0:n==="misses"?U(s):s.outcome==="expected-cache-hit"}function js(s){const n=[...new Set(s.map(i=>i.sessionId))].sort();return new Map(n.map((i,t)=>[i,{"--cache-session-color":`hsl(${(t*137.508+12)%360} 70% 52%)`}]))}function Ts(s,n){return s.messageIndex!==void 0&&n.messageIndex!==void 0&&s.messageIndex!==n.messageIndex?n.messageIndex-s.messageIndex:n.timestamp.localeCompare(s.timestamp)}function ys({events:s,basePath:n,recencyHours:i}){const{t}=A(),r=se(6e4),{outcomeFilter:a,setOutcomeFilter:l}=He(),[b,C]=v.useState(""),[H,R]=v.useState(()=>new Set),[N,S]=v.useState(null),E=v.useRef(new Map),j=v.useMemo(()=>s.filter(o=>bs(o,a)),[s,a]),T=v.useMemo(()=>{const o=b.trim().toLocaleLowerCase();return vs(j,t("cacheMissUnknownModel")).filter(p=>!o||p.tuple.toLocaleLowerCase().includes(o))},[j,t,b]),I=v.useMemo(()=>js(s),[s]),k=v.useMemo(()=>{const o=new Map,p=new Map;for(const M of T)for(const g of M.events){if(p.set(g.id,M.key),g.messageIndex===void 0)continue;const c=o.get(g.sessionId)??[];c.push(g),o.set(g.sessionId,c)}const d=new Map;for(const M of o.values()){M.sort(Ts);for(let g=0;g+1<M.length;g+=1){const c=M[g],u=M[g+1];c&&u&&d.set(c.id,u.id)}}return{groupByEventId:p,previousByEventId:d}},[T]);v.useEffect(()=>{var p;if(!N)return;const o=E.current.get(N);if(!o){S(null);return}(p=o.scrollIntoView)==null||p.call(o,{block:"center"}),o.focus({preventScroll:!0}),S(null)},[N]);const P=o=>{R(p=>{const d=new Set(p);return d.has(o)?d.delete(o):d.add(o),d})},D=o=>{const p=k.previousByEventId.get(o);if(!p)return;const d=k.groupByEventId.get(p);d&&R(M=>{if(!M.has(d))return M;const g=new Set(M);return g.delete(d),g}),S(p)},m=T.reduce((o,p)=>o+p.events.length,0),y=i===null?t("cacheMissEventVisibleCount",{shown:m,total:s.length}):t("cacheMissEventVisibleCountRecent",{shown:m,total:s.length,hours:i});return e.jsxs("div",{className:h.viewer,children:[e.jsxs("div",{className:h.toolbar,children:[e.jsxs("div",{className:h.filterControls,children:[e.jsxs("label",{className:h.outcomeLabel,children:[e.jsx("span",{children:t("cacheMissEventResultHeader")}),e.jsxs("select",{value:a,onChange:o=>l(o.currentTarget.value),children:[e.jsx("option",{value:"misses",children:t("cacheMissEventResultMiss")}),e.jsx("option",{value:"hits",children:t("cacheMissEventResultHit")}),e.jsx("option",{value:"all",children:t("cacheMissEventResultAll")})]})]}),e.jsxs("label",{className:h.filterLabel,children:[e.jsx("span",{children:t("cacheMissEventFilterLabel")}),e.jsx("input",{type:"search",value:b,onChange:o=>C(o.currentTarget.value),placeholder:t("cacheMissEventFilterPlaceholder")})]})]}),e.jsx("span",{className:h.matchCount,children:y})]}),T.length===0?e.jsx("p",{className:"settings-empty",children:s.length===0?t("cacheMissBillingEventsEmpty"):j.length===0?t("activityNoMatches"):t("cacheMissEventFilterEmpty")}):e.jsx("div",{className:h.scroller,children:e.jsxs("table",{className:h.table,children:[e.jsxs("colgroup",{children:[e.jsx("col",{className:h.tupleColumn}),e.jsx("col",{className:h.eventTimeColumn}),e.jsx("col",{className:h.resultColumn}),e.jsx("col",{className:h.gapColumn}),e.jsx("col",{className:h.tokensColumn}),e.jsx("col",{className:h.kindColumn}),e.jsx("col",{className:h.messageColumn}),e.jsx("col",{className:h.openColumn})]}),e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{title:t("cacheMissEventTupleHeaderTitle"),children:t("cacheMissEventTupleHeader")}),e.jsx("th",{title:t("cacheMissEventAgeHeaderTitle"),children:t("cacheMissEventAgeHeader")}),e.jsx("th",{title:t("cacheMissEventResultHeaderTitle"),children:t("cacheMissEventResultHeader")}),e.jsx("th",{title:t("cacheMissEventIdleHeaderTitle"),children:t("cacheMissEventIdleHeader")}),e.jsx("th",{title:t("cacheMissEventTokensHeaderTitle"),children:t("cacheMissEventTokensHeader")}),e.jsx("th",{title:t("cacheMissEventKindHeaderTitle"),children:t("cacheMissEventKindHeader")}),e.jsx("th",{title:t("cacheMissEventMessageHeaderTitle"),children:t("cacheMissEventMessageHeader")}),e.jsx("th",{title:t("cacheMissEventSessionHeaderTitle"),children:t("cacheMissEventSessionHeader")})]})}),T.map(o=>{const p=H.has(o.key);return e.jsxs("tbody",{children:[e.jsxs("tr",{className:h.groupRow,children:[e.jsx("th",{scope:"rowgroup",children:e.jsxs("button",{type:"button",className:h.groupButton,"aria-expanded":!p,"aria-label":t(p?"cacheMissEventExpandGroup":"cacheMissEventCollapseGroup",{tuple:o.tuple}),onClick:()=>P(o.key),children:[e.jsx("span",{"aria-hidden":"true",children:p?"▸":"▾"}),e.jsx("span",{children:o.tuple})]})}),e.jsxs("td",{colSpan:7,className:h.groupSummary,children:[t("cacheMissEventGroupSummary",{count:o.events.length,misses:o.misses}),o.newestTimestampMs>0&&e.jsxs(e.Fragment,{children:[" · ",e.jsx(_e,{timestampMs:o.newestTimestampMs,nowMs:r,className:h.age,formatLabel:d=>d==="now"?t("cacheMissEventNewestNow"):t("cacheMissEventNewestAge",{age:d})})]})]})]}),!p&&o.events.map(d=>{const M=fs(d.timestamp),g=k.previousByEventId.get(d.id),c=g?t("cacheMissPrev"):void 0,u=[d.messageId,c].filter(Boolean).join(`
2
2
  `);return e.jsxs("tr",{className:h.eventRow,style:I.get(d.sessionId),tabIndex:-1,ref:f=>{f?E.current.set(d.id,f):E.current.delete(d.id)},children:[e.jsx("td",{"aria-hidden":"true"}),e.jsx("td",{children:e.jsxs("time",{className:h.eventTimestamp,dateTime:d.timestamp,title:M.title,children:[e.jsx("span",{children:M.date}),e.jsx("span",{children:M.time})]})}),e.jsx("td",{className:d.outcome==="expected-cache-hit"?h.hit:d.outcome==="expected-cache-expiry"?h.expectedMiss:h.miss,children:d.outcome==="expected-cache-hit"?t("cacheMissEventResultHit"):d.outcome==="expected-cache-expiry"?t("cacheMissEventResultExpectedMiss"):t("cacheMissEventResultMiss")}),e.jsx("td",{children:_s(d.elapsedSinceExpectedCacheMs)}),e.jsx("td",{className:h.numeric,children:gs(Ms(d))}),e.jsx("td",{children:d.expectedCacheSource==="fork"?t("cacheMissEventKindFork"):t("cacheMissEventKindWarm")}),e.jsxs("td",{className:h.messageReference,children:[e.jsx("span",{className:h.sessionMarker,"aria-hidden":"true"}),g?e.jsx("button",{type:"button",className:h.messageJump,title:u||void 0,"aria-label":c,onClick:()=>D(d.id),children:Y(d)}):e.jsx("span",{title:u||void 0,children:Y(d)})]}),e.jsx("td",{children:e.jsx(he,{className:h.openLink,to:`${n}${d.sessionPath}`,title:t("cacheMissBillingOpenSession"),children:t("cacheMissEventOpen")})})]},d.id)})]},o.key)})]})})]})}const Es="_chart_k0wbw_1",ws="_bars_k0wbw_7",Cs="_bar_k0wbw_7",Ns="_barLabel_k0wbw_24",Ss="_barTrack_k0wbw_30",Is="_barFill_k0wbw_37",ks="_probabilityFill_k0wbw_50",Bs="_providerFill_k0wbw_54",Fs="_barValue_k0wbw_58",Rs="_barCount_k0wbw_64",x={chart:Es,bars:ws,bar:Cs,barLabel:Ns,barTrack:Ss,barFill:Is,probabilityFill:ks,providerFill:Bs,barValue:Fs,barCount:Rs};function ne(s){return s.outcome!=="expected-cache-hit"}function ie(s){const n=new Map;for(const i of s){if(i.elapsedSinceExpectedCacheMs===void 0)continue;const t=i.elapsedSinceExpectedCacheMs/6e4;if(!Number.isFinite(t)||t<0)continue;const r=t<.5?0:t<1?.5:2**Math.floor(Math.log2(t)),a=r===0?.5:r*2,l=n.get(r)??{fromMinutes:r,toMinutes:a,misses:0,hits:0,wastedTokens:0,events:[]};l.events.push(i),ne(i)?(l.misses+=1,l.wastedTokens+=i.wastedInputTokens):l.hits+=1,n.set(r,l)}return[...n.values()].sort((i,t)=>i.fromMinutes-t.fromMinutes)}function X(s){return s>=1e6?`${(s/1e6).toFixed(1)}M`:s>=1e3?`${Math.round(s/1e3)}K`:String(s)}function q(s){return s===0?"0":s<1?`${s*60}s`:`${s}m`}function ce(s){return`${q(s.fromMinutes)}–${q(s.toMinutes)}`}function Ls(s,n){var i;return`${s.provider} / ${((i=s.model)==null?void 0:i.trim())||n}`}function G(s,n,i,t){const r=[...new Set(s.map(a=>Ls(a,n)))].sort();return r.length>0?`${i}
3
3
  ${r.join(`
4
4
  `)}`:t}function ae(s){const n=s.misses+s.hits;return n===0?0:s.misses/n}function re(s){const n=s*100;return n===0?"0%":n<.1?`${n.toFixed(2)}%`:n<10?`${n.toFixed(1)}%`:`${Math.round(n)}%`}function le(s){return s<=0?0:Math.log10(1+Math.min(1,s)*999)/3*100}function $s({events:s}){const{t:n}=A(),i=l=>G(l,n("cacheMissUnknownModel"),n("cacheMissTupleTooltipHeading"),n("cacheMissTupleTooltipEmpty")),t=ie(s);if(t.length===0)return e.jsx("p",{className:"settings-empty",children:n("cacheMissChartEmpty")});const r=Math.max(...t.map(l=>l.wastedTokens),1),a=t.reduce((l,b)=>l+b.wastedTokens,0);return e.jsxs("div",{className:x.chart,children:[e.jsx("p",{className:"settings-hint",children:n("cacheMissChartTotal",{tokens:X(a)})}),e.jsx("ol",{className:x.bars,children:t.map(l=>e.jsxs("li",{className:x.bar,title:i(l.events),children:[e.jsx("span",{className:x.barLabel,children:ce(l)}),e.jsx("span",{className:x.barTrack,children:e.jsx("span",{className:x.barFill,style:{width:`${Math.round(l.wastedTokens/r*100)}%`},"data-empty":l.wastedTokens===0?"":void 0})}),e.jsx("span",{className:x.barValue,children:X(l.wastedTokens)}),e.jsx("span",{className:x.barCount,children:n("cacheMissChartRatio",{misses:String(l.misses),total:String(l.misses+l.hits)})})]},l.fromMinutes))})]})}function As({events:s}){const{t:n}=A(),i=a=>G(a,n("cacheMissUnknownModel"),n("cacheMissTupleTooltipHeading"),n("cacheMissTupleTooltipEmpty")),t=s.filter(a=>a.completeProbabilitySample===!0),r=ie(t);return r.length===0?e.jsx("p",{className:"settings-empty",children:n("cacheMissProbabilityEmpty")}):e.jsxs("div",{className:x.chart,children:[e.jsx("p",{className:"settings-hint",children:n("cacheMissProbabilitySampleNote")}),e.jsx("ol",{className:x.bars,children:r.map(a=>{const l=ae(a);return e.jsxs("li",{className:x.bar,title:i(a.events),children:[e.jsx("span",{className:x.barLabel,children:ce(a)}),e.jsx("span",{className:x.barTrack,children:e.jsx("span",{className:`${x.barFill} ${x.probabilityFill}`,style:{width:`${le(l)}%`},"data-empty":l===0?"":void 0})}),e.jsx("span",{className:x.barValue,children:re(l)}),e.jsx("span",{className:x.barCount,children:n("cacheMissChartRatio",{misses:String(a.misses),total:String(a.misses+a.hits)})})]},a.fromMinutes)})})]})}function Hs(s){const n=new Map;for(const i of s){if(i.completeProbabilitySample!==!0)continue;const t=n.get(i.provider)??{provider:i.provider,misses:0,hits:0,events:[]};t.events.push(i),ne(i)?t.misses+=1:t.hits+=1,n.set(i.provider,t)}return[...n.values()].sort((i,t)=>i.provider.localeCompare(t.provider))}function Ps({events:s}){const{t:n}=A(),i=r=>G(r,n("cacheMissUnknownModel"),n("cacheMissTupleTooltipHeading"),n("cacheMissTupleTooltipEmpty")),t=Hs(s);return t.length===0?e.jsx("p",{className:"settings-empty",children:n("cacheMissProviderEmpty")}):e.jsxs("div",{className:x.chart,children:[e.jsx("p",{className:"settings-hint",children:n("cacheMissProbabilitySampleNote")}),e.jsx("ol",{className:x.bars,children:t.map(r=>{const a=ae(r);return e.jsxs("li",{className:x.bar,title:i(r.events),children:[e.jsx("span",{className:x.barLabel,children:r.provider}),e.jsx("span",{className:x.barTrack,children:e.jsx("span",{className:`${x.barFill} ${x.providerFill}`,style:{width:`${le(a)}%`},"data-empty":a===0?"":void 0})}),e.jsx("span",{className:x.barValue,children:re(a)}),e.jsx("span",{className:x.barCount,children:n("cacheMissChartRatio",{misses:String(r.misses),total:String(r.misses+r.hits)})})]},r.provider)})})]})}const Q=500,L=96,V=L+1;function B(s,n,i,t){const r=Number.parseInt(s,10);return Number.isFinite(r)?Math.max(i,Math.min(t,r)):n}function Z(s){return{...K,...s,providerFreshWindowMinutes:{...K.providerFreshWindowMinutes,...s==null?void 0:s.providerFreshWindowMinutes}}}function F(s,n){return s.providerFreshWindowMinutes[n]??s.freshWindowMinutes}function ee(s,n){if(n)return s;const i={...s};return delete i.ignoreAfterMinutes,i}function Ds(s,n,i,t,r=!1){const a=n===null?null:t-n*60*6e4;return s.filter(l=>{if(!r&&!l.expectedInputCost.freshEnough)return!1;const b=Date.parse(l.timestamp);return a!==null&&(!Number.isFinite(b)||b<a)?!1:i===0||l.elapsedSinceExpectedCacheMs===void 0||l.elapsedSinceExpectedCacheMs<=i*6e4})}function gt(){const{t:s}=A();be(s("cacheMissBillingTitle"));const{version:n}=ge(),i=z(n,pe),t=z(n,xe),r=Me(),{settings:a,isLoading:l,error:b,updateSettings:C}=fe(),[H,R]=v.useState([]),[N,S]=v.useState(null),[E,j]=v.useState(null),[T,I]=v.useState(""),[k,P]=v.useState(!1),D=se(6e4),m=Z(a==null?void 0:a.cacheMissBilling),y=v.useCallback(async c=>{const u=Z(a==null?void 0:a.cacheMissBilling);await C({cacheMissBilling:ee({...u,...c,providerFreshWindowMinutes:{...u.providerFreshWindowMinutes,...c.providerFreshWindowMinutes}},i)})},[a==null?void 0:a.cacheMissBilling,i,C]),o=v.useCallback(async c=>{await C({cacheMissBilling:ee(c,i)})},[i,C]);je(a?m:null,o);const p=Ds(H,E,m.ignoreAfterMinutes,D,k);v.useEffect(()=>{let c=!1;return ve.getCacheMissBillingEvents(Q,t).then(u=>{c||(R(u.events),S(null))}).catch(u=>{c||S(u instanceof Error?u.message:s("cacheMissBillingEventsLoadError"))}),()=>{c=!0}},[t,s]),v.useEffect(()=>{const c=O=>{R(oe=>[O.record,...oe.filter(ue=>ue.id!==O.record.id)].slice(0,Q))},u=J.on("cache-miss-billing",c),f=t?J.on("cache-miss-billing-expected-expiry",c):void 0;return()=>{u(),f==null||f()}},[t]);const d=c=>{if(c===V){j(null),I("");return}j(c),I(String(c))},M=c=>{if(I(c),c.trim()===""){j(null);return}const u=Number.parseInt(c,10);Number.isInteger(u)&&u>=1&&u<=L&&j(u)},g=()=>{if(T.trim()==="")return;const c=B(T,E??L,1,L);j(c),I(String(c))};return l?e.jsx(W,{description:s("cacheMissBillingLoading")}):e.jsxs(e.Fragment,{children:[e.jsxs(W,{description:s("cacheMissBillingDescription"),children:[e.jsxs("div",{className:"settings-group",children:[e.jsx(w,{as:"label",label:s("cacheMissBillingEnableTitle"),description:s("cacheMissBillingEnableDescription"),children:e.jsx("input",{type:"checkbox",checked:m.enabled,onChange:c=>void y({enabled:c.currentTarget.checked}),"aria-label":s("cacheMissBillingEnableTitle")})}),e.jsx(w,{as:"label",label:s("cacheMissBillingToastTitle"),description:s("cacheMissBillingToastDescription"),children:e.jsx("input",{type:"checkbox",checked:m.showToasts,disabled:!m.enabled,onChange:c=>void y({showToasts:c.currentTarget.checked}),"aria-label":s("cacheMissBillingToastTitle")})}),e.jsx(w,{label:s("cacheMissBillingClaudeFreshWindowTitle"),description:s("cacheMissBillingClaudeFreshWindowDescription"),className:"settings-item--wide-control",children:e.jsx("div",{className:"settings-item-actions",children:e.jsxs("span",{className:"settings-input-unit",children:[e.jsx("input",{type:"number",className:"settings-input-small",min:1,max:1440,defaultValue:F(m,"claude"),disabled:!m.enabled,onBlur:c=>{const u=F(m,"claude"),f=B(c.currentTarget.value,u,1,1440);c.currentTarget.value=String(f),f!==u&&y({providerFreshWindowMinutes:{claude:f}})},"aria-label":s("cacheMissBillingClaudeFreshWindowTitle")},`fresh-claude-${F(m,"claude")}`),e.jsx("span",{children:s("cacheMissBillingMinutesUnit")})]})})}),e.jsx(w,{label:s("cacheMissBillingCodexFreshWindowTitle"),description:s("cacheMissBillingCodexFreshWindowDescription"),className:"settings-item--wide-control",children:e.jsx("div",{className:"settings-item-actions",children:e.jsxs("span",{className:"settings-input-unit",children:[e.jsx("input",{type:"number",className:"settings-input-small",min:1,max:1440,defaultValue:F(m,"codex"),disabled:!m.enabled,onBlur:c=>{const u=F(m,"codex"),f=B(c.currentTarget.value,u,1,1440);c.currentTarget.value=String(f),f!==u&&y({providerFreshWindowMinutes:{codex:f}})},"aria-label":s("cacheMissBillingCodexFreshWindowTitle")},`fresh-codex-${F(m,"codex")}`),e.jsx("span",{children:s("cacheMissBillingMinutesUnit")})]})})}),e.jsx(w,{label:s("cacheMissBillingMinimumTokensTitle"),description:s("cacheMissBillingMinimumTokensDescription"),className:"settings-item--wide-control",children:e.jsx("div",{className:"settings-item-actions",children:e.jsxs("span",{className:"settings-input-unit",children:[e.jsx("input",{type:"number",className:`settings-input-small ${_.tokenInput}`,min:1,max:5e6,step:1e3,defaultValue:m.minimumWastedTokens,disabled:!m.enabled,onBlur:c=>{const u=B(c.currentTarget.value,m.minimumWastedTokens,1,5e6);c.currentTarget.value=String(u),u!==m.minimumWastedTokens&&y({minimumWastedTokens:u})},"aria-label":s("cacheMissBillingMinimumTokensTitle")},`minimum-${m.minimumWastedTokens}`),e.jsx("span",{children:s("cacheMissBillingTokensUnit")})]})})}),e.jsx(w,{label:s("cacheMissBillingRecentActivityTitle"),description:s("cacheMissBillingRecentActivityDescription"),className:"settings-item--wide-control",children:e.jsx("div",{className:"settings-item-actions",children:e.jsxs("span",{className:"settings-input-unit",children:[e.jsx("input",{type:"number",className:"settings-input-small",min:0,max:1440,defaultValue:m.recentActivityMinutes,disabled:!m.enabled,onBlur:c=>{const u=B(c.currentTarget.value,m.recentActivityMinutes,0,1440);c.currentTarget.value=String(u),u!==m.recentActivityMinutes&&y({recentActivityMinutes:u})},"aria-label":s("cacheMissBillingRecentActivityTitle")},`recent-${m.recentActivityMinutes}`),e.jsx("span",{children:s("cacheMissBillingMinutesUnit")})]})})}),i&&e.jsx(w,{label:s("cacheMissBillingIgnoreAfterTitle"),description:s("cacheMissBillingIgnoreAfterDescription"),className:"settings-item--wide-control",children:e.jsx("div",{className:"settings-item-actions",children:e.jsxs("span",{className:"settings-input-unit",children:[e.jsx("input",{type:"number",className:"settings-input-small",min:0,max:1440,defaultValue:m.ignoreAfterMinutes,disabled:!m.enabled,onBlur:c=>{const u=B(c.currentTarget.value,m.ignoreAfterMinutes,0,1440);c.currentTarget.value=String(u),u!==m.ignoreAfterMinutes&&y({ignoreAfterMinutes:u})},"aria-label":s("cacheMissBillingIgnoreAfterTitle")},`ignore-after-${m.ignoreAfterMinutes}`),e.jsx("span",{children:s("cacheMissBillingMinutesUnit")})]})})})]}),b&&e.jsx("p",{className:"settings-warning",children:b})]}),e.jsxs(W,{title:s("cacheMissEvidenceTitle"),description:s("cacheMissEvidenceDescription"),children:[N&&e.jsx("p",{className:"settings-warning",children:N}),e.jsx(Te,{children:e.jsxs("div",{className:_.evidence,children:[e.jsxs("div",{className:_.recencyControl,children:[e.jsxs("div",{className:_.recencyHeader,children:[e.jsxs("div",{children:[e.jsx("h3",{children:s("cacheMissRecencyTitle")}),e.jsx("p",{children:s("cacheMissRecencyDescription")})]}),e.jsx("span",{children:s("cacheMissRecencySummary",{shown:p.length,total:H.length})})]}),t&&e.jsxs("label",{className:_.expectedExpiryToggle,children:[e.jsx("input",{type:"checkbox",checked:k,onChange:c=>P(c.currentTarget.checked),"aria-label":s("cacheMissExpectedExpiryToggleTitle")}),e.jsxs("span",{children:[e.jsx("strong",{children:s("cacheMissExpectedExpiryToggleTitle")}),e.jsx("span",{children:s("cacheMissExpectedExpiryToggleDescription")})]})]}),e.jsxs("div",{className:_.recencyInputs,children:[e.jsxs("div",{className:_.sliderStack,children:[e.jsx("input",{type:"range",min:1,max:V,step:1,value:E??V,onChange:c=>d(Number.parseInt(c.currentTarget.value,10)),"aria-label":s("cacheMissRecencySliderLabel")}),e.jsxs("div",{className:_.sliderLabels,"aria-hidden":"true",children:[e.jsx("span",{children:"1h"}),e.jsx("span",{children:"96h"}),e.jsx("span",{children:"∞"})]})]}),e.jsxs("label",{className:_.recencyTextInput,children:[e.jsx("span",{children:s("cacheMissRecencyHoursLabel")}),e.jsxs("span",{className:"settings-input-unit",children:[e.jsx("input",{type:"number",min:1,max:L,value:T,placeholder:"∞",onChange:c=>M(c.currentTarget.value),onBlur:g}),e.jsx("span",{children:s("cacheMissRecencyHoursUnit")})]})]})]})]}),e.jsxs("div",{className:_.chartGrid,children:[e.jsxs("section",{className:_.chartPanel,children:[e.jsx("h3",{children:s("cacheMissChartTitle")}),e.jsx("p",{children:s("cacheMissChartDescription")}),e.jsx($s,{events:p})]}),e.jsxs("section",{className:_.chartPanel,children:[e.jsx("h3",{children:s("cacheMissProbabilityTitle")}),e.jsx("p",{children:s("cacheMissProbabilityDescription")}),e.jsx(As,{events:p})]}),e.jsxs("section",{className:_.chartPanel,children:[e.jsx("h3",{children:s("cacheMissProviderTitle")}),e.jsx("p",{children:s("cacheMissProviderDescription")}),e.jsx(Ps,{events:p})]})]}),e.jsxs("section",{className:_.eventTableSection,children:[e.jsx("h3",{children:s("cacheMissEventsTitle")}),e.jsx("p",{children:s("cacheMissBillingEventsDescription")}),e.jsx(ys,{events:p,basePath:r,recencyHours:E})]})]})})]})]})}export{gt as CacheMissBillingSettings,ee as cacheMissBillingSettingsForServer,Ds as filterCacheMissEvents};
@@ -1 +1 @@
1
- import{u as L,r as a,j as e}from"./index-BY-TgOY-.js";import{u as W}from"./useCodexUpdateStatus-CAR1HkyO.js";import{u as G}from"./useProviders-45TZLkhy.js";import{a as H}from"./frontendReload-DN8qVYjF.js";import{M as K}from"./Modal-DOzUIhWU.js";import"./react-runtime-D-UPQ57m.js";import"./client-D_ikArFV.js";import"./RelayProtocol-DOWXVB0k.js";import"./types-BHkriVjU.js";import"./remoteRoutePaths-BxKY1U2z.js";const C="codex-update-seen-tag";function v(){try{return window.localStorage.getItem(C)}catch{return null}}function O(s){try{window.localStorage.setItem(C,s)}catch{}}function ee(){const{t:s}=L(),{settings:g,updateSetting:I}=H(),m=g==null?void 0:g.codexUpdatePolicy,{status:t,isInstalling:o,error:b,installOutput:_,install:T}=W({enabled:m==="notify"}),{refetch:P}=G(),[R,N]=a.useState(()=>v()),[n,j]=a.useState(null),[E,A]=a.useState(null),[y,S]=a.useState(!0),[c,i]=a.useState(!1),[r,u]=a.useState(null),[w,p]=a.useState(null);a.useEffect(()=>{N(v())},[]);const l=(t==null?void 0:t.latest)??null,k=m==="notify"&&!!t&&t.updateAvailable&&!!l&&l!==R&&l!==E;if(a.useEffect(()=>{!k||!l||n===l||(j(l),S(!0),i(!1),u(null),p(null))},[n,l,k]),a.useEffect(()=>{m!=="notify"&&n&&(j(null),i(!1),u(null),p(null))},[n,m]),!n||!t||!l)return null;const x=t.updateMethod==="npm",h=({markSeen:d=!1}={})=>{d&&(O(n),N(n)),A(n),j(null),i(!1),u(null),p(null)},M=()=>{o||h({markSeen:r!==!1})},D=async()=>{if(i(!1),u(null),p(null),y)try{await I("codexUpdatePolicy","auto")}catch{p("The auto-update preference could not be saved; future releases may still need manual confirmation.")}const d=await T();d&&await P(),i(!0),u(d)},F=()=>{h({markSeen:!0})},f=t.manualInstallCommand??(t.installedPackage?`npm install -g ${t.installedPackage}@latest`:null),U=(_==null?void 0:_.trim())||(o?"Running the Codex CLI update. Raw output will appear here when the command finishes.":c?"(The update command did not produce stdout or stderr.)":null);return e.jsx(K,{title:"Codex CLI update available",onClose:M,children:e.jsxs("div",{className:"settings-group codex-update-prompt",children:[e.jsx("p",{className:"codex-update-prompt__summary",children:r?s("codexUpdateInstalledSummary",{version:t.installed??n}):s("codexUpdateReadySummary",{current:t.installed??"unknown",latest:l})}),t.releaseUrl&&e.jsx("a",{href:t.releaseUrl,target:"_blank",rel:"noopener noreferrer",className:"settings-link codex-update-prompt__release-link",children:"Release notes"}),f&&e.jsxs("div",{className:"codex-update-prompt__command-block",children:[e.jsx("span",{className:"settings-hint",children:s(x?"codexUpdateWillRunCommand":"providersCodexUpdateWithInstaller")}),e.jsx("code",{className:"codex-update-prompt__command",children:f})]}),!x&&e.jsx("p",{className:"settings-hint",children:s("codexUpdateManualInstallHint")}),x&&e.jsxs("label",{className:"codex-update-prompt__checkbox-label",children:[e.jsx("input",{type:"checkbox",className:"codex-update-prompt__checkbox",checked:y,onChange:d=>S(d.target.checked),disabled:o||r===!0}),e.jsx("span",{children:s("codexUpdateAutoFutureVersions")})]}),o&&e.jsx("p",{className:"settings-hint codex-update-prompt__progress",children:s("codexUpdateProgress")}),c&&r===!0&&e.jsx("p",{className:"form-success",children:"Codex updated successfully. Review the raw output below, then close this dialog."}),c&&r===!1&&b&&e.jsx("p",{className:"settings-warning",children:b}),w&&e.jsx("p",{className:"settings-warning",children:w}),(o||c)&&U&&e.jsxs("div",{className:"codex-update-prompt__output-block",children:[e.jsxs("div",{className:"codex-update-prompt__output-header",children:[e.jsx("strong",{className:"codex-update-prompt__output-title",children:"Raw output"}),f&&e.jsx("code",{className:"codex-update-prompt__output-command",children:f})]}),e.jsx("pre",{className:"codex-update-prompt__output",children:U})]}),e.jsx("div",{className:"codex-update-prompt__actions",children:r===!0||!x?e.jsx("button",{type:"button",className:"settings-button",onClick:()=>h({markSeen:!0}),children:s("codexUpdateDone")}):e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:"settings-button settings-button-secondary",onClick:c?()=>h():F,disabled:o,children:c?"Dismiss":"Not now"}),e.jsx("button",{type:"button",className:"settings-button",onClick:()=>void D(),disabled:o,children:o?"Installing…":c?"Retry update":"Update now"})]})})]})})}export{ee as CodexUpdatePrompt};
1
+ import{u as L,r as a,j as e}from"./index-umZg0LZ6.js";import{u as W}from"./useCodexUpdateStatus-CEZO_f2Y.js";import{u as G}from"./useProviders-CeN1PclA.js";import{a as H}from"./frontendReload-CBdyvvdy.js";import{M as K}from"./Modal-ClSjJagX.js";import"./react-runtime-D-UPQ57m.js";import"./client-Ci_HPGfl.js";import"./RelayProtocol-BpdH0COG.js";import"./types-BHkriVjU.js";import"./remoteRoutePaths-D8htA0xa.js";const C="codex-update-seen-tag";function v(){try{return window.localStorage.getItem(C)}catch{return null}}function O(s){try{window.localStorage.setItem(C,s)}catch{}}function ee(){const{t:s}=L(),{settings:g,updateSetting:I}=H(),m=g==null?void 0:g.codexUpdatePolicy,{status:t,isInstalling:o,error:b,installOutput:_,install:T}=W({enabled:m==="notify"}),{refetch:P}=G(),[R,N]=a.useState(()=>v()),[n,j]=a.useState(null),[E,A]=a.useState(null),[y,S]=a.useState(!0),[c,i]=a.useState(!1),[r,u]=a.useState(null),[w,p]=a.useState(null);a.useEffect(()=>{N(v())},[]);const l=(t==null?void 0:t.latest)??null,k=m==="notify"&&!!t&&t.updateAvailable&&!!l&&l!==R&&l!==E;if(a.useEffect(()=>{!k||!l||n===l||(j(l),S(!0),i(!1),u(null),p(null))},[n,l,k]),a.useEffect(()=>{m!=="notify"&&n&&(j(null),i(!1),u(null),p(null))},[n,m]),!n||!t||!l)return null;const x=t.updateMethod==="npm",h=({markSeen:d=!1}={})=>{d&&(O(n),N(n)),A(n),j(null),i(!1),u(null),p(null)},M=()=>{o||h({markSeen:r!==!1})},D=async()=>{if(i(!1),u(null),p(null),y)try{await I("codexUpdatePolicy","auto")}catch{p("The auto-update preference could not be saved; future releases may still need manual confirmation.")}const d=await T();d&&await P(),i(!0),u(d)},F=()=>{h({markSeen:!0})},f=t.manualInstallCommand??(t.installedPackage?`npm install -g ${t.installedPackage}@latest`:null),U=(_==null?void 0:_.trim())||(o?"Running the Codex CLI update. Raw output will appear here when the command finishes.":c?"(The update command did not produce stdout or stderr.)":null);return e.jsx(K,{title:"Codex CLI update available",onClose:M,children:e.jsxs("div",{className:"settings-group codex-update-prompt",children:[e.jsx("p",{className:"codex-update-prompt__summary",children:r?s("codexUpdateInstalledSummary",{version:t.installed??n}):s("codexUpdateReadySummary",{current:t.installed??"unknown",latest:l})}),t.releaseUrl&&e.jsx("a",{href:t.releaseUrl,target:"_blank",rel:"noopener noreferrer",className:"settings-link codex-update-prompt__release-link",children:"Release notes"}),f&&e.jsxs("div",{className:"codex-update-prompt__command-block",children:[e.jsx("span",{className:"settings-hint",children:s(x?"codexUpdateWillRunCommand":"providersCodexUpdateWithInstaller")}),e.jsx("code",{className:"codex-update-prompt__command",children:f})]}),!x&&e.jsx("p",{className:"settings-hint",children:s("codexUpdateManualInstallHint")}),x&&e.jsxs("label",{className:"codex-update-prompt__checkbox-label",children:[e.jsx("input",{type:"checkbox",className:"codex-update-prompt__checkbox",checked:y,onChange:d=>S(d.target.checked),disabled:o||r===!0}),e.jsx("span",{children:s("codexUpdateAutoFutureVersions")})]}),o&&e.jsx("p",{className:"settings-hint codex-update-prompt__progress",children:s("codexUpdateProgress")}),c&&r===!0&&e.jsx("p",{className:"form-success",children:"Codex updated successfully. Review the raw output below, then close this dialog."}),c&&r===!1&&b&&e.jsx("p",{className:"settings-warning",children:b}),w&&e.jsx("p",{className:"settings-warning",children:w}),(o||c)&&U&&e.jsxs("div",{className:"codex-update-prompt__output-block",children:[e.jsxs("div",{className:"codex-update-prompt__output-header",children:[e.jsx("strong",{className:"codex-update-prompt__output-title",children:"Raw output"}),f&&e.jsx("code",{className:"codex-update-prompt__output-command",children:f})]}),e.jsx("pre",{className:"codex-update-prompt__output",children:U})]}),e.jsx("div",{className:"codex-update-prompt__actions",children:r===!0||!x?e.jsx("button",{type:"button",className:"settings-button",onClick:()=>h({markSeen:!0}),children:s("codexUpdateDone")}):e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",className:"settings-button settings-button-secondary",onClick:c?()=>h():F,disabled:o,children:c?"Dismiss":"Not now"}),e.jsx("button",{type:"button",className:"settings-button",onClick:()=>void D(),disabled:o,children:o?"Installing…":c?"Retry update":"Update now"})]})})]})})}export{ee as CodexUpdatePrompt};
@@ -1 +1 @@
1
- import{r as d,j as C}from"./index-BY-TgOY-.js";function u(c){const a=Number(c.value);return Number.isFinite(a)?a:0}function O({value:c,onCommit:a,onDraftChange:n,onBlur:f,onKeyUp:g,onPointerCancel:p,onPointerDown:m,onPointerUp:T,...h}){const[j,R]=d.useState(c),s=d.useRef(!1),l=d.useRef(c);d.useEffect(()=>{s.current||R(c)},[c]);const b=()=>{s.current||(s.current=!0,l.current=c)},i=r=>{s.current=!1,R(r),Object.is(r,l.current)||a(r)},x=r=>{const t=u(r.currentTarget);b(),R(t),n==null||n(t)},E=r=>{var t,e;b(),(e=(t=r.currentTarget).setPointerCapture)==null||e.call(t,r.pointerId),m==null||m(r)},I=r=>{var t,e;(e=(t=r.currentTarget).releasePointerCapture)==null||e.call(t,r.pointerId),i(u(r.currentTarget)),T==null||T(r)},o=r=>{var t,e;(e=(t=r.currentTarget).releasePointerCapture)==null||e.call(t,r.pointerId),i(u(r.currentTarget)),p==null||p(r)},N=r=>{s.current&&i(u(r.currentTarget)),g==null||g(r)},S=r=>{s.current&&i(u(r.currentTarget)),f==null||f(r)};return C.jsx("input",{...h,type:"range",value:j,onBlur:S,onChange:x,onKeyUp:N,onPointerCancel:o,onPointerDown:E,onPointerUp:I})}export{O as C};
1
+ import{r as d,j as C}from"./index-umZg0LZ6.js";function u(c){const a=Number(c.value);return Number.isFinite(a)?a:0}function O({value:c,onCommit:a,onDraftChange:n,onBlur:f,onKeyUp:g,onPointerCancel:p,onPointerDown:m,onPointerUp:T,...h}){const[j,R]=d.useState(c),s=d.useRef(!1),l=d.useRef(c);d.useEffect(()=>{s.current||R(c)},[c]);const b=()=>{s.current||(s.current=!0,l.current=c)},i=r=>{s.current=!1,R(r),Object.is(r,l.current)||a(r)},x=r=>{const t=u(r.currentTarget);b(),R(t),n==null||n(t)},E=r=>{var t,e;b(),(e=(t=r.currentTarget).setPointerCapture)==null||e.call(t,r.pointerId),m==null||m(r)},I=r=>{var t,e;(e=(t=r.currentTarget).releasePointerCapture)==null||e.call(t,r.pointerId),i(u(r.currentTarget)),T==null||T(r)},o=r=>{var t,e;(e=(t=r.currentTarget).releasePointerCapture)==null||e.call(t,r.pointerId),i(u(r.currentTarget)),p==null||p(r)},N=r=>{s.current&&i(u(r.currentTarget)),g==null||g(r)},S=r=>{s.current&&i(u(r.currentTarget)),f==null||f(r)};return C.jsx("input",{...h,type:"range",value:j,onBlur:S,onChange:x,onKeyUp:N,onPointerCancel:o,onPointerDown:E,onPointerUp:I})}export{O as C};
@@ -1 +1 @@
1
- import{r as o,j as f}from"./index-BY-TgOY-.js";import{C as I}from"./CommittedRangeInput-bK7EXtAc.js";function d(n,l,e){return Math.min(e,Math.max(l,n))}function D(n,l,e,a){if(n!==null)return d(n,e,a);if(l===void 0)throw new Error("A null range value requires unsetSliderValue");return l}function q(n){const{id:l,min:e,max:a,numberMin:S=e,numberMax:h=a,step:p=1,list:R,value:r,unsetSliderValue:u,unit:j,disabled:v,ariaLabel:w,className:y,onEdit:i,snapTextToStep:N=!0}=n,[M,c]=o.useState(()=>D(r,u,e,a)),[b,s]=o.useState(r===null?"":String(r));o.useEffect(()=>{c(D(r,u,e,a)),s(r===null?"":String(r))},[a,e,u,r]);const V=o.useCallback(t=>{const m=e+Math.round((t-e)/p)*p;return d(m,e,a)},[a,e,p]),g=o.useCallback(()=>{c(D(r,u,e,a)),s(r===null?"":String(r))},[a,e,u,r]),T=o.useCallback((t,m=!0,x=e,F=a)=>{const C=m?V(t):d(t,x,F);if(u!==void 0&&C===u){c(u),s(""),n.unsetSliderValue!==void 0&&n.onCommit(null);return}c(d(C,e,a)),s(String(C)),n.onCommit(C)},[a,e,V,n,u]),k=o.useCallback(()=>{if(b.trim()===""){n.unsetSliderValue!==void 0?(c(n.unsetSliderValue),s(""),n.onCommit(null)):g();return}const t=Number(b);if(!Number.isFinite(t)){g();return}T(t,N,S,h)},[T,h,S,n,g,N,b]),z=t=>{t.key==="Enter"?(t.preventDefault(),k(),t.currentTarget.blur()):t.key==="Escape"&&(t.preventDefault(),g(),t.currentTarget.blur())};return f.jsxs("span",{className:y?`output-appearance-slider-row ${y}`:"output-appearance-slider-row",children:[f.jsx(I,{id:l,min:e,max:a,step:p,list:R,value:M,disabled:v,"aria-label":w,onDraftChange:t=>{s(t===u?"":String(t)),i==null||i()},onCommit:T}),f.jsxs("span",{className:"output-appearance-number-wrap",children:[f.jsx("input",{id:l?`${l}-number`:void 0,type:"number",className:"settings-input-small output-appearance-number",min:S,max:h,step:N?p:"any",value:b,disabled:v,"aria-label":w,onChange:t=>{const m=t.currentTarget.value;if(s(m),m.trim()===""){u!==void 0&&(i==null||i());return}const x=Number(m);Number.isFinite(x)&&(c(d(x,e,a)),i==null||i())},onBlur:k,onKeyDown:z}),j&&f.jsx("span",{className:"output-appearance-unit",children:j})]})]})}export{q as C};
1
+ import{r as o,j as f}from"./index-umZg0LZ6.js";import{C as I}from"./CommittedRangeInput-BwuV6Q6c.js";function d(n,l,e){return Math.min(e,Math.max(l,n))}function D(n,l,e,a){if(n!==null)return d(n,e,a);if(l===void 0)throw new Error("A null range value requires unsetSliderValue");return l}function q(n){const{id:l,min:e,max:a,numberMin:S=e,numberMax:h=a,step:p=1,list:R,value:r,unsetSliderValue:u,unit:j,disabled:v,ariaLabel:w,className:y,onEdit:i,snapTextToStep:N=!0}=n,[M,c]=o.useState(()=>D(r,u,e,a)),[b,s]=o.useState(r===null?"":String(r));o.useEffect(()=>{c(D(r,u,e,a)),s(r===null?"":String(r))},[a,e,u,r]);const V=o.useCallback(t=>{const m=e+Math.round((t-e)/p)*p;return d(m,e,a)},[a,e,p]),g=o.useCallback(()=>{c(D(r,u,e,a)),s(r===null?"":String(r))},[a,e,u,r]),T=o.useCallback((t,m=!0,x=e,F=a)=>{const C=m?V(t):d(t,x,F);if(u!==void 0&&C===u){c(u),s(""),n.unsetSliderValue!==void 0&&n.onCommit(null);return}c(d(C,e,a)),s(String(C)),n.onCommit(C)},[a,e,V,n,u]),k=o.useCallback(()=>{if(b.trim()===""){n.unsetSliderValue!==void 0?(c(n.unsetSliderValue),s(""),n.onCommit(null)):g();return}const t=Number(b);if(!Number.isFinite(t)){g();return}T(t,N,S,h)},[T,h,S,n,g,N,b]),z=t=>{t.key==="Enter"?(t.preventDefault(),k(),t.currentTarget.blur()):t.key==="Escape"&&(t.preventDefault(),g(),t.currentTarget.blur())};return f.jsxs("span",{className:y?`output-appearance-slider-row ${y}`:"output-appearance-slider-row",children:[f.jsx(I,{id:l,min:e,max:a,step:p,list:R,value:M,disabled:v,"aria-label":w,onDraftChange:t=>{s(t===u?"":String(t)),i==null||i()},onCommit:T}),f.jsxs("span",{className:"output-appearance-number-wrap",children:[f.jsx("input",{id:l?`${l}-number`:void 0,type:"number",className:"settings-input-small output-appearance-number",min:S,max:h,step:N?p:"any",value:b,disabled:v,"aria-label":w,onChange:t=>{const m=t.currentTarget.value;if(s(m),m.trim()===""){u!==void 0&&(i==null||i());return}const x=Number(m);Number.isFinite(x)&&(c(d(x,e,a)),i==null||i())},onBlur:k,onKeyDown:z}),j&&f.jsx("span",{className:"output-appearance-unit",children:j})]})]})}export{q as C};
@@ -1 +1 @@
1
- import{u as D,s as I,i as N,j as e,r as u}from"./index-BY-TgOY-.js";import{e as M,b as A}from"./Modal-DOzUIhWU.js";import{S as F}from"./SettingsSection-DbOwfvBD.js";import"./react-runtime-D-UPQ57m.js";import"./client-D_ikArFV.js";import"./RelayProtocol-DOWXVB0k.js";import"./remoteRoutePaths-BxKY1U2z.js";import"./index-BrCZcBcO.js";import"./PageHeader-Ca3PbaMb.js";import"./LocalMediaModal-DyDpC0dk.js";import"./newSessionPrefill-DKcy0abh.js";import"./appHref-ByaEnJGJ.js";import"./SessionHeader.module-CHO2T3eQ.js";import"./HostIdentityContext-DbEx7dor.js";import"./frontendReload-DN8qVYjF.js";import"./NavigationLayout-D8BMwd7T.js";import"./useSidebarWidth-CITe0sSV.js";import"./useFileActivity-D0JXhEz7.js";import"./providerChildSessions-DVWCZpC4.js";import"./katex-Dv2p4YRM.js";import"./index-YAR5D3xY.js";import"./relay-url-j3kYm5KO.js";import"./ProviderBadge-BKZVllDn.js";import"./YepAnywhereLogo-C4H1sg3q.js";import"./index-BgkZrNQv.js";const H="_controls_1ku6n_1",L="_toggle_1ku6n_46",V="_help_1ku6n_92",$="_advanced_1ku6n_96",O="_actions_1ku6n_109",q="_session_1ku6n_110",c={controls:H,toggle:L,help:V,advanced:$,actions:O,session:q};function xe(){const{version:h}=M(),{sourceKey:l}=A(),{t}=D(),s=I(h,N.computerControl.name),m=I(h,N.computerControlReleases.name);return e.jsx(F,{title:t("computerTitle"),description:t("computerDescription"),children:s?e.jsx(B,{managed:m},l):e.jsx("p",{children:t("computerUnsupportedServer")})})}function B({managed:h}){var E,S,T,w,_,U,P,R;const{transport:l}=A(),{t}=D(),[s,m]=u.useState(),[g,k]=u.useState(""),[j,f]=u.useState(""),[v,b]=u.useState(""),[x,y]=u.useState(!1);u.useEffect(()=>{let r=!1;return l.fetch("/computer-control").then(p=>{var d,n;r||(m(p),k(((d=p.preview)==null?void 0:d.packageDirectory)??""),f(((n=p.preview)==null?void 0:n.trustedPublisher)??""))}).catch(()=>{r||b(t("computerRequestFailed"))}),()=>{r=!0}},[l,t]),u.useEffect(()=>{var d;if(!((d=s==null?void 0:s.release)!=null&&d.working))return;let r=!1;const p=setTimeout(()=>{l.fetch("/computer-control").then(n=>{r||m(n)}).catch(()=>{r||(b(t("computerRequestFailed")),m(n=>n&&{...n,release:n.release?{...n.release,working:!1}:void 0}))})},1e3);return()=>{r=!0,clearTimeout(p)}},[s,l,t]);const a=async(r,p,d)=>{y(!0),b("");try{await l.fetch(`/computer-control${r}`,{method:p,...d?{body:JSON.stringify(d)}:{}}),m(await l.fetch("/computer-control"))}catch(n){b(n instanceof Error?n.message:t("computerRequestFailed"))}finally{y(!1)}};if(!s)return e.jsx("p",{role:"status",children:v||t("computerLoading")});if(!s.available)return e.jsx("p",{children:t("computerUnavailable")});const i=x||((E=s.release)==null?void 0:E.working)||s.busy,o=(S=s.release)==null?void 0:S.progress,C=(o==null?void 0:o.phase)==="downloading"?t("computerDownloading"):(o==null?void 0:o.phase)==="verifying"?t("computerVerifying"):(o==null?void 0:o.phase)==="installing"?t("computerInstalling"):t("computerChecking");return e.jsxs("div",{className:c.controls,children:[h?e.jsxs(e.Fragment,{children:[e.jsxs("label",{className:c.toggle,children:[e.jsxs("span",{children:[e.jsx("strong",{children:t("computerManagedEnable")}),e.jsx("small",{children:t("computerDownloadHelp")})]}),e.jsx("input",{type:"checkbox",role:"switch","aria-checked":s.enabled,"aria-label":t("computerManagedEnable"),checked:s.enabled,disabled:i,onChange:r=>void a("/releases/enabled","PUT",{enabled:r.currentTarget.checked})})]}),(T=s.release)!=null&&T.working?e.jsxs("div",{role:"status",children:[e.jsx("p",{children:C}),e.jsx("progress",{max:o==null?void 0:o.total,value:o!=null&&o.total?o.received:void 0,"aria-label":C}),e.jsx("button",{type:"button",disabled:x,onClick:()=>void a("/releases/enabled","PUT",{enabled:!1}),children:t("computerCancelDownload")})]}):e.jsx("p",{role:"status",children:s.preview?`${t("computerInstalled")}: ${((w=s.release)==null?void 0:w.installedVersion)??t("computerLocalPackage")}. ${t(s.enabled?"computerReady":"computerDisabled")}`:t("computerNotInstalled")}),s.preview&&((_=s.release)==null?void 0:_.updateAvailable)&&e.jsxs("div",{className:c.actions,children:[e.jsx("span",{children:t("computerUpdateAvailable",{version:s.release.latestVersion??""})}),e.jsx("button",{type:"button",disabled:i||s.sessions.length>0,onClick:()=>void a("/releases/update","POST"),children:t("computerUpdateNow")})]}),s.preview&&e.jsxs("label",{className:c.toggle,children:[e.jsxs("span",{children:[t("computerAutoUpdate"),e.jsx("small",{children:t("computerAutoUpdateHelp")})]}),e.jsx("input",{type:"checkbox",checked:((U=s.release)==null?void 0:U.autoUpdate)??!0,disabled:i,onChange:r=>void a("/releases/automatic","PUT",{autoUpdate:r.currentTarget.checked})})]}),e.jsxs("div",{className:c.actions,children:[e.jsx("button",{type:"button",disabled:i,onClick:()=>void a("/releases/check","POST"),children:t("computerCheckUpdates")}),s.preview&&e.jsx("button",{type:"button",disabled:i,onClick:()=>void a("/installation","DELETE"),children:t("computerUninstall")})]}),e.jsx("p",{className:c.help,children:t("computerSessionHelp")})]}):e.jsxs(e.Fragment,{children:[e.jsx("p",{children:t("computerUpdateServer")}),s.preview&&e.jsxs("label",{className:c.toggle,children:[t("computerEnable"),e.jsx("input",{type:"checkbox",checked:s.enabled,disabled:i,onChange:r=>void a("/settings","PUT",{enabled:r.currentTarget.checked,idleMs:s.idleMs,grantMs:s.grantMs})})]})]}),(v||((P=s.release)==null?void 0:P.error)||s.lastError)&&e.jsx("p",{role:"alert",children:v||((R=s.release)==null?void 0:R.error)||s.lastError}),e.jsxs("details",{className:c.advanced,children:[e.jsx("summary",{children:t("computerAdvanced")}),e.jsx("p",{children:t("computerTrustHelp")}),e.jsxs("label",{children:[t("computerPackageDirectory"),e.jsx("input",{value:g,onChange:r=>k(r.currentTarget.value),disabled:i})]}),e.jsxs("label",{children:[t("computerTrustedPublisher"),e.jsx("input",{value:j,onChange:r=>f(r.currentTarget.value),disabled:i})]}),e.jsx("button",{type:"button",disabled:i||!g.trim()||!j.trim(),onClick:()=>void a("/install","POST",{packageDirectory:g,trustedPublisher:j}),children:t("computerInstall")}),e.jsx("p",{children:t(s.running?"computerRunning":"computerStopped")}),e.jsx("button",{type:"button",disabled:x,onClick:()=>void a("","GET"),children:t("computerRefresh")})]}),s.sessions.map(r=>e.jsxs("div",{className:c.session,children:[e.jsx("code",{children:r.sessionId}),e.jsx("button",{type:"button",disabled:x,onClick:()=>void a(`/sessions/${encodeURIComponent(r.sessionId)}`,"DELETE"),children:t("computerRevoke")})]},r.sessionId))]})}export{xe as ComputerControlSettings};
1
+ import{u as D,s as I,i as N,j as e,r as u}from"./index-umZg0LZ6.js";import{e as M,b as A}from"./Modal-ClSjJagX.js";import{S as F}from"./SettingsSection-BaPzETK6.js";import"./react-runtime-D-UPQ57m.js";import"./client-Ci_HPGfl.js";import"./RelayProtocol-BpdH0COG.js";import"./remoteRoutePaths-D8htA0xa.js";import"./index-BkOdUxq4.js";import"./PageHeader-BjwH2pWD.js";import"./LocalMediaModal-B9eHVx6y.js";import"./newSessionPrefill-DKcy0abh.js";import"./relay-url-j3kYm5KO.js";import"./appHref-ByaEnJGJ.js";import"./SessionHeader.module-BpaFAQ-S.js";import"./HostIdentityContext-DA7dMF-y.js";import"./frontendReload-CBdyvvdy.js";import"./NavigationLayout-BTFsWVtE.js";import"./useSidebarWidth-CBCcbSLg.js";import"./useFileActivity-BoW4X3DY.js";import"./providerChildSessions-DbLFSybt.js";import"./katex-Dv2p4YRM.js";import"./index-CoR-vzsb.js";import"./ProviderBadge-P0VTI71n.js";import"./YepAnywhereLogo-5zFKWjQq.js";import"./index-Cv3tQXyE.js";const H="_controls_1ku6n_1",L="_toggle_1ku6n_46",V="_help_1ku6n_92",$="_advanced_1ku6n_96",O="_actions_1ku6n_109",q="_session_1ku6n_110",c={controls:H,toggle:L,help:V,advanced:$,actions:O,session:q};function xe(){const{version:h}=M(),{sourceKey:l}=A(),{t}=D(),s=I(h,N.computerControl.name),m=I(h,N.computerControlReleases.name);return e.jsx(F,{title:t("computerTitle"),description:t("computerDescription"),children:s?e.jsx(B,{managed:m},l):e.jsx("p",{children:t("computerUnsupportedServer")})})}function B({managed:h}){var E,S,T,w,_,U,P,R;const{transport:l}=A(),{t}=D(),[s,m]=u.useState(),[g,k]=u.useState(""),[j,f]=u.useState(""),[v,b]=u.useState(""),[x,y]=u.useState(!1);u.useEffect(()=>{let r=!1;return l.fetch("/computer-control").then(p=>{var d,n;r||(m(p),k(((d=p.preview)==null?void 0:d.packageDirectory)??""),f(((n=p.preview)==null?void 0:n.trustedPublisher)??""))}).catch(()=>{r||b(t("computerRequestFailed"))}),()=>{r=!0}},[l,t]),u.useEffect(()=>{var d;if(!((d=s==null?void 0:s.release)!=null&&d.working))return;let r=!1;const p=setTimeout(()=>{l.fetch("/computer-control").then(n=>{r||m(n)}).catch(()=>{r||(b(t("computerRequestFailed")),m(n=>n&&{...n,release:n.release?{...n.release,working:!1}:void 0}))})},1e3);return()=>{r=!0,clearTimeout(p)}},[s,l,t]);const a=async(r,p,d)=>{y(!0),b("");try{await l.fetch(`/computer-control${r}`,{method:p,...d?{body:JSON.stringify(d)}:{}}),m(await l.fetch("/computer-control"))}catch(n){b(n instanceof Error?n.message:t("computerRequestFailed"))}finally{y(!1)}};if(!s)return e.jsx("p",{role:"status",children:v||t("computerLoading")});if(!s.available)return e.jsx("p",{children:t("computerUnavailable")});const i=x||((E=s.release)==null?void 0:E.working)||s.busy,o=(S=s.release)==null?void 0:S.progress,C=(o==null?void 0:o.phase)==="downloading"?t("computerDownloading"):(o==null?void 0:o.phase)==="verifying"?t("computerVerifying"):(o==null?void 0:o.phase)==="installing"?t("computerInstalling"):t("computerChecking");return e.jsxs("div",{className:c.controls,children:[h?e.jsxs(e.Fragment,{children:[e.jsxs("label",{className:c.toggle,children:[e.jsxs("span",{children:[e.jsx("strong",{children:t("computerManagedEnable")}),e.jsx("small",{children:t("computerDownloadHelp")})]}),e.jsx("input",{type:"checkbox",role:"switch","aria-checked":s.enabled,"aria-label":t("computerManagedEnable"),checked:s.enabled,disabled:i,onChange:r=>void a("/releases/enabled","PUT",{enabled:r.currentTarget.checked})})]}),(T=s.release)!=null&&T.working?e.jsxs("div",{role:"status",children:[e.jsx("p",{children:C}),e.jsx("progress",{max:o==null?void 0:o.total,value:o!=null&&o.total?o.received:void 0,"aria-label":C}),e.jsx("button",{type:"button",disabled:x,onClick:()=>void a("/releases/enabled","PUT",{enabled:!1}),children:t("computerCancelDownload")})]}):e.jsx("p",{role:"status",children:s.preview?`${t("computerInstalled")}: ${((w=s.release)==null?void 0:w.installedVersion)??t("computerLocalPackage")}. ${t(s.enabled?"computerReady":"computerDisabled")}`:t("computerNotInstalled")}),s.preview&&((_=s.release)==null?void 0:_.updateAvailable)&&e.jsxs("div",{className:c.actions,children:[e.jsx("span",{children:t("computerUpdateAvailable",{version:s.release.latestVersion??""})}),e.jsx("button",{type:"button",disabled:i||s.sessions.length>0,onClick:()=>void a("/releases/update","POST"),children:t("computerUpdateNow")})]}),s.preview&&e.jsxs("label",{className:c.toggle,children:[e.jsxs("span",{children:[t("computerAutoUpdate"),e.jsx("small",{children:t("computerAutoUpdateHelp")})]}),e.jsx("input",{type:"checkbox",checked:((U=s.release)==null?void 0:U.autoUpdate)??!0,disabled:i,onChange:r=>void a("/releases/automatic","PUT",{autoUpdate:r.currentTarget.checked})})]}),e.jsxs("div",{className:c.actions,children:[e.jsx("button",{type:"button",disabled:i,onClick:()=>void a("/releases/check","POST"),children:t("computerCheckUpdates")}),s.preview&&e.jsx("button",{type:"button",disabled:i,onClick:()=>void a("/installation","DELETE"),children:t("computerUninstall")})]}),e.jsx("p",{className:c.help,children:t("computerSessionHelp")})]}):e.jsxs(e.Fragment,{children:[e.jsx("p",{children:t("computerUpdateServer")}),s.preview&&e.jsxs("label",{className:c.toggle,children:[t("computerEnable"),e.jsx("input",{type:"checkbox",checked:s.enabled,disabled:i,onChange:r=>void a("/settings","PUT",{enabled:r.currentTarget.checked,idleMs:s.idleMs,grantMs:s.grantMs})})]})]}),(v||((P=s.release)==null?void 0:P.error)||s.lastError)&&e.jsx("p",{role:"alert",children:v||((R=s.release)==null?void 0:R.error)||s.lastError}),e.jsxs("details",{className:c.advanced,children:[e.jsx("summary",{children:t("computerAdvanced")}),e.jsx("p",{children:t("computerTrustHelp")}),e.jsxs("label",{children:[t("computerPackageDirectory"),e.jsx("input",{value:g,onChange:r=>k(r.currentTarget.value),disabled:i})]}),e.jsxs("label",{children:[t("computerTrustedPublisher"),e.jsx("input",{value:j,onChange:r=>f(r.currentTarget.value),disabled:i})]}),e.jsx("button",{type:"button",disabled:i||!g.trim()||!j.trim(),onClick:()=>void a("/install","POST",{packageDirectory:g,trustedPublisher:j}),children:t("computerInstall")}),e.jsx("p",{children:t(s.running?"computerRunning":"computerStopped")}),e.jsx("button",{type:"button",disabled:x,onClick:()=>void a("","GET"),children:t("computerRefresh")})]}),s.sessions.map(r=>e.jsxs("div",{className:c.session,children:[e.jsx("code",{children:r.sessionId}),e.jsx("button",{type:"button",disabled:x,onClick:()=>void a(`/sessions/${encodeURIComponent(r.sessionId)}`,"DELETE"),children:t("computerRevoke")})]},r.sessionId))]})}export{xe as ComputerControlSettings};