@datalayer/agent-runtimes 1.6.98 → 1.6.99

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 (357) hide show
  1. package/dist-embed/chunks/{AgentDetails-CqMfY8zN.js → AgentDetails-Dc-zAfsd.js} +1 -1
  2. package/dist-embed/chunks/{AgentDetailsDialog-lxnKA_dF.js → AgentDetailsDialog-D2ezFFlA.js} +1 -1
  3. package/dist-embed/chunks/{CellSidebarExtension-CrdbRLaE.js → CellSidebarExtension-umk7yQhN.js} +1 -1
  4. package/dist-embed/chunks/ChatView-BDvwDtXF.js +32 -0
  5. package/dist-embed/chunks/{CollapsiblePlugin-CnG1qA1e.js → CollapsiblePlugin-7P9eK3oU.js} +1 -1
  6. package/dist-embed/chunks/{ContextPie-DAZz2yzl.js → ContextPie-DaHEeHxd.js} +1 -1
  7. package/dist-embed/chunks/{DeckComponent-qAMqKLzs.js → DeckComponent-DQ2W1Fj7.js} +1 -1
  8. package/dist-embed/chunks/{DeckRenderer-DQmjQ_vE.js → DeckRenderer-BdATImsV.js} +2 -2
  9. package/dist-embed/chunks/{DeckStage-LDi6nZOg.js → DeckStage-BaIwK7uO.js} +2 -2
  10. package/dist-embed/chunks/{DiagramView-CpCoC99y.js → DiagramView-CUf_ij9A.js} +1 -1
  11. package/dist-embed/chunks/{DocumentView-B-lWAJgm.js → DocumentView-BXE42g3H.js} +1 -1
  12. package/dist-embed/chunks/{DrawingStage-DEeTWKLT.js → DrawingStage-B9AOjEPj.js} +1 -1
  13. package/dist-embed/chunks/{EphemeralDocument-CZNRDs_b.js → EphemeralDocument-BlvZagtH.js} +1 -1
  14. package/dist-embed/chunks/{EphemeralNotebook-BDutT9GQ.js → EphemeralNotebook-gz0sG8Hk.js} +1 -1
  15. package/dist-embed/chunks/{ExcalidrawComponent-CmJy7bb4.js → ExcalidrawComponent-Bc1UIgcH.js} +1 -1
  16. package/dist-embed/chunks/{ExcalidrawModal-D_DmAro7.js → ExcalidrawModal-Cp4Da2nV.js} +1 -1
  17. package/dist-embed/chunks/{FormulaBar-f9U7lupQ.js → FormulaBar-BUs-n7Zc.js} +1 -1
  18. package/dist-embed/chunks/{JupyterLexicalExtension-DpGAnn7v.js → JupyterLexicalExtension-Be8mweC6.js} +9 -9
  19. package/dist-embed/chunks/{KernelVariables-BIWju6rZ.js → KernelVariables-xXzfdk5t.js} +1 -1
  20. package/dist-embed/chunks/{LexicalToolRegistry-BqxU1w4N.js → LexicalToolRegistry-DI_iHg04.js} +1 -1
  21. package/dist-embed/chunks/{NotebookToolSurfaces-CqU9CVCl.js → NotebookToolSurfaces-BmBGWX9x.js} +1 -1
  22. package/dist-embed/chunks/{NotebookView-CpOBHIut.js → NotebookView-D4hr5dD7.js} +1 -1
  23. package/dist-embed/chunks/{Output-DLpf2Of9.js → Output-WQnm0VN5.js} +6 -6
  24. package/dist-embed/chunks/{SandboxDetailsDialog-yUjpxBdw.js → SandboxDetailsDialog-DujTXXdD.js} +1 -1
  25. package/dist-embed/chunks/SchemaForm-CL6wJsI5.js +1 -0
  26. package/dist-embed/chunks/{SheetStage-gUVhALxR.js → SheetStage-BCq1DaET.js} +1 -1
  27. package/dist-embed/chunks/{SheetTabs-sx_-jWyq.js → SheetTabs-BZP7_RGB.js} +1 -1
  28. package/dist-embed/chunks/SignInIcon-D1-wo8qx.js +1 -0
  29. package/dist-embed/chunks/{SpreadsheetPreviewView-C9LaI5mp.js → SpreadsheetPreviewView-D_LLvpPF.js} +1 -1
  30. package/dist-embed/chunks/{SpreadsheetView-FfnOGHeU.js → SpreadsheetView-BT4Rr56c.js} +1 -1
  31. package/dist-embed/chunks/{WidgetVariableView-CKcw-pPX.js → WidgetVariableView-DAz5YxtA.js} +1 -1
  32. package/dist-embed/chunks/{YouTubePlugin-DUDVTb3B.js → YouTubePlugin-DgTStKvk.js} +1 -1
  33. package/dist-embed/chunks/{abnfDiagram-VCTEODGH-BM2pAacI.js → abnfDiagram-VCTEODGH-B5LqqmCZ.js} +1 -1
  34. package/dist-embed/chunks/{abnfDiagram-VCTEODGH-B0MQRzNo.js → abnfDiagram-VCTEODGH-BsJXEg6b.js} +1 -1
  35. package/dist-embed/chunks/{abnfDiagram-VCTEODGH-fcR8gNdJ.js → abnfDiagram-VCTEODGH-DP066SC3.js} +1 -1
  36. package/dist-embed/chunks/{ar-SA-G6X2FPQ2-BfVZMCow.js → ar-SA-G6X2FPQ2-DwPbQVyE.js} +1 -1
  37. package/dist-embed/chunks/{architectureDiagram-5GKGNRK7-CnP0s6uJ.js → architectureDiagram-5GKGNRK7-C7914IyO.js} +1 -1
  38. package/dist-embed/chunks/{architectureDiagram-5GKGNRK7-GZ5981UE.js → architectureDiagram-5GKGNRK7-CAe4xseh.js} +1 -1
  39. package/dist-embed/chunks/{architectureDiagram-5GKGNRK7-Cpu0tfD1.js → architectureDiagram-5GKGNRK7-O1s7O7KE.js} +1 -1
  40. package/dist-embed/chunks/{az-AZ-76LH7QW2-BeD9jzcd.js → az-AZ-76LH7QW2-CnpysEBO.js} +1 -1
  41. package/dist-embed/chunks/{bg-BG-XCXSNQG7-VUraF-a0.js → bg-BG-XCXSNQG7-DJUiP_6F.js} +1 -1
  42. package/dist-embed/chunks/{blockDiagram-868be97b-BK7odeOZ.js → blockDiagram-868be97b-DNJtOmrO.js} +1 -1
  43. package/dist-embed/chunks/{blockDiagram-I7D4REHJ-BMQSOcOL.js → blockDiagram-I7D4REHJ-BDRQoIKI.js} +1 -1
  44. package/dist-embed/chunks/{blockDiagram-I7D4REHJ-CZlh2u1A.js → blockDiagram-I7D4REHJ-BO6TccV1.js} +1 -1
  45. package/dist-embed/chunks/{blockDiagram-I7D4REHJ-DiBWN476.js → blockDiagram-I7D4REHJ-BWNVQ7Gz.js} +1 -1
  46. package/dist-embed/chunks/{bn-BD-2XOGV67Q-DjghL9Ba.js → bn-BD-2XOGV67Q-VQD-Kmco.js} +1 -1
  47. package/dist-embed/chunks/{c4Diagram-3f4bdde3-CMf0cOcM.js → c4Diagram-3f4bdde3-Cj02FLSR.js} +1 -1
  48. package/dist-embed/chunks/{c4Diagram-7LVT6UL2-plU3oizm.js → c4Diagram-7LVT6UL2-BPMcidFW.js} +1 -1
  49. package/dist-embed/chunks/{c4Diagram-7LVT6UL2-BYPUXI1P.js → c4Diagram-7LVT6UL2-CoSh2wjn.js} +1 -1
  50. package/dist-embed/chunks/{c4Diagram-7LVT6UL2-qmYneJtb.js → c4Diagram-7LVT6UL2-yq3lLpw3.js} +1 -1
  51. package/dist-embed/chunks/{ca-ES-6MX7JW3Y-J6FuV-ut.js → ca-ES-6MX7JW3Y-W4esLUmK.js} +1 -1
  52. package/dist-embed/chunks/{celltoolbartracker-0MFBHjtq.js → celltoolbartracker-CxRPC2_P.js} +1 -1
  53. package/dist-embed/chunks/{chunk-2Q5K7J3B-B5DIEbuU.js → chunk-2Q5K7J3B-BM6msVjQ.js} +1 -1
  54. package/dist-embed/chunks/{chunk-2Q5K7J3B-Cj3jAIkT.js → chunk-2Q5K7J3B-ClmjTuJ8.js} +1 -1
  55. package/dist-embed/chunks/{chunk-2Q5K7J3B-BfCPaxeK.js → chunk-2Q5K7J3B-Q4yuTBzL.js} +1 -1
  56. package/dist-embed/chunks/{chunk-5VM5RSS4-DYeTGvz7.js → chunk-5VM5RSS4-BcDuf73d.js} +1 -1
  57. package/dist-embed/chunks/{chunk-5VM5RSS4-g3id5Hpo.js → chunk-5VM5RSS4-daB-wV3g.js} +1 -1
  58. package/dist-embed/chunks/{chunk-5VM5RSS4-BZGDG9GF.js → chunk-5VM5RSS4-g3qUjK0w.js} +1 -1
  59. package/dist-embed/chunks/{chunk-F27PBJKO-DvclqQhV.js → chunk-F27PBJKO-BVFLgw2h.js} +1 -1
  60. package/dist-embed/chunks/{chunk-F27PBJKO-kACIRR-8.js → chunk-F27PBJKO-Bh4vuDL9.js} +1 -1
  61. package/dist-embed/chunks/{chunk-F27PBJKO-S3msebgW.js → chunk-F27PBJKO-CeF8R-xY.js} +1 -1
  62. package/dist-embed/chunks/{chunk-IMKFNOWR-DjIARM3y.js → chunk-IMKFNOWR-D0xfV4fA.js} +1 -1
  63. package/dist-embed/chunks/{chunk-IMKFNOWR-SiS0o9FR.js → chunk-IMKFNOWR-DihmSer8.js} +1 -1
  64. package/dist-embed/chunks/{chunk-IMKFNOWR-Ch7v5XHt.js → chunk-IMKFNOWR-JVdSvsGK.js} +1 -1
  65. package/dist-embed/chunks/{chunk-JWPE2WC7-BwLKeh91.js → chunk-JWPE2WC7-B9R3G9XV.js} +1 -1
  66. package/dist-embed/chunks/{chunk-JWPE2WC7-CVacxpin.js → chunk-JWPE2WC7-R5kOKFCi.js} +1 -1
  67. package/dist-embed/chunks/{chunk-JWPE2WC7-M6oulZhu.js → chunk-JWPE2WC7-xLeWlifS.js} +1 -1
  68. package/dist-embed/chunks/{chunk-POPQ4Y6H-DacAiEUG.js → chunk-POPQ4Y6H-BDTkHmFN.js} +1 -1
  69. package/dist-embed/chunks/{chunk-POPQ4Y6H-BCHaCocF.js → chunk-POPQ4Y6H-BWThom3B.js} +1 -1
  70. package/dist-embed/chunks/{chunk-POPQ4Y6H-DicNgh7k.js → chunk-POPQ4Y6H-DH11l_UL.js} +1 -1
  71. package/dist-embed/chunks/{chunk-SVP7TREG-COLBrDOd.js → chunk-SVP7TREG-B5krxfJG.js} +1 -1
  72. package/dist-embed/chunks/{chunk-SVP7TREG-Cit7UeF2.js → chunk-SVP7TREG-BIf35xVD.js} +1 -1
  73. package/dist-embed/chunks/{chunk-SVP7TREG-3X_ReA6d.js → chunk-SVP7TREG-gPNw7vXg.js} +1 -1
  74. package/dist-embed/chunks/{chunk-TICWLB2K-DfGZ1S46.js → chunk-TICWLB2K-BhQI0S0U.js} +1 -1
  75. package/dist-embed/chunks/{chunk-TICWLB2K-C4D-h9t1.js → chunk-TICWLB2K-BnmW9-rq.js} +1 -1
  76. package/dist-embed/chunks/{chunk-TICWLB2K-TaUeWpZb.js → chunk-TICWLB2K-ZniMXeAW.js} +1 -1
  77. package/dist-embed/chunks/{chunk-XXDRQBXY-Bo_XDdf-.js → chunk-XXDRQBXY-B0pMdS4i.js} +1 -1
  78. package/dist-embed/chunks/{chunk-XXDRQBXY-Bz5lFaJG.js → chunk-XXDRQBXY-CGxfHk6Z.js} +1 -1
  79. package/dist-embed/chunks/{chunk-XXDRQBXY-B6fuzLc9.js → chunk-XXDRQBXY-CTBVYOwD.js} +1 -1
  80. package/dist-embed/chunks/{classDiagram-ZZMXUADV-DDZ5U8jk.js → classDiagram-ZZMXUADV-BVgpaw2k.js} +1 -1
  81. package/dist-embed/chunks/{classDiagram-ZZMXUADV-orzU8a0Z.js → classDiagram-ZZMXUADV-DZ_oaj8W.js} +1 -1
  82. package/dist-embed/chunks/{classDiagram-ZZMXUADV-DpQTfwXC.js → classDiagram-ZZMXUADV-Pn2VInwp.js} +1 -1
  83. package/dist-embed/chunks/{classDiagram-f62afe4f-CNI3U8Mt.js → classDiagram-f62afe4f-CbG4T64Y.js} +1 -1
  84. package/dist-embed/chunks/{classDiagram-v2-604399ef-CLQHn0oB.js → classDiagram-v2-604399ef-BY9qCJgc.js} +1 -1
  85. package/dist-embed/chunks/{classDiagram-v2-VYDZK3BY-DDZ5U8jk.js → classDiagram-v2-VYDZK3BY-BVgpaw2k.js} +1 -1
  86. package/dist-embed/chunks/{classDiagram-v2-VYDZK3BY-orzU8a0Z.js → classDiagram-v2-VYDZK3BY-DZ_oaj8W.js} +1 -1
  87. package/dist-embed/chunks/{classDiagram-v2-VYDZK3BY-DpQTfwXC.js → classDiagram-v2-VYDZK3BY-Pn2VInwp.js} +1 -1
  88. package/dist-embed/chunks/{code-block-IT6T5CEO-DjmCcA6a.js → code-block-IT6T5CEO-BH-xK8dt.js} +1 -1
  89. package/dist-embed/chunks/{component-B62XEB_I.js → component-CHAmQtQO.js} +1 -1
  90. package/dist-embed/chunks/{core-CsMGn5rr.js → core-B-25xtEy.js} +1 -1
  91. package/dist-embed/chunks/{cose-bilkent-JH36ORCC-B_IELYPJ.js → cose-bilkent-JH36ORCC--dQRyne0.js} +1 -1
  92. package/dist-embed/chunks/{cose-bilkent-JH36ORCC-CE9lt3OO.js → cose-bilkent-JH36ORCC-CCswhHys.js} +1 -1
  93. package/dist-embed/chunks/{cose-bilkent-JH36ORCC-CJiHk5L4.js → cose-bilkent-JH36ORCC-CzSbL0t-.js} +1 -1
  94. package/dist-embed/chunks/{createText-aed3d8b3-DTAS6DfQ.js → createText-aed3d8b3-C0l5-4ze.js} +1 -1
  95. package/dist-embed/chunks/{cs-CZ-2BRQDIVT-BJRVSuxc.js → cs-CZ-2BRQDIVT-BRaMX0Yn.js} +1 -1
  96. package/dist-embed/chunks/{cynefinDiagram-5FMLGOSQ-CyHkNAUC.js → cynefinDiagram-5FMLGOSQ-CCuKYj0g.js} +1 -1
  97. package/dist-embed/chunks/{cynefinDiagram-5FMLGOSQ-B2073FgP.js → cynefinDiagram-5FMLGOSQ-Dv0bdW3s.js} +1 -1
  98. package/dist-embed/chunks/{cynefinDiagram-5FMLGOSQ-HsJLw9Ow.js → cynefinDiagram-5FMLGOSQ-ULiO5ngX.js} +1 -1
  99. package/dist-embed/chunks/{da-DK-5WZEPLOC-DmvpQmCz.js → da-DK-5WZEPLOC-CHJSd-hL.js} +1 -1
  100. package/dist-embed/chunks/{dagre-GXQ25YYZ-DzmuuJ_r.js → dagre-GXQ25YYZ-BiEdL9_Y.js} +1 -1
  101. package/dist-embed/chunks/{dagre-GXQ25YYZ-R_lzFrVl.js → dagre-GXQ25YYZ-CQKZfFLy.js} +1 -1
  102. package/dist-embed/chunks/{dagre-GXQ25YYZ-BkxHUUfX.js → dagre-GXQ25YYZ-CbxhqH-l.js} +1 -1
  103. package/dist-embed/chunks/{de-DE-XR44H4JA-aRPZsjh8.js → de-DE-XR44H4JA-CtNUHnP5.js} +1 -1
  104. package/dist-embed/chunks/{diagram-S7CK7UJ4-1KpTTJPB.js → diagram-S7CK7UJ4-4cZ1l0Md.js} +1 -1
  105. package/dist-embed/chunks/{diagram-S7CK7UJ4-BANHWGqU.js → diagram-S7CK7UJ4-BbDaT9be.js} +1 -1
  106. package/dist-embed/chunks/{diagram-S7CK7UJ4-DsEYZOqE.js → diagram-S7CK7UJ4-C_K2XQ68.js} +1 -1
  107. package/dist-embed/chunks/{diagram-UQ7AKVKN-BadWwEqS.js → diagram-UQ7AKVKN-BQGMd5WO.js} +1 -1
  108. package/dist-embed/chunks/{diagram-UQ7AKVKN-B-SbMZjY.js → diagram-UQ7AKVKN-DHkyqRGv.js} +1 -1
  109. package/dist-embed/chunks/{diagram-UQ7AKVKN-E5q5_JWL.js → diagram-UQ7AKVKN-NwCsVCGT.js} +1 -1
  110. package/dist-embed/chunks/{diagram-VSXAHHWV-D_7x_Ody.js → diagram-VSXAHHWV-BOaVUYmv.js} +1 -1
  111. package/dist-embed/chunks/{diagram-VSXAHHWV-BsdL7E17.js → diagram-VSXAHHWV-BRZfKN3x.js} +1 -1
  112. package/dist-embed/chunks/{diagram-VSXAHHWV-B-ZTas3h.js → diagram-VSXAHHWV-C5Iv2HbC.js} +1 -1
  113. package/dist-embed/chunks/{diagram-VX7I27RA-BGyPrgPC.js → diagram-VX7I27RA-BRnBP8ma.js} +1 -1
  114. package/dist-embed/chunks/{diagram-VX7I27RA-C_1S9aIm.js → diagram-VX7I27RA-BYCgrvUs.js} +1 -1
  115. package/dist-embed/chunks/{diagram-VX7I27RA-CNSwTKHP.js → diagram-VX7I27RA-CRBBlvv5.js} +1 -1
  116. package/dist-embed/chunks/{diagram-Z3DM3KII-B5t8N8ZT.js → diagram-Z3DM3KII-B3LW49_k.js} +1 -1
  117. package/dist-embed/chunks/{diagram-Z3DM3KII-C2gtrmQ9.js → diagram-Z3DM3KII-CiCUrtKW.js} +1 -1
  118. package/dist-embed/chunks/{diagram-Z3DM3KII-yVDxeysg.js → diagram-Z3DM3KII-CsjIQRhO.js} +1 -1
  119. package/dist-embed/chunks/dist-BwO-MYZO.js +1 -0
  120. package/dist-embed/chunks/{ebnfDiagram-PWID7BFC-C7dUKFPT.js → ebnfDiagram-PWID7BFC-BaIi5Hrd.js} +1 -1
  121. package/dist-embed/chunks/{ebnfDiagram-PWID7BFC-LCa7gn5F.js → ebnfDiagram-PWID7BFC-CCJeM8Fw.js} +1 -1
  122. package/dist-embed/chunks/{ebnfDiagram-PWID7BFC-BgfF1EZn.js → ebnfDiagram-PWID7BFC-CopkaDiT.js} +1 -1
  123. package/dist-embed/chunks/{edges-b2856ca0-J2ON9YC7.js → edges-b2856ca0-C1lOjQnE.js} +1 -1
  124. package/dist-embed/chunks/{el-GR-BZB4AONW-BBpO4fOL.js → el-GR-BZB4AONW-BdA68ZvY.js} +1 -1
  125. package/dist-embed/chunks/{erDiagram-5d81789a-BM5rHLzM.js → erDiagram-5d81789a-Dj3mpdgC.js} +1 -1
  126. package/dist-embed/chunks/{erDiagram-RLTQ6QDP-CX1vL7D6.js → erDiagram-RLTQ6QDP-BB3sojlA.js} +1 -1
  127. package/dist-embed/chunks/{erDiagram-RLTQ6QDP-C35O3IA_.js → erDiagram-RLTQ6QDP-BtFCDuhD.js} +1 -1
  128. package/dist-embed/chunks/{erDiagram-RLTQ6QDP-BguBlD55.js → erDiagram-RLTQ6QDP-CWSWn-p1.js} +1 -1
  129. package/dist-embed/chunks/{es-ES-U4NZUMDT-CyrQHwAL.js → es-ES-U4NZUMDT-O5foFWNy.js} +1 -1
  130. package/dist-embed/chunks/{esm-BaC41XaP.js → esm-Bx0lRTDo.js} +1 -1
  131. package/dist-embed/chunks/{esm-DNtiNaWu.js → esm-Som5GXlh.js} +1 -1
  132. package/dist-embed/chunks/{eu-ES-A7QVB2H4-BJG9zHud.js → eu-ES-A7QVB2H4-DF43uSd5.js} +1 -1
  133. package/dist-embed/chunks/{fa-IR-HGAKTJCU-BOnLqEaQ.js → fa-IR-HGAKTJCU-CodiokGb.js} +1 -1
  134. package/dist-embed/chunks/{fi-FI-Z5N7JZ37-DdQTDw9O.js → fi-FI-Z5N7JZ37-C5RZVPNW.js} +1 -1
  135. package/dist-embed/chunks/{flowDb-185abca5-CLfj2Qv7.js → flowDb-185abca5-C-wCaq68.js} +1 -1
  136. package/dist-embed/chunks/{flowDiagram-1629c991-DjfIfqQ2.js → flowDiagram-1629c991-B0BqMZGm.js} +1 -1
  137. package/dist-embed/chunks/{flowDiagram-HODETNUW-DEVM2ZrI.js → flowDiagram-HODETNUW-l4GLkuOH.js} +1 -1
  138. package/dist-embed/chunks/{flowDiagram-HODETNUW-Cuv1YfzK.js → flowDiagram-HODETNUW-ncSEoBU5.js} +1 -1
  139. package/dist-embed/chunks/{flowDiagram-HODETNUW-CmpkqsRJ.js → flowDiagram-HODETNUW-uoDrwD7v.js} +1 -1
  140. package/dist-embed/chunks/{flowDiagram-v2-1d953310-4wSPcojK.js → flowDiagram-v2-1d953310-CbX1zFAU.js} +1 -1
  141. package/dist-embed/chunks/{flowchart-elk-definition-6df44142-Cb0xBerO.js → flowchart-elk-definition-6df44142-NO6Qs2xn.js} +1 -1
  142. package/dist-embed/chunks/{fr-FR-RHASNOE6-DQXpQs87.js → fr-FR-RHASNOE6-BecaN4ln.js} +1 -1
  143. package/dist-embed/chunks/{ganttDiagram-3b0b3873-DI6DrFsY.js → ganttDiagram-3b0b3873-DJda4k6s.js} +1 -1
  144. package/dist-embed/chunks/{ganttDiagram-EL5Y4UJY-DdKCj2ex.js → ganttDiagram-EL5Y4UJY-BNMzBAYm.js} +1 -1
  145. package/dist-embed/chunks/{ganttDiagram-EL5Y4UJY-CSmChevD.js → ganttDiagram-EL5Y4UJY-CyZOoQUx.js} +1 -1
  146. package/dist-embed/chunks/{ganttDiagram-EL5Y4UJY-drl1C7t5.js → ganttDiagram-EL5Y4UJY-D0pMMDIC.js} +1 -1
  147. package/dist-embed/chunks/{gitGraphDiagram-WWUBYQGX-gYDVDk5C.js → gitGraphDiagram-WWUBYQGX-BbxTXier.js} +1 -1
  148. package/dist-embed/chunks/{gitGraphDiagram-WWUBYQGX-PLhOfVTI.js → gitGraphDiagram-WWUBYQGX-DtiOT-6M.js} +1 -1
  149. package/dist-embed/chunks/{gitGraphDiagram-WWUBYQGX-Dna0JScG.js → gitGraphDiagram-WWUBYQGX-pM-0eEXc.js} +1 -1
  150. package/dist-embed/chunks/{gitGraphDiagram-f01e8bc2-BmE4UKm_.js → gitGraphDiagram-f01e8bc2-BY4Avza4.js} +1 -1
  151. package/dist-embed/chunks/{gl-ES-HMX3MZ6V-DzfCce3N.js → gl-ES-HMX3MZ6V-v7rlIuX_.js} +1 -1
  152. package/dist-embed/chunks/{he-IL-6SHJWFNN-DRlcBbb7.js → he-IL-6SHJWFNN-CPDVuLW6.js} +1 -1
  153. package/dist-embed/chunks/{hi-IN-IWLTKZ5I-BrerMuM3.js → hi-IN-IWLTKZ5I-cv7JPHhI.js} +1 -1
  154. package/dist-embed/chunks/{hu-HU-A5ZG7DT2-DFTsPGh6.js → hu-HU-A5ZG7DT2-sIqhErzy.js} +1 -1
  155. package/dist-embed/chunks/{id-ID-SAP4L64H-D0pKFdUL.js → id-ID-SAP4L64H-Bih05s5Z.js} +1 -1
  156. package/dist-embed/chunks/{index-9bae90f3-Cc18qrXw.js → index-9bae90f3-B-h6Bmpj.js} +1 -1
  157. package/dist-embed/chunks/{index-46VEGuyz.js → index-B5fl-cx7.js} +2 -2
  158. package/dist-embed/chunks/{index-BQEWUnIX.js → index-B9DnJYjS.js} +1 -1
  159. package/dist-embed/chunks/{index-BzdaTJ02.js → index-BEkzae0W.js} +4 -4
  160. package/dist-embed/chunks/{index-B5W7CVUY.js → index-DE0JwlLw.js} +1 -1
  161. package/dist-embed/chunks/{index-BXY2kJ1z.js → index-Dm-b78og.js} +1 -1
  162. package/dist-embed/chunks/{index-CBWGYoQM.js → index-Dqc2hT2k.js} +1 -1
  163. package/dist-embed/chunks/{index-C-4crJTg.js → index-dBBA442C.js} +4 -4
  164. package/dist-embed/chunks/{index-h8lXpqtD.js → index-npitmnIA.js} +1 -1
  165. package/dist-embed/chunks/{index-CET7bv5d.js → index-qZXZK5qd.js} +1 -1
  166. package/dist-embed/chunks/index.esm-9neflYIr.js +1 -0
  167. package/dist-embed/chunks/{index.esm-fF--io5D.js → index.esm-shCygvgu.js} +1 -1
  168. package/dist-embed/chunks/{infoDiagram-27XIBGKW-DlOi-VkF.js → infoDiagram-27XIBGKW-BQ_FpbVx.js} +1 -1
  169. package/dist-embed/chunks/{infoDiagram-27XIBGKW-BZLQcxTA.js → infoDiagram-27XIBGKW-BekHLcSS.js} +1 -1
  170. package/dist-embed/chunks/{infoDiagram-27XIBGKW-Ir7z7vae.js → infoDiagram-27XIBGKW-CHWrtYbt.js} +1 -1
  171. package/dist-embed/chunks/{infoDiagram-a29d40f1-B_50LXsh.js → infoDiagram-a29d40f1-rAu-MoIO.js} +1 -1
  172. package/dist-embed/chunks/{ishikawaDiagram-5VMMS53U-CmchLGEY.js → ishikawaDiagram-5VMMS53U-Cmb7AWZG.js} +1 -1
  173. package/dist-embed/chunks/{ishikawaDiagram-5VMMS53U-CUxqPwbA.js → ishikawaDiagram-5VMMS53U-Cn4-zUna.js} +1 -1
  174. package/dist-embed/chunks/{ishikawaDiagram-5VMMS53U-Erx01g7S.js → ishikawaDiagram-5VMMS53U-Uk09zgQy.js} +1 -1
  175. package/dist-embed/chunks/{it-IT-JPQ66NNP-CbZLqWAE.js → it-IT-JPQ66NNP-C7yi7ISV.js} +1 -1
  176. package/dist-embed/chunks/{ja-JP-DBVTYXUO-9xZnJjLg.js → ja-JP-DBVTYXUO-DfPIxAGi.js} +1 -1
  177. package/dist-embed/chunks/{journeyDiagram-3NMN7TZE-BRe0KiaN.js → journeyDiagram-3NMN7TZE-BuYQDwkV.js} +1 -1
  178. package/dist-embed/chunks/{journeyDiagram-3NMN7TZE-C9s2og1s.js → journeyDiagram-3NMN7TZE-D86e9Y03.js} +1 -1
  179. package/dist-embed/chunks/{journeyDiagram-3NMN7TZE-B6PqY62p.js → journeyDiagram-3NMN7TZE-DlZ7DnFk.js} +1 -1
  180. package/dist-embed/chunks/{journeyDiagram-95396277-BsoN0fKG.js → journeyDiagram-95396277-C2env92y.js} +1 -1
  181. package/dist-embed/chunks/{kaa-6HZHGXH3-CO2r0Hb-.js → kaa-6HZHGXH3-DtvfFgz6.js} +1 -1
  182. package/dist-embed/chunks/{kab-KAB-ZGHBKWFO-0WoWjCrc.js → kab-KAB-ZGHBKWFO-Cs_P0J-0.js} +1 -1
  183. package/dist-embed/chunks/{kanban-definition-UXKFOSKX-CKIjAYbp.js → kanban-definition-UXKFOSKX-BgGOEpcs.js} +1 -1
  184. package/dist-embed/chunks/{kanban-definition-UXKFOSKX-B6PDcRlF.js → kanban-definition-UXKFOSKX-DBTVO8S2.js} +1 -1
  185. package/dist-embed/chunks/{kanban-definition-UXKFOSKX-BO0-y3yZ.js → kanban-definition-UXKFOSKX-jcrnmXSL.js} +1 -1
  186. package/dist-embed/chunks/{kk-KZ-P5N5QNE5-DFQE1uuw.js → kk-KZ-P5N5QNE5-DX02WIig.js} +1 -1
  187. package/dist-embed/chunks/{km-KH-HSX4SM5Z-D0Bja56Q.js → km-KH-HSX4SM5Z-C4yS0alE.js} +1 -1
  188. package/dist-embed/chunks/{ko-KR-MTYHY66A-C6MeQrMU.js → ko-KR-MTYHY66A-5P-CxGKE.js} +1 -1
  189. package/dist-embed/chunks/{ku-TR-6OUDTVRD-CweepkXr.js → ku-TR-6OUDTVRD-B_CF--jS.js} +1 -1
  190. package/dist-embed/chunks/{layout-Bz98EP0E.js → layout-BzuSIVA6.js} +1 -1
  191. package/dist-embed/chunks/{layout-DPmNjViN.js → layout-DrQTHWcp.js} +1 -1
  192. package/dist-embed/chunks/{layout-mk0FGxVc.js → layout-ke1SehnF.js} +1 -1
  193. package/dist-embed/chunks/{lexicalHooks-Cj3BNPDC.js → lexicalHooks-mjCdxurM.js} +1 -1
  194. package/dist-embed/chunks/{lib-f60SfhfM.js → lib-77hal096.js} +1 -1
  195. package/dist-embed/chunks/{lib-tR3XRdBe.js → lib-BF0qLKx4.js} +1 -1
  196. package/dist-embed/chunks/{lib-0j0dfH8p.js → lib-BHN4er3T.js} +1 -1
  197. package/dist-embed/chunks/{lib-D8Ksfd49.js → lib-BL0Z7ZLN.js} +1 -1
  198. package/dist-embed/chunks/{lib-ku1U2GxE.js → lib-BbQRs6gq.js} +1 -1
  199. package/dist-embed/chunks/{lib-BItrfBU4.js → lib-BqYnt3B4.js} +1 -1
  200. package/dist-embed/chunks/{lib-DCBCbRKN.js → lib-C0IoKYd5.js} +1 -1
  201. package/dist-embed/chunks/{lib-DzVf9ZJD.js → lib-CSLo_71d.js} +1 -1
  202. package/dist-embed/chunks/{lib-CkKgTevD.js → lib-Clh_AUFx.js} +1 -1
  203. package/dist-embed/chunks/{lib-BmoHRaAo.js → lib-Cz1lLXyg.js} +1 -1
  204. package/dist-embed/chunks/{lib-Hgl-pfON.js → lib-DDBKY5pq.js} +1 -1
  205. package/dist-embed/chunks/{lib-B62N3zGB.js → lib-DJP5gvFi.js} +1 -1
  206. package/dist-embed/chunks/{lib-COg_k5cY.js → lib-DMTtt1wk.js} +1 -1
  207. package/dist-embed/chunks/{lib-DpZphKNm.js → lib-Jm05d6GV.js} +1 -1
  208. package/dist-embed/chunks/{lib-w650Gz0V.js → lib-KpC079PC.js} +1 -1
  209. package/dist-embed/chunks/{lib-CjicD0Pj.js → lib-WVhM2LQX.js} +1 -1
  210. package/dist-embed/chunks/{lib-BnAfx9wF.js → lib-_bLHZImL.js} +1 -1
  211. package/dist-embed/chunks/{lib-B01oDNlH.js → lib-jZS8hOW4.js} +1 -1
  212. package/dist-embed/chunks/{lib-CY6QUCzq.js → lib-q3E3Gmmk.js} +1 -1
  213. package/dist-embed/chunks/{lib-C-8NAvI1.js → lib-tF-FByVb.js} +1 -1
  214. package/dist-embed/chunks/{lt-LT-XHIRWOB4-DrPOBOia.js → lt-LT-XHIRWOB4-BDdaHp0_.js} +1 -1
  215. package/dist-embed/chunks/{lv-LV-5QDEKY6T-BlGiDUA0.js → lv-LV-5QDEKY6T-C4eEADZC.js} +1 -1
  216. package/dist-embed/chunks/{mermaid.core-BiF8MSuv.js → mermaid.core-Do9KSWkx.js} +5 -5
  217. package/dist-embed/chunks/{mermaid.core-1p09QPXM.js → mermaid.core-ImjaHcFN.js} +3 -3
  218. package/dist-embed/chunks/{mindmap-definition-YA3MSWOX-CEFrcqEk.js → mindmap-definition-YA3MSWOX-DQ5gBAUm.js} +1 -1
  219. package/dist-embed/chunks/{mindmap-definition-YA3MSWOX-DpAy5heR.js → mindmap-definition-YA3MSWOX-DhjXREA8.js} +1 -1
  220. package/dist-embed/chunks/{mindmap-definition-YA3MSWOX-t1pDKjS3.js → mindmap-definition-YA3MSWOX-DqaQ8KOs.js} +1 -1
  221. package/dist-embed/chunks/{mindmap-definition-e4c1d938-DcepOwKv.js → mindmap-definition-e4c1d938-DoEOORm1.js} +1 -1
  222. package/dist-embed/chunks/{model-jLDiOPpQ.js → model-DUnnBi6P.js} +1 -1
  223. package/dist-embed/chunks/{mr-IN-CRQNXWMA-BWEVprKf.js → mr-IN-CRQNXWMA-BWxvnaHu.js} +1 -1
  224. package/dist-embed/chunks/{my-MM-5M5IBNSE-BBxutJOz.js → my-MM-5M5IBNSE-CLLGJ71z.js} +1 -1
  225. package/dist-embed/chunks/{nb-NO-T6EIAALU-DJnrKa7W.js → nb-NO-T6EIAALU-CXXHz47F.js} +1 -1
  226. package/dist-embed/chunks/{nl-NL-IS3SIHDZ-DQfv4h3e.js → nl-NL-IS3SIHDZ-DgvIFG1o.js} +1 -1
  227. package/dist-embed/chunks/{nn-NO-6E72VCQL-DiGj9RA6.js → nn-NO-6E72VCQL-CF-xs2ZW.js} +1 -1
  228. package/dist-embed/chunks/{oc-FR-POXYY2M6-WJRn50ji.js → oc-FR-POXYY2M6-Blnuf5JR.js} +1 -1
  229. package/dist-embed/chunks/{pa-IN-N4M65BXN-U7QCzNgm.js → pa-IN-N4M65BXN--oZas2yq.js} +1 -1
  230. package/dist-embed/chunks/{pegDiagram-XKGWAZYB-iE6rBtXO.js → pegDiagram-XKGWAZYB-B7vltnXv.js} +1 -1
  231. package/dist-embed/chunks/{pegDiagram-XKGWAZYB-BlYwAwEo.js → pegDiagram-XKGWAZYB-D4e6HBvn.js} +1 -1
  232. package/dist-embed/chunks/{pegDiagram-XKGWAZYB-CudwiD3O.js → pegDiagram-XKGWAZYB-LNTV4YzJ.js} +1 -1
  233. package/dist-embed/chunks/{percentages-BXMCSKIN-DhE6_GLO.js → percentages-BXMCSKIN-MAjQwr8F.js} +5 -5
  234. package/dist-embed/chunks/{pieDiagram-E7YTZNPT-CIawCiDR.js → pieDiagram-E7YTZNPT-BL6tcixN.js} +1 -1
  235. package/dist-embed/chunks/{pieDiagram-E7YTZNPT-Cy6Wueqp.js → pieDiagram-E7YTZNPT-DgV4Cy2T.js} +1 -1
  236. package/dist-embed/chunks/{pieDiagram-E7YTZNPT-DkhDYj7K.js → pieDiagram-E7YTZNPT-a4twxVx-.js} +1 -1
  237. package/dist-embed/chunks/{pieDiagram-c941bede-Ds-rlqjJ.js → pieDiagram-c941bede-C1NXxH3p.js} +1 -1
  238. package/dist-embed/chunks/{pl-PL-T2D74RX3-D5hzyBxL.js → pl-PL-T2D74RX3-CW7khEw8.js} +1 -1
  239. package/dist-embed/chunks/{plugin-BqLEv-U0.js → plugin-U4XZBswA.js} +1 -1
  240. package/dist-embed/chunks/{pt-BR-5N22H2LF-CAs1Vbwd.js → pt-BR-5N22H2LF-CBLbqrvY.js} +1 -1
  241. package/dist-embed/chunks/{pt-PT-UZXXM6DQ-f3BuGnIL.js → pt-PT-UZXXM6DQ-Boh5oA32.js} +1 -1
  242. package/dist-embed/chunks/{quadrantDiagram-AXDQQJYC-1ViFLfLW.js → quadrantDiagram-AXDQQJYC-BTBfnkpT.js} +1 -1
  243. package/dist-embed/chunks/{quadrantDiagram-AXDQQJYC-B30POsrM.js → quadrantDiagram-AXDQQJYC-CXiKbUwz.js} +1 -1
  244. package/dist-embed/chunks/{quadrantDiagram-AXDQQJYC-CqArYUyr.js → quadrantDiagram-AXDQQJYC-Dy9EnqX6.js} +1 -1
  245. package/dist-embed/chunks/{quadrantDiagram-cf8b8fe0-QoN4fcns.js → quadrantDiagram-cf8b8fe0-BmuQ4zSn.js} +1 -1
  246. package/dist-embed/chunks/{railroadDiagram-O6MQD6OU-BelGMNLe.js → railroadDiagram-O6MQD6OU-BZgQtORC.js} +1 -1
  247. package/dist-embed/chunks/{railroadDiagram-O6MQD6OU-nWQg4Zha.js → railroadDiagram-O6MQD6OU-D4ziu6ro.js} +1 -1
  248. package/dist-embed/chunks/{railroadDiagram-O6MQD6OU-BKrSAEIz.js → railroadDiagram-O6MQD6OU-DZJxMT9e.js} +1 -1
  249. package/dist-embed/chunks/{renderer-NdtLW87o.js → renderer-DTpEU9RO.js} +1 -1
  250. package/dist-embed/chunks/{requirementDiagram-53bda41b-DRQpj1S7.js → requirementDiagram-53bda41b-CZFqw_aX.js} +1 -1
  251. package/dist-embed/chunks/{requirementDiagram-BXWQKSXE-C-ZNAzIA.js → requirementDiagram-BXWQKSXE-By8LT77q.js} +1 -1
  252. package/dist-embed/chunks/{requirementDiagram-BXWQKSXE-BsKIaNx-.js → requirementDiagram-BXWQKSXE-Dk3nxAMd.js} +1 -1
  253. package/dist-embed/chunks/{requirementDiagram-BXWQKSXE-Dj_84sJE.js → requirementDiagram-BXWQKSXE-Dx1y_rw2.js} +1 -1
  254. package/dist-embed/chunks/{ro-RO-JPDTUUEW-Ck6Pl6T-.js → ro-RO-JPDTUUEW-QpHkCZjx.js} +1 -1
  255. package/dist-embed/chunks/{ru-RU-B4JR7IUQ-B5ZFvbSm.js → ru-RU-B4JR7IUQ-C8-ztNrr.js} +1 -1
  256. package/dist-embed/chunks/{sankeyDiagram-P5KCCOFB-BwrjNR9f.js → sankeyDiagram-P5KCCOFB-BARe0eo5.js} +1 -1
  257. package/dist-embed/chunks/{sankeyDiagram-P5KCCOFB-DNcJ8lTV.js → sankeyDiagram-P5KCCOFB-D3-EpmdU.js} +1 -1
  258. package/dist-embed/chunks/{sankeyDiagram-P5KCCOFB-CvESkMt0.js → sankeyDiagram-P5KCCOFB-DJG8GtNG.js} +1 -1
  259. package/dist-embed/chunks/{sankeyDiagram-c3ef121a-NSdOSIUQ.js → sankeyDiagram-c3ef121a-DzTFYWVL.js} +1 -1
  260. package/dist-embed/chunks/{sequenceDiagram-82a5b84f-Cxc06-S6.js → sequenceDiagram-82a5b84f-B0hIjr4n.js} +1 -1
  261. package/dist-embed/chunks/{sequenceDiagram-WJ2MYXX4-vrbMF2lh.js → sequenceDiagram-WJ2MYXX4-BcB5M_uE.js} +1 -1
  262. package/dist-embed/chunks/{sequenceDiagram-WJ2MYXX4-DYkcZR01.js → sequenceDiagram-WJ2MYXX4-CggwqzCL.js} +1 -1
  263. package/dist-embed/chunks/{sequenceDiagram-WJ2MYXX4-CdKf7EXa.js → sequenceDiagram-WJ2MYXX4-DD0JtyHN.js} +1 -1
  264. package/dist-embed/chunks/{sheet-BFp5lgzm.js → sheet-BQ9MLxvm.js} +1 -1
  265. package/dist-embed/chunks/{si-LK-N5RQ5JYF-turarKuZ.js → si-LK-N5RQ5JYF-hqqq2gYS.js} +1 -1
  266. package/dist-embed/chunks/{sizeCapture-INFHLROL-B05-5pAF.js → sizeCapture-INFHLROL-BMuUFBVt.js} +1 -1
  267. package/dist-embed/chunks/{sizeCapture-INFHLROL-DBDGASUh.js → sizeCapture-INFHLROL-CpGgMlRe.js} +1 -1
  268. package/dist-embed/chunks/{sizeCapture-INFHLROL-BTK449Mq.js → sizeCapture-INFHLROL-DwbRJ4BV.js} +1 -1
  269. package/dist-embed/chunks/{sk-SK-C5VTKIMK-B61Eejyh.js → sk-SK-C5VTKIMK-Cwov2m-p.js} +1 -1
  270. package/dist-embed/chunks/{sl-SI-NN7IZMDC-Vmd7HFee.js → sl-SI-NN7IZMDC-BRxVCDIe.js} +1 -1
  271. package/dist-embed/chunks/{state-B-9Ja93T.js → state-OwYcN40e.js} +1 -1
  272. package/dist-embed/chunks/{stateDiagram-43e79a5f-BNfT8BMf.js → stateDiagram-43e79a5f-Bu9kA3H-.js} +1 -1
  273. package/dist-embed/chunks/{stateDiagram-D77RDMKH-B4P4foWm.js → stateDiagram-D77RDMKH-CC58EPeY.js} +1 -1
  274. package/dist-embed/chunks/{stateDiagram-D77RDMKH-DGy5pPcJ.js → stateDiagram-D77RDMKH-Cs4wIyOq.js} +1 -1
  275. package/dist-embed/chunks/{stateDiagram-D77RDMKH-cX1LxuDW.js → stateDiagram-D77RDMKH-vD5bWUvd.js} +1 -1
  276. package/dist-embed/chunks/{stateDiagram-v2-2041ed4f-DT_Cb2bL.js → stateDiagram-v2-2041ed4f-Od7A0mbg.js} +1 -1
  277. package/dist-embed/chunks/{stateDiagram-v2-MP3YSRHH-CoF-m0JB.js → stateDiagram-v2-MP3YSRHH-DXfM0lWD.js} +1 -1
  278. package/dist-embed/chunks/{stateDiagram-v2-MP3YSRHH-BSxDwfLM.js → stateDiagram-v2-MP3YSRHH-DwPQ0Ue3.js} +1 -1
  279. package/dist-embed/chunks/{stateDiagram-v2-MP3YSRHH-GuE-uLPq.js → stateDiagram-v2-MP3YSRHH-l7s3F_nn.js} +1 -1
  280. package/dist-embed/chunks/{styles-455b33cd-Cp1Ujuo8.js → styles-455b33cd-Ds_FotAH.js} +1 -1
  281. package/dist-embed/chunks/{styles-f932cba9-CxoS5hwQ.js → styles-f932cba9-D0_uYfjw.js} +1 -1
  282. package/dist-embed/chunks/{styles-fcc2142b-ByLmqETE.js → styles-fcc2142b-Btmp_yd-.js} +1 -1
  283. package/dist-embed/chunks/{subset-shared.chunk-BsVAPxIg.js → subset-shared.chunk-Bwn3uV7D.js} +1 -1
  284. package/dist-embed/chunks/{subset-worker.chunk-BS8PIaQX.js → subset-worker.chunk-sLZsYGAm.js} +1 -1
  285. package/dist-embed/chunks/{substates-CeUNAPt2.js → substates-CRCFGJkO.js} +1 -1
  286. package/dist-embed/chunks/{sv-SE-XGPEYMSR-C9lMr16n.js → sv-SE-XGPEYMSR-CFTcXTPe.js} +1 -1
  287. package/dist-embed/chunks/{svgDrawCommon-148a3cd9-BHhr6lti.js → svgDrawCommon-148a3cd9-BzG9z3G2.js} +1 -1
  288. package/dist-embed/chunks/{swimlanes-42K2YHIH-DQJZa-xA.js → swimlanes-42K2YHIH-CXcSAQkI.js} +1 -1
  289. package/dist-embed/chunks/{swimlanes-42K2YHIH-RHIIyMRW.js → swimlanes-42K2YHIH-CbKvXXpE.js} +1 -1
  290. package/dist-embed/chunks/{swimlanes-42K2YHIH-DKdFBGRm.js → swimlanes-42K2YHIH-Cn91OzZh.js} +1 -1
  291. package/dist-embed/chunks/{swimlanesDiagram-VR7AAH4N-qQpIxgus.js → swimlanesDiagram-VR7AAH4N-BDYem9Qf.js} +1 -1
  292. package/dist-embed/chunks/{swimlanesDiagram-VR7AAH4N-DPhzMK19.js → swimlanesDiagram-VR7AAH4N-C0oAnnos.js} +1 -1
  293. package/dist-embed/chunks/{swimlanesDiagram-VR7AAH4N-rV-EK234.js → swimlanesDiagram-VR7AAH4N-KVXFaw6h.js} +1 -1
  294. package/dist-embed/chunks/{ta-IN-2NMHFXQM-DDvtKbYb.js → ta-IN-2NMHFXQM-DOxRBGkF.js} +1 -1
  295. package/dist-embed/chunks/{th-TH-HPSO5L25-Cuk9i9q1.js → th-TH-HPSO5L25-B66DJGUH.js} +1 -1
  296. package/dist-embed/chunks/{timeline-definition-24CTP7MA-BYQXqujM.js → timeline-definition-24CTP7MA-BdFFNT8A.js} +1 -1
  297. package/dist-embed/chunks/{timeline-definition-24CTP7MA-CNJYLQV3.js → timeline-definition-24CTP7MA-BwHa8bSq.js} +1 -1
  298. package/dist-embed/chunks/{timeline-definition-24CTP7MA-B0VfyyC9.js → timeline-definition-24CTP7MA-pOvrvUiT.js} +1 -1
  299. package/dist-embed/chunks/{timeline-definition-7545f45a-B6u65RjP.js → timeline-definition-7545f45a-mktOQHwE.js} +1 -1
  300. package/dist-embed/chunks/{tr-TR-DEFEU3FU-Dt5AbXXF.js → tr-TR-DEFEU3FU-4T2eEq6g.js} +1 -1
  301. package/dist-embed/chunks/{uk-UA-QMV73CPH-CqxkvO2g.js → uk-UA-QMV73CPH-DzInGHdV.js} +1 -1
  302. package/dist-embed/chunks/{vennDiagram-4TSXK5OY-ERcpoENM.js → vennDiagram-4TSXK5OY-DgP7uC-E.js} +1 -1
  303. package/dist-embed/chunks/{vennDiagram-4TSXK5OY-8GPjZ_rY.js → vennDiagram-4TSXK5OY-DpQuXqxB.js} +1 -1
  304. package/dist-embed/chunks/{vennDiagram-4TSXK5OY-BC0uMGWS.js → vennDiagram-4TSXK5OY-DxCQybxm.js} +1 -1
  305. package/dist-embed/chunks/{vi-VN-M7AON7JQ-CZtlZzss.js → vi-VN-M7AON7JQ-DqvR1smN.js} +1 -1
  306. package/dist-embed/chunks/{wardleyDiagram-VM6X3IG4-DMJNYu8Y.js → wardleyDiagram-VM6X3IG4-1jMcvi60.js} +1 -1
  307. package/dist-embed/chunks/{wardleyDiagram-VM6X3IG4-Bubuc1xO.js → wardleyDiagram-VM6X3IG4-Dyv0LxbD.js} +1 -1
  308. package/dist-embed/chunks/{wardleyDiagram-VM6X3IG4-DdRbpzRB.js → wardleyDiagram-VM6X3IG4-MyP5nqZ4.js} +1 -1
  309. package/dist-embed/chunks/workbook-5qhwFc45.js +1 -0
  310. package/dist-embed/chunks/{write-D-y9_9sL.js → write-DKnalcKH.js} +1 -1
  311. package/dist-embed/chunks/{xychartDiagram-3f383b91-CEkYRds9.js → xychartDiagram-3f383b91-CH6jxwtm.js} +1 -1
  312. package/dist-embed/chunks/{xychartDiagram-S5SC5T6Z-iG96dorC.js → xychartDiagram-S5SC5T6Z-CepDAfxw.js} +1 -1
  313. package/dist-embed/chunks/{xychartDiagram-S5SC5T6Z-DKWKSC-B.js → xychartDiagram-S5SC5T6Z-FNQJ78h8.js} +1 -1
  314. package/dist-embed/chunks/{xychartDiagram-S5SC5T6Z-C0WCXM2P.js → xychartDiagram-S5SC5T6Z-euDlXTya.js} +1 -1
  315. package/dist-embed/chunks/{zh-CN-LNUGB5OW-6_SDF9o2.js → zh-CN-LNUGB5OW-iQ1ZrxBq.js} +1 -1
  316. package/dist-embed/chunks/{zh-HK-E62DVLB3-em8dd9Nl.js → zh-HK-E62DVLB3-BjSHLy4a.js} +1 -1
  317. package/dist-embed/chunks/{zh-TW-RAJ6MFWO-BCzbAoXj.js → zh-TW-RAJ6MFWO-CqMWwcSn.js} +1 -1
  318. package/dist-embed/datalayer-app-main.js +62 -62
  319. package/lib/apps/agentUiPlugins.d.ts +7 -0
  320. package/lib/apps/agentUiPlugins.js +20 -0
  321. package/lib/apps/apps/AppRenderer.d.ts +1 -1
  322. package/lib/apps/apps/AppRenderer.js +22 -13
  323. package/lib/apps/core/index.d.ts +7 -0
  324. package/lib/apps/core/index.js +7 -0
  325. package/lib/apps/embed/AppEmbed.d.ts +3 -3
  326. package/lib/apps/embed/LoopEmbed.js +2 -0
  327. package/lib/apps/embed/embedConfig.d.ts +1 -1
  328. package/lib/apps/embed/embedConfig.js +1 -1
  329. package/lib/apps/plugins/chat/ChatView.js +11 -5
  330. package/lib/apps/plugins/chat/index.d.ts +6 -5
  331. package/lib/apps/plugins/limited-preview/LimitedPreviewIndicator.d.ts +31 -0
  332. package/lib/apps/plugins/limited-preview/LimitedPreviewIndicator.js +70 -0
  333. package/lib/apps/plugins/limited-preview/index.d.ts +37 -0
  334. package/lib/apps/plugins/limited-preview/index.js +53 -0
  335. package/lib/apps/plugins/limited-preview/preview.d.ts +101 -0
  336. package/lib/apps/plugins/limited-preview/preview.js +188 -0
  337. package/lib/apps/presets.d.ts +16 -0
  338. package/lib/apps/presets.js +18 -1
  339. package/lib/chat/anonymous/AnonymousChat.d.ts +8 -19
  340. package/lib/chat/anonymous/AnonymousChat.js +11 -43
  341. package/lib/chat/anonymous/anonymousMode.d.ts +8 -13
  342. package/lib/chat/anonymous/anonymousMode.js +0 -6
  343. package/lib/chat/index.d.ts +1 -1
  344. package/lib/chat/index.js +1 -1
  345. package/lib/chat/prompt/InputPrompt.d.ts +8 -1
  346. package/lib/chat/prompt/InputPrompt.js +8 -3
  347. package/lib/chat/prompt/stack.d.ts +9 -0
  348. package/lib/chat/prompt/stack.js +8 -4
  349. package/lib/specs/apps.js +0 -40
  350. package/package.json +1 -1
  351. package/scripts/codegen/generate_apps.py +4 -1
  352. package/dist-embed/chunks/ChatView-B9oVgZ72.js +0 -32
  353. package/dist-embed/chunks/SchemaForm-N0hu4z_p.js +0 -1
  354. package/dist-embed/chunks/SignInIcon-XIbntAUw.js +0 -1
  355. package/dist-embed/chunks/dist-BOLa5oLF.js +0 -1
  356. package/dist-embed/chunks/index.esm-DwyYEnhk.js +0 -1
  357. package/dist-embed/chunks/workbook-BQLbQvZ-.js +0 -1
@@ -1,4 +1,4 @@
1
- import{J as te,r as z,j as e,B as n,H as F,dG as ae,T as i,v as L,a5 as De,a2 as le,fx as He,fy as Ge,fz as me,fA as Pe,fB as qe,fC as Be,fD as Ke,fE as Je,fF as Ye,fG as V,Y as ce,bJ as Xe,dF as Qe,L as A,bh as Ze,fH as et,fI as tt,fJ as nt,fK as de,fL as Oe,dE as st,fM as ot,fN as it,dC as rt,I as Me,fn as lt,fO as at,fP as ct,fQ as dt,fR as ut,fS as ft,fT as pt,fU as ht,fV as gt,fW as xt,fX as mt,fY as ne,fZ as se,dD as bt,f_ as yt}from"../datalayer-app-main.js";import{A as Ie}from"./ArrowLeftIcon-sX3iNMG1.js";import{A as jt,T as St,M as We,U as $e,F as wt}from"./UnlinkIcon-fXwOyjzQ.js";import Te from"./esm-DNtiNaWu.js";import{P as Ne}from"./index-Cz10oMGc.js";import{A as kt}from"./Avatar-B0TcOj_b.js";import"./core-CsMGn5rr.js";function vt(t,s){if(Object.is(t,s))return!0;if(typeof t!="object"||t===null||typeof s!="object"||s===null)return!1;if(t instanceof Map&&s instanceof Map){if(t.size!==s.size)return!1;for(const[l,o]of t)if(!Object.is(o,s.get(l)))return!1;return!0}if(t instanceof Set&&s instanceof Set){if(t.size!==s.size)return!1;for(const l of t)if(!s.has(l))return!1;return!0}const r=Object.keys(t);if(r.length!==Object.keys(s).length)return!1;for(const l of r)if(!Object.prototype.hasOwnProperty.call(s,l)||!Object.is(t[l],s[l]))return!1;return!0}const{useRef:zt}=te;function Le(t){const s=zt();return r=>{const l=t(r);return vt(s.current,l)?s.current:s.current=l}}function D(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}K`:t.toString()}function Ae(t){if(!Number.isFinite(t)||Number.isNaN(t)||t<0)return"0ms";if(t<1)return`${Math.max(0,Math.round(t*1e3))}ms`;if(t<60)return`${t.toFixed(1)}s`;const s=Math.floor(t/60),r=Math.round(t%60);return`${s}m ${r}s`}function Ct(t){const s=String(t??"");return/[",\n]/.test(s)?`"${s.replace(/"/g,'""')}"`:s}function It(t){const s=[];s.push(["Context Usage Snapshot for Agent",t.agentId]),s.push(["Generated At",new Date().toISOString()]),s.push([]),s.push(["Summary"]),s.push(["Total Tokens",t.totalTokens]),s.push(["Context Window",t.contextWindow]),s.push(["System Prompt Tokens",t.systemPromptTokens]),s.push(["Tool Tokens",t.toolTokens]),s.push(["History Tokens",t.historyTokens]),s.push(["Current Message Tokens",t.currentMessageTokens]),s.push(["User Message Tokens",t.userMessageTokens]),s.push(["Assistant Message Tokens",t.assistantMessageTokens]),s.push([]),t.sessionUsage&&(s.push(["Session Usage"]),s.push(["Input Tokens",t.sessionUsage.inputTokens]),s.push(["Output Tokens",t.sessionUsage.outputTokens]),s.push(["Requests",t.sessionUsage.requests]),s.push(["Tool Calls",t.sessionUsage.toolCalls]),s.push(["Turns",t.sessionUsage.turns]),s.push(["Duration Seconds",t.sessionUsage.durationSeconds]),s.push([])),t.turnUsage&&(s.push(["Last Turn Usage"]),s.push(["Input Tokens",t.turnUsage.inputTokens]),s.push(["Output Tokens",t.turnUsage.outputTokens]),s.push(["Requests",t.turnUsage.requests]),s.push(["Tool Calls",t.turnUsage.toolCalls]),s.push(["Duration Seconds",t.turnUsage.durationSeconds]),s.push([])),s.push(["Distribution"]),s.push(["Category","Tokens"]);for(const c of t.distribution?.children??[])s.push([c.name,c.value]);if(s.push([]),t.perRequestUsage.length>0){s.push(["Per Request Usage"]),s.push(["Request #","Input Tokens","Output Tokens","Duration Ms","Tool Names","Timestamp","Turn ID"]);for(const c of t.perRequestUsage)s.push([c.requestNum,c.inputTokens,c.outputTokens,c.durationMs,c.toolNames.join("; "),c.timestamp??"",c.turnId??""])}const r=s.map(c=>c.map(Ct).join(",")).join(`
1
+ import{J as te,r as z,j as e,B as n,H as F,dG as ae,T as i,v as L,a5 as De,a2 as le,fx as He,fy as Ge,fz as me,fA as Pe,fB as qe,fC as Be,fD as Ke,fE as Je,fF as Ye,fG as V,Y as ce,bJ as Xe,dF as Qe,L as A,bh as Ze,fH as et,fI as tt,fJ as nt,fK as de,fL as Oe,dE as st,fM as ot,fN as it,dC as rt,I as Me,fn as lt,fO as at,fP as ct,fQ as dt,fR as ut,fS as ft,fT as pt,fU as ht,fV as gt,fW as xt,fX as mt,fY as ne,fZ as se,dD as bt,f_ as yt}from"../datalayer-app-main.js";import{A as Ie}from"./ArrowLeftIcon-sX3iNMG1.js";import{A as jt,T as St,M as We,U as $e,F as wt}from"./UnlinkIcon-fXwOyjzQ.js";import Te from"./esm-Som5GXlh.js";import{P as Ne}from"./index-Cz10oMGc.js";import{A as kt}from"./Avatar-B0TcOj_b.js";import"./core-B-25xtEy.js";function vt(t,s){if(Object.is(t,s))return!0;if(typeof t!="object"||t===null||typeof s!="object"||s===null)return!1;if(t instanceof Map&&s instanceof Map){if(t.size!==s.size)return!1;for(const[l,o]of t)if(!Object.is(o,s.get(l)))return!1;return!0}if(t instanceof Set&&s instanceof Set){if(t.size!==s.size)return!1;for(const l of t)if(!s.has(l))return!1;return!0}const r=Object.keys(t);if(r.length!==Object.keys(s).length)return!1;for(const l of r)if(!Object.prototype.hasOwnProperty.call(s,l)||!Object.is(t[l],s[l]))return!1;return!0}const{useRef:zt}=te;function Le(t){const s=zt();return r=>{const l=t(r);return vt(s.current,l)?s.current:s.current=l}}function D(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}K`:t.toString()}function Ae(t){if(!Number.isFinite(t)||Number.isNaN(t)||t<0)return"0ms";if(t<1)return`${Math.max(0,Math.round(t*1e3))}ms`;if(t<60)return`${t.toFixed(1)}s`;const s=Math.floor(t/60),r=Math.round(t%60);return`${s}m ${r}s`}function Ct(t){const s=String(t??"");return/[",\n]/.test(s)?`"${s.replace(/"/g,'""')}"`:s}function It(t){const s=[];s.push(["Context Usage Snapshot for Agent",t.agentId]),s.push(["Generated At",new Date().toISOString()]),s.push([]),s.push(["Summary"]),s.push(["Total Tokens",t.totalTokens]),s.push(["Context Window",t.contextWindow]),s.push(["System Prompt Tokens",t.systemPromptTokens]),s.push(["Tool Tokens",t.toolTokens]),s.push(["History Tokens",t.historyTokens]),s.push(["Current Message Tokens",t.currentMessageTokens]),s.push(["User Message Tokens",t.userMessageTokens]),s.push(["Assistant Message Tokens",t.assistantMessageTokens]),s.push([]),t.sessionUsage&&(s.push(["Session Usage"]),s.push(["Input Tokens",t.sessionUsage.inputTokens]),s.push(["Output Tokens",t.sessionUsage.outputTokens]),s.push(["Requests",t.sessionUsage.requests]),s.push(["Tool Calls",t.sessionUsage.toolCalls]),s.push(["Turns",t.sessionUsage.turns]),s.push(["Duration Seconds",t.sessionUsage.durationSeconds]),s.push([])),t.turnUsage&&(s.push(["Last Turn Usage"]),s.push(["Input Tokens",t.turnUsage.inputTokens]),s.push(["Output Tokens",t.turnUsage.outputTokens]),s.push(["Requests",t.turnUsage.requests]),s.push(["Tool Calls",t.turnUsage.toolCalls]),s.push(["Duration Seconds",t.turnUsage.durationSeconds]),s.push([])),s.push(["Distribution"]),s.push(["Category","Tokens"]);for(const c of t.distribution?.children??[])s.push([c.name,c.value]);if(s.push([]),t.perRequestUsage.length>0){s.push(["Per Request Usage"]),s.push(["Request #","Input Tokens","Output Tokens","Duration Ms","Tool Names","Timestamp","Turn ID"]);for(const c of t.perRequestUsage)s.push([c.requestNum,c.inputTokens,c.outputTokens,c.durationMs,c.toolNames.join("; "),c.timestamp??"",c.turnId??""])}const r=s.map(c=>c.map(Ct).join(",")).join(`
2
2
  `),l=new Blob([r],{type:"text/csv;charset=utf-8;"}),o=URL.createObjectURL(l),a=document.createElement("a");a.href=o;const d=new Date().toISOString().replace(/[:.]/g,"-");a.download=`context-usage-${t.agentId}-${d}.csv`,a.style.display="none",document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(o)}function Tt(t){switch(t.toLowerCase()){case"messages":case"history":return Ke;case"tools":case"tool definitions":return Be;case"system":case"system prompts":return qe;case"cache":return Pe;default:return me}}function At({agentId:t,apiBase:s,liveData:r,messageCount:l=0,defaultView:o="overview",chartHeight:a="200px"}){const[d,c]=z.useState(o),[h,f]=z.useState(!1),S=r!==void 0,u=r,b=!S,m=z.useMemo(()=>{if(!u?.perRequestUsage||u.perRequestUsage.length===0)return null;const g=u.perRequestUsage;let C=0,N=0;const q=[],M=[],w=[],X=[];return g.forEach(W=>{C+=W.inputTokens,N+=W.outputTokens,q.push(`#${W.requestNum}`),M.push(C),w.push(N),X.push(C+N)}),{tooltip:{trigger:"axis",formatter:W=>{let U=`<strong>${W[0]?.axisValue||""}</strong><br/>`;return W.forEach($=>{U+=`${$.marker} ${$.seriesName}: ${D($.value)}<br/>`}),U}},legend:{data:["Input","Output","Total"],bottom:0,textStyle:{fontSize:10}},grid:{left:45,right:15,top:10,bottom:35},xAxis:{type:"category",data:q,axisLabel:{fontSize:10}},yAxis:{type:"value",axisLabel:{fontSize:10,formatter:W=>D(W)}},series:[{name:"Input",type:"line",data:M,smooth:!0,lineStyle:{width:2},areaStyle:{opacity:.2},itemStyle:{color:"#3B82F6"}},{name:"Output",type:"line",data:w,smooth:!0,lineStyle:{width:2},areaStyle:{opacity:.2},itemStyle:{color:"#10B981"}},{name:"Total",type:"line",data:X,smooth:!0,lineStyle:{width:2,type:"dashed"},itemStyle:{color:"#8B5CF6"}}]}},[u?.perRequestUsage]),R=z.useMemo(()=>{if(!u?.distribution)return null;const{distribution:g}=u,C=g.children&&g.children.length>0;return{tooltip:{formatter:N=>`${N.name}: ${D(N.value)} tokens`},series:[{type:"treemap",data:C?g.children:[{name:"No data",value:1}],roam:!1,breadcrumb:{show:!1},label:{show:!0,formatter:"{b}",fontSize:11},itemStyle:{borderColor:"#fff",borderWidth:2},levels:[{itemStyle:{borderColor:"#777",borderWidth:0,gapWidth:1}},{itemStyle:{borderColor:"#555",borderWidth:5,gapWidth:1},colorSaturation:[.35,.5]},{colorSaturation:[.35,.5]}]}]}},[u?.distribution]);if(b)return e.jsxs(n,{children:[e.jsx(F,{as:"h4",sx:{fontSize:1,fontWeight:"semibold",mb:2,color:"fg.muted"},children:"Context Usage"}),e.jsxs(n,{p:3,bg:"canvas.subtle",borderRadius:2,border:"1px solid",borderColor:"border.default",display:"flex",alignItems:"center",gap:2,children:[e.jsx(ae,{size:"small"}),e.jsx(i,{sx:{fontSize:1,color:"fg.muted"},children:"Loading context details..."})]})]});if(!u)return e.jsxs(n,{children:[e.jsx(F,{as:"h4",sx:{fontSize:1,fontWeight:"semibold",mb:2,color:"fg.muted"},children:"Context Usage"}),e.jsx(n,{p:3,bg:"attention.subtle",borderRadius:2,border:"1px solid",borderColor:"attention.muted",children:e.jsx(i,{sx:{fontSize:1,color:"attention.fg"},children:"Waiting for context data from WebSocket stream..."})})]});const{totalTokens:P,contextWindow:y,sessionUsage:p,turnUsage:j,distribution:E}=u,I=l>0?l:Math.max(p?.turns??0,u.perRequestUsage?.length>0?1:0),O=E?.children&&E.children.length>0;return e.jsxs(n,{children:[e.jsxs(n,{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2,children:[e.jsx(F,{as:"h4",sx:{fontSize:1,fontWeight:"semibold",color:"fg.muted"},children:"Context Usage"}),e.jsxs(n,{display:"flex",alignItems:"center",gap:2,children:[I>0&&e.jsxs(i,{sx:{fontSize:0,color:"fg.muted"},children:[I," ",I===1?"message sent":"messages sent"]}),e.jsx(L,{size:"small",variant:"invisible",leadingVisual:De,onClick:()=>It(u),children:"Download"})]})]}),e.jsxs(n,{p:3,bg:"canvas.subtle",borderRadius:2,border:"1px solid",borderColor:"border.default",children:[e.jsx(n,{mb:3,children:e.jsxs(i,{sx:{fontSize:1,fontWeight:"semibold"},children:["Total usage: ",D(P)]})}),(p||j)&&e.jsxs(n,{display:"flex",gap:3,mb:3,flexWrap:"wrap",children:[p&&e.jsxs(n,{flex:1,minWidth:120,p:2,bg:"canvas.default",borderRadius:2,border:"1px solid",borderColor:"border.muted",children:[e.jsxs(i,{sx:{fontSize:0,color:"fg.muted",display:"block"},children:["Session (",p.turns," turns)"]}),e.jsx(i,{sx:{fontSize:1,fontWeight:"semibold"},children:D(p.inputTokens+p.outputTokens)}),e.jsxs(i,{sx:{fontSize:0,color:"fg.muted"},children:[" ","in ",Ae(p.durationSeconds)]})]}),j&&e.jsxs(n,{flex:1,minWidth:120,p:2,bg:"canvas.default",borderRadius:2,border:"1px solid",borderColor:"border.muted",children:[e.jsxs(i,{sx:{fontSize:0,color:"fg.muted",display:"block"},children:["Last Turn (",j.requests," reqs)"]}),e.jsx(i,{sx:{fontSize:1,fontWeight:"semibold"},children:D(j.inputTokens+j.outputTokens)}),e.jsxs(i,{sx:{fontSize:0,color:"fg.muted"},children:[" ","in ",Ae(j.durationSeconds)]})]})]}),e.jsxs(n,{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2,children:[e.jsxs(le,{"aria-label":"View mode",size:"small",onChange:g=>{c(["overview","distribution","history"][g])},children:[e.jsx(le.IconButton,{"aria-label":"Overview",selected:d==="overview",icon:He}),e.jsx(le.IconButton,{"aria-label":"Distribution",selected:d==="distribution",icon:jt,disabled:!O}),e.jsx(le.IconButton,{"aria-label":"History",selected:d==="history",icon:Ge})]}),d==="overview"&&e.jsx(L,{size:"small",variant:"invisible",onClick:()=>f(!h),children:h?"Less":"More"})]}),d==="overview"&&e.jsxs(n,{children:[e.jsxs(n,{display:"flex",flexDirection:"column",gap:2,children:[O&&E.children.map(g=>{const C=Tt(g.name),N=g.value/y*100;return e.jsxs(n,{display:"flex",alignItems:"center",gap:2,children:[e.jsx(n,{color:"fg.muted",width:20,children:e.jsx(C,{size:16})}),e.jsx(i,{sx:{fontSize:1,flex:1},children:g.name}),e.jsx(i,{sx:{fontSize:0,color:"fg.muted",minWidth:60},children:D(g.value)}),e.jsx(n,{width:80,children:e.jsx(Ne,{progress:N,sx:{height:4}})})]},g.name)}),!O&&e.jsx(i,{sx:{color:"fg.muted",fontSize:1,textAlign:"center",py:2},children:"No context data yet. Start a conversation to see usage."})]}),h&&O&&e.jsxs(n,{mt:3,p:2,bg:"canvas.default",borderRadius:2,border:"1px solid",borderColor:"border.muted",fontSize:0,children:[u.systemPromptTokens>0&&e.jsxs(n,{mb:2,children:[e.jsxs(i,{sx:{fontWeight:"semibold"},children:["System Prompts:"," ",D(u.systemPromptTokens)," tokens"]}),u.systemPrompts.slice(0,2).map((g,C)=>e.jsxs(i,{sx:{display:"block",ml:2,mt:1,color:"fg.muted"},children:["•"," ",g.length>80?g.slice(0,80)+"...":g]},C))]}),u.toolTokens>0&&e.jsxs(n,{mb:2,children:[e.jsxs(i,{sx:{fontWeight:"semibold"},children:["Tools: ",D(u.toolTokens)," tokens (",u.tools.length," tools)"]}),e.jsxs(n,{ml:2,mt:1,children:[u.tools.slice(0,4).map((g,C)=>e.jsxs(i,{sx:{display:"block",color:"fg.muted"},children:["• ",g.name,": ",D(g.totalTokens)]},C)),u.tools.length>4&&e.jsxs(i,{sx:{color:"fg.muted",fontStyle:"italic"},children:["...and ",u.tools.length-4," more"]})]})]}),(u.userMessageTokens>0||u.assistantMessageTokens>0)&&e.jsxs(n,{mb:2,children:[e.jsxs(i,{sx:{fontWeight:"semibold"},children:["Messages:"," ",D(u.userMessageTokens+u.assistantMessageTokens)," ","tokens"]}),e.jsxs(n,{ml:2,mt:1,children:[e.jsxs(i,{sx:{display:"block",color:"fg.muted"},children:["• User: ",D(u.userMessageTokens)]}),e.jsxs(i,{sx:{display:"block",color:"fg.muted"},children:["• Assistant:"," ",D(u.assistantMessageTokens)]}),u.toolCallTokens>0&&e.jsxs(i,{sx:{display:"block",color:"fg.muted"},children:["• Tool calls:"," ",D(u.toolCallTokens)]})]})]})]})]}),d==="distribution"&&R&&e.jsx(Te,{option:R,style:{height:a},opts:{renderer:"svg"}}),d==="history"&&m&&e.jsxs(n,{children:[e.jsx(Te,{option:m,style:{height:a},opts:{renderer:"svg"}}),h&&u.perRequestUsage.length>0&&e.jsx(n,{mt:2,maxHeight:"150px",overflowY:"auto",fontSize:0,children:u.perRequestUsage.slice(-10).reverse().map((g,C)=>e.jsxs(n,{display:"flex",gap:2,py:1,borderBottom:C<9?"1px solid":"none",borderColor:"border.muted",children:[e.jsxs(i,{sx:{fontWeight:"semibold",minWidth:30},children:["#",g.requestNum]}),e.jsxs(i,{sx:{color:"#3B82F6"},children:["↓",D(g.inputTokens)]}),e.jsxs(i,{sx:{color:"#10B981"},children:["↑",D(g.outputTokens)]}),g.toolNames.length>0&&e.jsxs(i,{sx:{color:"fg.muted"},children:["🔧 ",g.toolNames.join(", ")]})]},g.requestNum))})]}),d==="history"&&!m&&e.jsx(n,{py:3,children:e.jsx(i,{sx:{color:"fg.muted",fontSize:1},children:"No history"})})]})]})}function G(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}K`:t.toString()}function ee({title:t,icon:s,count:r,tokens:l,defaultExpanded:o=!1,children:a}){const[d,c]=z.useState(o);return e.jsxs(n,{mb:2,children:[e.jsxs(n,{as:"button",onClick:()=>c(!d),display:"flex",alignItems:"center",gap:2,width:"100%",p:2,bg:"canvas.subtle",border:"1px solid",borderColor:"border.default",borderRadius:2,cursor:"pointer",hover:{bg:"canvas.inset"},children:[d?e.jsx(Xe,{size:16}):e.jsx(Qe,{size:16}),te.createElement(s,{size:16}),e.jsx(i,{sx:{fontWeight:"semibold",flex:1,textAlign:"left"},children:t}),r!==void 0&&e.jsx(A,{variant:"secondary",size:"small",children:r}),l!==void 0&&l>0&&e.jsxs(i,{sx:{fontSize:0,color:"fg.muted"},children:[G(l)," tokens"]})]}),d&&e.jsx(n,{border:"1px solid",borderColor:"border.default",borderTop:"none",borderRadius:"0 0 6px 6px",p:2,children:a})]})}function Et({tool:t}){const[s,r]=z.useState(!1),[l,o]=z.useState(!1);return e.jsxs(n,{p:2,mb:2,bg:"canvas.default",border:"1px solid",borderColor:"border.muted",borderRadius:2,children:[e.jsxs(n,{display:"flex",alignItems:"center",gap:2,mb:1,children:[e.jsx(i,{sx:{fontWeight:"bold",fontFamily:"mono",fontSize:1},children:t.name}),e.jsx(A,{size:"small",variant:"secondary",children:t.sourceType}),t.isAsync&&e.jsx(A,{size:"small",variant:"accent",children:"async"}),t.requiresApproval&&e.jsx(A,{size:"small",variant:"attention",children:"requires approval"}),e.jsxs(i,{sx:{fontSize:0,color:"fg.muted",ml:"auto"},children:[G(t.totalTokens)," tokens"]})]}),t.description&&e.jsx(i,{sx:{fontSize:1,color:"fg.muted",display:"block",mb:2},children:t.description}),e.jsxs(n,{display:"flex",gap:2,children:[e.jsxs(L,{size:"small",variant:"invisible",onClick:()=>r(!s),children:[s?"Hide":"Show"," Schema"]}),t.sourceCode&&e.jsxs(L,{size:"small",variant:"invisible",onClick:()=>o(!l),children:[l?"Hide":"Show"," Source"]})]}),s&&e.jsx(n,{as:"pre",mt:2,p:2,bg:"canvas.inset",borderRadius:2,fontSize:0,overflow:"auto",maxHeight:200,children:JSON.stringify(t.parametersSchema,null,2)}),l&&t.sourceCode&&e.jsx(n,{as:"pre",mt:2,p:2,bg:"canvas.inset",borderRadius:2,fontSize:0,overflow:"auto",maxHeight:300,children:t.sourceCode})]})}function Ut({agentId:t,apiBase:s,liveData:r}){const l=r!==void 0,o=r;if(!l)return e.jsx(n,{p:3,display:"flex",alignItems:"center",justifyContent:"center",children:e.jsx(i,{sx:{color:"fg.muted"},children:"Waiting for context data from WebSocket stream..."})});if(!o)return e.jsx(n,{p:3,bg:"attention.subtle",borderRadius:2,border:"1px solid",borderColor:"attention.muted",children:e.jsx(i,{sx:{color:"attention.fg"},children:"No context data available."})});if(o.error)return e.jsx(n,{p:3,bg:"attention.subtle",borderRadius:2,border:"1px solid",borderColor:"attention.muted",children:e.jsx(i,{sx:{color:"attention.fg"},children:o.error})});const{tokenSummary:a,modelConfiguration:d}=o;return e.jsxs(n,{children:[e.jsxs(n,{mb:3,children:[e.jsxs(i,{sx:{fontSize:1,fontWeight:"semibold"},children:["Total usage: ",G(a.total)," /"," ",G(a.contextWindow)," (",Math.round(a.usagePercent),"%)"]}),e.jsx(Ne,{progress:Math.min(a.usagePercent,100),sx:{mt:2,height:8},bg:a.usagePercent>90?"danger.emphasis":a.usagePercent>70?"attention.emphasis":"success.emphasis"}),e.jsxs(n,{display:"flex",gap:3,mt:2,flexWrap:"wrap",fontSize:0,color:"fg.muted",children:[e.jsxs(i,{children:["System: ",G(a.systemPrompts)]}),e.jsxs(i,{children:["Tools: ",G(a.tools)]}),a.memory>0&&e.jsxs(i,{children:["Memory: ",G(a.memory)]}),e.jsxs(i,{children:["History: ",G(a.history)]}),e.jsxs(i,{children:["Current: ",G(a.current)]})]})]}),e.jsx(ee,{title:"Model Configuration",icon:Je,defaultExpanded:!1,children:e.jsxs(n,{display:"grid",gridTemplateColumns:"1fr 2fr",gap:2,children:[e.jsx(i,{sx:{fontWeight:"semibold",fontSize:1},children:"Model:"}),e.jsx(i,{sx:{fontSize:1,fontFamily:"mono"},children:d.modelName||"Not specified"}),e.jsx(i,{sx:{fontWeight:"semibold",fontSize:1},children:"Context Window:"}),e.jsxs(i,{sx:{fontSize:1},children:[G(d.contextWindow)," tokens"]}),Object.keys(d.settings).length>0&&e.jsxs(e.Fragment,{children:[e.jsx(i,{sx:{fontWeight:"semibold",fontSize:1},children:"Settings:"}),e.jsx(n,{as:"pre",fontSize:0,p:2,bg:"canvas.inset",borderRadius:2,overflow:"auto",children:JSON.stringify(d.settings,null,2)})]})]})}),e.jsx(ee,{title:"System Prompts",icon:Ye,count:o.systemPrompts.length,tokens:o.systemPromptTokens,children:o.systemPrompts.length===0?e.jsx(i,{sx:{color:"fg.muted",fontSize:1},children:"No system prompts configured"}):o.systemPrompts.map((c,h)=>e.jsxs(n,{p:2,mb:2,bg:"canvas.inset",borderRadius:2,border:"1px solid",borderColor:"border.muted",children:[e.jsxs(n,{display:"flex",justifyContent:"space-between",mb:1,children:[e.jsxs(i,{sx:{fontWeight:"semibold",fontSize:0},children:["Prompt ",h+1]}),e.jsxs(i,{sx:{fontSize:0,color:"fg.muted"},children:[G(c.tokens)," tokens"]})]}),e.jsx(i,{as:"pre",sx:{fontSize:0,whiteSpace:"pre-wrap",wordBreak:"break-word",maxHeight:200,overflow:"auto"},children:c.content})]},h))}),e.jsx(ee,{title:"Tool Definitions",icon:St,count:o.tools.length,tokens:o.toolTokens,children:o.tools.length===0?e.jsx(i,{sx:{color:"fg.muted",fontSize:1},children:"No tools configured"}):o.tools.map((c,h)=>e.jsx(Et,{tool:c},h))}),o.memoryBlocks.length>0&&e.jsx(ee,{title:"Memory Blocks",icon:Pe,count:o.memoryBlocks.length,tokens:o.memoryTokens,children:o.memoryBlocks.map((c,h)=>e.jsx(n,{as:"pre",p:2,mb:2,bg:"canvas.inset",borderRadius:2,fontSize:0,overflow:"auto",children:JSON.stringify(c,null,2)},h))}),Object.keys(o.toolEnvironment).length>0&&e.jsx(ee,{title:"Tool Environment",icon:V,count:Object.keys(o.toolEnvironment).length,children:e.jsx(n,{display:"grid",gridTemplateColumns:"1fr 2fr",gap:2,children:Object.entries(o.toolEnvironment).map(([c,h])=>e.jsxs(te.Fragment,{children:[e.jsx(i,{sx:{fontFamily:"mono",fontSize:1,fontWeight:"semibold"},children:c}),e.jsx(i,{sx:{fontFamily:"mono",fontSize:1,color:"fg.muted"},children:h})]},c))})}),o.toolRules.length>0&&e.jsx(ee,{title:"Tool Rules",icon:ce,count:o.toolRules.length,children:o.toolRules.map((c,h)=>e.jsx(n,{as:"pre",p:2,mb:2,bg:"canvas.inset",borderRadius:2,fontSize:0,overflow:"auto",children:JSON.stringify(c,null,2)},h))})]})}const ye={provider:"github",displayName:"GitHub",iconUrl:"https://github.githubassets.com/favicons/favicon.svg",authorizationUrl:"https://github.com/login/oauth/authorize",tokenUrl:"https://github.com/login/oauth/access_token",userInfoUrl:"https://api.github.com/user",revocationUrl:"https://api.github.com/applications/{client_id}/token",defaultScopes:["read:user","user:email"]},je={provider:"google",displayName:"Google",iconUrl:"https://www.google.com/favicon.ico",authorizationUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",userInfoUrl:"https://www.googleapis.com/oauth2/v2/userinfo",revocationUrl:"https://oauth2.googleapis.com/revoke",defaultScopes:["openid","email","profile"],additionalParams:{access_type:"offline",prompt:"consent"}},Se={provider:"kaggle",displayName:"Kaggle",iconUrl:"https://www.kaggle.com/static/images/favicon.ico",authorizationUrl:"https://www.kaggle.com/oauth/authorize",tokenUrl:"https://www.kaggle.com/oauth/token",userInfoUrl:"https://www.kaggle.com/api/v1/me",defaultScopes:["datasets:read","notebooks:read"]};function _t(t=64){const s=Math.max(43,Math.min(128,t)),r=new Uint8Array(s);return crypto.getRandomValues(r),we(r)}async function Rt(t){const r=new TextEncoder().encode(t),l=await crypto.subtle.digest("SHA-256",r);return we(new Uint8Array(l))}function Dt(){const t=new Uint8Array(32);return crypto.getRandomValues(t),we(t)}function we(t){let s="";const r=new Uint8Array(t);for(let l=0;l<r.length;l++)s+=String.fromCharCode(r[l]);return s=btoa(s),s.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}async function Pt(){const t=_t(),s=await Rt(t);return{codeVerifier:t,codeChallenge:s}}const Ot="datalayer-agent-identities",Ee="/api/v1/identity/oauth/token",Mt="/api/v1/identity/oauth/userinfo",Wt="/api/v1/identity/oauth/revoke",$t={identities:new Map,pendingAuthorization:null,providerConfigs:new Map,isLoading:!1,error:null};function Nt(t,s,r,l){const o=new URLSearchParams({client_id:t.clientId,redirect_uri:t.redirectUri,response_type:"code",scope:s.join(" "),state:r,code_challenge:l,code_challenge_method:"S256",...t.additionalParams});return`${t.authorizationUrl}?${o.toString()}`}const T=Ze()(et(tt(nt((t,s)=>({...$t,configureProvider:r=>{t(l=>{const o=new Map(l.providerConfigs);return o.set(r.provider,r),{providerConfigs:o}})},startAuthorization:async(r,l,o)=>{const d=s().providerConfigs.get(r);if(!d)throw new Error(`Provider ${r} is not configured`);const{codeVerifier:c,codeChallenge:h}=await Pt(),f=Dt(),S=l||d.defaultScopes,u=Nt(d,S,f,h),b={requestId:`auth-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,provider:r,authUrl:u,state:f,codeVerifier:c,scopes:S,requestedAt:Date.now(),onComplete:o?.onComplete,onError:o?.onError};return t({pendingAuthorization:b,error:null}),u},completeAuthorization:async r=>{const l=s(),o=l.pendingAuthorization;if(!o)throw new Error("No pending authorization request");if(r.state!==o.state){const a=new Error("State mismatch - possible CSRF attack");throw o.onError?.(a),t({pendingAuthorization:null,error:a}),a}if(r.error){const a=new Error(r.errorDescription||r.error);throw o.onError?.(a),t({pendingAuthorization:null,error:a}),a}t({isLoading:!0});try{const a=l.providerConfigs.get(o.provider);if(!a)throw new Error(`Provider ${o.provider} is not configured`);const d=a.redirectUri.split("/").slice(0,3).join("/"),c=await fetch(`${d}${Ee}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:o.provider,code:r.code,code_verifier:o.codeVerifier,redirect_uri:a.redirectUri})});if(!c.ok){const b=await c.json().catch(()=>({}));throw new Error(b.detail||`Token exchange failed: ${c.status}`)}const h=await c.json(),f={accessToken:h.access_token,tokenType:h.token_type||"Bearer",expiresAt:h.expires_in?Date.now()+h.expires_in*1e3:void 0,refreshToken:h.refresh_token,scopes:o.scopes};let S;if(a.userInfoUrl)try{const b=await fetch(`${d}${Mt}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:o.provider,access_token:f.accessToken})});if(b.ok){const m=await b.json();S={id:m.id?.toString()||m.sub,username:m.login||m.username,name:m.name,email:m.email,avatarUrl:m.avatar_url||m.picture,profileUrl:m.html_url||m.profile,raw:m}}}catch(b){console.warn("Failed to fetch user info:",b)}const u={provider:o.provider,displayName:a.displayName,iconUrl:a.iconUrl,scopes:o.scopes,isConnected:!0,connectedAt:Date.now(),userInfo:S,token:f};return t(b=>{const m=new Map(b.identities);return m.set(o.provider,u),{identities:m,pendingAuthorization:null,isLoading:!1,error:null}}),o.onComplete?.(u),u}catch(a){const d=a instanceof Error?a:new Error(String(a));throw o.onError?.(d),t({isLoading:!1,error:d,pendingAuthorization:null}),d}},cancelAuthorization:()=>{const r=s().pendingAuthorization;r?.onError&&r.onError(new Error("Authorization cancelled")),t({pendingAuthorization:null})},connectWithToken:async(r,l,o)=>{t({isLoading:!0,error:null});try{const a={accessToken:l,tokenType:"Bearer",scopes:[]},d={kaggle:{displayName:"Kaggle",iconUrl:"https://www.kaggle.com/static/images/favicon.ico"}}[r]||{displayName:r,iconUrl:void 0},c={provider:r,authType:"token",displayName:o?.displayName||d.displayName,iconUrl:o?.iconUrl||d.iconUrl,scopes:[],isConnected:!0,connectedAt:Date.now(),userInfo:o?.userInfo,token:a};return t(h=>{const f=new Map(h.identities);return f.set(r,c),{identities:f,isLoading:!1,error:null}}),c}catch(a){const d=a instanceof Error?a:new Error(String(a));throw t({isLoading:!1,error:d}),d}},disconnect:async r=>{const l=s(),o=l.identities.get(r),a=l.providerConfigs.get(r);if(!o||!o.token){t(d=>{const c=new Map(d.identities);return c.delete(r),{identities:c}});return}if(o.authType==="token"){t(d=>{const c=new Map(d.identities);return c.delete(r),{identities:c}});return}if(a?.revocationUrl)try{const d=a.redirectUri.split("/").slice(0,3).join("/");await fetch(`${d}${Wt}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:r,access_token:o.token.accessToken})})}catch(d){console.warn("Failed to revoke token:",d)}t(d=>{const c=new Map(d.identities);return c.delete(r),{identities:c}})},refreshToken:async r=>{const l=s(),o=l.identities.get(r),a=l.providerConfigs.get(r);if(!o||!o.token?.refreshToken)throw new Error(`No refresh token available for ${r}`);if(!a)throw new Error(`Provider ${r} is not configured`);const d=a.redirectUri.split("/").slice(0,3).join("/"),c=await fetch(`${d}${Ee}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:r,grant_type:"refresh_token",refresh_token:o.token.refreshToken})});if(!c.ok)throw new Error(`Token refresh failed: ${c.status}`);const h=await c.json(),f={accessToken:h.access_token,tokenType:h.token_type||"Bearer",expiresAt:h.expires_in?Date.now()+h.expires_in*1e3:void 0,refreshToken:h.refresh_token||o.token.refreshToken,scopes:o.scopes};return t(S=>{const u=new Map(S.identities);return u.set(r,{...o,token:f}),{identities:u}}),f},getIdentity:r=>s().identities.get(r),isConnected:r=>s().identities.get(r)?.isConnected??!1,getToken:async r=>{const o=s().identities.get(r);if(!o||!o.token)return null;const a=o.token.expiresAt;if(a&&a-Date.now()<300*1e3){if(o.token.refreshToken)try{return await s().refreshToken(r)}catch(d){return console.warn("Token refresh failed:",d),null}return null}return o.token},clearAll:()=>{t({identities:new Map,pendingAuthorization:null,error:null})},setError:r=>{t({error:r})}}),{name:Ot,storage:{getItem:t=>{const s=localStorage.getItem(t);if(!s)return null;const r=JSON.parse(s),l=new URLSearchParams(window.location.search),o=l.has("code")&&l.has("state");return{state:{...r.state,identities:new Map(r.state.identities||[]),providerConfigs:new Map(r.state.providerConfigs||[]),pendingAuthorization:o&&r.state.pendingAuthorization||null,isLoading:!1,error:null}}},setItem:(t,s)=>{const r={state:{...s.state,identities:Array.from(s.state.identities.entries()),providerConfigs:Array.from(s.state.providerConfigs.entries()),pendingAuthorization:s.state.pendingAuthorization?{...s.state.pendingAuthorization,onComplete:void 0,onError:void 0}:null,isLoading:!1,error:null}};localStorage.setItem(t,JSON.stringify(r))},removeItem:t=>localStorage.removeItem(t)},partialize:t=>({identities:t.identities,providerConfigs:t.providerConfigs,pendingAuthorization:t.pendingAuthorization})})),{name:"IdentityStore"}));function Lt(){return T(Le(t=>Array.from(t.identities.values()).filter(s=>s.isConnected)))}function Ft(){return T(Le(t=>Array.from(t.identities.entries()).filter(([s,r])=>r.isConnected).map(([s])=>s)))}function Vt(){return T(t=>t.pendingAuthorization)}function Ht(){return T(t=>t.isLoading)}function Gt(){return T(t=>t.error)}function pe(t){const s=T.getState();t.github&&s.configureProvider({...ye,clientId:t.github.clientId,redirectUri:t.github.redirectUri}),t.google&&s.configureProvider({...je,clientId:t.google.clientId,redirectUri:t.google.redirectUri}),t.kaggle&&s.configureProvider({...Se,clientId:t.kaggle.clientId,redirectUri:t.kaggle.redirectUri})}function ke(t={}){const{providers:s,baseUrl:r=typeof window<"u"?window.location.origin:"",callbackPath:l=typeof window<"u"?window.location.pathname:"/oauth/callback",autoHandleCallback:o=!0}=t,a=Lt(),d=Ft(),c=Vt(),h=Ht(),f=Gt(),S=T(x=>x.startAuthorization),u=T(x=>x.completeAuthorization),b=T(x=>x.cancelAuthorization),m=T(x=>x.disconnect),R=T(x=>x.getIdentity),P=T(x=>x.isConnected),y=T(x=>x.getToken),p=T(x=>x.configureProvider);z.useEffect(()=>{if(!s)return;const x=`${r}${l}`;s.github&&pe({github:{clientId:s.github.clientId,redirectUri:s.github.redirectUri||x}}),s.google&&pe({google:{clientId:s.google.clientId,redirectUri:s.google.redirectUri||x}}),s.kaggle&&pe({kaggle:{clientId:s.kaggle.clientId,redirectUri:s.kaggle.redirectUri||x}}),s.custom&&s.custom.forEach(U=>{p(U)})},[s,r,l,p]),z.useEffect(()=>{if(!o||typeof window>"u")return;const x=new URLSearchParams(window.location.search),U=x.get("code"),$=x.get("state"),B=x.get("error"),H=x.get("error_description");(U&&$||B)&&u({code:U||"",state:$||"",error:B||void 0,errorDescription:H||void 0}).then(()=>{const K=window.location.pathname;window.history.replaceState({},"",K)}).catch(K=>{console.error("OAuth callback error:",K);const Q=window.location.pathname;window.history.replaceState({},"",Q)})},[o,u]);const j=z.useCallback(async(x,U)=>{const $=await S(x,U);window.location.href=$},[S]),E=z.useCallback(async(x,U)=>{const $=await S(x,U,{onComplete:()=>{},onError:()=>{}});return new Promise((B,H)=>{const K=T.getState();K.pendingAuthorization&&(K.pendingAuthorization.onComplete=B,K.pendingAuthorization.onError=H);const Q=600,k=700,ue=window.screenX+(window.outerWidth-Q)/2,v=window.screenY+(window.outerHeight-k)/2,_=window.open($,"oauth_popup",`width=${Q},height=${k},left=${ue},top=${v},toolbar=no,menubar=no`);if(!_){H(new Error("Failed to open popup window"));return}const J=Y=>{if(Y.origin===window.location.origin)if(Y.data?.type==="oauth-callback-success"){window.removeEventListener("message",J),clearInterval(oe),_.close();const ie=Y.data.provider,re=Y.data.identity;if(console.debug("[Identity] Received oauth-callback-success for provider:",ie),console.debug("[Identity] Identity from popup:",re),re){const ve=T.getState().identities,Z=new Map(ve);Z.set(ie,re),T.setState({identities:Z,pendingAuthorization:null}),console.debug("[Identity] Store updated with identity from popup, identities count:",Z.size),B(re);return}setTimeout(()=>{const Z=localStorage.getItem("agent-runtimes-identity");if(console.debug("[Identity] Fallback: reading from localStorage"),Z)try{const Fe=JSON.parse(Z).state?.identities||[],fe=new Map(Fe).get(ie);if(fe){const Ve=T.getState().identities,Ce=new Map(Ve);Ce.set(ie,fe),T.setState({identities:Ce,pendingAuthorization:null}),B(fe);return}}catch(ze){console.error("[Identity] Failed to parse identity from localStorage:",ze)}T.setState({pendingAuthorization:null}),H(new Error("Identity not found after OAuth success"))},100)}else Y.data?.type==="oauth-callback-error"?(window.removeEventListener("message",J),clearInterval(oe),_.close(),T.setState({pendingAuthorization:null}),H(new Error(Y.data.error||"OAuth authentication failed"))):Y.data?.type==="oauth_callback"&&(window.removeEventListener("message",J),clearInterval(oe),_.close(),u(Y.data.payload).then(B).catch(H))};window.addEventListener("message",J);const oe=setInterval(()=>{_.closed&&(clearInterval(oe),window.removeEventListener("message",J),T.getState().pendingAuthorization&&(b(),H(new Error("Popup closed by user"))))},500)})},[S,u,b]),I=T(x=>x.connectWithToken),O=z.useCallback(async(x,U,$)=>I(x,U,$),[I]),g=z.useCallback(async x=>{await m(x)},[m]),C=z.useCallback(async x=>u(x),[u]),N=z.useCallback(()=>{b()},[b]),q=z.useCallback(x=>P(x),[P]),M=z.useCallback(x=>R(x),[R]),w=z.useCallback(async x=>(await y(x))?.accessToken??null,[y]),X=z.useCallback(x=>{p(x)},[p]),W=c!==null;return z.useMemo(()=>({identities:a,connectedProviders:d,isAuthorizing:W,isLoading:h,error:f,pendingAuthorization:c,connect:j,connectWithPopup:E,connectWithToken:O,disconnect:g,completeAuthorization:C,cancelAuthorization:N,isConnected:q,getIdentity:M,getAccessToken:w,configureProvider:X}),[a,d,W,h,f,c,j,E,O,g,C,N,q,M,w,X])}const Ue={github:{name:"GitHub",icon:We,color:"#24292f",description:"Access GitHub repositories and APIs"},google:{name:"Google",icon:V,color:"#4285f4",description:"Access Google services and APIs"},kaggle:{name:"Kaggle",icon:V,color:"#20beff",description:"Access Kaggle datasets and notebooks"},linkedin:{name:"LinkedIn",icon:V,color:"#0077b5",description:"Access LinkedIn profile and connections"},slack:{name:"Slack",icon:V,color:"#4a154b",description:"Access Slack workspaces and channels"},notion:{name:"Notion",icon:V,color:"#000000",description:"Access Notion pages and databases"},custom:{name:"Custom",icon:de,color:"#6f42c1",description:"Custom OAuth provider"}},qt={github:["read:user","user:email"],google:["openid","profile","email"],kaggle:["read"],linkedin:["r_liteprofile","r_emailaddress"],slack:["users:read","channels:read"],notion:["read_content"],custom:[]},Bt=({provider:t,clientId:s,providerConfig:r,scopes:l,disabled:o=!1,size:a="medium",variant:d="full",onConnect:c,onDisconnect:h,onError:f})=>{const{identities:S,isAuthorizing:u,error:b,connectWithPopup:m,disconnect:R,configureProvider:P}=ke(),y=Ue[t]||Ue.custom,p=S.find(g=>g.provider===t),j=!!p,E=u;te.useEffect(()=>{if(s){const g=t==="github"?ye:t==="google"?je:t==="kaggle"?Se:void 0;if(g){const C=r?.redirectUri||(typeof window<"u"?`${window.location.origin}${window.location.pathname}`:"");P({...g,...r,provider:t,clientId:s,redirectUri:C})}}},[s,t,r,P]);const I=z.useCallback(async()=>{try{if(j)await R(t),h?.(t);else{const g=await m(t,l||qt[t]);c?.(g)}}catch(g){const C=g instanceof Error?g.message:String(g);C!=="Popup closed by user"&&f?.(g instanceof Error?g:new Error(C))}},[j,t,l,m,R,c,h,f]);te.useEffect(()=>{b&&f?.(b instanceof Error?b:new Error(String(b)))},[b,f]);const O={onClick:I,disabled:o||E||!s&&!j,size:a==="large"?"large":a==="small"?"small":"medium"};return d==="icon"?e.jsx(L,{...O,variant:j?"primary":"default","aria-label":j?`Disconnect ${y.name}`:`Connect ${y.name}`,sx:{width:a==="small"?28:a==="large"?44:36,height:a==="small"?28:a==="large"?44:36,p:0},children:E?e.jsx(n,{as:"span",className:"anim-rotate",display:"inline-block",children:"⏳"}):e.jsx(y.icon,{size:a==="small"?14:18})}):d==="compact"?e.jsx(L,{...O,variant:j?"primary":"default",leadingVisual:y.icon,trailingVisual:j?Oe:void 0,children:E?"Connecting...":y.name}):e.jsxs(n,{display:"flex",flexDirection:"column",gap:2,p:2,border:"1px solid",borderColor:j?"success.muted":"border.default",borderRadius:2,backgroundColor:j?"success.subtle":"canvas.subtle",children:[e.jsxs(n,{display:"flex",alignItems:"center",gap:2,children:[e.jsx(n,{width:40,height:40,borderRadius:2,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:y.color,color:"white",children:e.jsx(y.icon,{size:20})}),e.jsxs(n,{flex:1,children:[e.jsx(i,{sx:{fontWeight:"bold",display:"block"},children:y.name}),e.jsx(i,{sx:{fontSize:0,color:"fg.muted",display:"block"},children:j&&p?.userInfo?`Connected as ${p.userInfo.name||p.userInfo.email}`:y.description})]}),!j&&e.jsx(L,{...O,variant:"primary",leadingVisual:de,children:E?"Working...":"Connect"})]}),j&&p&&e.jsxs(n,{display:"flex",flexDirection:"column",gap:2,children:[e.jsxs(n,{display:"flex",alignItems:"center",gap:2,pl:1,children:[p.userInfo?.avatarUrl&&e.jsx("a",{href:p.userInfo.profileUrl||`https://github.com/${p.userInfo.username}`,target:"_blank",rel:"noopener noreferrer",style:{display:"block",lineHeight:0},children:e.jsx("img",{src:p.userInfo.avatarUrl,alt:p.userInfo.name||"User avatar",style:{width:32,height:32,borderRadius:"50%",cursor:"pointer"}})}),e.jsxs(n,{flex:1,children:[p.userInfo?.username&&e.jsx("a",{href:p.userInfo.profileUrl||`https://github.com/${p.userInfo.username}`,target:"_blank",rel:"noopener noreferrer",style:{textDecoration:"none"},children:e.jsxs(i,{sx:{fontSize:1,color:"fg.muted",display:"block",":hover":{textDecoration:"underline"}},children:["@",p.userInfo.username]})}),e.jsx(i,{sx:{fontSize:0,color:"fg.muted",display:"block"},children:p.token?.expiresAt?`Expires ${new Date(p.token.expiresAt).toLocaleDateString()}`:"Token does not expire"})]})]}),p.scopes&&p.scopes.length>0&&e.jsx(n,{display:"flex",flexWrap:"wrap",gap:1,pl:1,children:p.scopes.map(g=>e.jsx(i,{sx:{fontSize:0,px:2,py:1,bg:"neutral.muted",borderRadius:2,color:"fg.muted"},children:g},g))}),e.jsxs(L,{...O,variant:"danger",leadingVisual:$e,children:["Disconnect from ",y.name]})]})]})},_e={github:{name:"GitHub",icon:We,color:"#24292f",description:"Access GitHub repositories and APIs"},google:{name:"Google",icon:V,color:"#4285f4",description:"Access Google services and APIs"},kaggle:{name:"Kaggle",icon:V,color:"#20beff",description:"Access Kaggle datasets and notebooks"},linkedin:{name:"LinkedIn",icon:V,color:"#0077b5",description:"Access LinkedIn profile"},slack:{name:"Slack",icon:V,color:"#4a154b",description:"Access Slack workspaces"},notion:{name:"Notion",icon:V,color:"#000000",description:"Access Notion pages"},custom:{name:"Custom",icon:de,color:"#6f42c1",description:"Custom OAuth provider"}},Kt={github:["read:user","user:email","repo"],google:["openid","profile","email"],kaggle:["read"],linkedin:["r_liteprofile","r_emailaddress"],slack:["users:read","channels:read"],notion:["read_content"],custom:[]};function Jt(t){if(!t)return{isExpired:!1,isExpiringSoon:!1};const s=Date.now(),r=new Date(t),l=t-s,o=s-t,a=300*1e3;return{isExpired:l<0,isExpiringSoon:l>0&&l<a,expiresAt:r,timeUntilExpiry:l>0?l:void 0,timeSinceExpiry:l<0?o:void 0}}function he(t){const s=Math.floor(t/1e3),r=Math.floor(s/60),l=Math.floor(r/60),o=Math.floor(l/24);return o>0?o===1?"1 day":`${o} days`:l>0?l===1?"1 hour":`${l} hours`:r>0?r===1?"1 minute":`${r} minutes`:s===1?"1 second":`${s} seconds`}function Yt(t){return t.isExpired&&t.timeSinceExpiry?`Expired ${he(t.timeSinceExpiry)} ago`:t.timeUntilExpiry?t.isExpiringSoon?`Expires in ${he(t.timeUntilExpiry)}`:`Expires in ${he(t.timeUntilExpiry)}`:"Token does not expire"}function Xt({identity:t,providerConfig:s,showExpirationDetails:r=!0,allowReconnect:l=!0,onConnect:o,onDisconnect:a,onError:d}){const{connect:c,disconnect:h,configureProvider:f,isAuthorizing:S}=ke(),u=t.provider,b=_e[u]||_e.custom,m=z.useMemo(()=>Jt(t.token?.expiresAt),[t.token?.expiresAt]);te.useEffect(()=>{if(s?.clientId){const y=u==="github"?ye:u==="google"?je:u==="kaggle"?Se:void 0;if(y){const p=s.config?.redirectUri||(typeof window<"u"?`${window.location.origin}${window.location.pathname}`:"");f({...y,...s.config,provider:u,clientId:s.clientId,redirectUri:p})}}},[s,u,f]);const R=z.useCallback(async()=>{try{const y=s?.scopes||Kt[u];await c(u,y)}catch(y){d?.(y instanceof Error?y:new Error(String(y)))}},[u,s?.scopes,c,d]),P=z.useCallback(async()=>{try{await h(u),a?.(u)}catch(y){d?.(y instanceof Error?y:new Error(String(y)))}},[u,h,a,d]);return e.jsxs(n,{display:"flex",flexDirection:"column",gap:2,p:3,border:"1px solid",borderColor:m.isExpired?"danger.muted":m.isExpiringSoon?"attention.muted":"success.muted",borderRadius:2,backgroundColor:m.isExpired?"danger.subtle":m.isExpiringSoon?"attention.subtle":"success.subtle",children:[e.jsxs(n,{display:"flex",alignItems:"center",gap:2,children:[e.jsx(n,{width:32,height:32,borderRadius:2,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:b.color,color:"white",children:e.jsx(b.icon,{size:16})}),e.jsxs(n,{flex:1,display:"flex",alignItems:"center",gap:2,children:[e.jsx(i,{sx:{fontWeight:"semibold",fontSize:1},children:b.name}),e.jsx(A,{size:"small",variant:"secondary",children:t.authType==="token"?"API Key":"OAuth"})]}),m.isExpired?e.jsx(A,{variant:"danger",size:"small",children:e.jsxs(n,{display:"inline-flex",alignItems:"center",gap:1,children:[e.jsx(ot,{size:12})," Expired"]})}):m.isExpiringSoon?e.jsx(A,{variant:"attention",size:"small",children:e.jsxs(n,{display:"inline-flex",alignItems:"center",gap:1,children:[e.jsx(me,{size:12})," Expiring Soon"]})}):e.jsx(A,{variant:"success",size:"small",children:e.jsxs(n,{display:"inline-flex",alignItems:"center",gap:1,children:[e.jsx(Oe,{size:12})," Connected"]})})]}),e.jsxs(n,{display:"flex",alignItems:"center",gap:2,children:[t.userInfo?.avatarUrl&&e.jsx("a",{href:t.userInfo.profileUrl||(u==="github"?`https://github.com/${t.userInfo.username}`:void 0),target:"_blank",rel:"noopener noreferrer",style:{display:"block",lineHeight:0},children:e.jsx(kt,{src:t.userInfo.avatarUrl,size:32,alt:t.userInfo.name||t.userInfo.username||b.name,sx:{cursor:"pointer"}})}),e.jsxs(n,{flex:1,minWidth:0,children:[t.userInfo?.name&&e.jsx(i,{sx:{fontWeight:"semibold",fontSize:1,display:"block"},children:t.userInfo.name}),(t.userInfo?.username||t.userInfo?.email)&&e.jsx("a",{href:t.userInfo.profileUrl||(u==="github"?`https://github.com/${t.userInfo.username}`:void 0),target:"_blank",rel:"noopener noreferrer",style:{textDecoration:"none"},children:e.jsx(i,{sx:{fontSize:0,color:"fg.muted",display:"block",":hover":{textDecoration:"underline"}},children:t.userInfo.username?`@${t.userInfo.username}`:t.userInfo.email})})]})]}),r&&e.jsxs(n,{display:"flex",alignItems:"center",gap:1,children:[e.jsx(me,{size:12}),e.jsx(i,{sx:{fontSize:0,color:m.isExpired?"danger.fg":m.isExpiringSoon?"attention.fg":"fg.muted"},children:Yt(m)})]}),t.scopes&&t.scopes.length>0&&e.jsx(n,{display:"flex",flexWrap:"wrap",gap:1,children:t.scopes.map(y=>e.jsx(A,{size:"small",variant:"secondary",children:y},y))}),e.jsxs(n,{display:"flex",gap:2,mt:1,children:[m.isExpired&&l&&s?.clientId&&e.jsx(it,{text:"Reconnect to refresh token",children:e.jsx(L,{variant:"primary",size:"small",leadingVisual:rt,onClick:R,disabled:S,children:S?"Connecting...":"Reconnect"})}),e.jsxs(L,{variant:m.isExpired?"invisible":"danger",size:"small",leadingVisual:$e,onClick:P,disabled:S,children:["Disconnect from ",b.name]})]})]})}function Qt({providers:t,title:s="Connected Accounts",showHeader:r=!0,showDescription:l=!0,description:o="Connected identities for this agent. Agents can use these to access external services on your behalf.",showExpirationDetails:a=!0,allowReconnect:d=!0,onConnect:c,onDisconnect:h,onError:f}){const{identities:S,error:u}=ke(),b=z.useMemo(()=>{if(t){const p=Object.keys(t);return S.filter(j=>p.includes(j.provider)||j.authType==="token"&&j.isConnected)}return S},[S,t]),m=z.useMemo(()=>new Set(S.map(p=>p.provider)),[S]),R=z.useMemo(()=>{if(!t)return{};const p=Object.keys(t),j={};for(const E of p)m.has(E)||(j[E]=t[E]);return j},[t,m]),P=Object.keys(R).length>0,y=z.useCallback(p=>j=>{f?.(p,j)},[f]);return b.length===0&&!t?null:e.jsxs(n,{children:[r&&e.jsxs(n,{display:"flex",alignItems:"center",gap:2,mb:2,children:[e.jsx(V,{size:16}),e.jsx(i,{sx:{fontSize:1,fontWeight:"semibold",color:"fg.muted"},children:s})]}),e.jsxs(n,{p:3,bg:"canvas.subtle",borderRadius:2,border:"1px solid",borderColor:"border.default",children:[l&&e.jsx(i,{sx:{fontSize:0,color:"fg.muted",display:"block",mb:b.length>0?3:0},children:o}),u&&e.jsx(st,{variant:"danger",sx:{mb:3},children:u instanceof Error?u.message:String(u)}),b.length>0?e.jsx(n,{display:"flex",flexDirection:"column",gap:2,children:b.map(p=>e.jsx(Xt,{identity:p,providerConfig:t?.[p.provider],showExpirationDetails:a,allowReconnect:d,onConnect:c,onDisconnect:h,onError:y(p.provider)},p.provider))}):P?null:e.jsxs(n,{display:"flex",alignItems:"center",gap:2,color:"fg.muted",children:[e.jsx(de,{size:16}),e.jsx(i,{sx:{fontSize:1},children:"No connected accounts"})]}),P&&e.jsxs(n,{mt:b.length>0?3:0,children:[b.length>0&&e.jsx(i,{sx:{fontSize:0,color:"fg.muted",display:"block",mb:2},children:"Connect additional accounts:"}),e.jsx(n,{display:"flex",flexDirection:"column",gap:2,children:Object.keys(R).map(p=>{const j=R[p];return e.jsx(Bt,{provider:p,clientId:j.clientId,scopes:j.scopes,providerConfig:j.config,size:"medium",variant:"full",onConnect:c,onDisconnect:h,onError:y(p)},p)})})]})]})]})}const ge=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),xe=t=>{if(t==null)return"null";if(typeof t=="number"||typeof t=="boolean")return String(t);const s=String(t);return s===""?"''":/^[a-zA-Z0-9._/-]+$/.test(s)?s:JSON.stringify(s)},be=(t,s=0)=>{const r=" ".repeat(s);if(Array.isArray(t))return t.length===0?"[]":t.map(l=>ge(l)||Array.isArray(l)?`${r}-
3
3
  ${be(l,s+1)}`:`${r}- ${xe(l)}`).join(`
4
4
  `);if(ge(t)){const l=Object.entries(t).filter(([,o])=>o!==void 0);return l.length===0?"{}":l.map(([o,a])=>ge(a)||Array.isArray(a)?`${r}${o}:
@@ -1 +1 @@
1
- import{r as a,Q as l,j as s,D as o,h as m}from"../datalayer-app-main.js";import{AgentDetails as p}from"./AgentDetails-CqMfY8zN.js";import"./ArrowLeftIcon-sX3iNMG1.js";import"./UnlinkIcon-fXwOyjzQ.js";import"./esm-DNtiNaWu.js";import"./core-CsMGn5rr.js";import"./index-Cz10oMGc.js";import"./Avatar-B0TcOj_b.js";function B({about:e,name:r,onClose:t}){const n=a.useMemo(()=>new l,[]),i=!!(e.agentId&&e.apiBase);return s.jsx(o,{title:`${e.name??r} · Agent Details`,onClose:t,width:"xlarge",height:"large",children:s.jsx("div",{"data-assistant-agent-details":"",children:s.jsx(m,{client:n,children:s.jsx(p,{name:e.name??r,protocol:e.protocol??(i?"agent-runtimes":"browser"),url:e.url??"",messageCount:0,agentId:e.agentId,apiBase:e.apiBase,onBack:t,showBackHeader:!1,showUsage:i,padded:!1,runtime:i,summary:{spec:e.spec,model:e.model,where:e.where,description:e.description,skills:e.skills}})})})})}export{B as AgentDetailsDialog,B as default};
1
+ import{r as a,Q as l,j as s,D as o,h as m}from"../datalayer-app-main.js";import{AgentDetails as p}from"./AgentDetails-Dc-zAfsd.js";import"./ArrowLeftIcon-sX3iNMG1.js";import"./UnlinkIcon-fXwOyjzQ.js";import"./esm-Som5GXlh.js";import"./core-B-25xtEy.js";import"./index-Cz10oMGc.js";import"./Avatar-B0TcOj_b.js";function B({about:e,name:r,onClose:t}){const n=a.useMemo(()=>new l,[]),i=!!(e.agentId&&e.apiBase);return s.jsx(o,{title:`${e.name??r} · Agent Details`,onClose:t,width:"xlarge",height:"large",children:s.jsx("div",{"data-assistant-agent-details":"",children:s.jsx(m,{client:n,children:s.jsx(p,{name:e.name??r,protocol:e.protocol??(i?"agent-runtimes":"browser"),url:e.url??"",messageCount:0,agentId:e.agentId,apiBase:e.apiBase,onBack:t,showBackHeader:!1,showUsage:i,padded:!1,runtime:i,summary:{spec:e.spec,model:e.model,where:e.where,description:e.description,skills:e.skills}})})})})}export{B as AgentDetailsDialog,B as default};
@@ -1,4 +1,4 @@
1
- import{r as v,J as Xe,j as m,kC as Dt,I as J,fn as Ke,cO as me,bB as ge,v as Y,fM as At,fF as Ze,fY as jt,kD as It,kE as Nt,kF as Qe,kG as et,ct as V,kH as Lt,kI as Rt,kJ as Ot,b$ as je,kK as ft,kL as mt,kM as Ft,kN as ue,b1 as Bt,c0 as Ue,kO as gt,kP as Wt,kQ as tt,am as N,kR as nt,kS as fe,kT as Vt,kU as Ht,kV as Gt,aT as pe,kW as Le,kX as st,aU as ke,aV as ee,bw as $t,eY as zt,cq as U,kv as Kt,aO as Ut,cz as qt,aQ as Z,dV as Jt,ei as Yt,hk as We,hi as pt,kY as xe,eJ as Se,kZ as be,k_ as Xt,k$ as Zt,aY as Qt,aR as en,kt as tn,l0 as _t,h4 as K,l1 as nn,l2 as R,l3 as sn,dP as on,l4 as vt,l5 as rn,l6 as an,l7 as ln,Z as ne,B as he,e0 as dn,_ as cn,aL as hn,eN as ot,eO as de,eP as un,cE as fn,k as mn,l8 as gn,l9 as yt,hz as pn,la as ae,bA as D,z as le,a9 as it,aF as Ct,dI as _n,dF as vn,bJ as Me,V as yn,U as Cn,aZ as bn,b4 as wn}from"../datalayer-app-main.js";import{b as kn,c as xn,f as ce,P as Re,d as Sn,W as Mn,r as En,g as Tn,h as Pn,i as Dn,C as An,a as jn}from"./index-B5W7CVUY.js";import{c as In,N as Ve}from"./NotebookSkeleton-DHQ--KEB.js";import{H as Nn}from"./hoverbox-CStlKQWE.js";import{R as bt,L as Ln}from"./index-CBWGYoQM.js";import{a as Rn,W as rt}from"./renderer-NdtLW87o.js";import{C as Ee,S as Te}from"./SquareIcon-Dy3l3VdH.js";function On(...r){return v.useCallback(e=>{for(const t of r)typeof t=="function"?t(e):t&&(t.current=e)},r)}var Q={Banner:"prc-Banner-Banner-IR8eJ",BannerContainer:"prc-Banner-BannerContainer-lbx3d",BannerContent:"prc-Banner-BannerContent-zTITK",BannerActions:"prc-Banner-BannerActions-XCfHL",BannerTitle:"prc-Banner-BannerTitle-TcuJl",BannerIcon:"prc-Banner-BannerIcon-WuOyf",BannerDismiss:"prc-Banner-BannerDismiss-uBZVm",BannerActionsContainer:"prc-Banner-BannerActionsContainer-ukGMH"};const Fn={critical:m.jsx(It,{}),info:m.jsx(Ze,{}),success:m.jsx(jt,{}),upsell:m.jsx(Ze,{}),warning:m.jsx(At,{})},Bn={critical:"Critical",info:"Information",success:"Success",upsell:"Recommendation",warning:"Warning"},Wn=Xe.forwardRef(function({"aria-label":e,children:t,className:n,description:s,hideTitle:o,icon:i,onDismiss:a,primaryAction:l,secondaryAction:d,title:c,variant:h="info",...u},f){const _=!!a,y=l||d,A=Xe.useRef(null),j=On(f,A),p=h==="info"||h==="upsell";return m.jsxs("section",{...u,"aria-label":e??Bn[h],className:me(n,Q.Banner),"data-dismissible":a?"":void 0,"data-title-hidden":o?"":void 0,"data-variant":h,tabIndex:-1,ref:j,children:[m.jsx("div",{className:Q.BannerIcon,children:i&&p?i:Fn[h]}),m.jsxs("div",{className:Q.BannerContainer,children:[m.jsxs("div",{className:Q.BannerContent,children:[c?o?m.jsx(Dt,{children:m.jsx(He,{children:c})}):m.jsx(He,{children:c}):null,s?m.jsx(wt,{children:s}):null,t]}),y?m.jsx(Vn,{primaryAction:l,secondaryAction:d}):null]}),_?m.jsx(J,{"aria-label":"Dismiss banner",onClick:a,className:Q.BannerDismiss,icon:Ke,variant:"invisible"}):null]})});function He(r){const e=ge.c(12);let t,n,s,o;e[0]!==r?({as:o,className:n,children:t,...s}=r,e[0]=r,e[1]=t,e[2]=n,e[3]=s,e[4]=o):(t=e[1],n=e[2],s=e[3],o=e[4]);const i=o===void 0?"h2":o;let a;e[5]!==n?(a=me(n,Q.BannerTitle),e[5]=n,e[6]=a):a=e[6];let l;return e[7]!==i||e[8]!==t||e[9]!==s||e[10]!==a?(l=m.jsx(i,{...s,className:a,"data-banner-title":"",children:t}),e[7]=i,e[8]=t,e[9]=s,e[10]=a,e[11]=l):l=e[11],l}function wt(r){const e=ge.c(10);let t,n,s;e[0]!==r?({children:t,className:n,...s}=r,e[0]=r,e[1]=t,e[2]=n,e[3]=s):(t=e[1],n=e[2],s=e[3]);let o;e[4]!==n?(o=me("BannerDescription",n),e[4]=n,e[5]=o):o=e[5];let i;return e[6]!==t||e[7]!==s||e[8]!==o?(i=m.jsx("div",{...s,className:o,children:t}),e[6]=t,e[7]=s,e[8]=o,e[9]=i):i=e[9],i}function Vn(r){const e=ge.c(9),{primaryAction:t,secondaryAction:n}=r,s=n??null,o=t??null;let i;e[0]!==s||e[1]!==o?(i=m.jsxs("div",{className:Q.BannerActionsContainer,"data-primary-action":"trailing",children:[s,o]}),e[0]=s,e[1]=o,e[2]=i):i=e[2];const a=t??null,l=n??null;let d;e[3]!==a||e[4]!==l?(d=m.jsxs("div",{className:Q.BannerActionsContainer,"data-primary-action":"leading",children:[a,l]}),e[3]=a,e[4]=l,e[5]=d):d=e[5];let c;return e[6]!==i||e[7]!==d?(c=m.jsxs("div",{className:Q.BannerActions,children:[i,d]}),e[6]=i,e[7]=d,e[8]=c):c=e[8],c}const kt=v.forwardRef((r,e)=>{const t=ge.c(11);let n,s,o;t[0]!==r?({children:n,className:s,...o}=r,t[0]=r,t[1]=n,t[2]=s,t[3]=o):(n=t[1],s=t[2],o=t[3]);let i;t[4]!==s?(i=me("BannerPrimaryAction",s),t[4]=s,t[5]=i):i=t[5];let a;return t[6]!==n||t[7]!==e||t[8]!==o||t[9]!==i?(a=m.jsx(Y,{ref:e,className:i,variant:"default",...o,children:n}),t[6]=n,t[7]=e,t[8]=o,t[9]=i,t[10]=a):a=t[10],a});kt.displayName="BannerPrimaryAction";const xt=v.forwardRef((r,e)=>{const t=ge.c(11);let n,s,o;t[0]!==r?({children:n,className:s,...o}=r,t[0]=r,t[1]=n,t[2]=s,t[3]=o):(n=t[1],s=t[2],o=t[3]);let i;t[4]!==s?(i=me("BannerPrimaryAction",s),t[4]=s,t[5]=i):i=t[5];let a;return t[6]!==n||t[7]!==e||t[8]!==o||t[9]!==i?(a=m.jsx(Y,{ref:e,className:i,variant:"link",...o,children:n}),t[6]=n,t[7]=e,t[8]=o,t[9]=i,t[10]=a):a=t[10],a});xt.displayName="BannerSecondaryAction";const Hn=Object.assign(Wn,{Title:He,Description:wt,PrimaryAction:kt,SecondaryAction:xt}),_e=Rt.define({combine(r){return r[r.length-1]}}),Gn=je.baseTheme({".jp-remote-cursor":{borderLeft:"1px solid black",marginLeft:"-1px"},".jp-remote-cursor.jp-mod-primary":{borderLeftWidth:"2px"},".jp-remote-selection":{opacity:.5},".cm-tooltip":{border:"none"},".cm-tooltip.jp-remote-userInfo":{color:"var(--fgColor-onEmphasis, #ffffff)",padding:"0px 2px"}});function qe(r,e){const t=r?.username||r?.display_name||r?.name||String(e),{theme:n,colorMode:s}=Bt.getState(),o=s==="auto"?typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light":s;return In(t,n,o)}const Ie=Ot.define();class St{style;marker;constructor(e,t){this.style=e,this.marker=t}draw(){const e=this.marker.draw();for(const[t,n]of Object.entries(this.style))e.style[t]=n;return e}eq(e){return this.marker.eq(e.marker)&&V.deepEqual(this.style,e.style)}update(e,t){for(const[n,s]of Object.entries(this.style))e.style[n]=s;return this.marker.update(e,t.marker)}}const $n=ft({above:!0,markers(r){const{awareness:e,ytext:t}=r.state.facet(_e),n=t.doc,s=[];return e.getStates().forEach((o,i)=>{if(i===e.doc.clientID)return;const a=o.cursors;for(const l of a??[]){if(!l?.anchor||!l?.head)return;const d=ue(l.anchor,n),c=ue(l.head,n);if(d?.type!==t||c?.type!==t)return;const h=l.primary??!0?"jp-remote-cursor jp-mod-primary":"jp-remote-cursor",u=Ue.cursor(c.index,c.index>d.index?-1:1);for(const f of gt.forRange(r,h,u))s.push(new St({borderLeftColor:qe(o.user,i)},f))}}),s},update(r,e){return!!r.transactions.find(t=>t.annotation(Ie))},class:"jp-remote-cursors"});function at(r){const e=new Array,{awareness:t,ytext:n}=r.facet(_e),s=n.doc;for(const[o,i]of t.getStates())if(o!==t.doc.clientID)for(const a of i.cursors??[]){if(!a?.head)continue;const l=ue(a.head,s);l?.type===n&&e.push({pos:l.index,above:!0,create:()=>{const d=document.createElement("div");return d.classList.add("jp-remote-userInfo"),d.style.backgroundColor=qe(i.user,o),d.textContent=i.user?.display_name??"Anonymous",{dom:d}}})}return e}const zn=mt.define({create:at,update(r,e){return e.annotation(Ie)?at(e.state):r},provide(r){return Ft.computeN([r],e=>e.field(r))}}),Kn=ft({above:!1,markers(r){const{awareness:e,ytext:t}=r.state.facet(_e),n=t.doc,s=[];return e.getStates().forEach((o,i)=>{if(i===e.doc.clientID)return;const a=o.cursors;for(const l of a??[]){if((l.empty??!0)||!l?.anchor||!l?.head)return;const d=ue(l.anchor,n),c=ue(l.head,n);if(d?.type!==t||c?.type!==t)return;const h="jp-remote-selection";for(const u of gt.forRange(r,h,Ue.range(d.index,c.index)))s.push(new St({backgroundColor:qe(o.user,i)},u))}}),s},update(r,e){return!!r.transactions.find(t=>t.annotation(Ie))},class:"jp-remote-selections"}),Un=Nt.fromClass(class{editorAwareness;_listener;constructor(r){this.editorAwareness=r.state.facet(_e),this._listener=({added:e,updated:t,removed:n})=>{e.concat(t).concat(n).findIndex(o=>o!==this.editorAwareness.awareness.doc.clientID)>=0&&r.dispatch({annotations:[Ie.of([])]})},this.editorAwareness.awareness.on("change",this._listener)}destroy(){this.editorAwareness.awareness.off("change",this._listener)}update(r){if(!r.docChanged&&!r.selectionSet)return;const{awareness:e,ytext:t}=this.editorAwareness,n=e.getLocalState();if(n){const s=r.view.hasFocus&&r.view.dom.ownerDocument.hasFocus(),o=r.state.selection,i=new Array;if(s&&o){for(const a of o.ranges){const l=a===o.main,d=Qe(t,a.anchor),c=Qe(t,a.head);i.push({anchor:d,head:c,primary:l,empty:a.empty})}if(!n.cursors||i.length>0){const a=n.cursors?.map(l=>({...l,anchor:l?.anchor?et(l.anchor):null,head:l?.head?et(l.head):null}));V.deepEqual(i,a)||e.setLocalStateField("cursors",i)}}}}},{provide:()=>[Gn,$n,Kn,zn,Lt({position:"absolute",parent:document.body})]});function qn(r){return[_e.of(r),Un]}class Ne extends Wt{constructor(e={}){var t;super(),this.version="2.0.0",this.ymeta=this.ydoc.getMap("meta"),this._onMetaChanged=n=>{const s=n.find(i=>i.target===this.ymeta.get("metadata"));if(s){const i=s.changes.keys,a=this.ymeta.get("metadata");s.changes.keys.forEach((l,d)=>{switch(l.action){case"add":this._metadataChanged.emit({key:d,type:"add",newValue:a.get(d)});break;case"delete":this._metadataChanged.emit({key:d,type:"remove",oldValue:l.oldValue});break;case"update":{const c=a.get(d),h=l.oldValue;let u=!0;typeof h=="object"&&typeof c=="object"?u=V.deepEqual(h,c):u=h===c,u||this._metadataChanged.emit({key:d,type:"change",oldValue:h,newValue:c})}break}}),this._changed.emit({metadataChange:i})}const o=n.find(i=>i.target===this.ymeta);if(o){if(o.keysChanged.has("metadata")){const i=o.changes.keys.get("metadata");if(i?.action==="add"&&!i.oldValue){const a=new Map;for(const l of Object.keys(this.metadata))a.set(l,{action:"add",oldValue:void 0}),this._metadataChanged.emit({key:l,type:"add",newValue:this.getMetadata(l)});this._changed.emit({metadataChange:a})}}if(o.keysChanged.has("nbformat")){const i=o.changes.keys.get("nbformat"),a={key:"nbformat",oldValue:i?.oldValue?i.oldValue:void 0,newValue:this.nbformat};this._changed.emit({nbformatChanged:a})}if(o.keysChanged.has("nbformat_minor")){const i=o.changes.keys.get("nbformat_minor"),a={key:"nbformat_minor",oldValue:i?.oldValue?i.oldValue:void 0,newValue:this.nbformat_minor};this._changed.emit({nbformatChanged:a})}}},this._onYCellsChanged=n=>{n.changes.added.forEach(i=>{const a=i.content.type;if(!this._ycellMapping.has(a)){const l=tt(a,{notebook:this});this._ycellMapping.set(a,l)}}),n.changes.deleted.forEach(i=>{const a=i.content.type,l=this._ycellMapping.get(a);l&&(l.dispose(),this._ycellMapping.delete(a))});let s=0;const o=[];n.changes.delta.forEach(i=>{if(i.insert!=null){const a=i.insert.map(l=>this._ycellMapping.get(l));o.push({insert:a}),this.cells.splice(s,0,...a),s+=i.insert.length}else i.delete!=null?(o.push(i),this.cells.splice(s,i.delete)):i.retain!=null&&(o.push(i),s+=i.retain)}),this._changed.emit({cellsChange:o})},this._metadataChanged=new N(this),this._ycells=this.ydoc.getArray("cells"),this._ycellMapping=new WeakMap,this._disableDocumentWideUndoRedo=(t=e.disableDocumentWideUndoRedo)!==null&&t!==void 0?t:!1,this.cells=this._ycells.toArray().map(n=>(this._ycellMapping.has(n)||this._ycellMapping.set(n,tt(n,{notebook:this})),this._ycellMapping.get(n))),this.undoManager.addToScope(this._ycells),this._ycells.observe(this._onYCellsChanged),this.ymeta.observeDeep(this._onMetaChanged)}static create(e={}){var t,n,s,o,i,a,l,d,c;const h=new Ne({disableDocumentWideUndoRedo:(t=e.disableDocumentWideUndoRedo)!==null&&t!==void 0?t:!1}),u={cells:(s=(n=e.data)===null||n===void 0?void 0:n.cells)!==null&&s!==void 0?s:[],nbformat:(i=(o=e.data)===null||o===void 0?void 0:o.nbformat)!==null&&i!==void 0?i:4,nbformat_minor:(l=(a=e.data)===null||a===void 0?void 0:a.nbformat_minor)!==null&&l!==void 0?l:5,metadata:(c=(d=e.data)===null||d===void 0?void 0:d.metadata)!==null&&c!==void 0?c:{}};return h.setSource(u),h}get disableDocumentWideUndoRedo(){return this._disableDocumentWideUndoRedo}get metadata(){return this.getMetadata()}set metadata(e){this.setMetadata(e)}get metadataChanged(){return this._metadataChanged}get nbformat(){return this.ymeta.get("nbformat")}set nbformat(e){this.transact(()=>{this.ymeta.set("nbformat",e)},!1)}get nbformat_minor(){return this.ymeta.get("nbformat_minor")}set nbformat_minor(e){this.transact(()=>{this.ymeta.set("nbformat_minor",e)},!1)}dispose(){this.isDisposed||(this._ycells.unobserve(this._onYCellsChanged),this.ymeta.unobserveDeep(this._onMetaChanged),super.dispose())}getCell(e){return this.cells[e]}addCell(e){return this.insertCell(this._ycells.length,e)}insertCell(e,t){return this.insertCells(e,[t])[0]}insertCells(e,t){const n=t.map(s=>{const o=nt(s,this);return this._ycellMapping.set(o.ymodel,o),o});return this.transact(()=>{this._ycells.insert(e,n.map(s=>s.ymodel))}),this.dirty=!0,n}moveCell(e,t){this.moveCells(e,t)}moveCells(e,t,n=1){const s=new Array(n).fill(!0).map((o,i)=>this.getCell(e+i).toJSON());this.transact(()=>{this._ycells.delete(e,n),this._ycells.insert(e>t?t:t-n+1,s.map(o=>nt(o,this).ymodel))}),this.dirty=!0}deleteCell(e){this.deleteCellRange(e,e+1)}deleteCellRange(e,t){this.transact(()=>{this._ycells.delete(e,t-e)}),this.dirty=!0}deleteMetadata(e){if(typeof this.getMetadata(e)>"u")return;const t=this.metadata;delete t[e],this.setMetadata(t)}getMetadata(e){const t=this.ymeta.get("metadata");if(t!==void 0)if(typeof e=="string"){const n=t.get(e);return typeof n>"u"?void 0:V.deepCopy(n)}else return V.deepCopy(t.toJSON())}setMetadata(e,t){var n;if(typeof e=="string"){if(typeof t>"u")throw new TypeError(`Metadata value for ${e} cannot be 'undefined'; use deleteMetadata.`);if(V.deepEqual((n=this.getMetadata(e))!==null&&n!==void 0?n:null,t))return;const s={};s[e]=t,this.updateMetadata(s)}else if(!this.metadata||!V.deepEqual(this.metadata,e)){const s=V.deepCopy(e),o=this.ymeta.get("metadata");if(o===void 0)return;this.transact(()=>{o.clear();for(const[i,a]of Object.entries(s))o.set(i,a)}),this.dirty=!0}}updateMetadata(e){const t=V.deepCopy(e),n=this.ymeta.get("metadata");n!==void 0&&(this.transact(()=>{for(const[s,o]of Object.entries(t))n.set(s,o)}),this.dirty=!0)}getSource(){return this.toJSON()}setSource(e){this.fromJSON(e),this.dirty=!1}fromJSON(e){this.transact(()=>{this.nbformat=e.nbformat,this.nbformat_minor=e.nbformat_minor;const t=e.metadata;if(t.orig_nbformat!==void 0&&delete t.orig_nbformat,this.metadata)this.metadata=t;else{const o=new fe;for(const[i,a]of Object.entries(t))o.set(i,a);this.ymeta.set("metadata",o)}const n=e.nbformat===4&&e.nbformat_minor>=5,s=e.cells.map(o=>(n||delete o.id,o));this.insertCells(this.cells.length,s),this.deleteCellRange(0,this.cells.length)})}toJSON(){const e=this.nbformat===4&&this.nbformat_minor<=4;return Ge({metadata:this.metadata,nbformat_minor:this.nbformat_minor,nbformat:this.nbformat,cells:this.cells.map(t=>{const n=t.toJSON();return e&&delete n.id,n})})}}function Ge(r){if(Array.isArray(r))return r.map(e=>Ge(e));if(r!==null&&typeof r=="object"){const e={},t=Object.entries(r).sort(([n],[s])=>n<s?-1:n>s?1:0);for(const[n,s]of t)Object.defineProperty(e,n,{value:Ge(s),enumerable:!0,writable:!0,configurable:!0});return e}return r}class Jn{constructor(e){this.model=e,this._cellMap=new WeakMap,this._changed=new N(this),this._isDisposed=!1,this._insertCells(0,this.model.cells),this.model.changed.connect(this._onSharedModelChanged,this)}get changed(){return this._changed}get isDisposed(){return this._isDisposed}get length(){return this.model.cells.length}*[Symbol.iterator](){for(const e of this.model.cells)yield this._cellMap.get(e)}dispose(){var e;if(!this._isDisposed){this._isDisposed=!0;for(const t of this.model.cells)(e=this._cellMap.get(t))===null||e===void 0||e.dispose();N.clearData(this)}}get(e){return this._cellMap.get(this.model.cells[e])}_insertCells(e,t){return t.forEach(n=>{let s;switch(n.cell_type){case"code":{s=new Gt({sharedModel:n});break}case"markdown":{s=new Ht({sharedModel:n});break}default:s=new Vt({sharedModel:n})}this._cellMap.set(n,s),n.disposed.connect(()=>{s.dispose(),this._cellMap.delete(n)})}),this.length}_onSharedModelChanged(e,t){var n;let s=0;const o=new Array;(n=t.cellsChange)===null||n===void 0||n.forEach(i=>{i.insert!=null?(this._insertCells(s,i.insert),o.push({type:"add",newIndex:s,newValues:i.insert.map(a=>this._cellMap.get(a)),oldIndex:-2,oldValues:[]}),s+=i.insert.length):i.delete!=null?o.push({type:"remove",newIndex:-1,newValues:[],oldIndex:s,oldValues:new Array(i.delete).fill(void 0)}):i.retain!=null&&(s+=i.retain)}),o.forEach(i=>this._changed.emit(i))}}class Yn{constructor(e){this._requestBatchSize=10,this._cursor=0,this._hasSession=!1,this._history=[],this._placeholder="",this._kernelSession="",this._setByHistory=!1,this._isDisposed=!1,this._editor=null,this._filtered=[],this._kernel=null,this._sessionContext=e.sessionContext,this._trans=(e.translator||pe).load("jupyterlab"),this._toRequest=this._requestBatchSize,this._handleKernel().then(()=>{this._sessionContext.kernelChanged.connect(this._handleKernel,this)})}get editor(){return this._editor}set editor(e){if(this._editor===e)return;const t=this._editor;t&&t.model.sharedModel.changed.disconnect(this.onTextChange,this),this._editor=e,e&&e.model.sharedModel.changed.connect(this.onTextChange,this)}get placeholder(){return this._placeholder}get kernelSession(){return this._kernelSession}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed=!0,this._history.length=0,N.clearData(this)}async checkSession(e){var t;this._hasSession||(await this._retrieveHistory(),this._hasSession=!0,this.editor=e.editor,this._placeholder=((t=this._editor)===null||t===void 0?void 0:t.model.sharedModel.getSource())||"",this.setFilter(this._placeholder),this._cursor=this._filtered.length-1)}async back(e){return await this.checkSession(e),--this._cursor,this._cursor<0&&await this.fetchBatch(),this._cursor=Math.max(0,this._cursor),this._filtered[this._cursor]}async forward(e){return await this.checkSession(e),++this._cursor,this._cursor=Math.min(this._filtered.length-1,this._cursor),this._filtered[this._cursor]}updateEditor(e,t){var n,s;if(e){const o=(n=e.editor)===null||n===void 0?void 0:n.model,i=o?.sharedModel.getSource();if(this.isDisposed||!t||i===t)return;this._setByHistory=!0,o?.sharedModel.setSource(t);let a=0;a=t.indexOf(`
1
+ import{r as v,J as Xe,j as m,kB as Dt,I as J,fn as Ke,cO as me,bB as ge,v as Y,fM as At,fF as Ze,fY as jt,kC as It,kD as Nt,kE as Qe,kF as et,ct as V,kG as Lt,kH as Rt,kI as Ot,b$ as je,kJ as ft,kK as mt,kL as Ft,kM as ue,b1 as Bt,c0 as Ue,kN as gt,kO as Wt,kP as tt,am as N,kQ as nt,kR as fe,kS as Vt,kT as Ht,kU as Gt,aT as pe,kV as Le,kW as st,aU as ke,aV as ee,bw as $t,eY as zt,cq as U,ku as Kt,aO as Ut,cz as qt,aQ as Z,dV as Jt,ei as Yt,hk as We,hi as pt,kX as xe,eJ as Se,kY as be,kZ as Xt,k_ as Zt,aY as Qt,aR as en,ks as tn,k$ as _t,h4 as K,l0 as nn,l1 as R,l2 as sn,dP as on,l3 as vt,l4 as rn,l5 as an,l6 as ln,Z as ne,B as he,e0 as dn,_ as cn,aL as hn,eN as ot,eO as de,eP as un,cE as fn,k as mn,l7 as gn,l8 as yt,hA as pn,l9 as ae,bA as D,z as le,a9 as it,aF as Ct,dI as _n,dF as vn,bJ as Me,V as yn,U as Cn,aZ as bn,b4 as wn}from"../datalayer-app-main.js";import{b as kn,c as xn,f as ce,P as Re,d as Sn,W as Mn,r as En,g as Tn,h as Pn,i as Dn,C as An,a as jn}from"./index-DE0JwlLw.js";import{c as In,N as Ve}from"./NotebookSkeleton-DHQ--KEB.js";import{H as Nn}from"./hoverbox-CStlKQWE.js";import{R as bt,L as Ln}from"./index-Dqc2hT2k.js";import{a as Rn,W as rt}from"./renderer-DTpEU9RO.js";import{C as Ee,S as Te}from"./SquareIcon-Dy3l3VdH.js";function On(...r){return v.useCallback(e=>{for(const t of r)typeof t=="function"?t(e):t&&(t.current=e)},r)}var Q={Banner:"prc-Banner-Banner-IR8eJ",BannerContainer:"prc-Banner-BannerContainer-lbx3d",BannerContent:"prc-Banner-BannerContent-zTITK",BannerActions:"prc-Banner-BannerActions-XCfHL",BannerTitle:"prc-Banner-BannerTitle-TcuJl",BannerIcon:"prc-Banner-BannerIcon-WuOyf",BannerDismiss:"prc-Banner-BannerDismiss-uBZVm",BannerActionsContainer:"prc-Banner-BannerActionsContainer-ukGMH"};const Fn={critical:m.jsx(It,{}),info:m.jsx(Ze,{}),success:m.jsx(jt,{}),upsell:m.jsx(Ze,{}),warning:m.jsx(At,{})},Bn={critical:"Critical",info:"Information",success:"Success",upsell:"Recommendation",warning:"Warning"},Wn=Xe.forwardRef(function({"aria-label":e,children:t,className:n,description:s,hideTitle:o,icon:i,onDismiss:a,primaryAction:l,secondaryAction:d,title:c,variant:h="info",...u},f){const _=!!a,y=l||d,A=Xe.useRef(null),j=On(f,A),p=h==="info"||h==="upsell";return m.jsxs("section",{...u,"aria-label":e??Bn[h],className:me(n,Q.Banner),"data-dismissible":a?"":void 0,"data-title-hidden":o?"":void 0,"data-variant":h,tabIndex:-1,ref:j,children:[m.jsx("div",{className:Q.BannerIcon,children:i&&p?i:Fn[h]}),m.jsxs("div",{className:Q.BannerContainer,children:[m.jsxs("div",{className:Q.BannerContent,children:[c?o?m.jsx(Dt,{children:m.jsx(He,{children:c})}):m.jsx(He,{children:c}):null,s?m.jsx(wt,{children:s}):null,t]}),y?m.jsx(Vn,{primaryAction:l,secondaryAction:d}):null]}),_?m.jsx(J,{"aria-label":"Dismiss banner",onClick:a,className:Q.BannerDismiss,icon:Ke,variant:"invisible"}):null]})});function He(r){const e=ge.c(12);let t,n,s,o;e[0]!==r?({as:o,className:n,children:t,...s}=r,e[0]=r,e[1]=t,e[2]=n,e[3]=s,e[4]=o):(t=e[1],n=e[2],s=e[3],o=e[4]);const i=o===void 0?"h2":o;let a;e[5]!==n?(a=me(n,Q.BannerTitle),e[5]=n,e[6]=a):a=e[6];let l;return e[7]!==i||e[8]!==t||e[9]!==s||e[10]!==a?(l=m.jsx(i,{...s,className:a,"data-banner-title":"",children:t}),e[7]=i,e[8]=t,e[9]=s,e[10]=a,e[11]=l):l=e[11],l}function wt(r){const e=ge.c(10);let t,n,s;e[0]!==r?({children:t,className:n,...s}=r,e[0]=r,e[1]=t,e[2]=n,e[3]=s):(t=e[1],n=e[2],s=e[3]);let o;e[4]!==n?(o=me("BannerDescription",n),e[4]=n,e[5]=o):o=e[5];let i;return e[6]!==t||e[7]!==s||e[8]!==o?(i=m.jsx("div",{...s,className:o,children:t}),e[6]=t,e[7]=s,e[8]=o,e[9]=i):i=e[9],i}function Vn(r){const e=ge.c(9),{primaryAction:t,secondaryAction:n}=r,s=n??null,o=t??null;let i;e[0]!==s||e[1]!==o?(i=m.jsxs("div",{className:Q.BannerActionsContainer,"data-primary-action":"trailing",children:[s,o]}),e[0]=s,e[1]=o,e[2]=i):i=e[2];const a=t??null,l=n??null;let d;e[3]!==a||e[4]!==l?(d=m.jsxs("div",{className:Q.BannerActionsContainer,"data-primary-action":"leading",children:[a,l]}),e[3]=a,e[4]=l,e[5]=d):d=e[5];let c;return e[6]!==i||e[7]!==d?(c=m.jsxs("div",{className:Q.BannerActions,children:[i,d]}),e[6]=i,e[7]=d,e[8]=c):c=e[8],c}const kt=v.forwardRef((r,e)=>{const t=ge.c(11);let n,s,o;t[0]!==r?({children:n,className:s,...o}=r,t[0]=r,t[1]=n,t[2]=s,t[3]=o):(n=t[1],s=t[2],o=t[3]);let i;t[4]!==s?(i=me("BannerPrimaryAction",s),t[4]=s,t[5]=i):i=t[5];let a;return t[6]!==n||t[7]!==e||t[8]!==o||t[9]!==i?(a=m.jsx(Y,{ref:e,className:i,variant:"default",...o,children:n}),t[6]=n,t[7]=e,t[8]=o,t[9]=i,t[10]=a):a=t[10],a});kt.displayName="BannerPrimaryAction";const xt=v.forwardRef((r,e)=>{const t=ge.c(11);let n,s,o;t[0]!==r?({children:n,className:s,...o}=r,t[0]=r,t[1]=n,t[2]=s,t[3]=o):(n=t[1],s=t[2],o=t[3]);let i;t[4]!==s?(i=me("BannerPrimaryAction",s),t[4]=s,t[5]=i):i=t[5];let a;return t[6]!==n||t[7]!==e||t[8]!==o||t[9]!==i?(a=m.jsx(Y,{ref:e,className:i,variant:"link",...o,children:n}),t[6]=n,t[7]=e,t[8]=o,t[9]=i,t[10]=a):a=t[10],a});xt.displayName="BannerSecondaryAction";const Hn=Object.assign(Wn,{Title:He,Description:wt,PrimaryAction:kt,SecondaryAction:xt}),_e=Rt.define({combine(r){return r[r.length-1]}}),Gn=je.baseTheme({".jp-remote-cursor":{borderLeft:"1px solid black",marginLeft:"-1px"},".jp-remote-cursor.jp-mod-primary":{borderLeftWidth:"2px"},".jp-remote-selection":{opacity:.5},".cm-tooltip":{border:"none"},".cm-tooltip.jp-remote-userInfo":{color:"var(--fgColor-onEmphasis, #ffffff)",padding:"0px 2px"}});function qe(r,e){const t=r?.username||r?.display_name||r?.name||String(e),{theme:n,colorMode:s}=Bt.getState(),o=s==="auto"?typeof window<"u"&&window.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light":s;return In(t,n,o)}const Ie=Ot.define();class St{style;marker;constructor(e,t){this.style=e,this.marker=t}draw(){const e=this.marker.draw();for(const[t,n]of Object.entries(this.style))e.style[t]=n;return e}eq(e){return this.marker.eq(e.marker)&&V.deepEqual(this.style,e.style)}update(e,t){for(const[n,s]of Object.entries(this.style))e.style[n]=s;return this.marker.update(e,t.marker)}}const $n=ft({above:!0,markers(r){const{awareness:e,ytext:t}=r.state.facet(_e),n=t.doc,s=[];return e.getStates().forEach((o,i)=>{if(i===e.doc.clientID)return;const a=o.cursors;for(const l of a??[]){if(!l?.anchor||!l?.head)return;const d=ue(l.anchor,n),c=ue(l.head,n);if(d?.type!==t||c?.type!==t)return;const h=l.primary??!0?"jp-remote-cursor jp-mod-primary":"jp-remote-cursor",u=Ue.cursor(c.index,c.index>d.index?-1:1);for(const f of gt.forRange(r,h,u))s.push(new St({borderLeftColor:qe(o.user,i)},f))}}),s},update(r,e){return!!r.transactions.find(t=>t.annotation(Ie))},class:"jp-remote-cursors"});function at(r){const e=new Array,{awareness:t,ytext:n}=r.facet(_e),s=n.doc;for(const[o,i]of t.getStates())if(o!==t.doc.clientID)for(const a of i.cursors??[]){if(!a?.head)continue;const l=ue(a.head,s);l?.type===n&&e.push({pos:l.index,above:!0,create:()=>{const d=document.createElement("div");return d.classList.add("jp-remote-userInfo"),d.style.backgroundColor=qe(i.user,o),d.textContent=i.user?.display_name??"Anonymous",{dom:d}}})}return e}const zn=mt.define({create:at,update(r,e){return e.annotation(Ie)?at(e.state):r},provide(r){return Ft.computeN([r],e=>e.field(r))}}),Kn=ft({above:!1,markers(r){const{awareness:e,ytext:t}=r.state.facet(_e),n=t.doc,s=[];return e.getStates().forEach((o,i)=>{if(i===e.doc.clientID)return;const a=o.cursors;for(const l of a??[]){if((l.empty??!0)||!l?.anchor||!l?.head)return;const d=ue(l.anchor,n),c=ue(l.head,n);if(d?.type!==t||c?.type!==t)return;const h="jp-remote-selection";for(const u of gt.forRange(r,h,Ue.range(d.index,c.index)))s.push(new St({backgroundColor:qe(o.user,i)},u))}}),s},update(r,e){return!!r.transactions.find(t=>t.annotation(Ie))},class:"jp-remote-selections"}),Un=Nt.fromClass(class{editorAwareness;_listener;constructor(r){this.editorAwareness=r.state.facet(_e),this._listener=({added:e,updated:t,removed:n})=>{e.concat(t).concat(n).findIndex(o=>o!==this.editorAwareness.awareness.doc.clientID)>=0&&r.dispatch({annotations:[Ie.of([])]})},this.editorAwareness.awareness.on("change",this._listener)}destroy(){this.editorAwareness.awareness.off("change",this._listener)}update(r){if(!r.docChanged&&!r.selectionSet)return;const{awareness:e,ytext:t}=this.editorAwareness,n=e.getLocalState();if(n){const s=r.view.hasFocus&&r.view.dom.ownerDocument.hasFocus(),o=r.state.selection,i=new Array;if(s&&o){for(const a of o.ranges){const l=a===o.main,d=Qe(t,a.anchor),c=Qe(t,a.head);i.push({anchor:d,head:c,primary:l,empty:a.empty})}if(!n.cursors||i.length>0){const a=n.cursors?.map(l=>({...l,anchor:l?.anchor?et(l.anchor):null,head:l?.head?et(l.head):null}));V.deepEqual(i,a)||e.setLocalStateField("cursors",i)}}}}},{provide:()=>[Gn,$n,Kn,zn,Lt({position:"absolute",parent:document.body})]});function qn(r){return[_e.of(r),Un]}class Ne extends Wt{constructor(e={}){var t;super(),this.version="2.0.0",this.ymeta=this.ydoc.getMap("meta"),this._onMetaChanged=n=>{const s=n.find(i=>i.target===this.ymeta.get("metadata"));if(s){const i=s.changes.keys,a=this.ymeta.get("metadata");s.changes.keys.forEach((l,d)=>{switch(l.action){case"add":this._metadataChanged.emit({key:d,type:"add",newValue:a.get(d)});break;case"delete":this._metadataChanged.emit({key:d,type:"remove",oldValue:l.oldValue});break;case"update":{const c=a.get(d),h=l.oldValue;let u=!0;typeof h=="object"&&typeof c=="object"?u=V.deepEqual(h,c):u=h===c,u||this._metadataChanged.emit({key:d,type:"change",oldValue:h,newValue:c})}break}}),this._changed.emit({metadataChange:i})}const o=n.find(i=>i.target===this.ymeta);if(o){if(o.keysChanged.has("metadata")){const i=o.changes.keys.get("metadata");if(i?.action==="add"&&!i.oldValue){const a=new Map;for(const l of Object.keys(this.metadata))a.set(l,{action:"add",oldValue:void 0}),this._metadataChanged.emit({key:l,type:"add",newValue:this.getMetadata(l)});this._changed.emit({metadataChange:a})}}if(o.keysChanged.has("nbformat")){const i=o.changes.keys.get("nbformat"),a={key:"nbformat",oldValue:i?.oldValue?i.oldValue:void 0,newValue:this.nbformat};this._changed.emit({nbformatChanged:a})}if(o.keysChanged.has("nbformat_minor")){const i=o.changes.keys.get("nbformat_minor"),a={key:"nbformat_minor",oldValue:i?.oldValue?i.oldValue:void 0,newValue:this.nbformat_minor};this._changed.emit({nbformatChanged:a})}}},this._onYCellsChanged=n=>{n.changes.added.forEach(i=>{const a=i.content.type;if(!this._ycellMapping.has(a)){const l=tt(a,{notebook:this});this._ycellMapping.set(a,l)}}),n.changes.deleted.forEach(i=>{const a=i.content.type,l=this._ycellMapping.get(a);l&&(l.dispose(),this._ycellMapping.delete(a))});let s=0;const o=[];n.changes.delta.forEach(i=>{if(i.insert!=null){const a=i.insert.map(l=>this._ycellMapping.get(l));o.push({insert:a}),this.cells.splice(s,0,...a),s+=i.insert.length}else i.delete!=null?(o.push(i),this.cells.splice(s,i.delete)):i.retain!=null&&(o.push(i),s+=i.retain)}),this._changed.emit({cellsChange:o})},this._metadataChanged=new N(this),this._ycells=this.ydoc.getArray("cells"),this._ycellMapping=new WeakMap,this._disableDocumentWideUndoRedo=(t=e.disableDocumentWideUndoRedo)!==null&&t!==void 0?t:!1,this.cells=this._ycells.toArray().map(n=>(this._ycellMapping.has(n)||this._ycellMapping.set(n,tt(n,{notebook:this})),this._ycellMapping.get(n))),this.undoManager.addToScope(this._ycells),this._ycells.observe(this._onYCellsChanged),this.ymeta.observeDeep(this._onMetaChanged)}static create(e={}){var t,n,s,o,i,a,l,d,c;const h=new Ne({disableDocumentWideUndoRedo:(t=e.disableDocumentWideUndoRedo)!==null&&t!==void 0?t:!1}),u={cells:(s=(n=e.data)===null||n===void 0?void 0:n.cells)!==null&&s!==void 0?s:[],nbformat:(i=(o=e.data)===null||o===void 0?void 0:o.nbformat)!==null&&i!==void 0?i:4,nbformat_minor:(l=(a=e.data)===null||a===void 0?void 0:a.nbformat_minor)!==null&&l!==void 0?l:5,metadata:(c=(d=e.data)===null||d===void 0?void 0:d.metadata)!==null&&c!==void 0?c:{}};return h.setSource(u),h}get disableDocumentWideUndoRedo(){return this._disableDocumentWideUndoRedo}get metadata(){return this.getMetadata()}set metadata(e){this.setMetadata(e)}get metadataChanged(){return this._metadataChanged}get nbformat(){return this.ymeta.get("nbformat")}set nbformat(e){this.transact(()=>{this.ymeta.set("nbformat",e)},!1)}get nbformat_minor(){return this.ymeta.get("nbformat_minor")}set nbformat_minor(e){this.transact(()=>{this.ymeta.set("nbformat_minor",e)},!1)}dispose(){this.isDisposed||(this._ycells.unobserve(this._onYCellsChanged),this.ymeta.unobserveDeep(this._onMetaChanged),super.dispose())}getCell(e){return this.cells[e]}addCell(e){return this.insertCell(this._ycells.length,e)}insertCell(e,t){return this.insertCells(e,[t])[0]}insertCells(e,t){const n=t.map(s=>{const o=nt(s,this);return this._ycellMapping.set(o.ymodel,o),o});return this.transact(()=>{this._ycells.insert(e,n.map(s=>s.ymodel))}),this.dirty=!0,n}moveCell(e,t){this.moveCells(e,t)}moveCells(e,t,n=1){const s=new Array(n).fill(!0).map((o,i)=>this.getCell(e+i).toJSON());this.transact(()=>{this._ycells.delete(e,n),this._ycells.insert(e>t?t:t-n+1,s.map(o=>nt(o,this).ymodel))}),this.dirty=!0}deleteCell(e){this.deleteCellRange(e,e+1)}deleteCellRange(e,t){this.transact(()=>{this._ycells.delete(e,t-e)}),this.dirty=!0}deleteMetadata(e){if(typeof this.getMetadata(e)>"u")return;const t=this.metadata;delete t[e],this.setMetadata(t)}getMetadata(e){const t=this.ymeta.get("metadata");if(t!==void 0)if(typeof e=="string"){const n=t.get(e);return typeof n>"u"?void 0:V.deepCopy(n)}else return V.deepCopy(t.toJSON())}setMetadata(e,t){var n;if(typeof e=="string"){if(typeof t>"u")throw new TypeError(`Metadata value for ${e} cannot be 'undefined'; use deleteMetadata.`);if(V.deepEqual((n=this.getMetadata(e))!==null&&n!==void 0?n:null,t))return;const s={};s[e]=t,this.updateMetadata(s)}else if(!this.metadata||!V.deepEqual(this.metadata,e)){const s=V.deepCopy(e),o=this.ymeta.get("metadata");if(o===void 0)return;this.transact(()=>{o.clear();for(const[i,a]of Object.entries(s))o.set(i,a)}),this.dirty=!0}}updateMetadata(e){const t=V.deepCopy(e),n=this.ymeta.get("metadata");n!==void 0&&(this.transact(()=>{for(const[s,o]of Object.entries(t))n.set(s,o)}),this.dirty=!0)}getSource(){return this.toJSON()}setSource(e){this.fromJSON(e),this.dirty=!1}fromJSON(e){this.transact(()=>{this.nbformat=e.nbformat,this.nbformat_minor=e.nbformat_minor;const t=e.metadata;if(t.orig_nbformat!==void 0&&delete t.orig_nbformat,this.metadata)this.metadata=t;else{const o=new fe;for(const[i,a]of Object.entries(t))o.set(i,a);this.ymeta.set("metadata",o)}const n=e.nbformat===4&&e.nbformat_minor>=5,s=e.cells.map(o=>(n||delete o.id,o));this.insertCells(this.cells.length,s),this.deleteCellRange(0,this.cells.length)})}toJSON(){const e=this.nbformat===4&&this.nbformat_minor<=4;return Ge({metadata:this.metadata,nbformat_minor:this.nbformat_minor,nbformat:this.nbformat,cells:this.cells.map(t=>{const n=t.toJSON();return e&&delete n.id,n})})}}function Ge(r){if(Array.isArray(r))return r.map(e=>Ge(e));if(r!==null&&typeof r=="object"){const e={},t=Object.entries(r).sort(([n],[s])=>n<s?-1:n>s?1:0);for(const[n,s]of t)Object.defineProperty(e,n,{value:Ge(s),enumerable:!0,writable:!0,configurable:!0});return e}return r}class Jn{constructor(e){this.model=e,this._cellMap=new WeakMap,this._changed=new N(this),this._isDisposed=!1,this._insertCells(0,this.model.cells),this.model.changed.connect(this._onSharedModelChanged,this)}get changed(){return this._changed}get isDisposed(){return this._isDisposed}get length(){return this.model.cells.length}*[Symbol.iterator](){for(const e of this.model.cells)yield this._cellMap.get(e)}dispose(){var e;if(!this._isDisposed){this._isDisposed=!0;for(const t of this.model.cells)(e=this._cellMap.get(t))===null||e===void 0||e.dispose();N.clearData(this)}}get(e){return this._cellMap.get(this.model.cells[e])}_insertCells(e,t){return t.forEach(n=>{let s;switch(n.cell_type){case"code":{s=new Gt({sharedModel:n});break}case"markdown":{s=new Ht({sharedModel:n});break}default:s=new Vt({sharedModel:n})}this._cellMap.set(n,s),n.disposed.connect(()=>{s.dispose(),this._cellMap.delete(n)})}),this.length}_onSharedModelChanged(e,t){var n;let s=0;const o=new Array;(n=t.cellsChange)===null||n===void 0||n.forEach(i=>{i.insert!=null?(this._insertCells(s,i.insert),o.push({type:"add",newIndex:s,newValues:i.insert.map(a=>this._cellMap.get(a)),oldIndex:-2,oldValues:[]}),s+=i.insert.length):i.delete!=null?o.push({type:"remove",newIndex:-1,newValues:[],oldIndex:s,oldValues:new Array(i.delete).fill(void 0)}):i.retain!=null&&(s+=i.retain)}),o.forEach(i=>this._changed.emit(i))}}class Yn{constructor(e){this._requestBatchSize=10,this._cursor=0,this._hasSession=!1,this._history=[],this._placeholder="",this._kernelSession="",this._setByHistory=!1,this._isDisposed=!1,this._editor=null,this._filtered=[],this._kernel=null,this._sessionContext=e.sessionContext,this._trans=(e.translator||pe).load("jupyterlab"),this._toRequest=this._requestBatchSize,this._handleKernel().then(()=>{this._sessionContext.kernelChanged.connect(this._handleKernel,this)})}get editor(){return this._editor}set editor(e){if(this._editor===e)return;const t=this._editor;t&&t.model.sharedModel.changed.disconnect(this.onTextChange,this),this._editor=e,e&&e.model.sharedModel.changed.connect(this.onTextChange,this)}get placeholder(){return this._placeholder}get kernelSession(){return this._kernelSession}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed=!0,this._history.length=0,N.clearData(this)}async checkSession(e){var t;this._hasSession||(await this._retrieveHistory(),this._hasSession=!0,this.editor=e.editor,this._placeholder=((t=this._editor)===null||t===void 0?void 0:t.model.sharedModel.getSource())||"",this.setFilter(this._placeholder),this._cursor=this._filtered.length-1)}async back(e){return await this.checkSession(e),--this._cursor,this._cursor<0&&await this.fetchBatch(),this._cursor=Math.max(0,this._cursor),this._filtered[this._cursor]}async forward(e){return await this.checkSession(e),++this._cursor,this._cursor=Math.min(this._filtered.length-1,this._cursor),this._filtered[this._cursor]}updateEditor(e,t){var n,s;if(e){const o=(n=e.editor)===null||n===void 0?void 0:n.model,i=o?.sharedModel.getSource();if(this.isDisposed||!t||i===t)return;this._setByHistory=!0,o?.sharedModel.setSource(t);let a=0;a=t.indexOf(`
2
2
  `),a<0&&(a=t.length),(s=e.editor)===null||s===void 0||s.setCursorPosition({line:0,column:a})}}reset(){this._hasSession=!1,this._placeholder="",this._toRequest=this._requestBatchSize}async fetchBatch(){this._toRequest+=this._requestBatchSize;let e=this._filtered.slice().reverse(),t=this._history.slice();await this._retrieveHistory().then(()=>{this.setFilter(this._placeholder);let n=0,s=this._filtered.slice().reverse();for(let o=0;o<e.length;o++){let i=e[o];for(let a=o+n;a<s.length&&i!==s[a];a++)n+=1}this._cursor=this._filtered.length-(e.length+1)-n}),this._cursor<0&&this._history.length>t.length&&await this.fetchBatch()}onHistory(e,t){this._history.length=0;let n=["","",""],s=["","",""],o="";if(e.content.status==="ok"){for(let i=0;i<e.content.history.length;i++)s=e.content.history[i],s!==n&&(o=e.content.history[i][0],this._history.push(n=s));this.kernelSession||s[2]==t?.model.sharedModel.getSource()&&(this._kernelSession=o)}}onTextChange(){if(this._setByHistory){this._setByHistory=!1;return}this.reset()}async _handleKernel(){var e;if(this._kernel=(e=this._sessionContext.session)===null||e===void 0?void 0:e.kernel,!this._kernel){this._history.length=0;return}await this._retrieveHistory().catch()}async _retrieveHistory(e){var t;return await((t=this._kernel)===null||t===void 0?void 0:t.requestHistory(Xn(this._toRequest)).then(n=>{this.onHistory(n,e)}).catch(()=>{console.warn(this._trans.__("History was unable to be retrieved"))}))}setFilter(e=""){this._filtered.length=0;let t="",n="";for(let s=0;s<this._history.length;s++)n=this._history[s][2],n!==t&&e!==n&&this._filtered.push(t=n);this._filtered.push(e)}}function Xn(r){return{output:!1,raw:!0,hist_access_type:"tail",n:r}}class $e{constructor(e={}){var t,n;this.standaloneModel=!1,this._readOnly=!1,this._contentChanged=new N(this),this._stateChanged=new N(this),this._isDisposed=!1,this._metadataChanged=new N(this),this.standaloneModel=typeof e.sharedModel>"u",e.sharedModel?this.sharedModel=e.sharedModel:this.sharedModel=Ne.create({disableDocumentWideUndoRedo:(t=e.disableDocumentWideUndoRedo)!==null&&t!==void 0?t:!0,data:{nbformat:st,nbformat_minor:Le,metadata:{kernelspec:{name:"",display_name:""},language_info:{name:(n=e.languagePreference)!==null&&n!==void 0?n:""}}}}),this._cells=new Jn(this.sharedModel),this._trans=(e.translator||pe).load("jupyterlab"),this._deletedCells=[],this._collaborationEnabled=!!e?.collaborationEnabled,this._cells.changed.connect(this._onCellsChanged,this),this.sharedModel.changed.connect(this._onStateChanged,this),this.sharedModel.metadataChanged.connect(this._onMetadataChanged,this)}get contentChanged(){return this._contentChanged}get metadataChanged(){return this._metadataChanged}get stateChanged(){return this._stateChanged}get cells(){return this._cells}get dirty(){return this.sharedModel.dirty}set dirty(e){const t=this.dirty;e!==t&&(this.sharedModel.dirty=e)}get readOnly(){return this._readOnly}set readOnly(e){if(e===this._readOnly)return;const t=this._readOnly;this._readOnly=e,this.triggerStateChange({name:"readOnly",oldValue:t,newValue:e})}get metadata(){return this.sharedModel.metadata}get nbformat(){return this.sharedModel.nbformat}get nbformatMinor(){return this.sharedModel.nbformat_minor}get defaultKernelName(){var e;const t=this.getMetadata("kernelspec");return(e=t?.name)!==null&&e!==void 0?e:""}get deletedCells(){return this._deletedCells}get defaultKernelLanguage(){var e;const t=this.getMetadata("language_info");return(e=t?.name)!==null&&e!==void 0?e:""}get collaborative(){return this._collaborationEnabled}dispose(){if(this.isDisposed)return;this._isDisposed=!0;const e=this.cells;this._cells=null,e.dispose(),this.standaloneModel&&this.sharedModel.dispose(),N.clearData(this)}deleteMetadata(e){return this.sharedModel.deleteMetadata(e)}getMetadata(e){return this.sharedModel.getMetadata(e)}setMetadata(e,t){typeof t>"u"?this.sharedModel.deleteMetadata(e):this.sharedModel.setMetadata(e,t)}toString(){return JSON.stringify(this.toJSON())}fromString(e){this.fromJSON(JSON.parse(e))}toJSON(){return this._ensureMetadata(),this.sharedModel.toJSON()}fromJSON(e){var t,n;const s=V.deepCopy(e),o=e.metadata.orig_nbformat;if(s.nbformat=Math.max(e.nbformat,st),(s.nbformat!==e.nbformat||s.nbformat_minor<Le)&&(s.nbformat_minor=Le),o!==void 0&&s.nbformat!==o){const i=s.nbformat>o;let a;i?a=this._trans.__(`This notebook has been converted from an older notebook format (v%1)
3
3
  to the current notebook format (v%2).
4
4
  The next time you save this notebook, the current notebook format (v%2) will be used.
@@ -0,0 +1,32 @@
1
+ import{ag as K,fi as Eo,r as s,j as n,hv as Ro,hw as Mo,cq as bs,B as S,H as Mt,T as N,v as Q,dG as pn,fG as xn,hx as ce,a9 as At,hy as Ao,y as Io,hz as Oo,aI as Po,fm as $o,hA as Uo,bh as _o,hB as Lo,hC as Fo,hD as Bo,hE as zo,hF as No,hG as Vo,hH as Ps,f9 as $s,f7 as Ho,dC as Do,fa as Sn,hI as Wo,hJ as Go,hK as Ko,hL as vs,hM as Yo,hN as Us,hO as qo,hP as Jo,hQ as Qo,hR as _s,hS as Zo,hT as Ls,hU as Fs,hV as Xo,L as ea,hW as ta,dI as fn,I as Bs,hu as na,bA as dt,D as zs,hX as xs,hY as sa,hZ as oa,E as aa,cP as ia,h_ as ra,h$ as la,i0 as ca,i1 as da,i2 as ua,i3 as pa,ab as mn,i4 as fa,i5 as ma,i6 as ga,i7 as ha,i8 as ba,i9 as va,ia as xa,ib as Sa,ic as ya,id as wa,ie as ka,ig as Ca,ih as ja,ii as Ta,ij as Ea,ik as Ra,il as Ma,im as Aa,io as Ia,ip as Oa,iq as Pa,ir as mt,is as $a,it as Ua,iu as _a,iv as La,iw as Ss,ix as Fa,iy as Ge,iz as Ba,iA as za,cQ as ut,iB as Na,iC as Va,iD as ys,iE as Ha,iF as Da,iG as Wa,iH as Ga,iI as Ka,iJ as Ya,iK as qa,iL as Ja,iM as Qa,fQ as Za,iN as pt,iO as le,iP as Xa,iQ as ei,iR as ti,iS as ni,iT as ws,iU as si,iV as oi,iW as ai,iX as ii,iY as ri,fO as li,fS as ci,iZ as di,i_ as ui,i$ as pi,j0 as fi,j1 as mi,j2 as gi,j3 as ft,j4 as hi,j5 as bi,j6 as vi,j7 as xi,j8 as Si,j9 as yi,ja as wi,jb as ks,jc as ki,jd as Ci,je as ji,jf as Ti,jg as Cs,jh as yn,ji as Ei,a2 as gn,jj as Ri}from"../datalayer-app-main.js";import{S as Mi,E as Ai}from"./SignInIcon-D1-wo8qx.js";import{F as Ii,a as Oi,b as Pi}from"./LinkedInGreyIcon-eBP5iBjI.js";function Ns(){const e=K(Eo);return s.useMemo(()=>e.map(o=>o.value),[e])}const hn={github:{name:"github",oauth2CallbackServerRoute:"jupyter_iam/oauth2/callback",oauth2CallbackUIRoute:"/iam/oauth2/github/callback"},google:{name:"google",oauth2CallbackServerRoute:"jupyter_iam/oauth2/callback",oauth2CallbackUIRoute:"/iam/oauth2/google/callback"},linkedin:{name:"linkedin",oauth2CallbackServerRoute:"jupyter_iam/oauth2/callback",oauth2CallbackUIRoute:"/iam/oauth2/linkedin/callback"}},js=()=>{if(typeof document>"u")return"";const e=document.getElementById("datalayer-config-data");if(!e?.textContent)return"";try{const o=JSON.parse(e.textContent);return String(o?.iamUrl||"").replace(/\/$/,"")}catch{return""}},$i=(e,o="Unable to start social sign-in.")=>{if(e instanceof Error&&e.message)return e.message;if(typeof e=="string"&&e.trim())return e;if(e&&typeof e=="object"&&"message"in e){const a=e.message;if(typeof a=="string"&&a.trim())return a}return o},Ui=Uo`
2
+ .signin-input-theme-scope input:-webkit-autofill,
3
+ .signin-input-theme-scope input:-webkit-autofill:hover,
4
+ .signin-input-theme-scope input:-webkit-autofill:focus,
5
+ .signin-input-theme-scope input:-webkit-autofill:active,
6
+ .signin-input-theme-scope input:-webkit-autofill:disabled,
7
+ .signin-input-theme-scope textarea:-webkit-autofill,
8
+ .signin-input-theme-scope textarea:-webkit-autofill:hover,
9
+ .signin-input-theme-scope textarea:-webkit-autofill:focus,
10
+ .signin-input-theme-scope textarea:-webkit-autofill:active,
11
+ .signin-input-theme-scope textarea:-webkit-autofill:disabled {
12
+ -webkit-text-fill-color: var(--fgColor-default) !important;
13
+ caret-color: var(--fgColor-default) !important;
14
+ -webkit-box-shadow: 0 0 0 1000px var(--bgColor-default) inset !important;
15
+ box-shadow: 0 0 0 1000px var(--bgColor-default) inset !important;
16
+ background-color: var(--bgColor-default) !important;
17
+ transition: background-color 9999s ease-in-out 0s !important;
18
+ }
19
+
20
+ .signin-input-theme-scope input:disabled,
21
+ .signin-input-theme-scope textarea:disabled {
22
+ -webkit-text-fill-color: var(--fgColor-muted) !important;
23
+ -webkit-box-shadow: 0 0 0 1000px var(--bgColor-default) inset !important;
24
+ box-shadow: 0 0 0 1000px var(--bgColor-default) inset !important;
25
+ background-color: var(--bgColor-default) !important;
26
+ opacity: 1 !important;
27
+ }
28
+ `,_i=({onSignIn:e,onApiKeySignIn:o,loginUrl:a,name:i,title:c="Datalayer OTEL",description:d="Sign in to access the observability dashboard.",icon:b,leadingIcon:l=n.jsx($o,{size:24}),github:p=!1,google:h=!1,linkedin:y=!1,apiKey:g=!1,signUp:C=!0,socialSignInNavigationTarget:m,asDoc:f=!1,fillHeight:k=!0,hideHero:A=!1,calloutTitle:M,calloutDescription:ne,passwordToggleLabel:ke="Sign in with a password",signUpTitle:B="Don't have an account?",signUpDescription:It="Create a free Datalayer account with your email address.",signUpLabel:Ot="Sign up with email",signUpHref:Pt="https://datalayer.ai/signup",onSignUp:ue,forgotPasswordHref:Ce="/password",forgotPasswordLabel:pe="Forgot password?",showForgotPassword:$t=!0,socialButtonMarginTop:$e=3,actionButtonMaxWidth:W=320})=>{const xe=f&&!A,Ke=i??(f&&c==="Datalayer OTEL"?"Datalayer Sign In":c),Ut=b??(f?n.jsx(Mi,{size:24}):l),j=s.useMemo(()=>{if(a)return a;const v=js();return v?`${v}/api/iam/v1/login`:"/api/iam/v1/login"},[a]),[te,gt]=s.useState(""),[Se,_t]=s.useState(""),[P,Lt]=s.useState(!1),[fe,Ft]=s.useState(!1),[$,Ue]=s.useState(!1),[je,ht]=s.useState(!1),[me,Ye]=s.useState(null),[Y,bt]=s.useState(null),[Te,Bt]=s.useState(""),[Ee,zt]=s.useState(null),[vt,se]=s.useState(null),{enqueueToast:ge}=Ro(),[_e,qe]=s.useState(!1),[he,Re]=s.useState(""),Je=s.useRef(null),Qe=s.useCallback(v=>Mo()?bs.URLExt.join(bs.PageConfig.getBaseUrl(),v.oauth2CallbackServerRoute):`${window.location.protocol}//${window.location.hostname}${window.location.port?`:${window.location.port}`:""}${v.oauth2CallbackUIRoute}`,[]),oe=s.useMemo(()=>{if(typeof window>"u")return"/";const v=`${window.location.pathname}${window.location.search}${window.location.hash}`;return v.startsWith("/")?v:"/"},[]),Le=s.useCallback(async v=>{if(!je){se(null),Ye(v.name),ht(!0);try{const U=js(),q=new URLSearchParams({provider:v.name,callback_uri:Qe(v)}),J=m===void 0?void 0:String(m||"").trim(),et=J===void 0?oe&&oe!=="/"?oe:void 0:J&&J.startsWith("/")&&!J.startsWith("//")?J:void 0;et&&q.set("post_auth_redirect",et);const I=`${U||""}/api/iam/v1/oauth2/authz/url?${q.toString()}`,L=await fetch(I),R=await L.json(),be=R?.autorization_url;if(!L.ok||!be)throw new Error(R?.message||"Unable to start social sign-in.");window.location.assign(be)}catch(U){const q=$i(U);se(q),ge(q,{variant:"error"}),Ye(null),ht(!1)}}},[Qe,oe,ge,je,m]);s.useEffect(()=>{_e&&Je.current?.focus()},[_e]);const ae=s.useCallback(()=>{qe(!1),Re("")},[]),_=s.useCallback(()=>{!he.trim()||!o||(o(he.trim()),ae())},[he,o,ae]),Ze=s.useCallback(()=>{if(ue){ue();return}window.location.assign(Pt)},[ue,Pt]),Me=s.useCallback(()=>{if(Ce){if(Ce.startsWith("http://")||Ce.startsWith("https://")){window.open(Ce,"_blank","noopener,noreferrer");return}window.location.assign(Ce)}},[Ce]),Fe=s.useCallback(async()=>{if(!(f||!te||!Se||$)){Ue(!0),se(null);try{const v=await fetch(j,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({handle:te,password:Se})});if(!v.ok)throw new Error(`HTTP ${v.status}`);const U=await v.json();if(U.success&&U.token){const q=String(U?.user?.id||U?.user?.uid||"").trim();if(!!U?.user?.mfaUrl&&q){bt(q),zt(U.token),se(null);return}e&&e(U.token,te)}else se(U.message||"Invalid username or password.")}catch(v){se(v instanceof Error?v.message:String(v))}finally{Ue(!1)}}},[f,te,Se,$,j,e]),Be=s.useCallback(async()=>{if(!(f||$||!Y||!Te.trim()||!Ee)){Ue(!0),se(null);try{const v=new URL(j,window.location.origin),U=v.pathname.endsWith("/api/iam/v1/login")?v.href.replace(/\/api\/iam\/v1\/login$/,""):`${v.origin}`,q=await fetch(`${U}/api/iam/v1/users/${Y}/mfa/validate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userUid:Y,code:Te.trim()})}),J=await q.json();if(!q.ok||!J?.success)throw new Error(J?.message||"Failed to validate your MFA code.");e&&e(Ee,te)}catch(v){const U=v instanceof Error?v.message:String(v);se(U),ge(U,{variant:"error"})}finally{Ue(!1)}}},[f,ge,te,$,j,Te,Ee,Y,e]),Z=s.useCallback(v=>{v.key==="Enter"&&(Y?Be():Fe())},[Y,Fe,Be]),Xe=je||$||f;return n.jsxs(S,{className:"signin-input-theme-scope",display:"flex",alignItems:A||xe||!k?"flex-start":"center",justifyContent:"center",minHeight:A||xe||!k?"auto":"100vh",bg:A?"transparent":"canvas.default",color:"fg.default",py:A?0:xe?2:4,children:[n.jsx(Ui,{}),n.jsxs(S,{width:"100%",maxWidth:440,p:0,children:[!A&&n.jsxs(n.Fragment,{children:[n.jsxs(S,{display:"flex",alignItems:"center",gap:2,mb:xe?2:3,justifyContent:"center",children:[Ut,n.jsx(Mt,{sx:{fontSize:3},children:Ke})]}),n.jsx(N,{as:"p",sx:{fontSize:1,color:"fg.muted",mb:xe?2:3,textAlign:"center"},children:d})]}),(M||ne)&&n.jsxs(S,{mb:3,textAlign:"center",children:[M&&n.jsx(Mt,{as:"h3",sx:{fontSize:2,mb:1},children:M}),ne&&n.jsx(N,{sx:{color:"fg.muted",fontSize:1},children:ne})]}),!Y&&(p||h||y)&&n.jsxs(n.Fragment,{children:[p&&n.jsx(Q,{block:!0,size:"large",leadingVisual:me==="github"?()=>n.jsx(pn,{size:"small"}):Ii,disabled:Xe,onClick:()=>Le(hn.github),sx:{mt:$e,maxWidth:W,mx:"auto"},children:"Sign in with GitHub"}),h&&n.jsx(Q,{block:!0,size:"large",leadingVisual:me==="google"?()=>n.jsx(pn,{size:"small"}):Oi,disabled:Xe,onClick:()=>Le(hn.google),sx:{mt:$e,maxWidth:W,mx:"auto"},children:"Sign in with Google"}),y&&n.jsx(Q,{block:!0,size:"large",leadingVisual:me==="linkedin"?()=>n.jsx(pn,{size:"small"}):Pi,disabled:Xe,onClick:()=>Le(hn.linkedin),sx:{mt:$e,maxWidth:W,mx:"auto"},children:"Sign in with LinkedIn"})]}),!Y&&!P&&n.jsx(S,{mt:3,display:"flex",justifyContent:"center",children:n.jsx(Q,{leadingVisual:xn,size:"large",block:!0,disabled:f||$||je,onClick:()=>Lt(!0),sx:{maxWidth:W,mx:"auto"},children:ke})}),!Y&&P&&n.jsxs(S,{mt:4,children:[n.jsxs(ce,{required:!0,sx:{mb:3},children:[n.jsx(ce.Label,{children:"Username"}),n.jsx(At,{autoFocus:!0,block:!0,placeholder:"Your username",value:te,disabled:$||f,onChange:v=>gt(v.target.value),onKeyDown:Z})]}),n.jsxs(ce,{required:!0,sx:{mb:3},children:[n.jsx(ce.Label,{children:"Password"}),n.jsx(At,{block:!0,placeholder:"Your password",type:fe?"text":"password",value:Se,disabled:$||f,onChange:v=>_t(v.target.value),onKeyDown:Z,trailingAction:n.jsx(At.Action,{onClick:()=>Ft(!fe),disabled:$||f,icon:fe?Ai:Ao,"aria-label":fe?"Hide password":"Show password",sx:{color:"var(--fgColor-muted)"}})})]}),n.jsxs(S,{display:"flex",alignItems:"center",justifyContent:"space-between",mt:3,children:[n.jsx(Q,{variant:"primary",disabled:$||f||!te||!Se,onClick:Fe,children:$?"Signing in…":"Sign In"}),$t&&n.jsx(Io,{as:"button",sx:{fontSize:1,cursor:f?"not-allowed":"pointer",background:"none",border:"none",opacity:f?.6:1},onClick:()=>{f||$||Me()},children:pe})]})]}),Y&&n.jsxs(n.Fragment,{children:[n.jsxs(ce,{required:!0,sx:{mb:3,mt:2},children:[n.jsx(ce.Label,{children:"MFA Code"}),n.jsx(At,{autoFocus:!0,block:!0,placeholder:"Your MFA code",value:Te,disabled:$||f,onChange:v=>Bt(v.target.value),onKeyDown:Z})]}),n.jsx(Q,{variant:"primary",block:!0,disabled:$||f||!Te.trim(),onClick:Be,sx:{maxWidth:W,mx:"auto"},children:$?"Validating…":"Validate MFA Code"})]}),vt&&n.jsx(N,{sx:{color:"danger.fg",fontSize:1,mt:3,display:"block"},children:vt}),C&&n.jsxs(S,{mt:4,pt:4,textAlign:"center",borderTop:"1px solid",borderColor:"border.muted",children:[n.jsx(Mt,{as:"h3",sx:{fontSize:2,mb:2},children:B}),n.jsx(N,{as:"p",sx:{color:"fg.muted",fontSize:1,mb:3},children:It}),n.jsx(S,{display:"flex",justifyContent:"center",children:n.jsx(Q,{variant:"primary",size:"large",leadingVisual:Oo,disabled:f||$,onClick:Ze,children:Ot})})]}),g&&o&&n.jsxs(n.Fragment,{children:[n.jsxs(S,{display:"flex",alignItems:"center",gap:2,my:3,children:[n.jsx(S,{flex:1,height:"1px",bg:"border.default"}),n.jsx(N,{sx:{fontSize:0,color:"fg.muted"},children:"or"}),n.jsx(S,{flex:1,height:"1px",bg:"border.default"})]}),n.jsx(Q,{block:!0,leadingVisual:xn,disabled:f||$||je,onClick:()=>qe(!0),sx:{maxWidth:W,mx:"auto"},children:"Sign in with an API Key"}),_e&&n.jsx(S,{role:"dialog","aria-modal":"true","aria-labelledby":"signin-api-key-title",onKeyDown:v=>{v.key==="Escape"&&ae()},onClick:ae,position:"fixed",inset:0,zIndex:200,p:3,bg:"canvas.backdrop",display:"flex",alignItems:"center",justifyContent:"center",children:n.jsxs(S,{as:"form",onClick:v=>v.stopPropagation(),onSubmit:v=>{v.preventDefault(),_()},width:"min(560px, 100%)",p:3,borderRadius:2,border:"1px solid",borderColor:"border.default",bg:"canvas.overlay",color:"fg.default",boxShadow:"shadow.large",children:[n.jsx(Mt,{id:"signin-api-key-title",sx:{fontSize:2,mb:2},children:"Enter your API Key"}),n.jsxs(ce,{required:!0,children:[n.jsx(ce.Label,{children:"API Key"}),n.jsx(Po,{block:!0,required:!0,autoFocus:!0,placeholder:"Paste your API key here",value:he,onInput:v=>Re(v.currentTarget.value),ref:Je})]}),n.jsxs(S,{mt:3,display:"flex",justifyContent:"flex-end",gap:2,children:[n.jsx(Q,{type:"button",onClick:ae,children:"Cancel"}),n.jsx(Q,{type:"submit",variant:"primary",disabled:!he.trim(),children:"Authenticate"})]})]})})]})]})]})},Ts=_o((e,o)=>({pending:void 0,suggest:(a,i)=>{const c=a.trim();c&&e({pending:{text:c,submit:i?.submit??!1,nonce:(o().pending?.nonce??0)+1}})},consume:()=>e({pending:void 0})}));function Li(e){const{agentId:o,instructions:a,model:i,frontendTools:c,inference:d,subagents:b,sharing:l,onSubagentEvent:p,modeEffect:h}=e;return{type:"browser-vercel-ai",endpoint:"",agentId:o,enableConfigQuery:!1,options:{instructions:a,model:i,frontendTools:c,inference:d,subagents:b,sharing:l,onSubagentEvent:p,modeEffect:h}}}const Fi=({state:e})=>Lo[e];class Bi extends Error{constructor(o,a){super(a),this.status=o,this.name="RuntimeRefusal"}status}function zi({baseUrl:e,getAccessToken:o,fetch:a}){const i=e.replace(/\/+$/,""),c=(p={})=>{const h=o();return{...p,...h?{Authorization:`Bearer ${h}`}:{}}},d=async p=>{throw new Bi(p.status,zo(p.status,p.statusText,await No(p)))};return{json:async(p,h="GET",y)=>{const g=await a(`${i}${p}`,{method:h,headers:c({Accept:"application/json",...y===void 0?{}:{"Content-Type":"application/json"}}),...y===void 0?{}:{body:JSON.stringify(y)}});return g.ok?await g.json():d(g)},stream:async(p,h,{onEvent:y,signal:g},C="POST")=>{const m=await a(`${i}${p}`,{method:C,headers:c({"Content-Type":"application/json",Accept:"text/event-stream"}),body:JSON.stringify(h),signal:g});if(!m.ok)return d(m);await Vo(m,y)},refused:d,headers:c,root:i,fetcher:a}}const D=e=>`/api/v1/apps/sessions/${encodeURIComponent(e)}`;function Ni(e){const{json:o,stream:a,fetcher:i,headers:c,refused:d,root:b}=zi(e);return{serverUrl:b,accessToken:()=>e.getAccessToken(),start:(l,p)=>a("/api/v1/apps/sessions",{agent:l.agent,...l.deploymentUid?{deployment_uid:l.deploymentUid}:{},...l.appUid?{app_uid:l.appUid}:{},...l.version?{version:l.version}:{},...l.session?{session:l.session}:{},opener:l.opener},p),message:(l,p,h)=>a(`${D(l)}/messages`,{text:p},h),changeSettings:(l,p,h)=>a(`${D(l)}/settings`,{values:p},h,"PUT"),resume:(l,p,h)=>a(`${D(l)}/resume`,{agent:p},h),stop:l=>o(`${D(l)}/stop`,"POST"),end:l=>o(`${D(l)}/end`,"POST"),describe:l=>o(D(l)),described:async l=>Bo(await o(D(l))),list:(l={})=>{const p=new URLSearchParams;for(const[y,g]of Object.entries(l))g!==""&&g!==void 0&&g!==!1&&p.set(y,String(g));const h=p.toString();return o(`/api/v1/apps/sessions${h?`?${h}`:""}`)},swap:(l,p)=>o(`${D(l)}/agent`,"POST",{agent:p}),clone:(l,p={})=>o(`${D(l)}/clone`,"POST",{up_to_turn:p.upToTurn??null,agent:p.agent??null,title:p.title??""}),exportFile:async(l,p="")=>{const h=await i(`${b}${D(l)}/export${p?`?format=${encodeURIComponent(p)}`:""}`,{method:"GET",headers:c()});return h.ok?h.text():d(h)},importFile:async(l,p={})=>{const h=new URLSearchParams;p.agent&&h.set("agent",p.agent),p.format&&h.set("format",p.format);const y=h.toString(),g=await i(`${b}/api/v1/apps/sessions/import${y?`?${y}`:""}`,{method:"POST",headers:c({"Content-Type":"application/x-ndjson"}),body:l});return g.ok?await g.json():d(g)},rename:(l,p)=>o(`${D(l)}/title`,"PUT",{title:p}),archive:(l,p)=>o(`${D(l)}/archived`,"PUT",{archived:p}),switches:async l=>await o(`${D(l)}/switches`),switchIn:async(l,p)=>await o(`${D(l)}/switches`,"PUT",p),messages:async l=>Fo((await o(`${D(l)}/messages`)).messages)}}const de="";function Vi(e){return{surfaceId:!e||e===Ps?de:e,suspendedId:null}}function Hi({agentName:e,sandboxStillRuns:o=!1,temporary:a=!0,onSignedIn:i,onSignUp:c}){const{configuration:d}=$s(),b=s.useCallback(l=>{Ho.getState().checkIAMToken(l),i?.()},[i]);return n.jsx(S,{height:"100%",minHeight:0,overflowY:"auto",bg:"canvas.default",px:4,py:4,children:n.jsxs(S,{maxWidth:440,mx:"auto",children:[n.jsxs(S,{display:"flex",alignItems:"center",justifyContent:"center",gap:2,color:"attention.fg",mb:2,children:[n.jsx(xn,{size:20}),n.jsx(N,{sx:{fontSize:2,fontWeight:"semibold",color:"fg.default"},children:a?"This demo runs on a shared key":"Your key has expired"})]}),n.jsxs(N,{as:"p",sx:{fontSize:1,color:"fg.muted",textAlign:"center",mb:3},children:[a?`${e??"The agent"} has used the time this key allows. Sign in to point your own agent at it, use your own data, and drop the time limit.`:`${e??"The agent"} stopped because your session ran out.`,o?" Your notebook is still running in this page.":""]}),a&&n.jsxs(S,{display:"flex",flexDirection:"column",alignItems:"center",gap:2,mb:3,"data-anonymous-key-refresh":"",children:[n.jsx(N,{sx:{fontSize:1,color:"fg.muted",textAlign:"center"},children:"Or keep trying without an account: refreshing the page gives this demo a new key, and starts the conversation over."}),n.jsx(Q,{leadingVisual:Do,onClick:()=>{typeof window<"u"&&window.location.reload()},children:"Refresh the page for a new key"})]}),n.jsx(_i,{hideHero:!0,fillHeight:!1,calloutTitle:"Sign in to keep going",github:!0,google:!0,linkedin:!0,socialSignInNavigationTarget:typeof window>"u"?void 0:`${window.location.pathname}${window.location.search}`,loginUrl:d?.iamUrl?`${d.iamUrl}/api/iam/v1/login`:void 0,onSignIn:b,onSignUp:c})]})})}const Di="https://r1.datalayer.run";function Wi(e=!0,o=""){const{configuration:a}=$s(),i=Sn(p=>p.token),c=a?.aiInferenceUrl||Di,d=Wo(c,e&&!i,o),b=i||d.token,l=s.useMemo(()=>({inferenceUrl:c,token:b||void 0}),[c,b]);return{inference:l,needsSignIn:Go(l),anonymous:d,inferenceUrl:c}}const Gi={name:"general-purpose",description:"A capable generalist for a task none of the specialists covers: research, reasoning, drafting, checking.",instructions:"You are a capable general-purpose assistant. Carry out the task you are given completely and report the result plainly, saying what you could not do."};function Es(e){const o=e?.subagents;if(!o)return[];const a=(o.subagents??[]).map(i=>{const c=i.ref?Ko(i.ref):void 0;return{name:i.name,description:i.description||c?.description||i.name,instructions:i.instructions??c?.systemPrompt,model:i.model??c?.model??o.defaultModel,icon:c?.icon}});return o.includeGeneralPurpose?[...a,Gi]:a}const Vs=e=>e.replace(/\/+$/,""),Ki=e=>e.split(":")[0];function Yi(e,o){return`${Vs(e)}/api/v1/apps/agents/${encodeURIComponent(o)}/equipment`}function qi(e,o){return`${Vs(e)}/api/v1/configure/models?agent_id=${encodeURIComponent(o)}`}const Ji=["started","starting","failed","not_started","left_out"],bn=e=>Array.isArray(e)?e.filter(o=>typeof o=="string"):[];function Qi(e){const o=e??{};return{servers:(o.mcp_servers??[]).map(a=>({id:String(a.id??""),name:String(a.name??a.id??""),optional:a.optional===!0,state:Ji.includes(a.state)?a.state:"not_started",...typeof a.reason=="string"&&a.reason?{reason:a.reason}:{},missingEnvVars:bn(a.missing_env_vars),...typeof a.tools=="number"?{tools:a.tools}:{}})),skills:(o.skills??[]).map(a=>({id:String(a.id??""),name:String(a.name??a.id??""),description:String(a.description??""),optional:a.optional===!0,state:a.state==="not_activated"?"not_activated":"active",...typeof a.reason=="string"&&a.reason?{reason:a.reason}:{},missingEnvVars:bn(a.missing_env_vars),oneOfEnvVars:bn(a.one_of_env_vars)}))}}function Zi(e){const o=e?vs[e]??vs[Ki(e)]:void 0,a=new Set(o?.optional?.mcpServers??[]),i=new Set(o?.optional?.skills??[]),c=o?[o.model,...o.modelAdditionals??[]].filter(d=>!!d):[];return{source:"declared",modelsSource:"declared",servers:(o?.mcpServers??[]).filter(Boolean).map(d=>({id:d.id,name:d.name||d.id,optional:a.has(d.id),missingEnvVars:[]})),skills:(o?.skills??[]).filter(Boolean).map(d=>({id:d.id,name:d.name||d.id,description:d.description??"",optional:i.has(d.id),missingEnvVars:[],oneOfEnvVars:[]})),models:[...new Set(c)].map((d,b)=>({id:d,name:Yo(d)?.name??d,current:b===0}))}}function Xi(e,o){const a=Us(e),i=a.find(c=>c.id===o)?.id??a.find(c=>c.isAvailable!==!1)?.id;return a.map(c=>({...c,current:c.id===i}))}function er({agentServerUrl:e,agentId:o,token:a,specId:i,model:c,enabled:d,refreshMs:b=3e4}){const l=s.useMemo(()=>Zi(i),[i]),[p,h]=s.useState(),[y,g]=s.useState();return s.useEffect(()=>{if(h(void 0),g(void 0),!d||!e||!o)return;let C=new AbortController;const m=a?{Authorization:`Bearer ${a}`}:{},f=()=>{C.abort(),C=new AbortController;const{signal:A}=C;fetch(Yi(e,o),{headers:m,signal:A}).then(M=>M.ok?M.json():null).then(M=>{!A.aborted&&M&&h(Qi(M))}).catch(()=>{}),fetch(qi(e,o),{headers:m,signal:A}).then(M=>M.ok?M.json():null).then(M=>{if(!A.aborted&&M){const ne=Xi(M,c);g(ne.some(ke=>ke.isAvailable!==!1)?ne:void 0)}}).catch(()=>{})};f();const k=setInterval(f,b);return()=>{clearInterval(k),C.abort()}},[d,e,o,a,c,b]),s.useMemo(()=>({source:p?"live":"declared",servers:p?.servers??l.servers,skills:p?.skills??l.skills,modelsSource:y&&y.length>0?"live":"declared",models:y&&y.length>0?y:l.models}),[p,y,l])}const Rs=new Map;function Ms(e,o){if(!_s.getState().sendRawMessage(e,o))throw new Error(`The runtime's monitoring stream is closed: ${String(e.type)} was not sent.`)}function tr(e,o,a){const i=o.find(c=>c.id===e);return i&&i.tools.length>0?i.tools.map(c=>c.name):(a?.servers.find(c=>c.id===e)?.tools??[]).map(c=>c.name)}function nr({agentId:e,status:o,servers:a}){const i=s.useMemo(()=>({enabled:Jo(o)??Rs,approved:qo(o)??Rs}),[o]),[c,d]=s.useState({enabled:new Map,approved:new Map});s.useEffect(()=>{d({enabled:new Map,approved:new Map})},[i,e]);const b=s.useMemo(()=>new Map([...i.enabled,...c.enabled]),[i,c]),l=s.useMemo(()=>new Map([...i.approved,...c.approved]),[i,c]),p=s.useCallback((C,m)=>{Ms({type:"mcp_server_tools_set",serverId:C,enabledToolNames:Array.from(m)},e),d(f=>({...f,enabled:new Map(f.enabled).set(C,m)}))},[e]),h=s.useCallback((C,m)=>{const f=new Set(Qo(b,C,tr(C,a,o)));f.has(m)?f.delete(m):f.add(m),p(C,f)},[b,a,o,p]),y=s.useCallback((C,m,f)=>p(C,f?new Set(m):new Set),[p]),g=s.useCallback((C,m)=>{const f=new Set(l.get(C)??[]),k=!f.has(m);Ms({type:"mcp_server_tool_approve",serverId:C,toolName:m,approved:k},e),k?f.add(m):f.delete(m),d(A=>({...A,approved:new Map(A.approved).set(C,f)}))},[l,e]);return{enabledMcpTools:b,approvedMcpTools:l,onToggleMcpTool:h,onToggleAllMcpServerTools:y,onToggleMcpToolApproval:g}}const As=e=>e instanceof Error?e.message:String(e);function sr({client:e,uid:o,held:a,refresh:i,skillOn:c}){const[d,b]=s.useState(),[l,p]=s.useState();s.useEffect(()=>{if(p(void 0),!e||!o||!a){b(void 0);return}let m=!0;return e.switches(o).then(f=>{m&&b(f)},f=>{m&&(b(void 0),p(As(f)))}),()=>{m=!1}},[e,o,a,i]);const h=s.useCallback(m=>{if(!e||!d)throw new Error("This conversation is not held by its runtime yet: nothing to switch.");e.switchIn(o,m).then(f=>{b(f),p(void 0)},f=>p(As(f)))},[e,d,o]),y=s.useMemo(()=>new Map(Object.entries(d?.mcp_tools??{}).map(([m,f])=>[m,new Set(f)])),[d]),g=s.useMemo(()=>new Map(Object.entries(d?.mcp_approved??{}).map(([m,f])=>[m,new Set(f)])),[d]),C=s.useMemo(()=>new Set(Object.entries(d?.skills_approved??{}).filter(([,m])=>m).map(([m])=>m)),[d]);return{started:d!==void 0,refusal:l,enabledMcpTools:y,approvedMcpTools:g,skillsSwitched:d?.skills??{},approvedSkills:C,onToggleMcpTool:(m,f)=>h({kind:"tool",server:m,tool:f,enabled:!(y.get(m)?.has(f)??!0)}),onToggleAllMcpServerTools:(m,f,k)=>h({kind:"server",server:m,enabled:k}),onToggleMcpToolApproval:(m,f)=>h({kind:"tool_approval",server:m,tool:f,approved:!(g.get(m)?.has(f)??!1)}),onToggleSkill:m=>h({kind:"skill",skill:m,enabled:!(d?.skills[m]??c(m))}),onToggleAllSkills:(m,f)=>h({kind:"skills",skills:m,enabled:f}),onToggleSkillApproval:m=>h({kind:"skill_approval",skill:m,approved:!C.has(m)})}}function or(e){return e.replace(/^datalayer_/,"").replace(/_lexical$/,"")}function ar(e){const o=or(e);return/^executeCodeIn(Notebook|Document)$/.test(o)||/^(read|list)[A-Z]/.test(o)}function ir(e,o){return e.filter(a=>o?.has(a.name)||ar(a.name))}function rr(e,o){const a=i=>o&&i.value.id===`${o}-tools`?0:i.value.id==="notebook-tools"?1:2;return e.map((i,c)=>({entry:i,index:c,rank:a(i)})).sort((i,c)=>i.rank-c.rank||i.index-c.index).map(i=>i.entry)}function lr(e,o,a){if(!a||!e.endsWith("-tools"))return!1;const i=e.slice(0,-6);return o.has(i)&&i!==a}const cr={type:"object",properties:{}};function dr(e,o){const a=new Set(e.toolset);return e.commands.filter(i=>a.has(i.name)).map(i=>({name:i.name,description:i.description,parameters:i.parameters??cr,location:"frontend",handler:async c=>{if(!o)throw new Error(`${i.name}: the ${e.plugin??e.id} plugin is not mounted on this page.`);const d=Object.keys(c??{}).length>0?c:void 0,b=await o.executeCommand(i.command,d);return b===void 0?{ok:!0,command:i.command,argument:d}:b}}))}function Hs(e,o){return e.flatMap(a=>dr(a,o))}function ur(){const e=Zo(),o=Ns();return s.useMemo(()=>Hs(o,e),[o,e])}function pr(e){const o=e?.app_instance;if(!o||typeof o!="object")return"";const a=o.deployment_uid;return typeof a=="string"?a.trim():""}function fr(e,o,a){return e||!o?e:{id:a,messages:[]}}function mr(e){const o=(new URLSearchParams(e).get("session")??"").trim();if(!o)return"";if(!/^[A-Za-z0-9_-]{8,128}$/.test(o))throw new Error(`?session=${o} names no session: a session uid is 8 to 128 letters, digits, hyphens or underscores.`);return o}function gr({facts:e}){if(!e)return null;const o=Xo(e);return n.jsxs(S,{display:"inline-flex",alignItems:"center",gap:2,"data-session-state":e.state,children:[n.jsx(ea,{size:"small",variant:e.state==="open"?"accent":e.state==="paused"?"attention":"secondary",children:ta(e)}),o?n.jsx(N,{sx:{fontSize:0,color:"fg.muted"},"data-session-lineage":"",children:o}):null]})}function hr({facts:e,turn:o,context:a}){const i=K(Ls),c=Fs(i,e,"turn");return!e||c.length===0||o<1?null:n.jsx(S,{display:"inline-flex",gap:1,"data-turn-actions":o,children:c.map(d=>n.jsx(Q,{size:"small",variant:"invisible","data-turn-action":d.id,onClick:()=>{Promise.resolve(d.run(e,{...a,atTurn:o})).catch(b=>a.say(String(b.message??b)))},children:d.label},d.id))})}function br({uid:e,describe:o,context:a}){const i=K(Ls),[c,d]=s.useState(void 0),[b,l]=s.useState(!1),[p,h]=s.useState(""),[y,g]=s.useState(void 0),C={...a,show:a.show??g,say:k=>{h(k),a.say(k)}},m=s.useCallback(k=>{l(k),k&&e&&o(e).then(d,()=>d(void 0))},[o,e]);if(!e||i.length===0)return null;const f=Fs(i,c);return n.jsxs(n.Fragment,{children:[n.jsxs(fn,{open:b,onOpenChange:m,children:[n.jsx(fn.Anchor,{children:n.jsx(Bs,{icon:na,"aria-label":"Session actions",variant:"invisible",size:"small","data-testid":"session-actions"})}),n.jsx(fn.Overlay,{width:"small",children:n.jsxs(dt,{children:[f.length===0?n.jsx(dt.Item,{disabled:!0,children:c?"Nothing applies to this session now.":"Reading the session…"}):f.map(k=>n.jsx(dt.Item,{"data-session-action":k.id,onSelect:()=>{c&&Promise.resolve(k.run(c,C)).catch(A=>C.say(String(A.message??A)))},children:k.label},k.id)),p?n.jsxs(n.Fragment,{children:[n.jsx(dt.Divider,{}),n.jsx(dt.Item,{disabled:!0,"data-testid":"session-actions-said",children:p})]}):null]})})]}),y?n.jsx(zs,{title:y.title,onClose:()=>g(void 0),width:"large",children:n.jsx(S,{"data-session-panel":"",children:y.render()})}):null]})}const Is={confirm:"Switch",cancel:"Keep it"};function vr({question:e,onPick:o}){const[a,i]=s.useState(e.options[0]?.id??""),[c,d]=s.useState("");s.useEffect(()=>{let l=!0;if(!e.says||!a){d("");return}return e.says(a).then(p=>l&&d(p),()=>l&&d("")),()=>{l=!1}},[a,e]);const b=e.options.find(l=>l.id===a);return n.jsx(zs,{title:e.title,onClose:()=>o(void 0),width:"medium",footerButtons:[{buttonType:"default",content:Is.cancel,onClick:()=>o(void 0)},{buttonType:"primary",content:Is.confirm,disabled:!a,onClick:()=>o(a||void 0)}],children:n.jsxs(S,{display:"grid",gap:3,"data-session-choose":"",children:[n.jsxs(ce,{children:[n.jsx(ce.Label,{children:e.title}),n.jsx(xs,{value:a,onChange:l=>i(l.target.value),block:!0,children:e.options.map(l=>n.jsx(xs.Option,{value:l.id,children:l.label},l.id))})]}),b?.description?n.jsx(N,{sx:{fontSize:1,color:"fg.muted"},children:b.description}):null,c?n.jsx(N,{as:"p",sx:{m:0,fontSize:1,fontStyle:"italic"},"data-session-choose-says":"",children:c}):null]})})}const xr="var(--theme-accent)";function Ds({face:e,size:o}){return typeof e=="string"?n.jsx(sa,{emoji:e,size:o,label:""}):n.jsx(n.Fragment,{children:e})}function Sr({face:e,size:o,state:a}){const i=a==="thinking"||a==="working",c=a==="paused";return n.jsxs(S,{as:"span","aria-hidden":!0,"data-presence":a,position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",width:o+8,height:o+8,flexShrink:0,fontSize:o,lineHeight:1,children:[n.jsx(S,{as:"span",position:"absolute",inset:0,borderRadius:"50%",boxShadow:c?"none":`0 0 0 2px ${xr}`,border:c?"2px dashed":"none",borderColor:"border.default",opacity:i||a==="waiting"||c?.9:0,transition:"opacity var(--theme-motion-status, 0ms) var(--theme-motion-easing, ease)",animation:i?"loopPresenceBreath 1.8s ease-in-out infinite":"none",reducedMotion:{animation:"none"},sx:{"@keyframes loopPresenceBreath":{"0%, 100%":{transform:"scale(0.92)",opacity:.35},"50%":{transform:"scale(1.06)",opacity:.9}}}}),n.jsx(S,{as:"span",display:"inline-flex",opacity:c?.55:1,filter:c?"grayscale(0.6)":"none",transition:"opacity var(--theme-motion-status, 0ms) var(--theme-motion-easing, ease)",children:n.jsx(Ds,{face:e,size:o})})]})}function yr({state:e}){return n.jsx(N,{role:"status","aria-live":"polite","data-presence-line":e,sx:{fontSize:0,color:e==="waiting"?"fg.default":"fg.muted",fontWeight:e==="waiting"?"semibold":"normal",whiteSpace:"nowrap",flexShrink:0},children:Fi({state:e})})}const wr=yn(void 0),kr=yn(""),Cr=yn({}),jr=1400,Os=parseInt(Ri["--loop-face-large"],10),Tr={};function Or({workspace:e}){const o=oa(),a=aa(),i=s.useRef(null),c=s.useRef(void 0),{setViewControls:d}=e,b=s.useRef(e.setThread);b.current=e.setThread;const l=s.useCallback(()=>{const t=i.current?.thread();return t&&b.current?.(t),t},[]),[p,h]=s.useState(null),y=ia(),g=y.getConfig(ra),C=g?.placeholder||o.placeholder,m=g?.defaultSurface??"notebook",f=y.getConfig(la),[k,A]=s.useState(de),[M,ne]=s.useState(null),ke=s.useRef(!1),B=K(ca),It=K(da),Ot=K(ua),ue=K(pa)[0]?.value,pe=mn(ue?.promptStance??wr)??ue?.prompt,$t=K(fa),$e=ma($t[0]?.value),W=s.useRef($e);W.current=$e;const xe=s.useRef(""),Ke=K(ga),Ut=s.useMemo(()=>ha(()=>Ke.reduce((t,r)=>ba(t,r.value.extras.value),{})),[Ke]),j=mn(Ke.length>0?Ut:Cr),te=s.useRef(new Set),gt=va(Ei,e),Se=!gt.allowed,_t=Se?gt.reason??"Chat is unavailable for this sandbox":void 0,[P,Lt]=s.useState(!1),[fe,Ft]=s.useState(!1),[$,Ue]=s.useState(!1),[je,ht]=s.useState({open:!1,pendingApproval:!1}),me=xa(P,je,g?.presence?.paused===!0),Ye=g?.presence?.onPresence;s.useEffect(()=>{Ye?.(me),W.current?.setPresence(me)},[Ye,me]);const Y=s.useRef(g?.presence?.onSaying);Y.current=g?.presence?.onSaying;const bt=s.useRef({answering:!1}),Te=s.useCallback(t=>{i.current=t,Ft(!!t)},[]),Bt=s.useCallback(t=>{const{open:r,pendingApproval:u}=Sa(t);ht(Pe=>Pe.open===r&&Pe.pendingApproval===u?Pe:{open:r,pendingApproval:u});const w={saying:wa(t),answering:ya(t)},x=bt.current;(x.saying?.id!==w.saying?.id||x.saying?.text!==w.saying?.text||x.answering!==w.answering)&&(bt.current=w,Y.current?.(w));const ee=W.current;if(!ee)return;ee.items(t);const z=new Set(["complete","completed","done","error","failed","cancelled","canceled","rejected","denied","stopped"]),re={insertcell:"adding a cell",updatecell:"editing a cell",runcell:"running a cell",deletecells:"removing cells",readallcells:"reading the notebook",readcell:"reading a cell",executecode:"running code",insertblock:"adding a block",updateblock:"editing a block",runblock:"running a block",readdocument:"reading the document"};let E;for(let Pe=t.length-1;Pe>=0;Pe-=1){const Rt=t[Pe];if(typeof Rt.toolName=="string"&&Rt.toolCallId){z.has(String(Rt.status).toLowerCase())||(E=Rt);break}}if(!E){ee.activity(void 0);return}const Oe=E.toolName.toLowerCase().replace(/^datalayer_/,"").replace(/_lexical$/,"").replace(/[^a-z]/g,""),To=re[Oe]??`using ${E.toolName}`;ee.activity(`${xe.current||"The agent"} is ${To}…`)},[]),Ee=s.useRef(j);Ee.current=j;const zt=s.useCallback(t=>{so(t),W.current?.usage(t),Ee.current.onUsage?.(t)},[]),vt=s.useCallback(t=>{Lt(t),t||W.current?.end("done")},[]),se=s.useCallback(t=>{const r=W.current;if(!r)return;let u=-1;for(let x=t.length-1;x>=0;x-=1)if(t[x].role==="user"){u=x;break}const w=t.slice(u+1).filter(x=>x.role==="assistant").map(ka).filter(x=>x.trim().length>0).join(`
29
+
30
+ `);r.assistant(w)},[]),ge=s.useRef([]),_e=s.useRef(!1),qe=s.useRef(void 0),he=s.useRef(void 0),Re=s.useRef(void 0),Je=K(Ca),Qe=s.useRef(Je);Qe.current=Je;const oe=s.useCallback((t,r)=>{if(he.current)return he.current;const u=Re.current;Re.current=void 0;const w=ja(Qe.current.map(z=>z.value),u?{...r??{},voice:u}:r),x=w?.loop;if(_e.current&&x?.files&&x.files.length>0){const z=qe.current;if(!z)return"A file is given to an application running on a runtime: run it on Datalayer or on your machine to give it one.";let re;try{re=x.files.map(E=>({file:Ea(String(E.name??"")),base64:Ta(String(E.data_url??""))}))}catch(E){return E instanceof Error?E.message:String(E)}z.execute(Ra(re)).then(E=>{if(!E.success){h(`The files could not be put in the sandbox: ${E.error??"it failed"}.`);return}oe(`${t}
31
+
32
+ ${Ma(re.map(Oe=>Oe.file))}`,{...w,loop:Object.fromEntries(Object.entries(x).filter(([Oe])=>Oe!=="files"))})});return}W.current?.begin(t,l());const ee=i.current?.send;if(!ee){ge.current.push([t,w]);return}ee(t,w)},[l]);s.useEffect(()=>{d(fe?{busy:P,stop:i.current?.stop,newChat:i.current?.newChat,send:oe}:null)},[P,fe,d,oe]),s.useEffect(()=>()=>d(null),[d]),s.useEffect(()=>e.prompts.subscribe(oe),[e.prompts,oe]),s.useEffect(()=>{if(!fe||ge.current.length===0)return;const t=ge.current.splice(0,ge.current.length);for(const[r,u]of t)l(),i.current?.send(r,u)},[fe,l]);const Le=s.useRef(!1),ae=s.useCallback(async t=>{h(null);const r=await Aa(Ee.current,t);if(r){r.sent?ot(""):h(r.refused);return}Le.current||(Le.current=!0,f?.firstPromptHook?.());const u=await e.submit(t);if(!u.handled){h(u.reason??null);return}ot(""),u.result?.content&&h(u.result.content)},[e,f?.firstPromptHook]),_=s.useMemo(()=>B.find(t=>t.value.surfaceId===k)?.value,[B,k]),Ze=s.useCallback(t=>{ke.current=!0;const r=Vi(t);ne(r.suspendedId),A(r.surfaceId)},[]);s.useEffect(()=>Ia(Ze),[Ze]),s.useEffect(()=>{Oa(B.map(t=>t.value.surfaceId))},[B]),s.useEffect(()=>{Pa(k&&k!==de?k:Ps)},[k]);const Me=s.useMemo(()=>m===de||m==="none"?void 0:B.find(t=>t.value.surfaceId===m),[B,m]);s.useEffect(()=>{ke.current||!Me||mt(Me.value,e)&&A(m)},[Me,e,m]);const Fe=s.useRef(null),Be=g?.fullScreenTopOffset??0,{fullScreen:Z,usingApi:Xe,toggle:v,topOffsetPx:U}=$a(Fe,{forceOverlay:!!Be,topOffset:Be}),[q,J]=s.useState(!1),et=s.useRef(!1);s.useEffect(()=>{!P||et.current||Z||(et.current=!0,J(!0))},[P,Z]),s.useEffect(()=>{Z&&J(!1)},[Z]),s.useEffect(()=>{_&&!mt(_,e)&&(ne(_.surfaceId),A(de))},[_,e]);const xt=s.useMemo(()=>{if(M)return B.find(t=>t.value.surfaceId===M)?.value;if(!ke.current&&k===de)return Me?.value},[B,M,k,Me]);s.useEffect(()=>{if(!M||k!==de)return;const t=B.find(r=>r.value.surfaceId===M);t&&mt(t.value,e)&&(ne(null),A(M))},[B,k,M,e]);const I=e.agentId?.trim()||"default",L=Ua(e.sandbox.target??"local");_e.current=L;const R=_a(),be=mn(R?.selected??kr),O=R?.members.find(t=>t.id===be),wn=K(La)[0]?.value,Nt=wn?.specId,F=Ss(O?.specId??I)??(Nt?Ss(Nt):void 0),ze=O?void 0:wn,kn=L&&!O?Ti(Nt,F):void 0;xe.current=O?.name??F?.name??I;const Cn=K(Fa),jn=j.hiddenOpeners,Tn=j.hideOpeners,Vt=j.openers,Ht=s.useMemo(()=>{if(Tn)return[];const t=new Set(jn??[]),r=E=>t.size===0?E:E.filter(Oe=>!t.has(Oe.text));if(Vt)return r(Vt);const u=Cn.flatMap(E=>E.value.suggestions);if(u.length>0)return r(u);const w=r(F?.suggestions??[]),x=r(R?.team.suggestions??[]);if(x.length===0)return w;const ee=new Set(x.map(E=>E.text)),z=R?.team.name??"Team",re=O?.name??F?.name??I;return[...x.map(E=>({...E,group:z})),...w.filter(E=>!ee.has(E.text)).map(E=>({...E,group:re}))]},[Cn,R,F,O,I,jn,Tn,Vt]),St=s.useMemo(()=>Ht.map(t=>({title:t.summary??t.text,message:t.message??t.text,group:t.group})),[Ht]),Dt=Ge(F?.icon),G=g?.presence,Ws=Ge(R?.team.icon),En=K(Ba),yt=s.useMemo(()=>{const t=[],r=new Map,u=new Set,w=new Set(B.map(x=>x.value.surfaceId));for(const x of rr(En,_?.surfaceId)){if(lr(x.value.id,w,_?.surfaceId))continue;let ee;try{ee=x.value.tools(e)}catch(z){console.warn(`[loop] frontend tools from '${x.plugin}' failed:`,z);continue}for(const z of ee){const re=r.get(z.name);if(re){console.warn(`[loop] frontend tool '${z.name}' from '${x.plugin}' is shadowed by the one from '${re}'.`);continue}r.set(z.name,x.plugin),t.push(z),x.value.chatView&&u.add(z.name)}}for(const x of j.frontendTools??[])r.has(x.name)||(r.set(x.name,"chat-extras"),t.push(x),u.add(x.name));return _?t:ir(t,u)},[En,e.surfaceId,e.agentId,j.frontendTools,_?.surfaceId,B]),Wt=ur(),tt=s.useMemo(()=>{if(Wt.length===0)return yt;const t=new Set(yt.map(r=>r.name));return[...yt,...Wt.filter(r=>!t.has(r.name))]},[yt,Wt]),Rn=Ns(),Gt=j.agentToolBundles,Gs=s.useMemo(()=>{const t=j.frontendTools??[];if(!Gt?.length)return j.frontendTools;const r=Hs(Rn.filter(w=>Gt.includes(w.id)),y),u=new Set(t.map(w=>w.name));return[...t,...r.filter(w=>!u.has(w.name))]},[j.frontendTools,Gt,Rn,y]);qe.current=L&&tt.some(t=>t.name===za)?y.getOutput(ut)?.sandbox:void 0;const T=Na(e.sandbox,e.serverUrl),Ne=s.useMemo(()=>Ni({baseUrl:T??"",getAccessToken:()=>c.current,fetch:(t,r)=>fetch(t,r)}),[T]),Mn=K(Va),Ks=s.useMemo(()=>Mn.filter(t=>t.value.composer).map(t=>({name:t.value.name,description:t.value.description})),[Mn]),Ys=s.useMemo(()=>{if(!R||!O)return Es(F).map(u=>({name:u.name,description:u.description,icon:Ge(u.icon)}));const t=R.members.map(u=>({name:u.name,description:u.description,emoji:u.emoji,icon:Ge(u.icon),disabled:u.id===O.id,disabledReason:u.id===O.id?`You are already talking to ${u.name}`:void 0})),r=ys(R.team,O.id).filter(u=>!R.members.some(w=>w.name===u.name)).map(u=>({name:u.name,description:u.description,icon:Ge(u.icon)}));return[...t,...r]},[R,O,F]),qs=Ha(y.getConfig(ut)),{inference:An,anonymous:Js}=Wi(L,qs),Kt=Sn(t=>t.user),Yt=L&&Js.status==="expired",In=!Kt,nt=Da();he.current=nt.disabled?nt.disableReason||"This conversation is closed here.":void 0;const wt=T===void 0?Wa(e.sandbox,o):void 0,kt=y.getConfig(ut)?.datalayerVisitors,qt=Ga(kt),ye=g?.anonymous,Jt=Ka(ye?.maxTurns),Qt=!!(ye&&kt&&!qt.error&&e.sandbox.state!=="error"&&(!qt.token||T===void 0)),Ct=ye?Jt.refused:"",On=s.useRef(!1),Pn=Jt.take;s.useEffect(()=>{ye&&P&&!On.current&&Pn(),On.current=P},[ye,P,Pn]);const Qs=Ya(ye??Tr),st=Qt||!!Ct||Se||Yt||!!kn||!!wt||nt.disabled,$n=Qt?qa.validating:Ct||(Yt?In?o.demoKeyExpired:o.keyExpired:kn??wt??_t??(nt.disabled?nt.disableReason:void 0)),[Zt,ot]=s.useState(""),[Un]=Ja(),at=s.useMemo(()=>g?.voice?Qa(g.voice,Un):void 0,[g?.voice,Un]),[Zs,Xs]=s.useState(!1),[eo,_n]=s.useState(),jt=eo??ze?.model??F?.model??e.model??"",Ve=Za(),Ln=s.useRef(Ve),Fn=s.useRef(be),Bn=s.useRef(Ve);Bn.current=Ve,s.useEffect(()=>{Fn.current!==be&&(Fn.current=be,Ln.current=Bn.current,_n(void 0))},[be]);const to=Ve&&Ve!==Ln.current?Ve:null,[no,so]=s.useState(),oo=to??no??null,ao=pt(le.inpromptMenu),zn=pt(le.promptAction),io=pt(le.promptStatus),Nn=pt(le.chatHeader),Vn=pt(le.chatBanner),ro=s.useMemo(()=>R?.members.map(t=>({id:t.id,name:t.name,description:t.description,icon:Ge(t.icon)}))??[],[R]),Ae=Ts(t=>t.pending),[Hn,lo]=s.useState(0);s.useEffect(()=>Xa(()=>lo(t=>t+1)),[]),s.useEffect(()=>{Ae&&(ot(Ae.text),Ts.getState().consume(),Ae.submit&&ae(Ae.text))},[Ae]);const Xt=y.getConfig(ut)?.datalayerCreatePayload,V=!!(ze?.createPayload?.app_spec||Xt?.app_spec),en=pr(Xt),co=Sn(t=>t.token),uo=y.getConfig(ut)?.embedToken,ve=kt?qt.token:uo||co;c.current=ve||void 0;const po=s.useMemo(()=>ei(g?.voice,ve||void 0),[g?.voice,ve]),we=!!(en||kt),Dn=!!G&&V&&!L,Wn=er({agentServerUrl:T,agentId:I,token:ve||void 0,specId:Er(ze?.createPayload?.app_spec??Xt?.app_spec),enabled:Dn});if(we&&!V)throw new Error("A deployment’s page runs its application: its host gave no app_spec.");const[Gn]=s.useState(ti),[tn,fo]=s.useMemo(()=>{try{return[mr(typeof window>"u"?"":window.location.search),""]}catch(t){return["",t instanceof Error?t.message:String(t)]}},[]),[Kn,mo]=s.useState(void 0),H=s.useMemo(()=>Kn??fr(g?.thread??(tn&&V?{id:tn,messages:[],fromRuntime:!0}:void 0),en,Gn),[Kn,g?.thread,tn,V,en,Gn]),[He,Yn]=s.useState(null),go=!!(H?.fromRuntime&&He?.given!==H.id);s.useEffect(()=>{if(!H?.fromRuntime||!V||!T)return;let t=!0;return(async()=>{let r="";for(let u=0;u<4&&t;u+=1)try{const w=await ni({agentBaseUrl:T,agentId:I,uid:H.id,token:ve});t&&Yn({given:H.id,thread:{...H,fromRuntime:!1,messages:w}});return}catch(w){r=w instanceof Error?w.message:String(w),await new Promise(x=>setTimeout(x,1500))}t&&Yn({given:H.id,thread:{id:si(),messages:[],onStarted:H.onStarted},said:ws.notOpened(r)})})(),()=>{t=!1}},[H?.id,H?.fromRuntime,V,T,I,ve]);const nn=H?.fromRuntime?He?.given===H.id?He.thread:void 0:H,ie=e.thread||nn?.id||"",[qn,Jn]=s.useState(void 0),[ho,Qn]=s.useState(0),Zn=s.useRef("");s.useEffect(()=>{P&&ie&&(Zn.current=ie)},[P,ie]);const sn=!!H?.fromRuntime||!!(e.thread&&e.thread===ie)||Zn.current===ie;s.useEffect(()=>{if(!V||!T||!ie||P||!sn)return;let t=!0;return Ne.described(ie).then(r=>t&&Jn(r),()=>t&&Jn(void 0)),()=>{t=!1}},[V,T,ie,P,sn,ho,Ne]);const[Xn,es]=s.useState(fo),[ts,ns]=s.useState(null),on=s.useRef(null),an=s.useRef(null),ss=s.useRef(null),os=s.useMemo(()=>({client:Ne,say:t=>{es(t),Qn(r=>r+1)},openThread:t=>{mo({id:t,messages:[],fromRuntime:!0}),Qn(r=>r+1)},download:(t,r,u)=>{const w=URL.createObjectURL(new Blob([r],{type:u})),x=document.createElement("a");x.href=w,x.download=t,x.click(),URL.revokeObjectURL(w)},choose:t=>new Promise(r=>{on.current=r,ns(t)}),pickFile:t=>new Promise(r=>{const u=ss.current;if(!u){r(void 0);return}an.current=r,u.accept=t,u.value="",u.click()})}),[Ne]),Tt=s.useMemo(()=>L?Li({agentId:O?.specId??I,instructions:oi(F,ze?.instructions),model:jt||void 0,inference:An,frontendTools:tt,subagents:R&&O?ys(R.team,O.id):Es(F),sharing:R?.sharing,onSubagentEvent:t=>_s.getState().appendSubagentEvent(t),modeEffect:ze?.modeEffect}):T!==void 0?{type:"ag-ui",endpoint:V?`${T}/api/v1/apps/agents/${encodeURIComponent(I)}/ag-ui/`:`${T}/api/v1/ag-ui/${I}/`,...V&&ve?{authToken:ve}:{},...V?{uiSocket:`${T.replace(/^http/,"ws")}/api/v1/apps/ui`,uiFiles:`${T}/api/v1/apps/agents/${encodeURIComponent(I)}/files`,appSessions:`${T}/api/v1/apps/sessions`,...we?{ownRoutesOnly:!0}:{}}:{},agentId:I,configEndpoint:`${T}/api/v1/configure`,enableConfigQuery:!0}:void 0,[I,L,An,O,tt,R,F,ze,jt,T,V,ve,we]),it=ai(!L&&Tt?.type==="ag-ui",Tt?.type==="ag-ui"?Tt.configEndpoint:void 0,void 0,I),Ie=ii(),De=ri(I),bo=li(),as=j.mcpStatusData??bo??void 0,vo=ci(),rt=nr({agentId:I,status:as,servers:it.data?.mcpServers??[]}),is=vo==="connected",rn=!is&&V&&!!T,[rs,ln]=s.useState(void 0),[xo,So]=s.useState(void 0);s.useEffect(()=>{if(L||T===void 0)return;const t=di(T,I,we);if(!t){ln([]);return}let r=!1;return fetch(t).then(u=>u.ok?u.json():null).then(u=>{r||(ln(u?Us(u):[]),So(u?ui(u):void 0))}).catch(()=>{r||ln([])}),()=>{r=!0}},[T,I,L,we]);const yo=s.useMemo(()=>pi(fi(rs,()=>Object.values(mi).filter(t=>t.available&&gi(t)).map(t=>({id:t.id,name:t.name,provider:t.provider}))),!!Kt),[rs,Kt]),ls=s.useMemo(()=>{const t=it.data?.builtinTools??[],r=new Set(t.map(u=>u.name));return{runtime:t,frontend:tt.filter(u=>!r.has(u.name)).map(u=>({id:u.name,name:u.name}))}},[it.data?.builtinTools,tt]),cn=s.useMemo(()=>new Set((Ie.data?.skills??[]).filter(t=>t.status==="enabled"||t.status==="loaded").map(t=>t.id)),[Ie.data]),cs=s.useMemo(()=>new Set((Ie.data?.skills??[]).filter(t=>t.approved===!0).map(t=>t.id)),[Ie.data]),X=sr({client:rn?Ne:void 0,uid:ie,held:sn,refresh:P,skillOn:t=>cn.has(t)||Wn.skills.some(r=>r.id===t&&r.state==="active")}),wo=is?void 0:rn?X.started?void 0:Cs.locked.notStarted:Cs.locked.notConnected,ko=s.useCallback(async t=>{if(we)throw new Error("A deployment’s chat does not switch its runtime’s model.");_n(t),!(L||T===void 0)&&await fetch(`${T}/api/v1/configure/inference/provider`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({model:t})}).catch(()=>{})},[T,L,we]),ds=g?.promptPlacement==="bottom-chat",Co=g?.promptPlacement==="floating",We=g?.promptPlacement==="top",lt=g?.hidePrompt===!0||j.hidePrompt===!0,dn=Ot[0]?.value.Component,un=!g?.hideHeader&&!!dn,ct=ye?{...Jt,refused:Ct,config:ye,name:G?.name??O?.name??F?.name??"",validating:Qt,headerShown:un,minutes:Si,signIn:Qs}:null,jo={onSend:()=>{ae(Zt)},input:Zt,setInput:ot,focusTrigger:Ae||Hn?(Ae?.nonce??0)+Hn:void 0,placement:Co||pe==="floating"||pe==="floating-top"||pe==="floating-bottom"?"floating":"docked",floatingAnchor:pe==="floating-top"?"top":"bottom",isLoading:P,onStop:()=>e.viewControls.stop?.(),placeholder:$n??j.sendInstead?.says??C,typingSuggestions:Ht.map(t=>t.text),suggestions:St,disableInputPrompt:st,connectionConfirmed:!st,interim:Zs,padding:We||pe==="floating-top"||pe==="floating-bottom"||pe==="docked-top"?2:3,promptVariant:"lexical",autoFocus:g?.autoFocusPrompt??!0,mentionableAgents:Ys,promptCommands:Ks,headerContent:ao.length>0?n.jsx(ft,{slot:le.inpromptMenu,props:{workspace:e}}):void 0,footerLive:io.length>0?n.jsx(ft,{slot:le.promptStatus,props:{workspace:e}}):void 0,footerExtras:zn.length>0||at&&at.input!=="off"?n.jsxs(n.Fragment,{children:[zn.length>0?n.jsx(ft,{slot:le.promptAction,props:{workspace:e}}):null,at&&at.input!=="off"?n.jsx(hi,{voice:at,input:Zt,setInput:ot,disabled:st,speaking:$,onStopSpeaking:()=>i.current?.stopSpeaking?.(),playbackLevel:()=>i.current?.voiceLevel?.()??0,running:P,onStopRun:()=>(i.current?.interrupt??i.current?.stop)?.(),onInterrupted:()=>i.current?.markInterrupted(),onInterimChange:Xs,answers:!!(g?.voice?.output&&g.voice.output!=="off"&&g.voice.speechUrl),onSpoken:t=>{Re.current=t},send:(t,r)=>{Re.current=r,ae(t)}}):null]}):void 0,showAgentsMenu:!G,showInlineAgentsMenu:!1,agents:ro,selectedAgentId:be,onSelectAgent:t=>R?.select(t),showTokenUsage:j.showTokenUsage??g?.showTokenUsage??!0,showContextRing:!0,agentUsage:oo??void 0,showModelSelector:!G&&!we,models:yo,decisions:xo,selectedModel:jt,onModelSelect:t=>{ko(t)},showToolsMenu:!G,availableTools:ls.runtime,availableFrontendTools:ls.frontend,mcpServers:it.data?.mcpServers??[],mcpStatusData:as,showMcpMenu:!0,showSkillsMenu:!0,skills:Ie.data?.skills??[],skillsLoading:Ie.isLoading,enabledSkills:cn,...rn?{enabledMcpTools:X.enabledMcpTools,approvedMcpTools:X.approvedMcpTools,onToggleMcpTool:X.onToggleMcpTool,onToggleAllMcpServerTools:X.onToggleAllMcpServerTools,onToggleMcpToolApproval:X.onToggleMcpToolApproval,skillsSwitched:X.skillsSwitched,approvedSkills:X.approvedSkills,onToggleSkill:X.onToggleSkill,onToggleAllSkills:X.onToggleAllSkills,onToggleSkillApproval:X.onToggleSkillApproval,switchRefusal:X.refusal}:{enabledMcpTools:rt.enabledMcpTools,approvedMcpTools:rt.approvedMcpTools,onToggleMcpTool:rt.onToggleMcpTool,onToggleAllMcpServerTools:rt.onToggleAllMcpServerTools,onToggleMcpToolApproval:rt.onToggleMcpToolApproval,approvedSkills:cs,onToggleSkill:t=>cn.has(t)?De.disableSkill(t):De.enableSkill(t),onToggleAllSkills:(t,r)=>t.forEach(u=>r?De.enableSkill(u):De.disableSkill(u)),onToggleSkillApproval:t=>cs.has(t)?De.unapproveSkill(t):De.approveSkill(t)},codemodeEnabled:j.codemodeEnabled??!1,onToggleCodemode:j.onToggleCodemode,isA2AProtocol:!1,hasConfigData:!!it.data,hasSkillsData:!!Ie.data,...Dn?{equipment:Wn}:{},switchesLocked:wo},us=It[0]?.value.Component,Et=us?n.jsx(us,{workspace:e,composer:jo}):null,ps=B.length>0&&g?.showSurfaceSelector!==!1?n.jsx(Rr,{surfaces:B.map(t=>t.value),active:_?.surfaceId??xt?.surfaceId??de,onChange:Ze,workspace:e}):null,fs=n.jsxs(n.Fragment,{children:[B.map(t=>{const r=t.value,u=_?.surfaceId===r.surfaceId;return u||te.current.has(r.surfaceId)||mt(r,e)?(te.current.add(r.surfaceId),n.jsx(S,{sx:u?{flex:"1 1 0",minWidth:0,minHeight:0}:{position:"absolute",inset:0,visibility:"hidden",pointerEvents:"none",zIndex:-1},children:n.jsx(bi,{load:r.load,props:{surfaceId:r.surfaceId,workspace:e},fallback:n.jsxs(vn,{children:["Loading ",r.title,"…"]}),errorFallback:x=>n.jsxs(vn,{children:[r.title," failed to load: ",x.message]})})},r.surfaceId)):null}),!_&&xt?n.jsx(S,{flex:"1 1 0",minWidth:0,minHeight:0,children:n.jsxs(vn,{children:["Starting ",xt.title,"…"]})}):null]}),ms=n.jsx(n.Fragment,{children:n.jsxs(S,{flex:We&&_?"0 0 34%":"1 1 0",maxWidth:We&&_?460:void 0,minWidth:0,minHeight:0,display:"flex",flexDirection:"column",borderLeft:_?"1px solid":void 0,borderColor:"border.default",position:"relative",children:[j.errorBanner?n.jsx(S,{flexShrink:0,px:3,py:2,fontSize:1,borderBottom:"1px solid",bg:j.errorBanner.variant==="warning"?"attention.subtle":"danger.subtle",color:j.errorBanner.variant==="warning"?"attention.fg":"danger.fg",borderColor:j.errorBanner.variant==="warning"?"attention.muted":"danger.muted",children:j.errorBanner.message}):null,He?.said&&He.given===H?.id?n.jsx(N,{as:"p",role:"status",sx:{m:0,px:3,py:2,fontSize:1,color:"fg.muted"},children:He.said}):null,Xn?n.jsxs(S,{display:"flex",alignItems:"baseline",gap:2,px:3,py:2,fontSize:1,color:"fg.muted",role:"status","data-session-said":"",children:[n.jsx(N,{sx:{flex:1},children:Xn}),n.jsx(Q,{size:"small",variant:"invisible",onClick:()=>es(""),children:"Dismiss"})]}):null,ts?n.jsx(vr,{question:ts,onPick:t=>{ns(null),on.current?.(t),on.current=null}}):null,n.jsx("input",{ref:ss,type:"file",hidden:!0,"data-session-file":"",onChange:async t=>{const r=t.target.files?.[0],u=r?await r.text():void 0;an.current?.(u),an.current=null}}),n.jsx(S,{flex:"1 1 auto",minHeight:0,display:"flex",children:go?n.jsx(N,{as:"p",role:"status",sx:{m:0,p:3,fontSize:1,color:"fg.muted"},children:ws.opening}):n.jsx(vi,{themeVariant:g?.themeVariant,themeOverrides:g?.themeOverrides,colorMode:g?.colorMode,thread:nn,voice:po,disabled:st,disableReason:$n,protocol:Tt,frontendTools:L?void 0:Gs,initialModel:jt||void 0,title:G?.name??O?.name??F?.name??I,description:G?.welcome??F?.description,brandIcon:G?.face?n.jsx(Sr,{face:G.face,size:20,state:me}):n.jsx(Dt,{size:20}),headerLeading:e.chatHeaderLeading,headerContent:G&&!wt||Vn.length>0?n.jsxs(n.Fragment,{children:[G&&!wt?n.jsx(yr,{state:me}):null,Vn.length>0?n.jsx(ft,{slot:le.chatBanner,props:{workspace:e}}):null]}):void 0,emptyState:{icon:G?.face?n.jsx("span",{"aria-hidden":!0,style:{fontSize:Os,lineHeight:1},children:n.jsx(Ds,{face:G.face,size:Os})}):n.jsx(Dt,{size:48}),title:G?.name??O?.name??F?.name??I,...R&&O?{sections:[{group:R.team.name,icon:n.jsx(Ws,{size:48}),title:R.team.name,subtitle:R.team.description},{group:O.name,icon:n.jsx(Dt,{size:32}),title:O.name,subtitle:F?.description}]}:null},suggestions:We||ue||g?.suggestionLabels===!1?[]:St,showHeader:un,headerButtons:{showNewChat:g?.headerButtons?.newChat??!1,showClear:g?.headerButtons?.clear??!1},renderHeader:dn?t=>n.jsx(dn,{workspace:e,header:e.chatViewModes?{...t,chatViewMode:e.chatViewModes.value,onChatViewModeChange:e.chatViewModes.onChange,offeredViewModes:e.chatViewModes.offered}:t}):void 0,showInformation:!0,headerItems:[...e.chatHeaderActions?[{key:"workspace-actions",type:"custom",pinned:!0,render:()=>e.chatHeaderActions}]:[],...ct&&!ct.validating&&!ct.refused?[{key:"anonymous-key-clock",type:"custom",render:()=>n.jsx(xi,{state:ct})}]:[],...V&&T?[{key:"session-state",type:"custom",render:()=>n.jsx(gr,{facts:qn})},{key:"session-actions",type:"custom",pinned:!0,render:()=>n.jsx(br,{uid:ie||void 0,describe:t=>Ne.described(t),context:os})}]:[],...Nn.map(t=>{const r=t.Component;return{key:`slot-${t.slot}:${t.id}`,type:"custom",priority:-1,render:()=>n.jsx(r,{workspace:e})}}),...e.chatHeaderTrailing?[{key:"right-panel-toggle",type:"custom",pinned:!0,render:()=>e.chatHeaderTrailing}]:[],{key:"full-screen",type:"custom",pinned:!0,render:()=>n.jsx(Bs,{icon:Z?yi:wi,"aria-label":Z?"Exit full screen":"Enter full screen",variant:"invisible",size:"small",onClick:()=>{J(!1),v()},sx:q?{"@keyframes dla-fullscreen-hint":{"0%, 100%":{opacity:1},"50%":{opacity:.4}},"&&":{bg:`color-mix(in srgb, ${a.primary} 16%, transparent)`,boxShadow:`inset 0 0 0 1.5px ${a.primary}`,animation:`dla-fullscreen-hint ${jr}ms ease-in-out infinite`},"@media (prefers-reduced-motion: reduce)":{"&&":{animation:"none"}}}:void 0})}],showInput:!1,onSendReady:Te,notebookToolSurfacesId:_?void 0:e.surfaceId,showTurnFooter:j.showTokenUsage??g?.showTokenUsage??!0,onContextSnapshot:zt,onLoadingChange:vt,renderMessageFooter:V&&T?(t,r)=>t.role==="user"?n.jsx(hr,{facts:qn,turn:r.turn,context:os}):null:void 0,onSpeakingChange:Ue,onItemsChange:se,onDisplayItemsChange:Bt,enableStreaming:!0},nn?.id)}),!un&&Nn.length>0?n.jsx(S,{hidden:!0,children:n.jsx(ft,{slot:le.chatHeader,props:{workspace:e}})}):null,ds&&!lt?Et:null]})}),gs=g?.suggestionLabels!==!1&&St.length>0?n.jsx(S,{"aria-label":o.suggestedPrompts,display:"flex",flexWrap:"wrap",gap:2,px:2,pb:"6px",children:St.map(t=>n.jsx(S,{as:"button",type:"button",title:t.message,disabled:P||st,onClick:()=>{ae(t.message)},appearance:"none",font:"inherit",fontSize:0,fontWeight:"semibold",lineHeight:1.25,px:"10px",py:"5px",width:ks,flex:`0 0 ${ks}px`,borderRadius:"999px",border:"1px solid",bg:"canvas.subtle",whiteSpace:"nowrap",sx:{borderColor:"border.default",color:"fg.default",cursor:"pointer","&:hover:not(:disabled)":{borderColor:"accent.fg",color:"accent.fg"},"&:disabled":{opacity:.5,cursor:"default"}},children:n.jsx(ki,{title:t.title,maxWidth:"100%",sx:{minWidth:0},children:t.title})},t.title))}):null,hs=p?n.jsx(S,{flex:"0 0 auto",px:3,py:2,borderTop:"1px solid",borderColor:"border.default",bg:"canvas.subtle",fontSize:1,maxHeight:"40%",overflowY:"auto",children:p}):null;return n.jsx(Ci,{value:ct,children:n.jsxs(S,{ref:Fe,sx:{height:"100%",minHeight:0,display:"flex",flexDirection:"column",position:"relative",...Z?{bg:"canvas.default"}:null,...Z&&!Xe.current?{position:"fixed",top:U,right:0,bottom:0,left:0,height:"auto",zIndex:1e3}:null},children:[ue?n.jsx(ue.Component,{workspace:e,editors:fs,hasEditor:!!_,transcript:ms,prompt:lt?null:Et,chips:lt?null:gs,picker:ps,transient:hs}):n.jsxs(n.Fragment,{children:[We&&!lt?n.jsxs(S,{flex:"0 0 auto",borderBottom:"1px solid",borderColor:"border.default",children:[Et,gs]}):null,ps,n.jsxs(S,{flex:"1 1 auto",minHeight:0,display:"flex",position:"relative",children:[fs,ms]}),hs,ds||lt||We?null:Et]}),Yt?n.jsx(S,{position:"absolute",inset:0,zIndex:5,bg:"canvas.default",display:"flex",flexDirection:"column",minHeight:0,children:n.jsx(Hi,{agentName:O?.name??F?.name,sandboxStillRuns:L,temporary:In,onSignedIn:()=>ji.getState().clear()})}):null]})})}function Er(e){const o=e?.agent;return typeof o=="string"&&o?o:void 0}function Rr({surfaces:e,active:o,onChange:a,workspace:i}){const c=[...e].sort((d,b)=>(d.order??100)-(b.order??100));return n.jsxs(S,{flex:"0 0 auto",display:"flex",alignItems:"center",gap:2,px:3,py:2,borderBottom:"1px solid",borderColor:"border.default",children:[n.jsx(N,{sx:{fontSize:0,color:"fg.muted"},children:"Beside the chat"}),n.jsxs(gn,{"aria-label":"Editor beside the chat",size:"small",children:[n.jsx(gn.Button,{selected:o===de,onClick:()=>a(de),children:"Chat"}),c.map(d=>{const b=mt(d,i),l=b?void 0:d.unavailableReason?.(i)??"Not available right now";return n.jsx(gn.Button,{selected:o===d.surfaceId,"aria-disabled":!b,title:l??d.title,leadingIcon:d.icon,onClick:()=>{b&&a(d.surfaceId)},children:d.title},d.surfaceId)})]})]})}function vn({children:e}){return n.jsx(S,{height:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"fg.muted",fontSize:1,px:3,textAlign:"center",children:e})}export{Or as default};
@@ -1 +1 @@
1
- import{an as t,r as i}from"../datalayer-app-main.js";import{I as l,r}from"./JupyterLexicalExtension-DpGAnn7v.js";import{$ as j,a as k,b as q,c as v,d as w,e as y,C as z,f as F,g as G}from"./JupyterLexicalExtension-DpGAnn7v.js";import"./NotebookSkeleton-DHQ--KEB.js";import"./Avatar-B0TcOj_b.js";import"./url-4_0MnaFQ.js";import"./isObject-CeOzAI2h.js";import"./toNumber-DUdf79Nr.js";import"./isSymbol-DfwdEMHq.js";import"./StrikethroughIcon-CbiEuPT-.js";import"./TypographyIcon-CCkcdj7U.js";import"./ArrowUpIcon-y5enrVH9.js";import"./floating-ui.react-dom-Bcd0th1j.js";import"./SortDescIcon-Qif6E10I.js";import"./VideoIcon-BTOb9gRv.js";import"./PrismCss-C5fDCsu9.js";import"./Output-DLpf2Of9.js";import"./index-h8lXpqtD.js";import"./hoverbox-CStlKQWE.js";import"./index-B5W7CVUY.js";import"./index-CBWGYoQM.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-BxgGIFfN.js";import"./d3-color-Jd8hXty2.js";import"./dist-N90VI44_.js";import"./index-Cz10oMGc.js";import"./RestartIcon-DvpOf5Mf.js";import"./LexicalToolRegistry-BqxU1w4N.js";function D(){const[o]=t();return i.useEffect(()=>r(o),[o]),null}export{j as $createCollapsibleContainerNode,k as $createCollapsibleContentNode,q as $createCollapsibleTitleNode,v as $isCollapsibleContainerNode,w as $isCollapsibleContentNode,y as $isCollapsibleTitleNode,z as CollapsibleContainerNode,F as CollapsibleContentNode,D as CollapsiblePlugin,G as CollapsibleTitleNode,l as INSERT_COLLAPSIBLE_COMMAND,D as default};
1
+ import{an as t,r as i}from"../datalayer-app-main.js";import{I as l,r}from"./JupyterLexicalExtension-Be8mweC6.js";import{$ as j,a as k,b as q,c as v,d as w,e as y,C as z,f as F,g as G}from"./JupyterLexicalExtension-Be8mweC6.js";import"./NotebookSkeleton-DHQ--KEB.js";import"./Avatar-B0TcOj_b.js";import"./url-4_0MnaFQ.js";import"./isObject-CeOzAI2h.js";import"./toNumber-DUdf79Nr.js";import"./isSymbol-DfwdEMHq.js";import"./StrikethroughIcon-CbiEuPT-.js";import"./TypographyIcon-CCkcdj7U.js";import"./ArrowUpIcon-y5enrVH9.js";import"./floating-ui.react-dom-Bcd0th1j.js";import"./SortDescIcon-Qif6E10I.js";import"./VideoIcon-BTOb9gRv.js";import"./PrismCss-C5fDCsu9.js";import"./Output-WQnm0VN5.js";import"./index-npitmnIA.js";import"./hoverbox-CStlKQWE.js";import"./index-DE0JwlLw.js";import"./index-Dqc2hT2k.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-BxgGIFfN.js";import"./d3-color-Jd8hXty2.js";import"./dist-N90VI44_.js";import"./index-Cz10oMGc.js";import"./RestartIcon-DvpOf5Mf.js";import"./LexicalToolRegistry-DI_iHg04.js";function D(){const[o]=t();return i.useEffect(()=>r(o),[o]),null}export{j as $createCollapsibleContainerNode,k as $createCollapsibleContentNode,q as $createCollapsibleTitleNode,v as $isCollapsibleContainerNode,w as $isCollapsibleContentNode,y as $isCollapsibleTitleNode,z as CollapsibleContainerNode,F as CollapsibleContentNode,D as CollapsiblePlugin,G as CollapsibleTitleNode,l as INSERT_COLLAPSIBLE_COMMAND,D as default};
@@ -1 +1 @@
1
- import{r as x,j as e,B as n,T as s,a0 as i}from"../datalayer-app-main.js";import j from"./esm-DNtiNaWu.js";import"./core-CsMGn5rr.js";function F({agentUsage:o,padding:y,showContextRing:T=!1}){const[k,h]=x.useState(!1),v=x.useRef(null),c=x.useRef(null),g=!!o.turnUsage,C=!!o.sessionUsage,w=!!o.costUsage&&(o.costUsage.cumulativeCostUsd>0||o.costUsage.lastTurnCostUsd>0),m=o.sessionUsage,p=o.turnUsage,b=o.costUsage,d=t=>t<.01?`$${t.toFixed(4)}`:t<1?`$${t.toFixed(3)}`:`$${t.toFixed(2)}`,f=o.totalTokens,u=o.contextWindow,S=Math.max(0,u-f),a=u>0?f/u*100:0,r=[];if(o.distribution?.children?.length){const t={"System Prompts":"#8250df","Tool Definitions":"#bf8700","User Messages":"#16A085","Assistant Messages":"#1a7f37","Tool Usage":"#cf222e"};for(const l of o.distribution.children)r.push({name:l.name,value:l.value,color:t[l.name]||"#6e7781"})}else{o.systemPromptTokens>0&&r.push({name:"System Prompts",value:o.systemPromptTokens,color:"#8250df"}),o.toolTokens>0&&r.push({name:"Tool Definitions",value:o.toolTokens,color:"#bf8700"});const t=(o.userMessageTokens||0)+(o.assistantMessageTokens||0);t>0&&r.push({name:"Messages",value:t,color:"#16A085"});const l=(o.toolCallTokens||0)+(o.toolReturnTokens||0);l>0&&r.push({name:"Tool Results",value:l,color:"#cf222e"})}const z=a>90?"#cf222e":a>70?"#bf8700":"#16A085",W="var(--bgColor-muted, #f6f8fa)",R="var(--borderColor-default, #d1d9e0)",M={animation:!1,series:[{type:"pie",radius:[0,"90%"],center:["50%","50%"],silent:!0,label:{show:!1},labelLine:{show:!1},data:[{value:f,itemStyle:{color:z}},{value:S,itemStyle:{color:W}}]}]},P={animation:!1,series:[{type:"pie",radius:["45%","80%"],center:["50%","50%"],silent:!0,label:{show:!1},labelLine:{show:!1},itemStyle:{borderColor:"var(--bgColor-default, #ffffff)",borderWidth:1},data:[...r.map(t=>({value:t.value,itemStyle:{color:t.color}})),{value:S,itemStyle:{color:R}}]}]};return e.jsxs(n,{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:2,py:1,px:y,bg:"canvas.subtle",flexWrap:"nowrap",overflow:"visible",whiteSpace:"nowrap",minWidth:0,children:[T&&e.jsxs(n,{position:"relative",flexShrink:0,onMouseEnter:()=>{c.current&&clearTimeout(c.current),c.current=setTimeout(()=>h(!0),150)},onMouseLeave:()=>{c.current&&clearTimeout(c.current),c.current=setTimeout(()=>h(!1),250)},children:[e.jsx(n,{ref:v,cursor:"pointer",width:20,height:20,display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid",borderColor:"border.default",borderRadius:"50%",children:e.jsx(j,{option:M,style:{width:18,height:18},opts:{renderer:"svg"}})}),k&&e.jsxs(n,{position:"absolute",bottom:"100%",left:0,mb:1,p:3,width:260,bg:"canvas.overlay",borderRadius:2,boxShadow:"shadow.large",border:"1px solid",borderColor:"border.default",zIndex:100,children:[e.jsx(s,{sx:{fontWeight:"bold",fontSize:1,color:"fg.default",display:"block",mb:2},children:"Context"}),e.jsxs(s,{sx:{fontSize:0,color:"fg.muted",display:"block",mb:1},children:[e.jsx(s,{as:"span",sx:{fontWeight:"semibold",color:"fg.default"},children:i(f)})," / ",i(u)," tokens"]}),o.costUsage&&e.jsxs(s,{sx:{fontSize:0,color:"fg.muted",display:"block",mb:2},children:["cost ",e.jsx(s,{as:"span",sx:{fontWeight:"semibold",color:"fg.default"},children:d(o.costUsage.lastTurnCostUsd)})," turn · ",e.jsx(s,{as:"span",sx:{fontWeight:"semibold",color:"fg.default"},children:d(o.costUsage.cumulativeCostUsd)})," total"]}),e.jsxs(s,{sx:{fontSize:0,color:a>90?"danger.fg":a>70?"attention.fg":"fg.muted",fontWeight:"semibold",display:"block",mb:2},children:["• ",a.toFixed(0),"%"]}),e.jsx(n,{display:"flex",justifyContent:"center",mb:2,children:e.jsx(j,{option:P,style:{width:80,height:80},opts:{renderer:"svg"}})}),e.jsx(n,{display:"flex",flexDirection:"column",gap:1,children:r.map(t=>{const l=f>0?t.value/f*100:0;return e.jsxs(n,{display:"flex",alignItems:"center",gap:2,children:[e.jsx(n,{width:8,height:8,borderRadius:"50%",bg:t.color,flexShrink:0}),e.jsx(s,{sx:{fontSize:0,color:"fg.muted",flex:1},children:t.name}),e.jsxs(s,{sx:{fontSize:0,color:"fg.default",fontWeight:"semibold"},children:[l.toFixed(1),"%"]})]},t.name)})}),a>70&&e.jsx(s,{sx:{fontSize:0,color:"attention.fg",display:"block",mt:2,fontStyle:"italic"},children:"Quality may decline as limit nears."})]})]}),e.jsxs(s,{sx:{fontSize:0,color:"fg.muted",flexShrink:0},children:[e.jsx(s,{as:"span",sx:{fontWeight:"semibold",color:"fg.default",fontSize:0},children:i(o.totalTokens)})," / ",i(o.contextWindow)," ctx"]}),w&&e.jsxs(s,{sx:{fontSize:0,color:"fg.muted",flexShrink:0},children:["· cost ",e.jsx(s,{as:"span",sx:{fontWeight:"semibold",color:"fg.default",fontSize:0},children:d(b?.lastTurnCostUsd??0)})," turn / ",e.jsx(s,{as:"span",sx:{fontWeight:"semibold",color:"fg.default",fontSize:0},children:d(b?.cumulativeCostUsd??0)})]}),C&&e.jsxs(s,{sx:{fontSize:0,color:"fg.muted",flexShrink:0},children:["· session ",i(m?.inputTokens??0),e.jsx(s,{as:"span",sx:{color:"success.fg",fontSize:0},children:"▲"})," ",i(m?.outputTokens??0),e.jsx(s,{as:"span",sx:{color:"attention.fg",fontSize:0},children:"▼"})]}),g&&e.jsxs(s,{sx:{fontSize:0,color:"fg.muted",flexShrink:0},children:["· turn ",i(p?.inputTokens??0),e.jsx(s,{as:"span",sx:{color:"success.fg",fontSize:0},children:"▲"})," ",i(p?.outputTokens??0),e.jsx(s,{as:"span",sx:{color:"attention.fg",fontSize:0},children:"▼"})]})]})}export{F as ContextPie};
1
+ import{r as x,j as e,B as n,T as s,a0 as i}from"../datalayer-app-main.js";import j from"./esm-Som5GXlh.js";import"./core-B-25xtEy.js";function F({agentUsage:o,padding:y,showContextRing:T=!1}){const[k,h]=x.useState(!1),v=x.useRef(null),c=x.useRef(null),g=!!o.turnUsage,C=!!o.sessionUsage,w=!!o.costUsage&&(o.costUsage.cumulativeCostUsd>0||o.costUsage.lastTurnCostUsd>0),m=o.sessionUsage,p=o.turnUsage,b=o.costUsage,d=t=>t<.01?`$${t.toFixed(4)}`:t<1?`$${t.toFixed(3)}`:`$${t.toFixed(2)}`,f=o.totalTokens,u=o.contextWindow,S=Math.max(0,u-f),a=u>0?f/u*100:0,r=[];if(o.distribution?.children?.length){const t={"System Prompts":"#8250df","Tool Definitions":"#bf8700","User Messages":"#16A085","Assistant Messages":"#1a7f37","Tool Usage":"#cf222e"};for(const l of o.distribution.children)r.push({name:l.name,value:l.value,color:t[l.name]||"#6e7781"})}else{o.systemPromptTokens>0&&r.push({name:"System Prompts",value:o.systemPromptTokens,color:"#8250df"}),o.toolTokens>0&&r.push({name:"Tool Definitions",value:o.toolTokens,color:"#bf8700"});const t=(o.userMessageTokens||0)+(o.assistantMessageTokens||0);t>0&&r.push({name:"Messages",value:t,color:"#16A085"});const l=(o.toolCallTokens||0)+(o.toolReturnTokens||0);l>0&&r.push({name:"Tool Results",value:l,color:"#cf222e"})}const z=a>90?"#cf222e":a>70?"#bf8700":"#16A085",W="var(--bgColor-muted, #f6f8fa)",R="var(--borderColor-default, #d1d9e0)",M={animation:!1,series:[{type:"pie",radius:[0,"90%"],center:["50%","50%"],silent:!0,label:{show:!1},labelLine:{show:!1},data:[{value:f,itemStyle:{color:z}},{value:S,itemStyle:{color:W}}]}]},P={animation:!1,series:[{type:"pie",radius:["45%","80%"],center:["50%","50%"],silent:!0,label:{show:!1},labelLine:{show:!1},itemStyle:{borderColor:"var(--bgColor-default, #ffffff)",borderWidth:1},data:[...r.map(t=>({value:t.value,itemStyle:{color:t.color}})),{value:S,itemStyle:{color:R}}]}]};return e.jsxs(n,{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:2,py:1,px:y,bg:"canvas.subtle",flexWrap:"nowrap",overflow:"visible",whiteSpace:"nowrap",minWidth:0,children:[T&&e.jsxs(n,{position:"relative",flexShrink:0,onMouseEnter:()=>{c.current&&clearTimeout(c.current),c.current=setTimeout(()=>h(!0),150)},onMouseLeave:()=>{c.current&&clearTimeout(c.current),c.current=setTimeout(()=>h(!1),250)},children:[e.jsx(n,{ref:v,cursor:"pointer",width:20,height:20,display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid",borderColor:"border.default",borderRadius:"50%",children:e.jsx(j,{option:M,style:{width:18,height:18},opts:{renderer:"svg"}})}),k&&e.jsxs(n,{position:"absolute",bottom:"100%",left:0,mb:1,p:3,width:260,bg:"canvas.overlay",borderRadius:2,boxShadow:"shadow.large",border:"1px solid",borderColor:"border.default",zIndex:100,children:[e.jsx(s,{sx:{fontWeight:"bold",fontSize:1,color:"fg.default",display:"block",mb:2},children:"Context"}),e.jsxs(s,{sx:{fontSize:0,color:"fg.muted",display:"block",mb:1},children:[e.jsx(s,{as:"span",sx:{fontWeight:"semibold",color:"fg.default"},children:i(f)})," / ",i(u)," tokens"]}),o.costUsage&&e.jsxs(s,{sx:{fontSize:0,color:"fg.muted",display:"block",mb:2},children:["cost ",e.jsx(s,{as:"span",sx:{fontWeight:"semibold",color:"fg.default"},children:d(o.costUsage.lastTurnCostUsd)})," turn · ",e.jsx(s,{as:"span",sx:{fontWeight:"semibold",color:"fg.default"},children:d(o.costUsage.cumulativeCostUsd)})," total"]}),e.jsxs(s,{sx:{fontSize:0,color:a>90?"danger.fg":a>70?"attention.fg":"fg.muted",fontWeight:"semibold",display:"block",mb:2},children:["• ",a.toFixed(0),"%"]}),e.jsx(n,{display:"flex",justifyContent:"center",mb:2,children:e.jsx(j,{option:P,style:{width:80,height:80},opts:{renderer:"svg"}})}),e.jsx(n,{display:"flex",flexDirection:"column",gap:1,children:r.map(t=>{const l=f>0?t.value/f*100:0;return e.jsxs(n,{display:"flex",alignItems:"center",gap:2,children:[e.jsx(n,{width:8,height:8,borderRadius:"50%",bg:t.color,flexShrink:0}),e.jsx(s,{sx:{fontSize:0,color:"fg.muted",flex:1},children:t.name}),e.jsxs(s,{sx:{fontSize:0,color:"fg.default",fontWeight:"semibold"},children:[l.toFixed(1),"%"]})]},t.name)})}),a>70&&e.jsx(s,{sx:{fontSize:0,color:"attention.fg",display:"block",mt:2,fontStyle:"italic"},children:"Quality may decline as limit nears."})]})]}),e.jsxs(s,{sx:{fontSize:0,color:"fg.muted",flexShrink:0},children:[e.jsx(s,{as:"span",sx:{fontWeight:"semibold",color:"fg.default",fontSize:0},children:i(o.totalTokens)})," / ",i(o.contextWindow)," ctx"]}),w&&e.jsxs(s,{sx:{fontSize:0,color:"fg.muted",flexShrink:0},children:["· cost ",e.jsx(s,{as:"span",sx:{fontWeight:"semibold",color:"fg.default",fontSize:0},children:d(b?.lastTurnCostUsd??0)})," turn / ",e.jsx(s,{as:"span",sx:{fontWeight:"semibold",color:"fg.default",fontSize:0},children:d(b?.cumulativeCostUsd??0)})]}),C&&e.jsxs(s,{sx:{fontSize:0,color:"fg.muted",flexShrink:0},children:["· session ",i(m?.inputTokens??0),e.jsx(s,{as:"span",sx:{color:"success.fg",fontSize:0},children:"▲"})," ",i(m?.outputTokens??0),e.jsx(s,{as:"span",sx:{color:"attention.fg",fontSize:0},children:"▼"})]}),g&&e.jsxs(s,{sx:{fontSize:0,color:"fg.muted",flexShrink:0},children:["· turn ",i(p?.inputTokens??0),e.jsx(s,{as:"span",sx:{color:"success.fg",fontSize:0},children:"▲"})," ",i(p?.outputTokens??0),e.jsx(s,{as:"span",sx:{color:"attention.fg",fontSize:0},children:"▼"})]})]})}export{F as ContextPie};
@@ -1 +1 @@
1
- import{an as k,r as l,aG as g,j as s,I as h,aH as D,D as v,aI as w,aF as d,T as S}from"../datalayer-app-main.js";import{l as j,j as y,N as b}from"./JupyterLexicalExtension-DpGAnn7v.js";import{D as C,v as E}from"./DeckRenderer-DQmjQ_vE.js";import"./NotebookSkeleton-DHQ--KEB.js";import"./Avatar-B0TcOj_b.js";import"./url-4_0MnaFQ.js";import"./isObject-CeOzAI2h.js";import"./toNumber-DUdf79Nr.js";import"./isSymbol-DfwdEMHq.js";import"./StrikethroughIcon-CbiEuPT-.js";import"./TypographyIcon-CCkcdj7U.js";import"./ArrowUpIcon-y5enrVH9.js";import"./floating-ui.react-dom-Bcd0th1j.js";import"./SortDescIcon-Qif6E10I.js";import"./VideoIcon-BTOb9gRv.js";import"./PrismCss-C5fDCsu9.js";import"./Output-DLpf2Of9.js";import"./index-h8lXpqtD.js";import"./hoverbox-CStlKQWE.js";import"./index-B5W7CVUY.js";import"./index-CBWGYoQM.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-BxgGIFfN.js";import"./d3-color-Jd8hXty2.js";import"./dist-N90VI44_.js";import"./index-Cz10oMGc.js";import"./RestartIcon-DvpOf5Mf.js";import"./LexicalToolRegistry-BqxU1w4N.js";const T={ArrowRight:e=>e.next(),ArrowDown:e=>e.next(),PageDown:e=>e.next()," ":e=>e.next(),ArrowLeft:e=>e.prev(),ArrowUp:e=>e.prev(),PageUp:e=>e.prev(),Home:e=>e.slide(0),End:e=>e.slide(e.getTotalSlides()-1)};function I(e){const t=l.useRef(null);return l.useEffect(()=>{const o=t.current;if(!o)return;const a=i=>{const n=T[i.key];!n||!e.current||i.target!==o||(i.preventDefault(),i.stopPropagation(),n(e.current))};return o.addEventListener("keydown",a),()=>o.removeEventListener("keydown",a)},[e]),t}function N({issues:e}){return s.jsx(d,{as:"ul",role:"alert",sx:{m:0,mt:2,pl:3,display:"grid",gap:1,fontSize:1},children:e.map(t=>s.jsxs(d,{as:"li",sx:{color:t.severity==="warning"?"attention.fg":"danger.fg"},children:[s.jsx(S,{sx:{fontFamily:"mono"},children:t.where})," —"," ",t.message]},`${t.where}-${t.message}`))})}function R({spec:e,onSave:t,onClose:o}){const[a,i]=l.useState(()=>JSON.stringify(e,null,2)),[n,p]=l.useState([]),c=()=>{const r=E(a);p(r.issues),r.valid&&r.spec&&t(r.spec)};return s.jsxs(v,{title:"Deck specification",subtitle:"The deck as JSON: its title and template under deck, then its slides.",onClose:o,width:"xlarge",footerButtons:[{buttonType:"default",content:"Cancel",onClick:o},{buttonType:"primary",content:"Save",onClick:c}],children:[s.jsx(w,{"aria-label":"The deck's specification, as JSON",value:a,onChange:r=>i(r.target.value),spellCheck:!1,block:!0,rows:22,resize:"vertical",sx:{fontFamily:"mono",fontSize:0}}),n.length>0&&s.jsx(N,{issues:n})]})}function re({className:e,format:t,nodeKey:o,spec:a}){const[i]=k(),n=j(),[p,c]=l.useState(!1),r=l.useRef(null),f=I(r),x=l.useCallback(u=>{i.update(()=>{const m=g(o);y(m)&&m.setSpec(u)}),c(!1)},[i,o]);return s.jsxs(b,{className:e,format:t,nodeKey:o,children:[s.jsxs("div",{ref:f,"data-lexical-deck-block":"",tabIndex:-1,title:n?"Double-click to edit the specification":void 0,onDoubleClick:n?()=>c(!0):void 0,style:{position:"relative",width:"100%",outline:"none"},children:[s.jsx(C,{spec:a,chrome:160,deckRef:r}),n&&s.jsx(h,{icon:D,"aria-label":"Edit the deck's specification",size:"small",variant:"default",sx:{position:"absolute",top:2,right:2,zIndex:10},onMouseDown:u=>u.preventDefault(),onClick:()=>c(!0)})]}),p&&s.jsx(R,{spec:a,onSave:x,onClose:()=>c(!1)})]})}export{re as default};
1
+ import{an as k,r as l,aG as g,j as s,I as h,aH as D,D as v,aI as w,aF as d,T as S}from"../datalayer-app-main.js";import{l as j,j as y,N as b}from"./JupyterLexicalExtension-Be8mweC6.js";import{D as C,v as E}from"./DeckRenderer-BdATImsV.js";import"./NotebookSkeleton-DHQ--KEB.js";import"./Avatar-B0TcOj_b.js";import"./url-4_0MnaFQ.js";import"./isObject-CeOzAI2h.js";import"./toNumber-DUdf79Nr.js";import"./isSymbol-DfwdEMHq.js";import"./StrikethroughIcon-CbiEuPT-.js";import"./TypographyIcon-CCkcdj7U.js";import"./ArrowUpIcon-y5enrVH9.js";import"./floating-ui.react-dom-Bcd0th1j.js";import"./SortDescIcon-Qif6E10I.js";import"./VideoIcon-BTOb9gRv.js";import"./PrismCss-C5fDCsu9.js";import"./Output-WQnm0VN5.js";import"./index-npitmnIA.js";import"./hoverbox-CStlKQWE.js";import"./index-DE0JwlLw.js";import"./index-Dqc2hT2k.js";import"./dayjs.min-u3zuoSR8.js";import"./isEqual-BxgGIFfN.js";import"./d3-color-Jd8hXty2.js";import"./dist-N90VI44_.js";import"./index-Cz10oMGc.js";import"./RestartIcon-DvpOf5Mf.js";import"./LexicalToolRegistry-DI_iHg04.js";const T={ArrowRight:e=>e.next(),ArrowDown:e=>e.next(),PageDown:e=>e.next()," ":e=>e.next(),ArrowLeft:e=>e.prev(),ArrowUp:e=>e.prev(),PageUp:e=>e.prev(),Home:e=>e.slide(0),End:e=>e.slide(e.getTotalSlides()-1)};function I(e){const t=l.useRef(null);return l.useEffect(()=>{const o=t.current;if(!o)return;const a=i=>{const n=T[i.key];!n||!e.current||i.target!==o||(i.preventDefault(),i.stopPropagation(),n(e.current))};return o.addEventListener("keydown",a),()=>o.removeEventListener("keydown",a)},[e]),t}function N({issues:e}){return s.jsx(d,{as:"ul",role:"alert",sx:{m:0,mt:2,pl:3,display:"grid",gap:1,fontSize:1},children:e.map(t=>s.jsxs(d,{as:"li",sx:{color:t.severity==="warning"?"attention.fg":"danger.fg"},children:[s.jsx(S,{sx:{fontFamily:"mono"},children:t.where})," —"," ",t.message]},`${t.where}-${t.message}`))})}function R({spec:e,onSave:t,onClose:o}){const[a,i]=l.useState(()=>JSON.stringify(e,null,2)),[n,p]=l.useState([]),c=()=>{const r=E(a);p(r.issues),r.valid&&r.spec&&t(r.spec)};return s.jsxs(v,{title:"Deck specification",subtitle:"The deck as JSON: its title and template under deck, then its slides.",onClose:o,width:"xlarge",footerButtons:[{buttonType:"default",content:"Cancel",onClick:o},{buttonType:"primary",content:"Save",onClick:c}],children:[s.jsx(w,{"aria-label":"The deck's specification, as JSON",value:a,onChange:r=>i(r.target.value),spellCheck:!1,block:!0,rows:22,resize:"vertical",sx:{fontFamily:"mono",fontSize:0}}),n.length>0&&s.jsx(N,{issues:n})]})}function re({className:e,format:t,nodeKey:o,spec:a}){const[i]=k(),n=j(),[p,c]=l.useState(!1),r=l.useRef(null),f=I(r),x=l.useCallback(u=>{i.update(()=>{const m=g(o);y(m)&&m.setSpec(u)}),c(!1)},[i,o]);return s.jsxs(b,{className:e,format:t,nodeKey:o,children:[s.jsxs("div",{ref:f,"data-lexical-deck-block":"",tabIndex:-1,title:n?"Double-click to edit the specification":void 0,onDoubleClick:n?()=>c(!0):void 0,style:{position:"relative",width:"100%",outline:"none"},children:[s.jsx(C,{spec:a,chrome:160,deckRef:r}),n&&s.jsx(h,{icon:D,"aria-label":"Edit the deck's specification",size:"small",variant:"default",sx:{position:"absolute",top:2,right:2,zIndex:10},onMouseDown:u=>u.preventDefault(),onClick:()=>c(!0)})]}),p&&s.jsx(R,{spec:a,onSave:x,onClose:()=>c(!1)})]})}export{re as default};