dorkos 0.118.0 → 0.120.0

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 (273) hide show
  1. package/dist/bin/cli.js +3588 -3000
  2. package/dist/browser/native/package-manifest.json +1 -1
  3. package/dist/browser/source-manifest.json +1 -1
  4. package/dist/client/assets/{AboutPage-BOS59p1y.js → AboutPage-Y8O56Cz5.js} +1 -1
  5. package/dist/client/assets/{ActivityErrorState-DOmV85tr.js → ActivityErrorState-DlROxqde.js} +1 -1
  6. package/dist/client/assets/{ActivityPage-DbsBpb6N.js → ActivityPage-BdV90CV2.js} +1 -1
  7. package/dist/client/assets/{ActivityRow-B1ZeL7Jb.js → ActivityRow-B5yiD_uD.js} +1 -1
  8. package/dist/client/assets/{AdapterIcon-XPLZ-NAi.js → AdapterIcon-Dyq92Eup.js} +1 -1
  9. package/dist/client/assets/AdapterSetupWizard-D9tqz7Hl.js +2 -0
  10. package/dist/client/assets/{AgentOptionRow-C15RQsub.js → AgentOptionRow-BeRqDo7c.js} +1 -1
  11. package/dist/client/assets/{AgentPicker-CydNJYi_.js → AgentPicker-BRyYVJZu.js} +1 -1
  12. package/dist/client/assets/{AgentRequestCard-BBSbluBs.js → AgentRequestCard-xX6fAKgO.js} +4 -4
  13. package/dist/client/assets/AppearancePage-DKF9BqRt.js +1 -0
  14. package/dist/client/assets/{ApplyToOverridesDialog-Cv3KEf7T.js → ApplyToOverridesDialog-CPvtr_-f.js} +1 -1
  15. package/dist/client/assets/AttentionSignalRow-vBfioH1A.js +1 -0
  16. package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-Re2CfOlC.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-B50zNtwB.js} +1 -1
  17. package/dist/client/assets/{BindingDialog-8xnsM47D.js → BindingDialog-CSNjws3F.js} +1 -1
  18. package/dist/client/assets/{BlintzCanvas-DUDSNxlM.js → BlintzCanvas-ClOKWzws.js} +80 -79
  19. package/dist/client/assets/{CanvasCsvContent-D697P3sa.js → CanvasCsvContent-0Mb7uOuA.js} +6 -6
  20. package/dist/client/assets/CanvasFileContent-B_8zsIas.js +2 -0
  21. package/dist/client/assets/CanvasModel3dContent-UokbHY9i.js +2 -0
  22. package/dist/client/assets/{ChatAppsOff-CFEmPGm1.js → ChatAppsOff-CLRB0YU5.js} +1 -1
  23. package/dist/client/assets/{CodeMirrorDiff-B7VUevZG.js → CodeMirrorDiff-B4uFJD6g.js} +1 -1
  24. package/dist/client/assets/{CodeMirrorEditor-BX1bJlnT.js → CodeMirrorEditor-rYOrBAZc.js} +1 -1
  25. package/dist/client/assets/{CommitmentList-CDocwl5K.js → CommitmentList-i-IZ4gbr.js} +1 -1
  26. package/dist/client/assets/{CommitmentsPage-Cr_MvU96.js → CommitmentsPage-ChO1JkrE.js} +1 -1
  27. package/dist/client/assets/{ComputerResourceView-CJMUZPDy.js → ComputerResourceView-pLuD2ie6.js} +1 -1
  28. package/dist/client/assets/{ComputerViewer-BA-9lBBN.js → ComputerViewer-D7tPmpY5.js} +1 -1
  29. package/dist/client/assets/{ConnectionAccessLists-BLLpxhn3.js → ConnectionAccessLists-D6VH1vX3.js} +1 -1
  30. package/dist/client/assets/{ConnectionsPage-BWVfAPd1.js → ConnectionsPage-7x5olD9q.js} +2 -2
  31. package/dist/client/assets/{ConventionPage-EK3WUWVa.js → ConventionPage-BTYLWw6p.js} +1 -1
  32. package/dist/client/assets/{ExtensionPageRoute-C9hsJNX2.js → ExtensionPageRoute-A9AdBBbw.js} +2 -2
  33. package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-BeyAgBfh.js → FloatingTanStackRouterDevtools-CqogiFob-ayv0yz1C.js} +1 -1
  34. package/dist/client/assets/HandlePage-BdRWgke2.js +1 -0
  35. package/dist/client/assets/{HeartbeatPage-DfbNenFv.js → HeartbeatPage-Dh6W9Qg5.js} +1 -1
  36. package/dist/client/assets/KeyEntry-owhPGtw3.js +1 -0
  37. package/dist/client/assets/{LexicalField-DC_6Z-Ye.js → LexicalField-B1NFMLD6.js} +2 -2
  38. package/dist/client/assets/{ManagesPage-CYnGvNM2.js → ManagesPage-BAnBmBdo.js} +1 -1
  39. package/dist/client/assets/{Marketplace-CWiiq8of.js → Marketplace-67maxdwz.js} +2 -2
  40. package/dist/client/assets/{MarketplaceSourcesView-DF3cHMR0.js → MarketplaceSourcesView-CzPBNJJj.js} +1 -1
  41. package/dist/client/assets/{McpAppFrame-D5Muf5Sf.js → McpAppFrame-CuObpQTg.js} +2 -2
  42. package/dist/client/assets/McpSigninBody-B-ayj6bQ.js +1 -0
  43. package/dist/client/assets/{Model3dViewer-C9ODHy5I.js → Model3dViewer-DRVqxazk.js} +1 -1
  44. package/dist/client/assets/NamePage-DyH8JAqT.js +1 -0
  45. package/dist/client/assets/NewDirectMessageMenu-B3DxayR2.js +1 -0
  46. package/dist/client/assets/{NotificationsPage-ldulSpVu.js → NotificationsPage-BavEo7VZ.js} +1 -1
  47. package/dist/client/assets/{OpenMeshSwitch-BfEvR7s7.js → OpenMeshSwitch-BwkX2Toa.js} +2 -2
  48. package/dist/client/assets/{OperatorIdentityForm-ZM_zDnjM.js → OperatorIdentityForm-CtWgz2yi.js} +1 -1
  49. package/dist/client/assets/{PermissionHistory-liL_pJDR.js → PermissionHistory-DvM0F2bS.js} +1 -1
  50. package/dist/client/assets/{PermissionsPage-DFMjDQby.js → PermissionsPage-D1DJHezV.js} +1 -1
  51. package/dist/client/assets/{PersonalityPopover-CITFG0_N.js → PersonalityPopover-BV-9wfIl.js} +1 -1
  52. package/dist/client/assets/PhotoPage-BHvRQnex.js +1 -0
  53. package/dist/client/assets/{PresetPicker-CpYu7nb6.js → PresetPicker-BOQKgYAK.js} +2 -2
  54. package/dist/client/assets/{PreviewRefusedNotice-CF3bzfSe.js → PreviewRefusedNotice-BdhUln2h.js} +1 -1
  55. package/dist/client/assets/{ProfileFields-D4p6bhIa.js → ProfileFields-DFRnRR38.js} +1 -1
  56. package/dist/client/assets/{ProfilePanelContainer-XCuCnd1t.js → ProfilePanelContainer-CkxX9Dps.js} +1 -1
  57. package/dist/client/assets/{ProfileRolePicker-qRf3DSdk.js → ProfileRolePicker-BSYi_luB.js} +1 -1
  58. package/dist/client/assets/PromptSuggestionChips-r08GqBH1.js +1 -0
  59. package/dist/client/assets/{ReportsToPopover-Cu-Cnzij.js → ReportsToPopover-BcsM5Eia.js} +1 -1
  60. package/dist/client/assets/{RoomSurface-CsAifwp2.js → RoomSurface-DaRCf4og.js} +7 -7
  61. package/dist/client/assets/{RoomsPage-DZYMR2in.js → RoomsPage-CQqsdVvB.js} +1 -1
  62. package/dist/client/assets/RunsOnPopover-DFb4xEhP.js +1 -0
  63. package/dist/client/assets/RuntimeConnectFlow-pKFJlNSJ.js +1 -0
  64. package/dist/client/assets/RuntimeSetupDialog-DvBJbrmj.js +1 -0
  65. package/dist/client/assets/{SessionsPage-thndqcpY.js → SessionsPage-CGgnEPh7.js} +1 -1
  66. package/dist/client/assets/SettingsDialog-D0cmzjrH.js +12 -0
  67. package/dist/client/assets/{SkillsPage-CmXyAw3J.js → SkillsPage-DDoPlsn2.js} +1 -1
  68. package/dist/client/assets/TaskDialogWrapper-DoIVzbKU.js +1 -0
  69. package/dist/client/assets/TasksEmptyState-B68O6dnT.js +3 -0
  70. package/dist/client/assets/{TasksPage-DGNXrDAk.js → TasksPage-BsBDphim.js} +1 -1
  71. package/dist/client/assets/{TeamComputerEntry-CIfFRo6-.js → TeamComputerEntry-CoQ4EsDm.js} +1 -1
  72. package/dist/client/assets/{ToolsPage-BKZkSarf.js → ToolsPage-Cl1aOpev.js} +2 -2
  73. package/dist/client/assets/{TopologyGraph-og2tlLj7.js → TopologyGraph-D3CxaLGX.js} +2 -2
  74. package/dist/client/assets/TourHost-4O6TJzc-.js +1 -0
  75. package/dist/client/assets/{UnlinkDialog-BTYC_Sit.js → UnlinkDialog-DIMY60Fi.js} +1 -1
  76. package/dist/client/assets/WidgetErrorCard-CzWw_SPD.js +108 -0
  77. package/dist/client/assets/_shell-BRH2Y-U-.js +80 -0
  78. package/dist/client/assets/{_shell._home-CP7HQ7Cs.js → _shell._home-DG3Vw7S5.js} +1 -1
  79. package/dist/client/assets/_shell._home.activity-COI96oAO.js +1 -0
  80. package/dist/client/assets/_shell._home.index-CTwsTjcQ.js +3 -0
  81. package/dist/client/assets/_shell._home.tasks-DOVoPYaf.js +1 -0
  82. package/dist/client/assets/{_shell._home.workspaces-Cdsw2-jI.js → _shell._home.workspaces-ApZhnjwy.js} +1 -1
  83. package/dist/client/assets/_shell.channels-CRkJHU5R.js +10 -0
  84. package/dist/client/assets/{_shell.connections-sF5vS-Lm.js → _shell.connections-bhAK3jnE.js} +1 -1
  85. package/dist/client/assets/{_shell.feedback-requests-hu21WXyA.js → _shell.feedback-requests-k43R8-rW.js} +2 -2
  86. package/dist/client/assets/_shell.marketplace-DGN_IdZY.js +1 -0
  87. package/dist/client/assets/_shell.marketplace_.sources-2YMpLInp.js +1 -0
  88. package/dist/client/assets/_shell.session-D871zZl3.js +61 -0
  89. package/dist/client/assets/{_shell.team-raG7wRwF.js → _shell.team-DHCM1QoO.js} +6 -6
  90. package/dist/client/assets/_shell.x._extensionId-D3-n5IRW.js +1 -0
  91. package/dist/client/assets/_shell.x._extensionId_._-D3-n5IRW.js +1 -0
  92. package/dist/client/assets/{access-copy-CcG3wpsK.js → access-copy-BVzi1REx.js} +1 -1
  93. package/dist/client/assets/{banner-nt7EFLr6.js → banner-3xXXsU5J.js} +2 -2
  94. package/dist/client/assets/{card-B_zeSZiU.js → card-Bt6IU-Bh.js} +1 -1
  95. package/dist/client/assets/{command-CDfYcQI6.js → command-CWokzKS1.js} +1 -1
  96. package/dist/client/assets/{cpu-D861493C.js → cpu-BzByzE9V.js} +1 -1
  97. package/dist/client/assets/{empty-state-CQ1oXLFa.js → empty-state-BgnQDiMZ.js} +1 -1
  98. package/dist/client/assets/{execution-config-on8kVvnW.js → execution-config-D5-SEt2t.js} +1 -1
  99. package/dist/client/assets/{file-Bwo21EVR.js → file-VHDTQub2.js} +1 -1
  100. package/dist/client/assets/{file-exclamation-point-BedYLbs2.js → file-exclamation-point-DbWvGys0.js} +1 -1
  101. package/dist/client/assets/{file-text-BTj3WyHS.js → file-text-BAhi2zct.js} +1 -1
  102. package/dist/client/assets/{find-latest-widget-fence-B8fM5rIs.js → find-latest-widget-fence-Z0HPVqeK.js} +2 -2
  103. package/dist/client/assets/{form-lSBktWDn.js → form-Blrb1xBU.js} +1 -1
  104. package/dist/client/assets/{format-cron-W7G0In8e.js → format-cron-lKWqEmle.js} +1 -1
  105. package/dist/client/assets/{git-branch-CKlZ81Bg.js → git-branch-BObm8Rlz.js} +1 -1
  106. package/dist/client/assets/{heart-BSVjeGLA.js → heart-Du7nuefC.js} +1 -1
  107. package/dist/client/assets/{highlighted-body-KPVGNVTW-Ct8vmPkj.js → highlighted-body-KPVGNVTW-B_GO7V1P.js} +1 -1
  108. package/dist/client/assets/image-lightbox-BZ1TV3mN.js +1 -0
  109. package/dist/client/assets/image-off-hnjcBIzN.js +6 -0
  110. package/dist/client/assets/{index-6pYWHTBx.js → index-1I8qHZDt.js} +1 -1
  111. package/dist/client/assets/{index-CeZ13dpH.js → index-4GC2fkeO.js} +1 -1
  112. package/dist/client/assets/index-4PAAWURd.js +1 -0
  113. package/dist/client/assets/{index-CaKe9EaL.js → index-B0tAedq7.js} +1 -1
  114. package/dist/client/assets/{index-BVedye9r.js → index-BP68J4pb.js} +1 -1
  115. package/dist/client/assets/{index-gbNK9zj5.js → index-BUOcbPfv.js} +3 -3
  116. package/dist/client/assets/{index-DShrfGYE.js → index-BVKXIbLh.js} +1 -1
  117. package/dist/client/assets/{index-CeeHkxIC.js → index-BaRQVgiN.js} +1 -1
  118. package/dist/client/assets/{index-B-C_A3lP.js → index-BeVbHOwX.js} +2 -2
  119. package/dist/client/assets/{index-KaSZDcGa.js → index-BgzgdvDn.js} +1 -1
  120. package/dist/client/assets/{index-C0TknRcB.js → index-Bm0z9mHt.js} +1 -1
  121. package/dist/client/assets/{index-bvqpTKLz.js → index-BnNTKsbt.js} +1 -1
  122. package/dist/client/assets/{index-DjI5vH_U.js → index-BtbZpz4b.js} +1 -1
  123. package/dist/client/assets/{index-D7kjWnlR.js → index-BvjuGXcS.js} +1 -1
  124. package/dist/client/assets/{index-7Fd_Eeda.js → index-C60RrnTd.js} +1 -1
  125. package/dist/client/assets/{index-CQrM6oF9.js → index-CBm3whA-.js} +1 -1
  126. package/dist/client/assets/{index-C96eZrOR.js → index-CCg7yRe1.js} +1 -1
  127. package/dist/client/assets/{index-Dh8D-3Sb.js → index-CQCN6kWR.js} +1 -1
  128. package/dist/client/assets/index-Cdyszxoa.js +17 -0
  129. package/dist/client/assets/index-Ch-ON5gw.js +1 -0
  130. package/dist/client/assets/{index-UNxDevG6.js → index-Ci74HAFs.js} +1 -1
  131. package/dist/client/assets/{index-Dq4bx2np.js → index-CiQxS4Bn.js} +1 -1
  132. package/dist/client/assets/{index-DEOzZEcu.js → index-CqoIjNC2.js} +3 -3
  133. package/dist/client/assets/index-CrflCTqO.css +1 -0
  134. package/dist/client/assets/index-D5TZCu8j.js +1 -0
  135. package/dist/client/assets/{index-CNnnXzI4.js → index-D6y4WeTi.js} +1 -1
  136. package/dist/client/assets/{index-BjTJ6p2k.js → index-DB8TDRSm.js} +1 -1
  137. package/dist/client/assets/index-DCOOlbEt.js +1 -0
  138. package/dist/client/assets/index-DHYvT3nr.js +23 -0
  139. package/dist/client/assets/{index-GINKfP45.js → index-DRea_Gi0.js} +1 -1
  140. package/dist/client/assets/index-Dain_3cO.js +1 -0
  141. package/dist/client/assets/index-Dc5cpBoO.js +1023 -0
  142. package/dist/client/assets/{index-DOuj--Yi.js → index-Df7a-2P5.js} +1 -1
  143. package/dist/client/assets/{index-BHt5KOZA.js → index-DkhM0fDi.js} +1 -1
  144. package/dist/client/assets/{index-CCWSicoJ.js → index-DoMJUxt_.js} +1 -1
  145. package/dist/client/assets/{index-09EqfhW0.js → index-EZHlD3gf.js} +1 -1
  146. package/dist/client/assets/{index-SdTS2P3x.js → index-HxT_wkaZ.js} +1 -1
  147. package/dist/client/assets/{index-RFknyjho.js → index-Lh82Rz5C.js} +1 -1
  148. package/dist/client/assets/{index-DgRqCuFH.js → index-WxtASL5_.js} +1 -1
  149. package/dist/client/assets/{index-CF73kwtO.js → index-_5Dn0bFm.js} +17 -17
  150. package/dist/client/assets/{index-V_EcsvR4.js → index-aXm0xP_2.js} +1 -1
  151. package/dist/client/assets/{index-DeNVXdMl.js → index-ox3ce99A.js} +1 -1
  152. package/dist/client/assets/{index-BdrbKBym.js → index-r_O6CmXY.js} +1 -1
  153. package/dist/client/assets/index.esm-DXsF3Bua.js +41 -0
  154. package/dist/client/assets/{inline-code-Beal0546.js → inline-code-DAEoWvTf.js} +1 -1
  155. package/dist/client/assets/{layers-DUfQMkMa.js → layers-CsM34LRv.js} +1 -1
  156. package/dist/client/assets/{lightbulb-DTSn-mNB.js → lightbulb-B8JAixK_.js} +1 -1
  157. package/dist/client/assets/{link-2-CHr2s4m2.js → link-2-Csc6okl3.js} +1 -1
  158. package/dist/client/assets/{list-runtime-types-CwEp9Lg4.js → list-runtime-types-DQrZNB7x.js} +1 -1
  159. package/dist/client/assets/markdown-content-DPc7aD1j.js +1 -0
  160. package/dist/client/assets/{mention-pill-XE9mX9G8.js → mention-pill-8P_w4muj.js} +1 -1
  161. package/dist/client/assets/{message-square-off-DUkKSITA.js → message-square-off-D5DXu2cY.js} +1 -1
  162. package/dist/client/assets/{more-details-3dDtVYc6.js → more-details-DEeu2M-p.js} +1 -1
  163. package/dist/client/assets/{owner-notice-BKmuWRki.js → owner-notice-BW4k1ycg.js} +1 -1
  164. package/dist/client/assets/{package-DM7e-GVa.js → package-BSwwAFVm.js} +1 -1
  165. package/dist/client/assets/{page-container-nGewlFnj.js → page-container-CjPUNtNw.js} +1 -1
  166. package/dist/client/assets/{paperclip-BgXlvBBI.js → paperclip-DQaRz34E.js} +1 -1
  167. package/dist/client/assets/{path-input-RzOiTE45.js → path-input-CgXSYNZn.js} +1 -1
  168. package/dist/client/assets/plug-BaUXMfIl.js +11 -0
  169. package/dist/client/assets/primer-trigger-DHB0vilf.js +3 -0
  170. package/dist/client/assets/{profile-errors-CFZN0y6a.js → profile-errors-JW2XTgia.js} +1 -1
  171. package/dist/client/assets/{progress-Cvnh4Qcr.js → progress-CErAw8zp.js} +1 -1
  172. package/dist/client/assets/{query-error-state-CfJfYpa3.js → query-error-state-BFWpEXsl.js} +1 -1
  173. package/dist/client/assets/{radio-BOcAjXVO.js → radio-Bkx216ga.js} +1 -1
  174. package/dist/client/assets/registry-Ce1VRIS3.js +1 -0
  175. package/dist/client/assets/{relay-trace-schemas-Cvb7RGjg.js → relay-trace-schemas-DiZj_AFV.js} +2 -2
  176. package/dist/client/assets/{room-files-source-B-ZJA_NM.js → room-files-source-BilZvdpf.js} +2 -2
  177. package/dist/client/assets/{rotate-ccw-clock-vRQP4hWE.js → rotate-ccw-clock-D_SO1stN.js} +1 -1
  178. package/dist/client/assets/{rotate-cw-DD2nOAQ-.js → rotate-cw-C68kM23F.js} +1 -1
  179. package/dist/client/assets/{scroll-area-DTvv8_DS.js → scroll-area-CVWFUmJV.js} +1 -1
  180. package/dist/client/assets/{search-x-Ig8nk-DU.js → search-x-BTFVvyA2.js} +1 -1
  181. package/dist/client/assets/{shield-check-DjnWx7aT.js → shield-check-Dpxi6WqO.js} +1 -1
  182. package/dist/client/assets/{shield-x-BrtccpM7.js → shield-x-CdCCgyXk.js} +1 -1
  183. package/dist/client/assets/signed-in-BxAnDo0S.js +1 -0
  184. package/dist/client/assets/{soul-file-C5mMIP4v.js → soul-file-CRfKVJX3.js} +1 -1
  185. package/dist/client/assets/{table-Rll_Jxd8.js → table-BL3xUC41.js} +1 -1
  186. package/dist/client/assets/{terminal-Bjss9oke.js → terminal-u_UCRzSM.js} +1 -1
  187. package/dist/client/assets/{trust-posture-Dmk2WlZv.js → trust-posture-B-v4BWo7.js} +1 -1
  188. package/dist/client/assets/{unplug-BHYMc4ND.js → unplug-CFbC-L5W.js} +1 -1
  189. package/dist/client/assets/{unverified-catalog-notice-BmIVQhjE.js → unverified-catalog-notice-ZUqscVFM.js} +1 -1
  190. package/dist/client/assets/{use-adapter-catalog-RzlxX2Wa.js → use-adapter-catalog-Z4MDWZAZ.js} +1 -1
  191. package/dist/client/assets/{use-bindings-Ds_MAC67.js → use-bindings-CsTavmf-.js} +1 -1
  192. package/dist/client/assets/{use-composer-prefs-ckA_eZQS.js → use-composer-prefs-BY2dTvep.js} +1 -1
  193. package/dist/client/assets/{use-connector-management-oEqok0QG.js → use-connector-management-L9l21yTi.js} +1 -1
  194. package/dist/client/assets/{use-deep-link-scroll-Clu9Sz2-.js → use-deep-link-scroll-Bn2ZUtDY.js} +1 -1
  195. package/dist/client/assets/{use-delete-binding-B_zHPcy8.js → use-delete-binding-DLvdHtPD.js} +1 -1
  196. package/dist/client/assets/{use-dev-links-BO7-IHe9.js → use-dev-links-DFvL8mIg.js} +1 -1
  197. package/dist/client/assets/{use-external-adapter-catalog-7lRWtn7J.js → use-external-adapter-catalog-Be57G4tz.js} +1 -1
  198. package/dist/client/assets/{use-full-activity-feed-DrcMJL9m.js → use-full-activity-feed-Cp3lYXdi.js} +1 -1
  199. package/dist/client/assets/use-is-below-desktop-DmekpHAF.js +1 -0
  200. package/dist/client/assets/use-is-hub-el7LTkg3.js +1 -0
  201. package/dist/client/assets/{use-jump-back-in-Dav0ttfs.js → use-jump-back-in-ChH1FSEK.js} +3 -3
  202. package/dist/client/assets/{use-local-browser-CtltDlof.js → use-local-browser-zA8gMhcC.js} +1 -1
  203. package/dist/client/assets/{use-mesh-topology-CiS9XQsg.js → use-mesh-topology-CvoD-L1G.js} +1 -1
  204. package/dist/client/assets/{use-mounted-ref-DuK0vm9N.js → use-mounted-ref-Ch0wqQry.js} +1 -1
  205. package/dist/client/assets/{use-notification-prefs-Chf4UNbq.js → use-notification-prefs-DeR05zhp.js} +1 -1
  206. package/dist/client/assets/{use-panel-tab-placements-C5y831aL.js → use-panel-tab-placements-DdjrmaoK.js} +1 -1
  207. package/dist/client/assets/use-pending-read-DBpte0GI.js +1 -0
  208. package/dist/client/assets/use-personality-commit-qQfISO2-.js +1 -0
  209. package/dist/client/assets/use-promo-activation-CwGoE7b-.js +11 -0
  210. package/dist/client/assets/{use-promo-dismissals-8-hGry_v.js → use-promo-dismissals-BBqVN4hx.js} +1 -1
  211. package/dist/client/assets/{use-pulse-freshness-CWudgqNc.js → use-pulse-freshness-BKW7tjvX.js} +1 -1
  212. package/dist/client/assets/{use-relay-config-8mXfegbP.js → use-relay-config-D5iieBXl.js} +1 -1
  213. package/dist/client/assets/{use-room-follow-claim-DgEWUsoP.js → use-room-follow-claim-BwZh2ZPH.js} +1 -1
  214. package/dist/client/assets/{use-roving-tab-list-CXy0Hv5J.js → use-roving-tab-list-Ct7yDAUE.js} +1 -1
  215. package/dist/client/assets/use-session-canvas-CJrfZrYG.js +24 -0
  216. package/dist/client/assets/{use-session-diagnostics-LKiXub1H.js → use-session-diagnostics-Dn-Wnyhh.js} +4 -4
  217. package/dist/client/assets/{use-unclaimed-chats-Cr812OTh.js → use-unclaimed-chats-M-c5tjXH.js} +1 -1
  218. package/dist/client/assets/use-update-config-DhlbZldm.js +1 -0
  219. package/dist/client/assets/{useMutationState-BnXJ-0A_.js → useMutationState-Cd-VqRAv.js} +1 -1
  220. package/dist/client/index.html +2 -2
  221. package/dist/drizzle/20261017113300_session_public_computer.sql +1 -0
  222. package/dist/drizzle/meta/20261017113300_snapshot.json +14020 -0
  223. package/dist/drizzle/meta/_journal.json +7 -0
  224. package/dist/server/index.js +128843 -121508
  225. package/dist/server/index.js.map +2 -2
  226. package/package.json +5 -5
  227. package/dist/client/assets/AdapterSetupWizard-DfNJz5SD.js +0 -2
  228. package/dist/client/assets/AppearancePage-8ALtWGZZ.js +0 -1
  229. package/dist/client/assets/AttentionSignalRow-c-u1cE1l.js +0 -1
  230. package/dist/client/assets/CanvasFileContent-BJ39nHuR.js +0 -2
  231. package/dist/client/assets/CanvasModel3dContent-TaunlbT2.js +0 -2
  232. package/dist/client/assets/HandlePage-CfeEzfDk.js +0 -1
  233. package/dist/client/assets/KeyEntry-CEbe5Xvn.js +0 -6
  234. package/dist/client/assets/McpSigninBody-CLZFoQgC.js +0 -1
  235. package/dist/client/assets/NamePage-B4YrH-ug.js +0 -1
  236. package/dist/client/assets/NewDirectMessageMenu-Co9Uv5t5.js +0 -1
  237. package/dist/client/assets/PhotoPage-DYDJPBfu.js +0 -1
  238. package/dist/client/assets/PromptSuggestionChips-CUwLk83h.js +0 -1
  239. package/dist/client/assets/RunsOnPopover-CTBEMstG.js +0 -1
  240. package/dist/client/assets/RuntimeConnectFlow-DY4sjRgN.js +0 -1
  241. package/dist/client/assets/RuntimeSetupDialog-DJu_-eNa.js +0 -1
  242. package/dist/client/assets/SettingsDialog-CKmcLF66.js +0 -12
  243. package/dist/client/assets/TaskDialogWrapper-Boxr_hgF.js +0 -1
  244. package/dist/client/assets/TasksEmptyState-CQf1YroK.js +0 -3
  245. package/dist/client/assets/TourHost-DzEG8bZP.js +0 -1
  246. package/dist/client/assets/WidgetErrorCard-CT4sl_T6.js +0 -108
  247. package/dist/client/assets/_shell-BDlkTSin.js +0 -90
  248. package/dist/client/assets/_shell._home.activity-DGXa_ouh.js +0 -1
  249. package/dist/client/assets/_shell._home.index-D5kOfqnL.js +0 -3
  250. package/dist/client/assets/_shell._home.tasks-BSMD-atB.js +0 -1
  251. package/dist/client/assets/_shell.channels-B4VQ7tiZ.js +0 -10
  252. package/dist/client/assets/_shell.marketplace-B-T-ALMv.js +0 -1
  253. package/dist/client/assets/_shell.marketplace_.sources-Chu-9-Vi.js +0 -1
  254. package/dist/client/assets/_shell.session-Bz6wvDBp.js +0 -66
  255. package/dist/client/assets/_shell.x._extensionId-DSqMu6Ey.js +0 -1
  256. package/dist/client/assets/_shell.x._extensionId_._-DSqMu6Ey.js +0 -1
  257. package/dist/client/assets/index-BDCqg2iM.css +0 -1
  258. package/dist/client/assets/index-C8-dwIPp.js +0 -1018
  259. package/dist/client/assets/index-CAv_6Po4.js +0 -1
  260. package/dist/client/assets/index-ClELcMX1.js +0 -1
  261. package/dist/client/assets/index-CrEyJcPM.js +0 -17
  262. package/dist/client/assets/index-DQJM5kjJ.js +0 -1
  263. package/dist/client/assets/index-DURo45pu.js +0 -1
  264. package/dist/client/assets/index-sfSRuIXm.js +0 -23
  265. package/dist/client/assets/markdown-content-GoymYcRL.js +0 -1
  266. package/dist/client/assets/primer-trigger-B60oEVY7.js +0 -3
  267. package/dist/client/assets/registry-B9wsS5De.js +0 -1
  268. package/dist/client/assets/use-is-below-desktop-BhzXZsbH.js +0 -1
  269. package/dist/client/assets/use-pending-read-i6TB4gGQ.js +0 -1
  270. package/dist/client/assets/use-personality-commit-KKJ2ve1V.js +0 -1
  271. package/dist/client/assets/use-promo-activation-D45fuXdT.js +0 -11
  272. package/dist/client/assets/use-session-canvas-CUvHGgMf.js +0 -64
  273. package/dist/client/assets/use-update-config-Bad4g6mB.js +0 -1
@@ -0,0 +1,41 @@
1
+ import{R as ni,r as Y,j as L}from"./index-Dc5cpBoO.js";var R=function(i,n){return Number(i.toFixed(n))},pe=function(i,n){return typeof i=="number"?i:n},P=function(i,n,e){e&&typeof e=="function"&&e(i,n)},fe=function(i){return-Math.cos(i*Math.PI)/2+.5},me=function(i){return i},he=function(i){return i*i},ce=function(i){return i*(2-i)},ge=function(i){return i<.5?2*i*i:-1+(4-2*i)*i},we=function(i){return i*i*i},ye=function(i){return--i*i*i+1},be=function(i){return i<.5?4*i*i*i:(i-1)*(2*i-2)*(2*i-2)+1},Pe=function(i){return i*i*i*i},Se=function(i){return 1- --i*i*i*i},Ce=function(i){return i<.5?8*i*i*i*i:1-8*--i*i*i*i},Te=function(i){return i*i*i*i*i},Ae=function(i){return 1+--i*i*i*i*i},Ye=function(i){return i<.5?16*i*i*i*i*i:1+16*--i*i*i*i*i},Bi={easeOut:fe,linear:me,easeInQuad:he,easeOutQuad:ce,easeInOutQuad:ge,easeInCubic:we,easeOutCubic:ye,easeInOutCubic:be,easeInQuart:Pe,easeOutQuart:Se,easeInOutQuart:Ce,easeInQuint:Te,easeOutQuint:Ae,easeInOutQuint:Ye},Xe=function(i){var n=i.animationResolve;i.animationResolve=null,n==null||n()},_=function(i){i.animationFrame!==null&&cancelAnimationFrame(i.animationFrame),i.animationFrame=null,i.isAnimating=!1,i.animation=null,i.velocity=null,Xe(i)};function Li(i,n,e,r,o){if(!i.mounted){o==null||o();return}var a=new Date().getTime(),t=1;_(i);var l=function(){if(!(!i.mounted||i.animation!==l)){var s=new Date().getTime()-a,d=s/e,u=Bi[n],v=u(d);if(s>=e){i.animation=null,i.animationFrame=null;var p=i.animationResolve;i.animationResolve=null,r(t),p==null||p(),i.flushResizeAlignment()}else r(v),i.animationFrame=requestAnimationFrame(l)}};i.animation=l,i.animationResolve=o??null,i.animationFrame=requestAnimationFrame(l)}function Ee(i){var n=i.scale,e=i.positionX,r=i.positionY;return!(Number.isNaN(n)||Number.isNaN(e)||Number.isNaN(r))}function H(i,n,e,r){var o=Ee(n);if(!i.mounted||!o)return Promise.resolve();var a=i.setState,t=i.state,l=t.scale,s=t.positionX,d=t.positionY,u=n.scale-l,v=n.positionX-s,p=n.positionY-d;return e===0?(a(n.scale,n.positionX,n.positionY),Promise.resolve()):new Promise(function(m){Li(i,r,e,function(f){f!==1?i.isAnimating=!0:i.isAnimating=!1;var h=l+u*f,g=s+v*f,c=d+p*f;a(h,g,c)},m)})}function ze(i,n,e){var r=i.clientWidth,o=i.clientHeight,a=n.offsetWidth,t=n.offsetHeight,l=a*e,s=t*e,d=r-l,u=o-s;return{wrapperWidth:r,wrapperHeight:o,newContentWidth:l,newDiffWidth:d,newContentHeight:s,newDiffHeight:u}}var _e=function(i,n,e,r,o,a,t){var l=i>n?e*(t?.5:1):0,s=r>o?a*(t?.5:1):0,d=i-n-l,u=l,v=r-o-s,p=s;return{minPositionX:d,maxPositionX:u,minPositionY:v,maxPositionY:p,scaleWidthFactor:l,scaleHeightFactor:s}},bi=function(i,n){var e=i.wrapperComponent,r=i.contentComponent,o=i.setup,a=o.centerZoomedOut,t=o.disablePadding;if(!e||!r)throw new Error("Components are not mounted");var l=ze(e,r,n),s=l.wrapperWidth,d=l.wrapperHeight,u=l.newContentWidth,v=l.newContentHeight,p=l.newDiffWidth,m=l.newDiffHeight,f=_e(s,u,p,d,v,m,!!a),h=s>=u&&d>=v;t&&h&&!a&&(f.minPositionX=0,f.maxPositionX=0,f.minPositionY=0,f.maxPositionY=0);var g=i.setup,c=g.minPositionX,y=g.maxPositionX,w=g.minPositionY,S=g.maxPositionY;return c!=null&&(f.minPositionX=s*(1-n)+c*n),y!=null&&(f.maxPositionX=y*n),w!=null&&(f.minPositionY=d*(1-n)+w*n),S!=null&&(f.maxPositionY=S*n),f},G=function(i,n,e,r){return r?i<n?R(n,2):i>e?R(e,2):R(i,2):R(i,2)},k=function(i,n){var e=bi(i,n);return i.bounds=e,e};function F(i,n,e,r,o,a,t){var l=e.minPositionX,s=e.minPositionY,d=e.maxPositionX,u=e.maxPositionY,v=0,p=0;t&&(v=o,p=a);var m=G(i,l-v,d+v,r),f=G(n,s-p,u+p,r);return{x:m,y:f}}function oi(i,n,e,r,o,a){var t=i.state,l=t.scale,s=t.positionX,d=t.positionY,u=r-l;if(!Number.isFinite(n)||!Number.isFinite(e))return console.error("Mouse X and Y position were not provided!"),{x:s,y:d};var v=s-n*u,p=d-e*u,m=F(v,p,o,a,0,0,null);return m}var _i=1e-7;function V(i,n,e,r,o){var a=o?r:0,t=Math.max(n-a,_i),l=e+a;return!Number.isNaN(e)&&i>=l?l:!Number.isNaN(n)&&i<=t?t:Math.max(i,_i)}var ki=function(i,n){var e=i.setup.panning.excluded,r=i.isInitialized,o=i.wrapperComponent,a=n.target,t=function(u){return!!u&&typeof u=="object"&&u.nodeType===1&&typeof u.contains=="function"},l=typeof n.composedPath=="function"?n.composedPath().some(function(u){return t(u)&&!!(o!=null&&o.contains(u))}):!!(o!=null&&o.contains(a)),s=r&&a&&l;if(!s)return!1;var d=j(a,e);return!(d||ur(a)||Ci(a))},Wi=function(i){var n=i.isInitialized,e=i.isPanning,r=i.setup,o=r.panning.disabled,a=n&&e&&!o;return!!a},ke=function(i,n){var e=i.state,r=e.positionX,o=e.positionY;i.isPanning=!0;var a=n.clientX,t=n.clientY;i.startCoords={x:a-r,y:t-o}},We=function(i,n){var e=n.touches,r=i.state,o=r.positionX,a=r.positionY;i.isPanning=!0;var t=e.length===1;if(t){var l=e[0].clientX,s=e[0].clientY;i.startCoords={x:l-o,y:s-a}}};function Oe(i){var n=i.state,e=n.positionX,r=n.positionY,o=n.scale,a=i.setup,t=a.disabled,l=a.limitToBounds,s=a.centerZoomedOut,d=i.wrapperComponent;if(!(t||!d||!i.bounds)){var u=i.bounds,v=u.maxPositionX,p=u.minPositionX,m=u.maxPositionY,f=u.minPositionY,h=e>v||e<p,g=r>m||r<f,c=e>v?d.clientWidth:i.setup.minPositionX||0,y=r>m?d.clientHeight:i.setup.minPositionY||0,w=oi(i,c,y,o,i.bounds,l||s),S=w.x,X=w.y;return{scale:o,positionX:h?S:e,positionY:g?X:r}}}function Ki(i,n,e,r,o){var a=i.setup.limitToBounds,t=i.wrapperComponent,l=i.bounds,s=i.state,d=s.scale,u=s.positionX,v=s.positionY;if(!(t===null||l===null||n===u&&e===v)){var p=F(n,e,l,a,r,o,t),m=p.x,f=p.y;i.setState(d,m,f)}}var Me=function(i,n,e){var r=i.startCoords,o=i.state,a=i.setup.panning,t=a.lockAxisX,l=a.lockAxisY,s=o.positionX,d=o.positionY;if(!r)return{x:s,y:d};var u=n-r.x,v=e-r.y,p=t?s:u,m=l?d:v;return{x:p,y:m}},K=function(i,n,e){var r=i.setup,o=i.state,a=r.minScale,t=r.disablePadding,l=r.centerZoomedOut,s=e??o.scale;return n>0&&s>=a&&!t&&!l?n:0},B;(function(i){i.TRACK_PAD="track_pad",i.MOUSE="mouse",i.TOUCH="touch"})(B||(B={}));var De=function(i){var n=i.mounted,e=i.wrapperComponent,r=i.contentComponent,o=i.setup,a=o.disabled,t=o.velocityAnimation,l=o.limitToBounds,s=i.state.scale,d=t.disabled;if(d||a||!n||!e||!r)return!1;if(!l)return!0;var u=e.clientWidth<r.offsetWidth*s||e.clientHeight<r.offsetHeight*s;return u},Ne=function(i){var n=i.mounted,e=i.velocity,r=i.bounds,o=i.setup,a=o.disabled,t=o.velocityAnimation,l=t.disabled,s=!l&&!a&&n;return!(!s||!e||!r)};function Re(i,n){var e=i.setup.velocityAnimation,r=e.animationTime,o=e.maxAnimationTime,a=e.inertia;return Math.min(r*Math.max(1,Math.abs(n/a)),o)}function Oi(i,n,e,r,o,a,t,l,s,d){if(o){if(n>t&&e>t){var u=t+(i-t)*d;return u>s?s:u<t?t:u}if(n<a&&e<a){var u=a+(i-a)*d;return u<l?l:u>a?a:u}}return r?n:G(i,a,t,o)}function Be(i){var n=1,e=i.clientWidth/window.innerWidth;return Number.isNaN(e)?n:Math.min(n,e)}var fi=function(i,n,e){var r=0,o=i*e;return Number.isNaN(o)?r:i<0?Math.max(o,-n):Math.min(o,n)};function Le(i,n,e){var r,o,a=De(i);if(a){var t=i.lastMousePosition,l=i.velocityTime,s=i.setup,d=i.wrapperComponent,u=s.velocityAnimation,v=u.maxStrengthMouse,p=u.maxStrengthTouch,m=u.sensitivityTouch,f=u.sensitivityMouse,h=Date.now();if(t&&l&&d){var g=Be(d),c=(r={},r[B.TOUCH]=m,r[B.MOUSE]=f,r)[e],y=(o={},o[B.TOUCH]=p,o[B.MOUSE]=v,o)[e],w=n.x-t.x,S=n.y-t.y,X=fi(w/g,y,c),T=fi(S/g,y,c),C=h-l,E=w*w+S*S,A=fi(Math.sqrt(E)/C,y,c);i.velocity={velocityX:X,velocityY:T,total:A}}i.lastMousePosition=n,i.velocityTime=h}}function Ke(i){var n=i.velocity,e=i.bounds,r=i.setup,o=i.wrapperComponent,a=Ne(i);if(!(!a||!n||!e||!o)){var t=n.velocityX,l=n.velocityY,s=n.total,d=e.maxPositionX,u=e.minPositionX,v=e.maxPositionY,p=e.minPositionY,m=r.limitToBounds,f=r.autoAlignment,h=r.zoomAnimation,g=r.panning,c=g.lockAxisY,y=g.lockAxisX,w=h.animationType,S=f.sizeX,X=f.sizeY,T=f.velocityAlignmentTime,C=T,E=Re(i,s),A=Math.max(E,C),M=K(i,S),z=K(i,X),D=M*o.clientWidth/100,W=z*o.clientHeight/100,N=d+D,U=u-D,li=v+W,si=p-W,I=i.state,ui=new Date().getTime();Li(i,w,A,function(ii){var Q=i.state,di=Q.scale,vi=Q.positionX,pi=Q.positionY,le=new Date().getTime()-ui,se=le/C,ue=Bi[f.animationType],Ai=1-ue(Math.min(1,se)),Yi=1-ii,Xi=vi+t*Yi,Ei=pi+l*Yi,de=Oi(Xi,I.positionX,vi,y,m,u,d,U,N,Ai),ve=Oi(Ei,I.positionY,pi,c,m,p,v,si,li,Ai);if(vi!==Xi||pi!==Ei){i.setState(di,de,ve);var zi=i.props.onPanning;zi&&zi(b(i),{})}})}}function Mi(i,n){var e=i.state,r=e.scale,o=e.positionX,a=e.positionY;i.panStartPosition={x:o,y:a},_(i),k(i,r),"touches"in n?We(i,n):ke(i,n)}function Hi(i,n){var e=i.state.scale,r=i.setup,o=r.minScale,a=r.autoAlignment,t=a.disabled,l=a.sizeX,s=a.sizeY,d=a.animationTime,u=a.animationType,v=t||e<o||!l&&!s;if(!v){i.isResizeAlignmentPending&&k(i,e);var p=Oe(i);if(p){var m=i.state,f=m.positionX,h=m.positionY,g=p.positionX===f&&p.positionY===h;g||H(i,p,d,u)}}}function Di(i,n,e,r){var o=i.startCoords,a=i.setup,t=a.autoAlignment,l=t.sizeX,s=t.sizeY;if(o){var d=Me(i,n,e),u=d.x,v=d.y,p=K(i,l),m=K(i,s);Le(i,{x:u,y:v},r),Ki(i,u,v,p,m)}}function He(i,n){if(i.isPanning){var e=i.velocity,r=i.wrapperComponent,o=i.contentComponent;i.isPanning=!1;var a=i.state,t=a.positionX,l=a.positionY,s=a.scale,d=i.panStartPosition;if(i.panStartPosition=null,d){var u=t-d.x,v=l-d.y;if(u*u+v*v<=25)return}i.isAnimating=!1,i.animation=null,i.isResizeAlignmentPending&&k(i,s);var p=(r==null?void 0:r.clientWidth)||0,m=(r==null?void 0:r.clientHeight)||0,f=((o==null?void 0:o.offsetWidth)||0)*s,h=((o==null?void 0:o.offsetHeight)||0)*s,g=!i.setup.limitToBounds||p<f||m<h,c=!n&&e&&e.total>.1&&g;c?Ke(i):Hi(i)}}function ai(i,n,e,r){var o=i.setup,a=o.minScale,t=o.maxScale,l=o.limitToBounds,s=V(R(n,2),a,t,0,!1),d=k(i,s),u=oi(i,e,r,s,d,l),v=u.x,p=u.y;return{scale:s,positionX:v,positionY:p}}function Pi(i,n,e){var r=i.state.scale,o=i.wrapperComponent,a=i.setup,t=a.minScale,l=a.maxScale,s=a.limitToBounds,d=a.zoomAnimation,u=d.disabled,v=d.animationTime,p=d.animationType,m=r>=t&&r<=l,f=u||m;if((r>=1||s)&&Hi(i),!(f||!o||!i.mounted)){var h=n||o.clientWidth/2,g=e||o.clientHeight/2,c=r<t?t:l,y=ai(i,c,h,g);y&&H(i,y,v,p)}}var O=function(){return O=Object.assign||function(n){for(var e,r=1,o=arguments.length;r<o;r++){e=arguments[r];for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(n[a]=e[a])}return n},O.apply(this,arguments)};function Ni(i,n,e){for(var r=0,o=n.length,a;r<o;r++)(a||!(r in n))&&(a||(a=Array.prototype.slice.call(n,0,r)),a[r]=n[r]);return i.concat(a||Array.prototype.slice.call(n))}var mi={scale:1,positionX:0,positionY:0},Z={disabled:!1,minPositionX:null,maxPositionX:null,minPositionY:null,maxPositionY:null,minScale:1,maxScale:8,limitToBounds:!0,centerZoomedOut:!1,centerOnInit:!1,fitOnInit:!1,disablePadding:!1,smooth:!0,detached:!1,wheel:{step:.015,disabled:!1,wheelDisabled:!1,touchPadDisabled:!1,activationKeys:[],excluded:[]},trackPadPanning:{disabled:!0,velocityDisabled:!1,lockAxisX:!1,lockAxisY:!1,activationKeys:[],excluded:[]},panning:{disabled:!1,velocityDisabled:!1,lockAxisX:!1,lockAxisY:!1,allowLeftClickPan:!0,allowMiddleClickPan:!0,allowRightClickPan:!0,activationKeys:[],excluded:[]},pinch:{step:5,disabled:!1,allowPanning:!0,excluded:[]},keyboard:{disabled:!0,panStep:50,zoomStep:.25,animationTime:100,animationType:"easeOut",excluded:[]},doubleClick:{disabled:!1,step:.7,mode:"zoomIn",animationType:"easeOut",animationTime:200,excluded:[]},zoomAnimation:{disabled:!1,size:.4,animationTime:200,animationType:"easeOut"},autoAlignment:{disabled:!1,sizeX:100,sizeY:100,animationTime:200,velocityAlignmentTime:400,animationType:"easeOut"},velocityAnimation:{disabled:!1,sensitivityMouse:1,sensitivityTouch:1.2,maxStrengthMouse:20,maxStrengthTouch:40,inertia:1,animationTime:300,maxAnimationTime:800,animationType:"easeOut"}},gi={wrapperClass:"react-transform-wrapper",contentClass:"react-transform-component"},Zi=function(i){var n,e,r,o,a,t,l,s,d,u=Math.max((n=i.minScale)!==null&&n!==void 0?n:Z.minScale,1e-7),v=(e=i.maxScale)!==null&&e!==void 0?e:Z.maxScale,p=(r=i.initialScale)!==null&&r!==void 0?r:mi.scale,m=Math.min(Math.max(p,u),v),f=G((o=i.initialPositionX)!==null&&o!==void 0?o:mi.positionX,(a=i.minPositionX)!==null&&a!==void 0?a:-1/0,(t=i.maxPositionX)!==null&&t!==void 0?t:1/0,i.minPositionX!=null||i.maxPositionX!=null),h=G((l=i.initialPositionY)!==null&&l!==void 0?l:mi.positionY,(s=i.minPositionY)!==null&&s!==void 0?s:-1/0,(d=i.maxPositionY)!==null&&d!==void 0?d:1/0,i.minPositionY!=null||i.maxPositionY!=null);return{previousScale:m,scale:m,positionX:f,positionY:h}},Ri=function(i){var n=O({},Z);return Object.keys(i).forEach(function(e){var r=e,o=typeof i[r]<"u",a=typeof Z[r]<"u";if(a&&o){var t=Object.prototype.toString.call(Z[r]),l=t==="[object Object]",s=t==="[object Array]";l?n[r]=O(O({},Z[r]),i[r]):s?n[r]=Ni(Ni([],Z[r],!0),i[r]):n[r]=i[r]}}),n.minScale<=0&&(n.minScale=1e-7),n},Fi=function(i,n,e){var r=i.state.scale,o=i.wrapperComponent,a=i.setup,t=a.maxScale,l=a.minScale,s=a.zoomAnimation,d=s.size;if(!o)throw new Error("Wrapper is not mounted");var u=r+n*e,v=V(R(u,3),l,t,d,!1);return v};function q(i,n,e,r){var o,a,t=i.wrapperComponent,l=i.props,s=l.onZoomStart,d=l.onZoom,u=l.onZoomStop,v=new MouseEvent("mousemove",{bubbles:!0}),p=b(i);P(p,v,s),P(p,v,d);var m=H(i,n,e,r),f=(a=(o=t==null?void 0:t.ownerDocument)===null||o===void 0?void 0:o.defaultView)!==null&&a!==void 0?a:typeof window<"u"?window:null;return f&&f.setTimeout(function(){i.mounted&&P(b(i),v,u)},e),m}function Vi(i,n,e,r,o){var a=i.wrapperComponent,t=i.state,l=t.scale,s=t.positionX,d=t.positionY,u=i.setup.zoomAnimation;if(!a)return console.error("No WrapperComponent found"),Promise.resolve();var v=u.disabled?0:r,p=a.clientWidth,m=a.clientHeight,f=(p/2-s)/l,h=(m/2-d)/l,g=Fi(i,n,e),c=ai(i,g,f,h);return c?q(i,c,v,o):(console.error("Error during zoom event. New transformation state was not calculated."),Promise.resolve())}function Ze(i,n,e,r){var o,a,t=i.wrapperComponent,l=i.props,s=l.onPanningStart,d=l.onPanning,u=l.onPanningStop,v=new MouseEvent("mousemove",{bubbles:!0}),p=b(i);P(p,v,s),P(p,v,d);var m=H(i,n,e,r),f=(a=(o=t==null?void 0:t.ownerDocument)===null||o===void 0?void 0:o.defaultView)!==null&&a!==void 0?a:typeof window<"u"?window:null;return f&&f.setTimeout(function(){i.mounted&&P(b(i),v,u)},e),m}function Si(i,n,e,r){n===void 0&&(n="contain");var o=i.wrapperComponent,a=i.contentComponent,t=i.setup;if(!o||!a)return null;var l=a.offsetWidth,s=a.offsetHeight,d=o.clientWidth,u=o.clientHeight;if(!l||!s||!d||!u)return null;var v=d/l,p=u/s,m=n==="cover"?Math.max(v,p):Math.min(v,p);return r!==void 0&&(m=Math.min(m,r)),e!==void 0&&(m=Math.max(m,e)),m=V(m,t.minScale,t.maxScale,0,!1),ti(m,o,a)}function ji(i,n,e,r){var o=i.setup,a=i.wrapperComponent,t=i.contentComponent,l=o.limitToBounds,s=o.centerOnInit,d=o.fitOnInit,u=Zi(i.props),v=i.state,p=v.scale,m=v.positionX,f=v.positionY;if(!a)return Promise.resolve();if(d){var h=Si(i,d==="cover"?"cover":"contain");if(h)return p===h.scale&&m===h.positionX&&f===h.positionY?Promise.resolve():(r==null||r(),q(i,h,n,e))}var g=u.positionX,c=u.positionY;if(s&&t){var y=ti(u.scale,a,t);g=y.positionX,c=y.positionY}var w=bi(i,u.scale),S=F(g,c,w,l,0,0,a),X={scale:u.scale,positionX:S.x,positionY:S.y};return p===u.scale&&m===u.positionX&&f===u.positionY?Promise.resolve():(r==null||r(),q(i,X,n,e))}var Ui=function(i){if("getBoundingClientRect"in i){var n=i.getBoundingClientRect();return{x:n.left,y:n.top,width:n.width,height:n.height}}return i};function Fe(i){var n=i.map(Ui),e=Math.min.apply(Math,n.map(function(t){return t.x})),r=Math.min.apply(Math,n.map(function(t){return t.y})),o=Math.max.apply(Math,n.map(function(t){return t.x+t.width})),a=Math.max.apply(Math,n.map(function(t){return t.y+t.height}));return{x:e,y:r,width:o-e,height:a-r}}function Ve(i,n,e,r){var o=Ui(i),a=n.getBoundingClientRect(),t=e.getBoundingClientRect(),l=a.x*r.scale,s=a.y*r.scale;return{x:(o.x-t.x+l)/r.scale,y:(o.y-t.y+s)/r.scale}}function je(i,n,e,r,o,a,t){r===void 0&&(r=0),o===void 0&&(o=0);var l=i.wrapperComponent,s=i.contentComponent,d=i.state,u=i.setup,v=u.limitToBounds,p=u.minScale,m=u.maxScale;if(!l||!s)return d;var f=l.getBoundingClientRect(),h=Ve(n,l,s,d),g=h.x,c=h.y,y=n.width/d.scale,w=n.height/d.scale,S=l.clientWidth/y,X=l.clientHeight/w,T=e||Math.min(S,X);t!==void 0&&(T=Math.min(T,t)),a!==void 0&&(T=Math.max(T,a));var C=V(T,p,m,0,!1),E=(f.width-y*C)/2,A=(f.height-w*C)/2,M=(f.left-g)*C+E+r,z=(f.top-c)*C+A+o,D=bi(i,C),W=F(M,z,D,v,0,0,l),N=W.x,U=W.y;return{positionX:N,positionY:U,scale:C}}function Qi(i,n,e){var r=i.wrapperComponent,o=i.state;if(!r)return{x:0,y:0};var a=r.getBoundingClientRect();return{x:(n-a.left-o.positionX)/o.scale,y:(e-a.top-o.positionY)/o.scale}}function Ue(i,n,e){var r=i.wrapperComponent,o=i.state;if(!r)return{x:0,y:0};var a=r.getBoundingClientRect();return{x:a.left+o.positionX+n*o.scale,y:a.top+o.positionY+e*o.scale}}var Qe=function(i){return function(n,e,r){return n===void 0&&(n=.5),e===void 0&&(e=300),r===void 0&&(r="easeOut"),Vi(i,1,n,e,r)}},Ge=function(i){return function(n,e,r){return n===void 0&&(n=.5),e===void 0&&(e=300),r===void 0&&(r="easeOut"),Vi(i,-1,n,e,r)}},qe=function(i){return function(n,e,r,o,a){o===void 0&&(o=300),a===void 0&&(a="easeOut");var t=i.state,l=t.positionX,s=t.positionY,d=t.scale,u=i.wrapperComponent,v=i.contentComponent,p=i.setup.disabled;if(p||!u||!v)return Promise.resolve();var m={positionX:Number.isNaN(n)?l:n,positionY:Number.isNaN(e)?s:e,scale:Number.isNaN(r)?d:r};return H(i,m,o,a)}},Je=function(i){return function(n,e){return n===void 0&&(n=200),e===void 0&&(e="easeOut"),ji(i,n,e)}},$e=function(i){return function(n,e,r){e===void 0&&(e=200),r===void 0&&(r="easeOut");var o=i.state,a=i.wrapperComponent,t=i.contentComponent;if(a&&t){var l=ti(n||o.scale,a,t);return H(i,l,e,r)}return Promise.resolve()}},xe=function(i){return function(n,e,r,o,a){o===void 0&&(o=300),a===void 0&&(a="easeOut");var t=i.wrapperComponent,l=i.contentComponent,s=i.setup;if(s.disabled||!t||!l)return Promise.resolve();var d=Qi(i,e,r),u=ai(i,n,d.x,d.y);if(!u)return Promise.resolve();var v=s.zoomAnimation.disabled?0:o;return q(i,u,v,a)}},Ie=function(i){return function(n,e){return Qi(i,n,e)}},ir=function(i){return function(n,e){return Ue(i,n,e)}},er=function(i,n){var e,r=i.wrapperComponent;if(!r)return[];var o=r.getRootNode(),a=o&&"getElementById"in o?o:(e=r.ownerDocument)!==null&&e!==void 0?e:typeof document<"u"?document:null,t=Array.isArray(n)?n:[n];return t.map(function(l){return typeof l=="string"?a==null?void 0:a.getElementById(l):l}).filter(function(l){return!!l&&r.contains(l)})},rr=function(i){return function(n,e,r,o,a,t){var l,s,d,u;r===void 0&&(r=600),o===void 0&&(o="easeOut"),a===void 0&&(a=0),t===void 0&&(t=0),_(i);var v=typeof e=="object"&&e!==null?e:{scale:e},p=er(i,n);if(!i.wrapperComponent||p.length===0)return Promise.resolve();var m=je(i,Fe(p),v.scale,(l=v.offsetX)!==null&&l!==void 0?l:a,(s=v.offsetY)!==null&&s!==void 0?s:t,v.minScale,v.maxScale);return H(i,m,(d=v.animationTime)!==null&&d!==void 0?d:r,(u=v.animationType)!==null&&u!==void 0?u:o)}},nr=function(i){return function(n){var e,r,o;n===void 0&&(n={});var a=i.wrapperComponent,t=i.contentComponent,l=i.setup;if(l.disabled||!a||!t)return Promise.resolve();var s=Si(i,(e=n.mode)!==null&&e!==void 0?e:"contain",n.minScale,n.maxScale);if(!s)return Promise.resolve();var d=l.zoomAnimation.disabled?0:(r=n.animationTime)!==null&&r!==void 0?r:200;return q(i,s,d,(o=n.animationType)!==null&&o!==void 0?o:"easeOut")}},or=function(i){return function(n,e,r,o){r===void 0&&(r=200),o===void 0&&(o="easeOut");var a=i.wrapperComponent,t=i.contentComponent,l=i.setup,s=i.state;if(l.disabled||!a||!t||!Number.isFinite(n)||!Number.isFinite(e))return Promise.resolve();var d=k(i,s.scale),u=F(s.positionX+n,s.positionY+e,d,l.limitToBounds,0,0,a),v=u.x,p=u.y;return v===s.positionX&&p===s.positionY?Promise.resolve():Ze(i,{scale:s.scale,positionX:v,positionY:p},r,o)}},J=function(i){return{instance:i,state:i.state,zoomIn:Qe(i),zoomOut:Ge(i),setTransform:qe(i),resetTransform:Je(i),centerView:$e(i),zoomToElement:rr(i),zoomToPoint:xe(i),clientToContent:Ie(i),contentToClient:ir(i),fitToView:nr(i),panBy:or(i)}},ar=function(i){return{instance:i,state:i.state}},b=function(i){var n={};return Object.assign(n,ar(i)),Object.assign(n,J(i)),n},hi=!1;function ei(){try{var i={get passive(){return hi=!0,!1}};return i}catch{return hi=!1,hi}}var ri=".".concat(gi.wrapperClass),j=function(i,n){return n.some(function(e){return i.matches("".concat(ri," ").concat(e,", ").concat(ri," .").concat(e,", ").concat(ri," ").concat(e," *, ").concat(ri," .").concat(e," *"))})},tr=new Set(["INPUT","TEXTAREA","SELECT","OPTION"]),lr='[contenteditable=""], [contenteditable="true"], [contenteditable="plaintext-only"]',sr='[draggable="true"]',Gi=function(i){return!i||typeof i.closest!="function"?null:i},Ci=function(i){var n=Gi(i);return n?tr.has(n.tagName)||n.isContentEditable?!0:n.closest(lr)!==null:!1},ur=function(i){var n=Gi(i);return n?n.closest(sr)!==null:!1},$=function(i){i&&clearTimeout(i)},dr=function(i){return Number.parseFloat(i.toFixed(8))},qi=function(i,n,e){var r=dr(e);return"translate(".concat(i,"px, ").concat(n,"px) scale(").concat(r,")")},ti=function(i,n,e){var r=e.offsetWidth*i,o=e.offsetHeight*i,a=(n.clientWidth-r)/2,t=(n.clientHeight-o)/2;return{scale:i,positionX:a,positionY:t}};function vr(i,n){i!=null&&(typeof i=="function"?i(n):i.current=n)}function pr(i){return function(n){i.forEach(function(e){typeof e=="function"?e(n):e!=null&&(e.current=n)})}}var Ti=typeof window<"u"?Y.useLayoutEffect:Y.useEffect,fr={panLeft:["ArrowLeft"],panRight:["ArrowRight"],panUp:["ArrowUp"],panDown:["ArrowDown"],zoomIn:["+","="],zoomOut:["-","_"],reset:["0"]},mr=function(i){return Object.values(fr).some(function(n){return n.includes(i)})};function hr(i,n){var e=i.setup,r=e.disabled,o=e.keyboard,a=e.panning;if(r||o.disabled||n.defaultPrevented||n.ctrlKey||n.metaKey||n.altKey||!mr(n.key))return!1;var t=n.target;if(Ci(t)||t&&typeof t.matches=="function"&&j(t,o.excluded))return!1;var l=o.panStep,s=o.zoomStep,d=o.animationTime,u=o.animationType,v=J(i),p=n.key,m=a.lockAxisX?0:l,f=a.lockAxisY?0:l;return p==="ArrowLeft"?v.panBy(m,0,d,u):p==="ArrowRight"?v.panBy(-m,0,d,u):p==="ArrowUp"?v.panBy(0,f,d,u):p==="ArrowDown"?v.panBy(0,-f,d,u):p==="+"||p==="="?v.zoomIn(s,d,u):p==="-"||p==="_"?v.zoomOut(s,d,u):p==="0"&&v.resetTransform(d,u),n.cancelable&&n.preventDefault(),n.stopPropagation(),!0}var wi=function(i,n){return{wrapperWidth:i.offsetWidth,wrapperHeight:i.offsetHeight,contentWidth:n.offsetWidth,contentHeight:n.offsetHeight}},cr=function(i,n){return!i||i.wrapperWidth!==n.wrapperWidth||i.wrapperHeight!==n.wrapperHeight||i.contentWidth!==n.contentWidth||i.contentHeight!==n.contentHeight},Ji=function(i){return i.isPanning||i.isPinching},gr=function(i){return Ji(i)||i.wheelStopEventTimer!==null||i.wheelAnimationTimer!==null};function $i(i){var n=i.wrapperComponent,e=i.contentComponent,r=i.setup,o=i.state;if(!n||!e)return null;var a=k(i,o.scale),t=r.limitToBounds,l=r.centerZoomedOut;if(!t&&!l)return null;var s=F(o.positionX,o.positionY,a,!0,0,0,n),d=s.x,u=s.y,v=d===R(o.positionX,2)&&u===R(o.positionY,2);return v?null:{scale:o.scale,positionX:d,positionY:u}}var yi=function(i){i.animation=null,i.animationFrame=null,i.isAnimating=!1,i.resizeAnimation=null};function wr(i){var n=i.setup.autoAlignment.animationTime,e=Math.max(n/5,1);_(i);var r=Date.now(),o=function(){if(!(!i.mounted||i.animation!==o)){var a=Date.now(),t=Math.max(a-r,1);r=a;var l=$i(i);if(!l){yi(i);return}var s=i.state,d=s.scale,u=s.positionX,v=s.positionY,p=1-Math.exp(-t/e),m=u+(l.positionX-u)*p,f=v+(l.positionY-v)*p,h=Math.abs(l.positionX-m)<.5&&Math.abs(l.positionY-f)<.5;if(h&&(m=l.positionX,f=l.positionY),i.isAnimating=!h,i.setState(d,m,f),h){yi(i);return}i.animationFrame=requestAnimationFrame(o)}};i.animation=o,i.resizeAnimation=o,i.animationResolve=null,i.animationFrame=requestAnimationFrame(o)}function xi(i){if(i.setup.disabled){k(i,i.state.scale);return}if(Ji(i)){i.isResizeAlignmentPending=!0;return}var n=i.animation!==null&&i.animation===i.resizeAnimation;if(i.animation&&!n){var e=i.state.scale,r=i.setup,o=r.minScale,a=r.maxScale;if(e<o||e>a){i.isResizeAlignmentPending=!0;return}_(i)}var t=$i(i);if(!t){n&&yi(i);return}if(!n){if(i.setup.autoAlignment.animationTime===0){i.setState(t.scale,t.positionX,t.positionY);return}wr(i)}}function yr(i){var n=i.wrapperComponent,e=i.contentComponent;if(!(!n||!e)){var r=wi(n,e);cr(i.measuredSizes,r)&&(i.measuredSizes=r,xi(i))}}var Ii=function(i,n){var e=i.setup.wheel,r=e.disabled,o=e.wheelDisabled,a=e.touchPadDisabled,t=e.excluded,l=i.isInitialized,s=i.isPanning,d=n.target,u=l&&!s&&!r&&d;if(!u||n.deltaY===0||o&&!n.ctrlKey||a&&n.ctrlKey)return!1;var v=j(d,t);if(v)return!1;var p=i.isPressingKeys(i.setup.wheel.activationKeys);return!!p},br=function(i,n){var e=i.setup,r=e.disabled,o=e.trackPadPanning,a=o.activationKeys,t=o.excluded;if(!i.wrapperComponent||!i.contentComponent||r||o.disabled||n.ctrlKey)return!1;var l=Ii(i,n);if(l)return!1;var s=n.target,d=j(s,t);if(d)return!1;var u=i.isPressingKeys(a);return!!u},Pr=function(i){return i?i.deltaY<0?1:-1:0};function Sr(i,n){var e=Pr(i),r=pe(n,e);return r}function ie(i,n,e){var r=n.getBoundingClientRect(),o=0,a=0;if("clientX"in i)o=(i.clientX-r.left)/e,a=(i.clientY-r.top)/e;else{var t=i.touches[0];o=(t.clientX-r.left)/e,a=(t.clientY-r.top)/e}return Number.isNaN(o)||Number.isNaN(a)?(console.error("No mouse or touch offset found"),{x:0,y:0}):{x:o,y:a}}var Cr=function(i,n,e,r,o){var a=i.state.scale,t=i.wrapperComponent,l=i.setup,s=l.maxScale,d=l.minScale,u=l.zoomAnimation,v=l.disablePadding,p=u.size,m=u.disabled;if(!t)throw new Error("Wrapper is not mounted");var f=a+n*e,h=r?!1:!m,g=V(f,d,s,p,h&&!v);return g},ee=function(i,n){var e=i.previousWheelEvent,r=i.state.scale,o=i.setup,a=o.maxScale,t=o.minScale;return e?r<a||r>t||Math.sign(e.deltaY)!==Math.sign(n.deltaY)||e.deltaY>0&&e.deltaY<n.deltaY||e.deltaY<0&&e.deltaY>n.deltaY||Math.sign(e.deltaY)!==Math.sign(n.deltaY):!1},Tr=function(i,n){var e=i.setup.pinch,r=e.disabled,o=e.excluded,a=i.isInitialized,t=n.target,l=a&&!r&&t;if(!l)return!1;var s=j(t,o);return!s},Ar=function(i){var n=i.setup.pinch.disabled,e=i.isInitialized,r=i.pinchStartDistance,o=e&&!n&&r!==null;return!!o},Yr=function(i,n,e){var r=e.getBoundingClientRect(),o=i.touches,a=o[0].clientX-r.left,t=o[0].clientY-r.top,l=o[1].clientX-r.left,s=o[1].clientY-r.top;return{x:(a+l)/2/n,y:(t+s)/2/n}},re=function(i){return Math.sqrt(Math.pow(i.touches[0].pageX-i.touches[1].pageX,2)+Math.pow(i.touches[0].pageY-i.touches[1].pageY,2))},Xr=5,Er=function(i,n){var e=i.pinchStartScale,r=i.pinchStartDistance,o=i.setup,a=o.maxScale,t=o.minScale,l=o.zoomAnimation,s=o.disablePadding,d=o.pinch,u=l.size,v=l.disabled,p=d.step;if(!e||r===null)throw new Error("Pinch touches distance was not provided");if(n<0)return i.state.scale;var m=n/r,f=m*e,h=(f-e)*(p/Xr),g=e+h,c=g===1/0?0:R(g,10);return V(c,t,a,u,!v&&!s)},ne=160,oe=100,zr=function(i,n){var e=i.props,r=e.onWheelStart,o=e.onZoomStart;_(i),i.wheelStopEventTimer||(P(b(i),n,r),P(b(i),n,o))},_r=function(i,n){var e=i.props,r=e.onWheel,o=e.onZoom,a=i.contentComponent,t=i.setup,l=i.state,s=l.scale,d=t.limitToBounds,u=t.centerZoomedOut,v=t.zoomAnimation,p=t.wheel,m=t.disablePadding,f=t.smooth,h=v.size,g=v.disabled,c=p.step;if(!a)throw new Error("Component not mounted");n.cancelable&&n.preventDefault(),n.stopPropagation();var y=Sr(n,null),w=f?c*Math.abs(n.deltaY):c,S=Cr(i,y,w,!n.ctrlKey);if(s!==S){var X=k(i,S),T=ie(n,a,s),C=g||h===0||u||m,E=d&&C,A=oi(i,T.x,T.y,S,X,E),M=A.x,z=A.y;i.previousWheelEvent=n,i.setState(S,M,z),P(b(i),n,r),P(b(i),n,o)}},kr=function(i,n){var e=i.props,r=e.onWheelStop,o=e.onZoomStop;$(i.wheelAnimationTimer),i.wheelAnimationTimer=setTimeout(function(){i.mounted&&(Pi(i,n.x,n.y),i.wheelAnimationTimer=null,i.flushResizeAlignment())},oe);var a=ee(i,n);a&&($(i.wheelStopEventTimer),i.wheelStopEventTimer=setTimeout(function(){i.mounted&&(i.wheelStopEventTimer=null,P(b(i),n,r),P(b(i),n,o),i.flushResizeAlignment())},ne))},Wr=function(i,n){var e=i.props,r=e.onWheelStart,o=e.onPanningStart;_(i),i.wheelStopEventTimer||(i.wheelAnimationTimer||k(i,i.state.scale),P(b(i),n,r),P(b(i),n,o))},Or=function(i,n){var e=i.props,r=e.onWheelStop,o=e.onPanningStop;$(i.wheelAnimationTimer),i.wheelAnimationTimer=setTimeout(function(){i.mounted&&(Pi(i,n.x,n.y),i.wheelAnimationTimer=null,i.flushResizeAlignment())},oe);var a=ee(i,n);a&&($(i.wheelStopEventTimer),i.wheelStopEventTimer=setTimeout(function(){i.mounted&&(i.wheelStopEventTimer=null,P(b(i),n,r),P(b(i),n,o),i.flushResizeAlignment())},ne))},ae=function(i){for(var n=0,e=0,r=0;r<2;r+=1)n+=i.touches[r].clientX,e+=i.touches[r].clientY;var o=n/2,a=e/2;return{x:o,y:a}},Mr=function(i,n){var e=re(n);i.pinchStartDistance=e,i.lastDistance=e,i.pinchStartScale=i.state.scale,i.isPanning=!1,i.isPinching=!0,i.pinchPreviousCenter=ae(n),_(i)},Dr=function(i,n){var e=i.contentComponent,r=i.pinchStartDistance,o=i.wrapperComponent,a=i.pinchPreviousCenter,t=i.state.scale,l=i.setup,s=l.limitToBounds,d=l.centerZoomedOut,u=l.zoomAnimation,v=l.autoAlignment,p=l.pinch,m=l.panning,f=u.disabled,h=u.size,g=p.allowPanning;if(!(r===null||!e)){var c=Yr(n,t,e);if(!(!Number.isFinite(c.x)||!Number.isFinite(c.y))){var y=re(n),w=Er(i,y),S=ae(n),X=t/w,T=(S.x-((a==null?void 0:a.x)||0))*X,C=(S.y-((a==null?void 0:a.y)||0))*X;if(!(w===t&&T===0&&C===0)){i.pinchPreviousCenter=S;var E=k(i,w),A=f||h===0||d,M=s&&A,z=oi(i,c.x,c.y,w,E,M),D=z.x,W=z.y;if(i.pinchMidpoint=c,i.lastDistance=y,m.disabled||!g)i.setState(w,D,W);else{var N=v.sizeX,U=v.sizeY,li=K(i,N,w),si=K(i,U,w),I=D+T,ui=W+C,ii=F(I,ui,E,s,li,si,o),Q=ii.x,di=ii.y;i.setState(w,Q,di)}}}}},Nr=function(i){var n=i.pinchMidpoint;i.velocity=null,i.lastDistance=null,i.pinchMidpoint=null,i.pinchStartScale=null,i.pinchStartDistance=null,i.isPinching=!1,Pi(i,n==null?void 0:n.x,n==null?void 0:n.y)},te=function(i,n){var e=i.props.onZoomStop,r=i.setup.doubleClick.animationTime;$(i.doubleClickStopEventTimer),i.doubleClickStopEventTimer=setTimeout(function(){i.doubleClickStopEventTimer=null,i.mounted&&P(b(i),n,e)},r)},Rr=function(i,n){var e=i.props,r=e.onZoomStart,o=e.onZoom,a=i.setup.doubleClick,t=a.animationTime,l=a.animationType;P(b(i),n,r),ji(i,t,l,function(){return P(b(i),n,o)}),te(i,n)};function Br(i,n){return i==="toggle"?n===1?1:-1:i==="zoomOut"?-1:1}function Lr(i,n){var e=i.setup,r=i.doubleClickStopEventTimer,o=i.state,a=i.contentComponent,t=o.scale,l=i.props,s=l.onZoomStart,d=l.onZoom,u=e.doubleClick,v=u.disabled,p=u.mode,m=u.step,f=u.animationTime,h=u.animationType;if(!v&&!r){if(p==="reset")return Rr(i,n);if(!a)return console.error("No ContentComponent found");var g=Br(p,i.state.scale),c=Fi(i,g,m);if(t!==c){P(b(i),n,s);var y=ie(n,a,t),w=ai(i,c,y.x,y.y);if(!w)return console.error("Error during zoom event. New transformation state was not calculated.");P(b(i),n,d),H(i,w,f,h),te(i,n)}}}var Kr=function(i,n){var e=i.isInitialized,r=i.setup,o=i.wrapperComponent,a=r.doubleClick,t=a.disabled,l=a.excluded,s=n.target,d=o==null?void 0:o.contains(s),u=e&&s&&d&&!t;if(!u)return!1;var v=j(s,l);return!(v||Ci(s))},Hr=(function(){function i(n){var e=this;this.mounted=!0,this.onChangeCallbacks=new Set,this.onInitCallbacks=new Set,this.onTransformCallbacks=new Set,this.wrapperComponent=null,this.contentComponent=null,this.isInitialized=!1,this.bounds=null,this.previousWheelEvent=null,this.wheelStopEventTimer=null,this.wheelAnimationTimer=null,this.isPanning=!1,this.isWheelPanning=!1,this.startCoords=null,this.panStartPosition=null,this.lastTouch=null,this.isPinching=!1,this.distance=null,this.lastDistance=null,this.pinchStartDistance=null,this.pinchStartScale=null,this.pinchMidpoint=null,this.pinchPreviousCenter=null,this.doubleClickStopEventTimer=null,this.velocity=null,this.velocityTime=null,this.lastMousePosition=null,this.isAnimating=!1,this.animation=null,this.animationFrame=null,this.animationResolve=null,this.initObserverTimer=null,this.isInitialLayoutPending=!1,this.measuredSizes=null,this.isResizeAlignmentPending=!1,this.resizeAnimation=null,this.pressedKeys={},this.selectionLock=null,this.mount=function(){e.mounted=!0,e.initializeWindowEvents()},this.unmount=function(){e.mounted=!1,e.cleanupWindowEvents()},this.update=function(r){e.props=r,e.setup=Ri(r),e.wrapperComponent&&e.contentComponent&&!gr(e)&&k(e,e.state.scale)},this.clearTimers=function(){e.wheelStopEventTimer&&clearTimeout(e.wheelStopEventTimer),e.wheelAnimationTimer&&clearTimeout(e.wheelAnimationTimer),e.doubleClickStopEventTimer&&clearTimeout(e.doubleClickStopEventTimer),e.initObserverTimer&&clearTimeout(e.initObserverTimer),e.wheelStopEventTimer=null,e.wheelAnimationTimer=null,e.doubleClickStopEventTimer=null,e.initObserverTimer=null},this.initializeWindowEvents=function(){var r,o,a,t,l=ei(),s=(r=e.wrapperComponent)===null||r===void 0?void 0:r.ownerDocument,d=s==null?void 0:s.defaultView;(o=e.wrapperComponent)===null||o===void 0||o.addEventListener("wheel",e.onWheelPanning,l),(a=e.wrapperComponent)===null||a===void 0||a.addEventListener("keyup",e.setKeyUnPressed,l),(t=e.wrapperComponent)===null||t===void 0||t.addEventListener("keydown",e.setKeyPressed,l),d==null||d.addEventListener("mousedown",e.onPanningStart,l),d==null||d.addEventListener("mousemove",e.onPanning,l),d==null||d.addEventListener("mouseup",e.onPanningStop,l),s==null||s.addEventListener("mouseleave",e.clearPanning,l),d==null||d.addEventListener("keyup",e.setKeyUnPressed,l),d==null||d.addEventListener("keydown",e.setKeyPressed,l),d==null||d.addEventListener("blur",e.handleWindowBlur)},this.cleanupWindowEvents=function(){var r,o,a,t,l,s=ei(),d=(r=e.wrapperComponent)===null||r===void 0?void 0:r.ownerDocument,u=d==null?void 0:d.defaultView;u==null||u.removeEventListener("mousedown",e.onPanningStart,s),u==null||u.removeEventListener("mousemove",e.onPanning,s),u==null||u.removeEventListener("mouseup",e.onPanningStop,s),d==null||d.removeEventListener("mouseleave",e.clearPanning,s),u==null||u.removeEventListener("keyup",e.setKeyUnPressed,s),u==null||u.removeEventListener("keydown",e.setKeyPressed,s),u==null||u.removeEventListener("blur",e.handleWindowBlur),(o=e.wrapperComponent)===null||o===void 0||o.removeEventListener("wheel",e.onWheelPanning,s),(a=e.wrapperComponent)===null||a===void 0||a.removeEventListener("keyup",e.setKeyUnPressed,s),(t=e.wrapperComponent)===null||t===void 0||t.removeEventListener("keydown",e.setKeyPressed,s),e.cleanupWrapperEvents(),e.clearTimers(),_(e),e.unlockTextSelection(),(l=e.observer)===null||l===void 0||l.disconnect(),e.observer=void 0,e.isInitialLayoutPending=!1,e.isResizeAlignmentPending=!1,e.resizeAnimation=null},this.cleanupWrapperEvents=function(){var r=e.wrapperComponent;if(r){var o=ei();r.removeEventListener("wheel",e.onWheelZoom,o),r.removeEventListener("dblclick",e.onDoubleClick,o),r.removeEventListener("keydown",e.onKeyboardNavigation,o),r.removeEventListener("touchstart",e.onTouchPanningStart,o),r.removeEventListener("touchmove",e.onTouchPanning,o),r.removeEventListener("touchend",e.onTouchPanningStop,o)}},this.handleInitializeWrapperEvents=function(r){var o=ei();r.addEventListener("wheel",e.onWheelZoom,o),r.addEventListener("dblclick",e.onDoubleClick,o),r.addEventListener("keydown",e.onKeyboardNavigation,o),r.addEventListener("touchstart",e.onTouchPanningStart,o),r.addEventListener("touchmove",e.onTouchPanning,o),r.addEventListener("touchend",e.onTouchPanningStop,o)},this.handleInitialize=function(){var r=e.setup,o=r.centerOnInit,a=r.fitOnInit;if(e.applyTransformation(),e.onInitCallbacks.forEach(function(l){return l(b(e))}),o||a){var t=e.applyInitialLayout();e.isInitialLayoutPending=!0,e.initObserverTimer&&clearTimeout(e.initObserverTimer),t&&(e.initObserverTimer=setTimeout(function(){e.initObserverTimer=null,e.isInitialLayoutPending=!1},5e3))}},this.observeSizes=function(r,o){var a;(a=e.observer)===null||a===void 0||a.disconnect(),e.observer=void 0,e.measuredSizes=wi(r,o),!(typeof ResizeObserver>"u")&&(e.observer=new ResizeObserver(e.onSizeChange),e.observer.observe(r),e.observer.observe(o))},this.onSizeChange=function(){var r=e,o=r.wrapperComponent,a=r.contentComponent;if(!(!e.mounted||!o||!a)){if(e.isInitialLayoutPending){var t=(a.offsetWidth>0||a.offsetHeight>0)&&o.clientWidth>0&&o.clientHeight>0;if(!t)return;e.isInitialLayoutPending=!1,e.initObserverTimer&&clearTimeout(e.initObserverTimer),e.initObserverTimer=null,e.onInitCallbacks.forEach(function(l){return l(b(e))}),e.applyInitialLayout(),e.measuredSizes=wi(o,a),k(e,e.state.scale);return}yr(e)}},this.flushResizeAlignment=function(){e.isResizeAlignmentPending&&(e.isResizeAlignmentPending=!1,xi(e))},this.onWheelZoom=function(r){var o=e.setup.disabled;if(!o){e.syncModifierKeys(r);var a=Ii(e,r);a&&(zr(e,r),_r(e,r),kr(e,r))}},this.onWheelPanning=function(r){var o=e.props.onPanning,a=e.setup.trackPadPanning,t=a.lockAxisX,l=a.lockAxisY;e.syncModifierKeys(r);var s=br(e,r);if(s){r.cancelable&&r.preventDefault(),r.stopPropagation();var d=e.state,u=d.positionX,v=d.positionY,p=u-r.deltaX,m=v-r.deltaY,f=t?u:p,h=l?v:m,g=e.setup.autoAlignment,c=g.sizeX,y=g.sizeY,w=K(e,c),S=K(e,y);f===u&&h===v||(Wr(e,r),Ki(e,f,h,w,S),P(b(e),r,o),Or(e,r))}},this.onPanningStart=function(r){var o=e.setup,a=o.disabled,t=o.panning,l=e.props.onPanningStart;if(!(a||t.disabled)){e.syncModifierKeys(r);var s=ki(e,r);if(s){var d=e.isPressingKeys(e.setup.panning.activationKeys);d&&(r.button===0&&!e.setup.panning.allowLeftClickPan||r.button===1&&!e.setup.panning.allowMiddleClickPan||r.button===2&&!e.setup.panning.allowRightClickPan||(r.cancelable&&r.preventDefault(),r.stopPropagation(),_(e),Mi(e,r),e.lockTextSelection(),e.focusForKeyboard(),P(b(e),r,l)))}}},this.onPanning=function(r){var o=e.setup.disabled,a=e.props.onPanning;if(!o){if(e.syncModifierKeys(r),e.isPanning&&r.buttons===0){e.clearPanning(r);return}var t=Wi(e);if(t){var l=e.isPressingKeys(e.setup.panning.activationKeys);l&&(r.cancelable&&r.preventDefault(),r.stopPropagation(),Di(e,r.clientX,r.clientY,B.MOUSE),P(b(e),r,a))}}},this.onPanningStop=function(r){var o=e.setup.panning.velocityDisabled,a=e.props.onPanningStop;e.isPanning&&(e.unlockTextSelection(),He(e,o),P(b(e),r,a),e.flushResizeAlignment())},this.onPinchStart=function(r){var o=e.setup.disabled,a=e.props.onPinchStart;if(!o){var t=Tr(e,r);t&&(Mr(e,r),_(e),P(b(e),r,a))}},this.onPinch=function(r){var o=e.setup.disabled,a=e.props.onPinch;if(!o){var t=Ar(e);t&&(r.cancelable&&r.preventDefault(),r.stopPropagation(),Dr(e,r),P(b(e),r,a))}},this.onPinchStop=function(r){var o=e.props.onPinchStop;e.pinchStartScale&&(Nr(e),P(b(e),r,o),e.flushResizeAlignment())},this.onTouchPanningStart=function(r){var o=e.setup,a=o.disabled,t=o.doubleClick,l=e.props.onPanningStart;if(!a){var s=!(t!=null&&t.disabled),d=e.lastTouch&&+new Date-e.lastTouch<200;if(s&&d&&r.touches.length===1)e.lastTouch=null,e.onDoubleClick(r);else{e.lastTouch=+new Date,_(e);var u=r.touches,v=u.length===1,p=u.length===2,m=ki(e,r);if(v){if(!m||e.setup.panning.disabled)return;_(e),Mi(e,r),e.lockTextSelection(),e.focusForKeyboard(),P(b(e),r,l)}p&&e.onPinchStart(r)}}},this.onTouchPanning=function(r){var o=e.setup.disabled,a=e.props.onPanning;if(e.isPanning&&r.touches.length===1){if(o)return;var t=Wi(e);if(!t)return;r.cancelable&&r.preventDefault(),r.stopPropagation();var l=r.touches[0];Di(e,l.clientX,l.clientY,B.TOUCH),P(b(e),r,a)}else r.touches.length>1&&e.onPinch(r)},this.onTouchPanningStop=function(r){e.onPanningStop(r),e.onPinchStop(r)},this.onDoubleClick=function(r){var o=e.setup.disabled;if(!o){var a=Kr(e,r);a&&Lr(e,r)}},this.clearPanning=function(r){e.isPanning&&e.onPanningStop(r)},this.handleWindowBlur=function(){e.pressedKeys={},e.isPanning&&(e.isPanning=!1,e.startCoords=null),e.unlockTextSelection(),e.flushResizeAlignment()},this.syncModifierKeys=function(r){var o=r.ctrlKey,a=r.metaKey,t=r.shiftKey,l=r.altKey;typeof o=="boolean"&&(e.pressedKeys.Control=o),typeof a=="boolean"&&(e.pressedKeys.Meta=a),typeof t=="boolean"&&(e.pressedKeys.Shift=t),typeof l=="boolean"&&(e.pressedKeys.Alt=l)},this.setKeyPressed=function(r){e.pressedKeys[r.key]=!0},this.setKeyUnPressed=function(r){e.pressedKeys[r.key]=!1},this.isPressingKeys=function(r){return typeof r=="function"?r(Object.entries(e.pressedKeys).filter(function(o){var a=o[1];return a}).map(function(o){var a=o[0];return a})):r.length?!!r.every(function(o){return e.pressedKeys[o]}):!0},this.onKeyboardNavigation=function(r){hr(e,r)},this.focusForKeyboard=function(){var r,o=e.wrapperComponent;if(!(!o||e.setup.keyboard.disabled)){var a=(r=o.ownerDocument)===null||r===void 0?void 0:r.activeElement;a&&o.contains(a)||typeof o.focus=="function"&&o.focus({preventScroll:!0})}},this.lockTextSelection=function(){var r=e.wrapperComponent;!r||e.selectionLock||(e.selectionLock={userSelect:r.style.userSelect,webkitUserSelect:r.style.webkitUserSelect},r.style.userSelect="none",r.style.webkitUserSelect="none")},this.unlockTextSelection=function(){var r=e.selectionLock;e.selectionLock=null;var o=e.wrapperComponent;!o||!r||(o.style.userSelect=r.userSelect,o.style.webkitUserSelect=r.webkitUserSelect)},this.applyInitialLayout=function(){var r=e.setup.fitOnInit,o=e,a=o.wrapperComponent,t=o.contentComponent,l=!!a&&!!t&&a.clientWidth>0&&a.clientHeight>0&&(t.offsetWidth>0||t.offsetHeight>0);if(r){var s=Si(e,r==="cover"?"cover":"contain");if(s)return e.setState(s.scale,s.positionX,s.positionY),l}return e.setCenter(),l},this.setCenter=function(){if(e.wrapperComponent&&e.contentComponent){var r=ti(e.state.scale,e.wrapperComponent,e.contentComponent);e.setState(r.scale,r.positionX,r.positionY)}},this.handleTransformStyles=function(r,o,a){return e.props.customTransform?e.props.customTransform(r,o,a):qi(r,o,a)},this.getContext=function(){return b(e)},this.applyTransformation=function(){if(!(!e.mounted||!e.contentComponent)){var r=e.state,o=r.scale,a=r.positionX,t=r.positionY,l=e.handleTransformStyles(a,t,o);e.props.detached||(e.contentComponent.style.transform=l),e.onTransformCallbacks.forEach(function(s){return s({scale:o,positionX:a,positionY:t,previousScale:e.state.previousScale,ref:b(e)})})}},this.setState=function(r,o,a){var t=e.props.onTransform;if(!Number.isNaN(r)&&!Number.isNaN(o)&&!Number.isNaN(a)){var l=Math.max(r,1e-7);l!==e.state.scale&&(e.state.previousScale=e.state.scale,e.state.scale=l),e.state.positionX=o,e.state.positionY=a,e.applyTransformation();var s=b(e);e.onChangeCallbacks.forEach(function(d){return d(s)}),P(s,{scale:e.state.scale,positionX:o,positionY:a},t)}else console.error("Detected NaN set state values")},this.onTransform=function(r){return e.onTransformCallbacks.has(r)||e.onTransformCallbacks.add(r),function(){e.onTransformCallbacks.delete(r)}},this.onChange=function(r){return e.onChangeCallbacks.has(r)||e.onChangeCallbacks.add(r),function(){e.onChangeCallbacks.delete(r)}},this.onInit=function(r){return e.onInitCallbacks.has(r)||e.onInitCallbacks.add(r),function(){e.onInitCallbacks.delete(r)}},this.init=function(r,o){e.mounted=!0,e.cleanupWindowEvents(),e.wrapperComponent=r,e.contentComponent=o,k(e,e.state.scale),e.handleInitializeWrapperEvents(r),e.handleInitialize(),e.observeSizes(r,o),e.initializeWindowEvents(),e.isInitialized=!0;var a=b(e);P(a,void 0,e.props.onInit),vr(e.props.ref,a)},this.props=n,this.setup=Ri(this.props),this.state=Zi(this.props)}return i})(),x=ni.createContext(null),Zr=function(i,n){return typeof i=="function"?i(n):i},qr=ni.forwardRef(function(i,n){var e=Y.useRef(null);e.current===null&&(e.current=new Hr(i));var r=e.current,o=Zr(i.children,J(r));return Y.useImperativeHandle(n,function(){return J(r)},[r]),Y.useEffect(function(){return r.mount(),function(){r.unmount()}},[r]),Y.useEffect(function(){r.update(i)},[r,i]),L.jsx(x.Provider,O({value:r},{children:o}))});ni.forwardRef(function(i,n){var e=Y.useRef(null),r=Y.useContext(x);return Ti(function(){var o=function(a){if(e.current){var t=0,l=0;e.current.style.transform=r.handleTransformStyles(t,l,1/a)}};return o(r.state.scale),r.onChange(function(a){o(a.instance.state.scale)})},[r]),L.jsx("div",O({},i,{ref:pr([e,n])}))});function Fr(i,n){n===void 0&&(n={});var e=n.insertAt;if(!(typeof document>"u")){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css",e==="top"&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=i:o.appendChild(document.createTextNode(i))}}var Vr=`.transform-component-module_wrapper__SPB86 {
2
+ position: relative;
3
+ width: -moz-fit-content;
4
+ width: fit-content;
5
+ height: -moz-fit-content;
6
+ height: fit-content;
7
+ overflow: hidden;
8
+ -webkit-touch-callout: none; /* iOS Safari */
9
+ /* Text stays selectable (#467); the instance applies an inline lock
10
+ only while a pan gesture is active. */
11
+ margin: 0;
12
+ padding: 0;
13
+ transform: translate3d(0, 0, 0);
14
+ }
15
+ .transform-component-module_content__FBWxo {
16
+ display: flex;
17
+ flex-wrap: wrap;
18
+ width: -moz-fit-content;
19
+ width: fit-content;
20
+ height: -moz-fit-content;
21
+ height: fit-content;
22
+ margin: 0;
23
+ padding: 0;
24
+ transform-origin: 0% 0%;
25
+ }
26
+ .transform-component-module_content__FBWxo img {
27
+ pointer-events: none;
28
+ }
29
+ .transform-component-module_infiniteGrid__Z-aP3 {
30
+ position: absolute;
31
+ inset: 0;
32
+ pointer-events: none;
33
+ background-image: radial-gradient(
34
+ circle,
35
+ rgba(0, 0, 0, 0.12) 1px,
36
+ transparent 1px
37
+ );
38
+ background-size: 20px 20px;
39
+ background-position: 0 0;
40
+ }
41
+ `,ci={wrapper:"transform-component-module_wrapper__SPB86",content:"transform-component-module_content__FBWxo",infiniteGrid:"transform-component-module_infiniteGrid__Z-aP3"};Fr(Vr);var Jr=function(i){var n,e=i.children,r=i.wrapperClass,o=r===void 0?"":r,a=i.contentClass,t=a===void 0?"":a,l=i.wrapperStyle,s=i.contentStyle,d=i.wrapperProps,u=d===void 0?{}:d,v=i.contentProps,p=v===void 0?{}:v,m=i.infinite,f=m===void 0?!1:m,h=Y.useContext(x),g=h.init,c=h.cleanupWindowEvents,y=Y.useRef(null),w=Y.useRef(null),S=Y.useRef(null);Ti(function(){var T=y.current,C=w.current;return T!==null&&C!==null&&g&&(g==null||g(T,C)),function(){c==null||c()}},[]),Y.useEffect(function(){if(f){var T=S.current;if(T){var C=function(){var E=h.state,A=E.positionX,M=E.positionY;T.style.backgroundPosition="".concat(A,"px ").concat(M,"px")};return C(),h.onChange(C)}}},[f,h]);var X=!(!((n=h.setup.keyboard)===null||n===void 0)&&n.disabled);return L.jsxs("div",O({tabIndex:X?0:void 0},u,{ref:y,className:"".concat(gi.wrapperClass," ").concat(ci.wrapper," ").concat(o),style:l},{children:[f&&L.jsx("div",{ref:S,className:ci.infiniteGrid,"aria-hidden":!0}),L.jsx("div",O({},p,{ref:w,className:"".concat(gi.contentClass," ").concat(ci.content," ").concat(t),style:O(O({transformOrigin:"0 0"},s),{transform:qi(h.state.positionX,h.state.positionY,h.state.scale)})},{children:e}))]}))};function jr(i,n){var e=Math.max(0,Math.min(i.x+i.width,n.x+n.width)-Math.max(i.x,n.x)),r=Math.max(0,Math.min(i.y+i.height,n.y+n.height)-Math.max(i.y,n.y));return e*r}function Ur(i){var n=i.elementX,e=i.elementY,r=i.elementWidth,o=i.elementHeight,a=i.scale,t=i.positionX,l=i.positionY,s=i.viewportWidth,d=i.viewportHeight,u=i.margin,v=u===void 0?0:u,p=i.threshold,m=p===void 0?0:p,f={x:-v,y:-v,width:s+2*v,height:d+2*v},h={x:n*a+t,y:e*a+l,width:r*a,height:o*a};if(m<=0){var g=h.x<f.x+f.width&&h.x+h.width>f.x,c=h.y<f.y+f.height&&h.y+h.height>f.y;return g&&c}var y=h.width*h.height;if(y<=0)return!1;var w=jr(f,h);return w/y>=m}ni.forwardRef(function(i,n){var e=i.x,r=i.y,o=i.width,a=i.height,t=i.margin,l=t===void 0?0:t,s=i.threshold,d=s===void 0?0:s,u=i.placeholder,v=u===void 0?null:u,p=i.onShow,m=i.onHide,f=i.children,h=i.className,g=i.style,c=Y.useContext(x),y=function(){var A=c.wrapperComponent;return A?Ur({elementX:e,elementY:r,elementWidth:o,elementHeight:a,scale:c.state.scale,positionX:c.state.positionX,positionY:c.state.positionY,viewportWidth:A.clientWidth,viewportHeight:A.clientHeight,margin:l,threshold:d}):!1},w=Y.useState(y),S=w[0],X=w[1],T=Y.useRef(!1),C=Y.useRef(p),E=Y.useRef(m);return C.current=p,E.current=m,Ti(function(){var A=function(){var D,W;if(c.wrapperComponent){var N=y();N!==T.current&&(T.current=N,X(N),N?(D=C.current)===null||D===void 0||D.call(C):(W=E.current)===null||W===void 0||W.call(E))}};A();var M=c.onChange(A),z;return c.wrapperComponent||(z=c.onInit(function(){return A()})),function(){M(),z==null||z()}},[c,e,r,o,a,l,d]),S?L.jsx("div",O({ref:n,className:h,style:g},{children:f})):v?L.jsx(L.Fragment,{children:v}):null});var Qr=function(){var i=Y.useContext(x);if(!i)throw new Error("Transform context must be placed inside TransformWrapper");return i},$r=function(){var i=Qr();return J(i)};export{qr as T,Jr as a,$r as u};
@@ -1 +1 @@
1
- import{j as t,G as a}from"./index-C8-dwIPp.js";function r({className:e,children:o,...n}){return t.jsx("code",{"data-slot":"inline-code",className:a("bg-muted rounded px-1.5 py-0.5 font-mono text-[0.85em] break-all",e),...n,children:o})}export{r as I};
1
+ import{j as t,G as a}from"./index-Dc5cpBoO.js";function r({className:e,children:o,...n}){return t.jsx("code",{"data-slot":"inline-code",className:a("bg-muted rounded px-1.5 py-0.5 font-mono text-[0.85em] break-all",e),...n,children:o})}export{r as I};
@@ -1,4 +1,4 @@
1
- import{W as e}from"./index-C8-dwIPp.js";/**
1
+ import{W as e}from"./index-Dc5cpBoO.js";/**
2
2
  * @license lucide-react v1.48.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{W as t}from"./index-C8-dwIPp.js";/**
1
+ import{W as t}from"./index-Dc5cpBoO.js";/**
2
2
  * @license lucide-react v1.48.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{W as n}from"./index-C8-dwIPp.js";/**
1
+ import{W as n}from"./index-Dc5cpBoO.js";/**
2
2
  * @license lucide-react v1.48.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{aI as e}from"./index-C8-dwIPp.js";function i(o){const r=o.filter(t=>!e.includes(t)&&t!=="test-mode"&&t!=="computer-local");return[...e,...r]}export{i as l};
1
+ import{aJ as e}from"./index-Dc5cpBoO.js";function i(o){const r=o.filter(t=>!e.includes(t)&&t!=="test-mode"&&t!=="computer-local");return[...e,...r]}export{i as l};
@@ -0,0 +1 @@
1
+ var g=Object.defineProperty;var k=(r,t,e)=>t in r?g(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var p=(r,t,e)=>k(r,typeof t!="symbol"?t+"":t,e);import{r as n,j as a,G as f,d7 as E,d8 as b,d9 as y}from"./index-Dc5cpBoO.js";class j extends n.Component{constructor(){super(...arguments);p(this,"state",{hasError:!1})}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,s){console.error("[Markdown] Render error:",e,s.componentStack)}componentDidUpdate(e){e.resetKey!==this.props.resetKey&&this.state.hasError&&this.setState({hasError:!1})}render(){return this.state.hasError?this.props.fallback??a.jsx("p",{className:"text-muted-foreground text-sm",children:"This content couldn’t be displayed."}):this.props.children}}function M({node:r,className:t,src:e,alt:s,...d}){const i=n.useRef(null),[o,l]=n.useState(!1),[h,x]=n.useState(!1);if(n.useLayoutEffect(()=>{var m,u;(u=(m=i.current)==null?void 0:m.parentElement)!=null&&u.closest("a")&&l(!0)},[]),h)return a.jsx("span",{className:"text-muted-foreground bg-muted/40 inline-block rounded-md px-2 py-1 text-xs",children:s?`${s}, not available`:"Image not available"});const c=a.jsx("img",{ref:i,src:e,alt:s??"",loading:"lazy",decoding:"async",...d,onError:()=>x(!0),className:f("max-h-[32rem] max-w-full rounded-md",t)});return o||typeof e!="string"||e===""?c:a.jsx(E,{image:{src:e,alt:s??""},className:"my-1 inline-block",children:c})}function L({content:r,className:t,errorFallback:e,components:s,allowedTags:d,literalTagContent:i,renderers:o}){const l=n.useMemo(()=>o?{renderers:o}:void 0,[o]);return a.jsx("div",{className:f("desktop:select-text",t),children:a.jsx(j,{resetKey:r,fallback:e,children:a.jsx(b,{components:{img:M,...s,a:y},allowedTags:d,literalTagContent:i,plugins:l,children:r})})})}export{L as M,j as a,M as b};
@@ -1 +1 @@
1
- import{V as x,j as n,G as o,aR as g,aS as h}from"./index-C8-dwIPp.js";const v="65%",i=x("inline rounded-md px-1.5 py-0.5 font-medium [-webkit-box-decoration-break:clone] [box-decoration-break:clone] [overflow-wrap:anywhere]",{variants:{tone:{neutral:"bg-secondary text-secondary-foreground",agent:"bg-[color-mix(in_oklch,var(--identity-color)_14%,transparent)]"},interactive:{true:"focus-visible:ring-ring cursor-pointer transition-[background-color] duration-(--identity-answer) ease-(--identity-ease-standard) focus-visible:ring-2 focus-visible:outline-none",false:""}},compoundVariants:[{tone:"agent",interactive:!0,class:"hover:bg-[color-mix(in_oklch,var(--identity-color)_20%,transparent)]"},{tone:"neutral",interactive:!0,class:"hover:bg-[color-mix(in_oklch,hsl(var(--secondary)),hsl(var(--foreground))_10%)]"}],defaultVariants:{tone:"neutral",interactive:!1}});function p({kind:s,label:e,handle:l,color:c,origin:d,resolved:m,interactive:r,className:t,...a}){if(!m)return n.jsxs("span",{"data-slot":"mention-pill","data-resolved":"false",className:o("text-muted-foreground",t),...a,children:["@",e]});const u=l?`@${l}`:e;if(s==="agent")return n.jsxs("span",{"data-slot":"mention-pill","data-kind":"agent",title:u,className:o(i({tone:"agent",interactive:r}),t),style:{"--identity-color":c??"currentColor",color:`color-mix(in oklch, ${c??"currentColor"} ${v}, hsl(var(--foreground)))`},...a,children:[n.jsx(g,{"aria-hidden":!0,className:"mr-0.5 inline-block size-[0.85em] align-[-0.15em]"}),e]});if(s==="system")return n.jsx("span",{"data-slot":"mention-pill","data-kind":"system",className:o(i({tone:"neutral",interactive:r}),t),...a,children:e});const f=typeof d=="object"&&d!==null;return n.jsxs("span",{"data-slot":"mention-pill","data-kind":"human",title:u,className:o(i({tone:"neutral",interactive:r}),t),...a,children:["@",e,f&&n.jsx(h,{"aria-hidden":!0,className:"ml-0.5 inline-block size-[0.72em] align-[-0.05em] opacity-70"})]})}export{p as M,i as m};
1
+ import{V as x,j as n,G as o,aS as g,aT as h}from"./index-Dc5cpBoO.js";const v="65%",i=x("inline rounded-md px-1.5 py-0.5 font-medium [-webkit-box-decoration-break:clone] [box-decoration-break:clone] [overflow-wrap:anywhere]",{variants:{tone:{neutral:"bg-secondary text-secondary-foreground",agent:"bg-[color-mix(in_oklch,var(--identity-color)_14%,transparent)]"},interactive:{true:"focus-visible:ring-ring cursor-pointer transition-[background-color] duration-(--identity-answer) ease-(--identity-ease-standard) focus-visible:ring-2 focus-visible:outline-none",false:""}},compoundVariants:[{tone:"agent",interactive:!0,class:"hover:bg-[color-mix(in_oklch,var(--identity-color)_20%,transparent)]"},{tone:"neutral",interactive:!0,class:"hover:bg-[color-mix(in_oklch,hsl(var(--secondary)),hsl(var(--foreground))_10%)]"}],defaultVariants:{tone:"neutral",interactive:!1}});function p({kind:s,label:e,handle:l,color:c,origin:d,resolved:m,interactive:r,className:t,...a}){if(!m)return n.jsxs("span",{"data-slot":"mention-pill","data-resolved":"false",className:o("text-muted-foreground",t),...a,children:["@",e]});const u=l?`@${l}`:e;if(s==="agent")return n.jsxs("span",{"data-slot":"mention-pill","data-kind":"agent",title:u,className:o(i({tone:"agent",interactive:r}),t),style:{"--identity-color":c??"currentColor",color:`color-mix(in oklch, ${c??"currentColor"} ${v}, hsl(var(--foreground)))`},...a,children:[n.jsx(g,{"aria-hidden":!0,className:"mr-0.5 inline-block size-[0.85em] align-[-0.15em]"}),e]});if(s==="system")return n.jsx("span",{"data-slot":"mention-pill","data-kind":"system",className:o(i({tone:"neutral",interactive:r}),t),...a,children:e});const f=typeof d=="object"&&d!==null;return n.jsxs("span",{"data-slot":"mention-pill","data-kind":"human",title:u,className:o(i({tone:"neutral",interactive:r}),t),...a,children:["@",e,f&&n.jsx(h,{"aria-hidden":!0,className:"ml-0.5 inline-block size-[0.72em] align-[-0.05em] opacity-70"})]})}export{p as M,i as m};
@@ -1,4 +1,4 @@
1
- import{W as a}from"./index-C8-dwIPp.js";/**
1
+ import{W as a}from"./index-Dc5cpBoO.js";/**
2
2
  * @license lucide-react v1.48.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{r as d,j as e,Q as x,R as m,T as c,G as t,U as u}from"./index-C8-dwIPp.js";function f({children:a,label:r="More details",openLabel:n="Fewer details",defaultOpen:o=!1,className:i}){const[s,l]=d.useState(o);return e.jsxs(x,{open:s,onOpenChange:l,className:t("text-sm",i),children:[e.jsxs(m,{className:"text-muted-foreground hover:text-foreground focus-ring -mx-1 inline-flex items-center gap-1 rounded-sm px-1 text-xs font-medium transition-colors duration-150",children:[s?n:r,e.jsx(c,{"aria-hidden":!0,className:t("size-3.5 shrink-0 motion-safe:transition-transform motion-safe:duration-150",s&&"rotate-180")})]}),e.jsx(u,{children:e.jsx("div",{className:"text-muted-foreground space-y-2 pt-1.5 leading-relaxed",children:a})})]})}export{f as M};
1
+ import{r as d,j as e,O as x,Q as m,T as c,G as t,U as u}from"./index-Dc5cpBoO.js";function f({children:a,label:r="More details",openLabel:n="Fewer details",defaultOpen:o=!1,className:i}){const[s,l]=d.useState(o);return e.jsxs(x,{open:s,onOpenChange:l,className:t("text-sm",i),children:[e.jsxs(m,{className:"text-muted-foreground hover:text-foreground focus-ring -mx-1 inline-flex items-center gap-1 rounded-sm px-1 text-xs font-medium transition-colors duration-150",children:[s?n:r,e.jsx(c,{"aria-hidden":!0,className:t("size-3.5 shrink-0 motion-safe:transition-transform motion-safe:duration-150",s&&"rotate-180")})]}),e.jsx(u,{children:e.jsx("div",{className:"text-muted-foreground space-y-2 pt-1.5 leading-relaxed",children:a})})]})}export{f as M};
@@ -1 +1 @@
1
- import{aO as s}from"./index-C8-dwIPp.js";function l(e){var a;return((a=e==null?void 0:e.ownerNotice)==null?void 0:a.state)==="open"?e.ownerNotice:null}function n(e,a={}){return new Intl.DateTimeFormat(a.locale,{weekday:"long",day:"numeric",month:"long",year:"numeric",timeZone:a.timeZone}).format(new Date(e))}function i(e,a){return e.requestState==="claimable"?"at any time now":e.claimableAfter?`on or after ${n(e.claimableAfter,a)}`:"in 7 days or more"}function d(e,a,o){const{options:r}=e,t=["Someone asked to replace you as owner",`That can happen ${i(e,o)}, unless you keep ownership.`,"Open the space to keep ownership."];return r.transfer&&r.delete?t.push("You can also hand it over, or delete it."):r.transfer?t.push("You can also hand it over yourself."):r.delete&&t.push("You can also delete it."),r.needsPassword&&t.push(a==="active"?"To hand it over or delete it, add a password to your account.":"To delete it, add a password to your account."),e.claimReissuedAt&&t.push(`The new owner’s link was sent again on ${n(e.claimReissuedAt,o)}.`),t}function m(e){return new URL(s(e.remoteCommunityId),e.pinnedOrigin).toString()}export{d as a,m as c,l as o};
1
+ import{aP as s}from"./index-Dc5cpBoO.js";function l(e){var a;return((a=e==null?void 0:e.ownerNotice)==null?void 0:a.state)==="open"?e.ownerNotice:null}function n(e,a={}){return new Intl.DateTimeFormat(a.locale,{weekday:"long",day:"numeric",month:"long",year:"numeric",timeZone:a.timeZone}).format(new Date(e))}function i(e,a){return e.requestState==="claimable"?"at any time now":e.claimableAfter?`on or after ${n(e.claimableAfter,a)}`:"in 7 days or more"}function d(e,a,o){const{options:r}=e,t=["Someone asked to replace you as owner",`That can happen ${i(e,o)}, unless you keep ownership.`,"Open the space to keep ownership."];return r.transfer&&r.delete?t.push("You can also hand it over, or delete it."):r.transfer?t.push("You can also hand it over yourself."):r.delete&&t.push("You can also delete it."),r.needsPassword&&t.push(a==="active"?"To hand it over or delete it, add a password to your account.":"To delete it, add a password to your account."),e.claimReissuedAt&&t.push(`The new owner’s link was sent again on ${n(e.claimReissuedAt,o)}.`),t}function m(e){return new URL(s(e.remoteCommunityId),e.pinnedOrigin).toString()}export{d as a,m as c,l as o};
@@ -1,4 +1,4 @@
1
- import{W as e}from"./index-C8-dwIPp.js";/**
1
+ import{W as e}from"./index-Dc5cpBoO.js";/**
2
2
  * @license lucide-react v1.48.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{j as a,G as i,V as o}from"./index-C8-dwIPp.js";const d=o("mx-auto w-full px-4 py-6 sm:px-6",{variants:{width:{full:"",wide:"max-w-[var(--page-width-wide)]",reading:"max-w-[var(--page-width-reading)]"}}});function u({width:s,scroll:l=!0,className:e,children:t,...n}){const r=d({width:s});return l?a.jsx("div",{className:"h-full [scrollbar-gutter:stable_both-edges] overflow-y-auto",children:a.jsx("div",{"data-slot":"page-container",className:i(r,e),...n,children:t})}):a.jsx("div",{"data-slot":"page-container",className:i(r,"flex h-full min-h-0 flex-col",e),...n,children:t})}export{u as P};
1
+ import{j as a,G as i,V as o}from"./index-Dc5cpBoO.js";const d=o("mx-auto w-full px-4 py-6 sm:px-6",{variants:{width:{full:"",wide:"max-w-[var(--page-width-wide)]",reading:"max-w-[var(--page-width-reading)]"}}});function u({width:s,scroll:l=!0,className:e,children:t,...n}){const r=d({width:s});return l?a.jsx("div",{className:"h-full [scrollbar-gutter:stable_both-edges] overflow-y-auto",children:a.jsx("div",{"data-slot":"page-container",className:i(r,e),...n,children:t})}):a.jsx("div",{"data-slot":"page-container",className:i(r,"flex h-full min-h-0 flex-col",e),...n,children:t})}export{u as P};
@@ -1,4 +1,4 @@
1
- import{W as e}from"./index-C8-dwIPp.js";/**
1
+ import{W as e}from"./index-Dc5cpBoO.js";/**
2
2
  * @license lucide-react v1.48.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{j as r,I as u,B as x,aq as c,G as l}from"./index-C8-dwIPp.js";function p({className:a,disabled:s,onChange:t,onBrowse:n,browseLabel:e="Browse",browseTestId:o,...i}){return r.jsxs("div",{"data-slot":"path-input",className:l("dark:bg-input/30 border-input flex items-center rounded-md border bg-transparent shadow-xs transition-[color,box-shadow]","focus-within:border-ring focus-within:ring-ring focus-within:ring-[3px]",a),children:[r.jsx(u,{type:"text",className:"border-0 bg-transparent font-mono shadow-none focus-visible:border-0 focus-visible:ring-0 dark:bg-transparent",disabled:s,onChange:t?d=>t(d.target.value):void 0,...i}),n&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"bg-border mx-0 h-5 w-px shrink-0"}),r.jsxs(x,{variant:"ghost",size:"sm",disabled:s,onClick:n,className:"text-muted-foreground hover:text-foreground shrink-0 rounded-l-none text-xs","aria-label":e,"data-testid":o,children:[r.jsx(c,{className:"size-3.5"}),e]})]})]})}export{p as P};
1
+ import{j as r,I as u,B as x,aq as c,G as l}from"./index-Dc5cpBoO.js";function p({className:a,disabled:s,onChange:t,onBrowse:n,browseLabel:e="Browse",browseTestId:o,...i}){return r.jsxs("div",{"data-slot":"path-input",className:l("dark:bg-input/30 border-input flex items-center rounded-md border bg-transparent shadow-xs transition-[color,box-shadow]","focus-within:border-ring focus-within:ring-ring focus-within:ring-[3px]",a),children:[r.jsx(u,{type:"text",className:"border-0 bg-transparent font-mono shadow-none focus-visible:border-0 focus-visible:ring-0 dark:bg-transparent",disabled:s,onChange:t?d=>t(d.target.value):void 0,...i}),n&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"bg-border mx-0 h-5 w-px shrink-0"}),r.jsxs(x,{variant:"ghost",size:"sm",disabled:s,onClick:n,className:"text-muted-foreground hover:text-foreground shrink-0 rounded-l-none text-xs","aria-label":e,"data-testid":o,children:[r.jsx(c,{className:"size-3.5"}),e]})]})]})}export{p as P};
@@ -0,0 +1,11 @@
1
+ import{W as a}from"./index-Dc5cpBoO.js";/**
2
+ * @license lucide-react v1.48.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const e={name:"minus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}]]};e.node;const t=a(e);/**
7
+ * @license lucide-react v1.48.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const o={name:"plug",size:24,node:[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]]};o.node;const s=a(o);export{t as M,s as P};
@@ -0,0 +1,3 @@
1
+ import{dy as C,ad as I,r,j as u,bx as P,ar as b,G as M,gv as N,gw as A,gt as O,aW as S,a1 as x,a2 as v,aR as p,gx as w}from"./index-Dc5cpBoO.js";import{u as _}from"./use-is-below-desktop-DmekpHAF.js";import{u as G}from"./use-notification-prefs-DeR05zhp.js";const D=.16,K=`[&_button]:${N}`;function Q({candidates:t,ready:e,name:o="sidebar-bottom-slot",className:s}){const i=C(),a=I(),n=e?t.find(g=>g.show):void 0,[c,T]=r.useState(void 0),d=r.useRef(!1);r.useEffect(()=>{!e||d.current||(d.current=!0,T((n==null?void 0:n.id)??null))},[e,n]);const R=c!==void 0&&(n==null?void 0:n.id)!==c&&!i;return u.jsx("div",{"data-slot":o,className:M("shrink-0 px-2 pb-2 empty:p-0",a&&K,s),children:u.jsx(P,{initial:!1,children:n!==void 0&&u.jsx(b.div,{initial:R?{height:0,opacity:0}:!1,animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:i?0:D,ease:[0,0,.2,1]},className:"overflow-hidden",children:n.render()},n.id)})})}const U={knock:"/knock.wav",settle:"/settle.wav","turn-end":"/notification.wav"},m=new Map;function L(t){try{let e=m.get(t);e||(e=new Audio(U[t]),m.set(t,e)),e.currentTime=0,e.play().catch(()=>{})}catch{}}function Y(){const t=S(s=>s.loadRightPanelState),e=_(),o=r.useRef(!e);r.useEffect(()=>{t({restoreOpen:o.current})},[t])}const h=Symbol("right-panel-layout-key-pending");function z(){const[t]=A(),{data:e,isPending:o}=O(t),s=S(c=>c.loadRightPanelForAgent),i=_(),a=r.useRef(i);r.useEffect(()=>{a.current=i},[i]);let n;t?o?n=h:n=(e==null?void 0:e.id)??t:n=null,r.useEffect(()=>{n!==h&&s(n,t,{inherit:!a.current})},[n,t,s]),r.useEffect(()=>()=>s(null),[s])}function J(t,e,o){const s=x();return v({queryKey:["commands",{cwd:t??null,sessionId:e??null,runtime:o??null}],queryFn:()=>s.getCommands(!1,t??void 0,{sessionId:e,runtime:o}),staleTime:p.COMMANDS_STALE_TIME_MS,gcTime:p.COMMANDS_GC_TIME_MS})}const k="dork-kickoff",E=`<${k}>`,y=`</${k}>`;function V(t){return`${E}
2
+ ${t.trim()}
3
+ ${y}`}function j(t){const e=w(t);return e.startsWith(E)&&e.endsWith(y)}function X(t){const e=t.findIndex(o=>o.role==="user");return e===-1||!j(t[e].content)?t:t.filter((o,s)=>s!==e)}const F={knock:"knock",settle:"allClear","turn-end":"turnEnd"};function Z(){const{prefs:t}=G(),{sounds:e}=t;return{play:r.useCallback(s=>{e[F[s]]&&L(s)},[e])}}const tt=3e4;let l=!1;const f=new Set;function et(){if(!l){l=!0;for(const t of f)t()}}function W(t){return f.add(t),()=>{f.delete(t)}}function $(){return l}function nt(){return r.useSyncExternalStore(W,$,()=>!1)}export{Q as B,tt as L,et as a,Z as b,J as c,z as d,Y as e,X as f,nt as u,V as w};
@@ -1 +1 @@
1
- import{a1 as s,a3 as r,a4 as i,bi as h,bj as f}from"./index-C8-dwIPp.js";function u(e){e.invalidateQueries({queryKey:[...h]}),e.invalidateQueries({queryKey:f.details()})}function l(e){return e!=null&&e.isShownInline?{isShownInline:e.isShownInline}:void 0}function T(e){const n=s(),t=r();return i({mutationFn:a=>n.updateProfile(a),onSuccess:()=>u(t),meta:l(e)})}function A(){const e=s(),n=r();return i({mutationFn:({file:t})=>e.uploadProfileAvatar(t,t.name),onSuccess:()=>u(n)})}function E(){const e=s(),n=r();return i({mutationFn:()=>e.deleteProfileAvatar(),onSuccess:()=>u(n)})}function m(){const e=s(),n=r();return i({mutationFn:({memberId:t,linked:a})=>e.setIdentityLinkedToMe(t,a),onSuccess:()=>u(n)})}function O(e){const n=s(),t=r();return i({mutationFn:({authorId:a,handle:d})=>n.setAuthorHandle(a,d),onSuccess:()=>u(t),meta:l(e)})}function c(e){return typeof e=="object"&&e!==null&&"code"in e?e.code:void 0}function o(e){const n=e instanceof Error?e.message.trim():"";return n.length>0?n:void 0}function P(e,n){const t=`@${n}`;switch(c(e)){case"HANDLE_TAKEN":return`${t} belongs to someone else. Pick a different one.`;case"HANDLE_RESERVED":return`${t} is spoken for. Either you used it before, or it is a word DorkOS uses to reach everyone. Pick a different one.`;case"INVALID_HANDLE":return o(e)??"That handle won’t work. Use lowercase letters, numbers, dots, underscores or hyphens.";default:return o(e)??"Couldn’t save your handle. Try again."}}function v(e){switch(c(e)){case"AVATAR_TOO_LARGE":return"That photo is over 2 MB. Pick a smaller one.";case"AVATAR_TYPE_UNSUPPORTED":return"That file isn’t a photo DorkOS can use. Pick a PNG, JPEG or WebP.";case"AVATAR_MISSING":return"No photo came through. Pick the file again.";case"OPERATOR_ONLY":return"Only the person at the keyboard can change this photo.";default:return o(e)??"Couldn’t save your photo. Try again."}}function g(e){return c(e)==="OPERATOR_ONLY"?"Only the person at the keyboard can change this name.":o(e)??"Couldn’t save your name. Try again."}function k(e,n){switch(c(e)){case"IDENTITY_NOT_EXTERNAL":return"Only an account on another chat platform can be linked to you.";case"OPERATOR_ONLY":return"Only this install’s owner can link accounts.";default:return o(e)??(n?"Couldn’t link that account. Try again.":"Couldn’t remove that link. Try again.")}}export{E as a,v as b,O as c,T as d,m as e,P as h,k as i,g as n,A as u};
1
+ import{a1 as s,a3 as r,a4 as i,bj as h,bk as f}from"./index-Dc5cpBoO.js";function u(e){e.invalidateQueries({queryKey:[...h]}),e.invalidateQueries({queryKey:f.details()})}function l(e){return e!=null&&e.isShownInline?{isShownInline:e.isShownInline}:void 0}function T(e){const n=s(),t=r();return i({mutationFn:a=>n.updateProfile(a),onSuccess:()=>u(t),meta:l(e)})}function A(){const e=s(),n=r();return i({mutationFn:({file:t})=>e.uploadProfileAvatar(t,t.name),onSuccess:()=>u(n)})}function E(){const e=s(),n=r();return i({mutationFn:()=>e.deleteProfileAvatar(),onSuccess:()=>u(n)})}function m(){const e=s(),n=r();return i({mutationFn:({memberId:t,linked:a})=>e.setIdentityLinkedToMe(t,a),onSuccess:()=>u(n)})}function O(e){const n=s(),t=r();return i({mutationFn:({authorId:a,handle:d})=>n.setAuthorHandle(a,d),onSuccess:()=>u(t),meta:l(e)})}function c(e){return typeof e=="object"&&e!==null&&"code"in e?e.code:void 0}function o(e){const n=e instanceof Error?e.message.trim():"";return n.length>0?n:void 0}function P(e,n){const t=`@${n}`;switch(c(e)){case"HANDLE_TAKEN":return`${t} belongs to someone else. Pick a different one.`;case"HANDLE_RESERVED":return`${t} is spoken for. Either you used it before, or it is a word DorkOS uses to reach everyone. Pick a different one.`;case"INVALID_HANDLE":return o(e)??"That handle won’t work. Use lowercase letters, numbers, dots, underscores or hyphens.";default:return o(e)??"Couldn’t save your handle. Try again."}}function k(e){switch(c(e)){case"AVATAR_TOO_LARGE":return"That photo is over 2 MB. Pick a smaller one.";case"AVATAR_TYPE_UNSUPPORTED":return"That file isn’t a photo DorkOS can use. Pick a PNG, JPEG or WebP.";case"AVATAR_MISSING":return"No photo came through. Pick the file again.";case"OPERATOR_ONLY":return"Only the person at the keyboard can change this photo.";default:return o(e)??"Couldn’t save your photo. Try again."}}function v(e){return c(e)==="OPERATOR_ONLY"?"Only the person at the keyboard can change this name.":o(e)??"Couldn’t save your name. Try again."}function g(e,n){switch(c(e)){case"IDENTITY_NOT_EXTERNAL":return"Only an account on another chat platform can be linked to you.";case"OPERATOR_ONLY":return"Only this install’s owner can link accounts.";default:return o(e)??(n?"Couldn’t link that account. Try again.":"Couldn’t remove that link. Try again.")}}export{E as a,k as b,O as c,T as d,m as e,P as h,g as i,v as n,A as u};
@@ -1,4 +1,4 @@
1
- import{W as s,j as r,bt as o}from"./index-C8-dwIPp.js";/**
1
+ import{W as s,j as r,bu as o}from"./index-Dc5cpBoO.js";/**
2
2
  * @license lucide-react v1.48.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{j as i,a0 as n}from"./index-C8-dwIPp.js";import{E as s}from"./empty-state-CQ1oXLFa.js";function u({title:t,description:e,onRetry:r,isRetrying:a=!1,className:o}){return i.jsx(s,{icon:n,tone:"destructive",headline:t,description:e,action:{label:"Retry",onClick:r,busy:a},className:o})}export{u as Q};
1
+ import{j as i,a0 as n}from"./index-Dc5cpBoO.js";import{E as s}from"./empty-state-BgnQDiMZ.js";function u({title:t,description:e,onRetry:r,isRetrying:a=!1,className:o}){return i.jsx(s,{icon:n,tone:"destructive",headline:t,description:e,action:{label:"Retry",onClick:r,busy:a},className:o})}export{u as Q};
@@ -1,4 +1,4 @@
1
- import{W as e}from"./index-C8-dwIPp.js";/**
1
+ import{W as e}from"./index-Dc5cpBoO.js";/**
2
2
  * @license lucide-react v1.48.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -0,0 +1 @@
1
+ import{aN as a,aO as s}from"./index-Dc5cpBoO.js";const t={tasks:s,moment:a};export{t as i};
@@ -1,6 +1,6 @@
1
- import{W as L,a1 as P,a3 as U,a4 as N,fq as a,fr as e,r as O,a7 as W,j as i,en as q,fw as z,B as k,eo as K,ep as G,eq as H,er as J,aS as Q,fo as y,fx as t,fp as o,fu as p,fs as n,fy as r,fz as b,fA as m,fB as V,fC as C,fD as h}from"./index-C8-dwIPp.js";import{u as Z}from"./form-lSBktWDn.js";/**
1
+ import{W as L,a1 as P,a3 as N,a4 as O,r as U,a7 as W,j as i,es as q,fJ as z,B as k,et as K,eu as G,ev as H,ew as J,aT as Q,fD as a,fE as e,fB as y,fK as t,fC as o,fH as p,fF as n,fL as r,fM as b,fN as m,fO as V,fP as C,fQ as h}from"./index-Dc5cpBoO.js";import{u as Z}from"./form-Blrb1xBU.js";/**
2
2
  * @license lucide-react v1.48.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const v={name:"pen-line",size:24,node:[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],aliases:["edit-3"]};v.node;const $=L(v),Y=["relay","messages"];function X(){const s=P(),c=U();return N({mutationFn:g=>s.sendRelayMessage(g),onSuccess:()=>{c.invalidateQueries({queryKey:[...Y]})}})}function ee(s){try{return JSON.parse(s)}catch{return{content:s}}}const ae=a({subject:e().min(1,"Add a subject"),from:e().min(1,"Add a sender"),payload:e().min(1,"Add a message")});function De({open:s,onOpenChange:c}={}){const[g,B]=O.useState(!1),f=s!==void 0,F=f?s:g,I=X(),d=Z({defaultValues:{subject:"",from:"relay.human.console",payload:""},validators:{onSubmit:ae},onSubmit:({value:l})=>{I.mutate({subject:l.subject,from:l.from,payload:ee(l.payload)},{onSuccess:()=>{W.success("Message sent"),d.reset(),M(!1)}})}});function M(l){f?c==null||c(l):B(l),l||d.reset()}return i.jsxs(q,{open:F,onOpenChange:M,children:[!f&&i.jsx(z,{asChild:!0,children:i.jsxs(k,{variant:"ghost",size:"sm",className:"gap-1.5","data-testid":"compose-trigger",children:[i.jsx($,{className:"size-3.5"}),"Compose"]})}),i.jsxs(K,{children:[i.jsxs(G,{children:[i.jsx(H,{children:"Send a test message"}),i.jsx(J,{children:"Check that a message gets delivered."})]}),i.jsx(d.AppForm,{children:i.jsxs("form",{onSubmit:l=>{l.preventDefault(),d.handleSubmit()},className:"space-y-4",children:[i.jsx(d.AppField,{name:"subject",children:l=>i.jsx(l.TextField,{label:"Subject",placeholder:"e.g. relay.test.ping"})}),i.jsx(d.AppField,{name:"from",children:l=>i.jsx(l.TextField,{label:"From"})}),i.jsx(d.AppField,{name:"payload",children:l=>i.jsx(l.TextareaField,{label:"Message",placeholder:"Plain text or JSON",rows:4})}),i.jsx("div",{className:"flex justify-end",children:i.jsxs(k,{type:"submit",disabled:I.isPending,children:[i.jsx(Q,{className:"mr-2 size-4"}),"Send"]})})]})})]})]})}y();a({from:e().describe("Subject pattern (supports wildcards)"),to:e().describe("Subject pattern (supports wildcards)"),action:o(["allow","deny"]),priority:t().int()}).openapi("RelayAccessRule");y();const u=e().min(1),w=o(["telegram","webhook","claude-code","slack","plugin"]).openapi("AdapterType"),te=a({package:e().optional(),path:e().optional()}).refine(s=>s.package||s.path,{message:"Plugin source must specify either package or path"}).openapi("PluginSource"),S=o(["always","mention-only","thread-aware"]),j="thread-aware",ne=a({token:u,mode:o(["polling","webhook"]).default("polling"),webhookUrl:e().url().optional(),webhookPort:t().int().positive().optional(),webhookSecret:u.optional(),streaming:n().default(!0),respondMode:S.default(j),dmPolicy:o(["open","allowlist"]).default("allowlist"),dmAllowlist:p(e()).default([]),approverAllowlist:p(e()).default([])}).openapi("TelegramAdapterConfig"),oe=a({type:o(["photo","sticker","voice","document","video","location","audio","video_note"]),durationSec:t().optional(),fileName:e().optional(),mimeType:e().optional()}).openapi("TelegramMediaDescriptor");a({chatId:t(),messageId:t(),chatType:e(),fromId:t().optional(),username:e().optional(),replyToMessageId:t().optional(),messageThreadId:t().optional(),threadName:e().optional(),media:oe.optional(),botUsername:e().optional()}).openapi("TelegramPlatformData");const ie="A webhook must use its own address under relay.webhook., such as relay.webhook.my-service. Use letters, numbers, hyphens or underscores in each part; wildcards are not allowed.";function se(s){return s.startsWith("relay.webhook.")&&s.split(".").length<=16&&/^relay\.webhook\.[a-zA-Z0-9_-]+(?:\.[a-zA-Z0-9_-]+)*$/.test(s)}const le=a({subject:e().min(1).refine(se,{message:ie}),secret:e().min(16),previousSecret:e().optional()}).openapi("WebhookInboundConfig"),pe=a({url:e().url(),secret:e().min(16),headers:r(e(),e()).optional()}).openapi("WebhookOutboundConfig"),re=a({inbound:le,outbound:pe}).openapi("WebhookAdapterConfig"),de=a({botToken:u,appToken:u,signingSecret:u,streaming:n().default(!0),nativeStreaming:n().default(!0),typingIndicator:o(["none","reaction"]).default("reaction"),respondMode:S.default(j),dmPolicy:o(["open","allowlist"]).default("allowlist"),dmAllowlist:p(e()).default([]),approverAllowlist:p(e()).default([]),channelOverrides:r(e(),a({enabled:n().optional(),respondMode:S.optional()}).strict()).default({})}).openapi("SlackAdapterConfig"),ce=a({id:e().min(1).regex(/^[a-z0-9-]+$/,"Must be lowercase alphanumeric with hyphens"),type:w,enabled:n().default(!0),label:e().optional(),builtin:n().optional(),plugin:te.optional(),config:b([ne,re,de,r(e(),m())])}).openapi("AdapterConfig"),ue=a({id:e(),type:w,displayName:e(),state:o(["connected","disconnected","error","starting","stopping","reconnecting"]),messageCount:a({inbound:t().int().nonnegative(),outbound:t().int().nonnegative()}),errorCount:t().int().nonnegative(),lastError:e().optional(),lastErrorAt:e().datetime().optional(),startedAt:e().datetime().optional()}).openapi("AdapterStatus");a({adapters:p(ce)}).openapi("AdaptersConfigFile");const me=o(["text","password","number","boolean","select","textarea","url"]).openapi("ConfigFieldType"),he=a({label:e(),value:e(),description:e().optional()}).openapi("ConfigFieldOption"),ge=a({key:e(),label:e(),type:me,required:n(),default:b([e(),t(),n()]).optional(),placeholder:e().optional(),description:e().optional(),options:p(he).optional(),section:e().optional(),showWhen:a({field:e(),equals:b([e(),n(),t()])}).optional(),pattern:e().optional(),patternMessage:e().optional(),visibleByDefault:n().optional(),displayAs:V("radio-cards").optional(),helpMarkdown:e().optional(),valueShape:o(["id-list","json-object"]).optional()}).openapi("ConfigField"),fe=a({stepId:e(),title:e(),description:e().optional(),fields:p(e())}).openapi("AdapterSetupStep"),be=o(["messaging","automation","internal","custom"]).openapi("AdapterCategory"),Se=a({type:e(),displayName:e(),description:e(),iconId:e().optional(),category:be,docsUrl:e().url().optional(),builtin:n(),configFields:p(ge),setupSteps:p(fe).optional(),setupInstructions:e().optional(),multiInstance:n().default(!1),deprecated:n().optional(),apiVersion:e().optional(),actionButton:a({label:e(),url:e()}).optional(),setupGuide:e().optional()}).openapi("AdapterManifest"),ye=a({id:e(),enabled:n(),label:e().optional(),status:ue,config:r(e(),m()).optional()}).openapi("CatalogInstance");a({manifest:Se,instances:p(ye)}).openapi("CatalogEntry");const A=o(["per-chat","per-user","stateless"]).openapi("SessionStrategy"),R="A bridge cannot be attached to a wildcard binding — one room cannot honestly be the channel for an unbounded set of chats.";function D(s){return s.bridge!=="room"||!!s.chatId}const E=o(["private","group","supergroup","channel"]).openapi("PlatformChatType"),_=a({id:e().uuid(),adapterId:e().min(1),agentId:e().min(1),chatId:e().optional(),channelType:h.optional(),platformChatType:E.optional(),sessionStrategy:A.default("per-chat"),label:e().default(""),permissionMode:C.default("default"),enabled:n().default(!0),canInitiate:n().default(!1),canReply:n().default(!0),canReceive:n().default(!0),notifyOnTaskComplete:n().default(!0),bridge:o(["off","room"]).default("off"),roomId:e().nullable().default(null),createdAt:e().datetime(),updatedAt:e().datetime()}),T=_.refine(D,{message:R,path:["chatId"]}).openapi("AdapterBinding");_.omit({id:!0,createdAt:!0,updatedAt:!0}).refine(D,{message:R,path:["chatId"]}).openapi("CreateBindingRequest");a({sessionStrategy:A.optional(),label:e().optional(),chatId:e().optional().nullable(),channelType:h.optional().nullable(),canInitiate:n().optional(),canReply:n().optional(),canReceive:n().optional(),notifyOnTaskComplete:n().optional(),permissionMode:C.optional(),enabled:n().optional(),bridge:o(["off","room"]).optional(),roomId:e().optional().nullable()}).openapi("UpdateBindingRequest");a({agentId:e().min(1)}).openapi("MoveBindingRequest");const Ce=o(["pending","claimed","ignored","blocked"]).openapi("UnclaimedChatStatus"),x=200,Ae=a({id:e(),adapterId:e(),chatId:e(),channelType:h.nullable(),chatKind:o(["dm","group"]),platformChatType:E.nullable(),senderName:e().max(x).nullable(),senderId:e().nullable(),chatTitle:e().max(x).nullable(),status:Ce,messageCount:t().int().nonnegative(),firstSeenAt:e().datetime(),lastSeenAt:e().datetime(),decidedAt:e().datetime().nullable(),decidedAgentId:e().nullable()}).openapi("UnclaimedChat");a({chats:p(Ae)}).openapi("UnclaimedChatListResponse");a({agentId:e().min(1),sessionStrategy:A.optional(),permissionMode:C.optional(),label:e().optional(),bridge:n().optional()}).openapi("ClaimUnclaimedChatRequest");a({bindings:p(T)}).openapi("BindingListResponse");a({binding:T}).openapi("BindingResponse");a({binding:T,bridgeError:e().optional()}).openapi("ClaimUnclaimedChatResponse");const Te=a({chatId:e(),displayName:e().optional(),channelType:h.optional(),lastMessageAt:e().datetime(),messageCount:t()}).openapi("ObservedChat");a({chats:p(Te)}).openapi("ObservedChatsResponse");a({type:e().min(1),config:r(e(),m())}).openapi("AdapterTestRequest");a({type:e().min(1),id:e().min(1).regex(/^[a-z0-9-]+$/,"Must be lowercase alphanumeric with hyphens"),config:r(e(),m()),enabled:n().optional(),label:e().optional()}).openapi("AdapterCreateRequest");a({config:r(e(),m())}).openapi("AdapterConfigUpdate");a({ok:n(),resolved:n(),latencyMs:t(),wouldDeliverTo:e().optional(),reason:e().optional(),details:e().optional()}).openapi("BindingTestResult");y();const Ie=a({enabled:n().default(!0),windowSecs:t().int().min(1).default(60),maxPerWindow:t().int().min(1).default(100),perSenderOverrides:r(e(),t().int().min(1)).optional()}).openapi("RateLimitConfig"),Me=a({enabled:n().default(!0),failureThreshold:t().int().min(1).default(5),cooldownMs:t().int().min(1e3).default(3e4),halfOpenProbeCount:t().int().min(1).default(1),successToClose:t().int().min(1).default(2)}).openapi("CircuitBreakerConfig"),ke=a({enabled:n().default(!0),maxMailboxSize:t().int().min(1).default(1e3),pressureWarningAt:t().min(0).max(1).default(.8)}).openapi("BackpressureConfig");a({rateLimit:Ie.partial().optional(),circuitBreaker:Me.partial().optional(),backpressure:ke.partial().optional()}).openapi("ReliabilityConfig");a({adapterId:e().optional(),chatId:e().optional(),userId:e().optional(),isSyntheticTest:n().optional()}).passthrough().openapi("TraceMetadata");const xe=o(["sent","delivered","failed","timeout","no_subscriber"]).openapi("TraceSpanStatus"),ve=o(["delivery","lifecycle"]).openapi("TraceKind");o(["pending","delivered","processed","failed","dead_lettered"]).openapi("LegacyTraceSpanStatus");a({id:e(),messageId:e(),traceId:e(),subject:e(),status:xe,kind:ve,sentAt:e(),deliveredAt:e().nullable(),processedAt:e().nullable(),errorMessage:e().nullable(),metadata:e().nullable()}).openapi("TraceSpan");o(["hop_limit","ttl_expired","cycle_detected","budget_exhausted"]).openapi("BudgetRejectionCode");const we=a({hopLimit:t().int(),ttlExpired:t().int(),cycleDetected:t().int(),budgetExhausted:t().int()}).openapi("BudgetRejections");a({totalMessages:t().int(),deliveredCount:t().int(),failedCount:t().int(),noSubscriberCount:t().int(),deadLetteredCount:t().int(),avgDeliveryLatencyMs:t().nullable(),p50DeliveryLatencyMs:t().nullable(),p95DeliveryLatencyMs:t().nullable(),p99DeliveryLatencyMs:t().nullable(),activeEndpoints:t().int(),budgetRejections:we}).openapi("DeliveryMetrics");export{De as C};
6
+ */const w={name:"pen-line",size:24,node:[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],aliases:["edit-3"]};w.node;const $=L(w),Y=["relay","messages"];function X(){const s=P(),c=N();return O({mutationFn:g=>s.sendRelayMessage(g),onSuccess:()=>{c.invalidateQueries({queryKey:[...Y]})}})}function ee(s){try{return JSON.parse(s)}catch{return{content:s}}}const ae=a({subject:e().min(1,"Add a subject"),from:e().min(1,"Add a sender"),payload:e().min(1,"Add a message")});function De({open:s,onOpenChange:c}={}){const[g,B]=U.useState(!1),f=s!==void 0,F=f?s:g,M=X(),d=Z({defaultValues:{subject:"",from:"relay.human.console",payload:""},validators:{onSubmit:ae},onSubmit:({value:l})=>{M.mutate({subject:l.subject,from:l.from,payload:ee(l.payload)},{onSuccess:()=>{W.success("Message sent"),d.reset(),I(!1)}})}});function I(l){f?c==null||c(l):B(l),l||d.reset()}return i.jsxs(q,{open:F,onOpenChange:I,children:[!f&&i.jsx(z,{asChild:!0,children:i.jsxs(k,{variant:"ghost",size:"sm",className:"gap-1.5","data-testid":"compose-trigger",children:[i.jsx($,{className:"size-3.5"}),"Compose"]})}),i.jsxs(K,{children:[i.jsxs(G,{children:[i.jsx(H,{children:"Send a test message"}),i.jsx(J,{children:"Check that a message gets delivered."})]}),i.jsx(d.AppForm,{children:i.jsxs("form",{onSubmit:l=>{l.preventDefault(),d.handleSubmit()},className:"space-y-4",children:[i.jsx(d.AppField,{name:"subject",children:l=>i.jsx(l.TextField,{label:"Subject",placeholder:"e.g. relay.test.ping"})}),i.jsx(d.AppField,{name:"from",children:l=>i.jsx(l.TextField,{label:"From"})}),i.jsx(d.AppField,{name:"payload",children:l=>i.jsx(l.TextareaField,{label:"Message",placeholder:"Plain text or JSON",rows:4})}),i.jsx("div",{className:"flex justify-end",children:i.jsxs(k,{type:"submit",disabled:M.isPending,children:[i.jsx(Q,{className:"mr-2 size-4"}),"Send"]})})]})})]})]})}y();a({from:e().describe("Subject pattern (supports wildcards)"),to:e().describe("Subject pattern (supports wildcards)"),action:o(["allow","deny"]),priority:t().int()}).openapi("RelayAccessRule");y();const u=e().min(1),x=o(["telegram","webhook","claude-code","slack","plugin"]).openapi("AdapterType"),te=a({package:e().optional(),path:e().optional()}).refine(s=>s.package||s.path,{message:"Plugin source must specify either package or path"}).openapi("PluginSource"),S=o(["always","mention-only","thread-aware"]),j="thread-aware",ne=a({token:u,mode:o(["polling","webhook"]).default("polling"),webhookUrl:e().url().optional(),webhookPort:t().int().positive().optional(),webhookSecret:u.optional(),streaming:n().default(!0),respondMode:S.default(j),dmPolicy:o(["open","allowlist"]).default("allowlist"),dmAllowlist:p(e()).default([]),approverAllowlist:p(e()).default([])}).openapi("TelegramAdapterConfig"),oe=a({type:o(["photo","sticker","voice","document","video","location","audio","video_note"]),durationSec:t().optional(),fileName:e().optional(),mimeType:e().optional()}).openapi("TelegramMediaDescriptor");a({chatId:t(),messageId:t(),chatType:e(),fromId:t().optional(),username:e().optional(),replyToMessageId:t().optional(),messageThreadId:t().optional(),threadName:e().optional(),media:oe.optional(),botUsername:e().optional()}).openapi("TelegramPlatformData");const ie="A webhook must use its own address under relay.webhook., such as relay.webhook.my-service. Use letters, numbers, hyphens or underscores in each part; wildcards are not allowed.";function se(s){return s.startsWith("relay.webhook.")&&s.split(".").length<=16&&/^relay\.webhook\.[a-zA-Z0-9_-]+(?:\.[a-zA-Z0-9_-]+)*$/.test(s)}const le=a({subject:e().min(1).refine(se,{message:ie}),secret:e().min(16),previousSecret:e().optional()}).openapi("WebhookInboundConfig"),pe=a({url:e().url(),secret:e().min(16),headers:r(e(),e()).optional()}).openapi("WebhookOutboundConfig"),re=a({inbound:le,outbound:pe}).openapi("WebhookAdapterConfig"),de=a({botToken:u,appToken:u,signingSecret:u,streaming:n().default(!0),nativeStreaming:n().default(!0),typingIndicator:o(["none","reaction"]).default("reaction"),respondMode:S.default(j),dmPolicy:o(["open","allowlist"]).default("allowlist"),dmAllowlist:p(e()).default([]),approverAllowlist:p(e()).default([]),channelOverrides:r(e(),a({enabled:n().optional(),respondMode:S.optional()}).strict()).default({})}).openapi("SlackAdapterConfig"),ce=a({id:e().min(1).regex(/^[a-z0-9-]+$/,"Must be lowercase alphanumeric with hyphens"),type:x,enabled:n().default(!0),label:e().optional(),builtin:n().optional(),plugin:te.optional(),config:b([ne,re,de,r(e(),m())])}).openapi("AdapterConfig"),ue=a({id:e(),type:x,displayName:e(),state:o(["connected","disconnected","error","starting","stopping","reconnecting"]),messageCount:a({inbound:t().int().nonnegative(),outbound:t().int().nonnegative()}),errorCount:t().int().nonnegative(),lastError:e().optional(),lastErrorAt:e().datetime().optional(),startedAt:e().datetime().optional()}).openapi("AdapterStatus");a({adapters:p(ce)}).openapi("AdaptersConfigFile");const me=o(["text","password","number","boolean","select","textarea","url"]).openapi("ConfigFieldType"),he=a({label:e(),value:e(),description:e().optional()}).openapi("ConfigFieldOption"),ge=a({key:e(),label:e(),type:me,required:n(),default:b([e(),t(),n()]).optional(),placeholder:e().optional(),description:e().optional(),options:p(he).optional(),section:e().optional(),showWhen:a({field:e(),equals:b([e(),n(),t()])}).optional(),pattern:e().optional(),patternMessage:e().optional(),visibleByDefault:n().optional(),displayAs:V("radio-cards").optional(),helpMarkdown:e().optional(),valueShape:o(["id-list","json-object"]).optional()}).openapi("ConfigField"),fe=a({stepId:e(),title:e(),description:e().optional(),fields:p(e())}).openapi("AdapterSetupStep"),be=o(["messaging","automation","internal","custom"]).openapi("AdapterCategory"),Se=a({type:e(),displayName:e(),description:e(),iconId:e().optional(),category:be,docsUrl:e().url().optional(),builtin:n(),configFields:p(ge),setupSteps:p(fe).optional(),setupInstructions:e().optional(),multiInstance:n().default(!1),deprecated:n().optional(),apiVersion:e().optional(),actionButton:a({label:e(),url:e()}).optional(),setupGuide:e().optional()}).openapi("AdapterManifest"),ye=a({id:e(),enabled:n(),label:e().optional(),status:ue,config:r(e(),m()).optional()}).openapi("CatalogInstance");a({manifest:Se,instances:p(ye)}).openapi("CatalogEntry");const A=o(["per-chat","per-user","stateless"]).openapi("SessionStrategy"),R="A bridge cannot be attached to a wildcard binding — one room cannot honestly be the channel for an unbounded set of chats.";function D(s){return s.bridge!=="room"||!!s.chatId}const E=o(["private","group","supergroup","channel"]).openapi("PlatformChatType"),_=a({id:e().uuid(),adapterId:e().min(1),agentId:e().min(1),chatId:e().optional(),channelType:h.optional(),platformChatType:E.optional(),sessionStrategy:A.default("per-chat"),label:e().default(""),permissionMode:C.default("default"),enabled:n().default(!0),canInitiate:n().default(!1),canReply:n().default(!0),canReceive:n().default(!0),notifyOnTaskComplete:n().default(!0),bridge:o(["off","room"]).default("off"),roomId:e().nullable().default(null),createdAt:e().datetime(),updatedAt:e().datetime()}),T=_.refine(D,{message:R,path:["chatId"]}).openapi("AdapterBinding");_.omit({id:!0,createdAt:!0,updatedAt:!0}).refine(D,{message:R,path:["chatId"]}).openapi("CreateBindingRequest");a({sessionStrategy:A.optional(),label:e().optional(),chatId:e().optional().nullable(),channelType:h.optional().nullable(),canInitiate:n().optional(),canReply:n().optional(),canReceive:n().optional(),notifyOnTaskComplete:n().optional(),permissionMode:C.optional(),enabled:n().optional(),bridge:o(["off","room"]).optional(),roomId:e().optional().nullable()}).openapi("UpdateBindingRequest");a({agentId:e().min(1)}).openapi("MoveBindingRequest");const Ce=o(["pending","claimed","ignored","blocked"]).openapi("UnclaimedChatStatus"),v=200,Ae=a({id:e(),adapterId:e(),chatId:e(),channelType:h.nullable(),chatKind:o(["dm","group"]),platformChatType:E.nullable(),senderName:e().max(v).nullable(),senderId:e().nullable(),chatTitle:e().max(v).nullable(),status:Ce,messageCount:t().int().nonnegative(),firstSeenAt:e().datetime(),lastSeenAt:e().datetime(),decidedAt:e().datetime().nullable(),decidedAgentId:e().nullable()}).openapi("UnclaimedChat");a({chats:p(Ae)}).openapi("UnclaimedChatListResponse");a({agentId:e().min(1),sessionStrategy:A.optional(),permissionMode:C.optional(),label:e().optional(),bridge:n().optional()}).openapi("ClaimUnclaimedChatRequest");a({bindings:p(T)}).openapi("BindingListResponse");a({binding:T}).openapi("BindingResponse");a({binding:T,bridgeError:e().optional()}).openapi("ClaimUnclaimedChatResponse");const Te=a({chatId:e(),displayName:e().optional(),channelType:h.optional(),lastMessageAt:e().datetime(),messageCount:t()}).openapi("ObservedChat");a({chats:p(Te)}).openapi("ObservedChatsResponse");a({type:e().min(1),config:r(e(),m())}).openapi("AdapterTestRequest");a({type:e().min(1),id:e().min(1).regex(/^[a-z0-9-]+$/,"Must be lowercase alphanumeric with hyphens"),config:r(e(),m()),enabled:n().optional(),label:e().optional()}).openapi("AdapterCreateRequest");a({config:r(e(),m())}).openapi("AdapterConfigUpdate");a({ok:n(),resolved:n(),latencyMs:t(),wouldDeliverTo:e().optional(),reason:e().optional(),details:e().optional()}).openapi("BindingTestResult");y();const Me=a({enabled:n().default(!0),windowSecs:t().int().min(1).default(60),maxPerWindow:t().int().min(1).default(100),perSenderOverrides:r(e(),t().int().min(1)).optional()}).openapi("RateLimitConfig"),Ie=a({enabled:n().default(!0),failureThreshold:t().int().min(1).default(5),cooldownMs:t().int().min(1e3).default(3e4),halfOpenProbeCount:t().int().min(1).default(1),successToClose:t().int().min(1).default(2)}).openapi("CircuitBreakerConfig"),ke=a({enabled:n().default(!0),maxMailboxSize:t().int().min(1).default(1e3),pressureWarningAt:t().min(0).max(1).default(.8)}).openapi("BackpressureConfig");a({rateLimit:Me.partial().optional(),circuitBreaker:Ie.partial().optional(),backpressure:ke.partial().optional()}).openapi("ReliabilityConfig");a({adapterId:e().optional(),chatId:e().optional(),userId:e().optional(),isSyntheticTest:n().optional()}).passthrough().openapi("TraceMetadata");const ve=o(["sent","delivered","failed","timeout","no_subscriber"]).openapi("TraceSpanStatus"),we=o(["delivery","lifecycle"]).openapi("TraceKind");o(["pending","delivered","processed","failed","dead_lettered"]).openapi("LegacyTraceSpanStatus");a({id:e(),messageId:e(),traceId:e(),subject:e(),status:ve,kind:we,sentAt:e(),deliveredAt:e().nullable(),processedAt:e().nullable(),errorMessage:e().nullable(),metadata:e().nullable()}).openapi("TraceSpan");o(["hop_limit","ttl_expired","cycle_detected","budget_exhausted"]).openapi("BudgetRejectionCode");const xe=a({hopLimit:t().int(),ttlExpired:t().int(),cycleDetected:t().int(),budgetExhausted:t().int()}).openapi("BudgetRejections");a({totalMessages:t().int(),deliveredCount:t().int(),failedCount:t().int(),noSubscriberCount:t().int(),deadLetteredCount:t().int(),avgDeliveryLatencyMs:t().nullable(),p50DeliveryLatencyMs:t().nullable(),p95DeliveryLatencyMs:t().nullable(),p99DeliveryLatencyMs:t().nullable(),activeEndpoints:t().int(),budgetRejections:xe}).openapi("DeliveryMetrics");export{De as C};
@@ -1,6 +1,6 @@
1
- import{W as de,g8 as _,a7 as ue,g9 as V,b5 as Q,a3 as me,a2 as he,r as d,a4 as fe,j as s,cx as ge,cy as Oe,cA as xe,cB as _e,ga as q,cC as ve,B as x,gb as ye,du as Ee,x as be,G as Re,da as pe,gc as Te,bj as M,gd as X,ge as Ne}from"./index-C8-dwIPp.js";import{M as Ce}from"./markdown-content-GoymYcRL.js";import{F as Se}from"./file-exclamation-point-BedYLbs2.js";/**
1
+ import{W as de,gl as _,a7 as ue,gm as V,b6 as Q,a3 as me,a2 as he,r as d,a4 as fe,j as s,cw as ge,cx as Oe,cz as xe,cA as _e,gn as q,cB as ve,B as x,go as ye,dw as Ee,x as be,G as Re,dc as pe,gp as Te,bk as M,gq as X,gr as Ne}from"./index-Dc5cpBoO.js";import{M as Ce}from"./markdown-content-DPc7aD1j.js";import{F as Se}from"./file-exclamation-point-DbWvGys0.js";/**
2
2
  * @license lucide-react v1.48.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const J={name:"share-2",size:24,node:[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]};J.node;const Fe=de(J),De=["CONFLICT","COPY_INTO_SELF","DIR_NOT_EMPTY","NOT_FOUND","REFUSE_ROOT","OUTSIDE_BOUNDARY"];function we(e){const t=_(e);return t!==void 0&&De.includes(t)?t:void 0}const Ae="Can’t copy a folder into itself",w="ROOM_REPO_CONFIG_UNSAFE",L="Room files are locked: their git settings could run a program. See the DorkOS log.",Ie={CONFLICT:"That name already exists",COPY_INTO_SELF:Ae,DIR_NOT_EMPTY:"This folder isn’t empty",NOT_FOUND:"That item no longer exists",REFUSE_ROOT:"Can’t change the top folder",OUTSIDE_BOUNDARY:"That’s outside the folders DorkOS can use"};function st(e,t){const o=we(e);ue.error(o?Ie[o]:t)}const Me=new Map([["ROOM_UPLOAD_TOO_MANY_FILES",`Nothing was uploaded. One upload takes up to ${V} files.`],["FILE_TOO_LARGE","A file is bigger than this room allows, so nothing changed."],["REPO_CAP_EXCEEDED","This room’s files are full, so nothing changed. Delete something first."],["MAIN_CHECKOUT_DIRTY","Changes are paused. Somebody changed these files outside DorkOS. See the warning above."],["MERGE_IN_FLIGHT","Somebody else is changing these files. Nothing changed. Try again in a moment."],["PEOPLE_ONLY","Only a person can change files here. Agents bring work in by merging."],["ROOM_FILE_PATH_INVALID","That name can’t be used in room files, so nothing changed."],["ROOM_FILE_NOT_READABLE","That can’t be changed here."],["ROOM_FILE_NOT_FOUND","That’s gone from the room’s files, so nothing changed. The list is refreshed."],["ATTACHMENT_NOT_FOUND","That file is no longer in this room’s chat."],["ROOM_HAS_NO_REPO","This room no longer has its own files."],["ROOM_REPOS_DISABLED","Room files are turned off on this install, so nothing changed."],["ROOM_REPO_GIT_UNAVAILABLE","Room files need git, and git isn’t installed on this computer."],["ROOM_NOT_FOUND","This room no longer exists."],["ROOM_ARCHIVED","This room is archived, so its files can’t be changed."],[w,L]]),Le=new Set(["FILE_TOO_LARGE","ROOM_FILE_PATH_INVALID","ROOM_FILE_NOT_READABLE",w]);function ke(e){return e.replace(/`([^`]*)`/g,"“$1”").trim()}function je(e){const t=_(e);if(t===void 0)return;const o=Me.get(t);if(o!==void 0)return k(e)??o}function k(e){const t=_(e);if(!(t===void 0||!Le.has(t))&&!(!(e instanceof Error)||e.message.trim()===""))return ke(e.message)}function nt(e){return`“${e}” already exists there, so nothing changed. Pick another name.`}function ot(e){if(_(e)!==w)return;const t=e.body,o=typeof(t==null?void 0:t.command)=="string"&&t.command!==""?t.command:null;return{message:k(e)??L,command:o}}const Pe="—";function Ue(e){if(e==null)return{label:Pe,title:null};const t=Q(e.at);return{label:`${e.author} · ${t}`,title:`${e.subject} · ${e.author}, ${t}`}}function ze(e){return/\.(md|markdown|mdx)$/i.test(e)}function Be(e){return e<1024?`${e} bytes`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Ke(e,t){return e.editable&&e.save!==void 0&&t!==void 0&&t.body.kind==="text"}function it({source:e,path:t,isNew:o=!1,onCreated:a,onClose:c}){const r=e.read,i=me(),n=["file-explorer","preview",e.scopeKey,t],m=he({queryKey:n,queryFn:()=>r(t),enabled:t!==null&&r!==void 0&&!o}),h=o&&t!==null?{path:t,size:0,commit:null,lastCommit:null,body:{kind:"text",text:""}}:m.data,[v,j]=d.useState(!1),[P,U]=d.useState(null),A=e.showToEveryone,Z=d.useCallback(async l=>{if(A!==void 0){j(!0),U(null);try{await A(l),c()}catch(u){U(u instanceof Error&&u.message.trim().length>0?u.message:"Couldn’t reach DorkOS. Check your connection and try again.")}finally{j(!1)}}},[A,c]),[g,N]=d.useState(o),[b,R]=d.useState(""),[z,C]=d.useState({text:"",commit:null}),[y,O]=d.useState(null),[I,f]=d.useState(null),[B,p]=d.useState(!1),[ee,S]=d.useState(!1),K=d.useRef(null),$=d.useRef(null),H=d.useRef(!1),E=g&&b!==z.text,te=E||g&&o,Y=ee&&E,F=d.useCallback(()=>{N(!1),R(""),C({text:"",commit:null}),O(null),f(null),p(!1),S(!1)},[]),[se,ne]=d.useState(t);se!==t&&(ne(t),(g||b!==""||y!==null||I!==null||B)&&F(),o&&N(!0));const T=fe({mutationFn:l=>e.save({path:t,baseCommit:l.baseCommit,text:l.text}),onSuccess:(l,u)=>{if(l.status==="saved"){C({text:u.text,commit:l.commit}),O(null),f(null),p(!0),o&&(a==null||a()),i.invalidateQueries({queryKey:n}),i.invalidateQueries({queryKey:["file-explorer","tree",e.scopeKey]});return}if(p(!1),l.status==="conflict"){O(ce=>({commit:l.commit,lastCommit:l.lastCommit,again:ce!==null})),f(null);return}O(null),f(l.reason)},onError:()=>{p(!1),O(null),f("Couldn’t save. Try again in a moment.")}}),G=Ke(e,h),oe=()=>{h===void 0||h.body.kind!=="text"||(R(h.body.text),C({text:h.body.text,commit:h.commit??null}),O(null),f(null),p(!1),N(!0))},ie=()=>{if(o){F(),c();return}N(!1),R(""),O(null),f(null),S(!1)},ae=async()=>{const l=await m.refetch();if(l.isError||l.data===void 0){f("Couldn’t get their version, so nothing changed.");return}const u=l.data;if(u.body.kind!=="text"){f(u.body.kind==="not-readable"?`${u.body.reason} Your text is still here. Save over theirs, or copy it out first.`:"Their version can’t be shown here, so nothing changed.");return}R(u.body.text),C({text:u.body.text,commit:u.commit??null}),O(null),f(null)},re=()=>{y!==null&&T.mutate({text:b,baseCommit:y.commit})},le=()=>{if(E){S(!0);return}F(),c()};return d.useEffect(()=>{var l,u;g?(l=K.current)==null||l.focus():H.current&&((u=$.current)==null||u.focus()),H.current=g},[g]),s.jsx(ge,{open:t!==null,onOpenChange:l=>!l&&le(),children:s.jsxs(Oe,{className:"max-h-[80vh] sm:max-w-2xl",children:[s.jsxs(xe,{children:[s.jsx(_e,{className:"truncate font-mono text-sm",children:t===null?"":q(t)}),s.jsx(ve,{className:"truncate text-xs",children:o&&t!==null?`${t} · New file`:He(h,t)})]}),!g&&(e.showToEveryone!==void 0||G)&&s.jsxs("div",{className:"flex justify-end gap-1 px-4",children:[e.showToEveryone!==void 0&&t!==null&&s.jsxs(x,{type:"button",variant:"ghost",size:"sm",disabled:v,className:"text-muted-foreground hover:text-foreground gap-1.5",onClick:()=>void Z(t),children:[s.jsx(Fe,{className:"size-(--size-icon-xs)"}),v?"Putting it there…":"Put on the canvas"]}),G&&s.jsxs(x,{ref:$,type:"button",variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-foreground gap-1.5",onClick:oe,children:[s.jsx(ye,{className:"size-(--size-icon-xs)"}),"Edit"]})]}),P!==null&&s.jsx("p",{role:"status",className:"text-destructive px-4 pb-1 text-xs",children:P}),y!==null&&s.jsx($e,{conflict:y,onTakeTheirs:()=>void ae(),onKeepMine:re,busy:T.isPending||m.isFetching}),I!==null&&s.jsx("p",{role:"alert",className:"bg-destructive/10 text-destructive mx-4 rounded-md px-3 py-2 text-sm",children:I}),s.jsx(Ee,{className:"min-h-0 flex-1 overflow-auto",children:m.isPending&&!o?s.jsx("div",{className:"flex h-32 items-center justify-center",children:s.jsx(be,{size:"md",className:"text-muted-foreground",label:"Loading the file"})}):m.isError&&!o||h===void 0?s.jsx(D,{children:"This file couldn’t be read."}):g?s.jsx("textarea",{ref:K,"aria-label":`${t===null?"File":q(t)} contents`,value:b,onChange:l=>R(l.target.value),spellCheck:!1,autoComplete:"off",className:Re("text-foreground/90 border-border/60 bg-background field-sizing-content","focus-visible:border-ring focus-visible:ring-ring min-h-64 w-full","resize-none rounded-md border px-3 py-2 font-mono text-xs","whitespace-pre-wrap focus-visible:ring-[3px] focus-visible:outline-none")}):s.jsx(Ye,{file:h})}),g&&s.jsxs(pe,{className:"items-center gap-2 sm:justify-between",children:[s.jsx("span",{className:"text-muted-foreground text-xs","aria-live":"polite",children:T.isPending?"Saving…":Y?"You haven’t saved your changes.":B&&!E?"Saved":E?"Not saved yet":""}),s.jsx("span",{className:"flex gap-2",children:Y?s.jsxs(s.Fragment,{children:[s.jsx(x,{type:"button",variant:"ghost",size:"sm",onClick:()=>S(!1),children:"Keep editing"}),s.jsx(x,{type:"button",variant:"destructive",size:"sm",onClick:()=>{F(),c()},children:"Discard changes"})]}):s.jsxs(s.Fragment,{children:[s.jsx(x,{type:"button",variant:"ghost",size:"sm",onClick:ie,children:E?"Discard":o?"Cancel":"Done"}),s.jsx(x,{type:"button",size:"sm",disabled:!te||T.isPending||y!==null,onClick:()=>T.mutate({text:b,baseCommit:z.commit}),children:"Save"})]})})]})]})})}function $e({conflict:e,onTakeTheirs:t,onKeepMine:o,busy:a}){const c=e.lastCommit,r=c===null?"Somebody":c.author;return s.jsxs("div",{role:"alert",className:"border-border/60 bg-muted/40 mx-4 space-y-2 rounded-md border px-3 py-2 text-sm",children:[s.jsx("p",{children:e.again?`${r} changed this file again, so it still isn’t saved.`:`${r} changed this file while you edited, so nothing was saved.`}),c!==null&&s.jsxs("p",{className:"text-muted-foreground text-xs",children:[c.subject," · ",Q(c.at)]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx(x,{type:"button",variant:"outline",size:"sm",disabled:a,onClick:t,children:"Open their version"}),s.jsx(x,{type:"button",variant:"destructive",size:"sm",disabled:a,onClick:o,children:"Save mine over it"})]}),s.jsx("p",{className:"text-muted-foreground text-xs",children:"Opening theirs replaces what you typed here."})]})}function He(e,t){if(t===null)return"";const o=e===void 0?null:Ue(e.lastCommit);return o===null?t:`${t} · ${o.label}`}function Ye({file:e}){switch(e.body.kind){case"text":return ze(e.path)?s.jsx(Ce,{content:e.body.text,className:"text-sm",errorFallback:"This file couldn’t be displayed."}):s.jsx("pre",{className:"text-foreground/90 overflow-x-auto font-mono text-xs whitespace-pre",children:e.body.text});case"binary":return s.jsx(D,{children:"Only text files can be shown or edited here."});case"too-large":return s.jsxs(D,{children:["Files over ",Be(e.body.maxBytes)," aren’t shown here."]});case"not-readable":return s.jsx(D,{children:e.body.reason})}}function D({children:e}){return s.jsxs("div",{className:"text-muted-foreground flex h-32 flex-col items-center justify-center gap-2 px-6 text-center text-sm",children:[s.jsx(Se,{className:"size-(--size-icon-md) opacity-60"}),s.jsx("span",{children:e})]})}const Ge=new Map([["REQUEST_TOO_LARGE","Too much text to save here. Put big files in the room’s attachments."],["FILE_TOO_LARGE","This file is bigger than the room allows, so it wasn’t saved."],["REPO_CAP_EXCEEDED","This room’s files are full, so nothing was saved."],["MAIN_CHECKOUT_DIRTY","Saving is paused. Somebody changed these files outside DorkOS. See the warning above."],["MERGE_IN_FLIGHT","Somebody else is saving these files. Nothing was saved. Try again in a moment."],["PEOPLE_ONLY","Only a person can save here. Agents bring work in by merging."],["ROOM_FILE_NOT_TEXT","This file isn’t plain text, so it can’t be saved here."],["ROOM_FILE_PATH_INVALID","That file name points somewhere else, so nothing was saved."],["ROOM_FILE_NOT_FOUND","This file is gone from the room, so there was nothing to save over."],["ROOM_FILE_NOT_READABLE","This file can’t be edited here."],["ROOM_HAS_NO_REPO","This room no longer has its own files."],["ROOM_REPOS_DISABLED","Room files are turned off on this install, so nothing was saved."],["ROOM_REPO_GIT_UNAVAILABLE","Room files need git, and git isn’t installed on this computer."],["ROOM_NOT_FOUND","This room no longer exists."],["ROOM_ARCHIVED","This room is archived, so its files can’t be changed."],[w,L]]);function qe(e){return e===void 0?void 0:Ge.get(e)}function W(e){if(typeof e!="object"||e===null)return null;const t=Te.safeParse(e.body);return t.success?t.data.conflict:null}const Ve=15e3;function Qe(e,t,o){const a=JSON.stringify(M.entries(t));let c=0,r=null;const i=e.getQueryCache().subscribe(n=>{if(n.type!=="updated"||JSON.stringify(n.query.queryKey)!==a||r!==null)return;const m=Math.max(0,Ve-(Date.now()-c));r=setTimeout(()=>{r=null,c=Date.now(),o()},m)});return()=>{r!==null&&clearTimeout(r),i()}}function Xe(e){return{name:e.name,path:e.path,type:e.kind==="dir"?"dir":"file",size:e.size,isSymlink:e.kind==="symlink",lastCommit:e.lastCommit}}const Je=new Map([["ROOM_FILE_NOT_READABLE","This isn’t a file that can be shown here."],["ROOM_FILE_NOT_FOUND","This file is no longer in the room."]]);function at(e){const{transport:t,queryClient:o,roomId:a,canChange:c=!0}=e,r=async i=>{try{return{status:"changed",commit:(await i()).commit}}catch(n){return We(n,o,a)}};return{scopeKey:`room:${a}`,cwd:null,writable:c,provenance:!0,filtersHidden:!1,preview:"inline",async showToEveryone(i){await t.openRoomCanvasDocument(a,{type:"file",sourcePath:i})},editable:c,changes:c?{maxUploadFiles:V,upload:i=>r(()=>t.uploadRoomFiles(a,{dir:i.dir,baseCommit:i.baseCommit,replace:i.replace,files:i.files})),move:i=>r(()=>t.moveRoomFile(a,i)),remove:i=>r(()=>t.deleteRoomFile(a,i))}:void 0,async list(i){try{const n=await t.readRoomFiles(a,i===""?void 0:i);return{entries:n.entries.map(Xe),commit:n.commit}}catch(n){if(_(n)!==Ne)throw n;return{entries:[],absent:!0}}},async read(i){try{const n=await t.readRoomFileContent(a,i);return{path:n.path,size:n.size,lastCommit:n.lastCommit,commit:n.commit,body:n.body.kind==="text"?{kind:"text",text:n.body.text}:n.body.kind==="binary"?{kind:"binary"}:{kind:"too-large",maxBytes:n.body.maxBytes}}}catch(n){const m=Je.get(_(n)??"");if(m===void 0)throw n;return{path:i,size:0,lastCommit:null,commit:null,body:{kind:"not-readable",reason:m}}}},async save(i){try{const n=await t.saveRoomFile(a,{path:i.path,baseCommit:i.baseCommit,text:i.text});return{status:"saved",commit:n.commit,lastCommit:n.lastCommit,committed:n.committed}}catch(n){const m=_(n);if(m===X){const v=W(n);return v!==null?{status:"conflict",commit:v.commit,lastCommit:v.lastCommit}:{status:"refused",reason:"Somebody changed this file while you edited it. Nothing was saved. Reopen it to see theirs."}}m==="MAIN_CHECKOUT_DIRTY"&&o.invalidateQueries({queryKey:M.repoStatus(a)});const h=k(n)??qe(m);if(h===void 0)throw n;return{status:"refused",reason:h}}},events(i){return Qe(o,a,i)}}}function We(e,t,o){const a=_(e);if(a===X){const r=W(e);return r!==null?{status:"conflict",path:r.path,commit:r.commit,lastCommit:r.lastCommit}:{status:"refused",reason:"Somebody changed these files after you opened them. Nothing changed. Check, then try again."}}if(a==="ROOM_FILE_EXISTS"){const r=e instanceof Error?e.message.replace(/`([^`]*)`/g,"“$1”"):"";return{status:"exists",reason:r.trim()!==""?r:"Something with that name is already there."}}a==="MAIN_CHECKOUT_DIRTY"&&t.invalidateQueries({queryKey:M.repoStatus(o)});const c=je(e);if(c===void 0)throw e;return{status:"refused",reason:c}}export{Ae as C,it as F,Pe as N,Ve as R,ot as a,We as b,at as c,we as g,nt as n,Ue as p,je as r,st as t,Qe as w};
6
+ */const J={name:"share-2",size:24,node:[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]};J.node;const Fe=de(J),we=["CONFLICT","COPY_INTO_SELF","DIR_NOT_EMPTY","NOT_FOUND","REFUSE_ROOT","OUTSIDE_BOUNDARY"];function De(e){const t=_(e);return t!==void 0&&we.includes(t)?t:void 0}const Ae="Can’t copy a folder into itself",D="ROOM_REPO_CONFIG_UNSAFE",L="Room files are locked: their git settings could run a program. See the DorkOS log.",Ie={CONFLICT:"That name already exists",COPY_INTO_SELF:Ae,DIR_NOT_EMPTY:"This folder isn’t empty",NOT_FOUND:"That item no longer exists",REFUSE_ROOT:"Can’t change the top folder",OUTSIDE_BOUNDARY:"That’s outside the folders DorkOS can use"};function st(e,t){const o=De(e);ue.error(o?Ie[o]:t)}const Me=new Map([["ROOM_UPLOAD_TOO_MANY_FILES",`Nothing was uploaded. One upload takes up to ${V} files.`],["FILE_TOO_LARGE","A file is bigger than this room allows, so nothing changed."],["REPO_CAP_EXCEEDED","This room’s files are full, so nothing changed. Delete something first."],["MAIN_CHECKOUT_DIRTY","Changes are paused. Somebody changed these files outside DorkOS. See the warning above."],["MERGE_IN_FLIGHT","Somebody else is changing these files. Nothing changed. Try again in a moment."],["PEOPLE_ONLY","Only a person can change files here. Agents bring work in by merging."],["ROOM_FILE_PATH_INVALID","That name can’t be used in room files, so nothing changed."],["ROOM_FILE_NOT_READABLE","That can’t be changed here."],["ROOM_FILE_NOT_FOUND","That’s gone from the room’s files, so nothing changed. The list is refreshed."],["ATTACHMENT_NOT_FOUND","That file is no longer in this room’s chat."],["ROOM_HAS_NO_REPO","This room no longer has its own files."],["ROOM_REPOS_DISABLED","Room files are turned off on this install, so nothing changed."],["ROOM_REPO_GIT_UNAVAILABLE","Room files need git, and git isn’t installed on this computer."],["ROOM_NOT_FOUND","This room no longer exists."],["ROOM_ARCHIVED","This room is archived, so its files can’t be changed."],[D,L]]),Le=new Set(["FILE_TOO_LARGE","ROOM_FILE_PATH_INVALID","ROOM_FILE_NOT_READABLE",D]);function ke(e){return e.replace(/`([^`]*)`/g,"“$1”").trim()}function je(e){const t=_(e);if(t===void 0)return;const o=Me.get(t);if(o!==void 0)return k(e)??o}function k(e){const t=_(e);if(!(t===void 0||!Le.has(t))&&!(!(e instanceof Error)||e.message.trim()===""))return ke(e.message)}function nt(e){return`“${e}” already exists there, so nothing changed. Pick another name.`}function ot(e){if(_(e)!==D)return;const t=e.body,o=typeof(t==null?void 0:t.command)=="string"&&t.command!==""?t.command:null;return{message:k(e)??L,command:o}}const Pe="—";function Ue(e){if(e==null)return{label:Pe,title:null};const t=Q(e.at);return{label:`${e.author} · ${t}`,title:`${e.subject} · ${e.author}, ${t}`}}function ze(e){return/\.(md|markdown|mdx)$/i.test(e)}function Be(e){return e<1024?`${e} bytes`:e<1024*1024?`${Math.round(e/1024)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function Ke(e,t){return e.editable&&e.save!==void 0&&t!==void 0&&t.body.kind==="text"}function it({source:e,path:t,isNew:o=!1,onCreated:a,onClose:c}){const r=e.read,i=me(),n=["file-explorer","preview",e.scopeKey,t],m=he({queryKey:n,queryFn:()=>r(t),enabled:t!==null&&r!==void 0&&!o}),h=o&&t!==null?{path:t,size:0,commit:null,lastCommit:null,body:{kind:"text",text:""}}:m.data,[v,j]=d.useState(!1),[P,U]=d.useState(null),A=e.showToEveryone,Z=d.useCallback(async l=>{if(A!==void 0){j(!0),U(null);try{await A(l),c()}catch(u){U(u instanceof Error&&u.message.trim().length>0?u.message:"Couldn’t reach DorkOS. Check your connection and try again.")}finally{j(!1)}}},[A,c]),[g,N]=d.useState(o),[b,R]=d.useState(""),[z,C]=d.useState({text:"",commit:null}),[y,O]=d.useState(null),[I,f]=d.useState(null),[B,p]=d.useState(!1),[ee,S]=d.useState(!1),K=d.useRef(null),$=d.useRef(null),H=d.useRef(!1),E=g&&b!==z.text,te=E||g&&o,Y=ee&&E,F=d.useCallback(()=>{N(!1),R(""),C({text:"",commit:null}),O(null),f(null),p(!1),S(!1)},[]),[se,ne]=d.useState(t);se!==t&&(ne(t),(g||b!==""||y!==null||I!==null||B)&&F(),o&&N(!0));const T=fe({mutationFn:l=>e.save({path:t,baseCommit:l.baseCommit,text:l.text}),onSuccess:(l,u)=>{if(l.status==="saved"){C({text:u.text,commit:l.commit}),O(null),f(null),p(!0),o&&(a==null||a()),i.invalidateQueries({queryKey:n}),i.invalidateQueries({queryKey:["file-explorer","tree",e.scopeKey]});return}if(p(!1),l.status==="conflict"){O(ce=>({commit:l.commit,lastCommit:l.lastCommit,again:ce!==null})),f(null);return}O(null),f(l.reason)},onError:()=>{p(!1),O(null),f("Couldn’t save. Try again in a moment.")}}),G=Ke(e,h),oe=()=>{h===void 0||h.body.kind!=="text"||(R(h.body.text),C({text:h.body.text,commit:h.commit??null}),O(null),f(null),p(!1),N(!0))},ie=()=>{if(o){F(),c();return}N(!1),R(""),O(null),f(null),S(!1)},ae=async()=>{const l=await m.refetch();if(l.isError||l.data===void 0){f("Couldn’t get their version, so nothing changed.");return}const u=l.data;if(u.body.kind!=="text"){f(u.body.kind==="not-readable"?`${u.body.reason} Your text is still here. Save over theirs, or copy it out first.`:"Their version can’t be shown here, so nothing changed.");return}R(u.body.text),C({text:u.body.text,commit:u.commit??null}),O(null),f(null)},re=()=>{y!==null&&T.mutate({text:b,baseCommit:y.commit})},le=()=>{if(E){S(!0);return}F(),c()};return d.useEffect(()=>{var l,u;g?(l=K.current)==null||l.focus():H.current&&((u=$.current)==null||u.focus()),H.current=g},[g]),s.jsx(ge,{open:t!==null,onOpenChange:l=>!l&&le(),children:s.jsxs(Oe,{className:"max-h-[80vh] sm:max-w-2xl",children:[s.jsxs(xe,{children:[s.jsx(_e,{className:"truncate font-mono text-sm",children:t===null?"":q(t)}),s.jsx(ve,{className:"truncate text-xs",children:o&&t!==null?`${t} · New file`:He(h,t)})]}),!g&&(e.showToEveryone!==void 0||G)&&s.jsxs("div",{className:"flex justify-end gap-1 px-4",children:[e.showToEveryone!==void 0&&t!==null&&s.jsxs(x,{type:"button",variant:"ghost",size:"sm",disabled:v,className:"text-muted-foreground hover:text-foreground gap-1.5",onClick:()=>void Z(t),children:[s.jsx(Fe,{className:"size-(--size-icon-xs)"}),v?"Putting it there…":"Put on the canvas"]}),G&&s.jsxs(x,{ref:$,type:"button",variant:"ghost",size:"sm",className:"text-muted-foreground hover:text-foreground gap-1.5",onClick:oe,children:[s.jsx(ye,{className:"size-(--size-icon-xs)"}),"Edit"]})]}),P!==null&&s.jsx("p",{role:"status",className:"text-destructive px-4 pb-1 text-xs",children:P}),y!==null&&s.jsx($e,{conflict:y,onTakeTheirs:()=>void ae(),onKeepMine:re,busy:T.isPending||m.isFetching}),I!==null&&s.jsx("p",{role:"alert",className:"bg-destructive/10 text-destructive mx-4 rounded-md px-3 py-2 text-sm",children:I}),s.jsx(Ee,{className:"min-h-0 flex-1 overflow-auto",children:m.isPending&&!o?s.jsx("div",{className:"flex h-32 items-center justify-center",children:s.jsx(be,{size:"md",className:"text-muted-foreground",label:"Loading the file"})}):m.isError&&!o||h===void 0?s.jsx(w,{children:"This file couldn’t be read."}):g?s.jsx("textarea",{ref:K,"aria-label":`${t===null?"File":q(t)} contents`,value:b,onChange:l=>R(l.target.value),spellCheck:!1,autoComplete:"off",className:Re("text-foreground/90 border-border/60 bg-background field-sizing-content","focus-visible:border-ring focus-visible:ring-ring min-h-64 w-full","resize-none rounded-md border px-3 py-2 font-mono text-xs","whitespace-pre-wrap focus-visible:ring-[3px] focus-visible:outline-none")}):s.jsx(Ye,{file:h})}),g&&s.jsxs(pe,{className:"items-center gap-2 sm:justify-between",children:[s.jsx("span",{className:"text-muted-foreground text-xs","aria-live":"polite",children:T.isPending?"Saving…":Y?"You haven’t saved your changes.":B&&!E?"Saved":E?"Not saved yet":""}),s.jsx("span",{className:"flex gap-2",children:Y?s.jsxs(s.Fragment,{children:[s.jsx(x,{type:"button",variant:"ghost",size:"sm",onClick:()=>S(!1),children:"Keep editing"}),s.jsx(x,{type:"button",variant:"destructive",size:"sm",onClick:()=>{F(),c()},children:"Discard changes"})]}):s.jsxs(s.Fragment,{children:[s.jsx(x,{type:"button",variant:"ghost",size:"sm",onClick:ie,children:E?"Discard":o?"Cancel":"Done"}),s.jsx(x,{type:"button",size:"sm",disabled:!te||T.isPending||y!==null,onClick:()=>T.mutate({text:b,baseCommit:z.commit}),children:"Save"})]})})]})]})})}function $e({conflict:e,onTakeTheirs:t,onKeepMine:o,busy:a}){const c=e.lastCommit,r=c===null?"Somebody":c.author;return s.jsxs("div",{role:"alert",className:"border-border/60 bg-muted/40 mx-4 space-y-2 rounded-md border px-3 py-2 text-sm",children:[s.jsx("p",{children:e.again?`${r} changed this file again, so it still isn’t saved.`:`${r} changed this file while you edited, so nothing was saved.`}),c!==null&&s.jsxs("p",{className:"text-muted-foreground text-xs",children:[c.subject," · ",Q(c.at)]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx(x,{type:"button",variant:"outline",size:"sm",disabled:a,onClick:t,children:"Open their version"}),s.jsx(x,{type:"button",variant:"destructive",size:"sm",disabled:a,onClick:o,children:"Save mine over it"})]}),s.jsx("p",{className:"text-muted-foreground text-xs",children:"Opening theirs replaces what you typed here."})]})}function He(e,t){if(t===null)return"";const o=e===void 0?null:Ue(e.lastCommit);return o===null?t:`${t} · ${o.label}`}function Ye({file:e}){switch(e.body.kind){case"text":return ze(e.path)?s.jsx(Ce,{content:e.body.text,className:"text-sm",errorFallback:"This file couldn’t be displayed."}):s.jsx("pre",{className:"text-foreground/90 overflow-x-auto font-mono text-xs whitespace-pre",children:e.body.text});case"binary":return s.jsx(w,{children:"Only text files can be shown or edited here."});case"too-large":return s.jsxs(w,{children:["Files over ",Be(e.body.maxBytes)," aren’t shown here."]});case"not-readable":return s.jsx(w,{children:e.body.reason})}}function w({children:e}){return s.jsxs("div",{className:"text-muted-foreground flex h-32 flex-col items-center justify-center gap-2 px-6 text-center text-sm",children:[s.jsx(Se,{className:"size-(--size-icon-md) opacity-60"}),s.jsx("span",{children:e})]})}const Ge=new Map([["REQUEST_TOO_LARGE","Too much text to save here. Put big files in the room’s attachments."],["FILE_TOO_LARGE","This file is bigger than the room allows, so it wasn’t saved."],["REPO_CAP_EXCEEDED","This room’s files are full, so nothing was saved."],["MAIN_CHECKOUT_DIRTY","Saving is paused. Somebody changed these files outside DorkOS. See the warning above."],["MERGE_IN_FLIGHT","Somebody else is saving these files. Nothing was saved. Try again in a moment."],["PEOPLE_ONLY","Only a person can save here. Agents bring work in by merging."],["ROOM_FILE_NOT_TEXT","This file isn’t plain text, so it can’t be saved here."],["ROOM_FILE_PATH_INVALID","That file name points somewhere else, so nothing was saved."],["ROOM_FILE_NOT_FOUND","This file is gone from the room, so there was nothing to save over."],["ROOM_FILE_NOT_READABLE","This file can’t be edited here."],["ROOM_HAS_NO_REPO","This room no longer has its own files."],["ROOM_REPOS_DISABLED","Room files are turned off on this install, so nothing was saved."],["ROOM_REPO_GIT_UNAVAILABLE","Room files need git, and git isn’t installed on this computer."],["ROOM_NOT_FOUND","This room no longer exists."],["ROOM_ARCHIVED","This room is archived, so its files can’t be changed."],[D,L]]);function qe(e){return e===void 0?void 0:Ge.get(e)}function W(e){if(typeof e!="object"||e===null)return null;const t=Te.safeParse(e.body);return t.success?t.data.conflict:null}const Ve=15e3;function Qe(e,t,o){const a=JSON.stringify(M.entries(t));let c=0,r=null;const i=e.getQueryCache().subscribe(n=>{if(n.type!=="updated"||JSON.stringify(n.query.queryKey)!==a||r!==null)return;const m=Math.max(0,Ve-(Date.now()-c));r=setTimeout(()=>{r=null,c=Date.now(),o()},m)});return()=>{r!==null&&clearTimeout(r),i()}}function Xe(e){return{name:e.name,path:e.path,type:e.kind==="dir"?"dir":"file",size:e.size,isSymlink:e.kind==="symlink",lastCommit:e.lastCommit}}const Je=new Map([["ROOM_FILE_NOT_READABLE","This isn’t a file that can be shown here."],["ROOM_FILE_NOT_FOUND","This file is no longer in the room."]]);function at(e){const{transport:t,queryClient:o,roomId:a,canChange:c=!0}=e,r=async i=>{try{return{status:"changed",commit:(await i()).commit}}catch(n){return We(n,o,a)}};return{scopeKey:`room:${a}`,cwd:null,writable:c,provenance:!0,filtersHidden:!1,preview:"inline",async showToEveryone(i){await t.openRoomCanvasDocument(a,{type:"file",sourcePath:i})},editable:c,changes:c?{maxUploadFiles:V,upload:i=>r(()=>t.uploadRoomFiles(a,{dir:i.dir,baseCommit:i.baseCommit,replace:i.replace,files:i.files})),move:i=>r(()=>t.moveRoomFile(a,i)),remove:i=>r(()=>t.deleteRoomFile(a,i))}:void 0,async list(i){try{const n=await t.readRoomFiles(a,i===""?void 0:i);return{entries:n.entries.map(Xe),commit:n.commit}}catch(n){if(_(n)!==Ne)throw n;return{entries:[],absent:!0}}},async read(i){try{const n=await t.readRoomFileContent(a,i);return{path:n.path,size:n.size,lastCommit:n.lastCommit,commit:n.commit,body:n.body.kind==="text"?{kind:"text",text:n.body.text}:n.body.kind==="binary"?{kind:"binary"}:{kind:"too-large",maxBytes:n.body.maxBytes}}}catch(n){const m=Je.get(_(n)??"");if(m===void 0)throw n;return{path:i,size:0,lastCommit:null,commit:null,body:{kind:"not-readable",reason:m}}}},async save(i){try{const n=await t.saveRoomFile(a,{path:i.path,baseCommit:i.baseCommit,text:i.text});return{status:"saved",commit:n.commit,lastCommit:n.lastCommit,committed:n.committed}}catch(n){const m=_(n);if(m===X){const v=W(n);return v!==null?{status:"conflict",commit:v.commit,lastCommit:v.lastCommit}:{status:"refused",reason:"Somebody changed this file while you edited it. Nothing was saved. Reopen it to see theirs."}}m==="MAIN_CHECKOUT_DIRTY"&&o.invalidateQueries({queryKey:M.repoStatus(a)});const h=k(n)??qe(m);if(h===void 0)throw n;return{status:"refused",reason:h}}},events(i){return Qe(o,a,i)}}}function We(e,t,o){const a=_(e);if(a===X){const r=W(e);return r!==null?{status:"conflict",path:r.path,commit:r.commit,lastCommit:r.lastCommit}:{status:"refused",reason:"Somebody changed these files after you opened them. Nothing changed. Check, then try again."}}if(a==="ROOM_FILE_EXISTS"){const r=e instanceof Error?e.message.replace(/`([^`]*)`/g,"“$1”"):"";return{status:"exists",reason:r.trim()!==""?r:"Something with that name is already there."}}a==="MAIN_CHECKOUT_DIRTY"&&t.invalidateQueries({queryKey:M.repoStatus(o)});const c=je(e);if(c===void 0)throw e;return{status:"refused",reason:c}}export{Ae as C,it as F,Pe as N,Ve as R,ot as a,We as b,at as c,De as g,nt as n,Ue as p,je as r,st as t,Qe as w};
@@ -1,4 +1,4 @@
1
- import{W as e}from"./index-C8-dwIPp.js";/**
1
+ import{W as e}from"./index-Dc5cpBoO.js";/**
2
2
  * @license lucide-react v1.48.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{W as e}from"./index-C8-dwIPp.js";/**
1
+ import{W as e}from"./index-Dc5cpBoO.js";/**
2
2
  * @license lucide-react v1.48.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{r as c,j as b,bk as X,bl as R,bm as T,bn as j,bo as ne,bp as C,bq as le,br as ce,bs as ae,bt as U,bu as se}from"./index-C8-dwIPp.js";var ie=Object.defineProperty,h=(n,e)=>ie(n,"name",{value:e,configurable:!0});function J(n,e){return c.useReducer((t,r)=>e[t][r]??t,n)}h(J,"useStateMachine");var K="ScrollArea",[Q,je]=ne(K),[ue,g]=Q(K),de=c.forwardRef(h(function(e,t){const{__scopeScrollArea:r,type:s="hover",dir:o,scrollHideDelay:l=600,...a}=e,[i,u]=c.useState(null),[S,f]=c.useState(null),[v,d]=c.useState(null),[m,w]=c.useState(null),[y,Y]=c.useState(null),[P,z]=c.useState(0),[M,I]=c.useState(0),[O,_]=c.useState(!1),[N,L]=c.useState(!1),p=T(t,u),A=ae(o);return b.jsx(ue,{scope:r,type:s,dir:A,scrollHideDelay:l,scrollArea:i,viewport:S,onViewportChange:f,content:v,onContentChange:d,scrollbarX:m,onScrollbarXChange:w,scrollbarXEnabled:O,onScrollbarXEnabledChange:_,scrollbarY:y,onScrollbarYChange:Y,scrollbarYEnabled:N,onScrollbarYEnabledChange:L,onCornerWidthChange:z,onCornerHeightChange:I,children:b.jsx(j.div,{dir:A,...a,ref:p,style:{position:"relative","--radix-scroll-area-corner-width":P+"px","--radix-scroll-area-corner-height":M+"px",...e.style}})})},"ScrollArea")),he="ScrollAreaViewport",fe=c.forwardRef(h(function(e,t){const{__scopeScrollArea:r,children:s,nonce:o,...l}=e,a=g(he,r),i=c.useRef(null),u=T(t,i,a.onViewportChange);return b.jsxs(b.Fragment,{children:[b.jsx(Se,{nonce:o}),b.jsx(j.div,{"data-radix-scroll-area-viewport":"",...l,ref:u,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...e.style},children:b.jsx("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:s})})]})},"ScrollAreaViewport")),Se=c.memo(h(function({nonce:e}){return b.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:e})},"ScrollAreaViewportStyle"),(n,e)=>n.nonce===e.nonce),x="ScrollAreaScrollbar",be=c.forwardRef(h(function(e,t){const{forceMount:r,...s}=e,o=g(x,e.__scopeScrollArea),{onScrollbarXEnabledChange:l,onScrollbarYEnabledChange:a}=o,i=e.orientation==="horizontal";return c.useEffect(()=>(i?l(!0):a(!0),()=>{i?l(!1):a(!1)}),[i,l,a]),o.type==="hover"?b.jsx(me,{...s,ref:t,forceMount:r}):o.type==="scroll"?b.jsx(ve,{...s,ref:t,forceMount:r}):o.type==="auto"?b.jsx(Z,{...s,ref:t,forceMount:r}):o.type==="always"?b.jsx(F,{...s,ref:t,"data-state":"visible"}):null},"ScrollAreaScrollbar")),me=c.forwardRef(h(function(e,t){const{forceMount:r,...s}=e,o=g(x,e.__scopeScrollArea),[l,a]=c.useState(!1);return c.useEffect(()=>{const i=o.scrollArea;let u=0;if(i){const S=h(()=>{window.clearTimeout(u),a(!0)},"handlePointerEnter"),f=h(()=>{u=window.setTimeout(()=>a(!1),o.scrollHideDelay)},"handlePointerLeave");return i.addEventListener("pointerenter",S),i.addEventListener("pointerleave",f),()=>{window.clearTimeout(u),i.removeEventListener("pointerenter",S),i.removeEventListener("pointerleave",f)}}},[o.scrollArea,o.scrollHideDelay]),b.jsx(X,{present:r||l,children:b.jsx(Z,{"data-state":l?"visible":"hidden",...s,ref:t})})},"ScrollAreaScrollbarHover")),ve=c.forwardRef(h(function(e,t){const{forceMount:r,...s}=e,o=g(x,e.__scopeScrollArea),l=e.orientation==="horizontal",a=H(()=>u("SCROLL_END"),100),[i,u]=J("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return c.useEffect(()=>{if(i==="idle"){const S=window.setTimeout(()=>u("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(S)}},[i,o.scrollHideDelay,u]),c.useEffect(()=>{const S=o.viewport,f=l?"scrollLeft":"scrollTop";if(S){let v=S[f];const d=h(()=>{const m=S[f];v!==m&&(u("SCROLL"),a()),v=m},"handleScroll");return S.addEventListener("scroll",d),()=>S.removeEventListener("scroll",d)}},[o.viewport,l,u,a]),b.jsx(X,{present:r||i!=="hidden",children:b.jsx(F,{"data-state":i==="hidden"?"hidden":"visible",...s,ref:t,onPointerEnter:R(e.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:R(e.onPointerLeave,()=>u("POINTER_LEAVE"))})})},"ScrollAreaScrollbarScroll")),Z=c.forwardRef(h(function(e,t){const r=g(x,e.__scopeScrollArea),{forceMount:s,...o}=e,[l,a]=c.useState(!1),i=e.orientation==="horizontal",u=H(()=>{if(r.viewport){const S=r.viewport.offsetWidth<r.viewport.scrollWidth,f=r.viewport.offsetHeight<r.viewport.scrollHeight;a(i?S:f)}},10);return E(r.viewport,u),E(r.content,u),b.jsx(X,{present:s||l,children:b.jsx(F,{"data-state":l?"visible":"hidden",...o,ref:t})})},"ScrollAreaScrollbarAuto")),F=c.forwardRef(h(function(e,t){const{orientation:r="vertical",...s}=e,o=g(x,e.__scopeScrollArea),l=c.useRef(null),a=c.useRef(0),[i,u]=c.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),S=q(i.viewport,i.content),f={...s,sizes:i,onSizesChange:u,hasThumb:S>0&&S<1,onThumbChange:h(d=>l.current=d,"onThumbChange"),onThumbPointerUp:h(()=>a.current=0,"onThumbPointerUp"),onThumbPointerDown:h(d=>a.current=d,"onThumbPointerDown")};function v(d,m){return te(d,a.current,i,m)}return h(v,"getScrollPosition"),r==="horizontal"?b.jsx(pe,{...f,ref:t,onThumbPositionChange:()=>{if(o.viewport&&l.current){const d=o.viewport.scrollLeft,m=B(d,i,o.dir);l.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:d=>{o.viewport&&(o.viewport.scrollLeft=d)},onDragScroll:d=>{o.viewport&&(o.viewport.scrollLeft=v(d,o.dir))}}):r==="vertical"?b.jsx(we,{...f,ref:t,onThumbPositionChange:()=>{if(o.viewport&&l.current){const d=o.viewport.scrollTop,m=B(d,i);l.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:d=>{o.viewport&&(o.viewport.scrollTop=d)},onDragScroll:d=>{o.viewport&&(o.viewport.scrollTop=v(d))}}):null},"ScrollAreaScrollbarVisible")),pe=c.forwardRef(h(function(e,t){const{sizes:r,onSizesChange:s,...o}=e,l=g(x,e.__scopeScrollArea),[a,i]=c.useState(),u=c.useRef(null),S=T(t,u,l.onScrollbarXChange);return c.useEffect(()=>{u.current&&i(getComputedStyle(u.current))},[u]),b.jsx(re,{"data-orientation":"horizontal",...o,ref:S,sizes:r,style:{bottom:0,left:l.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:l.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":W(r)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.x),onDragScroll:f=>e.onDragScroll(f.x),onWheelScroll:(f,v)=>{if(l.viewport){const d=l.viewport.scrollLeft+f.deltaX;e.onWheelScroll(d),G(d,v)&&f.preventDefault()}},onResize:()=>{u.current&&l.viewport&&a&&s({content:l.viewport.scrollWidth,viewport:l.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:D(a.paddingLeft),paddingEnd:D(a.paddingRight)}})}})},"ScrollAreaScrollbarX")),we=c.forwardRef(h(function(e,t){const{sizes:r,onSizesChange:s,...o}=e,l=g(x,e.__scopeScrollArea),[a,i]=c.useState(),u=c.useRef(null),S=T(t,u,l.onScrollbarYChange);return c.useEffect(()=>{u.current&&i(getComputedStyle(u.current))},[u]),b.jsx(re,{"data-orientation":"vertical",...o,ref:S,sizes:r,style:{top:0,right:l.dir==="ltr"?0:void 0,left:l.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":W(r)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.y),onDragScroll:f=>e.onDragScroll(f.y),onWheelScroll:(f,v)=>{if(l.viewport){const d=l.viewport.scrollTop+f.deltaY;e.onWheelScroll(d),G(d,v)&&f.preventDefault()}},onResize:()=>{u.current&&l.viewport&&a&&s({content:l.viewport.scrollHeight,viewport:l.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:D(a.paddingTop),paddingEnd:D(a.paddingBottom)}})}})},"ScrollAreaScrollbarY")),[ge,ee]=Q(x),re=c.forwardRef(h(function(e,t){const{__scopeScrollArea:r,sizes:s,hasThumb:o,onThumbChange:l,onThumbPointerUp:a,onThumbPointerDown:i,onThumbPositionChange:u,onDragScroll:S,onWheelScroll:f,onResize:v,...d}=e,m=g(x,r),[w,y]=c.useState(null),Y=T(t,y),P=c.useRef(null),z=c.useRef(""),M=m.viewport,I=s.content-s.viewport,O=C(f),_=C(u),N=H(v,10);function L(p){if(P.current){const A=p.clientX-P.current.left,V=p.clientY-P.current.top;S({x:A,y:V})}}return h(L,"handleDragScroll"),c.useEffect(()=>{const p=h(A=>{const V=A.target;(w==null?void 0:w.contains(V))&&O(A,I)},"handleWheel");return document.addEventListener("wheel",p,{passive:!1}),()=>document.removeEventListener("wheel",p,{passive:!1})},[M,w,I,O]),c.useEffect(_,[s,_]),E(w,N),E(m.content,N),b.jsx(ge,{scope:r,scrollbar:w,hasThumb:o,onThumbChange:C(l),onThumbPointerUp:C(a),onThumbPositionChange:_,onThumbPointerDown:C(i),children:b.jsx(j.div,{...d,ref:Y,style:{position:"absolute",...d.style},onPointerDown:R(e.onPointerDown,p=>{p.button===0&&(p.target.setPointerCapture(p.pointerId),P.current=w.getBoundingClientRect(),z.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),L(p))}),onPointerMove:R(e.onPointerMove,L),onPointerUp:R(e.onPointerUp,p=>{const A=p.target;A.hasPointerCapture(p.pointerId)&&A.releasePointerCapture(p.pointerId),document.body.style.webkitUserSelect=z.current,m.viewport&&(m.viewport.style.scrollBehavior=""),P.current=null})})})},"ScrollAreaScrollbarImpl")),k="ScrollAreaThumb",Ae=c.forwardRef(h(function(e,t){const{forceMount:r,...s}=e,o=ee(k,e.__scopeScrollArea);return b.jsx(X,{present:r||o.hasThumb,children:b.jsx(xe,{ref:t,...s})})},"ScrollAreaThumb")),xe=c.forwardRef(h(function(e,t){const{__scopeScrollArea:r,style:s,...o}=e,l=g(k,r),a=ee(k,r),{onThumbPositionChange:i}=a,u=T(t,a.onThumbChange),S=c.useRef(void 0),f=H(()=>{S.current&&(S.current(),S.current=void 0)},100);return c.useEffect(()=>{const v=l.viewport;if(v){const d=h(()=>{if(f(),!S.current){const m=Re(v,i);S.current=m,i()}},"handleScroll");return i(),v.addEventListener("scroll",d),()=>v.removeEventListener("scroll",d)}},[l.viewport,f,i]),b.jsx(j.div,{"data-state":a.hasThumb?"visible":"hidden",...o,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...s},onPointerDownCapture:R(e.onPointerDownCapture,v=>{const m=v.target.getBoundingClientRect(),w=v.clientX-m.left,y=v.clientY-m.top;a.onThumbPointerDown({x:w,y})}),onPointerUp:R(e.onPointerUp,a.onThumbPointerUp)})},"ScrollAreaThumbImpl")),oe="ScrollAreaCorner",Pe=c.forwardRef(h(function(e,t){const r=g(oe,e.__scopeScrollArea),s=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&s?b.jsx(Ce,{...e,ref:t}):null},"ScrollAreaCorner")),Ce=c.forwardRef(h(function(e,t){const{__scopeScrollArea:r,...s}=e,o=g(oe,r),[l,a]=c.useState(0),[i,u]=c.useState(0),S=!!(l&&i),{onCornerWidthChange:f,onCornerHeightChange:v}=o;return E(o.scrollbarX,()=>{var m;const d=((m=o.scrollbarX)==null?void 0:m.offsetHeight)||0;o.onCornerHeightChange(d),u(d)}),E(o.scrollbarY,()=>{var m;const d=((m=o.scrollbarY)==null?void 0:m.offsetWidth)||0;o.onCornerWidthChange(d),a(d)}),c.useEffect(()=>()=>{f(0),v(0)},[f,v]),S?b.jsx(j.div,{...s,ref:t,style:{width:l,height:i,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null},"ScrollAreaCornerImpl"));function D(n){return n?parseInt(n,10):0}h(D,"toInt");function q(n,e){const t=n/e;return isNaN(t)?0:t}h(q,"getThumbRatio");function W(n){const e=q(n.viewport,n.content),t=n.scrollbar.paddingStart+n.scrollbar.paddingEnd,r=(n.scrollbar.size-t)*e;return Math.max(r,18)}h(W,"getThumbSize");function te(n,e,t,r="ltr"){const s=W(t),o=s/2,l=e||o,a=s-l,i=t.scrollbar.paddingStart+l,u=t.scrollbar.size-t.scrollbar.paddingEnd-a,S=t.content-t.viewport,f=r==="ltr"?[0,S]:[S*-1,0];return $([i,u],f)(n)}h(te,"getScrollPositionFromPointer");function B(n,e,t="ltr"){const r=W(e),s=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,o=e.scrollbar.size-s,l=e.content-e.viewport,a=o-r,i=t==="ltr"?[0,l]:[l*-1,0],u=ce(n,i);return $([0,l],[0,a])(u)}h(B,"getThumbOffsetFromScroll");function $(n,e){return t=>{if(n[0]===n[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(n[1]-n[0]);return e[0]+r*(t-n[0])}}h($,"linearScale");function G(n,e){return n>0&&n<e}h(G,"isScrollingWithinScrollbarBounds");var Re=h((n,e=()=>{})=>{let t={left:n.scrollLeft,top:n.scrollTop},r=0;return h((function s(){const o={left:n.scrollLeft,top:n.scrollTop},l=t.left!==o.left,a=t.top!==o.top;(l||a)&&e(),t=o,r=window.requestAnimationFrame(s)}),"loop")(),()=>window.cancelAnimationFrame(r)},"addUnlinkedScrollListener");function H(n,e){const t=C(n),r=c.useRef(0);return c.useEffect(()=>()=>window.clearTimeout(r.current),[]),c.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(t,e)},[t,e])}h(H,"useDebounceCallback");function E(n,e){const t=C(e);le(()=>{let r=0;if(n){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(t)});return s.observe(n),()=>{window.cancelAnimationFrame(r),s.unobserve(n)}}},[n,t])}h(E,"useResizeObserver");var Ee=de,Te=fe,ye=Pe;function We({className:n,children:e,viewportRef:t,viewportClassName:r,...s}){return b.jsxs(Ee,{"data-slot":"scroll-area",className:U("relative",n),...s,children:[b.jsx(Te,{ref:t,"data-slot":"scroll-area-viewport",className:U("size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:outline-1 motion-reduce:transition-none!",se,"[&>div]:!block",r),children:e}),b.jsx(_e,{}),b.jsx(ye,{})]})}function _e({className:n,orientation:e="vertical",...t}){return b.jsx(be,{"data-slot":"scroll-area-scrollbar",orientation:e,className:U("flex touch-none p-px transition-colors select-none motion-reduce:transition-none!",e==="vertical"&&"h-full w-2.5 border-l border-l-transparent",e==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",n),...t,children:b.jsx(Ae,{"data-slot":"scroll-area-thumb",className:"bg-dui-border relative flex-1 rounded-full"})})}export{We as S};
1
+ import{r as c,j as b,bl as X,bm as R,bn as T,bo as j,bp as ne,bq as C,br as le,bs as ce,bt as ae,bu as U,bv as se}from"./index-Dc5cpBoO.js";var ie=Object.defineProperty,h=(n,e)=>ie(n,"name",{value:e,configurable:!0});function J(n,e){return c.useReducer((t,r)=>e[t][r]??t,n)}h(J,"useStateMachine");var K="ScrollArea",[Q,je]=ne(K),[ue,g]=Q(K),de=c.forwardRef(h(function(e,t){const{__scopeScrollArea:r,type:s="hover",dir:o,scrollHideDelay:l=600,...a}=e,[i,u]=c.useState(null),[S,f]=c.useState(null),[v,d]=c.useState(null),[m,w]=c.useState(null),[y,Y]=c.useState(null),[P,z]=c.useState(0),[M,I]=c.useState(0),[O,_]=c.useState(!1),[N,L]=c.useState(!1),p=T(t,u),A=ae(o);return b.jsx(ue,{scope:r,type:s,dir:A,scrollHideDelay:l,scrollArea:i,viewport:S,onViewportChange:f,content:v,onContentChange:d,scrollbarX:m,onScrollbarXChange:w,scrollbarXEnabled:O,onScrollbarXEnabledChange:_,scrollbarY:y,onScrollbarYChange:Y,scrollbarYEnabled:N,onScrollbarYEnabledChange:L,onCornerWidthChange:z,onCornerHeightChange:I,children:b.jsx(j.div,{dir:A,...a,ref:p,style:{position:"relative","--radix-scroll-area-corner-width":P+"px","--radix-scroll-area-corner-height":M+"px",...e.style}})})},"ScrollArea")),he="ScrollAreaViewport",fe=c.forwardRef(h(function(e,t){const{__scopeScrollArea:r,children:s,nonce:o,...l}=e,a=g(he,r),i=c.useRef(null),u=T(t,i,a.onViewportChange);return b.jsxs(b.Fragment,{children:[b.jsx(Se,{nonce:o}),b.jsx(j.div,{"data-radix-scroll-area-viewport":"",...l,ref:u,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...e.style},children:b.jsx("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:s})})]})},"ScrollAreaViewport")),Se=c.memo(h(function({nonce:e}){return b.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:e})},"ScrollAreaViewportStyle"),(n,e)=>n.nonce===e.nonce),x="ScrollAreaScrollbar",be=c.forwardRef(h(function(e,t){const{forceMount:r,...s}=e,o=g(x,e.__scopeScrollArea),{onScrollbarXEnabledChange:l,onScrollbarYEnabledChange:a}=o,i=e.orientation==="horizontal";return c.useEffect(()=>(i?l(!0):a(!0),()=>{i?l(!1):a(!1)}),[i,l,a]),o.type==="hover"?b.jsx(me,{...s,ref:t,forceMount:r}):o.type==="scroll"?b.jsx(ve,{...s,ref:t,forceMount:r}):o.type==="auto"?b.jsx(Z,{...s,ref:t,forceMount:r}):o.type==="always"?b.jsx(F,{...s,ref:t,"data-state":"visible"}):null},"ScrollAreaScrollbar")),me=c.forwardRef(h(function(e,t){const{forceMount:r,...s}=e,o=g(x,e.__scopeScrollArea),[l,a]=c.useState(!1);return c.useEffect(()=>{const i=o.scrollArea;let u=0;if(i){const S=h(()=>{window.clearTimeout(u),a(!0)},"handlePointerEnter"),f=h(()=>{u=window.setTimeout(()=>a(!1),o.scrollHideDelay)},"handlePointerLeave");return i.addEventListener("pointerenter",S),i.addEventListener("pointerleave",f),()=>{window.clearTimeout(u),i.removeEventListener("pointerenter",S),i.removeEventListener("pointerleave",f)}}},[o.scrollArea,o.scrollHideDelay]),b.jsx(X,{present:r||l,children:b.jsx(Z,{"data-state":l?"visible":"hidden",...s,ref:t})})},"ScrollAreaScrollbarHover")),ve=c.forwardRef(h(function(e,t){const{forceMount:r,...s}=e,o=g(x,e.__scopeScrollArea),l=e.orientation==="horizontal",a=H(()=>u("SCROLL_END"),100),[i,u]=J("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return c.useEffect(()=>{if(i==="idle"){const S=window.setTimeout(()=>u("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(S)}},[i,o.scrollHideDelay,u]),c.useEffect(()=>{const S=o.viewport,f=l?"scrollLeft":"scrollTop";if(S){let v=S[f];const d=h(()=>{const m=S[f];v!==m&&(u("SCROLL"),a()),v=m},"handleScroll");return S.addEventListener("scroll",d),()=>S.removeEventListener("scroll",d)}},[o.viewport,l,u,a]),b.jsx(X,{present:r||i!=="hidden",children:b.jsx(F,{"data-state":i==="hidden"?"hidden":"visible",...s,ref:t,onPointerEnter:R(e.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:R(e.onPointerLeave,()=>u("POINTER_LEAVE"))})})},"ScrollAreaScrollbarScroll")),Z=c.forwardRef(h(function(e,t){const r=g(x,e.__scopeScrollArea),{forceMount:s,...o}=e,[l,a]=c.useState(!1),i=e.orientation==="horizontal",u=H(()=>{if(r.viewport){const S=r.viewport.offsetWidth<r.viewport.scrollWidth,f=r.viewport.offsetHeight<r.viewport.scrollHeight;a(i?S:f)}},10);return E(r.viewport,u),E(r.content,u),b.jsx(X,{present:s||l,children:b.jsx(F,{"data-state":l?"visible":"hidden",...o,ref:t})})},"ScrollAreaScrollbarAuto")),F=c.forwardRef(h(function(e,t){const{orientation:r="vertical",...s}=e,o=g(x,e.__scopeScrollArea),l=c.useRef(null),a=c.useRef(0),[i,u]=c.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),S=q(i.viewport,i.content),f={...s,sizes:i,onSizesChange:u,hasThumb:S>0&&S<1,onThumbChange:h(d=>l.current=d,"onThumbChange"),onThumbPointerUp:h(()=>a.current=0,"onThumbPointerUp"),onThumbPointerDown:h(d=>a.current=d,"onThumbPointerDown")};function v(d,m){return te(d,a.current,i,m)}return h(v,"getScrollPosition"),r==="horizontal"?b.jsx(pe,{...f,ref:t,onThumbPositionChange:()=>{if(o.viewport&&l.current){const d=o.viewport.scrollLeft,m=B(d,i,o.dir);l.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:d=>{o.viewport&&(o.viewport.scrollLeft=d)},onDragScroll:d=>{o.viewport&&(o.viewport.scrollLeft=v(d,o.dir))}}):r==="vertical"?b.jsx(we,{...f,ref:t,onThumbPositionChange:()=>{if(o.viewport&&l.current){const d=o.viewport.scrollTop,m=B(d,i);l.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:d=>{o.viewport&&(o.viewport.scrollTop=d)},onDragScroll:d=>{o.viewport&&(o.viewport.scrollTop=v(d))}}):null},"ScrollAreaScrollbarVisible")),pe=c.forwardRef(h(function(e,t){const{sizes:r,onSizesChange:s,...o}=e,l=g(x,e.__scopeScrollArea),[a,i]=c.useState(),u=c.useRef(null),S=T(t,u,l.onScrollbarXChange);return c.useEffect(()=>{u.current&&i(getComputedStyle(u.current))},[u]),b.jsx(re,{"data-orientation":"horizontal",...o,ref:S,sizes:r,style:{bottom:0,left:l.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:l.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":W(r)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.x),onDragScroll:f=>e.onDragScroll(f.x),onWheelScroll:(f,v)=>{if(l.viewport){const d=l.viewport.scrollLeft+f.deltaX;e.onWheelScroll(d),G(d,v)&&f.preventDefault()}},onResize:()=>{u.current&&l.viewport&&a&&s({content:l.viewport.scrollWidth,viewport:l.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:D(a.paddingLeft),paddingEnd:D(a.paddingRight)}})}})},"ScrollAreaScrollbarX")),we=c.forwardRef(h(function(e,t){const{sizes:r,onSizesChange:s,...o}=e,l=g(x,e.__scopeScrollArea),[a,i]=c.useState(),u=c.useRef(null),S=T(t,u,l.onScrollbarYChange);return c.useEffect(()=>{u.current&&i(getComputedStyle(u.current))},[u]),b.jsx(re,{"data-orientation":"vertical",...o,ref:S,sizes:r,style:{top:0,right:l.dir==="ltr"?0:void 0,left:l.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":W(r)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.y),onDragScroll:f=>e.onDragScroll(f.y),onWheelScroll:(f,v)=>{if(l.viewport){const d=l.viewport.scrollTop+f.deltaY;e.onWheelScroll(d),G(d,v)&&f.preventDefault()}},onResize:()=>{u.current&&l.viewport&&a&&s({content:l.viewport.scrollHeight,viewport:l.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:D(a.paddingTop),paddingEnd:D(a.paddingBottom)}})}})},"ScrollAreaScrollbarY")),[ge,ee]=Q(x),re=c.forwardRef(h(function(e,t){const{__scopeScrollArea:r,sizes:s,hasThumb:o,onThumbChange:l,onThumbPointerUp:a,onThumbPointerDown:i,onThumbPositionChange:u,onDragScroll:S,onWheelScroll:f,onResize:v,...d}=e,m=g(x,r),[w,y]=c.useState(null),Y=T(t,y),P=c.useRef(null),z=c.useRef(""),M=m.viewport,I=s.content-s.viewport,O=C(f),_=C(u),N=H(v,10);function L(p){if(P.current){const A=p.clientX-P.current.left,V=p.clientY-P.current.top;S({x:A,y:V})}}return h(L,"handleDragScroll"),c.useEffect(()=>{const p=h(A=>{const V=A.target;(w==null?void 0:w.contains(V))&&O(A,I)},"handleWheel");return document.addEventListener("wheel",p,{passive:!1}),()=>document.removeEventListener("wheel",p,{passive:!1})},[M,w,I,O]),c.useEffect(_,[s,_]),E(w,N),E(m.content,N),b.jsx(ge,{scope:r,scrollbar:w,hasThumb:o,onThumbChange:C(l),onThumbPointerUp:C(a),onThumbPositionChange:_,onThumbPointerDown:C(i),children:b.jsx(j.div,{...d,ref:Y,style:{position:"absolute",...d.style},onPointerDown:R(e.onPointerDown,p=>{p.button===0&&(p.target.setPointerCapture(p.pointerId),P.current=w.getBoundingClientRect(),z.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),L(p))}),onPointerMove:R(e.onPointerMove,L),onPointerUp:R(e.onPointerUp,p=>{const A=p.target;A.hasPointerCapture(p.pointerId)&&A.releasePointerCapture(p.pointerId),document.body.style.webkitUserSelect=z.current,m.viewport&&(m.viewport.style.scrollBehavior=""),P.current=null})})})},"ScrollAreaScrollbarImpl")),k="ScrollAreaThumb",Ae=c.forwardRef(h(function(e,t){const{forceMount:r,...s}=e,o=ee(k,e.__scopeScrollArea);return b.jsx(X,{present:r||o.hasThumb,children:b.jsx(xe,{ref:t,...s})})},"ScrollAreaThumb")),xe=c.forwardRef(h(function(e,t){const{__scopeScrollArea:r,style:s,...o}=e,l=g(k,r),a=ee(k,r),{onThumbPositionChange:i}=a,u=T(t,a.onThumbChange),S=c.useRef(void 0),f=H(()=>{S.current&&(S.current(),S.current=void 0)},100);return c.useEffect(()=>{const v=l.viewport;if(v){const d=h(()=>{if(f(),!S.current){const m=Re(v,i);S.current=m,i()}},"handleScroll");return i(),v.addEventListener("scroll",d),()=>v.removeEventListener("scroll",d)}},[l.viewport,f,i]),b.jsx(j.div,{"data-state":a.hasThumb?"visible":"hidden",...o,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...s},onPointerDownCapture:R(e.onPointerDownCapture,v=>{const m=v.target.getBoundingClientRect(),w=v.clientX-m.left,y=v.clientY-m.top;a.onThumbPointerDown({x:w,y})}),onPointerUp:R(e.onPointerUp,a.onThumbPointerUp)})},"ScrollAreaThumbImpl")),oe="ScrollAreaCorner",Pe=c.forwardRef(h(function(e,t){const r=g(oe,e.__scopeScrollArea),s=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&s?b.jsx(Ce,{...e,ref:t}):null},"ScrollAreaCorner")),Ce=c.forwardRef(h(function(e,t){const{__scopeScrollArea:r,...s}=e,o=g(oe,r),[l,a]=c.useState(0),[i,u]=c.useState(0),S=!!(l&&i),{onCornerWidthChange:f,onCornerHeightChange:v}=o;return E(o.scrollbarX,()=>{var m;const d=((m=o.scrollbarX)==null?void 0:m.offsetHeight)||0;o.onCornerHeightChange(d),u(d)}),E(o.scrollbarY,()=>{var m;const d=((m=o.scrollbarY)==null?void 0:m.offsetWidth)||0;o.onCornerWidthChange(d),a(d)}),c.useEffect(()=>()=>{f(0),v(0)},[f,v]),S?b.jsx(j.div,{...s,ref:t,style:{width:l,height:i,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null},"ScrollAreaCornerImpl"));function D(n){return n?parseInt(n,10):0}h(D,"toInt");function q(n,e){const t=n/e;return isNaN(t)?0:t}h(q,"getThumbRatio");function W(n){const e=q(n.viewport,n.content),t=n.scrollbar.paddingStart+n.scrollbar.paddingEnd,r=(n.scrollbar.size-t)*e;return Math.max(r,18)}h(W,"getThumbSize");function te(n,e,t,r="ltr"){const s=W(t),o=s/2,l=e||o,a=s-l,i=t.scrollbar.paddingStart+l,u=t.scrollbar.size-t.scrollbar.paddingEnd-a,S=t.content-t.viewport,f=r==="ltr"?[0,S]:[S*-1,0];return $([i,u],f)(n)}h(te,"getScrollPositionFromPointer");function B(n,e,t="ltr"){const r=W(e),s=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,o=e.scrollbar.size-s,l=e.content-e.viewport,a=o-r,i=t==="ltr"?[0,l]:[l*-1,0],u=ce(n,i);return $([0,l],[0,a])(u)}h(B,"getThumbOffsetFromScroll");function $(n,e){return t=>{if(n[0]===n[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(n[1]-n[0]);return e[0]+r*(t-n[0])}}h($,"linearScale");function G(n,e){return n>0&&n<e}h(G,"isScrollingWithinScrollbarBounds");var Re=h((n,e=()=>{})=>{let t={left:n.scrollLeft,top:n.scrollTop},r=0;return h((function s(){const o={left:n.scrollLeft,top:n.scrollTop},l=t.left!==o.left,a=t.top!==o.top;(l||a)&&e(),t=o,r=window.requestAnimationFrame(s)}),"loop")(),()=>window.cancelAnimationFrame(r)},"addUnlinkedScrollListener");function H(n,e){const t=C(n),r=c.useRef(0);return c.useEffect(()=>()=>window.clearTimeout(r.current),[]),c.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(t,e)},[t,e])}h(H,"useDebounceCallback");function E(n,e){const t=C(e);le(()=>{let r=0;if(n){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(t)});return s.observe(n),()=>{window.cancelAnimationFrame(r),s.unobserve(n)}}},[n,t])}h(E,"useResizeObserver");var Ee=de,Te=fe,ye=Pe;function We({className:n,children:e,viewportRef:t,viewportClassName:r,...s}){return b.jsxs(Ee,{"data-slot":"scroll-area",className:U("relative",n),...s,children:[b.jsx(Te,{ref:t,"data-slot":"scroll-area-viewport",className:U("size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:outline-1 motion-reduce:transition-none!",se,"[&>div]:!block",r),children:e}),b.jsx(_e,{}),b.jsx(ye,{})]})}function _e({className:n,orientation:e="vertical",...t}){return b.jsx(be,{"data-slot":"scroll-area-scrollbar",orientation:e,className:U("flex touch-none p-px transition-colors select-none motion-reduce:transition-none!",e==="vertical"&&"h-full w-2.5 border-l border-l-transparent",e==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",n),...t,children:b.jsx(Ae,{"data-slot":"scroll-area-thumb",className:"bg-dui-border relative flex-1 rounded-full"})})}export{We as S};