@meetquinn/animactl 0.1.13 → 0.1.14-canary.428.1.c550f6b

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 (112) hide show
  1. package/dist/server/inbox/slack-events.d.ts +1 -0
  2. package/dist/server/inbox/slack-events.d.ts.map +1 -1
  3. package/dist/server/inbox/slack-events.js +2 -1
  4. package/dist/server/inbox/slack-ingest.d.ts.map +1 -1
  5. package/dist/server/inbox/slack-ingest.js +6 -1
  6. package/dist/server/slack/message-text.d.ts +7 -0
  7. package/dist/server/slack/message-text.d.ts.map +1 -0
  8. package/dist/server/slack/message-text.js +206 -0
  9. package/dist/server/tests/messages.test.js +64 -0
  10. package/dist/server/tests/slack-ingest.test.js +55 -0
  11. package/dist/web/assets/{FileViewer-0dMU_3Yb.js → FileViewer-Bf5d6cSQ.js} +3 -3
  12. package/dist/web/assets/SlackTimeline-DlAGV1Pu.js +2 -0
  13. package/dist/web/assets/{activity-ChsGQv7u.js → activity-CDr-Xj7p.js} +5 -5
  14. package/dist/web/assets/{arc-BpdTDEEu.js → arc-CxbfVdQ_.js} +1 -1
  15. package/dist/web/assets/architecture-7EHR7CIX-DEPLDFCI.js +1 -0
  16. package/dist/web/assets/{architectureDiagram-3BPJPVTR-BAebiNli.js → architectureDiagram-3BPJPVTR-Cy3nCk5c.js} +1 -1
  17. package/dist/web/assets/{blockDiagram-GPEHLZMM-B_mWGkHL.js → blockDiagram-GPEHLZMM-DtqokDlJ.js} +1 -1
  18. package/dist/web/assets/{c4Diagram-AAUBKEIU-HR1VNy_i.js → c4Diagram-AAUBKEIU-CfP3izqA.js} +1 -1
  19. package/dist/web/assets/channel-Bzx2xkCS.js +1 -0
  20. package/dist/web/assets/channels-CcWcN4Ik.js +1 -0
  21. package/dist/web/assets/{chunk-2J33WTMH-NBbFLxve.js → chunk-2J33WTMH-CCrDtdZ5.js} +1 -1
  22. package/dist/web/assets/{chunk-3OPIFGDE-CjIv24gQ.js → chunk-3OPIFGDE-Cptu2IOT.js} +1 -1
  23. package/dist/web/assets/{chunk-4BX2VUAB-BklxL77i.js → chunk-4BX2VUAB-Be3FWfs2.js} +1 -1
  24. package/dist/web/assets/{chunk-55IACEB6-B7LcFahr.js → chunk-55IACEB6-C6GL1Sjq.js} +1 -1
  25. package/dist/web/assets/{chunk-5ZQYHXKU-C3FMbMob.js → chunk-5ZQYHXKU-oPwvb0pV.js} +1 -1
  26. package/dist/web/assets/{chunk-727SXJPM-YAVfX8gs.js → chunk-727SXJPM-DhkLW2o5.js} +1 -1
  27. package/dist/web/assets/{chunk-AQP2D5EJ-Cl1ITIvN.js → chunk-AQP2D5EJ-CiZtPr31.js} +1 -1
  28. package/dist/web/assets/{chunk-BSJP7CBP-CmTuSrgE.js → chunk-BSJP7CBP-BG46KzMp.js} +1 -1
  29. package/dist/web/assets/{chunk-CSCIHK7Q-D6B_hvzO.js → chunk-CSCIHK7Q-CNUMAlEL.js} +3 -3
  30. package/dist/web/assets/{chunk-FMBD7UC4-DrS0uwlj.js → chunk-FMBD7UC4-rvDi2DHg.js} +1 -1
  31. package/dist/web/assets/{chunk-KSCS5N6A-C8SntwZZ.js → chunk-KSCS5N6A-DH71CYvc.js} +1 -1
  32. package/dist/web/assets/{chunk-L5ZTLDWV-sDcrkouY.js → chunk-L5ZTLDWV-9K_oK75p.js} +1 -1
  33. package/dist/web/assets/{chunk-LZXEDZCA-YlsOdK-K.js → chunk-LZXEDZCA-B0zbk4C3.js} +2 -2
  34. package/dist/web/assets/{chunk-ND2GUHAM-BLbNRLsj.js → chunk-ND2GUHAM-B78Nduiw.js} +1 -1
  35. package/dist/web/assets/{chunk-NZK2D7GU-CADU3YPh.js → chunk-NZK2D7GU-B870oOeF.js} +1 -1
  36. package/dist/web/assets/{chunk-O5CBEL6O-DSlG7coI.js → chunk-O5CBEL6O-ChpcNBF6.js} +1 -1
  37. package/dist/web/assets/chunk-QZHKN3VN-DJogsWKF.js +1 -0
  38. package/dist/web/assets/chunk-WU5MYG2G-CFlJmNBg.js +1 -0
  39. package/dist/web/assets/{chunk-XPW4576I-C6JswecN.js → chunk-XPW4576I-D-MTTLnh.js} +1 -1
  40. package/dist/web/assets/classDiagram-4FO5ZUOK-Ci_0xV-R.js +1 -0
  41. package/dist/web/assets/classDiagram-v2-Q7XG4LA2-Ci_0xV-R.js +1 -0
  42. package/dist/web/assets/{cose-bilkent-S5V4N54A-mWhEcLCj.js → cose-bilkent-S5V4N54A-DqgkeLRI.js} +1 -1
  43. package/dist/web/assets/{dagre-BM42HDAG-9bIqaFph.js → dagre-BM42HDAG-DmquWetY.js} +1 -1
  44. package/dist/web/assets/{diagram-2AECGRRQ-B-K-ULKb.js → diagram-2AECGRRQ-CevmumpQ.js} +1 -1
  45. package/dist/web/assets/{diagram-5GNKFQAL-isB4Ca7U.js → diagram-5GNKFQAL-K8r8VcNV.js} +1 -1
  46. package/dist/web/assets/{diagram-KO2AKTUF-BqmEVGUS.js → diagram-KO2AKTUF-DRmmvshw.js} +1 -1
  47. package/dist/web/assets/{diagram-LMA3HP47-pxXcUCmE.js → diagram-LMA3HP47-C1g-mLH6.js} +1 -1
  48. package/dist/web/assets/{diagram-OG6HWLK6-DoC1Yx0A.js → diagram-OG6HWLK6-CGbmuTxb.js} +1 -1
  49. package/dist/web/assets/{dist-_XEgcieq.js → dist-BFH8Z2iv.js} +1 -1
  50. package/dist/web/assets/{erDiagram-TEJ5UH35-BVowOhVE.js → erDiagram-TEJ5UH35-DcOYye-a.js} +1 -1
  51. package/dist/web/assets/eventmodeling-FCH6USID-DpNB18P6.js +1 -0
  52. package/dist/web/assets/{files-CxbhaS_V.js → files-B08ErJWN.js} +1 -1
  53. package/dist/web/assets/{flowDiagram-I6XJVG4X-rvxAy7Lt.js → flowDiagram-I6XJVG4X-BYxTUxvs.js} +1 -1
  54. package/dist/web/assets/{ganttDiagram-6RSMTGT7-BEDXXmEA.js → ganttDiagram-6RSMTGT7-DaoL9-Rm.js} +1 -1
  55. package/dist/web/assets/gitGraph-WXDBUCRP-DMGTpKBF.js +1 -0
  56. package/dist/web/assets/{gitGraphDiagram-PVQCEYII-i2mrB3m-.js → gitGraphDiagram-PVQCEYII-wPwsRJmi.js} +1 -1
  57. package/dist/web/assets/{globe-C48unvgt.js → globe-Cdu1y3Xh.js} +1 -1
  58. package/dist/web/assets/{index-StJER2cx.css → index-Dha62hKJ.css} +1 -1
  59. package/dist/web/assets/{index-By2E9aa_.js → index-x0q5ijXg.js} +2 -2
  60. package/dist/web/assets/info-J43DQDTF-CfK71aR_.js +1 -0
  61. package/dist/web/assets/{infoDiagram-5YYISTIA-BMPanYyF.js → infoDiagram-5YYISTIA-Dn7qYkHv.js} +1 -1
  62. package/dist/web/assets/{ishikawaDiagram-YF4QCWOH-BHGpP5hW.js → ishikawaDiagram-YF4QCWOH-32xsRngp.js} +1 -1
  63. package/dist/web/assets/{journeyDiagram-JHISSGLW-BrlWiQLK.js → journeyDiagram-JHISSGLW-rCDZ6A3V.js} +1 -1
  64. package/dist/web/assets/{kanban-definition-UN3LZRKU-BbRqBTDo.js → kanban-definition-UN3LZRKU-D_8Q4tPb.js} +1 -1
  65. package/dist/web/assets/{kb-CydicK9h.js → kb-BK_YGW-g.js} +1 -1
  66. package/dist/web/assets/{lightbulb-Bq8GulUH.js → lightbulb-BXuYl8LU.js} +1 -1
  67. package/dist/web/assets/{line-DWy5o113.js → line-DdPyfsvS.js} +1 -1
  68. package/dist/web/assets/{linear-BLHFSyyB.js → linear-DuaNZSrO.js} +1 -1
  69. package/dist/web/assets/{login-CiCSE-gN.js → login-DdaXSiou.js} +1 -1
  70. package/dist/web/assets/{mermaid-parser.core-C4FyrCDB.js → mermaid-parser.core-BPcrIAHj.js} +2 -2
  71. package/dist/web/assets/{mermaid.core-BOAMNyeH.js → mermaid.core-DyZecZAb.js} +3 -3
  72. package/dist/web/assets/{mindmap-definition-RKZ34NQL-0rMOVfQt.js → mindmap-definition-RKZ34NQL-BAMb05hl.js} +1 -1
  73. package/dist/web/assets/packet-YPE3B663-CozX2JO6.js +1 -0
  74. package/dist/web/assets/pie-LRSECV5Y-DkgblrAc.js +1 -0
  75. package/dist/web/assets/{pieDiagram-4H26LBE5-NWMyYx4q.js → pieDiagram-4H26LBE5-DWEn20XN.js} +1 -1
  76. package/dist/web/assets/{profile-FoANjBFT.js → profile-wLVs7-tl.js} +1 -1
  77. package/dist/web/assets/{quadrantDiagram-W4KKPZXB-D5UrfN74.js → quadrantDiagram-W4KKPZXB-DhC79hdy.js} +1 -1
  78. package/dist/web/assets/radar-GUYGQ44K-DH8cECLg.js +1 -0
  79. package/dist/web/assets/{reminders-Bvymhrtj.js → reminders-CKqBA3ZW.js} +1 -1
  80. package/dist/web/assets/{requirementDiagram-4Y6WPE33-Bv4-TuDw.js → requirementDiagram-4Y6WPE33-DdvXJHYd.js} +1 -1
  81. package/dist/web/assets/{sankeyDiagram-5OEKKPKP-DP4Ik1g6.js → sankeyDiagram-5OEKKPKP-X6chbL78.js} +1 -1
  82. package/dist/web/assets/{sequenceDiagram-3UESZ5HK-DlPptHce.js → sequenceDiagram-3UESZ5HK-Yezu3cAV.js} +1 -1
  83. package/dist/web/assets/{src-LEEsfC1s.js → src-B_4a15K_.js} +1 -1
  84. package/dist/web/assets/{stateDiagram-AJRCARHV-DQ5xvrm2.js → stateDiagram-AJRCARHV-jnRTox7p.js} +1 -1
  85. package/dist/web/assets/stateDiagram-v2-BHNVJYJU-2Z_C_vib.js +1 -0
  86. package/dist/web/assets/{timeline-definition-PNZ67QCA-b9E_PkeA.js → timeline-definition-PNZ67QCA-z97-EA3-.js} +1 -1
  87. package/dist/web/assets/treeView-BLDUP644-rizqIaRs.js +1 -0
  88. package/dist/web/assets/treemap-LRROVOQU-BoWqd6zu.js +1 -0
  89. package/dist/web/assets/{vennDiagram-CIIHVFJN-CBT1cHyr.js → vennDiagram-CIIHVFJN-CJczFao4.js} +1 -1
  90. package/dist/web/assets/wardley-L42UT6IY-DEl_u0qc.js +1 -0
  91. package/dist/web/assets/{wardleyDiagram-YWT4CUSO-CfwOTo3p.js → wardleyDiagram-YWT4CUSO-Dsm1FTek.js} +1 -1
  92. package/dist/web/assets/{xychartDiagram-2RQKCTM6-ek4lNUs-.js → xychartDiagram-2RQKCTM6-DNPaRSwX.js} +1 -1
  93. package/dist/web/index.html +2 -2
  94. package/package.json +1 -1
  95. package/dist/web/assets/SlackTimeline-CfreH1Ju.js +0 -2
  96. package/dist/web/assets/architecture-7EHR7CIX-Bx4ycmv2.js +0 -1
  97. package/dist/web/assets/channel-DvNhPQ1e.js +0 -1
  98. package/dist/web/assets/channels-DeMOfCrw.js +0 -1
  99. package/dist/web/assets/chunk-QZHKN3VN-D1TfDS-C.js +0 -1
  100. package/dist/web/assets/chunk-WU5MYG2G-e5eltyh6.js +0 -1
  101. package/dist/web/assets/classDiagram-4FO5ZUOK-gbl3kcXl.js +0 -1
  102. package/dist/web/assets/classDiagram-v2-Q7XG4LA2-gbl3kcXl.js +0 -1
  103. package/dist/web/assets/eventmodeling-FCH6USID-Bdvk_UMb.js +0 -1
  104. package/dist/web/assets/gitGraph-WXDBUCRP-DT7FLvFp.js +0 -1
  105. package/dist/web/assets/info-J43DQDTF-DJWieANg.js +0 -1
  106. package/dist/web/assets/packet-YPE3B663-BpjO2S-z.js +0 -1
  107. package/dist/web/assets/pie-LRSECV5Y-Bl_GD1rD.js +0 -1
  108. package/dist/web/assets/radar-GUYGQ44K-nJYMTdQF.js +0 -1
  109. package/dist/web/assets/stateDiagram-v2-BHNVJYJU-BFo6-B6W.js +0 -1
  110. package/dist/web/assets/treeView-BLDUP644-BBK3rGOs.js +0 -1
  111. package/dist/web/assets/treemap-LRROVOQU-DaNsPlVg.js +0 -1
  112. package/dist/web/assets/wardley-L42UT6IY-CdZ1xhOq.js +0 -1
@@ -15,6 +15,7 @@ export interface SlackMessageEnvelope {
15
15
  }
16
16
  export interface SlackRawMessageEvent {
17
17
  attachments?: unknown[];
18
+ blocks?: unknown;
18
19
  bot_id?: string;
19
20
  channel?: string;
20
21
  channel_type?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"slack-events.d.ts","sourceRoot":"","sources":["../../../server/inbox/slack-events.ts"],"names":[],"mappings":"AACA,OAAO,EAA0C,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAErG,OAAO,KAAK,EAAmB,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,SAAS,GAAG,IAAI,GAAG,QAAQ,CAAC;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,SAAS,GAAG,QAAQ,CAAC;CAClC;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,oBAAoB;IACnC,WAAW,CAAC,EAAE,OAAO,EAAE,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,YAAY,EAAE,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,oBAAqB,SAAQ,oBAAoB;IAChE,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,aAAa,GAAG,SAAS,CAAC;IAChC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,oBAAoB,GAAG,KAAK,IAAI,oBAAoB,CAUjG;AAED,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,oBAAoB,GAAG,SAAS,EAC1C,KAAK,EAAE,oBAAoB,GAC1B,MAAM,CAER;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE;IAC3C,WAAW,CAAC,EAAE,OAAO,EAAE,CAAC;IACxB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,oBAAoB,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,gBAAgB,CAAC;CAChC,GAAG,cAAc,CA2BjB;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,cAAc,CAEpE;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,CAEpE;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,cAAc,GAAG,YAAY,CAcxE"}
1
+ {"version":3,"file":"slack-events.d.ts","sourceRoot":"","sources":["../../../server/inbox/slack-events.ts"],"names":[],"mappings":"AACA,OAAO,EAA0C,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGrG,OAAO,KAAK,EAAmB,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,SAAS,GAAG,IAAI,GAAG,QAAQ,CAAC;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,SAAS,GAAG,QAAQ,CAAC;CAClC;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,oBAAoB;IACnC,WAAW,CAAC,EAAE,OAAO,EAAE,CAAC;IACxB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,YAAY,EAAE,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,oBAAqB,SAAQ,oBAAoB;IAChE,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,aAAa,GAAG,SAAS,CAAC;IAChC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,oBAAoB,GAAG,KAAK,IAAI,oBAAoB,CAUjG;AAED,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,oBAAoB,GAAG,SAAS,EAC1C,KAAK,EAAE,oBAAoB,GAC1B,MAAM,CAER;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE;IAC3C,WAAW,CAAC,EAAE,OAAO,EAAE,CAAC;IACxB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,oBAAoB,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,gBAAgB,CAAC;CAChC,GAAG,cAAc,CA2BjB;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,cAAc,CAEpE;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,CAEpE;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,cAAc,GAAG,YAAY,CAcxE"}
@@ -1,6 +1,7 @@
1
1
  import { nowIso, slackMessageEventId, slackSurfaceId } from '../ids.js';
2
2
  import { normalizeSlackEventFiles, slackTsToIso } from '../slack/slack.helper.js';
3
3
  import { slackMessagePreviewsFromAttachments } from '../slack/message-previews.js';
4
+ import { slackVisibleMessageText } from '../slack/message-text.js';
4
5
  export function isRoutableSlackMessage(event) {
5
6
  return ((event.type === 'message' || event.type === 'app_mention') &&
6
7
  typeof event.channel === 'string' &&
@@ -30,7 +31,7 @@ export function normalizeSlackMessage(input) {
30
31
  channelId,
31
32
  messageTs: ts,
32
33
  actor: slackInboxActor(input.event.user, input.userProfile),
33
- text: input.text ?? input.event.text,
34
+ text: input.text ?? slackVisibleMessageText(input.event) ?? input.event.text,
34
35
  };
35
36
  if (input.attentionSuggestion)
36
37
  result.attentionSuggestion = input.attentionSuggestion;
@@ -1 +1 @@
1
- {"version":3,"file":"slack-ingest.d.ts","sourceRoot":"","sources":["../../../server/inbox/slack-ingest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAShD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAGL,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EAC1B,MAAM,mBAAmB,CAAC;AAE3B,MAAM,WAAW,gBAAgB;IAC/B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,MAAM,EAAE,SAAS,CAAC;IAClB,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IAChC,KAAK,EAAE,oBAAoB,CAAC;IAC5B,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IAChC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAClC;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,cAAc,CAAC;IACrB,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAAC;CAC7E;AAQD,wBAAsB,mBAAmB,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,cAAc,CAAC,CAE1F;AAED,wBAAsB,kCAAkC,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CA0ChH"}
1
+ {"version":3,"file":"slack-ingest.d.ts","sourceRoot":"","sources":["../../../server/inbox/slack-ingest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAShD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAE5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAGL,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EAC1B,MAAM,mBAAmB,CAAC;AAE3B,MAAM,WAAW,gBAAgB;IAC/B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,MAAM,EAAE,SAAS,CAAC;IAClB,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IAChC,KAAK,EAAE,oBAAoB,CAAC;IAC5B,QAAQ,CAAC,EAAE,oBAAoB,CAAC;IAChC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAClC;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,cAAc,CAAC;IACrB,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAAC;CAC7E;AAQD,wBAAsB,mBAAmB,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,cAAc,CAAC,CAE1F;AAED,wBAAsB,kCAAkC,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CA8ChH"}
@@ -1,6 +1,7 @@
1
1
  import { errorMessage } from '../ids.js';
2
2
  import { attachmentsHaveSlackMessagePreviews, slackMessagePreviewsFromAttachments, slackMessageAttachments, waitForSlackMessagePreviewAttachments, } from '../slack/message-previews.js';
3
3
  import { SlackProfileResolver } from '../slack/profiles.js';
4
+ import { slackVisibleMessageText } from '../slack/message-text.js';
4
5
  import { normalizeSlackMessage, slackEventTeamId, } from './slack-events.js';
5
6
  // Turns one routable Slack event into a fully enriched inbox item: sender and
6
7
  // channel profiles, readable mention text, permalink, unfurl previews, and file
@@ -14,7 +15,11 @@ export async function buildSlackInboxItem(input) {
14
15
  export async function buildSlackInboxItemWithLatePreview(input) {
15
16
  const warn = input.warn ?? ((message) => console.warn(message));
16
17
  const profiles = input.profiles ?? new SlackProfileResolver();
17
- const { client, event } = input;
18
+ const client = input.client;
19
+ const visibleText = slackVisibleMessageText(input.event) ?? input.event.text;
20
+ const event = visibleText === input.event.text
21
+ ? input.event
22
+ : { ...input.event, text: visibleText };
18
23
  const teamId = slackEventTeamId(input.envelope, event);
19
24
  const [userProfile, channelProfile, text, permalink, attachments] = await Promise.all([
20
25
  profiles.user({ client, teamId, userId: event.user }),
@@ -0,0 +1,7 @@
1
+ export interface SlackMessageTextInput {
2
+ blocks?: unknown;
3
+ text?: string;
4
+ }
5
+ export declare function slackVisibleMessageText(input: SlackMessageTextInput): string | undefined;
6
+ export declare function slackMessageTextFromBlocks(blocks: unknown): string | undefined;
7
+ //# sourceMappingURL=message-text.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message-text.d.ts","sourceRoot":"","sources":["../../../server/slack/message-text.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,qBAAqB;IACpC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAKD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,qBAAqB,GAAG,MAAM,GAAG,SAAS,CAExF;AAED,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAS9E"}
@@ -0,0 +1,206 @@
1
+ // Slack's top-level text is an accessibility/notification fallback. For rich
2
+ // messages it can be shorter than the body Slack renders from blocks, so use
3
+ // blocks only when every block is a supported message-content block.
4
+ export function slackVisibleMessageText(input) {
5
+ return slackMessageTextFromBlocks(input.blocks) ?? input.text;
6
+ }
7
+ export function slackMessageTextFromBlocks(blocks) {
8
+ if (!Array.isArray(blocks) || blocks.length === 0)
9
+ return undefined;
10
+ const rendered = [];
11
+ for (const block of blocks) {
12
+ const text = renderBlock(block);
13
+ if (text === undefined)
14
+ return undefined;
15
+ if (text.length > 0)
16
+ rendered.push(text);
17
+ }
18
+ return rendered.length > 0 ? rendered.join('\n\n') : undefined;
19
+ }
20
+ function renderBlock(value) {
21
+ const block = record(value);
22
+ if (!block)
23
+ return undefined;
24
+ if (block['type'] === 'markdown')
25
+ return stringField(block, 'text');
26
+ if (block['type'] === 'rich_text')
27
+ return renderRichTextElements(block['elements']);
28
+ if (block['type'] === 'table')
29
+ return renderTable(block['rows']);
30
+ return undefined;
31
+ }
32
+ function renderRichTextElements(value) {
33
+ if (!Array.isArray(value))
34
+ return undefined;
35
+ let output = '';
36
+ let previousWasBlock = false;
37
+ for (const element of value) {
38
+ const text = renderRichTextElement(element);
39
+ if (text === undefined)
40
+ return undefined;
41
+ const currentWasBlock = record(element)?.['type'] !== 'rich_text_section';
42
+ if (output.length > 0
43
+ && !output.endsWith('\n')
44
+ && !text.startsWith('\n')
45
+ && (previousWasBlock || currentWasBlock)) {
46
+ output += '\n';
47
+ }
48
+ output += text;
49
+ previousWasBlock = currentWasBlock;
50
+ }
51
+ return output;
52
+ }
53
+ function renderRichTextElement(value) {
54
+ const element = record(value);
55
+ if (!element)
56
+ return undefined;
57
+ switch (element['type']) {
58
+ case 'rich_text_section':
59
+ return renderInlineElements(element['elements']);
60
+ case 'rich_text_list':
61
+ return renderList(element);
62
+ case 'rich_text_preformatted': {
63
+ const text = renderInlineElements(element['elements']);
64
+ return text === undefined ? undefined : `\`\`\`\n${text}\n\`\`\``;
65
+ }
66
+ case 'rich_text_quote': {
67
+ const text = renderInlineElements(element['elements']);
68
+ return text === undefined ? undefined : text.split('\n').map((line) => `> ${line}`).join('\n');
69
+ }
70
+ default:
71
+ return undefined;
72
+ }
73
+ }
74
+ function renderInlineElements(value) {
75
+ if (!Array.isArray(value))
76
+ return undefined;
77
+ const parts = [];
78
+ for (const element of value) {
79
+ const text = renderInlineElement(element);
80
+ if (text === undefined)
81
+ return undefined;
82
+ parts.push(text);
83
+ }
84
+ return parts.join('');
85
+ }
86
+ function renderInlineElement(value) {
87
+ const element = record(value);
88
+ if (!element)
89
+ return undefined;
90
+ const type = element['type'];
91
+ let text;
92
+ switch (type) {
93
+ case 'text':
94
+ text = stringField(element, 'text');
95
+ break;
96
+ case 'user': {
97
+ const userId = stringField(element, 'user_id');
98
+ text = userId ? `<@${userId}>` : undefined;
99
+ break;
100
+ }
101
+ case 'channel': {
102
+ const channelId = stringField(element, 'channel_id');
103
+ text = channelId ? `<#${channelId}>` : undefined;
104
+ break;
105
+ }
106
+ case 'link': {
107
+ const url = stringField(element, 'url');
108
+ if (!url)
109
+ return undefined;
110
+ const label = stringField(element, 'text');
111
+ text = label && label !== url ? `<${url}|${label}>` : `<${url}>`;
112
+ break;
113
+ }
114
+ case 'emoji': {
115
+ const name = stringField(element, 'name');
116
+ text = name ? `:${name}:` : undefined;
117
+ break;
118
+ }
119
+ case 'broadcast': {
120
+ const range = stringField(element, 'range');
121
+ text = range ? `<!${range}>` : undefined;
122
+ break;
123
+ }
124
+ case 'usergroup': {
125
+ const usergroupId = stringField(element, 'usergroup_id');
126
+ text = usergroupId ? `<!subteam^${usergroupId}>` : undefined;
127
+ break;
128
+ }
129
+ case 'date':
130
+ text = stringField(element, 'fallback');
131
+ break;
132
+ case 'color':
133
+ text = stringField(element, 'value');
134
+ break;
135
+ default:
136
+ return undefined;
137
+ }
138
+ return text === undefined ? undefined : applyStyle(text, element['style']);
139
+ }
140
+ function renderList(element) {
141
+ const entries = element['elements'];
142
+ if (!Array.isArray(entries))
143
+ return undefined;
144
+ const ordered = element['style'] === 'ordered';
145
+ const indent = typeof element['indent'] === 'number' && Number.isFinite(element['indent'])
146
+ ? Math.max(0, Math.floor(element['indent']))
147
+ : 0;
148
+ const prefixIndent = ' '.repeat(indent);
149
+ const lines = [];
150
+ for (let index = 0; index < entries.length; index += 1) {
151
+ const entry = renderRichTextElement(entries[index]);
152
+ if (entry === undefined)
153
+ return undefined;
154
+ const marker = ordered ? `${index + 1}. ` : '- ';
155
+ const continuationIndent = `${prefixIndent}${' '.repeat(marker.length)}`;
156
+ const [first = '', ...rest] = entry.split('\n');
157
+ lines.push(`${prefixIndent}${marker}${first}`);
158
+ lines.push(...rest.map((line) => `${continuationIndent}${line}`));
159
+ }
160
+ return lines.join('\n');
161
+ }
162
+ function renderTable(value) {
163
+ if (!Array.isArray(value) || value.length === 0)
164
+ return undefined;
165
+ const rows = [];
166
+ for (const rawRow of value) {
167
+ if (!Array.isArray(rawRow) || rawRow.length === 0)
168
+ return undefined;
169
+ const row = [];
170
+ for (const cell of rawRow) {
171
+ const rendered = renderBlock(cell);
172
+ if (rendered === undefined)
173
+ return undefined;
174
+ row.push(rendered.replace(/\|/g, '\\|').replace(/\n/g, '<br>'));
175
+ }
176
+ rows.push(row);
177
+ }
178
+ const width = Math.max(...rows.map((row) => row.length));
179
+ const normalized = rows.map((row) => [...row, ...Array(width - row.length).fill('')]);
180
+ const lines = normalized.map((row) => `| ${row.join(' | ')} |`);
181
+ lines.splice(1, 0, `| ${Array(width).fill('---').join(' | ')} |`);
182
+ return lines.join('\n');
183
+ }
184
+ function applyStyle(text, value) {
185
+ const style = record(value);
186
+ if (!style)
187
+ return text;
188
+ let rendered = text;
189
+ if (style['code'] === true)
190
+ rendered = `\`${rendered}\``;
191
+ if (style['bold'] === true)
192
+ rendered = `**${rendered}**`;
193
+ if (style['italic'] === true)
194
+ rendered = `*${rendered}*`;
195
+ if (style['strike'] === true)
196
+ rendered = `~~${rendered}~~`;
197
+ return rendered;
198
+ }
199
+ function record(value) {
200
+ return value && typeof value === 'object' && !Array.isArray(value)
201
+ ? value
202
+ : undefined;
203
+ }
204
+ function stringField(value, key) {
205
+ return typeof value[key] === 'string' ? value[key] : undefined;
206
+ }
@@ -1,6 +1,7 @@
1
1
  import test from 'node:test';
2
2
  import assert from 'node:assert/strict';
3
3
  import { slackMessagePreviewsFromAttachments } from '../slack/message-previews.js';
4
+ import { slackVisibleMessageText } from '../slack/message-text.js';
4
5
  import { slackTranscriptOutput } from '../tools/slack-transcript.js';
5
6
  import { slackMessageContentForText } from '../tools/slack-message-format.js';
6
7
  test('Slack markdown block content enforces body and fallback limits', () => {
@@ -12,6 +13,63 @@ test('Slack markdown block content enforces body and fallback limits', () => {
12
13
  assert.ok(content.text.endsWith('…'));
13
14
  assert.throws(() => slackMessageContentForText('X'.repeat(12_001)), /message is too long for Slack markdown block: 12001 characters, Slack allows 12000; send a file instead/);
14
15
  });
16
+ test('Slack visible message text restores complete rich text and tables from blocks', () => {
17
+ const text = slackVisibleMessageText({
18
+ blocks: [
19
+ {
20
+ elements: [{
21
+ elements: [
22
+ { type: 'user', user_id: 'UB0B1' },
23
+ { text: ' finished ', type: 'text' },
24
+ { style: { bold: true }, text: 'S1', type: 'text' },
25
+ { text: '\n\nFiles', type: 'text' },
26
+ ],
27
+ type: 'rich_text_section',
28
+ }, {
29
+ elements: [
30
+ { elements: [{ style: { code: true }, text: 'one.go', type: 'text' }], type: 'rich_text_section' },
31
+ ],
32
+ indent: 0,
33
+ style: 'bullet',
34
+ type: 'rich_text_list',
35
+ }],
36
+ type: 'rich_text',
37
+ },
38
+ {
39
+ rows: [
40
+ [richTextCell('Contract'), richTextCell('Code')],
41
+ [richTextCell('Conservation'), richTextCell('placed | superseded')],
42
+ ],
43
+ type: 'table',
44
+ },
45
+ {
46
+ elements: [{
47
+ elements: [{ text: 'The complete ending survives.', type: 'text' }],
48
+ type: 'rich_text_section',
49
+ }],
50
+ type: 'rich_text',
51
+ },
52
+ ],
53
+ text: '<@UB0B1> finished **S1** …',
54
+ });
55
+ assert.equal(text, [
56
+ '<@UB0B1> finished **S1**\n\nFiles\n- `one.go`',
57
+ '| Contract | Code |\n| --- | --- |\n| Conservation | placed \\| superseded |',
58
+ 'The complete ending survives.',
59
+ ].join('\n\n'));
60
+ });
61
+ test('Slack visible message text keeps fallback text when blocks contain app controls', () => {
62
+ assert.equal(slackVisibleMessageText({
63
+ blocks: [{ elements: [{ type: 'button', value: 'approve' }], type: 'actions' }],
64
+ text: 'Approval requested',
65
+ }), 'Approval requested');
66
+ });
67
+ test('Slack visible message text reads a realtime markdown block verbatim', () => {
68
+ assert.equal(slackVisibleMessageText({
69
+ blocks: [{ text: 'Complete markdown body after the fallback cutoff.', type: 'markdown' }],
70
+ text: 'Complete markdown body…',
71
+ }), 'Complete markdown body after the fallback cutoff.');
72
+ });
15
73
  test('Slack message unfurl attachments normalize into explicit previews', () => {
16
74
  const previews = slackMessagePreviewsFromAttachments([
17
75
  {
@@ -39,6 +97,12 @@ test('Slack message unfurl attachments normalize into explicit previews', () =>
39
97
  text: 'Private note preview',
40
98
  }]);
41
99
  });
100
+ function richTextCell(text) {
101
+ return {
102
+ elements: [{ elements: [{ text, type: 'text' }], type: 'rich_text_section' }],
103
+ type: 'rich_text',
104
+ };
105
+ }
42
106
  test('Slack transcript output includes message preview annotations without reading the target channel', () => {
43
107
  const output = slackTranscriptOutput([{
44
108
  attachments: [{
@@ -125,6 +125,55 @@ test('buildSlackInboxItem enriches profile, channel, mentions, permalink, and fi
125
125
  assert.deepEqual(calls.history, []);
126
126
  });
127
127
  });
128
+ test('buildSlackInboxItem uses the complete visible block body instead of truncated fallback text', async () => {
129
+ await withIngestHome(async () => {
130
+ const calls = emptyCalls();
131
+ const item = await buildSlackInboxItem({
132
+ client: fakeIngestClient({ calls }),
133
+ envelope: { team_id: 'T-ingest' },
134
+ event: {
135
+ blocks: [
136
+ {
137
+ elements: [{
138
+ elements: [
139
+ { type: 'user', user_id: 'UB0B1' },
140
+ { text: ' contract evidence', type: 'text' },
141
+ ],
142
+ type: 'rich_text_section',
143
+ }],
144
+ type: 'rich_text',
145
+ },
146
+ {
147
+ rows: [
148
+ [richTextCell('Contract'), richTextCell('Code')],
149
+ [richTextCell('Conservation'), richTextCell('validateConservation')],
150
+ ],
151
+ type: 'table',
152
+ },
153
+ {
154
+ elements: [{
155
+ elements: [{ text: 'Full implementation tradeoff after the fallback cutoff.', type: 'text' }],
156
+ type: 'rich_text_section',
157
+ }],
158
+ type: 'rich_text',
159
+ },
160
+ ],
161
+ channel: 'C-team',
162
+ channel_type: 'channel',
163
+ text: '<@UB0B1> contract evidence…',
164
+ ts: '1770000012.000001',
165
+ type: 'message',
166
+ user: 'UALICE1',
167
+ },
168
+ warn: () => { },
169
+ });
170
+ assert.match(item.text, /^@bob contract evidence/);
171
+ assert.match(item.text, /\| Contract \| Code \|/);
172
+ assert.match(item.text, /Full implementation tradeoff after the fallback cutoff\.$/);
173
+ assert.doesNotMatch(item.text, /evidence…$/);
174
+ assert.ok(calls.usersInfo.includes('UB0B1'));
175
+ });
176
+ });
128
177
  test('buildSlackInboxItem makes the same Slack API calls for a mention without depending on order', async () => {
129
178
  await withIngestHome(async () => {
130
179
  const calls = emptyCalls();
@@ -151,6 +200,12 @@ test('buildSlackInboxItem makes the same Slack API calls for a mention without d
151
200
  ]));
152
201
  });
153
202
  });
203
+ function richTextCell(text) {
204
+ return {
205
+ elements: [{ elements: [{ text, type: 'text' }], type: 'rich_text_section' }],
206
+ type: 'rich_text',
207
+ };
208
+ }
154
209
  test('buildSlackInboxItem degrades to raw ids when every Slack lookup fails', async () => {
155
210
  await withIngestHome(async () => {
156
211
  const calls = emptyCalls();
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mermaid.core-BOAMNyeH.js","assets/index-By2E9aa_.js","assets/index-StJER2cx.css","assets/chunk-O5CBEL6O-DSlG7coI.js","assets/src-LEEsfC1s.js","assets/chunk-5ZQYHXKU-C3FMbMob.js","assets/dist-_XEgcieq.js","assets/chunk-CSCIHK7Q-D6B_hvzO.js","assets/chunk-3OPIFGDE-CjIv24gQ.js","assets/chunk-L5ZTLDWV-sDcrkouY.js","assets/chunk-NZK2D7GU-CADU3YPh.js","assets/rough.esm-CSKSodPl.js","assets/chunk-BSJP7CBP-CmTuSrgE.js","assets/chunk-KSCS5N6A-C8SntwZZ.js","assets/line-DWy5o113.js","assets/path-BWPyau1x.js","assets/array-BifhSqXX.js","assets/chunk-LZXEDZCA-YlsOdK-K.js","assets/chunk-WU5MYG2G-e5eltyh6.js","assets/chunk-XPW4576I-C6JswecN.js"])))=>i.map(i=>d[i]);
2
- import{t as e}from"./globe-C48unvgt.js";import{t}from"./lightbulb-Bq8GulUH.js";import{An as n,Ct as r,Dn as i,Dt as a,J as o,Mt as s,On as c,Rt as l,St as u,V as d,_n as f,bt as p,ft as m,jn as h,kn as g,kt as _,nt as v,pt as y,t as b,vt as x,wn as S,xt as ee,yt as te,zt as ne}from"./index-By2E9aa_.js";var C=s(`code-xml`,[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]]),re=s(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),ie=s(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),ae=s(`file-braces`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1`,key:`1oajmo`}],[`path`,{d:`M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1`,key:`mpwhp6`}]]),oe=s(`file-code`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]),se=s(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),ce=s(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),le=s(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),ue=s(`link-2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),de=s(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),fe=s(`megaphone`,[[`path`,{d:`M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z`,key:`q8bfy3`}],[`path`,{d:`M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14`,key:`1853fq`}],[`path`,{d:`M8 6v8`,key:`15ugcq`}]]),pe=s(`octagon-alert`,[[`path`,{d:`M12 16h.01`,key:`1drbdi`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z`,key:`1fd625`}]]),me=s(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),he=s(`text-wrap`,[[`path`,{d:`m16 16-3 3 3 3`,key:`117b85`}],[`path`,{d:`M3 12h14.5a1 1 0 0 1 0 7H13`,key:`18xa6z`}],[`path`,{d:`M3 19h6`,key:`1ygdsz`}],[`path`,{d:`M3 5h18`,key:`1u36vt`}]]),w=h(c(),1),T=f(),ge=n({ParseError:()=>E,SETTINGS_SCHEMA:()=>Ee,__defineFunction:()=>B,__defineMacro:()=>H,__defineSymbol:()=>k,__domTree:()=>Oo,__parse:()=>Co,__renderToDomTree:()=>To,__renderToHTMLTree:()=>Eo,__setFontMetrics:()=>It,default:()=>ko,render:()=>xo,renderToString:()=>So,version:()=>Do}),E=class e extends Error{constructor(t,n){var r=`KaTeX parse error: `+t,i,a,o=n&&n.loc;if(o&&o.start<=o.end){var s=o.lexer.input;i=o.start,a=o.end,i===s.length?r+=` at end of input: `:r+=` at position `+(i+1)+`: `;var c=s.slice(i,a).replace(/[^]/g,`$&̲`),l=i>15?`…`+s.slice(i-15,i):s.slice(0,i),u=a+15<s.length?s.slice(a,a+15)+`…`:s.slice(a);r+=l+c+u}super(r),this.name=`ParseError`,this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,e.prototype),this.position=i,i!=null&&a!=null&&(this.length=a-i),this.rawMessage=t}},_e=/([A-Z])/g,ve=e=>e.replace(_e,`-$1`).toLowerCase(),ye={"&":`&amp;`,">":`&gt;`,"<":`&lt;`,'"':`&quot;`,"'":`&#x27;`},be=/[&><"']/g,xe=e=>String(e).replace(be,e=>ye[e]),Se=e=>e.type===`ordgroup`||e.type===`color`?e.body.length===1?Se(e.body[0]):e:e.type===`font`?Se(e.body):e,Ce=new Set([`mathord`,`textord`,`atom`]),we=e=>Ce.has(Se(e).type),Te=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(e);return t?t[2]!==`:`||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():`_relative`},Ee={displayMode:{type:`boolean`,description:`Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.`,cli:`-d, --display-mode`},output:{type:{enum:[`htmlAndMathml`,`html`,`mathml`]},description:`Determines the markup language of the output.`,cli:`-F, --format <type>`},leqno:{type:`boolean`,description:`Render display math in leqno style (left-justified tags).`},fleqn:{type:`boolean`,description:`Render display math flush left.`},throwOnError:{type:`boolean`,default:!0,cli:`-t, --no-throw-on-error`,cliDescription:`Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error.`},errorColor:{type:`string`,default:`#cc0000`,cli:`-c, --error-color <color>`,cliDescription:`A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.`,cliProcessor:e=>`#`+e},macros:{type:`object`,cli:`-m, --macro <def>`,cliDescription:`Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).`,cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:`number`,description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:`--min-rule-thickness <size>`,cliProcessor:parseFloat},colorIsTextColor:{type:`boolean`,description:`Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.`,cli:`-b, --color-is-text-color`},strict:{type:[{enum:[`warn`,`ignore`,`error`]},`boolean`,`function`],description:`Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.`,cli:`-S, --strict`,cliDefault:!1},trust:{type:[`boolean`,`function`],description:`Trust the input, enabling all HTML features such as \\url.`,cli:`-T, --trust`},maxSize:{type:`number`,default:1/0,description:`If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large`,processor:e=>Math.max(0,e),cli:`-s, --max-size <n>`,cliProcessor:parseInt},maxExpand:{type:`number`,default:1e3,description:`Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.`,processor:e=>Math.max(0,e),cli:`-e, --max-expand <n>`,cliProcessor:e=>e===`Infinity`?1/0:parseInt(e)},globalGroup:{type:`boolean`,cli:!1}};function De(e){if(typeof e!=`string`)return e.enum[0];switch(e){case`boolean`:return!1;case`string`:return``;case`number`:return 0;case`object`:return{};default:throw Error(`Unexpected schema type; settings must declare an explicit default.`)}}function Oe(e){return e.default===void 0?De(Array.isArray(e.type)?e.type[0]:e.type):e.default}function ke(e,t,n,r){var i=n[t];e[t]=i===void 0?Oe(r):r.processor?r.processor(i):i}var Ae=class{constructor(e){e===void 0&&(e={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e||={};for(var t of Object.keys(Ee)){var n=Ee[t];n&&ke(this,t,e,n)}}reportNonstrict(e,t,n){var r=this.strict;if(typeof r==`function`&&(r=r(e,t,n)),!(!r||r===`ignore`)){if(r===!0||r===`error`)throw new E(`LaTeX-incompatible input and strict mode is set to 'error': `+(t+` [`+e+`]`),n);r===`warn`?typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)):typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`))}}useStrictBehavior(e,t,n){var r=this.strict;if(typeof r==`function`)try{r=r(e,t,n)}catch{r=`error`}return!r||r===`ignore`?!1:r===!0||r===`error`?!0:r===`warn`?(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)),!1):(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`)),!1)}isTrusted(e){if(`url`in e&&e.url&&!e.protocol){var t=Te(e.url);if(t==null)return!1;e.protocol=t}return!!(typeof this.trust==`function`?this.trust(e):this.trust)}},je=class{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return Be[Ve[this.id]]}sub(){return Be[He[this.id]]}fracNum(){return Be[Ue[this.id]]}fracDen(){return Be[We[this.id]]}cramp(){return Be[Ge[this.id]]}text(){return Be[Ke[this.id]]}isTight(){return this.size>=2}},Me=0,Ne=1,Pe=2,Fe=3,Ie=4,Le=5,Re=6,ze=7,Be=[new je(Me,0,!1),new je(Ne,0,!0),new je(Pe,1,!1),new je(Fe,1,!0),new je(Ie,2,!1),new je(Le,2,!0),new je(Re,3,!1),new je(ze,3,!0)],Ve=[Ie,Le,Ie,Le,Re,ze,Re,ze],He=[Le,Le,Le,Le,ze,ze,ze,ze],Ue=[Pe,Fe,Ie,Le,Re,ze,Re,ze],We=[Fe,Fe,Le,Le,ze,ze,ze,ze],Ge=[Ne,Ne,Fe,Fe,Le,Le,ze,ze],Ke=[Me,Ne,Pe,Fe,Pe,Fe,Pe,Fe],D={DISPLAY:Be[Me],TEXT:Be[Pe],SCRIPT:Be[Ie],SCRIPTSCRIPT:Be[Re]},qe=[{name:`latin`,blocks:[[256,591],[768,879]]},{name:`cyrillic`,blocks:[[1024,1279]]},{name:`armenian`,blocks:[[1328,1423]]},{name:`brahmic`,blocks:[[2304,4255]]},{name:`georgian`,blocks:[[4256,4351]]},{name:`cjk`,blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:`hangul`,blocks:[[44032,55215]]}];function Je(e){for(var t=0;t<qe.length;t++)for(var n=qe[t],r=0;r<n.blocks.length;r++){var i=n.blocks[r];if(e>=i[0]&&e<=i[1])return n.name}return null}var Ye=[];qe.forEach(e=>e.blocks.forEach(e=>Ye.push(...e)));function Xe(e){for(var t=0;t<Ye.length;t+=2)if(e>=Ye[t]&&e<=Ye[t+1])return!0;return!1}var Ze=e=>e+` `+e,Qe=80,$e=function(e,t){return`M95,`+(622+e+t)+`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mermaid.core-DyZecZAb.js","assets/index-x0q5ijXg.js","assets/index-Dha62hKJ.css","assets/chunk-O5CBEL6O-ChpcNBF6.js","assets/src-B_4a15K_.js","assets/chunk-5ZQYHXKU-oPwvb0pV.js","assets/dist-BFH8Z2iv.js","assets/chunk-CSCIHK7Q-CNUMAlEL.js","assets/chunk-3OPIFGDE-Cptu2IOT.js","assets/chunk-L5ZTLDWV-9K_oK75p.js","assets/chunk-NZK2D7GU-B870oOeF.js","assets/rough.esm-CSKSodPl.js","assets/chunk-BSJP7CBP-BG46KzMp.js","assets/chunk-KSCS5N6A-DH71CYvc.js","assets/line-DdPyfsvS.js","assets/path-BWPyau1x.js","assets/array-BifhSqXX.js","assets/chunk-LZXEDZCA-B0zbk4C3.js","assets/chunk-WU5MYG2G-CFlJmNBg.js","assets/chunk-XPW4576I-D-MTTLnh.js"])))=>i.map(i=>d[i]);
2
+ import{t as e}from"./globe-Cdu1y3Xh.js";import{t}from"./lightbulb-BXuYl8LU.js";import{An as n,Ct as r,Dn as i,Dt as a,J as o,Mt as s,On as c,Rt as l,St as u,V as d,_n as f,bt as p,ft as m,jn as h,kn as g,kt as _,nt as v,pt as y,t as b,vt as x,wn as S,xt as ee,yt as te,zt as ne}from"./index-x0q5ijXg.js";var C=s(`code-xml`,[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]]),re=s(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),ie=s(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),ae=s(`file-braces`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1`,key:`1oajmo`}],[`path`,{d:`M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1`,key:`mpwhp6`}]]),oe=s(`file-code`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]),se=s(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),ce=s(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),le=s(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),ue=s(`link-2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),de=s(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),fe=s(`megaphone`,[[`path`,{d:`M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z`,key:`q8bfy3`}],[`path`,{d:`M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14`,key:`1853fq`}],[`path`,{d:`M8 6v8`,key:`15ugcq`}]]),pe=s(`octagon-alert`,[[`path`,{d:`M12 16h.01`,key:`1drbdi`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z`,key:`1fd625`}]]),me=s(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),he=s(`text-wrap`,[[`path`,{d:`m16 16-3 3 3 3`,key:`117b85`}],[`path`,{d:`M3 12h14.5a1 1 0 0 1 0 7H13`,key:`18xa6z`}],[`path`,{d:`M3 19h6`,key:`1ygdsz`}],[`path`,{d:`M3 5h18`,key:`1u36vt`}]]),w=h(c(),1),T=f(),ge=n({ParseError:()=>E,SETTINGS_SCHEMA:()=>Ee,__defineFunction:()=>B,__defineMacro:()=>H,__defineSymbol:()=>k,__domTree:()=>Oo,__parse:()=>Co,__renderToDomTree:()=>To,__renderToHTMLTree:()=>Eo,__setFontMetrics:()=>It,default:()=>ko,render:()=>xo,renderToString:()=>So,version:()=>Do}),E=class e extends Error{constructor(t,n){var r=`KaTeX parse error: `+t,i,a,o=n&&n.loc;if(o&&o.start<=o.end){var s=o.lexer.input;i=o.start,a=o.end,i===s.length?r+=` at end of input: `:r+=` at position `+(i+1)+`: `;var c=s.slice(i,a).replace(/[^]/g,`$&̲`),l=i>15?`…`+s.slice(i-15,i):s.slice(0,i),u=a+15<s.length?s.slice(a,a+15)+`…`:s.slice(a);r+=l+c+u}super(r),this.name=`ParseError`,this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,e.prototype),this.position=i,i!=null&&a!=null&&(this.length=a-i),this.rawMessage=t}},_e=/([A-Z])/g,ve=e=>e.replace(_e,`-$1`).toLowerCase(),ye={"&":`&amp;`,">":`&gt;`,"<":`&lt;`,'"':`&quot;`,"'":`&#x27;`},be=/[&><"']/g,xe=e=>String(e).replace(be,e=>ye[e]),Se=e=>e.type===`ordgroup`||e.type===`color`?e.body.length===1?Se(e.body[0]):e:e.type===`font`?Se(e.body):e,Ce=new Set([`mathord`,`textord`,`atom`]),we=e=>Ce.has(Se(e).type),Te=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(e);return t?t[2]!==`:`||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():`_relative`},Ee={displayMode:{type:`boolean`,description:`Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.`,cli:`-d, --display-mode`},output:{type:{enum:[`htmlAndMathml`,`html`,`mathml`]},description:`Determines the markup language of the output.`,cli:`-F, --format <type>`},leqno:{type:`boolean`,description:`Render display math in leqno style (left-justified tags).`},fleqn:{type:`boolean`,description:`Render display math flush left.`},throwOnError:{type:`boolean`,default:!0,cli:`-t, --no-throw-on-error`,cliDescription:`Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error.`},errorColor:{type:`string`,default:`#cc0000`,cli:`-c, --error-color <color>`,cliDescription:`A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.`,cliProcessor:e=>`#`+e},macros:{type:`object`,cli:`-m, --macro <def>`,cliDescription:`Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).`,cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:`number`,description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:`--min-rule-thickness <size>`,cliProcessor:parseFloat},colorIsTextColor:{type:`boolean`,description:`Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.`,cli:`-b, --color-is-text-color`},strict:{type:[{enum:[`warn`,`ignore`,`error`]},`boolean`,`function`],description:`Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.`,cli:`-S, --strict`,cliDefault:!1},trust:{type:[`boolean`,`function`],description:`Trust the input, enabling all HTML features such as \\url.`,cli:`-T, --trust`},maxSize:{type:`number`,default:1/0,description:`If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large`,processor:e=>Math.max(0,e),cli:`-s, --max-size <n>`,cliProcessor:parseInt},maxExpand:{type:`number`,default:1e3,description:`Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.`,processor:e=>Math.max(0,e),cli:`-e, --max-expand <n>`,cliProcessor:e=>e===`Infinity`?1/0:parseInt(e)},globalGroup:{type:`boolean`,cli:!1}};function De(e){if(typeof e!=`string`)return e.enum[0];switch(e){case`boolean`:return!1;case`string`:return``;case`number`:return 0;case`object`:return{};default:throw Error(`Unexpected schema type; settings must declare an explicit default.`)}}function Oe(e){return e.default===void 0?De(Array.isArray(e.type)?e.type[0]:e.type):e.default}function ke(e,t,n,r){var i=n[t];e[t]=i===void 0?Oe(r):r.processor?r.processor(i):i}var Ae=class{constructor(e){e===void 0&&(e={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e||={};for(var t of Object.keys(Ee)){var n=Ee[t];n&&ke(this,t,e,n)}}reportNonstrict(e,t,n){var r=this.strict;if(typeof r==`function`&&(r=r(e,t,n)),!(!r||r===`ignore`)){if(r===!0||r===`error`)throw new E(`LaTeX-incompatible input and strict mode is set to 'error': `+(t+` [`+e+`]`),n);r===`warn`?typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)):typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`))}}useStrictBehavior(e,t,n){var r=this.strict;if(typeof r==`function`)try{r=r(e,t,n)}catch{r=`error`}return!r||r===`ignore`?!1:r===!0||r===`error`?!0:r===`warn`?(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)),!1):(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`)),!1)}isTrusted(e){if(`url`in e&&e.url&&!e.protocol){var t=Te(e.url);if(t==null)return!1;e.protocol=t}return!!(typeof this.trust==`function`?this.trust(e):this.trust)}},je=class{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return Be[Ve[this.id]]}sub(){return Be[He[this.id]]}fracNum(){return Be[Ue[this.id]]}fracDen(){return Be[We[this.id]]}cramp(){return Be[Ge[this.id]]}text(){return Be[Ke[this.id]]}isTight(){return this.size>=2}},Me=0,Ne=1,Pe=2,Fe=3,Ie=4,Le=5,Re=6,ze=7,Be=[new je(Me,0,!1),new je(Ne,0,!0),new je(Pe,1,!1),new je(Fe,1,!0),new je(Ie,2,!1),new je(Le,2,!0),new je(Re,3,!1),new je(ze,3,!0)],Ve=[Ie,Le,Ie,Le,Re,ze,Re,ze],He=[Le,Le,Le,Le,ze,ze,ze,ze],Ue=[Pe,Fe,Ie,Le,Re,ze,Re,ze],We=[Fe,Fe,Le,Le,ze,ze,ze,ze],Ge=[Ne,Ne,Fe,Fe,Le,Le,ze,ze],Ke=[Me,Ne,Pe,Fe,Pe,Fe,Pe,Fe],D={DISPLAY:Be[Me],TEXT:Be[Pe],SCRIPT:Be[Ie],SCRIPTSCRIPT:Be[Re]},qe=[{name:`latin`,blocks:[[256,591],[768,879]]},{name:`cyrillic`,blocks:[[1024,1279]]},{name:`armenian`,blocks:[[1328,1423]]},{name:`brahmic`,blocks:[[2304,4255]]},{name:`georgian`,blocks:[[4256,4351]]},{name:`cjk`,blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:`hangul`,blocks:[[44032,55215]]}];function Je(e){for(var t=0;t<qe.length;t++)for(var n=qe[t],r=0;r<n.blocks.length;r++){var i=n.blocks[r];if(e>=i[0]&&e<=i[1])return n.name}return null}var Ye=[];qe.forEach(e=>e.blocks.forEach(e=>Ye.push(...e)));function Xe(e){for(var t=0;t<Ye.length;t+=2)if(e>=Ye[t]&&e<=Ye[t+1])return!0;return!1}var Ze=e=>e+` `+e,Qe=80,$e=function(e,t){return`M95,`+(622+e+t)+`
3
3
  c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
4
4
  c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
5
5
  c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
@@ -297,4 +297,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
297
297
  `,e[0].empty=!0)},hT=(e,t)=>{let n=e.length;return n>0&&e[n-1]===t?e:e.concat(t)},gT=e=>{let t=[[]],n=[e],r=[0],i=[e.length],a=0,o=0,s=[],c=[s];for(;o>-1;){for(;(a=r[o]++)<i[o];){let e,l=t[o],u=n[o][a];if(typeof u==`string`?(l=o>0?l:[`plain`],e=u):(l=hT(l,u.type),u.alias&&(l=hT(l,u.alias)),e=u.content),typeof e!=`string`){o++,t.push(l),n.push(e),r.push(0),i.push(e.length);continue}let d=e.split(pT),f=d.length;s.push({types:l,content:d[0]});for(let e=1;e<f;e++)mT(s),c.push(s=[]),s.push({types:l,content:d[e]})}o--,t.pop(),n.pop(),r.pop(),i.pop()}return mT(s),c},_T=({prism:e,code:t,grammar:n,language:r})=>(0,w.useMemo)(()=>{if(n==null)return gT([t]);let i={code:t,grammar:n,language:r,tokens:[]};return e.hooks.run(`before-tokenize`,i),i.tokens=e.tokenize(t,n),e.hooks.run(`after-tokenize`,i),gT(i.tokens)},[t,n,r,e]),vT=(e,t)=>{let{plain:n}=e,r=e.styles.reduce((e,n)=>{let{languages:r,style:i}=n;return r&&!r.includes(t)||n.types.forEach(t=>{e[t]=Lw(Lw({},e[t]),i)}),e},{});return r.root=n,r.plain=Rw(Lw({},n),{backgroundColor:void 0}),r},yT=({children:e,language:t,code:n,theme:r,prism:i})=>{let a=t.toLowerCase(),o=vT(r,a),s=dT(o),c=fT(o),l=i.languages[a];return e({tokens:_T({prism:i,language:a,code:n,grammar:l}),className:`prism-code language-${a}`,style:o==null?{}:o.root,getLineProps:s,getTokenProps:c})},bT=e=>(0,w.createElement)(yT,Rw(Lw({},e),{prism:e.prism||$,theme:e.theme||rT,code:e.code,language:e.language}));function xT(e){return e.toLowerCase().replace(/[^\w\s-]/g,``).trim().replace(/\s+/g,`-`)||`section`}function ST(e,t){let n=xT(e),r=t.get(n)??0;return t.set(n,r+1),r===0?n:`${n}-${r}`}function CT(e){return e.replace(/\s+#+\s*$/,``).trim()}function wT(e){window.location.hash!==`#${e}`&&window.history.replaceState(null,``,`${window.location.pathname}${window.location.search}#${e}`)}function TT(e){let t=[],n=new Map,r=e.split(`
298
298
  `);for(let[e,i]of r.entries()){let r=i.match(/^(#{1,6})\s+(.+)/);if(r){let i=r[1].length,a=CT(r[2]);t.push({depth:i,text:a,id:ST(a,n),line:e+1})}}return t}function ET(e){let{origin:t,pathname:n,search:r}=window.location;return`${t}${n}${r}#${e}`}function DT(e){let t=/^#L(\d+)$/.exec(e);if(!t)return null;let n=Number(t[1]);return Number.isInteger(n)&&n>0?n:null}function OT({text:e,variant:t=`floating`}){let[n,r]=(0,w.useState)(!1),i=(0,w.useRef)(null),a=(0,w.useCallback)(()=>{b(e).then(()=>{r(!0),i.current&&clearTimeout(i.current),i.current=setTimeout(()=>r(!1),2e3)}).catch(()=>{})},[e]);return(0,w.useEffect)(()=>()=>{i.current&&clearTimeout(i.current)},[]),(0,T.jsxs)(`button`,{onClick:a,title:n?`Copied!`:`Copy`,"aria-label":n?`Copied`:`Copy code`,className:t===`floating`?`chrome absolute right-2 top-2 flex h-7 items-center gap-1 rounded-sm bg-surface-elevated/80 px-2 text-[11px] text-text-subtle opacity-0 transition-opacity hover:bg-surface-elevated hover:text-text focus-visible:opacity-100 group-hover:opacity-100 group-focus-within:opacity-100 [@media(hover:none)]:opacity-100`:`chrome flex h-7 items-center gap-1 rounded-sm px-2 text-[11px] text-text-subtle transition-colors hover:bg-surface-hover hover:text-text focus-visible:bg-surface-hover focus-visible:text-text`,children:[(0,T.jsx)(re,{className:`h-3 w-3`}),n&&(0,T.jsx)(`span`,{children:`Copied!`})]})}function kT({id:e}){let[t,n]=(0,w.useState)(!1),r=(0,w.useRef)(null),i=(0,w.useCallback)(t=>{t.stopPropagation(),t.preventDefault(),wT(e),b(ET(e)).then(()=>{n(!0),r.current&&clearTimeout(r.current),r.current=setTimeout(()=>n(!1),1500)}).catch(()=>{})},[e]);return(0,w.useEffect)(()=>()=>{r.current&&clearTimeout(r.current)},[]),(0,T.jsx)(`a`,{href:`#${e}`,onClick:i,"aria-label":t?`Link copied`:`Copy link to this section`,title:t?`Link copied!`:`Copy link to this section`,contentEditable:!1,className:`absolute right-full top-[0.1em] mr-1 inline-flex items-center px-1 text-text-subtle no-underline opacity-0 transition-opacity duration-100 hover:text-accent focus-visible:opacity-100 group-hover:opacity-100`,children:(0,T.jsx)(ue,{className:`h-[0.7em] w-[0.7em]`,strokeWidth:2.5,"aria-hidden":`true`})})}function AT({filePath:e}){let t=e.split(`/`).filter(Boolean),n=t[t.length-1]??e,r=t.slice(0,-1),i=r[r.length-1],o=r.length>1;return(0,T.jsxs)(`div`,{title:e,className:`flex min-w-0 items-center gap-1 font-sans text-[12px] text-text-subtle`,children:[i&&(0,T.jsxs)(T.Fragment,{children:[o&&(0,T.jsx)(`span`,{className:`shrink-0 text-text-subtle/70`,children:`…`}),o&&(0,T.jsx)(a,{className:`h-3 w-3 shrink-0 text-text-subtle/50`}),(0,T.jsx)(`span`,{className:`max-w-[12rem] shrink truncate`,children:i}),(0,T.jsx)(a,{className:`h-3 w-3 shrink-0 text-text-subtle/50`})]}),(0,T.jsx)(`span`,{className:`min-w-0 shrink truncate font-medium text-text-muted`,children:n})]})}function jT({id:e,filePath:t,size:n,rawUrl:i,downloadUrl:a}){let[s,c]=(0,w.useState)(!1),[l,d]=(0,w.useState)(!1),f=(0,w.useRef)(null),p=(0,w.useRef)(null);(0,w.useEffect)(()=>{if(!s)return;function e(e){f.current&&!f.current.contains(e.target)&&c(!1)}return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[s]),(0,w.useEffect)(()=>()=>{p.current&&clearTimeout(p.current)},[]);let m=i??ne(e,t),h=a===void 0?o(e,t):a,g=(0,w.useCallback)(()=>{b(t).then(()=>{d(!0),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>d(!1),2e3)}).catch(()=>{})},[t]),_=`flex w-full items-center gap-2 px-3 py-2 text-left font-sans text-[12px] text-text-muted transition-colors hover:bg-surface-elevated`;return(0,T.jsxs)(`div`,{ref:f,className:`relative`,children:[(0,T.jsx)(`button`,{onClick:()=>c(e=>!e),title:`More actions`,"aria-label":`More actions`,"aria-haspopup":`menu`,"aria-expanded":s,className:[`chrome flex min-h-[44px] shrink-0 items-center justify-center rounded-sm px-2 transition-colors`,s?`text-text`:`text-text-subtle hover:bg-surface-elevated hover:text-text-muted`].join(` `),children:(0,T.jsx)(u,{className:`h-3.5 w-3.5`})}),s&&(0,T.jsxs)(`div`,{role:`menu`,className:`absolute right-0 top-full z-20 mt-1 w-44 overflow-hidden rounded-md border border-border-soft bg-surface-raised shadow-lg`,children:[n!==void 0&&(0,T.jsx)(`div`,{className:`border-b border-border-soft px-3 py-1.5 font-sans text-[11px] text-text-subtle`,children:v(n)}),(0,T.jsxs)(`button`,{role:`menuitem`,onClick:g,className:_,children:[(0,T.jsx)(re,{className:`h-3.5 w-3.5 shrink-0`}),l?`Path copied`:`Copy path`]}),(0,T.jsxs)(`a`,{role:`menuitem`,href:m,target:`_blank`,rel:`noreferrer`,onClick:()=>c(!1),className:_,children:[(0,T.jsx)(ee,{className:`h-3.5 w-3.5 shrink-0`}),`Open raw`]}),h&&(0,T.jsxs)(`a`,{role:`menuitem`,href:h,download:!0,onClick:()=>c(!1),className:_,children:[(0,T.jsx)(r,{className:`h-3.5 w-3.5 shrink-0`}),`Download`]})]})]})}function MT({entries:e}){let[t,n]=(0,w.useState)(!1),r=(0,w.useRef)(null);return(0,w.useEffect)(()=>{if(!t)return;function e(e){r.current&&!r.current.contains(e.target)&&n(!1)}return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[t]),e.length===0?null:(0,T.jsxs)(`div`,{ref:r,className:`relative`,children:[(0,T.jsx)(`button`,{onClick:()=>n(e=>!e),title:`Table of contents`,className:[`chrome flex min-h-[44px] shrink-0 items-center justify-center rounded-sm px-2 transition-colors`,t?`text-text`:`text-text-subtle hover:bg-surface-elevated hover:text-text-muted`].join(` `),children:(0,T.jsx)(de,{className:`h-3.5 w-3.5`})}),t&&(0,T.jsx)(`div`,{className:`absolute right-0 top-full z-20 mt-1 w-72 max-h-[480px] overflow-y-auto rounded-md border border-border-soft bg-surface shadow-deep`,children:(0,T.jsx)(`nav`,{className:`py-1`,children:e.map((e,t)=>(0,T.jsx)(`a`,{href:`#${e.id}`,onClick:t=>{t.preventDefault(),n(!1),window.history.replaceState(null,``,`#${e.id}`),document.getElementById(e.id)?.scrollIntoView({behavior:`smooth`})},className:`flex min-h-[40px] items-center font-sans text-[13px] text-text-muted transition-colors hover:bg-surface-elevated/60 hover:text-text`,style:{paddingLeft:`${.75+(e.depth-1)*.75}rem`,paddingRight:`0.75rem`},children:e.text},t))})})]})}var NT=[{value:`preview`,label:`Preview`,Icon:ie},{value:`code`,label:`Code`,Icon:C}];function PT({mode:e,onChange:t}){return(0,T.jsx)(`div`,{role:`tablist`,"aria-label":`File view mode`,className:`chrome inline-flex shrink-0 items-center gap-0.5 rounded-md border border-border-soft bg-surface-raised/40 p-0.5`,children:NT.map(({value:n,label:r,Icon:i})=>{let a=e===n;return(0,T.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":a,title:r,onClick:()=>t(n),className:[`flex min-h-[28px] items-center gap-1.5 rounded-[5px] px-2 text-[11px] font-medium transition-colors`,a?`bg-surface text-text shadow-sm`:`text-text-subtle hover:text-text-muted`].join(` `),children:[(0,T.jsx)(i,{className:`h-3.5 w-3.5`,strokeWidth:2}),r]},n)})})}var FT=`kb-file-view-mode`;function IT(){try{return window.sessionStorage.getItem(`kb-file-view-mode`)===`code`?`code`:`preview`}catch{return`preview`}}function LT(e){try{window.sessionStorage.setItem(FT,e)}catch{}}var RT=`kb-code-wrap`;function zT(){try{return window.sessionStorage.getItem(RT)!==`off`}catch{return!0}}function BT(e){try{window.sessionStorage.setItem(RT,e?`on`:`off`)}catch{}}function VT({body:e,language:t}){let n=(0,w.useRef)(null),[r,i]=(0,w.useState)(()=>DT(window.location.hash)),[a,o]=(0,w.useState)(zT),s=(0,w.useCallback)(()=>{o(e=>{let t=!e;return BT(t),t})},[]);(0,w.useEffect)(()=>{function e(){i(DT(window.location.hash))}return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[]),(0,w.useEffect)(()=>{let e=DT(window.location.hash);if(e===null)return;let t=n.current?.querySelector(`#L${e}`);if(!t)return;let r=setTimeout(()=>t.scrollIntoView({behavior:`smooth`,block:`center`}),80);return()=>clearTimeout(r)},[]);function c(e){let t=r===e?null:e;i(t);let n=t===null?window.location.pathname+window.location.search:`#L${t}`;window.history.replaceState(null,``,n)}return(0,T.jsx)(`div`,{ref:n,className:`min-h-0 flex-1 overflow-auto`,children:(0,T.jsxs)(`div`,{className:`relative group min-h-0 flex-1 overflow-auto`,children:[(0,T.jsx)(`button`,{type:`button`,onClick:s,"aria-pressed":a,title:a?`Disable soft wrap`:`Enable soft wrap`,className:[`chrome absolute right-12 top-2 z-10 flex h-7 items-center gap-1 rounded-sm px-2 text-[11px] transition-opacity`,`opacity-0 focus-visible:opacity-100 group-hover:opacity-100 group-focus-within:opacity-100 [@media(hover:none)]:opacity-100`,a?`bg-accent/10 text-accent hover:bg-accent/15`:`bg-surface-elevated/80 text-text-subtle hover:bg-surface-elevated hover:text-text`].join(` `),children:(0,T.jsx)(he,{className:`h-3 w-3`})}),(0,T.jsx)(OT,{text:e}),(0,T.jsx)(bT,{code:e.replace(/\n$/,``),language:t,theme:Uw.github,children:({className:e,style:t,tokens:n,getLineProps:i,getTokenProps:o})=>(0,T.jsx)(`pre`,{className:`${e} min-h-full font-mono text-[12.5px] leading-relaxed ${a?``:`w-max`}`,style:{...t,background:`transparent`,padding:0,whiteSpace:a?`pre-wrap`:`pre`,wordBreak:a?`break-word`:`normal`},children:(0,T.jsx)(`div`,{className:`py-4`,children:n.map((e,t)=>{let n=t+1,{className:s,...l}=i({line:e}),u=r===n;return(0,T.jsxs)(`div`,{...l,id:`L${n}`,className:[s??``,`flex px-5`,a?``:`min-w-full`,u?`bg-accent/10`:``].join(` `).trim(),children:[(0,T.jsx)(`a`,{href:`#L${n}`,onClick:e=>{e.preventDefault(),c(n)},title:`Link to line ${n}`,className:[`mr-4 inline-block w-8 shrink-0 select-none text-right tabular-nums transition-colors`,u?`text-accent`:`text-text-subtle/50 hover:text-text-muted`].join(` `),children:n}),(0,T.jsx)(`span`,{className:a?`min-w-0 flex-1`:`shrink-0`,children:e.map((e,t)=>(0,T.jsx)(`span`,{...o({token:e})},t))})]},t)})})})})]})})}function HT(e){if(e.length>=2){let t=e[0],n=e[e.length-1];if(t===`"`&&n===`"`||t===`'`&&n===`'`)return e.slice(1,-1)}return e}function UT(e){let t=e.split(`
299
299
  `),n=[],r=0;for(;r<t.length;){let e=t[r];if(e.trim()===``||e.trimStart().startsWith(`#`)){r++;continue}let i=/^([A-Za-z0-9_][\w .-]*):(?:[ \t]+(.*))?$/.exec(e);if(!i||/^\s/.test(e)){r++;continue}let a=i[1],o=(i[2]??``).trim();if(o!==``){n.push({key:a,value:HT(o),block:null}),r++;continue}let s=[];for(r++;r<t.length;){let e=t[r];if(e.trim()===``){r++;continue}if(/^\s/.test(e)||/^-[ \t]/.test(e)){s.push(e),r++;continue}break}n.push({key:a,value:null,block:s.length>0?s:null})}return n}function WT(e){let t=/^---\r?\n([\s\S]*?)\r?\n---[ \t]*(?:\r?\n|$)/.exec(e);if(!t)return{entries:null,body:e};let n=UT(t[1]);return n.length===0?{entries:null,body:e}:{entries:n,body:e.slice(t[0].length)}}function GT(e){let t=e.filter(e=>e.trim()!==``).map(e=>/^[ \t]*/.exec(e)?.[0].length??0),n=t.length>0?Math.min(...t):0;return e.map(e=>e.slice(n))}function KT({block:e}){let t=GT(e),n=t.filter(e=>e.trim()!==``);return n.length>0&&n.every(e=>/^-[ \t]+/.test(e))?(0,T.jsx)(`ul`,{className:`m-0 list-disc space-y-0.5 pl-4`,children:n.map((e,t)=>(0,T.jsx)(`li`,{className:`font-mono text-[12px] text-text`,children:HT(e.replace(/^-[ \t]+/,``).trim())},t))}):(0,T.jsx)(`pre`,{className:`m-0 whitespace-pre-wrap break-words font-mono text-[12px] leading-relaxed text-text`,children:t.join(`
300
- `).trimEnd()})}function qT({entries:e}){return(0,T.jsx)(`div`,{className:`mb-5 overflow-hidden rounded-sm border border-border-soft bg-surface-raised/30`,children:(0,T.jsx)(`table`,{className:`m-0 w-full border-collapse text-left align-top`,children:(0,T.jsx)(`tbody`,{children:e.map((e,t)=>(0,T.jsxs)(`tr`,{className:t>0?`border-t border-border-soft/70`:void 0,children:[(0,T.jsx)(`th`,{scope:`row`,className:`w-px whitespace-nowrap border-r border-border-soft/70 bg-surface-raised/40 px-3 py-2 align-top font-sans text-[11px] font-semibold uppercase tracking-wide text-text-subtle`,children:e.key}),(0,T.jsx)(`td`,{className:`px-3 py-2 align-top font-mono text-[12px] text-text`,children:e.block?(0,T.jsx)(KT,{block:e.block}):(0,T.jsx)(`span`,{className:`break-words`,children:e.value})})]},e.key+t))})})})}function JT({src:e,alt:t}){let[n,r]=(0,w.useState)(!1),i=(0,w.useRef)(null),a=(0,w.useRef)(null),o=(0,w.useCallback)(()=>{a.current=document.activeElement instanceof HTMLElement?document.activeElement:null,r(!0)},[]),s=(0,w.useCallback)(()=>{r(!1)},[]);return(0,w.useEffect)(()=>{if(!n)return;function e(e){e.key===`Escape`?s():e.key===`Tab`&&(e.preventDefault(),i.current?.focus())}return i.current?.focus(),document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),a.current?.focus()}},[s,n]),(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`img`,{src:e,alt:t,onClick:o,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),o())},role:`button`,tabIndex:0,"aria-label":t?`Open image: ${t}`:`Open image`,className:`max-w-full cursor-zoom-in rounded`}),n&&(0,T.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":t?`Image preview: ${t}`:`Image preview`,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/80 p-4`,onClick:s,children:[(0,T.jsx)(`button`,{ref:i,onClick:e=>{e.stopPropagation(),s()},"aria-label":`Close image preview`,title:`Close`,className:`chrome absolute right-4 top-4 flex min-h-[44px] min-w-[44px] items-center justify-center rounded-sm bg-black/40 text-white transition-colors hover:bg-black/60 focus-visible:bg-black/60`,children:(0,T.jsx)(m,{className:`h-4 w-4`})}),(0,T.jsx)(`img`,{src:e,alt:t,className:`max-h-full max-w-full object-contain`,onClick:e=>e.stopPropagation()}),t&&(0,T.jsx)(`div`,{className:`chrome absolute bottom-4 left-4 right-4 rounded-sm bg-black/45 px-3 py-2 text-center text-[12px] text-white/85`,children:t})]})]})}var YT=null;function XT(){return YT||=i(async()=>{let{default:e}=await import(`./mermaid.core-BOAMNyeH.js`);return{default:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19])).then(({default:e})=>(e.initialize({startOnLoad:!1,securityLevel:`strict`,theme:`neutral`,htmlLabels:!1,flowchart:{htmlLabels:!1}}),e)),YT}function ZT(e){return qs.sanitize(e,{USE_PROFILES:{svg:!0,svgFilters:!0},FORBID_TAGS:[`foreignObject`,`img`,`image`,`script`,`iframe`,`object`,`embed`,`a`,`audio`,`video`,`source`,`link`,`base`],FORBID_ATTR:[`href`,`xlink:href`,`src`,`onerror`,`onload`,`onclick`]})}function QT({code:e}){let t=(0,w.useId)(),[n,r]=(0,w.useState)({svg:null,failed:!1});(0,w.useEffect)(()=>{let n=!1,i=`mermaid-${t.replace(/[^a-zA-Z0-9_-]/g,``)}`;return XT().then(t=>t.render(i,e)).then(({svg:e})=>{n||r({svg:e,failed:!1})}).catch(()=>{n||r({svg:null,failed:!0})}),()=>{n=!0}},[e,t]);let{svg:i,failed:a}=n;return a?(0,T.jsx)(`pre`,{className:`font-mono text-[0.82em] leading-[1.55] text-text-muted`,style:{background:`transparent`,margin:0},children:e}):i===null?(0,T.jsx)(`div`,{className:`px-3 py-4 text-[0.82em] text-text-subtle`,children:`Rendering diagram…`}):(0,T.jsx)(`div`,{className:`flex justify-center overflow-x-auto px-3 py-3 [&_svg]:max-w-full [&_svg]:h-auto`,dangerouslySetInnerHTML:{__html:ZT(i)}})}var $T={note:{label:`Note`,Icon:le},tip:{label:`Tip`,Icon:t},important:{label:`Important`,Icon:fe},warning:{label:`Warning`,Icon:y},caution:{label:`Caution`,Icon:pe}},eE=/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]/i;function tE(e){let t=Array.isArray(e)?e:typeof e==`string`?e.split(/\s+/):[];if(!t.includes(`markdown-alert`))return null;for(let e of Object.keys($T))if(t.includes(`markdown-alert-${e}`))return e;return null}function nE(){function e(e){let t=e.children?.find(e=>e.type===`element`&&e.tagName===`p`),n=t?.children?.[0];if(!t||!n||n.type!==`text`||typeof n.value!=`string`)return;let r=eE.exec(n.value);if(!r)return;let i=r[1].toLowerCase(),a=n.value.slice(r[0].length).replace(/^[^\S\n]*\n?/,``);if(a)n.value=a;else{t.children.shift();let n=t.children[0];(n&&n.type===`text`&&typeof n.value==`string`&&/^\s+$/.test(n.value)||n&&n.type===`element`&&n.tagName===`br`)&&t.children.shift(),t.children.length===0&&(e.children=e.children.filter(e=>e!==t))}e.properties=e.properties??{},e.properties.className=[`markdown-alert`,`markdown-alert-${i}`]}function t(n){if(n.children)for(let r of n.children)r.type===`element`&&r.tagName===`blockquote`&&e(r),t(r)}return e=>t(e)}function rE(e,t){if(!e||e.startsWith(`#`)||/^[a-z][a-z\d+\-.]*:/i.test(e))return null;try{let n=new URL(e,`http://x/${t}`);if(n.host!==`x`)return null;let r=n.pathname.slice(1);return r?{path:r,hash:n.hash}:null}catch{return null}}function iE(e,t,n){if(!e||/^[a-z][a-z\d+\-.]*:/i.test(e)||e.startsWith(`#`)||e.startsWith(`/`))return e;let r=rE(e,n);return r?t(r.path):e}function aE(e){if(typeof e!=`string`||e.trim()===``)return!0;if(/prefers-color-scheme:\s*dark/i.test(e))return!1;if(/prefers-color-scheme:\s*light/i.test(e))return!0;if(typeof window<`u`&&typeof window.matchMedia==`function`)try{return window.matchMedia(e).matches}catch{return!0}return!0}function oE(e,t,n){let r=Array.isArray(e)?e.join(`, `):typeof e==`string`?e:``;if(r)return r.split(`,`).map(e=>e.trim()).filter(Boolean).map(e=>{let[r,...i]=e.split(/\s+/);return[iE(r,t,n),...i].join(` `).trim()}).join(`, `)}function sE(e){return w.Children.toArray(e).map(e=>typeof e==`string`?e:(0,w.isValidElement)(e)?sE(e.props.children):``).join(``)}function cE(e,t){return function({children:n,node:r,className:i,...a}){let o=r?.position?.start?.line,s=(typeof o==`number`?t.get(o):void 0)??xT(sE(n));return(0,T.jsxs)(e,{...a,id:s,onClick:()=>{wT(s)},className:[`group relative cursor-pointer`,i].filter(Boolean).join(` `),children:[(0,T.jsx)(kT,{id:s}),n]})}}function lE(e){return{h1:cE(`h1`,e),h2:cE(`h2`,e),h3:cE(`h3`,e),h4:cE(`h4`,e),h5:cE(`h5`,e),h6:cE(`h6`,e)}}var uE=[`div`,`p`,`span`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`td`,`th`],dE={...cw,tagNames:[...cw.tagNames??[],`picture`,`source`,`details`,`summary`],attributes:{...cw.attributes,source:[`srcSet`,`srcset`,`media`,`type`,`sizes`,`width`,`height`],img:[...cw.attributes?.img??[],`align`,`width`,`height`,`loading`],details:[...cw.attributes?.details??[],`open`],blockquote:[...cw.attributes?.blockquote??[],[`className`,`markdown-alert`,`markdown-alert-note`,`markdown-alert-tip`,`markdown-alert-important`,`markdown-alert-warning`,`markdown-alert-caution`]],...Object.fromEntries(uE.map(e=>[e,[...cw.attributes?.[e]??[],`align`]]))}};function fE(e,t,n){return function({href:r,children:i,...a}){if(!r||r.startsWith(`#`))return(0,T.jsx)(`a`,{href:r,...a,children:i});if(/^[a-z][a-z\d+\-.]*:/i.test(r))return(0,T.jsx)(`a`,{href:r,target:`_blank`,rel:`noreferrer`,...a,children:i});let o=rE(r,t);if(!o)return(0,T.jsx)(`a`,{href:r,target:`_blank`,rel:`noreferrer`,...a,children:i});let s=e.browsePath(o.path)+o.hash;return(0,T.jsx)(`a`,{href:s,onClick:e=>{e.preventDefault(),n(s)},...a,children:i})}}function pE({id:e,filePath:t,file:n,loading:r,error:i,links:a,mode:o,onModeChange:s}){let c=S(),u=(0,w.useMemo)(()=>a??{rawPath:t=>ne(e,t),browsePath:t=>l({id:e,filePath:t})},[a,e]),d=u.rawPath(t),f=(0,w.useRef)(null),{entries:p,body:m}=(0,w.useMemo)(()=>n?.kind!==`markdown`||!n.content?{entries:null,body:``}:WT(n.content),[n]),h=(0,w.useMemo)(()=>n?.kind!==`markdown`||!m?new Map:new Map(TT(m).map(e=>[e.line,e.id])),[n,m]),[g,_]=(0,w.useState)(()=>DT(window.location.hash)?`code`:IT()),y=o!==void 0&&s!==void 0,b=y?o:g,x=(0,w.useCallback)(e=>{y&&s?s(e):(_(e),LT(e))},[y,s]),te=n?.kind===`markdown`&&b===`code`;(0,w.useEffect)(()=>{if(n?.kind!==`markdown`||b!==`preview`)return;let e=window.location.hash.slice(1);if(!e)return;let t=document.getElementById(e);if(t){let e=setTimeout(()=>t.scrollIntoView({behavior:`smooth`}),100);return()=>clearTimeout(e)}},[n,b]),(0,w.useEffect)(()=>{if(n?.kind!==`markdown`||b!==`preview`)return;let e=f.current;if(!e)return;let t=e,r=Array.from(t.querySelectorAll(`h1[id], h2[id], h3[id], h4[id], h5[id], h6[id]`));if(r.length===0)return;let i=0;function a(){i=0;let e=t.getBoundingClientRect().top+24,n=r[0];for(let t of r)if(t.getBoundingClientRect().top<=e)n=t;else break;n?.id&&wT(n.id)}function o(){i||=window.requestAnimationFrame(a)}return t.addEventListener(`scroll`,o,{passive:!0}),()=>{t.removeEventListener(`scroll`,o),i&&window.cancelAnimationFrame(i)}},[n,b]);let C=(0,w.useMemo)(()=>({a:fE(u,t,c),...lE(h),img:({src:e,alt:n})=>{let r=e??``;if(r&&!/^[a-z][a-z\d+\-.]*:/i.test(r)&&!r.startsWith(`#`)){let e=rE(r,t);e&&(r=u.rawPath(e.path))}return(0,T.jsx)(JT,{src:r,alt:n??``})},picture:({node:e})=>{let n=null,r=null;for(let i of e?.children??[]){if(i.type!==`element`)continue;let e=i.properties??{};if(i.tagName===`source`&&!n&&aE(e.media)){let r=oE(e.srcSet??e.srcset,u.rawPath,t),i=r?r.split(`,`)[0]?.trim().split(/\s+/)[0]:``;i&&(n=i)}else i.tagName===`img`&&!r&&(r={src:iE(typeof e.src==`string`?e.src:``,u.rawPath,t),alt:typeof e.alt==`string`?e.alt:``,width:e.width==null?void 0:String(e.width)})}let i=n??r?.src;return i?(0,T.jsx)(`img`,{src:i,alt:r?.alt??``,width:r?.width,className:`inline-block h-auto max-w-full`}):null},blockquote:({node:e,children:t,...n})=>{let r=tE(e?.properties?.className);if(!r)return(0,T.jsx)(`blockquote`,{...n,children:t});let{label:i,Icon:a}=$T[r];return(0,T.jsxs)(`blockquote`,{className:`markdown-alert markdown-alert-${r}`,children:[(0,T.jsxs)(`p`,{className:`markdown-alert-title`,children:[(0,T.jsx)(a,{className:`h-4 w-4 shrink-0`,strokeWidth:2,"aria-hidden":`true`}),i]}),t]})},table:({children:e,...t})=>(0,T.jsx)(`div`,{className:`overflow-x-auto`,children:(0,T.jsx)(`table`,{...t,children:e})}),pre:({children:e})=>{let t=sE(e),n=``,r=w.Children.toArray(e)[0];if((0,w.isValidElement)(r)){let e=(r.props.className??``).match(/language-(\S+)/);e&&(n=e[1])}return n===`mermaid`?(0,T.jsxs)(`div`,{className:`kb-markdown-code-block group`,children:[(0,T.jsxs)(`div`,{className:`chrome flex min-h-9 items-center justify-between gap-2 border-b border-border-soft/70 bg-surface-raised/45 px-2 py-1`,children:[(0,T.jsx)(`span`,{className:`rounded-sm px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-text-subtle`,children:`mermaid`}),(0,T.jsx)(OT,{text:t,variant:`inline`})]}),(0,T.jsx)(QT,{code:t.replace(/\n$/,``)})]}):(0,T.jsxs)(`div`,{className:`kb-markdown-code-block group`,children:[(0,T.jsxs)(`div`,{className:`chrome flex min-h-9 items-center justify-between gap-2 border-b border-border-soft/70 bg-surface-raised/45 px-2 py-1`,children:[n?(0,T.jsx)(`span`,{className:`rounded-sm px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-text-subtle`,children:n}):(0,T.jsx)(`span`,{"aria-hidden":`true`}),(0,T.jsx)(OT,{text:t,variant:`inline`})]}),(0,T.jsx)(bT,{code:t.replace(/\n$/,``),language:n||`text`,theme:Uw.github,children:({className:e,style:t,tokens:n,getLineProps:r,getTokenProps:i})=>(0,T.jsx)(`pre`,{className:`${e} font-mono text-[0.82em] leading-[1.55]`,style:{...t,background:`transparent`,margin:0},children:n.map((e,t)=>(0,T.jsx)(`div`,{...r({line:e}),children:e.map((e,t)=>(0,T.jsx)(`span`,{...i({token:e})},t))},t))})})]})}}),[h,u,t,c]);if(i)return(0,T.jsxs)(`div`,{className:`p-6 font-sans text-[13px] text-health-error`,children:[`Could not open `,(0,T.jsx)(`span`,{className:`font-mono`,children:t}),`: `,i.message]});if(r||!n)return(0,T.jsx)(`div`,{className:`p-6 font-sans text-[13px] text-text-subtle`,children:`Loading…`});if(n.kind===`html`)return(0,T.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,T.jsx)(`div`,{className:`flex h-8 shrink-0 items-center justify-end border-b border-border-soft px-3`,children:(0,T.jsxs)(`a`,{href:d,target:`_blank`,rel:`noreferrer`,title:`Open the full-width report in a new tab`,className:`chrome flex items-center gap-1 rounded-sm px-2 py-0.5 text-[10px] uppercase tracking-[0.08em] text-text-subtle transition-colors hover:bg-surface-elevated hover:text-text-muted`,children:[(0,T.jsx)(ee,{className:`h-3 w-3`}),`Open full page`]})}),(0,T.jsx)(`iframe`,{title:n.name,src:d,sandbox:`allow-scripts`,className:`min-h-0 w-full flex-1 border-0 bg-white`})]});if(n.kind===`image`)return(0,T.jsx)(`div`,{className:`flex h-full flex-col`,children:(0,T.jsx)(`div`,{className:`flex flex-1 items-center justify-center overflow-auto bg-surface-elevated/30 p-6`,children:(0,T.jsx)(JT,{src:d,alt:n.name})})});if(n.truncated)return(0,T.jsxs)(`div`,{className:`p-6 font-sans text-[13px] text-text-muted`,children:[`This file is too large to inline (`,v(n.size),`).`,` `,(0,T.jsx)(`a`,{href:d,target:`_blank`,rel:`noreferrer`,className:`text-accent underline underline-offset-2`,children:`Open raw`})]});if(n.kind===`binary`||n.content===void 0)return(0,T.jsxs)(`div`,{className:`p-6 font-sans text-[13px] text-text-muted`,children:[`Binary file (`,v(n.size),`).`,` `,(0,T.jsx)(`a`,{href:d,target:`_blank`,rel:`noreferrer`,className:`text-accent underline underline-offset-2`,children:`Open raw`})]});if(n.kind===`markdown`)return(0,T.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[!y&&(0,T.jsx)(`div`,{className:`flex h-9 shrink-0 items-center justify-end border-b border-border-soft px-3`,children:(0,T.jsx)(PT,{mode:b,onChange:x})}),te?(0,T.jsx)(VT,{body:n.content,language:`markdown`}):(0,T.jsxs)(`div`,{ref:f,className:`min-h-0 flex-1 overflow-y-auto px-6 py-5`,children:[p&&(0,T.jsx)(qT,{entries:p}),(0,T.jsx)(`div`,{className:`md-prose`,children:(0,T.jsx)(Hm,{remarkPlugins:[J_,ov,lv],rehypePlugins:[bC,nE,[Tw,dE],ow],components:C,children:m})})]})]});let re=n.kind===`json`?`json`:n.language??`text`,ie=n.content;if(n.kind===`json`)try{ie=JSON.stringify(JSON.parse(n.content),null,2)}catch{}return(0,T.jsx)(VT,{body:ie,language:re})}export{jT as a,TT as c,$s as d,ec as f,me as h,AT as i,DT as l,ge as m,IT as n,MT as o,qs as p,LT as r,PT as s,pE as t,ic as u};
300
+ `).trimEnd()})}function qT({entries:e}){return(0,T.jsx)(`div`,{className:`mb-5 overflow-hidden rounded-sm border border-border-soft bg-surface-raised/30`,children:(0,T.jsx)(`table`,{className:`m-0 w-full border-collapse text-left align-top`,children:(0,T.jsx)(`tbody`,{children:e.map((e,t)=>(0,T.jsxs)(`tr`,{className:t>0?`border-t border-border-soft/70`:void 0,children:[(0,T.jsx)(`th`,{scope:`row`,className:`w-px whitespace-nowrap border-r border-border-soft/70 bg-surface-raised/40 px-3 py-2 align-top font-sans text-[11px] font-semibold uppercase tracking-wide text-text-subtle`,children:e.key}),(0,T.jsx)(`td`,{className:`px-3 py-2 align-top font-mono text-[12px] text-text`,children:e.block?(0,T.jsx)(KT,{block:e.block}):(0,T.jsx)(`span`,{className:`break-words`,children:e.value})})]},e.key+t))})})})}function JT({src:e,alt:t}){let[n,r]=(0,w.useState)(!1),i=(0,w.useRef)(null),a=(0,w.useRef)(null),o=(0,w.useCallback)(()=>{a.current=document.activeElement instanceof HTMLElement?document.activeElement:null,r(!0)},[]),s=(0,w.useCallback)(()=>{r(!1)},[]);return(0,w.useEffect)(()=>{if(!n)return;function e(e){e.key===`Escape`?s():e.key===`Tab`&&(e.preventDefault(),i.current?.focus())}return i.current?.focus(),document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),a.current?.focus()}},[s,n]),(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`img`,{src:e,alt:t,onClick:o,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),o())},role:`button`,tabIndex:0,"aria-label":t?`Open image: ${t}`:`Open image`,className:`max-w-full cursor-zoom-in rounded`}),n&&(0,T.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":t?`Image preview: ${t}`:`Image preview`,className:`fixed inset-0 z-50 flex items-center justify-center bg-black/80 p-4`,onClick:s,children:[(0,T.jsx)(`button`,{ref:i,onClick:e=>{e.stopPropagation(),s()},"aria-label":`Close image preview`,title:`Close`,className:`chrome absolute right-4 top-4 flex min-h-[44px] min-w-[44px] items-center justify-center rounded-sm bg-black/40 text-white transition-colors hover:bg-black/60 focus-visible:bg-black/60`,children:(0,T.jsx)(m,{className:`h-4 w-4`})}),(0,T.jsx)(`img`,{src:e,alt:t,className:`max-h-full max-w-full object-contain`,onClick:e=>e.stopPropagation()}),t&&(0,T.jsx)(`div`,{className:`chrome absolute bottom-4 left-4 right-4 rounded-sm bg-black/45 px-3 py-2 text-center text-[12px] text-white/85`,children:t})]})]})}var YT=null;function XT(){return YT||=i(async()=>{let{default:e}=await import(`./mermaid.core-DyZecZAb.js`);return{default:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19])).then(({default:e})=>(e.initialize({startOnLoad:!1,securityLevel:`strict`,theme:`neutral`,htmlLabels:!1,flowchart:{htmlLabels:!1}}),e)),YT}function ZT(e){return qs.sanitize(e,{USE_PROFILES:{svg:!0,svgFilters:!0},FORBID_TAGS:[`foreignObject`,`img`,`image`,`script`,`iframe`,`object`,`embed`,`a`,`audio`,`video`,`source`,`link`,`base`],FORBID_ATTR:[`href`,`xlink:href`,`src`,`onerror`,`onload`,`onclick`]})}function QT({code:e}){let t=(0,w.useId)(),[n,r]=(0,w.useState)({svg:null,failed:!1});(0,w.useEffect)(()=>{let n=!1,i=`mermaid-${t.replace(/[^a-zA-Z0-9_-]/g,``)}`;return XT().then(t=>t.render(i,e)).then(({svg:e})=>{n||r({svg:e,failed:!1})}).catch(()=>{n||r({svg:null,failed:!0})}),()=>{n=!0}},[e,t]);let{svg:i,failed:a}=n;return a?(0,T.jsx)(`pre`,{className:`font-mono text-[0.82em] leading-[1.55] text-text-muted`,style:{background:`transparent`,margin:0},children:e}):i===null?(0,T.jsx)(`div`,{className:`px-3 py-4 text-[0.82em] text-text-subtle`,children:`Rendering diagram…`}):(0,T.jsx)(`div`,{className:`flex justify-center overflow-x-auto px-3 py-3 [&_svg]:max-w-full [&_svg]:h-auto`,dangerouslySetInnerHTML:{__html:ZT(i)}})}var $T={note:{label:`Note`,Icon:le},tip:{label:`Tip`,Icon:t},important:{label:`Important`,Icon:fe},warning:{label:`Warning`,Icon:y},caution:{label:`Caution`,Icon:pe}},eE=/^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\]/i;function tE(e){let t=Array.isArray(e)?e:typeof e==`string`?e.split(/\s+/):[];if(!t.includes(`markdown-alert`))return null;for(let e of Object.keys($T))if(t.includes(`markdown-alert-${e}`))return e;return null}function nE(){function e(e){let t=e.children?.find(e=>e.type===`element`&&e.tagName===`p`),n=t?.children?.[0];if(!t||!n||n.type!==`text`||typeof n.value!=`string`)return;let r=eE.exec(n.value);if(!r)return;let i=r[1].toLowerCase(),a=n.value.slice(r[0].length).replace(/^[^\S\n]*\n?/,``);if(a)n.value=a;else{t.children.shift();let n=t.children[0];(n&&n.type===`text`&&typeof n.value==`string`&&/^\s+$/.test(n.value)||n&&n.type===`element`&&n.tagName===`br`)&&t.children.shift(),t.children.length===0&&(e.children=e.children.filter(e=>e!==t))}e.properties=e.properties??{},e.properties.className=[`markdown-alert`,`markdown-alert-${i}`]}function t(n){if(n.children)for(let r of n.children)r.type===`element`&&r.tagName===`blockquote`&&e(r),t(r)}return e=>t(e)}function rE(e,t){if(!e||e.startsWith(`#`)||/^[a-z][a-z\d+\-.]*:/i.test(e))return null;try{let n=new URL(e,`http://x/${t}`);if(n.host!==`x`)return null;let r=n.pathname.slice(1);return r?{path:r,hash:n.hash}:null}catch{return null}}function iE(e,t,n){if(!e||/^[a-z][a-z\d+\-.]*:/i.test(e)||e.startsWith(`#`)||e.startsWith(`/`))return e;let r=rE(e,n);return r?t(r.path):e}function aE(e){if(typeof e!=`string`||e.trim()===``)return!0;if(/prefers-color-scheme:\s*dark/i.test(e))return!1;if(/prefers-color-scheme:\s*light/i.test(e))return!0;if(typeof window<`u`&&typeof window.matchMedia==`function`)try{return window.matchMedia(e).matches}catch{return!0}return!0}function oE(e,t,n){let r=Array.isArray(e)?e.join(`, `):typeof e==`string`?e:``;if(r)return r.split(`,`).map(e=>e.trim()).filter(Boolean).map(e=>{let[r,...i]=e.split(/\s+/);return[iE(r,t,n),...i].join(` `).trim()}).join(`, `)}function sE(e){return w.Children.toArray(e).map(e=>typeof e==`string`?e:(0,w.isValidElement)(e)?sE(e.props.children):``).join(``)}function cE(e,t){return function({children:n,node:r,className:i,...a}){let o=r?.position?.start?.line,s=(typeof o==`number`?t.get(o):void 0)??xT(sE(n));return(0,T.jsxs)(e,{...a,id:s,onClick:()=>{wT(s)},className:[`group relative cursor-pointer`,i].filter(Boolean).join(` `),children:[(0,T.jsx)(kT,{id:s}),n]})}}function lE(e){return{h1:cE(`h1`,e),h2:cE(`h2`,e),h3:cE(`h3`,e),h4:cE(`h4`,e),h5:cE(`h5`,e),h6:cE(`h6`,e)}}var uE=[`div`,`p`,`span`,`h1`,`h2`,`h3`,`h4`,`h5`,`h6`,`td`,`th`],dE={...cw,tagNames:[...cw.tagNames??[],`picture`,`source`,`details`,`summary`],attributes:{...cw.attributes,source:[`srcSet`,`srcset`,`media`,`type`,`sizes`,`width`,`height`],img:[...cw.attributes?.img??[],`align`,`width`,`height`,`loading`],details:[...cw.attributes?.details??[],`open`],blockquote:[...cw.attributes?.blockquote??[],[`className`,`markdown-alert`,`markdown-alert-note`,`markdown-alert-tip`,`markdown-alert-important`,`markdown-alert-warning`,`markdown-alert-caution`]],...Object.fromEntries(uE.map(e=>[e,[...cw.attributes?.[e]??[],`align`]]))}};function fE(e,t,n){return function({href:r,children:i,...a}){if(!r||r.startsWith(`#`))return(0,T.jsx)(`a`,{href:r,...a,children:i});if(/^[a-z][a-z\d+\-.]*:/i.test(r))return(0,T.jsx)(`a`,{href:r,target:`_blank`,rel:`noreferrer`,...a,children:i});let o=rE(r,t);if(!o)return(0,T.jsx)(`a`,{href:r,target:`_blank`,rel:`noreferrer`,...a,children:i});let s=e.browsePath(o.path)+o.hash;return(0,T.jsx)(`a`,{href:s,onClick:e=>{e.preventDefault(),n(s)},...a,children:i})}}function pE({id:e,filePath:t,file:n,loading:r,error:i,links:a,mode:o,onModeChange:s}){let c=S(),u=(0,w.useMemo)(()=>a??{rawPath:t=>ne(e,t),browsePath:t=>l({id:e,filePath:t})},[a,e]),d=u.rawPath(t),f=(0,w.useRef)(null),{entries:p,body:m}=(0,w.useMemo)(()=>n?.kind!==`markdown`||!n.content?{entries:null,body:``}:WT(n.content),[n]),h=(0,w.useMemo)(()=>n?.kind!==`markdown`||!m?new Map:new Map(TT(m).map(e=>[e.line,e.id])),[n,m]),[g,_]=(0,w.useState)(()=>DT(window.location.hash)?`code`:IT()),y=o!==void 0&&s!==void 0,b=y?o:g,x=(0,w.useCallback)(e=>{y&&s?s(e):(_(e),LT(e))},[y,s]),te=n?.kind===`markdown`&&b===`code`;(0,w.useEffect)(()=>{if(n?.kind!==`markdown`||b!==`preview`)return;let e=window.location.hash.slice(1);if(!e)return;let t=document.getElementById(e);if(t){let e=setTimeout(()=>t.scrollIntoView({behavior:`smooth`}),100);return()=>clearTimeout(e)}},[n,b]),(0,w.useEffect)(()=>{if(n?.kind!==`markdown`||b!==`preview`)return;let e=f.current;if(!e)return;let t=e,r=Array.from(t.querySelectorAll(`h1[id], h2[id], h3[id], h4[id], h5[id], h6[id]`));if(r.length===0)return;let i=0;function a(){i=0;let e=t.getBoundingClientRect().top+24,n=r[0];for(let t of r)if(t.getBoundingClientRect().top<=e)n=t;else break;n?.id&&wT(n.id)}function o(){i||=window.requestAnimationFrame(a)}return t.addEventListener(`scroll`,o,{passive:!0}),()=>{t.removeEventListener(`scroll`,o),i&&window.cancelAnimationFrame(i)}},[n,b]);let C=(0,w.useMemo)(()=>({a:fE(u,t,c),...lE(h),img:({src:e,alt:n})=>{let r=e??``;if(r&&!/^[a-z][a-z\d+\-.]*:/i.test(r)&&!r.startsWith(`#`)){let e=rE(r,t);e&&(r=u.rawPath(e.path))}return(0,T.jsx)(JT,{src:r,alt:n??``})},picture:({node:e})=>{let n=null,r=null;for(let i of e?.children??[]){if(i.type!==`element`)continue;let e=i.properties??{};if(i.tagName===`source`&&!n&&aE(e.media)){let r=oE(e.srcSet??e.srcset,u.rawPath,t),i=r?r.split(`,`)[0]?.trim().split(/\s+/)[0]:``;i&&(n=i)}else i.tagName===`img`&&!r&&(r={src:iE(typeof e.src==`string`?e.src:``,u.rawPath,t),alt:typeof e.alt==`string`?e.alt:``,width:e.width==null?void 0:String(e.width)})}let i=n??r?.src;return i?(0,T.jsx)(`img`,{src:i,alt:r?.alt??``,width:r?.width,className:`inline-block h-auto max-w-full`}):null},blockquote:({node:e,children:t,...n})=>{let r=tE(e?.properties?.className);if(!r)return(0,T.jsx)(`blockquote`,{...n,children:t});let{label:i,Icon:a}=$T[r];return(0,T.jsxs)(`blockquote`,{className:`markdown-alert markdown-alert-${r}`,children:[(0,T.jsxs)(`p`,{className:`markdown-alert-title`,children:[(0,T.jsx)(a,{className:`h-4 w-4 shrink-0`,strokeWidth:2,"aria-hidden":`true`}),i]}),t]})},table:({children:e,...t})=>(0,T.jsx)(`div`,{className:`overflow-x-auto`,children:(0,T.jsx)(`table`,{...t,children:e})}),pre:({children:e})=>{let t=sE(e),n=``,r=w.Children.toArray(e)[0];if((0,w.isValidElement)(r)){let e=(r.props.className??``).match(/language-(\S+)/);e&&(n=e[1])}return n===`mermaid`?(0,T.jsxs)(`div`,{className:`kb-markdown-code-block group`,children:[(0,T.jsxs)(`div`,{className:`chrome flex min-h-9 items-center justify-between gap-2 border-b border-border-soft/70 bg-surface-raised/45 px-2 py-1`,children:[(0,T.jsx)(`span`,{className:`rounded-sm px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-text-subtle`,children:`mermaid`}),(0,T.jsx)(OT,{text:t,variant:`inline`})]}),(0,T.jsx)(QT,{code:t.replace(/\n$/,``)})]}):(0,T.jsxs)(`div`,{className:`kb-markdown-code-block group`,children:[(0,T.jsxs)(`div`,{className:`chrome flex min-h-9 items-center justify-between gap-2 border-b border-border-soft/70 bg-surface-raised/45 px-2 py-1`,children:[n?(0,T.jsx)(`span`,{className:`rounded-sm px-1.5 py-0.5 text-[10px] uppercase tracking-wider text-text-subtle`,children:n}):(0,T.jsx)(`span`,{"aria-hidden":`true`}),(0,T.jsx)(OT,{text:t,variant:`inline`})]}),(0,T.jsx)(bT,{code:t.replace(/\n$/,``),language:n||`text`,theme:Uw.github,children:({className:e,style:t,tokens:n,getLineProps:r,getTokenProps:i})=>(0,T.jsx)(`pre`,{className:`${e} font-mono text-[0.82em] leading-[1.55]`,style:{...t,background:`transparent`,margin:0},children:n.map((e,t)=>(0,T.jsx)(`div`,{...r({line:e}),children:e.map((e,t)=>(0,T.jsx)(`span`,{...i({token:e})},t))},t))})})]})}}),[h,u,t,c]);if(i)return(0,T.jsxs)(`div`,{className:`p-6 font-sans text-[13px] text-health-error`,children:[`Could not open `,(0,T.jsx)(`span`,{className:`font-mono`,children:t}),`: `,i.message]});if(r||!n)return(0,T.jsx)(`div`,{className:`p-6 font-sans text-[13px] text-text-subtle`,children:`Loading…`});if(n.kind===`html`)return(0,T.jsxs)(`div`,{className:`flex h-full flex-col`,children:[(0,T.jsx)(`div`,{className:`flex h-8 shrink-0 items-center justify-end border-b border-border-soft px-3`,children:(0,T.jsxs)(`a`,{href:d,target:`_blank`,rel:`noreferrer`,title:`Open the full-width report in a new tab`,className:`chrome flex items-center gap-1 rounded-sm px-2 py-0.5 text-[10px] uppercase tracking-[0.08em] text-text-subtle transition-colors hover:bg-surface-elevated hover:text-text-muted`,children:[(0,T.jsx)(ee,{className:`h-3 w-3`}),`Open full page`]})}),(0,T.jsx)(`iframe`,{title:n.name,src:d,sandbox:`allow-scripts`,className:`min-h-0 w-full flex-1 border-0 bg-white`})]});if(n.kind===`image`)return(0,T.jsx)(`div`,{className:`flex h-full flex-col`,children:(0,T.jsx)(`div`,{className:`flex flex-1 items-center justify-center overflow-auto bg-surface-elevated/30 p-6`,children:(0,T.jsx)(JT,{src:d,alt:n.name})})});if(n.truncated)return(0,T.jsxs)(`div`,{className:`p-6 font-sans text-[13px] text-text-muted`,children:[`This file is too large to inline (`,v(n.size),`).`,` `,(0,T.jsx)(`a`,{href:d,target:`_blank`,rel:`noreferrer`,className:`text-accent underline underline-offset-2`,children:`Open raw`})]});if(n.kind===`binary`||n.content===void 0)return(0,T.jsxs)(`div`,{className:`p-6 font-sans text-[13px] text-text-muted`,children:[`Binary file (`,v(n.size),`).`,` `,(0,T.jsx)(`a`,{href:d,target:`_blank`,rel:`noreferrer`,className:`text-accent underline underline-offset-2`,children:`Open raw`})]});if(n.kind===`markdown`)return(0,T.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[!y&&(0,T.jsx)(`div`,{className:`flex h-9 shrink-0 items-center justify-end border-b border-border-soft px-3`,children:(0,T.jsx)(PT,{mode:b,onChange:x})}),te?(0,T.jsx)(VT,{body:n.content,language:`markdown`}):(0,T.jsxs)(`div`,{ref:f,className:`min-h-0 flex-1 overflow-y-auto px-6 py-5`,children:[p&&(0,T.jsx)(qT,{entries:p}),(0,T.jsx)(`div`,{className:`md-prose`,children:(0,T.jsx)(Hm,{remarkPlugins:[J_,ov,lv],rehypePlugins:[bC,nE,[Tw,dE],ow],components:C,children:m})})]})]});let re=n.kind===`json`?`json`:n.language??`text`,ie=n.content;if(n.kind===`json`)try{ie=JSON.stringify(JSON.parse(n.content),null,2)}catch{}return(0,T.jsx)(VT,{body:ie,language:re})}export{jT as a,TT as c,$s as d,ec as f,me as h,AT as i,DT as l,ge as m,IT as n,MT as o,qs as p,LT as r,PT as s,pE as t,ic as u};