dreamcontext 0.17.0 → 0.17.1

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 (116) hide show
  1. package/dist/dashboard/assets/{BrainCanvas3D-y35c1rJf.js → BrainCanvas3D-DyF_3yYD.js} +1 -1
  2. package/dist/dashboard/assets/{_baseUniq-g57aeE1L.js → _baseUniq-Do8VMBA0.js} +1 -1
  3. package/dist/dashboard/assets/{ar-SA-G6X2FPQ2-B7ybIFFt.js → ar-SA-G6X2FPQ2-DmbXDb2R.js} +1 -1
  4. package/dist/dashboard/assets/{arc-C5Y4eje1.js → arc-CwtUBQfU.js} +1 -1
  5. package/dist/dashboard/assets/{architectureDiagram-Q4EWVU46-DnxEKMQ-.js → architectureDiagram-Q4EWVU46-O9bOog_f.js} +1 -1
  6. package/dist/dashboard/assets/{az-AZ-76LH7QW2-DF75BEoV.js → az-AZ-76LH7QW2-c9Zk10vG.js} +1 -1
  7. package/dist/dashboard/assets/{bg-BG-XCXSNQG7-D_xX3Evl.js → bg-BG-XCXSNQG7-uMTg84lX.js} +1 -1
  8. package/dist/dashboard/assets/{blockDiagram-DXYQGD6D-DsFvaLns.js → blockDiagram-DXYQGD6D-BTENXCSO.js} +1 -1
  9. package/dist/dashboard/assets/{bn-BD-2XOGV67Q-DSRsGjwD.js → bn-BD-2XOGV67Q-DUFKHcua.js} +1 -1
  10. package/dist/dashboard/assets/{c4Diagram-AHTNJAMY-DXmGhsoH.js → c4Diagram-AHTNJAMY-DMXPWRiQ.js} +1 -1
  11. package/dist/dashboard/assets/{ca-ES-6MX7JW3Y-DXLsz3CU.js → ca-ES-6MX7JW3Y-BuYX1q89.js} +1 -1
  12. package/dist/dashboard/assets/channel-2YfRjala.js +1 -0
  13. package/dist/dashboard/assets/{chunk-4BX2VUAB-B1u0KwPb.js → chunk-4BX2VUAB-DgefvnWS.js} +1 -1
  14. package/dist/dashboard/assets/{chunk-4TB4RGXK-DCMNOaAV.js → chunk-4TB4RGXK-BnFO5G1t.js} +1 -1
  15. package/dist/dashboard/assets/{chunk-55IACEB6-ByleWNvl.js → chunk-55IACEB6-COm2TYEM.js} +1 -1
  16. package/dist/dashboard/assets/{chunk-EDXVE4YY-D1uIvY6z.js → chunk-EDXVE4YY-CtsGCwZp.js} +1 -1
  17. package/dist/dashboard/assets/{chunk-FMBD7UC4-gnrb7hoq.js → chunk-FMBD7UC4-cfSvx35j.js} +1 -1
  18. package/dist/dashboard/assets/{chunk-OYMX7WX6-DW6-cdV3.js → chunk-OYMX7WX6-DAhDKteL.js} +1 -1
  19. package/dist/dashboard/assets/{chunk-QZHKN3VN-CGHdGGkQ.js → chunk-QZHKN3VN-B5h4qML3.js} +1 -1
  20. package/dist/dashboard/assets/{chunk-YZCP3GAM-DDJQ7-hq.js → chunk-YZCP3GAM-CGp_NiRg.js} +1 -1
  21. package/dist/dashboard/assets/classDiagram-6PBFFD2Q-DB_UnN1h.js +1 -0
  22. package/dist/dashboard/assets/classDiagram-v2-HSJHXN6E-DB_UnN1h.js +1 -0
  23. package/dist/dashboard/assets/clone-DaDvB3N6.js +1 -0
  24. package/dist/dashboard/assets/{cose-bilkent-S5V4N54A-CTQIwiIq.js → cose-bilkent-S5V4N54A-Dk7CMFA4.js} +1 -1
  25. package/dist/dashboard/assets/{cs-CZ-2BRQDIVT-BKvVPsJS.js → cs-CZ-2BRQDIVT-zfUTiS_d.js} +1 -1
  26. package/dist/dashboard/assets/{da-DK-5WZEPLOC-D-GZqbdX.js → da-DK-5WZEPLOC-CU14f8NA.js} +1 -1
  27. package/dist/dashboard/assets/{dagre-KV5264BT-Jz3whjk4.js → dagre-KV5264BT-BiMVxC4Q.js} +1 -1
  28. package/dist/dashboard/assets/{de-DE-XR44H4JA-dN8Dh2tp.js → de-DE-XR44H4JA-CDOHAJGo.js} +1 -1
  29. package/dist/dashboard/assets/{diagram-5BDNPKRD-DtDbd2d1.js → diagram-5BDNPKRD-DfJEsVTA.js} +1 -1
  30. package/dist/dashboard/assets/{diagram-G4DWMVQ6-DFVSpltG.js → diagram-G4DWMVQ6-CztLHIcY.js} +1 -1
  31. package/dist/dashboard/assets/{diagram-MMDJMWI5-eBAtVrcR.js → diagram-MMDJMWI5-DqoQLlWK.js} +1 -1
  32. package/dist/dashboard/assets/{diagram-TYMM5635-BHjVr_FM.js → diagram-TYMM5635-DvyvQBCc.js} +1 -1
  33. package/dist/dashboard/assets/{el-GR-BZB4AONW-RPZfx5-x.js → el-GR-BZB4AONW-ChUphbcv.js} +1 -1
  34. package/dist/dashboard/assets/{erDiagram-SMLLAGMA-CXAkwxcx.js → erDiagram-SMLLAGMA-D_uSs2_2.js} +1 -1
  35. package/dist/dashboard/assets/{es-ES-U4NZUMDT-DQv-XgP6.js → es-ES-U4NZUMDT-BNalBEhb.js} +1 -1
  36. package/dist/dashboard/assets/{eu-ES-A7QVB2H4-CuWBCBqu.js → eu-ES-A7QVB2H4-BMiQyA2y.js} +1 -1
  37. package/dist/dashboard/assets/{fa-IR-HGAKTJCU-4FMGsomC.js → fa-IR-HGAKTJCU-Bd6ZnTSo.js} +1 -1
  38. package/dist/dashboard/assets/{fi-FI-Z5N7JZ37-C_7XKQ39.js → fi-FI-Z5N7JZ37-BWAfJadC.js} +1 -1
  39. package/dist/dashboard/assets/{flowDiagram-DWJPFMVM-BFdWnw5h.js → flowDiagram-DWJPFMVM-Bmsp6kyU.js} +1 -1
  40. package/dist/dashboard/assets/{fr-FR-RHASNOE6-pmcEtk8N.js → fr-FR-RHASNOE6-CspbYzOW.js} +1 -1
  41. package/dist/dashboard/assets/{ganttDiagram-T4ZO3ILL-DFf9_pss.js → ganttDiagram-T4ZO3ILL-wEdysXo_.js} +1 -1
  42. package/dist/dashboard/assets/{gitGraphDiagram-UUTBAWPF-DURiCXR8.js → gitGraphDiagram-UUTBAWPF-BEiGpPBj.js} +1 -1
  43. package/dist/dashboard/assets/{gl-ES-HMX3MZ6V-DB4ImOy_.js → gl-ES-HMX3MZ6V-CV76vsWr.js} +1 -1
  44. package/dist/dashboard/assets/{graph-DYtPayNd.js → graph-CZFIeNHZ.js} +1 -1
  45. package/dist/dashboard/assets/{he-IL-6SHJWFNN-CHIkZOP6.js → he-IL-6SHJWFNN-Y1VoXJ_H.js} +1 -1
  46. package/dist/dashboard/assets/{hi-IN-IWLTKZ5I-pVpeINen.js → hi-IN-IWLTKZ5I-Crh5S49o.js} +1 -1
  47. package/dist/dashboard/assets/{hu-HU-A5ZG7DT2-CAUlCsMQ.js → hu-HU-A5ZG7DT2-D4I3gCbp.js} +1 -1
  48. package/dist/dashboard/assets/{id-ID-SAP4L64H-BZJDBU66.js → id-ID-SAP4L64H-Chvzkuvi.js} +1 -1
  49. package/dist/dashboard/assets/{index-B8f3KGr5.js → index-BIfrbaFS.js} +8 -8
  50. package/dist/dashboard/assets/{index-DxIybLvS.js → index-C7Bo5AQH.js} +1 -1
  51. package/dist/dashboard/assets/{infoDiagram-42DDH7IO-BPiW3Ij4.js → infoDiagram-42DDH7IO-BzfuDHl4.js} +1 -1
  52. package/dist/dashboard/assets/{ishikawaDiagram-UXIWVN3A-Blkx8f3S.js → ishikawaDiagram-UXIWVN3A-BVoNJ9VS.js} +1 -1
  53. package/dist/dashboard/assets/{it-IT-JPQ66NNP-My2T4UwV.js → it-IT-JPQ66NNP-BH_gN5es.js} +1 -1
  54. package/dist/dashboard/assets/{ja-JP-DBVTYXUO-BPD5Unyr.js → ja-JP-DBVTYXUO-DU_WmLVa.js} +1 -1
  55. package/dist/dashboard/assets/{journeyDiagram-VCZTEJTY-BDsJYpXT.js → journeyDiagram-VCZTEJTY-DbwICa_a.js} +1 -1
  56. package/dist/dashboard/assets/{kaa-6HZHGXH3-ByIbhvgR.js → kaa-6HZHGXH3-KYU9qowM.js} +1 -1
  57. package/dist/dashboard/assets/{kab-KAB-ZGHBKWFO-eKUh9BOS.js → kab-KAB-ZGHBKWFO-bjhyiUq5.js} +1 -1
  58. package/dist/dashboard/assets/{kanban-definition-6JOO6SKY-C3viwNtJ.js → kanban-definition-6JOO6SKY-D9XucLs4.js} +1 -1
  59. package/dist/dashboard/assets/{kk-KZ-P5N5QNE5-CyZ_MOrV.js → kk-KZ-P5N5QNE5-CYTx_dAZ.js} +1 -1
  60. package/dist/dashboard/assets/{km-KH-HSX4SM5Z-D3FZvcLx.js → km-KH-HSX4SM5Z-DqsuY4Lf.js} +1 -1
  61. package/dist/dashboard/assets/{ko-KR-MTYHY66A-D8irDigM.js → ko-KR-MTYHY66A-BZe7NywF.js} +1 -1
  62. package/dist/dashboard/assets/{ku-TR-6OUDTVRD-B7P1RwAB.js → ku-TR-6OUDTVRD-F5d6HFWt.js} +1 -1
  63. package/dist/dashboard/assets/{layout-Bm4ekZW0.js → layout-CotqU0S9.js} +1 -1
  64. package/dist/dashboard/assets/{linear-CuMgtZOc.js → linear-Dqv87Scf.js} +1 -1
  65. package/dist/dashboard/assets/{lt-LT-XHIRWOB4-Ci1UvfZQ.js → lt-LT-XHIRWOB4-BCCuaPbS.js} +1 -1
  66. package/dist/dashboard/assets/{lv-LV-5QDEKY6T-Bo3huXeU.js → lv-LV-5QDEKY6T-NLGi-vJ6.js} +1 -1
  67. package/dist/dashboard/assets/{min-DbOs1vEh.js → min-BbJdnc3h.js} +1 -1
  68. package/dist/dashboard/assets/{mindmap-definition-QFDTVHPH-Bqzy1-O0.js → mindmap-definition-QFDTVHPH-Dk4QySu7.js} +1 -1
  69. package/dist/dashboard/assets/{mr-IN-CRQNXWMA-CqisPVEd.js → mr-IN-CRQNXWMA-BnGDIgVN.js} +1 -1
  70. package/dist/dashboard/assets/{my-MM-5M5IBNSE-BeBN5i_N.js → my-MM-5M5IBNSE-CspgYE9_.js} +1 -1
  71. package/dist/dashboard/assets/{nb-NO-T6EIAALU-D5dV1--A.js → nb-NO-T6EIAALU-BeRPw3hu.js} +1 -1
  72. package/dist/dashboard/assets/{nl-NL-IS3SIHDZ-D-0yJ8XR.js → nl-NL-IS3SIHDZ-C-G-bljM.js} +1 -1
  73. package/dist/dashboard/assets/{nn-NO-6E72VCQL-Vo96ITcp.js → nn-NO-6E72VCQL-Ct7VZY8D.js} +1 -1
  74. package/dist/dashboard/assets/{oc-FR-POXYY2M6-nsG4ZsrH.js → oc-FR-POXYY2M6-Cv5-C4Qq.js} +1 -1
  75. package/dist/dashboard/assets/{pa-IN-N4M65BXN-DxCDdJGd.js → pa-IN-N4M65BXN-DAgkIThL.js} +1 -1
  76. package/dist/dashboard/assets/{percentages-BXMCSKIN-BjW3QiBD.js → percentages-BXMCSKIN-vidRYabK.js} +7 -7
  77. package/dist/dashboard/assets/{pica-BbAsDbLn.js → pica-Cy-Xl-mi.js} +1 -1
  78. package/dist/dashboard/assets/{pieDiagram-DEJITSTG-CCVGHDYA.js → pieDiagram-DEJITSTG-BnP4-zwd.js} +1 -1
  79. package/dist/dashboard/assets/{pl-PL-T2D74RX3-BxKUkBW3.js → pl-PL-T2D74RX3-BuJQ3HD-.js} +1 -1
  80. package/dist/dashboard/assets/{pt-BR-5N22H2LF-B2rKoKHu.js → pt-BR-5N22H2LF-BbAqsvD6.js} +1 -1
  81. package/dist/dashboard/assets/{pt-PT-UZXXM6DQ-D2aDN9F3.js → pt-PT-UZXXM6DQ-DzFJedU3.js} +1 -1
  82. package/dist/dashboard/assets/{quadrantDiagram-34T5L4WZ-DPRv7LNW.js → quadrantDiagram-34T5L4WZ-BXN88cHy.js} +1 -1
  83. package/dist/dashboard/assets/{requirementDiagram-MS252O5E-6bTSQFfr.js → requirementDiagram-MS252O5E-D34hL42a.js} +1 -1
  84. package/dist/dashboard/assets/{ro-RO-JPDTUUEW-C1oY-qLb.js → ro-RO-JPDTUUEW-BV2-sOiv.js} +1 -1
  85. package/dist/dashboard/assets/{ru-RU-B4JR7IUQ-aHhtIKSv.js → ru-RU-B4JR7IUQ-BCL4N9Ej.js} +1 -1
  86. package/dist/dashboard/assets/{sankeyDiagram-XADWPNL6-BWSI8qsY.js → sankeyDiagram-XADWPNL6-0mFeok-3.js} +1 -1
  87. package/dist/dashboard/assets/{sequenceDiagram-FGHM5R23-DANhN4OD.js → sequenceDiagram-FGHM5R23-C-5nW5j6.js} +1 -1
  88. package/dist/dashboard/assets/{si-LK-N5RQ5JYF-D2d4DTQQ.js → si-LK-N5RQ5JYF-CNhaw4jx.js} +1 -1
  89. package/dist/dashboard/assets/{sk-SK-C5VTKIMK-Di1t95sR.js → sk-SK-C5VTKIMK-mHCphOXu.js} +1 -1
  90. package/dist/dashboard/assets/{sl-SI-NN7IZMDC-CQXx5B1D.js → sl-SI-NN7IZMDC--lzgHthQ.js} +1 -1
  91. package/dist/dashboard/assets/{stateDiagram-FHFEXIEX-CpuW4o5E.js → stateDiagram-FHFEXIEX-C50iDFqe.js} +1 -1
  92. package/dist/dashboard/assets/stateDiagram-v2-QKLJ7IA2-eW9-s0Sm.js +1 -0
  93. package/dist/dashboard/assets/{subset-shared.chunk-CZJii2rp.js → subset-shared.chunk-DNsjL37s.js} +1 -1
  94. package/dist/dashboard/assets/{subset-worker.chunk-CtJccz91.js → subset-worker.chunk-BaV3r-bl.js} +1 -1
  95. package/dist/dashboard/assets/{sv-SE-XGPEYMSR-BtJ_mbLr.js → sv-SE-XGPEYMSR-ckw8jfGN.js} +1 -1
  96. package/dist/dashboard/assets/{ta-IN-2NMHFXQM-Dq22XWgM.js → ta-IN-2NMHFXQM-CSeNmVhS.js} +1 -1
  97. package/dist/dashboard/assets/{th-TH-HPSO5L25-ChfIMa5w.js → th-TH-HPSO5L25-Cvn1sg_3.js} +1 -1
  98. package/dist/dashboard/assets/{timeline-definition-GMOUNBTQ-nUPbvtjj.js → timeline-definition-GMOUNBTQ-DRYfuqHT.js} +1 -1
  99. package/dist/dashboard/assets/{tr-TR-DEFEU3FU-Lon-b9uf.js → tr-TR-DEFEU3FU-CyhY22TB.js} +1 -1
  100. package/dist/dashboard/assets/{uk-UA-QMV73CPH-BmpXA4GS.js → uk-UA-QMV73CPH-BvvAEO6U.js} +1 -1
  101. package/dist/dashboard/assets/{vennDiagram-DHZGUBPP-Cfq6Ys0H.js → vennDiagram-DHZGUBPP-Crril7Cj.js} +1 -1
  102. package/dist/dashboard/assets/{vi-VN-M7AON7JQ-gUFADT8k.js → vi-VN-M7AON7JQ-c7AwSUZ8.js} +1 -1
  103. package/dist/dashboard/assets/{wardley-RL74JXVD-DbjyRI1F.js → wardley-RL74JXVD-Da5AhSWU.js} +1 -1
  104. package/dist/dashboard/assets/{wardleyDiagram-NUSXRM2D-D7kJ-35q.js → wardleyDiagram-NUSXRM2D-C4GeB_Df.js} +1 -1
  105. package/dist/dashboard/assets/{xychartDiagram-5P7HB3ND-Bt41FbXl.js → xychartDiagram-5P7HB3ND-BPCFKXqR.js} +1 -1
  106. package/dist/dashboard/assets/{zh-CN-LNUGB5OW-GEnnC6n4.js → zh-CN-LNUGB5OW-BvNiZwKU.js} +1 -1
  107. package/dist/dashboard/assets/{zh-HK-E62DVLB3-bQyXnsrh.js → zh-HK-E62DVLB3-CCFtoCWb.js} +1 -1
  108. package/dist/dashboard/assets/{zh-TW-RAJ6MFWO-Buauia8Y.js → zh-TW-RAJ6MFWO-bYBr-stu.js} +1 -1
  109. package/dist/dashboard/index.html +1 -1
  110. package/dist/index.js +297 -245
  111. package/package.json +1 -1
  112. package/dist/dashboard/assets/channel-8FAi-z4K.js +0 -1
  113. package/dist/dashboard/assets/classDiagram-6PBFFD2Q-Docm0aN-.js +0 -1
  114. package/dist/dashboard/assets/classDiagram-v2-HSJHXN6E-Docm0aN-.js +0 -1
  115. package/dist/dashboard/assets/clone-CxkSBJ3W.js +0 -1
  116. package/dist/dashboard/assets/stateDiagram-v2-QKLJ7IA2-hI3OGuUV.js +0 -1
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/window-DmNpeJAL.js","assets/core-Cn4yfEqx.js","assets/event-BbvoZQ5o.js","assets/webviewWindow-BbG9Cr7f.js","assets/index-NsrznfmA.js","assets/index-D-gsCv2F.js","assets/dagre-KV5264BT-Jz3whjk4.js","assets/graph-DYtPayNd.js","assets/_baseUniq-g57aeE1L.js","assets/layout-Bm4ekZW0.js","assets/min-DbOs1vEh.js","assets/clone-CxkSBJ3W.js","assets/cose-bilkent-S5V4N54A-CTQIwiIq.js","assets/cytoscape.esm-D_LviqZs.js","assets/c4Diagram-AHTNJAMY-DXmGhsoH.js","assets/chunk-YZCP3GAM-DDJQ7-hq.js","assets/flowDiagram-DWJPFMVM-BFdWnw5h.js","assets/chunk-FMBD7UC4-gnrb7hoq.js","assets/chunk-55IACEB6-ByleWNvl.js","assets/chunk-EDXVE4YY-D1uIvY6z.js","assets/channel-8FAi-z4K.js","assets/erDiagram-SMLLAGMA-CXAkwxcx.js","assets/gitGraphDiagram-UUTBAWPF-DURiCXR8.js","assets/chunk-4BX2VUAB-B1u0KwPb.js","assets/chunk-QZHKN3VN-CGHdGGkQ.js","assets/wardley-RL74JXVD-DbjyRI1F.js","assets/ganttDiagram-T4ZO3ILL-DFf9_pss.js","assets/linear-CuMgtZOc.js","assets/defaultLocale-DX6XiGOO.js","assets/infoDiagram-42DDH7IO-BPiW3Ij4.js","assets/pieDiagram-DEJITSTG-CCVGHDYA.js","assets/arc-C5Y4eje1.js","assets/quadrantDiagram-34T5L4WZ-DPRv7LNW.js","assets/xychartDiagram-5P7HB3ND-Bt41FbXl.js","assets/requirementDiagram-MS252O5E-6bTSQFfr.js","assets/sequenceDiagram-FGHM5R23-DANhN4OD.js","assets/classDiagram-6PBFFD2Q-Docm0aN-.js","assets/chunk-4TB4RGXK-DCMNOaAV.js","assets/classDiagram-v2-HSJHXN6E-Docm0aN-.js","assets/stateDiagram-FHFEXIEX-CpuW4o5E.js","assets/chunk-OYMX7WX6-DW6-cdV3.js","assets/stateDiagram-v2-QKLJ7IA2-hI3OGuUV.js","assets/journeyDiagram-VCZTEJTY-BDsJYpXT.js","assets/timeline-definition-GMOUNBTQ-nUPbvtjj.js","assets/mindmap-definition-QFDTVHPH-Bqzy1-O0.js","assets/kanban-definition-6JOO6SKY-C3viwNtJ.js","assets/diagram-TYMM5635-BHjVr_FM.js","assets/diagram-MMDJMWI5-eBAtVrcR.js","assets/blockDiagram-DXYQGD6D-DsFvaLns.js","assets/diagram-5BDNPKRD-DtDbd2d1.js","assets/architectureDiagram-Q4EWVU46-DnxEKMQ-.js","assets/diagram-G4DWMVQ6-DFVSpltG.js","assets/wardleyDiagram-NUSXRM2D-D7kJ-35q.js","assets/percentages-BXMCSKIN-BjW3QiBD.js","assets/extends-CF3RwP-h.js","assets/percentages-BXMCSKIN-DnMnD4LF.css","assets/BrainCanvas3D-y35c1rJf.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/window-DmNpeJAL.js","assets/core-Cn4yfEqx.js","assets/event-BbvoZQ5o.js","assets/webviewWindow-BbG9Cr7f.js","assets/index-NsrznfmA.js","assets/index-D-gsCv2F.js","assets/dagre-KV5264BT-BiMVxC4Q.js","assets/graph-CZFIeNHZ.js","assets/_baseUniq-Do8VMBA0.js","assets/layout-CotqU0S9.js","assets/min-BbJdnc3h.js","assets/clone-DaDvB3N6.js","assets/cose-bilkent-S5V4N54A-Dk7CMFA4.js","assets/cytoscape.esm-D_LviqZs.js","assets/c4Diagram-AHTNJAMY-DMXPWRiQ.js","assets/chunk-YZCP3GAM-CGp_NiRg.js","assets/flowDiagram-DWJPFMVM-Bmsp6kyU.js","assets/chunk-FMBD7UC4-cfSvx35j.js","assets/chunk-55IACEB6-COm2TYEM.js","assets/chunk-EDXVE4YY-CtsGCwZp.js","assets/channel-2YfRjala.js","assets/erDiagram-SMLLAGMA-D_uSs2_2.js","assets/gitGraphDiagram-UUTBAWPF-BEiGpPBj.js","assets/chunk-4BX2VUAB-DgefvnWS.js","assets/chunk-QZHKN3VN-B5h4qML3.js","assets/wardley-RL74JXVD-Da5AhSWU.js","assets/ganttDiagram-T4ZO3ILL-wEdysXo_.js","assets/linear-Dqv87Scf.js","assets/defaultLocale-DX6XiGOO.js","assets/infoDiagram-42DDH7IO-BzfuDHl4.js","assets/pieDiagram-DEJITSTG-BnP4-zwd.js","assets/arc-CwtUBQfU.js","assets/quadrantDiagram-34T5L4WZ-BXN88cHy.js","assets/xychartDiagram-5P7HB3ND-BPCFKXqR.js","assets/requirementDiagram-MS252O5E-D34hL42a.js","assets/sequenceDiagram-FGHM5R23-C-5nW5j6.js","assets/classDiagram-6PBFFD2Q-DB_UnN1h.js","assets/chunk-4TB4RGXK-BnFO5G1t.js","assets/classDiagram-v2-HSJHXN6E-DB_UnN1h.js","assets/stateDiagram-FHFEXIEX-C50iDFqe.js","assets/chunk-OYMX7WX6-DAhDKteL.js","assets/stateDiagram-v2-QKLJ7IA2-eW9-s0Sm.js","assets/journeyDiagram-VCZTEJTY-DbwICa_a.js","assets/timeline-definition-GMOUNBTQ-DRYfuqHT.js","assets/mindmap-definition-QFDTVHPH-Dk4QySu7.js","assets/kanban-definition-6JOO6SKY-D9XucLs4.js","assets/diagram-TYMM5635-DvyvQBCc.js","assets/diagram-MMDJMWI5-DqoQLlWK.js","assets/blockDiagram-DXYQGD6D-BTENXCSO.js","assets/diagram-5BDNPKRD-DfJEsVTA.js","assets/architectureDiagram-Q4EWVU46-O9bOog_f.js","assets/diagram-G4DWMVQ6-CztLHIcY.js","assets/wardleyDiagram-NUSXRM2D-C4GeB_Df.js","assets/percentages-BXMCSKIN-vidRYabK.js","assets/extends-CF3RwP-h.js","assets/percentages-BXMCSKIN-DnMnD4LF.css","assets/BrainCanvas3D-DyF_3yYD.js"])))=>i.map(i=>d[i]);
2
2
  var Z8=Object.defineProperty;var BE=r=>{throw TypeError(r)};var Q8=(r,e,i)=>e in r?Z8(r,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):r[e]=i;var Wt=(r,e,i)=>Q8(r,typeof e!="symbol"?e+"":e,i),m0=(r,e,i)=>e.has(r)||BE("Cannot "+i);var me=(r,e,i)=>(m0(r,e,"read from private field"),i?i.call(r):e.get(r)),Gt=(r,e,i)=>e.has(r)?BE("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,i),Ct=(r,e,i,n)=>(m0(r,e,"write to private field"),n?n.call(r,i):e.set(r,i),i),pr=(r,e,i)=>(m0(r,e,"access private method"),i);var dg=(r,e,i,n)=>({set _(s){Ct(r,e,s,i)},get _(){return me(r,e,n)}});function J8(r,e){for(var i=0;i<e.length;i++){const n=e[i];if(typeof n!="string"&&!Array.isArray(n)){for(const s in n)if(s!=="default"&&!(s in r)){const o=Object.getOwnPropertyDescriptor(n,s);o&&Object.defineProperty(r,s,o.get?o:{enumerable:!0,get:()=>n[s]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const h of o.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&n(h)}).observe(document,{childList:!0,subtree:!0});function i(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(s){if(s.ep)return;s.ep=!0;const o=i(s);fetch(s.href,o)}})();var Cye=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function pu(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function wye(r){if(Object.prototype.hasOwnProperty.call(r,"__esModule"))return r;var e=r.default;if(typeof e=="function"){var i=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};i.prototype=e.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(r).forEach(function(n){var s=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(i,n,s.get?s:{enumerable:!0,get:function(){return r[n]}})}),i}var y0={exports:{}},hd={};/**
3
3
  * @license React
4
4
  * react-jsx-runtime.production.js
@@ -47,7 +47,7 @@ var Z8=Object.defineProperty;var BE=r=>{throw TypeError(r)};var Q8=(r,e,i)=>e in
47
47
  `+pe[S].replace(" at new "," at ");return c.displayName&&Ge.includes("<anonymous>")&&(Ge=Ge.replace("<anonymous>",c.displayName)),Ge}while(1<=S&&0<=M);break}}}finally{We=!1,Error.prepareStackTrace=v}return(v=c?c.displayName||c.name:"")?Ve(v):""}function de(c,p){switch(c.tag){case 26:case 27:case 5:return Ve(c.type);case 16:return Ve("Lazy");case 13:return c.child!==p&&p!==null?Ve("Suspense Fallback"):Ve("Suspense");case 19:return Ve("SuspenseList");case 0:case 15:return et(c.type,!1);case 11:return et(c.type.render,!1);case 1:return et(c.type,!0);case 31:return Ve("Activity");default:return""}}function Ne(c){try{var p="",v=null;do p+=de(c,v),v=c,c=c.return;while(c);return p}catch(S){return`
48
48
  Error generating stack: `+S.message+`
49
49
  `+S.stack}}var he=Object.prototype.hasOwnProperty,He=r.unstable_scheduleCallback,ut=r.unstable_cancelCallback,zt=r.unstable_shouldYield,At=r.unstable_requestPaint,Lt=r.unstable_now,qt=r.unstable_getCurrentPriorityLevel,mt=r.unstable_ImmediatePriority,Te=r.unstable_UserBlockingPriority,Ie=r.unstable_NormalPriority,Be=r.unstable_LowPriority,Je=r.unstable_IdlePriority,vt=r.log,lt=r.unstable_setDisableYieldValue,Nt=null,ke=null;function dt(c){if(typeof vt=="function"&&lt(c),ke&&typeof ke.setStrictMode=="function")try{ke.setStrictMode(Nt,c)}catch{}}var at=Math.clz32?Math.clz32:rt,ve=Math.log,ye=Math.LN2;function rt(c){return c>>>=0,c===0?32:31-(ve(c)/ye|0)|0}var Ze=256,xt=262144,pt=4194304;function wt(c){var p=c&42;if(p!==0)return p;switch(c&-c){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return c&261888;case 262144:case 524288:case 1048576:case 2097152:return c&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return c&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return c}}function ae(c,p,v){var S=c.pendingLanes;if(S===0)return 0;var M=0,R=c.suspendedLanes,Y=c.pingedLanes;c=c.warmLanes;var te=S&134217727;return te!==0?(S=te&~R,S!==0?M=wt(S):(Y&=te,Y!==0?M=wt(Y):v||(v=te&~c,v!==0&&(M=wt(v))))):(te=S&~R,te!==0?M=wt(te):Y!==0?M=wt(Y):v||(v=S&~c,v!==0&&(M=wt(v)))),M===0?0:p!==0&&p!==M&&(p&R)===0&&(R=M&-M,v=p&-p,R>=v||R===32&&(v&4194048)!==0)?p:M}function Ae(c,p){return(c.pendingLanes&~(c.suspendedLanes&~c.pingedLanes)&p)===0}function Ye(c,p){switch(c){case 1:case 2:case 4:case 8:case 64:return p+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return p+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ot(){var c=pt;return pt<<=1,(pt&62914560)===0&&(pt=4194304),c}function Ft(c){for(var p=[],v=0;31>v;v++)p.push(c);return p}function gt(c,p){c.pendingLanes|=p,p!==268435456&&(c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0)}function nt(c,p,v,S,M,R){var Y=c.pendingLanes;c.pendingLanes=v,c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0,c.expiredLanes&=v,c.entangledLanes&=v,c.errorRecoveryDisabledLanes&=v,c.shellSuspendCounter=0;var te=c.entanglements,pe=c.expirationTimes,Le=c.hiddenUpdates;for(v=Y&~v;0<v;){var Ge=31-at(v),Qe=1<<Ge;te[Ge]=0,pe[Ge]=-1;var Oe=Le[Ge];if(Oe!==null)for(Le[Ge]=null,Ge=0;Ge<Oe.length;Ge++){var Pe=Oe[Ge];Pe!==null&&(Pe.lane&=-536870913)}v&=~Qe}S!==0&&ge(c,S,0),R!==0&&M===0&&c.tag!==0&&(c.suspendedLanes|=R&~(Y&~p))}function ge(c,p,v){c.pendingLanes|=p,c.suspendedLanes&=~p;var S=31-at(p);c.entangledLanes|=p,c.entanglements[S]=c.entanglements[S]|1073741824|v&261930}function qe(c,p){var v=c.entangledLanes|=p;for(c=c.entanglements;v;){var S=31-at(v),M=1<<S;M&p|c[S]&p&&(c[S]|=p),v&=~M}}function kt(c,p){var v=p&-p;return v=(v&42)!==0?1:se(v),(v&(c.suspendedLanes|p))!==0?0:v}function se(c){switch(c){case 2:c=1;break;case 8:c=4;break;case 32:c=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:c=128;break;case 268435456:c=134217728;break;default:c=0}return c}function ue(c){return c&=-c,2<c?8<c?(c&134217727)!==0?32:268435456:8:2}function be(){var c=W.p;return c!==0?c:(c=window.event,c===void 0?32:EE(c.type))}function Ee(c,p){var v=W.p;try{return W.p=c,p()}finally{W.p=v}}var Fe=Math.random().toString(36).slice(2),Ke="__reactFiber$"+Fe,Tt="__reactProps$"+Fe,er="__reactContainer$"+Fe,Qr="__reactEvents$"+Fe,Kr="__reactListeners$"+Fe,Nn="__reactHandles$"+Fe,Ri="__reactResources$"+Fe,Hn="__reactMarker$"+Fe;function Os(c){delete c[Ke],delete c[Tt],delete c[Qr],delete c[Kr],delete c[Nn]}function _i(c){var p=c[Ke];if(p)return p;for(var v=c.parentNode;v;){if(p=v[er]||v[Ke]){if(v=p.alternate,p.child!==null||v!==null&&v.child!==null)for(c=uE(c);c!==null;){if(v=c[Ke])return v;c=uE(c)}return p}c=v,v=c.parentNode}return null}function en(c){if(c=c[Ke]||c[er]){var p=c.tag;if(p===5||p===6||p===13||p===31||p===26||p===27||p===3)return c}return null}function pn(c){var p=c.tag;if(p===5||p===26||p===27||p===6)return c.stateNode;throw Error(n(33))}function Ci(c){var p=c[Ri];return p||(p=c[Ri]={hoistableStyles:new Map,hoistableScripts:new Map}),p}function Br(c){c[Hn]=!0}var Et=new Set,oe={};function Ue(c,p){je(c,p),je(c+"Capture",p)}function je(c,p){for(oe[c]=p,c=0;c<p.length;c++)Et.add(p[c])}var ct=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),yt={},$t={};function mr(c){return he.call($t,c)?!0:he.call(yt,c)?!1:ct.test(c)?$t[c]=!0:(yt[c]=!0,!1)}function Or(c,p,v){if(mr(p))if(v===null)c.removeAttribute(p);else{switch(typeof v){case"undefined":case"function":case"symbol":c.removeAttribute(p);return;case"boolean":var S=p.toLowerCase().slice(0,5);if(S!=="data-"&&S!=="aria-"){c.removeAttribute(p);return}}c.setAttribute(p,""+v)}}function kr(c,p,v){if(v===null)c.removeAttribute(p);else{switch(typeof v){case"undefined":case"function":case"symbol":case"boolean":c.removeAttribute(p);return}c.setAttribute(p,""+v)}}function ii(c,p,v,S){if(S===null)c.removeAttribute(v);else{switch(typeof S){case"undefined":case"function":case"symbol":case"boolean":c.removeAttribute(v);return}c.setAttributeNS(p,v,""+S)}}function sr(c){switch(typeof c){case"bigint":case"boolean":case"number":case"string":case"undefined":return c;case"object":return c;default:return""}}function ai(c){var p=c.type;return(c=c.nodeName)&&c.toLowerCase()==="input"&&(p==="checkbox"||p==="radio")}function Un(c,p,v){var S=Object.getOwnPropertyDescriptor(c.constructor.prototype,p);if(!c.hasOwnProperty(p)&&typeof S<"u"&&typeof S.get=="function"&&typeof S.set=="function"){var M=S.get,R=S.set;return Object.defineProperty(c,p,{configurable:!0,get:function(){return M.call(this)},set:function(Y){v=""+Y,R.call(this,Y)}}),Object.defineProperty(c,p,{enumerable:S.enumerable}),{getValue:function(){return v},setValue:function(Y){v=""+Y},stopTracking:function(){c._valueTracker=null,delete c[p]}}}}function ms(c){if(!c._valueTracker){var p=ai(c)?"checked":"value";c._valueTracker=Un(c,p,""+c[p])}}function Za(c){if(!c)return!1;var p=c._valueTracker;if(!p)return!0;var v=p.getValue(),S="";return c&&(S=ai(c)?c.checked?"true":"false":c.value),c=S,c!==v?(p.setValue(c),!0):!1}function la(c){if(c=c||(typeof document<"u"?document:void 0),typeof c>"u")return null;try{return c.activeElement||c.body}catch{return c.body}}var cl=/[\n"\\]/g;function Bi(c){return c.replace(cl,function(p){return"\\"+p.charCodeAt(0).toString(16)+" "})}function Wn(c,p,v,S,M,R,Y,te){c.name="",Y!=null&&typeof Y!="function"&&typeof Y!="symbol"&&typeof Y!="boolean"?c.type=Y:c.removeAttribute("type"),p!=null?Y==="number"?(p===0&&c.value===""||c.value!=p)&&(c.value=""+sr(p)):c.value!==""+sr(p)&&(c.value=""+sr(p)):Y!=="submit"&&Y!=="reset"||c.removeAttribute("value"),p!=null?st(c,Y,sr(p)):v!=null?st(c,Y,sr(v)):S!=null&&c.removeAttribute("value"),M==null&&R!=null&&(c.defaultChecked=!!R),M!=null&&(c.checked=M&&typeof M!="function"&&typeof M!="symbol"),te!=null&&typeof te!="function"&&typeof te!="symbol"&&typeof te!="boolean"?c.name=""+sr(te):c.removeAttribute("name")}function Re(c,p,v,S,M,R,Y,te){if(R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"&&(c.type=R),p!=null||v!=null){if(!(R!=="submit"&&R!=="reset"||p!=null)){ms(c);return}v=v!=null?""+sr(v):"",p=p!=null?""+sr(p):v,te||p===c.value||(c.value=p),c.defaultValue=p}S=S??M,S=typeof S!="function"&&typeof S!="symbol"&&!!S,c.checked=te?c.checked:!!S,c.defaultChecked=!!S,Y!=null&&typeof Y!="function"&&typeof Y!="symbol"&&typeof Y!="boolean"&&(c.name=Y),ms(c)}function st(c,p,v){p==="number"&&la(c.ownerDocument)===c||c.defaultValue===""+v||(c.defaultValue=""+v)}function it(c,p,v,S){if(c=c.options,p){p={};for(var M=0;M<v.length;M++)p["$"+v[M]]=!0;for(v=0;v<c.length;v++)M=p.hasOwnProperty("$"+c[v].value),c[v].selected!==M&&(c[v].selected=M),M&&S&&(c[v].defaultSelected=!0)}else{for(v=""+sr(v),p=null,M=0;M<c.length;M++){if(c[M].value===v){c[M].selected=!0,S&&(c[M].defaultSelected=!0);return}p!==null||c[M].disabled||(p=c[M])}p!==null&&(p.selected=!0)}}function _t(c,p,v){if(p!=null&&(p=""+sr(p),p!==c.value&&(c.value=p),v==null)){c.defaultValue!==p&&(c.defaultValue=p);return}c.defaultValue=v!=null?""+sr(v):""}function ur(c,p,v,S){if(p==null){if(S!=null){if(v!=null)throw Error(n(92));if(P(S)){if(1<S.length)throw Error(n(93));S=S[0]}v=S}v==null&&(v=""),p=v}v=sr(p),c.defaultValue=v,S=c.textContent,S===v&&S!==""&&S!==null&&(c.value=S),ms(c)}function bt(c,p){if(p){var v=c.firstChild;if(v&&v===c.lastChild&&v.nodeType===3){v.nodeValue=p;return}}c.textContent=p}var Nr=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function gr(c,p,v){var S=p.indexOf("--")===0;v==null||typeof v=="boolean"||v===""?S?c.setProperty(p,""):p==="float"?c.cssFloat="":c[p]="":S?c.setProperty(p,v):typeof v!="number"||v===0||Nr.has(p)?p==="float"?c.cssFloat=v:c[p]=(""+v).trim():c[p]=v+"px"}function vr(c,p,v){if(p!=null&&typeof p!="object")throw Error(n(62));if(c=c.style,v!=null){for(var S in v)!v.hasOwnProperty(S)||p!=null&&p.hasOwnProperty(S)||(S.indexOf("--")===0?c.setProperty(S,""):S==="float"?c.cssFloat="":c[S]="");for(var M in p)S=p[M],p.hasOwnProperty(M)&&v[M]!==S&&gr(c,M,S)}else for(var R in p)p.hasOwnProperty(R)&&gr(c,R,p[R])}function Ui(c){if(c.indexOf("-")===-1)return!1;switch(c){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Gn=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Qa=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Ja(c){return Qa.test(""+c)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":c}function ft(){}var Ot=null;function cr(c){return c=c.target||c.srcElement||window,c.correspondingUseElement&&(c=c.correspondingUseElement),c.nodeType===3?c.parentNode:c}var xr=null,ni=null;function Kn(c){var p=en(c);if(p&&(c=p.stateNode)){var v=c[Tt]||null;e:switch(c=p.stateNode,p.type){case"input":if(Wn(c,v.value,v.defaultValue,v.defaultValue,v.checked,v.defaultChecked,v.type,v.name),p=v.name,v.type==="radio"&&p!=null){for(v=c;v.parentNode;)v=v.parentNode;for(v=v.querySelectorAll('input[name="'+Bi(""+p)+'"][type="radio"]'),p=0;p<v.length;p++){var S=v[p];if(S!==c&&S.form===c.form){var M=S[Tt]||null;if(!M)throw Error(n(90));Wn(S,M.value,M.defaultValue,M.defaultValue,M.checked,M.defaultChecked,M.type,M.name)}}for(p=0;p<v.length;p++)S=v[p],S.form===c.form&&Za(S)}break e;case"textarea":_t(c,v.value,v.defaultValue);break e;case"select":p=v.value,p!=null&&it(c,!!v.multiple,p,!1)}}}var Cu=!1;function ip(c,p,v){if(Cu)return c(p,v);Cu=!0;try{var S=c(p);return S}finally{if(Cu=!1,(xr!==null||ni!==null)&&(Up(),xr&&(p=xr,c=ni,ni=xr=null,Kn(p),c)))for(p=0;p<c.length;p++)Kn(c[p])}}function wu(c,p){var v=c.stateNode;if(v===null)return null;var S=v[Tt]||null;if(S===null)return null;v=S[p];e:switch(p){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(S=!S.disabled)||(c=c.type,S=!(c==="button"||c==="input"||c==="select"||c==="textarea")),c=!S;break e;default:c=!1}if(c)return null;if(v&&typeof v!="function")throw Error(n(231,p,typeof v));return v}var ca=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),mb=!1;if(ca)try{var ku={};Object.defineProperty(ku,"passive",{get:function(){mb=!0}}),window.addEventListener("test",ku,ku),window.removeEventListener("test",ku,ku)}catch{mb=!1}var eo=null,yb=null,np=null;function nS(){if(np)return np;var c,p=yb,v=p.length,S,M="value"in eo?eo.value:eo.textContent,R=M.length;for(c=0;c<v&&p[c]===M[c];c++);var Y=v-c;for(S=1;S<=Y&&p[v-S]===M[R-S];S++);return np=M.slice(c,1<S?1-S:void 0)}function sp(c){var p=c.keyCode;return"charCode"in c?(c=c.charCode,c===0&&p===13&&(c=13)):c=p,c===10&&(c=13),32<=c||c===13?c:0}function ap(){return!0}function sS(){return!1}function gn(c){function p(v,S,M,R,Y){this._reactName=v,this._targetInst=M,this.type=S,this.nativeEvent=R,this.target=Y,this.currentTarget=null;for(var te in c)c.hasOwnProperty(te)&&(v=c[te],this[te]=v?v(R):R[te]);return this.isDefaultPrevented=(R.defaultPrevented!=null?R.defaultPrevented:R.returnValue===!1)?ap:sS,this.isPropagationStopped=sS,this}return f(p.prototype,{preventDefault:function(){this.defaultPrevented=!0;var v=this.nativeEvent;v&&(v.preventDefault?v.preventDefault():typeof v.returnValue!="unknown"&&(v.returnValue=!1),this.isDefaultPrevented=ap)},stopPropagation:function(){var v=this.nativeEvent;v&&(v.stopPropagation?v.stopPropagation():typeof v.cancelBubble!="unknown"&&(v.cancelBubble=!0),this.isPropagationStopped=ap)},persist:function(){},isPersistent:ap}),p}var hl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(c){return c.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},op=gn(hl),Su=f({},hl,{view:0,detail:0}),Y$=gn(Su),bb,vb,Tu,lp=f({},Su,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:_b,button:0,buttons:0,relatedTarget:function(c){return c.relatedTarget===void 0?c.fromElement===c.srcElement?c.toElement:c.fromElement:c.relatedTarget},movementX:function(c){return"movementX"in c?c.movementX:(c!==Tu&&(Tu&&c.type==="mousemove"?(bb=c.screenX-Tu.screenX,vb=c.screenY-Tu.screenY):vb=bb=0,Tu=c),bb)},movementY:function(c){return"movementY"in c?c.movementY:vb}}),aS=gn(lp),X$=f({},lp,{dataTransfer:0}),Z$=gn(X$),Q$=f({},Su,{relatedTarget:0}),xb=gn(Q$),J$=f({},hl,{animationName:0,elapsedTime:0,pseudoElement:0}),eP=gn(J$),tP=f({},hl,{clipboardData:function(c){return"clipboardData"in c?c.clipboardData:window.clipboardData}}),rP=gn(tP),iP=f({},hl,{data:0}),oS=gn(iP),nP={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},sP={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},aP={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function oP(c){var p=this.nativeEvent;return p.getModifierState?p.getModifierState(c):(c=aP[c])?!!p[c]:!1}function _b(){return oP}var lP=f({},Su,{key:function(c){if(c.key){var p=nP[c.key]||c.key;if(p!=="Unidentified")return p}return c.type==="keypress"?(c=sp(c),c===13?"Enter":String.fromCharCode(c)):c.type==="keydown"||c.type==="keyup"?sP[c.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:_b,charCode:function(c){return c.type==="keypress"?sp(c):0},keyCode:function(c){return c.type==="keydown"||c.type==="keyup"?c.keyCode:0},which:function(c){return c.type==="keypress"?sp(c):c.type==="keydown"||c.type==="keyup"?c.keyCode:0}}),cP=gn(lP),hP=f({},lp,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),lS=gn(hP),uP=f({},Su,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:_b}),dP=gn(uP),fP=f({},hl,{propertyName:0,elapsedTime:0,pseudoElement:0}),pP=gn(fP),gP=f({},lp,{deltaX:function(c){return"deltaX"in c?c.deltaX:"wheelDeltaX"in c?-c.wheelDeltaX:0},deltaY:function(c){return"deltaY"in c?c.deltaY:"wheelDeltaY"in c?-c.wheelDeltaY:"wheelDelta"in c?-c.wheelDelta:0},deltaZ:0,deltaMode:0}),mP=gn(gP),yP=f({},hl,{newState:0,oldState:0}),bP=gn(yP),vP=[9,13,27,32],Cb=ca&&"CompositionEvent"in window,Eu=null;ca&&"documentMode"in document&&(Eu=document.documentMode);var xP=ca&&"TextEvent"in window&&!Eu,cS=ca&&(!Cb||Eu&&8<Eu&&11>=Eu),hS=" ",uS=!1;function dS(c,p){switch(c){case"keyup":return vP.indexOf(p.keyCode)!==-1;case"keydown":return p.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function fS(c){return c=c.detail,typeof c=="object"&&"data"in c?c.data:null}var Sc=!1;function _P(c,p){switch(c){case"compositionend":return fS(p);case"keypress":return p.which!==32?null:(uS=!0,hS);case"textInput":return c=p.data,c===hS&&uS?null:c;default:return null}}function CP(c,p){if(Sc)return c==="compositionend"||!Cb&&dS(c,p)?(c=nS(),np=yb=eo=null,Sc=!1,c):null;switch(c){case"paste":return null;case"keypress":if(!(p.ctrlKey||p.altKey||p.metaKey)||p.ctrlKey&&p.altKey){if(p.char&&1<p.char.length)return p.char;if(p.which)return String.fromCharCode(p.which)}return null;case"compositionend":return cS&&p.locale!=="ko"?null:p.data;default:return null}}var wP={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function pS(c){var p=c&&c.nodeName&&c.nodeName.toLowerCase();return p==="input"?!!wP[c.type]:p==="textarea"}function gS(c,p,v,S){xr?ni?ni.push(S):ni=[S]:xr=S,p=Zp(p,"onChange"),0<p.length&&(v=new op("onChange","change",null,v,S),c.push({event:v,listeners:p}))}var Nu=null,ju=null;function kP(c){ZT(c,0)}function cp(c){var p=pn(c);if(Za(p))return c}function mS(c,p){if(c==="change")return p}var yS=!1;if(ca){var wb;if(ca){var kb="oninput"in document;if(!kb){var bS=document.createElement("div");bS.setAttribute("oninput","return;"),kb=typeof bS.oninput=="function"}wb=kb}else wb=!1;yS=wb&&(!document.documentMode||9<document.documentMode)}function vS(){Nu&&(Nu.detachEvent("onpropertychange",xS),ju=Nu=null)}function xS(c){if(c.propertyName==="value"&&cp(ju)){var p=[];gS(p,ju,c,cr(c)),ip(kP,p)}}function SP(c,p,v){c==="focusin"?(vS(),Nu=p,ju=v,Nu.attachEvent("onpropertychange",xS)):c==="focusout"&&vS()}function TP(c){if(c==="selectionchange"||c==="keyup"||c==="keydown")return cp(ju)}function EP(c,p){if(c==="click")return cp(p)}function NP(c,p){if(c==="input"||c==="change")return cp(p)}function jP(c,p){return c===p&&(c!==0||1/c===1/p)||c!==c&&p!==p}var jn=typeof Object.is=="function"?Object.is:jP;function Au(c,p){if(jn(c,p))return!0;if(typeof c!="object"||c===null||typeof p!="object"||p===null)return!1;var v=Object.keys(c),S=Object.keys(p);if(v.length!==S.length)return!1;for(S=0;S<v.length;S++){var M=v[S];if(!he.call(p,M)||!jn(c[M],p[M]))return!1}return!0}function _S(c){for(;c&&c.firstChild;)c=c.firstChild;return c}function CS(c,p){var v=_S(c);c=0;for(var S;v;){if(v.nodeType===3){if(S=c+v.textContent.length,c<=p&&S>=p)return{node:v,offset:p-c};c=S}e:{for(;v;){if(v.nextSibling){v=v.nextSibling;break e}v=v.parentNode}v=void 0}v=_S(v)}}function wS(c,p){return c&&p?c===p?!0:c&&c.nodeType===3?!1:p&&p.nodeType===3?wS(c,p.parentNode):"contains"in c?c.contains(p):c.compareDocumentPosition?!!(c.compareDocumentPosition(p)&16):!1:!1}function kS(c){c=c!=null&&c.ownerDocument!=null&&c.ownerDocument.defaultView!=null?c.ownerDocument.defaultView:window;for(var p=la(c.document);p instanceof c.HTMLIFrameElement;){try{var v=typeof p.contentWindow.location.href=="string"}catch{v=!1}if(v)c=p.contentWindow;else break;p=la(c.document)}return p}function Sb(c){var p=c&&c.nodeName&&c.nodeName.toLowerCase();return p&&(p==="input"&&(c.type==="text"||c.type==="search"||c.type==="tel"||c.type==="url"||c.type==="password")||p==="textarea"||c.contentEditable==="true")}var AP=ca&&"documentMode"in document&&11>=document.documentMode,Tc=null,Tb=null,Mu=null,Eb=!1;function SS(c,p,v){var S=v.window===v?v.document:v.nodeType===9?v:v.ownerDocument;Eb||Tc==null||Tc!==la(S)||(S=Tc,"selectionStart"in S&&Sb(S)?S={start:S.selectionStart,end:S.selectionEnd}:(S=(S.ownerDocument&&S.ownerDocument.defaultView||window).getSelection(),S={anchorNode:S.anchorNode,anchorOffset:S.anchorOffset,focusNode:S.focusNode,focusOffset:S.focusOffset}),Mu&&Au(Mu,S)||(Mu=S,S=Zp(Tb,"onSelect"),0<S.length&&(p=new op("onSelect","select",null,p,v),c.push({event:p,listeners:S}),p.target=Tc)))}function ul(c,p){var v={};return v[c.toLowerCase()]=p.toLowerCase(),v["Webkit"+c]="webkit"+p,v["Moz"+c]="moz"+p,v}var Ec={animationend:ul("Animation","AnimationEnd"),animationiteration:ul("Animation","AnimationIteration"),animationstart:ul("Animation","AnimationStart"),transitionrun:ul("Transition","TransitionRun"),transitionstart:ul("Transition","TransitionStart"),transitioncancel:ul("Transition","TransitionCancel"),transitionend:ul("Transition","TransitionEnd")},Nb={},TS={};ca&&(TS=document.createElement("div").style,"AnimationEvent"in window||(delete Ec.animationend.animation,delete Ec.animationiteration.animation,delete Ec.animationstart.animation),"TransitionEvent"in window||delete Ec.transitionend.transition);function dl(c){if(Nb[c])return Nb[c];if(!Ec[c])return c;var p=Ec[c],v;for(v in p)if(p.hasOwnProperty(v)&&v in TS)return Nb[c]=p[v];return c}var ES=dl("animationend"),NS=dl("animationiteration"),jS=dl("animationstart"),MP=dl("transitionrun"),LP=dl("transitionstart"),RP=dl("transitioncancel"),AS=dl("transitionend"),MS=new Map,jb="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");jb.push("scrollEnd");function ys(c,p){MS.set(c,p),Ue(p,[c])}var hp=typeof reportError=="function"?reportError:function(c){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var p=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof c=="object"&&c!==null&&typeof c.message=="string"?String(c.message):String(c),error:c});if(!window.dispatchEvent(p))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",c);return}console.error(c)},Vn=[],Nc=0,Ab=0;function up(){for(var c=Nc,p=Ab=Nc=0;p<c;){var v=Vn[p];Vn[p++]=null;var S=Vn[p];Vn[p++]=null;var M=Vn[p];Vn[p++]=null;var R=Vn[p];if(Vn[p++]=null,S!==null&&M!==null){var Y=S.pending;Y===null?M.next=M:(M.next=Y.next,Y.next=M),S.pending=M}R!==0&&LS(v,M,R)}}function dp(c,p,v,S){Vn[Nc++]=c,Vn[Nc++]=p,Vn[Nc++]=v,Vn[Nc++]=S,Ab|=S,c.lanes|=S,c=c.alternate,c!==null&&(c.lanes|=S)}function Mb(c,p,v,S){return dp(c,p,v,S),fp(c)}function fl(c,p){return dp(c,null,null,p),fp(c)}function LS(c,p,v){c.lanes|=v;var S=c.alternate;S!==null&&(S.lanes|=v);for(var M=!1,R=c.return;R!==null;)R.childLanes|=v,S=R.alternate,S!==null&&(S.childLanes|=v),R.tag===22&&(c=R.stateNode,c===null||c._visibility&1||(M=!0)),c=R,R=R.return;return c.tag===3?(R=c.stateNode,M&&p!==null&&(M=31-at(v),c=R.hiddenUpdates,S=c[M],S===null?c[M]=[p]:S.push(p),p.lane=v|536870912),R):null}function fp(c){if(50<Ju)throw Ju=0,Pv=null,Error(n(185));for(var p=c.return;p!==null;)c=p,p=c.return;return c.tag===3?c.stateNode:null}var jc={};function BP(c,p,v,S){this.tag=c,this.key=v,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=p,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=S,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function An(c,p,v,S){return new BP(c,p,v,S)}function Lb(c){return c=c.prototype,!(!c||!c.isReactComponent)}function ha(c,p){var v=c.alternate;return v===null?(v=An(c.tag,p,c.key,c.mode),v.elementType=c.elementType,v.type=c.type,v.stateNode=c.stateNode,v.alternate=c,c.alternate=v):(v.pendingProps=p,v.type=c.type,v.flags=0,v.subtreeFlags=0,v.deletions=null),v.flags=c.flags&65011712,v.childLanes=c.childLanes,v.lanes=c.lanes,v.child=c.child,v.memoizedProps=c.memoizedProps,v.memoizedState=c.memoizedState,v.updateQueue=c.updateQueue,p=c.dependencies,v.dependencies=p===null?null:{lanes:p.lanes,firstContext:p.firstContext},v.sibling=c.sibling,v.index=c.index,v.ref=c.ref,v.refCleanup=c.refCleanup,v}function RS(c,p){c.flags&=65011714;var v=c.alternate;return v===null?(c.childLanes=0,c.lanes=p,c.child=null,c.subtreeFlags=0,c.memoizedProps=null,c.memoizedState=null,c.updateQueue=null,c.dependencies=null,c.stateNode=null):(c.childLanes=v.childLanes,c.lanes=v.lanes,c.child=v.child,c.subtreeFlags=0,c.deletions=null,c.memoizedProps=v.memoizedProps,c.memoizedState=v.memoizedState,c.updateQueue=v.updateQueue,c.type=v.type,p=v.dependencies,c.dependencies=p===null?null:{lanes:p.lanes,firstContext:p.firstContext}),c}function pp(c,p,v,S,M,R){var Y=0;if(S=c,typeof c=="function")Lb(c)&&(Y=1);else if(typeof c=="string")Y=$8(c,v,re.current)?26:c==="html"||c==="head"||c==="body"?27:5;else e:switch(c){case L:return c=An(31,v,p,M),c.elementType=L,c.lanes=R,c;case _:return pl(v.children,M,R,p);case b:Y=8,M|=24;break;case x:return c=An(12,v,p,M|2),c.elementType=x,c.lanes=R,c;case N:return c=An(13,v,p,M),c.elementType=N,c.lanes=R,c;case A:return c=An(19,v,p,M),c.elementType=A,c.lanes=R,c;default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case k:Y=10;break e;case C:Y=9;break e;case T:Y=11;break e;case j:Y=14;break e;case E:Y=16,S=null;break e}Y=29,v=Error(n(130,c===null?"null":typeof c,"")),S=null}return p=An(Y,v,p,M),p.elementType=c,p.type=S,p.lanes=R,p}function pl(c,p,v,S){return c=An(7,c,S,p),c.lanes=v,c}function Rb(c,p,v){return c=An(6,c,null,p),c.lanes=v,c}function BS(c){var p=An(18,null,null,0);return p.stateNode=c,p}function Bb(c,p,v){return p=An(4,c.children!==null?c.children:[],c.key,p),p.lanes=v,p.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},p}var OS=new WeakMap;function Yn(c,p){if(typeof c=="object"&&c!==null){var v=OS.get(c);return v!==void 0?v:(p={value:c,source:p,stack:Ne(p)},OS.set(c,p),p)}return{value:c,source:p,stack:Ne(p)}}var Ac=[],Mc=0,gp=null,Lu=0,Xn=[],Zn=0,to=null,Ds=1,Is="";function ua(c,p){Ac[Mc++]=Lu,Ac[Mc++]=gp,gp=c,Lu=p}function DS(c,p,v){Xn[Zn++]=Ds,Xn[Zn++]=Is,Xn[Zn++]=to,to=c;var S=Ds;c=Is;var M=32-at(S)-1;S&=~(1<<M),v+=1;var R=32-at(p)+M;if(30<R){var Y=M-M%5;R=(S&(1<<Y)-1).toString(32),S>>=Y,M-=Y,Ds=1<<32-at(p)+M|v<<M|S,Is=R+c}else Ds=1<<R|v<<M|S,Is=c}function Ob(c){c.return!==null&&(ua(c,1),DS(c,1,0))}function Db(c){for(;c===gp;)gp=Ac[--Mc],Ac[Mc]=null,Lu=Ac[--Mc],Ac[Mc]=null;for(;c===to;)to=Xn[--Zn],Xn[Zn]=null,Is=Xn[--Zn],Xn[Zn]=null,Ds=Xn[--Zn],Xn[Zn]=null}function IS(c,p){Xn[Zn++]=Ds,Xn[Zn++]=Is,Xn[Zn++]=to,Ds=p.id,Is=p.overflow,to=c}var Oi=null,Vr=null,Sr=!1,ro=null,Qn=!1,Ib=Error(n(519));function io(c){var p=Error(n(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ru(Yn(p,c)),Ib}function FS(c){var p=c.stateNode,v=c.type,S=c.memoizedProps;switch(p[Ke]=c,p[Tt]=S,v){case"dialog":br("cancel",p),br("close",p);break;case"iframe":case"object":case"embed":br("load",p);break;case"video":case"audio":for(v=0;v<td.length;v++)br(td[v],p);break;case"source":br("error",p);break;case"img":case"image":case"link":br("error",p),br("load",p);break;case"details":br("toggle",p);break;case"input":br("invalid",p),Re(p,S.value,S.defaultValue,S.checked,S.defaultChecked,S.type,S.name,!0);break;case"select":br("invalid",p);break;case"textarea":br("invalid",p),ur(p,S.value,S.defaultValue,S.children)}v=S.children,typeof v!="string"&&typeof v!="number"&&typeof v!="bigint"||p.textContent===""+v||S.suppressHydrationWarning===!0||tE(p.textContent,v)?(S.popover!=null&&(br("beforetoggle",p),br("toggle",p)),S.onScroll!=null&&br("scroll",p),S.onScrollEnd!=null&&br("scrollend",p),S.onClick!=null&&(p.onclick=ft),p=!0):p=!1,p||io(c,!0)}function $S(c){for(Oi=c.return;Oi;)switch(Oi.tag){case 5:case 31:case 13:Qn=!1;return;case 27:case 3:Qn=!0;return;default:Oi=Oi.return}}function Lc(c){if(c!==Oi)return!1;if(!Sr)return $S(c),Sr=!0,!1;var p=c.tag,v;if((v=p!==3&&p!==27)&&((v=p===5)&&(v=c.type,v=!(v!=="form"&&v!=="button")||t0(c.type,c.memoizedProps)),v=!v),v&&Vr&&io(c),$S(c),p===13){if(c=c.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(n(317));Vr=hE(c)}else if(p===31){if(c=c.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(n(317));Vr=hE(c)}else p===27?(p=Vr,bo(c.type)?(c=a0,a0=null,Vr=c):Vr=p):Vr=Oi?es(c.stateNode.nextSibling):null;return!0}function gl(){Vr=Oi=null,Sr=!1}function Fb(){var c=ro;return c!==null&&(vn===null?vn=c:vn.push.apply(vn,c),ro=null),c}function Ru(c){ro===null?ro=[c]:ro.push(c)}var $b=U(null),ml=null,da=null;function no(c,p,v){ee($b,p._currentValue),p._currentValue=v}function fa(c){c._currentValue=$b.current,X($b)}function Pb(c,p,v){for(;c!==null;){var S=c.alternate;if((c.childLanes&p)!==p?(c.childLanes|=p,S!==null&&(S.childLanes|=p)):S!==null&&(S.childLanes&p)!==p&&(S.childLanes|=p),c===v)break;c=c.return}}function zb(c,p,v,S){var M=c.child;for(M!==null&&(M.return=c);M!==null;){var R=M.dependencies;if(R!==null){var Y=M.child;R=R.firstContext;e:for(;R!==null;){var te=R;R=M;for(var pe=0;pe<p.length;pe++)if(te.context===p[pe]){R.lanes|=v,te=R.alternate,te!==null&&(te.lanes|=v),Pb(R.return,v,c),S||(Y=null);break e}R=te.next}}else if(M.tag===18){if(Y=M.return,Y===null)throw Error(n(341));Y.lanes|=v,R=Y.alternate,R!==null&&(R.lanes|=v),Pb(Y,v,c),Y=null}else Y=M.child;if(Y!==null)Y.return=M;else for(Y=M;Y!==null;){if(Y===c){Y=null;break}if(M=Y.sibling,M!==null){M.return=Y.return,Y=M;break}Y=Y.return}M=Y}}function Rc(c,p,v,S){c=null;for(var M=p,R=!1;M!==null;){if(!R){if((M.flags&524288)!==0)R=!0;else if((M.flags&262144)!==0)break}if(M.tag===10){var Y=M.alternate;if(Y===null)throw Error(n(387));if(Y=Y.memoizedProps,Y!==null){var te=M.type;jn(M.pendingProps.value,Y.value)||(c!==null?c.push(te):c=[te])}}else if(M===ie.current){if(Y=M.alternate,Y===null)throw Error(n(387));Y.memoizedState.memoizedState!==M.memoizedState.memoizedState&&(c!==null?c.push(ad):c=[ad])}M=M.return}c!==null&&zb(p,c,v,S),p.flags|=262144}function mp(c){for(c=c.firstContext;c!==null;){if(!jn(c.context._currentValue,c.memoizedValue))return!0;c=c.next}return!1}function yl(c){ml=c,da=null,c=c.dependencies,c!==null&&(c.firstContext=null)}function Di(c){return PS(ml,c)}function yp(c,p){return ml===null&&yl(c),PS(c,p)}function PS(c,p){var v=p._currentValue;if(p={context:p,memoizedValue:v,next:null},da===null){if(c===null)throw Error(n(308));da=p,c.dependencies={lanes:0,firstContext:p},c.flags|=524288}else da=da.next=p;return v}var OP=typeof AbortController<"u"?AbortController:function(){var c=[],p=this.signal={aborted:!1,addEventListener:function(v,S){c.push(S)}};this.abort=function(){p.aborted=!0,c.forEach(function(v){return v()})}},DP=r.unstable_scheduleCallback,IP=r.unstable_NormalPriority,gi={$$typeof:k,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function qb(){return{controller:new OP,data:new Map,refCount:0}}function Bu(c){c.refCount--,c.refCount===0&&DP(IP,function(){c.controller.abort()})}var Ou=null,Hb=0,Bc=0,Oc=null;function FP(c,p){if(Ou===null){var v=Ou=[];Hb=0,Bc=Gv(),Oc={status:"pending",value:void 0,then:function(S){v.push(S)}}}return Hb++,p.then(zS,zS),p}function zS(){if(--Hb===0&&Ou!==null){Oc!==null&&(Oc.status="fulfilled");var c=Ou;Ou=null,Bc=0,Oc=null;for(var p=0;p<c.length;p++)(0,c[p])()}}function $P(c,p){var v=[],S={status:"pending",value:null,reason:null,then:function(M){v.push(M)}};return c.then(function(){S.status="fulfilled",S.value=p;for(var M=0;M<v.length;M++)(0,v[M])(p)},function(M){for(S.status="rejected",S.reason=M,M=0;M<v.length;M++)(0,v[M])(void 0)}),S}var qS=$.S;$.S=function(c,p){ST=Lt(),typeof p=="object"&&p!==null&&typeof p.then=="function"&&FP(c,p),qS!==null&&qS(c,p)};var bl=U(null);function Ub(){var c=bl.current;return c!==null?c:Wr.pooledCache}function bp(c,p){p===null?ee(bl,bl.current):ee(bl,p.pool)}function HS(){var c=Ub();return c===null?null:{parent:gi._currentValue,pool:c}}var Dc=Error(n(460)),Wb=Error(n(474)),vp=Error(n(542)),xp={then:function(){}};function US(c){return c=c.status,c==="fulfilled"||c==="rejected"}function WS(c,p,v){switch(v=c[v],v===void 0?c.push(p):v!==p&&(p.then(ft,ft),p=v),p.status){case"fulfilled":return p.value;case"rejected":throw c=p.reason,KS(c),c;default:if(typeof p.status=="string")p.then(ft,ft);else{if(c=Wr,c!==null&&100<c.shellSuspendCounter)throw Error(n(482));c=p,c.status="pending",c.then(function(S){if(p.status==="pending"){var M=p;M.status="fulfilled",M.value=S}},function(S){if(p.status==="pending"){var M=p;M.status="rejected",M.reason=S}})}switch(p.status){case"fulfilled":return p.value;case"rejected":throw c=p.reason,KS(c),c}throw xl=p,Dc}}function vl(c){try{var p=c._init;return p(c._payload)}catch(v){throw v!==null&&typeof v=="object"&&typeof v.then=="function"?(xl=v,Dc):v}}var xl=null;function GS(){if(xl===null)throw Error(n(459));var c=xl;return xl=null,c}function KS(c){if(c===Dc||c===vp)throw Error(n(483))}var Ic=null,Du=0;function _p(c){var p=Du;return Du+=1,Ic===null&&(Ic=[]),WS(Ic,c,p)}function Iu(c,p){p=p.props.ref,c.ref=p!==void 0?p:null}function Cp(c,p){throw p.$$typeof===m?Error(n(525)):(c=Object.prototype.toString.call(p),Error(n(31,c==="[object Object]"?"object with keys {"+Object.keys(p).join(", ")+"}":c)))}function VS(c){function p(Se,_e){if(c){var Me=Se.deletions;Me===null?(Se.deletions=[_e],Se.flags|=16):Me.push(_e)}}function v(Se,_e){if(!c)return null;for(;_e!==null;)p(Se,_e),_e=_e.sibling;return null}function S(Se){for(var _e=new Map;Se!==null;)Se.key!==null?_e.set(Se.key,Se):_e.set(Se.index,Se),Se=Se.sibling;return _e}function M(Se,_e){return Se=ha(Se,_e),Se.index=0,Se.sibling=null,Se}function R(Se,_e,Me){return Se.index=Me,c?(Me=Se.alternate,Me!==null?(Me=Me.index,Me<_e?(Se.flags|=67108866,_e):Me):(Se.flags|=67108866,_e)):(Se.flags|=1048576,_e)}function Y(Se){return c&&Se.alternate===null&&(Se.flags|=67108866),Se}function te(Se,_e,Me,Xe){return _e===null||_e.tag!==6?(_e=Rb(Me,Se.mode,Xe),_e.return=Se,_e):(_e=M(_e,Me),_e.return=Se,_e)}function pe(Se,_e,Me,Xe){var Kt=Me.type;return Kt===_?Ge(Se,_e,Me.props.children,Xe,Me.key):_e!==null&&(_e.elementType===Kt||typeof Kt=="object"&&Kt!==null&&Kt.$$typeof===E&&vl(Kt)===_e.type)?(_e=M(_e,Me.props),Iu(_e,Me),_e.return=Se,_e):(_e=pp(Me.type,Me.key,Me.props,null,Se.mode,Xe),Iu(_e,Me),_e.return=Se,_e)}function Le(Se,_e,Me,Xe){return _e===null||_e.tag!==4||_e.stateNode.containerInfo!==Me.containerInfo||_e.stateNode.implementation!==Me.implementation?(_e=Bb(Me,Se.mode,Xe),_e.return=Se,_e):(_e=M(_e,Me.children||[]),_e.return=Se,_e)}function Ge(Se,_e,Me,Xe,Kt){return _e===null||_e.tag!==7?(_e=pl(Me,Se.mode,Xe,Kt),_e.return=Se,_e):(_e=M(_e,Me),_e.return=Se,_e)}function Qe(Se,_e,Me){if(typeof _e=="string"&&_e!==""||typeof _e=="number"||typeof _e=="bigint")return _e=Rb(""+_e,Se.mode,Me),_e.return=Se,_e;if(typeof _e=="object"&&_e!==null){switch(_e.$$typeof){case y:return Me=pp(_e.type,_e.key,_e.props,null,Se.mode,Me),Iu(Me,_e),Me.return=Se,Me;case w:return _e=Bb(_e,Se.mode,Me),_e.return=Se,_e;case E:return _e=vl(_e),Qe(Se,_e,Me)}if(P(_e)||K(_e))return _e=pl(_e,Se.mode,Me,null),_e.return=Se,_e;if(typeof _e.then=="function")return Qe(Se,_p(_e),Me);if(_e.$$typeof===k)return Qe(Se,yp(Se,_e),Me);Cp(Se,_e)}return null}function Oe(Se,_e,Me,Xe){var Kt=_e!==null?_e.key:null;if(typeof Me=="string"&&Me!==""||typeof Me=="number"||typeof Me=="bigint")return Kt!==null?null:te(Se,_e,""+Me,Xe);if(typeof Me=="object"&&Me!==null){switch(Me.$$typeof){case y:return Me.key===Kt?pe(Se,_e,Me,Xe):null;case w:return Me.key===Kt?Le(Se,_e,Me,Xe):null;case E:return Me=vl(Me),Oe(Se,_e,Me,Xe)}if(P(Me)||K(Me))return Kt!==null?null:Ge(Se,_e,Me,Xe,null);if(typeof Me.then=="function")return Oe(Se,_e,_p(Me),Xe);if(Me.$$typeof===k)return Oe(Se,_e,yp(Se,Me),Xe);Cp(Se,Me)}return null}function Pe(Se,_e,Me,Xe,Kt){if(typeof Xe=="string"&&Xe!==""||typeof Xe=="number"||typeof Xe=="bigint")return Se=Se.get(Me)||null,te(_e,Se,""+Xe,Kt);if(typeof Xe=="object"&&Xe!==null){switch(Xe.$$typeof){case y:return Se=Se.get(Xe.key===null?Me:Xe.key)||null,pe(_e,Se,Xe,Kt);case w:return Se=Se.get(Xe.key===null?Me:Xe.key)||null,Le(_e,Se,Xe,Kt);case E:return Xe=vl(Xe),Pe(Se,_e,Me,Xe,Kt)}if(P(Xe)||K(Xe))return Se=Se.get(Me)||null,Ge(_e,Se,Xe,Kt,null);if(typeof Xe.then=="function")return Pe(Se,_e,Me,_p(Xe),Kt);if(Xe.$$typeof===k)return Pe(Se,_e,Me,yp(_e,Xe),Kt);Cp(_e,Xe)}return null}function jt(Se,_e,Me,Xe){for(var Kt=null,jr=null,Dt=_e,dr=_e=0,Cr=null;Dt!==null&&dr<Me.length;dr++){Dt.index>dr?(Cr=Dt,Dt=null):Cr=Dt.sibling;var Ar=Oe(Se,Dt,Me[dr],Xe);if(Ar===null){Dt===null&&(Dt=Cr);break}c&&Dt&&Ar.alternate===null&&p(Se,Dt),_e=R(Ar,_e,dr),jr===null?Kt=Ar:jr.sibling=Ar,jr=Ar,Dt=Cr}if(dr===Me.length)return v(Se,Dt),Sr&&ua(Se,dr),Kt;if(Dt===null){for(;dr<Me.length;dr++)Dt=Qe(Se,Me[dr],Xe),Dt!==null&&(_e=R(Dt,_e,dr),jr===null?Kt=Dt:jr.sibling=Dt,jr=Dt);return Sr&&ua(Se,dr),Kt}for(Dt=S(Dt);dr<Me.length;dr++)Cr=Pe(Dt,Se,dr,Me[dr],Xe),Cr!==null&&(c&&Cr.alternate!==null&&Dt.delete(Cr.key===null?dr:Cr.key),_e=R(Cr,_e,dr),jr===null?Kt=Cr:jr.sibling=Cr,jr=Cr);return c&&Dt.forEach(function(wo){return p(Se,wo)}),Sr&&ua(Se,dr),Kt}function Jt(Se,_e,Me,Xe){if(Me==null)throw Error(n(151));for(var Kt=null,jr=null,Dt=_e,dr=_e=0,Cr=null,Ar=Me.next();Dt!==null&&!Ar.done;dr++,Ar=Me.next()){Dt.index>dr?(Cr=Dt,Dt=null):Cr=Dt.sibling;var wo=Oe(Se,Dt,Ar.value,Xe);if(wo===null){Dt===null&&(Dt=Cr);break}c&&Dt&&wo.alternate===null&&p(Se,Dt),_e=R(wo,_e,dr),jr===null?Kt=wo:jr.sibling=wo,jr=wo,Dt=Cr}if(Ar.done)return v(Se,Dt),Sr&&ua(Se,dr),Kt;if(Dt===null){for(;!Ar.done;dr++,Ar=Me.next())Ar=Qe(Se,Ar.value,Xe),Ar!==null&&(_e=R(Ar,_e,dr),jr===null?Kt=Ar:jr.sibling=Ar,jr=Ar);return Sr&&ua(Se,dr),Kt}for(Dt=S(Dt);!Ar.done;dr++,Ar=Me.next())Ar=Pe(Dt,Se,dr,Ar.value,Xe),Ar!==null&&(c&&Ar.alternate!==null&&Dt.delete(Ar.key===null?dr:Ar.key),_e=R(Ar,_e,dr),jr===null?Kt=Ar:jr.sibling=Ar,jr=Ar);return c&&Dt.forEach(function(X8){return p(Se,X8)}),Sr&&ua(Se,dr),Kt}function Ur(Se,_e,Me,Xe){if(typeof Me=="object"&&Me!==null&&Me.type===_&&Me.key===null&&(Me=Me.props.children),typeof Me=="object"&&Me!==null){switch(Me.$$typeof){case y:e:{for(var Kt=Me.key;_e!==null;){if(_e.key===Kt){if(Kt=Me.type,Kt===_){if(_e.tag===7){v(Se,_e.sibling),Xe=M(_e,Me.props.children),Xe.return=Se,Se=Xe;break e}}else if(_e.elementType===Kt||typeof Kt=="object"&&Kt!==null&&Kt.$$typeof===E&&vl(Kt)===_e.type){v(Se,_e.sibling),Xe=M(_e,Me.props),Iu(Xe,Me),Xe.return=Se,Se=Xe;break e}v(Se,_e);break}else p(Se,_e);_e=_e.sibling}Me.type===_?(Xe=pl(Me.props.children,Se.mode,Xe,Me.key),Xe.return=Se,Se=Xe):(Xe=pp(Me.type,Me.key,Me.props,null,Se.mode,Xe),Iu(Xe,Me),Xe.return=Se,Se=Xe)}return Y(Se);case w:e:{for(Kt=Me.key;_e!==null;){if(_e.key===Kt)if(_e.tag===4&&_e.stateNode.containerInfo===Me.containerInfo&&_e.stateNode.implementation===Me.implementation){v(Se,_e.sibling),Xe=M(_e,Me.children||[]),Xe.return=Se,Se=Xe;break e}else{v(Se,_e);break}else p(Se,_e);_e=_e.sibling}Xe=Bb(Me,Se.mode,Xe),Xe.return=Se,Se=Xe}return Y(Se);case E:return Me=vl(Me),Ur(Se,_e,Me,Xe)}if(P(Me))return jt(Se,_e,Me,Xe);if(K(Me)){if(Kt=K(Me),typeof Kt!="function")throw Error(n(150));return Me=Kt.call(Me),Jt(Se,_e,Me,Xe)}if(typeof Me.then=="function")return Ur(Se,_e,_p(Me),Xe);if(Me.$$typeof===k)return Ur(Se,_e,yp(Se,Me),Xe);Cp(Se,Me)}return typeof Me=="string"&&Me!==""||typeof Me=="number"||typeof Me=="bigint"?(Me=""+Me,_e!==null&&_e.tag===6?(v(Se,_e.sibling),Xe=M(_e,Me),Xe.return=Se,Se=Xe):(v(Se,_e),Xe=Rb(Me,Se.mode,Xe),Xe.return=Se,Se=Xe),Y(Se)):v(Se,_e)}return function(Se,_e,Me,Xe){try{Du=0;var Kt=Ur(Se,_e,Me,Xe);return Ic=null,Kt}catch(Dt){if(Dt===Dc||Dt===vp)throw Dt;var jr=An(29,Dt,null,Se.mode);return jr.lanes=Xe,jr.return=Se,jr}finally{}}}var _l=VS(!0),YS=VS(!1),so=!1;function Gb(c){c.updateQueue={baseState:c.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Kb(c,p){c=c.updateQueue,p.updateQueue===c&&(p.updateQueue={baseState:c.baseState,firstBaseUpdate:c.firstBaseUpdate,lastBaseUpdate:c.lastBaseUpdate,shared:c.shared,callbacks:null})}function ao(c){return{lane:c,tag:0,payload:null,callback:null,next:null}}function oo(c,p,v){var S=c.updateQueue;if(S===null)return null;if(S=S.shared,(Rr&2)!==0){var M=S.pending;return M===null?p.next=p:(p.next=M.next,M.next=p),S.pending=p,p=fp(c),LS(c,null,v),p}return dp(c,S,p,v),fp(c)}function Fu(c,p,v){if(p=p.updateQueue,p!==null&&(p=p.shared,(v&4194048)!==0)){var S=p.lanes;S&=c.pendingLanes,v|=S,p.lanes=v,qe(c,v)}}function Vb(c,p){var v=c.updateQueue,S=c.alternate;if(S!==null&&(S=S.updateQueue,v===S)){var M=null,R=null;if(v=v.firstBaseUpdate,v!==null){do{var Y={lane:v.lane,tag:v.tag,payload:v.payload,callback:null,next:null};R===null?M=R=Y:R=R.next=Y,v=v.next}while(v!==null);R===null?M=R=p:R=R.next=p}else M=R=p;v={baseState:S.baseState,firstBaseUpdate:M,lastBaseUpdate:R,shared:S.shared,callbacks:S.callbacks},c.updateQueue=v;return}c=v.lastBaseUpdate,c===null?v.firstBaseUpdate=p:c.next=p,v.lastBaseUpdate=p}var Yb=!1;function $u(){if(Yb){var c=Oc;if(c!==null)throw c}}function Pu(c,p,v,S){Yb=!1;var M=c.updateQueue;so=!1;var R=M.firstBaseUpdate,Y=M.lastBaseUpdate,te=M.shared.pending;if(te!==null){M.shared.pending=null;var pe=te,Le=pe.next;pe.next=null,Y===null?R=Le:Y.next=Le,Y=pe;var Ge=c.alternate;Ge!==null&&(Ge=Ge.updateQueue,te=Ge.lastBaseUpdate,te!==Y&&(te===null?Ge.firstBaseUpdate=Le:te.next=Le,Ge.lastBaseUpdate=pe))}if(R!==null){var Qe=M.baseState;Y=0,Ge=Le=pe=null,te=R;do{var Oe=te.lane&-536870913,Pe=Oe!==te.lane;if(Pe?(_r&Oe)===Oe:(S&Oe)===Oe){Oe!==0&&Oe===Bc&&(Yb=!0),Ge!==null&&(Ge=Ge.next={lane:0,tag:te.tag,payload:te.payload,callback:null,next:null});e:{var jt=c,Jt=te;Oe=p;var Ur=v;switch(Jt.tag){case 1:if(jt=Jt.payload,typeof jt=="function"){Qe=jt.call(Ur,Qe,Oe);break e}Qe=jt;break e;case 3:jt.flags=jt.flags&-65537|128;case 0:if(jt=Jt.payload,Oe=typeof jt=="function"?jt.call(Ur,Qe,Oe):jt,Oe==null)break e;Qe=f({},Qe,Oe);break e;case 2:so=!0}}Oe=te.callback,Oe!==null&&(c.flags|=64,Pe&&(c.flags|=8192),Pe=M.callbacks,Pe===null?M.callbacks=[Oe]:Pe.push(Oe))}else Pe={lane:Oe,tag:te.tag,payload:te.payload,callback:te.callback,next:null},Ge===null?(Le=Ge=Pe,pe=Qe):Ge=Ge.next=Pe,Y|=Oe;if(te=te.next,te===null){if(te=M.shared.pending,te===null)break;Pe=te,te=Pe.next,Pe.next=null,M.lastBaseUpdate=Pe,M.shared.pending=null}}while(!0);Ge===null&&(pe=Qe),M.baseState=pe,M.firstBaseUpdate=Le,M.lastBaseUpdate=Ge,R===null&&(M.shared.lanes=0),fo|=Y,c.lanes=Y,c.memoizedState=Qe}}function XS(c,p){if(typeof c!="function")throw Error(n(191,c));c.call(p)}function ZS(c,p){var v=c.callbacks;if(v!==null)for(c.callbacks=null,c=0;c<v.length;c++)XS(v[c],p)}var Fc=U(null),wp=U(0);function QS(c,p){c=Ca,ee(wp,c),ee(Fc,p),Ca=c|p.baseLanes}function Xb(){ee(wp,Ca),ee(Fc,Fc.current)}function Zb(){Ca=wp.current,X(Fc),X(wp)}var Mn=U(null),Jn=null;function lo(c){var p=c.alternate;ee(di,di.current&1),ee(Mn,c),Jn===null&&(p===null||Fc.current!==null||p.memoizedState!==null)&&(Jn=c)}function Qb(c){ee(di,di.current),ee(Mn,c),Jn===null&&(Jn=c)}function JS(c){c.tag===22?(ee(di,di.current),ee(Mn,c),Jn===null&&(Jn=c)):co()}function co(){ee(di,di.current),ee(Mn,Mn.current)}function Ln(c){X(Mn),Jn===c&&(Jn=null),X(di)}var di=U(0);function kp(c){for(var p=c;p!==null;){if(p.tag===13){var v=p.memoizedState;if(v!==null&&(v=v.dehydrated,v===null||n0(v)||s0(v)))return p}else if(p.tag===19&&(p.memoizedProps.revealOrder==="forwards"||p.memoizedProps.revealOrder==="backwards"||p.memoizedProps.revealOrder==="unstable_legacy-backwards"||p.memoizedProps.revealOrder==="together")){if((p.flags&128)!==0)return p}else if(p.child!==null){p.child.return=p,p=p.child;continue}if(p===c)break;for(;p.sibling===null;){if(p.return===null||p.return===c)return null;p=p.return}p.sibling.return=p.return,p=p.sibling}return null}var pa=0,hr=null,qr=null,mi=null,Sp=!1,$c=!1,Cl=!1,Tp=0,zu=0,Pc=null,PP=0;function oi(){throw Error(n(321))}function Jb(c,p){if(p===null)return!1;for(var v=0;v<p.length&&v<c.length;v++)if(!jn(c[v],p[v]))return!1;return!0}function ev(c,p,v,S,M,R){return pa=R,hr=p,p.memoizedState=null,p.updateQueue=null,p.lanes=0,$.H=c===null||c.memoizedState===null?D2:gv,Cl=!1,R=v(S,M),Cl=!1,$c&&(R=t2(p,v,S,M)),e2(c),R}function e2(c){$.H=Uu;var p=qr!==null&&qr.next!==null;if(pa=0,mi=qr=hr=null,Sp=!1,zu=0,Pc=null,p)throw Error(n(300));c===null||yi||(c=c.dependencies,c!==null&&mp(c)&&(yi=!0))}function t2(c,p,v,S){hr=c;var M=0;do{if($c&&(Pc=null),zu=0,$c=!1,25<=M)throw Error(n(301));if(M+=1,mi=qr=null,c.updateQueue!=null){var R=c.updateQueue;R.lastEffect=null,R.events=null,R.stores=null,R.memoCache!=null&&(R.memoCache.index=0)}$.H=I2,R=p(v,S)}while($c);return R}function zP(){var c=$.H,p=c.useState()[0];return p=typeof p.then=="function"?qu(p):p,c=c.useState()[0],(qr!==null?qr.memoizedState:null)!==c&&(hr.flags|=1024),p}function tv(){var c=Tp!==0;return Tp=0,c}function rv(c,p,v){p.updateQueue=c.updateQueue,p.flags&=-2053,c.lanes&=~v}function iv(c){if(Sp){for(c=c.memoizedState;c!==null;){var p=c.queue;p!==null&&(p.pending=null),c=c.next}Sp=!1}pa=0,mi=qr=hr=null,$c=!1,zu=Tp=0,Pc=null}function tn(){var c={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return mi===null?hr.memoizedState=mi=c:mi=mi.next=c,mi}function fi(){if(qr===null){var c=hr.alternate;c=c!==null?c.memoizedState:null}else c=qr.next;var p=mi===null?hr.memoizedState:mi.next;if(p!==null)mi=p,qr=c;else{if(c===null)throw hr.alternate===null?Error(n(467)):Error(n(310));qr=c,c={memoizedState:qr.memoizedState,baseState:qr.baseState,baseQueue:qr.baseQueue,queue:qr.queue,next:null},mi===null?hr.memoizedState=mi=c:mi=mi.next=c}return mi}function Ep(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function qu(c){var p=zu;return zu+=1,Pc===null&&(Pc=[]),c=WS(Pc,c,p),p=hr,(mi===null?p.memoizedState:mi.next)===null&&(p=p.alternate,$.H=p===null||p.memoizedState===null?D2:gv),c}function Np(c){if(c!==null&&typeof c=="object"){if(typeof c.then=="function")return qu(c);if(c.$$typeof===k)return Di(c)}throw Error(n(438,String(c)))}function nv(c){var p=null,v=hr.updateQueue;if(v!==null&&(p=v.memoCache),p==null){var S=hr.alternate;S!==null&&(S=S.updateQueue,S!==null&&(S=S.memoCache,S!=null&&(p={data:S.data.map(function(M){return M.slice()}),index:0})))}if(p==null&&(p={data:[],index:0}),v===null&&(v=Ep(),hr.updateQueue=v),v.memoCache=p,v=p.data[p.index],v===void 0)for(v=p.data[p.index]=Array(c),S=0;S<c;S++)v[S]=O;return p.index++,v}function ga(c,p){return typeof p=="function"?p(c):p}function jp(c){var p=fi();return sv(p,qr,c)}function sv(c,p,v){var S=c.queue;if(S===null)throw Error(n(311));S.lastRenderedReducer=v;var M=c.baseQueue,R=S.pending;if(R!==null){if(M!==null){var Y=M.next;M.next=R.next,R.next=Y}p.baseQueue=M=R,S.pending=null}if(R=c.baseState,M===null)c.memoizedState=R;else{p=M.next;var te=Y=null,pe=null,Le=p,Ge=!1;do{var Qe=Le.lane&-536870913;if(Qe!==Le.lane?(_r&Qe)===Qe:(pa&Qe)===Qe){var Oe=Le.revertLane;if(Oe===0)pe!==null&&(pe=pe.next={lane:0,revertLane:0,gesture:null,action:Le.action,hasEagerState:Le.hasEagerState,eagerState:Le.eagerState,next:null}),Qe===Bc&&(Ge=!0);else if((pa&Oe)===Oe){Le=Le.next,Oe===Bc&&(Ge=!0);continue}else Qe={lane:0,revertLane:Le.revertLane,gesture:null,action:Le.action,hasEagerState:Le.hasEagerState,eagerState:Le.eagerState,next:null},pe===null?(te=pe=Qe,Y=R):pe=pe.next=Qe,hr.lanes|=Oe,fo|=Oe;Qe=Le.action,Cl&&v(R,Qe),R=Le.hasEagerState?Le.eagerState:v(R,Qe)}else Oe={lane:Qe,revertLane:Le.revertLane,gesture:Le.gesture,action:Le.action,hasEagerState:Le.hasEagerState,eagerState:Le.eagerState,next:null},pe===null?(te=pe=Oe,Y=R):pe=pe.next=Oe,hr.lanes|=Qe,fo|=Qe;Le=Le.next}while(Le!==null&&Le!==p);if(pe===null?Y=R:pe.next=te,!jn(R,c.memoizedState)&&(yi=!0,Ge&&(v=Oc,v!==null)))throw v;c.memoizedState=R,c.baseState=Y,c.baseQueue=pe,S.lastRenderedState=R}return M===null&&(S.lanes=0),[c.memoizedState,S.dispatch]}function av(c){var p=fi(),v=p.queue;if(v===null)throw Error(n(311));v.lastRenderedReducer=c;var S=v.dispatch,M=v.pending,R=p.memoizedState;if(M!==null){v.pending=null;var Y=M=M.next;do R=c(R,Y.action),Y=Y.next;while(Y!==M);jn(R,p.memoizedState)||(yi=!0),p.memoizedState=R,p.baseQueue===null&&(p.baseState=R),v.lastRenderedState=R}return[R,S]}function r2(c,p,v){var S=hr,M=fi(),R=Sr;if(R){if(v===void 0)throw Error(n(407));v=v()}else v=p();var Y=!jn((qr||M).memoizedState,v);if(Y&&(M.memoizedState=v,yi=!0),M=M.queue,cv(s2.bind(null,S,M,c),[c]),M.getSnapshot!==p||Y||mi!==null&&mi.memoizedState.tag&1){if(S.flags|=2048,zc(9,{destroy:void 0},n2.bind(null,S,M,v,p),null),Wr===null)throw Error(n(349));R||(pa&127)!==0||i2(S,p,v)}return v}function i2(c,p,v){c.flags|=16384,c={getSnapshot:p,value:v},p=hr.updateQueue,p===null?(p=Ep(),hr.updateQueue=p,p.stores=[c]):(v=p.stores,v===null?p.stores=[c]:v.push(c))}function n2(c,p,v,S){p.value=v,p.getSnapshot=S,a2(p)&&o2(c)}function s2(c,p,v){return v(function(){a2(p)&&o2(c)})}function a2(c){var p=c.getSnapshot;c=c.value;try{var v=p();return!jn(c,v)}catch{return!0}}function o2(c){var p=fl(c,2);p!==null&&xn(p,c,2)}function ov(c){var p=tn();if(typeof c=="function"){var v=c;if(c=v(),Cl){dt(!0);try{v()}finally{dt(!1)}}}return p.memoizedState=p.baseState=c,p.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ga,lastRenderedState:c},p}function l2(c,p,v,S){return c.baseState=v,sv(c,qr,typeof S=="function"?S:ga)}function qP(c,p,v,S,M){if(Lp(c))throw Error(n(485));if(c=p.action,c!==null){var R={payload:M,action:c,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(Y){R.listeners.push(Y)}};$.T!==null?v(!0):R.isTransition=!1,S(R),v=p.pending,v===null?(R.next=p.pending=R,c2(p,R)):(R.next=v.next,p.pending=v.next=R)}}function c2(c,p){var v=p.action,S=p.payload,M=c.state;if(p.isTransition){var R=$.T,Y={};$.T=Y;try{var te=v(M,S),pe=$.S;pe!==null&&pe(Y,te),h2(c,p,te)}catch(Le){lv(c,p,Le)}finally{R!==null&&Y.types!==null&&(R.types=Y.types),$.T=R}}else try{R=v(M,S),h2(c,p,R)}catch(Le){lv(c,p,Le)}}function h2(c,p,v){v!==null&&typeof v=="object"&&typeof v.then=="function"?v.then(function(S){u2(c,p,S)},function(S){return lv(c,p,S)}):u2(c,p,v)}function u2(c,p,v){p.status="fulfilled",p.value=v,d2(p),c.state=v,p=c.pending,p!==null&&(v=p.next,v===p?c.pending=null:(v=v.next,p.next=v,c2(c,v)))}function lv(c,p,v){var S=c.pending;if(c.pending=null,S!==null){S=S.next;do p.status="rejected",p.reason=v,d2(p),p=p.next;while(p!==S)}c.action=null}function d2(c){c=c.listeners;for(var p=0;p<c.length;p++)(0,c[p])()}function f2(c,p){return p}function p2(c,p){if(Sr){var v=Wr.formState;if(v!==null){e:{var S=hr;if(Sr){if(Vr){t:{for(var M=Vr,R=Qn;M.nodeType!==8;){if(!R){M=null;break t}if(M=es(M.nextSibling),M===null){M=null;break t}}R=M.data,M=R==="F!"||R==="F"?M:null}if(M){Vr=es(M.nextSibling),S=M.data==="F!";break e}}io(S)}S=!1}S&&(p=v[0])}}return v=tn(),v.memoizedState=v.baseState=p,S={pending:null,lanes:0,dispatch:null,lastRenderedReducer:f2,lastRenderedState:p},v.queue=S,v=R2.bind(null,hr,S),S.dispatch=v,S=ov(!1),R=pv.bind(null,hr,!1,S.queue),S=tn(),M={state:p,dispatch:null,action:c,pending:null},S.queue=M,v=qP.bind(null,hr,M,R,v),M.dispatch=v,S.memoizedState=c,[p,v,!1]}function g2(c){var p=fi();return m2(p,qr,c)}function m2(c,p,v){if(p=sv(c,p,f2)[0],c=jp(ga)[0],typeof p=="object"&&p!==null&&typeof p.then=="function")try{var S=qu(p)}catch(Y){throw Y===Dc?vp:Y}else S=p;p=fi();var M=p.queue,R=M.dispatch;return v!==p.memoizedState&&(hr.flags|=2048,zc(9,{destroy:void 0},HP.bind(null,M,v),null)),[S,R,c]}function HP(c,p){c.action=p}function y2(c){var p=fi(),v=qr;if(v!==null)return m2(p,v,c);fi(),p=p.memoizedState,v=fi();var S=v.queue.dispatch;return v.memoizedState=c,[p,S,!1]}function zc(c,p,v,S){return c={tag:c,create:v,deps:S,inst:p,next:null},p=hr.updateQueue,p===null&&(p=Ep(),hr.updateQueue=p),v=p.lastEffect,v===null?p.lastEffect=c.next=c:(S=v.next,v.next=c,c.next=S,p.lastEffect=c),c}function b2(){return fi().memoizedState}function Ap(c,p,v,S){var M=tn();hr.flags|=c,M.memoizedState=zc(1|p,{destroy:void 0},v,S===void 0?null:S)}function Mp(c,p,v,S){var M=fi();S=S===void 0?null:S;var R=M.memoizedState.inst;qr!==null&&S!==null&&Jb(S,qr.memoizedState.deps)?M.memoizedState=zc(p,R,v,S):(hr.flags|=c,M.memoizedState=zc(1|p,R,v,S))}function v2(c,p){Ap(8390656,8,c,p)}function cv(c,p){Mp(2048,8,c,p)}function UP(c){hr.flags|=4;var p=hr.updateQueue;if(p===null)p=Ep(),hr.updateQueue=p,p.events=[c];else{var v=p.events;v===null?p.events=[c]:v.push(c)}}function x2(c){var p=fi().memoizedState;return UP({ref:p,nextImpl:c}),function(){if((Rr&2)!==0)throw Error(n(440));return p.impl.apply(void 0,arguments)}}function _2(c,p){return Mp(4,2,c,p)}function C2(c,p){return Mp(4,4,c,p)}function w2(c,p){if(typeof p=="function"){c=c();var v=p(c);return function(){typeof v=="function"?v():p(null)}}if(p!=null)return c=c(),p.current=c,function(){p.current=null}}function k2(c,p,v){v=v!=null?v.concat([c]):null,Mp(4,4,w2.bind(null,p,c),v)}function hv(){}function S2(c,p){var v=fi();p=p===void 0?null:p;var S=v.memoizedState;return p!==null&&Jb(p,S[1])?S[0]:(v.memoizedState=[c,p],c)}function T2(c,p){var v=fi();p=p===void 0?null:p;var S=v.memoizedState;if(p!==null&&Jb(p,S[1]))return S[0];if(S=c(),Cl){dt(!0);try{c()}finally{dt(!1)}}return v.memoizedState=[S,p],S}function uv(c,p,v){return v===void 0||(pa&1073741824)!==0&&(_r&261930)===0?c.memoizedState=p:(c.memoizedState=v,c=ET(),hr.lanes|=c,fo|=c,v)}function E2(c,p,v,S){return jn(v,p)?v:Fc.current!==null?(c=uv(c,v,S),jn(c,p)||(yi=!0),c):(pa&42)===0||(pa&1073741824)!==0&&(_r&261930)===0?(yi=!0,c.memoizedState=v):(c=ET(),hr.lanes|=c,fo|=c,p)}function N2(c,p,v,S,M){var R=W.p;W.p=R!==0&&8>R?R:8;var Y=$.T,te={};$.T=te,pv(c,!1,p,v);try{var pe=M(),Le=$.S;if(Le!==null&&Le(te,pe),pe!==null&&typeof pe=="object"&&typeof pe.then=="function"){var Ge=$P(pe,S);Hu(c,p,Ge,On(c))}else Hu(c,p,S,On(c))}catch(Qe){Hu(c,p,{then:function(){},status:"rejected",reason:Qe},On())}finally{W.p=R,Y!==null&&te.types!==null&&(Y.types=te.types),$.T=Y}}function WP(){}function dv(c,p,v,S){if(c.tag!==5)throw Error(n(476));var M=j2(c).queue;N2(c,M,p,V,v===null?WP:function(){return A2(c),v(S)})}function j2(c){var p=c.memoizedState;if(p!==null)return p;p={memoizedState:V,baseState:V,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ga,lastRenderedState:V},next:null};var v={};return p.next={memoizedState:v,baseState:v,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ga,lastRenderedState:v},next:null},c.memoizedState=p,c=c.alternate,c!==null&&(c.memoizedState=p),p}function A2(c){var p=j2(c);p.next===null&&(p=c.alternate.memoizedState),Hu(c,p.next.queue,{},On())}function fv(){return Di(ad)}function M2(){return fi().memoizedState}function L2(){return fi().memoizedState}function GP(c){for(var p=c.return;p!==null;){switch(p.tag){case 24:case 3:var v=On();c=ao(v);var S=oo(p,c,v);S!==null&&(xn(S,p,v),Fu(S,p,v)),p={cache:qb()},c.payload=p;return}p=p.return}}function KP(c,p,v){var S=On();v={lane:S,revertLane:0,gesture:null,action:v,hasEagerState:!1,eagerState:null,next:null},Lp(c)?B2(p,v):(v=Mb(c,p,v,S),v!==null&&(xn(v,c,S),O2(v,p,S)))}function R2(c,p,v){var S=On();Hu(c,p,v,S)}function Hu(c,p,v,S){var M={lane:S,revertLane:0,gesture:null,action:v,hasEagerState:!1,eagerState:null,next:null};if(Lp(c))B2(p,M);else{var R=c.alternate;if(c.lanes===0&&(R===null||R.lanes===0)&&(R=p.lastRenderedReducer,R!==null))try{var Y=p.lastRenderedState,te=R(Y,v);if(M.hasEagerState=!0,M.eagerState=te,jn(te,Y))return dp(c,p,M,0),Wr===null&&up(),!1}catch{}finally{}if(v=Mb(c,p,M,S),v!==null)return xn(v,c,S),O2(v,p,S),!0}return!1}function pv(c,p,v,S){if(S={lane:2,revertLane:Gv(),gesture:null,action:S,hasEagerState:!1,eagerState:null,next:null},Lp(c)){if(p)throw Error(n(479))}else p=Mb(c,v,S,2),p!==null&&xn(p,c,2)}function Lp(c){var p=c.alternate;return c===hr||p!==null&&p===hr}function B2(c,p){$c=Sp=!0;var v=c.pending;v===null?p.next=p:(p.next=v.next,v.next=p),c.pending=p}function O2(c,p,v){if((v&4194048)!==0){var S=p.lanes;S&=c.pendingLanes,v|=S,p.lanes=v,qe(c,v)}}var Uu={readContext:Di,use:Np,useCallback:oi,useContext:oi,useEffect:oi,useImperativeHandle:oi,useLayoutEffect:oi,useInsertionEffect:oi,useMemo:oi,useReducer:oi,useRef:oi,useState:oi,useDebugValue:oi,useDeferredValue:oi,useTransition:oi,useSyncExternalStore:oi,useId:oi,useHostTransitionStatus:oi,useFormState:oi,useActionState:oi,useOptimistic:oi,useMemoCache:oi,useCacheRefresh:oi};Uu.useEffectEvent=oi;var D2={readContext:Di,use:Np,useCallback:function(c,p){return tn().memoizedState=[c,p===void 0?null:p],c},useContext:Di,useEffect:v2,useImperativeHandle:function(c,p,v){v=v!=null?v.concat([c]):null,Ap(4194308,4,w2.bind(null,p,c),v)},useLayoutEffect:function(c,p){return Ap(4194308,4,c,p)},useInsertionEffect:function(c,p){Ap(4,2,c,p)},useMemo:function(c,p){var v=tn();p=p===void 0?null:p;var S=c();if(Cl){dt(!0);try{c()}finally{dt(!1)}}return v.memoizedState=[S,p],S},useReducer:function(c,p,v){var S=tn();if(v!==void 0){var M=v(p);if(Cl){dt(!0);try{v(p)}finally{dt(!1)}}}else M=p;return S.memoizedState=S.baseState=M,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:M},S.queue=c,c=c.dispatch=KP.bind(null,hr,c),[S.memoizedState,c]},useRef:function(c){var p=tn();return c={current:c},p.memoizedState=c},useState:function(c){c=ov(c);var p=c.queue,v=R2.bind(null,hr,p);return p.dispatch=v,[c.memoizedState,v]},useDebugValue:hv,useDeferredValue:function(c,p){var v=tn();return uv(v,c,p)},useTransition:function(){var c=ov(!1);return c=N2.bind(null,hr,c.queue,!0,!1),tn().memoizedState=c,[!1,c]},useSyncExternalStore:function(c,p,v){var S=hr,M=tn();if(Sr){if(v===void 0)throw Error(n(407));v=v()}else{if(v=p(),Wr===null)throw Error(n(349));(_r&127)!==0||i2(S,p,v)}M.memoizedState=v;var R={value:v,getSnapshot:p};return M.queue=R,v2(s2.bind(null,S,R,c),[c]),S.flags|=2048,zc(9,{destroy:void 0},n2.bind(null,S,R,v,p),null),v},useId:function(){var c=tn(),p=Wr.identifierPrefix;if(Sr){var v=Is,S=Ds;v=(S&~(1<<32-at(S)-1)).toString(32)+v,p="_"+p+"R_"+v,v=Tp++,0<v&&(p+="H"+v.toString(32)),p+="_"}else v=PP++,p="_"+p+"r_"+v.toString(32)+"_";return c.memoizedState=p},useHostTransitionStatus:fv,useFormState:p2,useActionState:p2,useOptimistic:function(c){var p=tn();p.memoizedState=p.baseState=c;var v={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return p.queue=v,p=pv.bind(null,hr,!0,v),v.dispatch=p,[c,p]},useMemoCache:nv,useCacheRefresh:function(){return tn().memoizedState=GP.bind(null,hr)},useEffectEvent:function(c){var p=tn(),v={impl:c};return p.memoizedState=v,function(){if((Rr&2)!==0)throw Error(n(440));return v.impl.apply(void 0,arguments)}}},gv={readContext:Di,use:Np,useCallback:S2,useContext:Di,useEffect:cv,useImperativeHandle:k2,useInsertionEffect:_2,useLayoutEffect:C2,useMemo:T2,useReducer:jp,useRef:b2,useState:function(){return jp(ga)},useDebugValue:hv,useDeferredValue:function(c,p){var v=fi();return E2(v,qr.memoizedState,c,p)},useTransition:function(){var c=jp(ga)[0],p=fi().memoizedState;return[typeof c=="boolean"?c:qu(c),p]},useSyncExternalStore:r2,useId:M2,useHostTransitionStatus:fv,useFormState:g2,useActionState:g2,useOptimistic:function(c,p){var v=fi();return l2(v,qr,c,p)},useMemoCache:nv,useCacheRefresh:L2};gv.useEffectEvent=x2;var I2={readContext:Di,use:Np,useCallback:S2,useContext:Di,useEffect:cv,useImperativeHandle:k2,useInsertionEffect:_2,useLayoutEffect:C2,useMemo:T2,useReducer:av,useRef:b2,useState:function(){return av(ga)},useDebugValue:hv,useDeferredValue:function(c,p){var v=fi();return qr===null?uv(v,c,p):E2(v,qr.memoizedState,c,p)},useTransition:function(){var c=av(ga)[0],p=fi().memoizedState;return[typeof c=="boolean"?c:qu(c),p]},useSyncExternalStore:r2,useId:M2,useHostTransitionStatus:fv,useFormState:y2,useActionState:y2,useOptimistic:function(c,p){var v=fi();return qr!==null?l2(v,qr,c,p):(v.baseState=c,[c,v.queue.dispatch])},useMemoCache:nv,useCacheRefresh:L2};I2.useEffectEvent=x2;function mv(c,p,v,S){p=c.memoizedState,v=v(S,p),v=v==null?p:f({},p,v),c.memoizedState=v,c.lanes===0&&(c.updateQueue.baseState=v)}var yv={enqueueSetState:function(c,p,v){c=c._reactInternals;var S=On(),M=ao(S);M.payload=p,v!=null&&(M.callback=v),p=oo(c,M,S),p!==null&&(xn(p,c,S),Fu(p,c,S))},enqueueReplaceState:function(c,p,v){c=c._reactInternals;var S=On(),M=ao(S);M.tag=1,M.payload=p,v!=null&&(M.callback=v),p=oo(c,M,S),p!==null&&(xn(p,c,S),Fu(p,c,S))},enqueueForceUpdate:function(c,p){c=c._reactInternals;var v=On(),S=ao(v);S.tag=2,p!=null&&(S.callback=p),p=oo(c,S,v),p!==null&&(xn(p,c,v),Fu(p,c,v))}};function F2(c,p,v,S,M,R,Y){return c=c.stateNode,typeof c.shouldComponentUpdate=="function"?c.shouldComponentUpdate(S,R,Y):p.prototype&&p.prototype.isPureReactComponent?!Au(v,S)||!Au(M,R):!0}function $2(c,p,v,S){c=p.state,typeof p.componentWillReceiveProps=="function"&&p.componentWillReceiveProps(v,S),typeof p.UNSAFE_componentWillReceiveProps=="function"&&p.UNSAFE_componentWillReceiveProps(v,S),p.state!==c&&yv.enqueueReplaceState(p,p.state,null)}function wl(c,p){var v=p;if("ref"in p){v={};for(var S in p)S!=="ref"&&(v[S]=p[S])}if(c=c.defaultProps){v===p&&(v=f({},v));for(var M in c)v[M]===void 0&&(v[M]=c[M])}return v}function P2(c){hp(c)}function z2(c){console.error(c)}function q2(c){hp(c)}function Rp(c,p){try{var v=c.onUncaughtError;v(p.value,{componentStack:p.stack})}catch(S){setTimeout(function(){throw S})}}function H2(c,p,v){try{var S=c.onCaughtError;S(v.value,{componentStack:v.stack,errorBoundary:p.tag===1?p.stateNode:null})}catch(M){setTimeout(function(){throw M})}}function bv(c,p,v){return v=ao(v),v.tag=3,v.payload={element:null},v.callback=function(){Rp(c,p)},v}function U2(c){return c=ao(c),c.tag=3,c}function W2(c,p,v,S){var M=v.type.getDerivedStateFromError;if(typeof M=="function"){var R=S.value;c.payload=function(){return M(R)},c.callback=function(){H2(p,v,S)}}var Y=v.stateNode;Y!==null&&typeof Y.componentDidCatch=="function"&&(c.callback=function(){H2(p,v,S),typeof M!="function"&&(po===null?po=new Set([this]):po.add(this));var te=S.stack;this.componentDidCatch(S.value,{componentStack:te!==null?te:""})})}function VP(c,p,v,S,M){if(v.flags|=32768,S!==null&&typeof S=="object"&&typeof S.then=="function"){if(p=v.alternate,p!==null&&Rc(p,v,M,!0),v=Mn.current,v!==null){switch(v.tag){case 31:case 13:return Jn===null?Wp():v.alternate===null&&li===0&&(li=3),v.flags&=-257,v.flags|=65536,v.lanes=M,S===xp?v.flags|=16384:(p=v.updateQueue,p===null?v.updateQueue=new Set([S]):p.add(S),Hv(c,S,M)),!1;case 22:return v.flags|=65536,S===xp?v.flags|=16384:(p=v.updateQueue,p===null?(p={transitions:null,markerInstances:null,retryQueue:new Set([S])},v.updateQueue=p):(v=p.retryQueue,v===null?p.retryQueue=new Set([S]):v.add(S)),Hv(c,S,M)),!1}throw Error(n(435,v.tag))}return Hv(c,S,M),Wp(),!1}if(Sr)return p=Mn.current,p!==null?((p.flags&65536)===0&&(p.flags|=256),p.flags|=65536,p.lanes=M,S!==Ib&&(c=Error(n(422),{cause:S}),Ru(Yn(c,v)))):(S!==Ib&&(p=Error(n(423),{cause:S}),Ru(Yn(p,v))),c=c.current.alternate,c.flags|=65536,M&=-M,c.lanes|=M,S=Yn(S,v),M=bv(c.stateNode,S,M),Vb(c,M),li!==4&&(li=2)),!1;var R=Error(n(520),{cause:S});if(R=Yn(R,v),Qu===null?Qu=[R]:Qu.push(R),li!==4&&(li=2),p===null)return!0;S=Yn(S,v),v=p;do{switch(v.tag){case 3:return v.flags|=65536,c=M&-M,v.lanes|=c,c=bv(v.stateNode,S,c),Vb(v,c),!1;case 1:if(p=v.type,R=v.stateNode,(v.flags&128)===0&&(typeof p.getDerivedStateFromError=="function"||R!==null&&typeof R.componentDidCatch=="function"&&(po===null||!po.has(R))))return v.flags|=65536,M&=-M,v.lanes|=M,M=U2(M),W2(M,c,v,S),Vb(v,M),!1}v=v.return}while(v!==null);return!1}var vv=Error(n(461)),yi=!1;function Ii(c,p,v,S){p.child=c===null?YS(p,null,v,S):_l(p,c.child,v,S)}function G2(c,p,v,S,M){v=v.render;var R=p.ref;if("ref"in S){var Y={};for(var te in S)te!=="ref"&&(Y[te]=S[te])}else Y=S;return yl(p),S=ev(c,p,v,Y,R,M),te=tv(),c!==null&&!yi?(rv(c,p,M),ma(c,p,M)):(Sr&&te&&Ob(p),p.flags|=1,Ii(c,p,S,M),p.child)}function K2(c,p,v,S,M){if(c===null){var R=v.type;return typeof R=="function"&&!Lb(R)&&R.defaultProps===void 0&&v.compare===null?(p.tag=15,p.type=R,V2(c,p,R,S,M)):(c=pp(v.type,null,S,p,p.mode,M),c.ref=p.ref,c.return=p,p.child=c)}if(R=c.child,!Ev(c,M)){var Y=R.memoizedProps;if(v=v.compare,v=v!==null?v:Au,v(Y,S)&&c.ref===p.ref)return ma(c,p,M)}return p.flags|=1,c=ha(R,S),c.ref=p.ref,c.return=p,p.child=c}function V2(c,p,v,S,M){if(c!==null){var R=c.memoizedProps;if(Au(R,S)&&c.ref===p.ref)if(yi=!1,p.pendingProps=S=R,Ev(c,M))(c.flags&131072)!==0&&(yi=!0);else return p.lanes=c.lanes,ma(c,p,M)}return xv(c,p,v,S,M)}function Y2(c,p,v,S){var M=S.children,R=c!==null?c.memoizedState:null;if(c===null&&p.stateNode===null&&(p.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),S.mode==="hidden"){if((p.flags&128)!==0){if(R=R!==null?R.baseLanes|v:v,c!==null){for(S=p.child=c.child,M=0;S!==null;)M=M|S.lanes|S.childLanes,S=S.sibling;S=M&~R}else S=0,p.child=null;return X2(c,p,R,v,S)}if((v&536870912)!==0)p.memoizedState={baseLanes:0,cachePool:null},c!==null&&bp(p,R!==null?R.cachePool:null),R!==null?QS(p,R):Xb(),JS(p);else return S=p.lanes=536870912,X2(c,p,R!==null?R.baseLanes|v:v,v,S)}else R!==null?(bp(p,R.cachePool),QS(p,R),co(),p.memoizedState=null):(c!==null&&bp(p,null),Xb(),co());return Ii(c,p,M,v),p.child}function Wu(c,p){return c!==null&&c.tag===22||p.stateNode!==null||(p.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),p.sibling}function X2(c,p,v,S,M){var R=Ub();return R=R===null?null:{parent:gi._currentValue,pool:R},p.memoizedState={baseLanes:v,cachePool:R},c!==null&&bp(p,null),Xb(),JS(p),c!==null&&Rc(c,p,S,!0),p.childLanes=M,null}function Bp(c,p){return p=Dp({mode:p.mode,children:p.children},c.mode),p.ref=c.ref,c.child=p,p.return=c,p}function Z2(c,p,v){return _l(p,c.child,null,v),c=Bp(p,p.pendingProps),c.flags|=2,Ln(p),p.memoizedState=null,c}function YP(c,p,v){var S=p.pendingProps,M=(p.flags&128)!==0;if(p.flags&=-129,c===null){if(Sr){if(S.mode==="hidden")return c=Bp(p,S),p.lanes=536870912,Wu(null,c);if(Qb(p),(c=Vr)?(c=cE(c,Qn),c=c!==null&&c.data==="&"?c:null,c!==null&&(p.memoizedState={dehydrated:c,treeContext:to!==null?{id:Ds,overflow:Is}:null,retryLane:536870912,hydrationErrors:null},v=BS(c),v.return=p,p.child=v,Oi=p,Vr=null)):c=null,c===null)throw io(p);return p.lanes=536870912,null}return Bp(p,S)}var R=c.memoizedState;if(R!==null){var Y=R.dehydrated;if(Qb(p),M)if(p.flags&256)p.flags&=-257,p=Z2(c,p,v);else if(p.memoizedState!==null)p.child=c.child,p.flags|=128,p=null;else throw Error(n(558));else if(yi||Rc(c,p,v,!1),M=(v&c.childLanes)!==0,yi||M){if(S=Wr,S!==null&&(Y=kt(S,v),Y!==0&&Y!==R.retryLane))throw R.retryLane=Y,fl(c,Y),xn(S,c,Y),vv;Wp(),p=Z2(c,p,v)}else c=R.treeContext,Vr=es(Y.nextSibling),Oi=p,Sr=!0,ro=null,Qn=!1,c!==null&&IS(p,c),p=Bp(p,S),p.flags|=4096;return p}return c=ha(c.child,{mode:S.mode,children:S.children}),c.ref=p.ref,p.child=c,c.return=p,c}function Op(c,p){var v=p.ref;if(v===null)c!==null&&c.ref!==null&&(p.flags|=4194816);else{if(typeof v!="function"&&typeof v!="object")throw Error(n(284));(c===null||c.ref!==v)&&(p.flags|=4194816)}}function xv(c,p,v,S,M){return yl(p),v=ev(c,p,v,S,void 0,M),S=tv(),c!==null&&!yi?(rv(c,p,M),ma(c,p,M)):(Sr&&S&&Ob(p),p.flags|=1,Ii(c,p,v,M),p.child)}function Q2(c,p,v,S,M,R){return yl(p),p.updateQueue=null,v=t2(p,S,v,M),e2(c),S=tv(),c!==null&&!yi?(rv(c,p,R),ma(c,p,R)):(Sr&&S&&Ob(p),p.flags|=1,Ii(c,p,v,R),p.child)}function J2(c,p,v,S,M){if(yl(p),p.stateNode===null){var R=jc,Y=v.contextType;typeof Y=="object"&&Y!==null&&(R=Di(Y)),R=new v(S,R),p.memoizedState=R.state!==null&&R.state!==void 0?R.state:null,R.updater=yv,p.stateNode=R,R._reactInternals=p,R=p.stateNode,R.props=S,R.state=p.memoizedState,R.refs={},Gb(p),Y=v.contextType,R.context=typeof Y=="object"&&Y!==null?Di(Y):jc,R.state=p.memoizedState,Y=v.getDerivedStateFromProps,typeof Y=="function"&&(mv(p,v,Y,S),R.state=p.memoizedState),typeof v.getDerivedStateFromProps=="function"||typeof R.getSnapshotBeforeUpdate=="function"||typeof R.UNSAFE_componentWillMount!="function"&&typeof R.componentWillMount!="function"||(Y=R.state,typeof R.componentWillMount=="function"&&R.componentWillMount(),typeof R.UNSAFE_componentWillMount=="function"&&R.UNSAFE_componentWillMount(),Y!==R.state&&yv.enqueueReplaceState(R,R.state,null),Pu(p,S,R,M),$u(),R.state=p.memoizedState),typeof R.componentDidMount=="function"&&(p.flags|=4194308),S=!0}else if(c===null){R=p.stateNode;var te=p.memoizedProps,pe=wl(v,te);R.props=pe;var Le=R.context,Ge=v.contextType;Y=jc,typeof Ge=="object"&&Ge!==null&&(Y=Di(Ge));var Qe=v.getDerivedStateFromProps;Ge=typeof Qe=="function"||typeof R.getSnapshotBeforeUpdate=="function",te=p.pendingProps!==te,Ge||typeof R.UNSAFE_componentWillReceiveProps!="function"&&typeof R.componentWillReceiveProps!="function"||(te||Le!==Y)&&$2(p,R,S,Y),so=!1;var Oe=p.memoizedState;R.state=Oe,Pu(p,S,R,M),$u(),Le=p.memoizedState,te||Oe!==Le||so?(typeof Qe=="function"&&(mv(p,v,Qe,S),Le=p.memoizedState),(pe=so||F2(p,v,pe,S,Oe,Le,Y))?(Ge||typeof R.UNSAFE_componentWillMount!="function"&&typeof R.componentWillMount!="function"||(typeof R.componentWillMount=="function"&&R.componentWillMount(),typeof R.UNSAFE_componentWillMount=="function"&&R.UNSAFE_componentWillMount()),typeof R.componentDidMount=="function"&&(p.flags|=4194308)):(typeof R.componentDidMount=="function"&&(p.flags|=4194308),p.memoizedProps=S,p.memoizedState=Le),R.props=S,R.state=Le,R.context=Y,S=pe):(typeof R.componentDidMount=="function"&&(p.flags|=4194308),S=!1)}else{R=p.stateNode,Kb(c,p),Y=p.memoizedProps,Ge=wl(v,Y),R.props=Ge,Qe=p.pendingProps,Oe=R.context,Le=v.contextType,pe=jc,typeof Le=="object"&&Le!==null&&(pe=Di(Le)),te=v.getDerivedStateFromProps,(Le=typeof te=="function"||typeof R.getSnapshotBeforeUpdate=="function")||typeof R.UNSAFE_componentWillReceiveProps!="function"&&typeof R.componentWillReceiveProps!="function"||(Y!==Qe||Oe!==pe)&&$2(p,R,S,pe),so=!1,Oe=p.memoizedState,R.state=Oe,Pu(p,S,R,M),$u();var Pe=p.memoizedState;Y!==Qe||Oe!==Pe||so||c!==null&&c.dependencies!==null&&mp(c.dependencies)?(typeof te=="function"&&(mv(p,v,te,S),Pe=p.memoizedState),(Ge=so||F2(p,v,Ge,S,Oe,Pe,pe)||c!==null&&c.dependencies!==null&&mp(c.dependencies))?(Le||typeof R.UNSAFE_componentWillUpdate!="function"&&typeof R.componentWillUpdate!="function"||(typeof R.componentWillUpdate=="function"&&R.componentWillUpdate(S,Pe,pe),typeof R.UNSAFE_componentWillUpdate=="function"&&R.UNSAFE_componentWillUpdate(S,Pe,pe)),typeof R.componentDidUpdate=="function"&&(p.flags|=4),typeof R.getSnapshotBeforeUpdate=="function"&&(p.flags|=1024)):(typeof R.componentDidUpdate!="function"||Y===c.memoizedProps&&Oe===c.memoizedState||(p.flags|=4),typeof R.getSnapshotBeforeUpdate!="function"||Y===c.memoizedProps&&Oe===c.memoizedState||(p.flags|=1024),p.memoizedProps=S,p.memoizedState=Pe),R.props=S,R.state=Pe,R.context=pe,S=Ge):(typeof R.componentDidUpdate!="function"||Y===c.memoizedProps&&Oe===c.memoizedState||(p.flags|=4),typeof R.getSnapshotBeforeUpdate!="function"||Y===c.memoizedProps&&Oe===c.memoizedState||(p.flags|=1024),S=!1)}return R=S,Op(c,p),S=(p.flags&128)!==0,R||S?(R=p.stateNode,v=S&&typeof v.getDerivedStateFromError!="function"?null:R.render(),p.flags|=1,c!==null&&S?(p.child=_l(p,c.child,null,M),p.child=_l(p,null,v,M)):Ii(c,p,v,M),p.memoizedState=R.state,c=p.child):c=ma(c,p,M),c}function eT(c,p,v,S){return gl(),p.flags|=256,Ii(c,p,v,S),p.child}var _v={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Cv(c){return{baseLanes:c,cachePool:HS()}}function wv(c,p,v){return c=c!==null?c.childLanes&~v:0,p&&(c|=Bn),c}function tT(c,p,v){var S=p.pendingProps,M=!1,R=(p.flags&128)!==0,Y;if((Y=R)||(Y=c!==null&&c.memoizedState===null?!1:(di.current&2)!==0),Y&&(M=!0,p.flags&=-129),Y=(p.flags&32)!==0,p.flags&=-33,c===null){if(Sr){if(M?lo(p):co(),(c=Vr)?(c=cE(c,Qn),c=c!==null&&c.data!=="&"?c:null,c!==null&&(p.memoizedState={dehydrated:c,treeContext:to!==null?{id:Ds,overflow:Is}:null,retryLane:536870912,hydrationErrors:null},v=BS(c),v.return=p,p.child=v,Oi=p,Vr=null)):c=null,c===null)throw io(p);return s0(c)?p.lanes=32:p.lanes=536870912,null}var te=S.children;return S=S.fallback,M?(co(),M=p.mode,te=Dp({mode:"hidden",children:te},M),S=pl(S,M,v,null),te.return=p,S.return=p,te.sibling=S,p.child=te,S=p.child,S.memoizedState=Cv(v),S.childLanes=wv(c,Y,v),p.memoizedState=_v,Wu(null,S)):(lo(p),kv(p,te))}var pe=c.memoizedState;if(pe!==null&&(te=pe.dehydrated,te!==null)){if(R)p.flags&256?(lo(p),p.flags&=-257,p=Sv(c,p,v)):p.memoizedState!==null?(co(),p.child=c.child,p.flags|=128,p=null):(co(),te=S.fallback,M=p.mode,S=Dp({mode:"visible",children:S.children},M),te=pl(te,M,v,null),te.flags|=2,S.return=p,te.return=p,S.sibling=te,p.child=S,_l(p,c.child,null,v),S=p.child,S.memoizedState=Cv(v),S.childLanes=wv(c,Y,v),p.memoizedState=_v,p=Wu(null,S));else if(lo(p),s0(te)){if(Y=te.nextSibling&&te.nextSibling.dataset,Y)var Le=Y.dgst;Y=Le,S=Error(n(419)),S.stack="",S.digest=Y,Ru({value:S,source:null,stack:null}),p=Sv(c,p,v)}else if(yi||Rc(c,p,v,!1),Y=(v&c.childLanes)!==0,yi||Y){if(Y=Wr,Y!==null&&(S=kt(Y,v),S!==0&&S!==pe.retryLane))throw pe.retryLane=S,fl(c,S),xn(Y,c,S),vv;n0(te)||Wp(),p=Sv(c,p,v)}else n0(te)?(p.flags|=192,p.child=c.child,p=null):(c=pe.treeContext,Vr=es(te.nextSibling),Oi=p,Sr=!0,ro=null,Qn=!1,c!==null&&IS(p,c),p=kv(p,S.children),p.flags|=4096);return p}return M?(co(),te=S.fallback,M=p.mode,pe=c.child,Le=pe.sibling,S=ha(pe,{mode:"hidden",children:S.children}),S.subtreeFlags=pe.subtreeFlags&65011712,Le!==null?te=ha(Le,te):(te=pl(te,M,v,null),te.flags|=2),te.return=p,S.return=p,S.sibling=te,p.child=S,Wu(null,S),S=p.child,te=c.child.memoizedState,te===null?te=Cv(v):(M=te.cachePool,M!==null?(pe=gi._currentValue,M=M.parent!==pe?{parent:pe,pool:pe}:M):M=HS(),te={baseLanes:te.baseLanes|v,cachePool:M}),S.memoizedState=te,S.childLanes=wv(c,Y,v),p.memoizedState=_v,Wu(c.child,S)):(lo(p),v=c.child,c=v.sibling,v=ha(v,{mode:"visible",children:S.children}),v.return=p,v.sibling=null,c!==null&&(Y=p.deletions,Y===null?(p.deletions=[c],p.flags|=16):Y.push(c)),p.child=v,p.memoizedState=null,v)}function kv(c,p){return p=Dp({mode:"visible",children:p},c.mode),p.return=c,c.child=p}function Dp(c,p){return c=An(22,c,null,p),c.lanes=0,c}function Sv(c,p,v){return _l(p,c.child,null,v),c=kv(p,p.pendingProps.children),c.flags|=2,p.memoizedState=null,c}function rT(c,p,v){c.lanes|=p;var S=c.alternate;S!==null&&(S.lanes|=p),Pb(c.return,p,v)}function Tv(c,p,v,S,M,R){var Y=c.memoizedState;Y===null?c.memoizedState={isBackwards:p,rendering:null,renderingStartTime:0,last:S,tail:v,tailMode:M,treeForkCount:R}:(Y.isBackwards=p,Y.rendering=null,Y.renderingStartTime=0,Y.last=S,Y.tail=v,Y.tailMode=M,Y.treeForkCount=R)}function iT(c,p,v){var S=p.pendingProps,M=S.revealOrder,R=S.tail;S=S.children;var Y=di.current,te=(Y&2)!==0;if(te?(Y=Y&1|2,p.flags|=128):Y&=1,ee(di,Y),Ii(c,p,S,v),S=Sr?Lu:0,!te&&c!==null&&(c.flags&128)!==0)e:for(c=p.child;c!==null;){if(c.tag===13)c.memoizedState!==null&&rT(c,v,p);else if(c.tag===19)rT(c,v,p);else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===p)break e;for(;c.sibling===null;){if(c.return===null||c.return===p)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}switch(M){case"forwards":for(v=p.child,M=null;v!==null;)c=v.alternate,c!==null&&kp(c)===null&&(M=v),v=v.sibling;v=M,v===null?(M=p.child,p.child=null):(M=v.sibling,v.sibling=null),Tv(p,!1,M,v,R,S);break;case"backwards":case"unstable_legacy-backwards":for(v=null,M=p.child,p.child=null;M!==null;){if(c=M.alternate,c!==null&&kp(c)===null){p.child=M;break}c=M.sibling,M.sibling=v,v=M,M=c}Tv(p,!0,v,null,R,S);break;case"together":Tv(p,!1,null,null,void 0,S);break;default:p.memoizedState=null}return p.child}function ma(c,p,v){if(c!==null&&(p.dependencies=c.dependencies),fo|=p.lanes,(v&p.childLanes)===0)if(c!==null){if(Rc(c,p,v,!1),(v&p.childLanes)===0)return null}else return null;if(c!==null&&p.child!==c.child)throw Error(n(153));if(p.child!==null){for(c=p.child,v=ha(c,c.pendingProps),p.child=v,v.return=p;c.sibling!==null;)c=c.sibling,v=v.sibling=ha(c,c.pendingProps),v.return=p;v.sibling=null}return p.child}function Ev(c,p){return(c.lanes&p)!==0?!0:(c=c.dependencies,!!(c!==null&&mp(c)))}function XP(c,p,v){switch(p.tag){case 3:I(p,p.stateNode.containerInfo),no(p,gi,c.memoizedState.cache),gl();break;case 27:case 5:J(p);break;case 4:I(p,p.stateNode.containerInfo);break;case 10:no(p,p.type,p.memoizedProps.value);break;case 31:if(p.memoizedState!==null)return p.flags|=128,Qb(p),null;break;case 13:var S=p.memoizedState;if(S!==null)return S.dehydrated!==null?(lo(p),p.flags|=128,null):(v&p.child.childLanes)!==0?tT(c,p,v):(lo(p),c=ma(c,p,v),c!==null?c.sibling:null);lo(p);break;case 19:var M=(c.flags&128)!==0;if(S=(v&p.childLanes)!==0,S||(Rc(c,p,v,!1),S=(v&p.childLanes)!==0),M){if(S)return iT(c,p,v);p.flags|=128}if(M=p.memoizedState,M!==null&&(M.rendering=null,M.tail=null,M.lastEffect=null),ee(di,di.current),S)break;return null;case 22:return p.lanes=0,Y2(c,p,v,p.pendingProps);case 24:no(p,gi,c.memoizedState.cache)}return ma(c,p,v)}function nT(c,p,v){if(c!==null)if(c.memoizedProps!==p.pendingProps)yi=!0;else{if(!Ev(c,v)&&(p.flags&128)===0)return yi=!1,XP(c,p,v);yi=(c.flags&131072)!==0}else yi=!1,Sr&&(p.flags&1048576)!==0&&DS(p,Lu,p.index);switch(p.lanes=0,p.tag){case 16:e:{var S=p.pendingProps;if(c=vl(p.elementType),p.type=c,typeof c=="function")Lb(c)?(S=wl(c,S),p.tag=1,p=J2(null,p,c,S,v)):(p.tag=0,p=xv(null,p,c,S,v));else{if(c!=null){var M=c.$$typeof;if(M===T){p.tag=11,p=G2(null,p,c,S,v);break e}else if(M===j){p.tag=14,p=K2(null,p,c,S,v);break e}}throw p=H(c)||c,Error(n(306,p,""))}}return p;case 0:return xv(c,p,p.type,p.pendingProps,v);case 1:return S=p.type,M=wl(S,p.pendingProps),J2(c,p,S,M,v);case 3:e:{if(I(p,p.stateNode.containerInfo),c===null)throw Error(n(387));S=p.pendingProps;var R=p.memoizedState;M=R.element,Kb(c,p),Pu(p,S,null,v);var Y=p.memoizedState;if(S=Y.cache,no(p,gi,S),S!==R.cache&&zb(p,[gi],v,!0),$u(),S=Y.element,R.isDehydrated)if(R={element:S,isDehydrated:!1,cache:Y.cache},p.updateQueue.baseState=R,p.memoizedState=R,p.flags&256){p=eT(c,p,S,v);break e}else if(S!==M){M=Yn(Error(n(424)),p),Ru(M),p=eT(c,p,S,v);break e}else{switch(c=p.stateNode.containerInfo,c.nodeType){case 9:c=c.body;break;default:c=c.nodeName==="HTML"?c.ownerDocument.body:c}for(Vr=es(c.firstChild),Oi=p,Sr=!0,ro=null,Qn=!0,v=YS(p,null,S,v),p.child=v;v;)v.flags=v.flags&-3|4096,v=v.sibling}else{if(gl(),S===M){p=ma(c,p,v);break e}Ii(c,p,S,v)}p=p.child}return p;case 26:return Op(c,p),c===null?(v=gE(p.type,null,p.pendingProps,null))?p.memoizedState=v:Sr||(v=p.type,c=p.pendingProps,S=Qp(fe.current).createElement(v),S[Ke]=p,S[Tt]=c,Fi(S,v,c),Br(S),p.stateNode=S):p.memoizedState=gE(p.type,c.memoizedProps,p.pendingProps,c.memoizedState),null;case 27:return J(p),c===null&&Sr&&(S=p.stateNode=dE(p.type,p.pendingProps,fe.current),Oi=p,Qn=!0,M=Vr,bo(p.type)?(a0=M,Vr=es(S.firstChild)):Vr=M),Ii(c,p,p.pendingProps.children,v),Op(c,p),c===null&&(p.flags|=4194304),p.child;case 5:return c===null&&Sr&&((M=S=Vr)&&(S=T8(S,p.type,p.pendingProps,Qn),S!==null?(p.stateNode=S,Oi=p,Vr=es(S.firstChild),Qn=!1,M=!0):M=!1),M||io(p)),J(p),M=p.type,R=p.pendingProps,Y=c!==null?c.memoizedProps:null,S=R.children,t0(M,R)?S=null:Y!==null&&t0(M,Y)&&(p.flags|=32),p.memoizedState!==null&&(M=ev(c,p,zP,null,null,v),ad._currentValue=M),Op(c,p),Ii(c,p,S,v),p.child;case 6:return c===null&&Sr&&((c=v=Vr)&&(v=E8(v,p.pendingProps,Qn),v!==null?(p.stateNode=v,Oi=p,Vr=null,c=!0):c=!1),c||io(p)),null;case 13:return tT(c,p,v);case 4:return I(p,p.stateNode.containerInfo),S=p.pendingProps,c===null?p.child=_l(p,null,S,v):Ii(c,p,S,v),p.child;case 11:return G2(c,p,p.type,p.pendingProps,v);case 7:return Ii(c,p,p.pendingProps,v),p.child;case 8:return Ii(c,p,p.pendingProps.children,v),p.child;case 12:return Ii(c,p,p.pendingProps.children,v),p.child;case 10:return S=p.pendingProps,no(p,p.type,S.value),Ii(c,p,S.children,v),p.child;case 9:return M=p.type._context,S=p.pendingProps.children,yl(p),M=Di(M),S=S(M),p.flags|=1,Ii(c,p,S,v),p.child;case 14:return K2(c,p,p.type,p.pendingProps,v);case 15:return V2(c,p,p.type,p.pendingProps,v);case 19:return iT(c,p,v);case 31:return YP(c,p,v);case 22:return Y2(c,p,v,p.pendingProps);case 24:return yl(p),S=Di(gi),c===null?(M=Ub(),M===null&&(M=Wr,R=qb(),M.pooledCache=R,R.refCount++,R!==null&&(M.pooledCacheLanes|=v),M=R),p.memoizedState={parent:S,cache:M},Gb(p),no(p,gi,M)):((c.lanes&v)!==0&&(Kb(c,p),Pu(p,null,null,v),$u()),M=c.memoizedState,R=p.memoizedState,M.parent!==S?(M={parent:S,cache:S},p.memoizedState=M,p.lanes===0&&(p.memoizedState=p.updateQueue.baseState=M),no(p,gi,S)):(S=R.cache,no(p,gi,S),S!==M.cache&&zb(p,[gi],v,!0))),Ii(c,p,p.pendingProps.children,v),p.child;case 29:throw p.pendingProps}throw Error(n(156,p.tag))}function ya(c){c.flags|=4}function Nv(c,p,v,S,M){if((p=(c.mode&32)!==0)&&(p=!1),p){if(c.flags|=16777216,(M&335544128)===M)if(c.stateNode.complete)c.flags|=8192;else if(MT())c.flags|=8192;else throw xl=xp,Wb}else c.flags&=-16777217}function sT(c,p){if(p.type!=="stylesheet"||(p.state.loading&4)!==0)c.flags&=-16777217;else if(c.flags|=16777216,!xE(p))if(MT())c.flags|=8192;else throw xl=xp,Wb}function Ip(c,p){p!==null&&(c.flags|=4),c.flags&16384&&(p=c.tag!==22?ot():536870912,c.lanes|=p,Wc|=p)}function Gu(c,p){if(!Sr)switch(c.tailMode){case"hidden":p=c.tail;for(var v=null;p!==null;)p.alternate!==null&&(v=p),p=p.sibling;v===null?c.tail=null:v.sibling=null;break;case"collapsed":v=c.tail;for(var S=null;v!==null;)v.alternate!==null&&(S=v),v=v.sibling;S===null?p||c.tail===null?c.tail=null:c.tail.sibling=null:S.sibling=null}}function Yr(c){var p=c.alternate!==null&&c.alternate.child===c.child,v=0,S=0;if(p)for(var M=c.child;M!==null;)v|=M.lanes|M.childLanes,S|=M.subtreeFlags&65011712,S|=M.flags&65011712,M.return=c,M=M.sibling;else for(M=c.child;M!==null;)v|=M.lanes|M.childLanes,S|=M.subtreeFlags,S|=M.flags,M.return=c,M=M.sibling;return c.subtreeFlags|=S,c.childLanes=v,p}function ZP(c,p,v){var S=p.pendingProps;switch(Db(p),p.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Yr(p),null;case 1:return Yr(p),null;case 3:return v=p.stateNode,S=null,c!==null&&(S=c.memoizedState.cache),p.memoizedState.cache!==S&&(p.flags|=2048),fa(gi),Z(),v.pendingContext&&(v.context=v.pendingContext,v.pendingContext=null),(c===null||c.child===null)&&(Lc(p)?ya(p):c===null||c.memoizedState.isDehydrated&&(p.flags&256)===0||(p.flags|=1024,Fb())),Yr(p),null;case 26:var M=p.type,R=p.memoizedState;return c===null?(ya(p),R!==null?(Yr(p),sT(p,R)):(Yr(p),Nv(p,M,null,S,v))):R?R!==c.memoizedState?(ya(p),Yr(p),sT(p,R)):(Yr(p),p.flags&=-16777217):(c=c.memoizedProps,c!==S&&ya(p),Yr(p),Nv(p,M,c,S,v)),null;case 27:if(ne(p),v=fe.current,M=p.type,c!==null&&p.stateNode!=null)c.memoizedProps!==S&&ya(p);else{if(!S){if(p.stateNode===null)throw Error(n(166));return Yr(p),null}c=re.current,Lc(p)?FS(p):(c=dE(M,S,v),p.stateNode=c,ya(p))}return Yr(p),null;case 5:if(ne(p),M=p.type,c!==null&&p.stateNode!=null)c.memoizedProps!==S&&ya(p);else{if(!S){if(p.stateNode===null)throw Error(n(166));return Yr(p),null}if(R=re.current,Lc(p))FS(p);else{var Y=Qp(fe.current);switch(R){case 1:R=Y.createElementNS("http://www.w3.org/2000/svg",M);break;case 2:R=Y.createElementNS("http://www.w3.org/1998/Math/MathML",M);break;default:switch(M){case"svg":R=Y.createElementNS("http://www.w3.org/2000/svg",M);break;case"math":R=Y.createElementNS("http://www.w3.org/1998/Math/MathML",M);break;case"script":R=Y.createElement("div"),R.innerHTML="<script><\/script>",R=R.removeChild(R.firstChild);break;case"select":R=typeof S.is=="string"?Y.createElement("select",{is:S.is}):Y.createElement("select"),S.multiple?R.multiple=!0:S.size&&(R.size=S.size);break;default:R=typeof S.is=="string"?Y.createElement(M,{is:S.is}):Y.createElement(M)}}R[Ke]=p,R[Tt]=S;e:for(Y=p.child;Y!==null;){if(Y.tag===5||Y.tag===6)R.appendChild(Y.stateNode);else if(Y.tag!==4&&Y.tag!==27&&Y.child!==null){Y.child.return=Y,Y=Y.child;continue}if(Y===p)break e;for(;Y.sibling===null;){if(Y.return===null||Y.return===p)break e;Y=Y.return}Y.sibling.return=Y.return,Y=Y.sibling}p.stateNode=R;e:switch(Fi(R,M,S),M){case"button":case"input":case"select":case"textarea":S=!!S.autoFocus;break e;case"img":S=!0;break e;default:S=!1}S&&ya(p)}}return Yr(p),Nv(p,p.type,c===null?null:c.memoizedProps,p.pendingProps,v),null;case 6:if(c&&p.stateNode!=null)c.memoizedProps!==S&&ya(p);else{if(typeof S!="string"&&p.stateNode===null)throw Error(n(166));if(c=fe.current,Lc(p)){if(c=p.stateNode,v=p.memoizedProps,S=null,M=Oi,M!==null)switch(M.tag){case 27:case 5:S=M.memoizedProps}c[Ke]=p,c=!!(c.nodeValue===v||S!==null&&S.suppressHydrationWarning===!0||tE(c.nodeValue,v)),c||io(p,!0)}else c=Qp(c).createTextNode(S),c[Ke]=p,p.stateNode=c}return Yr(p),null;case 31:if(v=p.memoizedState,c===null||c.memoizedState!==null){if(S=Lc(p),v!==null){if(c===null){if(!S)throw Error(n(318));if(c=p.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(n(557));c[Ke]=p}else gl(),(p.flags&128)===0&&(p.memoizedState=null),p.flags|=4;Yr(p),c=!1}else v=Fb(),c!==null&&c.memoizedState!==null&&(c.memoizedState.hydrationErrors=v),c=!0;if(!c)return p.flags&256?(Ln(p),p):(Ln(p),null);if((p.flags&128)!==0)throw Error(n(558))}return Yr(p),null;case 13:if(S=p.memoizedState,c===null||c.memoizedState!==null&&c.memoizedState.dehydrated!==null){if(M=Lc(p),S!==null&&S.dehydrated!==null){if(c===null){if(!M)throw Error(n(318));if(M=p.memoizedState,M=M!==null?M.dehydrated:null,!M)throw Error(n(317));M[Ke]=p}else gl(),(p.flags&128)===0&&(p.memoizedState=null),p.flags|=4;Yr(p),M=!1}else M=Fb(),c!==null&&c.memoizedState!==null&&(c.memoizedState.hydrationErrors=M),M=!0;if(!M)return p.flags&256?(Ln(p),p):(Ln(p),null)}return Ln(p),(p.flags&128)!==0?(p.lanes=v,p):(v=S!==null,c=c!==null&&c.memoizedState!==null,v&&(S=p.child,M=null,S.alternate!==null&&S.alternate.memoizedState!==null&&S.alternate.memoizedState.cachePool!==null&&(M=S.alternate.memoizedState.cachePool.pool),R=null,S.memoizedState!==null&&S.memoizedState.cachePool!==null&&(R=S.memoizedState.cachePool.pool),R!==M&&(S.flags|=2048)),v!==c&&v&&(p.child.flags|=8192),Ip(p,p.updateQueue),Yr(p),null);case 4:return Z(),c===null&&Xv(p.stateNode.containerInfo),Yr(p),null;case 10:return fa(p.type),Yr(p),null;case 19:if(X(di),S=p.memoizedState,S===null)return Yr(p),null;if(M=(p.flags&128)!==0,R=S.rendering,R===null)if(M)Gu(S,!1);else{if(li!==0||c!==null&&(c.flags&128)!==0)for(c=p.child;c!==null;){if(R=kp(c),R!==null){for(p.flags|=128,Gu(S,!1),c=R.updateQueue,p.updateQueue=c,Ip(p,c),p.subtreeFlags=0,c=v,v=p.child;v!==null;)RS(v,c),v=v.sibling;return ee(di,di.current&1|2),Sr&&ua(p,S.treeForkCount),p.child}c=c.sibling}S.tail!==null&&Lt()>qp&&(p.flags|=128,M=!0,Gu(S,!1),p.lanes=4194304)}else{if(!M)if(c=kp(R),c!==null){if(p.flags|=128,M=!0,c=c.updateQueue,p.updateQueue=c,Ip(p,c),Gu(S,!0),S.tail===null&&S.tailMode==="hidden"&&!R.alternate&&!Sr)return Yr(p),null}else 2*Lt()-S.renderingStartTime>qp&&v!==536870912&&(p.flags|=128,M=!0,Gu(S,!1),p.lanes=4194304);S.isBackwards?(R.sibling=p.child,p.child=R):(c=S.last,c!==null?c.sibling=R:p.child=R,S.last=R)}return S.tail!==null?(c=S.tail,S.rendering=c,S.tail=c.sibling,S.renderingStartTime=Lt(),c.sibling=null,v=di.current,ee(di,M?v&1|2:v&1),Sr&&ua(p,S.treeForkCount),c):(Yr(p),null);case 22:case 23:return Ln(p),Zb(),S=p.memoizedState!==null,c!==null?c.memoizedState!==null!==S&&(p.flags|=8192):S&&(p.flags|=8192),S?(v&536870912)!==0&&(p.flags&128)===0&&(Yr(p),p.subtreeFlags&6&&(p.flags|=8192)):Yr(p),v=p.updateQueue,v!==null&&Ip(p,v.retryQueue),v=null,c!==null&&c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(v=c.memoizedState.cachePool.pool),S=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(S=p.memoizedState.cachePool.pool),S!==v&&(p.flags|=2048),c!==null&&X(bl),null;case 24:return v=null,c!==null&&(v=c.memoizedState.cache),p.memoizedState.cache!==v&&(p.flags|=2048),fa(gi),Yr(p),null;case 25:return null;case 30:return null}throw Error(n(156,p.tag))}function QP(c,p){switch(Db(p),p.tag){case 1:return c=p.flags,c&65536?(p.flags=c&-65537|128,p):null;case 3:return fa(gi),Z(),c=p.flags,(c&65536)!==0&&(c&128)===0?(p.flags=c&-65537|128,p):null;case 26:case 27:case 5:return ne(p),null;case 31:if(p.memoizedState!==null){if(Ln(p),p.alternate===null)throw Error(n(340));gl()}return c=p.flags,c&65536?(p.flags=c&-65537|128,p):null;case 13:if(Ln(p),c=p.memoizedState,c!==null&&c.dehydrated!==null){if(p.alternate===null)throw Error(n(340));gl()}return c=p.flags,c&65536?(p.flags=c&-65537|128,p):null;case 19:return X(di),null;case 4:return Z(),null;case 10:return fa(p.type),null;case 22:case 23:return Ln(p),Zb(),c!==null&&X(bl),c=p.flags,c&65536?(p.flags=c&-65537|128,p):null;case 24:return fa(gi),null;case 25:return null;default:return null}}function aT(c,p){switch(Db(p),p.tag){case 3:fa(gi),Z();break;case 26:case 27:case 5:ne(p);break;case 4:Z();break;case 31:p.memoizedState!==null&&Ln(p);break;case 13:Ln(p);break;case 19:X(di);break;case 10:fa(p.type);break;case 22:case 23:Ln(p),Zb(),c!==null&&X(bl);break;case 24:fa(gi)}}function Ku(c,p){try{var v=p.updateQueue,S=v!==null?v.lastEffect:null;if(S!==null){var M=S.next;v=M;do{if((v.tag&c)===c){S=void 0;var R=v.create,Y=v.inst;S=R(),Y.destroy=S}v=v.next}while(v!==M)}}catch(te){zr(p,p.return,te)}}function ho(c,p,v){try{var S=p.updateQueue,M=S!==null?S.lastEffect:null;if(M!==null){var R=M.next;S=R;do{if((S.tag&c)===c){var Y=S.inst,te=Y.destroy;if(te!==void 0){Y.destroy=void 0,M=p;var pe=v,Le=te;try{Le()}catch(Ge){zr(M,pe,Ge)}}}S=S.next}while(S!==R)}}catch(Ge){zr(p,p.return,Ge)}}function oT(c){var p=c.updateQueue;if(p!==null){var v=c.stateNode;try{ZS(p,v)}catch(S){zr(c,c.return,S)}}}function lT(c,p,v){v.props=wl(c.type,c.memoizedProps),v.state=c.memoizedState;try{v.componentWillUnmount()}catch(S){zr(c,p,S)}}function Vu(c,p){try{var v=c.ref;if(v!==null){switch(c.tag){case 26:case 27:case 5:var S=c.stateNode;break;case 30:S=c.stateNode;break;default:S=c.stateNode}typeof v=="function"?c.refCleanup=v(S):v.current=S}}catch(M){zr(c,p,M)}}function Fs(c,p){var v=c.ref,S=c.refCleanup;if(v!==null)if(typeof S=="function")try{S()}catch(M){zr(c,p,M)}finally{c.refCleanup=null,c=c.alternate,c!=null&&(c.refCleanup=null)}else if(typeof v=="function")try{v(null)}catch(M){zr(c,p,M)}else v.current=null}function cT(c){var p=c.type,v=c.memoizedProps,S=c.stateNode;try{e:switch(p){case"button":case"input":case"select":case"textarea":v.autoFocus&&S.focus();break e;case"img":v.src?S.src=v.src:v.srcSet&&(S.srcset=v.srcSet)}}catch(M){zr(c,c.return,M)}}function jv(c,p,v){try{var S=c.stateNode;x8(S,c.type,v,p),S[Tt]=p}catch(M){zr(c,c.return,M)}}function hT(c){return c.tag===5||c.tag===3||c.tag===26||c.tag===27&&bo(c.type)||c.tag===4}function Av(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||hT(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(c.tag===27&&bo(c.type)||c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function Mv(c,p,v){var S=c.tag;if(S===5||S===6)c=c.stateNode,p?(v.nodeType===9?v.body:v.nodeName==="HTML"?v.ownerDocument.body:v).insertBefore(c,p):(p=v.nodeType===9?v.body:v.nodeName==="HTML"?v.ownerDocument.body:v,p.appendChild(c),v=v._reactRootContainer,v!=null||p.onclick!==null||(p.onclick=ft));else if(S!==4&&(S===27&&bo(c.type)&&(v=c.stateNode,p=null),c=c.child,c!==null))for(Mv(c,p,v),c=c.sibling;c!==null;)Mv(c,p,v),c=c.sibling}function Fp(c,p,v){var S=c.tag;if(S===5||S===6)c=c.stateNode,p?v.insertBefore(c,p):v.appendChild(c);else if(S!==4&&(S===27&&bo(c.type)&&(v=c.stateNode),c=c.child,c!==null))for(Fp(c,p,v),c=c.sibling;c!==null;)Fp(c,p,v),c=c.sibling}function uT(c){var p=c.stateNode,v=c.memoizedProps;try{for(var S=c.type,M=p.attributes;M.length;)p.removeAttributeNode(M[0]);Fi(p,S,v),p[Ke]=c,p[Tt]=v}catch(R){zr(c,c.return,R)}}var ba=!1,bi=!1,Lv=!1,dT=typeof WeakSet=="function"?WeakSet:Set,Ai=null;function JP(c,p){if(c=c.containerInfo,Jv=sg,c=kS(c),Sb(c)){if("selectionStart"in c)var v={start:c.selectionStart,end:c.selectionEnd};else e:{v=(v=c.ownerDocument)&&v.defaultView||window;var S=v.getSelection&&v.getSelection();if(S&&S.rangeCount!==0){v=S.anchorNode;var M=S.anchorOffset,R=S.focusNode;S=S.focusOffset;try{v.nodeType,R.nodeType}catch{v=null;break e}var Y=0,te=-1,pe=-1,Le=0,Ge=0,Qe=c,Oe=null;t:for(;;){for(var Pe;Qe!==v||M!==0&&Qe.nodeType!==3||(te=Y+M),Qe!==R||S!==0&&Qe.nodeType!==3||(pe=Y+S),Qe.nodeType===3&&(Y+=Qe.nodeValue.length),(Pe=Qe.firstChild)!==null;)Oe=Qe,Qe=Pe;for(;;){if(Qe===c)break t;if(Oe===v&&++Le===M&&(te=Y),Oe===R&&++Ge===S&&(pe=Y),(Pe=Qe.nextSibling)!==null)break;Qe=Oe,Oe=Qe.parentNode}Qe=Pe}v=te===-1||pe===-1?null:{start:te,end:pe}}else v=null}v=v||{start:0,end:0}}else v=null;for(e0={focusedElem:c,selectionRange:v},sg=!1,Ai=p;Ai!==null;)if(p=Ai,c=p.child,(p.subtreeFlags&1028)!==0&&c!==null)c.return=p,Ai=c;else for(;Ai!==null;){switch(p=Ai,R=p.alternate,c=p.flags,p.tag){case 0:if((c&4)!==0&&(c=p.updateQueue,c=c!==null?c.events:null,c!==null))for(v=0;v<c.length;v++)M=c[v],M.ref.impl=M.nextImpl;break;case 11:case 15:break;case 1:if((c&1024)!==0&&R!==null){c=void 0,v=p,M=R.memoizedProps,R=R.memoizedState,S=v.stateNode;try{var jt=wl(v.type,M);c=S.getSnapshotBeforeUpdate(jt,R),S.__reactInternalSnapshotBeforeUpdate=c}catch(Jt){zr(v,v.return,Jt)}}break;case 3:if((c&1024)!==0){if(c=p.stateNode.containerInfo,v=c.nodeType,v===9)i0(c);else if(v===1)switch(c.nodeName){case"HEAD":case"HTML":case"BODY":i0(c);break;default:c.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((c&1024)!==0)throw Error(n(163))}if(c=p.sibling,c!==null){c.return=p.return,Ai=c;break}Ai=p.return}}function fT(c,p,v){var S=v.flags;switch(v.tag){case 0:case 11:case 15:xa(c,v),S&4&&Ku(5,v);break;case 1:if(xa(c,v),S&4)if(c=v.stateNode,p===null)try{c.componentDidMount()}catch(Y){zr(v,v.return,Y)}else{var M=wl(v.type,p.memoizedProps);p=p.memoizedState;try{c.componentDidUpdate(M,p,c.__reactInternalSnapshotBeforeUpdate)}catch(Y){zr(v,v.return,Y)}}S&64&&oT(v),S&512&&Vu(v,v.return);break;case 3:if(xa(c,v),S&64&&(c=v.updateQueue,c!==null)){if(p=null,v.child!==null)switch(v.child.tag){case 27:case 5:p=v.child.stateNode;break;case 1:p=v.child.stateNode}try{ZS(c,p)}catch(Y){zr(v,v.return,Y)}}break;case 27:p===null&&S&4&&uT(v);case 26:case 5:xa(c,v),p===null&&S&4&&cT(v),S&512&&Vu(v,v.return);break;case 12:xa(c,v);break;case 31:xa(c,v),S&4&&mT(c,v);break;case 13:xa(c,v),S&4&&yT(c,v),S&64&&(c=v.memoizedState,c!==null&&(c=c.dehydrated,c!==null&&(v=l8.bind(null,v),N8(c,v))));break;case 22:if(S=v.memoizedState!==null||ba,!S){p=p!==null&&p.memoizedState!==null||bi,M=ba;var R=bi;ba=S,(bi=p)&&!R?_a(c,v,(v.subtreeFlags&8772)!==0):xa(c,v),ba=M,bi=R}break;case 30:break;default:xa(c,v)}}function pT(c){var p=c.alternate;p!==null&&(c.alternate=null,pT(p)),c.child=null,c.deletions=null,c.sibling=null,c.tag===5&&(p=c.stateNode,p!==null&&Os(p)),c.stateNode=null,c.return=null,c.dependencies=null,c.memoizedProps=null,c.memoizedState=null,c.pendingProps=null,c.stateNode=null,c.updateQueue=null}var Jr=null,mn=!1;function va(c,p,v){for(v=v.child;v!==null;)gT(c,p,v),v=v.sibling}function gT(c,p,v){if(ke&&typeof ke.onCommitFiberUnmount=="function")try{ke.onCommitFiberUnmount(Nt,v)}catch{}switch(v.tag){case 26:bi||Fs(v,p),va(c,p,v),v.memoizedState?v.memoizedState.count--:v.stateNode&&(v=v.stateNode,v.parentNode.removeChild(v));break;case 27:bi||Fs(v,p);var S=Jr,M=mn;bo(v.type)&&(Jr=v.stateNode,mn=!1),va(c,p,v),id(v.stateNode),Jr=S,mn=M;break;case 5:bi||Fs(v,p);case 6:if(S=Jr,M=mn,Jr=null,va(c,p,v),Jr=S,mn=M,Jr!==null)if(mn)try{(Jr.nodeType===9?Jr.body:Jr.nodeName==="HTML"?Jr.ownerDocument.body:Jr).removeChild(v.stateNode)}catch(R){zr(v,p,R)}else try{Jr.removeChild(v.stateNode)}catch(R){zr(v,p,R)}break;case 18:Jr!==null&&(mn?(c=Jr,oE(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,v.stateNode),Jc(c)):oE(Jr,v.stateNode));break;case 4:S=Jr,M=mn,Jr=v.stateNode.containerInfo,mn=!0,va(c,p,v),Jr=S,mn=M;break;case 0:case 11:case 14:case 15:ho(2,v,p),bi||ho(4,v,p),va(c,p,v);break;case 1:bi||(Fs(v,p),S=v.stateNode,typeof S.componentWillUnmount=="function"&&lT(v,p,S)),va(c,p,v);break;case 21:va(c,p,v);break;case 22:bi=(S=bi)||v.memoizedState!==null,va(c,p,v),bi=S;break;default:va(c,p,v)}}function mT(c,p){if(p.memoizedState===null&&(c=p.alternate,c!==null&&(c=c.memoizedState,c!==null))){c=c.dehydrated;try{Jc(c)}catch(v){zr(p,p.return,v)}}}function yT(c,p){if(p.memoizedState===null&&(c=p.alternate,c!==null&&(c=c.memoizedState,c!==null&&(c=c.dehydrated,c!==null))))try{Jc(c)}catch(v){zr(p,p.return,v)}}function e8(c){switch(c.tag){case 31:case 13:case 19:var p=c.stateNode;return p===null&&(p=c.stateNode=new dT),p;case 22:return c=c.stateNode,p=c._retryCache,p===null&&(p=c._retryCache=new dT),p;default:throw Error(n(435,c.tag))}}function $p(c,p){var v=e8(c);p.forEach(function(S){if(!v.has(S)){v.add(S);var M=c8.bind(null,c,S);S.then(M,M)}})}function yn(c,p){var v=p.deletions;if(v!==null)for(var S=0;S<v.length;S++){var M=v[S],R=c,Y=p,te=Y;e:for(;te!==null;){switch(te.tag){case 27:if(bo(te.type)){Jr=te.stateNode,mn=!1;break e}break;case 5:Jr=te.stateNode,mn=!1;break e;case 3:case 4:Jr=te.stateNode.containerInfo,mn=!0;break e}te=te.return}if(Jr===null)throw Error(n(160));gT(R,Y,M),Jr=null,mn=!1,R=M.alternate,R!==null&&(R.return=null),M.return=null}if(p.subtreeFlags&13886)for(p=p.child;p!==null;)bT(p,c),p=p.sibling}var bs=null;function bT(c,p){var v=c.alternate,S=c.flags;switch(c.tag){case 0:case 11:case 14:case 15:yn(p,c),bn(c),S&4&&(ho(3,c,c.return),Ku(3,c),ho(5,c,c.return));break;case 1:yn(p,c),bn(c),S&512&&(bi||v===null||Fs(v,v.return)),S&64&&ba&&(c=c.updateQueue,c!==null&&(S=c.callbacks,S!==null&&(v=c.shared.hiddenCallbacks,c.shared.hiddenCallbacks=v===null?S:v.concat(S))));break;case 26:var M=bs;if(yn(p,c),bn(c),S&512&&(bi||v===null||Fs(v,v.return)),S&4){var R=v!==null?v.memoizedState:null;if(S=c.memoizedState,v===null)if(S===null)if(c.stateNode===null){e:{S=c.type,v=c.memoizedProps,M=M.ownerDocument||M;t:switch(S){case"title":R=M.getElementsByTagName("title")[0],(!R||R[Hn]||R[Ke]||R.namespaceURI==="http://www.w3.org/2000/svg"||R.hasAttribute("itemprop"))&&(R=M.createElement(S),M.head.insertBefore(R,M.querySelector("head > title"))),Fi(R,S,v),R[Ke]=c,Br(R),S=R;break e;case"link":var Y=bE("link","href",M).get(S+(v.href||""));if(Y){for(var te=0;te<Y.length;te++)if(R=Y[te],R.getAttribute("href")===(v.href==null||v.href===""?null:v.href)&&R.getAttribute("rel")===(v.rel==null?null:v.rel)&&R.getAttribute("title")===(v.title==null?null:v.title)&&R.getAttribute("crossorigin")===(v.crossOrigin==null?null:v.crossOrigin)){Y.splice(te,1);break t}}R=M.createElement(S),Fi(R,S,v),M.head.appendChild(R);break;case"meta":if(Y=bE("meta","content",M).get(S+(v.content||""))){for(te=0;te<Y.length;te++)if(R=Y[te],R.getAttribute("content")===(v.content==null?null:""+v.content)&&R.getAttribute("name")===(v.name==null?null:v.name)&&R.getAttribute("property")===(v.property==null?null:v.property)&&R.getAttribute("http-equiv")===(v.httpEquiv==null?null:v.httpEquiv)&&R.getAttribute("charset")===(v.charSet==null?null:v.charSet)){Y.splice(te,1);break t}}R=M.createElement(S),Fi(R,S,v),M.head.appendChild(R);break;default:throw Error(n(468,S))}R[Ke]=c,Br(R),S=R}c.stateNode=S}else vE(M,c.type,c.stateNode);else c.stateNode=yE(M,S,c.memoizedProps);else R!==S?(R===null?v.stateNode!==null&&(v=v.stateNode,v.parentNode.removeChild(v)):R.count--,S===null?vE(M,c.type,c.stateNode):yE(M,S,c.memoizedProps)):S===null&&c.stateNode!==null&&jv(c,c.memoizedProps,v.memoizedProps)}break;case 27:yn(p,c),bn(c),S&512&&(bi||v===null||Fs(v,v.return)),v!==null&&S&4&&jv(c,c.memoizedProps,v.memoizedProps);break;case 5:if(yn(p,c),bn(c),S&512&&(bi||v===null||Fs(v,v.return)),c.flags&32){M=c.stateNode;try{bt(M,"")}catch(jt){zr(c,c.return,jt)}}S&4&&c.stateNode!=null&&(M=c.memoizedProps,jv(c,M,v!==null?v.memoizedProps:M)),S&1024&&(Lv=!0);break;case 6:if(yn(p,c),bn(c),S&4){if(c.stateNode===null)throw Error(n(162));S=c.memoizedProps,v=c.stateNode;try{v.nodeValue=S}catch(jt){zr(c,c.return,jt)}}break;case 3:if(tg=null,M=bs,bs=Jp(p.containerInfo),yn(p,c),bs=M,bn(c),S&4&&v!==null&&v.memoizedState.isDehydrated)try{Jc(p.containerInfo)}catch(jt){zr(c,c.return,jt)}Lv&&(Lv=!1,vT(c));break;case 4:S=bs,bs=Jp(c.stateNode.containerInfo),yn(p,c),bn(c),bs=S;break;case 12:yn(p,c),bn(c);break;case 31:yn(p,c),bn(c),S&4&&(S=c.updateQueue,S!==null&&(c.updateQueue=null,$p(c,S)));break;case 13:yn(p,c),bn(c),c.child.flags&8192&&c.memoizedState!==null!=(v!==null&&v.memoizedState!==null)&&(zp=Lt()),S&4&&(S=c.updateQueue,S!==null&&(c.updateQueue=null,$p(c,S)));break;case 22:M=c.memoizedState!==null;var pe=v!==null&&v.memoizedState!==null,Le=ba,Ge=bi;if(ba=Le||M,bi=Ge||pe,yn(p,c),bi=Ge,ba=Le,bn(c),S&8192)e:for(p=c.stateNode,p._visibility=M?p._visibility&-2:p._visibility|1,M&&(v===null||pe||ba||bi||kl(c)),v=null,p=c;;){if(p.tag===5||p.tag===26){if(v===null){pe=v=p;try{if(R=pe.stateNode,M)Y=R.style,typeof Y.setProperty=="function"?Y.setProperty("display","none","important"):Y.display="none";else{te=pe.stateNode;var Qe=pe.memoizedProps.style,Oe=Qe!=null&&Qe.hasOwnProperty("display")?Qe.display:null;te.style.display=Oe==null||typeof Oe=="boolean"?"":(""+Oe).trim()}}catch(jt){zr(pe,pe.return,jt)}}}else if(p.tag===6){if(v===null){pe=p;try{pe.stateNode.nodeValue=M?"":pe.memoizedProps}catch(jt){zr(pe,pe.return,jt)}}}else if(p.tag===18){if(v===null){pe=p;try{var Pe=pe.stateNode;M?lE(Pe,!0):lE(pe.stateNode,!1)}catch(jt){zr(pe,pe.return,jt)}}}else if((p.tag!==22&&p.tag!==23||p.memoizedState===null||p===c)&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===c)break e;for(;p.sibling===null;){if(p.return===null||p.return===c)break e;v===p&&(v=null),p=p.return}v===p&&(v=null),p.sibling.return=p.return,p=p.sibling}S&4&&(S=c.updateQueue,S!==null&&(v=S.retryQueue,v!==null&&(S.retryQueue=null,$p(c,v))));break;case 19:yn(p,c),bn(c),S&4&&(S=c.updateQueue,S!==null&&(c.updateQueue=null,$p(c,S)));break;case 30:break;case 21:break;default:yn(p,c),bn(c)}}function bn(c){var p=c.flags;if(p&2){try{for(var v,S=c.return;S!==null;){if(hT(S)){v=S;break}S=S.return}if(v==null)throw Error(n(160));switch(v.tag){case 27:var M=v.stateNode,R=Av(c);Fp(c,R,M);break;case 5:var Y=v.stateNode;v.flags&32&&(bt(Y,""),v.flags&=-33);var te=Av(c);Fp(c,te,Y);break;case 3:case 4:var pe=v.stateNode.containerInfo,Le=Av(c);Mv(c,Le,pe);break;default:throw Error(n(161))}}catch(Ge){zr(c,c.return,Ge)}c.flags&=-3}p&4096&&(c.flags&=-4097)}function vT(c){if(c.subtreeFlags&1024)for(c=c.child;c!==null;){var p=c;vT(p),p.tag===5&&p.flags&1024&&p.stateNode.reset(),c=c.sibling}}function xa(c,p){if(p.subtreeFlags&8772)for(p=p.child;p!==null;)fT(c,p.alternate,p),p=p.sibling}function kl(c){for(c=c.child;c!==null;){var p=c;switch(p.tag){case 0:case 11:case 14:case 15:ho(4,p,p.return),kl(p);break;case 1:Fs(p,p.return);var v=p.stateNode;typeof v.componentWillUnmount=="function"&&lT(p,p.return,v),kl(p);break;case 27:id(p.stateNode);case 26:case 5:Fs(p,p.return),kl(p);break;case 22:p.memoizedState===null&&kl(p);break;case 30:kl(p);break;default:kl(p)}c=c.sibling}}function _a(c,p,v){for(v=v&&(p.subtreeFlags&8772)!==0,p=p.child;p!==null;){var S=p.alternate,M=c,R=p,Y=R.flags;switch(R.tag){case 0:case 11:case 15:_a(M,R,v),Ku(4,R);break;case 1:if(_a(M,R,v),S=R,M=S.stateNode,typeof M.componentDidMount=="function")try{M.componentDidMount()}catch(Le){zr(S,S.return,Le)}if(S=R,M=S.updateQueue,M!==null){var te=S.stateNode;try{var pe=M.shared.hiddenCallbacks;if(pe!==null)for(M.shared.hiddenCallbacks=null,M=0;M<pe.length;M++)XS(pe[M],te)}catch(Le){zr(S,S.return,Le)}}v&&Y&64&&oT(R),Vu(R,R.return);break;case 27:uT(R);case 26:case 5:_a(M,R,v),v&&S===null&&Y&4&&cT(R),Vu(R,R.return);break;case 12:_a(M,R,v);break;case 31:_a(M,R,v),v&&Y&4&&mT(M,R);break;case 13:_a(M,R,v),v&&Y&4&&yT(M,R);break;case 22:R.memoizedState===null&&_a(M,R,v),Vu(R,R.return);break;case 30:break;default:_a(M,R,v)}p=p.sibling}}function Rv(c,p){var v=null;c!==null&&c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(v=c.memoizedState.cachePool.pool),c=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(c=p.memoizedState.cachePool.pool),c!==v&&(c!=null&&c.refCount++,v!=null&&Bu(v))}function Bv(c,p){c=null,p.alternate!==null&&(c=p.alternate.memoizedState.cache),p=p.memoizedState.cache,p!==c&&(p.refCount++,c!=null&&Bu(c))}function vs(c,p,v,S){if(p.subtreeFlags&10256)for(p=p.child;p!==null;)xT(c,p,v,S),p=p.sibling}function xT(c,p,v,S){var M=p.flags;switch(p.tag){case 0:case 11:case 15:vs(c,p,v,S),M&2048&&Ku(9,p);break;case 1:vs(c,p,v,S);break;case 3:vs(c,p,v,S),M&2048&&(c=null,p.alternate!==null&&(c=p.alternate.memoizedState.cache),p=p.memoizedState.cache,p!==c&&(p.refCount++,c!=null&&Bu(c)));break;case 12:if(M&2048){vs(c,p,v,S),c=p.stateNode;try{var R=p.memoizedProps,Y=R.id,te=R.onPostCommit;typeof te=="function"&&te(Y,p.alternate===null?"mount":"update",c.passiveEffectDuration,-0)}catch(pe){zr(p,p.return,pe)}}else vs(c,p,v,S);break;case 31:vs(c,p,v,S);break;case 13:vs(c,p,v,S);break;case 23:break;case 22:R=p.stateNode,Y=p.alternate,p.memoizedState!==null?R._visibility&2?vs(c,p,v,S):Yu(c,p):R._visibility&2?vs(c,p,v,S):(R._visibility|=2,qc(c,p,v,S,(p.subtreeFlags&10256)!==0||!1)),M&2048&&Rv(Y,p);break;case 24:vs(c,p,v,S),M&2048&&Bv(p.alternate,p);break;default:vs(c,p,v,S)}}function qc(c,p,v,S,M){for(M=M&&((p.subtreeFlags&10256)!==0||!1),p=p.child;p!==null;){var R=c,Y=p,te=v,pe=S,Le=Y.flags;switch(Y.tag){case 0:case 11:case 15:qc(R,Y,te,pe,M),Ku(8,Y);break;case 23:break;case 22:var Ge=Y.stateNode;Y.memoizedState!==null?Ge._visibility&2?qc(R,Y,te,pe,M):Yu(R,Y):(Ge._visibility|=2,qc(R,Y,te,pe,M)),M&&Le&2048&&Rv(Y.alternate,Y);break;case 24:qc(R,Y,te,pe,M),M&&Le&2048&&Bv(Y.alternate,Y);break;default:qc(R,Y,te,pe,M)}p=p.sibling}}function Yu(c,p){if(p.subtreeFlags&10256)for(p=p.child;p!==null;){var v=c,S=p,M=S.flags;switch(S.tag){case 22:Yu(v,S),M&2048&&Rv(S.alternate,S);break;case 24:Yu(v,S),M&2048&&Bv(S.alternate,S);break;default:Yu(v,S)}p=p.sibling}}var Xu=8192;function Hc(c,p,v){if(c.subtreeFlags&Xu)for(c=c.child;c!==null;)_T(c,p,v),c=c.sibling}function _T(c,p,v){switch(c.tag){case 26:Hc(c,p,v),c.flags&Xu&&c.memoizedState!==null&&P8(v,bs,c.memoizedState,c.memoizedProps);break;case 5:Hc(c,p,v);break;case 3:case 4:var S=bs;bs=Jp(c.stateNode.containerInfo),Hc(c,p,v),bs=S;break;case 22:c.memoizedState===null&&(S=c.alternate,S!==null&&S.memoizedState!==null?(S=Xu,Xu=16777216,Hc(c,p,v),Xu=S):Hc(c,p,v));break;default:Hc(c,p,v)}}function CT(c){var p=c.alternate;if(p!==null&&(c=p.child,c!==null)){p.child=null;do p=c.sibling,c.sibling=null,c=p;while(c!==null)}}function Zu(c){var p=c.deletions;if((c.flags&16)!==0){if(p!==null)for(var v=0;v<p.length;v++){var S=p[v];Ai=S,kT(S,c)}CT(c)}if(c.subtreeFlags&10256)for(c=c.child;c!==null;)wT(c),c=c.sibling}function wT(c){switch(c.tag){case 0:case 11:case 15:Zu(c),c.flags&2048&&ho(9,c,c.return);break;case 3:Zu(c);break;case 12:Zu(c);break;case 22:var p=c.stateNode;c.memoizedState!==null&&p._visibility&2&&(c.return===null||c.return.tag!==13)?(p._visibility&=-3,Pp(c)):Zu(c);break;default:Zu(c)}}function Pp(c){var p=c.deletions;if((c.flags&16)!==0){if(p!==null)for(var v=0;v<p.length;v++){var S=p[v];Ai=S,kT(S,c)}CT(c)}for(c=c.child;c!==null;){switch(p=c,p.tag){case 0:case 11:case 15:ho(8,p,p.return),Pp(p);break;case 22:v=p.stateNode,v._visibility&2&&(v._visibility&=-3,Pp(p));break;default:Pp(p)}c=c.sibling}}function kT(c,p){for(;Ai!==null;){var v=Ai;switch(v.tag){case 0:case 11:case 15:ho(8,v,p);break;case 23:case 22:if(v.memoizedState!==null&&v.memoizedState.cachePool!==null){var S=v.memoizedState.cachePool.pool;S!=null&&S.refCount++}break;case 24:Bu(v.memoizedState.cache)}if(S=v.child,S!==null)S.return=v,Ai=S;else e:for(v=c;Ai!==null;){S=Ai;var M=S.sibling,R=S.return;if(pT(S),S===v){Ai=null;break e}if(M!==null){M.return=R,Ai=M;break e}Ai=R}}}var t8={getCacheForType:function(c){var p=Di(gi),v=p.data.get(c);return v===void 0&&(v=c(),p.data.set(c,v)),v},cacheSignal:function(){return Di(gi).controller.signal}},r8=typeof WeakMap=="function"?WeakMap:Map,Rr=0,Wr=null,yr=null,_r=0,Pr=0,Rn=null,uo=!1,Uc=!1,Ov=!1,Ca=0,li=0,fo=0,Sl=0,Dv=0,Bn=0,Wc=0,Qu=null,vn=null,Iv=!1,zp=0,ST=0,qp=1/0,Hp=null,po=null,wi=0,go=null,Gc=null,wa=0,Fv=0,$v=null,TT=null,Ju=0,Pv=null;function On(){return(Rr&2)!==0&&_r!==0?_r&-_r:$.T!==null?Gv():be()}function ET(){if(Bn===0)if((_r&536870912)===0||Sr){var c=xt;xt<<=1,(xt&3932160)===0&&(xt=262144),Bn=c}else Bn=536870912;return c=Mn.current,c!==null&&(c.flags|=32),Bn}function xn(c,p,v){(c===Wr&&(Pr===2||Pr===9)||c.cancelPendingCommit!==null)&&(Kc(c,0),mo(c,_r,Bn,!1)),gt(c,v),((Rr&2)===0||c!==Wr)&&(c===Wr&&((Rr&2)===0&&(Sl|=v),li===4&&mo(c,_r,Bn,!1)),$s(c))}function NT(c,p,v){if((Rr&6)!==0)throw Error(n(327));var S=!v&&(p&127)===0&&(p&c.expiredLanes)===0||Ae(c,p),M=S?s8(c,p):qv(c,p,!0),R=S;do{if(M===0){Uc&&!S&&mo(c,p,0,!1);break}else{if(v=c.current.alternate,R&&!i8(v)){M=qv(c,p,!1),R=!1;continue}if(M===2){if(R=p,c.errorRecoveryDisabledLanes&R)var Y=0;else Y=c.pendingLanes&-536870913,Y=Y!==0?Y:Y&536870912?536870912:0;if(Y!==0){p=Y;e:{var te=c;M=Qu;var pe=te.current.memoizedState.isDehydrated;if(pe&&(Kc(te,Y).flags|=256),Y=qv(te,Y,!1),Y!==2){if(Ov&&!pe){te.errorRecoveryDisabledLanes|=R,Sl|=R,M=4;break e}R=vn,vn=M,R!==null&&(vn===null?vn=R:vn.push.apply(vn,R))}M=Y}if(R=!1,M!==2)continue}}if(M===1){Kc(c,0),mo(c,p,0,!0);break}e:{switch(S=c,R=M,R){case 0:case 1:throw Error(n(345));case 4:if((p&4194048)!==p)break;case 6:mo(S,p,Bn,!uo);break e;case 2:vn=null;break;case 3:case 5:break;default:throw Error(n(329))}if((p&62914560)===p&&(M=zp+300-Lt(),10<M)){if(mo(S,p,Bn,!uo),ae(S,0,!0)!==0)break e;wa=p,S.timeoutHandle=sE(jT.bind(null,S,v,vn,Hp,Iv,p,Bn,Sl,Wc,uo,R,"Throttled",-0,0),M);break e}jT(S,v,vn,Hp,Iv,p,Bn,Sl,Wc,uo,R,null,-0,0)}}break}while(!0);$s(c)}function jT(c,p,v,S,M,R,Y,te,pe,Le,Ge,Qe,Oe,Pe){if(c.timeoutHandle=-1,Qe=p.subtreeFlags,Qe&8192||(Qe&16785408)===16785408){Qe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ft},_T(p,R,Qe);var jt=(R&62914560)===R?zp-Lt():(R&4194048)===R?ST-Lt():0;if(jt=z8(Qe,jt),jt!==null){wa=R,c.cancelPendingCommit=jt(IT.bind(null,c,p,R,v,S,M,Y,te,pe,Ge,Qe,null,Oe,Pe)),mo(c,R,Y,!Le);return}}IT(c,p,R,v,S,M,Y,te,pe)}function i8(c){for(var p=c;;){var v=p.tag;if((v===0||v===11||v===15)&&p.flags&16384&&(v=p.updateQueue,v!==null&&(v=v.stores,v!==null)))for(var S=0;S<v.length;S++){var M=v[S],R=M.getSnapshot;M=M.value;try{if(!jn(R(),M))return!1}catch{return!1}}if(v=p.child,p.subtreeFlags&16384&&v!==null)v.return=p,p=v;else{if(p===c)break;for(;p.sibling===null;){if(p.return===null||p.return===c)return!0;p=p.return}p.sibling.return=p.return,p=p.sibling}}return!0}function mo(c,p,v,S){p&=~Dv,p&=~Sl,c.suspendedLanes|=p,c.pingedLanes&=~p,S&&(c.warmLanes|=p),S=c.expirationTimes;for(var M=p;0<M;){var R=31-at(M),Y=1<<R;S[R]=-1,M&=~Y}v!==0&&ge(c,v,p)}function Up(){return(Rr&6)===0?(ed(0),!1):!0}function zv(){if(yr!==null){if(Pr===0)var c=yr.return;else c=yr,da=ml=null,iv(c),Ic=null,Du=0,c=yr;for(;c!==null;)aT(c.alternate,c),c=c.return;yr=null}}function Kc(c,p){var v=c.timeoutHandle;v!==-1&&(c.timeoutHandle=-1,w8(v)),v=c.cancelPendingCommit,v!==null&&(c.cancelPendingCommit=null,v()),wa=0,zv(),Wr=c,yr=v=ha(c.current,null),_r=p,Pr=0,Rn=null,uo=!1,Uc=Ae(c,p),Ov=!1,Wc=Bn=Dv=Sl=fo=li=0,vn=Qu=null,Iv=!1,(p&8)!==0&&(p|=p&32);var S=c.entangledLanes;if(S!==0)for(c=c.entanglements,S&=p;0<S;){var M=31-at(S),R=1<<M;p|=c[M],S&=~R}return Ca=p,up(),v}function AT(c,p){hr=null,$.H=Uu,p===Dc||p===vp?(p=GS(),Pr=3):p===Wb?(p=GS(),Pr=4):Pr=p===vv?8:p!==null&&typeof p=="object"&&typeof p.then=="function"?6:1,Rn=p,yr===null&&(li=1,Rp(c,Yn(p,c.current)))}function MT(){var c=Mn.current;return c===null?!0:(_r&4194048)===_r?Jn===null:(_r&62914560)===_r||(_r&536870912)!==0?c===Jn:!1}function LT(){var c=$.H;return $.H=Uu,c===null?Uu:c}function RT(){var c=$.A;return $.A=t8,c}function Wp(){li=4,uo||(_r&4194048)!==_r&&Mn.current!==null||(Uc=!0),(fo&134217727)===0&&(Sl&134217727)===0||Wr===null||mo(Wr,_r,Bn,!1)}function qv(c,p,v){var S=Rr;Rr|=2;var M=LT(),R=RT();(Wr!==c||_r!==p)&&(Hp=null,Kc(c,p)),p=!1;var Y=li;e:do try{if(Pr!==0&&yr!==null){var te=yr,pe=Rn;switch(Pr){case 8:zv(),Y=6;break e;case 3:case 2:case 9:case 6:Mn.current===null&&(p=!0);var Le=Pr;if(Pr=0,Rn=null,Vc(c,te,pe,Le),v&&Uc){Y=0;break e}break;default:Le=Pr,Pr=0,Rn=null,Vc(c,te,pe,Le)}}n8(),Y=li;break}catch(Ge){AT(c,Ge)}while(!0);return p&&c.shellSuspendCounter++,da=ml=null,Rr=S,$.H=M,$.A=R,yr===null&&(Wr=null,_r=0,up()),Y}function n8(){for(;yr!==null;)BT(yr)}function s8(c,p){var v=Rr;Rr|=2;var S=LT(),M=RT();Wr!==c||_r!==p?(Hp=null,qp=Lt()+500,Kc(c,p)):Uc=Ae(c,p);e:do try{if(Pr!==0&&yr!==null){p=yr;var R=Rn;t:switch(Pr){case 1:Pr=0,Rn=null,Vc(c,p,R,1);break;case 2:case 9:if(US(R)){Pr=0,Rn=null,OT(p);break}p=function(){Pr!==2&&Pr!==9||Wr!==c||(Pr=7),$s(c)},R.then(p,p);break e;case 3:Pr=7;break e;case 4:Pr=5;break e;case 7:US(R)?(Pr=0,Rn=null,OT(p)):(Pr=0,Rn=null,Vc(c,p,R,7));break;case 5:var Y=null;switch(yr.tag){case 26:Y=yr.memoizedState;case 5:case 27:var te=yr;if(Y?xE(Y):te.stateNode.complete){Pr=0,Rn=null;var pe=te.sibling;if(pe!==null)yr=pe;else{var Le=te.return;Le!==null?(yr=Le,Gp(Le)):yr=null}break t}}Pr=0,Rn=null,Vc(c,p,R,5);break;case 6:Pr=0,Rn=null,Vc(c,p,R,6);break;case 8:zv(),li=6;break e;default:throw Error(n(462))}}a8();break}catch(Ge){AT(c,Ge)}while(!0);return da=ml=null,$.H=S,$.A=M,Rr=v,yr!==null?0:(Wr=null,_r=0,up(),li)}function a8(){for(;yr!==null&&!zt();)BT(yr)}function BT(c){var p=nT(c.alternate,c,Ca);c.memoizedProps=c.pendingProps,p===null?Gp(c):yr=p}function OT(c){var p=c,v=p.alternate;switch(p.tag){case 15:case 0:p=Q2(v,p,p.pendingProps,p.type,void 0,_r);break;case 11:p=Q2(v,p,p.pendingProps,p.type.render,p.ref,_r);break;case 5:iv(p);default:aT(v,p),p=yr=RS(p,Ca),p=nT(v,p,Ca)}c.memoizedProps=c.pendingProps,p===null?Gp(c):yr=p}function Vc(c,p,v,S){da=ml=null,iv(p),Ic=null,Du=0;var M=p.return;try{if(VP(c,M,p,v,_r)){li=1,Rp(c,Yn(v,c.current)),yr=null;return}}catch(R){if(M!==null)throw yr=M,R;li=1,Rp(c,Yn(v,c.current)),yr=null;return}p.flags&32768?(Sr||S===1?c=!0:Uc||(_r&536870912)!==0?c=!1:(uo=c=!0,(S===2||S===9||S===3||S===6)&&(S=Mn.current,S!==null&&S.tag===13&&(S.flags|=16384))),DT(p,c)):Gp(p)}function Gp(c){var p=c;do{if((p.flags&32768)!==0){DT(p,uo);return}c=p.return;var v=ZP(p.alternate,p,Ca);if(v!==null){yr=v;return}if(p=p.sibling,p!==null){yr=p;return}yr=p=c}while(p!==null);li===0&&(li=5)}function DT(c,p){do{var v=QP(c.alternate,c);if(v!==null){v.flags&=32767,yr=v;return}if(v=c.return,v!==null&&(v.flags|=32768,v.subtreeFlags=0,v.deletions=null),!p&&(c=c.sibling,c!==null)){yr=c;return}yr=c=v}while(c!==null);li=6,yr=null}function IT(c,p,v,S,M,R,Y,te,pe){c.cancelPendingCommit=null;do Kp();while(wi!==0);if((Rr&6)!==0)throw Error(n(327));if(p!==null){if(p===c.current)throw Error(n(177));if(R=p.lanes|p.childLanes,R|=Ab,nt(c,v,R,Y,te,pe),c===Wr&&(yr=Wr=null,_r=0),Gc=p,go=c,wa=v,Fv=R,$v=M,TT=S,(p.subtreeFlags&10256)!==0||(p.flags&10256)!==0?(c.callbackNode=null,c.callbackPriority=0,h8(Ie,function(){return qT(),null})):(c.callbackNode=null,c.callbackPriority=0),S=(p.flags&13878)!==0,(p.subtreeFlags&13878)!==0||S){S=$.T,$.T=null,M=W.p,W.p=2,Y=Rr,Rr|=4;try{JP(c,p,v)}finally{Rr=Y,W.p=M,$.T=S}}wi=1,FT(),$T(),PT()}}function FT(){if(wi===1){wi=0;var c=go,p=Gc,v=(p.flags&13878)!==0;if((p.subtreeFlags&13878)!==0||v){v=$.T,$.T=null;var S=W.p;W.p=2;var M=Rr;Rr|=4;try{bT(p,c);var R=e0,Y=kS(c.containerInfo),te=R.focusedElem,pe=R.selectionRange;if(Y!==te&&te&&te.ownerDocument&&wS(te.ownerDocument.documentElement,te)){if(pe!==null&&Sb(te)){var Le=pe.start,Ge=pe.end;if(Ge===void 0&&(Ge=Le),"selectionStart"in te)te.selectionStart=Le,te.selectionEnd=Math.min(Ge,te.value.length);else{var Qe=te.ownerDocument||document,Oe=Qe&&Qe.defaultView||window;if(Oe.getSelection){var Pe=Oe.getSelection(),jt=te.textContent.length,Jt=Math.min(pe.start,jt),Ur=pe.end===void 0?Jt:Math.min(pe.end,jt);!Pe.extend&&Jt>Ur&&(Y=Ur,Ur=Jt,Jt=Y);var Se=CS(te,Jt),_e=CS(te,Ur);if(Se&&_e&&(Pe.rangeCount!==1||Pe.anchorNode!==Se.node||Pe.anchorOffset!==Se.offset||Pe.focusNode!==_e.node||Pe.focusOffset!==_e.offset)){var Me=Qe.createRange();Me.setStart(Se.node,Se.offset),Pe.removeAllRanges(),Jt>Ur?(Pe.addRange(Me),Pe.extend(_e.node,_e.offset)):(Me.setEnd(_e.node,_e.offset),Pe.addRange(Me))}}}}for(Qe=[],Pe=te;Pe=Pe.parentNode;)Pe.nodeType===1&&Qe.push({element:Pe,left:Pe.scrollLeft,top:Pe.scrollTop});for(typeof te.focus=="function"&&te.focus(),te=0;te<Qe.length;te++){var Xe=Qe[te];Xe.element.scrollLeft=Xe.left,Xe.element.scrollTop=Xe.top}}sg=!!Jv,e0=Jv=null}finally{Rr=M,W.p=S,$.T=v}}c.current=p,wi=2}}function $T(){if(wi===2){wi=0;var c=go,p=Gc,v=(p.flags&8772)!==0;if((p.subtreeFlags&8772)!==0||v){v=$.T,$.T=null;var S=W.p;W.p=2;var M=Rr;Rr|=4;try{fT(c,p.alternate,p)}finally{Rr=M,W.p=S,$.T=v}}wi=3}}function PT(){if(wi===4||wi===3){wi=0,At();var c=go,p=Gc,v=wa,S=TT;(p.subtreeFlags&10256)!==0||(p.flags&10256)!==0?wi=5:(wi=0,Gc=go=null,zT(c,c.pendingLanes));var M=c.pendingLanes;if(M===0&&(po=null),ue(v),p=p.stateNode,ke&&typeof ke.onCommitFiberRoot=="function")try{ke.onCommitFiberRoot(Nt,p,void 0,(p.current.flags&128)===128)}catch{}if(S!==null){p=$.T,M=W.p,W.p=2,$.T=null;try{for(var R=c.onRecoverableError,Y=0;Y<S.length;Y++){var te=S[Y];R(te.value,{componentStack:te.stack})}}finally{$.T=p,W.p=M}}(wa&3)!==0&&Kp(),$s(c),M=c.pendingLanes,(v&261930)!==0&&(M&42)!==0?c===Pv?Ju++:(Ju=0,Pv=c):Ju=0,ed(0)}}function zT(c,p){(c.pooledCacheLanes&=p)===0&&(p=c.pooledCache,p!=null&&(c.pooledCache=null,Bu(p)))}function Kp(){return FT(),$T(),PT(),qT()}function qT(){if(wi!==5)return!1;var c=go,p=Fv;Fv=0;var v=ue(wa),S=$.T,M=W.p;try{W.p=32>v?32:v,$.T=null,v=$v,$v=null;var R=go,Y=wa;if(wi=0,Gc=go=null,wa=0,(Rr&6)!==0)throw Error(n(331));var te=Rr;if(Rr|=4,wT(R.current),xT(R,R.current,Y,v),Rr=te,ed(0,!1),ke&&typeof ke.onPostCommitFiberRoot=="function")try{ke.onPostCommitFiberRoot(Nt,R)}catch{}return!0}finally{W.p=M,$.T=S,zT(c,p)}}function HT(c,p,v){p=Yn(v,p),p=bv(c.stateNode,p,2),c=oo(c,p,2),c!==null&&(gt(c,2),$s(c))}function zr(c,p,v){if(c.tag===3)HT(c,c,v);else for(;p!==null;){if(p.tag===3){HT(p,c,v);break}else if(p.tag===1){var S=p.stateNode;if(typeof p.type.getDerivedStateFromError=="function"||typeof S.componentDidCatch=="function"&&(po===null||!po.has(S))){c=Yn(v,c),v=U2(2),S=oo(p,v,2),S!==null&&(W2(v,S,p,c),gt(S,2),$s(S));break}}p=p.return}}function Hv(c,p,v){var S=c.pingCache;if(S===null){S=c.pingCache=new r8;var M=new Set;S.set(p,M)}else M=S.get(p),M===void 0&&(M=new Set,S.set(p,M));M.has(v)||(Ov=!0,M.add(v),c=o8.bind(null,c,p,v),p.then(c,c))}function o8(c,p,v){var S=c.pingCache;S!==null&&S.delete(p),c.pingedLanes|=c.suspendedLanes&v,c.warmLanes&=~v,Wr===c&&(_r&v)===v&&(li===4||li===3&&(_r&62914560)===_r&&300>Lt()-zp?(Rr&2)===0&&Kc(c,0):Dv|=v,Wc===_r&&(Wc=0)),$s(c)}function UT(c,p){p===0&&(p=ot()),c=fl(c,p),c!==null&&(gt(c,p),$s(c))}function l8(c){var p=c.memoizedState,v=0;p!==null&&(v=p.retryLane),UT(c,v)}function c8(c,p){var v=0;switch(c.tag){case 31:case 13:var S=c.stateNode,M=c.memoizedState;M!==null&&(v=M.retryLane);break;case 19:S=c.stateNode;break;case 22:S=c.stateNode._retryCache;break;default:throw Error(n(314))}S!==null&&S.delete(p),UT(c,v)}function h8(c,p){return He(c,p)}var Vp=null,Yc=null,Uv=!1,Yp=!1,Wv=!1,yo=0;function $s(c){c!==Yc&&c.next===null&&(Yc===null?Vp=Yc=c:Yc=Yc.next=c),Yp=!0,Uv||(Uv=!0,d8())}function ed(c,p){if(!Wv&&Yp){Wv=!0;do for(var v=!1,S=Vp;S!==null;){if(c!==0){var M=S.pendingLanes;if(M===0)var R=0;else{var Y=S.suspendedLanes,te=S.pingedLanes;R=(1<<31-at(42|c)+1)-1,R&=M&~(Y&~te),R=R&201326741?R&201326741|1:R?R|2:0}R!==0&&(v=!0,VT(S,R))}else R=_r,R=ae(S,S===Wr?R:0,S.cancelPendingCommit!==null||S.timeoutHandle!==-1),(R&3)===0||Ae(S,R)||(v=!0,VT(S,R));S=S.next}while(v);Wv=!1}}function u8(){WT()}function WT(){Yp=Uv=!1;var c=0;yo!==0&&C8()&&(c=yo);for(var p=Lt(),v=null,S=Vp;S!==null;){var M=S.next,R=GT(S,p);R===0?(S.next=null,v===null?Vp=M:v.next=M,M===null&&(Yc=v)):(v=S,(c!==0||(R&3)!==0)&&(Yp=!0)),S=M}wi!==0&&wi!==5||ed(c),yo!==0&&(yo=0)}function GT(c,p){for(var v=c.suspendedLanes,S=c.pingedLanes,M=c.expirationTimes,R=c.pendingLanes&-62914561;0<R;){var Y=31-at(R),te=1<<Y,pe=M[Y];pe===-1?((te&v)===0||(te&S)!==0)&&(M[Y]=Ye(te,p)):pe<=p&&(c.expiredLanes|=te),R&=~te}if(p=Wr,v=_r,v=ae(c,c===p?v:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),S=c.callbackNode,v===0||c===p&&(Pr===2||Pr===9)||c.cancelPendingCommit!==null)return S!==null&&S!==null&&ut(S),c.callbackNode=null,c.callbackPriority=0;if((v&3)===0||Ae(c,v)){if(p=v&-v,p===c.callbackPriority)return p;switch(S!==null&&ut(S),ue(v)){case 2:case 8:v=Te;break;case 32:v=Ie;break;case 268435456:v=Je;break;default:v=Ie}return S=KT.bind(null,c),v=He(v,S),c.callbackPriority=p,c.callbackNode=v,p}return S!==null&&S!==null&&ut(S),c.callbackPriority=2,c.callbackNode=null,2}function KT(c,p){if(wi!==0&&wi!==5)return c.callbackNode=null,c.callbackPriority=0,null;var v=c.callbackNode;if(Kp()&&c.callbackNode!==v)return null;var S=_r;return S=ae(c,c===Wr?S:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),S===0?null:(NT(c,S,p),GT(c,Lt()),c.callbackNode!=null&&c.callbackNode===v?KT.bind(null,c):null)}function VT(c,p){if(Kp())return null;NT(c,p,!0)}function d8(){k8(function(){(Rr&6)!==0?He(mt,u8):WT()})}function Gv(){if(yo===0){var c=Bc;c===0&&(c=Ze,Ze<<=1,(Ze&261888)===0&&(Ze=256)),yo=c}return yo}function YT(c){return c==null||typeof c=="symbol"||typeof c=="boolean"?null:typeof c=="function"?c:Ja(""+c)}function XT(c,p){var v=p.ownerDocument.createElement("input");return v.name=p.name,v.value=p.value,c.id&&v.setAttribute("form",c.id),p.parentNode.insertBefore(v,p),c=new FormData(c),v.parentNode.removeChild(v),c}function f8(c,p,v,S,M){if(p==="submit"&&v&&v.stateNode===M){var R=YT((M[Tt]||null).action),Y=S.submitter;Y&&(p=(p=Y[Tt]||null)?YT(p.formAction):Y.getAttribute("formAction"),p!==null&&(R=p,Y=null));var te=new op("action","action",null,S,M);c.push({event:te,listeners:[{instance:null,listener:function(){if(S.defaultPrevented){if(yo!==0){var pe=Y?XT(M,Y):new FormData(M);dv(v,{pending:!0,data:pe,method:M.method,action:R},null,pe)}}else typeof R=="function"&&(te.preventDefault(),pe=Y?XT(M,Y):new FormData(M),dv(v,{pending:!0,data:pe,method:M.method,action:R},R,pe))},currentTarget:M}]})}}for(var Kv=0;Kv<jb.length;Kv++){var Vv=jb[Kv],p8=Vv.toLowerCase(),g8=Vv[0].toUpperCase()+Vv.slice(1);ys(p8,"on"+g8)}ys(ES,"onAnimationEnd"),ys(NS,"onAnimationIteration"),ys(jS,"onAnimationStart"),ys("dblclick","onDoubleClick"),ys("focusin","onFocus"),ys("focusout","onBlur"),ys(MP,"onTransitionRun"),ys(LP,"onTransitionStart"),ys(RP,"onTransitionCancel"),ys(AS,"onTransitionEnd"),je("onMouseEnter",["mouseout","mouseover"]),je("onMouseLeave",["mouseout","mouseover"]),je("onPointerEnter",["pointerout","pointerover"]),je("onPointerLeave",["pointerout","pointerover"]),Ue("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ue("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ue("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ue("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ue("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ue("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var td="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),m8=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(td));function ZT(c,p){p=(p&4)!==0;for(var v=0;v<c.length;v++){var S=c[v],M=S.event;S=S.listeners;e:{var R=void 0;if(p)for(var Y=S.length-1;0<=Y;Y--){var te=S[Y],pe=te.instance,Le=te.currentTarget;if(te=te.listener,pe!==R&&M.isPropagationStopped())break e;R=te,M.currentTarget=Le;try{R(M)}catch(Ge){hp(Ge)}M.currentTarget=null,R=pe}else for(Y=0;Y<S.length;Y++){if(te=S[Y],pe=te.instance,Le=te.currentTarget,te=te.listener,pe!==R&&M.isPropagationStopped())break e;R=te,M.currentTarget=Le;try{R(M)}catch(Ge){hp(Ge)}M.currentTarget=null,R=pe}}}}function br(c,p){var v=p[Qr];v===void 0&&(v=p[Qr]=new Set);var S=c+"__bubble";v.has(S)||(QT(p,c,2,!1),v.add(S))}function Yv(c,p,v){var S=0;p&&(S|=4),QT(v,c,S,p)}var Xp="_reactListening"+Math.random().toString(36).slice(2);function Xv(c){if(!c[Xp]){c[Xp]=!0,Et.forEach(function(v){v!=="selectionchange"&&(m8.has(v)||Yv(v,!1,c),Yv(v,!0,c))});var p=c.nodeType===9?c:c.ownerDocument;p===null||p[Xp]||(p[Xp]=!0,Yv("selectionchange",!1,p))}}function QT(c,p,v,S){switch(EE(p)){case 2:var M=U8;break;case 8:M=W8;break;default:M=u0}v=M.bind(null,p,v,c),M=void 0,!mb||p!=="touchstart"&&p!=="touchmove"&&p!=="wheel"||(M=!0),S?M!==void 0?c.addEventListener(p,v,{capture:!0,passive:M}):c.addEventListener(p,v,!0):M!==void 0?c.addEventListener(p,v,{passive:M}):c.addEventListener(p,v,!1)}function Zv(c,p,v,S,M){var R=S;if((p&1)===0&&(p&2)===0&&S!==null)e:for(;;){if(S===null)return;var Y=S.tag;if(Y===3||Y===4){var te=S.stateNode.containerInfo;if(te===M)break;if(Y===4)for(Y=S.return;Y!==null;){var pe=Y.tag;if((pe===3||pe===4)&&Y.stateNode.containerInfo===M)return;Y=Y.return}for(;te!==null;){if(Y=_i(te),Y===null)return;if(pe=Y.tag,pe===5||pe===6||pe===26||pe===27){S=R=Y;continue e}te=te.parentNode}}S=S.return}ip(function(){var Le=R,Ge=cr(v),Qe=[];e:{var Oe=MS.get(c);if(Oe!==void 0){var Pe=op,jt=c;switch(c){case"keypress":if(sp(v)===0)break e;case"keydown":case"keyup":Pe=cP;break;case"focusin":jt="focus",Pe=xb;break;case"focusout":jt="blur",Pe=xb;break;case"beforeblur":case"afterblur":Pe=xb;break;case"click":if(v.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Pe=aS;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Pe=Z$;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Pe=dP;break;case ES:case NS:case jS:Pe=eP;break;case AS:Pe=pP;break;case"scroll":case"scrollend":Pe=Y$;break;case"wheel":Pe=mP;break;case"copy":case"cut":case"paste":Pe=rP;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Pe=lS;break;case"toggle":case"beforetoggle":Pe=bP}var Jt=(p&4)!==0,Ur=!Jt&&(c==="scroll"||c==="scrollend"),Se=Jt?Oe!==null?Oe+"Capture":null:Oe;Jt=[];for(var _e=Le,Me;_e!==null;){var Xe=_e;if(Me=Xe.stateNode,Xe=Xe.tag,Xe!==5&&Xe!==26&&Xe!==27||Me===null||Se===null||(Xe=wu(_e,Se),Xe!=null&&Jt.push(rd(_e,Xe,Me))),Ur)break;_e=_e.return}0<Jt.length&&(Oe=new Pe(Oe,jt,null,v,Ge),Qe.push({event:Oe,listeners:Jt}))}}if((p&7)===0){e:{if(Oe=c==="mouseover"||c==="pointerover",Pe=c==="mouseout"||c==="pointerout",Oe&&v!==Ot&&(jt=v.relatedTarget||v.fromElement)&&(_i(jt)||jt[er]))break e;if((Pe||Oe)&&(Oe=Ge.window===Ge?Ge:(Oe=Ge.ownerDocument)?Oe.defaultView||Oe.parentWindow:window,Pe?(jt=v.relatedTarget||v.toElement,Pe=Le,jt=jt?_i(jt):null,jt!==null&&(Ur=o(jt),Jt=jt.tag,jt!==Ur||Jt!==5&&Jt!==27&&Jt!==6)&&(jt=null)):(Pe=null,jt=Le),Pe!==jt)){if(Jt=aS,Xe="onMouseLeave",Se="onMouseEnter",_e="mouse",(c==="pointerout"||c==="pointerover")&&(Jt=lS,Xe="onPointerLeave",Se="onPointerEnter",_e="pointer"),Ur=Pe==null?Oe:pn(Pe),Me=jt==null?Oe:pn(jt),Oe=new Jt(Xe,_e+"leave",Pe,v,Ge),Oe.target=Ur,Oe.relatedTarget=Me,Xe=null,_i(Ge)===Le&&(Jt=new Jt(Se,_e+"enter",jt,v,Ge),Jt.target=Me,Jt.relatedTarget=Ur,Xe=Jt),Ur=Xe,Pe&&jt)t:{for(Jt=y8,Se=Pe,_e=jt,Me=0,Xe=Se;Xe;Xe=Jt(Xe))Me++;Xe=0;for(var Kt=_e;Kt;Kt=Jt(Kt))Xe++;for(;0<Me-Xe;)Se=Jt(Se),Me--;for(;0<Xe-Me;)_e=Jt(_e),Xe--;for(;Me--;){if(Se===_e||_e!==null&&Se===_e.alternate){Jt=Se;break t}Se=Jt(Se),_e=Jt(_e)}Jt=null}else Jt=null;Pe!==null&&JT(Qe,Oe,Pe,Jt,!1),jt!==null&&Ur!==null&&JT(Qe,Ur,jt,Jt,!0)}}e:{if(Oe=Le?pn(Le):window,Pe=Oe.nodeName&&Oe.nodeName.toLowerCase(),Pe==="select"||Pe==="input"&&Oe.type==="file")var jr=mS;else if(pS(Oe))if(yS)jr=NP;else{jr=TP;var Dt=SP}else Pe=Oe.nodeName,!Pe||Pe.toLowerCase()!=="input"||Oe.type!=="checkbox"&&Oe.type!=="radio"?Le&&Ui(Le.elementType)&&(jr=mS):jr=EP;if(jr&&(jr=jr(c,Le))){gS(Qe,jr,v,Ge);break e}Dt&&Dt(c,Oe,Le),c==="focusout"&&Le&&Oe.type==="number"&&Le.memoizedProps.value!=null&&st(Oe,"number",Oe.value)}switch(Dt=Le?pn(Le):window,c){case"focusin":(pS(Dt)||Dt.contentEditable==="true")&&(Tc=Dt,Tb=Le,Mu=null);break;case"focusout":Mu=Tb=Tc=null;break;case"mousedown":Eb=!0;break;case"contextmenu":case"mouseup":case"dragend":Eb=!1,SS(Qe,v,Ge);break;case"selectionchange":if(AP)break;case"keydown":case"keyup":SS(Qe,v,Ge)}var dr;if(Cb)e:{switch(c){case"compositionstart":var Cr="onCompositionStart";break e;case"compositionend":Cr="onCompositionEnd";break e;case"compositionupdate":Cr="onCompositionUpdate";break e}Cr=void 0}else Sc?dS(c,v)&&(Cr="onCompositionEnd"):c==="keydown"&&v.keyCode===229&&(Cr="onCompositionStart");Cr&&(cS&&v.locale!=="ko"&&(Sc||Cr!=="onCompositionStart"?Cr==="onCompositionEnd"&&Sc&&(dr=nS()):(eo=Ge,yb="value"in eo?eo.value:eo.textContent,Sc=!0)),Dt=Zp(Le,Cr),0<Dt.length&&(Cr=new oS(Cr,c,null,v,Ge),Qe.push({event:Cr,listeners:Dt}),dr?Cr.data=dr:(dr=fS(v),dr!==null&&(Cr.data=dr)))),(dr=xP?_P(c,v):CP(c,v))&&(Cr=Zp(Le,"onBeforeInput"),0<Cr.length&&(Dt=new oS("onBeforeInput","beforeinput",null,v,Ge),Qe.push({event:Dt,listeners:Cr}),Dt.data=dr)),f8(Qe,c,Le,v,Ge)}ZT(Qe,p)})}function rd(c,p,v){return{instance:c,listener:p,currentTarget:v}}function Zp(c,p){for(var v=p+"Capture",S=[];c!==null;){var M=c,R=M.stateNode;if(M=M.tag,M!==5&&M!==26&&M!==27||R===null||(M=wu(c,v),M!=null&&S.unshift(rd(c,M,R)),M=wu(c,p),M!=null&&S.push(rd(c,M,R))),c.tag===3)return S;c=c.return}return[]}function y8(c){if(c===null)return null;do c=c.return;while(c&&c.tag!==5&&c.tag!==27);return c||null}function JT(c,p,v,S,M){for(var R=p._reactName,Y=[];v!==null&&v!==S;){var te=v,pe=te.alternate,Le=te.stateNode;if(te=te.tag,pe!==null&&pe===S)break;te!==5&&te!==26&&te!==27||Le===null||(pe=Le,M?(Le=wu(v,R),Le!=null&&Y.unshift(rd(v,Le,pe))):M||(Le=wu(v,R),Le!=null&&Y.push(rd(v,Le,pe)))),v=v.return}Y.length!==0&&c.push({event:p,listeners:Y})}var b8=/\r\n?/g,v8=/\u0000|\uFFFD/g;function eE(c){return(typeof c=="string"?c:""+c).replace(b8,`
50
- `).replace(v8,"")}function tE(c,p){return p=eE(p),eE(c)===p}function Hr(c,p,v,S,M,R){switch(v){case"children":typeof S=="string"?p==="body"||p==="textarea"&&S===""||bt(c,S):(typeof S=="number"||typeof S=="bigint")&&p!=="body"&&bt(c,""+S);break;case"className":kr(c,"class",S);break;case"tabIndex":kr(c,"tabindex",S);break;case"dir":case"role":case"viewBox":case"width":case"height":kr(c,v,S);break;case"style":vr(c,S,R);break;case"data":if(p!=="object"){kr(c,"data",S);break}case"src":case"href":if(S===""&&(p!=="a"||v!=="href")){c.removeAttribute(v);break}if(S==null||typeof S=="function"||typeof S=="symbol"||typeof S=="boolean"){c.removeAttribute(v);break}S=Ja(""+S),c.setAttribute(v,S);break;case"action":case"formAction":if(typeof S=="function"){c.setAttribute(v,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof R=="function"&&(v==="formAction"?(p!=="input"&&Hr(c,p,"name",M.name,M,null),Hr(c,p,"formEncType",M.formEncType,M,null),Hr(c,p,"formMethod",M.formMethod,M,null),Hr(c,p,"formTarget",M.formTarget,M,null)):(Hr(c,p,"encType",M.encType,M,null),Hr(c,p,"method",M.method,M,null),Hr(c,p,"target",M.target,M,null)));if(S==null||typeof S=="symbol"||typeof S=="boolean"){c.removeAttribute(v);break}S=Ja(""+S),c.setAttribute(v,S);break;case"onClick":S!=null&&(c.onclick=ft);break;case"onScroll":S!=null&&br("scroll",c);break;case"onScrollEnd":S!=null&&br("scrollend",c);break;case"dangerouslySetInnerHTML":if(S!=null){if(typeof S!="object"||!("__html"in S))throw Error(n(61));if(v=S.__html,v!=null){if(M.children!=null)throw Error(n(60));c.innerHTML=v}}break;case"multiple":c.multiple=S&&typeof S!="function"&&typeof S!="symbol";break;case"muted":c.muted=S&&typeof S!="function"&&typeof S!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(S==null||typeof S=="function"||typeof S=="boolean"||typeof S=="symbol"){c.removeAttribute("xlink:href");break}v=Ja(""+S),c.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",v);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":S!=null&&typeof S!="function"&&typeof S!="symbol"?c.setAttribute(v,""+S):c.removeAttribute(v);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":S&&typeof S!="function"&&typeof S!="symbol"?c.setAttribute(v,""):c.removeAttribute(v);break;case"capture":case"download":S===!0?c.setAttribute(v,""):S!==!1&&S!=null&&typeof S!="function"&&typeof S!="symbol"?c.setAttribute(v,S):c.removeAttribute(v);break;case"cols":case"rows":case"size":case"span":S!=null&&typeof S!="function"&&typeof S!="symbol"&&!isNaN(S)&&1<=S?c.setAttribute(v,S):c.removeAttribute(v);break;case"rowSpan":case"start":S==null||typeof S=="function"||typeof S=="symbol"||isNaN(S)?c.removeAttribute(v):c.setAttribute(v,S);break;case"popover":br("beforetoggle",c),br("toggle",c),Or(c,"popover",S);break;case"xlinkActuate":ii(c,"http://www.w3.org/1999/xlink","xlink:actuate",S);break;case"xlinkArcrole":ii(c,"http://www.w3.org/1999/xlink","xlink:arcrole",S);break;case"xlinkRole":ii(c,"http://www.w3.org/1999/xlink","xlink:role",S);break;case"xlinkShow":ii(c,"http://www.w3.org/1999/xlink","xlink:show",S);break;case"xlinkTitle":ii(c,"http://www.w3.org/1999/xlink","xlink:title",S);break;case"xlinkType":ii(c,"http://www.w3.org/1999/xlink","xlink:type",S);break;case"xmlBase":ii(c,"http://www.w3.org/XML/1998/namespace","xml:base",S);break;case"xmlLang":ii(c,"http://www.w3.org/XML/1998/namespace","xml:lang",S);break;case"xmlSpace":ii(c,"http://www.w3.org/XML/1998/namespace","xml:space",S);break;case"is":Or(c,"is",S);break;case"innerText":case"textContent":break;default:(!(2<v.length)||v[0]!=="o"&&v[0]!=="O"||v[1]!=="n"&&v[1]!=="N")&&(v=Gn.get(v)||v,Or(c,v,S))}}function Qv(c,p,v,S,M,R){switch(v){case"style":vr(c,S,R);break;case"dangerouslySetInnerHTML":if(S!=null){if(typeof S!="object"||!("__html"in S))throw Error(n(61));if(v=S.__html,v!=null){if(M.children!=null)throw Error(n(60));c.innerHTML=v}}break;case"children":typeof S=="string"?bt(c,S):(typeof S=="number"||typeof S=="bigint")&&bt(c,""+S);break;case"onScroll":S!=null&&br("scroll",c);break;case"onScrollEnd":S!=null&&br("scrollend",c);break;case"onClick":S!=null&&(c.onclick=ft);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!oe.hasOwnProperty(v))e:{if(v[0]==="o"&&v[1]==="n"&&(M=v.endsWith("Capture"),p=v.slice(2,M?v.length-7:void 0),R=c[Tt]||null,R=R!=null?R[v]:null,typeof R=="function"&&c.removeEventListener(p,R,M),typeof S=="function")){typeof R!="function"&&R!==null&&(v in c?c[v]=null:c.hasAttribute(v)&&c.removeAttribute(v)),c.addEventListener(p,S,M);break e}v in c?c[v]=S:S===!0?c.setAttribute(v,""):Or(c,v,S)}}}function Fi(c,p,v){switch(p){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":br("error",c),br("load",c);var S=!1,M=!1,R;for(R in v)if(v.hasOwnProperty(R)){var Y=v[R];if(Y!=null)switch(R){case"src":S=!0;break;case"srcSet":M=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(n(137,p));default:Hr(c,p,R,Y,v,null)}}M&&Hr(c,p,"srcSet",v.srcSet,v,null),S&&Hr(c,p,"src",v.src,v,null);return;case"input":br("invalid",c);var te=R=Y=M=null,pe=null,Le=null;for(S in v)if(v.hasOwnProperty(S)){var Ge=v[S];if(Ge!=null)switch(S){case"name":M=Ge;break;case"type":Y=Ge;break;case"checked":pe=Ge;break;case"defaultChecked":Le=Ge;break;case"value":R=Ge;break;case"defaultValue":te=Ge;break;case"children":case"dangerouslySetInnerHTML":if(Ge!=null)throw Error(n(137,p));break;default:Hr(c,p,S,Ge,v,null)}}Re(c,R,te,pe,Le,Y,M,!1);return;case"select":br("invalid",c),S=Y=R=null;for(M in v)if(v.hasOwnProperty(M)&&(te=v[M],te!=null))switch(M){case"value":R=te;break;case"defaultValue":Y=te;break;case"multiple":S=te;default:Hr(c,p,M,te,v,null)}p=R,v=Y,c.multiple=!!S,p!=null?it(c,!!S,p,!1):v!=null&&it(c,!!S,v,!0);return;case"textarea":br("invalid",c),R=M=S=null;for(Y in v)if(v.hasOwnProperty(Y)&&(te=v[Y],te!=null))switch(Y){case"value":S=te;break;case"defaultValue":M=te;break;case"children":R=te;break;case"dangerouslySetInnerHTML":if(te!=null)throw Error(n(91));break;default:Hr(c,p,Y,te,v,null)}ur(c,S,M,R);return;case"option":for(pe in v)if(v.hasOwnProperty(pe)&&(S=v[pe],S!=null))switch(pe){case"selected":c.selected=S&&typeof S!="function"&&typeof S!="symbol";break;default:Hr(c,p,pe,S,v,null)}return;case"dialog":br("beforetoggle",c),br("toggle",c),br("cancel",c),br("close",c);break;case"iframe":case"object":br("load",c);break;case"video":case"audio":for(S=0;S<td.length;S++)br(td[S],c);break;case"image":br("error",c),br("load",c);break;case"details":br("toggle",c);break;case"embed":case"source":case"link":br("error",c),br("load",c);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Le in v)if(v.hasOwnProperty(Le)&&(S=v[Le],S!=null))switch(Le){case"children":case"dangerouslySetInnerHTML":throw Error(n(137,p));default:Hr(c,p,Le,S,v,null)}return;default:if(Ui(p)){for(Ge in v)v.hasOwnProperty(Ge)&&(S=v[Ge],S!==void 0&&Qv(c,p,Ge,S,v,void 0));return}}for(te in v)v.hasOwnProperty(te)&&(S=v[te],S!=null&&Hr(c,p,te,S,v,null))}function x8(c,p,v,S){switch(p){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var M=null,R=null,Y=null,te=null,pe=null,Le=null,Ge=null;for(Pe in v){var Qe=v[Pe];if(v.hasOwnProperty(Pe)&&Qe!=null)switch(Pe){case"checked":break;case"value":break;case"defaultValue":pe=Qe;default:S.hasOwnProperty(Pe)||Hr(c,p,Pe,null,S,Qe)}}for(var Oe in S){var Pe=S[Oe];if(Qe=v[Oe],S.hasOwnProperty(Oe)&&(Pe!=null||Qe!=null))switch(Oe){case"type":R=Pe;break;case"name":M=Pe;break;case"checked":Le=Pe;break;case"defaultChecked":Ge=Pe;break;case"value":Y=Pe;break;case"defaultValue":te=Pe;break;case"children":case"dangerouslySetInnerHTML":if(Pe!=null)throw Error(n(137,p));break;default:Pe!==Qe&&Hr(c,p,Oe,Pe,S,Qe)}}Wn(c,Y,te,pe,Le,Ge,R,M);return;case"select":Pe=Y=te=Oe=null;for(R in v)if(pe=v[R],v.hasOwnProperty(R)&&pe!=null)switch(R){case"value":break;case"multiple":Pe=pe;default:S.hasOwnProperty(R)||Hr(c,p,R,null,S,pe)}for(M in S)if(R=S[M],pe=v[M],S.hasOwnProperty(M)&&(R!=null||pe!=null))switch(M){case"value":Oe=R;break;case"defaultValue":te=R;break;case"multiple":Y=R;default:R!==pe&&Hr(c,p,M,R,S,pe)}p=te,v=Y,S=Pe,Oe!=null?it(c,!!v,Oe,!1):!!S!=!!v&&(p!=null?it(c,!!v,p,!0):it(c,!!v,v?[]:"",!1));return;case"textarea":Pe=Oe=null;for(te in v)if(M=v[te],v.hasOwnProperty(te)&&M!=null&&!S.hasOwnProperty(te))switch(te){case"value":break;case"children":break;default:Hr(c,p,te,null,S,M)}for(Y in S)if(M=S[Y],R=v[Y],S.hasOwnProperty(Y)&&(M!=null||R!=null))switch(Y){case"value":Oe=M;break;case"defaultValue":Pe=M;break;case"children":break;case"dangerouslySetInnerHTML":if(M!=null)throw Error(n(91));break;default:M!==R&&Hr(c,p,Y,M,S,R)}_t(c,Oe,Pe);return;case"option":for(var jt in v)if(Oe=v[jt],v.hasOwnProperty(jt)&&Oe!=null&&!S.hasOwnProperty(jt))switch(jt){case"selected":c.selected=!1;break;default:Hr(c,p,jt,null,S,Oe)}for(pe in S)if(Oe=S[pe],Pe=v[pe],S.hasOwnProperty(pe)&&Oe!==Pe&&(Oe!=null||Pe!=null))switch(pe){case"selected":c.selected=Oe&&typeof Oe!="function"&&typeof Oe!="symbol";break;default:Hr(c,p,pe,Oe,S,Pe)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Jt in v)Oe=v[Jt],v.hasOwnProperty(Jt)&&Oe!=null&&!S.hasOwnProperty(Jt)&&Hr(c,p,Jt,null,S,Oe);for(Le in S)if(Oe=S[Le],Pe=v[Le],S.hasOwnProperty(Le)&&Oe!==Pe&&(Oe!=null||Pe!=null))switch(Le){case"children":case"dangerouslySetInnerHTML":if(Oe!=null)throw Error(n(137,p));break;default:Hr(c,p,Le,Oe,S,Pe)}return;default:if(Ui(p)){for(var Ur in v)Oe=v[Ur],v.hasOwnProperty(Ur)&&Oe!==void 0&&!S.hasOwnProperty(Ur)&&Qv(c,p,Ur,void 0,S,Oe);for(Ge in S)Oe=S[Ge],Pe=v[Ge],!S.hasOwnProperty(Ge)||Oe===Pe||Oe===void 0&&Pe===void 0||Qv(c,p,Ge,Oe,S,Pe);return}}for(var Se in v)Oe=v[Se],v.hasOwnProperty(Se)&&Oe!=null&&!S.hasOwnProperty(Se)&&Hr(c,p,Se,null,S,Oe);for(Qe in S)Oe=S[Qe],Pe=v[Qe],!S.hasOwnProperty(Qe)||Oe===Pe||Oe==null&&Pe==null||Hr(c,p,Qe,Oe,S,Pe)}function rE(c){switch(c){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function _8(){if(typeof performance.getEntriesByType=="function"){for(var c=0,p=0,v=performance.getEntriesByType("resource"),S=0;S<v.length;S++){var M=v[S],R=M.transferSize,Y=M.initiatorType,te=M.duration;if(R&&te&&rE(Y)){for(Y=0,te=M.responseEnd,S+=1;S<v.length;S++){var pe=v[S],Le=pe.startTime;if(Le>te)break;var Ge=pe.transferSize,Qe=pe.initiatorType;Ge&&rE(Qe)&&(pe=pe.responseEnd,Y+=Ge*(pe<te?1:(te-Le)/(pe-Le)))}if(--S,p+=8*(R+Y)/(M.duration/1e3),c++,10<c)break}}if(0<c)return p/c/1e6}return navigator.connection&&(c=navigator.connection.downlink,typeof c=="number")?c:5}var Jv=null,e0=null;function Qp(c){return c.nodeType===9?c:c.ownerDocument}function iE(c){switch(c){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function nE(c,p){if(c===0)switch(p){case"svg":return 1;case"math":return 2;default:return 0}return c===1&&p==="foreignObject"?0:c}function t0(c,p){return c==="textarea"||c==="noscript"||typeof p.children=="string"||typeof p.children=="number"||typeof p.children=="bigint"||typeof p.dangerouslySetInnerHTML=="object"&&p.dangerouslySetInnerHTML!==null&&p.dangerouslySetInnerHTML.__html!=null}var r0=null;function C8(){var c=window.event;return c&&c.type==="popstate"?c===r0?!1:(r0=c,!0):(r0=null,!1)}var sE=typeof setTimeout=="function"?setTimeout:void 0,w8=typeof clearTimeout=="function"?clearTimeout:void 0,aE=typeof Promise=="function"?Promise:void 0,k8=typeof queueMicrotask=="function"?queueMicrotask:typeof aE<"u"?function(c){return aE.resolve(null).then(c).catch(S8)}:sE;function S8(c){setTimeout(function(){throw c})}function bo(c){return c==="head"}function oE(c,p){var v=p,S=0;do{var M=v.nextSibling;if(c.removeChild(v),M&&M.nodeType===8)if(v=M.data,v==="/$"||v==="/&"){if(S===0){c.removeChild(M),Jc(p);return}S--}else if(v==="$"||v==="$?"||v==="$~"||v==="$!"||v==="&")S++;else if(v==="html")id(c.ownerDocument.documentElement);else if(v==="head"){v=c.ownerDocument.head,id(v);for(var R=v.firstChild;R;){var Y=R.nextSibling,te=R.nodeName;R[Hn]||te==="SCRIPT"||te==="STYLE"||te==="LINK"&&R.rel.toLowerCase()==="stylesheet"||v.removeChild(R),R=Y}}else v==="body"&&id(c.ownerDocument.body);v=M}while(v);Jc(p)}function lE(c,p){var v=c;c=0;do{var S=v.nextSibling;if(v.nodeType===1?p?(v._stashedDisplay=v.style.display,v.style.display="none"):(v.style.display=v._stashedDisplay||"",v.getAttribute("style")===""&&v.removeAttribute("style")):v.nodeType===3&&(p?(v._stashedText=v.nodeValue,v.nodeValue=""):v.nodeValue=v._stashedText||""),S&&S.nodeType===8)if(v=S.data,v==="/$"){if(c===0)break;c--}else v!=="$"&&v!=="$?"&&v!=="$~"&&v!=="$!"||c++;v=S}while(v)}function i0(c){var p=c.firstChild;for(p&&p.nodeType===10&&(p=p.nextSibling);p;){var v=p;switch(p=p.nextSibling,v.nodeName){case"HTML":case"HEAD":case"BODY":i0(v),Os(v);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(v.rel.toLowerCase()==="stylesheet")continue}c.removeChild(v)}}function T8(c,p,v,S){for(;c.nodeType===1;){var M=v;if(c.nodeName.toLowerCase()!==p.toLowerCase()){if(!S&&(c.nodeName!=="INPUT"||c.type!=="hidden"))break}else if(S){if(!c[Hn])switch(p){case"meta":if(!c.hasAttribute("itemprop"))break;return c;case"link":if(R=c.getAttribute("rel"),R==="stylesheet"&&c.hasAttribute("data-precedence"))break;if(R!==M.rel||c.getAttribute("href")!==(M.href==null||M.href===""?null:M.href)||c.getAttribute("crossorigin")!==(M.crossOrigin==null?null:M.crossOrigin)||c.getAttribute("title")!==(M.title==null?null:M.title))break;return c;case"style":if(c.hasAttribute("data-precedence"))break;return c;case"script":if(R=c.getAttribute("src"),(R!==(M.src==null?null:M.src)||c.getAttribute("type")!==(M.type==null?null:M.type)||c.getAttribute("crossorigin")!==(M.crossOrigin==null?null:M.crossOrigin))&&R&&c.hasAttribute("async")&&!c.hasAttribute("itemprop"))break;return c;default:return c}}else if(p==="input"&&c.type==="hidden"){var R=M.name==null?null:""+M.name;if(M.type==="hidden"&&c.getAttribute("name")===R)return c}else return c;if(c=es(c.nextSibling),c===null)break}return null}function E8(c,p,v){if(p==="")return null;for(;c.nodeType!==3;)if((c.nodeType!==1||c.nodeName!=="INPUT"||c.type!=="hidden")&&!v||(c=es(c.nextSibling),c===null))return null;return c}function cE(c,p){for(;c.nodeType!==8;)if((c.nodeType!==1||c.nodeName!=="INPUT"||c.type!=="hidden")&&!p||(c=es(c.nextSibling),c===null))return null;return c}function n0(c){return c.data==="$?"||c.data==="$~"}function s0(c){return c.data==="$!"||c.data==="$?"&&c.ownerDocument.readyState!=="loading"}function N8(c,p){var v=c.ownerDocument;if(c.data==="$~")c._reactRetry=p;else if(c.data!=="$?"||v.readyState!=="loading")p();else{var S=function(){p(),v.removeEventListener("DOMContentLoaded",S)};v.addEventListener("DOMContentLoaded",S),c._reactRetry=S}}function es(c){for(;c!=null;c=c.nextSibling){var p=c.nodeType;if(p===1||p===3)break;if(p===8){if(p=c.data,p==="$"||p==="$!"||p==="$?"||p==="$~"||p==="&"||p==="F!"||p==="F")break;if(p==="/$"||p==="/&")return null}}return c}var a0=null;function hE(c){c=c.nextSibling;for(var p=0;c;){if(c.nodeType===8){var v=c.data;if(v==="/$"||v==="/&"){if(p===0)return es(c.nextSibling);p--}else v!=="$"&&v!=="$!"&&v!=="$?"&&v!=="$~"&&v!=="&"||p++}c=c.nextSibling}return null}function uE(c){c=c.previousSibling;for(var p=0;c;){if(c.nodeType===8){var v=c.data;if(v==="$"||v==="$!"||v==="$?"||v==="$~"||v==="&"){if(p===0)return c;p--}else v!=="/$"&&v!=="/&"||p++}c=c.previousSibling}return null}function dE(c,p,v){switch(p=Qp(v),c){case"html":if(c=p.documentElement,!c)throw Error(n(452));return c;case"head":if(c=p.head,!c)throw Error(n(453));return c;case"body":if(c=p.body,!c)throw Error(n(454));return c;default:throw Error(n(451))}}function id(c){for(var p=c.attributes;p.length;)c.removeAttributeNode(p[0]);Os(c)}var ts=new Map,fE=new Set;function Jp(c){return typeof c.getRootNode=="function"?c.getRootNode():c.nodeType===9?c:c.ownerDocument}var ka=W.d;W.d={f:j8,r:A8,D:M8,C:L8,L:R8,m:B8,X:D8,S:O8,M:I8};function j8(){var c=ka.f(),p=Up();return c||p}function A8(c){var p=en(c);p!==null&&p.tag===5&&p.type==="form"?A2(p):ka.r(c)}var Xc=typeof document>"u"?null:document;function pE(c,p,v){var S=Xc;if(S&&typeof p=="string"&&p){var M=Bi(p);M='link[rel="'+c+'"][href="'+M+'"]',typeof v=="string"&&(M+='[crossorigin="'+v+'"]'),fE.has(M)||(fE.add(M),c={rel:c,crossOrigin:v,href:p},S.querySelector(M)===null&&(p=S.createElement("link"),Fi(p,"link",c),Br(p),S.head.appendChild(p)))}}function M8(c){ka.D(c),pE("dns-prefetch",c,null)}function L8(c,p){ka.C(c,p),pE("preconnect",c,p)}function R8(c,p,v){ka.L(c,p,v);var S=Xc;if(S&&c&&p){var M='link[rel="preload"][as="'+Bi(p)+'"]';p==="image"&&v&&v.imageSrcSet?(M+='[imagesrcset="'+Bi(v.imageSrcSet)+'"]',typeof v.imageSizes=="string"&&(M+='[imagesizes="'+Bi(v.imageSizes)+'"]')):M+='[href="'+Bi(c)+'"]';var R=M;switch(p){case"style":R=Zc(c);break;case"script":R=Qc(c)}ts.has(R)||(c=f({rel:"preload",href:p==="image"&&v&&v.imageSrcSet?void 0:c,as:p},v),ts.set(R,c),S.querySelector(M)!==null||p==="style"&&S.querySelector(nd(R))||p==="script"&&S.querySelector(sd(R))||(p=S.createElement("link"),Fi(p,"link",c),Br(p),S.head.appendChild(p)))}}function B8(c,p){ka.m(c,p);var v=Xc;if(v&&c){var S=p&&typeof p.as=="string"?p.as:"script",M='link[rel="modulepreload"][as="'+Bi(S)+'"][href="'+Bi(c)+'"]',R=M;switch(S){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":R=Qc(c)}if(!ts.has(R)&&(c=f({rel:"modulepreload",href:c},p),ts.set(R,c),v.querySelector(M)===null)){switch(S){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(v.querySelector(sd(R)))return}S=v.createElement("link"),Fi(S,"link",c),Br(S),v.head.appendChild(S)}}}function O8(c,p,v){ka.S(c,p,v);var S=Xc;if(S&&c){var M=Ci(S).hoistableStyles,R=Zc(c);p=p||"default";var Y=M.get(R);if(!Y){var te={loading:0,preload:null};if(Y=S.querySelector(nd(R)))te.loading=5;else{c=f({rel:"stylesheet",href:c,"data-precedence":p},v),(v=ts.get(R))&&o0(c,v);var pe=Y=S.createElement("link");Br(pe),Fi(pe,"link",c),pe._p=new Promise(function(Le,Ge){pe.onload=Le,pe.onerror=Ge}),pe.addEventListener("load",function(){te.loading|=1}),pe.addEventListener("error",function(){te.loading|=2}),te.loading|=4,eg(Y,p,S)}Y={type:"stylesheet",instance:Y,count:1,state:te},M.set(R,Y)}}}function D8(c,p){ka.X(c,p);var v=Xc;if(v&&c){var S=Ci(v).hoistableScripts,M=Qc(c),R=S.get(M);R||(R=v.querySelector(sd(M)),R||(c=f({src:c,async:!0},p),(p=ts.get(M))&&l0(c,p),R=v.createElement("script"),Br(R),Fi(R,"link",c),v.head.appendChild(R)),R={type:"script",instance:R,count:1,state:null},S.set(M,R))}}function I8(c,p){ka.M(c,p);var v=Xc;if(v&&c){var S=Ci(v).hoistableScripts,M=Qc(c),R=S.get(M);R||(R=v.querySelector(sd(M)),R||(c=f({src:c,async:!0,type:"module"},p),(p=ts.get(M))&&l0(c,p),R=v.createElement("script"),Br(R),Fi(R,"link",c),v.head.appendChild(R)),R={type:"script",instance:R,count:1,state:null},S.set(M,R))}}function gE(c,p,v,S){var M=(M=fe.current)?Jp(M):null;if(!M)throw Error(n(446));switch(c){case"meta":case"title":return null;case"style":return typeof v.precedence=="string"&&typeof v.href=="string"?(p=Zc(v.href),v=Ci(M).hoistableStyles,S=v.get(p),S||(S={type:"style",instance:null,count:0,state:null},v.set(p,S)),S):{type:"void",instance:null,count:0,state:null};case"link":if(v.rel==="stylesheet"&&typeof v.href=="string"&&typeof v.precedence=="string"){c=Zc(v.href);var R=Ci(M).hoistableStyles,Y=R.get(c);if(Y||(M=M.ownerDocument||M,Y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},R.set(c,Y),(R=M.querySelector(nd(c)))&&!R._p&&(Y.instance=R,Y.state.loading=5),ts.has(c)||(v={rel:"preload",as:"style",href:v.href,crossOrigin:v.crossOrigin,integrity:v.integrity,media:v.media,hrefLang:v.hrefLang,referrerPolicy:v.referrerPolicy},ts.set(c,v),R||F8(M,c,v,Y.state))),p&&S===null)throw Error(n(528,""));return Y}if(p&&S!==null)throw Error(n(529,""));return null;case"script":return p=v.async,v=v.src,typeof v=="string"&&p&&typeof p!="function"&&typeof p!="symbol"?(p=Qc(v),v=Ci(M).hoistableScripts,S=v.get(p),S||(S={type:"script",instance:null,count:0,state:null},v.set(p,S)),S):{type:"void",instance:null,count:0,state:null};default:throw Error(n(444,c))}}function Zc(c){return'href="'+Bi(c)+'"'}function nd(c){return'link[rel="stylesheet"]['+c+"]"}function mE(c){return f({},c,{"data-precedence":c.precedence,precedence:null})}function F8(c,p,v,S){c.querySelector('link[rel="preload"][as="style"]['+p+"]")?S.loading=1:(p=c.createElement("link"),S.preload=p,p.addEventListener("load",function(){return S.loading|=1}),p.addEventListener("error",function(){return S.loading|=2}),Fi(p,"link",v),Br(p),c.head.appendChild(p))}function Qc(c){return'[src="'+Bi(c)+'"]'}function sd(c){return"script[async]"+c}function yE(c,p,v){if(p.count++,p.instance===null)switch(p.type){case"style":var S=c.querySelector('style[data-href~="'+Bi(v.href)+'"]');if(S)return p.instance=S,Br(S),S;var M=f({},v,{"data-href":v.href,"data-precedence":v.precedence,href:null,precedence:null});return S=(c.ownerDocument||c).createElement("style"),Br(S),Fi(S,"style",M),eg(S,v.precedence,c),p.instance=S;case"stylesheet":M=Zc(v.href);var R=c.querySelector(nd(M));if(R)return p.state.loading|=4,p.instance=R,Br(R),R;S=mE(v),(M=ts.get(M))&&o0(S,M),R=(c.ownerDocument||c).createElement("link"),Br(R);var Y=R;return Y._p=new Promise(function(te,pe){Y.onload=te,Y.onerror=pe}),Fi(R,"link",S),p.state.loading|=4,eg(R,v.precedence,c),p.instance=R;case"script":return R=Qc(v.src),(M=c.querySelector(sd(R)))?(p.instance=M,Br(M),M):(S=v,(M=ts.get(R))&&(S=f({},v),l0(S,M)),c=c.ownerDocument||c,M=c.createElement("script"),Br(M),Fi(M,"link",S),c.head.appendChild(M),p.instance=M);case"void":return null;default:throw Error(n(443,p.type))}else p.type==="stylesheet"&&(p.state.loading&4)===0&&(S=p.instance,p.state.loading|=4,eg(S,v.precedence,c));return p.instance}function eg(c,p,v){for(var S=v.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),M=S.length?S[S.length-1]:null,R=M,Y=0;Y<S.length;Y++){var te=S[Y];if(te.dataset.precedence===p)R=te;else if(R!==M)break}R?R.parentNode.insertBefore(c,R.nextSibling):(p=v.nodeType===9?v.head:v,p.insertBefore(c,p.firstChild))}function o0(c,p){c.crossOrigin==null&&(c.crossOrigin=p.crossOrigin),c.referrerPolicy==null&&(c.referrerPolicy=p.referrerPolicy),c.title==null&&(c.title=p.title)}function l0(c,p){c.crossOrigin==null&&(c.crossOrigin=p.crossOrigin),c.referrerPolicy==null&&(c.referrerPolicy=p.referrerPolicy),c.integrity==null&&(c.integrity=p.integrity)}var tg=null;function bE(c,p,v){if(tg===null){var S=new Map,M=tg=new Map;M.set(v,S)}else M=tg,S=M.get(v),S||(S=new Map,M.set(v,S));if(S.has(c))return S;for(S.set(c,null),v=v.getElementsByTagName(c),M=0;M<v.length;M++){var R=v[M];if(!(R[Hn]||R[Ke]||c==="link"&&R.getAttribute("rel")==="stylesheet")&&R.namespaceURI!=="http://www.w3.org/2000/svg"){var Y=R.getAttribute(p)||"";Y=c+Y;var te=S.get(Y);te?te.push(R):S.set(Y,[R])}}return S}function vE(c,p,v){c=c.ownerDocument||c,c.head.insertBefore(v,p==="title"?c.querySelector("head > title"):null)}function $8(c,p,v){if(v===1||p.itemProp!=null)return!1;switch(c){case"meta":case"title":return!0;case"style":if(typeof p.precedence!="string"||typeof p.href!="string"||p.href==="")break;return!0;case"link":if(typeof p.rel!="string"||typeof p.href!="string"||p.href===""||p.onLoad||p.onError)break;switch(p.rel){case"stylesheet":return c=p.disabled,typeof p.precedence=="string"&&c==null;default:return!0}case"script":if(p.async&&typeof p.async!="function"&&typeof p.async!="symbol"&&!p.onLoad&&!p.onError&&p.src&&typeof p.src=="string")return!0}return!1}function xE(c){return!(c.type==="stylesheet"&&(c.state.loading&3)===0)}function P8(c,p,v,S){if(v.type==="stylesheet"&&(typeof S.media!="string"||matchMedia(S.media).matches!==!1)&&(v.state.loading&4)===0){if(v.instance===null){var M=Zc(S.href),R=p.querySelector(nd(M));if(R){p=R._p,p!==null&&typeof p=="object"&&typeof p.then=="function"&&(c.count++,c=rg.bind(c),p.then(c,c)),v.state.loading|=4,v.instance=R,Br(R);return}R=p.ownerDocument||p,S=mE(S),(M=ts.get(M))&&o0(S,M),R=R.createElement("link"),Br(R);var Y=R;Y._p=new Promise(function(te,pe){Y.onload=te,Y.onerror=pe}),Fi(R,"link",S),v.instance=R}c.stylesheets===null&&(c.stylesheets=new Map),c.stylesheets.set(v,p),(p=v.state.preload)&&(v.state.loading&3)===0&&(c.count++,v=rg.bind(c),p.addEventListener("load",v),p.addEventListener("error",v))}}var c0=0;function z8(c,p){return c.stylesheets&&c.count===0&&ng(c,c.stylesheets),0<c.count||0<c.imgCount?function(v){var S=setTimeout(function(){if(c.stylesheets&&ng(c,c.stylesheets),c.unsuspend){var R=c.unsuspend;c.unsuspend=null,R()}},6e4+p);0<c.imgBytes&&c0===0&&(c0=62500*_8());var M=setTimeout(function(){if(c.waitingForImages=!1,c.count===0&&(c.stylesheets&&ng(c,c.stylesheets),c.unsuspend)){var R=c.unsuspend;c.unsuspend=null,R()}},(c.imgBytes>c0?50:800)+p);return c.unsuspend=v,function(){c.unsuspend=null,clearTimeout(S),clearTimeout(M)}}:null}function rg(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ng(this,this.stylesheets);else if(this.unsuspend){var c=this.unsuspend;this.unsuspend=null,c()}}}var ig=null;function ng(c,p){c.stylesheets=null,c.unsuspend!==null&&(c.count++,ig=new Map,p.forEach(q8,c),ig=null,rg.call(c))}function q8(c,p){if(!(p.state.loading&4)){var v=ig.get(c);if(v)var S=v.get(null);else{v=new Map,ig.set(c,v);for(var M=c.querySelectorAll("link[data-precedence],style[data-precedence]"),R=0;R<M.length;R++){var Y=M[R];(Y.nodeName==="LINK"||Y.getAttribute("media")!=="not all")&&(v.set(Y.dataset.precedence,Y),S=Y)}S&&v.set(null,S)}M=p.instance,Y=M.getAttribute("data-precedence"),R=v.get(Y)||S,R===S&&v.set(null,M),v.set(Y,M),this.count++,S=rg.bind(this),M.addEventListener("load",S),M.addEventListener("error",S),R?R.parentNode.insertBefore(M,R.nextSibling):(c=c.nodeType===9?c.head:c,c.insertBefore(M,c.firstChild)),p.state.loading|=4}}var ad={$$typeof:k,Provider:null,Consumer:null,_currentValue:V,_currentValue2:V,_threadCount:0};function H8(c,p,v,S,M,R,Y,te,pe){this.tag=1,this.containerInfo=c,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ft(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ft(0),this.hiddenUpdates=Ft(null),this.identifierPrefix=S,this.onUncaughtError=M,this.onCaughtError=R,this.onRecoverableError=Y,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=pe,this.incompleteTransitions=new Map}function _E(c,p,v,S,M,R,Y,te,pe,Le,Ge,Qe){return c=new H8(c,p,v,Y,pe,Le,Ge,Qe,te),p=1,R===!0&&(p|=24),R=An(3,null,null,p),c.current=R,R.stateNode=c,p=qb(),p.refCount++,c.pooledCache=p,p.refCount++,R.memoizedState={element:S,isDehydrated:v,cache:p},Gb(R),c}function CE(c){return c?(c=jc,c):jc}function wE(c,p,v,S,M,R){M=CE(M),S.context===null?S.context=M:S.pendingContext=M,S=ao(p),S.payload={element:v},R=R===void 0?null:R,R!==null&&(S.callback=R),v=oo(c,S,p),v!==null&&(xn(v,c,p),Fu(v,c,p))}function kE(c,p){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var v=c.retryLane;c.retryLane=v!==0&&v<p?v:p}}function h0(c,p){kE(c,p),(c=c.alternate)&&kE(c,p)}function SE(c){if(c.tag===13||c.tag===31){var p=fl(c,67108864);p!==null&&xn(p,c,67108864),h0(c,67108864)}}function TE(c){if(c.tag===13||c.tag===31){var p=On();p=se(p);var v=fl(c,p);v!==null&&xn(v,c,p),h0(c,p)}}var sg=!0;function U8(c,p,v,S){var M=$.T;$.T=null;var R=W.p;try{W.p=2,u0(c,p,v,S)}finally{W.p=R,$.T=M}}function W8(c,p,v,S){var M=$.T;$.T=null;var R=W.p;try{W.p=8,u0(c,p,v,S)}finally{W.p=R,$.T=M}}function u0(c,p,v,S){if(sg){var M=d0(S);if(M===null)Zv(c,p,S,ag,v),NE(c,S);else if(K8(M,c,p,v,S))S.stopPropagation();else if(NE(c,S),p&4&&-1<G8.indexOf(c)){for(;M!==null;){var R=en(M);if(R!==null)switch(R.tag){case 3:if(R=R.stateNode,R.current.memoizedState.isDehydrated){var Y=wt(R.pendingLanes);if(Y!==0){var te=R;for(te.pendingLanes|=2,te.entangledLanes|=2;Y;){var pe=1<<31-at(Y);te.entanglements[1]|=pe,Y&=~pe}$s(R),(Rr&6)===0&&(qp=Lt()+500,ed(0))}}break;case 31:case 13:te=fl(R,2),te!==null&&xn(te,R,2),Up(),h0(R,2)}if(R=d0(S),R===null&&Zv(c,p,S,ag,v),R===M)break;M=R}M!==null&&S.stopPropagation()}else Zv(c,p,S,null,v)}}function d0(c){return c=cr(c),f0(c)}var ag=null;function f0(c){if(ag=null,c=_i(c),c!==null){var p=o(c);if(p===null)c=null;else{var v=p.tag;if(v===13){if(c=h(p),c!==null)return c;c=null}else if(v===31){if(c=l(p),c!==null)return c;c=null}else if(v===3){if(p.stateNode.current.memoizedState.isDehydrated)return p.tag===3?p.stateNode.containerInfo:null;c=null}else p!==c&&(c=null)}}return ag=c,null}function EE(c){switch(c){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(qt()){case mt:return 2;case Te:return 8;case Ie:case Be:return 32;case Je:return 268435456;default:return 32}default:return 32}}var p0=!1,vo=null,xo=null,_o=null,od=new Map,ld=new Map,Co=[],G8="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function NE(c,p){switch(c){case"focusin":case"focusout":vo=null;break;case"dragenter":case"dragleave":xo=null;break;case"mouseover":case"mouseout":_o=null;break;case"pointerover":case"pointerout":od.delete(p.pointerId);break;case"gotpointercapture":case"lostpointercapture":ld.delete(p.pointerId)}}function cd(c,p,v,S,M,R){return c===null||c.nativeEvent!==R?(c={blockedOn:p,domEventName:v,eventSystemFlags:S,nativeEvent:R,targetContainers:[M]},p!==null&&(p=en(p),p!==null&&SE(p)),c):(c.eventSystemFlags|=S,p=c.targetContainers,M!==null&&p.indexOf(M)===-1&&p.push(M),c)}function K8(c,p,v,S,M){switch(p){case"focusin":return vo=cd(vo,c,p,v,S,M),!0;case"dragenter":return xo=cd(xo,c,p,v,S,M),!0;case"mouseover":return _o=cd(_o,c,p,v,S,M),!0;case"pointerover":var R=M.pointerId;return od.set(R,cd(od.get(R)||null,c,p,v,S,M)),!0;case"gotpointercapture":return R=M.pointerId,ld.set(R,cd(ld.get(R)||null,c,p,v,S,M)),!0}return!1}function jE(c){var p=_i(c.target);if(p!==null){var v=o(p);if(v!==null){if(p=v.tag,p===13){if(p=h(v),p!==null){c.blockedOn=p,Ee(c.priority,function(){TE(v)});return}}else if(p===31){if(p=l(v),p!==null){c.blockedOn=p,Ee(c.priority,function(){TE(v)});return}}else if(p===3&&v.stateNode.current.memoizedState.isDehydrated){c.blockedOn=v.tag===3?v.stateNode.containerInfo:null;return}}}c.blockedOn=null}function og(c){if(c.blockedOn!==null)return!1;for(var p=c.targetContainers;0<p.length;){var v=d0(c.nativeEvent);if(v===null){v=c.nativeEvent;var S=new v.constructor(v.type,v);Ot=S,v.target.dispatchEvent(S),Ot=null}else return p=en(v),p!==null&&SE(p),c.blockedOn=v,!1;p.shift()}return!0}function AE(c,p,v){og(c)&&v.delete(p)}function V8(){p0=!1,vo!==null&&og(vo)&&(vo=null),xo!==null&&og(xo)&&(xo=null),_o!==null&&og(_o)&&(_o=null),od.forEach(AE),ld.forEach(AE)}function lg(c,p){c.blockedOn===p&&(c.blockedOn=null,p0||(p0=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,V8)))}var cg=null;function ME(c){cg!==c&&(cg=c,r.unstable_scheduleCallback(r.unstable_NormalPriority,function(){cg===c&&(cg=null);for(var p=0;p<c.length;p+=3){var v=c[p],S=c[p+1],M=c[p+2];if(typeof S!="function"){if(f0(S||v)===null)continue;break}var R=en(v);R!==null&&(c.splice(p,3),p-=3,dv(R,{pending:!0,data:M,method:v.method,action:S},S,M))}}))}function Jc(c){function p(pe){return lg(pe,c)}vo!==null&&lg(vo,c),xo!==null&&lg(xo,c),_o!==null&&lg(_o,c),od.forEach(p),ld.forEach(p);for(var v=0;v<Co.length;v++){var S=Co[v];S.blockedOn===c&&(S.blockedOn=null)}for(;0<Co.length&&(v=Co[0],v.blockedOn===null);)jE(v),v.blockedOn===null&&Co.shift();if(v=(c.ownerDocument||c).$$reactFormReplay,v!=null)for(S=0;S<v.length;S+=3){var M=v[S],R=v[S+1],Y=M[Tt]||null;if(typeof R=="function")Y||ME(v);else if(Y){var te=null;if(R&&R.hasAttribute("formAction")){if(M=R,Y=R[Tt]||null)te=Y.formAction;else if(f0(M)!==null)continue}else te=Y.action;typeof te=="function"?v[S+1]=te:(v.splice(S,3),S-=3),ME(v)}}}function LE(){function c(R){R.canIntercept&&R.info==="react-transition"&&R.intercept({handler:function(){return new Promise(function(Y){return M=Y})},focusReset:"manual",scroll:"manual"})}function p(){M!==null&&(M(),M=null),S||setTimeout(v,20)}function v(){if(!S&&!navigation.transition){var R=navigation.currentEntry;R&&R.url!=null&&navigation.navigate(R.url,{state:R.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var S=!1,M=null;return navigation.addEventListener("navigate",c),navigation.addEventListener("navigatesuccess",p),navigation.addEventListener("navigateerror",p),setTimeout(v,100),function(){S=!0,navigation.removeEventListener("navigate",c),navigation.removeEventListener("navigatesuccess",p),navigation.removeEventListener("navigateerror",p),M!==null&&(M(),M=null)}}}function g0(c){this._internalRoot=c}hg.prototype.render=g0.prototype.render=function(c){var p=this._internalRoot;if(p===null)throw Error(n(409));var v=p.current,S=On();wE(v,S,c,p,null,null)},hg.prototype.unmount=g0.prototype.unmount=function(){var c=this._internalRoot;if(c!==null){this._internalRoot=null;var p=c.containerInfo;wE(c.current,2,null,c,null,null),Up(),p[er]=null}};function hg(c){this._internalRoot=c}hg.prototype.unstable_scheduleHydration=function(c){if(c){var p=be();c={blockedOn:null,target:c,priority:p};for(var v=0;v<Co.length&&p!==0&&p<Co[v].priority;v++);Co.splice(v,0,c),v===0&&jE(c)}};var RE=e.version;if(RE!=="19.2.4")throw Error(n(527,RE,"19.2.4"));W.findDOMNode=function(c){var p=c._reactInternals;if(p===void 0)throw typeof c.render=="function"?Error(n(188)):(c=Object.keys(c).join(","),Error(n(268,c)));return c=d(p),c=c!==null?g(c):null,c=c===null?null:c.stateNode,c};var Y8={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:$,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ug=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ug.isDisabled&&ug.supportsFiber)try{Nt=ug.inject(Y8),ke=ug}catch{}}return ud.createRoot=function(c,p){if(!s(c))throw Error(n(299));var v=!1,S="",M=P2,R=z2,Y=q2;return p!=null&&(p.unstable_strictMode===!0&&(v=!0),p.identifierPrefix!==void 0&&(S=p.identifierPrefix),p.onUncaughtError!==void 0&&(M=p.onUncaughtError),p.onCaughtError!==void 0&&(R=p.onCaughtError),p.onRecoverableError!==void 0&&(Y=p.onRecoverableError)),p=_E(c,1,!1,null,null,v,S,null,M,R,Y,LE),c[er]=p.current,Xv(c),new g0(p)},ud.hydrateRoot=function(c,p,v){if(!s(c))throw Error(n(299));var S=!1,M="",R=P2,Y=z2,te=q2,pe=null;return v!=null&&(v.unstable_strictMode===!0&&(S=!0),v.identifierPrefix!==void 0&&(M=v.identifierPrefix),v.onUncaughtError!==void 0&&(R=v.onUncaughtError),v.onCaughtError!==void 0&&(Y=v.onCaughtError),v.onRecoverableError!==void 0&&(te=v.onRecoverableError),v.formState!==void 0&&(pe=v.formState)),p=_E(c,1,!0,p,v??null,S,M,pe,R,Y,te,LE),p.context=CE(null),v=p.current,S=On(),S=se(S),M=ao(S),M.callback=null,oo(v,M,S),v=S,p.current.lanes=v,gt(p,v),$s(p),c[er]=p.current,Xv(c),new hg(p)},ud.version="19.2.4",ud}var UE;function oz(){if(UE)return v0.exports;UE=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(e){console.error(e)}}return r(),v0.exports=az(),v0.exports}var lz=oz(),gu=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(r){return this.listeners.add(r),this.onSubscribe(),()=>{this.listeners.delete(r),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},cz={setTimeout:(r,e)=>setTimeout(r,e),clearTimeout:r=>clearTimeout(r),setInterval:(r,e)=>setInterval(r,e),clearInterval:r=>clearInterval(r)},Bo,FC,QR,hz=(QR=class{constructor(){Gt(this,Bo,cz);Gt(this,FC,!1)}setTimeoutProvider(r){Ct(this,Bo,r)}setTimeout(r,e){return me(this,Bo).setTimeout(r,e)}clearTimeout(r){me(this,Bo).clearTimeout(r)}setInterval(r,e){return me(this,Bo).setInterval(r,e)}clearInterval(r){me(this,Bo).clearInterval(r)}},Bo=new WeakMap,FC=new WeakMap,QR),Il=new hz;function uz(r){setTimeout(r,0)}var ic=typeof window>"u"||"Deno"in globalThis;function sn(){}function dz(r,e){return typeof r=="function"?r(e):r}function j_(r){return typeof r=="number"&&r>=0&&r!==1/0}function uB(r,e){return Math.max(r+(e||0)-Date.now(),0)}function Ko(r,e){return typeof r=="function"?r(e):r}function os(r,e){return typeof r=="function"?r(e):r}function WE(r,e){const{type:i="all",exact:n,fetchStatus:s,predicate:o,queryKey:h,stale:l}=r;if(h){if(n){if(e.queryHash!==PC(h,e.options))return!1}else if(!yf(e.queryKey,h))return!1}if(i!=="all"){const u=e.isActive();if(i==="active"&&!u||i==="inactive"&&u)return!1}return!(typeof l=="boolean"&&e.isStale()!==l||s&&s!==e.state.fetchStatus||o&&!o(e))}function GE(r,e){const{exact:i,status:n,predicate:s,mutationKey:o}=r;if(o){if(!e.options.mutationKey)return!1;if(i){if(nc(e.options.mutationKey)!==nc(o))return!1}else if(!yf(e.options.mutationKey,o))return!1}return!(n&&e.state.status!==n||s&&!s(e))}function PC(r,e){return((e==null?void 0:e.queryKeyHashFn)||nc)(r)}function nc(r){return JSON.stringify(r,(e,i)=>A_(i)?Object.keys(i).sort().reduce((n,s)=>(n[s]=i[s],n),{}):i)}function yf(r,e){return r===e?!0:typeof r!=typeof e?!1:r&&e&&typeof r=="object"&&typeof e=="object"?Object.keys(e).every(i=>yf(r[i],e[i])):!1}var fz=Object.prototype.hasOwnProperty;function dB(r,e,i=0){if(r===e)return r;if(i>500)return e;const n=KE(r)&&KE(e);if(!n&&!(A_(r)&&A_(e)))return e;const o=(n?r:Object.keys(r)).length,h=n?e:Object.keys(e),l=h.length,u=n?new Array(l):{};let d=0;for(let g=0;g<l;g++){const f=n?g:h[g],m=r[f],y=e[f];if(m===y){u[f]=m,(n?g<o:fz.call(r,f))&&d++;continue}if(m===null||y===null||typeof m!="object"||typeof y!="object"){u[f]=y;continue}const w=dB(m,y,i+1);u[f]=w,w===m&&d++}return o===l&&d===o?r:u}function Em(r,e){if(!e||Object.keys(r).length!==Object.keys(e).length)return!1;for(const i in r)if(r[i]!==e[i])return!1;return!0}function KE(r){return Array.isArray(r)&&r.length===Object.keys(r).length}function A_(r){if(!VE(r))return!1;const e=r.constructor;if(e===void 0)return!0;const i=e.prototype;return!(!VE(i)||!i.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(r)!==Object.prototype)}function VE(r){return Object.prototype.toString.call(r)==="[object Object]"}function pz(r){return new Promise(e=>{Il.setTimeout(e,r)})}function M_(r,e,i){return typeof i.structuralSharing=="function"?i.structuralSharing(r,e):i.structuralSharing!==!1?dB(r,e):e}function gz(r){return r}function mz(r,e,i=0){const n=[...r,e];return i&&n.length>i?n.slice(1):n}function yz(r,e,i=0){const n=[e,...r];return i&&n.length>i?n.slice(0,-1):n}var zC=Symbol();function fB(r,e){return!r.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!r.queryFn||r.queryFn===zC?()=>Promise.reject(new Error(`Missing queryFn: '${r.queryHash}'`)):r.queryFn}function qC(r,e){return typeof r=="function"?r(...e):!!r}function bz(r,e,i){let n=!1,s;return Object.defineProperty(r,"signal",{enumerable:!0,get:()=>(s??(s=e()),n||(n=!0,s.aborted?i():s.addEventListener("abort",i,{once:!0})),s)}),r}var Hl,Oo,Mh,JR,vz=(JR=class extends gu{constructor(){super();Gt(this,Hl);Gt(this,Oo);Gt(this,Mh);Ct(this,Mh,e=>{if(!ic&&window.addEventListener){const i=()=>e();return window.addEventListener("visibilitychange",i,!1),()=>{window.removeEventListener("visibilitychange",i)}}})}onSubscribe(){me(this,Oo)||this.setEventListener(me(this,Mh))}onUnsubscribe(){var e;this.hasListeners()||((e=me(this,Oo))==null||e.call(this),Ct(this,Oo,void 0))}setEventListener(e){var i;Ct(this,Mh,e),(i=me(this,Oo))==null||i.call(this),Ct(this,Oo,e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(e){me(this,Hl)!==e&&(Ct(this,Hl,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(i=>{i(e)})}isFocused(){var e;return typeof me(this,Hl)=="boolean"?me(this,Hl):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Hl=new WeakMap,Oo=new WeakMap,Mh=new WeakMap,JR),HC=new vz;function L_(){let r,e;const i=new Promise((s,o)=>{r=s,e=o});i.status="pending",i.catch(()=>{});function n(s){Object.assign(i,s),delete i.resolve,delete i.reject}return i.resolve=s=>{n({status:"fulfilled",value:s}),r(s)},i.reject=s=>{n({status:"rejected",reason:s}),e(s)},i}var xz=uz;function _z(){let r=[],e=0,i=l=>{l()},n=l=>{l()},s=xz;const o=l=>{e?r.push(l):s(()=>{i(l)})},h=()=>{const l=r;r=[],l.length&&s(()=>{n(()=>{l.forEach(u=>{i(u)})})})};return{batch:l=>{let u;e++;try{u=l()}finally{e--,e||h()}return u},batchCalls:l=>(...u)=>{o(()=>{l(...u)})},schedule:o,setNotifyFunction:l=>{i=l},setBatchNotifyFunction:l=>{n=l},setScheduler:l=>{s=l}}}var Ti=_z(),Lh,Do,Rh,eB,Cz=(eB=class extends gu{constructor(){super();Gt(this,Lh,!0);Gt(this,Do);Gt(this,Rh);Ct(this,Rh,e=>{if(!ic&&window.addEventListener){const i=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",i,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",i),window.removeEventListener("offline",n)}}})}onSubscribe(){me(this,Do)||this.setEventListener(me(this,Rh))}onUnsubscribe(){var e;this.hasListeners()||((e=me(this,Do))==null||e.call(this),Ct(this,Do,void 0))}setEventListener(e){var i;Ct(this,Rh,e),(i=me(this,Do))==null||i.call(this),Ct(this,Do,e(this.setOnline.bind(this)))}setOnline(e){me(this,Lh)!==e&&(Ct(this,Lh,e),this.listeners.forEach(n=>{n(e)}))}isOnline(){return me(this,Lh)}},Lh=new WeakMap,Do=new WeakMap,Rh=new WeakMap,eB),Nm=new Cz;function wz(r){return Math.min(1e3*2**r,3e4)}function pB(r){return(r??"online")==="online"?Nm.isOnline():!0}var R_=class extends Error{constructor(r){super("CancelledError"),this.revert=r==null?void 0:r.revert,this.silent=r==null?void 0:r.silent}};function gB(r){let e=!1,i=0,n;const s=L_(),o=()=>s.status!=="pending",h=_=>{var b;if(!o()){const x=new R_(_);m(x),(b=r.onCancel)==null||b.call(r,x)}},l=()=>{e=!0},u=()=>{e=!1},d=()=>HC.isFocused()&&(r.networkMode==="always"||Nm.isOnline())&&r.canRun(),g=()=>pB(r.networkMode)&&r.canRun(),f=_=>{o()||(n==null||n(),s.resolve(_))},m=_=>{o()||(n==null||n(),s.reject(_))},y=()=>new Promise(_=>{var b;n=x=>{(o()||d())&&_(x)},(b=r.onPause)==null||b.call(r)}).then(()=>{var _;n=void 0,o()||(_=r.onContinue)==null||_.call(r)}),w=()=>{if(o())return;let _;const b=i===0?r.initialPromise:void 0;try{_=b??r.fn()}catch(x){_=Promise.reject(x)}Promise.resolve(_).then(f).catch(x=>{var A;if(o())return;const C=r.retry??(ic?0:3),k=r.retryDelay??wz,T=typeof k=="function"?k(i,x):k,N=C===!0||typeof C=="number"&&i<C||typeof C=="function"&&C(i,x);if(e||!N){m(x);return}i++,(A=r.onFail)==null||A.call(r,i,x),pz(T).then(()=>d()?void 0:y()).then(()=>{e?m(x):w()})})};return{promise:s,status:()=>s.status,cancel:h,continue:()=>(n==null||n(),s),cancelRetry:l,continueRetry:u,canStart:g,start:()=>(g()?w():y().then(w),s)}}var Ul,tB,mB=(tB=class{constructor(){Gt(this,Ul)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),j_(this.gcTime)&&Ct(this,Ul,Il.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(r){this.gcTime=Math.max(this.gcTime||0,r??(ic?1/0:300*1e3))}clearGcTimeout(){me(this,Ul)&&(Il.clearTimeout(me(this,Ul)),Ct(this,Ul,void 0))}},Ul=new WeakMap,tB),Wl,Bh,as,Gl,Mi,Df,Kl,_s,Ma,rB,kz=(rB=class extends mB{constructor(e){super();Gt(this,_s);Gt(this,Wl);Gt(this,Bh);Gt(this,as);Gt(this,Gl);Gt(this,Mi);Gt(this,Df);Gt(this,Kl);Ct(this,Kl,!1),Ct(this,Df,e.defaultOptions),this.setOptions(e.options),this.observers=[],Ct(this,Gl,e.client),Ct(this,as,me(this,Gl).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Ct(this,Wl,XE(this.options)),this.state=e.state??me(this,Wl),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=me(this,Mi))==null?void 0:e.promise}setOptions(e){if(this.options={...me(this,Df),...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const i=XE(this.options);i.data!==void 0&&(this.setState(YE(i.data,i.dataUpdatedAt)),Ct(this,Wl,i))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&me(this,as).remove(this)}setData(e,i){const n=M_(this.state.data,e,this.options);return pr(this,_s,Ma).call(this,{data:n,type:"success",dataUpdatedAt:i==null?void 0:i.updatedAt,manual:i==null?void 0:i.manual}),n}setState(e,i){pr(this,_s,Ma).call(this,{type:"setState",state:e,setStateOptions:i})}cancel(e){var n,s;const i=(n=me(this,Mi))==null?void 0:n.promise;return(s=me(this,Mi))==null||s.cancel(e),i?i.then(sn).catch(sn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(me(this,Wl))}isActive(){return this.observers.some(e=>os(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===zC||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Ko(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!uB(this.state.dataUpdatedAt,e)}onFocus(){var i;const e=this.observers.find(n=>n.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(i=me(this,Mi))==null||i.continue()}onOnline(){var i;const e=this.observers.find(n=>n.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(i=me(this,Mi))==null||i.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),me(this,as).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(i=>i!==e),this.observers.length||(me(this,Mi)&&(me(this,Kl)?me(this,Mi).cancel({revert:!0}):me(this,Mi).cancelRetry()),this.scheduleGc()),me(this,as).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||pr(this,_s,Ma).call(this,{type:"invalidate"})}async fetch(e,i){var u,d,g,f,m,y,w,_,b,x,C,k;if(this.state.fetchStatus!=="idle"&&((u=me(this,Mi))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(i!=null&&i.cancelRefetch))this.cancel({silent:!0});else if(me(this,Mi))return me(this,Mi).continueRetry(),me(this,Mi).promise}if(e&&this.setOptions(e),!this.options.queryFn){const T=this.observers.find(N=>N.options.queryFn);T&&this.setOptions(T.options)}const n=new AbortController,s=T=>{Object.defineProperty(T,"signal",{enumerable:!0,get:()=>(Ct(this,Kl,!0),n.signal)})},o=()=>{const T=fB(this.options,i),A=(()=>{const j={client:me(this,Gl),queryKey:this.queryKey,meta:this.meta};return s(j),j})();return Ct(this,Kl,!1),this.options.persister?this.options.persister(T,A,this):T(A)},l=(()=>{const T={fetchOptions:i,options:this.options,queryKey:this.queryKey,client:me(this,Gl),state:this.state,fetchFn:o};return s(T),T})();(d=this.options.behavior)==null||d.onFetch(l,this),Ct(this,Bh,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((g=l.fetchOptions)==null?void 0:g.meta))&&pr(this,_s,Ma).call(this,{type:"fetch",meta:(f=l.fetchOptions)==null?void 0:f.meta}),Ct(this,Mi,gB({initialPromise:i==null?void 0:i.initialPromise,fn:l.fetchFn,onCancel:T=>{T instanceof R_&&T.revert&&this.setState({...me(this,Bh),fetchStatus:"idle"}),n.abort()},onFail:(T,N)=>{pr(this,_s,Ma).call(this,{type:"failed",failureCount:T,error:N})},onPause:()=>{pr(this,_s,Ma).call(this,{type:"pause"})},onContinue:()=>{pr(this,_s,Ma).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const T=await me(this,Mi).start();if(T===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(T),(y=(m=me(this,as).config).onSuccess)==null||y.call(m,T,this),(_=(w=me(this,as).config).onSettled)==null||_.call(w,T,this.state.error,this),T}catch(T){if(T instanceof R_){if(T.silent)return me(this,Mi).promise;if(T.revert){if(this.state.data===void 0)throw T;return this.state.data}}throw pr(this,_s,Ma).call(this,{type:"error",error:T}),(x=(b=me(this,as).config).onError)==null||x.call(b,T,this),(k=(C=me(this,as).config).onSettled)==null||k.call(C,this.state.data,T,this),T}finally{this.scheduleGc()}}},Wl=new WeakMap,Bh=new WeakMap,as=new WeakMap,Gl=new WeakMap,Mi=new WeakMap,Df=new WeakMap,Kl=new WeakMap,_s=new WeakSet,Ma=function(e){const i=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...yB(n.data,this.options),fetchMeta:e.meta??null};case"success":const s={...n,...YE(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Ct(this,Bh,e.manual?s:void 0),s;case"error":const o=e.error;return{...n,error:o,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=i(this.state),Ti.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),me(this,as).notify({query:this,type:"updated",action:e})})},rB);function yB(r,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:pB(e.networkMode)?"fetching":"paused",...r===void 0&&{error:null,status:"pending"}}}function YE(r,e){return{data:r,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function XE(r){const e=typeof r.initialData=="function"?r.initialData():r.initialData,i=e!==void 0,n=i?typeof r.initialDataUpdatedAt=="function"?r.initialDataUpdatedAt():r.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:i?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}var Cn,Tr,If,nn,Vl,Oh,Ba,Io,Ff,Dh,Ih,Yl,Xl,Fo,Fh,Fr,zd,B_,O_,D_,I_,F_,$_,P_,bB,iB,Sz=(iB=class extends gu{constructor(e,i){super();Gt(this,Fr);Gt(this,Cn);Gt(this,Tr);Gt(this,If);Gt(this,nn);Gt(this,Vl);Gt(this,Oh);Gt(this,Ba);Gt(this,Io);Gt(this,Ff);Gt(this,Dh);Gt(this,Ih);Gt(this,Yl);Gt(this,Xl);Gt(this,Fo);Gt(this,Fh,new Set);this.options=i,Ct(this,Cn,e),Ct(this,Io,null),Ct(this,Ba,L_()),this.bindMethods(),this.setOptions(i)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(me(this,Tr).addObserver(this),ZE(me(this,Tr),this.options)?pr(this,Fr,zd).call(this):this.updateResult(),pr(this,Fr,I_).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return z_(me(this,Tr),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return z_(me(this,Tr),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,pr(this,Fr,F_).call(this),pr(this,Fr,$_).call(this),me(this,Tr).removeObserver(this)}setOptions(e){const i=this.options,n=me(this,Tr);if(this.options=me(this,Cn).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof os(this.options.enabled,me(this,Tr))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");pr(this,Fr,P_).call(this),me(this,Tr).setOptions(this.options),i._defaulted&&!Em(this.options,i)&&me(this,Cn).getQueryCache().notify({type:"observerOptionsUpdated",query:me(this,Tr),observer:this});const s=this.hasListeners();s&&QE(me(this,Tr),n,this.options,i)&&pr(this,Fr,zd).call(this),this.updateResult(),s&&(me(this,Tr)!==n||os(this.options.enabled,me(this,Tr))!==os(i.enabled,me(this,Tr))||Ko(this.options.staleTime,me(this,Tr))!==Ko(i.staleTime,me(this,Tr)))&&pr(this,Fr,B_).call(this);const o=pr(this,Fr,O_).call(this);s&&(me(this,Tr)!==n||os(this.options.enabled,me(this,Tr))!==os(i.enabled,me(this,Tr))||o!==me(this,Fo))&&pr(this,Fr,D_).call(this,o)}getOptimisticResult(e){const i=me(this,Cn).getQueryCache().build(me(this,Cn),e),n=this.createResult(i,e);return Ez(this,n)&&(Ct(this,nn,n),Ct(this,Oh,this.options),Ct(this,Vl,me(this,Tr).state)),n}getCurrentResult(){return me(this,nn)}trackResult(e,i){return new Proxy(e,{get:(n,s)=>(this.trackProp(s),i==null||i(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&me(this,Ba).status==="pending"&&me(this,Ba).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,s))})}trackProp(e){me(this,Fh).add(e)}getCurrentQuery(){return me(this,Tr)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const i=me(this,Cn).defaultQueryOptions(e),n=me(this,Cn).getQueryCache().build(me(this,Cn),i);return n.fetch().then(()=>this.createResult(n,i))}fetch(e){return pr(this,Fr,zd).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),me(this,nn)))}createResult(e,i){var L;const n=me(this,Tr),s=this.options,o=me(this,nn),h=me(this,Vl),l=me(this,Oh),d=e!==n?e.state:me(this,If),{state:g}=e;let f={...g},m=!1,y;if(i._optimisticResults){const O=this.hasListeners(),D=!O&&ZE(e,i),K=O&&QE(e,n,i,s);(D||K)&&(f={...f,...yB(g.data,e.options)}),i._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:w,errorUpdatedAt:_,status:b}=f;y=f.data;let x=!1;if(i.placeholderData!==void 0&&y===void 0&&b==="pending"){let O;o!=null&&o.isPlaceholderData&&i.placeholderData===(l==null?void 0:l.placeholderData)?(O=o.data,x=!0):O=typeof i.placeholderData=="function"?i.placeholderData((L=me(this,Ih))==null?void 0:L.state.data,me(this,Ih)):i.placeholderData,O!==void 0&&(b="success",y=M_(o==null?void 0:o.data,O,i),m=!0)}if(i.select&&y!==void 0&&!x)if(o&&y===(h==null?void 0:h.data)&&i.select===me(this,Ff))y=me(this,Dh);else try{Ct(this,Ff,i.select),y=i.select(y),y=M_(o==null?void 0:o.data,y,i),Ct(this,Dh,y),Ct(this,Io,null)}catch(O){Ct(this,Io,O)}me(this,Io)&&(w=me(this,Io),y=me(this,Dh),_=Date.now(),b="error");const C=f.fetchStatus==="fetching",k=b==="pending",T=b==="error",N=k&&C,A=y!==void 0,E={status:b,fetchStatus:f.fetchStatus,isPending:k,isSuccess:b==="success",isError:T,isInitialLoading:N,isLoading:N,data:y,dataUpdatedAt:f.dataUpdatedAt,error:w,errorUpdatedAt:_,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>d.dataUpdateCount||f.errorUpdateCount>d.errorUpdateCount,isFetching:C,isRefetching:C&&!k,isLoadingError:T&&!A,isPaused:f.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:T&&A,isStale:UC(e,i),refetch:this.refetch,promise:me(this,Ba),isEnabled:os(i.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const O=E.data!==void 0,D=E.status==="error"&&!O,K=P=>{D?P.reject(E.error):O&&P.resolve(E.data)},z=()=>{const P=Ct(this,Ba,E.promise=L_());K(P)},H=me(this,Ba);switch(H.status){case"pending":e.queryHash===n.queryHash&&K(H);break;case"fulfilled":(D||E.data!==H.value)&&z();break;case"rejected":(!D||E.error!==H.reason)&&z();break}}return E}updateResult(){const e=me(this,nn),i=this.createResult(me(this,Tr),this.options);if(Ct(this,Vl,me(this,Tr).state),Ct(this,Oh,this.options),me(this,Vl).data!==void 0&&Ct(this,Ih,me(this,Tr)),Em(i,e))return;Ct(this,nn,i);const n=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,o=typeof s=="function"?s():s;if(o==="all"||!o&&!me(this,Fh).size)return!0;const h=new Set(o??me(this,Fh));return this.options.throwOnError&&h.add("error"),Object.keys(me(this,nn)).some(l=>{const u=l;return me(this,nn)[u]!==e[u]&&h.has(u)})};pr(this,Fr,bB).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&pr(this,Fr,I_).call(this)}},Cn=new WeakMap,Tr=new WeakMap,If=new WeakMap,nn=new WeakMap,Vl=new WeakMap,Oh=new WeakMap,Ba=new WeakMap,Io=new WeakMap,Ff=new WeakMap,Dh=new WeakMap,Ih=new WeakMap,Yl=new WeakMap,Xl=new WeakMap,Fo=new WeakMap,Fh=new WeakMap,Fr=new WeakSet,zd=function(e){pr(this,Fr,P_).call(this);let i=me(this,Tr).fetch(this.options,e);return e!=null&&e.throwOnError||(i=i.catch(sn)),i},B_=function(){pr(this,Fr,F_).call(this);const e=Ko(this.options.staleTime,me(this,Tr));if(ic||me(this,nn).isStale||!j_(e))return;const n=uB(me(this,nn).dataUpdatedAt,e)+1;Ct(this,Yl,Il.setTimeout(()=>{me(this,nn).isStale||this.updateResult()},n))},O_=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(me(this,Tr)):this.options.refetchInterval)??!1},D_=function(e){pr(this,Fr,$_).call(this),Ct(this,Fo,e),!(ic||os(this.options.enabled,me(this,Tr))===!1||!j_(me(this,Fo))||me(this,Fo)===0)&&Ct(this,Xl,Il.setInterval(()=>{(this.options.refetchIntervalInBackground||HC.isFocused())&&pr(this,Fr,zd).call(this)},me(this,Fo)))},I_=function(){pr(this,Fr,B_).call(this),pr(this,Fr,D_).call(this,pr(this,Fr,O_).call(this))},F_=function(){me(this,Yl)&&(Il.clearTimeout(me(this,Yl)),Ct(this,Yl,void 0))},$_=function(){me(this,Xl)&&(Il.clearInterval(me(this,Xl)),Ct(this,Xl,void 0))},P_=function(){const e=me(this,Cn).getQueryCache().build(me(this,Cn),this.options);if(e===me(this,Tr))return;const i=me(this,Tr);Ct(this,Tr,e),Ct(this,If,e.state),this.hasListeners()&&(i==null||i.removeObserver(this),e.addObserver(this))},bB=function(e){Ti.batch(()=>{e.listeners&&this.listeners.forEach(i=>{i(me(this,nn))}),me(this,Cn).getQueryCache().notify({query:me(this,Tr),type:"observerResultsUpdated"})})},iB);function Tz(r,e){return os(e.enabled,r)!==!1&&r.state.data===void 0&&!(r.state.status==="error"&&e.retryOnMount===!1)}function ZE(r,e){return Tz(r,e)||r.state.data!==void 0&&z_(r,e,e.refetchOnMount)}function z_(r,e,i){if(os(e.enabled,r)!==!1&&Ko(e.staleTime,r)!=="static"){const n=typeof i=="function"?i(r):i;return n==="always"||n!==!1&&UC(r,e)}return!1}function QE(r,e,i,n){return(r!==e||os(n.enabled,r)===!1)&&(!i.suspense||r.state.status!=="error")&&UC(r,i)}function UC(r,e){return os(e.enabled,r)!==!1&&r.isStaleByTime(Ko(e.staleTime,r))}function Ez(r,e){return!Em(r.getCurrentResult(),e)}function JE(r){return{onFetch:(e,i)=>{var g,f,m,y,w;const n=e.options,s=(m=(f=(g=e.fetchOptions)==null?void 0:g.meta)==null?void 0:f.fetchMore)==null?void 0:m.direction,o=((y=e.state.data)==null?void 0:y.pages)||[],h=((w=e.state.data)==null?void 0:w.pageParams)||[];let l={pages:[],pageParams:[]},u=0;const d=async()=>{let _=!1;const b=k=>{bz(k,()=>e.signal,()=>_=!0)},x=fB(e.options,e.fetchOptions),C=async(k,T,N)=>{if(_)return Promise.reject();if(T==null&&k.pages.length)return Promise.resolve(k);const j=(()=>{const D={client:e.client,queryKey:e.queryKey,pageParam:T,direction:N?"backward":"forward",meta:e.options.meta};return b(D),D})(),E=await x(j),{maxPages:L}=e.options,O=N?yz:mz;return{pages:O(k.pages,E,L),pageParams:O(k.pageParams,T,L)}};if(s&&o.length){const k=s==="backward",T=k?Nz:eN,N={pages:o,pageParams:h},A=T(n,N);l=await C(N,A,k)}else{const k=r??o.length;do{const T=u===0?h[0]??n.initialPageParam:eN(n,l);if(u>0&&T==null)break;l=await C(l,T),u++}while(u<k)}return l};e.options.persister?e.fetchFn=()=>{var _,b;return(b=(_=e.options).persister)==null?void 0:b.call(_,d,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},i)}:e.fetchFn=d}}}function eN(r,{pages:e,pageParams:i}){const n=e.length-1;return e.length>0?r.getNextPageParam(e[n],e,i[n],i):void 0}function Nz(r,{pages:e,pageParams:i}){var n;return e.length>0?(n=r.getPreviousPageParam)==null?void 0:n.call(r,e[0],e,i[0],i):void 0}var $f,Xs,Xi,Zl,Zs,No,nB,jz=(nB=class extends mB{constructor(e){super();Gt(this,Zs);Gt(this,$f);Gt(this,Xs);Gt(this,Xi);Gt(this,Zl);Ct(this,$f,e.client),this.mutationId=e.mutationId,Ct(this,Xi,e.mutationCache),Ct(this,Xs,[]),this.state=e.state||vB(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){me(this,Xs).includes(e)||(me(this,Xs).push(e),this.clearGcTimeout(),me(this,Xi).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Ct(this,Xs,me(this,Xs).filter(i=>i!==e)),this.scheduleGc(),me(this,Xi).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){me(this,Xs).length||(this.state.status==="pending"?this.scheduleGc():me(this,Xi).remove(this))}continue(){var e;return((e=me(this,Zl))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var h,l,u,d,g,f,m,y,w,_,b,x,C,k,T,N,A,j;const i=()=>{pr(this,Zs,No).call(this,{type:"continue"})},n={client:me(this,$f),meta:this.options.meta,mutationKey:this.options.mutationKey};Ct(this,Zl,gB({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(E,L)=>{pr(this,Zs,No).call(this,{type:"failed",failureCount:E,error:L})},onPause:()=>{pr(this,Zs,No).call(this,{type:"pause"})},onContinue:i,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>me(this,Xi).canRun(this)}));const s=this.state.status==="pending",o=!me(this,Zl).canStart();try{if(s)i();else{pr(this,Zs,No).call(this,{type:"pending",variables:e,isPaused:o}),me(this,Xi).config.onMutate&&await me(this,Xi).config.onMutate(e,this,n);const L=await((l=(h=this.options).onMutate)==null?void 0:l.call(h,e,n));L!==this.state.context&&pr(this,Zs,No).call(this,{type:"pending",context:L,variables:e,isPaused:o})}const E=await me(this,Zl).start();return await((d=(u=me(this,Xi).config).onSuccess)==null?void 0:d.call(u,E,e,this.state.context,this,n)),await((f=(g=this.options).onSuccess)==null?void 0:f.call(g,E,e,this.state.context,n)),await((y=(m=me(this,Xi).config).onSettled)==null?void 0:y.call(m,E,null,this.state.variables,this.state.context,this,n)),await((_=(w=this.options).onSettled)==null?void 0:_.call(w,E,null,e,this.state.context,n)),pr(this,Zs,No).call(this,{type:"success",data:E}),E}catch(E){try{await((x=(b=me(this,Xi).config).onError)==null?void 0:x.call(b,E,e,this.state.context,this,n))}catch(L){Promise.reject(L)}try{await((k=(C=this.options).onError)==null?void 0:k.call(C,E,e,this.state.context,n))}catch(L){Promise.reject(L)}try{await((N=(T=me(this,Xi).config).onSettled)==null?void 0:N.call(T,void 0,E,this.state.variables,this.state.context,this,n))}catch(L){Promise.reject(L)}try{await((j=(A=this.options).onSettled)==null?void 0:j.call(A,void 0,E,e,this.state.context,n))}catch(L){Promise.reject(L)}throw pr(this,Zs,No).call(this,{type:"error",error:E}),E}finally{me(this,Xi).runNext(this)}}},$f=new WeakMap,Xs=new WeakMap,Xi=new WeakMap,Zl=new WeakMap,Zs=new WeakSet,No=function(e){const i=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=i(this.state),Ti.batch(()=>{me(this,Xs).forEach(n=>{n.onMutationUpdate(e)}),me(this,Xi).notify({mutation:this,type:"updated",action:e})})},nB);function vB(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Oa,Cs,Pf,sB,Az=(sB=class extends gu{constructor(e={}){super();Gt(this,Oa);Gt(this,Cs);Gt(this,Pf);this.config=e,Ct(this,Oa,new Set),Ct(this,Cs,new Map),Ct(this,Pf,0)}build(e,i,n){const s=new jz({client:e,mutationCache:this,mutationId:++dg(this,Pf)._,options:e.defaultMutationOptions(i),state:n});return this.add(s),s}add(e){me(this,Oa).add(e);const i=fg(e);if(typeof i=="string"){const n=me(this,Cs).get(i);n?n.push(e):me(this,Cs).set(i,[e])}this.notify({type:"added",mutation:e})}remove(e){if(me(this,Oa).delete(e)){const i=fg(e);if(typeof i=="string"){const n=me(this,Cs).get(i);if(n)if(n.length>1){const s=n.indexOf(e);s!==-1&&n.splice(s,1)}else n[0]===e&&me(this,Cs).delete(i)}}this.notify({type:"removed",mutation:e})}canRun(e){const i=fg(e);if(typeof i=="string"){const n=me(this,Cs).get(i),s=n==null?void 0:n.find(o=>o.state.status==="pending");return!s||s===e}else return!0}runNext(e){var n;const i=fg(e);if(typeof i=="string"){const s=(n=me(this,Cs).get(i))==null?void 0:n.find(o=>o!==e&&o.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Ti.batch(()=>{me(this,Oa).forEach(e=>{this.notify({type:"removed",mutation:e})}),me(this,Oa).clear(),me(this,Cs).clear()})}getAll(){return Array.from(me(this,Oa))}find(e){const i={exact:!0,...e};return this.getAll().find(n=>GE(i,n))}findAll(e={}){return this.getAll().filter(i=>GE(e,i))}notify(e){Ti.batch(()=>{this.listeners.forEach(i=>{i(e)})})}resumePausedMutations(){const e=this.getAll().filter(i=>i.state.isPaused);return Ti.batch(()=>Promise.all(e.map(i=>i.continue().catch(sn))))}},Oa=new WeakMap,Cs=new WeakMap,Pf=new WeakMap,sB);function fg(r){var e;return(e=r.options.scope)==null?void 0:e.id}var Da,$o,wn,Ia,Ua,om,q_,aB,Mz=(aB=class extends gu{constructor(i,n){super();Gt(this,Ua);Gt(this,Da);Gt(this,$o);Gt(this,wn);Gt(this,Ia);Ct(this,Da,i),this.setOptions(n),this.bindMethods(),pr(this,Ua,om).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(i){var s;const n=this.options;this.options=me(this,Da).defaultMutationOptions(i),Em(this.options,n)||me(this,Da).getMutationCache().notify({type:"observerOptionsUpdated",mutation:me(this,wn),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&nc(n.mutationKey)!==nc(this.options.mutationKey)?this.reset():((s=me(this,wn))==null?void 0:s.state.status)==="pending"&&me(this,wn).setOptions(this.options)}onUnsubscribe(){var i;this.hasListeners()||(i=me(this,wn))==null||i.removeObserver(this)}onMutationUpdate(i){pr(this,Ua,om).call(this),pr(this,Ua,q_).call(this,i)}getCurrentResult(){return me(this,$o)}reset(){var i;(i=me(this,wn))==null||i.removeObserver(this),Ct(this,wn,void 0),pr(this,Ua,om).call(this),pr(this,Ua,q_).call(this)}mutate(i,n){var s;return Ct(this,Ia,n),(s=me(this,wn))==null||s.removeObserver(this),Ct(this,wn,me(this,Da).getMutationCache().build(me(this,Da),this.options)),me(this,wn).addObserver(this),me(this,wn).execute(i)}},Da=new WeakMap,$o=new WeakMap,wn=new WeakMap,Ia=new WeakMap,Ua=new WeakSet,om=function(){var n;const i=((n=me(this,wn))==null?void 0:n.state)??vB();Ct(this,$o,{...i,isPending:i.status==="pending",isSuccess:i.status==="success",isError:i.status==="error",isIdle:i.status==="idle",mutate:this.mutate,reset:this.reset})},q_=function(i){Ti.batch(()=>{var n,s,o,h,l,u,d,g;if(me(this,Ia)&&this.hasListeners()){const f=me(this,$o).variables,m=me(this,$o).context,y={client:me(this,Da),meta:this.options.meta,mutationKey:this.options.mutationKey};if((i==null?void 0:i.type)==="success"){try{(s=(n=me(this,Ia)).onSuccess)==null||s.call(n,i.data,f,m,y)}catch(w){Promise.reject(w)}try{(h=(o=me(this,Ia)).onSettled)==null||h.call(o,i.data,null,f,m,y)}catch(w){Promise.reject(w)}}else if((i==null?void 0:i.type)==="error"){try{(u=(l=me(this,Ia)).onError)==null||u.call(l,i.error,f,m,y)}catch(w){Promise.reject(w)}try{(g=(d=me(this,Ia)).onSettled)==null||g.call(d,void 0,i.error,f,m,y)}catch(w){Promise.reject(w)}}}this.listeners.forEach(f=>{f(me(this,$o))})})},aB),Qs,oB,Lz=(oB=class extends gu{constructor(e={}){super();Gt(this,Qs);this.config=e,Ct(this,Qs,new Map)}build(e,i,n){const s=i.queryKey,o=i.queryHash??PC(s,i);let h=this.get(o);return h||(h=new kz({client:e,queryKey:s,queryHash:o,options:e.defaultQueryOptions(i),state:n,defaultOptions:e.getQueryDefaults(s)}),this.add(h)),h}add(e){me(this,Qs).has(e.queryHash)||(me(this,Qs).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const i=me(this,Qs).get(e.queryHash);i&&(e.destroy(),i===e&&me(this,Qs).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Ti.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return me(this,Qs).get(e)}getAll(){return[...me(this,Qs).values()]}find(e){const i={exact:!0,...e};return this.getAll().find(n=>WE(i,n))}findAll(e={}){const i=this.getAll();return Object.keys(e).length>0?i.filter(n=>WE(e,n)):i}notify(e){Ti.batch(()=>{this.listeners.forEach(i=>{i(e)})})}onFocus(){Ti.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Ti.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Qs=new WeakMap,oB),ui,Po,zo,$h,Ph,qo,zh,qh,lB,Rz=(lB=class{constructor(r={}){Gt(this,ui);Gt(this,Po);Gt(this,zo);Gt(this,$h);Gt(this,Ph);Gt(this,qo);Gt(this,zh);Gt(this,qh);Ct(this,ui,r.queryCache||new Lz),Ct(this,Po,r.mutationCache||new Az),Ct(this,zo,r.defaultOptions||{}),Ct(this,$h,new Map),Ct(this,Ph,new Map),Ct(this,qo,0)}mount(){dg(this,qo)._++,me(this,qo)===1&&(Ct(this,zh,HC.subscribe(async r=>{r&&(await this.resumePausedMutations(),me(this,ui).onFocus())})),Ct(this,qh,Nm.subscribe(async r=>{r&&(await this.resumePausedMutations(),me(this,ui).onOnline())})))}unmount(){var r,e;dg(this,qo)._--,me(this,qo)===0&&((r=me(this,zh))==null||r.call(this),Ct(this,zh,void 0),(e=me(this,qh))==null||e.call(this),Ct(this,qh,void 0))}isFetching(r){return me(this,ui).findAll({...r,fetchStatus:"fetching"}).length}isMutating(r){return me(this,Po).findAll({...r,status:"pending"}).length}getQueryData(r){var i;const e=this.defaultQueryOptions({queryKey:r});return(i=me(this,ui).get(e.queryHash))==null?void 0:i.state.data}ensureQueryData(r){const e=this.defaultQueryOptions(r),i=me(this,ui).build(this,e),n=i.state.data;return n===void 0?this.fetchQuery(r):(r.revalidateIfStale&&i.isStaleByTime(Ko(e.staleTime,i))&&this.prefetchQuery(e),Promise.resolve(n))}getQueriesData(r){return me(this,ui).findAll(r).map(({queryKey:e,state:i})=>{const n=i.data;return[e,n]})}setQueryData(r,e,i){const n=this.defaultQueryOptions({queryKey:r}),s=me(this,ui).get(n.queryHash),o=s==null?void 0:s.state.data,h=dz(e,o);if(h!==void 0)return me(this,ui).build(this,n).setData(h,{...i,manual:!0})}setQueriesData(r,e,i){return Ti.batch(()=>me(this,ui).findAll(r).map(({queryKey:n})=>[n,this.setQueryData(n,e,i)]))}getQueryState(r){var i;const e=this.defaultQueryOptions({queryKey:r});return(i=me(this,ui).get(e.queryHash))==null?void 0:i.state}removeQueries(r){const e=me(this,ui);Ti.batch(()=>{e.findAll(r).forEach(i=>{e.remove(i)})})}resetQueries(r,e){const i=me(this,ui);return Ti.batch(()=>(i.findAll(r).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...r},e)))}cancelQueries(r,e={}){const i={revert:!0,...e},n=Ti.batch(()=>me(this,ui).findAll(r).map(s=>s.cancel(i)));return Promise.all(n).then(sn).catch(sn)}invalidateQueries(r,e={}){return Ti.batch(()=>(me(this,ui).findAll(r).forEach(i=>{i.invalidate()}),(r==null?void 0:r.refetchType)==="none"?Promise.resolve():this.refetchQueries({...r,type:(r==null?void 0:r.refetchType)??(r==null?void 0:r.type)??"active"},e)))}refetchQueries(r,e={}){const i={...e,cancelRefetch:e.cancelRefetch??!0},n=Ti.batch(()=>me(this,ui).findAll(r).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let o=s.fetch(void 0,i);return i.throwOnError||(o=o.catch(sn)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(n).then(sn)}fetchQuery(r){const e=this.defaultQueryOptions(r);e.retry===void 0&&(e.retry=!1);const i=me(this,ui).build(this,e);return i.isStaleByTime(Ko(e.staleTime,i))?i.fetch(e):Promise.resolve(i.state.data)}prefetchQuery(r){return this.fetchQuery(r).then(sn).catch(sn)}fetchInfiniteQuery(r){return r.behavior=JE(r.pages),this.fetchQuery(r)}prefetchInfiniteQuery(r){return this.fetchInfiniteQuery(r).then(sn).catch(sn)}ensureInfiniteQueryData(r){return r.behavior=JE(r.pages),this.ensureQueryData(r)}resumePausedMutations(){return Nm.isOnline()?me(this,Po).resumePausedMutations():Promise.resolve()}getQueryCache(){return me(this,ui)}getMutationCache(){return me(this,Po)}getDefaultOptions(){return me(this,zo)}setDefaultOptions(r){Ct(this,zo,r)}setQueryDefaults(r,e){me(this,$h).set(nc(r),{queryKey:r,defaultOptions:e})}getQueryDefaults(r){const e=[...me(this,$h).values()],i={};return e.forEach(n=>{yf(r,n.queryKey)&&Object.assign(i,n.defaultOptions)}),i}setMutationDefaults(r,e){me(this,Ph).set(nc(r),{mutationKey:r,defaultOptions:e})}getMutationDefaults(r){const e=[...me(this,Ph).values()],i={};return e.forEach(n=>{yf(r,n.mutationKey)&&Object.assign(i,n.defaultOptions)}),i}defaultQueryOptions(r){if(r._defaulted)return r;const e={...me(this,zo).queries,...this.getQueryDefaults(r.queryKey),...r,_defaulted:!0};return e.queryHash||(e.queryHash=PC(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===zC&&(e.enabled=!1),e}defaultMutationOptions(r){return r!=null&&r._defaulted?r:{...me(this,zo).mutations,...(r==null?void 0:r.mutationKey)&&this.getMutationDefaults(r.mutationKey),...r,_defaulted:!0}}clear(){me(this,ui).clear(),me(this,Po).clear()}},ui=new WeakMap,Po=new WeakMap,zo=new WeakMap,$h=new WeakMap,Ph=new WeakMap,qo=new WeakMap,zh=new WeakMap,qh=new WeakMap,lB),xB=B.createContext(void 0),Pt=r=>{const e=B.useContext(xB);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},tN=({client:r,children:e})=>(B.useEffect(()=>(r.mount(),()=>{r.unmount()}),[r]),a.jsx(xB.Provider,{value:r,children:e})),_B=B.createContext(!1),Bz=()=>B.useContext(_B);_B.Provider;function Oz(){let r=!1;return{clearReset:()=>{r=!1},reset:()=>{r=!0},isReset:()=>r}}var Dz=B.createContext(Oz()),Iz=()=>B.useContext(Dz),Fz=(r,e,i)=>{const n=i!=null&&i.state.error&&typeof r.throwOnError=="function"?qC(r.throwOnError,[i.state.error,i]):r.throwOnError;(r.suspense||r.experimental_prefetchInRender||n)&&(e.isReset()||(r.retryOnMount=!1))},$z=r=>{B.useEffect(()=>{r.clearReset()},[r])},Pz=({result:r,errorResetBoundary:e,throwOnError:i,query:n,suspense:s})=>r.isError&&!e.isReset()&&!r.isFetching&&n&&(s&&r.data===void 0||qC(i,[r.error,n])),zz=r=>{if(r.suspense){const i=s=>s==="static"?s:Math.max(s??1e3,1e3),n=r.staleTime;r.staleTime=typeof n=="function"?(...s)=>i(n(...s)):i(n),typeof r.gcTime=="number"&&(r.gcTime=Math.max(r.gcTime,1e3))}},qz=(r,e)=>r.isLoading&&r.isFetching&&!e,Hz=(r,e)=>(r==null?void 0:r.suspense)&&e.isPending,rN=(r,e,i)=>e.fetchOptimistic(r).catch(()=>{i.clearReset()});function Uz(r,e,i){var m,y,w,_;const n=Bz(),s=Iz(),o=Pt(),h=o.defaultQueryOptions(r);(y=(m=o.getDefaultOptions().queries)==null?void 0:m._experimental_beforeQuery)==null||y.call(m,h);const l=o.getQueryCache().get(h.queryHash);h._optimisticResults=n?"isRestoring":"optimistic",zz(h),Fz(h,s,l),$z(s);const u=!o.getQueryCache().get(h.queryHash),[d]=B.useState(()=>new e(o,h)),g=d.getOptimisticResult(h),f=!n&&r.subscribed!==!1;if(B.useSyncExternalStore(B.useCallback(b=>{const x=f?d.subscribe(Ti.batchCalls(b)):sn;return d.updateResult(),x},[d,f]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),B.useEffect(()=>{d.setOptions(h)},[h,d]),Hz(h,g))throw rN(h,d,s);if(Pz({result:g,errorResetBoundary:s,throwOnError:h.throwOnError,query:l,suspense:h.suspense}))throw g.error;if((_=(w=o.getDefaultOptions().queries)==null?void 0:w._experimental_afterQuery)==null||_.call(w,h,g),h.experimental_prefetchInRender&&!ic&&qz(g,n)){const b=u?rN(h,d,s):l==null?void 0:l.promise;b==null||b.catch(sn).finally(()=>{d.updateResult()})}return h.notifyOnChangeProps?g:d.trackResult(g)}function Yt(r,e){return Uz(r,Sz)}function Vt(r,e){const i=Pt(),[n]=B.useState(()=>new Mz(i,r));B.useEffect(()=>{n.setOptions(r)},[n,r]);const s=B.useSyncExternalStore(B.useCallback(h=>n.subscribe(Ti.batchCalls(h)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),o=B.useCallback((h,l)=>{n.mutate(h,l).catch(sn)},[n]);if(s.error&&qC(n.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:o,mutateAsync:s.mutate}}const Wz="/api";let jm=null;function WC(r){jm=r}function CB(){return jm}class Gz{async request(e,i){const n={"Content-Type":"application/json",...i==null?void 0:i.headers};jm&&(n["X-Dreamcontext-Vault"]=jm);const s=await fetch(`${Wz}${e}`,{...i,headers:n});if(!s.ok){let o=`Request failed: ${s.status}`;try{const h=await s.json();h.message&&(o=h.message)}catch{}throw new Error(o)}return await s.json()}get(e){return this.request(e)}post(e,i){return this.request(e,{method:"POST",body:JSON.stringify(i)})}patch(e,i){return this.request(e,{method:"PATCH",body:JSON.stringify(i)})}put(e,i){return this.request(e,{method:"PUT",body:JSON.stringify(i)})}del(e){return this.request(e,{method:"DELETE"})}}const De=new Gz;function GC(){const{data:r}=Yt({queryKey:["health"],queryFn:()=>De.get("/health"),staleTime:6e4,retry:1});return{health:r,serverCurrent:(r==null?void 0:r.version)==="0.17.0"}}const Kz=[["vaults"],["launcher-status"],["launcher-federation-graph"],["connections"]];function mc(r){for(const e of Kz)r.invalidateQueries({queryKey:e})}function Vz(){const r=Pt();return Vt({mutationFn:e=>De.post("/launcher/register",e),onSuccess:()=>{mc(r)}})}function Yz(){return Yt({queryKey:["launcher-defaults"],queryFn:()=>De.get("/launcher/defaults"),staleTime:1/0})}function Xz(){const r=Pt();return Vt({mutationFn:e=>De.post("/launcher/scaffold",e),onSuccess:()=>{mc(r)}})}function Zz(){return Yt({queryKey:["launcher-catalog"],queryFn:()=>De.get("/launcher/catalog"),staleTime:1/0})}async function Qz(r){return De.get(`/launcher/detect?path=${encodeURIComponent(r)}`)}function wB(r=!0){return Yt({queryKey:["launcher-status"],queryFn:()=>De.get("/launcher/status"),enabled:r})}function kB(){const r=Pt();return Vt({mutationFn:e=>De.post("/launcher/update",{name:e}),onSuccess:()=>{mc(r)}})}function Jz(){const r=Pt();return Vt({mutationFn:e=>De.post("/launcher/unregister",{name:e}),onSuccess:()=>{mc(r)}})}function e7(){return Yt({queryKey:["launcher-federation-graph"],queryFn:()=>De.get("/launcher/federation-graph")})}function t7(){const r=Pt();return Vt({mutationFn:e=>De.post("/launcher/connection",e),onSuccess:()=>{mc(r)}})}function r7(){const r=Pt();return Vt({mutationFn:e=>De.post("/launcher/connection/remove",e),onSuccess:()=>{mc(r)}})}function i7(){const r=Pt();return Vt({mutationFn:e=>De.post("/launcher/shareable",e),onSuccess:()=>{mc(r)}})}const Pn={status:["brain-status"],settings:["brain-settings"],authStatus:["brain-auth-status"],teamUpdates:["brain-team-updates"]};function yc(r){r.invalidateQueries({queryKey:Pn.status}),r.invalidateQueries({queryKey:Pn.settings}),r.invalidateQueries({queryKey:Pn.teamUpdates}),r.invalidateQueries({queryKey:Pn.authStatus})}function KC(){return Yt({queryKey:Pn.status,queryFn:()=>De.get("/brain/status")})}function n7(){return Yt({queryKey:Pn.settings,queryFn:()=>De.get("/brain/settings")})}function s7(){const r=Pt();return Vt({mutationFn:e=>De.post("/brain/settings",{enabled:e}),onSuccess:e=>{r.setQueryData(Pn.settings,e),yc(r)}})}function a7(){const r=Pt();return Vt({mutationFn:(e={})=>De.post("/brain/origin/create",e),onSuccess:()=>yc(r)})}function o7(){const r=Pt();return Vt({mutationFn:e=>De.post("/brain/origin/attach",{url:e}),onSuccess:()=>yc(r)})}function l7(){const r=Pt();return Vt({mutationFn:e=>De.post("/brain/origin/update",{url:e}),onSuccess:()=>yc(r)})}function c7(){const r=Pt();return Vt({mutationFn:()=>De.post("/brain/origin/detach",{}),onSuccess:()=>yc(r)})}function VC(){return Yt({queryKey:Pn.authStatus,queryFn:()=>De.get("/brain/auth/status")})}function h7(){return Vt({mutationFn:()=>De.post("/brain/auth/device/start",{})})}function u7(){return Vt({mutationFn:r=>De.post("/brain/auth/device/poll",{sessionId:r})})}function d7(){const r=Pt();return Vt({mutationFn:e=>De.post("/brain/auth/token",{token:e}),onSuccess:e=>r.setQueryData(Pn.authStatus,e)})}function f7(){const r=Pt();return Vt({mutationFn:()=>De.post("/brain/auth/logout",{}),onSuccess:e=>r.setQueryData(Pn.authStatus,e)})}function p7(){const r=Pt();return Vt({mutationFn:(e="pull-only")=>{const{mode:i="pull-only",noCheckpoint:n=!1}=typeof e=="string"?{mode:e}:e;return De.post("/brain/sync",{mode:i,foreground:!0,noCheckpoint:n})},onSuccess:()=>yc(r)})}function g7(){const r=Pt();return Vt({mutationFn:e=>De.post("/brain/scrub/ignore",{path:e}),onSuccess:()=>yc(r)})}function SB(){return Yt({queryKey:Pn.teamUpdates,queryFn:()=>De.get("/brain/team/updates"),select:r=>r.vaults})}function TB(){const r=Pt();return Vt({mutationFn:e=>De.post("/brain/team/fetch",e?{vault:e}:{}),onSuccess:()=>{r.invalidateQueries({queryKey:Pn.teamUpdates}),r.invalidateQueries({queryKey:Pn.status})}})}const m7="modulepreload",y7=function(r){return"/"+r},iN={},Zt=function(e,i,n){let s=Promise.resolve();if(i&&i.length>0){let h=function(d){return Promise.all(d.map(g=>Promise.resolve(g).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),u=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));s=h(i.map(d=>{if(d=y7(d),d in iN)return;iN[d]=!0;const g=d.endsWith(".css"),f=g?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${f}`))return;const m=document.createElement("link");if(m.rel=g?"stylesheet":m7,g||(m.as="script"),m.crossOrigin="",m.href=d,u&&m.setAttribute("nonce",u),document.head.appendChild(m),g)return new Promise((y,w)=>{m.addEventListener("load",y),m.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${d}`)))})}))}function o(h){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=h,window.dispatchEvent(l),!l.defaultPrevented)throw h}return s.then(h=>{for(const l of h||[])l.status==="rejected"&&o(l.reason);return e().catch(o)})};function qi(){return!!window.__TAURI_INTERNALS__}const b7='button, input, a, select, textarea, [role="button"], [data-no-drag]';function YC(r){return r instanceof Element&&r.closest(b7)!==null}async function v7(r){if(qi()&&!YC(r))try{const{getCurrentWindow:e}=await Zt(async()=>{const{getCurrentWindow:i}=await import("./window-DmNpeJAL.js").then(n=>n.w);return{getCurrentWindow:i}},__vite__mapDeps([0,1,2]));await e().startDragging()}catch{}}async function EB(){if(qi())try{const{getCurrentWindow:r}=await Zt(async()=>{const{getCurrentWindow:e}=await import("./window-DmNpeJAL.js").then(i=>i.w);return{getCurrentWindow:e}},__vite__mapDeps([0,1,2]));await r().close()}catch{}}async function x7(){if(qi()){try{const e=(await Zt(()=>import("./webviewWindow-BbG9Cr7f.js"),__vite__mapDeps([3,0,1,2]))).WebviewWindow,i=e.getAll?await e.getAll():[];if(i.length>0){await Promise.all(i.map(n=>n.close().catch(()=>{})));return}}catch{}await EB()}}function NB(r){if(r.button!==0)return;const e=r.target;if(YC(e))return;const i=r.clientX,n=r.clientY,s=h=>{(Math.abs(h.clientX-i)>4||Math.abs(h.clientY-n)>4)&&(o(),v7(e))},o=()=>{window.removeEventListener("mousemove",s),window.removeEventListener("mouseup",o)};window.addEventListener("mousemove",s),window.addEventListener("mouseup",o)}async function jB(r){if(qi()&&!YC(r))try{const{getCurrentWindow:e}=await Zt(async()=>{const{getCurrentWindow:i}=await import("./window-DmNpeJAL.js").then(n=>n.w);return{getCurrentWindow:i}},__vite__mapDeps([0,1,2]));await e().toggleMaximize()}catch{}}async function AB(){if(qi()){const{open:e}=await Zt(async()=>{const{open:n}=await import("./index-NsrznfmA.js");return{open:n}},__vite__mapDeps([4,1])),i=await e({directory:!0,multiple:!1});return typeof i=="string"?i:null}const r=window.prompt("Enter an absolute path to a dreamcontext project:");return r&&r.trim()?r.trim():null}async function _7(){if(qi())try{const{open:e}=await Zt(async()=>{const{open:n}=await import("./index-NsrznfmA.js");return{open:n}},__vite__mapDeps([4,1])),i=await e({directory:!1,multiple:!0});return Array.isArray(i)?i.filter(n=>typeof n=="string"):typeof i=="string"?[i]:[]}catch{return[]}const r=window.prompt("Enter absolute file path(s), comma-separated:");return r?r.split(",").map(e=>e.trim()).filter(Boolean):[]}function MB(r,e){return new Promise((i,n)=>{r.once("tauri://created",()=>i()),r.once("tauri://error",s=>n(new Error(`${e} window create failed: ${String(s.payload)}`)))})}async function LB(r){if(qi()){const{WebviewWindow:e}=await Zt(async()=>{const{WebviewWindow:o}=await import("./webviewWindow-BbG9Cr7f.js");return{WebviewWindow:o}},__vite__mapDeps([3,0,1,2])),i=`vault-${r.replace(/[^a-zA-Z0-9_-]/g,"-")}`,n=await e.getByLabel(i);if(n){await n.setFocus();return}const s=new e(i,{url:`${window.location.origin}/?vault=${encodeURIComponent(r)}`,title:`dreamcontext — ${r}`,width:1280,height:800,titleBarStyle:"overlay",hiddenTitle:!0,dragDropEnabled:!1});await MB(s,`vault "${r}"`);return}window.open(`/?vault=${encodeURIComponent(r)}`,"_blank")}async function C7(){if(qi()){const{WebviewWindow:r}=await Zt(async()=>{const{WebviewWindow:n}=await import("./webviewWindow-BbG9Cr7f.js");return{WebviewWindow:n}},__vite__mapDeps([3,0,1,2])),e=await r.getByLabel("main");if(e){await e.setFocus();return}const i=new r("main",{url:`${window.location.origin}/`,title:"dreamcontext",width:1280,height:800,titleBarStyle:"overlay",hiddenTitle:!0,dragDropEnabled:!1});await MB(i,"launcher");return}window.location.assign(`${window.location.origin}/`)}async function nN(r){await LB(r)}function Am({exists:r,needsUpdate:e,title:i,className:n}){const s=r?e?"stale":"ok":"gone";return a.jsx("span",{className:`vault-dot vault-dot--${s}${n?` ${n}`:""}`,title:i,"aria-hidden":"true"})}const w7={en:{"nav.brain":"Map","nav.tasks":"Tasks","nav.roadmap":"Roadmap","nav.labpage":"Insights","nav.core":"Core","nav.knowledge":"Knowledge","nav.sleep":"Sleep Cycle","nav.council":"Council","nav.settings":"Settings","nav.packs":"Packs","nav.taxonomy":"Taxonomy","nav.about":"What is this?","nav.lab":"Lab","nav.beta":"Beta","nav.group.workspace":"Workspace","nav.group.memory":"Memory","nav.group.brain":"Brain","nav.group.control":"Control Panel","nav.collapse":"Collapse","nav.expand":"Expand","lab.credentials.title":"{n} credential(s) missing — some insights can’t sync","lab.credentials.hint":"Paste each value below, or run `dreamcontext lab credentials set <key>` from the CLI. Values are stored gitignored and never shown again.","lab.credentials.usedBy":"Used by {slugs}","lab.credentials.placeholder":"Paste the value…","lab.credentials.save":"Save","lab.credentials.saving":"Saving…","lab.credentials.saved":"Credential “{key}” saved.","lab.credentials.saveFailed":"Could not save “{key}” — {message}","lab.credentials.collapse":"Hide","lab.credentials.expand":"Show","council.title":"Council","council.tab.verdict":"Verdict","council.tab.matrix":"Matrix","council.tab.transcript":"Transcript","council.search.placeholder":"Search sessions…","council.search.matrix":"Filter cells by text…","council.search.transcript":"Search transcript…","council.filter.all":"All","council.filter.status":"Status","council.inspector.empty":"Select a persona or cell to inspect.","council.inspector.selectCell":"Select a cell in the matrix for round details.","council.verdict.awaitingSynthesis":"Awaiting synthesis","council.verdict.synthPending":"The final report will appear here once the synthesizer runs.","council.empty.list":"No debates yet.","council.empty.detail":"Select a council session from the list.","council.lab.tagline":"A panel of AI personas debates a hard decision across rounds, then synthesizes a verdict you can trace.","council.new":"New debate","council.empty.cta":"Start your first debate","council.empty.nomatch":"No debates match your search.","tasks.title":"Tasks","tasks.create":"New Task","tasks.filter":"Filter","tasks.todo":"To Do","tasks.in_progress":"In Progress","tasks.in_review":"In Review","tasks.completed":"Completed","tasks.name":"Task Name","tasks.description":"Description","tasks.priority":"Priority","tasks.tags":"Tags","tasks.save":"Create Task","tasks.cancel":"Cancel","tasks.changelog":"Changelog","tasks.add_entry":"Add Entry","tasks.customFields.sectionLabel":"Custom","rice.title":"RICE","rice.reach":"Reach","rice.impact":"Impact","rice.confidence":"Confidence","rice.effort":"Effort","rice.score":"Score","rice.clear":"Clear RICE","rice.tooltip.reach":"How many people / sessions / units affected (1–10)","rice.tooltip.impact":"How much per affected unit (1=minimal, 5=massive)","rice.tooltip.confidence":"How sure are you? (25, 50, 75, 100)","rice.tooltip.effort":"Person-weeks (0.5–8 typical, max 52)","rice.empty":"Not rated","sort.rice":"RICE score","filter.min_rice":"Min RICE","priority.critical":"Critical","priority.high":"High","priority.medium":"Medium","priority.low":"Low","sleep.title":"Sleep State","sleep.debt":"Debt","sleep.level":"Level","sleep.last_sleep":"Last Sleep","sleep.sessions":"Sessions","sleep.alert":"Alert","sleep.drowsy":"Drowsy","sleep.sleepy":"Sleepy","sleep.must_sleep":"Must Sleep","sleep.active":"Sleeping","sleep.waiting":"Waiting to sleep…","sleep.menu.details":"Show sleep details","sleep.menu.run":"Run sleep agent","sleep.menu.run.disabled":"Agent unavailable — needs the desktop app with node-pty + the Claude CLI","sleep.menu.run.active":"A consolidation is already in progress","sleep.menu.run.waiting":"Waiting for the sleep agent to start…","sleep.changelog":"Changelog","sleep.changelog.pending":"Will fold into next sleep","sleep.changelog.breaking":"BREAKING","sleep.changelog.earlier":"earlier entries not shown","sleep.summary":"Summary","sleep.never":"Never","sleep.tagline.alert":"Wide awake. Your project memory is fresh and fully consolidated.","sleep.tagline.drowsy":"Resting easy. A handful of new memories have gathered since the last sleep.","sleep.tagline.sleepy":"Getting drowsy. A consolidation will soon weave recent work into long-term memory.","sleep.tagline.must_sleep":"It's time to sleep. Run a consolidation to fold recent work into long-term memory.","sleep.next.title":"Next sleep will consolidate","sleep.next.subtitle":"Everything captured since the last sleep — folded into long-term memory on the next cycle.","sleep.next.change":"change","sleep.next.changes":"changes","sleep.dashboard_changes":"Dashboard Changes","sleep.cloud.title":"Sleep cloud","sleep.cloud.subtitle":"Everything gathered since your last sleep — the next consolidation will weave it all into long-term memory.","sleep.cloud.item":"item","sleep.cloud.items":"items","sleep.cloud.stat.sessions":"Work sessions","sleep.cloud.stat.dashboard":"Dashboard edits","sleep.cloud.stat.highlights":"Highlights","sleep.cloud.stat.changelog":"Captured","sleep.cloud.group.dashboard":"Dashboard activity","sleep.cloud.group.dashboard.hint":"Manual edits you made in the dashboard — tasks, knowledge, features and more.","sleep.cloud.group.sessions":"Work sessions","sleep.cloud.group.sessions.hint":"Coding sessions since the last sleep, scored into the debt meter.","sleep.cloud.group.highlights":"Highlights","sleep.cloud.group.highlights.hint":"High-signal moments auto-tagged during work — processed first.","sleep.cloud.group.changelog":"Captured changelog","sleep.cloud.group.changelog.hint":"Shipped notes captured since the last sleep.","sleep.cloud.empty.title":"The cloud is clear","sleep.cloud.empty.sub":"Your memory is fully consolidated. New sessions and dashboard edits will gather here until the next sleep.","sleep.cloud.active":"Active","sleep.entity.task":"Tasks","sleep.entity.knowledge":"Knowledge","sleep.entity.feature":"Features","sleep.entity.core":"Core","sleep.entity.sleep":"Sleep","core.title":"Core Files","knowledge.title":"Knowledge","knowledge.pin":"Pin","knowledge.unpin":"Unpin","knowledge.search":"Search knowledge...","knowledge.fullscreen":"Full screen","settings.title":"Settings","settings.nav.platforms":"Platforms","settings.nav.tasks":"Cloud Tasks","settings.nav.format":"Task Format","settings.nav.memory":"Memory","settings.nav.connections":"Connections","settings.nav.brain":"Cloud sync","settings.nav.agents":"Agents","settings.nav.sleepy":"Sleepy","settings.navdesc.platforms":"Which AI coding agents this project uses","settings.navdesc.tasks":"Sync tasks to ClickUp or GitHub","settings.navdesc.format":"Add custom fields to your tasks","settings.navdesc.memory":"Control Claude's built-in memory","settings.navdesc.connections":"Share knowledge between your projects","settings.navdesc.brain":"Back up and share your project memory on GitHub","settings.navdesc.agents":"The in-app Claude Code panel","settings.navdesc.sleepy":"Notch quick-capture hotkey","settings.desc.platforms":"Tell dreamcontext which AI coding agents you use. It installs the right hooks and context files for each one so your project memory loads automatically.","settings.desc.tasks":"By default your tasks live in local files. Turn this on to mirror them to a cloud backend (ClickUp or GitHub Issues) so your team can see them too — recall, snapshots and this dashboard keep working either way.","settings.desc.memory":"dreamcontext can be the single source of your project's memory instead of Claude Code's built-in memory file.","settings.desc.brain":"Sign in with GitHub and connect a brain repo to back up your project memory to the cloud and share it with your team. Off by default — nothing syncs until you turn it on.","settings.agents.title":"Agents — in-app Claude Code","settings.agents.enable":"Enable the Agents surface","settings.agents.enable_hint":"Show the in-app agent launcher (the corner button and session dock). Turning this off hides it and closes any open agent view; running sessions keep going in the background.","settings.agents.restore_tabs":"Reopen past tabs on launch","settings.agents.restore_tabs_hint":"When the app starts, restore the agent/terminal tabs from your last session (agents resume their conversation). Off = always start with a clean slate.","settings.agents.default_agent":"Default agent","settings.agents.default_agent_hint":"Which agent a new session runs. Only Claude Code is available for now.","settings.agents.agent.claude":"Claude Code","settings.agents.auto_title":"Auto-name tabs from your first message","settings.agents.auto_title_hint":"Off by default. When on, after a new agent session's first turn a fast Haiku model reads your opening message and renames the tab to a short, descriptive title. Only tabs still named “Agent N” are renamed — tabs you've renamed yourself are never touched.","settings.agents.hotkey":"Quick open/close hotkey","settings.agents.hotkey_hint":"Press this anywhere in the app to open or close the Agents view. Default ⌃A. Click the field and press a new combo to rebind — or double-tap a single modifier (Ctrl, Option, ⌘, or Shift) to bind it as ⌃⌃-style two-taps. Backspace clears it. A chord yields to a focused terminal (close it with Esc or the collapse button); a double-tap toggles from anywhere, even inside a terminal.","settings.agents.hotkey_capturing":"Press a combo, or double-tap a modifier…","settings.platforms":"Platforms","settings.save":"Save","settings.saving":"Saving...","settings.saved":"Saved","settings.no_config":"No configuration file found. Saving will create one with your selections.","settings.platform.claude":"Claude (Anthropic)","settings.packs.installed":"Installed","settings.memory":"Memory","settings.brain":"Cloud sync","settings.native_memory.label":"Disable Claude's native memory","settings.native_memory.hint":"Recommended — dreamcontext becomes the single source of project memory instead of Claude Code’s built-in MEMORY.md.","settings.recall.title":"Memory recall","settings.recall.desc":"How dreamcontext finds relevant project memory for each prompt.","settings.recall.experimental":"Experimental","settings.recall.haiku.label":"Haiku (recommended)","settings.recall.haiku.hint":"A fast Haiku model reads each prompt and picks the most relevant docs.","settings.recall.raw.label":"Raw","settings.recall.raw.hint":"BM25 keyword search only — no LLM call, fully local.","settings.recall.hybrid.label":"Hybrid","settings.recall.hybrid.hint":"BM25 + local dense embeddings, blended (no LLM call). Falls back to BM25 if the embedding model is unavailable — the first use downloads a ~113MB model.","settings.recall.off.label":"Off","settings.recall.off.hint":"Memory recall disabled — no project memory is injected into prompts.","settings.recall.embed.checking":"Checking hybrid search…","settings.recall.embed.ready":"Hybrid search ready","settings.recall.embed.local":"local, offline","settings.recall.embed.chunks":"sections indexed","settings.recall.embed.needed":"Hybrid needs a local embedding model (~113 MB, one-time download). It runs on your machine — nothing is uploaded.","settings.recall.embed.download":"Download model (~113 MB)","settings.recall.embed.starting":"Starting…","settings.recall.embed.step1of2":"Step 1 of 2","settings.recall.embed.step2of2":"Step 2 of 2","settings.recall.embed.downloading":"Downloading model…","settings.recall.embed.downloading.hint":"One-time download. You can leave this page — it keeps going in the background.","settings.recall.embed.failed":"Model download failed","settings.recall.embed.retry":"Retry","settings.recall.embed.indexing":"Building search index…","settings.recall.embed.indexing.hint":"One-time. Indexing your brain for semantic search — this can take a few minutes the first time.","settings.recall.embed.index_needed":"Model ready. Now build this vault’s search index to finish enabling hybrid.","settings.recall.embed.build_index":"Build search index","settings.recall.embed.index_failed":"Search index build failed","settings.recall.embed.no_runtime":"Embedding runtime not installed","settings.recall.embed.no_runtime.hint":"The @huggingface/transformers package is missing on this machine, so Hybrid falls back to keyword (BM25) recall. Reinstall dreamcontext to add it.","settings.tasks":"Tasks","settings.cloud_tasks.label":"Cloud Task Management","settings.cloud_tasks.hint":"Tasks live in a remote backend; a gitignored local mirror keeps recall, snapshots, and the dashboard working unchanged.","settings.cloud_tasks.provider":"Provider","settings.cloud_tasks.provider.clickup":"ClickUp","settings.cloud_tasks.provider.github":"GitHub","settings.cloud_tasks.team":"Team ID","settings.cloud_tasks.space":"Space ID","settings.cloud_tasks.list":"List ID","settings.cloud_tasks.token_hint":"The key is saved to a gitignored secrets file (never in this config). You can also set it from the CLI with `dreamcontext config clickup-token`.","settings.cloud_tasks.github.hint":"Tasks sync to a GitHub repository's Issues; a gitignored local mirror keeps recall, snapshots, and the dashboard working unchanged.","settings.cloud_tasks.github.owner":"Owner","settings.cloud_tasks.github.repo":"Repository","settings.cloud_tasks.github.repo_picker":"Discovered repository","settings.cloud_tasks.github.pick":"Pick the repository to sync to…","settings.cloud_tasks.github.search":"Search repositories…","settings.cloud_tasks.github.token_hint":"The token is saved to a gitignored secrets file (never in this config). You can also set it from the CLI with `dreamcontext config github-token`. Needs `repo` scope (classic) or Issues read/write + Metadata (fine-grained).","settings.cloud_tasks.github.provision":"Provision labels","settings.cloud_tasks.github.provisioning":"Provisioning…","settings.cloud_tasks.list_pick":"Pick the list to sync to…","settings.cloud_tasks.list_search":"Search lists…","settings.cloud_tasks.keep_current":"(keep current)","settings.cloud_tasks.list_label":"List","settings.cloud_tasks.provision":"Provision fields","settings.cloud_tasks.provisioning":"Provisioning…","settings.cloud_tasks.test":"Test connection","settings.cloud_tasks.testing":"Testing…","settings.cloud_tasks.test_ok":"Connected as","settings.cloud_tasks.status":"Sync status","settings.cloud_tasks.pending":"pending push","settings.cloud_tasks.conflicts":"conflict(s) preserved in state/.conflicts/","settings.cloud_tasks.api_key":"API key","settings.cloud_tasks.api_key_placeholder":"Paste your API key…","settings.cloud_tasks.api_key_none":"No key saved yet — paste it above, then Test connection (it saves automatically).","settings.cloud_tasks.api_key_set":"Key saved ✓","settings.cloud_tasks.api_key_env":"Using an environment variable ✓ (overrides any saved key)","settings.cloud_tasks.preview_title":"These custom fields will be created on the list:","settings.cloud_tasks.github.preview_title":"These labels will be created on the repository:","settings.cloud_tasks.preview_will_create":"Will create ({n})","settings.cloud_tasks.preview_existing":"Already exist ({n})","settings.cloud_tasks.provision_confirm":"Create {n} now","settings.cloud_tasks.provision_creating":"Creating…","settings.cloud_tasks.provision_cancel":"Cancel","settings.cloud_tasks.provision_created":"Created","settings.cloud_tasks.provision_backfilled":"backfilled {n} value(s)","settings.cloud_tasks.provision_nothing":"All recommended fields already exist.","settings.federation":"Cross-Project Federation","settings.desc.connections":"Connect this project to your other dreamcontext projects so they can share knowledge. Everything here is off until you opt in.","federation.board.title":"Connection map","federation.board.desc":"Each card is one of your projects. Drag from one project to another to make the first read the second live. Click a project to see who reads it or to let others read it; click a wire to remove it.","federation.advanced":"More — list view, topic filters, inbox & sync preview","federation.vaults.desc":"Every dreamcontext project on this machine that this one can connect to.","federation.connections.desc":"Projects this one is already linked with. Set the direction and, optionally, limit which topics flow.","federation.add.desc":"Link a new project and choose whether you read from it, share to it, or both.","federation.inbox.desc":"Knowledge that connected projects have sent you. It folds into your memory on the next sleep cycle.","federation.preview.title":"Preview what you would share","federation.intro.title":"What is cross-project federation?","federation.intro.body":"Federation lets your projects share knowledge with each other. Connect two projects and one can “read” the other — its agent can recall decisions, changelog and knowledge from across the link. It’s off by default: nothing is shared until you opt in.","federation.intro.step1":"1. Turn on Sharing below so other projects are allowed to read this one.","federation.intro.step2":"2. Add a connection to a peer and choose the direction — read it, share to it, or both.","federation.intro.step3":"3. Incoming knowledge lands in the digest inbox and is folded in on the next sleep cycle.","federation.sharing":"Sharing","federation.shareable.label":"Let other projects read this one","federation.shareable.hint":"When on, projects you’ve connected may pull this project’s knowledge into their recall. Off = private (the default). This only controls who may READ you — it never stops you reading others.","federation.vaults":"Registered vaults","federation.vaults.empty":"No vaults registered. Run `dreamcontext vaults discover --register` to add sibling projects.","federation.current":"This project","federation.connections":"Connections","federation.connections.empty":"No connections yet. Add a peer below to read or share knowledge across projects.","federation.stale":"Stale","federation.remove":"Remove","federation.direction":"Direction","federation.direction.out":"→ Share to","federation.direction.in":"← Read from","federation.direction.both":"⇄ Two-way","federation.direction.out.hint":"Your knowledge flows to this peer, and your recall can reach into theirs.","federation.direction.in.hint":"Accept this peer’s digests into your inbox.","federation.direction.both.hint":"Read from and share to this peer.","federation.topics.placeholder":"topics (comma-separated, blank = all)","federation.topics.label":"Limit to topics","federation.add":"Add a connection","federation.add.pick":"Pick a vault…","federation.add.none":"Every registered vault is already connected (or none are available to add).","federation.connect":"Connect","federation.error.pick_vault":"Pick a vault to connect to.","federation.inbox":"Digest inbox","federation.inbox.pending":"Pending","federation.inbox.consumed":"Consumed","federation.inbox.empty":"Inbox is empty — no peer digests waiting. The next sleep cycle drains it.","federation.inbox.quarantined":"Quarantined (incompatible schema — left in place)","federation.inbox.from":"from","federation.preview":"Preview sync","federation.preview.running":"Previewing…","federation.preview.hint":"Dry-run: computes the digests that would be pushed to consenting peers. Writes nothing.","federation.preview.none":"No out/both connections to preview.","federation.preview.stale":"unreachable (stale)","federation.preview.noconsent":"no consent (peer must link in/both back)","federation.preview.nodelta":"no new entries since last sync","federation.preview.entries":"entries would be pushed","federation.map.help":"How it works","federation.map.connections":"Connections","federation.map.hint.default":"Drag from one project to another to connect them. Click a project for details, or click a wire to edit it.","federation.map.hint.first":"Try it: drag from one project card onto another — the first will read the second, live.","federation.map.hint.armed":"Now click the project “{name}” should read. Esc cancels.","federation.map.legend.live":"reads — live, nothing copied","federation.map.legend.inert":"not Readable yet","federation.map.legend.ok":"up to date","federation.map.legend.stale":"needs update","federation.map.legend.gone":"folder missing","federation.map.note.connected":"“{from}” now reads “{to}” — live.","federation.map.note.inert":"“{from}” now reads “{to}”, but “{to}” isn’t Readable yet — the wire stays inert until you switch it on.","federation.map.note.makeReadable":"Turn on Readable","federation.map.note.readable":"“{name}” is now Readable — its wires are live.","federation.map.note.failed":"Failed to connect.","federation.map.wire.reads":"reads","federation.map.wire.mutual":"read each other","federation.map.wiremenu.title":"Connection","federation.map.wiremenu.row":"“{from}” reads “{to}”","federation.map.wiremenu.notLive":"not live — “{name}” isn’t Readable","federation.map.wiremenu.remove":"Remove","federation.map.wiremenu.makeReadable":"Make “{name}” Readable","federation.map.conns.title":"All connections","federation.map.conns.empty":"No connections yet — drag one project onto another to create the first wire.","federation.map.conns.mutual":"{a} ⇄ {b} — read each other","federation.map.conns.reads":"{from} reads {to}","federation.map.conns.inert":" — not Readable yet","federation.map.detail.gone":"Folder is gone.","federation.map.detail.behind":"Behind: v{from} → v{to}","federation.map.detail.current":"Up to date (v{v})","federation.map.detail.update":"Update","federation.map.detail.updating":"Updating…","federation.map.detail.readable":"Readable — let connected projects read this one","federation.map.detail.connect":"Connect to another project…","federation.map.detail.connections":"Connections","federation.map.detail.none":"No connections yet.","federation.map.detail.youRead":"Reads “{name}” live","federation.map.detail.readsYou":"“{name}” reads this project live","federation.map.detail.notLive":" — not Readable yet","federation.map.status.loading":"Loading the connection map…","federation.map.status.error":"Failed to load the connection map.","federation.map.empty.title":"Nothing to connect yet","federation.map.empty.body":"Register at least two projects, then wire them so one can read the other’s memory live.","federation.map.guide.title":"How the connection map works","federation.map.guide.def":"App reads Libs’ canonical memory live during recall — a reference, never a copy. Each project stays the single source of truth for its own knowledge.","federation.map.guide.step1":"Drag from one project onto another — the first now reads the second.","federation.map.guide.step2":"Click a project to see its connections and switch on Readable (violet dot) so others may read it.","federation.map.guide.step3":"Click any wire to remove it — or to make its target Readable if it isn’t live yet.","federation.map.guide.keys":"Shortcuts: + / − zoom · 0 fit · Esc cancel · ? this guide","federation.map.guide.gotit":"Got it","federation.map.guide.start":"Start wiring","federation.map.zoom.in":"Zoom in","federation.map.zoom.out":"Zoom out","federation.map.zoom.fit":"Fit to view","packs.title":"Skill Packs","packs.section.packs":"Packs","packs.section.standalone":"Standalone Skills","packs.detail.base":"Base Skill","packs.detail.subskills":"Sub-Skills","packs.detail.agents":"Related Agents","packs.detail.close":"Close","packs.action.install":"Install","packs.action.remove":"Remove","packs.action.installing":"Installing…","packs.action.removing":"Removing…","packs.action.error":"Action failed","update.available":"Update available","update.title":"Update Available","update.dismiss":"Dismiss","update.managePacks":"Manage packs →","update.upgradeAll":"Upgrade everything","update.upgradeHint":"Updates the CLI, this desktop app, and every project — in one step.","update.upgrading":"Upgrading…","update.upgraded":"Upgrade complete.","update.relaunch":"Relaunch to finish","update.relaunchHint":"Quit and reopen dreamcontext to apply the new version.","update.upgradeFailed":"Upgrade failed.","update.retry":"Try again","upgradeRelaunch.countdown":"dreamcontext updated to v{version} — relaunching in {seconds}s to apply.","upgradeRelaunch.deferred":"dreamcontext v{version} is installed — relaunch to apply the update.","upgradeRelaunch.relaunching":"Relaunching to apply the update…","upgradeRelaunch.now":"Relaunch now","upgradeRelaunch.later":"Later","upgradeRelaunch.failed":"Couldn't relaunch automatically — quit and reopen dreamcontext to finish updating.","upgradeRelaunch.retry":"Try again","taxonomy.title":"Taxonomy","common.loading":"Loading...","common.error":"Error","common.empty":"Nothing here yet.","common.close":"Close","common.cancel":"Cancel","brain.sidebar.connect":"Connect GitHub","brain.sidebar.setup":"Set up team sync","brain.sidebar.synced":"Synced","brain.sidebar.syncedProject":"Project synced","brain.sidebar.syncing":"Syncing…","brain.sidebar.syncNowTip":"Sync now — pull teammates’ changes, then merge & push yours","brain.sidebar.settingsTip":"Cloud sync settings","brain.sidebar.refresh":"Sync now","brain.sidebar.refreshing":"Syncing…","brain.sidebar.refreshTip":"Pull and merge the latest team updates","brain.sidebar.refreshDone":"Synced ✓","brain.sidebar.refreshUpToDate":"Up to date ✓","brain.sidebar.refreshPulled":"Pulled {n} update(s) ✓","brain.sidebar.refreshPushed":"Synced ✓","brain.sidebar.refreshAwaitingAgent":"A teammate edited the same section — resolve it","brain.sidebar.refreshBlocked":"Sync blocked — possible secret found","brain.sidebar.refreshFailed":"Sync failed","brain.sidebar.resolveLabel":"A teammate edited the same section — Resolve with AI","brain.sidebar.resolveTip":"Launch the in-app agent to reconcile the overlapping edits (or copy the command)","brain.sync.failed":"Sync failed — see below","brain.sync.codeConflictShort":"Code conflict — resolve in your editor","brain.sync.userMergeShort":"Finish your git merge first","brain.sync.detachedShort":"Detached HEAD — check out a branch","brain.resolve.launching":"Launching Resolve agent…","brain.resolve.fallbackTitle":"Run this to reconcile with the team:","brain.resolve.copy":"Copy command","brain.resolve.copied":"Copied ✓","brain.code.title":"A teammate changed the same code","brain.code.hint":"Resolve the conflict markers in your editor, commit the merge, then sync.","brain.code.more":"+{n} more","brain.userMerge.title":"You have a git merge in progress","brain.userMerge.hint":"Finish (or abort) your own merge, then run sync again.","brain.recovery.reconnect":"Reconnect GitHub","brain.recovery.checkPerms":"Open Settings","brain.recovery.retry":"Retry sync","brain.recovery.openSettings":"Open Settings","brain.scrub.title":"Sync blocked — possible secret found","brain.scrub.ignore":"Add to .gitignore","brain.scrub.hint":"For a real source file, remove the secret instead of un-tracking it.","brain.checkpoint.note":"Checkpointed your local edits","brain.checkpoint.undo":"Undo: git reset --soft {sha}^","brain.scope.autoCheckpoint.label":"Auto-checkpoint local edits when the dashboard opens","brain.scope.autoCheckpoint.hint":"On open, uncommitted edits are committed as a clearly-labelled checkpoint before pulling teammates’ changes, so nothing is ever lost to a merge. Turn off to leave uncommitted work untouched (the on-open pull is skipped while your tree is dirty).","brain.auth.title":"GitHub sign-in","brain.auth.continueWithGithub":"Continue with GitHub","brain.auth.signedIn":"Signed in with GitHub","brain.auth.signedInAs":"Signed in as {login}","brain.auth.signOut":"Sign out","brain.auth.expired":"GitHub sign-in expired","brain.auth.expiredAs":"Signed in as {login} — session expired","brain.auth.expiredHint":"GitHub rejected your saved sign-in, so cloud sync can’t push or pull. Reconnect below to fix it — your local work is safe and nothing was lost.","brain.auth.scopeDisclosure":"This grants access to all your private repositories — GitHub does not offer a narrower scope for the device flow. If you would rather limit access to one repo, use a fine-grained personal access token instead.","brain.auth.device.hint":"Enter this code on GitHub to finish connecting.","brain.auth.device.open":"Open GitHub","brain.auth.device.waiting":"Waiting for you to approve on GitHub…","brain.auth.device.starting":"Starting…","brain.auth.device.denied":"Sign-in was denied on GitHub.","brain.auth.device.expired":"This code expired. Try again.","brain.auth.device.error":"Something went wrong signing in with GitHub.","brain.auth.oauthUnavailable":"Connect with a personal access token below. Create a fine-grained token limited to just your brain repo, with Contents read/write access, then paste it here.","brain.auth.pat.recommend":"Prefer a fine-grained token? Use a personal access token instead","brain.auth.pat.hide":"Hide token form","brain.auth.pat.hint":"Recommended for tighter scope: create a fine-grained personal access token limited to just the brain repo, with Contents read/write access, and paste it below.","brain.auth.pat.placeholder":"ghp_… or github_pat_…","brain.auth.pat.submit":"Connect","brain.auth.pat.submitting":"Connecting…","brain.cloudSync.label":"Cloud sync","brain.cloudSync.hint":"Sync your whole project (code + brain) to its GitHub repo so your team can share it.","brain.cloudSync.desc":"When on, dreamcontext syncs the entire project folder — your code, .claude, and the brain — to this project’s GitHub origin on your current branch (fetch, merge, commit, push). When off, the brain is still committed inside your code repo, but never pushed on its own. Needs a GitHub origin on this project.","brain.cloudSync.error":"Could not turn on cloud sync.","brain.cloudSync.source.explicit":"set here","brain.cloudSync.source.derived":"from config","brain.origin.title":"This project has no GitHub repo yet","brain.origin.desc":"Cloud sync pushes your whole project to its GitHub origin. Create a new repo or connect an existing one to set it up.","brain.origin.tab.create":"Create new","brain.origin.tab.attach":"Connect existing","brain.origin.namePlaceholder":"Repository name (defaults to the project folder)","brain.origin.private":"Private repository","brain.origin.publicWarn":"A public repo means anyone can read your code and brain. Only do this on purpose.","brain.origin.createBtn":"Create & connect","brain.origin.creating":"Creating…","brain.origin.urlPlaceholder":"https://github.com/owner/repo","brain.origin.attachHint":"Paste an existing GitHub repo (ideally empty) to use as this project’s origin.","brain.origin.attachBtn":"Connect","brain.origin.attaching":"Connecting…","brain.origin.connected":"Connected to {repo}","brain.origin.firstSyncOk":"Your project was pushed to GitHub. Cloud sync is on.","brain.origin.firstSyncFailed":"Origin connected, but the first sync needs attention.","brain.origin.connectedTitle":"Connected repo","brain.origin.changeBtn":"Change","brain.origin.changeHint":"Re-point this project’s origin at a different GitHub repo. Cloud sync turns off so nothing pushes until you turn it back on.","brain.origin.updateBtn":"Update repo","brain.origin.updating":"Updating…","brain.origin.detachBtn":"Disconnect","brain.origin.detachWarn":"This removes the git origin and turns cloud sync off. Your local files are untouched.","brain.origin.detachConfirm":"Disconnect","brain.origin.detaching":"Disconnecting…","brain.team.title":"Team updates","brain.team.updates":"{n} updates","brain.team.updatesShort":"updates","brain.team.pending":"Update pending","brain.team.awaitingAgent":"Awaiting agent merge","brain.team.checkNow":"Check now","brain.team.checking":"Checking…","linkedRepos.title":"Linked repos","linkedRepos.desc":"The bare code repos this brain governs. The name + GitHub URL are shared with your team; each machine maps them to its own local path, which never leaves this computer.","linkedRepos.empty":"No linked repos yet. Bind a local checkout to start governing a code repo.","linkedRepos.missing":"Not on this machine yet","linkedRepos.clone":"Clone","linkedRepos.cloneConfirm":"Clone anyway","linkedRepos.cloning":"Cloning…","linkedRepos.trustWarn":"This URL comes from the shared config — clone only if you trust it.","linkedRepos.unlink":"Unlink","linkedRepos.add":"Add","linkedRepos.adding":"Adding…","linkedRepos.namePlaceholder":"Name (e.g. api), then pick its folder"}},RB=B.createContext(null);function sN({children:r}){const[e,i]=B.useState("en"),n=s=>{var o;return((o=w7[e])==null?void 0:o[s])??s};return a.jsx(RB.Provider,{value:{locale:e,setLocale:i,t:n},children:r})}function wr(){const r=B.useContext(RB);if(!r)throw new Error("useI18n must be used within I18nProvider");return r}function k7({vaultName:r,compact:e}){const{t:i}=wr(),{data:n}=SB(),s=TB(),[o,h]=B.useState(!1),l=r?(n??[]).filter(f=>f.name===r):n??[],u=l.reduce((f,m)=>f+(m.updates??0),0),d=l.some(f=>f.pendingAgentMerge);if(u===0&&!d)return null;const g=()=>s.mutate(r);return a.jsxs("div",{className:"update-badge team-updates-badge",children:[a.jsxs("button",{type:"button",className:"update-badge-trigger",onClick:()=>h(f=>!f),"aria-expanded":o,title:i("brain.team.title"),children:[a.jsx("span",{className:"update-badge-dot"}),!e&&a.jsx("span",{className:"update-badge-label",children:d?i("brain.team.pending"):i("brain.team.updates").replace("{n}",String(u))}),e&&a.jsx("span",{className:"update-badge-label",children:u})]}),o&&a.jsxs("div",{className:"update-badge-popover team-updates-popover",children:[a.jsxs("div",{className:"update-badge-popover-header",children:[a.jsx("span",{className:"update-badge-popover-title",children:i("brain.team.title")}),a.jsx("button",{className:"update-badge-dismiss",onClick:()=>h(!1),"aria-label":i("update.dismiss"),children:"×"})]}),a.jsx("div",{className:"update-badge-content",children:a.jsx("ul",{className:"team-updates-list",children:l.map(f=>a.jsxs("li",{className:"team-updates-item",children:[a.jsx("span",{className:"team-updates-vault",children:f.name}),a.jsx("span",{className:"team-updates-count",children:f.pendingAgentMerge?i("brain.team.awaitingAgent"):`${f.updates} ${i("brain.team.updatesShort")}`})]},f.name))})}),a.jsx("button",{className:"update-badge-action",onClick:g,disabled:s.isPending,children:s.isPending?i("brain.team.checking"):i("brain.team.checkNow")})]})]})}const S7=["name","description","targetUser","stack","priority","platforms","packs","review"],T7=["path","description","targetUser","stack","priority","platforms","packs","review"],E7=["path","platforms","packs","review"],w0={name:{label:"What is this project called?",hint:"Used as the folder name and the vault name."},description:{label:"One line — what is it?",hint:"A short description. Optional.",optional:!0},targetUser:{label:"Who is it for?",hint:"The target user. Optional.",optional:!0},stack:{label:"Tech stack?",hint:"Comma-separated. Auto-detected for existing folders. Optional.",optional:!0},priority:{label:"Current focus?",hint:"What you are working on right now. Optional.",optional:!0}};function N7({onClose:r,onReady:e}){const i=Yz(),n=Zz(),s=Xz(),o=Vz(),[h,l]=B.useState(null),[u,d]=B.useState(0),[g,f]=B.useState(null),[m,y]=B.useState(null),[w,_]=B.useState(null),[b,x]=B.useState(!1),[C,k]=B.useState(""),[T,N]=B.useState(""),[A,j]=B.useState(""),[E,L]=B.useState(""),[O,D]=B.useState(""),[K,z]=B.useState(""),[H,P]=B.useState(""),[$,W]=B.useState(["claude"]),[V,F]=B.useState([]),[G,U]=B.useState(!1),X=B.useRef(null);function ee(Ne,he,He){he(Ne.includes(He)?Ne.filter(ut=>ut!==He):[...Ne,He])}B.useEffect(()=>{var Ne;h==="new"&&!T&&((Ne=i.data)!=null&&Ne.defaultParent)&&N(i.data.defaultParent)},[h,T,i.data]);const re=h==="existing"?G?E7:T7:S7,le=re[u];B.useEffect(()=>{var Ne;(Ne=X.current)==null||Ne.focus()},[le,h]);function fe(Ne){l(Ne),d(0),f(null)}async function ie(Ne){f(null);const he=await AB();if(he){if(Ne==="parent"){N(he);return}j(he);try{const He=await Qz(he);if(k(He.name),!K&&He.stack&&z(He.stack),U(He.hasContext),He.hasContext){try{await o.mutateAsync({name:He.name,path:he})}catch(ut){const zt=ut instanceof Error?ut.message:String(ut);if(!/already registered/i.test(zt))throw ut}e(He.name);return}d(1)}catch(He){f(He instanceof Error?He.message:String(He))}}}const I=B.useMemo(()=>le==="name"?C.trim().length>0&&T.trim().length>0:le==="path"?A.trim().length>0:!0,[le,C,T,A]);function Z(){f(null),u<re.length-1&&d(Ne=>Ne+1)}function J(){f(null),u>0?d(Ne=>Ne-1):l(null)}async function ne(){f(null);const Ne=h==="existing"?{mode:"existing",name:C.trim(),projectPath:A.trim()}:{mode:"new",name:C.trim(),parentDir:T.trim()};Ne.description=E.trim()||void 0,Ne.targetUser=O.trim()||void 0,Ne.stack=K.trim()||void 0,Ne.priority=H.trim()||void 0,Ne.platforms=$.length>0?$:void 0,Ne.packs=V.length>0?V:void 0;try{const he=await s.mutateAsync(Ne);y(he.vault),_(he.cli??null)}catch(he){f(he instanceof Error?he.message:String(he))}}const ce="Enrich my dreamcontext: scan the codebase and fill soul, memory, and tech_stack with real detail, then propose initial feature PRDs and a first task. No placeholders.";async function xe(){try{await navigator.clipboard.writeText(ce),x(!0),setTimeout(()=>x(!1),1500)}catch{f("Could not copy to clipboard.")}}function Ve(Ne,he,He){return a.jsx("input",{ref:X,type:"text",className:"wiz-input",value:Ne,placeholder:He,onChange:ut=>he(ut.target.value),onKeyDown:ut=>{ut.key==="Enter"&&I&&Z()}})}function We(){var Lt,qt,mt;if(m)return a.jsxs("div",{className:"wiz-success",children:[a.jsx("div",{className:"wiz-success-check","aria-hidden":!0,children:"✓"}),a.jsxs("h2",{className:"wiz-q",children:["“",m.name,"” is ready"]}),a.jsx("p",{className:"wiz-hint",children:m.path}),(w==null?void 0:w.status)==="installed"&&a.jsx("p",{className:"wiz-hint",children:"Installed the dreamcontext CLI from npm so your hooks work."}),(w==null?void 0:w.status)==="failed"&&a.jsx("div",{className:"wiz-error",children:w.message??"Run: npm install -g dreamcontext"}),a.jsxs("div",{className:"wiz-handoff",children:[a.jsx("div",{className:"wiz-handoff-title",children:"Next: enrich it in Claude Code"}),a.jsx("p",{className:"wiz-hint",children:"The skeleton is in place. Open this project in Claude Code and paste the prompt below so the agent can scan your code and fill in real context."}),a.jsx("pre",{className:"wiz-handoff-prompt",children:ce}),a.jsx("button",{type:"button",className:"wiz-btn",onClick:xe,children:b?"Copied ✓":"Copy prompt"})]}),a.jsxs("div",{className:"wiz-actions",children:[a.jsx("button",{type:"button",className:"wiz-btn",onClick:r,children:"Close"}),a.jsx("button",{type:"button",className:"wiz-btn wiz-btn-primary",onClick:()=>e(m.name),children:"Open project →"})]})]});if(h===null)return a.jsxs("div",{children:[a.jsx("h2",{className:"wiz-q",children:"Add a project"}),a.jsx("p",{className:"wiz-hint",children:"Create something new, or set up a folder you already have."}),a.jsxs("div",{className:"wiz-choices",children:[a.jsxs("button",{type:"button",className:"wiz-choice",onClick:()=>fe("new"),children:[a.jsx("span",{className:"wiz-choice-title",children:"Create new"}),a.jsx("span",{className:"wiz-hint",children:"Make a new folder and initialize dreamcontext in it."})]}),a.jsxs("button",{type:"button",className:"wiz-choice",onClick:()=>fe("existing"),children:[a.jsx("span",{className:"wiz-choice-title",children:"Open existing"}),a.jsx("span",{className:"wiz-hint",children:"Pick a folder on your Mac and set up dreamcontext there."})]})]})]});if(le==="path")return a.jsxs("div",{children:[a.jsx("h2",{className:"wiz-q",children:"Which folder?"}),a.jsx("p",{className:"wiz-hint",children:"Choose the project folder. If it's already a dreamcontext project, it opens straight away."}),a.jsxs("div",{className:"wiz-row",children:[a.jsx("input",{className:"wiz-input",type:"text",value:A,readOnly:!0,placeholder:"No folder chosen"}),a.jsx("button",{type:"button",className:"wiz-btn",onClick:()=>ie("project"),children:s.isPending?"Working…":"Browse…"})]})]});if(le==="name")return a.jsxs("div",{children:[a.jsx("h2",{className:"wiz-q",children:w0.name.label}),a.jsx("p",{className:"wiz-hint",children:w0.name.hint}),Ve(C,k,"my-project"),a.jsx("label",{className:"wiz-sublabel",children:"Where should it live?"}),a.jsxs("div",{className:"wiz-row",children:[a.jsx("input",{className:"wiz-input",type:"text",value:T,placeholder:((Lt=i.data)==null?void 0:Lt.defaultParent)??"~/projects",onChange:Te=>N(Te.target.value)}),a.jsx("button",{type:"button",className:"wiz-btn",onClick:()=>ie("parent"),children:"Browse…"})]}),C.trim()&&T.trim()&&a.jsxs("p",{className:"wiz-hint wiz-preview",children:["Creates: ",T.replace(/\/+$/,""),"/",C.trim()]})]});if(le==="review")return a.jsxs("div",{children:[a.jsx("h2",{className:"wiz-q",children:"Ready to set up"}),a.jsxs("dl",{className:"wiz-review",children:[a.jsx("dt",{children:"Name"}),a.jsx("dd",{children:C.trim()}),a.jsx("dt",{children:"Location"}),a.jsx("dd",{children:h==="new"?`${T.replace(/\/+$/,"")}/${C.trim()}`:A}),E.trim()&&a.jsxs(a.Fragment,{children:[a.jsx("dt",{children:"Description"}),a.jsx("dd",{children:E.trim()})]}),O.trim()&&a.jsxs(a.Fragment,{children:[a.jsx("dt",{children:"For"}),a.jsx("dd",{children:O.trim()})]}),K.trim()&&a.jsxs(a.Fragment,{children:[a.jsx("dt",{children:"Stack"}),a.jsx("dd",{children:K.trim()})]}),H.trim()&&a.jsxs(a.Fragment,{children:[a.jsx("dt",{children:"Focus"}),a.jsx("dd",{children:H.trim()})]}),a.jsx("dt",{children:"Platforms"}),a.jsx("dd",{children:($.length>0?$:["claude"]).map(Te=>{var Ie,Be;return((Be=(Ie=n.data)==null?void 0:Ie.platforms.find(Je=>Je.id===Te))==null?void 0:Be.label)??Te}).join(", ")}),V.length>0&&a.jsxs(a.Fragment,{children:[a.jsx("dt",{children:"Skill packs"}),a.jsx("dd",{children:V.join(", ")})]})]})]});if(le==="platforms"){const Te=((qt=n.data)==null?void 0:qt.platforms)??[];return a.jsxs("div",{children:[a.jsx("h2",{className:"wiz-q",children:"Which agent platforms?"}),a.jsx("p",{className:"wiz-hint",children:"Where dreamcontext installs its skills, agents, and hooks. Pick one or more."}),a.jsx("div",{className:"wiz-choices",children:Te.map(Ie=>{const Be=$.includes(Ie.id);return a.jsxs("button",{type:"button",className:`wiz-choice wiz-select${Be?" wiz-select-on":""}`,onClick:()=>ee($,W,Ie.id),"aria-pressed":Be,children:[a.jsxs("span",{className:"wiz-choice-title",children:[Ie.label,Ie.recommended&&a.jsx("span",{className:"wiz-badge",children:"Recommended"})]}),a.jsx("span",{className:"wiz-hint",children:Ie.description})]},Ie.id)})}),$.length===0&&a.jsx("p",{className:"wiz-hint wiz-preview",children:"Nothing selected — defaults to Claude."})]})}if(le==="packs"){const Te=((mt=n.data)==null?void 0:mt.packs)??[];return a.jsxs("div",{children:[a.jsx("h2",{className:"wiz-q",children:"Add skill packs?"}),a.jsx("p",{className:"wiz-hint",children:"Optional curated skills for your agent. You can add more later. Skip if unsure."}),Te.length===0?a.jsx("p",{className:"wiz-hint",children:"No optional packs available."}):a.jsx("div",{className:"wiz-choices",children:Te.map(Ie=>{const Be=V.includes(Ie.name);return a.jsxs("button",{type:"button",className:`wiz-choice wiz-select${Be?" wiz-select-on":""}`,onClick:()=>ee(V,F,Ie.name),"aria-pressed":Be,children:[a.jsxs("span",{className:"wiz-choice-title",children:[a.jsx("span",{className:"wiz-check","aria-hidden":!0,children:Be?"☑":"☐"})," ",Ie.name]}),a.jsx("span",{className:"wiz-hint",children:Ie.description})]},Ie.name)})})]})}const he=w0[le],He={description:[E,L,"A persistent brain for AI agents…"],targetUser:[O,D,"Developers"],stack:[K,z,"TypeScript, React, Node…"],priority:[H,P,"Initial setup"]},[ut,zt,At]=He[le];return a.jsxs("div",{children:[a.jsx("h2",{className:"wiz-q",children:he.label}),a.jsx("p",{className:"wiz-hint",children:he.hint}),Ve(ut,zt,At)]})}const et=le==="review",de=h!==null&&le!=="path"&&!m;return a.jsx("div",{className:"wiz-overlay",role:"dialog","aria-modal":"true",onClick:r,children:a.jsxs("div",{className:"wiz-modal",onClick:Ne=>Ne.stopPropagation(),children:[a.jsx("button",{type:"button",className:"wiz-close",onClick:r,"aria-label":"Close",children:"×"}),a.jsx("div",{className:"wiz-body",children:We()}),g&&a.jsx("div",{className:"wiz-error",children:g}),de&&a.jsxs("div",{className:"wiz-actions",children:[a.jsx("button",{type:"button",className:"wiz-btn",onClick:J,children:"Back"}),et?a.jsx("button",{type:"button",className:"wiz-btn wiz-btn-primary",onClick:ne,disabled:s.isPending||!C.trim(),children:s.isPending?"Setting up…":"Set up project"}):a.jsx("button",{type:"button",className:"wiz-btn wiz-btn-primary",onClick:Z,disabled:!I,children:"Next"})]})]})})}function j7(r,e){var i=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(i!=null){var n,s,o,h,l=[],u=!0,d=!1;try{if(o=(i=i.call(r)).next,e===0){if(Object(i)!==i)return;u=!1}else for(;!(u=(n=o.call(i)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(g){d=!0,s=g}finally{try{if(!u&&i.return!=null&&(h=i.return(),Object(h)!==h))return}finally{if(d)throw s}}return l}}function A7(r,e,i){return e=F7(e),e in r?Object.defineProperty(r,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[e]=i,r}function aN(r,e){return R7(r)||j7(r,e)||BB(r,e)||D7()}function M7(r){return L7(r)||B7(r)||BB(r)||O7()}function L7(r){if(Array.isArray(r))return H_(r)}function R7(r){if(Array.isArray(r))return r}function B7(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function BB(r,e){if(r){if(typeof r=="string")return H_(r,e);var i=Object.prototype.toString.call(r).slice(8,-1);if(i==="Object"&&r.constructor&&(i=r.constructor.name),i==="Map"||i==="Set")return Array.from(r);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return H_(r,e)}}function H_(r,e){(e==null||e>r.length)&&(e=r.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=r[i];return n}function O7(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
50
+ `).replace(v8,"")}function tE(c,p){return p=eE(p),eE(c)===p}function Hr(c,p,v,S,M,R){switch(v){case"children":typeof S=="string"?p==="body"||p==="textarea"&&S===""||bt(c,S):(typeof S=="number"||typeof S=="bigint")&&p!=="body"&&bt(c,""+S);break;case"className":kr(c,"class",S);break;case"tabIndex":kr(c,"tabindex",S);break;case"dir":case"role":case"viewBox":case"width":case"height":kr(c,v,S);break;case"style":vr(c,S,R);break;case"data":if(p!=="object"){kr(c,"data",S);break}case"src":case"href":if(S===""&&(p!=="a"||v!=="href")){c.removeAttribute(v);break}if(S==null||typeof S=="function"||typeof S=="symbol"||typeof S=="boolean"){c.removeAttribute(v);break}S=Ja(""+S),c.setAttribute(v,S);break;case"action":case"formAction":if(typeof S=="function"){c.setAttribute(v,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof R=="function"&&(v==="formAction"?(p!=="input"&&Hr(c,p,"name",M.name,M,null),Hr(c,p,"formEncType",M.formEncType,M,null),Hr(c,p,"formMethod",M.formMethod,M,null),Hr(c,p,"formTarget",M.formTarget,M,null)):(Hr(c,p,"encType",M.encType,M,null),Hr(c,p,"method",M.method,M,null),Hr(c,p,"target",M.target,M,null)));if(S==null||typeof S=="symbol"||typeof S=="boolean"){c.removeAttribute(v);break}S=Ja(""+S),c.setAttribute(v,S);break;case"onClick":S!=null&&(c.onclick=ft);break;case"onScroll":S!=null&&br("scroll",c);break;case"onScrollEnd":S!=null&&br("scrollend",c);break;case"dangerouslySetInnerHTML":if(S!=null){if(typeof S!="object"||!("__html"in S))throw Error(n(61));if(v=S.__html,v!=null){if(M.children!=null)throw Error(n(60));c.innerHTML=v}}break;case"multiple":c.multiple=S&&typeof S!="function"&&typeof S!="symbol";break;case"muted":c.muted=S&&typeof S!="function"&&typeof S!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(S==null||typeof S=="function"||typeof S=="boolean"||typeof S=="symbol"){c.removeAttribute("xlink:href");break}v=Ja(""+S),c.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",v);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":S!=null&&typeof S!="function"&&typeof S!="symbol"?c.setAttribute(v,""+S):c.removeAttribute(v);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":S&&typeof S!="function"&&typeof S!="symbol"?c.setAttribute(v,""):c.removeAttribute(v);break;case"capture":case"download":S===!0?c.setAttribute(v,""):S!==!1&&S!=null&&typeof S!="function"&&typeof S!="symbol"?c.setAttribute(v,S):c.removeAttribute(v);break;case"cols":case"rows":case"size":case"span":S!=null&&typeof S!="function"&&typeof S!="symbol"&&!isNaN(S)&&1<=S?c.setAttribute(v,S):c.removeAttribute(v);break;case"rowSpan":case"start":S==null||typeof S=="function"||typeof S=="symbol"||isNaN(S)?c.removeAttribute(v):c.setAttribute(v,S);break;case"popover":br("beforetoggle",c),br("toggle",c),Or(c,"popover",S);break;case"xlinkActuate":ii(c,"http://www.w3.org/1999/xlink","xlink:actuate",S);break;case"xlinkArcrole":ii(c,"http://www.w3.org/1999/xlink","xlink:arcrole",S);break;case"xlinkRole":ii(c,"http://www.w3.org/1999/xlink","xlink:role",S);break;case"xlinkShow":ii(c,"http://www.w3.org/1999/xlink","xlink:show",S);break;case"xlinkTitle":ii(c,"http://www.w3.org/1999/xlink","xlink:title",S);break;case"xlinkType":ii(c,"http://www.w3.org/1999/xlink","xlink:type",S);break;case"xmlBase":ii(c,"http://www.w3.org/XML/1998/namespace","xml:base",S);break;case"xmlLang":ii(c,"http://www.w3.org/XML/1998/namespace","xml:lang",S);break;case"xmlSpace":ii(c,"http://www.w3.org/XML/1998/namespace","xml:space",S);break;case"is":Or(c,"is",S);break;case"innerText":case"textContent":break;default:(!(2<v.length)||v[0]!=="o"&&v[0]!=="O"||v[1]!=="n"&&v[1]!=="N")&&(v=Gn.get(v)||v,Or(c,v,S))}}function Qv(c,p,v,S,M,R){switch(v){case"style":vr(c,S,R);break;case"dangerouslySetInnerHTML":if(S!=null){if(typeof S!="object"||!("__html"in S))throw Error(n(61));if(v=S.__html,v!=null){if(M.children!=null)throw Error(n(60));c.innerHTML=v}}break;case"children":typeof S=="string"?bt(c,S):(typeof S=="number"||typeof S=="bigint")&&bt(c,""+S);break;case"onScroll":S!=null&&br("scroll",c);break;case"onScrollEnd":S!=null&&br("scrollend",c);break;case"onClick":S!=null&&(c.onclick=ft);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!oe.hasOwnProperty(v))e:{if(v[0]==="o"&&v[1]==="n"&&(M=v.endsWith("Capture"),p=v.slice(2,M?v.length-7:void 0),R=c[Tt]||null,R=R!=null?R[v]:null,typeof R=="function"&&c.removeEventListener(p,R,M),typeof S=="function")){typeof R!="function"&&R!==null&&(v in c?c[v]=null:c.hasAttribute(v)&&c.removeAttribute(v)),c.addEventListener(p,S,M);break e}v in c?c[v]=S:S===!0?c.setAttribute(v,""):Or(c,v,S)}}}function Fi(c,p,v){switch(p){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":br("error",c),br("load",c);var S=!1,M=!1,R;for(R in v)if(v.hasOwnProperty(R)){var Y=v[R];if(Y!=null)switch(R){case"src":S=!0;break;case"srcSet":M=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(n(137,p));default:Hr(c,p,R,Y,v,null)}}M&&Hr(c,p,"srcSet",v.srcSet,v,null),S&&Hr(c,p,"src",v.src,v,null);return;case"input":br("invalid",c);var te=R=Y=M=null,pe=null,Le=null;for(S in v)if(v.hasOwnProperty(S)){var Ge=v[S];if(Ge!=null)switch(S){case"name":M=Ge;break;case"type":Y=Ge;break;case"checked":pe=Ge;break;case"defaultChecked":Le=Ge;break;case"value":R=Ge;break;case"defaultValue":te=Ge;break;case"children":case"dangerouslySetInnerHTML":if(Ge!=null)throw Error(n(137,p));break;default:Hr(c,p,S,Ge,v,null)}}Re(c,R,te,pe,Le,Y,M,!1);return;case"select":br("invalid",c),S=Y=R=null;for(M in v)if(v.hasOwnProperty(M)&&(te=v[M],te!=null))switch(M){case"value":R=te;break;case"defaultValue":Y=te;break;case"multiple":S=te;default:Hr(c,p,M,te,v,null)}p=R,v=Y,c.multiple=!!S,p!=null?it(c,!!S,p,!1):v!=null&&it(c,!!S,v,!0);return;case"textarea":br("invalid",c),R=M=S=null;for(Y in v)if(v.hasOwnProperty(Y)&&(te=v[Y],te!=null))switch(Y){case"value":S=te;break;case"defaultValue":M=te;break;case"children":R=te;break;case"dangerouslySetInnerHTML":if(te!=null)throw Error(n(91));break;default:Hr(c,p,Y,te,v,null)}ur(c,S,M,R);return;case"option":for(pe in v)if(v.hasOwnProperty(pe)&&(S=v[pe],S!=null))switch(pe){case"selected":c.selected=S&&typeof S!="function"&&typeof S!="symbol";break;default:Hr(c,p,pe,S,v,null)}return;case"dialog":br("beforetoggle",c),br("toggle",c),br("cancel",c),br("close",c);break;case"iframe":case"object":br("load",c);break;case"video":case"audio":for(S=0;S<td.length;S++)br(td[S],c);break;case"image":br("error",c),br("load",c);break;case"details":br("toggle",c);break;case"embed":case"source":case"link":br("error",c),br("load",c);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Le in v)if(v.hasOwnProperty(Le)&&(S=v[Le],S!=null))switch(Le){case"children":case"dangerouslySetInnerHTML":throw Error(n(137,p));default:Hr(c,p,Le,S,v,null)}return;default:if(Ui(p)){for(Ge in v)v.hasOwnProperty(Ge)&&(S=v[Ge],S!==void 0&&Qv(c,p,Ge,S,v,void 0));return}}for(te in v)v.hasOwnProperty(te)&&(S=v[te],S!=null&&Hr(c,p,te,S,v,null))}function x8(c,p,v,S){switch(p){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var M=null,R=null,Y=null,te=null,pe=null,Le=null,Ge=null;for(Pe in v){var Qe=v[Pe];if(v.hasOwnProperty(Pe)&&Qe!=null)switch(Pe){case"checked":break;case"value":break;case"defaultValue":pe=Qe;default:S.hasOwnProperty(Pe)||Hr(c,p,Pe,null,S,Qe)}}for(var Oe in S){var Pe=S[Oe];if(Qe=v[Oe],S.hasOwnProperty(Oe)&&(Pe!=null||Qe!=null))switch(Oe){case"type":R=Pe;break;case"name":M=Pe;break;case"checked":Le=Pe;break;case"defaultChecked":Ge=Pe;break;case"value":Y=Pe;break;case"defaultValue":te=Pe;break;case"children":case"dangerouslySetInnerHTML":if(Pe!=null)throw Error(n(137,p));break;default:Pe!==Qe&&Hr(c,p,Oe,Pe,S,Qe)}}Wn(c,Y,te,pe,Le,Ge,R,M);return;case"select":Pe=Y=te=Oe=null;for(R in v)if(pe=v[R],v.hasOwnProperty(R)&&pe!=null)switch(R){case"value":break;case"multiple":Pe=pe;default:S.hasOwnProperty(R)||Hr(c,p,R,null,S,pe)}for(M in S)if(R=S[M],pe=v[M],S.hasOwnProperty(M)&&(R!=null||pe!=null))switch(M){case"value":Oe=R;break;case"defaultValue":te=R;break;case"multiple":Y=R;default:R!==pe&&Hr(c,p,M,R,S,pe)}p=te,v=Y,S=Pe,Oe!=null?it(c,!!v,Oe,!1):!!S!=!!v&&(p!=null?it(c,!!v,p,!0):it(c,!!v,v?[]:"",!1));return;case"textarea":Pe=Oe=null;for(te in v)if(M=v[te],v.hasOwnProperty(te)&&M!=null&&!S.hasOwnProperty(te))switch(te){case"value":break;case"children":break;default:Hr(c,p,te,null,S,M)}for(Y in S)if(M=S[Y],R=v[Y],S.hasOwnProperty(Y)&&(M!=null||R!=null))switch(Y){case"value":Oe=M;break;case"defaultValue":Pe=M;break;case"children":break;case"dangerouslySetInnerHTML":if(M!=null)throw Error(n(91));break;default:M!==R&&Hr(c,p,Y,M,S,R)}_t(c,Oe,Pe);return;case"option":for(var jt in v)if(Oe=v[jt],v.hasOwnProperty(jt)&&Oe!=null&&!S.hasOwnProperty(jt))switch(jt){case"selected":c.selected=!1;break;default:Hr(c,p,jt,null,S,Oe)}for(pe in S)if(Oe=S[pe],Pe=v[pe],S.hasOwnProperty(pe)&&Oe!==Pe&&(Oe!=null||Pe!=null))switch(pe){case"selected":c.selected=Oe&&typeof Oe!="function"&&typeof Oe!="symbol";break;default:Hr(c,p,pe,Oe,S,Pe)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Jt in v)Oe=v[Jt],v.hasOwnProperty(Jt)&&Oe!=null&&!S.hasOwnProperty(Jt)&&Hr(c,p,Jt,null,S,Oe);for(Le in S)if(Oe=S[Le],Pe=v[Le],S.hasOwnProperty(Le)&&Oe!==Pe&&(Oe!=null||Pe!=null))switch(Le){case"children":case"dangerouslySetInnerHTML":if(Oe!=null)throw Error(n(137,p));break;default:Hr(c,p,Le,Oe,S,Pe)}return;default:if(Ui(p)){for(var Ur in v)Oe=v[Ur],v.hasOwnProperty(Ur)&&Oe!==void 0&&!S.hasOwnProperty(Ur)&&Qv(c,p,Ur,void 0,S,Oe);for(Ge in S)Oe=S[Ge],Pe=v[Ge],!S.hasOwnProperty(Ge)||Oe===Pe||Oe===void 0&&Pe===void 0||Qv(c,p,Ge,Oe,S,Pe);return}}for(var Se in v)Oe=v[Se],v.hasOwnProperty(Se)&&Oe!=null&&!S.hasOwnProperty(Se)&&Hr(c,p,Se,null,S,Oe);for(Qe in S)Oe=S[Qe],Pe=v[Qe],!S.hasOwnProperty(Qe)||Oe===Pe||Oe==null&&Pe==null||Hr(c,p,Qe,Oe,S,Pe)}function rE(c){switch(c){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function _8(){if(typeof performance.getEntriesByType=="function"){for(var c=0,p=0,v=performance.getEntriesByType("resource"),S=0;S<v.length;S++){var M=v[S],R=M.transferSize,Y=M.initiatorType,te=M.duration;if(R&&te&&rE(Y)){for(Y=0,te=M.responseEnd,S+=1;S<v.length;S++){var pe=v[S],Le=pe.startTime;if(Le>te)break;var Ge=pe.transferSize,Qe=pe.initiatorType;Ge&&rE(Qe)&&(pe=pe.responseEnd,Y+=Ge*(pe<te?1:(te-Le)/(pe-Le)))}if(--S,p+=8*(R+Y)/(M.duration/1e3),c++,10<c)break}}if(0<c)return p/c/1e6}return navigator.connection&&(c=navigator.connection.downlink,typeof c=="number")?c:5}var Jv=null,e0=null;function Qp(c){return c.nodeType===9?c:c.ownerDocument}function iE(c){switch(c){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function nE(c,p){if(c===0)switch(p){case"svg":return 1;case"math":return 2;default:return 0}return c===1&&p==="foreignObject"?0:c}function t0(c,p){return c==="textarea"||c==="noscript"||typeof p.children=="string"||typeof p.children=="number"||typeof p.children=="bigint"||typeof p.dangerouslySetInnerHTML=="object"&&p.dangerouslySetInnerHTML!==null&&p.dangerouslySetInnerHTML.__html!=null}var r0=null;function C8(){var c=window.event;return c&&c.type==="popstate"?c===r0?!1:(r0=c,!0):(r0=null,!1)}var sE=typeof setTimeout=="function"?setTimeout:void 0,w8=typeof clearTimeout=="function"?clearTimeout:void 0,aE=typeof Promise=="function"?Promise:void 0,k8=typeof queueMicrotask=="function"?queueMicrotask:typeof aE<"u"?function(c){return aE.resolve(null).then(c).catch(S8)}:sE;function S8(c){setTimeout(function(){throw c})}function bo(c){return c==="head"}function oE(c,p){var v=p,S=0;do{var M=v.nextSibling;if(c.removeChild(v),M&&M.nodeType===8)if(v=M.data,v==="/$"||v==="/&"){if(S===0){c.removeChild(M),Jc(p);return}S--}else if(v==="$"||v==="$?"||v==="$~"||v==="$!"||v==="&")S++;else if(v==="html")id(c.ownerDocument.documentElement);else if(v==="head"){v=c.ownerDocument.head,id(v);for(var R=v.firstChild;R;){var Y=R.nextSibling,te=R.nodeName;R[Hn]||te==="SCRIPT"||te==="STYLE"||te==="LINK"&&R.rel.toLowerCase()==="stylesheet"||v.removeChild(R),R=Y}}else v==="body"&&id(c.ownerDocument.body);v=M}while(v);Jc(p)}function lE(c,p){var v=c;c=0;do{var S=v.nextSibling;if(v.nodeType===1?p?(v._stashedDisplay=v.style.display,v.style.display="none"):(v.style.display=v._stashedDisplay||"",v.getAttribute("style")===""&&v.removeAttribute("style")):v.nodeType===3&&(p?(v._stashedText=v.nodeValue,v.nodeValue=""):v.nodeValue=v._stashedText||""),S&&S.nodeType===8)if(v=S.data,v==="/$"){if(c===0)break;c--}else v!=="$"&&v!=="$?"&&v!=="$~"&&v!=="$!"||c++;v=S}while(v)}function i0(c){var p=c.firstChild;for(p&&p.nodeType===10&&(p=p.nextSibling);p;){var v=p;switch(p=p.nextSibling,v.nodeName){case"HTML":case"HEAD":case"BODY":i0(v),Os(v);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(v.rel.toLowerCase()==="stylesheet")continue}c.removeChild(v)}}function T8(c,p,v,S){for(;c.nodeType===1;){var M=v;if(c.nodeName.toLowerCase()!==p.toLowerCase()){if(!S&&(c.nodeName!=="INPUT"||c.type!=="hidden"))break}else if(S){if(!c[Hn])switch(p){case"meta":if(!c.hasAttribute("itemprop"))break;return c;case"link":if(R=c.getAttribute("rel"),R==="stylesheet"&&c.hasAttribute("data-precedence"))break;if(R!==M.rel||c.getAttribute("href")!==(M.href==null||M.href===""?null:M.href)||c.getAttribute("crossorigin")!==(M.crossOrigin==null?null:M.crossOrigin)||c.getAttribute("title")!==(M.title==null?null:M.title))break;return c;case"style":if(c.hasAttribute("data-precedence"))break;return c;case"script":if(R=c.getAttribute("src"),(R!==(M.src==null?null:M.src)||c.getAttribute("type")!==(M.type==null?null:M.type)||c.getAttribute("crossorigin")!==(M.crossOrigin==null?null:M.crossOrigin))&&R&&c.hasAttribute("async")&&!c.hasAttribute("itemprop"))break;return c;default:return c}}else if(p==="input"&&c.type==="hidden"){var R=M.name==null?null:""+M.name;if(M.type==="hidden"&&c.getAttribute("name")===R)return c}else return c;if(c=es(c.nextSibling),c===null)break}return null}function E8(c,p,v){if(p==="")return null;for(;c.nodeType!==3;)if((c.nodeType!==1||c.nodeName!=="INPUT"||c.type!=="hidden")&&!v||(c=es(c.nextSibling),c===null))return null;return c}function cE(c,p){for(;c.nodeType!==8;)if((c.nodeType!==1||c.nodeName!=="INPUT"||c.type!=="hidden")&&!p||(c=es(c.nextSibling),c===null))return null;return c}function n0(c){return c.data==="$?"||c.data==="$~"}function s0(c){return c.data==="$!"||c.data==="$?"&&c.ownerDocument.readyState!=="loading"}function N8(c,p){var v=c.ownerDocument;if(c.data==="$~")c._reactRetry=p;else if(c.data!=="$?"||v.readyState!=="loading")p();else{var S=function(){p(),v.removeEventListener("DOMContentLoaded",S)};v.addEventListener("DOMContentLoaded",S),c._reactRetry=S}}function es(c){for(;c!=null;c=c.nextSibling){var p=c.nodeType;if(p===1||p===3)break;if(p===8){if(p=c.data,p==="$"||p==="$!"||p==="$?"||p==="$~"||p==="&"||p==="F!"||p==="F")break;if(p==="/$"||p==="/&")return null}}return c}var a0=null;function hE(c){c=c.nextSibling;for(var p=0;c;){if(c.nodeType===8){var v=c.data;if(v==="/$"||v==="/&"){if(p===0)return es(c.nextSibling);p--}else v!=="$"&&v!=="$!"&&v!=="$?"&&v!=="$~"&&v!=="&"||p++}c=c.nextSibling}return null}function uE(c){c=c.previousSibling;for(var p=0;c;){if(c.nodeType===8){var v=c.data;if(v==="$"||v==="$!"||v==="$?"||v==="$~"||v==="&"){if(p===0)return c;p--}else v!=="/$"&&v!=="/&"||p++}c=c.previousSibling}return null}function dE(c,p,v){switch(p=Qp(v),c){case"html":if(c=p.documentElement,!c)throw Error(n(452));return c;case"head":if(c=p.head,!c)throw Error(n(453));return c;case"body":if(c=p.body,!c)throw Error(n(454));return c;default:throw Error(n(451))}}function id(c){for(var p=c.attributes;p.length;)c.removeAttributeNode(p[0]);Os(c)}var ts=new Map,fE=new Set;function Jp(c){return typeof c.getRootNode=="function"?c.getRootNode():c.nodeType===9?c:c.ownerDocument}var ka=W.d;W.d={f:j8,r:A8,D:M8,C:L8,L:R8,m:B8,X:D8,S:O8,M:I8};function j8(){var c=ka.f(),p=Up();return c||p}function A8(c){var p=en(c);p!==null&&p.tag===5&&p.type==="form"?A2(p):ka.r(c)}var Xc=typeof document>"u"?null:document;function pE(c,p,v){var S=Xc;if(S&&typeof p=="string"&&p){var M=Bi(p);M='link[rel="'+c+'"][href="'+M+'"]',typeof v=="string"&&(M+='[crossorigin="'+v+'"]'),fE.has(M)||(fE.add(M),c={rel:c,crossOrigin:v,href:p},S.querySelector(M)===null&&(p=S.createElement("link"),Fi(p,"link",c),Br(p),S.head.appendChild(p)))}}function M8(c){ka.D(c),pE("dns-prefetch",c,null)}function L8(c,p){ka.C(c,p),pE("preconnect",c,p)}function R8(c,p,v){ka.L(c,p,v);var S=Xc;if(S&&c&&p){var M='link[rel="preload"][as="'+Bi(p)+'"]';p==="image"&&v&&v.imageSrcSet?(M+='[imagesrcset="'+Bi(v.imageSrcSet)+'"]',typeof v.imageSizes=="string"&&(M+='[imagesizes="'+Bi(v.imageSizes)+'"]')):M+='[href="'+Bi(c)+'"]';var R=M;switch(p){case"style":R=Zc(c);break;case"script":R=Qc(c)}ts.has(R)||(c=f({rel:"preload",href:p==="image"&&v&&v.imageSrcSet?void 0:c,as:p},v),ts.set(R,c),S.querySelector(M)!==null||p==="style"&&S.querySelector(nd(R))||p==="script"&&S.querySelector(sd(R))||(p=S.createElement("link"),Fi(p,"link",c),Br(p),S.head.appendChild(p)))}}function B8(c,p){ka.m(c,p);var v=Xc;if(v&&c){var S=p&&typeof p.as=="string"?p.as:"script",M='link[rel="modulepreload"][as="'+Bi(S)+'"][href="'+Bi(c)+'"]',R=M;switch(S){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":R=Qc(c)}if(!ts.has(R)&&(c=f({rel:"modulepreload",href:c},p),ts.set(R,c),v.querySelector(M)===null)){switch(S){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(v.querySelector(sd(R)))return}S=v.createElement("link"),Fi(S,"link",c),Br(S),v.head.appendChild(S)}}}function O8(c,p,v){ka.S(c,p,v);var S=Xc;if(S&&c){var M=Ci(S).hoistableStyles,R=Zc(c);p=p||"default";var Y=M.get(R);if(!Y){var te={loading:0,preload:null};if(Y=S.querySelector(nd(R)))te.loading=5;else{c=f({rel:"stylesheet",href:c,"data-precedence":p},v),(v=ts.get(R))&&o0(c,v);var pe=Y=S.createElement("link");Br(pe),Fi(pe,"link",c),pe._p=new Promise(function(Le,Ge){pe.onload=Le,pe.onerror=Ge}),pe.addEventListener("load",function(){te.loading|=1}),pe.addEventListener("error",function(){te.loading|=2}),te.loading|=4,eg(Y,p,S)}Y={type:"stylesheet",instance:Y,count:1,state:te},M.set(R,Y)}}}function D8(c,p){ka.X(c,p);var v=Xc;if(v&&c){var S=Ci(v).hoistableScripts,M=Qc(c),R=S.get(M);R||(R=v.querySelector(sd(M)),R||(c=f({src:c,async:!0},p),(p=ts.get(M))&&l0(c,p),R=v.createElement("script"),Br(R),Fi(R,"link",c),v.head.appendChild(R)),R={type:"script",instance:R,count:1,state:null},S.set(M,R))}}function I8(c,p){ka.M(c,p);var v=Xc;if(v&&c){var S=Ci(v).hoistableScripts,M=Qc(c),R=S.get(M);R||(R=v.querySelector(sd(M)),R||(c=f({src:c,async:!0,type:"module"},p),(p=ts.get(M))&&l0(c,p),R=v.createElement("script"),Br(R),Fi(R,"link",c),v.head.appendChild(R)),R={type:"script",instance:R,count:1,state:null},S.set(M,R))}}function gE(c,p,v,S){var M=(M=fe.current)?Jp(M):null;if(!M)throw Error(n(446));switch(c){case"meta":case"title":return null;case"style":return typeof v.precedence=="string"&&typeof v.href=="string"?(p=Zc(v.href),v=Ci(M).hoistableStyles,S=v.get(p),S||(S={type:"style",instance:null,count:0,state:null},v.set(p,S)),S):{type:"void",instance:null,count:0,state:null};case"link":if(v.rel==="stylesheet"&&typeof v.href=="string"&&typeof v.precedence=="string"){c=Zc(v.href);var R=Ci(M).hoistableStyles,Y=R.get(c);if(Y||(M=M.ownerDocument||M,Y={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},R.set(c,Y),(R=M.querySelector(nd(c)))&&!R._p&&(Y.instance=R,Y.state.loading=5),ts.has(c)||(v={rel:"preload",as:"style",href:v.href,crossOrigin:v.crossOrigin,integrity:v.integrity,media:v.media,hrefLang:v.hrefLang,referrerPolicy:v.referrerPolicy},ts.set(c,v),R||F8(M,c,v,Y.state))),p&&S===null)throw Error(n(528,""));return Y}if(p&&S!==null)throw Error(n(529,""));return null;case"script":return p=v.async,v=v.src,typeof v=="string"&&p&&typeof p!="function"&&typeof p!="symbol"?(p=Qc(v),v=Ci(M).hoistableScripts,S=v.get(p),S||(S={type:"script",instance:null,count:0,state:null},v.set(p,S)),S):{type:"void",instance:null,count:0,state:null};default:throw Error(n(444,c))}}function Zc(c){return'href="'+Bi(c)+'"'}function nd(c){return'link[rel="stylesheet"]['+c+"]"}function mE(c){return f({},c,{"data-precedence":c.precedence,precedence:null})}function F8(c,p,v,S){c.querySelector('link[rel="preload"][as="style"]['+p+"]")?S.loading=1:(p=c.createElement("link"),S.preload=p,p.addEventListener("load",function(){return S.loading|=1}),p.addEventListener("error",function(){return S.loading|=2}),Fi(p,"link",v),Br(p),c.head.appendChild(p))}function Qc(c){return'[src="'+Bi(c)+'"]'}function sd(c){return"script[async]"+c}function yE(c,p,v){if(p.count++,p.instance===null)switch(p.type){case"style":var S=c.querySelector('style[data-href~="'+Bi(v.href)+'"]');if(S)return p.instance=S,Br(S),S;var M=f({},v,{"data-href":v.href,"data-precedence":v.precedence,href:null,precedence:null});return S=(c.ownerDocument||c).createElement("style"),Br(S),Fi(S,"style",M),eg(S,v.precedence,c),p.instance=S;case"stylesheet":M=Zc(v.href);var R=c.querySelector(nd(M));if(R)return p.state.loading|=4,p.instance=R,Br(R),R;S=mE(v),(M=ts.get(M))&&o0(S,M),R=(c.ownerDocument||c).createElement("link"),Br(R);var Y=R;return Y._p=new Promise(function(te,pe){Y.onload=te,Y.onerror=pe}),Fi(R,"link",S),p.state.loading|=4,eg(R,v.precedence,c),p.instance=R;case"script":return R=Qc(v.src),(M=c.querySelector(sd(R)))?(p.instance=M,Br(M),M):(S=v,(M=ts.get(R))&&(S=f({},v),l0(S,M)),c=c.ownerDocument||c,M=c.createElement("script"),Br(M),Fi(M,"link",S),c.head.appendChild(M),p.instance=M);case"void":return null;default:throw Error(n(443,p.type))}else p.type==="stylesheet"&&(p.state.loading&4)===0&&(S=p.instance,p.state.loading|=4,eg(S,v.precedence,c));return p.instance}function eg(c,p,v){for(var S=v.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),M=S.length?S[S.length-1]:null,R=M,Y=0;Y<S.length;Y++){var te=S[Y];if(te.dataset.precedence===p)R=te;else if(R!==M)break}R?R.parentNode.insertBefore(c,R.nextSibling):(p=v.nodeType===9?v.head:v,p.insertBefore(c,p.firstChild))}function o0(c,p){c.crossOrigin==null&&(c.crossOrigin=p.crossOrigin),c.referrerPolicy==null&&(c.referrerPolicy=p.referrerPolicy),c.title==null&&(c.title=p.title)}function l0(c,p){c.crossOrigin==null&&(c.crossOrigin=p.crossOrigin),c.referrerPolicy==null&&(c.referrerPolicy=p.referrerPolicy),c.integrity==null&&(c.integrity=p.integrity)}var tg=null;function bE(c,p,v){if(tg===null){var S=new Map,M=tg=new Map;M.set(v,S)}else M=tg,S=M.get(v),S||(S=new Map,M.set(v,S));if(S.has(c))return S;for(S.set(c,null),v=v.getElementsByTagName(c),M=0;M<v.length;M++){var R=v[M];if(!(R[Hn]||R[Ke]||c==="link"&&R.getAttribute("rel")==="stylesheet")&&R.namespaceURI!=="http://www.w3.org/2000/svg"){var Y=R.getAttribute(p)||"";Y=c+Y;var te=S.get(Y);te?te.push(R):S.set(Y,[R])}}return S}function vE(c,p,v){c=c.ownerDocument||c,c.head.insertBefore(v,p==="title"?c.querySelector("head > title"):null)}function $8(c,p,v){if(v===1||p.itemProp!=null)return!1;switch(c){case"meta":case"title":return!0;case"style":if(typeof p.precedence!="string"||typeof p.href!="string"||p.href==="")break;return!0;case"link":if(typeof p.rel!="string"||typeof p.href!="string"||p.href===""||p.onLoad||p.onError)break;switch(p.rel){case"stylesheet":return c=p.disabled,typeof p.precedence=="string"&&c==null;default:return!0}case"script":if(p.async&&typeof p.async!="function"&&typeof p.async!="symbol"&&!p.onLoad&&!p.onError&&p.src&&typeof p.src=="string")return!0}return!1}function xE(c){return!(c.type==="stylesheet"&&(c.state.loading&3)===0)}function P8(c,p,v,S){if(v.type==="stylesheet"&&(typeof S.media!="string"||matchMedia(S.media).matches!==!1)&&(v.state.loading&4)===0){if(v.instance===null){var M=Zc(S.href),R=p.querySelector(nd(M));if(R){p=R._p,p!==null&&typeof p=="object"&&typeof p.then=="function"&&(c.count++,c=rg.bind(c),p.then(c,c)),v.state.loading|=4,v.instance=R,Br(R);return}R=p.ownerDocument||p,S=mE(S),(M=ts.get(M))&&o0(S,M),R=R.createElement("link"),Br(R);var Y=R;Y._p=new Promise(function(te,pe){Y.onload=te,Y.onerror=pe}),Fi(R,"link",S),v.instance=R}c.stylesheets===null&&(c.stylesheets=new Map),c.stylesheets.set(v,p),(p=v.state.preload)&&(v.state.loading&3)===0&&(c.count++,v=rg.bind(c),p.addEventListener("load",v),p.addEventListener("error",v))}}var c0=0;function z8(c,p){return c.stylesheets&&c.count===0&&ng(c,c.stylesheets),0<c.count||0<c.imgCount?function(v){var S=setTimeout(function(){if(c.stylesheets&&ng(c,c.stylesheets),c.unsuspend){var R=c.unsuspend;c.unsuspend=null,R()}},6e4+p);0<c.imgBytes&&c0===0&&(c0=62500*_8());var M=setTimeout(function(){if(c.waitingForImages=!1,c.count===0&&(c.stylesheets&&ng(c,c.stylesheets),c.unsuspend)){var R=c.unsuspend;c.unsuspend=null,R()}},(c.imgBytes>c0?50:800)+p);return c.unsuspend=v,function(){c.unsuspend=null,clearTimeout(S),clearTimeout(M)}}:null}function rg(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ng(this,this.stylesheets);else if(this.unsuspend){var c=this.unsuspend;this.unsuspend=null,c()}}}var ig=null;function ng(c,p){c.stylesheets=null,c.unsuspend!==null&&(c.count++,ig=new Map,p.forEach(q8,c),ig=null,rg.call(c))}function q8(c,p){if(!(p.state.loading&4)){var v=ig.get(c);if(v)var S=v.get(null);else{v=new Map,ig.set(c,v);for(var M=c.querySelectorAll("link[data-precedence],style[data-precedence]"),R=0;R<M.length;R++){var Y=M[R];(Y.nodeName==="LINK"||Y.getAttribute("media")!=="not all")&&(v.set(Y.dataset.precedence,Y),S=Y)}S&&v.set(null,S)}M=p.instance,Y=M.getAttribute("data-precedence"),R=v.get(Y)||S,R===S&&v.set(null,M),v.set(Y,M),this.count++,S=rg.bind(this),M.addEventListener("load",S),M.addEventListener("error",S),R?R.parentNode.insertBefore(M,R.nextSibling):(c=c.nodeType===9?c.head:c,c.insertBefore(M,c.firstChild)),p.state.loading|=4}}var ad={$$typeof:k,Provider:null,Consumer:null,_currentValue:V,_currentValue2:V,_threadCount:0};function H8(c,p,v,S,M,R,Y,te,pe){this.tag=1,this.containerInfo=c,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ft(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ft(0),this.hiddenUpdates=Ft(null),this.identifierPrefix=S,this.onUncaughtError=M,this.onCaughtError=R,this.onRecoverableError=Y,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=pe,this.incompleteTransitions=new Map}function _E(c,p,v,S,M,R,Y,te,pe,Le,Ge,Qe){return c=new H8(c,p,v,Y,pe,Le,Ge,Qe,te),p=1,R===!0&&(p|=24),R=An(3,null,null,p),c.current=R,R.stateNode=c,p=qb(),p.refCount++,c.pooledCache=p,p.refCount++,R.memoizedState={element:S,isDehydrated:v,cache:p},Gb(R),c}function CE(c){return c?(c=jc,c):jc}function wE(c,p,v,S,M,R){M=CE(M),S.context===null?S.context=M:S.pendingContext=M,S=ao(p),S.payload={element:v},R=R===void 0?null:R,R!==null&&(S.callback=R),v=oo(c,S,p),v!==null&&(xn(v,c,p),Fu(v,c,p))}function kE(c,p){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var v=c.retryLane;c.retryLane=v!==0&&v<p?v:p}}function h0(c,p){kE(c,p),(c=c.alternate)&&kE(c,p)}function SE(c){if(c.tag===13||c.tag===31){var p=fl(c,67108864);p!==null&&xn(p,c,67108864),h0(c,67108864)}}function TE(c){if(c.tag===13||c.tag===31){var p=On();p=se(p);var v=fl(c,p);v!==null&&xn(v,c,p),h0(c,p)}}var sg=!0;function U8(c,p,v,S){var M=$.T;$.T=null;var R=W.p;try{W.p=2,u0(c,p,v,S)}finally{W.p=R,$.T=M}}function W8(c,p,v,S){var M=$.T;$.T=null;var R=W.p;try{W.p=8,u0(c,p,v,S)}finally{W.p=R,$.T=M}}function u0(c,p,v,S){if(sg){var M=d0(S);if(M===null)Zv(c,p,S,ag,v),NE(c,S);else if(K8(M,c,p,v,S))S.stopPropagation();else if(NE(c,S),p&4&&-1<G8.indexOf(c)){for(;M!==null;){var R=en(M);if(R!==null)switch(R.tag){case 3:if(R=R.stateNode,R.current.memoizedState.isDehydrated){var Y=wt(R.pendingLanes);if(Y!==0){var te=R;for(te.pendingLanes|=2,te.entangledLanes|=2;Y;){var pe=1<<31-at(Y);te.entanglements[1]|=pe,Y&=~pe}$s(R),(Rr&6)===0&&(qp=Lt()+500,ed(0))}}break;case 31:case 13:te=fl(R,2),te!==null&&xn(te,R,2),Up(),h0(R,2)}if(R=d0(S),R===null&&Zv(c,p,S,ag,v),R===M)break;M=R}M!==null&&S.stopPropagation()}else Zv(c,p,S,null,v)}}function d0(c){return c=cr(c),f0(c)}var ag=null;function f0(c){if(ag=null,c=_i(c),c!==null){var p=o(c);if(p===null)c=null;else{var v=p.tag;if(v===13){if(c=h(p),c!==null)return c;c=null}else if(v===31){if(c=l(p),c!==null)return c;c=null}else if(v===3){if(p.stateNode.current.memoizedState.isDehydrated)return p.tag===3?p.stateNode.containerInfo:null;c=null}else p!==c&&(c=null)}}return ag=c,null}function EE(c){switch(c){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(qt()){case mt:return 2;case Te:return 8;case Ie:case Be:return 32;case Je:return 268435456;default:return 32}default:return 32}}var p0=!1,vo=null,xo=null,_o=null,od=new Map,ld=new Map,Co=[],G8="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function NE(c,p){switch(c){case"focusin":case"focusout":vo=null;break;case"dragenter":case"dragleave":xo=null;break;case"mouseover":case"mouseout":_o=null;break;case"pointerover":case"pointerout":od.delete(p.pointerId);break;case"gotpointercapture":case"lostpointercapture":ld.delete(p.pointerId)}}function cd(c,p,v,S,M,R){return c===null||c.nativeEvent!==R?(c={blockedOn:p,domEventName:v,eventSystemFlags:S,nativeEvent:R,targetContainers:[M]},p!==null&&(p=en(p),p!==null&&SE(p)),c):(c.eventSystemFlags|=S,p=c.targetContainers,M!==null&&p.indexOf(M)===-1&&p.push(M),c)}function K8(c,p,v,S,M){switch(p){case"focusin":return vo=cd(vo,c,p,v,S,M),!0;case"dragenter":return xo=cd(xo,c,p,v,S,M),!0;case"mouseover":return _o=cd(_o,c,p,v,S,M),!0;case"pointerover":var R=M.pointerId;return od.set(R,cd(od.get(R)||null,c,p,v,S,M)),!0;case"gotpointercapture":return R=M.pointerId,ld.set(R,cd(ld.get(R)||null,c,p,v,S,M)),!0}return!1}function jE(c){var p=_i(c.target);if(p!==null){var v=o(p);if(v!==null){if(p=v.tag,p===13){if(p=h(v),p!==null){c.blockedOn=p,Ee(c.priority,function(){TE(v)});return}}else if(p===31){if(p=l(v),p!==null){c.blockedOn=p,Ee(c.priority,function(){TE(v)});return}}else if(p===3&&v.stateNode.current.memoizedState.isDehydrated){c.blockedOn=v.tag===3?v.stateNode.containerInfo:null;return}}}c.blockedOn=null}function og(c){if(c.blockedOn!==null)return!1;for(var p=c.targetContainers;0<p.length;){var v=d0(c.nativeEvent);if(v===null){v=c.nativeEvent;var S=new v.constructor(v.type,v);Ot=S,v.target.dispatchEvent(S),Ot=null}else return p=en(v),p!==null&&SE(p),c.blockedOn=v,!1;p.shift()}return!0}function AE(c,p,v){og(c)&&v.delete(p)}function V8(){p0=!1,vo!==null&&og(vo)&&(vo=null),xo!==null&&og(xo)&&(xo=null),_o!==null&&og(_o)&&(_o=null),od.forEach(AE),ld.forEach(AE)}function lg(c,p){c.blockedOn===p&&(c.blockedOn=null,p0||(p0=!0,r.unstable_scheduleCallback(r.unstable_NormalPriority,V8)))}var cg=null;function ME(c){cg!==c&&(cg=c,r.unstable_scheduleCallback(r.unstable_NormalPriority,function(){cg===c&&(cg=null);for(var p=0;p<c.length;p+=3){var v=c[p],S=c[p+1],M=c[p+2];if(typeof S!="function"){if(f0(S||v)===null)continue;break}var R=en(v);R!==null&&(c.splice(p,3),p-=3,dv(R,{pending:!0,data:M,method:v.method,action:S},S,M))}}))}function Jc(c){function p(pe){return lg(pe,c)}vo!==null&&lg(vo,c),xo!==null&&lg(xo,c),_o!==null&&lg(_o,c),od.forEach(p),ld.forEach(p);for(var v=0;v<Co.length;v++){var S=Co[v];S.blockedOn===c&&(S.blockedOn=null)}for(;0<Co.length&&(v=Co[0],v.blockedOn===null);)jE(v),v.blockedOn===null&&Co.shift();if(v=(c.ownerDocument||c).$$reactFormReplay,v!=null)for(S=0;S<v.length;S+=3){var M=v[S],R=v[S+1],Y=M[Tt]||null;if(typeof R=="function")Y||ME(v);else if(Y){var te=null;if(R&&R.hasAttribute("formAction")){if(M=R,Y=R[Tt]||null)te=Y.formAction;else if(f0(M)!==null)continue}else te=Y.action;typeof te=="function"?v[S+1]=te:(v.splice(S,3),S-=3),ME(v)}}}function LE(){function c(R){R.canIntercept&&R.info==="react-transition"&&R.intercept({handler:function(){return new Promise(function(Y){return M=Y})},focusReset:"manual",scroll:"manual"})}function p(){M!==null&&(M(),M=null),S||setTimeout(v,20)}function v(){if(!S&&!navigation.transition){var R=navigation.currentEntry;R&&R.url!=null&&navigation.navigate(R.url,{state:R.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var S=!1,M=null;return navigation.addEventListener("navigate",c),navigation.addEventListener("navigatesuccess",p),navigation.addEventListener("navigateerror",p),setTimeout(v,100),function(){S=!0,navigation.removeEventListener("navigate",c),navigation.removeEventListener("navigatesuccess",p),navigation.removeEventListener("navigateerror",p),M!==null&&(M(),M=null)}}}function g0(c){this._internalRoot=c}hg.prototype.render=g0.prototype.render=function(c){var p=this._internalRoot;if(p===null)throw Error(n(409));var v=p.current,S=On();wE(v,S,c,p,null,null)},hg.prototype.unmount=g0.prototype.unmount=function(){var c=this._internalRoot;if(c!==null){this._internalRoot=null;var p=c.containerInfo;wE(c.current,2,null,c,null,null),Up(),p[er]=null}};function hg(c){this._internalRoot=c}hg.prototype.unstable_scheduleHydration=function(c){if(c){var p=be();c={blockedOn:null,target:c,priority:p};for(var v=0;v<Co.length&&p!==0&&p<Co[v].priority;v++);Co.splice(v,0,c),v===0&&jE(c)}};var RE=e.version;if(RE!=="19.2.4")throw Error(n(527,RE,"19.2.4"));W.findDOMNode=function(c){var p=c._reactInternals;if(p===void 0)throw typeof c.render=="function"?Error(n(188)):(c=Object.keys(c).join(","),Error(n(268,c)));return c=d(p),c=c!==null?g(c):null,c=c===null?null:c.stateNode,c};var Y8={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:$,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ug=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ug.isDisabled&&ug.supportsFiber)try{Nt=ug.inject(Y8),ke=ug}catch{}}return ud.createRoot=function(c,p){if(!s(c))throw Error(n(299));var v=!1,S="",M=P2,R=z2,Y=q2;return p!=null&&(p.unstable_strictMode===!0&&(v=!0),p.identifierPrefix!==void 0&&(S=p.identifierPrefix),p.onUncaughtError!==void 0&&(M=p.onUncaughtError),p.onCaughtError!==void 0&&(R=p.onCaughtError),p.onRecoverableError!==void 0&&(Y=p.onRecoverableError)),p=_E(c,1,!1,null,null,v,S,null,M,R,Y,LE),c[er]=p.current,Xv(c),new g0(p)},ud.hydrateRoot=function(c,p,v){if(!s(c))throw Error(n(299));var S=!1,M="",R=P2,Y=z2,te=q2,pe=null;return v!=null&&(v.unstable_strictMode===!0&&(S=!0),v.identifierPrefix!==void 0&&(M=v.identifierPrefix),v.onUncaughtError!==void 0&&(R=v.onUncaughtError),v.onCaughtError!==void 0&&(Y=v.onCaughtError),v.onRecoverableError!==void 0&&(te=v.onRecoverableError),v.formState!==void 0&&(pe=v.formState)),p=_E(c,1,!0,p,v??null,S,M,pe,R,Y,te,LE),p.context=CE(null),v=p.current,S=On(),S=se(S),M=ao(S),M.callback=null,oo(v,M,S),v=S,p.current.lanes=v,gt(p,v),$s(p),c[er]=p.current,Xv(c),new hg(p)},ud.version="19.2.4",ud}var UE;function oz(){if(UE)return v0.exports;UE=1;function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(e){console.error(e)}}return r(),v0.exports=az(),v0.exports}var lz=oz(),gu=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(r){return this.listeners.add(r),this.onSubscribe(),()=>{this.listeners.delete(r),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},cz={setTimeout:(r,e)=>setTimeout(r,e),clearTimeout:r=>clearTimeout(r),setInterval:(r,e)=>setInterval(r,e),clearInterval:r=>clearInterval(r)},Bo,FC,QR,hz=(QR=class{constructor(){Gt(this,Bo,cz);Gt(this,FC,!1)}setTimeoutProvider(r){Ct(this,Bo,r)}setTimeout(r,e){return me(this,Bo).setTimeout(r,e)}clearTimeout(r){me(this,Bo).clearTimeout(r)}setInterval(r,e){return me(this,Bo).setInterval(r,e)}clearInterval(r){me(this,Bo).clearInterval(r)}},Bo=new WeakMap,FC=new WeakMap,QR),Il=new hz;function uz(r){setTimeout(r,0)}var ic=typeof window>"u"||"Deno"in globalThis;function sn(){}function dz(r,e){return typeof r=="function"?r(e):r}function j_(r){return typeof r=="number"&&r>=0&&r!==1/0}function uB(r,e){return Math.max(r+(e||0)-Date.now(),0)}function Ko(r,e){return typeof r=="function"?r(e):r}function os(r,e){return typeof r=="function"?r(e):r}function WE(r,e){const{type:i="all",exact:n,fetchStatus:s,predicate:o,queryKey:h,stale:l}=r;if(h){if(n){if(e.queryHash!==PC(h,e.options))return!1}else if(!yf(e.queryKey,h))return!1}if(i!=="all"){const u=e.isActive();if(i==="active"&&!u||i==="inactive"&&u)return!1}return!(typeof l=="boolean"&&e.isStale()!==l||s&&s!==e.state.fetchStatus||o&&!o(e))}function GE(r,e){const{exact:i,status:n,predicate:s,mutationKey:o}=r;if(o){if(!e.options.mutationKey)return!1;if(i){if(nc(e.options.mutationKey)!==nc(o))return!1}else if(!yf(e.options.mutationKey,o))return!1}return!(n&&e.state.status!==n||s&&!s(e))}function PC(r,e){return((e==null?void 0:e.queryKeyHashFn)||nc)(r)}function nc(r){return JSON.stringify(r,(e,i)=>A_(i)?Object.keys(i).sort().reduce((n,s)=>(n[s]=i[s],n),{}):i)}function yf(r,e){return r===e?!0:typeof r!=typeof e?!1:r&&e&&typeof r=="object"&&typeof e=="object"?Object.keys(e).every(i=>yf(r[i],e[i])):!1}var fz=Object.prototype.hasOwnProperty;function dB(r,e,i=0){if(r===e)return r;if(i>500)return e;const n=KE(r)&&KE(e);if(!n&&!(A_(r)&&A_(e)))return e;const o=(n?r:Object.keys(r)).length,h=n?e:Object.keys(e),l=h.length,u=n?new Array(l):{};let d=0;for(let g=0;g<l;g++){const f=n?g:h[g],m=r[f],y=e[f];if(m===y){u[f]=m,(n?g<o:fz.call(r,f))&&d++;continue}if(m===null||y===null||typeof m!="object"||typeof y!="object"){u[f]=y;continue}const w=dB(m,y,i+1);u[f]=w,w===m&&d++}return o===l&&d===o?r:u}function Em(r,e){if(!e||Object.keys(r).length!==Object.keys(e).length)return!1;for(const i in r)if(r[i]!==e[i])return!1;return!0}function KE(r){return Array.isArray(r)&&r.length===Object.keys(r).length}function A_(r){if(!VE(r))return!1;const e=r.constructor;if(e===void 0)return!0;const i=e.prototype;return!(!VE(i)||!i.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(r)!==Object.prototype)}function VE(r){return Object.prototype.toString.call(r)==="[object Object]"}function pz(r){return new Promise(e=>{Il.setTimeout(e,r)})}function M_(r,e,i){return typeof i.structuralSharing=="function"?i.structuralSharing(r,e):i.structuralSharing!==!1?dB(r,e):e}function gz(r){return r}function mz(r,e,i=0){const n=[...r,e];return i&&n.length>i?n.slice(1):n}function yz(r,e,i=0){const n=[e,...r];return i&&n.length>i?n.slice(0,-1):n}var zC=Symbol();function fB(r,e){return!r.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!r.queryFn||r.queryFn===zC?()=>Promise.reject(new Error(`Missing queryFn: '${r.queryHash}'`)):r.queryFn}function qC(r,e){return typeof r=="function"?r(...e):!!r}function bz(r,e,i){let n=!1,s;return Object.defineProperty(r,"signal",{enumerable:!0,get:()=>(s??(s=e()),n||(n=!0,s.aborted?i():s.addEventListener("abort",i,{once:!0})),s)}),r}var Hl,Oo,Mh,JR,vz=(JR=class extends gu{constructor(){super();Gt(this,Hl);Gt(this,Oo);Gt(this,Mh);Ct(this,Mh,e=>{if(!ic&&window.addEventListener){const i=()=>e();return window.addEventListener("visibilitychange",i,!1),()=>{window.removeEventListener("visibilitychange",i)}}})}onSubscribe(){me(this,Oo)||this.setEventListener(me(this,Mh))}onUnsubscribe(){var e;this.hasListeners()||((e=me(this,Oo))==null||e.call(this),Ct(this,Oo,void 0))}setEventListener(e){var i;Ct(this,Mh,e),(i=me(this,Oo))==null||i.call(this),Ct(this,Oo,e(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(e){me(this,Hl)!==e&&(Ct(this,Hl,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(i=>{i(e)})}isFocused(){var e;return typeof me(this,Hl)=="boolean"?me(this,Hl):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Hl=new WeakMap,Oo=new WeakMap,Mh=new WeakMap,JR),HC=new vz;function L_(){let r,e;const i=new Promise((s,o)=>{r=s,e=o});i.status="pending",i.catch(()=>{});function n(s){Object.assign(i,s),delete i.resolve,delete i.reject}return i.resolve=s=>{n({status:"fulfilled",value:s}),r(s)},i.reject=s=>{n({status:"rejected",reason:s}),e(s)},i}var xz=uz;function _z(){let r=[],e=0,i=l=>{l()},n=l=>{l()},s=xz;const o=l=>{e?r.push(l):s(()=>{i(l)})},h=()=>{const l=r;r=[],l.length&&s(()=>{n(()=>{l.forEach(u=>{i(u)})})})};return{batch:l=>{let u;e++;try{u=l()}finally{e--,e||h()}return u},batchCalls:l=>(...u)=>{o(()=>{l(...u)})},schedule:o,setNotifyFunction:l=>{i=l},setBatchNotifyFunction:l=>{n=l},setScheduler:l=>{s=l}}}var Ti=_z(),Lh,Do,Rh,eB,Cz=(eB=class extends gu{constructor(){super();Gt(this,Lh,!0);Gt(this,Do);Gt(this,Rh);Ct(this,Rh,e=>{if(!ic&&window.addEventListener){const i=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",i,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",i),window.removeEventListener("offline",n)}}})}onSubscribe(){me(this,Do)||this.setEventListener(me(this,Rh))}onUnsubscribe(){var e;this.hasListeners()||((e=me(this,Do))==null||e.call(this),Ct(this,Do,void 0))}setEventListener(e){var i;Ct(this,Rh,e),(i=me(this,Do))==null||i.call(this),Ct(this,Do,e(this.setOnline.bind(this)))}setOnline(e){me(this,Lh)!==e&&(Ct(this,Lh,e),this.listeners.forEach(n=>{n(e)}))}isOnline(){return me(this,Lh)}},Lh=new WeakMap,Do=new WeakMap,Rh=new WeakMap,eB),Nm=new Cz;function wz(r){return Math.min(1e3*2**r,3e4)}function pB(r){return(r??"online")==="online"?Nm.isOnline():!0}var R_=class extends Error{constructor(r){super("CancelledError"),this.revert=r==null?void 0:r.revert,this.silent=r==null?void 0:r.silent}};function gB(r){let e=!1,i=0,n;const s=L_(),o=()=>s.status!=="pending",h=_=>{var b;if(!o()){const x=new R_(_);m(x),(b=r.onCancel)==null||b.call(r,x)}},l=()=>{e=!0},u=()=>{e=!1},d=()=>HC.isFocused()&&(r.networkMode==="always"||Nm.isOnline())&&r.canRun(),g=()=>pB(r.networkMode)&&r.canRun(),f=_=>{o()||(n==null||n(),s.resolve(_))},m=_=>{o()||(n==null||n(),s.reject(_))},y=()=>new Promise(_=>{var b;n=x=>{(o()||d())&&_(x)},(b=r.onPause)==null||b.call(r)}).then(()=>{var _;n=void 0,o()||(_=r.onContinue)==null||_.call(r)}),w=()=>{if(o())return;let _;const b=i===0?r.initialPromise:void 0;try{_=b??r.fn()}catch(x){_=Promise.reject(x)}Promise.resolve(_).then(f).catch(x=>{var A;if(o())return;const C=r.retry??(ic?0:3),k=r.retryDelay??wz,T=typeof k=="function"?k(i,x):k,N=C===!0||typeof C=="number"&&i<C||typeof C=="function"&&C(i,x);if(e||!N){m(x);return}i++,(A=r.onFail)==null||A.call(r,i,x),pz(T).then(()=>d()?void 0:y()).then(()=>{e?m(x):w()})})};return{promise:s,status:()=>s.status,cancel:h,continue:()=>(n==null||n(),s),cancelRetry:l,continueRetry:u,canStart:g,start:()=>(g()?w():y().then(w),s)}}var Ul,tB,mB=(tB=class{constructor(){Gt(this,Ul)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),j_(this.gcTime)&&Ct(this,Ul,Il.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(r){this.gcTime=Math.max(this.gcTime||0,r??(ic?1/0:300*1e3))}clearGcTimeout(){me(this,Ul)&&(Il.clearTimeout(me(this,Ul)),Ct(this,Ul,void 0))}},Ul=new WeakMap,tB),Wl,Bh,as,Gl,Mi,Df,Kl,_s,Ma,rB,kz=(rB=class extends mB{constructor(e){super();Gt(this,_s);Gt(this,Wl);Gt(this,Bh);Gt(this,as);Gt(this,Gl);Gt(this,Mi);Gt(this,Df);Gt(this,Kl);Ct(this,Kl,!1),Ct(this,Df,e.defaultOptions),this.setOptions(e.options),this.observers=[],Ct(this,Gl,e.client),Ct(this,as,me(this,Gl).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Ct(this,Wl,XE(this.options)),this.state=e.state??me(this,Wl),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=me(this,Mi))==null?void 0:e.promise}setOptions(e){if(this.options={...me(this,Df),...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const i=XE(this.options);i.data!==void 0&&(this.setState(YE(i.data,i.dataUpdatedAt)),Ct(this,Wl,i))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&me(this,as).remove(this)}setData(e,i){const n=M_(this.state.data,e,this.options);return pr(this,_s,Ma).call(this,{data:n,type:"success",dataUpdatedAt:i==null?void 0:i.updatedAt,manual:i==null?void 0:i.manual}),n}setState(e,i){pr(this,_s,Ma).call(this,{type:"setState",state:e,setStateOptions:i})}cancel(e){var n,s;const i=(n=me(this,Mi))==null?void 0:n.promise;return(s=me(this,Mi))==null||s.cancel(e),i?i.then(sn).catch(sn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(me(this,Wl))}isActive(){return this.observers.some(e=>os(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===zC||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Ko(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!uB(this.state.dataUpdatedAt,e)}onFocus(){var i;const e=this.observers.find(n=>n.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(i=me(this,Mi))==null||i.continue()}onOnline(){var i;const e=this.observers.find(n=>n.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(i=me(this,Mi))==null||i.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),me(this,as).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(i=>i!==e),this.observers.length||(me(this,Mi)&&(me(this,Kl)?me(this,Mi).cancel({revert:!0}):me(this,Mi).cancelRetry()),this.scheduleGc()),me(this,as).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||pr(this,_s,Ma).call(this,{type:"invalidate"})}async fetch(e,i){var u,d,g,f,m,y,w,_,b,x,C,k;if(this.state.fetchStatus!=="idle"&&((u=me(this,Mi))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(i!=null&&i.cancelRefetch))this.cancel({silent:!0});else if(me(this,Mi))return me(this,Mi).continueRetry(),me(this,Mi).promise}if(e&&this.setOptions(e),!this.options.queryFn){const T=this.observers.find(N=>N.options.queryFn);T&&this.setOptions(T.options)}const n=new AbortController,s=T=>{Object.defineProperty(T,"signal",{enumerable:!0,get:()=>(Ct(this,Kl,!0),n.signal)})},o=()=>{const T=fB(this.options,i),A=(()=>{const j={client:me(this,Gl),queryKey:this.queryKey,meta:this.meta};return s(j),j})();return Ct(this,Kl,!1),this.options.persister?this.options.persister(T,A,this):T(A)},l=(()=>{const T={fetchOptions:i,options:this.options,queryKey:this.queryKey,client:me(this,Gl),state:this.state,fetchFn:o};return s(T),T})();(d=this.options.behavior)==null||d.onFetch(l,this),Ct(this,Bh,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((g=l.fetchOptions)==null?void 0:g.meta))&&pr(this,_s,Ma).call(this,{type:"fetch",meta:(f=l.fetchOptions)==null?void 0:f.meta}),Ct(this,Mi,gB({initialPromise:i==null?void 0:i.initialPromise,fn:l.fetchFn,onCancel:T=>{T instanceof R_&&T.revert&&this.setState({...me(this,Bh),fetchStatus:"idle"}),n.abort()},onFail:(T,N)=>{pr(this,_s,Ma).call(this,{type:"failed",failureCount:T,error:N})},onPause:()=>{pr(this,_s,Ma).call(this,{type:"pause"})},onContinue:()=>{pr(this,_s,Ma).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const T=await me(this,Mi).start();if(T===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(T),(y=(m=me(this,as).config).onSuccess)==null||y.call(m,T,this),(_=(w=me(this,as).config).onSettled)==null||_.call(w,T,this.state.error,this),T}catch(T){if(T instanceof R_){if(T.silent)return me(this,Mi).promise;if(T.revert){if(this.state.data===void 0)throw T;return this.state.data}}throw pr(this,_s,Ma).call(this,{type:"error",error:T}),(x=(b=me(this,as).config).onError)==null||x.call(b,T,this),(k=(C=me(this,as).config).onSettled)==null||k.call(C,this.state.data,T,this),T}finally{this.scheduleGc()}}},Wl=new WeakMap,Bh=new WeakMap,as=new WeakMap,Gl=new WeakMap,Mi=new WeakMap,Df=new WeakMap,Kl=new WeakMap,_s=new WeakSet,Ma=function(e){const i=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...yB(n.data,this.options),fetchMeta:e.meta??null};case"success":const s={...n,...YE(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Ct(this,Bh,e.manual?s:void 0),s;case"error":const o=e.error;return{...n,error:o,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=i(this.state),Ti.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),me(this,as).notify({query:this,type:"updated",action:e})})},rB);function yB(r,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:pB(e.networkMode)?"fetching":"paused",...r===void 0&&{error:null,status:"pending"}}}function YE(r,e){return{data:r,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function XE(r){const e=typeof r.initialData=="function"?r.initialData():r.initialData,i=e!==void 0,n=i?typeof r.initialDataUpdatedAt=="function"?r.initialDataUpdatedAt():r.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:i?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}var Cn,Tr,If,nn,Vl,Oh,Ba,Io,Ff,Dh,Ih,Yl,Xl,Fo,Fh,Fr,zd,B_,O_,D_,I_,F_,$_,P_,bB,iB,Sz=(iB=class extends gu{constructor(e,i){super();Gt(this,Fr);Gt(this,Cn);Gt(this,Tr);Gt(this,If);Gt(this,nn);Gt(this,Vl);Gt(this,Oh);Gt(this,Ba);Gt(this,Io);Gt(this,Ff);Gt(this,Dh);Gt(this,Ih);Gt(this,Yl);Gt(this,Xl);Gt(this,Fo);Gt(this,Fh,new Set);this.options=i,Ct(this,Cn,e),Ct(this,Io,null),Ct(this,Ba,L_()),this.bindMethods(),this.setOptions(i)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(me(this,Tr).addObserver(this),ZE(me(this,Tr),this.options)?pr(this,Fr,zd).call(this):this.updateResult(),pr(this,Fr,I_).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return z_(me(this,Tr),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return z_(me(this,Tr),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,pr(this,Fr,F_).call(this),pr(this,Fr,$_).call(this),me(this,Tr).removeObserver(this)}setOptions(e){const i=this.options,n=me(this,Tr);if(this.options=me(this,Cn).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof os(this.options.enabled,me(this,Tr))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");pr(this,Fr,P_).call(this),me(this,Tr).setOptions(this.options),i._defaulted&&!Em(this.options,i)&&me(this,Cn).getQueryCache().notify({type:"observerOptionsUpdated",query:me(this,Tr),observer:this});const s=this.hasListeners();s&&QE(me(this,Tr),n,this.options,i)&&pr(this,Fr,zd).call(this),this.updateResult(),s&&(me(this,Tr)!==n||os(this.options.enabled,me(this,Tr))!==os(i.enabled,me(this,Tr))||Ko(this.options.staleTime,me(this,Tr))!==Ko(i.staleTime,me(this,Tr)))&&pr(this,Fr,B_).call(this);const o=pr(this,Fr,O_).call(this);s&&(me(this,Tr)!==n||os(this.options.enabled,me(this,Tr))!==os(i.enabled,me(this,Tr))||o!==me(this,Fo))&&pr(this,Fr,D_).call(this,o)}getOptimisticResult(e){const i=me(this,Cn).getQueryCache().build(me(this,Cn),e),n=this.createResult(i,e);return Ez(this,n)&&(Ct(this,nn,n),Ct(this,Oh,this.options),Ct(this,Vl,me(this,Tr).state)),n}getCurrentResult(){return me(this,nn)}trackResult(e,i){return new Proxy(e,{get:(n,s)=>(this.trackProp(s),i==null||i(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&me(this,Ba).status==="pending"&&me(this,Ba).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,s))})}trackProp(e){me(this,Fh).add(e)}getCurrentQuery(){return me(this,Tr)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const i=me(this,Cn).defaultQueryOptions(e),n=me(this,Cn).getQueryCache().build(me(this,Cn),i);return n.fetch().then(()=>this.createResult(n,i))}fetch(e){return pr(this,Fr,zd).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),me(this,nn)))}createResult(e,i){var L;const n=me(this,Tr),s=this.options,o=me(this,nn),h=me(this,Vl),l=me(this,Oh),d=e!==n?e.state:me(this,If),{state:g}=e;let f={...g},m=!1,y;if(i._optimisticResults){const O=this.hasListeners(),D=!O&&ZE(e,i),K=O&&QE(e,n,i,s);(D||K)&&(f={...f,...yB(g.data,e.options)}),i._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:w,errorUpdatedAt:_,status:b}=f;y=f.data;let x=!1;if(i.placeholderData!==void 0&&y===void 0&&b==="pending"){let O;o!=null&&o.isPlaceholderData&&i.placeholderData===(l==null?void 0:l.placeholderData)?(O=o.data,x=!0):O=typeof i.placeholderData=="function"?i.placeholderData((L=me(this,Ih))==null?void 0:L.state.data,me(this,Ih)):i.placeholderData,O!==void 0&&(b="success",y=M_(o==null?void 0:o.data,O,i),m=!0)}if(i.select&&y!==void 0&&!x)if(o&&y===(h==null?void 0:h.data)&&i.select===me(this,Ff))y=me(this,Dh);else try{Ct(this,Ff,i.select),y=i.select(y),y=M_(o==null?void 0:o.data,y,i),Ct(this,Dh,y),Ct(this,Io,null)}catch(O){Ct(this,Io,O)}me(this,Io)&&(w=me(this,Io),y=me(this,Dh),_=Date.now(),b="error");const C=f.fetchStatus==="fetching",k=b==="pending",T=b==="error",N=k&&C,A=y!==void 0,E={status:b,fetchStatus:f.fetchStatus,isPending:k,isSuccess:b==="success",isError:T,isInitialLoading:N,isLoading:N,data:y,dataUpdatedAt:f.dataUpdatedAt,error:w,errorUpdatedAt:_,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>d.dataUpdateCount||f.errorUpdateCount>d.errorUpdateCount,isFetching:C,isRefetching:C&&!k,isLoadingError:T&&!A,isPaused:f.fetchStatus==="paused",isPlaceholderData:m,isRefetchError:T&&A,isStale:UC(e,i),refetch:this.refetch,promise:me(this,Ba),isEnabled:os(i.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const O=E.data!==void 0,D=E.status==="error"&&!O,K=P=>{D?P.reject(E.error):O&&P.resolve(E.data)},z=()=>{const P=Ct(this,Ba,E.promise=L_());K(P)},H=me(this,Ba);switch(H.status){case"pending":e.queryHash===n.queryHash&&K(H);break;case"fulfilled":(D||E.data!==H.value)&&z();break;case"rejected":(!D||E.error!==H.reason)&&z();break}}return E}updateResult(){const e=me(this,nn),i=this.createResult(me(this,Tr),this.options);if(Ct(this,Vl,me(this,Tr).state),Ct(this,Oh,this.options),me(this,Vl).data!==void 0&&Ct(this,Ih,me(this,Tr)),Em(i,e))return;Ct(this,nn,i);const n=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,o=typeof s=="function"?s():s;if(o==="all"||!o&&!me(this,Fh).size)return!0;const h=new Set(o??me(this,Fh));return this.options.throwOnError&&h.add("error"),Object.keys(me(this,nn)).some(l=>{const u=l;return me(this,nn)[u]!==e[u]&&h.has(u)})};pr(this,Fr,bB).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&pr(this,Fr,I_).call(this)}},Cn=new WeakMap,Tr=new WeakMap,If=new WeakMap,nn=new WeakMap,Vl=new WeakMap,Oh=new WeakMap,Ba=new WeakMap,Io=new WeakMap,Ff=new WeakMap,Dh=new WeakMap,Ih=new WeakMap,Yl=new WeakMap,Xl=new WeakMap,Fo=new WeakMap,Fh=new WeakMap,Fr=new WeakSet,zd=function(e){pr(this,Fr,P_).call(this);let i=me(this,Tr).fetch(this.options,e);return e!=null&&e.throwOnError||(i=i.catch(sn)),i},B_=function(){pr(this,Fr,F_).call(this);const e=Ko(this.options.staleTime,me(this,Tr));if(ic||me(this,nn).isStale||!j_(e))return;const n=uB(me(this,nn).dataUpdatedAt,e)+1;Ct(this,Yl,Il.setTimeout(()=>{me(this,nn).isStale||this.updateResult()},n))},O_=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(me(this,Tr)):this.options.refetchInterval)??!1},D_=function(e){pr(this,Fr,$_).call(this),Ct(this,Fo,e),!(ic||os(this.options.enabled,me(this,Tr))===!1||!j_(me(this,Fo))||me(this,Fo)===0)&&Ct(this,Xl,Il.setInterval(()=>{(this.options.refetchIntervalInBackground||HC.isFocused())&&pr(this,Fr,zd).call(this)},me(this,Fo)))},I_=function(){pr(this,Fr,B_).call(this),pr(this,Fr,D_).call(this,pr(this,Fr,O_).call(this))},F_=function(){me(this,Yl)&&(Il.clearTimeout(me(this,Yl)),Ct(this,Yl,void 0))},$_=function(){me(this,Xl)&&(Il.clearInterval(me(this,Xl)),Ct(this,Xl,void 0))},P_=function(){const e=me(this,Cn).getQueryCache().build(me(this,Cn),this.options);if(e===me(this,Tr))return;const i=me(this,Tr);Ct(this,Tr,e),Ct(this,If,e.state),this.hasListeners()&&(i==null||i.removeObserver(this),e.addObserver(this))},bB=function(e){Ti.batch(()=>{e.listeners&&this.listeners.forEach(i=>{i(me(this,nn))}),me(this,Cn).getQueryCache().notify({query:me(this,Tr),type:"observerResultsUpdated"})})},iB);function Tz(r,e){return os(e.enabled,r)!==!1&&r.state.data===void 0&&!(r.state.status==="error"&&e.retryOnMount===!1)}function ZE(r,e){return Tz(r,e)||r.state.data!==void 0&&z_(r,e,e.refetchOnMount)}function z_(r,e,i){if(os(e.enabled,r)!==!1&&Ko(e.staleTime,r)!=="static"){const n=typeof i=="function"?i(r):i;return n==="always"||n!==!1&&UC(r,e)}return!1}function QE(r,e,i,n){return(r!==e||os(n.enabled,r)===!1)&&(!i.suspense||r.state.status!=="error")&&UC(r,i)}function UC(r,e){return os(e.enabled,r)!==!1&&r.isStaleByTime(Ko(e.staleTime,r))}function Ez(r,e){return!Em(r.getCurrentResult(),e)}function JE(r){return{onFetch:(e,i)=>{var g,f,m,y,w;const n=e.options,s=(m=(f=(g=e.fetchOptions)==null?void 0:g.meta)==null?void 0:f.fetchMore)==null?void 0:m.direction,o=((y=e.state.data)==null?void 0:y.pages)||[],h=((w=e.state.data)==null?void 0:w.pageParams)||[];let l={pages:[],pageParams:[]},u=0;const d=async()=>{let _=!1;const b=k=>{bz(k,()=>e.signal,()=>_=!0)},x=fB(e.options,e.fetchOptions),C=async(k,T,N)=>{if(_)return Promise.reject();if(T==null&&k.pages.length)return Promise.resolve(k);const j=(()=>{const D={client:e.client,queryKey:e.queryKey,pageParam:T,direction:N?"backward":"forward",meta:e.options.meta};return b(D),D})(),E=await x(j),{maxPages:L}=e.options,O=N?yz:mz;return{pages:O(k.pages,E,L),pageParams:O(k.pageParams,T,L)}};if(s&&o.length){const k=s==="backward",T=k?Nz:eN,N={pages:o,pageParams:h},A=T(n,N);l=await C(N,A,k)}else{const k=r??o.length;do{const T=u===0?h[0]??n.initialPageParam:eN(n,l);if(u>0&&T==null)break;l=await C(l,T),u++}while(u<k)}return l};e.options.persister?e.fetchFn=()=>{var _,b;return(b=(_=e.options).persister)==null?void 0:b.call(_,d,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},i)}:e.fetchFn=d}}}function eN(r,{pages:e,pageParams:i}){const n=e.length-1;return e.length>0?r.getNextPageParam(e[n],e,i[n],i):void 0}function Nz(r,{pages:e,pageParams:i}){var n;return e.length>0?(n=r.getPreviousPageParam)==null?void 0:n.call(r,e[0],e,i[0],i):void 0}var $f,Xs,Xi,Zl,Zs,No,nB,jz=(nB=class extends mB{constructor(e){super();Gt(this,Zs);Gt(this,$f);Gt(this,Xs);Gt(this,Xi);Gt(this,Zl);Ct(this,$f,e.client),this.mutationId=e.mutationId,Ct(this,Xi,e.mutationCache),Ct(this,Xs,[]),this.state=e.state||vB(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){me(this,Xs).includes(e)||(me(this,Xs).push(e),this.clearGcTimeout(),me(this,Xi).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Ct(this,Xs,me(this,Xs).filter(i=>i!==e)),this.scheduleGc(),me(this,Xi).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){me(this,Xs).length||(this.state.status==="pending"?this.scheduleGc():me(this,Xi).remove(this))}continue(){var e;return((e=me(this,Zl))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var h,l,u,d,g,f,m,y,w,_,b,x,C,k,T,N,A,j;const i=()=>{pr(this,Zs,No).call(this,{type:"continue"})},n={client:me(this,$f),meta:this.options.meta,mutationKey:this.options.mutationKey};Ct(this,Zl,gB({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(E,L)=>{pr(this,Zs,No).call(this,{type:"failed",failureCount:E,error:L})},onPause:()=>{pr(this,Zs,No).call(this,{type:"pause"})},onContinue:i,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>me(this,Xi).canRun(this)}));const s=this.state.status==="pending",o=!me(this,Zl).canStart();try{if(s)i();else{pr(this,Zs,No).call(this,{type:"pending",variables:e,isPaused:o}),me(this,Xi).config.onMutate&&await me(this,Xi).config.onMutate(e,this,n);const L=await((l=(h=this.options).onMutate)==null?void 0:l.call(h,e,n));L!==this.state.context&&pr(this,Zs,No).call(this,{type:"pending",context:L,variables:e,isPaused:o})}const E=await me(this,Zl).start();return await((d=(u=me(this,Xi).config).onSuccess)==null?void 0:d.call(u,E,e,this.state.context,this,n)),await((f=(g=this.options).onSuccess)==null?void 0:f.call(g,E,e,this.state.context,n)),await((y=(m=me(this,Xi).config).onSettled)==null?void 0:y.call(m,E,null,this.state.variables,this.state.context,this,n)),await((_=(w=this.options).onSettled)==null?void 0:_.call(w,E,null,e,this.state.context,n)),pr(this,Zs,No).call(this,{type:"success",data:E}),E}catch(E){try{await((x=(b=me(this,Xi).config).onError)==null?void 0:x.call(b,E,e,this.state.context,this,n))}catch(L){Promise.reject(L)}try{await((k=(C=this.options).onError)==null?void 0:k.call(C,E,e,this.state.context,n))}catch(L){Promise.reject(L)}try{await((N=(T=me(this,Xi).config).onSettled)==null?void 0:N.call(T,void 0,E,this.state.variables,this.state.context,this,n))}catch(L){Promise.reject(L)}try{await((j=(A=this.options).onSettled)==null?void 0:j.call(A,void 0,E,e,this.state.context,n))}catch(L){Promise.reject(L)}throw pr(this,Zs,No).call(this,{type:"error",error:E}),E}finally{me(this,Xi).runNext(this)}}},$f=new WeakMap,Xs=new WeakMap,Xi=new WeakMap,Zl=new WeakMap,Zs=new WeakSet,No=function(e){const i=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=i(this.state),Ti.batch(()=>{me(this,Xs).forEach(n=>{n.onMutationUpdate(e)}),me(this,Xi).notify({mutation:this,type:"updated",action:e})})},nB);function vB(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Oa,Cs,Pf,sB,Az=(sB=class extends gu{constructor(e={}){super();Gt(this,Oa);Gt(this,Cs);Gt(this,Pf);this.config=e,Ct(this,Oa,new Set),Ct(this,Cs,new Map),Ct(this,Pf,0)}build(e,i,n){const s=new jz({client:e,mutationCache:this,mutationId:++dg(this,Pf)._,options:e.defaultMutationOptions(i),state:n});return this.add(s),s}add(e){me(this,Oa).add(e);const i=fg(e);if(typeof i=="string"){const n=me(this,Cs).get(i);n?n.push(e):me(this,Cs).set(i,[e])}this.notify({type:"added",mutation:e})}remove(e){if(me(this,Oa).delete(e)){const i=fg(e);if(typeof i=="string"){const n=me(this,Cs).get(i);if(n)if(n.length>1){const s=n.indexOf(e);s!==-1&&n.splice(s,1)}else n[0]===e&&me(this,Cs).delete(i)}}this.notify({type:"removed",mutation:e})}canRun(e){const i=fg(e);if(typeof i=="string"){const n=me(this,Cs).get(i),s=n==null?void 0:n.find(o=>o.state.status==="pending");return!s||s===e}else return!0}runNext(e){var n;const i=fg(e);if(typeof i=="string"){const s=(n=me(this,Cs).get(i))==null?void 0:n.find(o=>o!==e&&o.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Ti.batch(()=>{me(this,Oa).forEach(e=>{this.notify({type:"removed",mutation:e})}),me(this,Oa).clear(),me(this,Cs).clear()})}getAll(){return Array.from(me(this,Oa))}find(e){const i={exact:!0,...e};return this.getAll().find(n=>GE(i,n))}findAll(e={}){return this.getAll().filter(i=>GE(e,i))}notify(e){Ti.batch(()=>{this.listeners.forEach(i=>{i(e)})})}resumePausedMutations(){const e=this.getAll().filter(i=>i.state.isPaused);return Ti.batch(()=>Promise.all(e.map(i=>i.continue().catch(sn))))}},Oa=new WeakMap,Cs=new WeakMap,Pf=new WeakMap,sB);function fg(r){var e;return(e=r.options.scope)==null?void 0:e.id}var Da,$o,wn,Ia,Ua,om,q_,aB,Mz=(aB=class extends gu{constructor(i,n){super();Gt(this,Ua);Gt(this,Da);Gt(this,$o);Gt(this,wn);Gt(this,Ia);Ct(this,Da,i),this.setOptions(n),this.bindMethods(),pr(this,Ua,om).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(i){var s;const n=this.options;this.options=me(this,Da).defaultMutationOptions(i),Em(this.options,n)||me(this,Da).getMutationCache().notify({type:"observerOptionsUpdated",mutation:me(this,wn),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&nc(n.mutationKey)!==nc(this.options.mutationKey)?this.reset():((s=me(this,wn))==null?void 0:s.state.status)==="pending"&&me(this,wn).setOptions(this.options)}onUnsubscribe(){var i;this.hasListeners()||(i=me(this,wn))==null||i.removeObserver(this)}onMutationUpdate(i){pr(this,Ua,om).call(this),pr(this,Ua,q_).call(this,i)}getCurrentResult(){return me(this,$o)}reset(){var i;(i=me(this,wn))==null||i.removeObserver(this),Ct(this,wn,void 0),pr(this,Ua,om).call(this),pr(this,Ua,q_).call(this)}mutate(i,n){var s;return Ct(this,Ia,n),(s=me(this,wn))==null||s.removeObserver(this),Ct(this,wn,me(this,Da).getMutationCache().build(me(this,Da),this.options)),me(this,wn).addObserver(this),me(this,wn).execute(i)}},Da=new WeakMap,$o=new WeakMap,wn=new WeakMap,Ia=new WeakMap,Ua=new WeakSet,om=function(){var n;const i=((n=me(this,wn))==null?void 0:n.state)??vB();Ct(this,$o,{...i,isPending:i.status==="pending",isSuccess:i.status==="success",isError:i.status==="error",isIdle:i.status==="idle",mutate:this.mutate,reset:this.reset})},q_=function(i){Ti.batch(()=>{var n,s,o,h,l,u,d,g;if(me(this,Ia)&&this.hasListeners()){const f=me(this,$o).variables,m=me(this,$o).context,y={client:me(this,Da),meta:this.options.meta,mutationKey:this.options.mutationKey};if((i==null?void 0:i.type)==="success"){try{(s=(n=me(this,Ia)).onSuccess)==null||s.call(n,i.data,f,m,y)}catch(w){Promise.reject(w)}try{(h=(o=me(this,Ia)).onSettled)==null||h.call(o,i.data,null,f,m,y)}catch(w){Promise.reject(w)}}else if((i==null?void 0:i.type)==="error"){try{(u=(l=me(this,Ia)).onError)==null||u.call(l,i.error,f,m,y)}catch(w){Promise.reject(w)}try{(g=(d=me(this,Ia)).onSettled)==null||g.call(d,void 0,i.error,f,m,y)}catch(w){Promise.reject(w)}}}this.listeners.forEach(f=>{f(me(this,$o))})})},aB),Qs,oB,Lz=(oB=class extends gu{constructor(e={}){super();Gt(this,Qs);this.config=e,Ct(this,Qs,new Map)}build(e,i,n){const s=i.queryKey,o=i.queryHash??PC(s,i);let h=this.get(o);return h||(h=new kz({client:e,queryKey:s,queryHash:o,options:e.defaultQueryOptions(i),state:n,defaultOptions:e.getQueryDefaults(s)}),this.add(h)),h}add(e){me(this,Qs).has(e.queryHash)||(me(this,Qs).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const i=me(this,Qs).get(e.queryHash);i&&(e.destroy(),i===e&&me(this,Qs).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Ti.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return me(this,Qs).get(e)}getAll(){return[...me(this,Qs).values()]}find(e){const i={exact:!0,...e};return this.getAll().find(n=>WE(i,n))}findAll(e={}){const i=this.getAll();return Object.keys(e).length>0?i.filter(n=>WE(e,n)):i}notify(e){Ti.batch(()=>{this.listeners.forEach(i=>{i(e)})})}onFocus(){Ti.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Ti.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Qs=new WeakMap,oB),ui,Po,zo,$h,Ph,qo,zh,qh,lB,Rz=(lB=class{constructor(r={}){Gt(this,ui);Gt(this,Po);Gt(this,zo);Gt(this,$h);Gt(this,Ph);Gt(this,qo);Gt(this,zh);Gt(this,qh);Ct(this,ui,r.queryCache||new Lz),Ct(this,Po,r.mutationCache||new Az),Ct(this,zo,r.defaultOptions||{}),Ct(this,$h,new Map),Ct(this,Ph,new Map),Ct(this,qo,0)}mount(){dg(this,qo)._++,me(this,qo)===1&&(Ct(this,zh,HC.subscribe(async r=>{r&&(await this.resumePausedMutations(),me(this,ui).onFocus())})),Ct(this,qh,Nm.subscribe(async r=>{r&&(await this.resumePausedMutations(),me(this,ui).onOnline())})))}unmount(){var r,e;dg(this,qo)._--,me(this,qo)===0&&((r=me(this,zh))==null||r.call(this),Ct(this,zh,void 0),(e=me(this,qh))==null||e.call(this),Ct(this,qh,void 0))}isFetching(r){return me(this,ui).findAll({...r,fetchStatus:"fetching"}).length}isMutating(r){return me(this,Po).findAll({...r,status:"pending"}).length}getQueryData(r){var i;const e=this.defaultQueryOptions({queryKey:r});return(i=me(this,ui).get(e.queryHash))==null?void 0:i.state.data}ensureQueryData(r){const e=this.defaultQueryOptions(r),i=me(this,ui).build(this,e),n=i.state.data;return n===void 0?this.fetchQuery(r):(r.revalidateIfStale&&i.isStaleByTime(Ko(e.staleTime,i))&&this.prefetchQuery(e),Promise.resolve(n))}getQueriesData(r){return me(this,ui).findAll(r).map(({queryKey:e,state:i})=>{const n=i.data;return[e,n]})}setQueryData(r,e,i){const n=this.defaultQueryOptions({queryKey:r}),s=me(this,ui).get(n.queryHash),o=s==null?void 0:s.state.data,h=dz(e,o);if(h!==void 0)return me(this,ui).build(this,n).setData(h,{...i,manual:!0})}setQueriesData(r,e,i){return Ti.batch(()=>me(this,ui).findAll(r).map(({queryKey:n})=>[n,this.setQueryData(n,e,i)]))}getQueryState(r){var i;const e=this.defaultQueryOptions({queryKey:r});return(i=me(this,ui).get(e.queryHash))==null?void 0:i.state}removeQueries(r){const e=me(this,ui);Ti.batch(()=>{e.findAll(r).forEach(i=>{e.remove(i)})})}resetQueries(r,e){const i=me(this,ui);return Ti.batch(()=>(i.findAll(r).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...r},e)))}cancelQueries(r,e={}){const i={revert:!0,...e},n=Ti.batch(()=>me(this,ui).findAll(r).map(s=>s.cancel(i)));return Promise.all(n).then(sn).catch(sn)}invalidateQueries(r,e={}){return Ti.batch(()=>(me(this,ui).findAll(r).forEach(i=>{i.invalidate()}),(r==null?void 0:r.refetchType)==="none"?Promise.resolve():this.refetchQueries({...r,type:(r==null?void 0:r.refetchType)??(r==null?void 0:r.type)??"active"},e)))}refetchQueries(r,e={}){const i={...e,cancelRefetch:e.cancelRefetch??!0},n=Ti.batch(()=>me(this,ui).findAll(r).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let o=s.fetch(void 0,i);return i.throwOnError||(o=o.catch(sn)),s.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(n).then(sn)}fetchQuery(r){const e=this.defaultQueryOptions(r);e.retry===void 0&&(e.retry=!1);const i=me(this,ui).build(this,e);return i.isStaleByTime(Ko(e.staleTime,i))?i.fetch(e):Promise.resolve(i.state.data)}prefetchQuery(r){return this.fetchQuery(r).then(sn).catch(sn)}fetchInfiniteQuery(r){return r.behavior=JE(r.pages),this.fetchQuery(r)}prefetchInfiniteQuery(r){return this.fetchInfiniteQuery(r).then(sn).catch(sn)}ensureInfiniteQueryData(r){return r.behavior=JE(r.pages),this.ensureQueryData(r)}resumePausedMutations(){return Nm.isOnline()?me(this,Po).resumePausedMutations():Promise.resolve()}getQueryCache(){return me(this,ui)}getMutationCache(){return me(this,Po)}getDefaultOptions(){return me(this,zo)}setDefaultOptions(r){Ct(this,zo,r)}setQueryDefaults(r,e){me(this,$h).set(nc(r),{queryKey:r,defaultOptions:e})}getQueryDefaults(r){const e=[...me(this,$h).values()],i={};return e.forEach(n=>{yf(r,n.queryKey)&&Object.assign(i,n.defaultOptions)}),i}setMutationDefaults(r,e){me(this,Ph).set(nc(r),{mutationKey:r,defaultOptions:e})}getMutationDefaults(r){const e=[...me(this,Ph).values()],i={};return e.forEach(n=>{yf(r,n.mutationKey)&&Object.assign(i,n.defaultOptions)}),i}defaultQueryOptions(r){if(r._defaulted)return r;const e={...me(this,zo).queries,...this.getQueryDefaults(r.queryKey),...r,_defaulted:!0};return e.queryHash||(e.queryHash=PC(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===zC&&(e.enabled=!1),e}defaultMutationOptions(r){return r!=null&&r._defaulted?r:{...me(this,zo).mutations,...(r==null?void 0:r.mutationKey)&&this.getMutationDefaults(r.mutationKey),...r,_defaulted:!0}}clear(){me(this,ui).clear(),me(this,Po).clear()}},ui=new WeakMap,Po=new WeakMap,zo=new WeakMap,$h=new WeakMap,Ph=new WeakMap,qo=new WeakMap,zh=new WeakMap,qh=new WeakMap,lB),xB=B.createContext(void 0),Pt=r=>{const e=B.useContext(xB);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},tN=({client:r,children:e})=>(B.useEffect(()=>(r.mount(),()=>{r.unmount()}),[r]),a.jsx(xB.Provider,{value:r,children:e})),_B=B.createContext(!1),Bz=()=>B.useContext(_B);_B.Provider;function Oz(){let r=!1;return{clearReset:()=>{r=!1},reset:()=>{r=!0},isReset:()=>r}}var Dz=B.createContext(Oz()),Iz=()=>B.useContext(Dz),Fz=(r,e,i)=>{const n=i!=null&&i.state.error&&typeof r.throwOnError=="function"?qC(r.throwOnError,[i.state.error,i]):r.throwOnError;(r.suspense||r.experimental_prefetchInRender||n)&&(e.isReset()||(r.retryOnMount=!1))},$z=r=>{B.useEffect(()=>{r.clearReset()},[r])},Pz=({result:r,errorResetBoundary:e,throwOnError:i,query:n,suspense:s})=>r.isError&&!e.isReset()&&!r.isFetching&&n&&(s&&r.data===void 0||qC(i,[r.error,n])),zz=r=>{if(r.suspense){const i=s=>s==="static"?s:Math.max(s??1e3,1e3),n=r.staleTime;r.staleTime=typeof n=="function"?(...s)=>i(n(...s)):i(n),typeof r.gcTime=="number"&&(r.gcTime=Math.max(r.gcTime,1e3))}},qz=(r,e)=>r.isLoading&&r.isFetching&&!e,Hz=(r,e)=>(r==null?void 0:r.suspense)&&e.isPending,rN=(r,e,i)=>e.fetchOptimistic(r).catch(()=>{i.clearReset()});function Uz(r,e,i){var m,y,w,_;const n=Bz(),s=Iz(),o=Pt(),h=o.defaultQueryOptions(r);(y=(m=o.getDefaultOptions().queries)==null?void 0:m._experimental_beforeQuery)==null||y.call(m,h);const l=o.getQueryCache().get(h.queryHash);h._optimisticResults=n?"isRestoring":"optimistic",zz(h),Fz(h,s,l),$z(s);const u=!o.getQueryCache().get(h.queryHash),[d]=B.useState(()=>new e(o,h)),g=d.getOptimisticResult(h),f=!n&&r.subscribed!==!1;if(B.useSyncExternalStore(B.useCallback(b=>{const x=f?d.subscribe(Ti.batchCalls(b)):sn;return d.updateResult(),x},[d,f]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),B.useEffect(()=>{d.setOptions(h)},[h,d]),Hz(h,g))throw rN(h,d,s);if(Pz({result:g,errorResetBoundary:s,throwOnError:h.throwOnError,query:l,suspense:h.suspense}))throw g.error;if((_=(w=o.getDefaultOptions().queries)==null?void 0:w._experimental_afterQuery)==null||_.call(w,h,g),h.experimental_prefetchInRender&&!ic&&qz(g,n)){const b=u?rN(h,d,s):l==null?void 0:l.promise;b==null||b.catch(sn).finally(()=>{d.updateResult()})}return h.notifyOnChangeProps?g:d.trackResult(g)}function Yt(r,e){return Uz(r,Sz)}function Vt(r,e){const i=Pt(),[n]=B.useState(()=>new Mz(i,r));B.useEffect(()=>{n.setOptions(r)},[n,r]);const s=B.useSyncExternalStore(B.useCallback(h=>n.subscribe(Ti.batchCalls(h)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),o=B.useCallback((h,l)=>{n.mutate(h,l).catch(sn)},[n]);if(s.error&&qC(n.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:o,mutateAsync:s.mutate}}const Wz="/api";let jm=null;function WC(r){jm=r}function CB(){return jm}class Gz{async request(e,i){const n={"Content-Type":"application/json",...i==null?void 0:i.headers};jm&&(n["X-Dreamcontext-Vault"]=jm);const s=await fetch(`${Wz}${e}`,{...i,headers:n});if(!s.ok){let o=`Request failed: ${s.status}`;try{const h=await s.json();h.message&&(o=h.message)}catch{}throw new Error(o)}return await s.json()}get(e){return this.request(e)}post(e,i){return this.request(e,{method:"POST",body:JSON.stringify(i)})}patch(e,i){return this.request(e,{method:"PATCH",body:JSON.stringify(i)})}put(e,i){return this.request(e,{method:"PUT",body:JSON.stringify(i)})}del(e){return this.request(e,{method:"DELETE"})}}const De=new Gz;function GC(){const{data:r}=Yt({queryKey:["health"],queryFn:()=>De.get("/health"),staleTime:6e4,retry:1});return{health:r,serverCurrent:(r==null?void 0:r.version)==="0.17.1"}}const Kz=[["vaults"],["launcher-status"],["launcher-federation-graph"],["connections"]];function mc(r){for(const e of Kz)r.invalidateQueries({queryKey:e})}function Vz(){const r=Pt();return Vt({mutationFn:e=>De.post("/launcher/register",e),onSuccess:()=>{mc(r)}})}function Yz(){return Yt({queryKey:["launcher-defaults"],queryFn:()=>De.get("/launcher/defaults"),staleTime:1/0})}function Xz(){const r=Pt();return Vt({mutationFn:e=>De.post("/launcher/scaffold",e),onSuccess:()=>{mc(r)}})}function Zz(){return Yt({queryKey:["launcher-catalog"],queryFn:()=>De.get("/launcher/catalog"),staleTime:1/0})}async function Qz(r){return De.get(`/launcher/detect?path=${encodeURIComponent(r)}`)}function wB(r=!0){return Yt({queryKey:["launcher-status"],queryFn:()=>De.get("/launcher/status"),enabled:r})}function kB(){const r=Pt();return Vt({mutationFn:e=>De.post("/launcher/update",{name:e}),onSuccess:()=>{mc(r)}})}function Jz(){const r=Pt();return Vt({mutationFn:e=>De.post("/launcher/unregister",{name:e}),onSuccess:()=>{mc(r)}})}function e7(){return Yt({queryKey:["launcher-federation-graph"],queryFn:()=>De.get("/launcher/federation-graph")})}function t7(){const r=Pt();return Vt({mutationFn:e=>De.post("/launcher/connection",e),onSuccess:()=>{mc(r)}})}function r7(){const r=Pt();return Vt({mutationFn:e=>De.post("/launcher/connection/remove",e),onSuccess:()=>{mc(r)}})}function i7(){const r=Pt();return Vt({mutationFn:e=>De.post("/launcher/shareable",e),onSuccess:()=>{mc(r)}})}const Pn={status:["brain-status"],settings:["brain-settings"],authStatus:["brain-auth-status"],teamUpdates:["brain-team-updates"]};function yc(r){r.invalidateQueries({queryKey:Pn.status}),r.invalidateQueries({queryKey:Pn.settings}),r.invalidateQueries({queryKey:Pn.teamUpdates}),r.invalidateQueries({queryKey:Pn.authStatus})}function KC(){return Yt({queryKey:Pn.status,queryFn:()=>De.get("/brain/status")})}function n7(){return Yt({queryKey:Pn.settings,queryFn:()=>De.get("/brain/settings")})}function s7(){const r=Pt();return Vt({mutationFn:e=>De.post("/brain/settings",{enabled:e}),onSuccess:e=>{r.setQueryData(Pn.settings,e),yc(r)}})}function a7(){const r=Pt();return Vt({mutationFn:(e={})=>De.post("/brain/origin/create",e),onSuccess:()=>yc(r)})}function o7(){const r=Pt();return Vt({mutationFn:e=>De.post("/brain/origin/attach",{url:e}),onSuccess:()=>yc(r)})}function l7(){const r=Pt();return Vt({mutationFn:e=>De.post("/brain/origin/update",{url:e}),onSuccess:()=>yc(r)})}function c7(){const r=Pt();return Vt({mutationFn:()=>De.post("/brain/origin/detach",{}),onSuccess:()=>yc(r)})}function VC(){return Yt({queryKey:Pn.authStatus,queryFn:()=>De.get("/brain/auth/status")})}function h7(){return Vt({mutationFn:()=>De.post("/brain/auth/device/start",{})})}function u7(){return Vt({mutationFn:r=>De.post("/brain/auth/device/poll",{sessionId:r})})}function d7(){const r=Pt();return Vt({mutationFn:e=>De.post("/brain/auth/token",{token:e}),onSuccess:e=>r.setQueryData(Pn.authStatus,e)})}function f7(){const r=Pt();return Vt({mutationFn:()=>De.post("/brain/auth/logout",{}),onSuccess:e=>r.setQueryData(Pn.authStatus,e)})}function p7(){const r=Pt();return Vt({mutationFn:(e="pull-only")=>{const{mode:i="pull-only",noCheckpoint:n=!1}=typeof e=="string"?{mode:e}:e;return De.post("/brain/sync",{mode:i,foreground:!0,noCheckpoint:n})},onSuccess:()=>yc(r)})}function g7(){const r=Pt();return Vt({mutationFn:e=>De.post("/brain/scrub/ignore",{path:e}),onSuccess:()=>yc(r)})}function SB(){return Yt({queryKey:Pn.teamUpdates,queryFn:()=>De.get("/brain/team/updates"),select:r=>r.vaults})}function TB(){const r=Pt();return Vt({mutationFn:e=>De.post("/brain/team/fetch",e?{vault:e}:{}),onSuccess:()=>{r.invalidateQueries({queryKey:Pn.teamUpdates}),r.invalidateQueries({queryKey:Pn.status})}})}const m7="modulepreload",y7=function(r){return"/"+r},iN={},Zt=function(e,i,n){let s=Promise.resolve();if(i&&i.length>0){let h=function(d){return Promise.all(d.map(g=>Promise.resolve(g).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),u=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));s=h(i.map(d=>{if(d=y7(d),d in iN)return;iN[d]=!0;const g=d.endsWith(".css"),f=g?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${f}`))return;const m=document.createElement("link");if(m.rel=g?"stylesheet":m7,g||(m.as="script"),m.crossOrigin="",m.href=d,u&&m.setAttribute("nonce",u),document.head.appendChild(m),g)return new Promise((y,w)=>{m.addEventListener("load",y),m.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${d}`)))})}))}function o(h){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=h,window.dispatchEvent(l),!l.defaultPrevented)throw h}return s.then(h=>{for(const l of h||[])l.status==="rejected"&&o(l.reason);return e().catch(o)})};function qi(){return!!window.__TAURI_INTERNALS__}const b7='button, input, a, select, textarea, [role="button"], [data-no-drag]';function YC(r){return r instanceof Element&&r.closest(b7)!==null}async function v7(r){if(qi()&&!YC(r))try{const{getCurrentWindow:e}=await Zt(async()=>{const{getCurrentWindow:i}=await import("./window-DmNpeJAL.js").then(n=>n.w);return{getCurrentWindow:i}},__vite__mapDeps([0,1,2]));await e().startDragging()}catch{}}async function EB(){if(qi())try{const{getCurrentWindow:r}=await Zt(async()=>{const{getCurrentWindow:e}=await import("./window-DmNpeJAL.js").then(i=>i.w);return{getCurrentWindow:e}},__vite__mapDeps([0,1,2]));await r().close()}catch{}}async function x7(){if(qi()){try{const e=(await Zt(()=>import("./webviewWindow-BbG9Cr7f.js"),__vite__mapDeps([3,0,1,2]))).WebviewWindow,i=e.getAll?await e.getAll():[];if(i.length>0){await Promise.all(i.map(n=>n.close().catch(()=>{})));return}}catch{}await EB()}}function NB(r){if(r.button!==0)return;const e=r.target;if(YC(e))return;const i=r.clientX,n=r.clientY,s=h=>{(Math.abs(h.clientX-i)>4||Math.abs(h.clientY-n)>4)&&(o(),v7(e))},o=()=>{window.removeEventListener("mousemove",s),window.removeEventListener("mouseup",o)};window.addEventListener("mousemove",s),window.addEventListener("mouseup",o)}async function jB(r){if(qi()&&!YC(r))try{const{getCurrentWindow:e}=await Zt(async()=>{const{getCurrentWindow:i}=await import("./window-DmNpeJAL.js").then(n=>n.w);return{getCurrentWindow:i}},__vite__mapDeps([0,1,2]));await e().toggleMaximize()}catch{}}async function AB(){if(qi()){const{open:e}=await Zt(async()=>{const{open:n}=await import("./index-NsrznfmA.js");return{open:n}},__vite__mapDeps([4,1])),i=await e({directory:!0,multiple:!1});return typeof i=="string"?i:null}const r=window.prompt("Enter an absolute path to a dreamcontext project:");return r&&r.trim()?r.trim():null}async function _7(){if(qi())try{const{open:e}=await Zt(async()=>{const{open:n}=await import("./index-NsrznfmA.js");return{open:n}},__vite__mapDeps([4,1])),i=await e({directory:!1,multiple:!0});return Array.isArray(i)?i.filter(n=>typeof n=="string"):typeof i=="string"?[i]:[]}catch{return[]}const r=window.prompt("Enter absolute file path(s), comma-separated:");return r?r.split(",").map(e=>e.trim()).filter(Boolean):[]}function MB(r,e){return new Promise((i,n)=>{r.once("tauri://created",()=>i()),r.once("tauri://error",s=>n(new Error(`${e} window create failed: ${String(s.payload)}`)))})}async function LB(r){if(qi()){const{WebviewWindow:e}=await Zt(async()=>{const{WebviewWindow:o}=await import("./webviewWindow-BbG9Cr7f.js");return{WebviewWindow:o}},__vite__mapDeps([3,0,1,2])),i=`vault-${r.replace(/[^a-zA-Z0-9_-]/g,"-")}`,n=await e.getByLabel(i);if(n){await n.setFocus();return}const s=new e(i,{url:`${window.location.origin}/?vault=${encodeURIComponent(r)}`,title:`dreamcontext — ${r}`,width:1280,height:800,titleBarStyle:"overlay",hiddenTitle:!0,dragDropEnabled:!1});await MB(s,`vault "${r}"`);return}window.open(`/?vault=${encodeURIComponent(r)}`,"_blank")}async function C7(){if(qi()){const{WebviewWindow:r}=await Zt(async()=>{const{WebviewWindow:n}=await import("./webviewWindow-BbG9Cr7f.js");return{WebviewWindow:n}},__vite__mapDeps([3,0,1,2])),e=await r.getByLabel("main");if(e){await e.setFocus();return}const i=new r("main",{url:`${window.location.origin}/`,title:"dreamcontext",width:1280,height:800,titleBarStyle:"overlay",hiddenTitle:!0,dragDropEnabled:!1});await MB(i,"launcher");return}window.location.assign(`${window.location.origin}/`)}async function nN(r){await LB(r)}function Am({exists:r,needsUpdate:e,title:i,className:n}){const s=r?e?"stale":"ok":"gone";return a.jsx("span",{className:`vault-dot vault-dot--${s}${n?` ${n}`:""}`,title:i,"aria-hidden":"true"})}const w7={en:{"nav.brain":"Map","nav.tasks":"Tasks","nav.roadmap":"Roadmap","nav.labpage":"Insights","nav.core":"Core","nav.knowledge":"Knowledge","nav.sleep":"Sleep Cycle","nav.council":"Council","nav.settings":"Settings","nav.packs":"Packs","nav.taxonomy":"Taxonomy","nav.about":"What is this?","nav.lab":"Lab","nav.beta":"Beta","nav.group.workspace":"Workspace","nav.group.memory":"Memory","nav.group.brain":"Brain","nav.group.control":"Control Panel","nav.collapse":"Collapse","nav.expand":"Expand","lab.credentials.title":"{n} credential(s) missing — some insights can’t sync","lab.credentials.hint":"Paste each value below, or run `dreamcontext lab credentials set <key>` from the CLI. Values are stored gitignored and never shown again.","lab.credentials.usedBy":"Used by {slugs}","lab.credentials.placeholder":"Paste the value…","lab.credentials.save":"Save","lab.credentials.saving":"Saving…","lab.credentials.saved":"Credential “{key}” saved.","lab.credentials.saveFailed":"Could not save “{key}” — {message}","lab.credentials.collapse":"Hide","lab.credentials.expand":"Show","council.title":"Council","council.tab.verdict":"Verdict","council.tab.matrix":"Matrix","council.tab.transcript":"Transcript","council.search.placeholder":"Search sessions…","council.search.matrix":"Filter cells by text…","council.search.transcript":"Search transcript…","council.filter.all":"All","council.filter.status":"Status","council.inspector.empty":"Select a persona or cell to inspect.","council.inspector.selectCell":"Select a cell in the matrix for round details.","council.verdict.awaitingSynthesis":"Awaiting synthesis","council.verdict.synthPending":"The final report will appear here once the synthesizer runs.","council.empty.list":"No debates yet.","council.empty.detail":"Select a council session from the list.","council.lab.tagline":"A panel of AI personas debates a hard decision across rounds, then synthesizes a verdict you can trace.","council.new":"New debate","council.empty.cta":"Start your first debate","council.empty.nomatch":"No debates match your search.","tasks.title":"Tasks","tasks.create":"New Task","tasks.filter":"Filter","tasks.todo":"To Do","tasks.in_progress":"In Progress","tasks.in_review":"In Review","tasks.completed":"Completed","tasks.name":"Task Name","tasks.description":"Description","tasks.priority":"Priority","tasks.tags":"Tags","tasks.save":"Create Task","tasks.cancel":"Cancel","tasks.changelog":"Changelog","tasks.add_entry":"Add Entry","tasks.customFields.sectionLabel":"Custom","rice.title":"RICE","rice.reach":"Reach","rice.impact":"Impact","rice.confidence":"Confidence","rice.effort":"Effort","rice.score":"Score","rice.clear":"Clear RICE","rice.tooltip.reach":"How many people / sessions / units affected (1–10)","rice.tooltip.impact":"How much per affected unit (1=minimal, 5=massive)","rice.tooltip.confidence":"How sure are you? (25, 50, 75, 100)","rice.tooltip.effort":"Person-weeks (0.5–8 typical, max 52)","rice.empty":"Not rated","sort.rice":"RICE score","filter.min_rice":"Min RICE","priority.critical":"Critical","priority.high":"High","priority.medium":"Medium","priority.low":"Low","sleep.title":"Sleep State","sleep.debt":"Debt","sleep.level":"Level","sleep.last_sleep":"Last Sleep","sleep.sessions":"Sessions","sleep.alert":"Alert","sleep.drowsy":"Drowsy","sleep.sleepy":"Sleepy","sleep.must_sleep":"Must Sleep","sleep.active":"Sleeping","sleep.waiting":"Waiting to sleep…","sleep.menu.details":"Show sleep details","sleep.menu.run":"Run sleep agent","sleep.menu.run.disabled":"Agent unavailable — needs the desktop app with node-pty + the Claude CLI","sleep.menu.run.active":"A consolidation is already in progress","sleep.menu.run.waiting":"Waiting for the sleep agent to start…","sleep.changelog":"Changelog","sleep.changelog.pending":"Will fold into next sleep","sleep.changelog.breaking":"BREAKING","sleep.changelog.earlier":"earlier entries not shown","sleep.summary":"Summary","sleep.never":"Never","sleep.tagline.alert":"Wide awake. Your project memory is fresh and fully consolidated.","sleep.tagline.drowsy":"Resting easy. A handful of new memories have gathered since the last sleep.","sleep.tagline.sleepy":"Getting drowsy. A consolidation will soon weave recent work into long-term memory.","sleep.tagline.must_sleep":"It's time to sleep. Run a consolidation to fold recent work into long-term memory.","sleep.next.title":"Next sleep will consolidate","sleep.next.subtitle":"Everything captured since the last sleep — folded into long-term memory on the next cycle.","sleep.next.change":"change","sleep.next.changes":"changes","sleep.dashboard_changes":"Dashboard Changes","sleep.cloud.title":"Sleep cloud","sleep.cloud.subtitle":"Everything gathered since your last sleep — the next consolidation will weave it all into long-term memory.","sleep.cloud.item":"item","sleep.cloud.items":"items","sleep.cloud.stat.sessions":"Work sessions","sleep.cloud.stat.dashboard":"Dashboard edits","sleep.cloud.stat.highlights":"Highlights","sleep.cloud.stat.changelog":"Captured","sleep.cloud.group.dashboard":"Dashboard activity","sleep.cloud.group.dashboard.hint":"Manual edits you made in the dashboard — tasks, knowledge, features and more.","sleep.cloud.group.sessions":"Work sessions","sleep.cloud.group.sessions.hint":"Coding sessions since the last sleep, scored into the debt meter.","sleep.cloud.group.highlights":"Highlights","sleep.cloud.group.highlights.hint":"High-signal moments auto-tagged during work — processed first.","sleep.cloud.group.changelog":"Captured changelog","sleep.cloud.group.changelog.hint":"Shipped notes captured since the last sleep.","sleep.cloud.empty.title":"The cloud is clear","sleep.cloud.empty.sub":"Your memory is fully consolidated. New sessions and dashboard edits will gather here until the next sleep.","sleep.cloud.active":"Active","sleep.entity.task":"Tasks","sleep.entity.knowledge":"Knowledge","sleep.entity.feature":"Features","sleep.entity.core":"Core","sleep.entity.sleep":"Sleep","core.title":"Core Files","knowledge.title":"Knowledge","knowledge.pin":"Pin","knowledge.unpin":"Unpin","knowledge.search":"Search knowledge...","knowledge.fullscreen":"Full screen","settings.title":"Settings","settings.nav.platforms":"Platforms","settings.nav.tasks":"Cloud Tasks","settings.nav.format":"Task Format","settings.nav.memory":"Memory","settings.nav.connections":"Connections","settings.nav.brain":"Cloud sync","settings.nav.agents":"Agents","settings.nav.sleepy":"Sleepy","settings.navdesc.platforms":"Which AI coding agents this project uses","settings.navdesc.tasks":"Sync tasks to ClickUp or GitHub","settings.navdesc.format":"Add custom fields to your tasks","settings.navdesc.memory":"Control Claude's built-in memory","settings.navdesc.connections":"Share knowledge between your projects","settings.navdesc.brain":"Back up and share your project memory on GitHub","settings.navdesc.agents":"The in-app Claude Code panel","settings.navdesc.sleepy":"Notch quick-capture hotkey","settings.desc.platforms":"Tell dreamcontext which AI coding agents you use. It installs the right hooks and context files for each one so your project memory loads automatically.","settings.desc.tasks":"By default your tasks live in local files. Turn this on to mirror them to a cloud backend (ClickUp or GitHub Issues) so your team can see them too — recall, snapshots and this dashboard keep working either way.","settings.desc.memory":"dreamcontext can be the single source of your project's memory instead of Claude Code's built-in memory file.","settings.desc.brain":"Sign in with GitHub and connect a brain repo to back up your project memory to the cloud and share it with your team. Off by default — nothing syncs until you turn it on.","settings.agents.title":"Agents — in-app Claude Code","settings.agents.enable":"Enable the Agents surface","settings.agents.enable_hint":"Show the in-app agent launcher (the corner button and session dock). Turning this off hides it and closes any open agent view; running sessions keep going in the background.","settings.agents.restore_tabs":"Reopen past tabs on launch","settings.agents.restore_tabs_hint":"When the app starts, restore the agent/terminal tabs from your last session (agents resume their conversation). Off = always start with a clean slate.","settings.agents.default_agent":"Default agent","settings.agents.default_agent_hint":"Which agent a new session runs. Only Claude Code is available for now.","settings.agents.agent.claude":"Claude Code","settings.agents.auto_title":"Auto-name tabs from your first message","settings.agents.auto_title_hint":"Off by default. When on, after a new agent session's first turn a fast Haiku model reads your opening message and renames the tab to a short, descriptive title. Only tabs still named “Agent N” are renamed — tabs you've renamed yourself are never touched.","settings.agents.hotkey":"Quick open/close hotkey","settings.agents.hotkey_hint":"Press this anywhere in the app to open or close the Agents view. Default ⌃A. Click the field and press a new combo to rebind — or double-tap a single modifier (Ctrl, Option, ⌘, or Shift) to bind it as ⌃⌃-style two-taps. Backspace clears it. A chord yields to a focused terminal (close it with Esc or the collapse button); a double-tap toggles from anywhere, even inside a terminal.","settings.agents.hotkey_capturing":"Press a combo, or double-tap a modifier…","settings.platforms":"Platforms","settings.save":"Save","settings.saving":"Saving...","settings.saved":"Saved","settings.no_config":"No configuration file found. Saving will create one with your selections.","settings.platform.claude":"Claude (Anthropic)","settings.packs.installed":"Installed","settings.memory":"Memory","settings.brain":"Cloud sync","settings.native_memory.label":"Disable Claude's native memory","settings.native_memory.hint":"Recommended — dreamcontext becomes the single source of project memory instead of Claude Code’s built-in MEMORY.md.","settings.recall.title":"Memory recall","settings.recall.desc":"How dreamcontext finds relevant project memory for each prompt.","settings.recall.experimental":"Experimental","settings.recall.haiku.label":"Haiku (recommended)","settings.recall.haiku.hint":"A fast Haiku model reads each prompt and picks the most relevant docs.","settings.recall.raw.label":"Raw","settings.recall.raw.hint":"BM25 keyword search only — no LLM call, fully local.","settings.recall.hybrid.label":"Hybrid","settings.recall.hybrid.hint":"BM25 + local dense embeddings, blended (no LLM call). Falls back to BM25 if the embedding model is unavailable — the first use downloads a ~113MB model.","settings.recall.off.label":"Off","settings.recall.off.hint":"Memory recall disabled — no project memory is injected into prompts.","settings.recall.embed.checking":"Checking hybrid search…","settings.recall.embed.ready":"Hybrid search ready","settings.recall.embed.local":"local, offline","settings.recall.embed.chunks":"sections indexed","settings.recall.embed.needed":"Hybrid needs a local embedding model (~113 MB, one-time download). It runs on your machine — nothing is uploaded.","settings.recall.embed.download":"Download model (~113 MB)","settings.recall.embed.starting":"Starting…","settings.recall.embed.step1of2":"Step 1 of 2","settings.recall.embed.step2of2":"Step 2 of 2","settings.recall.embed.downloading":"Downloading model…","settings.recall.embed.downloading.hint":"One-time download. You can leave this page — it keeps going in the background.","settings.recall.embed.failed":"Model download failed","settings.recall.embed.retry":"Retry","settings.recall.embed.indexing":"Building search index…","settings.recall.embed.indexing.hint":"One-time. Indexing your brain for semantic search — this can take a few minutes the first time.","settings.recall.embed.index_needed":"Model ready. Now build this vault’s search index to finish enabling hybrid.","settings.recall.embed.build_index":"Build search index","settings.recall.embed.index_failed":"Search index build failed","settings.recall.embed.no_runtime":"Embedding runtime not installed","settings.recall.embed.no_runtime.hint":"The @huggingface/transformers package is missing on this machine, so Hybrid falls back to keyword (BM25) recall. Reinstall dreamcontext to add it.","settings.tasks":"Tasks","settings.cloud_tasks.label":"Cloud Task Management","settings.cloud_tasks.hint":"Tasks live in a remote backend; a gitignored local mirror keeps recall, snapshots, and the dashboard working unchanged.","settings.cloud_tasks.provider":"Provider","settings.cloud_tasks.provider.clickup":"ClickUp","settings.cloud_tasks.provider.github":"GitHub","settings.cloud_tasks.team":"Team ID","settings.cloud_tasks.space":"Space ID","settings.cloud_tasks.list":"List ID","settings.cloud_tasks.token_hint":"The key is saved to a gitignored secrets file (never in this config). You can also set it from the CLI with `dreamcontext config clickup-token`.","settings.cloud_tasks.github.hint":"Tasks sync to a GitHub repository's Issues; a gitignored local mirror keeps recall, snapshots, and the dashboard working unchanged.","settings.cloud_tasks.github.owner":"Owner","settings.cloud_tasks.github.repo":"Repository","settings.cloud_tasks.github.repo_picker":"Discovered repository","settings.cloud_tasks.github.pick":"Pick the repository to sync to…","settings.cloud_tasks.github.search":"Search repositories…","settings.cloud_tasks.github.token_hint":"The token is saved to a gitignored secrets file (never in this config). You can also set it from the CLI with `dreamcontext config github-token`. Needs `repo` scope (classic) or Issues read/write + Metadata (fine-grained).","settings.cloud_tasks.github.provision":"Provision labels","settings.cloud_tasks.github.provisioning":"Provisioning…","settings.cloud_tasks.list_pick":"Pick the list to sync to…","settings.cloud_tasks.list_search":"Search lists…","settings.cloud_tasks.keep_current":"(keep current)","settings.cloud_tasks.list_label":"List","settings.cloud_tasks.provision":"Provision fields","settings.cloud_tasks.provisioning":"Provisioning…","settings.cloud_tasks.test":"Test connection","settings.cloud_tasks.testing":"Testing…","settings.cloud_tasks.test_ok":"Connected as","settings.cloud_tasks.status":"Sync status","settings.cloud_tasks.pending":"pending push","settings.cloud_tasks.conflicts":"conflict(s) preserved in state/.conflicts/","settings.cloud_tasks.api_key":"API key","settings.cloud_tasks.api_key_placeholder":"Paste your API key…","settings.cloud_tasks.api_key_none":"No key saved yet — paste it above, then Test connection (it saves automatically).","settings.cloud_tasks.api_key_set":"Key saved ✓","settings.cloud_tasks.api_key_env":"Using an environment variable ✓ (overrides any saved key)","settings.cloud_tasks.preview_title":"These custom fields will be created on the list:","settings.cloud_tasks.github.preview_title":"These labels will be created on the repository:","settings.cloud_tasks.preview_will_create":"Will create ({n})","settings.cloud_tasks.preview_existing":"Already exist ({n})","settings.cloud_tasks.provision_confirm":"Create {n} now","settings.cloud_tasks.provision_creating":"Creating…","settings.cloud_tasks.provision_cancel":"Cancel","settings.cloud_tasks.provision_created":"Created","settings.cloud_tasks.provision_backfilled":"backfilled {n} value(s)","settings.cloud_tasks.provision_nothing":"All recommended fields already exist.","settings.federation":"Cross-Project Federation","settings.desc.connections":"Connect this project to your other dreamcontext projects so they can share knowledge. Everything here is off until you opt in.","federation.board.title":"Connection map","federation.board.desc":"Each card is one of your projects. Drag from one project to another to make the first read the second live. Click a project to see who reads it or to let others read it; click a wire to remove it.","federation.advanced":"More — list view, topic filters, inbox & sync preview","federation.vaults.desc":"Every dreamcontext project on this machine that this one can connect to.","federation.connections.desc":"Projects this one is already linked with. Set the direction and, optionally, limit which topics flow.","federation.add.desc":"Link a new project and choose whether you read from it, share to it, or both.","federation.inbox.desc":"Knowledge that connected projects have sent you. It folds into your memory on the next sleep cycle.","federation.preview.title":"Preview what you would share","federation.intro.title":"What is cross-project federation?","federation.intro.body":"Federation lets your projects share knowledge with each other. Connect two projects and one can “read” the other — its agent can recall decisions, changelog and knowledge from across the link. It’s off by default: nothing is shared until you opt in.","federation.intro.step1":"1. Turn on Sharing below so other projects are allowed to read this one.","federation.intro.step2":"2. Add a connection to a peer and choose the direction — read it, share to it, or both.","federation.intro.step3":"3. Incoming knowledge lands in the digest inbox and is folded in on the next sleep cycle.","federation.sharing":"Sharing","federation.shareable.label":"Let other projects read this one","federation.shareable.hint":"When on, projects you’ve connected may pull this project’s knowledge into their recall. Off = private (the default). This only controls who may READ you — it never stops you reading others.","federation.vaults":"Registered vaults","federation.vaults.empty":"No vaults registered. Run `dreamcontext vaults discover --register` to add sibling projects.","federation.current":"This project","federation.connections":"Connections","federation.connections.empty":"No connections yet. Add a peer below to read or share knowledge across projects.","federation.stale":"Stale","federation.remove":"Remove","federation.direction":"Direction","federation.direction.out":"→ Share to","federation.direction.in":"← Read from","federation.direction.both":"⇄ Two-way","federation.direction.out.hint":"Your knowledge flows to this peer, and your recall can reach into theirs.","federation.direction.in.hint":"Accept this peer’s digests into your inbox.","federation.direction.both.hint":"Read from and share to this peer.","federation.topics.placeholder":"topics (comma-separated, blank = all)","federation.topics.label":"Limit to topics","federation.add":"Add a connection","federation.add.pick":"Pick a vault…","federation.add.none":"Every registered vault is already connected (or none are available to add).","federation.connect":"Connect","federation.error.pick_vault":"Pick a vault to connect to.","federation.inbox":"Digest inbox","federation.inbox.pending":"Pending","federation.inbox.consumed":"Consumed","federation.inbox.empty":"Inbox is empty — no peer digests waiting. The next sleep cycle drains it.","federation.inbox.quarantined":"Quarantined (incompatible schema — left in place)","federation.inbox.from":"from","federation.preview":"Preview sync","federation.preview.running":"Previewing…","federation.preview.hint":"Dry-run: computes the digests that would be pushed to consenting peers. Writes nothing.","federation.preview.none":"No out/both connections to preview.","federation.preview.stale":"unreachable (stale)","federation.preview.noconsent":"no consent (peer must link in/both back)","federation.preview.nodelta":"no new entries since last sync","federation.preview.entries":"entries would be pushed","federation.map.help":"How it works","federation.map.connections":"Connections","federation.map.hint.default":"Drag from one project to another to connect them. Click a project for details, or click a wire to edit it.","federation.map.hint.first":"Try it: drag from one project card onto another — the first will read the second, live.","federation.map.hint.armed":"Now click the project “{name}” should read. Esc cancels.","federation.map.legend.live":"reads — live, nothing copied","federation.map.legend.inert":"not Readable yet","federation.map.legend.ok":"up to date","federation.map.legend.stale":"needs update","federation.map.legend.gone":"folder missing","federation.map.note.connected":"“{from}” now reads “{to}” — live.","federation.map.note.inert":"“{from}” now reads “{to}”, but “{to}” isn’t Readable yet — the wire stays inert until you switch it on.","federation.map.note.makeReadable":"Turn on Readable","federation.map.note.readable":"“{name}” is now Readable — its wires are live.","federation.map.note.failed":"Failed to connect.","federation.map.wire.reads":"reads","federation.map.wire.mutual":"read each other","federation.map.wiremenu.title":"Connection","federation.map.wiremenu.row":"“{from}” reads “{to}”","federation.map.wiremenu.notLive":"not live — “{name}” isn’t Readable","federation.map.wiremenu.remove":"Remove","federation.map.wiremenu.makeReadable":"Make “{name}” Readable","federation.map.conns.title":"All connections","federation.map.conns.empty":"No connections yet — drag one project onto another to create the first wire.","federation.map.conns.mutual":"{a} ⇄ {b} — read each other","federation.map.conns.reads":"{from} reads {to}","federation.map.conns.inert":" — not Readable yet","federation.map.detail.gone":"Folder is gone.","federation.map.detail.behind":"Behind: v{from} → v{to}","federation.map.detail.current":"Up to date (v{v})","federation.map.detail.update":"Update","federation.map.detail.updating":"Updating…","federation.map.detail.readable":"Readable — let connected projects read this one","federation.map.detail.connect":"Connect to another project…","federation.map.detail.connections":"Connections","federation.map.detail.none":"No connections yet.","federation.map.detail.youRead":"Reads “{name}” live","federation.map.detail.readsYou":"“{name}” reads this project live","federation.map.detail.notLive":" — not Readable yet","federation.map.status.loading":"Loading the connection map…","federation.map.status.error":"Failed to load the connection map.","federation.map.empty.title":"Nothing to connect yet","federation.map.empty.body":"Register at least two projects, then wire them so one can read the other’s memory live.","federation.map.guide.title":"How the connection map works","federation.map.guide.def":"App reads Libs’ canonical memory live during recall — a reference, never a copy. Each project stays the single source of truth for its own knowledge.","federation.map.guide.step1":"Drag from one project onto another — the first now reads the second.","federation.map.guide.step2":"Click a project to see its connections and switch on Readable (violet dot) so others may read it.","federation.map.guide.step3":"Click any wire to remove it — or to make its target Readable if it isn’t live yet.","federation.map.guide.keys":"Shortcuts: + / − zoom · 0 fit · Esc cancel · ? this guide","federation.map.guide.gotit":"Got it","federation.map.guide.start":"Start wiring","federation.map.zoom.in":"Zoom in","federation.map.zoom.out":"Zoom out","federation.map.zoom.fit":"Fit to view","packs.title":"Skill Packs","packs.section.packs":"Packs","packs.section.standalone":"Standalone Skills","packs.detail.base":"Base Skill","packs.detail.subskills":"Sub-Skills","packs.detail.agents":"Related Agents","packs.detail.close":"Close","packs.action.install":"Install","packs.action.remove":"Remove","packs.action.installing":"Installing…","packs.action.removing":"Removing…","packs.action.error":"Action failed","update.available":"Update available","update.title":"Update Available","update.dismiss":"Dismiss","update.managePacks":"Manage packs →","update.upgradeAll":"Upgrade everything","update.upgradeHint":"Updates the CLI, this desktop app, and every project — in one step.","update.upgrading":"Upgrading…","update.upgraded":"Upgrade complete.","update.relaunch":"Relaunch to finish","update.relaunchHint":"Quit and reopen dreamcontext to apply the new version.","update.upgradeFailed":"Upgrade failed.","update.retry":"Try again","upgradeRelaunch.countdown":"dreamcontext updated to v{version} — relaunching in {seconds}s to apply.","upgradeRelaunch.deferred":"dreamcontext v{version} is installed — relaunch to apply the update.","upgradeRelaunch.relaunching":"Relaunching to apply the update…","upgradeRelaunch.now":"Relaunch now","upgradeRelaunch.later":"Later","upgradeRelaunch.failed":"Couldn't relaunch automatically — quit and reopen dreamcontext to finish updating.","upgradeRelaunch.retry":"Try again","taxonomy.title":"Taxonomy","common.loading":"Loading...","common.error":"Error","common.empty":"Nothing here yet.","common.close":"Close","common.cancel":"Cancel","brain.sidebar.connect":"Connect GitHub","brain.sidebar.setup":"Set up team sync","brain.sidebar.synced":"Synced","brain.sidebar.syncedProject":"Project synced","brain.sidebar.syncing":"Syncing…","brain.sidebar.syncNowTip":"Sync now — pull teammates’ changes, then merge & push yours","brain.sidebar.settingsTip":"Cloud sync settings","brain.sidebar.refresh":"Sync now","brain.sidebar.refreshing":"Syncing…","brain.sidebar.refreshTip":"Pull and merge the latest team updates","brain.sidebar.refreshDone":"Synced ✓","brain.sidebar.refreshUpToDate":"Up to date ✓","brain.sidebar.refreshPulled":"Pulled {n} update(s) ✓","brain.sidebar.refreshPushed":"Synced ✓","brain.sidebar.refreshAwaitingAgent":"A teammate edited the same section — resolve it","brain.sidebar.refreshBlocked":"Sync blocked — possible secret found","brain.sidebar.refreshFailed":"Sync failed","brain.sidebar.resolveLabel":"A teammate edited the same section — Resolve with AI","brain.sidebar.resolveTip":"Launch the in-app agent to reconcile the overlapping edits (or copy the command)","brain.sync.failed":"Sync failed — see below","brain.sync.codeConflictShort":"Code conflict — resolve in your editor","brain.sync.userMergeShort":"Finish your git merge first","brain.sync.detachedShort":"Detached HEAD — check out a branch","brain.resolve.launching":"Launching Resolve agent…","brain.resolve.fallbackTitle":"Run this to reconcile with the team:","brain.resolve.copy":"Copy command","brain.resolve.copied":"Copied ✓","brain.code.title":"A teammate changed the same code","brain.code.hint":"Resolve the conflict markers in your editor, commit the merge, then sync.","brain.code.more":"+{n} more","brain.userMerge.title":"You have a git merge in progress","brain.userMerge.hint":"Finish (or abort) your own merge, then run sync again.","brain.recovery.reconnect":"Reconnect GitHub","brain.recovery.checkPerms":"Open Settings","brain.recovery.retry":"Retry sync","brain.recovery.openSettings":"Open Settings","brain.scrub.title":"Sync blocked — possible secret found","brain.scrub.ignore":"Add to .gitignore","brain.scrub.hint":"For a real source file, remove the secret instead of un-tracking it.","brain.checkpoint.note":"Checkpointed your local edits","brain.checkpoint.undo":"Undo: git reset --soft {sha}^","brain.scope.autoCheckpoint.label":"Auto-checkpoint local edits when the dashboard opens","brain.scope.autoCheckpoint.hint":"On open, uncommitted edits are committed as a clearly-labelled checkpoint before pulling teammates’ changes, so nothing is ever lost to a merge. Turn off to leave uncommitted work untouched (the on-open pull is skipped while your tree is dirty).","brain.auth.title":"GitHub sign-in","brain.auth.continueWithGithub":"Continue with GitHub","brain.auth.signedIn":"Signed in with GitHub","brain.auth.signedInAs":"Signed in as {login}","brain.auth.signOut":"Sign out","brain.auth.expired":"GitHub sign-in expired","brain.auth.expiredAs":"Signed in as {login} — session expired","brain.auth.expiredHint":"GitHub rejected your saved sign-in, so cloud sync can’t push or pull. Reconnect below to fix it — your local work is safe and nothing was lost.","brain.auth.scopeDisclosure":"This grants access to all your private repositories — GitHub does not offer a narrower scope for the device flow. If you would rather limit access to one repo, use a fine-grained personal access token instead.","brain.auth.device.hint":"Enter this code on GitHub to finish connecting.","brain.auth.device.open":"Open GitHub","brain.auth.device.waiting":"Waiting for you to approve on GitHub…","brain.auth.device.starting":"Starting…","brain.auth.device.denied":"Sign-in was denied on GitHub.","brain.auth.device.expired":"This code expired. Try again.","brain.auth.device.error":"Something went wrong signing in with GitHub.","brain.auth.oauthUnavailable":"Connect with a personal access token below. Create a fine-grained token limited to just your brain repo, with Contents read/write access, then paste it here.","brain.auth.pat.recommend":"Prefer a fine-grained token? Use a personal access token instead","brain.auth.pat.hide":"Hide token form","brain.auth.pat.hint":"Recommended for tighter scope: create a fine-grained personal access token limited to just the brain repo, with Contents read/write access, and paste it below.","brain.auth.pat.placeholder":"ghp_… or github_pat_…","brain.auth.pat.submit":"Connect","brain.auth.pat.submitting":"Connecting…","brain.cloudSync.label":"Cloud sync","brain.cloudSync.hint":"Sync your whole project (code + brain) to its GitHub repo so your team can share it.","brain.cloudSync.desc":"When on, dreamcontext syncs the entire project folder — your code, .claude, and the brain — to this project’s GitHub origin on your current branch (fetch, merge, commit, push). When off, the brain is still committed inside your code repo, but never pushed on its own. Needs a GitHub origin on this project.","brain.cloudSync.error":"Could not turn on cloud sync.","brain.cloudSync.source.explicit":"set here","brain.cloudSync.source.derived":"from config","brain.origin.title":"This project has no GitHub repo yet","brain.origin.desc":"Cloud sync pushes your whole project to its GitHub origin. Create a new repo or connect an existing one to set it up.","brain.origin.tab.create":"Create new","brain.origin.tab.attach":"Connect existing","brain.origin.namePlaceholder":"Repository name (defaults to the project folder)","brain.origin.private":"Private repository","brain.origin.publicWarn":"A public repo means anyone can read your code and brain. Only do this on purpose.","brain.origin.createBtn":"Create & connect","brain.origin.creating":"Creating…","brain.origin.urlPlaceholder":"https://github.com/owner/repo","brain.origin.attachHint":"Paste an existing GitHub repo (ideally empty) to use as this project’s origin.","brain.origin.attachBtn":"Connect","brain.origin.attaching":"Connecting…","brain.origin.connected":"Connected to {repo}","brain.origin.firstSyncOk":"Your project was pushed to GitHub. Cloud sync is on.","brain.origin.firstSyncFailed":"Origin connected, but the first sync needs attention.","brain.origin.connectedTitle":"Connected repo","brain.origin.changeBtn":"Change","brain.origin.changeHint":"Re-point this project’s origin at a different GitHub repo. Cloud sync turns off so nothing pushes until you turn it back on.","brain.origin.updateBtn":"Update repo","brain.origin.updating":"Updating…","brain.origin.detachBtn":"Disconnect","brain.origin.detachWarn":"This removes the git origin and turns cloud sync off. Your local files are untouched.","brain.origin.detachConfirm":"Disconnect","brain.origin.detaching":"Disconnecting…","brain.team.title":"Team updates","brain.team.updates":"{n} updates","brain.team.updatesShort":"updates","brain.team.pending":"Update pending","brain.team.awaitingAgent":"Awaiting agent merge","brain.team.checkNow":"Check now","brain.team.checking":"Checking…","linkedRepos.title":"Linked repos","linkedRepos.desc":"The bare code repos this brain governs. The name + GitHub URL are shared with your team; each machine maps them to its own local path, which never leaves this computer.","linkedRepos.empty":"No linked repos yet. Bind a local checkout to start governing a code repo.","linkedRepos.missing":"Not on this machine yet","linkedRepos.clone":"Clone","linkedRepos.cloneConfirm":"Clone anyway","linkedRepos.cloning":"Cloning…","linkedRepos.trustWarn":"This URL comes from the shared config — clone only if you trust it.","linkedRepos.unlink":"Unlink","linkedRepos.add":"Add","linkedRepos.adding":"Adding…","linkedRepos.namePlaceholder":"Name (e.g. api), then pick its folder"}},RB=B.createContext(null);function sN({children:r}){const[e,i]=B.useState("en"),n=s=>{var o;return((o=w7[e])==null?void 0:o[s])??s};return a.jsx(RB.Provider,{value:{locale:e,setLocale:i,t:n},children:r})}function wr(){const r=B.useContext(RB);if(!r)throw new Error("useI18n must be used within I18nProvider");return r}function k7({vaultName:r,compact:e}){const{t:i}=wr(),{data:n}=SB(),s=TB(),[o,h]=B.useState(!1),l=r?(n??[]).filter(f=>f.name===r):n??[],u=l.reduce((f,m)=>f+(m.updates??0),0),d=l.some(f=>f.pendingAgentMerge);if(u===0&&!d)return null;const g=()=>s.mutate(r);return a.jsxs("div",{className:"update-badge team-updates-badge",children:[a.jsxs("button",{type:"button",className:"update-badge-trigger",onClick:()=>h(f=>!f),"aria-expanded":o,title:i("brain.team.title"),children:[a.jsx("span",{className:"update-badge-dot"}),!e&&a.jsx("span",{className:"update-badge-label",children:d?i("brain.team.pending"):i("brain.team.updates").replace("{n}",String(u))}),e&&a.jsx("span",{className:"update-badge-label",children:u})]}),o&&a.jsxs("div",{className:"update-badge-popover team-updates-popover",children:[a.jsxs("div",{className:"update-badge-popover-header",children:[a.jsx("span",{className:"update-badge-popover-title",children:i("brain.team.title")}),a.jsx("button",{className:"update-badge-dismiss",onClick:()=>h(!1),"aria-label":i("update.dismiss"),children:"×"})]}),a.jsx("div",{className:"update-badge-content",children:a.jsx("ul",{className:"team-updates-list",children:l.map(f=>a.jsxs("li",{className:"team-updates-item",children:[a.jsx("span",{className:"team-updates-vault",children:f.name}),a.jsx("span",{className:"team-updates-count",children:f.pendingAgentMerge?i("brain.team.awaitingAgent"):`${f.updates} ${i("brain.team.updatesShort")}`})]},f.name))})}),a.jsx("button",{className:"update-badge-action",onClick:g,disabled:s.isPending,children:s.isPending?i("brain.team.checking"):i("brain.team.checkNow")})]})]})}const S7=["name","description","targetUser","stack","priority","platforms","packs","review"],T7=["path","description","targetUser","stack","priority","platforms","packs","review"],E7=["path","platforms","packs","review"],w0={name:{label:"What is this project called?",hint:"Used as the folder name and the vault name."},description:{label:"One line — what is it?",hint:"A short description. Optional.",optional:!0},targetUser:{label:"Who is it for?",hint:"The target user. Optional.",optional:!0},stack:{label:"Tech stack?",hint:"Comma-separated. Auto-detected for existing folders. Optional.",optional:!0},priority:{label:"Current focus?",hint:"What you are working on right now. Optional.",optional:!0}};function N7({onClose:r,onReady:e}){const i=Yz(),n=Zz(),s=Xz(),o=Vz(),[h,l]=B.useState(null),[u,d]=B.useState(0),[g,f]=B.useState(null),[m,y]=B.useState(null),[w,_]=B.useState(null),[b,x]=B.useState(!1),[C,k]=B.useState(""),[T,N]=B.useState(""),[A,j]=B.useState(""),[E,L]=B.useState(""),[O,D]=B.useState(""),[K,z]=B.useState(""),[H,P]=B.useState(""),[$,W]=B.useState(["claude"]),[V,F]=B.useState([]),[G,U]=B.useState(!1),X=B.useRef(null);function ee(Ne,he,He){he(Ne.includes(He)?Ne.filter(ut=>ut!==He):[...Ne,He])}B.useEffect(()=>{var Ne;h==="new"&&!T&&((Ne=i.data)!=null&&Ne.defaultParent)&&N(i.data.defaultParent)},[h,T,i.data]);const re=h==="existing"?G?E7:T7:S7,le=re[u];B.useEffect(()=>{var Ne;(Ne=X.current)==null||Ne.focus()},[le,h]);function fe(Ne){l(Ne),d(0),f(null)}async function ie(Ne){f(null);const he=await AB();if(he){if(Ne==="parent"){N(he);return}j(he);try{const He=await Qz(he);if(k(He.name),!K&&He.stack&&z(He.stack),U(He.hasContext),He.hasContext){try{await o.mutateAsync({name:He.name,path:he})}catch(ut){const zt=ut instanceof Error?ut.message:String(ut);if(!/already registered/i.test(zt))throw ut}e(He.name);return}d(1)}catch(He){f(He instanceof Error?He.message:String(He))}}}const I=B.useMemo(()=>le==="name"?C.trim().length>0&&T.trim().length>0:le==="path"?A.trim().length>0:!0,[le,C,T,A]);function Z(){f(null),u<re.length-1&&d(Ne=>Ne+1)}function J(){f(null),u>0?d(Ne=>Ne-1):l(null)}async function ne(){f(null);const Ne=h==="existing"?{mode:"existing",name:C.trim(),projectPath:A.trim()}:{mode:"new",name:C.trim(),parentDir:T.trim()};Ne.description=E.trim()||void 0,Ne.targetUser=O.trim()||void 0,Ne.stack=K.trim()||void 0,Ne.priority=H.trim()||void 0,Ne.platforms=$.length>0?$:void 0,Ne.packs=V.length>0?V:void 0;try{const he=await s.mutateAsync(Ne);y(he.vault),_(he.cli??null)}catch(he){f(he instanceof Error?he.message:String(he))}}const ce="Enrich my dreamcontext: scan the codebase and fill soul, memory, and tech_stack with real detail, then propose initial feature PRDs and a first task. No placeholders.";async function xe(){try{await navigator.clipboard.writeText(ce),x(!0),setTimeout(()=>x(!1),1500)}catch{f("Could not copy to clipboard.")}}function Ve(Ne,he,He){return a.jsx("input",{ref:X,type:"text",className:"wiz-input",value:Ne,placeholder:He,onChange:ut=>he(ut.target.value),onKeyDown:ut=>{ut.key==="Enter"&&I&&Z()}})}function We(){var Lt,qt,mt;if(m)return a.jsxs("div",{className:"wiz-success",children:[a.jsx("div",{className:"wiz-success-check","aria-hidden":!0,children:"✓"}),a.jsxs("h2",{className:"wiz-q",children:["“",m.name,"” is ready"]}),a.jsx("p",{className:"wiz-hint",children:m.path}),(w==null?void 0:w.status)==="installed"&&a.jsx("p",{className:"wiz-hint",children:"Installed the dreamcontext CLI from npm so your hooks work."}),(w==null?void 0:w.status)==="failed"&&a.jsx("div",{className:"wiz-error",children:w.message??"Run: npm install -g dreamcontext"}),a.jsxs("div",{className:"wiz-handoff",children:[a.jsx("div",{className:"wiz-handoff-title",children:"Next: enrich it in Claude Code"}),a.jsx("p",{className:"wiz-hint",children:"The skeleton is in place. Open this project in Claude Code and paste the prompt below so the agent can scan your code and fill in real context."}),a.jsx("pre",{className:"wiz-handoff-prompt",children:ce}),a.jsx("button",{type:"button",className:"wiz-btn",onClick:xe,children:b?"Copied ✓":"Copy prompt"})]}),a.jsxs("div",{className:"wiz-actions",children:[a.jsx("button",{type:"button",className:"wiz-btn",onClick:r,children:"Close"}),a.jsx("button",{type:"button",className:"wiz-btn wiz-btn-primary",onClick:()=>e(m.name),children:"Open project →"})]})]});if(h===null)return a.jsxs("div",{children:[a.jsx("h2",{className:"wiz-q",children:"Add a project"}),a.jsx("p",{className:"wiz-hint",children:"Create something new, or set up a folder you already have."}),a.jsxs("div",{className:"wiz-choices",children:[a.jsxs("button",{type:"button",className:"wiz-choice",onClick:()=>fe("new"),children:[a.jsx("span",{className:"wiz-choice-title",children:"Create new"}),a.jsx("span",{className:"wiz-hint",children:"Make a new folder and initialize dreamcontext in it."})]}),a.jsxs("button",{type:"button",className:"wiz-choice",onClick:()=>fe("existing"),children:[a.jsx("span",{className:"wiz-choice-title",children:"Open existing"}),a.jsx("span",{className:"wiz-hint",children:"Pick a folder on your Mac and set up dreamcontext there."})]})]})]});if(le==="path")return a.jsxs("div",{children:[a.jsx("h2",{className:"wiz-q",children:"Which folder?"}),a.jsx("p",{className:"wiz-hint",children:"Choose the project folder. If it's already a dreamcontext project, it opens straight away."}),a.jsxs("div",{className:"wiz-row",children:[a.jsx("input",{className:"wiz-input",type:"text",value:A,readOnly:!0,placeholder:"No folder chosen"}),a.jsx("button",{type:"button",className:"wiz-btn",onClick:()=>ie("project"),children:s.isPending?"Working…":"Browse…"})]})]});if(le==="name")return a.jsxs("div",{children:[a.jsx("h2",{className:"wiz-q",children:w0.name.label}),a.jsx("p",{className:"wiz-hint",children:w0.name.hint}),Ve(C,k,"my-project"),a.jsx("label",{className:"wiz-sublabel",children:"Where should it live?"}),a.jsxs("div",{className:"wiz-row",children:[a.jsx("input",{className:"wiz-input",type:"text",value:T,placeholder:((Lt=i.data)==null?void 0:Lt.defaultParent)??"~/projects",onChange:Te=>N(Te.target.value)}),a.jsx("button",{type:"button",className:"wiz-btn",onClick:()=>ie("parent"),children:"Browse…"})]}),C.trim()&&T.trim()&&a.jsxs("p",{className:"wiz-hint wiz-preview",children:["Creates: ",T.replace(/\/+$/,""),"/",C.trim()]})]});if(le==="review")return a.jsxs("div",{children:[a.jsx("h2",{className:"wiz-q",children:"Ready to set up"}),a.jsxs("dl",{className:"wiz-review",children:[a.jsx("dt",{children:"Name"}),a.jsx("dd",{children:C.trim()}),a.jsx("dt",{children:"Location"}),a.jsx("dd",{children:h==="new"?`${T.replace(/\/+$/,"")}/${C.trim()}`:A}),E.trim()&&a.jsxs(a.Fragment,{children:[a.jsx("dt",{children:"Description"}),a.jsx("dd",{children:E.trim()})]}),O.trim()&&a.jsxs(a.Fragment,{children:[a.jsx("dt",{children:"For"}),a.jsx("dd",{children:O.trim()})]}),K.trim()&&a.jsxs(a.Fragment,{children:[a.jsx("dt",{children:"Stack"}),a.jsx("dd",{children:K.trim()})]}),H.trim()&&a.jsxs(a.Fragment,{children:[a.jsx("dt",{children:"Focus"}),a.jsx("dd",{children:H.trim()})]}),a.jsx("dt",{children:"Platforms"}),a.jsx("dd",{children:($.length>0?$:["claude"]).map(Te=>{var Ie,Be;return((Be=(Ie=n.data)==null?void 0:Ie.platforms.find(Je=>Je.id===Te))==null?void 0:Be.label)??Te}).join(", ")}),V.length>0&&a.jsxs(a.Fragment,{children:[a.jsx("dt",{children:"Skill packs"}),a.jsx("dd",{children:V.join(", ")})]})]})]});if(le==="platforms"){const Te=((qt=n.data)==null?void 0:qt.platforms)??[];return a.jsxs("div",{children:[a.jsx("h2",{className:"wiz-q",children:"Which agent platforms?"}),a.jsx("p",{className:"wiz-hint",children:"Where dreamcontext installs its skills, agents, and hooks. Pick one or more."}),a.jsx("div",{className:"wiz-choices",children:Te.map(Ie=>{const Be=$.includes(Ie.id);return a.jsxs("button",{type:"button",className:`wiz-choice wiz-select${Be?" wiz-select-on":""}`,onClick:()=>ee($,W,Ie.id),"aria-pressed":Be,children:[a.jsxs("span",{className:"wiz-choice-title",children:[Ie.label,Ie.recommended&&a.jsx("span",{className:"wiz-badge",children:"Recommended"})]}),a.jsx("span",{className:"wiz-hint",children:Ie.description})]},Ie.id)})}),$.length===0&&a.jsx("p",{className:"wiz-hint wiz-preview",children:"Nothing selected — defaults to Claude."})]})}if(le==="packs"){const Te=((mt=n.data)==null?void 0:mt.packs)??[];return a.jsxs("div",{children:[a.jsx("h2",{className:"wiz-q",children:"Add skill packs?"}),a.jsx("p",{className:"wiz-hint",children:"Optional curated skills for your agent. You can add more later. Skip if unsure."}),Te.length===0?a.jsx("p",{className:"wiz-hint",children:"No optional packs available."}):a.jsx("div",{className:"wiz-choices",children:Te.map(Ie=>{const Be=V.includes(Ie.name);return a.jsxs("button",{type:"button",className:`wiz-choice wiz-select${Be?" wiz-select-on":""}`,onClick:()=>ee(V,F,Ie.name),"aria-pressed":Be,children:[a.jsxs("span",{className:"wiz-choice-title",children:[a.jsx("span",{className:"wiz-check","aria-hidden":!0,children:Be?"☑":"☐"})," ",Ie.name]}),a.jsx("span",{className:"wiz-hint",children:Ie.description})]},Ie.name)})})]})}const he=w0[le],He={description:[E,L,"A persistent brain for AI agents…"],targetUser:[O,D,"Developers"],stack:[K,z,"TypeScript, React, Node…"],priority:[H,P,"Initial setup"]},[ut,zt,At]=He[le];return a.jsxs("div",{children:[a.jsx("h2",{className:"wiz-q",children:he.label}),a.jsx("p",{className:"wiz-hint",children:he.hint}),Ve(ut,zt,At)]})}const et=le==="review",de=h!==null&&le!=="path"&&!m;return a.jsx("div",{className:"wiz-overlay",role:"dialog","aria-modal":"true",onClick:r,children:a.jsxs("div",{className:"wiz-modal",onClick:Ne=>Ne.stopPropagation(),children:[a.jsx("button",{type:"button",className:"wiz-close",onClick:r,"aria-label":"Close",children:"×"}),a.jsx("div",{className:"wiz-body",children:We()}),g&&a.jsx("div",{className:"wiz-error",children:g}),de&&a.jsxs("div",{className:"wiz-actions",children:[a.jsx("button",{type:"button",className:"wiz-btn",onClick:J,children:"Back"}),et?a.jsx("button",{type:"button",className:"wiz-btn wiz-btn-primary",onClick:ne,disabled:s.isPending||!C.trim(),children:s.isPending?"Setting up…":"Set up project"}):a.jsx("button",{type:"button",className:"wiz-btn wiz-btn-primary",onClick:Z,disabled:!I,children:"Next"})]})]})})}function j7(r,e){var i=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(i!=null){var n,s,o,h,l=[],u=!0,d=!1;try{if(o=(i=i.call(r)).next,e===0){if(Object(i)!==i)return;u=!1}else for(;!(u=(n=o.call(i)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(g){d=!0,s=g}finally{try{if(!u&&i.return!=null&&(h=i.return(),Object(h)!==h))return}finally{if(d)throw s}}return l}}function A7(r,e,i){return e=F7(e),e in r?Object.defineProperty(r,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):r[e]=i,r}function aN(r,e){return R7(r)||j7(r,e)||BB(r,e)||D7()}function M7(r){return L7(r)||B7(r)||BB(r)||O7()}function L7(r){if(Array.isArray(r))return H_(r)}function R7(r){if(Array.isArray(r))return r}function B7(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function BB(r,e){if(r){if(typeof r=="string")return H_(r,e);var i=Object.prototype.toString.call(r).slice(8,-1);if(i==="Object"&&r.constructor&&(i=r.constructor.name),i==="Map"||i==="Set")return Array.from(r);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return H_(r,e)}}function H_(r,e){(e==null||e>r.length)&&(e=r.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=r[i];return n}function O7(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
51
51
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function D7(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
52
52
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function I7(r,e){if(typeof r!="object"||r===null)return r;var i=r[Symbol.toPrimitive];if(i!==void 0){var n=i.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function F7(r){var e=I7(r,"string");return typeof e=="symbol"?e:String(e)}var $7=function(e,i){var n=new Set(i);return Object.assign.apply(Object,[{}].concat(M7(Object.entries(e).filter(function(s){var o=aN(s,1),h=o[0];return!n.has(h)}).map(function(s){var o=aN(s,2),h=o[0],l=o[1];return A7({},h,l)}))))};function U_(r,e){(e==null||e>r.length)&&(e=r.length);for(var i=0,n=Array(e);i<e;i++)n[i]=r[i];return n}function P7(r){if(Array.isArray(r))return r}function z7(r){if(Array.isArray(r))return U_(r)}function q7(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function H7(r,e){var i=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(i!=null){var n,s,o,h,l=[],u=!0,d=!1;try{if(o=(i=i.call(r)).next,e!==0)for(;!(u=(n=o.call(i)).done)&&(l.push(n.value),l.length!==e);u=!0);}catch(g){d=!0,s=g}finally{try{if(!u&&i.return!=null&&(h=i.return(),Object(h)!==h))return}finally{if(d)throw s}}return l}}function U7(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
53
53
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function W7(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
@@ -444,8 +444,8 @@ Please report this to https://github.com/markedjs/marked.`,e){let s="<p>An error
444
444
  L0,20`)},"requirement_arrow"),Ene=q((r,e,i)=>{const n=si(),{themeVariables:s}=n,{strokeWidth:o}=s;r.append("defs").append("marker").attr("id",i+"_"+e+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("stroke-width",`${o}`).attr("viewBox","0 0 25 20").append("path").attr("d",`M0,0
445
445
  L20,10
446
446
  M20,10
447
- L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),Nne=q((r,e,i)=>{const n=r.append("defs").append("marker").attr("id",i+"_"+e+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");n.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),n.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),n.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),jne=q((r,e,i)=>{const n=si(),{themeVariables:s}=n,{strokeWidth:o}=s,h=r.append("defs").append("marker").attr("id",i+"_"+e+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");h.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),h.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),h.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),h.selectAll("*").attr("stroke-width",`${o}`)},"requirement_contains_neo"),Ane={extension:lne,composition:cne,aggregation:hne,dependency:une,lollipop:dne,point:fne,circle:pne,cross:gne,barb:mne,barbNeo:yne,only_one:bne,zero_or_one:vne,one_or_more:xne,zero_or_more:_ne,only_one_neo:Cne,zero_or_one_neo:wne,one_or_more_neo:kne,zero_or_more_neo:Sne,requirement_arrow:Tne,requirement_contains:Nne,requirement_arrow_neo:Ene,requirement_contains_neo:jne},Mne=one,Lne={common:Yf,getConfig:si,insertCluster:jie,insertEdge:ane,insertEdgeLabel:ene,insertMarkers:Mne,insertNode:i6,interpolateToCurve:tk,labelHelper:tr,log:tt,positionEdgeLabel:tne},Lf={},o6=q(r=>{for(const e of r)Lf[e.name]=e},"registerLayoutLoaders"),Rne=q(()=>{o6([{name:"dagre",loader:q(async()=>await Zt(()=>import("./dagre-KV5264BT-Jz3whjk4.js"),__vite__mapDeps([6,7,8,9,10,11])),"loader")},{name:"cose-bilkent",loader:q(async()=>await Zt(()=>import("./cose-bilkent-S5V4N54A-CTQIwiIq.js"),__vite__mapDeps([12,13])),"loader")}])},"registerDefaultLayoutLoaders");Rne();var Qye=q(async(r,e)=>{if(!(r.layoutAlgorithm in Lf))throw new Error(`Unknown layout algorithm: ${r.layoutAlgorithm}`);if(r.diagramId)for(const g of r.nodes){const f=g.domId||g.id;g.domId=`${r.diagramId}-${f}`}const i=Lf[r.layoutAlgorithm],n=await i.loader(),{theme:s,themeVariables:o}=r.config,{useGradient:h,gradientStart:l,gradientStop:u}=o,d=e.attr("id");if(e.append("defs").append("filter").attr("id",`${d}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${s!=null&&s.includes("dark")?"#FFFFFF":"#000000"}`),e.append("defs").append("filter").attr("id",`${d}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${s!=null&&s.includes("dark")?"#FFFFFF":"#000000"}`),h){const g=e.append("linearGradient").attr("id",e.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");g.append("svg:stop").attr("offset","0%").attr("stop-color",l).attr("stop-opacity",1),g.append("svg:stop").attr("offset","100%").attr("stop-color",u).attr("stop-opacity",1)}return n.render(r,e,Lne,{algorithm:i.algorithm})},"render"),Jye=q((r="",{fallback:e="dagre"}={})=>{if(r in Lf)return r;if(e in Lf)return tt.warn(`Layout algorithm ${r} is not registered. Using ${e} as fallback.`),e;throw new Error(`Both layout algorithms ${r} and ${e} are not registered.`)},"getRegisteredLayoutAlgorithm"),l6="comm",c6="rule",h6="decl",Bne="@import",One="@namespace",Dne="@keyframes",Ine="@layer",Fne=Math.abs,pf=String.fromCharCode;function u6(r){return r.trim()}function sC(r,e,i){return r.replace(e,i)}function jh(r,e){return r.charCodeAt(e)|0}function cu(r,e,i){return r.slice(e,i)}function Ys(r){return r.length}function $ne(r){return r.length}function Mg(r,e){return e.push(r),r}var ib=1,hu=1,d6=0,ps=0,vi=0,xu="";function Ck(r,e,i,n,s,o,h,l){return{value:r,root:e,parent:i,type:n,props:s,children:o,line:ib,column:hu,length:h,return:"",siblings:l}}function Pne(){return vi}function zne(){return vi=ps>0?jh(xu,--ps):0,hu--,vi===10&&(hu=1,ib--),vi}function js(){return vi=ps<d6?jh(xu,ps++):0,hu++,vi===10&&(hu=1,ib++),vi}function Uo(){return jh(xu,ps)}function Cm(){return ps}function nb(r,e){return cu(xu,r,e)}function Rf(r){switch(r){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function qne(r){return ib=hu=1,d6=Ys(xu=r),ps=0,[]}function Hne(r){return xu="",r}function ix(r){return u6(nb(ps-1,aC(r===91?r+2:r===40?r+1:r)))}function Une(r){for(;(vi=Uo())&&vi<33;)js();return Rf(r)>2||Rf(vi)>3?"":" "}function Wne(r,e){for(;--e&&js()&&!(vi<48||vi>102||vi>57&&vi<65||vi>70&&vi<97););return nb(r,Cm()+(e<6&&Uo()==32&&js()==32))}function aC(r){for(;js();)switch(vi){case r:return ps;case 34:case 39:r!==34&&r!==39&&aC(vi);break;case 40:r===41&&aC(r);break;case 92:js();break}return ps}function Gne(r,e){for(;js()&&r+vi!==57;)if(r+vi===84&&Uo()===47)break;return"/*"+nb(e,ps-1)+"*"+pf(r===47?r:js())}function Kne(r){for(;!Rf(Uo());)js();return nb(r,ps)}function Vne(r){return Hne(wm("",null,null,null,[""],r=qne(r),0,[0],r))}function wm(r,e,i,n,s,o,h,l,u){for(var d=0,g=0,f=h,m=0,y=0,w=0,_=1,b=1,x=1,C=0,k=0,T="",N=s,A=o,j=n,E=T;b;)switch(w=k,k=js()){case 40:w!=108&&jh(E,f-1)==58?(C++,E+="("):E+=ix(k);break;case 41:C--,E+=")";break;case 34:case 39:case 91:E+=ix(k);break;case 9:case 10:case 13:case 32:if(C>0){E+=pf(k);break}E+=Une(w);break;case 92:E+=Wne(Cm()-1,7);continue;case 47:switch(Uo()){case 42:case 47:Mg(Yne(Gne(js(),Cm()),e,i,u),u),(Rf(w||1)==5||Rf(Uo()||1)==5)&&Ys(E)&&cu(E,-1,void 0)!==" "&&(E+=" ");break;default:E+="/"}break;case 123*_:l[d++]=Ys(E)*x;case 125*_:case 59:case 0:if(C>0&&k){E+=pf(k);break}switch(k){case 0:case 125:b=0;case 59+g:x==-1&&(E=sC(E,/\f/g,"")),y>0&&(Ys(E)-f||_===0)&&Mg(y>32?oM(E+";",n,i,f-1,u):oM(sC(E," ","")+";",n,i,f-2,u),u);break;case 59:E+=";";default:if(Mg(j=aM(E,e,i,d,g,s,l,T,N=[],A=[],f,o),o),k===123)if(g===0)wm(E,e,j,j,N,o,f,l,A);else{switch(m){case 99:if(jh(E,3)===110)break;case 108:if(jh(E,2)===97)break;default:g=0;case 100:case 109:case 115:}g?wm(r,j,j,n&&Mg(aM(r,j,j,0,0,s,l,T,s,N=[],f,A),A),s,A,f,l,n?N:A):wm(E,j,j,j,[""],A,0,l,A)}}d=g=y=0,_=x=1,T=E="",f=h;break;case 58:f=1+Ys(E),y=w;default:if(_<1){if(k==123)--_;else if(k==125&&_++==0&&zne()==125)continue}switch(E+=pf(k),k*_){case 38:x=g>0?1:(E+="\f",-1);break;case 44:if(C>0)break;l[d++]=(Ys(E)-1)*x,x=1;break;case 64:Uo()===45&&(E+=ix(js())),m=Uo(),g=f=Ys(T=E+=Kne(Cm())),k++;break;case 45:w===45&&Ys(E)==2&&(_=0)}}return o}function aM(r,e,i,n,s,o,h,l,u,d,g,f){for(var m=s-1,y=s===0?o:[""],w=$ne(y),_=0,b=0,x=0;_<n;++_)for(var C=0,k=cu(r,m+1,m=Fne(b=h[_])),T=r;C<w;++C)(T=u6(b>0?y[C]+" "+k:sC(k,/&\f/g,y[C])))&&(u[x++]=T);return Ck(r,e,i,s===0?c6:l,u,d,g,f)}function Yne(r,e,i,n){return Ck(r,e,i,l6,pf(Pne()),cu(r,2,-2),0,n)}function oM(r,e,i,n,s){return Ck(r,e,i,h6,cu(r,0,n),cu(r,n+1,-1),n,s)}function oC(r,e){for(var i="",n=0;n<r.length;n++)i+=e(r[n],n,r,e)||"";return i}function Xne(r,e,i,n){switch(r.type){case Ine:if(r.children.length)break;case Bne:case One:case h6:return r.return=r.return||r.value;case l6:return"";case Dne:return r.return=r.value+"{"+oC(r.children,n)+"}";case c6:if(!Ys(r.value=r.props.join(",")))return""}return Ys(i=oC(r.children,n))?r.return=r.value+"{"+i+"}":""}var f6="c4",Zne=q(r=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(r),"detector"),Qne=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./c4Diagram-AHTNJAMY-DXmGhsoH.js");return{diagram:e}},__vite__mapDeps([14,15]));return{id:f6,diagram:r}},"loader"),Jne={id:f6,detector:Zne,loader:Qne},ese=Jne,p6="flowchart",tse=q((r,e)=>{var i,n;return((i=e==null?void 0:e.flowchart)==null?void 0:i.defaultRenderer)==="dagre-wrapper"||((n=e==null?void 0:e.flowchart)==null?void 0:n.defaultRenderer)==="elk"?!1:/^\s*graph/.test(r)},"detector"),rse=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./flowDiagram-DWJPFMVM-BFdWnw5h.js");return{diagram:e}},__vite__mapDeps([16,17,15,18,19,20]));return{id:p6,diagram:r}},"loader"),ise={id:p6,detector:tse,loader:rse},nse=ise,g6="flowchart-v2",sse=q((r,e)=>{var i,n,s;return((i=e==null?void 0:e.flowchart)==null?void 0:i.defaultRenderer)==="dagre-d3"?!1:(((n=e==null?void 0:e.flowchart)==null?void 0:n.defaultRenderer)==="elk"&&(e.layout="elk"),/^\s*graph/.test(r)&&((s=e==null?void 0:e.flowchart)==null?void 0:s.defaultRenderer)==="dagre-wrapper"?!0:/^\s*flowchart/.test(r))},"detector"),ase=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./flowDiagram-DWJPFMVM-BFdWnw5h.js");return{diagram:e}},__vite__mapDeps([16,17,15,18,19,20]));return{id:g6,diagram:r}},"loader"),ose={id:g6,detector:sse,loader:ase},lse=ose,m6="er",cse=q(r=>/^\s*erDiagram/.test(r),"detector"),hse=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./erDiagram-SMLLAGMA-CXAkwxcx.js");return{diagram:e}},__vite__mapDeps([21,18,19,20]));return{id:m6,diagram:r}},"loader"),use={id:m6,detector:cse,loader:hse},dse=use,y6="gitGraph",fse=q(r=>/^\s*gitGraph/.test(r),"detector"),pse=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./gitGraphDiagram-UUTBAWPF-DURiCXR8.js");return{diagram:e}},__vite__mapDeps([22,23,24,25,10,8]));return{id:y6,diagram:r}},"loader"),gse={id:y6,detector:fse,loader:pse},mse=gse,b6="gantt",yse=q(r=>/^\s*gantt/.test(r),"detector"),bse=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./ganttDiagram-T4ZO3ILL-DFf9_pss.js");return{diagram:e}},__vite__mapDeps([26,27,28]));return{id:b6,diagram:r}},"loader"),vse={id:b6,detector:yse,loader:bse},xse=vse,v6="info",_se=q(r=>/^\s*info/.test(r),"detector"),Cse=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./infoDiagram-42DDH7IO-BPiW3Ij4.js");return{diagram:e}},__vite__mapDeps([29,25,10,8]));return{id:v6,diagram:r}},"loader"),wse={id:v6,detector:_se,loader:Cse},x6="pie",kse=q(r=>/^\s*pie/.test(r),"detector"),Sse=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./pieDiagram-DEJITSTG-CCVGHDYA.js");return{diagram:e}},__vite__mapDeps([30,23,25,10,8,31]));return{id:x6,diagram:r}},"loader"),Tse={id:x6,detector:kse,loader:Sse},_6="quadrantChart",Ese=q(r=>/^\s*quadrantChart/.test(r),"detector"),Nse=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./quadrantDiagram-34T5L4WZ-DPRv7LNW.js");return{diagram:e}},__vite__mapDeps([32,27,28]));return{id:_6,diagram:r}},"loader"),jse={id:_6,detector:Ese,loader:Nse},Ase=jse,C6="xychart",Mse=q(r=>/^\s*xychart(-beta)?/.test(r),"detector"),Lse=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./xychartDiagram-5P7HB3ND-Bt41FbXl.js");return{diagram:e}},__vite__mapDeps([33,27,28]));return{id:C6,diagram:r}},"loader"),Rse={id:C6,detector:Mse,loader:Lse},Bse=Rse,w6="requirement",Ose=q(r=>/^\s*requirement(Diagram)?/.test(r),"detector"),Dse=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./requirementDiagram-MS252O5E-6bTSQFfr.js");return{diagram:e}},__vite__mapDeps([34,18,19]));return{id:w6,diagram:r}},"loader"),Ise={id:w6,detector:Ose,loader:Dse},Fse=Ise,k6="sequence",$se=q(r=>/^\s*sequenceDiagram/.test(r),"detector"),Pse=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./sequenceDiagram-FGHM5R23-DANhN4OD.js");return{diagram:e}},__vite__mapDeps([35,15,24]));return{id:k6,diagram:r}},"loader"),zse={id:k6,detector:$se,loader:Pse},qse=zse,S6="class",Hse=q((r,e)=>{var i;return((i=e==null?void 0:e.class)==null?void 0:i.defaultRenderer)==="dagre-wrapper"?!1:/^\s*classDiagram/.test(r)},"detector"),Use=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./classDiagram-6PBFFD2Q-Docm0aN-.js");return{diagram:e}},__vite__mapDeps([36,37,17,15,18,19]));return{id:S6,diagram:r}},"loader"),Wse={id:S6,detector:Hse,loader:Use},Gse=Wse,T6="classDiagram",Kse=q((r,e)=>{var i;return/^\s*classDiagram/.test(r)&&((i=e==null?void 0:e.class)==null?void 0:i.defaultRenderer)==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(r)},"detector"),Vse=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./classDiagram-v2-HSJHXN6E-Docm0aN-.js");return{diagram:e}},__vite__mapDeps([38,37,17,15,18,19]));return{id:T6,diagram:r}},"loader"),Yse={id:T6,detector:Kse,loader:Vse},Xse=Yse,E6="state",Zse=q((r,e)=>{var i;return((i=e==null?void 0:e.state)==null?void 0:i.defaultRenderer)==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(r)},"detector"),Qse=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./stateDiagram-FHFEXIEX-CpuW4o5E.js");return{diagram:e}},__vite__mapDeps([39,40,18,19,7,8,9,10]));return{id:E6,diagram:r}},"loader"),Jse={id:E6,detector:Zse,loader:Qse},eae=Jse,N6="stateDiagram",tae=q((r,e)=>{var i;return!!(/^\s*stateDiagram-v2/.test(r)||/^\s*stateDiagram/.test(r)&&((i=e==null?void 0:e.state)==null?void 0:i.defaultRenderer)==="dagre-wrapper")},"detector"),rae=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./stateDiagram-v2-QKLJ7IA2-hI3OGuUV.js");return{diagram:e}},__vite__mapDeps([41,40,18,19]));return{id:N6,diagram:r}},"loader"),iae={id:N6,detector:tae,loader:rae},nae=iae,j6="journey",sae=q(r=>/^\s*journey/.test(r),"detector"),aae=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./journeyDiagram-VCZTEJTY-BDsJYpXT.js");return{diagram:e}},__vite__mapDeps([42,17,15,31]));return{id:j6,diagram:r}},"loader"),oae={id:j6,detector:sae,loader:aae},lae=oae,cae=q((r,e,i)=>{tt.debug(`rendering svg for syntax error
448
- `);const n=xee(e),s=n.append("g");n.attr("viewBox","0 0 2412 512"),z5(n,100,512,!0),s.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),s.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),s.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),s.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),s.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),s.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),s.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),s.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${i}`)},"draw"),A6={draw:cae},hae=A6,uae={db:{},renderer:A6,parser:{parse:q(()=>{},"parse")}},dae=uae,M6="flowchart-elk",fae=q((r,e={})=>{var i;return/^\s*flowchart-elk/.test(r)||/^\s*(flowchart|graph)/.test(r)&&((i=e==null?void 0:e.flowchart)==null?void 0:i.defaultRenderer)==="elk"?(e.layout="elk",!0):!1},"detector"),pae=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./flowDiagram-DWJPFMVM-BFdWnw5h.js");return{diagram:e}},__vite__mapDeps([16,17,15,18,19,20]));return{id:M6,diagram:r}},"loader"),gae={id:M6,detector:fae,loader:pae},mae=gae,L6="timeline",yae=q(r=>/^\s*timeline/.test(r),"detector"),bae=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./timeline-definition-GMOUNBTQ-nUPbvtjj.js");return{diagram:e}},__vite__mapDeps([43,31]));return{id:L6,diagram:r}},"loader"),vae={id:L6,detector:yae,loader:bae},xae=vae,R6="mindmap",_ae=q(r=>/^\s*mindmap/.test(r),"detector"),Cae=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./mindmap-definition-QFDTVHPH-Bqzy1-O0.js");return{diagram:e}},__vite__mapDeps([44,18,19]));return{id:R6,diagram:r}},"loader"),wae={id:R6,detector:_ae,loader:Cae},kae=wae,B6="kanban",Sae=q(r=>/^\s*kanban/.test(r),"detector"),Tae=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./kanban-definition-6JOO6SKY-C3viwNtJ.js");return{diagram:e}},__vite__mapDeps([45,17]));return{id:B6,diagram:r}},"loader"),Eae={id:B6,detector:Sae,loader:Tae},Nae=Eae,O6="sankey",jae=q(r=>/^\s*sankey(-beta)?/.test(r),"detector"),Aae=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./sankeyDiagram-XADWPNL6-BWSI8qsY.js");return{diagram:e}},[]);return{id:O6,diagram:r}},"loader"),Mae={id:O6,detector:jae,loader:Aae},Lae=Mae,D6="packet",Rae=q(r=>/^\s*packet(-beta)?/.test(r),"detector"),Bae=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./diagram-TYMM5635-BHjVr_FM.js");return{diagram:e}},__vite__mapDeps([46,23,25,10,8]));return{id:D6,diagram:r}},"loader"),Oae={id:D6,detector:Rae,loader:Bae},I6="radar",Dae=q(r=>/^\s*radar-beta/.test(r),"detector"),Iae=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./diagram-MMDJMWI5-eBAtVrcR.js");return{diagram:e}},__vite__mapDeps([47,23,25,10,8]));return{id:I6,diagram:r}},"loader"),Fae={id:I6,detector:Dae,loader:Iae},F6="block",$ae=q(r=>/^\s*block(-beta)?/.test(r),"detector"),Pae=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./blockDiagram-DXYQGD6D-DsFvaLns.js");return{diagram:e}},__vite__mapDeps([48,17,11,7,8,20]));return{id:F6,diagram:r}},"loader"),zae={id:F6,detector:$ae,loader:Pae},qae=zae,$6="treeView",Hae=q(r=>/^\s*treeView-beta/.test(r),"detector"),Uae=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./diagram-5BDNPKRD-DtDbd2d1.js");return{diagram:e}},__vite__mapDeps([49,23,24,25,10,8]));return{id:$6,diagram:r}},"loader"),Wae={id:$6,detector:Hae,loader:Uae},Gae=Wae,P6="architecture",Kae=q(r=>/^\s*architecture/.test(r),"detector"),Vae=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./architectureDiagram-Q4EWVU46-DnxEKMQ-.js");return{diagram:e}},__vite__mapDeps([50,23,25,10,8,13]));return{id:P6,diagram:r}},"loader"),Yae={id:P6,detector:Kae,loader:Vae},Xae=Yae,z6="ishikawa",Zae=q(r=>/^\s*ishikawa(-beta)?\b/i.test(r),"detector"),Qae=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./ishikawaDiagram-UXIWVN3A-Blkx8f3S.js");return{diagram:e}},[]);return{id:z6,diagram:r}},"loader"),Jae={id:z6,detector:Zae,loader:Qae},q6="venn",eoe=q(r=>/^\s*venn-beta/.test(r),"detector"),toe=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./vennDiagram-DHZGUBPP-Cfq6Ys0H.js");return{diagram:e}},[]);return{id:q6,diagram:r}},"loader"),roe={id:q6,detector:eoe,loader:toe},ioe=roe,H6="treemap",noe=q(r=>/^\s*treemap/.test(r),"detector"),soe=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./diagram-G4DWMVQ6-DFVSpltG.js");return{diagram:e}},__vite__mapDeps([51,19,23,25,10,8,28]));return{id:H6,diagram:r}},"loader"),aoe={id:H6,detector:noe,loader:soe},U6="wardley-beta",ooe=q(r=>/^\s*wardley-beta/i.test(r),"detector"),loe=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./wardleyDiagram-NUSXRM2D-D7kJ-35q.js");return{diagram:e}},__vite__mapDeps([52,23,25,10,8]));return{id:U6,diagram:r}},"loader"),coe={id:U6,detector:ooe,loader:loe},hoe=coe,lM=!1,sb=q(()=>{lM||(lM=!0,ry("error",dae,r=>r.toLowerCase().trim()==="error"),ry("---",{db:{clear:q(()=>{},"clear")},styles:{},renderer:{draw:q(()=>{},"draw")},parser:{parse:q(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:q(()=>null,"init")},r=>r.toLowerCase().trimStart().startsWith("---")),w1(mae,kae,Xae),w1(ese,Nae,Xse,Gse,dse,xse,wse,Tse,Fse,qse,lse,nse,xae,mse,nae,eae,lae,Ase,Lae,Oae,Bse,qae,Gae,Fae,Jae,aoe,ioe,hoe))},"addDiagrams"),uoe=q(async()=>{tt.debug("Loading registered diagrams");const e=(await Promise.allSettled(Object.entries(cc).map(async([i,{detector:n,loader:s}])=>{if(s)try{E1(i)}catch{try{const{diagram:o,id:h}=await s();ry(h,o,n)}catch(o){throw tt.error(`Failed to load external diagram with key ${i}. Removing from detectors.`),delete cc[i],o}}}))).filter(i=>i.status==="rejected");if(e.length>0){tt.error(`Failed to load ${e.length} external diagrams`);for(const i of e)tt.error(i);throw new Error(`Failed to load ${e.length} external diagrams`)}},"loadRegisteredDiagrams"),doe="graphics-document document";function W6(r,e){r.attr("role",doe),e!==""&&r.attr("aria-roledescription",e)}q(W6,"setA11yDiagramInfo");function G6(r,e,i,n){if(r.insert!==void 0){if(i){const s=`chart-desc-${n}`;r.attr("aria-describedby",s),r.insert("desc",":first-child").attr("id",s).text(i)}if(e){const s=`chart-title-${n}`;r.attr("aria-labelledby",s),r.insert("title",":first-child").attr("id",s).text(e)}}}q(G6,"addSVGa11yTitleDescription");var rc,lC=(rc=class{constructor(e,i,n,s,o){this.type=e,this.text=i,this.db=n,this.parser=s,this.renderer=o}static async fromText(e,i={}){var d,g;const n=si(),s=Dw(e,n);e=Yte(e)+`
447
+ L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),Nne=q((r,e,i)=>{const n=r.append("defs").append("marker").attr("id",i+"_"+e+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");n.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),n.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),n.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),jne=q((r,e,i)=>{const n=si(),{themeVariables:s}=n,{strokeWidth:o}=s,h=r.append("defs").append("marker").attr("id",i+"_"+e+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");h.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),h.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),h.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),h.selectAll("*").attr("stroke-width",`${o}`)},"requirement_contains_neo"),Ane={extension:lne,composition:cne,aggregation:hne,dependency:une,lollipop:dne,point:fne,circle:pne,cross:gne,barb:mne,barbNeo:yne,only_one:bne,zero_or_one:vne,one_or_more:xne,zero_or_more:_ne,only_one_neo:Cne,zero_or_one_neo:wne,one_or_more_neo:kne,zero_or_more_neo:Sne,requirement_arrow:Tne,requirement_contains:Nne,requirement_arrow_neo:Ene,requirement_contains_neo:jne},Mne=one,Lne={common:Yf,getConfig:si,insertCluster:jie,insertEdge:ane,insertEdgeLabel:ene,insertMarkers:Mne,insertNode:i6,interpolateToCurve:tk,labelHelper:tr,log:tt,positionEdgeLabel:tne},Lf={},o6=q(r=>{for(const e of r)Lf[e.name]=e},"registerLayoutLoaders"),Rne=q(()=>{o6([{name:"dagre",loader:q(async()=>await Zt(()=>import("./dagre-KV5264BT-BiMVxC4Q.js"),__vite__mapDeps([6,7,8,9,10,11])),"loader")},{name:"cose-bilkent",loader:q(async()=>await Zt(()=>import("./cose-bilkent-S5V4N54A-Dk7CMFA4.js"),__vite__mapDeps([12,13])),"loader")}])},"registerDefaultLayoutLoaders");Rne();var Qye=q(async(r,e)=>{if(!(r.layoutAlgorithm in Lf))throw new Error(`Unknown layout algorithm: ${r.layoutAlgorithm}`);if(r.diagramId)for(const g of r.nodes){const f=g.domId||g.id;g.domId=`${r.diagramId}-${f}`}const i=Lf[r.layoutAlgorithm],n=await i.loader(),{theme:s,themeVariables:o}=r.config,{useGradient:h,gradientStart:l,gradientStop:u}=o,d=e.attr("id");if(e.append("defs").append("filter").attr("id",`${d}-drop-shadow`).attr("height","130%").attr("width","130%").append("feDropShadow").attr("dx","4").attr("dy","4").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${s!=null&&s.includes("dark")?"#FFFFFF":"#000000"}`),e.append("defs").append("filter").attr("id",`${d}-drop-shadow-small`).attr("height","150%").attr("width","150%").append("feDropShadow").attr("dx","2").attr("dy","2").attr("stdDeviation",0).attr("flood-opacity","0.06").attr("flood-color",`${s!=null&&s.includes("dark")?"#FFFFFF":"#000000"}`),h){const g=e.append("linearGradient").attr("id",e.attr("id")+"-gradient").attr("gradientUnits","objectBoundingBox").attr("x1","0%").attr("y1","0%").attr("x2","100%").attr("y2","0%");g.append("svg:stop").attr("offset","0%").attr("stop-color",l).attr("stop-opacity",1),g.append("svg:stop").attr("offset","100%").attr("stop-color",u).attr("stop-opacity",1)}return n.render(r,e,Lne,{algorithm:i.algorithm})},"render"),Jye=q((r="",{fallback:e="dagre"}={})=>{if(r in Lf)return r;if(e in Lf)return tt.warn(`Layout algorithm ${r} is not registered. Using ${e} as fallback.`),e;throw new Error(`Both layout algorithms ${r} and ${e} are not registered.`)},"getRegisteredLayoutAlgorithm"),l6="comm",c6="rule",h6="decl",Bne="@import",One="@namespace",Dne="@keyframes",Ine="@layer",Fne=Math.abs,pf=String.fromCharCode;function u6(r){return r.trim()}function sC(r,e,i){return r.replace(e,i)}function jh(r,e){return r.charCodeAt(e)|0}function cu(r,e,i){return r.slice(e,i)}function Ys(r){return r.length}function $ne(r){return r.length}function Mg(r,e){return e.push(r),r}var ib=1,hu=1,d6=0,ps=0,vi=0,xu="";function Ck(r,e,i,n,s,o,h,l){return{value:r,root:e,parent:i,type:n,props:s,children:o,line:ib,column:hu,length:h,return:"",siblings:l}}function Pne(){return vi}function zne(){return vi=ps>0?jh(xu,--ps):0,hu--,vi===10&&(hu=1,ib--),vi}function js(){return vi=ps<d6?jh(xu,ps++):0,hu++,vi===10&&(hu=1,ib++),vi}function Uo(){return jh(xu,ps)}function Cm(){return ps}function nb(r,e){return cu(xu,r,e)}function Rf(r){switch(r){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function qne(r){return ib=hu=1,d6=Ys(xu=r),ps=0,[]}function Hne(r){return xu="",r}function ix(r){return u6(nb(ps-1,aC(r===91?r+2:r===40?r+1:r)))}function Une(r){for(;(vi=Uo())&&vi<33;)js();return Rf(r)>2||Rf(vi)>3?"":" "}function Wne(r,e){for(;--e&&js()&&!(vi<48||vi>102||vi>57&&vi<65||vi>70&&vi<97););return nb(r,Cm()+(e<6&&Uo()==32&&js()==32))}function aC(r){for(;js();)switch(vi){case r:return ps;case 34:case 39:r!==34&&r!==39&&aC(vi);break;case 40:r===41&&aC(r);break;case 92:js();break}return ps}function Gne(r,e){for(;js()&&r+vi!==57;)if(r+vi===84&&Uo()===47)break;return"/*"+nb(e,ps-1)+"*"+pf(r===47?r:js())}function Kne(r){for(;!Rf(Uo());)js();return nb(r,ps)}function Vne(r){return Hne(wm("",null,null,null,[""],r=qne(r),0,[0],r))}function wm(r,e,i,n,s,o,h,l,u){for(var d=0,g=0,f=h,m=0,y=0,w=0,_=1,b=1,x=1,C=0,k=0,T="",N=s,A=o,j=n,E=T;b;)switch(w=k,k=js()){case 40:w!=108&&jh(E,f-1)==58?(C++,E+="("):E+=ix(k);break;case 41:C--,E+=")";break;case 34:case 39:case 91:E+=ix(k);break;case 9:case 10:case 13:case 32:if(C>0){E+=pf(k);break}E+=Une(w);break;case 92:E+=Wne(Cm()-1,7);continue;case 47:switch(Uo()){case 42:case 47:Mg(Yne(Gne(js(),Cm()),e,i,u),u),(Rf(w||1)==5||Rf(Uo()||1)==5)&&Ys(E)&&cu(E,-1,void 0)!==" "&&(E+=" ");break;default:E+="/"}break;case 123*_:l[d++]=Ys(E)*x;case 125*_:case 59:case 0:if(C>0&&k){E+=pf(k);break}switch(k){case 0:case 125:b=0;case 59+g:x==-1&&(E=sC(E,/\f/g,"")),y>0&&(Ys(E)-f||_===0)&&Mg(y>32?oM(E+";",n,i,f-1,u):oM(sC(E," ","")+";",n,i,f-2,u),u);break;case 59:E+=";";default:if(Mg(j=aM(E,e,i,d,g,s,l,T,N=[],A=[],f,o),o),k===123)if(g===0)wm(E,e,j,j,N,o,f,l,A);else{switch(m){case 99:if(jh(E,3)===110)break;case 108:if(jh(E,2)===97)break;default:g=0;case 100:case 109:case 115:}g?wm(r,j,j,n&&Mg(aM(r,j,j,0,0,s,l,T,s,N=[],f,A),A),s,A,f,l,n?N:A):wm(E,j,j,j,[""],A,0,l,A)}}d=g=y=0,_=x=1,T=E="",f=h;break;case 58:f=1+Ys(E),y=w;default:if(_<1){if(k==123)--_;else if(k==125&&_++==0&&zne()==125)continue}switch(E+=pf(k),k*_){case 38:x=g>0?1:(E+="\f",-1);break;case 44:if(C>0)break;l[d++]=(Ys(E)-1)*x,x=1;break;case 64:Uo()===45&&(E+=ix(js())),m=Uo(),g=f=Ys(T=E+=Kne(Cm())),k++;break;case 45:w===45&&Ys(E)==2&&(_=0)}}return o}function aM(r,e,i,n,s,o,h,l,u,d,g,f){for(var m=s-1,y=s===0?o:[""],w=$ne(y),_=0,b=0,x=0;_<n;++_)for(var C=0,k=cu(r,m+1,m=Fne(b=h[_])),T=r;C<w;++C)(T=u6(b>0?y[C]+" "+k:sC(k,/&\f/g,y[C])))&&(u[x++]=T);return Ck(r,e,i,s===0?c6:l,u,d,g,f)}function Yne(r,e,i,n){return Ck(r,e,i,l6,pf(Pne()),cu(r,2,-2),0,n)}function oM(r,e,i,n,s){return Ck(r,e,i,h6,cu(r,0,n),cu(r,n+1,-1),n,s)}function oC(r,e){for(var i="",n=0;n<r.length;n++)i+=e(r[n],n,r,e)||"";return i}function Xne(r,e,i,n){switch(r.type){case Ine:if(r.children.length)break;case Bne:case One:case h6:return r.return=r.return||r.value;case l6:return"";case Dne:return r.return=r.value+"{"+oC(r.children,n)+"}";case c6:if(!Ys(r.value=r.props.join(",")))return""}return Ys(i=oC(r.children,n))?r.return=r.value+"{"+i+"}":""}var f6="c4",Zne=q(r=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(r),"detector"),Qne=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./c4Diagram-AHTNJAMY-DMXPWRiQ.js");return{diagram:e}},__vite__mapDeps([14,15]));return{id:f6,diagram:r}},"loader"),Jne={id:f6,detector:Zne,loader:Qne},ese=Jne,p6="flowchart",tse=q((r,e)=>{var i,n;return((i=e==null?void 0:e.flowchart)==null?void 0:i.defaultRenderer)==="dagre-wrapper"||((n=e==null?void 0:e.flowchart)==null?void 0:n.defaultRenderer)==="elk"?!1:/^\s*graph/.test(r)},"detector"),rse=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./flowDiagram-DWJPFMVM-Bmsp6kyU.js");return{diagram:e}},__vite__mapDeps([16,17,15,18,19,20]));return{id:p6,diagram:r}},"loader"),ise={id:p6,detector:tse,loader:rse},nse=ise,g6="flowchart-v2",sse=q((r,e)=>{var i,n,s;return((i=e==null?void 0:e.flowchart)==null?void 0:i.defaultRenderer)==="dagre-d3"?!1:(((n=e==null?void 0:e.flowchart)==null?void 0:n.defaultRenderer)==="elk"&&(e.layout="elk"),/^\s*graph/.test(r)&&((s=e==null?void 0:e.flowchart)==null?void 0:s.defaultRenderer)==="dagre-wrapper"?!0:/^\s*flowchart/.test(r))},"detector"),ase=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./flowDiagram-DWJPFMVM-Bmsp6kyU.js");return{diagram:e}},__vite__mapDeps([16,17,15,18,19,20]));return{id:g6,diagram:r}},"loader"),ose={id:g6,detector:sse,loader:ase},lse=ose,m6="er",cse=q(r=>/^\s*erDiagram/.test(r),"detector"),hse=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./erDiagram-SMLLAGMA-D_uSs2_2.js");return{diagram:e}},__vite__mapDeps([21,18,19,20]));return{id:m6,diagram:r}},"loader"),use={id:m6,detector:cse,loader:hse},dse=use,y6="gitGraph",fse=q(r=>/^\s*gitGraph/.test(r),"detector"),pse=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./gitGraphDiagram-UUTBAWPF-BEiGpPBj.js");return{diagram:e}},__vite__mapDeps([22,23,24,25,10,8]));return{id:y6,diagram:r}},"loader"),gse={id:y6,detector:fse,loader:pse},mse=gse,b6="gantt",yse=q(r=>/^\s*gantt/.test(r),"detector"),bse=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./ganttDiagram-T4ZO3ILL-wEdysXo_.js");return{diagram:e}},__vite__mapDeps([26,27,28]));return{id:b6,diagram:r}},"loader"),vse={id:b6,detector:yse,loader:bse},xse=vse,v6="info",_se=q(r=>/^\s*info/.test(r),"detector"),Cse=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./infoDiagram-42DDH7IO-BzfuDHl4.js");return{diagram:e}},__vite__mapDeps([29,25,10,8]));return{id:v6,diagram:r}},"loader"),wse={id:v6,detector:_se,loader:Cse},x6="pie",kse=q(r=>/^\s*pie/.test(r),"detector"),Sse=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./pieDiagram-DEJITSTG-BnP4-zwd.js");return{diagram:e}},__vite__mapDeps([30,23,25,10,8,31]));return{id:x6,diagram:r}},"loader"),Tse={id:x6,detector:kse,loader:Sse},_6="quadrantChart",Ese=q(r=>/^\s*quadrantChart/.test(r),"detector"),Nse=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./quadrantDiagram-34T5L4WZ-BXN88cHy.js");return{diagram:e}},__vite__mapDeps([32,27,28]));return{id:_6,diagram:r}},"loader"),jse={id:_6,detector:Ese,loader:Nse},Ase=jse,C6="xychart",Mse=q(r=>/^\s*xychart(-beta)?/.test(r),"detector"),Lse=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./xychartDiagram-5P7HB3ND-BPCFKXqR.js");return{diagram:e}},__vite__mapDeps([33,27,28]));return{id:C6,diagram:r}},"loader"),Rse={id:C6,detector:Mse,loader:Lse},Bse=Rse,w6="requirement",Ose=q(r=>/^\s*requirement(Diagram)?/.test(r),"detector"),Dse=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./requirementDiagram-MS252O5E-D34hL42a.js");return{diagram:e}},__vite__mapDeps([34,18,19]));return{id:w6,diagram:r}},"loader"),Ise={id:w6,detector:Ose,loader:Dse},Fse=Ise,k6="sequence",$se=q(r=>/^\s*sequenceDiagram/.test(r),"detector"),Pse=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./sequenceDiagram-FGHM5R23-C-5nW5j6.js");return{diagram:e}},__vite__mapDeps([35,15,24]));return{id:k6,diagram:r}},"loader"),zse={id:k6,detector:$se,loader:Pse},qse=zse,S6="class",Hse=q((r,e)=>{var i;return((i=e==null?void 0:e.class)==null?void 0:i.defaultRenderer)==="dagre-wrapper"?!1:/^\s*classDiagram/.test(r)},"detector"),Use=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./classDiagram-6PBFFD2Q-DB_UnN1h.js");return{diagram:e}},__vite__mapDeps([36,37,17,15,18,19]));return{id:S6,diagram:r}},"loader"),Wse={id:S6,detector:Hse,loader:Use},Gse=Wse,T6="classDiagram",Kse=q((r,e)=>{var i;return/^\s*classDiagram/.test(r)&&((i=e==null?void 0:e.class)==null?void 0:i.defaultRenderer)==="dagre-wrapper"?!0:/^\s*classDiagram-v2/.test(r)},"detector"),Vse=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./classDiagram-v2-HSJHXN6E-DB_UnN1h.js");return{diagram:e}},__vite__mapDeps([38,37,17,15,18,19]));return{id:T6,diagram:r}},"loader"),Yse={id:T6,detector:Kse,loader:Vse},Xse=Yse,E6="state",Zse=q((r,e)=>{var i;return((i=e==null?void 0:e.state)==null?void 0:i.defaultRenderer)==="dagre-wrapper"?!1:/^\s*stateDiagram/.test(r)},"detector"),Qse=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./stateDiagram-FHFEXIEX-C50iDFqe.js");return{diagram:e}},__vite__mapDeps([39,40,18,19,7,8,9,10]));return{id:E6,diagram:r}},"loader"),Jse={id:E6,detector:Zse,loader:Qse},eae=Jse,N6="stateDiagram",tae=q((r,e)=>{var i;return!!(/^\s*stateDiagram-v2/.test(r)||/^\s*stateDiagram/.test(r)&&((i=e==null?void 0:e.state)==null?void 0:i.defaultRenderer)==="dagre-wrapper")},"detector"),rae=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./stateDiagram-v2-QKLJ7IA2-eW9-s0Sm.js");return{diagram:e}},__vite__mapDeps([41,40,18,19]));return{id:N6,diagram:r}},"loader"),iae={id:N6,detector:tae,loader:rae},nae=iae,j6="journey",sae=q(r=>/^\s*journey/.test(r),"detector"),aae=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./journeyDiagram-VCZTEJTY-DbwICa_a.js");return{diagram:e}},__vite__mapDeps([42,17,15,31]));return{id:j6,diagram:r}},"loader"),oae={id:j6,detector:sae,loader:aae},lae=oae,cae=q((r,e,i)=>{tt.debug(`rendering svg for syntax error
448
+ `);const n=xee(e),s=n.append("g");n.attr("viewBox","0 0 2412 512"),z5(n,100,512,!0),s.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),s.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),s.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),s.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),s.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),s.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),s.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),s.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${i}`)},"draw"),A6={draw:cae},hae=A6,uae={db:{},renderer:A6,parser:{parse:q(()=>{},"parse")}},dae=uae,M6="flowchart-elk",fae=q((r,e={})=>{var i;return/^\s*flowchart-elk/.test(r)||/^\s*(flowchart|graph)/.test(r)&&((i=e==null?void 0:e.flowchart)==null?void 0:i.defaultRenderer)==="elk"?(e.layout="elk",!0):!1},"detector"),pae=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./flowDiagram-DWJPFMVM-Bmsp6kyU.js");return{diagram:e}},__vite__mapDeps([16,17,15,18,19,20]));return{id:M6,diagram:r}},"loader"),gae={id:M6,detector:fae,loader:pae},mae=gae,L6="timeline",yae=q(r=>/^\s*timeline/.test(r),"detector"),bae=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./timeline-definition-GMOUNBTQ-DRYfuqHT.js");return{diagram:e}},__vite__mapDeps([43,31]));return{id:L6,diagram:r}},"loader"),vae={id:L6,detector:yae,loader:bae},xae=vae,R6="mindmap",_ae=q(r=>/^\s*mindmap/.test(r),"detector"),Cae=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./mindmap-definition-QFDTVHPH-Dk4QySu7.js");return{diagram:e}},__vite__mapDeps([44,18,19]));return{id:R6,diagram:r}},"loader"),wae={id:R6,detector:_ae,loader:Cae},kae=wae,B6="kanban",Sae=q(r=>/^\s*kanban/.test(r),"detector"),Tae=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./kanban-definition-6JOO6SKY-D9XucLs4.js");return{diagram:e}},__vite__mapDeps([45,17]));return{id:B6,diagram:r}},"loader"),Eae={id:B6,detector:Sae,loader:Tae},Nae=Eae,O6="sankey",jae=q(r=>/^\s*sankey(-beta)?/.test(r),"detector"),Aae=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./sankeyDiagram-XADWPNL6-0mFeok-3.js");return{diagram:e}},[]);return{id:O6,diagram:r}},"loader"),Mae={id:O6,detector:jae,loader:Aae},Lae=Mae,D6="packet",Rae=q(r=>/^\s*packet(-beta)?/.test(r),"detector"),Bae=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./diagram-TYMM5635-DvyvQBCc.js");return{diagram:e}},__vite__mapDeps([46,23,25,10,8]));return{id:D6,diagram:r}},"loader"),Oae={id:D6,detector:Rae,loader:Bae},I6="radar",Dae=q(r=>/^\s*radar-beta/.test(r),"detector"),Iae=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./diagram-MMDJMWI5-DqoQLlWK.js");return{diagram:e}},__vite__mapDeps([47,23,25,10,8]));return{id:I6,diagram:r}},"loader"),Fae={id:I6,detector:Dae,loader:Iae},F6="block",$ae=q(r=>/^\s*block(-beta)?/.test(r),"detector"),Pae=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./blockDiagram-DXYQGD6D-BTENXCSO.js");return{diagram:e}},__vite__mapDeps([48,17,11,7,8,20]));return{id:F6,diagram:r}},"loader"),zae={id:F6,detector:$ae,loader:Pae},qae=zae,$6="treeView",Hae=q(r=>/^\s*treeView-beta/.test(r),"detector"),Uae=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./diagram-5BDNPKRD-DfJEsVTA.js");return{diagram:e}},__vite__mapDeps([49,23,24,25,10,8]));return{id:$6,diagram:r}},"loader"),Wae={id:$6,detector:Hae,loader:Uae},Gae=Wae,P6="architecture",Kae=q(r=>/^\s*architecture/.test(r),"detector"),Vae=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./architectureDiagram-Q4EWVU46-O9bOog_f.js");return{diagram:e}},__vite__mapDeps([50,23,25,10,8,13]));return{id:P6,diagram:r}},"loader"),Yae={id:P6,detector:Kae,loader:Vae},Xae=Yae,z6="ishikawa",Zae=q(r=>/^\s*ishikawa(-beta)?\b/i.test(r),"detector"),Qae=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./ishikawaDiagram-UXIWVN3A-BVoNJ9VS.js");return{diagram:e}},[]);return{id:z6,diagram:r}},"loader"),Jae={id:z6,detector:Zae,loader:Qae},q6="venn",eoe=q(r=>/^\s*venn-beta/.test(r),"detector"),toe=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./vennDiagram-DHZGUBPP-Crril7Cj.js");return{diagram:e}},[]);return{id:q6,diagram:r}},"loader"),roe={id:q6,detector:eoe,loader:toe},ioe=roe,H6="treemap",noe=q(r=>/^\s*treemap/.test(r),"detector"),soe=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./diagram-G4DWMVQ6-CztLHIcY.js");return{diagram:e}},__vite__mapDeps([51,19,23,25,10,8,28]));return{id:H6,diagram:r}},"loader"),aoe={id:H6,detector:noe,loader:soe},U6="wardley-beta",ooe=q(r=>/^\s*wardley-beta/i.test(r),"detector"),loe=q(async()=>{const{diagram:r}=await Zt(async()=>{const{diagram:e}=await import("./wardleyDiagram-NUSXRM2D-C4GeB_Df.js");return{diagram:e}},__vite__mapDeps([52,23,25,10,8]));return{id:U6,diagram:r}},"loader"),coe={id:U6,detector:ooe,loader:loe},hoe=coe,lM=!1,sb=q(()=>{lM||(lM=!0,ry("error",dae,r=>r.toLowerCase().trim()==="error"),ry("---",{db:{clear:q(()=>{},"clear")},styles:{},renderer:{draw:q(()=>{},"draw")},parser:{parse:q(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:q(()=>null,"init")},r=>r.toLowerCase().trimStart().startsWith("---")),w1(mae,kae,Xae),w1(ese,Nae,Xse,Gse,dse,xse,wse,Tse,Fse,qse,lse,nse,xae,mse,nae,eae,lae,Ase,Lae,Oae,Bse,qae,Gae,Fae,Jae,aoe,ioe,hoe))},"addDiagrams"),uoe=q(async()=>{tt.debug("Loading registered diagrams");const e=(await Promise.allSettled(Object.entries(cc).map(async([i,{detector:n,loader:s}])=>{if(s)try{E1(i)}catch{try{const{diagram:o,id:h}=await s();ry(h,o,n)}catch(o){throw tt.error(`Failed to load external diagram with key ${i}. Removing from detectors.`),delete cc[i],o}}}))).filter(i=>i.status==="rejected");if(e.length>0){tt.error(`Failed to load ${e.length} external diagrams`);for(const i of e)tt.error(i);throw new Error(`Failed to load ${e.length} external diagrams`)}},"loadRegisteredDiagrams"),doe="graphics-document document";function W6(r,e){r.attr("role",doe),e!==""&&r.attr("aria-roledescription",e)}q(W6,"setA11yDiagramInfo");function G6(r,e,i,n){if(r.insert!==void 0){if(i){const s=`chart-desc-${n}`;r.attr("aria-describedby",s),r.insert("desc",":first-child").attr("id",s).text(i)}if(e){const s=`chart-title-${n}`;r.attr("aria-labelledby",s),r.insert("title",":first-child").attr("id",s).text(e)}}}q(G6,"addSVGa11yTitleDescription");var rc,lC=(rc=class{constructor(e,i,n,s,o){this.type=e,this.text=i,this.db=n,this.parser=s,this.renderer=o}static async fromText(e,i={}){var d,g;const n=si(),s=Dw(e,n);e=Yte(e)+`
449
449
  `;try{E1(s)}catch{const f=JQ(s);if(!f)throw new E5(`Diagram ${s} not found.`);const{id:m,diagram:y}=await f();ry(m,y)}const{db:o,parser:h,renderer:l,init:u}=E1(s);return h.parser&&(h.parser.yy=o),(d=o.clear)==null||d.call(o),u==null||u(n),i.title&&((g=o.setDiagramTitle)==null||g.call(o,i.title)),await h.parse(e),new rc(s,e,o,h,l)}async render(e,i){await this.renderer.draw(this.text,e,i,this)}getParser(){return this.parser}getType(){return this.type}},q(rc,"Diagram"),rc),cM=[],foe=q(()=>{cM.forEach(r=>{r()}),cM=[]},"attachFunctions"),poe=q(r=>r.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function K6(r){const e=r.match(T5);if(!e)return{text:r,metadata:{}};let i=Ete(e[1],{schema:Tte})??{};i=typeof i=="object"&&!Array.isArray(i)?i:{};const n={};return i.displayMode&&(n.displayMode=i.displayMode.toString()),i.title&&(n.title=i.title.toString()),i.config&&(n.config=i.config),{text:r.slice(e[0].length),metadata:n}}q(K6,"extractFrontMatter");var goe=q(r=>r.replace(/\r\n?/g,`
450
450
  `).replace(/<(\w+)([^>]*)>/g,(e,i,n)=>"<"+i+n.replace(/="([^"]*)"/g,"='$1'")+">"),"cleanupText"),moe=q(r=>{const{text:e,metadata:i}=K6(r),{displayMode:n,title:s,config:o={}}=i;return n&&(o.gantt||(o.gantt={}),o.gantt.displayMode=n),{title:s,config:o,text:e}},"processFrontmatter"),yoe=q(r=>{const e=Ts.detectInit(r)??{},i=Ts.detectDirective(r,"wrap");return Array.isArray(i)?e.wrap=i.some(({type:n})=>n==="wrap"):(i==null?void 0:i.type)==="wrap"&&(e.wrap=!0),{text:Dte(r),directive:e}},"processDirectives");function wk(r){const e=goe(r),i=moe(e),n=yoe(i.text),s=ak(i.config,n.directive);return r=poe(n.text),{code:r,title:i.title,config:s}}q(wk,"preprocessDiagram");function V6(r){const e=new TextEncoder().encode(r),i=Array.from(e,n=>String.fromCodePoint(n)).join("");return btoa(i)}q(V6,"toBase64");var boe=5e4,voe="graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa",xoe="sandbox",_oe="loose",Coe="http://www.w3.org/2000/svg",woe="http://www.w3.org/1999/xlink",koe="http://www.w3.org/1999/xhtml",Soe="100%",Toe="100%",Eoe="border:0;margin:0;",Noe="margin:0",joe="allow-top-navigation-by-user-activation allow-popups",Aoe='The "iframe" tag is not supported by your browser.',Moe=["foreignobject"],Loe=["dominant-baseline"];function kk(r){const e=wk(r);return ey(),EJ(e.config??{}),e}q(kk,"processAndSetConfigs");async function Y6(r,e){sb();try{const{code:i,config:n}=kk(r);return{diagramType:(await Z6(i)).type,config:n}}catch(i){if(e!=null&&e.suppressErrors)return!1;throw i}}q(Y6,"parse");var hM=q((r,e,i=[])=>`
451
451
  .${r} ${e} { ${i.join(" !important; ")} !important; }`,"cssImportantStyles"),Roe=q((r,e=new Map)=>{let i="";if(r.themeCSS!==void 0&&(i+=`
@@ -465,9 +465,9 @@ Couldn't relaunch automatically (${(O==null?void 0:O.reason)??"app not installed
465
465
 
466
466
  Couldn't reach the relaunch service. Reopen the app manually to finish.`.trimStart())}_(!1)},[]),A=B.useCallback(O=>{O.key==="Escape"&&u&&g!=="running"&&d(!1)},[u,g]);if(B.useEffect(()=>(document.addEventListener("keydown",A),()=>document.removeEventListener("keydown",A)),[A]),!(o||s.length>0||!!n))return null;const E=o&&h&&l?`v${h} → v${l}`:null,L=g==="running"||w;return a.jsxs("div",{className:"update-badge",children:[a.jsxs("button",{className:"update-badge-trigger",onClick:()=>d(O=>!O),"aria-expanded":u,title:e("update.title"),children:[a.jsx("span",{className:`update-badge-dot ${g==="running"?"update-badge-dot--busy":""}`}),a.jsx("span",{className:"update-badge-label",children:e(g==="running"?"update.upgrading":"update.available")})]}),u&&a.jsxs("div",{className:"update-badge-popover",children:[a.jsxs("div",{className:"update-badge-popover-header",children:[a.jsx("span",{className:"update-badge-popover-title",children:e("update.title")}),a.jsx("button",{className:"update-badge-dismiss",onClick:()=>d(!1),disabled:g==="running",title:e("update.dismiss"),"aria-label":e("update.dismiss"),children:"×"})]}),g!=="idle"?a.jsxs("div",{className:"update-badge-content",children:[a.jsxs("div",{className:`update-badge-status update-badge-status--${g}`,children:[g==="running"&&a.jsx("span",{className:"update-badge-spinner","aria-hidden":"true"}),a.jsxs("span",{className:"update-badge-status-text",children:[g==="running"&&e("update.upgrading"),g==="done"&&e("update.upgraded"),g==="error"&&e("update.upgradeFailed")]})]}),m&&a.jsx("pre",{className:"update-badge-log",children:m}),g==="done"&&a.jsx("p",{className:"update-badge-note",children:e("update.relaunchHint")})]}):a.jsxs("div",{className:"update-badge-content",children:[E&&a.jsx("p",{className:"update-badge-version",children:E}),a.jsx("p",{className:"update-badge-hint",children:e("update.upgradeHint")}),n&&a.jsxs("details",{className:"update-badge-details",children:[a.jsx("summary",{children:e("update.title")}),a.jsx(tp,{content:n})]})]}),g==="idle"&&a.jsx("button",{className:"update-badge-action",onClick:T,disabled:L,children:e("update.upgradeAll")}),g==="done"&&a.jsx("button",{className:"update-badge-action",onClick:N,disabled:w,children:e("update.relaunch")}),g==="error"&&a.jsx("button",{className:"update-badge-action",onClick:T,disabled:L,children:e("update.retry")}),g==="idle"&&s.length>0&&r&&a.jsx("button",{className:"update-badge-action update-badge-action--secondary",onClick:()=>{r(),d(!1)},children:e("update.managePacks")})]})]})}const aF=8,Tk=14,ab=20,Lg=ab;function $le(r){return r<aF?"Alert":r<Tk?"Drowsy":r<ab?"Sleepy":"Must Sleep"}function oF(r){return r<aF?"alert":r<Tk?"drowsy":r<ab?"sleepy":"must_sleep"}function lF(r){return r<Tk?"idle":r<ab?"sleepy":"sleeps"}function ob(){return Yt({queryKey:["sleep"],queryFn:()=>De.get("/sleep")})}function cF(){const{data:r}=ob();return(r==null?void 0:r.recall_mode)??"haiku"}function Ple(){const r=Pt();return Vt({mutationFn:e=>De.patch("/sleep",e),onSuccess:e=>r.setQueryData(["sleep"],e)})}const ZM=[{id:"brain",label:"Brain lifecycle",triggers:[{insert:"/initializer ",label:"Initializer",hint:"Bootstrap a missing or sparse brain from your real material.",what:"Bootstraps a missing or sparse brain from your real material — docs, wikis, Obsidian/Notion exports, or just the codebase — into a proper knowledge / feature / task hierarchy.",how:["Scout inventories your code + docs into a categorized ingestion manifest","You confirm the proposed knowledge / feature / task hierarchy","Ingestor agents fan out per batch, distilling sources into real files (never templates)","Verifier gates: no placeholders, doctor clean, recall actually returns hits"],agents:["initializer-scout","initializer-ingestor","initializer-verifier"]},{insert:"/curator ",label:"Curator",hint:"The periodic brain refactor that sleep won't do.",what:"The periodic brain REFACTOR that sleep won't do — re-orders the whole corpus into the right shape (MOVE / MERGE / SPLIT / RENAME / RE-TYPE / RETIRE) to conform to current conventions.",how:["Auditors fan out per domain, reading conventions live from the skill + taxonomy + soul","A reorg PLAN is proposed: source → action → target for every drifted file","You confirm the shape before anything moves","Workers execute via the CLI so frontmatter, wikilinks and indexes stay coherent","Verifier gates: doctor clean, zero duplicate topics, recall not regressed"],agents:["curator-auditor","curator-worker","curator-verifier"]},{insert:"/dreamcontext-deep-research ",label:"Deep Research",hint:"Heavy cross-corpus synthesis across a large or multi-project brain.",what:"Heavy, iterative synthesis across a large or multi-project brain and connected peer vaults — for when a single explore pass under-serves the question.",how:["Searchers fan out over knowledge, features, tasks, memory, changelog + connected peers","Load-bearing claims are adversarially verified, not trusted","Returns a synthesized, CITED report — not a pile of raw hits"]},{insert:"/dream-sync ",label:"Sync",hint:"Resolve the team brain-merge the CLI defers to you.",what:"The agent half of the team brain-merge — resolves the prose conflicts the CLI deliberately hands off.",how:["The CLI auto-resolves every deterministic file (JSON, task statuses, changelogs)","It defers only PROSE where two people edited the same section","You read base / ours / theirs and write the true semantic merge","Hand back to the CLI to commit + push"]}]},{id:"build",label:"Build & review",triggers:[{insert:"/goal-skill ",label:"Goal",hint:"Drive a non-trivial goal to done under planned, reviewed, validated orchestration.",what:'Drives a non-trivial goal to done under rigorous orchestration — the orchestrator gates each phase; sub-agents do the work; "done" means validation passes against criteria you agreed to.',how:["Planner produces a file-by-file plan grounded in the real codebase","Parallel plan-reviewers critique it from different lenses → SOLID / NEEDS_WORK","The plan is persisted as a dreamcontext task with agreed acceptance criteria","Implementer builds strictly to the criteria; the reviewer gates the diff","Validator runs your chosen tests / checklist → PASS / FAIL, looping until reached"],agents:["goal-planner","goal-plan-reviewer","goal-implementer","reviewer","goal-validator"]},{insert:"/multi-review ",label:"Multi-review",hint:"Route the diff to specialist reviewers, then consolidate one report.",what:"Team code review — routes a diff to niche specialists in parallel, then consolidates their findings into one greptile-style report with a verdict.",how:["Router classifies the diff by size tier + affected domains","Specialists review in parallel: security · cloud-functions · frontend · edge-cases","Coordinator dedupes, re-ranks and drops false positives → one final verdict"],agents:["review-router","review-security","review-cloud-functions","review-frontend","review-edge-cases","review-coordinator"]}]},{id:"decide",label:"Decide & draw",triggers:[{insert:"/council ",label:"Council",hint:"Run a structured multi-persona debate, then synthesize a decision.",what:"A structured multi-persona debate for a hard decision, ending in a synthesized decision report that traces every reason back to who raised it.",how:["3–10 persona agents debate the question over N rounds","Each argues from its own assigned perspective, with optional web research","A synthesizer reads every report and writes the final decision + minority views"],agents:["council-persona","council-synthesizer"]},{insert:"/excalidraw ",label:"Excalidraw",hint:"Generate or extend an Obsidian Excalidraw board from a spec.",what:"Generate or extend an Obsidian Excalidraw board — images, labels, shapes, arrows, lanes, grids — from a small spec.",how:["You describe the board (or point at screenshots to embed)","A deterministic script emits valid plugin markup — ~no tokens, always renders"]}]}],hF={models:[{id:"opus",label:"Opus"},{id:"sonnet",label:"Sonnet"},{id:"haiku",label:"Haiku"},{id:"fable",label:"Fable"}],efforts:["low","medium","high","xhigh","max"],defaultModel:"opus",defaultEffort:"high"};function QM(r){return r&&r.charAt(0).toUpperCase()+r.slice(1)}function Rg(r){if(r<1e3)return String(Math.round(r));if(r<1e6){const e=r/1e3;return`${e<10?e.toFixed(1):Math.round(e)}k`}return`${(r/1e6).toFixed(1)}M`}function JM(r){return r<=0?"$0.00":r<.01?"<$0.01":r<100?`$${r.toFixed(2)}`:`$${Math.round(r)}`}function zle(r){const e=[...r].filter(i=>{const n=i.codePointAt(0)??0;return n>=32&&n!==127}).join("");return/^[\w@%+=:,./-]+$/.test(e)?e:`'${e.replace(/'/g,"'\\''")}'`}function Ek(){return Yt({queryKey:["agent-capabilities"],queryFn:()=>De.get("/agent/capabilities"),staleTime:3e4,refetchInterval:3e4,retry:!1})}function uF(r){return!!(r!=null&&r.desktop&&r.embeddedTerminal&&r.claudeCli)}function qle(){return Yt({queryKey:["agent-model-config"],queryFn:()=>De.get("/agent/model-config"),staleTime:1e4,refetchInterval:3e4,refetchOnWindowFocus:!0,retry:!1,placeholderData:hF})}const Hle={contextTokens:null,contextLimit:null,costUsd:null};function Ule(r,e){return Yt({queryKey:["agent-session-stats",r],queryFn:()=>De.get(`/agent/session-stats?claudeId=${encodeURIComponent(r)}`),enabled:e&&!!r,refetchInterval:e?5e3:!1,staleTime:4e3,retry:!1,placeholderData:Hle})}const dF="agent:settings:v1",Bf="dreamcontext-agent-settings",hC={enabled:!0,restoreTabs:!0,defaultAgent:"claude",autoTitle:!1,hotkey:"Ctrl+A"};function fF(r){const e=r??{};return{enabled:e.enabled!==!1,restoreTabs:e.restoreTabs!==!1,defaultAgent:e.defaultAgent==="claude"?"claude":hC.defaultAgent,autoTitle:e.autoTitle===!0,hotkey:typeof e.hotkey=="string"&&e.hotkey.trim()?e.hotkey.trim():hC.hotkey}}function lb(){try{const r=localStorage.getItem(dF);if(r)return fF(JSON.parse(r))}catch{}return{...hC}}function pF(r){try{localStorage.setItem(dF,JSON.stringify(r))}catch{}}function Wle(r){pF(r),De.post("/launcher/agent-settings",r).catch(()=>{});try{window.dispatchEvent(new CustomEvent(Bf,{detail:r}))}catch{}}async function gF(){try{const r=await De.get("/launcher/agent-settings"),e=fF(r);return pF(e),e}catch{return lb()}}function mF(r){if(["Meta","Control","Alt","Shift"].includes(r.key))return null;const e=[];if(r.metaKey&&e.push("Cmd"),r.ctrlKey&&e.push("Ctrl"),r.altKey&&e.push("Alt"),r.shiftKey&&e.push("Shift"),e.length===0)return null;let i=r.key;return i===" "?i="Space":i.length===1?i=i.toUpperCase():i=i.charAt(0).toUpperCase()+i.slice(1),[...e,i].join("+")}function Gle(r,e){const i=mF(r);if(!i)return!1;const n=s=>s.split("+").map(o=>o.trim().toLowerCase()).sort().join("+");return n(i)===n(e)}const yF=400,bF={Control:"Ctrl",Alt:"Alt",Meta:"Cmd",Shift:"Shift",Fn:"Fn",FnLock:"Fn"};function vF(r){return bF[r.key]??null}function xF(r){const e=r.split("+").map(i=>i.trim());return e.length===2&&e[0]&&e[0]===e[1]&&Object.values(bF).includes(e[0])?e[0]:null}function Kle(r){const e=xF(r);return e?`${e} ×2`:r}function Vle(r,e=yF){let i=0;return n=>{if(vF(n)!==r)return n.repeat||(i=0),!1;if(n.repeat)return!1;const s=Date.now();return i!==0&&s-i<=e?(i=0,!0):(i=s,!1)}}const uC="dreamcontext-run-sleep-agent",eL="Sleep",tL='Think hard. Run a full dreamcontext memory consolidation ("sleep") for THIS project now, fully autonomously — do NOT ask any questions. Follow the project\'s dreamcontext sleep flow: pin the epoch with `dreamcontext sleep start`, reconcile the task / changelog / knowledge / feature files to current truth (prefer updating existing entities over creating new ones), then close the cycle with `dreamcontext sleep done "<one-paragraph summary>"` to reset the debt. When finished, reply with a SHORT Markdown summary of what was consolidated.';function Yle(){window.dispatchEvent(new CustomEvent(uC))}const Nk="dreamcontext:sleep-pending-at",wy="dreamcontext-sleep-pending",Xle=3*6e4;function Zle(){try{localStorage.setItem(Nk,String(Date.now()))}catch{}window.dispatchEvent(new CustomEvent(wy))}function Qle(){try{localStorage.removeItem(Nk)}catch{}window.dispatchEvent(new CustomEvent(wy))}function Hx(){try{const r=localStorage.getItem(Nk);if(!r)return null;const e=Number(r);return!Number.isFinite(e)||Date.now()-e>Xle?null:e}catch{return null}}function Jle({onOpen:r}){const{t:e}=wr(),{data:i}=ob(),{data:n}=Ek(),[s,o]=B.useState(!1),[h,l]=B.useState(()=>lb()),[u,d]=B.useState(()=>Hx()),g=B.useRef(null);if(B.useEffect(()=>{const A=()=>d(Hx());window.addEventListener(wy,A);const j=window.setInterval(A,4e3);return()=>{window.removeEventListener(wy,A),window.clearInterval(j)}},[]),B.useEffect(()=>{const A=j=>{const E=j.detail;E&&l(E)};return window.addEventListener(Bf,A),()=>window.removeEventListener(Bf,A)},[]),B.useEffect(()=>{i!=null&&i.sleep_started_at&&Hx()!=null&&Qle()},[i==null?void 0:i.sleep_started_at]),B.useEffect(()=>{if(!s)return;const A=E=>{var L;(L=g.current)!=null&&L.contains(E.target)||o(!1)},j=E=>{E.key==="Escape"&&o(!1)};return document.addEventListener("mousedown",A,!0),window.addEventListener("keydown",j,!0),()=>{document.removeEventListener("mousedown",A,!0),window.removeEventListener("keydown",j,!0)}},[s]),!i)return null;const f=Math.max(0,i.debt),m=!!i.sleep_started_at,y=!m&&u!=null,w=m?"must_sleep":oF(f),_=m?"sleeps":y?"sleepy":lF(f),b=m?100:Math.min(100,f/Lg*100),x=e(`sleep.${w}`),C=uF(n)&&h.enabled,k=()=>{o(!1),Zle(),Yle()},T=()=>{o(!1),r==null||r()},N=m?e("sleep.active"):y?e("sleep.waiting"):`${x} · ${f}/${Lg} ${e("sleep.debt")}`;return a.jsxs("div",{className:"sleep-tracker-wrap",ref:g,children:[a.jsxs("button",{type:"button",className:`sleep-tracker sleep-tracker--${w}${m?" sleep-tracker--sleeping":""}${y?" sleep-tracker--waiting":""}`,"data-no-drag":!0,onClick:()=>o(A=>!A),title:N,"aria-haspopup":"menu","aria-expanded":s,"aria-label":m?e("sleep.active"):y?e("sleep.waiting"):`${e("sleep.level")}: ${x}. ${e("sleep.debt")} ${f} / ${Lg}.`,children:[a.jsx("span",{className:"sleep-tracker-face","aria-hidden":!0,children:a.jsx(lc,{mood:_,size:30,compact:!0})}),a.jsxs("span",{className:"sleep-tracker-body",children:[a.jsxs("span",{className:"sleep-tracker-top",children:[a.jsx("span",{className:"sleep-tracker-level",children:m?e("sleep.active"):y?e("sleep.waiting"):x}),m?a.jsxs("span",{className:"sleep-tracker-zzz","aria-hidden":!0,children:[a.jsx("span",{children:"z"}),a.jsx("span",{children:"z"}),a.jsx("span",{children:"z"})]}):y?a.jsxs("span",{className:"sleep-tracker-wait-dots","aria-hidden":!0,children:[a.jsx("span",{children:"·"}),a.jsx("span",{children:"·"}),a.jsx("span",{children:"·"})]}):a.jsxs("span",{className:"sleep-tracker-count",children:[f,a.jsxs("span",{className:"sleep-tracker-count-max",children:["/",Lg]})]})]}),a.jsx("span",{className:"sleep-tracker-bar","aria-hidden":!0,children:a.jsx("span",{className:"sleep-tracker-fill",style:{width:`${b}%`}})})]})]}),s&&a.jsxs("div",{className:"sleep-tracker-menu",role:"menu",children:[a.jsxs("button",{type:"button",className:"sleep-tracker-menu-item",role:"menuitem",onClick:T,disabled:!r,children:[a.jsx("span",{className:"sleep-tracker-menu-glyph","aria-hidden":!0,children:"☾"}),a.jsx("span",{className:"sleep-tracker-menu-label",children:e("sleep.menu.details")})]}),a.jsxs("button",{type:"button",className:"sleep-tracker-menu-item",role:"menuitem",onClick:k,disabled:!C||m||y,title:m?e("sleep.menu.run.active"):y?e("sleep.menu.run.waiting"):C?void 0:e("sleep.menu.run.disabled"),children:[a.jsx("span",{className:"sleep-tracker-menu-glyph","aria-hidden":!0,children:"▸"}),a.jsx("span",{className:"sleep-tracker-menu-label",children:e("sleep.menu.run")}),m&&a.jsx("span",{className:"sleep-tracker-menu-hint",children:e("sleep.active")}),y&&a.jsx("span",{className:"sleep-tracker-menu-hint",children:e("sleep.waiting")})]})]})]})}const Qd=[.85,.9,1,1.1,1.2],_F="dreamcontext-zoom";function ece(){try{const r=localStorage.getItem(_F);if(r!==null){const e=parseFloat(r);if(Qd.includes(e))return e}}catch{}return 1}function tce(r){document.documentElement.style.setProperty("--zoom",String(r)),window.dispatchEvent(new CustomEvent("dreamcontext-zoom",{detail:r}))}function rce(){if(typeof window>"u")return"";try{return new URLSearchParams(window.location.search).get("vault")??""}catch{return""}}function ice({onNavigate:r,sidebarCollapsed:e,onToggleSidebar:i,onOpenSearch:n}){const{theme:s,setTheme:o,resolved:h}=Kf(),l=Pt(),[u,d]=B.useState(ece),[g,f]=B.useState(!1),m=rce(),y=async()=>{f(!0);try{await l.refetchQueries({type:"active"})}finally{f(!1)}};B.useEffect(()=>{tce(u)},[u]);const w=()=>{o(s==="system"?"light":s==="light"?"dark":"system")},_=s==="system"?`System (${h})`:h==="dark"?"Dark":"Light",b=Qd.indexOf(u),x=b>0,C=b<Qd.length-1,k=T=>{const N=b+T;if(N<0||N>=Qd.length)return;const A=Qd[N];d(A);try{localStorage.setItem(_F,String(A))}catch{}};return a.jsxs("header",{className:"header",onMouseDown:NB,onDoubleClick:T=>void jB(T.target),children:[a.jsxs("div",{className:"header-left",children:[a.jsx("button",{className:"header-icon-btn","data-testid":"sidebar-collapse",onClick:i,title:e?"Expand sidebar":"Collapse sidebar","aria-label":e?"Expand sidebar":"Collapse sidebar","aria-expanded":!e,children:a.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[a.jsx("rect",{x:"1.4",y:"2.4",width:"13.2",height:"11.2",rx:"2.2",stroke:"currentColor",strokeWidth:"1.4"}),a.jsx("line",{x1:"6.1",y1:"2.8",x2:"6.1",y2:"13.2",stroke:"currentColor",strokeWidth:"1.4"})]})}),a.jsxs("button",{className:"header-search-pill","data-no-drag":!0,onClick:n,title:"Search the brain (⌘K)","aria-label":"Search the brain",children:[a.jsx("span",{className:"header-search-pill-icon","aria-hidden":"true",children:a.jsx(Zm,{size:14})}),a.jsx("span",{className:"header-search-pill-text",children:"Search the brain…"}),a.jsx("kbd",{className:"header-search-pill-kbd",children:"⌘K"})]})]}),m&&a.jsx("div",{className:"header-vault",title:m,children:m}),a.jsxs("div",{className:"header-right",children:[a.jsx(Jle,{onOpen:r?()=>r("sleep"):void 0}),a.jsx("button",{className:`header-refresh ${g?"header-refresh--spinning":""}`,onClick:y,disabled:g,title:"Refresh now","aria-label":"Refresh now",children:a.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M13.65 4.5A6 6 0 1 0 14 8"}),a.jsx("path",{d:"M14 2v3h-3"})]})}),a.jsx(Fle,{onManagePacks:r?()=>r("packs"):void 0}),a.jsxs("div",{className:"zoom-controls",children:[a.jsx("button",{className:"zoom-btn",onClick:()=>k(-1),disabled:!x,title:"Zoom out",children:"-"}),a.jsxs("span",{className:"zoom-label",children:[Math.round(u*100),"%"]}),a.jsx("button",{className:"zoom-btn",onClick:()=>k(1),disabled:!C,title:"Zoom in",children:"+"})]}),a.jsx("button",{className:"theme-toggle",onClick:w,title:`Theme: ${_}`,children:h==="dark"?a.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:a.jsx("path",{d:"M8 1a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 1zm0 10a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 11zm7-3a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 15 8zM5 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 5 8zm7.07-4.07a.5.5 0 0 1 0 .71l-1.41 1.41a.5.5 0 1 1-.71-.71l1.41-1.41a.5.5 0 0 1 .71 0zM6.05 10.66a.5.5 0 0 1 0 .71l-1.41 1.41a.5.5 0 0 1-.71-.71l1.41-1.41a.5.5 0 0 1 .71 0zm7.72 3.12a.5.5 0 0 1-.71 0l-1.41-1.41a.5.5 0 1 1 .71-.71l1.41 1.41a.5.5 0 0 1 0 .71zM5.34 6.05a.5.5 0 0 1-.71 0L3.22 4.64a.5.5 0 0 1 .71-.71l1.41 1.41a.5.5 0 0 1 0 .71zM8 4a4 4 0 1 0 0 8 4 4 0 0 0 0-8z"})}):a.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:a.jsx("path",{d:"M6 .278a.768.768 0 0 1 .08.858 7.208 7.208 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277.527 0 1.04-.055 1.533-.16a.787.787 0 0 1 .81.316.733.733 0 0 1-.031.893A8.349 8.349 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.752.752 0 0 1 6 .278z"})})})]})]})}function cb({size:r=34,glow:e=!1,className:i,title:n}){return a.jsx("img",{src:"/logo.png",width:r,height:r,className:i,alt:n??"dreamcontext",draggable:!1,style:{objectFit:"contain",...e?{filter:"drop-shadow(0 6px 16px rgba(123,104,238,0.35))"}:{}}})}const nce={fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round"};function gs({children:r}){return a.jsx("svg",{viewBox:"0 0 24 24",width:"14",height:"14",...nce,"aria-hidden":"true",children:r})}function sce(){return a.jsxs(gs,{children:[a.jsx("path",{d:"M3.5 6.5 5 8l2.4-2.6"}),a.jsx("line",{x1:"10",y1:"6.5",x2:"20.5",y2:"6.5"}),a.jsx("path",{d:"M3.5 12 5 13.5 7.4 10.9"}),a.jsx("line",{x1:"10",y1:"12",x2:"20.5",y2:"12"}),a.jsx("line",{x1:"3.5",y1:"17.5",x2:"6.5",y2:"17.5"}),a.jsx("line",{x1:"10",y1:"17.5",x2:"20.5",y2:"17.5"})]})}function ace(){return a.jsxs(gs,{children:[a.jsx("line",{x1:"3",y1:"4.5",x2:"21",y2:"4.5"}),a.jsx("rect",{x:"3",y:"7.4",width:"11",height:"3.2",rx:"1.2"}),a.jsx("rect",{x:"8",y:"13.2",width:"13",height:"3.2",rx:"1.2"}),a.jsx("rect",{x:"3",y:"19",width:"8",height:"3.2",rx:"1.2"}),a.jsx("line",{x1:"10",y1:"3",x2:"10",y2:"21",strokeDasharray:"1.6 2",opacity:"0.55"})]})}function oce(){return a.jsxs(gs,{children:[a.jsx("path",{d:"M3 5.5h9a1.8 1.8 0 0 1 1.8 1.8v3.4A1.8 1.8 0 0 1 12 12.5H7l-3 2.6V12.5a1.8 1.8 0 0 1-1-1.6V7.3A1.8 1.8 0 0 1 3 5.5z"}),a.jsx("path",{d:"M21 11.5v3.4a1.8 1.8 0 0 1-1.8 1.8H16l-2.4 2.1v-2.1"})]})}function lce(){return a.jsxs(gs,{children:[a.jsx("path",{d:"M6 3.5h12l3.5 5.5L12 21 2.5 9z"}),a.jsx("path",{d:"M2.5 9h19"}),a.jsx("path",{d:"M9 3.5 7 9l5 12 5-12-2-5.5"})]})}function cce(){return a.jsxs(gs,{children:[a.jsx("path",{d:"M12 6.2C10.1 4.9 7.8 4.2 5 4.2c-.9 0-1.7.1-2.5.3v13c.8-.2 1.6-.3 2.5-.3 2.8 0 5.1.7 7 2"}),a.jsx("path",{d:"M12 6.2c1.9-1.3 4.2-2 7-2 .9 0 1.7.1 2.5.3v13c-.8-.2-1.6-.3-2.5-.3-2.8 0-5.1.7-7 2"}),a.jsx("line",{x1:"12",y1:"6.2",x2:"12",y2:"19.2"})]})}function hce(){return a.jsxs(gs,{children:[a.jsx("path",{d:"M3 11.4V5a2 2 0 0 1 2-2h6.4a2 2 0 0 1 1.4.6l7 7a2 2 0 0 1 0 2.8l-6.4 6.4a2 2 0 0 1-2.8 0l-7-7A2 2 0 0 1 3 11.4z"}),a.jsx("circle",{cx:"7.6",cy:"7.6",r:"1.3"})]})}function uce(){return a.jsxs(gs,{children:[a.jsx("circle",{cx:"6",cy:"6",r:"2.1"}),a.jsx("circle",{cx:"18",cy:"7.5",r:"2.1"}),a.jsx("circle",{cx:"8.5",cy:"18",r:"2.1"}),a.jsx("circle",{cx:"17.5",cy:"17",r:"2.1"}),a.jsx("line",{x1:"7.7",y1:"7.4",x2:"8.2",y2:"15.9"}),a.jsx("line",{x1:"8",y1:"6.4",x2:"15.9",y2:"7.1"}),a.jsx("line",{x1:"10.6",y1:"17.7",x2:"15.4",y2:"17.2"}),a.jsx("line",{x1:"17.6",y1:"9.5",x2:"9.5",y2:"16.2"})]})}function dce(){return a.jsx(gs,{children:a.jsx("path",{d:"M20.5 14.6A8.2 8.2 0 0 1 9.4 3.5a8.2 8.2 0 1 0 11.1 11.1z"})})}function fce(){return a.jsxs(gs,{children:[a.jsx("path",{d:"M12 3 21.5 8 12 13 2.5 8z"}),a.jsx("path",{d:"M2.5 12 12 17l9.5-5"}),a.jsx("path",{d:"M2.5 16 12 21l9.5-5"})]})}function pce(){return a.jsxs(gs,{children:[a.jsx("line",{x1:"3.5",y1:"8",x2:"20.5",y2:"8"}),a.jsx("circle",{cx:"9",cy:"8",r:"2.2"}),a.jsx("line",{x1:"3.5",y1:"16",x2:"20.5",y2:"16"}),a.jsx("circle",{cx:"15",cy:"16",r:"2.2"})]})}function gce(){return a.jsxs(gs,{children:[a.jsx("path",{d:"M12 2.8a6 6 0 0 1 3.7 10.7c-.75.6-1.2 1.3-1.2 2.1v.9H9.5v-.9c0-.8-.45-1.5-1.2-2.1A6 6 0 0 1 12 2.8z"}),a.jsx("line",{x1:"9.8",y1:"19.4",x2:"14.2",y2:"19.4"}),a.jsx("line",{x1:"10.6",y1:"21.4",x2:"13.4",y2:"21.4"})]})}function mce(){return a.jsxs(gs,{children:[a.jsx("circle",{cx:"12",cy:"12",r:"9"}),a.jsx("path",{d:"M9.3 9.2a2.8 2.8 0 0 1 5.4 1c0 1.9-2.7 2.5-2.7 2.5"}),a.jsx("circle",{cx:"11.9",cy:"16.6",r:"0.7",fill:"currentColor",stroke:"none"})]})}const yce={tasks:sce,roadmap:ace,lab:gce,council:oce,core:lce,knowledge:cce,taxonomy:hce,brain:uce,sleep:dce,packs:fce,settings:pce,about:mce};function bce({page:r}){const e=yce[r];return e?a.jsx(e,{}):null}function Xo({size:r=16}){return a.jsx("svg",{width:r,height:r,viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:a.jsx("path",{d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8Z"})})}const vce=300;function xce(){const{t:r}=wr(),{data:e,isLoading:i}=VC(),n=h7(),s=u7(),o=d7(),h=f7(),[l,u]=B.useState("idle"),[d,g]=B.useState(null),[f,m]=B.useState(null),[y,w]=B.useState(!1),[_,b]=B.useState(""),[x,C]=B.useState(null),k=B.useRef(null),T=B.useRef(0),N=B.useRef(!1),A=B.useCallback(()=>{N.current=!0,k.current&&(clearTimeout(k.current),k.current=null)},[]);B.useEffect(()=>()=>A(),[A]);const j=B.useCallback((z,H)=>{N.current||(k.current=setTimeout(async()=>{if(!N.current){if(T.current+=1,T.current>vce){u("error"),m(r("brain.auth.device.expired"));return}try{const P=await s.mutateAsync(z);if(N.current)return;switch(P.status){case"authorized":A(),u("idle"),g(null);break;case"slow_down":j(z,P.interval);break;case"pending":j(z,H);break;case"expired":A(),u("error"),m(r("brain.auth.device.expired"));break;case"denied":A(),u("error"),m(r("brain.auth.device.denied"));break;default:A(),u("error"),m(P.message??r("brain.auth.device.error"))}}catch(P){A(),u("error"),m(P instanceof Error?P.message:String(P))}}},Math.max(1,H)*1e3))},[s,A,r]),E=async()=>{m(null),u("starting"),N.current=!1,T.current=0;try{const z=await n.mutateAsync();g({userCode:z.userCode,verificationUri:z.verificationUri}),u("waiting"),j(z.sessionId,z.interval)}catch(z){u("error"),m(z instanceof Error?z.message:String(z))}},L=()=>{A(),u("idle"),g(null)},O=async()=>{C(null);try{await o.mutateAsync(_.trim()),b(""),w(!1)}catch(z){C(z instanceof Error?z.message:String(z))}};if(i)return a.jsx("p",{className:"settings-field-hint",children:r("common.loading")});const D=a.jsxs("div",{className:"gh-login-pat-form",children:[a.jsx("p",{className:"settings-field-hint",children:r("brain.auth.pat.hint")}),a.jsxs("div",{className:"settings-field-row",children:[a.jsx("input",{type:"password",className:"settings-text-input",autoComplete:"off",placeholder:r("brain.auth.pat.placeholder"),value:_,onChange:z=>b(z.target.value)}),a.jsx("button",{type:"button",className:"btn btn--primary",onClick:O,disabled:o.isPending||!_.trim(),children:o.isPending?r("brain.auth.pat.submitting"):r("brain.auth.pat.submit")})]}),x&&a.jsxs("p",{className:"settings-test-err",children:["✗ ",x]})]}),K=(e==null?void 0:e.oauthConfigured)===!1?a.jsxs("div",{className:"gh-login gh-login--pat-primary",children:[a.jsx("p",{className:"gh-login-disclosure",children:r("brain.auth.oauthUnavailable")}),D]}):a.jsxs("div",{className:"gh-login",children:[a.jsx("p",{className:"gh-login-disclosure",children:r("brain.auth.scopeDisclosure")}),l==="waiting"&&d?a.jsxs("div",{className:"gh-login-device",children:[a.jsx("p",{className:"gh-login-device-hint",children:r("brain.auth.device.hint")}),a.jsx("div",{className:"gh-login-code",children:d.userCode}),a.jsx("a",{className:"btn btn--primary gh-login-open",href:d.verificationUri,target:"_blank",rel:"noreferrer",children:r("brain.auth.device.open")}),a.jsxs("p",{className:"gh-login-waiting",children:[a.jsx("span",{className:"gh-login-spinner","aria-hidden":"true"}),r("brain.auth.device.waiting")]}),a.jsx("button",{type:"button",className:"btn btn--ghost",onClick:L,children:r("common.cancel")})]}):a.jsxs("button",{type:"button",className:"btn btn--primary gh-login-start",onClick:E,disabled:l==="starting",children:[a.jsx(Xo,{size:15}),r(l==="starting"?"brain.auth.device.starting":"brain.auth.continueWithGithub")]}),f&&a.jsxs("p",{className:"settings-test-err",children:["✗ ",f]}),a.jsx("button",{type:"button",className:"gh-login-pat-toggle",onClick:()=>w(z=>!z),children:r(y?"brain.auth.pat.hide":"brain.auth.pat.recommend")}),y&&D]});return e!=null&&e.connected&&!(e!=null&&e.needsReconnect)?a.jsxs("div",{className:"gh-login gh-login--connected",children:[a.jsxs("span",{className:"gh-login-badge",children:[a.jsx(Xo,{size:15}),e.login?r("brain.auth.signedInAs").replace("{login}",e.login):r("brain.auth.signedIn")]}),a.jsx("button",{type:"button",className:"btn btn--ghost gh-login-logout",onClick:()=>h.mutate(),disabled:h.isPending,children:r("brain.auth.signOut")})]}):e!=null&&e.connected&&(e!=null&&e.needsReconnect)?a.jsxs("div",{className:"gh-login gh-login--expired",children:[a.jsxs("span",{className:"gh-login-badge gh-login-badge--expired",children:[a.jsx(Xo,{size:15}),e.login?r("brain.auth.expiredAs").replace("{login}",e.login):r("brain.auth.expired")]}),a.jsx("p",{className:"settings-field-hint gh-login-expired-hint",children:r("brain.auth.expiredHint")}),K,a.jsx("button",{type:"button",className:"btn btn--ghost gh-login-logout",onClick:()=>h.mutate(),disabled:h.isPending,children:r("brain.auth.signOut")})]}):K}const dC="dreamcontext-run-brain-resolve",rL="Resolve",iL="Think hard. Run the /dream-sync flow for THIS project now, fully autonomously — do NOT ask any questions. Reconcile the brain repo with the team: resume the deferred team merge (`dreamcontext brain sync --resume`), read the conflict report base/ours/theirs snapshots, write the correct semantic merge for every deferred prose file, then hand back with `dreamcontext brain sync --continue` to commit and push. When finished, reply with a SHORT Markdown summary of what you reconciled.";function _ce(){window.dispatchEvent(new CustomEvent(dC))}const nL="dreamcontext brain sync --resume # then run /dream-sync in Claude Code, then: dreamcontext brain sync --continue",CF="dreamcontext.dashboard.autoCheckpointOnOpen",Cce="dreamcontext-auto-checkpoint-pref";function wF(){try{return window.localStorage.getItem(CF)!=="0"}catch{return!0}}function wce(r){try{window.localStorage.setItem(CF,r?"1":"0")}catch{}try{window.dispatchEvent(new CustomEvent(Cce,{detail:r}))}catch{}}const kce=4e3,Sce=1600;function Tce({size:r=14}){return a.jsxs("svg",{width:r,height:r,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M13.5 8a5.5 5.5 0 1 1-1.6-3.9"}),a.jsx("path",{d:"M13.7 2.2v2.9h-2.9"})]})}function Ece({size:r=13}){return a.jsxs("svg",{width:r,height:r,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.4","aria-hidden":"true",children:[a.jsx("circle",{cx:"8",cy:"8",r:"2.1"}),a.jsx("path",{d:"M8 1.5v1.7M8 12.8v1.7M1.5 8h1.7M12.8 8h1.7M3.4 3.4l1.2 1.2M11.4 11.4l1.2 1.2M12.6 3.4l-1.2 1.2M4.6 11.4l-1.2 1.2",strokeLinecap:"round"})]})}function Nce({onOpenSettings:r}){const{t:e}=wr(),{data:i}=KC(),{data:n}=Ek(),s=p7(),o=g7(),h=uF(n)&&lb().enabled,l=(i==null?void 0:i.mergeKind)??null,u=(i==null?void 0:i.codeConflicts)??[],[d,g]=B.useState(null),[f,m]=B.useState(null),[y,w]=B.useState([]),[_,b]=B.useState(null),[x,C]=B.useState(null),[k,T]=B.useState(!1),[N,A]=B.useState(!1),j=B.useRef(null),E=B.useRef(null),L=B.useRef(!1);B.useEffect(()=>()=>{j.current!==null&&window.clearTimeout(j.current),E.current!==null&&window.clearTimeout(E.current)},[]);const O=F=>{g(F),j.current!==null&&window.clearTimeout(j.current),j.current=window.setTimeout(()=>g(null),kce)},D=(F,G={})=>{s.isPending||(g(null),m(null),w([]),b(null),C(null),s.mutate({mode:F,noCheckpoint:G.noCheckpoint},{onSettled:(U,X)=>{var ee;if(X||!U){O({kind:"warn",message:e("brain.sidebar.refreshFailed")});return}switch(U.checkpointed&&U.checkpointSha&&C(U.checkpointSha),U.action){case"error":m(U.failure??{kind:"unknown",recovery:"retry",message:U.note??e("brain.sidebar.refreshFailed")}),O({kind:"warn",message:e("brain.sync.failed")});break;case"no-remote":U.failure?m(U.failure):b(U.note??e("brain.sidebar.refreshFailed")),O({kind:"warn",message:U.note??e("brain.sidebar.refreshFailed")});break;case"blocked-scrub":w(((ee=U.scrub)==null?void 0:ee.blocks)??[]),O({kind:"warn",message:e("brain.sidebar.refreshBlocked")});break;case"awaiting-agent":case"already-awaiting-agent":O({kind:"warn",message:e("brain.sidebar.refreshAwaitingAgent")});break;case"code-conflict":O({kind:"warn",message:e("brain.sync.codeConflictShort")});break;case"user-merge-in-progress":O({kind:"warn",message:e("brain.sync.userMergeShort")});break;case"detached-head":b(e("brain.sync.detachedShort")),O({kind:"warn",message:e("brain.sync.detachedShort")});break;case"pulled":O({kind:"ok",message:e("brain.sidebar.refreshPulled").replace("{n}",String(U.pulledUpdates??0))});break;case"pushed":O({kind:"ok",message:e("brain.sidebar.refreshPushed")});break;case"noop":G.silentNoop||O({kind:"ok",message:e("brain.sidebar.refreshUpToDate")});break;default:O({kind:"warn",message:U.note??e("brain.sidebar.refreshFailed")})}}}))};B.useEffect(()=>{L.current||(L.current=!0,D("pull-only",{silentNoop:!0,noCheckpoint:!wF()}))},[]);const K=()=>{h?(_ce(),O({kind:"ok",message:e("brain.resolve.launching")}),T(!1)):T(F=>!F)},z=()=>{var F;try{(F=navigator.clipboard)==null||F.writeText(nL),A(!0),E.current!==null&&window.clearTimeout(E.current),E.current=window.setTimeout(()=>A(!1),Sce)}catch{}},H=F=>{switch(F.recovery){case"reconnect-github":return{label:e("brain.recovery.reconnect"),onClick:r};case"check-permissions":return{label:e("brain.recovery.checkPerms"),onClick:r};case"retry":return{label:e("brain.recovery.retry"),onClick:()=>D("auto")};case"manual":return{label:e("brain.recovery.openSettings"),onClick:r};case"wait-online":return null;default:return{label:e("brain.recovery.retry"),onClick:()=>D("auto")}}},P=f?e("brain.sidebar.refreshFailed"):y.length>0?e("brain.sidebar.refreshBlocked"):l==="code"?e("brain.sync.codeConflictShort"):l==="user"?e("brain.sync.userMergeShort"):l==="agent"?e("brain.sidebar.refreshAwaitingAgent"):_,$=(d==null?void 0:d.message)??(s.isPending?e("brain.sidebar.syncing"):P??e("brain.sidebar.syncedProject")),W=(d==null?void 0:d.kind)??(P?"warn":null),V=f?H(f):null;return a.jsxs("div",{className:"sidebar-brain-sync sidebar-brain-sync--connected",children:[l==="agent"&&a.jsxs("button",{className:"sidebar-sync-resolve",onClick:K,title:e("brain.sidebar.resolveTip"),children:[a.jsx("span",{className:"sidebar-sync-resolve-icon","aria-hidden":"true",children:"⚠"}),a.jsx("span",{className:"sidebar-sync-resolve-label",children:e("brain.sidebar.resolveLabel")}),a.jsx("span",{className:"sidebar-sync-resolve-cta","aria-hidden":"true",children:"▸"})]}),l==="agent"&&k&&a.jsxs("div",{className:"brain-sync-panel brain-sync-panel--info",children:[a.jsx("p",{className:"brain-sync-panel-title",children:e("brain.resolve.fallbackTitle")}),a.jsx("code",{className:"brain-sync-cmd",children:nL}),a.jsx("button",{className:"brain-sync-panel-btn",onClick:z,children:e(N?"brain.resolve.copied":"brain.resolve.copy")})]}),l==="code"&&a.jsxs("div",{className:"brain-sync-panel brain-sync-panel--warn",children:[a.jsx("p",{className:"brain-sync-panel-title",children:e("brain.code.title")}),u.length>0&&a.jsxs("ul",{className:"brain-sync-files",children:[u.slice(0,4).map(F=>a.jsx("li",{children:a.jsx("code",{children:F})},F)),u.length>4&&a.jsx("li",{children:e("brain.code.more").replace("{n}",String(u.length-4))})]}),a.jsx("p",{className:"brain-sync-panel-hint",children:e("brain.code.hint")}),a.jsx("button",{className:"brain-sync-panel-btn",onClick:()=>D("auto"),children:e("brain.recovery.retry")})]}),l==="user"&&a.jsxs("div",{className:"brain-sync-panel brain-sync-panel--warn",children:[a.jsx("p",{className:"brain-sync-panel-title",children:e("brain.userMerge.title")}),a.jsx("p",{className:"brain-sync-panel-hint",children:e("brain.userMerge.hint")})]}),f&&a.jsxs("div",{className:`brain-sync-panel brain-sync-panel--${f.kind==="network"?"info":"error"}`,children:[a.jsx("p",{className:"brain-sync-panel-title",children:f.message}),(f.kind==="auth"||f.kind==="no-token")&&a.jsx("span",{className:"brain-sync-panel-mark","aria-hidden":"true",children:a.jsx(Xo,{size:13})}),V&&a.jsx("button",{className:"brain-sync-panel-btn",onClick:V.onClick,children:V.label})]}),y.length>0&&a.jsxs("div",{className:"brain-sync-panel brain-sync-panel--error",children:[a.jsx("p",{className:"brain-sync-panel-title",children:e("brain.scrub.title")}),a.jsx("ul",{className:"brain-sync-files",children:y.slice(0,4).map((F,G)=>a.jsxs("li",{children:[a.jsxs("code",{children:[F.file,":",F.line]})," ",a.jsx("span",{className:"brain-sync-rule",children:F.rule}),Ace(F.file)&&a.jsx("button",{className:"brain-sync-inline-btn",disabled:o.isPending,onClick:()=>o.mutate(F.file,{onSuccess:()=>D("auto")}),children:e("brain.scrub.ignore")})]},`${F.file}:${F.line}:${G}`))}),a.jsx("p",{className:"brain-sync-panel-hint",children:e("brain.scrub.hint")})]}),x&&a.jsxs("div",{className:"brain-sync-note",title:e("brain.checkpoint.undo").replace("{sha}",x.slice(0,7)),children:[a.jsx("span",{"aria-hidden":"true",children:"✓"})," ",e("brain.checkpoint.note")]}),a.jsxs("div",{className:"sidebar-brain-sync-row",children:[a.jsxs("button",{className:`sidebar-item sidebar-item--synced${s.isPending?" sidebar-item--syncing":""}`,onClick:()=>D("auto"),disabled:s.isPending,title:e("brain.sidebar.syncNowTip"),children:[a.jsx("span",{className:`sidebar-icon${s.isPending?" sidebar-icon--spin":""}`,children:s.isPending?a.jsx(Tce,{size:14}):a.jsx(Xo,{size:14})}),a.jsx("span",{className:`sidebar-label${W?` sidebar-label--sync-${W}`:""}`,role:"status","aria-live":"polite",children:$})]}),a.jsx("button",{className:"sidebar-sync-settings",onClick:r,title:e("brain.sidebar.settingsTip"),"aria-label":e("brain.sidebar.settingsTip"),children:a.jsx(Ece,{})})]})]})}const jce=/(^|\/)([^/]*\.env(\.[^/]+)?|[^/]*\.local\.[^/]+|[^/]*secrets?[^/]*\.(json|ya?ml|toml|env)|credentials?[^/]*\.(json|ya?ml|toml|env)|[^/]*\.(pem|key|p12|pfx|keystore|jks)|id_rsa[^/]*|id_ed25519[^/]*)$/i;function Ace(r){const e=r.replace(/\\/g,"/").trim();return!e||/[!#*?[\]\r\n\0]/.test(e)||e.startsWith("/")||e.split("/").includes("..")?!1:jce.test(e)}function Mce(){if(typeof window>"u")return"";try{return new URLSearchParams(window.location.search).get("vault")??""}catch{return""}}const Lce=[{labelKey:"nav.group.workspace",items:[{page:"tasks",labelKey:"nav.tasks"},{page:"roadmap",labelKey:"nav.roadmap",beta:!0},{page:"lab",labelKey:"nav.labpage",lab:!0},{page:"council",labelKey:"nav.council",lab:!0}]},{labelKey:"nav.group.memory",items:[{page:"core",labelKey:"nav.core"},{page:"knowledge",labelKey:"nav.knowledge"},{page:"taxonomy",labelKey:"nav.taxonomy"}]},{labelKey:"nav.group.brain",items:[{page:"brain",labelKey:"nav.brain"},{page:"sleep",labelKey:"nav.sleep"}]},{labelKey:"nav.group.control",items:[{page:"packs",labelKey:"nav.packs"},{page:"settings",labelKey:"nav.settings"}]}],sL="dreamcontext.dashboard.aboutSeen",aL="dreamcontext.dashboard.githubSyncSeen";function oL(r){if(typeof window>"u")return!1;try{return window.localStorage.getItem(r)==="1"}catch{return!1}}function lL(r){try{window.localStorage.setItem(r,"1")}catch{}}function Rce({activePage:r,onNavigate:e,collapsed:i}){const{t:n}=wr(),[s,o]=B.useState(()=>oL(sL)),[h,l]=B.useState(()=>oL(aL)),{data:u}=VC(),{data:d}=KC(),g=Mce(),f=!!(u!=null&&u.connected),m=!!(d!=null&&d.hasRemote),y=()=>{s||(o(!0),lL(sL)),e("about")},w=()=>{h||(l(!0),lL(aL)),e("settings","brain")},_=!s&&r!=="about",b=!h,x=n(f?m?"brain.sidebar.synced":"brain.sidebar.setup":"brain.sidebar.connect");let C=0;return a.jsxs("nav",{className:`sidebar${i?" sidebar--collapsed":""}`,"aria-label":"Primary",children:[a.jsxs("div",{className:"sidebar-brand",title:"dreamcontext",children:[a.jsx(cb,{size:30,glow:!0}),a.jsxs("div",{className:"sidebar-brand-text",children:[a.jsxs("span",{className:"sidebar-brand-word",children:["dream",a.jsx("span",{children:"context"})]}),g&&a.jsx("span",{className:"sidebar-brand-vault",children:g})]})]}),Lce.map(k=>a.jsxs("div",{className:"sidebar-group",children:[a.jsx("span",{className:"sidebar-group-label",children:n(k.labelKey)}),a.jsx("ul",{className:"sidebar-nav",children:k.items.map(({page:T,labelKey:N,lab:A,beta:j})=>{C+=1;const E=n(N),L=A?n("nav.lab"):j?n("nav.beta"):null,O=T==="about";return a.jsx("li",{className:`animate-stagger animate-stagger-${C}`,children:a.jsxs("button",{className:`sidebar-item ${r===T?"sidebar-item--active":""}${O&&_?" sidebar-item--nudge":""}`,onClick:O?y:()=>e(T),title:L?`${E} — ${L}`:E,"aria-current":r===T?"page":void 0,children:[a.jsx("span",{className:"sidebar-icon",children:a.jsx(bce,{page:T})}),a.jsx("span",{className:"sidebar-label",children:E}),A&&a.jsx("span",{className:"sidebar-lab-tag",children:n("nav.lab")}),j&&a.jsx("span",{className:"sidebar-lab-tag sidebar-beta-tag",children:n("nav.beta")})]})},T)})})]},k.labelKey)),a.jsx("div",{className:"sidebar-footer",children:f&&m?a.jsx(Nce,{onOpenSettings:w}):a.jsxs("button",{className:`sidebar-item sidebar-item--brain-sync${b?" sidebar-item--nudge":""}`,onClick:w,title:x,children:[a.jsx("span",{className:"sidebar-icon",children:a.jsx(Xo,{size:14})}),a.jsx("span",{className:"sidebar-label",children:x})]})})]})}function kF(r,e,i=12){const n=r.trim(),s=e.length?e.join(","):"";return Yt({queryKey:["recall",n,s,i],queryFn:()=>{const o=new URLSearchParams({q:n,top:String(i)});return s&&o.set("types",s),De.get(`/recall?${o.toString()}`)},enabled:n.length>0,placeholderData:gz,staleTime:5e3})}async function SF(r,e,i=4){const n=r.trim();if(!n)return[];const s=new URLSearchParams({q:n,top:String(i)});return e.length&&s.set("types",e.join(",")),(await De.get(`/recall?${s.toString()}`)).hits}async function TF(r,e){const i=r.trim();if(!i)return{query:"",mode:"haiku",skip:!1,tookMs:0,hits:[]};const n=new URLSearchParams({q:i});return e.length&&n.set("types",e.join(",")),De.get(`/recall/haiku?${n.toString()}`)}const Bce=new Set(["text","int","integer","numeric","boolean","timestamp","jsonb","json","serial","bigint","smallint","real","double","float","date","time","uuid","bytea","blob","varchar","char","array"]);function Ux(r){const e=r.replace(/\(.*\)/,"").replace(/\[.*\]/,"").toLowerCase();return Bce.has(e)}function Oce(r){const{entities:e,relations:i}=Dce(r),n=Ice(r),s=new Set(e.map(g=>g.name.toLowerCase())),o=[...e,...n.filter(g=>!s.has(g.name.toLowerCase()))],h=Fce(o),l=g=>`${g.from}.${g.fromField}->${g.to}.${g.toField}`,u=new Set(i.map(l)),d=[...i,...h.filter(g=>!u.has(l(g)))];return{entities:o,relations:d}}function Dce(r){const e=[],i=[],n=r.split(`
467
467
  `);let s=null,o=[],h,l=!1,u=null;function d(){s&&o.length>0&&e.push({name:s,path:h,fields:o,storageType:"table",notes:[]}),s=null,h=void 0,o=[],l=!1,u=null}for(let g=0;g<n.length;g++){const f=n[g],m=f.trim();if(/^\s*--\s*\d+\.\s+\w+/.test(f)){const L=f.match(/\/\w+\/\{[^}]+\}/);L&&(h=L[0]);continue}const y=m.match(/^CREATE\s+TABLE\s+(?:IF\s+NOT\s+EXISTS\s+)?[`"']?(\w+)[`"']?\s*\(/i);if(y){d(),s=y[1],o=[],l=!0;continue}if(!l||!s)continue;if(/^\s*\)\s*;/.test(f)){d();continue}if(/^\s*--/.test(f)){const O=f.replace(/^\s*--\s?/,"").trim();if(!O||/^[═─=\-*]{3,}/.test(O))continue;if(O.startsWith(".")){const K=O.match(/^\.(\w+(?:\.\w+)*)\s+(\w+(?:(?:\([^)]*\))|(?:\[[\w,\s]*\]))?)\s*(.*)/i);if(K&&Ux(K[2])&&u){const z=K[1],H=K[2].toLowerCase(),$=(K[3]||"").match(/--\s*(.+)$/),W=$?$[1].trim():void 0;o.push({name:`${u}.${z}`,type:H,description:W,isNested:!0,parentField:u})}continue}const D=O.match(/^(\w+(?:\[\])?)\.(\w+(?:\.\w+)*)\s+(\w+(?:(?:\([^)]*\))|(?:\[[\w,\s]*\]))?)\s*(.*)/i);if(D&&Ux(D[3])){const K=D[1].replace(/\[\]$/,""),z=D[2],H=D[3].toLowerCase(),$=(D[4]||"").match(/--\s*(.+)$/),W=$?$[1].trim():void 0;u=K,o.push({name:`${K}.${z}`,type:H,description:W,isNested:!0,parentField:K});continue}continue}if(!m)continue;const _=m.replace(/--.*$/,"").trim().replace(/,\s*$/,"").trim();if(/^(PRIMARY|FOREIGN|UNIQUE|CHECK|CONSTRAINT|INDEX)\b/i.test(_))continue;const b=_.match(/^[`"']?(\w+)[`"']?\s+(\w+(?:(?:\([^)]*\))|(?:\[[\w,\s]*\]))?)\s*(.*)/i);if(!b)continue;const x=b[1],C=b[2],k=b[3]||"";if(!Ux(C))continue;const T=C.toLowerCase(),N=/PRIMARY\s+KEY/i.test(k),A=k.match(/REFERENCES\s+[`"']?(\w+)[`"']?\s*\(\s*[`"']?(\w+)[`"']?\s*\)/i);A&&i.push({from:s,fromField:x,to:A[1],toField:A[2],cardinality:"1:1"});const j=f.match(/--\s*(.+)$/),E=j?j[1].trim():void 0;(T==="jsonb"||T==="json")&&(u=x),o.push({name:x,type:T,isPrimary:N,description:E})}return d(),{entities:e,relations:i}}function Ice(r){var o,h,l,u,d;const e=[];let i=null,n=!1;const s=r.split(`
468
- `);for(let g=0;g<s.length;g++){const m=s[g].match(/^--\s?(.*)/);if(!m)continue;const y=m[1].trim();if(/^={4,}$/.test(y)){i&&i.fields.length>0&&e.push(i),i=null,n=!1;continue}if(/^[A-Z ]+\(/.test(y)&&!y.match(/^[a-z_]/))continue;const w=y.match(/^([A-Z][A-Z _]+?):\s+(\S.+)$/);if(w&&!n){const _=w[1].trim();if(_===_.toUpperCase()&&_.length>1){i&&i.fields.length>0&&e.push(i);const b=w[2].trim();i={name:_,path:b,storageType:b.endsWith(".json")?"json":"file",notes:[],fields:[]},n=!1;continue}}if(i){const _=y.match(/^(?:Created|Managed)\s+by:\s+(.+)/i);if(_){i.managedBy=_[1].trim();continue}}if(y.includes("Fields in YAML frontmatter")||y.startsWith("Schema ")){n=!0;continue}if(y==="["||y==="{"){n=!0;continue}if(!(y==="]"||y==="}"||y==="..."||y==="},")){if(i&&n){const _=y.match(/^([a-z_]\w*):\s+(.+?)(?:\s{2,}--\s+(.+))?$/);if(_){const{type:x,enumValues:C}=cL(_[2].trim(),(o=_[3])==null?void 0:o.trim());i.fields.push({name:_[1],type:x,enumValues:C,description:(h=_[3])==null?void 0:h.trim(),isPrimary:_[1]==="id"});continue}const b=y.match(/^"([a-z_]\w*)":\s+(.+?)(?:,)?(?:\s{2,}--\s+(.+))?$/);if(b){const{type:x,enumValues:C}=cL(b[2].trim(),(l=b[3])==null?void 0:l.trim());i.fields.push({name:b[1],type:x,enumValues:C,description:(u=b[3])==null?void 0:u.trim()});continue}}if(i&&y.startsWith("Body ")&&(i.notes.push(y),y.includes("sections")&&g+1<s.length)){const _=(d=s[g+1])==null?void 0:d.match(/^--\s?(.*)/);_&&/^\s*(Why|[A-Z])/.test(_[1])&&(i.notes.push(_[1].trim()),g++)}}}return i&&i.fields.length>0&&e.push(i),e}function cL(r,e){return r.includes("|")?{type:"enum",enumValues:r.split("|").map(n=>n.trim().replace(/^"|"$/g,""))}:r==="[]"?{type:e!=null&&e.includes("string")?"string[]":"array"}:r.startsWith("[")?{type:"array"}:r==="true"||r==="false"?{type:"boolean"}:r==="null"?{type:"nullable"}:/^\d+$/.test(r)?{type:"number"}:/\d{4}-\d{2}-\d{2}/.test(r.replace(/"/g,""))?{type:"date"}:{type:"string"}}function Fce(r){const e=[];for(const i of r)for(const n of i.fields)if(!n.isNested){if(n.description){const s=n.description.match(/(task|feature|knowledge)\s+IDs?/i);if(s){const o=s[1].toLowerCase(),h=r.find(l=>l.name.toLowerCase().includes(o));if(h&&h.name!==i.name){const l=h.fields.find(u=>u.isPrimary);e.push({from:i.name,fromField:n.name,to:h.name,toField:l?l.name:"_id",cardinality:n.type.includes("array")||n.type==="array"?"1:N":"1:1"})}}}if(n.name==="parent_task"||n.name==="parent_id"){const s=i.fields.find(o=>o.isPrimary);e.push({from:i.name,fromField:n.name,to:i.name,toField:s?s.name:"_id",cardinality:"1:1"})}}return e}function fC(r){return r.toLowerCase().replace(/\s+/g,"-")}function hL(r){return r==="enum"?"enum":r==="array"||r.endsWith("[]")||r.startsWith("array")?"array":r==="boolean"?"boolean":r==="nullable"?"nullable":r==="date"||r==="timestamp"?"date":r==="int"||r==="integer"||r==="numeric"||r==="serial"||r==="bigint"||r==="smallint"||r==="real"||r==="float"||r==="double"?"number":r==="jsonb"||r==="json"?"json":"string"}function $ce(r,e,i){return r.isPrimary?{icon:"PK",cls:"entity-field-icon--key"}:e.some(s=>s.from===i&&s.fromField===r.name)?{icon:"FK",cls:"entity-field-icon--ref"}:null}function Pce(r,e,i,n){if(n){const _=r.right-i.left,b=r.top+r.height*.35-i.top,x=36,C=28;return{d:`M ${_},${b} C ${_+x},${b-C*.3} ${_+x},${b-C*1.3} ${_},${b-C}`,labelX:_+x+4,labelY:b-C*.5}}const s=r.left+r.width/2-i.left,o=e.left+e.width/2-i.left,h=r.top+r.height/2-i.top,l=e.top+e.height/2-i.top,u=Math.abs(s-o),d=Math.abs(h-l);let g,f,m,y;if(u>d){s<o?(g=r.right-i.left,m=e.left-i.left):(g=r.left-i.left,m=e.right-i.left),f=h,y=l;const _=(m-g)*.4;return{d:`M ${g},${f} C ${g+_},${f} ${m-_},${y} ${m},${y}`,labelX:(g+m)/2,labelY:(f+y)/2-10}}g=s,m=o,h<l?(f=r.bottom-i.top,y=e.top-i.top):(f=r.top-i.top,y=e.bottom-i.top);const w=(y-f)*.4;return{d:`M ${g},${f} C ${g},${f+w} ${m},${y-w} ${m},${y}`,labelX:(g+m)/2,labelY:(f+y)/2-10}}function zce({entity:r,relations:e}){const[i,n]=B.useState(new Set),s=r.storageType==="json"?"{ }":r.storageType==="table"?"SQL":"☰",o=r.fields.filter(u=>!u.isNested),h=B.useMemo(()=>{const u=new Map;for(const d of r.fields)if(d.isNested&&d.parentField){const g=u.get(d.parentField)||[];g.push(d),u.set(d.parentField,g)}return u},[r.fields]),l=u=>{n(d=>{const g=new Set(d);return g.has(u)?g.delete(u):g.add(u),g})};return a.jsxs("div",{className:"entity-card","data-entity":fC(r.name),children:[a.jsxs("div",{className:"entity-card-header",children:[a.jsxs("div",{className:"entity-card-title-group",children:[a.jsx("span",{className:"entity-card-category-icon",children:s}),a.jsx("span",{className:"entity-card-name",children:r.name})]}),a.jsx("span",{className:"entity-card-badge","data-storage":r.storageType,children:r.storageType})]}),r.path&&a.jsx("div",{className:"entity-card-path",title:r.path,children:r.path}),r.managedBy&&a.jsx("div",{className:"entity-card-managed",children:r.managedBy}),a.jsx("div",{className:"entity-fields",children:o.map(u=>{const d=$ce(u,e,r.name),g=hL(u.type),f=h.get(u.name),m=i.has(u.name);return a.jsxs(B.Fragment,{children:[a.jsxs("div",{className:`entity-field${f?" entity-field--expandable":""}`,onClick:f?()=>l(u.name):void 0,children:[a.jsx("span",{className:`entity-field-icon ${(d==null?void 0:d.cls)??""}`,children:(d==null?void 0:d.icon)??""}),a.jsx("span",{className:"entity-field-name",children:u.name}),u.type==="enum"&&u.enumValues?a.jsx("span",{className:"entity-field-enum-group",children:u.enumValues.map(y=>a.jsx("span",{className:"entity-field-enum-pill",children:y},y))}):a.jsx("span",{className:"entity-field-type","data-type":g,children:u.type}),f&&a.jsxs("span",{className:"entity-field-toggle",children:[a.jsx("span",{className:`entity-field-toggle-arrow${m?" entity-field-toggle-arrow--open":""}`,children:"▶"}),a.jsx("span",{className:"entity-field-toggle-count",children:f.length})]}),!f&&u.description&&a.jsx("span",{className:"entity-field-desc",title:u.description,children:u.description})]}),f&&m&&f.map(y=>{var b;const w=hL(y.type),_=y.name.slice((((b=y.parentField)==null?void 0:b.length)??0)+1);return a.jsxs("div",{className:"entity-field entity-field--nested",children:[a.jsx("span",{className:"entity-field-icon"}),a.jsxs("span",{className:"entity-field-name entity-field-name--nested",children:[".",_]}),a.jsx("span",{className:"entity-field-type","data-type":w,children:y.type}),y.description&&a.jsx("span",{className:"entity-field-desc",title:y.description,children:y.description})]},y.name)})]},u.name)})}),r.notes.length>0&&a.jsx("div",{className:"entity-card-notes",children:r.notes.map((u,d)=>a.jsx("div",{className:"entity-card-note",children:u},d))})]})}function qce({relations:r,entities:e}){return r.length===0?null:a.jsxs("div",{className:"sql-preview-legend",children:[a.jsx("div",{className:"sql-preview-legend-title",children:"Relationships"}),a.jsx("div",{className:"sql-preview-legend-items",children:r.map((i,n)=>{var l,u;const s=((l=e.find(d=>d.name===i.from))==null?void 0:l.name)??i.from,o=((u=e.find(d=>d.name===i.to))==null?void 0:u.name)??i.to,h=i.from===i.to;return a.jsxs("div",{className:"sql-preview-legend-item",children:[a.jsx("span",{className:"sql-preview-legend-line"}),a.jsx("span",{children:h?`${s}.${i.fromField} ↻ self`:`${s}.${i.fromField} → ${o}.${i.toField}`}),a.jsx("span",{className:"sql-preview-legend-cardinality",children:i.cardinality})]},n)})})]})}function jk({content:r}){const e=B.useRef(null),[i,n]=B.useState([]),[s,o]=B.useState({width:0,height:0}),h=B.useMemo(()=>Oce(r),[r]),l=B.useCallback(()=>{const u=e.current;if(!u||h.relations.length===0){n([]);return}const d=u.getBoundingClientRect();o({width:u.scrollWidth,height:u.scrollHeight});const g=[];for(const f of h.relations){const m=u.querySelector(`[data-entity="${fC(f.from)}"]`),y=u.querySelector(`[data-entity="${fC(f.to)}"]`);if(!m||!y)continue;const w=m.getBoundingClientRect(),_=y.getBoundingClientRect(),{d:b,labelX:x,labelY:C}=Pce(w,_,d,f.from===f.to);g.push({d:b,labelX:x,labelY:C,label:f.cardinality})}n(g)},[h]);if(B.useEffect(()=>{const u=requestAnimationFrame(l),d=new ResizeObserver(l);return e.current&&d.observe(e.current),()=>{cancelAnimationFrame(u),d.disconnect()}},[l]),h.entities.length===0){const u=r.trim().length>0;return a.jsx("div",{className:"sql-preview",children:u?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"sql-preview-empty sql-preview-empty--hint",children:"No table definitions to diagram — showing the raw SQL."}),a.jsx("pre",{className:"sql-preview-raw",children:a.jsx("code",{children:r.trim()})})]}):a.jsx("div",{className:"sql-preview-empty",children:"No schema entities found in this file."})})}return a.jsxs("div",{className:"sql-preview",ref:e,children:[a.jsxs("svg",{className:"sql-preview-svg",width:s.width||"100%",height:s.height||"100%",viewBox:s.width?`0 0 ${s.width} ${s.height}`:void 0,children:[a.jsx("defs",{children:a.jsx("marker",{id:"rel-arrowhead",viewBox:"0 0 10 7",refX:"9",refY:"3.5",markerWidth:"8",markerHeight:"6",orient:"auto",children:a.jsx("polygon",{points:"0 0, 10 3.5, 0 7",className:"sql-preview-arrowhead"})})}),i.map((u,d)=>a.jsxs("g",{children:[a.jsx("path",{d:u.d,className:"sql-preview-line",markerEnd:"url(#rel-arrowhead)"}),a.jsx("rect",{className:"sql-preview-line-label-bg",x:u.labelX-12,y:u.labelY-7,width:24,height:14}),a.jsx("text",{className:"sql-preview-line-label",x:u.labelX,y:u.labelY+4,textAnchor:"middle",children:u.label})]},d))]}),a.jsx("div",{className:"sql-preview-grid",children:h.entities.map(u=>a.jsx(zce,{entity:u,relations:h.relations},u.name))}),a.jsx(qce,{relations:h.relations,entities:h.entities})]})}var Wx={exports:{}},uL;function Hce(){return uL||(uL=1,(function(r){var e=(function(){var i=String.fromCharCode,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",o={};function h(u,d){if(!o[u]){o[u]={};for(var g=0;g<u.length;g++)o[u][u.charAt(g)]=g}return o[u][d]}var l={compressToBase64:function(u){if(u==null)return"";var d=l._compress(u,6,function(g){return n.charAt(g)});switch(d.length%4){default:case 0:return d;case 1:return d+"===";case 2:return d+"==";case 3:return d+"="}},decompressFromBase64:function(u){return u==null?"":u==""?null:l._decompress(u.length,32,function(d){return h(n,u.charAt(d))})},compressToUTF16:function(u){return u==null?"":l._compress(u,15,function(d){return i(d+32)})+" "},decompressFromUTF16:function(u){return u==null?"":u==""?null:l._decompress(u.length,16384,function(d){return u.charCodeAt(d)-32})},compressToUint8Array:function(u){for(var d=l.compress(u),g=new Uint8Array(d.length*2),f=0,m=d.length;f<m;f++){var y=d.charCodeAt(f);g[f*2]=y>>>8,g[f*2+1]=y%256}return g},decompressFromUint8Array:function(u){if(u==null)return l.decompress(u);for(var d=new Array(u.length/2),g=0,f=d.length;g<f;g++)d[g]=u[g*2]*256+u[g*2+1];var m=[];return d.forEach(function(y){m.push(i(y))}),l.decompress(m.join(""))},compressToEncodedURIComponent:function(u){return u==null?"":l._compress(u,6,function(d){return s.charAt(d)})},decompressFromEncodedURIComponent:function(u){return u==null?"":u==""?null:(u=u.replace(/ /g,"+"),l._decompress(u.length,32,function(d){return h(s,u.charAt(d))}))},compress:function(u){return l._compress(u,16,function(d){return i(d)})},_compress:function(u,d,g){if(u==null)return"";var f,m,y={},w={},_="",b="",x="",C=2,k=3,T=2,N=[],A=0,j=0,E;for(E=0;E<u.length;E+=1)if(_=u.charAt(E),Object.prototype.hasOwnProperty.call(y,_)||(y[_]=k++,w[_]=!0),b=x+_,Object.prototype.hasOwnProperty.call(y,b))x=b;else{if(Object.prototype.hasOwnProperty.call(w,x)){if(x.charCodeAt(0)<256){for(f=0;f<T;f++)A=A<<1,j==d-1?(j=0,N.push(g(A)),A=0):j++;for(m=x.charCodeAt(0),f=0;f<8;f++)A=A<<1|m&1,j==d-1?(j=0,N.push(g(A)),A=0):j++,m=m>>1}else{for(m=1,f=0;f<T;f++)A=A<<1|m,j==d-1?(j=0,N.push(g(A)),A=0):j++,m=0;for(m=x.charCodeAt(0),f=0;f<16;f++)A=A<<1|m&1,j==d-1?(j=0,N.push(g(A)),A=0):j++,m=m>>1}C--,C==0&&(C=Math.pow(2,T),T++),delete w[x]}else for(m=y[x],f=0;f<T;f++)A=A<<1|m&1,j==d-1?(j=0,N.push(g(A)),A=0):j++,m=m>>1;C--,C==0&&(C=Math.pow(2,T),T++),y[b]=k++,x=String(_)}if(x!==""){if(Object.prototype.hasOwnProperty.call(w,x)){if(x.charCodeAt(0)<256){for(f=0;f<T;f++)A=A<<1,j==d-1?(j=0,N.push(g(A)),A=0):j++;for(m=x.charCodeAt(0),f=0;f<8;f++)A=A<<1|m&1,j==d-1?(j=0,N.push(g(A)),A=0):j++,m=m>>1}else{for(m=1,f=0;f<T;f++)A=A<<1|m,j==d-1?(j=0,N.push(g(A)),A=0):j++,m=0;for(m=x.charCodeAt(0),f=0;f<16;f++)A=A<<1|m&1,j==d-1?(j=0,N.push(g(A)),A=0):j++,m=m>>1}C--,C==0&&(C=Math.pow(2,T),T++),delete w[x]}else for(m=y[x],f=0;f<T;f++)A=A<<1|m&1,j==d-1?(j=0,N.push(g(A)),A=0):j++,m=m>>1;C--,C==0&&(C=Math.pow(2,T),T++)}for(m=2,f=0;f<T;f++)A=A<<1|m&1,j==d-1?(j=0,N.push(g(A)),A=0):j++,m=m>>1;for(;;)if(A=A<<1,j==d-1){N.push(g(A));break}else j++;return N.join("")},decompress:function(u){return u==null?"":u==""?null:l._decompress(u.length,32768,function(d){return u.charCodeAt(d)})},_decompress:function(u,d,g){var f=[],m=4,y=4,w=3,_="",b=[],x,C,k,T,N,A,j,E={val:g(0),position:d,index:1};for(x=0;x<3;x+=1)f[x]=x;for(k=0,N=Math.pow(2,2),A=1;A!=N;)T=E.val&E.position,E.position>>=1,E.position==0&&(E.position=d,E.val=g(E.index++)),k|=(T>0?1:0)*A,A<<=1;switch(k){case 0:for(k=0,N=Math.pow(2,8),A=1;A!=N;)T=E.val&E.position,E.position>>=1,E.position==0&&(E.position=d,E.val=g(E.index++)),k|=(T>0?1:0)*A,A<<=1;j=i(k);break;case 1:for(k=0,N=Math.pow(2,16),A=1;A!=N;)T=E.val&E.position,E.position>>=1,E.position==0&&(E.position=d,E.val=g(E.index++)),k|=(T>0?1:0)*A,A<<=1;j=i(k);break;case 2:return""}for(f[3]=j,C=j,b.push(j);;){if(E.index>u)return"";for(k=0,N=Math.pow(2,w),A=1;A!=N;)T=E.val&E.position,E.position>>=1,E.position==0&&(E.position=d,E.val=g(E.index++)),k|=(T>0?1:0)*A,A<<=1;switch(j=k){case 0:for(k=0,N=Math.pow(2,8),A=1;A!=N;)T=E.val&E.position,E.position>>=1,E.position==0&&(E.position=d,E.val=g(E.index++)),k|=(T>0?1:0)*A,A<<=1;f[y++]=i(k),j=y-1,m--;break;case 1:for(k=0,N=Math.pow(2,16),A=1;A!=N;)T=E.val&E.position,E.position>>=1,E.position==0&&(E.position=d,E.val=g(E.index++)),k|=(T>0?1:0)*A,A<<=1;f[y++]=i(k),j=y-1,m--;break;case 2:return b.join("")}if(m==0&&(m=Math.pow(2,w),w++),f[j])_=f[j];else if(j===y)_=C+C.charAt(0);else return null;b.push(_),f[y++]=C+_.charAt(0),m--,C=_,m==0&&(m=Math.pow(2,w),w++)}}};return l})();r!=null?r.exports=e:typeof angular<"u"&&angular!=null&&angular.module("LZString",[]).factory("LZString",function(){return e})})(Wx)),Wx.exports}var Uce=Hce();const Wce=/##\s*Drawing\s*```(compressed-json|json)\s*([\s\S]*?)```/;function Gce(r){const e=r.match(Wce);if(!e)return null;const[,i,n]=e;let s;if(i==="compressed-json"){const o=Uce.decompressFromBase64(n.replace(/\s+/g,""));if(!o)return null;s=o}else s=n;try{const o=JSON.parse(s);return Array.isArray(o.elements)?o:null}catch{return null}}function Of(r){return r.endsWith(".excalidraw")}function Kce(){return Yt({queryKey:["knowledge"],queryFn:()=>De.get("/knowledge"),select:r=>r.entries})}function Vce(r){return Yt({queryKey:["knowledge",r],queryFn:()=>De.get(`/knowledge/${r}`),select:e=>e.entry,enabled:!!r,staleTime:1/0,refetchInterval:!1})}function Yce(r,e){return Yt({queryKey:["knowledge-assets",r],queryFn:()=>De.get(`/knowledge-assets/${r}`),select:i=>i.files,enabled:e&&!!r,staleTime:1/0,refetchInterval:!1,refetchOnWindowFocus:!1})}function Xce(r,e,i){const n=Pt();B.useEffect(()=>{!r||e===void 0||i===void 0||e<=i||(n.invalidateQueries({queryKey:["knowledge",r]}),n.invalidateQueries({queryKey:["knowledge-assets",r]}))},[r,e,i,n])}function Zce(){const r=Pt();return Vt({mutationFn:({slug:e,pinned:i})=>De.patch(`/knowledge/${e}`,{pinned:i}),onSuccess:()=>{r.invalidateQueries({queryKey:["knowledge"]})}})}function EF(r,e){const i=`chunk-reloaded:${r}`;return B.lazy(async()=>{try{const n=await e();return window.sessionStorage.removeItem(i),n}catch(n){if(!(window.sessionStorage.getItem(i)==="1"))return window.sessionStorage.setItem(i,"1"),window.location.reload(),new Promise(()=>{});throw window.sessionStorage.removeItem(i),n}})}const Qce=EF("ExcalidrawCanvas",()=>Zt(()=>import("./percentages-BXMCSKIN-BjW3QiBD.js").then(r=>r.E),__vite__mapDeps([53,54,55]))),dL=()=>a.jsxs("div",{className:"excalidraw-loading","aria-live":"polite",children:[a.jsx("span",{className:"excalidraw-spinner","aria-hidden":"true"}),a.jsx("span",{className:"excalidraw-loading-label",children:"Loading diagram…"})]});function NF({content:r,slug:e}){const{resolved:i}=Kf(),n=B.useMemo(()=>Gce(r),[r]),s=B.useMemo(()=>r.includes("## Embedded Files"),[r]),o=Yce(e??"",!!e&&s),h=o.data,l=!!e&&s&&o.isLoading,u=B.useMemo(()=>{const d={...(n==null?void 0:n.files)??{}};if(h)for(const[g,f]of Object.entries(h))d[g]={id:g,mimeType:f.mimeType,dataURL:f.dataURL,created:0};return d},[n,h]);return n?a.jsx("div",{className:"excalidraw-preview","data-theme":i,children:l?a.jsx(dL,{}):a.jsx(B.Suspense,{fallback:a.jsx(dL,{}),children:a.jsx(Qce,{elements:n.elements,files:u,appState:n.appState,theme:i==="dark"?"dark":"light"},e??"board")})}):a.jsx("div",{className:"excalidraw-error",children:"Could not read the Excalidraw drawing in this file."})}const Jce=/```sql\s*\n([\s\S]*?)```/gi;function jF(r){return r.replace(/^.*?knowledge\//,"").replace(/\.md$/,"")}function ehe(r,e){if(!r.startsWith("data-structures/"))return null;const i=[...e.matchAll(Jce)].map(n=>n[1]);return i.length>0?i.join(`
468
+ `);for(let g=0;g<s.length;g++){const m=s[g].match(/^--\s?(.*)/);if(!m)continue;const y=m[1].trim();if(/^={4,}$/.test(y)){i&&i.fields.length>0&&e.push(i),i=null,n=!1;continue}if(/^[A-Z ]+\(/.test(y)&&!y.match(/^[a-z_]/))continue;const w=y.match(/^([A-Z][A-Z _]+?):\s+(\S.+)$/);if(w&&!n){const _=w[1].trim();if(_===_.toUpperCase()&&_.length>1){i&&i.fields.length>0&&e.push(i);const b=w[2].trim();i={name:_,path:b,storageType:b.endsWith(".json")?"json":"file",notes:[],fields:[]},n=!1;continue}}if(i){const _=y.match(/^(?:Created|Managed)\s+by:\s+(.+)/i);if(_){i.managedBy=_[1].trim();continue}}if(y.includes("Fields in YAML frontmatter")||y.startsWith("Schema ")){n=!0;continue}if(y==="["||y==="{"){n=!0;continue}if(!(y==="]"||y==="}"||y==="..."||y==="},")){if(i&&n){const _=y.match(/^([a-z_]\w*):\s+(.+?)(?:\s{2,}--\s+(.+))?$/);if(_){const{type:x,enumValues:C}=cL(_[2].trim(),(o=_[3])==null?void 0:o.trim());i.fields.push({name:_[1],type:x,enumValues:C,description:(h=_[3])==null?void 0:h.trim(),isPrimary:_[1]==="id"});continue}const b=y.match(/^"([a-z_]\w*)":\s+(.+?)(?:,)?(?:\s{2,}--\s+(.+))?$/);if(b){const{type:x,enumValues:C}=cL(b[2].trim(),(l=b[3])==null?void 0:l.trim());i.fields.push({name:b[1],type:x,enumValues:C,description:(u=b[3])==null?void 0:u.trim()});continue}}if(i&&y.startsWith("Body ")&&(i.notes.push(y),y.includes("sections")&&g+1<s.length)){const _=(d=s[g+1])==null?void 0:d.match(/^--\s?(.*)/);_&&/^\s*(Why|[A-Z])/.test(_[1])&&(i.notes.push(_[1].trim()),g++)}}}return i&&i.fields.length>0&&e.push(i),e}function cL(r,e){return r.includes("|")?{type:"enum",enumValues:r.split("|").map(n=>n.trim().replace(/^"|"$/g,""))}:r==="[]"?{type:e!=null&&e.includes("string")?"string[]":"array"}:r.startsWith("[")?{type:"array"}:r==="true"||r==="false"?{type:"boolean"}:r==="null"?{type:"nullable"}:/^\d+$/.test(r)?{type:"number"}:/\d{4}-\d{2}-\d{2}/.test(r.replace(/"/g,""))?{type:"date"}:{type:"string"}}function Fce(r){const e=[];for(const i of r)for(const n of i.fields)if(!n.isNested){if(n.description){const s=n.description.match(/(task|feature|knowledge)\s+IDs?/i);if(s){const o=s[1].toLowerCase(),h=r.find(l=>l.name.toLowerCase().includes(o));if(h&&h.name!==i.name){const l=h.fields.find(u=>u.isPrimary);e.push({from:i.name,fromField:n.name,to:h.name,toField:l?l.name:"_id",cardinality:n.type.includes("array")||n.type==="array"?"1:N":"1:1"})}}}if(n.name==="parent_task"||n.name==="parent_id"){const s=i.fields.find(o=>o.isPrimary);e.push({from:i.name,fromField:n.name,to:i.name,toField:s?s.name:"_id",cardinality:"1:1"})}}return e}function fC(r){return r.toLowerCase().replace(/\s+/g,"-")}function hL(r){return r==="enum"?"enum":r==="array"||r.endsWith("[]")||r.startsWith("array")?"array":r==="boolean"?"boolean":r==="nullable"?"nullable":r==="date"||r==="timestamp"?"date":r==="int"||r==="integer"||r==="numeric"||r==="serial"||r==="bigint"||r==="smallint"||r==="real"||r==="float"||r==="double"?"number":r==="jsonb"||r==="json"?"json":"string"}function $ce(r,e,i){return r.isPrimary?{icon:"PK",cls:"entity-field-icon--key"}:e.some(s=>s.from===i&&s.fromField===r.name)?{icon:"FK",cls:"entity-field-icon--ref"}:null}function Pce(r,e,i,n){if(n){const _=r.right-i.left,b=r.top+r.height*.35-i.top,x=36,C=28;return{d:`M ${_},${b} C ${_+x},${b-C*.3} ${_+x},${b-C*1.3} ${_},${b-C}`,labelX:_+x+4,labelY:b-C*.5}}const s=r.left+r.width/2-i.left,o=e.left+e.width/2-i.left,h=r.top+r.height/2-i.top,l=e.top+e.height/2-i.top,u=Math.abs(s-o),d=Math.abs(h-l);let g,f,m,y;if(u>d){s<o?(g=r.right-i.left,m=e.left-i.left):(g=r.left-i.left,m=e.right-i.left),f=h,y=l;const _=(m-g)*.4;return{d:`M ${g},${f} C ${g+_},${f} ${m-_},${y} ${m},${y}`,labelX:(g+m)/2,labelY:(f+y)/2-10}}g=s,m=o,h<l?(f=r.bottom-i.top,y=e.top-i.top):(f=r.top-i.top,y=e.bottom-i.top);const w=(y-f)*.4;return{d:`M ${g},${f} C ${g},${f+w} ${m},${y-w} ${m},${y}`,labelX:(g+m)/2,labelY:(f+y)/2-10}}function zce({entity:r,relations:e}){const[i,n]=B.useState(new Set),s=r.storageType==="json"?"{ }":r.storageType==="table"?"SQL":"☰",o=r.fields.filter(u=>!u.isNested),h=B.useMemo(()=>{const u=new Map;for(const d of r.fields)if(d.isNested&&d.parentField){const g=u.get(d.parentField)||[];g.push(d),u.set(d.parentField,g)}return u},[r.fields]),l=u=>{n(d=>{const g=new Set(d);return g.has(u)?g.delete(u):g.add(u),g})};return a.jsxs("div",{className:"entity-card","data-entity":fC(r.name),children:[a.jsxs("div",{className:"entity-card-header",children:[a.jsxs("div",{className:"entity-card-title-group",children:[a.jsx("span",{className:"entity-card-category-icon",children:s}),a.jsx("span",{className:"entity-card-name",children:r.name})]}),a.jsx("span",{className:"entity-card-badge","data-storage":r.storageType,children:r.storageType})]}),r.path&&a.jsx("div",{className:"entity-card-path",title:r.path,children:r.path}),r.managedBy&&a.jsx("div",{className:"entity-card-managed",children:r.managedBy}),a.jsx("div",{className:"entity-fields",children:o.map(u=>{const d=$ce(u,e,r.name),g=hL(u.type),f=h.get(u.name),m=i.has(u.name);return a.jsxs(B.Fragment,{children:[a.jsxs("div",{className:`entity-field${f?" entity-field--expandable":""}`,onClick:f?()=>l(u.name):void 0,children:[a.jsx("span",{className:`entity-field-icon ${(d==null?void 0:d.cls)??""}`,children:(d==null?void 0:d.icon)??""}),a.jsx("span",{className:"entity-field-name",children:u.name}),u.type==="enum"&&u.enumValues?a.jsx("span",{className:"entity-field-enum-group",children:u.enumValues.map(y=>a.jsx("span",{className:"entity-field-enum-pill",children:y},y))}):a.jsx("span",{className:"entity-field-type","data-type":g,children:u.type}),f&&a.jsxs("span",{className:"entity-field-toggle",children:[a.jsx("span",{className:`entity-field-toggle-arrow${m?" entity-field-toggle-arrow--open":""}`,children:"▶"}),a.jsx("span",{className:"entity-field-toggle-count",children:f.length})]}),!f&&u.description&&a.jsx("span",{className:"entity-field-desc",title:u.description,children:u.description})]}),f&&m&&f.map(y=>{var b;const w=hL(y.type),_=y.name.slice((((b=y.parentField)==null?void 0:b.length)??0)+1);return a.jsxs("div",{className:"entity-field entity-field--nested",children:[a.jsx("span",{className:"entity-field-icon"}),a.jsxs("span",{className:"entity-field-name entity-field-name--nested",children:[".",_]}),a.jsx("span",{className:"entity-field-type","data-type":w,children:y.type}),y.description&&a.jsx("span",{className:"entity-field-desc",title:y.description,children:y.description})]},y.name)})]},u.name)})}),r.notes.length>0&&a.jsx("div",{className:"entity-card-notes",children:r.notes.map((u,d)=>a.jsx("div",{className:"entity-card-note",children:u},d))})]})}function qce({relations:r,entities:e}){return r.length===0?null:a.jsxs("div",{className:"sql-preview-legend",children:[a.jsx("div",{className:"sql-preview-legend-title",children:"Relationships"}),a.jsx("div",{className:"sql-preview-legend-items",children:r.map((i,n)=>{var l,u;const s=((l=e.find(d=>d.name===i.from))==null?void 0:l.name)??i.from,o=((u=e.find(d=>d.name===i.to))==null?void 0:u.name)??i.to,h=i.from===i.to;return a.jsxs("div",{className:"sql-preview-legend-item",children:[a.jsx("span",{className:"sql-preview-legend-line"}),a.jsx("span",{children:h?`${s}.${i.fromField} ↻ self`:`${s}.${i.fromField} → ${o}.${i.toField}`}),a.jsx("span",{className:"sql-preview-legend-cardinality",children:i.cardinality})]},n)})})]})}function jk({content:r}){const e=B.useRef(null),[i,n]=B.useState([]),[s,o]=B.useState({width:0,height:0}),h=B.useMemo(()=>Oce(r),[r]),l=B.useCallback(()=>{const u=e.current;if(!u||h.relations.length===0){n([]);return}const d=u.getBoundingClientRect();o({width:u.scrollWidth,height:u.scrollHeight});const g=[];for(const f of h.relations){const m=u.querySelector(`[data-entity="${fC(f.from)}"]`),y=u.querySelector(`[data-entity="${fC(f.to)}"]`);if(!m||!y)continue;const w=m.getBoundingClientRect(),_=y.getBoundingClientRect(),{d:b,labelX:x,labelY:C}=Pce(w,_,d,f.from===f.to);g.push({d:b,labelX:x,labelY:C,label:f.cardinality})}n(g)},[h]);if(B.useEffect(()=>{const u=requestAnimationFrame(l),d=new ResizeObserver(l);return e.current&&d.observe(e.current),()=>{cancelAnimationFrame(u),d.disconnect()}},[l]),h.entities.length===0){const u=r.trim().length>0;return a.jsx("div",{className:"sql-preview",children:u?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"sql-preview-empty sql-preview-empty--hint",children:"No table definitions to diagram — showing the raw SQL."}),a.jsx("pre",{className:"sql-preview-raw",children:a.jsx("code",{children:r.trim()})})]}):a.jsx("div",{className:"sql-preview-empty",children:"No schema entities found in this file."})})}return a.jsxs("div",{className:"sql-preview",ref:e,children:[a.jsxs("svg",{className:"sql-preview-svg",width:s.width||"100%",height:s.height||"100%",viewBox:s.width?`0 0 ${s.width} ${s.height}`:void 0,children:[a.jsx("defs",{children:a.jsx("marker",{id:"rel-arrowhead",viewBox:"0 0 10 7",refX:"9",refY:"3.5",markerWidth:"8",markerHeight:"6",orient:"auto",children:a.jsx("polygon",{points:"0 0, 10 3.5, 0 7",className:"sql-preview-arrowhead"})})}),i.map((u,d)=>a.jsxs("g",{children:[a.jsx("path",{d:u.d,className:"sql-preview-line",markerEnd:"url(#rel-arrowhead)"}),a.jsx("rect",{className:"sql-preview-line-label-bg",x:u.labelX-12,y:u.labelY-7,width:24,height:14}),a.jsx("text",{className:"sql-preview-line-label",x:u.labelX,y:u.labelY+4,textAnchor:"middle",children:u.label})]},d))]}),a.jsx("div",{className:"sql-preview-grid",children:h.entities.map(u=>a.jsx(zce,{entity:u,relations:h.relations},u.name))}),a.jsx(qce,{relations:h.relations,entities:h.entities})]})}var Wx={exports:{}},uL;function Hce(){return uL||(uL=1,(function(r){var e=(function(){var i=String.fromCharCode,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",o={};function h(u,d){if(!o[u]){o[u]={};for(var g=0;g<u.length;g++)o[u][u.charAt(g)]=g}return o[u][d]}var l={compressToBase64:function(u){if(u==null)return"";var d=l._compress(u,6,function(g){return n.charAt(g)});switch(d.length%4){default:case 0:return d;case 1:return d+"===";case 2:return d+"==";case 3:return d+"="}},decompressFromBase64:function(u){return u==null?"":u==""?null:l._decompress(u.length,32,function(d){return h(n,u.charAt(d))})},compressToUTF16:function(u){return u==null?"":l._compress(u,15,function(d){return i(d+32)})+" "},decompressFromUTF16:function(u){return u==null?"":u==""?null:l._decompress(u.length,16384,function(d){return u.charCodeAt(d)-32})},compressToUint8Array:function(u){for(var d=l.compress(u),g=new Uint8Array(d.length*2),f=0,m=d.length;f<m;f++){var y=d.charCodeAt(f);g[f*2]=y>>>8,g[f*2+1]=y%256}return g},decompressFromUint8Array:function(u){if(u==null)return l.decompress(u);for(var d=new Array(u.length/2),g=0,f=d.length;g<f;g++)d[g]=u[g*2]*256+u[g*2+1];var m=[];return d.forEach(function(y){m.push(i(y))}),l.decompress(m.join(""))},compressToEncodedURIComponent:function(u){return u==null?"":l._compress(u,6,function(d){return s.charAt(d)})},decompressFromEncodedURIComponent:function(u){return u==null?"":u==""?null:(u=u.replace(/ /g,"+"),l._decompress(u.length,32,function(d){return h(s,u.charAt(d))}))},compress:function(u){return l._compress(u,16,function(d){return i(d)})},_compress:function(u,d,g){if(u==null)return"";var f,m,y={},w={},_="",b="",x="",C=2,k=3,T=2,N=[],A=0,j=0,E;for(E=0;E<u.length;E+=1)if(_=u.charAt(E),Object.prototype.hasOwnProperty.call(y,_)||(y[_]=k++,w[_]=!0),b=x+_,Object.prototype.hasOwnProperty.call(y,b))x=b;else{if(Object.prototype.hasOwnProperty.call(w,x)){if(x.charCodeAt(0)<256){for(f=0;f<T;f++)A=A<<1,j==d-1?(j=0,N.push(g(A)),A=0):j++;for(m=x.charCodeAt(0),f=0;f<8;f++)A=A<<1|m&1,j==d-1?(j=0,N.push(g(A)),A=0):j++,m=m>>1}else{for(m=1,f=0;f<T;f++)A=A<<1|m,j==d-1?(j=0,N.push(g(A)),A=0):j++,m=0;for(m=x.charCodeAt(0),f=0;f<16;f++)A=A<<1|m&1,j==d-1?(j=0,N.push(g(A)),A=0):j++,m=m>>1}C--,C==0&&(C=Math.pow(2,T),T++),delete w[x]}else for(m=y[x],f=0;f<T;f++)A=A<<1|m&1,j==d-1?(j=0,N.push(g(A)),A=0):j++,m=m>>1;C--,C==0&&(C=Math.pow(2,T),T++),y[b]=k++,x=String(_)}if(x!==""){if(Object.prototype.hasOwnProperty.call(w,x)){if(x.charCodeAt(0)<256){for(f=0;f<T;f++)A=A<<1,j==d-1?(j=0,N.push(g(A)),A=0):j++;for(m=x.charCodeAt(0),f=0;f<8;f++)A=A<<1|m&1,j==d-1?(j=0,N.push(g(A)),A=0):j++,m=m>>1}else{for(m=1,f=0;f<T;f++)A=A<<1|m,j==d-1?(j=0,N.push(g(A)),A=0):j++,m=0;for(m=x.charCodeAt(0),f=0;f<16;f++)A=A<<1|m&1,j==d-1?(j=0,N.push(g(A)),A=0):j++,m=m>>1}C--,C==0&&(C=Math.pow(2,T),T++),delete w[x]}else for(m=y[x],f=0;f<T;f++)A=A<<1|m&1,j==d-1?(j=0,N.push(g(A)),A=0):j++,m=m>>1;C--,C==0&&(C=Math.pow(2,T),T++)}for(m=2,f=0;f<T;f++)A=A<<1|m&1,j==d-1?(j=0,N.push(g(A)),A=0):j++,m=m>>1;for(;;)if(A=A<<1,j==d-1){N.push(g(A));break}else j++;return N.join("")},decompress:function(u){return u==null?"":u==""?null:l._decompress(u.length,32768,function(d){return u.charCodeAt(d)})},_decompress:function(u,d,g){var f=[],m=4,y=4,w=3,_="",b=[],x,C,k,T,N,A,j,E={val:g(0),position:d,index:1};for(x=0;x<3;x+=1)f[x]=x;for(k=0,N=Math.pow(2,2),A=1;A!=N;)T=E.val&E.position,E.position>>=1,E.position==0&&(E.position=d,E.val=g(E.index++)),k|=(T>0?1:0)*A,A<<=1;switch(k){case 0:for(k=0,N=Math.pow(2,8),A=1;A!=N;)T=E.val&E.position,E.position>>=1,E.position==0&&(E.position=d,E.val=g(E.index++)),k|=(T>0?1:0)*A,A<<=1;j=i(k);break;case 1:for(k=0,N=Math.pow(2,16),A=1;A!=N;)T=E.val&E.position,E.position>>=1,E.position==0&&(E.position=d,E.val=g(E.index++)),k|=(T>0?1:0)*A,A<<=1;j=i(k);break;case 2:return""}for(f[3]=j,C=j,b.push(j);;){if(E.index>u)return"";for(k=0,N=Math.pow(2,w),A=1;A!=N;)T=E.val&E.position,E.position>>=1,E.position==0&&(E.position=d,E.val=g(E.index++)),k|=(T>0?1:0)*A,A<<=1;switch(j=k){case 0:for(k=0,N=Math.pow(2,8),A=1;A!=N;)T=E.val&E.position,E.position>>=1,E.position==0&&(E.position=d,E.val=g(E.index++)),k|=(T>0?1:0)*A,A<<=1;f[y++]=i(k),j=y-1,m--;break;case 1:for(k=0,N=Math.pow(2,16),A=1;A!=N;)T=E.val&E.position,E.position>>=1,E.position==0&&(E.position=d,E.val=g(E.index++)),k|=(T>0?1:0)*A,A<<=1;f[y++]=i(k),j=y-1,m--;break;case 2:return b.join("")}if(m==0&&(m=Math.pow(2,w),w++),f[j])_=f[j];else if(j===y)_=C+C.charAt(0);else return null;b.push(_),f[y++]=C+_.charAt(0),m--,C=_,m==0&&(m=Math.pow(2,w),w++)}}};return l})();r!=null?r.exports=e:typeof angular<"u"&&angular!=null&&angular.module("LZString",[]).factory("LZString",function(){return e})})(Wx)),Wx.exports}var Uce=Hce();const Wce=/##\s*Drawing\s*```(compressed-json|json)\s*([\s\S]*?)```/;function Gce(r){const e=r.match(Wce);if(!e)return null;const[,i,n]=e;let s;if(i==="compressed-json"){const o=Uce.decompressFromBase64(n.replace(/\s+/g,""));if(!o)return null;s=o}else s=n;try{const o=JSON.parse(s);return Array.isArray(o.elements)?o:null}catch{return null}}function Of(r){return r.endsWith(".excalidraw")}function Kce(){return Yt({queryKey:["knowledge"],queryFn:()=>De.get("/knowledge"),select:r=>r.entries})}function Vce(r){return Yt({queryKey:["knowledge",r],queryFn:()=>De.get(`/knowledge/${r}`),select:e=>e.entry,enabled:!!r,staleTime:1/0,refetchInterval:!1})}function Yce(r,e){return Yt({queryKey:["knowledge-assets",r],queryFn:()=>De.get(`/knowledge-assets/${r}`),select:i=>i.files,enabled:e&&!!r,staleTime:1/0,refetchInterval:!1,refetchOnWindowFocus:!1})}function Xce(r,e,i){const n=Pt();B.useEffect(()=>{!r||e===void 0||i===void 0||e<=i||(n.invalidateQueries({queryKey:["knowledge",r]}),n.invalidateQueries({queryKey:["knowledge-assets",r]}))},[r,e,i,n])}function Zce(){const r=Pt();return Vt({mutationFn:({slug:e,pinned:i})=>De.patch(`/knowledge/${e}`,{pinned:i}),onSuccess:()=>{r.invalidateQueries({queryKey:["knowledge"]})}})}function EF(r,e){const i=`chunk-reloaded:${r}`;return B.lazy(async()=>{try{const n=await e();return window.sessionStorage.removeItem(i),n}catch(n){if(!(window.sessionStorage.getItem(i)==="1"))return window.sessionStorage.setItem(i,"1"),window.location.reload(),new Promise(()=>{});throw window.sessionStorage.removeItem(i),n}})}const Qce=EF("ExcalidrawCanvas",()=>Zt(()=>import("./percentages-BXMCSKIN-vidRYabK.js").then(r=>r.E),__vite__mapDeps([53,54,55]))),dL=()=>a.jsxs("div",{className:"excalidraw-loading","aria-live":"polite",children:[a.jsx("span",{className:"excalidraw-spinner","aria-hidden":"true"}),a.jsx("span",{className:"excalidraw-loading-label",children:"Loading diagram…"})]});function NF({content:r,slug:e}){const{resolved:i}=Kf(),n=B.useMemo(()=>Gce(r),[r]),s=B.useMemo(()=>r.includes("## Embedded Files"),[r]),o=Yce(e??"",!!e&&s),h=o.data,l=!!e&&s&&o.isLoading,u=B.useMemo(()=>{const d={...(n==null?void 0:n.files)??{}};if(h)for(const[g,f]of Object.entries(h))d[g]={id:g,mimeType:f.mimeType,dataURL:f.dataURL,created:0};return d},[n,h]);return n?a.jsx("div",{className:"excalidraw-preview","data-theme":i,children:l?a.jsx(dL,{}):a.jsx(B.Suspense,{fallback:a.jsx(dL,{}),children:a.jsx(Qce,{elements:n.elements,files:u,appState:n.appState,theme:i==="dark"?"dark":"light"},e??"board")})}):a.jsx("div",{className:"excalidraw-error",children:"Could not read the Excalidraw drawing in this file."})}const Jce=/```sql\s*\n([\s\S]*?)```/gi;function jF(r){return r.replace(/^.*?knowledge\//,"").replace(/\.md$/,"")}function ehe(r,e){if(!r.startsWith("data-structures/"))return null;const i=[...e.matchAll(Jce)].map(n=>n[1]);return i.length>0?i.join(`
469
469
 
470
- `):null}function the(r){switch(r.type){case"knowledge":case"feature":return{url:`/knowledge/${jF(r.path)}`,pick:e=>fL(e,["entry","content"])};case"task":return{url:`/tasks/${r.slug}`,pick:e=>fL(e,["task","body"])};default:return null}}function fL(r,e){let i=r;for(const n of e)if(i&&typeof i=="object"&&n in i)i=i[n];else return"";return typeof i=="string"?i:""}function rhe({hit:r}){const e=B.useMemo(()=>the(r),[r]),{data:i,isLoading:n,isError:s}=Yt({queryKey:["docdetail",r.type,r.path,r.slug],queryFn:()=>De.get(e.url),enabled:!!e,staleTime:3e4});if(e&&n)return a.jsx("div",{style:{color:"var(--text-5)",fontSize:"13px",padding:"8px 2px"},children:"Loading document…"});const o=e&&!s&&i?e.pick(i):r.body;if(r.type==="knowledge"){const h=jF(r.path);if(Of(h))return a.jsx("div",{style:{height:"440px",borderRadius:"10px",overflow:"hidden",border:"1px solid var(--border)"},children:a.jsx(NF,{content:o,slug:h})});const l=ehe(h,o);if(l)return a.jsx(jk,{content:l})}return a.jsx(tp,{content:o})}function pL(r){return r.replace(/^.*?knowledge\//,"").replace(/\.md$/,"")}function ihe(r){const e=r.match(/(?:^|\/)core\/([^/]+)$/);return e?e[1]:""}function nhe(r){switch(r.type){case"knowledge":return{page:"knowledge",slug:pL(r.path)};case"feature":return{page:"knowledge",slug:pL(r.path)};case"task":return{page:"tasks",slug:r.slug};case"changelog":case"memory":default:return{page:"core",slug:ihe(r.path)}}}const Zo=[];function Ak(r){const e=Zo.indexOf(r);e!==-1&&Zo.splice(e,1),Zo.push(r)}function Mk(r){const e=Zo.indexOf(r);e!==-1&&Zo.splice(e,1)}function Lk(r){return Zo.length>0&&Zo[Zo.length-1]===r}function AF({id:r,open:e,onClose:i,ariaLabel:n,className:s,children:o}){if(B.useEffect(()=>{if(!e)return;Ak(r);const l=u=>{u.key==="Escape"&&Lk(r)&&(u.preventDefault(),u.stopImmediatePropagation(),i())};return window.addEventListener("keydown",l,!0),()=>{window.removeEventListener("keydown",l,!0),Mk(r)}},[e,i,r]),!e)return null;const h=s?` ${s}`:"";return a.jsx("div",{className:`cmd-modal-scrim${h}`,onMouseDown:i,children:a.jsx("div",{className:`cmd-modal${h}`,role:"dialog","aria-modal":"true","aria-label":n,onMouseDown:l=>l.stopPropagation(),children:o})})}function MF({length:r,onEnter:e}){const[i,n]=B.useState(0);B.useEffect(()=>{n(o=>Math.min(o,Math.max(0,r-1)))},[r]);const s=B.useCallback(o=>{o.key==="ArrowDown"?(o.preventDefault(),n(h=>Math.min(r-1,h+1))):o.key==="ArrowUp"?(o.preventDefault(),n(h=>Math.max(0,h-1))):o.key==="Enter"&&(o.preventDefault(),e(i))},[r,e,i]);return{focused:i,setFocused:n,onKeyDown:s}}const LF="dreamcontext.cmdk.intelligent";function she(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(LF)==="1"}catch{return!1}}function ahe(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function gL({text:r,tokens:e}){if(!e.length||!r)return a.jsx(a.Fragment,{children:r});const i=new RegExp(`(${e.map(ahe).join("|")})`,"gi"),n=new Set(e.map(s=>s.toLowerCase()));return a.jsx(a.Fragment,{children:r.split(i).map((s,o)=>n.has(s.toLowerCase())?a.jsx("mark",{className:"cmdk-hl",children:s},o):a.jsx("span",{children:s},o))})}function ohe({open:r,onClose:e,onNavigate:i}){const[n,s]=B.useState(""),[o,h]=B.useState(""),l=B.useRef(null),u=cF()==="hybrid",[d,g]=B.useState(she),f=d&&!u,[m,y]=B.useState([]),[w,_]=B.useState("idle"),[b,x]=B.useState(""),[C,k]=B.useState("haiku"),T=n.trim();B.useEffect(()=>{const ee=setTimeout(()=>h(T),110);return()=>clearTimeout(ee)},[T]);const{data:N,isFetching:A}=kF(r&&!f?o:"",[],12),j=B.useMemo(()=>(N==null?void 0:N.hits)??[],[N]),E=f&&w==="done"&&b!==""&&b===T,L=f?E?m:[]:j,O=B.useCallback(ee=>{const re=nhe(ee);i(re.page,re.slug),e()},[i,e]),D=B.useCallback(()=>{var ee;try{(ee=l.current)==null||ee.focus()}catch{}},[]),{focused:K,setFocused:z,onKeyDown:H}=MF({length:L.length,onEnter:ee=>{if(f&&!E&&T){$();return}L[ee]&&O(L[ee])}}),P=B.useMemo(()=>(f?b:T).toLowerCase().split(/\s+/).filter(Boolean),[f,b,T]),$=B.useCallback(async()=>{const ee=T;if(ee){_("thinking"),x(ee),z(0);try{const re=await TF(ee,[]);y(re.hits),k(re.mode)}catch{try{y(await SF(ee,[],12))}catch{y([])}k("bm25")}_("done")}},[T,z]),W=B.useCallback(()=>{g(ee=>{const re=!ee;try{window.localStorage.setItem(LF,re?"1":"0")}catch{}return re}),_("idle"),y([]),x(""),z(0),D()},[D,z]);B.useEffect(()=>{if(!r)return;s(""),h(""),z(0),y([]),_("idle"),x("");const ee=requestAnimationFrame(()=>{var re;try{(re=l.current)==null||re.focus()}catch{}});return()=>cancelAnimationFrame(ee)},[r,z]);const V=L[K]??null,F=f&&!!T&&w!=="thinking"&&!E,G=f&&w==="thinking",U=!!T&&(!f&&!A&&j.length===0&&o===T||f&&E&&m.length===0),X=!T;return a.jsxs(AF,{id:"command-palette",open:r,onClose:e,ariaLabel:"Search the brain",className:"command-palette",children:[a.jsxs("div",{className:"cmdk-input-row",children:[a.jsxs("div",{className:`cmdk-field${f?" cmdk-field--intel":""}`,children:[a.jsx("span",{className:"cmdk-input-icon","aria-hidden":"true",children:a.jsx(Zm,{size:17})}),a.jsx("input",{ref:l,className:"cmdk-input",value:n,placeholder:f?"Ask the brain — press ↵ to reason…":"Search the brain…",spellCheck:!1,autoComplete:"off","aria-label":"Search the brain",onChange:ee=>{s(ee.target.value),z(0),f&&_("idle")},onKeyDown:H}),!f&&A&&!!T&&a.jsx("span",{className:"cmdk-spin","aria-hidden":"true"}),!u&&a.jsxs("button",{type:"button",className:`cmdk-intel${f?" cmdk-intel--on":""}`,onClick:W,"aria-pressed":f,title:f?"Intelligent search is on — reasons over your brain with Haiku (uses tokens)":"Turn on intelligent search — intent-aware, beyond keywords",children:[a.jsx("span",{className:"cmdk-intel-dot","aria-hidden":"true"}),a.jsx(Eh,{size:13,color:f?"#fff":"currentColor"}),a.jsx("span",{className:"cmdk-intel-label",children:"Intelligent"})]})]}),a.jsx("kbd",{className:"cmdk-kbd",children:"esc"})]}),a.jsxs("div",{className:"cmdk-body",children:[a.jsxs("div",{className:"cmdk-list",role:"listbox","aria-label":"Search results",children:[X&&a.jsx("div",{className:"cmdk-empty",children:f?"Ask anything — Intelligent search reasons over your whole brain.":"Search tasks, knowledge, core and memory."}),F&&a.jsxs("button",{className:"cmdk-cta",onClick:()=>void $(),children:[a.jsx(Eh,{size:15,color:"#fff"}),"Run intelligent search",a.jsx("kbd",{className:"cmdk-cta-kbd",children:"↵"})]}),G&&a.jsxs("div",{className:"cmdk-thinking",children:[a.jsx("span",{className:"cmdk-thinking-spark",children:a.jsx(Eh,{size:14,color:"currentColor"})}),"Reasoning over your brain…",a.jsxs("div",{className:"cmdk-skel",children:[a.jsx("i",{}),a.jsx("i",{}),a.jsx("i",{})]})]}),U&&a.jsxs("div",{className:"cmdk-empty",children:["No matches for “",T,"”."]}),L.map((ee,re)=>a.jsxs("button",{type:"button",role:"option","aria-selected":re===K,className:`cmdk-row${re===K?" cmdk-row--focused":""}`,onClick:()=>O(ee),onMouseEnter:()=>z(re),children:[a.jsx("span",{className:"cmdk-row-icon","aria-hidden":"true",children:a.jsx(C1,{type:ee.type,size:15})}),a.jsxs("span",{className:"cmdk-row-main",children:[a.jsx("span",{className:"cmdk-row-title",children:a.jsx(gL,{text:ee.title,tokens:P})}),a.jsx("span",{className:"cmdk-row-snippet",children:a.jsx(gL,{text:ee.snippet||ee.description,tokens:P})})]}),a.jsx("span",{className:"cmdk-row-type",children:ee.type})]},`${ee.type}/${ee.slug}/${re}`))]}),V&&a.jsxs("div",{className:"cmdk-preview",children:[a.jsxs("div",{className:"cmdk-preview-head",children:[a.jsx("span",{className:"cmdk-preview-icon","aria-hidden":"true",children:a.jsx(C1,{type:V.type,size:15})}),a.jsx("span",{className:"cmdk-preview-title",children:V.title})]}),a.jsx("div",{className:"cmdk-preview-path",children:V.path}),a.jsx("div",{className:"cmdk-preview-body",children:a.jsx(rhe,{hit:V})})]})]}),a.jsxs("div",{className:"cmdk-foot",children:[a.jsxs("span",{children:[a.jsx("kbd",{children:"↑"}),a.jsx("kbd",{children:"↓"})," move"]}),a.jsxs("span",{children:[a.jsx("kbd",{children:"↵"})," ",f&&!E?"reason":"open"]}),a.jsxs("span",{children:[a.jsx("kbd",{children:"esc"})," close"]}),a.jsx("span",{className:`cmdk-foot-mode${f||u?" cmdk-foot-mode--intel":""}`,children:f?E&&C==="bm25"?"bm25 · fallback":"intelligent · haiku":u?`local · ${(N==null?void 0:N.mode)??"hybrid"}`:"local · bm25"})]})]})}const RF="dreamcontext.dashboard.sidebarCollapsed",hh=typeof window<"u"&&window.matchMedia?window.matchMedia("(max-width: 1024px)"):null;function lhe(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(RF)==="1"}catch{return!1}}function che(){const[r,e]=B.useState(lhe),[i,n]=B.useState((hh==null?void 0:hh.matches)??!1);B.useEffect(()=>{if(!hh)return;const o=h=>n(h.matches);return hh.addEventListener("change",o),()=>hh.removeEventListener("change",o)},[]);const s=B.useCallback(()=>{e(o=>{const h=!o;try{window.localStorage.setItem(RF,h?"1":"0")}catch{}return h})},[]);return{collapsed:i||r,toggle:s}}const BF="dreamcontext.dashboard.activePage",mL=["tasks","roadmap","lab","core","knowledge","sleep","brain","council","taxonomy","settings","packs","about"];function hhe(){if(typeof window>"u")return"tasks";try{const r=new URLSearchParams(window.location.search).get("page");if(r&&mL.includes(r))return r}catch{}try{const r=window.localStorage.getItem(BF);if(r&&mL.includes(r))return r}catch{}return"tasks"}function uhe({children:r}){const[e,i]=B.useState(hhe),[n,s]=B.useState(null),[o,h]=B.useState(0),[l,u]=B.useState(!1),{collapsed:d,toggle:g}=che();B.useEffect(()=>{const _=b=>{(b.metaKey||b.ctrlKey)&&!b.altKey&&b.key.toLowerCase()==="k"&&(b.preventDefault(),u(x=>!x))};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[]),B.useEffect(()=>{document.documentElement.dataset.sidebar=d?"collapsed":"expanded"},[d]);const f=B.useCallback((_,b)=>{i(_),s(b),h(x=>x+1),window.dispatchEvent(new CustomEvent("dreamcontext-navigate",{detail:{page:_}}));try{window.localStorage.setItem(BF,_)}catch{}},[]),m=B.useCallback((_,b)=>{f(_,b??null)},[f]),y=B.useCallback(()=>s(null),[]),w=B.useCallback(()=>u(!1),[]);return a.jsxs("div",{className:"shell",children:[a.jsx(ice,{onNavigate:m,sidebarCollapsed:d,onToggleSidebar:g,onOpenSearch:()=>u(!0)}),a.jsxs("div",{className:"shell-body",children:[a.jsx(Rce,{activePage:e,onNavigate:m,collapsed:d}),a.jsx("main",{className:"shell-main",children:r({page:e,focusId:n,nonce:o,navigate:f,clearFocus:y})})]}),a.jsx(ohe,{open:l,onClose:w,onNavigate:f})]})}const dhe=20,fhe=8e3;function yL(){const{t:r}=wr(),{health:e}=GC(),i=(e==null?void 0:e.upgradeReady)??null,s=qi()&&!!i&&i!=="0.17.0",[o,h]=B.useState(dhe),[l,u]=B.useState(!1),[d,g]=B.useState(!1),[f,m]=B.useState(!1),y=B.useRef(!1),w=B.useCallback(async()=>{if(!y.current){y.current=!0,g(!0),m(!1);try{const x=await De.post("/launcher/relaunch",{});if(x!=null&&x.ok){await x7();return}}catch{}y.current=!1,g(!1),m(!0)}},[]);if(B.useEffect(()=>{if(!s||l||d||f)return;if(o<=0){w();return}const x=setTimeout(()=>h(C=>C-1),1e3);return()=>clearTimeout(x)},[s,l,d,f,o,w]),B.useEffect(()=>{if(!d)return;const x=setTimeout(()=>{y.current=!1,g(!1),m(!0)},fhe);return()=>clearTimeout(x)},[d]),!s)return null;const _=i,b=d?r("upgradeRelaunch.relaunching"):f?r("upgradeRelaunch.failed"):l?r("upgradeRelaunch.deferred").replace("{version}",_):r("upgradeRelaunch.countdown").replace("{version}",_).replace("{seconds}",String(o));return a.jsxs("div",{className:"upgrade-relaunch-banner",role:"status","aria-live":"polite",children:[a.jsx("span",{className:"upgrade-relaunch-msg",children:b}),!d&&a.jsxs("span",{className:"upgrade-relaunch-actions",children:[a.jsx("button",{className:"upgrade-relaunch-btn upgrade-relaunch-btn--primary",onClick:()=>void w(),children:r(f?"upgradeRelaunch.retry":"upgradeRelaunch.now")}),!l&&!f&&a.jsx("button",{className:"upgrade-relaunch-btn",onClick:()=>u(!0),children:r("upgradeRelaunch.later")})]})]})}function phe(){try{return new URLSearchParams(window.location.search).get("vault")}catch{return null}}function ghe(r){return r instanceof Element?!!r.closest('input, textarea, select, [contenteditable="true"], .xterm, .agent-surface'):!1}function mhe(r){return r instanceof Element?!!r.closest(".xterm, .agent-surface"):!1}function bL(){const[r,e]=B.useState(!1),[i,n]=B.useState(""),s=B.useRef(null),{data:o}=wB(r),h=B.useMemo(()=>(o==null?void 0:o.vaults)??[],[o]),l=phe(),u=l===null,d=B.useMemo(()=>h.filter(T=>T.exists),[h]),g=B.useMemo(()=>{const T=i.trim().toLowerCase();return T?h.filter(N=>N.name.toLowerCase().includes(T)||N.path.toLowerCase().includes(T)):h},[h,i]),f=B.useCallback(T=>{e(!1),T.exists&&T.name!==l&&nN(T.name)},[l]),m=B.useCallback(()=>{e(!1),C7()},[]),y=B.useCallback(()=>e(!1),[]),w=B.useMemo(()=>{const T=[];u||T.push({kind:"home"});for(const N of g)T.push({kind:"vault",vault:N,quickIdx:d.indexOf(N)});return T},[u,g,d]),_=B.useCallback(T=>{const N=w[T];N&&(N.kind==="home"?m():f(N.vault))},[w,m,f]),{focused:b,setFocused:x,onKeyDown:C}=MF({length:w.length,onEnter:_}),k=B.useRef(null);return B.useEffect(()=>{var T,N;(N=(T=k.current)==null?void 0:T.querySelector(`[data-row-index="${b}"]`))==null||N.scrollIntoView({block:"nearest"})},[b]),B.useEffect(()=>{const T=N=>{if(!(!(N.metaKey||N.ctrlKey)||N.altKey)){if(N.key.toLowerCase()==="p"&&!N.shiftKey&&!mhe(N.target)){N.preventDefault(),e(j=>!j);return}if(/^[1-9]$/.test(N.key)&&!N.shiftKey&&!ghe(N.target)){const j=d[Number(N.key)-1];if(!j)return;N.preventDefault(),j.name!==l&&nN(j.name)}}};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[d,l]),B.useEffect(()=>{if(!r)return;n(""),x(0);const T=requestAnimationFrame(()=>{var N;try{(N=s.current)==null||N.focus()}catch{}});return()=>cancelAnimationFrame(T)},[r,x]),a.jsxs(AF,{id:"project-switcher",open:r,onClose:y,ariaLabel:"Go to project",className:"psw-modal",children:[a.jsxs("div",{className:"psw-input-row",children:[a.jsx("input",{ref:s,className:"psw-input",value:i,placeholder:"Go to project…",spellCheck:!1,autoComplete:"off","aria-label":"Go to project",onChange:T=>{n(T.target.value),x(0)},onKeyDown:C}),a.jsx("kbd",{className:"psw-kbd",children:"esc"})]}),a.jsxs("div",{className:"psw-list",role:"listbox","aria-label":"Projects",ref:k,children:[w.map((T,N)=>{const A=N===b;if(T.kind==="home")return a.jsxs("button",{type:"button",role:"option","aria-selected":A,"data-row-index":N,className:`psw-row psw-row--home${A?" psw-row--focused":""}`,onClick:m,onMouseEnter:()=>x(N),children:[a.jsx("span",{className:"psw-home-glyph","aria-hidden":"true",children:"←"}),a.jsx("span",{className:"psw-row-main",children:a.jsx("span",{className:"psw-row-name",children:"Launcher"})}),a.jsx("span",{className:"psw-row-hint",children:"home"})]},"__home__");const{vault:j,quickIdx:E}=T,L=j.name===l;return a.jsxs("button",{type:"button",role:"option","aria-selected":A,"data-row-index":N,disabled:!j.exists,className:`psw-row${A?" psw-row--focused":""}${L?" psw-row--current":""}`,onClick:()=>f(j),onMouseEnter:()=>x(N),children:[a.jsx(Am,{exists:j.exists,needsUpdate:j.needsUpdate}),a.jsxs("span",{className:"psw-row-main",children:[a.jsx("span",{className:"psw-row-name",children:j.name}),a.jsx("span",{className:"psw-row-path",children:j.path})]}),L?a.jsx("span",{className:"psw-row-hint psw-row-hint--current",children:"current"}):E>=0&&E<9?a.jsxs("kbd",{className:"psw-row-num",children:["⌘",E+1]}):null]},j.name)}),w.length===0&&a.jsx("div",{className:"psw-empty",children:h.length===0?"No projects registered yet.":`No projects match “${i.trim()}”.`})]}),a.jsxs("div",{className:"psw-foot",children:[a.jsxs("span",{children:[a.jsx("kbd",{children:"↑"}),a.jsx("kbd",{children:"↓"})," move"]}),a.jsxs("span",{children:[a.jsx("kbd",{children:"↵"})," open"]}),a.jsxs("span",{children:[a.jsx("kbd",{children:"⌘"}),a.jsx("kbd",{children:"1-9"})," jump"]}),a.jsxs("span",{children:[a.jsx("kbd",{children:"esc"})," close"]})]})]})}var Gx={exports:{}},vL;function yhe(){return vL||(vL=1,(function(r,e){(function(i,n){r.exports=n()})(globalThis,(()=>(()=>{var i={4567:function(h,l,u){var d=this&&this.__decorate||function(C,k,T,N){var A,j=arguments.length,E=j<3?k:N===null?N=Object.getOwnPropertyDescriptor(k,T):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(C,k,T,N);else for(var L=C.length-1;L>=0;L--)(A=C[L])&&(E=(j<3?A(E):j>3?A(k,T,E):A(k,T))||E);return j>3&&E&&Object.defineProperty(k,T,E),E},g=this&&this.__param||function(C,k){return function(T,N){k(T,N,C)}};Object.defineProperty(l,"__esModule",{value:!0}),l.AccessibilityManager=void 0;const f=u(9042),m=u(9924),y=u(844),w=u(4725),_=u(2585),b=u(3656);let x=l.AccessibilityManager=class extends y.Disposable{constructor(C,k,T,N){super(),this._terminal=C,this._coreBrowserService=T,this._renderService=N,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let A=0;A<this._terminal.rows;A++)this._rowElements[A]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[A]);if(this._topBoundaryFocusListener=A=>this._handleBoundaryFocus(A,0),this._bottomBoundaryFocusListener=A=>this._handleBoundaryFocus(A,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new m.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((A=>this._handleResize(A.rows)))),this.register(this._terminal.onRender((A=>this._refreshRows(A.start,A.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((A=>this._handleChar(A)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
470
+ `):null}function the(r){switch(r.type){case"knowledge":case"feature":return{url:`/knowledge/${jF(r.path)}`,pick:e=>fL(e,["entry","content"])};case"task":return{url:`/tasks/${r.slug}`,pick:e=>fL(e,["task","body"])};default:return null}}function fL(r,e){let i=r;for(const n of e)if(i&&typeof i=="object"&&n in i)i=i[n];else return"";return typeof i=="string"?i:""}function rhe({hit:r}){const e=B.useMemo(()=>the(r),[r]),{data:i,isLoading:n,isError:s}=Yt({queryKey:["docdetail",r.type,r.path,r.slug],queryFn:()=>De.get(e.url),enabled:!!e,staleTime:3e4});if(e&&n)return a.jsx("div",{style:{color:"var(--text-5)",fontSize:"13px",padding:"8px 2px"},children:"Loading document…"});const o=e&&!s&&i?e.pick(i):r.body;if(r.type==="knowledge"){const h=jF(r.path);if(Of(h))return a.jsx("div",{style:{height:"440px",borderRadius:"10px",overflow:"hidden",border:"1px solid var(--border)"},children:a.jsx(NF,{content:o,slug:h})});const l=ehe(h,o);if(l)return a.jsx(jk,{content:l})}return a.jsx(tp,{content:o})}function pL(r){return r.replace(/^.*?knowledge\//,"").replace(/\.md$/,"")}function ihe(r){const e=r.match(/(?:^|\/)core\/([^/]+)$/);return e?e[1]:""}function nhe(r){switch(r.type){case"knowledge":return{page:"knowledge",slug:pL(r.path)};case"feature":return{page:"knowledge",slug:pL(r.path)};case"task":return{page:"tasks",slug:r.slug};case"changelog":case"memory":default:return{page:"core",slug:ihe(r.path)}}}const Zo=[];function Ak(r){const e=Zo.indexOf(r);e!==-1&&Zo.splice(e,1),Zo.push(r)}function Mk(r){const e=Zo.indexOf(r);e!==-1&&Zo.splice(e,1)}function Lk(r){return Zo.length>0&&Zo[Zo.length-1]===r}function AF({id:r,open:e,onClose:i,ariaLabel:n,className:s,children:o}){if(B.useEffect(()=>{if(!e)return;Ak(r);const l=u=>{u.key==="Escape"&&Lk(r)&&(u.preventDefault(),u.stopImmediatePropagation(),i())};return window.addEventListener("keydown",l,!0),()=>{window.removeEventListener("keydown",l,!0),Mk(r)}},[e,i,r]),!e)return null;const h=s?` ${s}`:"";return a.jsx("div",{className:`cmd-modal-scrim${h}`,onMouseDown:i,children:a.jsx("div",{className:`cmd-modal${h}`,role:"dialog","aria-modal":"true","aria-label":n,onMouseDown:l=>l.stopPropagation(),children:o})})}function MF({length:r,onEnter:e}){const[i,n]=B.useState(0);B.useEffect(()=>{n(o=>Math.min(o,Math.max(0,r-1)))},[r]);const s=B.useCallback(o=>{o.key==="ArrowDown"?(o.preventDefault(),n(h=>Math.min(r-1,h+1))):o.key==="ArrowUp"?(o.preventDefault(),n(h=>Math.max(0,h-1))):o.key==="Enter"&&(o.preventDefault(),e(i))},[r,e,i]);return{focused:i,setFocused:n,onKeyDown:s}}const LF="dreamcontext.cmdk.intelligent";function she(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(LF)==="1"}catch{return!1}}function ahe(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function gL({text:r,tokens:e}){if(!e.length||!r)return a.jsx(a.Fragment,{children:r});const i=new RegExp(`(${e.map(ahe).join("|")})`,"gi"),n=new Set(e.map(s=>s.toLowerCase()));return a.jsx(a.Fragment,{children:r.split(i).map((s,o)=>n.has(s.toLowerCase())?a.jsx("mark",{className:"cmdk-hl",children:s},o):a.jsx("span",{children:s},o))})}function ohe({open:r,onClose:e,onNavigate:i}){const[n,s]=B.useState(""),[o,h]=B.useState(""),l=B.useRef(null),u=cF()==="hybrid",[d,g]=B.useState(she),f=d&&!u,[m,y]=B.useState([]),[w,_]=B.useState("idle"),[b,x]=B.useState(""),[C,k]=B.useState("haiku"),T=n.trim();B.useEffect(()=>{const ee=setTimeout(()=>h(T),110);return()=>clearTimeout(ee)},[T]);const{data:N,isFetching:A}=kF(r&&!f?o:"",[],12),j=B.useMemo(()=>(N==null?void 0:N.hits)??[],[N]),E=f&&w==="done"&&b!==""&&b===T,L=f?E?m:[]:j,O=B.useCallback(ee=>{const re=nhe(ee);i(re.page,re.slug),e()},[i,e]),D=B.useCallback(()=>{var ee;try{(ee=l.current)==null||ee.focus()}catch{}},[]),{focused:K,setFocused:z,onKeyDown:H}=MF({length:L.length,onEnter:ee=>{if(f&&!E&&T){$();return}L[ee]&&O(L[ee])}}),P=B.useMemo(()=>(f?b:T).toLowerCase().split(/\s+/).filter(Boolean),[f,b,T]),$=B.useCallback(async()=>{const ee=T;if(ee){_("thinking"),x(ee),z(0);try{const re=await TF(ee,[]);y(re.hits),k(re.mode)}catch{try{y(await SF(ee,[],12))}catch{y([])}k("bm25")}_("done")}},[T,z]),W=B.useCallback(()=>{g(ee=>{const re=!ee;try{window.localStorage.setItem(LF,re?"1":"0")}catch{}return re}),_("idle"),y([]),x(""),z(0),D()},[D,z]);B.useEffect(()=>{if(!r)return;s(""),h(""),z(0),y([]),_("idle"),x("");const ee=requestAnimationFrame(()=>{var re;try{(re=l.current)==null||re.focus()}catch{}});return()=>cancelAnimationFrame(ee)},[r,z]);const V=L[K]??null,F=f&&!!T&&w!=="thinking"&&!E,G=f&&w==="thinking",U=!!T&&(!f&&!A&&j.length===0&&o===T||f&&E&&m.length===0),X=!T;return a.jsxs(AF,{id:"command-palette",open:r,onClose:e,ariaLabel:"Search the brain",className:"command-palette",children:[a.jsxs("div",{className:"cmdk-input-row",children:[a.jsxs("div",{className:`cmdk-field${f?" cmdk-field--intel":""}`,children:[a.jsx("span",{className:"cmdk-input-icon","aria-hidden":"true",children:a.jsx(Zm,{size:17})}),a.jsx("input",{ref:l,className:"cmdk-input",value:n,placeholder:f?"Ask the brain — press ↵ to reason…":"Search the brain…",spellCheck:!1,autoComplete:"off","aria-label":"Search the brain",onChange:ee=>{s(ee.target.value),z(0),f&&_("idle")},onKeyDown:H}),!f&&A&&!!T&&a.jsx("span",{className:"cmdk-spin","aria-hidden":"true"}),!u&&a.jsxs("button",{type:"button",className:`cmdk-intel${f?" cmdk-intel--on":""}`,onClick:W,"aria-pressed":f,title:f?"Intelligent search is on — reasons over your brain with Haiku (uses tokens)":"Turn on intelligent search — intent-aware, beyond keywords",children:[a.jsx("span",{className:"cmdk-intel-dot","aria-hidden":"true"}),a.jsx(Eh,{size:13,color:f?"#fff":"currentColor"}),a.jsx("span",{className:"cmdk-intel-label",children:"Intelligent"})]})]}),a.jsx("kbd",{className:"cmdk-kbd",children:"esc"})]}),a.jsxs("div",{className:"cmdk-body",children:[a.jsxs("div",{className:"cmdk-list",role:"listbox","aria-label":"Search results",children:[X&&a.jsx("div",{className:"cmdk-empty",children:f?"Ask anything — Intelligent search reasons over your whole brain.":"Search tasks, knowledge, core and memory."}),F&&a.jsxs("button",{className:"cmdk-cta",onClick:()=>void $(),children:[a.jsx(Eh,{size:15,color:"#fff"}),"Run intelligent search",a.jsx("kbd",{className:"cmdk-cta-kbd",children:"↵"})]}),G&&a.jsxs("div",{className:"cmdk-thinking",children:[a.jsx("span",{className:"cmdk-thinking-spark",children:a.jsx(Eh,{size:14,color:"currentColor"})}),"Reasoning over your brain…",a.jsxs("div",{className:"cmdk-skel",children:[a.jsx("i",{}),a.jsx("i",{}),a.jsx("i",{})]})]}),U&&a.jsxs("div",{className:"cmdk-empty",children:["No matches for “",T,"”."]}),L.map((ee,re)=>a.jsxs("button",{type:"button",role:"option","aria-selected":re===K,className:`cmdk-row${re===K?" cmdk-row--focused":""}`,onClick:()=>O(ee),onMouseEnter:()=>z(re),children:[a.jsx("span",{className:"cmdk-row-icon","aria-hidden":"true",children:a.jsx(C1,{type:ee.type,size:15})}),a.jsxs("span",{className:"cmdk-row-main",children:[a.jsx("span",{className:"cmdk-row-title",children:a.jsx(gL,{text:ee.title,tokens:P})}),a.jsx("span",{className:"cmdk-row-snippet",children:a.jsx(gL,{text:ee.snippet||ee.description,tokens:P})})]}),a.jsx("span",{className:"cmdk-row-type",children:ee.type})]},`${ee.type}/${ee.slug}/${re}`))]}),V&&a.jsxs("div",{className:"cmdk-preview",children:[a.jsxs("div",{className:"cmdk-preview-head",children:[a.jsx("span",{className:"cmdk-preview-icon","aria-hidden":"true",children:a.jsx(C1,{type:V.type,size:15})}),a.jsx("span",{className:"cmdk-preview-title",children:V.title})]}),a.jsx("div",{className:"cmdk-preview-path",children:V.path}),a.jsx("div",{className:"cmdk-preview-body",children:a.jsx(rhe,{hit:V})})]})]}),a.jsxs("div",{className:"cmdk-foot",children:[a.jsxs("span",{children:[a.jsx("kbd",{children:"↑"}),a.jsx("kbd",{children:"↓"})," move"]}),a.jsxs("span",{children:[a.jsx("kbd",{children:"↵"})," ",f&&!E?"reason":"open"]}),a.jsxs("span",{children:[a.jsx("kbd",{children:"esc"})," close"]}),a.jsx("span",{className:`cmdk-foot-mode${f||u?" cmdk-foot-mode--intel":""}`,children:f?E&&C==="bm25"?"bm25 · fallback":"intelligent · haiku":u?`local · ${(N==null?void 0:N.mode)??"hybrid"}`:"local · bm25"})]})]})}const RF="dreamcontext.dashboard.sidebarCollapsed",hh=typeof window<"u"&&window.matchMedia?window.matchMedia("(max-width: 1024px)"):null;function lhe(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(RF)==="1"}catch{return!1}}function che(){const[r,e]=B.useState(lhe),[i,n]=B.useState((hh==null?void 0:hh.matches)??!1);B.useEffect(()=>{if(!hh)return;const o=h=>n(h.matches);return hh.addEventListener("change",o),()=>hh.removeEventListener("change",o)},[]);const s=B.useCallback(()=>{e(o=>{const h=!o;try{window.localStorage.setItem(RF,h?"1":"0")}catch{}return h})},[]);return{collapsed:i||r,toggle:s}}const BF="dreamcontext.dashboard.activePage",mL=["tasks","roadmap","lab","core","knowledge","sleep","brain","council","taxonomy","settings","packs","about"];function hhe(){if(typeof window>"u")return"tasks";try{const r=new URLSearchParams(window.location.search).get("page");if(r&&mL.includes(r))return r}catch{}try{const r=window.localStorage.getItem(BF);if(r&&mL.includes(r))return r}catch{}return"tasks"}function uhe({children:r}){const[e,i]=B.useState(hhe),[n,s]=B.useState(null),[o,h]=B.useState(0),[l,u]=B.useState(!1),{collapsed:d,toggle:g}=che();B.useEffect(()=>{const _=b=>{(b.metaKey||b.ctrlKey)&&!b.altKey&&b.key.toLowerCase()==="k"&&(b.preventDefault(),u(x=>!x))};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[]),B.useEffect(()=>{document.documentElement.dataset.sidebar=d?"collapsed":"expanded"},[d]);const f=B.useCallback((_,b)=>{i(_),s(b),h(x=>x+1),window.dispatchEvent(new CustomEvent("dreamcontext-navigate",{detail:{page:_}}));try{window.localStorage.setItem(BF,_)}catch{}},[]),m=B.useCallback((_,b)=>{f(_,b??null)},[f]),y=B.useCallback(()=>s(null),[]),w=B.useCallback(()=>u(!1),[]);return a.jsxs("div",{className:"shell",children:[a.jsx(ice,{onNavigate:m,sidebarCollapsed:d,onToggleSidebar:g,onOpenSearch:()=>u(!0)}),a.jsxs("div",{className:"shell-body",children:[a.jsx(Rce,{activePage:e,onNavigate:m,collapsed:d}),a.jsx("main",{className:"shell-main",children:r({page:e,focusId:n,nonce:o,navigate:f,clearFocus:y})})]}),a.jsx(ohe,{open:l,onClose:w,onNavigate:f})]})}const dhe=20,fhe=8e3;function yL(){const{t:r}=wr(),{health:e}=GC(),i=(e==null?void 0:e.upgradeReady)??null,s=qi()&&!!i&&i!=="0.17.1",[o,h]=B.useState(dhe),[l,u]=B.useState(!1),[d,g]=B.useState(!1),[f,m]=B.useState(!1),y=B.useRef(!1),w=B.useCallback(async()=>{if(!y.current){y.current=!0,g(!0),m(!1);try{const x=await De.post("/launcher/relaunch",{});if(x!=null&&x.ok){await x7();return}}catch{}y.current=!1,g(!1),m(!0)}},[]);if(B.useEffect(()=>{if(!s||l||d||f)return;if(o<=0){w();return}const x=setTimeout(()=>h(C=>C-1),1e3);return()=>clearTimeout(x)},[s,l,d,f,o,w]),B.useEffect(()=>{if(!d)return;const x=setTimeout(()=>{y.current=!1,g(!1),m(!0)},fhe);return()=>clearTimeout(x)},[d]),!s)return null;const _=i,b=d?r("upgradeRelaunch.relaunching"):f?r("upgradeRelaunch.failed"):l?r("upgradeRelaunch.deferred").replace("{version}",_):r("upgradeRelaunch.countdown").replace("{version}",_).replace("{seconds}",String(o));return a.jsxs("div",{className:"upgrade-relaunch-banner",role:"status","aria-live":"polite",children:[a.jsx("span",{className:"upgrade-relaunch-msg",children:b}),!d&&a.jsxs("span",{className:"upgrade-relaunch-actions",children:[a.jsx("button",{className:"upgrade-relaunch-btn upgrade-relaunch-btn--primary",onClick:()=>void w(),children:r(f?"upgradeRelaunch.retry":"upgradeRelaunch.now")}),!l&&!f&&a.jsx("button",{className:"upgrade-relaunch-btn",onClick:()=>u(!0),children:r("upgradeRelaunch.later")})]})]})}function phe(){try{return new URLSearchParams(window.location.search).get("vault")}catch{return null}}function ghe(r){return r instanceof Element?!!r.closest('input, textarea, select, [contenteditable="true"], .xterm, .agent-surface'):!1}function mhe(r){return r instanceof Element?!!r.closest(".xterm, .agent-surface"):!1}function bL(){const[r,e]=B.useState(!1),[i,n]=B.useState(""),s=B.useRef(null),{data:o}=wB(r),h=B.useMemo(()=>(o==null?void 0:o.vaults)??[],[o]),l=phe(),u=l===null,d=B.useMemo(()=>h.filter(T=>T.exists),[h]),g=B.useMemo(()=>{const T=i.trim().toLowerCase();return T?h.filter(N=>N.name.toLowerCase().includes(T)||N.path.toLowerCase().includes(T)):h},[h,i]),f=B.useCallback(T=>{e(!1),T.exists&&T.name!==l&&nN(T.name)},[l]),m=B.useCallback(()=>{e(!1),C7()},[]),y=B.useCallback(()=>e(!1),[]),w=B.useMemo(()=>{const T=[];u||T.push({kind:"home"});for(const N of g)T.push({kind:"vault",vault:N,quickIdx:d.indexOf(N)});return T},[u,g,d]),_=B.useCallback(T=>{const N=w[T];N&&(N.kind==="home"?m():f(N.vault))},[w,m,f]),{focused:b,setFocused:x,onKeyDown:C}=MF({length:w.length,onEnter:_}),k=B.useRef(null);return B.useEffect(()=>{var T,N;(N=(T=k.current)==null?void 0:T.querySelector(`[data-row-index="${b}"]`))==null||N.scrollIntoView({block:"nearest"})},[b]),B.useEffect(()=>{const T=N=>{if(!(!(N.metaKey||N.ctrlKey)||N.altKey)){if(N.key.toLowerCase()==="p"&&!N.shiftKey&&!mhe(N.target)){N.preventDefault(),e(j=>!j);return}if(/^[1-9]$/.test(N.key)&&!N.shiftKey&&!ghe(N.target)){const j=d[Number(N.key)-1];if(!j)return;N.preventDefault(),j.name!==l&&nN(j.name)}}};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[d,l]),B.useEffect(()=>{if(!r)return;n(""),x(0);const T=requestAnimationFrame(()=>{var N;try{(N=s.current)==null||N.focus()}catch{}});return()=>cancelAnimationFrame(T)},[r,x]),a.jsxs(AF,{id:"project-switcher",open:r,onClose:y,ariaLabel:"Go to project",className:"psw-modal",children:[a.jsxs("div",{className:"psw-input-row",children:[a.jsx("input",{ref:s,className:"psw-input",value:i,placeholder:"Go to project…",spellCheck:!1,autoComplete:"off","aria-label":"Go to project",onChange:T=>{n(T.target.value),x(0)},onKeyDown:C}),a.jsx("kbd",{className:"psw-kbd",children:"esc"})]}),a.jsxs("div",{className:"psw-list",role:"listbox","aria-label":"Projects",ref:k,children:[w.map((T,N)=>{const A=N===b;if(T.kind==="home")return a.jsxs("button",{type:"button",role:"option","aria-selected":A,"data-row-index":N,className:`psw-row psw-row--home${A?" psw-row--focused":""}`,onClick:m,onMouseEnter:()=>x(N),children:[a.jsx("span",{className:"psw-home-glyph","aria-hidden":"true",children:"←"}),a.jsx("span",{className:"psw-row-main",children:a.jsx("span",{className:"psw-row-name",children:"Launcher"})}),a.jsx("span",{className:"psw-row-hint",children:"home"})]},"__home__");const{vault:j,quickIdx:E}=T,L=j.name===l;return a.jsxs("button",{type:"button",role:"option","aria-selected":A,"data-row-index":N,disabled:!j.exists,className:`psw-row${A?" psw-row--focused":""}${L?" psw-row--current":""}`,onClick:()=>f(j),onMouseEnter:()=>x(N),children:[a.jsx(Am,{exists:j.exists,needsUpdate:j.needsUpdate}),a.jsxs("span",{className:"psw-row-main",children:[a.jsx("span",{className:"psw-row-name",children:j.name}),a.jsx("span",{className:"psw-row-path",children:j.path})]}),L?a.jsx("span",{className:"psw-row-hint psw-row-hint--current",children:"current"}):E>=0&&E<9?a.jsxs("kbd",{className:"psw-row-num",children:["⌘",E+1]}):null]},j.name)}),w.length===0&&a.jsx("div",{className:"psw-empty",children:h.length===0?"No projects registered yet.":`No projects match “${i.trim()}”.`})]}),a.jsxs("div",{className:"psw-foot",children:[a.jsxs("span",{children:[a.jsx("kbd",{children:"↑"}),a.jsx("kbd",{children:"↓"})," move"]}),a.jsxs("span",{children:[a.jsx("kbd",{children:"↵"})," open"]}),a.jsxs("span",{children:[a.jsx("kbd",{children:"⌘"}),a.jsx("kbd",{children:"1-9"})," jump"]}),a.jsxs("span",{children:[a.jsx("kbd",{children:"esc"})," close"]})]})]})}var Gx={exports:{}},vL;function yhe(){return vL||(vL=1,(function(r,e){(function(i,n){r.exports=n()})(globalThis,(()=>(()=>{var i={4567:function(h,l,u){var d=this&&this.__decorate||function(C,k,T,N){var A,j=arguments.length,E=j<3?k:N===null?N=Object.getOwnPropertyDescriptor(k,T):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(C,k,T,N);else for(var L=C.length-1;L>=0;L--)(A=C[L])&&(E=(j<3?A(E):j>3?A(k,T,E):A(k,T))||E);return j>3&&E&&Object.defineProperty(k,T,E),E},g=this&&this.__param||function(C,k){return function(T,N){k(T,N,C)}};Object.defineProperty(l,"__esModule",{value:!0}),l.AccessibilityManager=void 0;const f=u(9042),m=u(9924),y=u(844),w=u(4725),_=u(2585),b=u(3656);let x=l.AccessibilityManager=class extends y.Disposable{constructor(C,k,T,N){super(),this._terminal=C,this._coreBrowserService=T,this._renderService=N,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let A=0;A<this._terminal.rows;A++)this._rowElements[A]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[A]);if(this._topBoundaryFocusListener=A=>this._handleBoundaryFocus(A,0),this._bottomBoundaryFocusListener=A=>this._handleBoundaryFocus(A,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new m.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((A=>this._handleResize(A.rows)))),this.register(this._terminal.onRender((A=>this._refreshRows(A.start,A.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((A=>this._handleChar(A)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
471
471
  `)))),this.register(this._terminal.onA11yTab((A=>this._handleTab(A)))),this.register(this._terminal.onKey((A=>this._handleKey(A.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,b.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,y.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(C){for(let k=0;k<C;k++)this._handleChar(" ")}_handleChar(C){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==C&&(this._charsToAnnounce+=C):this._charsToAnnounce+=C,C===`
472
472
  `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=f.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(C){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(C)||this._charsToConsume.push(C)}_refreshRows(C,k){this._liveRegionDebouncer.refresh(C,k,this._terminal.rows)}_renderRows(C,k){const T=this._terminal.buffer,N=T.lines.length.toString();for(let A=C;A<=k;A++){const j=T.lines.get(T.ydisp+A),E=[],L=(j==null?void 0:j.translateToString(!0,void 0,void 0,E))||"",O=(T.ydisp+A+1).toString(),D=this._rowElements[A];D&&(L.length===0?(D.innerText=" ",this._rowColumns.set(D,[0,1])):(D.textContent=L,this._rowColumns.set(D,E)),D.setAttribute("aria-posinset",O),D.setAttribute("aria-setsize",N))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(C,k){const T=C.target,N=this._rowElements[k===0?1:this._rowElements.length-2];if(T.getAttribute("aria-posinset")===(k===0?"1":`${this._terminal.buffer.lines.length}`)||C.relatedTarget!==N)return;let A,j;if(k===0?(A=T,j=this._rowElements.pop(),this._rowContainer.removeChild(j)):(A=this._rowElements.shift(),j=T,this._rowContainer.removeChild(A)),A.removeEventListener("focus",this._topBoundaryFocusListener),j.removeEventListener("focus",this._bottomBoundaryFocusListener),k===0){const E=this._createAccessibilityTreeNode();this._rowElements.unshift(E),this._rowContainer.insertAdjacentElement("afterbegin",E)}else{const E=this._createAccessibilityTreeNode();this._rowElements.push(E),this._rowContainer.appendChild(E)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(k===0?-1:1),this._rowElements[k===0?1:this._rowElements.length-2].focus(),C.preventDefault(),C.stopImmediatePropagation()}_handleSelectionChange(){var L;if(this._rowElements.length===0)return;const C=document.getSelection();if(!C)return;if(C.isCollapsed)return void(this._rowContainer.contains(C.anchorNode)&&this._terminal.clearSelection());if(!C.anchorNode||!C.focusNode)return void console.error("anchorNode and/or focusNode are null");let k={node:C.anchorNode,offset:C.anchorOffset},T={node:C.focusNode,offset:C.focusOffset};if((k.node.compareDocumentPosition(T.node)&Node.DOCUMENT_POSITION_PRECEDING||k.node===T.node&&k.offset>T.offset)&&([k,T]=[T,k]),k.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(k={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(k.node))return;const N=this._rowElements.slice(-1)[0];if(T.node.compareDocumentPosition(N)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(T={node:N,offset:((L=N.textContent)==null?void 0:L.length)??0}),!this._rowContainer.contains(T.node))return;const A=({node:O,offset:D})=>{const K=O instanceof Text?O.parentNode:O;let z=parseInt(K==null?void 0:K.getAttribute("aria-posinset"),10)-1;if(isNaN(z))return console.warn("row is invalid. Race condition?"),null;const H=this._rowColumns.get(K);if(!H)return console.warn("columns is null. Race condition?"),null;let P=D<H.length?H[D]:H.slice(-1)[0]+1;return P>=this._terminal.cols&&(++z,P=0),{row:z,column:P}},j=A(k),E=A(T);if(j&&E){if(j.row>E.row||j.row===E.row&&j.column>=E.column)throw new Error("invalid range");this._terminal.select(j.column,j.row,(E.row-j.row)*this._terminal.cols-j.column+E.column)}}_handleResize(C){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let k=this._rowContainer.children.length;k<this._terminal.rows;k++)this._rowElements[k]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[k]);for(;this._rowElements.length>C;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const C=this._coreBrowserService.mainDocument.createElement("div");return C.setAttribute("role","listitem"),C.tabIndex=-1,this._refreshRowDimensions(C),C}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let C=0;C<this._terminal.rows;C++)this._refreshRowDimensions(this._rowElements[C])}}_refreshRowDimensions(C){C.style.height=`${this._renderService.dimensions.css.cell.height}px`}};l.AccessibilityManager=x=d([g(1,_.IInstantiationService),g(2,w.ICoreBrowserService),g(3,w.IRenderService)],x)},3614:(h,l)=>{function u(m){return m.replace(/\r?\n/g,"\r")}function d(m,y){return y?"\x1B[200~"+m+"\x1B[201~":m}function g(m,y,w,_){m=d(m=u(m),w.decPrivateModes.bracketedPasteMode&&_.rawOptions.ignoreBracketedPasteMode!==!0),w.triggerDataEvent(m,!0),y.value=""}function f(m,y,w){const _=w.getBoundingClientRect(),b=m.clientX-_.left-10,x=m.clientY-_.top-10;y.style.width="20px",y.style.height="20px",y.style.left=`${b}px`,y.style.top=`${x}px`,y.style.zIndex="1000",y.focus()}Object.defineProperty(l,"__esModule",{value:!0}),l.rightClickHandler=l.moveTextAreaUnderMouseCursor=l.paste=l.handlePasteEvent=l.copyHandler=l.bracketTextForPaste=l.prepareTextForTerminal=void 0,l.prepareTextForTerminal=u,l.bracketTextForPaste=d,l.copyHandler=function(m,y){m.clipboardData&&m.clipboardData.setData("text/plain",y.selectionText),m.preventDefault()},l.handlePasteEvent=function(m,y,w,_){m.stopPropagation(),m.clipboardData&&g(m.clipboardData.getData("text/plain"),y,w,_)},l.paste=g,l.moveTextAreaUnderMouseCursor=f,l.rightClickHandler=function(m,y,w,_,b){f(m,y,w),b&&_.rightClickSelect(m),y.value=_.selectionText,y.select()}},7239:(h,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorContrastCache=void 0;const d=u(1505);l.ColorContrastCache=class{constructor(){this._color=new d.TwoKeyMap,this._css=new d.TwoKeyMap}setCss(g,f,m){this._css.set(g,f,m)}getCss(g,f){return this._css.get(g,f)}setColor(g,f,m){this._color.set(g,f,m)}getColor(g,f){return this._color.get(g,f)}clear(){this._color.clear(),this._css.clear()}}},3656:(h,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.addDisposableDomListener=void 0,l.addDisposableDomListener=function(u,d,g,f){u.addEventListener(d,g,f);let m=!1;return{dispose:()=>{m||(m=!0,u.removeEventListener(d,g,f))}}}},3551:function(h,l,u){var d=this&&this.__decorate||function(x,C,k,T){var N,A=arguments.length,j=A<3?C:T===null?T=Object.getOwnPropertyDescriptor(C,k):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(x,C,k,T);else for(var E=x.length-1;E>=0;E--)(N=x[E])&&(j=(A<3?N(j):A>3?N(C,k,j):N(C,k))||j);return A>3&&j&&Object.defineProperty(C,k,j),j},g=this&&this.__param||function(x,C){return function(k,T){C(k,T,x)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Linkifier=void 0;const f=u(3656),m=u(8460),y=u(844),w=u(2585),_=u(4725);let b=l.Linkifier=class extends y.Disposable{get currentLink(){return this._currentLink}constructor(x,C,k,T,N){super(),this._element=x,this._mouseService=C,this._renderService=k,this._bufferService=T,this._linkProviderService=N,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new m.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new m.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,y.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,y.toDisposable)((()=>{var A;this._lastMouseEvent=void 0,(A=this._activeProviderReplies)==null||A.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,f.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,f.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,f.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(x){this._lastMouseEvent=x;const C=this._positionFromMouseEvent(x,this._element,this._mouseService);if(!C)return;this._isMouseOut=!1;const k=x.composedPath();for(let T=0;T<k.length;T++){const N=k[T];if(N.classList.contains("xterm"))break;if(N.classList.contains("xterm-hover"))return}this._lastBufferCell&&C.x===this._lastBufferCell.x&&C.y===this._lastBufferCell.y||(this._handleHover(C),this._lastBufferCell=C)}_handleHover(x){if(this._activeLine!==x.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(x,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,x)||(this._clearCurrentLink(),this._askForLink(x,!0))}_askForLink(x,C){var T,N;this._activeProviderReplies&&C||((T=this._activeProviderReplies)==null||T.forEach((A=>{A==null||A.forEach((j=>{j.link.dispose&&j.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=x.y);let k=!1;for(const[A,j]of this._linkProviderService.linkProviders.entries())C?(N=this._activeProviderReplies)!=null&&N.get(A)&&(k=this._checkLinkProviderResult(A,x,k)):j.provideLinks(x.y,(E=>{var O,D;if(this._isMouseOut)return;const L=E==null?void 0:E.map((K=>({link:K})));(O=this._activeProviderReplies)==null||O.set(A,L),k=this._checkLinkProviderResult(A,x,k),((D=this._activeProviderReplies)==null?void 0:D.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(x.y,this._activeProviderReplies)}))}_removeIntersectingLinks(x,C){const k=new Set;for(let T=0;T<C.size;T++){const N=C.get(T);if(N)for(let A=0;A<N.length;A++){const j=N[A],E=j.link.range.start.y<x?0:j.link.range.start.x,L=j.link.range.end.y>x?this._bufferService.cols:j.link.range.end.x;for(let O=E;O<=L;O++){if(k.has(O)){N.splice(A--,1);break}k.add(O)}}}}_checkLinkProviderResult(x,C,k){var A;if(!this._activeProviderReplies)return k;const T=this._activeProviderReplies.get(x);let N=!1;for(let j=0;j<x;j++)this._activeProviderReplies.has(j)&&!this._activeProviderReplies.get(j)||(N=!0);if(!N&&T){const j=T.find((E=>this._linkAtPosition(E.link,C)));j&&(k=!0,this._handleNewLink(j))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!k)for(let j=0;j<this._activeProviderReplies.size;j++){const E=(A=this._activeProviderReplies.get(j))==null?void 0:A.find((L=>this._linkAtPosition(L.link,C)));if(E){k=!0,this._handleNewLink(E);break}}return k}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(x){if(!this._currentLink)return;const C=this._positionFromMouseEvent(x,this._element,this._mouseService);C&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,C)&&this._currentLink.link.activate(x,this._currentLink.link.text)}_clearCurrentLink(x,C){this._currentLink&&this._lastMouseEvent&&(!x||!C||this._currentLink.link.range.start.y>=x&&this._currentLink.link.range.end.y<=C)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,y.disposeArray)(this._linkCacheDisposables))}_handleNewLink(x){if(!this._lastMouseEvent)return;const C=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);C&&this._linkAtPosition(x.link,C)&&(this._currentLink=x,this._currentLink.state={decorations:{underline:x.link.decorations===void 0||x.link.decorations.underline,pointerCursor:x.link.decorations===void 0||x.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,x.link,this._lastMouseEvent),x.link.decorations={},Object.defineProperties(x.link.decorations,{pointerCursor:{get:()=>{var k,T;return(T=(k=this._currentLink)==null?void 0:k.state)==null?void 0:T.decorations.pointerCursor},set:k=>{var T;(T=this._currentLink)!=null&&T.state&&this._currentLink.state.decorations.pointerCursor!==k&&(this._currentLink.state.decorations.pointerCursor=k,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",k))}},underline:{get:()=>{var k,T;return(T=(k=this._currentLink)==null?void 0:k.state)==null?void 0:T.decorations.underline},set:k=>{var T,N,A;(T=this._currentLink)!=null&&T.state&&((A=(N=this._currentLink)==null?void 0:N.state)==null?void 0:A.decorations.underline)!==k&&(this._currentLink.state.decorations.underline=k,this._currentLink.state.isHovered&&this._fireUnderlineEvent(x.link,k))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((k=>{if(!this._currentLink)return;const T=k.start===0?0:k.start+1+this._bufferService.buffer.ydisp,N=this._bufferService.buffer.ydisp+1+k.end;if(this._currentLink.link.range.start.y>=T&&this._currentLink.link.range.end.y<=N&&(this._clearCurrentLink(T,N),this._lastMouseEvent)){const A=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);A&&this._askForLink(A,!1)}}))))}_linkHover(x,C,k){var T;(T=this._currentLink)!=null&&T.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(C,!0),this._currentLink.state.decorations.pointerCursor&&x.classList.add("xterm-cursor-pointer")),C.hover&&C.hover(k,C.text)}_fireUnderlineEvent(x,C){const k=x.range,T=this._bufferService.buffer.ydisp,N=this._createLinkUnderlineEvent(k.start.x-1,k.start.y-T-1,k.end.x,k.end.y-T-1,void 0);(C?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(N)}_linkLeave(x,C,k){var T;(T=this._currentLink)!=null&&T.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(C,!1),this._currentLink.state.decorations.pointerCursor&&x.classList.remove("xterm-cursor-pointer")),C.leave&&C.leave(k,C.text)}_linkAtPosition(x,C){const k=x.range.start.y*this._bufferService.cols+x.range.start.x,T=x.range.end.y*this._bufferService.cols+x.range.end.x,N=C.y*this._bufferService.cols+C.x;return k<=N&&N<=T}_positionFromMouseEvent(x,C,k){const T=k.getCoords(x,C,this._bufferService.cols,this._bufferService.rows);if(T)return{x:T[0],y:T[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(x,C,k,T,N){return{x1:x,y1:C,x2:k,y2:T,cols:this._bufferService.cols,fg:N}}};l.Linkifier=b=d([g(1,_.IMouseService),g(2,_.IRenderService),g(3,w.IBufferService),g(4,_.ILinkProviderService)],b)},9042:(h,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.tooMuchOutput=l.promptLabel=void 0,l.promptLabel="Terminal input",l.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(h,l,u){var d=this&&this.__decorate||function(_,b,x,C){var k,T=arguments.length,N=T<3?b:C===null?C=Object.getOwnPropertyDescriptor(b,x):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(_,b,x,C);else for(var A=_.length-1;A>=0;A--)(k=_[A])&&(N=(T<3?k(N):T>3?k(b,x,N):k(b,x))||N);return T>3&&N&&Object.defineProperty(b,x,N),N},g=this&&this.__param||function(_,b){return function(x,C){b(x,C,_)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkProvider=void 0;const f=u(511),m=u(2585);let y=l.OscLinkProvider=class{constructor(_,b,x){this._bufferService=_,this._optionsService=b,this._oscLinkService=x}provideLinks(_,b){var L;const x=this._bufferService.buffer.lines.get(_-1);if(!x)return void b(void 0);const C=[],k=this._optionsService.rawOptions.linkHandler,T=new f.CellData,N=x.getTrimmedLength();let A=-1,j=-1,E=!1;for(let O=0;O<N;O++)if(j!==-1||x.hasContent(O)){if(x.loadCell(O,T),T.hasExtendedAttrs()&&T.extended.urlId){if(j===-1){j=O,A=T.extended.urlId;continue}E=T.extended.urlId!==A}else j!==-1&&(E=!0);if(E||j!==-1&&O===N-1){const D=(L=this._oscLinkService.getLinkData(A))==null?void 0:L.uri;if(D){const K={start:{x:j+1,y:_},end:{x:O+(E||O!==N-1?0:1),y:_}};let z=!1;if(!(k!=null&&k.allowNonHttpProtocols))try{const H=new URL(D);["http:","https:"].includes(H.protocol)||(z=!0)}catch{z=!0}z||C.push({text:D,range:K,activate:(H,P)=>k?k.activate(H,P,K):w(0,P),hover:(H,P)=>{var $;return($=k==null?void 0:k.hover)==null?void 0:$.call(k,H,P,K)},leave:(H,P)=>{var $;return($=k==null?void 0:k.leave)==null?void 0:$.call(k,H,P,K)}})}E=!1,T.hasExtendedAttrs()&&T.extended.urlId?(j=O,A=T.extended.urlId):(j=-1,A=-1)}}b(C)}};function w(_,b){if(confirm(`Do you want to navigate to ${b}?
473
473
 
@@ -510,7 +510,7 @@ Drag to reschedule · drag an edge to resize`,children:[a.jsx("div",{className:"
510
510
 
511
511
  This removes it from the roadmap and clears it from any dependent objectives and any tasks assigned to it. This cannot be undone.`)&&g.mutate(r.slug,{onSuccess:I=>{var Z;o(),(Z=I.unhealedTasks)!=null&&Z.length&&h(`Deleted — but ${I.unhealedTasks.length} task file(s) couldn't be updated; check them for a stale reference to “${r.slug}”.`)},onError:I=>h(I instanceof Error?I.message:"Could not delete objective.")})},K=(I,Z)=>E({start_date:I,target_date:Z}),z=()=>{const I=k;if(!I)return;const Z=I.label.trim(),J={label:Z||"Metric",unit:I.unit&&I.unit.trim()?I.unit.trim():null,baseline:Number.isFinite(I.baseline)?I.baseline:0,target:I.target,current:Number.isFinite(I.current)?I.current:0};if(!Z||!Number.isFinite(J.target)||J.target===J.baseline){T(r.metric),h("Metric needs a label and a target that differs from the baseline.");return}const ne=r.metric;ne&&ne.label===J.label&&ne.unit===J.unit&&ne.baseline===J.baseline&&ne.target===J.target&&ne.current===J.current||E({metric:J},"Could not update metric.")},H=()=>E({metric:{label:"MRR",unit:null,baseline:0,target:100,current:0}}),P=f.find(I=>{var Z;return((Z=I.binding)==null?void 0:Z.objective)===r.slug})??null,$=()=>{P&&m.mutate({slug:P.slug,binding:null},{onError:()=>h("Could not disconnect the insight.")}),E({metric:null})},W=I=>{if(I===null){if(!P)return;m.mutate({slug:P.slug,binding:null},{onSuccess:()=>h("Insight disconnected — the metric is manual again."),onError:Z=>h(Z instanceof Error?Z.message:"Could not disconnect the insight.")});return}m.mutate({slug:I,binding:{objective:r.slug,value:"latest"}},{onSuccess:Z=>h(Z.seededCurrent!==null?`Connected — current set to ${Z.seededCurrent} from the insight.`:"Connected — current updates on the next lab sync."),onError:Z=>h(Z instanceof Error?Z.message:"Could not connect the insight.")})},V=I=>E({impact:r.impact===I?null:I}),F=I=>E({effort:r.effort===I?null:I}),G=I=>{for(const Z of I.filter(J=>!r.depends_on.includes(J)))u.mutate({slug:r.slug,to:Z},{onError:J=>h(J instanceof Error?J.message:"Could not link.")});for(const Z of r.depends_on.filter(J=>!I.includes(J)))d.mutate({slug:r.slug,to:Z},{onError:()=>h("Could not unlink.")})};let U,X,ee,re,le;if(e.slipping){U="slip",X="🔴",le=ec,ee=`Slipping — ${e.slipDays} day${e.slipDays===1?"":"s"} past target`;const I=e.forecast_start!==null&&e.target!==null&&e.forecast_start>e.target;let Z;r.slipUpstream.length>0?Z=` Likely cause: upstream ${r.slipUpstream.join(", ")} running late.`:I?Z=` Cause: it can’t start until ${hs(e.forecast_start)}, already past the target.`:e.basis==="tasks"?Z=" Cause: this objective’s own member tasks overrun the target.":r.effort?Z=` Cause: the ${r.effort}-week effort estimate doesn’t fit before the target — widen the window or lower the effort.`:Z=" Cause: the committed window overruns the target.",re=`Projected finish (${hs(e.forecast_end)}) overshoots the committed target (${hs(e.target)}). The slip cascades to everything this blocks.${Z}`}else if(!e.forecastable)U="unforecastable",X="◔",le="var(--color-text-secondary)",ee="Unforecastable",re="No dates to project from. Set a start/target below (or link dated member tasks) to compute a forecast.";else{U="ontrack",X="🟢",le="#3fb950";const I=Math.abs(e.slipDays);ee=I>0?`On track — ${I} day${I===1?"":"s"} of buffer`:"On track",re=e.target!==null?`The work fits before the committed target (${hs(e.target)})${I>0?` with ${I} day${I===1?"":"s"} to spare`:""}.`:"No committed target set — no deadline to slip against. Set a target to track slip."}const fe=e.dependents.map(I=>{const Z=i.get(I),J=n.get(I);return{slug:I,title:(Z==null?void 0:Z.title)??I,color:ds[(Z==null?void 0:Z.status)??"not_started"].color,slipping:!!(J!=null&&J.slipping)}}),ie=[...i.values()].filter(I=>I.slug!==r.slug).map(I=>({slug:I.slug,title:I.title,status:I.status}));return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"odp-overlay",onClick:o}),a.jsxs("div",{className:"odp-panel",role:"dialog","aria-modal":"true","aria-label":r.title,children:[a.jsxs("div",{className:"odp-head",children:[a.jsxs("div",{className:"odp-head-row",children:[a.jsxs("div",{className:"odp-status-wrap",children:[a.jsxs("button",{className:"odp-status",style:{color:"var(--color-text)",background:vC(A.color,.14),border:`1px solid ${vC(A.color,.3)}`},onClick:()=>C(I=>!I),title:"Change status",children:[a.jsx("span",{className:"odp-status-dot",style:{background:A.color}}),A.label,a.jsx("span",{className:"odp-caret",children:"▾"})]}),x&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"odp-drop-away",onClick:()=>C(!1)}),a.jsxs("div",{className:"odp-drop",children:[xfe.map(I=>a.jsxs("div",{className:"odp-drop-row",onClick:()=>O(I),children:[a.jsx("span",{className:"odp-drop-dot",style:{background:ds[I].color}}),a.jsx("span",{className:"odp-drop-label",children:ds[I].label}),r.status===I&&r.statusOverride&&a.jsx("span",{className:"odp-drop-check",children:"✓"})]},I)),a.jsx("div",{className:"odp-drop-sep"}),a.jsxs("div",{className:"odp-drop-row",onClick:()=>O(null),title:"Clear the manual override — status falls back to the task rollup",children:[a.jsx("span",{className:"odp-drop-dot odp-drop-dot--auto",children:"↺"}),a.jsx("span",{className:"odp-drop-label",children:"Auto (from tasks)"}),!r.statusOverride&&a.jsx("span",{className:"odp-drop-check",children:"✓"})]})]})]})]}),r.statusOverride&&a.jsx("span",{className:"odp-override",title:"Status set manually — click the pill → Auto to clear",children:"✎ override"}),a.jsx("span",{className:"odp-spacer"}),a.jsx("span",{className:"odp-close",onClick:o,title:"Close (Esc)",children:"✕"})]}),_?a.jsx("input",{ref:N,className:"odp-title-input",value:y,autoFocus:!0,onChange:I=>w(I.target.value),onBlur:L,onKeyDown:I=>{I.key==="Enter"&&(I.preventDefault(),L())}}):a.jsxs("div",{className:"odp-title",onClick:()=>b(!0),title:"Click to rename",children:[r.title,a.jsx("span",{className:"odp-title-edit",children:"✎"})]}),a.jsx("div",{className:"odp-slug",children:r.slug}),r.description&&a.jsx("div",{className:"odp-desc",children:r.description})]}),a.jsxs("div",{className:"odp-body bd-scroll",children:[a.jsxs("div",{className:`odp-risk odp-risk--${U}`,children:[a.jsx("span",{className:"odp-risk-glyph",children:X}),a.jsxs("div",{children:[a.jsx("div",{className:"odp-risk-title",style:{color:le},children:ee}),a.jsx("div",{className:"odp-risk-sub",children:re})]})]}),a.jsxs("div",{className:"odp-section-label",children:["Committed window ",a.jsx("span",{className:"odp-hint",children:"editable"})]}),a.jsx("div",{className:"odp-range",children:a.jsx(u$,{start:r.start_date,end:r.target_date,onChange:K,placeholder:"Set start & target dates"})}),a.jsxs("div",{className:"odp-forecast-line",children:[a.jsx("span",{className:"odp-forecast-cap",children:"Forecast · computed"}),a.jsx("span",{style:{color:e.slipping?ec:e.forecastable?"var(--color-text-secondary)":"var(--color-text-tertiary)",fontFamily:"var(--font-mono)",fontWeight:600},children:e.forecast_end?hs(e.forecast_end):"none"}),e.forecastable&&a.jsx("span",{className:"odp-forecast-note",children:e.slipping?`slipping ${e.slipDays}d`:`${Math.abs(e.slipDays)}d buffer`})]}),r.metric?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"odp-section-label",children:["Key Result ",a.jsx("span",{className:"odp-hint",children:"editable"}),a.jsx("button",{className:"odp-metric-clear",onClick:$,title:"Remove the metric — track by tasks instead",children:"track by tasks"})]}),a.jsxs("div",{className:"odp-metric",children:[a.jsxs("div",{className:"odp-metric-row",children:[a.jsx("input",{className:"odp-metric-label",value:(k==null?void 0:k.label)??"",placeholder:"Metric",onChange:I=>T(Z=>Z&&{...Z,label:I.target.value}),onBlur:()=>z(),onKeyDown:I=>{I.key==="Enter"&&I.currentTarget.blur()}}),a.jsx("input",{className:"odp-metric-unit",value:(k==null?void 0:k.unit)??"",placeholder:"unit",onChange:I=>T(Z=>Z&&{...Z,unit:I.target.value||null}),onBlur:()=>z(),onKeyDown:I=>{I.key==="Enter"&&I.currentTarget.blur()}})]}),a.jsxs("div",{className:"odp-prog",children:[a.jsx("div",{className:"odp-prog-track",children:a.jsx("div",{className:"odp-prog-fill",style:{width:`${j??0}%`,background:`linear-gradient(90deg, ${A.lite}, ${A.color})`}})}),a.jsxs("span",{className:"odp-prog-label",children:[nl(r.metric.current,r.metric.unit)," / ",nl(r.metric.target,r.metric.unit)," · ",j,"%"]})]}),a.jsxs("div",{className:"odp-metric-grid",children:[a.jsxs("label",{className:"odp-metric-field",children:[a.jsx("span",{children:"Current"}),a.jsx("input",{type:"number",value:(k==null?void 0:k.current)??0,onChange:I=>T(Z=>Z&&{...Z,current:I.target.valueAsNumber}),onBlur:()=>z(),onKeyDown:I=>{I.key==="Enter"&&I.currentTarget.blur()}})]}),a.jsxs("label",{className:"odp-metric-field",children:[a.jsx("span",{children:"Baseline"}),a.jsx("input",{type:"number",value:(k==null?void 0:k.baseline)??0,onChange:I=>T(Z=>Z&&{...Z,baseline:I.target.valueAsNumber}),onBlur:()=>z(),onKeyDown:I=>{I.key==="Enter"&&I.currentTarget.blur()}})]}),a.jsxs("label",{className:"odp-metric-field",children:[a.jsx("span",{children:"Target"}),a.jsx("input",{type:"number",value:(k==null?void 0:k.target)??0,onChange:I=>T(Z=>Z&&{...Z,target:I.target.valueAsNumber}),onBlur:()=>z(),onKeyDown:I=>{I.key==="Enter"&&I.currentTarget.blur()}})]})]}),f.length>0&&a.jsxs("div",{className:"odp-metric-insight",children:[a.jsx(f$,{insights:f,selected:(P==null?void 0:P.slug)??null,objectiveSlug:r.slug,onSelect:W,disabled:m.isPending}),P&&a.jsx("span",{className:"odp-metric-insight-hint",children:"Current updates automatically from this insight on every lab sync."})]})]})]}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"odp-section-label",children:"Progress"}),r.progress.total>0?a.jsxs("div",{className:"odp-prog",children:[a.jsx("div",{className:"odp-prog-track",children:a.jsx("div",{className:"odp-prog-fill",style:{width:`${j??0}%`,background:`linear-gradient(90deg, ${A.lite}, ${A.color})`}})}),a.jsxs("span",{className:"odp-prog-label",children:[r.progress.done," / ",r.progress.total," · ",j,"%"]})]}):a.jsx("div",{className:"odp-prog-empty",children:"No tasks yet — assign tasks to roll up progress."}),a.jsxs("button",{className:"odp-goal-add",onClick:H,title:"Track this objective by an outcome number (e.g. MRR) instead of task completion",children:[a.jsx("span",{className:"odp-goal-add-plus","aria-hidden":"true",children:"+"}),a.jsxs("span",{className:"odp-goal-add-text",children:[a.jsx("strong",{children:"Track by a metric"}),a.jsx("span",{children:"Set a goal number — e.g. MRR, customers, %"})]})]})]}),a.jsxs("div",{className:"odp-section-label",children:["Impact ",a.jsx("span",{className:"odp-times",children:"×"})," Effort ",a.jsx("span",{className:"odp-hint",children:"editable"})]}),a.jsxs("div",{className:"odp-prio",children:[a.jsxs("div",{className:"odp-prio-axis",children:[a.jsx("span",{className:"odp-prio-cap",children:"Impact"}),a.jsx("div",{className:"odp-seg",children:[1,2,3,4,5].map(I=>a.jsx("button",{className:`odp-seg-btn ${r.impact===I?"odp-seg-btn--on":""}`,onClick:()=>V(I),title:_fe[I],children:I},I))})]}),a.jsxs("div",{className:"odp-prio-axis",children:[a.jsx("span",{className:"odp-prio-cap",children:"Effort"}),a.jsx("div",{className:"odp-seg",children:Cfe.map(I=>a.jsxs("button",{className:`odp-seg-btn ${r.effort===I?"odp-seg-btn--on":""}`,onClick:()=>F(I),title:`${I} week${I===1?"":"s"}`,children:[I,"w"]},I))})]})]}),a.jsx("div",{className:"odp-deps",children:a.jsxs("div",{className:"odp-deps-col",children:[a.jsxs("div",{className:"odp-section-label",children:["Depends on ",a.jsx("span",{className:"odp-hint",children:"editable"})]}),a.jsx(d$,{options:ie,selected:r.depends_on,onChange:G})]})}),a.jsxs("div",{className:"odp-blocks",children:[a.jsx("div",{className:"odp-section-label",children:"Blocks"}),fe.length===0?a.jsx("div",{className:"odp-none",children:"— none"}):fe.map(I=>a.jsxs("div",{className:"odp-dep-chip",onClick:()=>s(I.slug),children:[a.jsx("span",{className:"odp-dep-dot",style:{background:I.color}}),a.jsx("span",{className:"odp-dep-title",children:I.title}),I.slipping&&a.jsx("span",{className:"odp-dep-slip",children:"●"})]},I.slug))]}),a.jsxs("div",{className:"odp-tasks-head",children:[a.jsx("span",{className:"odp-section-label",style:{margin:0},children:"Member tasks"}),a.jsx("span",{className:"odp-tasks-count",children:r.tasks.length})]}),r.tasks.length===0?a.jsxs("div",{className:"odp-notasks",children:["No tasks yet — link work by adding ",a.jsxs("span",{className:"odp-mono",children:["objectives: [",r.slug,"]"]})," to a task's frontmatter."]}):a.jsx("div",{className:"odp-tasklist",children:r.tasks.map(I=>{const Z=Pde[I.status]??{label:I.status,color:"var(--color-text-tertiary)"};return a.jsxs("div",{className:"odp-task",children:[a.jsx("span",{className:"odp-task-dot",style:{background:Z.color}}),a.jsx("span",{className:"odp-task-slug",children:I.slug}),a.jsx("span",{className:"odp-task-status",style:{color:Z.color},children:Z.label})]},I.slug)})})]}),a.jsxs("div",{className:"odp-foot",children:[a.jsx("span",{className:"odp-foot-note",children:e.basis==="tasks"?`forecast from ${r.progress.total} task${r.progress.total===1?"":"s"} + deps`:e.basis==="milestone"?"forecast from dependencies":e.forecastable?"forecast from committed dates + deps":"no forecast — set dates or link dated tasks"}),a.jsx("button",{className:"odp-delete",onClick:D,title:"Delete this objective",children:g.isPending?"Deleting…":"Delete"})]})]})]})}const x_="dreamcontext:";function Kk(r,e){const{projectId:i}=IQ(),n=i?`${x_}${i}:${r}`:`${x_}${r}`,[s,o]=B.useState(()=>{try{const l=localStorage.getItem(n);if(l!==null)return JSON.parse(l);if(i){const u=`${x_}${r}`,d=localStorage.getItem(u);if(d!==null)return localStorage.setItem(n,d),localStorage.removeItem(u),JSON.parse(d)}}catch{}return e}),h=B.useCallback(l=>{o(u=>{const d=typeof l=="function"?l(u):l;try{localStorage.setItem(n,JSON.stringify(d))}catch{}return d})},[n]);return[s,h]}const m$={search:"",sortBy:"manual",sortDir:"asc",layout:"timeline",cardProps:{target:!0,forecast:!0,progress:!0,status:!0,dependencies:!0,priority:!0,tasks:!1},filters:{status:{inc:[],exc:[]},signal:{inc:[],exc:[]}}};function __(r){var i,n;const e=m$;return{search:typeof r.search=="string"?r.search:e.search,sortBy:r.sortBy??e.sortBy,sortDir:r.sortDir==="desc"?"desc":"asc",layout:r.layout??e.layout,cardProps:{...e.cardProps,...r.cardProps??{}},filters:{status:{...e.filters.status,...((i=r.filters)==null?void 0:i.status)??{}},signal:{...e.filters.signal,...((n=r.filters)==null?void 0:n.signal)??{}}}}}function kfe(){const[r,e]=Kk("roadmap:prefs:v1",m$),i=B.useMemo(()=>__(r),[r]),n=B.useRef(!1);B.useEffect(()=>{if(n.current)return;let w=!1;return De.get("/roadmap-prefs").then(_=>{if(w)return;n.current=!0;const b=_.settings;b&&typeof b=="object"&&Object.keys(b).length>0&&e(__(b))}).catch(()=>{n.current=!0}),()=>{w=!0}},[e]);const s=B.useRef(null),o=B.useCallback(w=>{n.current&&(s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{De.put("/roadmap-prefs",{settings:w}).catch(()=>{})},600))},[]),h=B.useCallback(w=>{e(_=>{const b=w(__(_));return o(b),b})},[e,o]),l=B.useCallback(w=>h(_=>({..._,search:w})),[h]),u=B.useCallback(w=>h(_=>({..._,sortBy:w})),[h]),d=B.useCallback(()=>h(w=>({...w,sortDir:w.sortDir==="asc"?"desc":"asc"})),[h]),g=B.useCallback(w=>h(_=>({..._,layout:w})),[h]),f=B.useCallback(w=>h(_=>({..._,cardProps:{..._.cardProps,[w]:!_.cardProps[w]}})),[h]),m=B.useCallback(()=>h(w=>({...w,filters:{status:{inc:[],exc:[]},signal:{inc:[],exc:[]}}})),[h]),y=B.useCallback((w,_,b)=>{h(x=>{const C=x.filters[w],k=b==="inc"?{inc:C.inc.includes(_)?C.inc.filter(T=>T!==_):[...C.inc,_],exc:C.exc.filter(T=>T!==_)}:{exc:C.exc.includes(_)?C.exc.filter(T=>T!==_):[...C.exc,_],inc:C.inc.filter(T=>T!==_)};return{...x,filters:{...x.filters,[w]:k}}})},[h]);return{prefs:i,setSearch:l,setSort:u,toggleSortDir:d,setLayout:g,toggleCardProp:f,cycleFilter:y,clearAllFilters:m}}function Sfe(){const{data:r=[],isLoading:e}=Hk(),{data:i}=Zue();return{items:B.useMemo(()=>{const s=new Map(((i==null?void 0:i.objectives)??[]).map(o=>[o.slug,o]));return r.map(o=>{const h=s.get(o.slug);return{slug:o.slug,title:o.title,description:(h==null?void 0:h.description)??null,start_date:o.start_date,target_date:o.target_date,depends_on:o.depends_on,status:o.status??(h==null?void 0:h.status)??"not_started",statusOverride:o.status!=null,progress:(h==null?void 0:h.progress)??{done:0,total:0,pct:o.metric?0:null,source:o.metric?"metric":"tasks",metric:o.metric},tasks:(h==null?void 0:h.tasks)??[],impact:o.impact,effort:o.effort,metric:o.metric,slipDays:(h==null?void 0:h.slip_days)??null,slipUpstream:(h==null?void 0:h.slip_upstream)??[]}})},[r,i]),warnings:(i==null?void 0:i.warnings)??[],isLoading:e}}function CR(r,e){return!(e.exc.includes(r)||e.inc.length>0&&!e.inc.includes(r))}function Tfe(){const{prefs:r,setSearch:e,setSort:i,toggleSortDir:n,setLayout:s,toggleCardProp:o,cycleFilter:h,clearAllFilters:l}=kfe(),{search:u,sortBy:d,sortDir:g,layout:f,cardProps:m,filters:y}=r,[w,_]=B.useState(null),[b,x]=B.useState(!1),[C,k]=B.useState(null),[T,N]=B.useState(!1),[A,j]=B.useState(null),{items:E,warnings:L,isLoading:O}=Sfe(),D=B.useCallback(F=>j(F),[]);B.useEffect(()=>{if(!A)return;const F=setTimeout(()=>j(null),2600);return()=>clearTimeout(F)},[A]);const K=B.useCallback(()=>_(null),[]),z=B.useMemo(()=>CC(E),[E]),H=B.useMemo(()=>new Map(E.map(F=>[F.slug,F])),[E]),P=B.useMemo(()=>{const F=u.trim().toLowerCase();let G=E.filter(ee=>{var re;return(!F||ee.title.toLowerCase().includes(F)||ee.slug.includes(F))&&CR(ee.status,y.status)&&CR(((re=z.get(ee.slug))==null?void 0:re.signal)??"unforecastable",y.signal)});const U=g==="asc"?1:-1,X=(ee,re)=>(ee??"9999-99-99").localeCompare(re??"9999-99-99")*U;return d==="title"?G=[...G].sort((ee,re)=>ee.title.localeCompare(re.title)*U):d==="target"?G=[...G].sort((ee,re)=>{var le,fe;return X((le=z.get(ee.slug))==null?void 0:le.target,(fe=z.get(re.slug))==null?void 0:fe.target)}):d==="forecast"?G=[...G].sort((ee,re)=>{var le,fe;return X((le=z.get(ee.slug))==null?void 0:le.forecast_end,(fe=z.get(re.slug))==null?void 0:fe.forecast_end)}):d==="progress"&&(G=[...G].sort((ee,re)=>((ee.progress.pct??-1)-(re.progress.pct??-1))*U)),G},[E,u,y,d,g,z]),$=C?H.get(C):void 0,W=C?z.get(C):void 0,V=L.length>0&&!T;return a.jsxs("div",{style:{zoom:"var(--zoom)",height:"calc(100dvh - var(--header-height) - 2 * var(--space-4))",maxHeight:"calc(100dvh - var(--header-height) - 2 * var(--space-4))",display:"flex",flexDirection:"column",position:"relative",background:"var(--color-bg)",border:"1px solid var(--color-border)",borderRadius:14,overflow:"hidden",boxShadow:"var(--shadow-md)"},children:[a.jsx(Yde,{search:u,setSearch:e,sortBy:d,setSort:i,sortDir:g,toggleSortDir:n,layout:f,setLayout:s,cardProps:m,toggleCardProp:o,filters:y,cycleFilter:h,clearAllFilters:l,openMenu:w,setOpenMenu:_,onNewObjective:()=>x(!0)}),V&&a.jsxs("div",{className:"rm-warn",children:[a.jsx("span",{className:"rm-warn-icon",children:"⚠"}),a.jsx("div",{className:"rm-warn-list",children:L.map((F,G)=>a.jsx("span",{className:"rm-warn-item",children:F},G))}),a.jsx("span",{className:"rm-warn-x",onClick:()=>N(!0),title:"Dismiss",children:"✕"})]}),a.jsx("div",{style:{flex:1,minHeight:0,display:"flex",flexDirection:"column",background:"var(--color-bg)"},children:O?a.jsx(Efe,{children:"Loading objectives…"}):E.length===0?a.jsx(Nfe,{onCreate:()=>x(!0)}):P.length===0?a.jsx(jfe,{onClear:l}):f==="board"?a.jsx(vfe,{items:P,forecasts:z,onOpen:k}):a.jsx(yfe,{items:P,allItems:E,cardProps:m,onOpen:k,onToast:D})}),w!==null&&a.jsx("div",{onClick:K,style:{position:"absolute",inset:0,zIndex:35}}),$&&W&&a.jsx(wfe,{item:$,forecast:W,itemsBySlug:H,forecasts:z,onOpen:k,onClose:()=>k(null),onToast:D},$.slug),b&&a.jsx(afe,{onClose:()=>x(!1),onCreated:F=>D(`Objective “${F.title}” created`)}),A&&a.jsxs("div",{className:"bd-pop",style:{position:"absolute",bottom:22,left:"50%",transform:"translateX(-50%)",zIndex:60,display:"flex",alignItems:"center",gap:9,padding:"10px 16px",borderRadius:11,background:"var(--color-bg-elevated)",border:"1px solid var(--color-border)",boxShadow:"var(--shadow-lg)",fontSize:13,color:"var(--color-text)"},children:[a.jsx("span",{style:{color:"var(--color-accent)"},children:"✓"}),A]})]})}function Efe({children:r}){return a.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--color-text-tertiary)",fontSize:13},children:r})}function Nfe({onCreate:r}){return a.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:8,textAlign:"center",padding:40},children:[a.jsx("div",{style:{width:70,height:70,borderRadius:18,background:"linear-gradient(160deg, rgba(123,104,238,0.16), rgba(123,104,238,0.05))",border:"1px solid rgba(157,140,255,0.28)",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:12},children:a.jsxs("svg",{width:"34",height:"34",viewBox:"0 0 32 32",fill:"none",children:[a.jsx("line",{x1:"5",y1:"9",x2:"20",y2:"9",stroke:"#9d8cff",strokeWidth:"2.4",strokeLinecap:"round"}),a.jsx("line",{x1:"9",y1:"16",x2:"27",y2:"16",stroke:"#9d8cff",strokeWidth:"2.4",strokeLinecap:"round",opacity:"0.65"}),a.jsx("line",{x1:"5",y1:"23",x2:"16",y2:"23",stroke:"#9d8cff",strokeWidth:"2.4",strokeLinecap:"round",opacity:"0.4"})]})}),a.jsx("div",{style:{fontFamily:"var(--font-family-display)",fontWeight:700,fontSize:22,color:"var(--color-text)",letterSpacing:"-0.02em"},children:"No objectives yet"}),a.jsx("div",{style:{fontSize:14,color:"var(--color-text-tertiary)",maxWidth:440,lineHeight:1.55},children:"A roadmap is a board of outcomes you're driving toward. Author your first objective — the system computes progress, forecasts and slip for you."}),a.jsx("button",{onClick:r,className:"bd-chip",style:{marginTop:14,padding:"10px 18px",borderRadius:11,cursor:"pointer",background:"linear-gradient(150deg,#8b7bff,#6f5ce0)",color:"#fff",fontSize:13.5,fontWeight:600,border:"none",boxShadow:"0 8px 20px -6px rgba(123,104,238,0.8)"},children:"+ Create your first objective"})]})}function jfe({onClear:r}){return a.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:8,textAlign:"center",padding:40},children:[a.jsx("div",{style:{width:56,height:56,borderRadius:15,background:"var(--color-bg-elevated)",border:"1px solid var(--color-border)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:22,color:"var(--color-text-tertiary)",marginBottom:8},children:"⌕"}),a.jsx("div",{style:{fontFamily:"var(--font-family-display)",fontWeight:700,fontSize:18,color:"var(--color-text)"},children:"No objectives match your filters"}),a.jsx("div",{style:{fontSize:13.5,color:"var(--color-text-tertiary)"},children:"Try clearing a status or the slipping filter."}),a.jsx("button",{onClick:r,className:"bd-chip",style:{marginTop:8,padding:"8px 15px",borderRadius:9,cursor:"pointer",background:"var(--color-accent-soft)",color:"var(--color-accent-text)",fontSize:12.5,fontWeight:600,border:"none"},children:"✕ Clear filters"})]})}function Afe(){return a.jsx("div",{style:{height:"100%",minHeight:0},children:a.jsx(Tfe,{})})}const Mfe={order:{},collapsed:[]};function C_(r){const e={};if(r.order&&typeof r.order=="object"&&!Array.isArray(r.order))for(const[n,s]of Object.entries(r.order))Array.isArray(s)&&(e[n]=s.filter(o=>typeof o=="string"));const i=Array.isArray(r.collapsed)?r.collapsed.filter(n=>typeof n=="string"):[];return{order:e,collapsed:i}}function Lfe(){const[r,e]=Kk("lab:prefs:v1",Mfe),i=B.useMemo(()=>C_(r),[r]),n=B.useRef(!1);B.useEffect(()=>{if(n.current)return;let d=!1;return De.get("/lab-prefs").then(g=>{if(d)return;n.current=!0;const f=g.settings;f&&typeof f=="object"&&Object.keys(f).length>0&&e(C_(f))}).catch(()=>{n.current=!0}),()=>{d=!0}},[e]);const s=B.useRef(null),o=B.useCallback(d=>{n.current&&(s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{De.put("/lab-prefs",{settings:d}).catch(()=>{})},600))},[]),h=B.useCallback(d=>{e(g=>{const f=d(C_(g));return o(f),f})},[e,o]),l=B.useCallback(d=>{h(g=>({...g,collapsed:g.collapsed.includes(d)?g.collapsed.filter(f=>f!==d):[...g.collapsed,d]}))},[h]),u=B.useCallback((d,g)=>{h(f=>({...f,order:{...f.order,[d]:g}}))},[h]);return{prefs:i,toggleCollapsed:l,setGroupOrder:u}}function Rfe(r){var s;const e=((s=r[0])==null?void 0:s.points)??[];if(e.length<2)return null;const i=e[e.length-2].v;return e[e.length-1].v-i}function y$({latest:r,unit:e,series:i}){const n=Rfe(i),s=n===null?"var(--color-text-tertiary)":n>0?"var(--color-success)":n<0?"var(--color-error)":"var(--color-text-tertiary)",o=n!==null&&n>0?"+":"";return a.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:10},children:[a.jsx("span",{style:{fontFamily:"var(--font-family-display)",fontWeight:700,fontSize:32,color:"var(--color-text)",letterSpacing:"-0.02em"},children:r!==null?r.toLocaleString():"—"}),e&&a.jsx("span",{style:{fontSize:14,color:"var(--color-text-tertiary)"},children:e}),n!==null&&a.jsxs("span",{style:{fontSize:13,fontWeight:600,color:s},children:[o,n.toLocaleString()]})]})}const mh=["#7b68ee","#0091ff","#ff5b36","#4ade80","#ffae3b"],Dd=560,Ki={top:12,right:12,bottom:24,left:12};function wC({series:r,unit:e=null,height:i=200}){const n=B.useRef(null),[s,o]=B.useState(null),h=Dd-Ki.left-Ki.right,l=i-Ki.top-Ki.bottom,{xKeys:u,xFor:d,yFor:g,polylines:f,hasData:m}=B.useMemo(()=>{const T=r.flatMap(H=>H.points),N=Array.from(new Set(T.map(H=>H.t))).sort(),A=new Map(N.map((H,P)=>[H,P])),j=T.map(H=>H.v),E=Math.min(...j,0),O=Math.max(...j,1)-E||1,D=H=>{const P=A.get(H)??0;return N.length<=1?Ki.left+h/2:Ki.left+P/(N.length-1)*h},K=H=>Ki.top+l-(H-E)/O*l,z=r.map((H,P)=>({name:H.name,color:mh[P%mh.length],path:H.points.map($=>`${D($.t)},${K($.v)}`).join(" ")}));return{xKeys:N,xFor:D,yFor:K,polylines:z,hasData:T.length>0}},[r,h,l]);if(!m)return a.jsx("div",{style:{color:"var(--color-text-tertiary)",fontSize:13,padding:"24px 0"},children:"No data yet."});const y=T=>{const N=n.current;if(!N||u.length===0)return;const A=N.getBoundingClientRect();if(A.width===0)return;const E=((T.clientX-A.left)/A.width*Dd-Ki.left)/h,L=Math.round(E*(u.length-1));o(Math.max(0,Math.min(u.length-1,L)))},w=u[0],_=u[u.length-1],b=s!==null?u[s]??null:null,x=b!==null?d(b):null,C=b!==null?r.map((T,N)=>({name:T.name,color:mh[N%mh.length],point:T.points.find(A=>A.t===b)??null})):[],k=x!==null&&x>Dd/2;return a.jsxs("div",{style:{position:"relative"},children:[a.jsxs("svg",{ref:n,viewBox:`0 0 ${Dd} ${i}`,width:"100%",height:i,role:"img","aria-label":"Line chart",style:{display:"block",touchAction:"pan-y"},onPointerMove:y,onPointerLeave:()=>o(null),children:[a.jsx("line",{x1:Ki.left,y1:Ki.top+l,x2:Ki.left+h,y2:Ki.top+l,stroke:"var(--color-border)",strokeWidth:1}),f.map(T=>a.jsx("polyline",{points:T.path,fill:"none",stroke:T.color,strokeWidth:2,strokeLinejoin:"round",strokeLinecap:"round"},T.name)),x!==null&&a.jsxs("g",{pointerEvents:"none",children:[a.jsx("line",{x1:x,y1:Ki.top,x2:x,y2:Ki.top+l,stroke:"var(--color-text-tertiary)",strokeWidth:1,strokeDasharray:"3 3"}),C.map(T=>T.point?a.jsx("circle",{cx:x,cy:g(T.point.v),r:4,fill:T.color,stroke:"var(--color-bg-secondary)",strokeWidth:2},T.name):null)]}),a.jsx("text",{x:Ki.left,y:i-4,fontSize:10,fill:"var(--color-text-tertiary)",children:w}),a.jsx("text",{x:Ki.left+h,y:i-4,fontSize:10,fill:"var(--color-text-tertiary)",textAnchor:"end",children:_})]}),x!==null&&b!==null&&a.jsxs("div",{style:{position:"absolute",top:8,left:`${x/Dd*100}%`,transform:k?"translateX(calc(-100% - 10px))":"translateX(10px)",pointerEvents:"none",zIndex:5,background:"var(--color-bg-elevated)",border:"1px solid var(--color-border)",borderRadius:8,boxShadow:"var(--shadow-md)",padding:"7px 10px",minWidth:90,fontSize:12},children:[a.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:10.5,color:"var(--color-text-tertiary)",marginBottom:4},children:b}),C.map(T=>a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"1px 0"},children:[a.jsx("span",{style:{width:10,height:2,borderRadius:1,background:T.color,flexShrink:0}}),a.jsxs("span",{style:{fontWeight:700,color:"var(--color-text)",fontFamily:"var(--font-mono)"},children:[T.point?T.point.v.toLocaleString():"—",T.point&&e?` ${e}`:""]}),r.length>1&&a.jsx("span",{style:{color:"var(--color-text-secondary)",fontSize:11.5},children:T.name})]},T.name))]}),r.length>1&&a.jsx("div",{style:{display:"flex",gap:12,flexWrap:"wrap",marginTop:4},children:r.map((T,N)=>a.jsxs("span",{style:{display:"flex",alignItems:"center",gap:5,fontSize:12,color:"var(--color-text-secondary)"},children:[a.jsx("span",{style:{width:9,height:9,borderRadius:3,background:mh[N%mh.length],display:"inline-block"}}),T.name]},T.name))})]})}const wR=["#7b68ee","#0091ff","#ff5b36","#4ade80","#ffae3b","#c8ccd9"];function Bfe(r,e,i,n,s){const o=f=>[r+i*Math.cos(f),e+i*Math.sin(f)],[h,l]=o(n),[u,d]=o(s),g=s-n>Math.PI?1:0;return`M ${r} ${e} L ${h} ${l} A ${i} ${i} 0 ${g} 1 ${u} ${d} Z`}function b$({series:r,size:e=140,unit:i=null}){const[n,s]=B.useState(null),o=e/2,h=e/2,l=e*.43,u=r.map(y=>({name:y.name,value:y.points.length>0?y.points[y.points.length-1].v:0})).filter(y=>y.value>0),d=u.reduce((y,w)=>y+w.value,0);if(u.length===0||d<=0)return a.jsx("div",{style:{color:"var(--color-text-tertiary)",fontSize:13,padding:"24px 0"},children:"No data yet."});let g=-Math.PI/2;const f=u.map((y,w)=>{const _=y.value/d,b=g,x=g+_*2*Math.PI;return g=x,{name:y.name,value:y.value,frac:_,d:Bfe(o,h,l,b,x),color:wR[w%wR.length]}}),m=f.find(y=>y.name===n)??null;return a.jsxs("div",{style:{display:"flex",alignItems:"center",gap:16},children:[a.jsxs("div",{style:{position:"relative",flexShrink:0},children:[a.jsx("svg",{viewBox:`0 0 ${e} ${e}`,width:e,height:e,role:"img","aria-label":"Pie chart",children:f.map(y=>f.length===1?a.jsx("circle",{cx:o,cy:h,r:l,fill:y.color,stroke:"var(--color-bg)",strokeWidth:1,onPointerEnter:()=>s(y.name),onPointerLeave:()=>s(null)},y.name):a.jsx("path",{d:y.d,fill:y.color,stroke:"var(--color-bg)",strokeWidth:1,opacity:n===null||n===y.name?1:.45,style:{transition:"opacity 0.12s ease",cursor:"default"},onPointerEnter:()=>s(y.name),onPointerLeave:()=>s(null)},y.name))}),m&&a.jsxs("div",{style:{position:"absolute",top:-6,left:"50%",transform:"translate(-50%, -100%)",pointerEvents:"none",zIndex:5,whiteSpace:"nowrap",background:"var(--color-bg-elevated)",border:"1px solid var(--color-border)",borderRadius:8,boxShadow:"var(--shadow-md)",padding:"6px 10px",fontSize:12},children:[a.jsxs("span",{style:{fontWeight:700,color:"var(--color-text)",fontFamily:"var(--font-mono)"},children:[m.value.toLocaleString(),i?` ${i}`:""]}),a.jsxs("span",{style:{color:"var(--color-text-secondary)",marginLeft:6},children:[m.name," · ",(m.frac*100).toFixed(1),"%"]})]})]}),a.jsx("div",{style:{display:"flex",flexDirection:"column",gap:6},children:f.map(y=>a.jsxs("span",{style:{display:"flex",alignItems:"center",gap:6,fontSize:12,color:n===y.name?"var(--color-text)":"var(--color-text-secondary)"},onPointerEnter:()=>s(y.name),onPointerLeave:()=>s(null),children:[a.jsx("span",{style:{width:9,height:9,borderRadius:3,background:y.color,display:"inline-block"}}),y.name," — ",(y.frac*100).toFixed(1),"%"]},y.name))})]})}function v$({series:r}){const[e,i]=B.useState("table");return a.jsxs("div",{children:[a.jsxs("div",{style:{display:"flex",gap:6,marginBottom:8},children:[a.jsx("button",{onClick:()=>i("table"),style:{padding:"4px 10px",borderRadius:7,fontSize:12,fontWeight:600,cursor:"pointer",border:"1px solid var(--color-border)",background:e==="table"?"var(--color-accent-soft)":"transparent",color:e==="table"?"var(--color-accent)":"var(--color-text-secondary)"},children:"Table"}),a.jsx("button",{onClick:()=>i("json"),style:{padding:"4px 10px",borderRadius:7,fontSize:12,fontWeight:600,cursor:"pointer",border:"1px solid var(--color-border)",background:e==="json"?"var(--color-accent-soft)":"transparent",color:e==="json"?"var(--color-accent)":"var(--color-text-secondary)"},children:"JSON"})]}),e==="table"?a.jsx("div",{style:{maxHeight:220,overflow:"auto",border:"1px solid var(--color-border)",borderRadius:8},children:a.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:12.5},children:[a.jsx("thead",{children:a.jsxs("tr",{style:{background:"var(--color-bg-tertiary)"},children:[a.jsx("th",{style:{textAlign:"left",padding:"6px 10px"},children:"Series"}),a.jsx("th",{style:{textAlign:"left",padding:"6px 10px"},children:"Time"}),a.jsx("th",{style:{textAlign:"right",padding:"6px 10px"},children:"Value"})]})}),a.jsx("tbody",{children:r.flatMap(n=>n.points.map((s,o)=>a.jsxs("tr",{style:{borderTop:"1px solid var(--color-border)"},children:[a.jsx("td",{style:{padding:"5px 10px",color:"var(--color-text-secondary)"},children:n.name}),a.jsx("td",{style:{padding:"5px 10px"},children:s.t}),a.jsx("td",{style:{padding:"5px 10px",textAlign:"right",fontFamily:"var(--font-mono)"},children:s.v})]},`${n.name}-${s.t}-${o}`)))})]})}):a.jsx("pre",{style:{maxHeight:220,overflow:"auto",margin:0,padding:10,borderRadius:8,border:"1px solid var(--color-border)",background:"var(--color-bg-tertiary)",fontFamily:"var(--font-mono)",fontSize:11.5,color:"var(--color-text)"},children:JSON.stringify(r,null,2)})]})}function x$({tweaks:r,onSave:e,saving:i}){const[n,s]=B.useState(()=>{const h={};for(const l of r)h[l.key]=l.value??l.default??"";return h});if(r.length===0)return null;const o=(h,l)=>s(u=>({...u,[h]:l}));return a.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,marginTop:8},children:[r.map(h=>a.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,fontSize:12.5},children:[a.jsx("span",{style:{minWidth:90,color:"var(--color-text-secondary)"},children:h.label??h.key}),h.type==="enum"?a.jsx("select",{value:n[h.key]??"",onChange:l=>o(h.key,l.target.value),style:{padding:"4px 8px",borderRadius:6,border:"1px solid var(--color-border)",background:"var(--color-bg)",color:"var(--color-text)",fontSize:12.5},children:(h.options??[]).map(l=>a.jsx("option",{value:l,children:l},l))}):h.type==="date"?a.jsx("input",{type:"date",value:n[h.key]??"",onChange:l=>o(h.key,l.target.value),style:{padding:"4px 8px",borderRadius:6,border:"1px solid var(--color-border)",background:"var(--color-bg)",color:"var(--color-text)",fontSize:12.5}}):a.jsx("input",{type:"text",value:n[h.key]??"",onChange:l=>o(h.key,l.target.value),style:{padding:"4px 8px",borderRadius:6,border:"1px solid var(--color-border)",background:"var(--color-bg)",color:"var(--color-text)",fontSize:12.5,flex:1}})]},h.key)),a.jsx("button",{onClick:()=>e(n),disabled:i,style:{alignSelf:"flex-start",padding:"5px 12px",borderRadius:7,fontSize:12,fontWeight:600,cursor:i?"default":"pointer",border:"none",background:"var(--color-accent)",color:"var(--color-accent-text)",opacity:i?.6:1},children:i?"Saving…":"Save"})]})}function Ofe({summary:r}){if(r.error)return a.jsx("span",{className:"lab-badge lab-badge--error",title:r.error,children:"⚠ error"});if(!r.fetchedAt)return a.jsx("span",{className:"lab-badge lab-badge--muted",children:"never synced"});if(r.stale){const e=r.staleMinutes!==null?Math.round(r.staleMinutes/60):null;return a.jsxs("span",{className:"lab-badge lab-badge--stale",children:["stale",e!==null?` (${e}h)`:""]})}return a.jsx("span",{className:"lab-badge lab-badge--fresh",children:"fresh"})}function Dfe({summary:r,onToast:e,onOpen:i,dragging:n=!1,dropTarget:s=!1,onDragStart:o,onDragOver:h,onDrop:l,onDragEnd:u}){var C;const[d,g]=B.useState(!1),f=o$(r.slug),m=l$(),y=h$(),w=(C=f.data)==null?void 0:C.cache,_=(w==null?void 0:w.series)??[],b=()=>{m.mutate(r.slug,{onSuccess:k=>{const T=k.results[0];(T==null?void 0:T.status)==="failed"?e(`${r.title}: sync failed — ${T.error??"unknown error"}`):e(`${r.title}: refreshed.`)},onError:k=>e(`${r.title}: refresh failed — ${k.message}`)})},x=k=>{y.mutate({slug:r.slug,tweaks:k},{onSuccess:()=>e(`${r.title}: tweaks saved.`),onError:T=>e(`${r.title}: could not save tweaks — ${T.message}`)})};return a.jsxs("div",{className:`lab-card lab-card--clickable${n?" lab-card--dragging":""}${s?" lab-card--drop-target":""}`,onClick:()=>i(r.slug),role:"button",tabIndex:0,onKeyDown:k=>{k.key==="Enter"&&i(r.slug)},title:"Open details, history & interactive chart",draggable:!0,onDragStart:o,onDragOver:h,onDrop:l,onDragEnd:u,children:[a.jsxs("div",{className:"lab-card-header",children:[a.jsxs("div",{className:"lab-card-title-row",children:[a.jsx("span",{className:"lab-card-title",children:r.title}),r.binding&&a.jsxs("span",{className:"lab-badge lab-badge--binding",title:`Feeds objective: ${r.binding.objective}`,children:["feeds ",r.binding.objective]})]}),a.jsxs("div",{className:"lab-card-actions",onClick:k=>k.stopPropagation(),children:[a.jsx(Ofe,{summary:r}),a.jsx("button",{className:"lab-card-refresh",onClick:b,disabled:m.isPending,title:"Refresh this insight",children:m.isPending?"…":"↻"})]})]}),a.jsxs("div",{className:"lab-card-body",children:[r.render==="number"&&a.jsx(y$,{latest:r.latest,unit:r.unit,series:_}),r.render==="line"&&a.jsx(wC,{series:_,unit:r.unit}),r.render==="pie"&&a.jsx(b$,{series:_,unit:r.unit}),r.render==="raw"&&a.jsx("div",{onClick:k=>k.stopPropagation(),children:a.jsx(v$,{series:_})})]}),r.tweaks.length>0&&a.jsxs("div",{className:"lab-card-tweaks",onClick:k=>k.stopPropagation(),children:[a.jsx("button",{className:"lab-card-tweaks-toggle",onClick:()=>g(k=>!k),children:d?"Hide tweaks":"Edit tweaks"}),d&&a.jsx(x$,{tweaks:r.tweaks,saving:y.isPending,onSave:x})]})]})}function kC(r){const e=new Date(r);return Number.isNaN(e.getTime())?r:e.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function Ife(r){return r%1440===0?`${r/1440}d`:r%60===0?`${r/60}h`:`${r}m`}function Ffe({summary:r}){if(r.error)return a.jsx("span",{className:"lab-badge lab-badge--error",title:r.error,children:"⚠ error"});if(!r.fetchedAt)return a.jsx("span",{className:"lab-badge lab-badge--muted",children:"never synced"});if(r.stale){const e=r.staleMinutes!==null?Math.round(r.staleMinutes/60):null;return a.jsxs("span",{className:"lab-badge lab-badge--stale",children:["stale",e!==null?` (${e}h)`:""]})}return a.jsx("span",{className:"lab-badge lab-badge--fresh",children:"fresh"})}function $fe({event:r,unit:e}){return a.jsxs("div",{className:"idp-history-row",children:[a.jsx("span",{className:`idp-history-dot idp-history-dot--${r.status}`}),a.jsx("span",{className:"idp-history-when",children:kC(r.at)}),r.status==="ok"?a.jsxs("span",{className:"idp-history-value",children:[r.latest!==null?r.latest.toLocaleString():"—",r.latest!==null&&e?` ${e}`:"",r.granularity&&a.jsx("span",{className:"idp-history-gran",children:r.granularity})]}):a.jsx("span",{className:"idp-history-error",title:r.error??void 0,children:r.error??"failed"})]})}function Pfe({summary:r,onClose:e,onToast:i}){var b,x,C,k;const n=o$(r.slug),s=l$(),o=h$();B.useEffect(()=>{const T="insight-detail-panel";Ak(T);const N=A=>{if(A.key!=="Escape"||!Lk(T))return;const j=A.target;if(j&&(j.tagName==="INPUT"||j.tagName==="TEXTAREA"||j.tagName==="SELECT")){j.blur();return}A.preventDefault(),A.stopImmediatePropagation(),e()};return window.addEventListener("keydown",N,!0),()=>{window.removeEventListener("keydown",N,!0),Mk(T)}},[e]);const h=((b=n.data)==null?void 0:b.insight)??null,l=((x=n.data)==null?void 0:x.cache)??null,u=(l==null?void 0:l.series)??[],d=(((C=n.data)==null?void 0:C.meaning)??"").replace(/^##\s*Meaning\s*/i,"").trim(),g=((k=n.data)==null?void 0:k.resolvedTweaks)??{},f=Array.isArray(l==null?void 0:l.history)?[...l.history].reverse():[],m=()=>{s.mutate(r.slug,{onSuccess:T=>{const N=T.results[0];(N==null?void 0:N.status)==="failed"?i(`${r.title}: sync failed — ${N.error??"unknown error"}`):i(`${r.title}: refreshed.`)},onError:T=>i(`${r.title}: refresh failed — ${T.message}`)})},y=T=>{o.mutate({slug:r.slug,tweaks:T},{onSuccess:()=>i(`${r.title}: tweaks saved.`),onError:N=>i(`${r.title}: could not save tweaks — ${N.message}`)})},w=[];r.group&&w.push(["Group",r.group]),h!=null&&h.adapter&&w.push(["Source",h.adapter==="http"?`HTTP ${h.method??"GET"}`:"custom script"]),w.push(["Render",r.render]),r.unit&&w.push(["Unit",r.unit]),w.push(["Refresh TTL",Ife(r.ttlMinutes)]),l!=null&&l.granularity&&w.push(["Granularity",l.granularity]),r.fetchedAt&&w.push(["Last synced",kC(r.fetchedAt)]),h&&h.credentials_used.length>0&&w.push(["Credentials",h.credentials_used.join(", ")]);const _=Object.entries(g);return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"idp-overlay",onClick:e}),a.jsxs("div",{className:"idp-panel",role:"dialog","aria-modal":"true","aria-label":r.title,children:[a.jsxs("div",{className:"idp-head",children:[a.jsxs("div",{className:"idp-head-row",children:[a.jsx(Ffe,{summary:r}),r.binding&&a.jsxs("span",{className:"lab-badge lab-badge--binding",title:`Feeds objective: ${r.binding.objective}`,children:["feeds ",r.binding.objective]}),a.jsx("span",{className:"idp-spacer"}),a.jsx("button",{className:"idp-refresh",onClick:m,disabled:s.isPending,title:"Refresh this insight",children:s.isPending?"Refreshing…":"↻ Refresh"}),a.jsx("span",{className:"idp-close",onClick:e,title:"Close (Esc)",children:"✕"})]}),a.jsx("div",{className:"idp-title",children:r.title}),a.jsx("div",{className:"idp-slug",children:r.slug}),(h==null?void 0:h.description)&&a.jsx("div",{className:"idp-desc",children:h.description})]}),a.jsxs("div",{className:"idp-body",children:[r.error&&a.jsxs("div",{className:"idp-error-banner",children:[a.jsx("span",{className:"idp-error-glyph",children:"⚠"}),a.jsxs("div",{children:[a.jsxs("div",{className:"idp-error-title",children:["Last sync failed",r.errorAt?` · ${kC(r.errorAt)}`:""]}),a.jsx("div",{className:"idp-error-sub",children:r.error})]})]}),n.isLoading?a.jsx("div",{className:"idp-loading",children:"Loading…"}):a.jsxs("div",{className:"idp-columns",children:[a.jsxs("div",{className:"idp-col-main",children:[a.jsxs("div",{className:"idp-chart",children:[r.render==="number"&&a.jsxs(a.Fragment,{children:[a.jsx(y$,{latest:r.latest,unit:r.unit,series:u}),u.some(T=>T.points.length>1)&&a.jsx("div",{className:"idp-chart-trend",children:a.jsx(wC,{series:u,unit:r.unit,height:280})})]}),r.render==="line"&&a.jsx(wC,{series:u,unit:r.unit,height:340}),r.render==="pie"&&a.jsx(b$,{series:u,size:240,unit:r.unit}),r.render==="raw"&&a.jsx(v$,{series:u})]}),d&&a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"idp-section-label",children:"Meaning"}),a.jsx("div",{className:"idp-meaning",children:d})]})]}),a.jsxs("div",{className:"idp-col-rail",children:[a.jsx("div",{className:"idp-section-label",children:"Details"}),a.jsxs("div",{className:"idp-details",children:[w.map(([T,N])=>a.jsxs("div",{className:"idp-detail-row",children:[a.jsx("span",{className:"idp-detail-label",children:T}),a.jsx("span",{className:"idp-detail-value",children:N})]},T)),_.length>0&&a.jsxs("div",{className:"idp-detail-row",children:[a.jsx("span",{className:"idp-detail-label",children:"Tweaks"}),a.jsx("span",{className:"idp-detail-value",children:_.map(([T,N])=>`${T}=${N}`).join(" · ")})]})]}),r.tweaks.length>0&&a.jsxs("div",{className:"idp-tweaks",children:[a.jsx("div",{className:"idp-section-label",children:"Edit tweaks"}),a.jsx(x$,{tweaks:r.tweaks,saving:o.isPending,onSave:y})]}),a.jsxs("div",{className:"idp-section-label",children:["Update history",f.length>0&&a.jsx("span",{className:"idp-history-count",children:f.length})]}),f.length===0?a.jsx("div",{className:"idp-history-empty",children:"No sync history yet — each refresh from now on is recorded here."}):a.jsx("div",{className:"idp-history",children:f.map((T,N)=>a.jsx($fe,{event:T,unit:r.unit},`${T.at}-${N}`))})]})]})]})]})]})}function kR({onToast:r}){const{t:e}=wr(),{data:i}=Zde(),n=Qde(),[s,o]=B.useState({}),[h,l]=B.useState(!1),u=(i??[]).filter(g=>!g.present);if(u.length===0)return null;const d=g=>{const f=s[g]??"";f.trim()&&n.mutate({key:g,value:f},{onSuccess:()=>{o(m=>({...m,[g]:""})),r(e("lab.credentials.saved").replace("{key}",g))},onError:m=>{r(e("lab.credentials.saveFailed").replace("{key}",g).replace("{message}",m.message))}})};return a.jsxs("div",{className:"lab-cred-banner",role:"alert",children:[a.jsxs("div",{className:"lab-cred-banner-header",children:[a.jsx("span",{className:"lab-cred-banner-title",children:e("lab.credentials.title").replace("{n}",String(u.length))}),a.jsx("button",{className:"lab-cred-banner-toggle",onClick:()=>l(g=>!g),"aria-expanded":!h,children:e(h?"lab.credentials.expand":"lab.credentials.collapse")})]}),!h&&a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"lab-cred-banner-hint",children:e("lab.credentials.hint")}),a.jsx("ul",{className:"lab-cred-banner-list",children:u.map(({key:g,usedBy:f})=>a.jsxs("li",{className:"lab-cred-banner-row",children:[a.jsxs("div",{className:"lab-cred-banner-key",children:[a.jsx("code",{children:g}),a.jsx("span",{className:"lab-cred-banner-usedby",children:e("lab.credentials.usedBy").replace("{slugs}",f.join(", "))})]}),a.jsxs("div",{className:"lab-cred-banner-form",children:[a.jsx("input",{type:"password",className:"lab-cred-banner-input",placeholder:e("lab.credentials.placeholder"),autoComplete:"off",value:s[g]??"",onChange:m=>o(y=>({...y,[g]:m.target.value})),onKeyDown:m=>{m.key==="Enter"&&d(g)}}),a.jsx("button",{className:"lab-cred-banner-save",onClick:()=>d(g),disabled:n.isPending||!(s[g]??"").trim(),children:n.isPending?e("lab.credentials.saving"):e("lab.credentials.save")})]})]},g))})]})]})}function zfe(r,e,i){const n=i*.6,o=Math.max(6,Math.floor((e-i*2)/n));if(r.length<=o)return[r];const h=[];let l="";const u=(d,g)=>{const f=l?l+g+d:d;l&&f.length>o?(h.push(l),l=d):l=f};return r.split(" · ").forEach((d,g)=>{const f=g===0?"":" · ";d.length<=o?u(d,f):d.split(" ").forEach((m,y)=>u(m,y===0?f:" "))}),l&&h.push(l),h}function kc({spec:r,className:e,size:i="full"}){const s=B.useId().replace(/[^a-zA-Z0-9_-]/g,""),o=`fd-node-${s}`,h=`fd-dot-${s}`,l=`fd-arrow-${s}`,u=i==="mini"?5:7;return a.jsx("div",{className:`fd fd--${i} ${e??""}`,role:"img","aria-label":r.ariaLabel,children:a.jsxs("svg",{viewBox:r.viewBox,preserveAspectRatio:"xMidYMid meet",className:"fd-svg",children:[a.jsxs("defs",{children:[a.jsxs("linearGradient",{id:o,x1:"0",y1:"0",x2:"0",y2:"1",children:[a.jsx("stop",{offset:"0",className:"fd-node-grad-a"}),a.jsx("stop",{offset:"1",className:"fd-node-grad-b"})]}),a.jsxs("radialGradient",{id:h,children:[a.jsx("stop",{offset:"0",className:"fd-dot-core"}),a.jsx("stop",{offset:"0.45",className:"fd-dot-mid"}),a.jsx("stop",{offset:"1",className:"fd-dot-edge"})]}),a.jsx("marker",{id:l,viewBox:"0 0 10 10",refX:"8.5",refY:"5",markerWidth:"6.5",markerHeight:"6.5",orient:"auto-start-reverse",markerUnits:"userSpaceOnUse",children:a.jsx("path",{d:"M0 1 L9 5 L0 9 z",className:"fd-arrowhead"})})]}),a.jsx("g",{className:"fd-wires",fill:"none",children:r.edges.map(d=>a.jsxs("g",{children:[a.jsx("path",{d:d.d,className:`fd-wire${d.dashed?" fd-wire--dashed":""}${d.thin?" fd-wire--thin":""}`,markerEnd:d.arrow?`url(#${l})`:void 0}),d.comet!==!1&&a.jsx("circle",{cx:"0",cy:"0",r:u,className:"fd-comet-dot",fill:`url(#${h})`,style:{offsetPath:`path('${d.d}')`,animationDelay:`${d.delay??0}s`,animationDuration:`${d.dur??2.6}s`}}),d.label&&a.jsx("text",{x:d.label.x,y:d.label.y,className:"fd-label",transform:d.label.rotate!==void 0?`rotate(${d.label.rotate} ${d.label.x} ${d.label.y})`:void 0,children:d.label.text})]},d.id))}),r.nodes.map(d=>{const g=d.x+d.w/2,f=d.y+d.h/2,m=d.sub==null?[]:Array.isArray(d.sub)?d.sub:d.glyph?[d.sub]:zfe(d.sub,d.w,i==="mini"?10:12),y=15,w=d.glyph?f+6:m.length?f-8-(m.length-1)*(y/2):f,_=d.glyph?d.y+d.h-16:w+22;return a.jsxs("g",{className:`fd-node fd-node--${d.variant??"plain"}${d.breathe?" fd-node--breathe":""}`,children:[a.jsx("rect",{x:d.x,y:d.y,width:d.w,height:d.h,rx:"14",fill:`url(#${o})`,style:d.breathe&&d.breatheDelay!==void 0?{animationDelay:`${d.breatheDelay}s`}:void 0}),d.glyph&&a.jsx("text",{x:g,y:d.y+26,className:"fd-region-glyph",children:d.glyph}),a.jsx("text",{x:g,y:w,className:"fd-node-title",children:d.title}),m.length>0&&a.jsx("text",{x:g,y:_,className:"fd-node-sub",children:m.map((b,x)=>a.jsx("tspan",{x:g,dy:x===0?0:y,children:b},x))})]},d.id)})]})})}const qfe=3,Hfe=9;function SR(r,e,i,n){const s=r.w/2+n,o=r.h/2+n,h=e-r.cx,l=i-r.cy,u=h!==0?s/Math.abs(h):1/0,d=l!==0?o/Math.abs(l):1/0,g=Math.min(u,d);return[r.cx+h*g,r.cy+l*g]}function _$(r){return function(i,n,s=0){const o=r[i],h=r[n],[l,u]=SR(o,h.cx,h.cy,qfe),[d,g]=SR(h,o.cx,o.cy,Hfe),f=(l+d)/2,m=(u+g)/2;let y=d-l,w=g-u;const _=Math.hypot(y,w)||1;y/=_,w/=_;const b=f+-w*s*_,x=m+y*s*_;return`M ${l.toFixed(1)} ${u.toFixed(1)} Q ${b.toFixed(1)} ${x.toFixed(1)} ${d.toFixed(1)} ${g.toFixed(1)}`}}const SC=120,TC=50,Vk=[{id:"s1",x:20,y:44,title:"PostHog",sub:"product",delay:0},{id:"s2",x:20,y:158,title:"Stripe",sub:"revenue",delay:.4},{id:"s3",x:20,y:272,title:"HTTP · script",sub:"anything",delay:.8}],C$=[{id:"sync",x:209,y:156,w:134,h:100,title:"sync",sub:["↻ TTL-gated","rollup · cap"],variant:"rem"},{id:"cache",x:409,y:170,w:126,h:72,title:"insight",sub:"cached series",variant:"accent"},{id:"c1",x:550,y:114,w:140,h:56,title:"agents",sub:"session snapshot",variant:"agent"},{id:"c2",x:550,y:242,w:140,h:56,title:"roadmap KR",sub:"measured metric",variant:"agent"}],Yk={};for(const r of Vk)Yk[r.id]={cx:r.x+SC/2,cy:r.y+TC/2,w:SC,h:TC};for(const r of C$)Yk[r.id]={cx:r.x+r.w/2,cy:r.y+r.h/2,w:r.w,h:r.h};const Tm=_$(Yk),Ufe=Vk.map((r,e)=>({id:`${r.id}-sync`,d:Tm(r.id,"sync"),arrow:!0,thin:!0,dur:2.4+e%3*.2,delay:e*.5%2.4})),Wfe={viewBox:"0 0 700 366",ariaLabel:"External sources — a PostHog query, a Stripe number, any HTTP API or local script — converge into one sync, which rolls the raw data down to a capped curated series, caches it in the brain, and fans it out to every agent’s session snapshot and a bound roadmap Key Result.",nodes:[...Vk.map(r=>({id:r.id,x:r.x,y:r.y,w:SC,h:TC,title:r.title,sub:r.sub,variant:"region",breathe:!0,breatheDelay:r.delay})),...C$],edges:[...Ufe,{id:"sync-cache",d:Tm("sync","cache"),arrow:!0,dur:2.3,delay:.3},{id:"cache-c1",d:Tm("cache","c1",.06),arrow:!0,dur:2.2,delay:.9},{id:"cache-c2",d:Tm("cache","c2",-.06),arrow:!0,dur:2.2,delay:1.3}]};function Gfe(){return a.jsxs("div",{className:"lab-stage",children:[a.jsx("span",{className:"lab-stage-tag",children:"Insights"}),a.jsx(kc,{spec:Wfe,className:"lab-stage-flow"})]})}function Kfe(){return a.jsxs("div",{className:"lab-intro",children:[a.jsx("div",{className:"lab-intro-mark",children:a.jsx(cb,{size:40,glow:!0})}),a.jsx("p",{className:"lab-intro-kicker",children:"Insights"}),a.jsxs("h2",{className:"lab-intro-title",children:["The metrics that matter, ",a.jsx("span",{children:"live in the brain"}),"."]}),a.jsx("p",{className:"lab-intro-lead",children:"Insights are curated analytics — WAU, conversion, revenue — pulled from PostHog, Stripe, any HTTP API, or your own script. One sync rolls the raw data into a capped series, caches it here, and feeds it to every agent’s session snapshot and your bound roadmap Key Results. Not a BI tool — a metrics-delivery layer for agents."}),a.jsx(Gfe,{}),a.jsx("p",{className:"lab-intro-scaffold",children:"Scaffold your first insight from the CLI:"}),a.jsx("code",{className:"lab-intro-cmd",children:'dreamcontext lab create <slug> --title "Weekly Active Users" --render number --adapter http'}),a.jsx("p",{className:"lab-intro-foot",children:"Insights is experimental. Sources sync on demand (TTL-gated); credentials stay gitignored and are never logged. Bind an insight to a roadmap objective to turn asserted targets into measured ones."})]})}const Qg="Ungrouped";function Vfe(r){const e=new Map;for(const s of r){const o=s.group??Qg,h=e.get(o);h?h.push(s):e.set(o,[s])}const i=[...e.keys()].filter(s=>s!==Qg).sort();return(e.has(Qg)?[...i,Qg]:i).map(s=>[s,e.get(s)])}function Yfe(r,e){if(!e||e.length===0)return r;const i=new Map(e.map((n,s)=>[n,s]));return r.map((n,s)=>({item:n,key:i.get(n.slug)??e.length+s})).sort((n,s)=>n.key-s.key).map(n=>n.item)}function Xfe(){const{data:r,isLoading:e,isError:i,error:n}=Gk(),s=Xde(),{prefs:o,toggleCollapsed:h,setGroupOrder:l}=Lfe(),[u,d]=B.useState(null),[g,f]=B.useState(null),[m,y]=B.useState(null),[w,_]=B.useState(null);B.useEffect(()=>{if(!u)return;const N=setTimeout(()=>d(null),4200);return()=>clearTimeout(N)},[u]);const b=B.useMemo(()=>Vfe(r??[]).map(([N,A])=>[N,Yfe(A,o.order[N])]),[r,o.order]),x=g?(r??[]).find(N=>N.slug===g)??null:null,C=B.useCallback(()=>{y(null),_(null)},[]),k=B.useCallback((N,A,j)=>{if(!m||m.group!==N){C();return}const E=A.map(O=>O.slug).filter(O=>O!==m.slug),L=j===null?E.length:E.indexOf(j);E.splice(L===-1?E.length:L,0,m.slug),l(N,E),C()},[m,l,C]),T=()=>{s.mutate(!0,{onSuccess:N=>{if(N.failed.length>0){const A=N.failed.map(j=>j.slug).join(", ");d(`⚠ ${N.failed.length} of ${N.results.length} insight(s) failed: ${A}`)}else d(`Synced ${N.results.length} insight(s).`)},onError:N=>d(`Sync all failed: ${N.message}`)})};return e?a.jsx("div",{className:"lab-board",children:a.jsx("div",{className:"lab-board-loading",children:"Loading insights…"})}):i?a.jsx("div",{className:"lab-board",children:a.jsxs("div",{className:"error-state",children:["Failed to load insights. ",n==null?void 0:n.message]})}):!r||r.length===0?a.jsxs("div",{className:"lab-board lab-board--empty",children:[a.jsx(kR,{onToast:d}),a.jsx(Kfe,{}),u&&a.jsx("div",{className:"lab-toast",children:u})]}):a.jsxs("div",{className:"lab-board",children:[a.jsx(kR,{onToast:d}),a.jsx("div",{className:"lab-board-toolbar",children:a.jsx("button",{className:"lab-board-sync-all",onClick:T,disabled:s.isPending,children:s.isPending?"Syncing…":"Sync all"})}),a.jsx("div",{className:"lab-board-sections",children:b.map(([N,A])=>{const j=o.collapsed.includes(N);return a.jsxs("section",{className:"lab-board-section",children:[a.jsxs("button",{className:"lab-board-section-header",onClick:()=>h(N),"aria-expanded":!j,children:[a.jsx("svg",{className:`lab-board-section-chevron ${j?"":"lab-board-section-chevron--open"}`,width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",children:a.jsx("path",{d:"M3 2L7 5L3 8",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})}),a.jsx("span",{className:"lab-board-section-title",children:N}),a.jsx("span",{className:"lab-board-section-count",children:A.length})]}),!j&&a.jsx("div",{className:"lab-board-grid",onDragOver:E=>{(m==null?void 0:m.group)===N&&(E.preventDefault(),E.dataTransfer.dropEffect="move")},onDrop:E=>{(m==null?void 0:m.group)===N&&(E.preventDefault(),k(N,A,null))},children:A.map(E=>a.jsx(Dfe,{summary:E,onToast:d,onOpen:f,dragging:(m==null?void 0:m.slug)===E.slug,dropTarget:w===E.slug&&(m==null?void 0:m.slug)!==E.slug,onDragStart:L=>{y({slug:E.slug,group:N});try{L.dataTransfer.effectAllowed="move"}catch{}},onDragOver:L=>{(m==null?void 0:m.group)===N&&(L.preventDefault(),L.dataTransfer.dropEffect="move",_(E.slug))},onDrop:L=>{(m==null?void 0:m.group)===N&&(L.preventDefault(),L.stopPropagation(),k(N,A,E.slug))},onDragEnd:C},E.slug))})]},N)})}),x&&a.jsx(Pfe,{summary:x,onClose:()=>f(null),onToast:d}),u&&a.jsx("div",{className:"lab-toast",children:u})]})}function Zfe(){return a.jsx("div",{style:{height:"100%",minHeight:0},children:a.jsx(Xfe,{})})}function Qfe(){return Yt({queryKey:["changelog"],queryFn:()=>De.get("/changelog")})}const Jfe=25,epe={task:{icon:Rw,labelKey:"sleep.entity.task"},knowledge:{icon:Mw,labelKey:"sleep.entity.knowledge"},feature:{icon:Lw,labelKey:"sleep.entity.feature"},core:{icon:Bw,labelKey:"sleep.entity.core"},sleep:{icon:Hy,labelKey:"sleep.entity.sleep"}};function Xk(r){if(!r)return"";const e=/^(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2})/.exec(r);return e?`${e[1]} ${e[2]}`:r.slice(0,16)}function TR({entry:r}){const{t:e}=wr();return a.jsxs("div",{className:"changelog-item",children:[a.jsxs("div",{className:"changelog-meta",children:[a.jsx("span",{className:"task-tag","data-hue":na(r.type),children:r.type}),r.scope&&a.jsx("span",{className:"changelog-scope",children:r.scope}),r.breaking&&a.jsx("span",{className:"changelog-breaking",children:e("sleep.changelog.breaking")})]}),a.jsx("p",{className:"changelog-summary",children:r.summary}),r.description&&a.jsx("p",{className:"changelog-desc",children:r.description})]})}function Jg({icon:r,count:e,label:i}){return a.jsxs("div",{className:"cloud-stat",children:[a.jsx("span",{className:"cloud-stat-icon",children:a.jsx(r,{size:16})}),a.jsx("span",{className:"cloud-stat-count",children:e}),a.jsx("span",{className:"cloud-stat-label",children:i})]})}function em({title:r,hint:e,count:i,children:n}){return a.jsxs("div",{className:"cloud-group",children:[a.jsxs("div",{className:"cloud-group-head",children:[a.jsx("h3",{className:"cloud-group-title",children:r}),a.jsx("span",{className:"cloud-group-count",children:i})]}),a.jsx("p",{className:"cloud-group-hint",children:e}),a.jsx("div",{className:"cloud-rows",children:n})]})}function tpe({session:r}){const{t:e}=wr();return a.jsxs("div",{className:"cloud-row",children:[a.jsxs("div",{className:"cloud-row-meta",children:[a.jsx("span",{className:"cloud-row-time",children:Xk(r.stopped_at)||e("sleep.cloud.active")}),r.score!==null&&a.jsxs("span",{className:"session-score",children:["+",r.score]}),r.change_count!==null&&a.jsxs("span",{className:"session-changes",children:[r.change_count," changes"]}),r.tool_count!=null&&a.jsxs("span",{className:"session-changes",children:[r.tool_count," tools"]})]}),r.last_assistant_message&&a.jsxs("p",{className:"cloud-row-text",children:[r.last_assistant_message.slice(0,160),r.last_assistant_message.length>160?"…":""]})]})}function rpe({change:r}){const{t:e}=wr(),i=epe[r.entity],n=(i==null?void 0:i.icon)??Hy;return a.jsxs("div",{className:"cloud-row",children:[a.jsxs("div",{className:"cloud-row-meta",children:[a.jsxs("span",{className:"cloud-entity",children:[a.jsx(n,{size:14}),i?e(i.labelKey):r.entity]}),a.jsx("span",{className:`cloud-action cloud-action--${r.action}`,children:r.action}),a.jsx("span",{className:"cloud-row-time",children:Xk(r.timestamp)})]}),a.jsx("p",{className:"cloud-row-text",children:r.summary})]})}function ipe(r){const e=[];for(const i of r){const n=e[e.length-1];n&&n.date===i.date?n.items.push(i):e.push({date:i.date,items:[i]})}return e}function npe(){const{t:r}=wr(),{data:e,isLoading:i,isError:n,error:s}=ob(),{data:o}=Qfe();if(i||!e)return a.jsx("div",{className:"loading",children:r("common.loading")});if(n)return a.jsxs("div",{className:"error-state",children:["Failed to load sleep state. ",s==null?void 0:s.message]});const h=$le(e.debt),l=oF(e.debt),u=lF(e.debt),d=e.last_sleep,g=(o==null?void 0:o.entries)??[],f=d?g.filter(N=>N.date>d):[],m=d?g.filter(N=>N.date<=d):g,y=m.slice(0,Jfe),w=ipe(y),_=m.length-y.length,b=e.sessions,x=e.dashboard_changes,C=e.bookmarks??[],k=x.reduce((N,A)=>{var j;return(N[j=A.entity]??(N[j]=[])).push(A),N},{}),T=b.length+x.length+C.length+f.length;return a.jsxs("div",{className:"sleep-page",children:[a.jsxs("section",{className:`sleep-card sleep-card--${l}`,children:[a.jsxs("div",{className:"sleep-hero",children:[a.jsxs("div",{className:"sleep-hero-stage",children:[a.jsx("div",{className:"sleep-hero-aura","aria-hidden":!0}),a.jsx(lc,{mood:u,size:148})]}),a.jsxs("div",{className:"sleep-hero-body",children:[a.jsxs("div",{className:"sleep-hero-headline",children:[a.jsx("span",{className:"sleep-hero-level",children:h}),a.jsxs("span",{className:"sleep-hero-debt",children:[a.jsx("span",{className:"sleep-hero-debt-num",children:e.debt}),a.jsx("span",{className:"sleep-hero-debt-unit",children:r("sleep.debt")})]}),T>0&&a.jsxs("span",{className:"sleep-hero-cloud-count",children:[T," ",r(T===1?"sleep.cloud.item":"sleep.cloud.items")]})]}),a.jsx("p",{className:"sleep-hero-tagline",children:r(`sleep.tagline.${l}`)}),a.jsxs("div",{className:"sleep-hero-meta",children:[a.jsxs("div",{className:"sleep-hero-meta-item",children:[a.jsx("span",{className:"sleep-hero-meta-label",children:r("sleep.last_sleep")}),a.jsx("span",{className:"sleep-hero-meta-value",children:e.last_sleep??r("sleep.never")})]}),e.last_sleep_summary&&a.jsxs("div",{className:"sleep-hero-meta-item sleep-hero-meta-item--summary",children:[a.jsx("span",{className:"sleep-hero-meta-label",children:r("sleep.summary")}),a.jsx("span",{className:"sleep-hero-meta-value sleep-hero-meta-value--summary",children:e.last_sleep_summary.slice(0,220)})]})]})]})]}),T===0?a.jsx("div",{className:"sleep-cloud sleep-cloud--empty",children:a.jsxs("div",{className:"sleep-cloud-empty",children:[a.jsx("p",{className:"sleep-cloud-empty-title",children:r("sleep.cloud.empty.title")}),a.jsx("p",{className:"sleep-cloud-empty-sub",children:r("sleep.cloud.empty.sub")})]})}):a.jsxs("div",{className:"sleep-cloud",children:[a.jsxs("div",{className:"sleep-cloud-stats",children:[x.length>0&&a.jsx(Jg,{icon:Rw,count:x.length,label:r("sleep.cloud.stat.dashboard")}),b.length>0&&a.jsx(Jg,{icon:Bw,count:b.length,label:r("sleep.cloud.stat.sessions")}),C.length>0&&a.jsx(Jg,{icon:Hy,count:C.length,label:r("sleep.cloud.stat.highlights")}),f.length>0&&a.jsx(Jg,{icon:Lw,count:f.length,label:r("sleep.cloud.stat.changelog")})]}),a.jsxs("div",{className:"sleep-cloud-body",children:[x.length>0&&a.jsx(em,{title:r("sleep.cloud.group.dashboard"),hint:r("sleep.cloud.group.dashboard.hint"),count:x.length,children:Object.entries(k).flatMap(([,N])=>N.map((A,j)=>a.jsx(rpe,{change:A},`${A.entity}-${j}`)))}),b.length>0&&a.jsx(em,{title:r("sleep.cloud.group.sessions"),hint:r("sleep.cloud.group.sessions.hint"),count:b.length,children:b.map((N,A)=>a.jsx(tpe,{session:N},A))}),C.length>0&&a.jsx(em,{title:r("sleep.cloud.group.highlights"),hint:r("sleep.cloud.group.highlights.hint"),count:C.length,children:C.map(N=>a.jsxs("div",{className:"cloud-row",children:[a.jsxs("div",{className:"cloud-row-meta",children:[a.jsx("span",{className:"cloud-salience","data-salience":N.salience,children:"★".repeat(Math.max(1,Math.min(3,N.salience)))}),a.jsx("span",{className:"cloud-row-time",children:Xk(N.created_at)})]}),a.jsx("p",{className:"cloud-row-text",children:N.text})]},N.id))}),f.length>0&&a.jsx(em,{title:r("sleep.cloud.group.changelog"),hint:r("sleep.cloud.group.changelog.hint"),count:f.length,children:f.map((N,A)=>a.jsx(TR,{entry:N},`p-${A}`))})]})]})]}),m.length>0&&a.jsxs("div",{className:"sleep-section",children:[a.jsxs("h2",{className:"sleep-section-title",children:[r("sleep.changelog")," (",m.length,")"]}),w.map(N=>a.jsxs("div",{className:"changelog-group",children:[a.jsx("h3",{className:"changelog-group-title changelog-group-title--day",children:N.date}),a.jsx("div",{className:"changelog-list",children:N.items.map((A,j)=>a.jsx(TR,{entry:A},`${N.date}-${j}`))})]},N.date)),_>0&&a.jsxs("p",{className:"changelog-more",children:[_," ",r("sleep.changelog.earlier")]})]})]})}const spe={feat:"type--feat",fix:"type--fix",refactor:"type--refactor",chore:"type--chore",docs:"type--docs",test:"type--test",perf:"type--perf"};function EC({type:r}){return a.jsx("span",{className:`json-type-badge ${spe[r]??""}`,children:r})}function NC(){return a.jsx("span",{className:"json-breaking-badge",children:"BREAKING"})}function ape({data:r}){const[e,i]=B.useState("all"),[n,s]=B.useState(new Set),o=B.useMemo(()=>{const u=e==="all"?r:r.filter(g=>g.type===e),d=new Map;for(let g=0;g<u.length;g++){const f=u[g],m=d.get(f.date)||[];m.push({entry:f,index:g}),d.set(f.date,m)}return d},[r,e]),h=u=>{s(d=>{const g=new Set(d);return g.has(u)?g.delete(u):g.add(u),g})},l=B.useMemo(()=>{const u={};for(const d of r)u[d.type]=(u[d.type]||0)+1;return u},[r]);return a.jsxs("div",{className:"json-preview",children:[a.jsx("div",{className:"json-preview-header",children:a.jsxs("div",{className:"json-preview-stats",children:[a.jsxs("span",{className:"json-preview-total",children:[r.length," entries"]}),Object.entries(l).sort((u,d)=>d[1]-u[1]).map(([u,d])=>a.jsxs("button",{className:`json-stat-chip ${e===u?"json-stat-chip--active":""}`,onClick:()=>i(g=>g===u?"all":u),children:[a.jsx(EC,{type:u})," ",d]},u))]})}),a.jsx("div",{className:"json-timeline",children:Array.from(o.entries()).map(([u,d])=>a.jsxs("div",{className:"json-date-group",children:[a.jsxs("div",{className:"json-date-marker",children:[a.jsx("span",{className:"json-date-dot"}),a.jsx("span",{className:"json-date-label",children:u}),a.jsx("span",{className:"json-date-count",children:d.length})]}),a.jsx("div",{className:"json-date-entries",children:d.map(({entry:g,index:f})=>{const m=n.has(f),y=g.scope.length>50?g.scope.slice(0,47)+"...":g.scope;return a.jsxs("div",{className:`json-entry ${m?"json-entry--expanded":""}`,onClick:()=>h(f),children:[a.jsxs("div",{className:"json-entry-header",children:[a.jsx(EC,{type:g.type}),g.breaking&&a.jsx(NC,{}),a.jsx("span",{className:"json-entry-scope",title:g.scope,children:y})]}),a.jsx("div",{className:`json-entry-desc ${m?"":"json-entry-desc--clamped"}`,children:g.description})]},f)})})]},u))})]})}function ope({data:r}){const[e,i]=B.useState(new Set([0])),n=s=>{i(o=>{const h=new Set(o);return h.has(s)?h.delete(s):h.add(s),h})};return a.jsxs("div",{className:"json-preview",children:[a.jsx("div",{className:"json-preview-header",children:a.jsxs("span",{className:"json-preview-total",children:[r.length," release",r.length!==1?"s":""]})}),a.jsx("div",{className:"json-releases",children:r.map((s,o)=>{var l,u,d,g;const h=e.has(o);return a.jsxs("div",{className:`json-release ${h?"json-release--expanded":""}`,children:[a.jsxs("div",{className:"json-release-header",onClick:()=>n(o),children:[a.jsx("span",{className:"json-release-version",children:s.version}),a.jsx("span",{className:"json-release-date",children:s.date}),s.breaking&&a.jsx(NC,{}),a.jsxs("span",{className:"json-release-meta",children:[(l=s.features)!=null&&l.length?`${s.features.length} features`:"",(u=s.features)!=null&&u.length&&((d=s.tasks)!=null&&d.length)?" / ":"",(g=s.tasks)!=null&&g.length?`${s.tasks.length} task${s.tasks.length!==1?"s":""}`:""]}),a.jsx("span",{className:`json-release-chevron ${h?"json-release-chevron--open":""}`,children:"▶"})]}),h&&a.jsxs("div",{className:"json-release-body",children:[a.jsx("div",{className:"json-release-summary",children:s.summary}),s.features&&s.features.length>0&&a.jsxs("div",{className:"json-release-section",children:[a.jsx("div",{className:"json-release-section-title",children:"Features"}),a.jsx("div",{className:"json-release-ids",children:s.features.map(f=>a.jsx("span",{className:"json-id-chip json-id-chip--feature",children:f},f))})]}),s.tasks&&s.tasks.length>0&&a.jsxs("div",{className:"json-release-section",children:[a.jsx("div",{className:"json-release-section-title",children:"Tasks"}),a.jsx("div",{className:"json-release-ids",children:s.tasks.map(f=>a.jsx("span",{className:"json-id-chip json-id-chip--task",children:f},f))})]}),s.changelog&&s.changelog.length>0&&a.jsxs("div",{className:"json-release-section",children:[a.jsxs("div",{className:"json-release-section-title",children:["Changelog (",s.changelog.length,")"]}),a.jsx("div",{className:"json-release-changelog",children:s.changelog.map((f,m)=>a.jsxs("div",{className:"json-release-cl-entry",children:[a.jsx(EC,{type:f.type}),f.breaking&&a.jsx(NC,{}),a.jsx("span",{className:"json-release-cl-scope",children:f.scope}),a.jsx("span",{className:"json-release-cl-desc",children:f.description})]},m))})]})]})]},s.version)})})]})}function lpe({data:r,filename:e}){var s,o,h;if(!Array.isArray(r)||r.length===0)return a.jsx("div",{className:"json-preview",children:a.jsx("div",{className:"json-preview-empty",children:"No data found in this file."})});const i=e.toLowerCase().includes("changelog"),n=e.toLowerCase().includes("release");return i&&((s=r[0])!=null&&s.type)&&((o=r[0])!=null&&o.description)?a.jsx(ape,{data:r}):n&&((h=r[0])!=null&&h.version)?a.jsx(ope,{data:r}):a.jsxs("div",{className:"json-preview",children:[a.jsx("div",{className:"json-preview-header",children:a.jsxs("span",{className:"json-preview-total",children:[r.length," items"]})}),a.jsx("div",{className:"json-generic-list",children:r.map((l,u)=>a.jsx("pre",{className:"json-generic-item",children:JSON.stringify(l,null,2)},u))})]})}function cpe(r){return r.endsWith(".sql")||r.endsWith(".json")||r.endsWith(".md")}function hpe({onNavigateTaxonomy:r,focus:e}={}){var j,E;const{t:i}=wr(),n=Pt(),[s,o]=B.useState(null),[h,l]=B.useState(null),[u,d]=B.useState(!1),[g,f]=B.useState("preview");Ok(e,L=>{o(L),d(!1),f("preview")});const{data:m,isLoading:y,isError:w,error:_}=Yt({queryKey:["core"],queryFn:()=>De.get("/core")}),b=s??((E=(j=m==null?void 0:m.files)==null?void 0:j[0])==null?void 0:E.filename)??null,{data:x}=Yt({queryKey:["core",b],queryFn:()=>De.get(`/core/${b}`),enabled:!!b}),C=Vt({mutationFn:({filename:L,content:O})=>De.put(`/core/${L}`,{content:O}),onSuccess:()=>{n.invalidateQueries({queryKey:["core"]}),d(!1)}}),k=()=>{(x==null?void 0:x.content)!==void 0&&(l(x.content),d(!0))},T=()=>{b&&h!==null&&C.mutate({filename:b,content:h})};if(y)return a.jsx("div",{className:"loading",children:i("common.loading")});if(w)return a.jsxs("div",{className:"error-state",children:["Failed to load core files. ",_==null?void 0:_.message]});const N=(m==null?void 0:m.files)??[],A=()=>{if(!b||!x)return null;if(b==="taxonomy.json"&&r)return a.jsxs("div",{className:"core-taxonomy-link",children:[a.jsx("p",{className:"core-taxonomy-link-hint",children:"This file is managed by the Taxonomy system."}),a.jsx("button",{className:"btn btn--primary",onClick:r,children:"Open Taxonomy page"})]});if(g==="preview"){if(b.endsWith(".sql")&&x.content)return a.jsx(jk,{content:x.content});if(b.endsWith(".json")&&x.data)return a.jsx(lpe,{data:x.data,filename:b});if(b.endsWith(".md")&&x.content)return a.jsx(tp,{content:x.content,frontmatter:x.frontmatter})}return a.jsx("pre",{className:"core-viewer-content",children:x.content??JSON.stringify(x.data,null,2)})};return a.jsx("div",{className:"core-page",children:a.jsxs("div",{className:"core-layout",children:[a.jsx("div",{className:"core-list",children:N.map((L,O)=>a.jsxs("button",{className:`core-list-item ${b===L.filename?"core-list-item--active":""} animate-stagger animate-stagger-${Math.min(O+1,8)}`,onClick:()=>{o(L.filename),d(!1),f("preview")},children:[a.jsx("span",{className:"core-list-name",children:L.name}),a.jsx("span",{className:"core-list-type",children:L.type})]},L.filename))}),a.jsxs("div",{className:"core-detail",children:[!b&&a.jsx("div",{className:"core-empty",children:"Select a file to view."}),b&&x&&!u&&a.jsxs("div",{className:"core-viewer",children:[a.jsxs("div",{className:"core-viewer-header",children:[a.jsx("h2",{className:"core-viewer-title",children:x.filename}),a.jsxs("div",{className:"core-viewer-actions",children:[cpe(b)&&a.jsxs("div",{className:"core-tabs",children:[a.jsx("button",{className:`core-tab ${g==="file"?"core-tab--active":""}`,onClick:()=>f("file"),children:"File"}),a.jsx("button",{className:`core-tab ${g==="preview"?"core-tab--active":""}`,onClick:()=>f("preview"),children:"Preview"})]}),x.type==="markdown"&&a.jsx("button",{className:"btn btn--ghost",onClick:k,children:"Edit"})]})]}),A()]}),b&&u&&a.jsxs("div",{className:"core-editor",children:[a.jsxs("div",{className:"core-editor-header",children:[a.jsxs("h2",{className:"core-viewer-title",children:["Editing: ",b]}),a.jsxs("div",{className:"core-editor-actions",children:[a.jsx("button",{className:"btn btn--ghost",onClick:()=>d(!1),children:"Cancel"}),a.jsx("button",{className:"btn btn--primary",onClick:T,disabled:C.isPending,children:C.isPending?"Saving...":"Save"})]})]}),a.jsxs("div",{className:"core-editor-split",children:[a.jsx("textarea",{className:"core-editor-textarea",value:h??"",onChange:L=>l(L.target.value)}),a.jsx("pre",{className:"core-editor-preview",children:h})]})]})]})]})})}const upe='button:not(:disabled), [href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"])';function dpe({label:r,actions:e,onClose:i,children:n}){const{t:s}=wr(),o=B.useRef(null),h=B.useRef(i);return B.useEffect(()=>{h.current=i}),B.useEffect(()=>{const l=o.current;if(!l)return;const u=document.activeElement,d=document.body,g=d.style.overflow,f=d.style.paddingRight,m=window.innerWidth-document.documentElement.clientWidth;d.style.overflow="hidden",m>0&&(d.style.paddingRight=`${m}px`),l.focus();const y=w=>{if(w.key==="Escape"){w.stopPropagation(),h.current();return}if(w.key!=="Tab")return;const _=l.querySelectorAll(upe);if(_.length===0){w.preventDefault();return}const b=_[0],x=_[_.length-1],C=document.activeElement;!C||!l.contains(C)?(w.preventDefault(),(w.shiftKey?x:b).focus()):w.shiftKey&&(C===b||C===l)?(w.preventDefault(),x.focus()):!w.shiftKey&&C===x&&(w.preventDefault(),b.focus())};return document.addEventListener("keydown",y,!0),()=>{var w;document.removeEventListener("keydown",y,!0),d.style.overflow=g,d.style.paddingRight=f,(w=u==null?void 0:u.focus)==null||w.call(u)}},[]),a.jsxs("div",{ref:o,className:"fullscreen-overlay",role:"dialog","aria-modal":"true","aria-label":r,tabIndex:-1,children:[a.jsxs("div",{className:"fullscreen-overlay-header",children:[a.jsx("h2",{className:"fullscreen-overlay-title",children:r}),a.jsxs("div",{className:"fullscreen-overlay-actions",children:[e,a.jsx("button",{className:"fullscreen-overlay-close",onClick:i,title:s("common.close"),"aria-label":s("common.close"),children:"✕"})]})]}),a.jsx("div",{className:"fullscreen-overlay-body",children:n})]})}const fpe={knowledge:["knowledge","feature"]};function ER(r){return r.path.replace(/^.*?knowledge\//,"").replace(/\.md$/,"")}function ppe(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function NR({text:r,tokens:e}){if(!e.length||!r)return a.jsx(a.Fragment,{children:r});const i=new RegExp(`(${e.map(ppe).join("|")})`,"gi"),n=new Set(e.map(o=>o.toLowerCase())),s=r.split(i);return a.jsx(a.Fragment,{children:s.map((o,h)=>n.has(o.toLowerCase())?a.jsx("mark",{className:"bsearch-hl",children:o},h):a.jsx("span",{children:o},h))})}function gpe({scope:r,placeholder:e,selectedSlug:i,onOpen:n,browse:s,detail:o,formatTitle:h}){const[l,u]=B.useState(""),[d,g]=B.useState(""),f=cF()==="hybrid",[m,y]=B.useState(!1),w=m&&!f,[_,b]=B.useState([]),[x,C]=B.useState("idle"),[k,T]=B.useState(""),[N,A]=B.useState("haiku"),[j,E]=B.useState(0),L=B.useRef(null),O=B.useMemo(()=>fpe[r],[r]),D=l.trim(),K=D.length>0,z=!w;B.useEffect(()=>{const xe=setTimeout(()=>g(D),110);return()=>clearTimeout(xe)},[D]);const{data:H,isFetching:P}=kF(z?d:"",O,14),$=B.useMemo(()=>(H==null?void 0:H.hits)??[],[H]),W=w&&x==="done"&&k===D,V=w?W?_:[]:$,F=B.useMemo(()=>V.length?Math.max(...V.map(xe=>xe.rankScore||xe.score||1)):1,[V]),G=B.useMemo(()=>(w?k:D).toLowerCase().split(/\s+/).filter(Boolean),[w,k,D]),U=!K,X=w&&K&&x!=="thinking"&&!W,ee=w&&x==="thinking",re=K&&(w?W:!0)&&V.length>0,le=K&&(z&&!P&&$.length===0&&d===D||w&&W&&_.length===0),fe=B.useCallback(()=>{var xe;try{(xe=L.current)==null||xe.focus()}catch{}},[]);B.useEffect(()=>{E(xe=>Math.min(xe,Math.max(0,V.length-1)))},[V.length]);const ie=B.useCallback(async()=>{const xe=D;if(xe){C("thinking"),T(xe),E(0);try{const Ve=await TF(xe,O);b(Ve.hits),A(Ve.mode)}catch{try{b(await SF(xe,O,14))}catch{b([])}A("bm25")}C("done")}},[D,O]),I=()=>{y(xe=>(C("idle"),b([]),T(""),E(0),!xe)),fe()},Z=()=>{u(""),g(""),C("idle"),b([]),T(""),E(0),fe()},J=xe=>n({slug:ER(xe),title:xe.title,type:xe.type}),ne=xe=>{if(xe.key==="Escape"){Z();return}if(xe.key==="Enter"){if(w&&!W){xe.preventDefault(),ie();return}V[j]&&(xe.preventDefault(),J(V[j]));return}V.length&&(xe.key==="ArrowDown"?(xe.preventDefault(),E(Ve=>Math.min(Ve+1,V.length-1))):xe.key==="ArrowUp"&&(xe.preventDefault(),E(Ve=>Math.max(Ve-1,0))))},ce=xe=>h?h(xe):xe.title;return a.jsxs("div",{className:"bsearch",children:[a.jsxs("div",{className:`bsearch-bar ${K?"bsearch-bar--active":""}`,children:[a.jsx("span",{className:"bsearch-bar-icon",children:a.jsx(Zm,{size:16})}),a.jsx("input",{ref:L,className:"bsearch-input",placeholder:e,value:l,onChange:xe=>{u(xe.target.value),w&&C("idle")},onKeyDown:ne,spellCheck:!1,autoComplete:"off"}),z&&P&&K&&a.jsx("span",{className:"bsearch-spin","aria-hidden":"true"}),K&&a.jsx("button",{className:"bsearch-clear",onClick:Z,title:"Clear","aria-label":"Clear search",children:"×"}),!f&&a.jsxs("button",{className:`bsearch-intel ${w?"bsearch-intel--on":""}`,onClick:I,title:w?"Intelligent search is on — reasons over your brain (uses tokens)":"Turn on intelligent search — intent-aware, beyond keywords",children:[a.jsx("span",{className:"bsearch-intel-dot"}),a.jsx(Eh,{size:13,color:w?"#fff":"currentColor"}),"Intelligent"]})]}),a.jsxs("div",{className:"bsearch-layout",children:[a.jsxs("div",{className:"bsearch-list",children:[U&&s,X&&a.jsxs("button",{className:"bsearch-cta",onClick:()=>void ie(),children:[a.jsx(Eh,{size:15,color:"#fff"}),"Run intelligent search",a.jsx("kbd",{className:"bsearch-kbd",children:"↵"})]}),ee&&a.jsxs("div",{className:"bsearch-thinking",children:[a.jsx("span",{className:"bsearch-thinking-spark",children:a.jsx(Eh,{size:14,color:"currentColor"})}),"Reasoning over your ",r,"…",a.jsxs("div",{className:"bsearch-skel",children:[a.jsx("i",{}),a.jsx("i",{}),a.jsx("i",{})]})]}),re&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"bsearch-meta",children:[a.jsxs("span",{className:"bsearch-count",children:[V.length," ",V.length===1?"match":"matches"]}),a.jsx("span",{className:`bsearch-mode ${w||f?"bsearch-mode--intel":""}`,children:w?N==="haiku"?"intelligent":"bm25 fallback":f?(H==null?void 0:H.mode)??"hybrid":"keyword"})]}),V.map((xe,Ve)=>{const We=Math.round((xe.rankScore||xe.score||0)/F*100),et=(w?xe.snippet:xe.snippet||xe.description)??"",de=ER(xe);return a.jsxs("button",{className:`bsearch-row ${i===de?"bsearch-row--active":""} ${j===Ve?"bsearch-row--focused":""}`,onClick:()=>J(xe),onMouseEnter:()=>E(Ve),children:[a.jsx("span",{className:"bsearch-row-icon",children:a.jsx(C1,{type:xe.type,size:15})}),a.jsxs("span",{className:"bsearch-row-main",children:[a.jsx("span",{className:"bsearch-row-title",children:a.jsx(NR,{text:ce(xe),tokens:G})}),et&&a.jsx("span",{className:"bsearch-row-snippet",children:a.jsx(NR,{text:et,tokens:G})}),xe.tags.length>0&&a.jsx("span",{className:"bsearch-row-tags",children:xe.tags.slice(0,4).map(Ne=>a.jsx("span",{className:"task-tag","data-hue":na(Ne),children:Ne},Ne))})]}),a.jsx("span",{className:"bsearch-row-score",title:`relevance ${We}%`,children:a.jsx("span",{className:"bsearch-score-track",children:a.jsx("i",{style:{width:`${Math.max(We,6)}%`}})})})]},xe.slug)})]}),le&&a.jsxs("div",{className:"bsearch-empty",children:[a.jsx(Zm,{size:22}),a.jsxs("p",{children:["No ",r," match “",D,"”."]}),!w&&!f&&a.jsxs("span",{children:["Try ",a.jsx("button",{className:"bsearch-empty-link",onClick:I,children:"Intelligent search"})," for intent-aware matches."]})]})]}),a.jsx("div",{className:"bsearch-detail",children:o})]})]})}const mpe=/```sql\s*\n([\s\S]*?)```/gi;function ype(r,e){if(!r.startsWith("data-structures/"))return null;const i=[...e.matchAll(mpe)].map(n=>n[1]);return i.length>0?i.join(`
512
512
 
513
- `):null}function bpe(r){return r.split(/[-_]/).map(e=>e&&e[0].toUpperCase()+e.slice(1)).join(" ")}function jC(r,e){if(!e)return r.name;if(Of(r.slug)){const i=r.slug.lastIndexOf("/");return i>=0?r.slug.slice(i+1):r.slug}return r.name.startsWith(`${e}/`)?r.name.slice(e.length+1):r.name}function w$(r){return r.cards.length+r.folders.reduce((e,i)=>e+w$(i),0)}function vpe(r){const e=[],i={path:"",folders:[],cards:[]},n=new Map;for(const h of r){const l=h.slug.split("/");for(let u=1;u<l.length;u++){const d=l.slice(0,u).join("/");n.set(d,(n.get(d)??0)+1)}}const s=(h,l)=>{let u=h.folders.find(d=>d.name===l);if(!u){const d=h.path?`${h.path}/${l}`:l;u={name:l,path:d,label:bpe(l),folders:[],cards:[]},h.folders.push(u)}return u};for(const h of r){const l=h.slug.split("/"),u=l[l.length-1];let d=l.slice(0,-1);if(Of(h.slug)&&d.length>0){const f=u.replace(/\.excalidraw$/,""),m=d.join("/");d[d.length-1]===f&&(n.get(m)??0)<=1&&(d=d.slice(0,-1))}if(d.length===0){e.push(h);continue}let g=i;for(const f of d)g=s(g,f);g.cards.push(h)}const o=h=>{h.folders.sort((l,u)=>l.label.localeCompare(u.label)),h.cards.sort((l,u)=>jC(l,h.path).localeCompare(jC(u,h.path))),h.folders.forEach(o)};return o(i),{roots:e,folders:i.folders}}function xpe(r){const e=r.split("/"),i=[];for(let n=1;n<e.length;n++)i.push(e.slice(0,n).join("/"));return i}function _pe({focus:r}={}){const{t:e}=wr(),{data:i,isLoading:n,isError:s,error:o}=Kce(),h=Zce(),[l,u]=B.useState(null),[d,g]=B.useState("preview"),[f,m]=B.useState(new Set),[y,w]=B.useState(!1);Ok(r,D=>{u(D),g("preview"),m(K=>{const z=new Set(K);for(const H of xpe(D))z.add(H);return z})});const{data:_}=Vce(l??""),b=B.useMemo(()=>{var D;return(D=i==null?void 0:i.find(K=>K.slug===l))==null?void 0:D.mtime},[i,l]);Xce(l,b,_==null?void 0:_.mtime);const{roots:x,folders:C}=B.useMemo(()=>vpe(i??[]),[i]),k=D=>f.has(D),T=D=>{m(K=>{const z=new Set(K);return z.has(D)?z.delete(D):z.add(D),z})},N=(D,K=null)=>a.jsxs("button",{className:`knowledge-card ${l===D.slug?"knowledge-card--active":""}`,onClick:()=>{u(D.slug),g("preview")},children:[a.jsxs("div",{className:"knowledge-card-header",children:[a.jsxs("span",{className:"knowledge-card-title",children:[Of(D.slug)&&a.jsx("span",{className:"knowledge-card-icon",title:"Diagram / sketch","aria-label":"Diagram",children:a.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M12 20h9"}),a.jsx("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4Z"})]})}),a.jsx("span",{className:"knowledge-card-name",children:jC(D,K)}),D.type==="feature"&&D.status&&a.jsx("span",{className:`knowledge-card-status knowledge-card-status--${D.status}`,children:D.status})]}),a.jsx("button",{className:`pin-btn ${D.pinned?"pin-btn--active":""}`,onClick:z=>{z.stopPropagation(),h.mutate({slug:D.slug,pinned:!D.pinned})},title:D.pinned?e("knowledge.unpin"):e("knowledge.pin"),children:D.pinned?"◆":"◇"})]}),D.description&&a.jsx("p",{className:"knowledge-card-desc",children:D.description}),a.jsx("div",{className:"knowledge-card-tags",children:D.tags.map(z=>a.jsx("span",{className:"task-tag","data-hue":na(z),children:z},z))})]},D.slug),A=D=>a.jsxs("div",{className:"knowledge-folder",children:[a.jsxs("button",{className:"knowledge-folder-header",onClick:()=>T(D.path),"aria-expanded":k(D.path),children:[a.jsx("span",{className:"knowledge-folder-chevron",children:k(D.path)?"▾":"▸"}),a.jsx("span",{className:"knowledge-folder-name",children:D.label}),a.jsx("span",{className:"knowledge-folder-count",children:w$(D)})]}),k(D.path)&&a.jsxs("div",{className:"knowledge-folder-items",children:[D.folders.map(A),D.cards.map(K=>N(K,D.path))]})]},D.path),j=()=>a.jsxs("div",{className:"core-tabs",children:[a.jsx("button",{className:`core-tab ${d==="file"?"core-tab--active":""}`,onClick:()=>g("file"),children:"File"}),a.jsx("button",{className:`core-tab ${d==="preview"?"core-tab--active":""}`,onClick:()=>g("preview"),children:"Preview"})]}),E=D=>{if(d==="preview"&&D.content){if(Of(D.slug))return a.jsx(NF,{content:D.content,slug:D.slug});const K=ype(D.slug,D.content);return K?a.jsx(jk,{content:K}):a.jsx(tp,{content:D.content})}return a.jsx("pre",{className:"core-viewer-content",children:D.content})};if(n)return a.jsx("div",{className:"loading",children:e("common.loading")});if(s)return a.jsxs("div",{className:"error-state",children:["Failed to load knowledge. ",o==null?void 0:o.message]});const L=a.jsxs(a.Fragment,{children:[(!i||i.length===0)&&a.jsx("div",{className:"core-empty",children:e("common.empty")}),C.map(A),x.map(D=>N(D))]}),O=a.jsxs(a.Fragment,{children:[!l&&a.jsxs("div",{className:"knowledge-detail-empty",children:[a.jsx("span",{className:"knowledge-detail-empty-icon","aria-hidden":"true",children:a.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M12 6.2C10.1 4.9 7.8 4.2 5 4.2c-.9 0-1.7.1-2.5.3v13c.8-.2 1.6-.3 2.5-.3 2.8 0 5.1.7 7 2"}),a.jsx("path",{d:"M12 6.2c1.9-1.3 4.2-2 7-2 .9 0 1.7.1 2.5.3v13c-.8-.2-1.6-.3-2.5-.3-2.8 0-5.1.7-7 2"}),a.jsx("line",{x1:"12",y1:"6.2",x2:"12",y2:"19.2"})]})}),a.jsx("p",{children:"Select a knowledge file, or search to recall across your brain."})]}),l&&!_&&a.jsx("div",{className:"core-empty",children:"Loading document…"}),l&&_&&a.jsxs("div",{className:"core-viewer",children:[a.jsxs("div",{className:"core-viewer-header",children:[a.jsx("h2",{className:"core-viewer-title",children:_.name}),a.jsxs("div",{className:"core-viewer-actions",children:[j(),a.jsx("button",{className:"core-expand-btn",onClick:()=>w(!0),title:e("knowledge.fullscreen"),"aria-label":e("knowledge.fullscreen"),children:"⛶"})]})]}),y?a.jsx(dpe,{label:_.name,actions:j(),onClose:()=>w(!1),children:E(_)}):E(_)]})]});return a.jsx("div",{className:"knowledge-page",children:a.jsx(gpe,{scope:"knowledge",placeholder:e("knowledge.search"),selectedSlug:l,onOpen:D=>{u(D.slug),g("preview")},browse:L,detail:O})})}function Cpe(){return Yt({queryKey:["graph"],queryFn:()=>De.get("/graph"),staleTime:3e4})}const kh={filters:{search:"",showTags:!0,showOrphans:!0,showAttachments:!1,existingFilesOnly:!1},groups:[],display:{view:"2d",arrows:!1,textFadeThreshold:.85,nodeSize:.5,linkThickness:.5},forces:{centerStrength:.7,repelStrength:.35,linkStrength:.9,linkDistance:.35}};function wpe(r){return{centerStrength:.05+r.centerStrength*.45,repelStrength:-(30+r.repelStrength*240),linkStrength:.1+r.linkStrength*1.2,linkDistance:20+r.linkDistance*180}}function kpe(r){return{filters:{...kh.filters,...r.filters},groups:Array.isArray(r.groups)?r.groups:kh.groups,display:{...kh.display,...r.display},forces:{...kh.forces,...r.forces}}}function Spe(){const[r,e]=Kk("brain:settings:v1",kh),i=B.useRef(!1);B.useEffect(()=>{if(i.current)return;let d=!1;return De.get("/brain-settings").then(g=>{if(d)return;i.current=!0;const f=g.settings;f&&typeof f=="object"&&Object.keys(f).length>0&&e(kpe(f))}).catch(()=>{i.current=!0}),()=>{d=!0}},[e]);const n=B.useRef(null),s=B.useCallback(d=>{i.current&&(n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{De.put("/brain-settings",{settings:d}).catch(()=>{})},600))},[]),o=B.useCallback(d=>{e(g=>{const f=d(g);return s(f),f})},[e,s]),h=B.useCallback((d,g)=>{o(f=>({...f,[d]:{...f[d],...g}}))},[o]),l=B.useCallback(d=>{o(g=>({...g,groups:d}))},[o]),u=B.useCallback(()=>{o(()=>kh)},[o]);return{settings:r,patch:h,setGroups:l,reset:u}}function Tpe(r){const e=[];let i=0;for(;i<r.length;){const n=r[i];if(/\s/.test(n)){i++;continue}if(n==="("){e.push({type:"LPAREN"}),i++;continue}if(n===")"){e.push({type:"RPAREN"}),i++;continue}if(n==="-"&&i+1<r.length&&!/\s/.test(r[i+1])){e.push({type:"NOT"}),i++;continue}if(n==='"'){let l=i+1,u="";for(;l<r.length&&r[l]!=='"';)r[l]==="\\"&&l+1<r.length?(u+=r[l+1],l+=2):(u+=r[l],l++);e.push({type:"PHRASE",value:u}),i=l+1;continue}if(n==="/"){let l=i+1,u="";for(;l<r.length&&r[l]!=="/";)r[l]==="\\"&&l+1<r.length?(u+=r[l]+r[l+1],l+=2):(u+=r[l],l++);if(l<r.length){e.push({type:"REGEX",value:u}),i=l+1;continue}}let s=i;for(;s<r.length&&!/[\s()]/.test(r[s])&&r[s]!=='"';)s++;const o=r.slice(i,s),h=o.match(/^(tag|path|file|content):(.*)$/i);h?e.push({type:"OP",value:h[1].toLowerCase(),arg:h[2]}):o.toUpperCase()==="OR"?e.push({type:"OR"}):o.toUpperCase()==="AND"||o.length>0&&e.push({type:"WORD",value:o}),i=s}return e}class Epe{constructor(e){Wt(this,"pos",0);this.tokens=e}parse(){return this.parseOr()}parseOr(){var i;let e=this.parseAnd();for(;((i=this.peek())==null?void 0:i.type)==="OR";){this.pos++;const n=this.parseAnd();e.type==="or"?e.children.push(n):e={type:"or",children:[e,n]}}return e}parseAnd(){var i,n;const e=[];for(;this.pos<this.tokens.length&&((i=this.peek())==null?void 0:i.type)!=="RPAREN"&&((n=this.peek())==null?void 0:n.type)!=="OR";){const s=this.parseTerm();s&&e.push(s)}return e.length===0?{type:"and",children:[]}:e.length===1?e[0]:{type:"and",children:e}}parseTerm(){var s;const e=this.peek();if(!e)return null;let i=!1;e.type==="NOT"&&(i=!0,this.pos++);const n=this.peek();if(!n)return null;if(n.type==="LPAREN"){this.pos++;const o=this.parseOr();return((s=this.peek())==null?void 0:s.type)==="RPAREN"&&this.pos++,i?k$(o):o}if(n.type==="WORD")return this.pos++,{type:"word",value:n.value.toLowerCase(),negated:i};if(n.type==="PHRASE")return this.pos++,{type:"phrase",value:n.value.toLowerCase(),negated:i};if(n.type==="REGEX"){this.pos++;try{return{type:"regex",value:new RegExp(n.value,"i"),negated:i}}catch{return null}}return n.type==="OP"?(this.pos++,{type:"op",op:n.value,arg:n.arg.toLowerCase(),negated:i}):(this.pos++,null)}peek(){return this.tokens[this.pos]}}function k$(r){return r.type==="and"||r.type==="or"?{...r,children:r.children.map(k$)}:{...r,negated:!r.negated}}function jR(r){const e=r.trim();if(!e)return{match:()=>!0,raw:"",isEmpty:!0};const i=Tpe(e),n=new Epe(i).parse();return{match:s=>AC(n,s),raw:e,isEmpty:!1}}function AC(r,e){switch(r.type){case"and":return r.children.every(i=>AC(i,e));case"or":return r.children.some(i=>AC(i,e));case"word":return tm(AR(e,r.value),r.negated);case"phrase":return tm(AR(e,r.value),r.negated);case"regex":return tm(Npe(e,r.value),r.negated);case"op":return tm(jpe(e,r.op,r.arg),r.negated)}}function tm(r,e){return e?!r:r}function S$(r){return[r.label,r.path,r.id,r.meta.description??"",...r.meta.tags??[]].join(" ").toLowerCase()}function AR(r,e){return S$(r).includes(e)}function Npe(r,e){return e.test(S$(r))}function jpe(r,e,i){var s;const n=i.toLowerCase();switch(e){case"path":return r.path.toLowerCase().includes(n);case"file":return(((s=r.path.split("/").pop())==null?void 0:s.toLowerCase())??r.label.toLowerCase()).includes(n);case"tag":{const o=n.replace(/^#/,"");return(r.meta.tags??[]).some(h=>h.toLowerCase()===o)||r.group==="tag"&&r.label.toLowerCase().replace(/^#/,"")===o}case"content":return(r.meta.description??"").toLowerCase().includes(n);default:return!1}}const rm={filters:"Filters",groups:"Groups",display:"Display",forces:"Forces"},w_=["#10b981","#4fb3e6","#a78bfa","#f59e0b","#ef4444","#e11d74","#9ca3af","#eab308","#22d3ee","#f472b6"];function Ape({settings:r,patch:e,setGroups:i,reset:n,onClose:s}){const[o,h]=B.useState({filters:!0,groups:!0,display:!0,forces:!0}),l=u=>h(d=>({...d,[u]:!d[u]}));return a.jsxs("aside",{className:"brain-settings",children:[a.jsxs("div",{className:"brain-settings-header",children:[a.jsx("span",{className:"brain-settings-title",children:"Graph settings"}),a.jsxs("div",{className:"brain-settings-header-actions",children:[a.jsx("button",{className:"brain-settings-mini-btn",onClick:n,title:"Restore default settings",children:"↻"}),a.jsx("button",{className:"brain-settings-mini-btn",onClick:s,title:"Close",children:"×"})]})]}),a.jsxs("div",{className:"brain-settings-body",children:[a.jsxs(im,{label:rm.filters,open:o.filters,onToggle:()=>l("filters"),children:[a.jsx("label",{className:"brain-settings-label",children:"Search files"}),a.jsx("input",{type:"search",className:"brain-settings-input",placeholder:"Search…",value:r.filters.search,onChange:u=>e("filters",{search:u.target.value})}),a.jsxs("p",{className:"brain-settings-hint",children:["Operators: ",a.jsx("code",{children:"tag:"})," ",a.jsx("code",{children:"path:"})," ",a.jsx("code",{children:"file:"})," ",a.jsx("code",{children:"-not"})," ",a.jsx("code",{children:"OR"})," ",a.jsx("code",{children:'"phrase"'})," ",a.jsx("code",{children:"/regex/"})]}),a.jsx(Id,{label:"Tags",checked:r.filters.showTags,onChange:u=>e("filters",{showTags:u})}),a.jsx(Id,{label:"Attachments",checked:r.filters.showAttachments,onChange:u=>e("filters",{showAttachments:u})}),a.jsx(Id,{label:"Existing files only",checked:r.filters.existingFilesOnly,onChange:u=>e("filters",{existingFilesOnly:u})}),a.jsx(Id,{label:"Orphans",checked:r.filters.showOrphans,onChange:u=>e("filters",{showOrphans:u})})]}),a.jsx(im,{label:rm.groups,open:o.groups,onToggle:()=>l("groups"),children:a.jsx(Lpe,{groups:r.groups,onChange:i})}),a.jsxs(im,{label:rm.display,open:o.display,onToggle:()=>l("display"),children:[a.jsx(Mpe,{label:"View",value:r.display.view==="3d"?"3d":"2d",options:[{value:"2d",label:"2D"},{value:"3d",label:"3D"}],onChange:u=>e("display",{view:u})}),a.jsx(Id,{label:"Arrows",checked:r.display.arrows,onChange:u=>e("display",{arrows:u})}),a.jsx(Al,{label:"Text fade threshold",value:r.display.textFadeThreshold,onChange:u=>e("display",{textFadeThreshold:u})}),a.jsx(Al,{label:"Node size",value:r.display.nodeSize,onChange:u=>e("display",{nodeSize:u})}),a.jsx(Al,{label:"Link thickness",value:r.display.linkThickness,onChange:u=>e("display",{linkThickness:u})})]}),a.jsxs(im,{label:rm.forces,open:o.forces,onToggle:()=>l("forces"),children:[a.jsx(Al,{label:"Center force",value:r.forces.centerStrength,onChange:u=>e("forces",{centerStrength:u})}),a.jsx(Al,{label:"Repel force",value:r.forces.repelStrength,onChange:u=>e("forces",{repelStrength:u})}),a.jsx(Al,{label:"Link force",value:r.forces.linkStrength,onChange:u=>e("forces",{linkStrength:u})}),a.jsx(Al,{label:"Link distance",value:r.forces.linkDistance,onChange:u=>e("forces",{linkDistance:u})})]})]})]})}function im({label:r,open:e,onToggle:i,children:n}){return a.jsxs("div",{className:`brain-section ${e?"brain-section--open":""}`,children:[a.jsxs("button",{className:"brain-section-header",onClick:i,type:"button",children:[a.jsx("span",{className:"brain-section-caret",children:e?"▾":"▸"}),a.jsx("span",{children:r})]}),e&&a.jsx("div",{className:"brain-section-body",children:n})]})}function Id({label:r,checked:e,onChange:i}){return a.jsxs("label",{className:"brain-toggle-row",children:[a.jsx("span",{children:r}),a.jsx("span",{className:`brain-toggle ${e?"brain-toggle--on":""}`,onClick:()=>i(!e),children:a.jsx("span",{className:"brain-toggle-knob"})})]})}function Mpe({label:r,value:e,options:i,onChange:n}){return a.jsxs("div",{className:"brain-segmented-row",children:[a.jsx("span",{className:"brain-segmented-label",children:r}),a.jsx("div",{className:"brain-segmented",role:"tablist",children:i.map(s=>a.jsx("button",{type:"button",role:"tab","aria-selected":e===s.value,className:`brain-segmented-btn ${e===s.value?"brain-segmented-btn--active":""}`,onClick:()=>n(s.value),children:s.label},s.value))})]})}function Al({label:r,value:e,onChange:i}){return a.jsxs("label",{className:"brain-slider-row",children:[a.jsx("span",{className:"brain-slider-label-text",children:r}),a.jsx("input",{type:"range",min:0,max:1,step:.01,value:e,onChange:n=>i(parseFloat(n.target.value))})]})}function Lpe({groups:r,onChange:e}){const[i,n]=B.useState(""),[s,o]=B.useState(null),h=()=>{const d=i.trim();if(!d)return;const g=`grp_${Math.random().toString(36).slice(2,8)}`;e([...r,{id:g,query:d,color:w_[r.length%w_.length]}]),n("")},l=(d,g)=>{e(r.map(f=>f.id===d?{...f,...g}:f))},u=d=>e(r.filter(g=>g.id!==d));return a.jsxs(a.Fragment,{children:[r.length===0&&a.jsxs("p",{className:"brain-settings-hint",children:["Color nodes that match a query. First matching group wins. Example:"," ",a.jsx("code",{children:"tag:#architecture"})]}),a.jsx("div",{className:"brain-groups-list",children:r.map(d=>a.jsxs("div",{className:"brain-group-row",children:[a.jsx("button",{className:"brain-group-color",style:{background:d.color},onClick:()=>o(s===d.id?null:d.id),title:"Pick color"}),a.jsx("input",{className:"brain-settings-input brain-group-input",value:d.query,onChange:g=>l(d.id,{query:g.target.value})}),a.jsx("button",{className:"brain-settings-mini-btn",onClick:()=>u(d.id),title:"Remove group",children:"×"}),s===d.id&&a.jsx("div",{className:"brain-swatch-picker",children:w_.map(g=>a.jsx("button",{className:"brain-swatch",style:{background:g},onClick:()=>{l(d.id,{color:g}),o(null)}},g))})]},d.id))}),a.jsxs("div",{className:"brain-group-add",children:[a.jsx("input",{className:"brain-settings-input",placeholder:"New group query…",value:i,onChange:d=>n(d.target.value),onKeyDown:d=>{d.key==="Enter"&&h()}}),a.jsx("button",{className:"brain-settings-btn",onClick:h,disabled:!i.trim(),children:"New group"})]})]})}function Rpe(r){return Yt({queryKey:["graph","content",(r==null?void 0:r.path)??null],queryFn:()=>{if(!r||!r.path)throw new Error("No path for node");return De.get(`/graph/content?path=${encodeURIComponent(r.path)}`)},enabled:!!(r&&r.path),staleTime:3e4})}const MR={soul:"#4fb3e6",user:"#4fb3e6",memory:"#4fb3e6",core:"#4fb3e6",feature:"#10b981",task:"#f59e0b",knowledge:"#a78bfa",release:"#e11d74",inbox:"#9ca3af",tag:"#10b981"},Bpe={soul:"Soul",user:"User",memory:"Memory",core:"Core",feature:"Feature",task:"Task",knowledge:"Knowledge",release:"Release",inbox:"Inbox",tag:"Tag"},Ope={related_feature:"feature",parent_task:"parent",release_includes:"released",sibling_core:"spine",has_tag:"tag"};function Dpe(r){return r==="task"?"tasks":r==="feature"||r==="knowledge"?"knowledge":r==="soul"||r==="user"||r==="memory"||r==="core"?"core":null}function Ipe(r,e){return r==="knowledge"&&e.path?e.path.replace(/^knowledge\//,"").replace(/\.md$/,""):e.id}function Fpe({node:r,onClose:e,onSelectRelated:i,relatedNodes:n,inDegree:s,totalDegree:o,onNavigate:h}){const l=!!(r!=null&&r.path),u=Rpe(l?r:null);if(!r)return a.jsx("aside",{className:"brain-drawer"});const d=Dpe(r.group),g=u.data;return a.jsxs("aside",{className:"brain-drawer brain-drawer--open",children:[a.jsx("button",{className:"brain-drawer-close",onClick:e,"aria-label":"Close",children:"×"}),a.jsxs("div",{className:"brain-drawer-header",children:[a.jsxs("span",{className:"brain-drawer-group-badge",children:[a.jsx("span",{className:"brain-related-dot",style:{background:MR[r.group]}}),Bpe[r.group]]}),a.jsx("h2",{className:"brain-drawer-title",children:r.label}),r.path&&a.jsx("span",{className:"brain-drawer-id",children:r.path})]}),a.jsxs("div",{className:"brain-drawer-body",children:[l&&u.isLoading&&a.jsx("p",{className:"brain-description",children:"Loading…"}),l&&u.error&&a.jsxs("p",{className:"brain-description",children:["Failed to load file: ",String(u.error)]}),(g==null?void 0:g.type)==="markdown"&&a.jsx(tp,{content:g.content,frontmatter:g.frontmatter}),(g==null?void 0:g.type)==="json"&&a.jsx("pre",{className:"brain-codeblock",children:g.data!==void 0?JSON.stringify(g.data,null,2):g.raw??"(empty)"}),(g==null?void 0:g.type)==="text"&&a.jsx("pre",{className:"brain-codeblock",children:g.content}),!l&&r.group==="tag"&&a.jsxs("p",{className:"brain-description",children:["Tag ",a.jsxs("code",{children:["#",r.label.replace(/^#/,"")]})," — ",n.length," ",n.length===1?"file":"files"," reference this tag."]}),!l&&r.group!=="tag"&&a.jsx("p",{className:"brain-description",children:r.meta.description??"No file content."}),n.length>0&&a.jsxs("section",{className:"brain-drawer-section",children:[a.jsxs("h3",{className:"brain-drawer-section-title",children:["Connections (",n.length,") · in ",s," · total ",o]}),a.jsx("div",{className:"brain-related-list",children:n.map(({node:f,kind:m})=>a.jsxs("button",{className:"brain-related-item",onClick:()=>i(f.id),children:[a.jsx("span",{className:"brain-related-dot",style:{background:MR[f.group]}}),a.jsx("span",{children:f.label}),a.jsx("span",{className:"brain-related-kind",children:Ope[m]??m})]},`${f.id}-${m}`))})]})]}),d&&h&&a.jsx("div",{className:"brain-drawer-footer",children:a.jsxs("button",{className:"brain-btn",onClick:()=>h(d,Ipe(d,r)),children:["Open in ",d.charAt(0).toUpperCase()+d.slice(1)," to edit →"]})})]})}const $pe=EF("BrainCanvas3D",()=>Zt(()=>import("./BrainCanvas3D-y35c1rJf.js"),__vite__mapDeps([56,54])).then(r=>({default:r.BrainCanvas3D}))),Ppe={soul:"#4fb3e6",user:"#4fb3e6",memory:"#4fb3e6",core:"#4fb3e6",feature:"#10b981",task:"#f59e0b",knowledge:"#a78bfa",release:"#e11d74",inbox:"#9ca3af",tag:"#10b981"},zpe={soul:"#0d7bb8",user:"#0d7bb8",memory:"#0d7bb8",core:"#0d7bb8",feature:"#047857",task:"#b45309",knowledge:"#6d28d9",release:"#be185d",inbox:"#475569",tag:"#047857"};function LR(r){return typeof r=="string"?r:r.id}function T$(r){const e=r.group==="soul"?8:r.group==="user"||r.group==="memory"?6:r.group==="tag"?3:4,i=r.__inDegree??0;return e+Math.min(14,i*1.2)}function RR(r,e){return Math.sqrt(T$(r)*e)*3}function qpe(r,e,i){for(const{group:n,parsed:s}of e)if(s.match(r))return n.color;return i[r.group]}function Hpe({onNavigate:r}){const{data:e,isLoading:i,error:n}=Cpe(),s=Pt(),{settings:o,patch:h,setGroups:l,reset:u}=Spe(),{resolved:d}=Kf(),g=d==="dark",f=g?Ppe:zpe,m=B.useRef(null),y=B.useRef(void 0),[w,_]=B.useState({w:0,h:0}),[b,x]=B.useState(null),[C,k]=B.useState(null),[T,N]=B.useState(!0),A=B.useRef(!1);B.useEffect(()=>{if(!m.current)return;const I=m.current,Z=()=>_({w:I.clientWidth,h:I.clientHeight});Z();const J=new ResizeObserver(Z);return J.observe(I),()=>J.disconnect()},[]);const j=B.useMemo(()=>jR(o.filters.search),[o.filters.search]),E=B.useMemo(()=>o.groups.map(I=>({group:I,parsed:jR(I.query)})).filter(({parsed:I})=>!I.isEmpty),[o.groups]),{filteredData:L,neighborsById:O,totalDegreeById:D,inDegreeById:K}=B.useMemo(()=>{if(!e)return{filteredData:{nodes:[],links:[]},neighborsById:new Map,totalDegreeById:new Map,inDegreeById:new Map};const I=new Map,Z=new Map;for(const We of e.nodes)I.set(We.id,0),Z.set(We.id,0);for(const We of e.links){const et=typeof We.source=="string"?We.source:We.source.id,de=typeof We.target=="string"?We.target:We.target.id;I.set(de,(I.get(de)??0)+1),Z.set(et,(Z.get(et)??0)+1),Z.set(de,(Z.get(de)??0)+1)}const J=We=>(Z.get(We)??0)===0,ne=[],ce=new Set;for(const We of e.nodes){if(!o.filters.showTags&&We.group==="tag"||!o.filters.showOrphans&&J(We.id)||!j.isEmpty&&!j.match(We))continue;const et={...We};et.__inDegree=I.get(We.id)??0,et.__totalDegree=Z.get(We.id)??0,et.__color=qpe(We,E,f),ne.push(et),ce.add(We.id)}const xe=[],Ve=new Map;for(const We of ne)Ve.set(We.id,new Set);for(const We of e.links){const et=typeof We.source=="string"?We.source:We.source.id,de=typeof We.target=="string"?We.target:We.target.id;!ce.has(et)||!ce.has(de)||(xe.push({source:et,target:de,kind:We.kind}),Ve.get(et).add(de),Ve.get(de).add(et))}return{filteredData:{nodes:ne,links:xe},neighborsById:Ve,totalDegreeById:Z,inDegreeById:I}},[e,o.filters,j,E]),z=B.useMemo(()=>wpe(o.forces),[o.forces]),H=.4+o.display.nodeSize*2.2;B.useEffect(()=>{var ce,xe,Ve,We,et,de,Ne,he,He;const I=y.current;if(!I)return;const Z=(ce=I.d3Force)==null?void 0:ce.call(I,"charge");Z!=null&&Z.strength&&Z.strength(z.repelStrength),Z!=null&&Z.distanceMax&&Z.distanceMax(420);const J=(xe=I.d3Force)==null?void 0:xe.call(I,"link");J&&((Ve=J.strength)==null||Ve.call(J,z.linkStrength),(We=J.distance)==null||We.call(J,z.linkDistance));const ne=(et=I.d3Force)==null?void 0:et.call(I,"center");ne!=null&&ne.strength&&ne.strength(z.centerStrength),(de=I.d3Force)==null||de.call(I,"collide",UO().radius(ut=>RR(ut,H)+4).strength(.9).iterations(2)),(Ne=I.d3Force)==null||Ne.call(I,"x",WO(0).strength(z.centerStrength*.4)),(he=I.d3Force)==null||he.call(I,"y",GO(0).strength(z.centerStrength*.4)),(He=I.d3ReheatSimulation)==null||He.call(I)},[z,H,L]),B.useEffect(()=>{A.current=!1},[e==null?void 0:e.nodes.length]),B.useEffect(()=>{if(!e||!L.nodes.length)return;const I=[];return[800,1600,2600].forEach(Z=>{I.push(setTimeout(()=>{var ne;if(A.current)return;const J=y.current;J&&((ne=J.zoomToFit)==null||ne.call(J,500,80),Z>=2600&&(A.current=!0))},Z))}),()=>I.forEach(clearTimeout)},[e,L.nodes.length]);const P=B.useMemo(()=>L.nodes.find(I=>I.id===b)??null,[L,b]),$=B.useMemo(()=>{if(!P||!e)return[];const I=[],Z=new Map(e.nodes.map(J=>[J.id,J]));for(const J of e.links){const ne=typeof J.source=="string"?J.source:J.source.id,ce=typeof J.target=="string"?J.target:J.target.id;if(ne===P.id){const xe=Z.get(ce);xe&&I.push({node:xe,kind:J.kind})}else if(ce===P.id){const xe=Z.get(ne);xe&&I.push({node:xe,kind:J.kind})}}return I},[e,P]),W=I=>{x(I.id);const Z=y.current;Z&&typeof I.x=="number"&&typeof I.y=="number"&&(Z.centerAt(I.x,I.y,400),Z.zoom(Math.max(Z.zoom(),2.2),400))},V=()=>s.invalidateQueries({queryKey:["graph"]});B.useEffect(()=>{const I=Z=>{var ce;if((ce=Z.target)!=null&&ce.matches("input,textarea"))return;const J=y.current;if(!J)return;const ne=J.zoom();if(Z.key==="+"||Z.key==="=")J.zoom(ne*1.2,200);else if(Z.key==="-"||Z.key==="_")J.zoom(ne/1.2,200);else if(Z.key.startsWith("Arrow")){const xe=Z.shiftKey?120:40,Ve=J.centerAt();let We=0,et=0;Z.key==="ArrowUp"?et=-xe:Z.key==="ArrowDown"?et=xe:Z.key==="ArrowLeft"?We=-xe:Z.key==="ArrowRight"&&(We=xe),J.centerAt(((Ve==null?void 0:Ve.x)??0)+We/ne,((Ve==null?void 0:Ve.y)??0)+et/ne,150)}};return window.addEventListener("keydown",I),()=>window.removeEventListener("keydown",I)},[]);const F=C??b,G=F?O.get(F)??new Set:null,U=I=>!F||I===F?!1:!(G!=null&&G.has(I)),X=I=>{const Z=I.__color??f[I.group];return U(I.id)?Upe(Z,g?.18:.3):Z},ee=I=>{const Z=LR(I.source),J=LR(I.target);return F?Z===F||J===F?g?"rgba(220, 225, 240, 0.85)":"rgba(30, 35, 50, 0.85)":g?"rgba(140, 150, 170, 0.07)":"rgba(60, 65, 80, 0.06)":g?"rgba(140, 150, 170, 0.35)":"rgba(60, 65, 80, 0.28)"},re=.5+o.display.linkThickness*2.5,le=I=>I.kind==="sibling_core"||I.kind==="release_includes"?re*1.3:re,fe=I=>T$(I)*H,ie=(1-o.display.textFadeThreshold)*.8;return a.jsxs("div",{className:"brain-page",children:[a.jsxs("header",{className:"brain-header",children:[a.jsxs("h1",{className:"brain-title",children:[a.jsx("span",{className:"brain-title-mark",children:"◉"}),"Brain"]}),e&&a.jsxs("span",{className:"brain-stats",children:[L.nodes.length,"/",e.nodes.length," nodes · ",L.links.length," links"]}),a.jsxs("div",{className:"brain-header-actions",children:[a.jsx("button",{className:"brain-btn",onClick:V,title:"Refresh",children:"↻"}),a.jsx("button",{className:`brain-btn ${T?"brain-btn--active":""}`,onClick:()=>N(I=>!I),title:"Graph settings",children:"⚙"})]})]}),a.jsxs("div",{className:"brain-canvas-wrap",ref:m,onPointerLeave:()=>k(null),onPointerDown:()=>k(null),children:[T&&a.jsx(Ape,{settings:o,patch:h,setGroups:l,reset:u,onClose:()=>N(!1)}),i&&a.jsx("div",{className:"brain-loading",children:"Loading brain…"}),n&&a.jsxs("div",{className:"brain-empty",children:["Failed to load graph: ",String(n)]}),e&&L.nodes.length===0&&!i&&a.jsx("div",{className:"brain-empty",children:"No nodes match the current filters."}),e&&L.nodes.length>0&&w.w>0&&o.display.view!=="3d"&&a.jsx(Py,{ref:y,graphData:L,width:w.w,height:w.h,backgroundColor:g?"#151518":"#ffffff",nodeId:"id",nodeLabel:I=>I.label,nodeColor:I=>X(I),nodeVal:I=>fe(I),nodeRelSize:3,linkColor:I=>ee(I),linkWidth:I=>le(I),linkDirectionalArrowLength:I=>o.display.arrows?3.5:0,linkDirectionalArrowRelPos:.94,linkDirectionalArrowColor:()=>g?"rgba(180, 185, 200, 0.6)":"rgba(60, 65, 80, 0.55)",onNodeClick:I=>W(I),onNodeHover:I=>k(I?I.id:null),onNodeDrag:()=>k(null),onZoom:()=>k(null),onBackgroundClick:()=>{x(null),k(null)},onEngineStop:()=>{var Z;if(A.current)return;const I=y.current;I&&((Z=I.zoomToFit)==null||Z.call(I,600,80),A.current=!0)},cooldownTicks:160,d3AlphaDecay:.025,d3VelocityDecay:.28,enableNodeDrag:!0,nodeCanvasObjectMode:()=>"after",nodeCanvasObject:(I,Z,J)=>{if(!(I.id===C||I.id===b||F&&(G==null?void 0:G.has(I.id)))&&J<ie)return;const ce=I.label,xe=Math.max(10,13/Math.max(J,.7));Z.font=`${xe}px -apple-system, BlinkMacSystemFont, 'Visby CF', sans-serif`,Z.textAlign="center",Z.textBaseline="top";const Ve=RR(I,H),We=(I.y??0)+Ve+3,et=U(I.id);g?Z.fillStyle=et?"rgba(200, 210, 225, 0.3)":"rgba(235, 240, 250, 0.95)":Z.fillStyle=et?"rgba(60, 65, 80, 0.3)":"rgba(20, 24, 36, 0.92)",Z.fillText(ce,I.x??0,We)}}),e&&L.nodes.length>0&&w.w>0&&o.display.view==="3d"&&a.jsx(B.Suspense,{fallback:a.jsx("div",{className:"brain-loading",children:"Loading 3D engine…"}),children:a.jsx($pe,{graphData:L,width:w.w,height:w.h,isDark:g,nodeColor:X,nodeVal:fe,linkColor:ee,linkWidth:le,showArrows:o.display.arrows,forces:z,nodeSizeScale:H,isDimmed:U,neighborsById:O,onNodeClick:W,onNodeHover:I=>k(I?I.id:null),onBackgroundClick:()=>{x(null),k(null)}})}),a.jsx(Fpe,{node:P,onClose:()=>x(null),onSelectRelated:I=>x(I),relatedNodes:$,inDegree:P?K.get(P.id)??0:0,totalDegree:P?D.get(P.id)??0:0,onNavigate:r})]})]})}function Upe(r,e){const i=r.replace("#",""),n=parseInt(i,16),s=n>>16&255,o=n>>8&255,h=n&255;return`rgba(${s}, ${o}, ${h}, ${e})`}function Wpe(){return Yt({queryKey:["council"],queryFn:()=>De.get("/council"),select:r=>r.debates})}function Gpe(r){return Yt({queryKey:["council",r],queryFn:()=>De.get(`/council/${r}`),select:e=>e.debate,enabled:!!r})}function E$(r){if(!r)return null;const e=r.split(`
513
+ `):null}function bpe(r){return r.split(/[-_]/).map(e=>e&&e[0].toUpperCase()+e.slice(1)).join(" ")}function jC(r,e){if(!e)return r.name;if(Of(r.slug)){const i=r.slug.lastIndexOf("/");return i>=0?r.slug.slice(i+1):r.slug}return r.name.startsWith(`${e}/`)?r.name.slice(e.length+1):r.name}function w$(r){return r.cards.length+r.folders.reduce((e,i)=>e+w$(i),0)}function vpe(r){const e=[],i={path:"",folders:[],cards:[]},n=new Map;for(const h of r){const l=h.slug.split("/");for(let u=1;u<l.length;u++){const d=l.slice(0,u).join("/");n.set(d,(n.get(d)??0)+1)}}const s=(h,l)=>{let u=h.folders.find(d=>d.name===l);if(!u){const d=h.path?`${h.path}/${l}`:l;u={name:l,path:d,label:bpe(l),folders:[],cards:[]},h.folders.push(u)}return u};for(const h of r){const l=h.slug.split("/"),u=l[l.length-1];let d=l.slice(0,-1);if(Of(h.slug)&&d.length>0){const f=u.replace(/\.excalidraw$/,""),m=d.join("/");d[d.length-1]===f&&(n.get(m)??0)<=1&&(d=d.slice(0,-1))}if(d.length===0){e.push(h);continue}let g=i;for(const f of d)g=s(g,f);g.cards.push(h)}const o=h=>{h.folders.sort((l,u)=>l.label.localeCompare(u.label)),h.cards.sort((l,u)=>jC(l,h.path).localeCompare(jC(u,h.path))),h.folders.forEach(o)};return o(i),{roots:e,folders:i.folders}}function xpe(r){const e=r.split("/"),i=[];for(let n=1;n<e.length;n++)i.push(e.slice(0,n).join("/"));return i}function _pe({focus:r}={}){const{t:e}=wr(),{data:i,isLoading:n,isError:s,error:o}=Kce(),h=Zce(),[l,u]=B.useState(null),[d,g]=B.useState("preview"),[f,m]=B.useState(new Set),[y,w]=B.useState(!1);Ok(r,D=>{u(D),g("preview"),m(K=>{const z=new Set(K);for(const H of xpe(D))z.add(H);return z})});const{data:_}=Vce(l??""),b=B.useMemo(()=>{var D;return(D=i==null?void 0:i.find(K=>K.slug===l))==null?void 0:D.mtime},[i,l]);Xce(l,b,_==null?void 0:_.mtime);const{roots:x,folders:C}=B.useMemo(()=>vpe(i??[]),[i]),k=D=>f.has(D),T=D=>{m(K=>{const z=new Set(K);return z.has(D)?z.delete(D):z.add(D),z})},N=(D,K=null)=>a.jsxs("button",{className:`knowledge-card ${l===D.slug?"knowledge-card--active":""}`,onClick:()=>{u(D.slug),g("preview")},children:[a.jsxs("div",{className:"knowledge-card-header",children:[a.jsxs("span",{className:"knowledge-card-title",children:[Of(D.slug)&&a.jsx("span",{className:"knowledge-card-icon",title:"Diagram / sketch","aria-label":"Diagram",children:a.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M12 20h9"}),a.jsx("path",{d:"M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4Z"})]})}),a.jsx("span",{className:"knowledge-card-name",children:jC(D,K)}),D.type==="feature"&&D.status&&a.jsx("span",{className:`knowledge-card-status knowledge-card-status--${D.status}`,children:D.status})]}),a.jsx("button",{className:`pin-btn ${D.pinned?"pin-btn--active":""}`,onClick:z=>{z.stopPropagation(),h.mutate({slug:D.slug,pinned:!D.pinned})},title:D.pinned?e("knowledge.unpin"):e("knowledge.pin"),children:D.pinned?"◆":"◇"})]}),D.description&&a.jsx("p",{className:"knowledge-card-desc",children:D.description}),a.jsx("div",{className:"knowledge-card-tags",children:D.tags.map(z=>a.jsx("span",{className:"task-tag","data-hue":na(z),children:z},z))})]},D.slug),A=D=>a.jsxs("div",{className:"knowledge-folder",children:[a.jsxs("button",{className:"knowledge-folder-header",onClick:()=>T(D.path),"aria-expanded":k(D.path),children:[a.jsx("span",{className:"knowledge-folder-chevron",children:k(D.path)?"▾":"▸"}),a.jsx("span",{className:"knowledge-folder-name",children:D.label}),a.jsx("span",{className:"knowledge-folder-count",children:w$(D)})]}),k(D.path)&&a.jsxs("div",{className:"knowledge-folder-items",children:[D.folders.map(A),D.cards.map(K=>N(K,D.path))]})]},D.path),j=()=>a.jsxs("div",{className:"core-tabs",children:[a.jsx("button",{className:`core-tab ${d==="file"?"core-tab--active":""}`,onClick:()=>g("file"),children:"File"}),a.jsx("button",{className:`core-tab ${d==="preview"?"core-tab--active":""}`,onClick:()=>g("preview"),children:"Preview"})]}),E=D=>{if(d==="preview"&&D.content){if(Of(D.slug))return a.jsx(NF,{content:D.content,slug:D.slug});const K=ype(D.slug,D.content);return K?a.jsx(jk,{content:K}):a.jsx(tp,{content:D.content})}return a.jsx("pre",{className:"core-viewer-content",children:D.content})};if(n)return a.jsx("div",{className:"loading",children:e("common.loading")});if(s)return a.jsxs("div",{className:"error-state",children:["Failed to load knowledge. ",o==null?void 0:o.message]});const L=a.jsxs(a.Fragment,{children:[(!i||i.length===0)&&a.jsx("div",{className:"core-empty",children:e("common.empty")}),C.map(A),x.map(D=>N(D))]}),O=a.jsxs(a.Fragment,{children:[!l&&a.jsxs("div",{className:"knowledge-detail-empty",children:[a.jsx("span",{className:"knowledge-detail-empty-icon","aria-hidden":"true",children:a.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[a.jsx("path",{d:"M12 6.2C10.1 4.9 7.8 4.2 5 4.2c-.9 0-1.7.1-2.5.3v13c.8-.2 1.6-.3 2.5-.3 2.8 0 5.1.7 7 2"}),a.jsx("path",{d:"M12 6.2c1.9-1.3 4.2-2 7-2 .9 0 1.7.1 2.5.3v13c-.8-.2-1.6-.3-2.5-.3-2.8 0-5.1.7-7 2"}),a.jsx("line",{x1:"12",y1:"6.2",x2:"12",y2:"19.2"})]})}),a.jsx("p",{children:"Select a knowledge file, or search to recall across your brain."})]}),l&&!_&&a.jsx("div",{className:"core-empty",children:"Loading document…"}),l&&_&&a.jsxs("div",{className:"core-viewer",children:[a.jsxs("div",{className:"core-viewer-header",children:[a.jsx("h2",{className:"core-viewer-title",children:_.name}),a.jsxs("div",{className:"core-viewer-actions",children:[j(),a.jsx("button",{className:"core-expand-btn",onClick:()=>w(!0),title:e("knowledge.fullscreen"),"aria-label":e("knowledge.fullscreen"),children:"⛶"})]})]}),y?a.jsx(dpe,{label:_.name,actions:j(),onClose:()=>w(!1),children:E(_)}):E(_)]})]});return a.jsx("div",{className:"knowledge-page",children:a.jsx(gpe,{scope:"knowledge",placeholder:e("knowledge.search"),selectedSlug:l,onOpen:D=>{u(D.slug),g("preview")},browse:L,detail:O})})}function Cpe(){return Yt({queryKey:["graph"],queryFn:()=>De.get("/graph"),staleTime:3e4})}const kh={filters:{search:"",showTags:!0,showOrphans:!0,showAttachments:!1,existingFilesOnly:!1},groups:[],display:{view:"2d",arrows:!1,textFadeThreshold:.85,nodeSize:.5,linkThickness:.5},forces:{centerStrength:.7,repelStrength:.35,linkStrength:.9,linkDistance:.35}};function wpe(r){return{centerStrength:.05+r.centerStrength*.45,repelStrength:-(30+r.repelStrength*240),linkStrength:.1+r.linkStrength*1.2,linkDistance:20+r.linkDistance*180}}function kpe(r){return{filters:{...kh.filters,...r.filters},groups:Array.isArray(r.groups)?r.groups:kh.groups,display:{...kh.display,...r.display},forces:{...kh.forces,...r.forces}}}function Spe(){const[r,e]=Kk("brain:settings:v1",kh),i=B.useRef(!1);B.useEffect(()=>{if(i.current)return;let d=!1;return De.get("/brain-settings").then(g=>{if(d)return;i.current=!0;const f=g.settings;f&&typeof f=="object"&&Object.keys(f).length>0&&e(kpe(f))}).catch(()=>{i.current=!0}),()=>{d=!0}},[e]);const n=B.useRef(null),s=B.useCallback(d=>{i.current&&(n.current&&clearTimeout(n.current),n.current=setTimeout(()=>{De.put("/brain-settings",{settings:d}).catch(()=>{})},600))},[]),o=B.useCallback(d=>{e(g=>{const f=d(g);return s(f),f})},[e,s]),h=B.useCallback((d,g)=>{o(f=>({...f,[d]:{...f[d],...g}}))},[o]),l=B.useCallback(d=>{o(g=>({...g,groups:d}))},[o]),u=B.useCallback(()=>{o(()=>kh)},[o]);return{settings:r,patch:h,setGroups:l,reset:u}}function Tpe(r){const e=[];let i=0;for(;i<r.length;){const n=r[i];if(/\s/.test(n)){i++;continue}if(n==="("){e.push({type:"LPAREN"}),i++;continue}if(n===")"){e.push({type:"RPAREN"}),i++;continue}if(n==="-"&&i+1<r.length&&!/\s/.test(r[i+1])){e.push({type:"NOT"}),i++;continue}if(n==='"'){let l=i+1,u="";for(;l<r.length&&r[l]!=='"';)r[l]==="\\"&&l+1<r.length?(u+=r[l+1],l+=2):(u+=r[l],l++);e.push({type:"PHRASE",value:u}),i=l+1;continue}if(n==="/"){let l=i+1,u="";for(;l<r.length&&r[l]!=="/";)r[l]==="\\"&&l+1<r.length?(u+=r[l]+r[l+1],l+=2):(u+=r[l],l++);if(l<r.length){e.push({type:"REGEX",value:u}),i=l+1;continue}}let s=i;for(;s<r.length&&!/[\s()]/.test(r[s])&&r[s]!=='"';)s++;const o=r.slice(i,s),h=o.match(/^(tag|path|file|content):(.*)$/i);h?e.push({type:"OP",value:h[1].toLowerCase(),arg:h[2]}):o.toUpperCase()==="OR"?e.push({type:"OR"}):o.toUpperCase()==="AND"||o.length>0&&e.push({type:"WORD",value:o}),i=s}return e}class Epe{constructor(e){Wt(this,"pos",0);this.tokens=e}parse(){return this.parseOr()}parseOr(){var i;let e=this.parseAnd();for(;((i=this.peek())==null?void 0:i.type)==="OR";){this.pos++;const n=this.parseAnd();e.type==="or"?e.children.push(n):e={type:"or",children:[e,n]}}return e}parseAnd(){var i,n;const e=[];for(;this.pos<this.tokens.length&&((i=this.peek())==null?void 0:i.type)!=="RPAREN"&&((n=this.peek())==null?void 0:n.type)!=="OR";){const s=this.parseTerm();s&&e.push(s)}return e.length===0?{type:"and",children:[]}:e.length===1?e[0]:{type:"and",children:e}}parseTerm(){var s;const e=this.peek();if(!e)return null;let i=!1;e.type==="NOT"&&(i=!0,this.pos++);const n=this.peek();if(!n)return null;if(n.type==="LPAREN"){this.pos++;const o=this.parseOr();return((s=this.peek())==null?void 0:s.type)==="RPAREN"&&this.pos++,i?k$(o):o}if(n.type==="WORD")return this.pos++,{type:"word",value:n.value.toLowerCase(),negated:i};if(n.type==="PHRASE")return this.pos++,{type:"phrase",value:n.value.toLowerCase(),negated:i};if(n.type==="REGEX"){this.pos++;try{return{type:"regex",value:new RegExp(n.value,"i"),negated:i}}catch{return null}}return n.type==="OP"?(this.pos++,{type:"op",op:n.value,arg:n.arg.toLowerCase(),negated:i}):(this.pos++,null)}peek(){return this.tokens[this.pos]}}function k$(r){return r.type==="and"||r.type==="or"?{...r,children:r.children.map(k$)}:{...r,negated:!r.negated}}function jR(r){const e=r.trim();if(!e)return{match:()=>!0,raw:"",isEmpty:!0};const i=Tpe(e),n=new Epe(i).parse();return{match:s=>AC(n,s),raw:e,isEmpty:!1}}function AC(r,e){switch(r.type){case"and":return r.children.every(i=>AC(i,e));case"or":return r.children.some(i=>AC(i,e));case"word":return tm(AR(e,r.value),r.negated);case"phrase":return tm(AR(e,r.value),r.negated);case"regex":return tm(Npe(e,r.value),r.negated);case"op":return tm(jpe(e,r.op,r.arg),r.negated)}}function tm(r,e){return e?!r:r}function S$(r){return[r.label,r.path,r.id,r.meta.description??"",...r.meta.tags??[]].join(" ").toLowerCase()}function AR(r,e){return S$(r).includes(e)}function Npe(r,e){return e.test(S$(r))}function jpe(r,e,i){var s;const n=i.toLowerCase();switch(e){case"path":return r.path.toLowerCase().includes(n);case"file":return(((s=r.path.split("/").pop())==null?void 0:s.toLowerCase())??r.label.toLowerCase()).includes(n);case"tag":{const o=n.replace(/^#/,"");return(r.meta.tags??[]).some(h=>h.toLowerCase()===o)||r.group==="tag"&&r.label.toLowerCase().replace(/^#/,"")===o}case"content":return(r.meta.description??"").toLowerCase().includes(n);default:return!1}}const rm={filters:"Filters",groups:"Groups",display:"Display",forces:"Forces"},w_=["#10b981","#4fb3e6","#a78bfa","#f59e0b","#ef4444","#e11d74","#9ca3af","#eab308","#22d3ee","#f472b6"];function Ape({settings:r,patch:e,setGroups:i,reset:n,onClose:s}){const[o,h]=B.useState({filters:!0,groups:!0,display:!0,forces:!0}),l=u=>h(d=>({...d,[u]:!d[u]}));return a.jsxs("aside",{className:"brain-settings",children:[a.jsxs("div",{className:"brain-settings-header",children:[a.jsx("span",{className:"brain-settings-title",children:"Graph settings"}),a.jsxs("div",{className:"brain-settings-header-actions",children:[a.jsx("button",{className:"brain-settings-mini-btn",onClick:n,title:"Restore default settings",children:"↻"}),a.jsx("button",{className:"brain-settings-mini-btn",onClick:s,title:"Close",children:"×"})]})]}),a.jsxs("div",{className:"brain-settings-body",children:[a.jsxs(im,{label:rm.filters,open:o.filters,onToggle:()=>l("filters"),children:[a.jsx("label",{className:"brain-settings-label",children:"Search files"}),a.jsx("input",{type:"search",className:"brain-settings-input",placeholder:"Search…",value:r.filters.search,onChange:u=>e("filters",{search:u.target.value})}),a.jsxs("p",{className:"brain-settings-hint",children:["Operators: ",a.jsx("code",{children:"tag:"})," ",a.jsx("code",{children:"path:"})," ",a.jsx("code",{children:"file:"})," ",a.jsx("code",{children:"-not"})," ",a.jsx("code",{children:"OR"})," ",a.jsx("code",{children:'"phrase"'})," ",a.jsx("code",{children:"/regex/"})]}),a.jsx(Id,{label:"Tags",checked:r.filters.showTags,onChange:u=>e("filters",{showTags:u})}),a.jsx(Id,{label:"Attachments",checked:r.filters.showAttachments,onChange:u=>e("filters",{showAttachments:u})}),a.jsx(Id,{label:"Existing files only",checked:r.filters.existingFilesOnly,onChange:u=>e("filters",{existingFilesOnly:u})}),a.jsx(Id,{label:"Orphans",checked:r.filters.showOrphans,onChange:u=>e("filters",{showOrphans:u})})]}),a.jsx(im,{label:rm.groups,open:o.groups,onToggle:()=>l("groups"),children:a.jsx(Lpe,{groups:r.groups,onChange:i})}),a.jsxs(im,{label:rm.display,open:o.display,onToggle:()=>l("display"),children:[a.jsx(Mpe,{label:"View",value:r.display.view==="3d"?"3d":"2d",options:[{value:"2d",label:"2D"},{value:"3d",label:"3D"}],onChange:u=>e("display",{view:u})}),a.jsx(Id,{label:"Arrows",checked:r.display.arrows,onChange:u=>e("display",{arrows:u})}),a.jsx(Al,{label:"Text fade threshold",value:r.display.textFadeThreshold,onChange:u=>e("display",{textFadeThreshold:u})}),a.jsx(Al,{label:"Node size",value:r.display.nodeSize,onChange:u=>e("display",{nodeSize:u})}),a.jsx(Al,{label:"Link thickness",value:r.display.linkThickness,onChange:u=>e("display",{linkThickness:u})})]}),a.jsxs(im,{label:rm.forces,open:o.forces,onToggle:()=>l("forces"),children:[a.jsx(Al,{label:"Center force",value:r.forces.centerStrength,onChange:u=>e("forces",{centerStrength:u})}),a.jsx(Al,{label:"Repel force",value:r.forces.repelStrength,onChange:u=>e("forces",{repelStrength:u})}),a.jsx(Al,{label:"Link force",value:r.forces.linkStrength,onChange:u=>e("forces",{linkStrength:u})}),a.jsx(Al,{label:"Link distance",value:r.forces.linkDistance,onChange:u=>e("forces",{linkDistance:u})})]})]})]})}function im({label:r,open:e,onToggle:i,children:n}){return a.jsxs("div",{className:`brain-section ${e?"brain-section--open":""}`,children:[a.jsxs("button",{className:"brain-section-header",onClick:i,type:"button",children:[a.jsx("span",{className:"brain-section-caret",children:e?"▾":"▸"}),a.jsx("span",{children:r})]}),e&&a.jsx("div",{className:"brain-section-body",children:n})]})}function Id({label:r,checked:e,onChange:i}){return a.jsxs("label",{className:"brain-toggle-row",children:[a.jsx("span",{children:r}),a.jsx("span",{className:`brain-toggle ${e?"brain-toggle--on":""}`,onClick:()=>i(!e),children:a.jsx("span",{className:"brain-toggle-knob"})})]})}function Mpe({label:r,value:e,options:i,onChange:n}){return a.jsxs("div",{className:"brain-segmented-row",children:[a.jsx("span",{className:"brain-segmented-label",children:r}),a.jsx("div",{className:"brain-segmented",role:"tablist",children:i.map(s=>a.jsx("button",{type:"button",role:"tab","aria-selected":e===s.value,className:`brain-segmented-btn ${e===s.value?"brain-segmented-btn--active":""}`,onClick:()=>n(s.value),children:s.label},s.value))})]})}function Al({label:r,value:e,onChange:i}){return a.jsxs("label",{className:"brain-slider-row",children:[a.jsx("span",{className:"brain-slider-label-text",children:r}),a.jsx("input",{type:"range",min:0,max:1,step:.01,value:e,onChange:n=>i(parseFloat(n.target.value))})]})}function Lpe({groups:r,onChange:e}){const[i,n]=B.useState(""),[s,o]=B.useState(null),h=()=>{const d=i.trim();if(!d)return;const g=`grp_${Math.random().toString(36).slice(2,8)}`;e([...r,{id:g,query:d,color:w_[r.length%w_.length]}]),n("")},l=(d,g)=>{e(r.map(f=>f.id===d?{...f,...g}:f))},u=d=>e(r.filter(g=>g.id!==d));return a.jsxs(a.Fragment,{children:[r.length===0&&a.jsxs("p",{className:"brain-settings-hint",children:["Color nodes that match a query. First matching group wins. Example:"," ",a.jsx("code",{children:"tag:#architecture"})]}),a.jsx("div",{className:"brain-groups-list",children:r.map(d=>a.jsxs("div",{className:"brain-group-row",children:[a.jsx("button",{className:"brain-group-color",style:{background:d.color},onClick:()=>o(s===d.id?null:d.id),title:"Pick color"}),a.jsx("input",{className:"brain-settings-input brain-group-input",value:d.query,onChange:g=>l(d.id,{query:g.target.value})}),a.jsx("button",{className:"brain-settings-mini-btn",onClick:()=>u(d.id),title:"Remove group",children:"×"}),s===d.id&&a.jsx("div",{className:"brain-swatch-picker",children:w_.map(g=>a.jsx("button",{className:"brain-swatch",style:{background:g},onClick:()=>{l(d.id,{color:g}),o(null)}},g))})]},d.id))}),a.jsxs("div",{className:"brain-group-add",children:[a.jsx("input",{className:"brain-settings-input",placeholder:"New group query…",value:i,onChange:d=>n(d.target.value),onKeyDown:d=>{d.key==="Enter"&&h()}}),a.jsx("button",{className:"brain-settings-btn",onClick:h,disabled:!i.trim(),children:"New group"})]})]})}function Rpe(r){return Yt({queryKey:["graph","content",(r==null?void 0:r.path)??null],queryFn:()=>{if(!r||!r.path)throw new Error("No path for node");return De.get(`/graph/content?path=${encodeURIComponent(r.path)}`)},enabled:!!(r&&r.path),staleTime:3e4})}const MR={soul:"#4fb3e6",user:"#4fb3e6",memory:"#4fb3e6",core:"#4fb3e6",feature:"#10b981",task:"#f59e0b",knowledge:"#a78bfa",release:"#e11d74",inbox:"#9ca3af",tag:"#10b981"},Bpe={soul:"Soul",user:"User",memory:"Memory",core:"Core",feature:"Feature",task:"Task",knowledge:"Knowledge",release:"Release",inbox:"Inbox",tag:"Tag"},Ope={related_feature:"feature",parent_task:"parent",release_includes:"released",sibling_core:"spine",has_tag:"tag"};function Dpe(r){return r==="task"?"tasks":r==="feature"||r==="knowledge"?"knowledge":r==="soul"||r==="user"||r==="memory"||r==="core"?"core":null}function Ipe(r,e){return r==="knowledge"&&e.path?e.path.replace(/^knowledge\//,"").replace(/\.md$/,""):e.id}function Fpe({node:r,onClose:e,onSelectRelated:i,relatedNodes:n,inDegree:s,totalDegree:o,onNavigate:h}){const l=!!(r!=null&&r.path),u=Rpe(l?r:null);if(!r)return a.jsx("aside",{className:"brain-drawer"});const d=Dpe(r.group),g=u.data;return a.jsxs("aside",{className:"brain-drawer brain-drawer--open",children:[a.jsx("button",{className:"brain-drawer-close",onClick:e,"aria-label":"Close",children:"×"}),a.jsxs("div",{className:"brain-drawer-header",children:[a.jsxs("span",{className:"brain-drawer-group-badge",children:[a.jsx("span",{className:"brain-related-dot",style:{background:MR[r.group]}}),Bpe[r.group]]}),a.jsx("h2",{className:"brain-drawer-title",children:r.label}),r.path&&a.jsx("span",{className:"brain-drawer-id",children:r.path})]}),a.jsxs("div",{className:"brain-drawer-body",children:[l&&u.isLoading&&a.jsx("p",{className:"brain-description",children:"Loading…"}),l&&u.error&&a.jsxs("p",{className:"brain-description",children:["Failed to load file: ",String(u.error)]}),(g==null?void 0:g.type)==="markdown"&&a.jsx(tp,{content:g.content,frontmatter:g.frontmatter}),(g==null?void 0:g.type)==="json"&&a.jsx("pre",{className:"brain-codeblock",children:g.data!==void 0?JSON.stringify(g.data,null,2):g.raw??"(empty)"}),(g==null?void 0:g.type)==="text"&&a.jsx("pre",{className:"brain-codeblock",children:g.content}),!l&&r.group==="tag"&&a.jsxs("p",{className:"brain-description",children:["Tag ",a.jsxs("code",{children:["#",r.label.replace(/^#/,"")]})," — ",n.length," ",n.length===1?"file":"files"," reference this tag."]}),!l&&r.group!=="tag"&&a.jsx("p",{className:"brain-description",children:r.meta.description??"No file content."}),n.length>0&&a.jsxs("section",{className:"brain-drawer-section",children:[a.jsxs("h3",{className:"brain-drawer-section-title",children:["Connections (",n.length,") · in ",s," · total ",o]}),a.jsx("div",{className:"brain-related-list",children:n.map(({node:f,kind:m})=>a.jsxs("button",{className:"brain-related-item",onClick:()=>i(f.id),children:[a.jsx("span",{className:"brain-related-dot",style:{background:MR[f.group]}}),a.jsx("span",{children:f.label}),a.jsx("span",{className:"brain-related-kind",children:Ope[m]??m})]},`${f.id}-${m}`))})]})]}),d&&h&&a.jsx("div",{className:"brain-drawer-footer",children:a.jsxs("button",{className:"brain-btn",onClick:()=>h(d,Ipe(d,r)),children:["Open in ",d.charAt(0).toUpperCase()+d.slice(1)," to edit →"]})})]})}const $pe=EF("BrainCanvas3D",()=>Zt(()=>import("./BrainCanvas3D-DyF_3yYD.js"),__vite__mapDeps([56,54])).then(r=>({default:r.BrainCanvas3D}))),Ppe={soul:"#4fb3e6",user:"#4fb3e6",memory:"#4fb3e6",core:"#4fb3e6",feature:"#10b981",task:"#f59e0b",knowledge:"#a78bfa",release:"#e11d74",inbox:"#9ca3af",tag:"#10b981"},zpe={soul:"#0d7bb8",user:"#0d7bb8",memory:"#0d7bb8",core:"#0d7bb8",feature:"#047857",task:"#b45309",knowledge:"#6d28d9",release:"#be185d",inbox:"#475569",tag:"#047857"};function LR(r){return typeof r=="string"?r:r.id}function T$(r){const e=r.group==="soul"?8:r.group==="user"||r.group==="memory"?6:r.group==="tag"?3:4,i=r.__inDegree??0;return e+Math.min(14,i*1.2)}function RR(r,e){return Math.sqrt(T$(r)*e)*3}function qpe(r,e,i){for(const{group:n,parsed:s}of e)if(s.match(r))return n.color;return i[r.group]}function Hpe({onNavigate:r}){const{data:e,isLoading:i,error:n}=Cpe(),s=Pt(),{settings:o,patch:h,setGroups:l,reset:u}=Spe(),{resolved:d}=Kf(),g=d==="dark",f=g?Ppe:zpe,m=B.useRef(null),y=B.useRef(void 0),[w,_]=B.useState({w:0,h:0}),[b,x]=B.useState(null),[C,k]=B.useState(null),[T,N]=B.useState(!0),A=B.useRef(!1);B.useEffect(()=>{if(!m.current)return;const I=m.current,Z=()=>_({w:I.clientWidth,h:I.clientHeight});Z();const J=new ResizeObserver(Z);return J.observe(I),()=>J.disconnect()},[]);const j=B.useMemo(()=>jR(o.filters.search),[o.filters.search]),E=B.useMemo(()=>o.groups.map(I=>({group:I,parsed:jR(I.query)})).filter(({parsed:I})=>!I.isEmpty),[o.groups]),{filteredData:L,neighborsById:O,totalDegreeById:D,inDegreeById:K}=B.useMemo(()=>{if(!e)return{filteredData:{nodes:[],links:[]},neighborsById:new Map,totalDegreeById:new Map,inDegreeById:new Map};const I=new Map,Z=new Map;for(const We of e.nodes)I.set(We.id,0),Z.set(We.id,0);for(const We of e.links){const et=typeof We.source=="string"?We.source:We.source.id,de=typeof We.target=="string"?We.target:We.target.id;I.set(de,(I.get(de)??0)+1),Z.set(et,(Z.get(et)??0)+1),Z.set(de,(Z.get(de)??0)+1)}const J=We=>(Z.get(We)??0)===0,ne=[],ce=new Set;for(const We of e.nodes){if(!o.filters.showTags&&We.group==="tag"||!o.filters.showOrphans&&J(We.id)||!j.isEmpty&&!j.match(We))continue;const et={...We};et.__inDegree=I.get(We.id)??0,et.__totalDegree=Z.get(We.id)??0,et.__color=qpe(We,E,f),ne.push(et),ce.add(We.id)}const xe=[],Ve=new Map;for(const We of ne)Ve.set(We.id,new Set);for(const We of e.links){const et=typeof We.source=="string"?We.source:We.source.id,de=typeof We.target=="string"?We.target:We.target.id;!ce.has(et)||!ce.has(de)||(xe.push({source:et,target:de,kind:We.kind}),Ve.get(et).add(de),Ve.get(de).add(et))}return{filteredData:{nodes:ne,links:xe},neighborsById:Ve,totalDegreeById:Z,inDegreeById:I}},[e,o.filters,j,E]),z=B.useMemo(()=>wpe(o.forces),[o.forces]),H=.4+o.display.nodeSize*2.2;B.useEffect(()=>{var ce,xe,Ve,We,et,de,Ne,he,He;const I=y.current;if(!I)return;const Z=(ce=I.d3Force)==null?void 0:ce.call(I,"charge");Z!=null&&Z.strength&&Z.strength(z.repelStrength),Z!=null&&Z.distanceMax&&Z.distanceMax(420);const J=(xe=I.d3Force)==null?void 0:xe.call(I,"link");J&&((Ve=J.strength)==null||Ve.call(J,z.linkStrength),(We=J.distance)==null||We.call(J,z.linkDistance));const ne=(et=I.d3Force)==null?void 0:et.call(I,"center");ne!=null&&ne.strength&&ne.strength(z.centerStrength),(de=I.d3Force)==null||de.call(I,"collide",UO().radius(ut=>RR(ut,H)+4).strength(.9).iterations(2)),(Ne=I.d3Force)==null||Ne.call(I,"x",WO(0).strength(z.centerStrength*.4)),(he=I.d3Force)==null||he.call(I,"y",GO(0).strength(z.centerStrength*.4)),(He=I.d3ReheatSimulation)==null||He.call(I)},[z,H,L]),B.useEffect(()=>{A.current=!1},[e==null?void 0:e.nodes.length]),B.useEffect(()=>{if(!e||!L.nodes.length)return;const I=[];return[800,1600,2600].forEach(Z=>{I.push(setTimeout(()=>{var ne;if(A.current)return;const J=y.current;J&&((ne=J.zoomToFit)==null||ne.call(J,500,80),Z>=2600&&(A.current=!0))},Z))}),()=>I.forEach(clearTimeout)},[e,L.nodes.length]);const P=B.useMemo(()=>L.nodes.find(I=>I.id===b)??null,[L,b]),$=B.useMemo(()=>{if(!P||!e)return[];const I=[],Z=new Map(e.nodes.map(J=>[J.id,J]));for(const J of e.links){const ne=typeof J.source=="string"?J.source:J.source.id,ce=typeof J.target=="string"?J.target:J.target.id;if(ne===P.id){const xe=Z.get(ce);xe&&I.push({node:xe,kind:J.kind})}else if(ce===P.id){const xe=Z.get(ne);xe&&I.push({node:xe,kind:J.kind})}}return I},[e,P]),W=I=>{x(I.id);const Z=y.current;Z&&typeof I.x=="number"&&typeof I.y=="number"&&(Z.centerAt(I.x,I.y,400),Z.zoom(Math.max(Z.zoom(),2.2),400))},V=()=>s.invalidateQueries({queryKey:["graph"]});B.useEffect(()=>{const I=Z=>{var ce;if((ce=Z.target)!=null&&ce.matches("input,textarea"))return;const J=y.current;if(!J)return;const ne=J.zoom();if(Z.key==="+"||Z.key==="=")J.zoom(ne*1.2,200);else if(Z.key==="-"||Z.key==="_")J.zoom(ne/1.2,200);else if(Z.key.startsWith("Arrow")){const xe=Z.shiftKey?120:40,Ve=J.centerAt();let We=0,et=0;Z.key==="ArrowUp"?et=-xe:Z.key==="ArrowDown"?et=xe:Z.key==="ArrowLeft"?We=-xe:Z.key==="ArrowRight"&&(We=xe),J.centerAt(((Ve==null?void 0:Ve.x)??0)+We/ne,((Ve==null?void 0:Ve.y)??0)+et/ne,150)}};return window.addEventListener("keydown",I),()=>window.removeEventListener("keydown",I)},[]);const F=C??b,G=F?O.get(F)??new Set:null,U=I=>!F||I===F?!1:!(G!=null&&G.has(I)),X=I=>{const Z=I.__color??f[I.group];return U(I.id)?Upe(Z,g?.18:.3):Z},ee=I=>{const Z=LR(I.source),J=LR(I.target);return F?Z===F||J===F?g?"rgba(220, 225, 240, 0.85)":"rgba(30, 35, 50, 0.85)":g?"rgba(140, 150, 170, 0.07)":"rgba(60, 65, 80, 0.06)":g?"rgba(140, 150, 170, 0.35)":"rgba(60, 65, 80, 0.28)"},re=.5+o.display.linkThickness*2.5,le=I=>I.kind==="sibling_core"||I.kind==="release_includes"?re*1.3:re,fe=I=>T$(I)*H,ie=(1-o.display.textFadeThreshold)*.8;return a.jsxs("div",{className:"brain-page",children:[a.jsxs("header",{className:"brain-header",children:[a.jsxs("h1",{className:"brain-title",children:[a.jsx("span",{className:"brain-title-mark",children:"◉"}),"Brain"]}),e&&a.jsxs("span",{className:"brain-stats",children:[L.nodes.length,"/",e.nodes.length," nodes · ",L.links.length," links"]}),a.jsxs("div",{className:"brain-header-actions",children:[a.jsx("button",{className:"brain-btn",onClick:V,title:"Refresh",children:"↻"}),a.jsx("button",{className:`brain-btn ${T?"brain-btn--active":""}`,onClick:()=>N(I=>!I),title:"Graph settings",children:"⚙"})]})]}),a.jsxs("div",{className:"brain-canvas-wrap",ref:m,onPointerLeave:()=>k(null),onPointerDown:()=>k(null),children:[T&&a.jsx(Ape,{settings:o,patch:h,setGroups:l,reset:u,onClose:()=>N(!1)}),i&&a.jsx("div",{className:"brain-loading",children:"Loading brain…"}),n&&a.jsxs("div",{className:"brain-empty",children:["Failed to load graph: ",String(n)]}),e&&L.nodes.length===0&&!i&&a.jsx("div",{className:"brain-empty",children:"No nodes match the current filters."}),e&&L.nodes.length>0&&w.w>0&&o.display.view!=="3d"&&a.jsx(Py,{ref:y,graphData:L,width:w.w,height:w.h,backgroundColor:g?"#151518":"#ffffff",nodeId:"id",nodeLabel:I=>I.label,nodeColor:I=>X(I),nodeVal:I=>fe(I),nodeRelSize:3,linkColor:I=>ee(I),linkWidth:I=>le(I),linkDirectionalArrowLength:I=>o.display.arrows?3.5:0,linkDirectionalArrowRelPos:.94,linkDirectionalArrowColor:()=>g?"rgba(180, 185, 200, 0.6)":"rgba(60, 65, 80, 0.55)",onNodeClick:I=>W(I),onNodeHover:I=>k(I?I.id:null),onNodeDrag:()=>k(null),onZoom:()=>k(null),onBackgroundClick:()=>{x(null),k(null)},onEngineStop:()=>{var Z;if(A.current)return;const I=y.current;I&&((Z=I.zoomToFit)==null||Z.call(I,600,80),A.current=!0)},cooldownTicks:160,d3AlphaDecay:.025,d3VelocityDecay:.28,enableNodeDrag:!0,nodeCanvasObjectMode:()=>"after",nodeCanvasObject:(I,Z,J)=>{if(!(I.id===C||I.id===b||F&&(G==null?void 0:G.has(I.id)))&&J<ie)return;const ce=I.label,xe=Math.max(10,13/Math.max(J,.7));Z.font=`${xe}px -apple-system, BlinkMacSystemFont, 'Visby CF', sans-serif`,Z.textAlign="center",Z.textBaseline="top";const Ve=RR(I,H),We=(I.y??0)+Ve+3,et=U(I.id);g?Z.fillStyle=et?"rgba(200, 210, 225, 0.3)":"rgba(235, 240, 250, 0.95)":Z.fillStyle=et?"rgba(60, 65, 80, 0.3)":"rgba(20, 24, 36, 0.92)",Z.fillText(ce,I.x??0,We)}}),e&&L.nodes.length>0&&w.w>0&&o.display.view==="3d"&&a.jsx(B.Suspense,{fallback:a.jsx("div",{className:"brain-loading",children:"Loading 3D engine…"}),children:a.jsx($pe,{graphData:L,width:w.w,height:w.h,isDark:g,nodeColor:X,nodeVal:fe,linkColor:ee,linkWidth:le,showArrows:o.display.arrows,forces:z,nodeSizeScale:H,isDimmed:U,neighborsById:O,onNodeClick:W,onNodeHover:I=>k(I?I.id:null),onBackgroundClick:()=>{x(null),k(null)}})}),a.jsx(Fpe,{node:P,onClose:()=>x(null),onSelectRelated:I=>x(I),relatedNodes:$,inDegree:P?K.get(P.id)??0:0,totalDegree:P?D.get(P.id)??0:0,onNavigate:r})]})]})}function Upe(r,e){const i=r.replace("#",""),n=parseInt(i,16),s=n>>16&255,o=n>>8&255,h=n&255;return`rgba(${s}, ${o}, ${h}, ${e})`}function Wpe(){return Yt({queryKey:["council"],queryFn:()=>De.get("/council"),select:r=>r.debates})}function Gpe(r){return Yt({queryKey:["council",r],queryFn:()=>De.get(`/council/${r}`),select:e=>e.debate,enabled:!!r})}function E$(r){if(!r)return null;const e=r.split(`
514
514
  `)[0].trim();if(!e)return null;const n=e.replace(/^(recommend(?:ed|ing)?|i\s+(?:would\s+)?recommend|proposal|my\s+position|conclusion|verdict)\s*[:\-—]?\s*/i,"").replace(/\.$/,"").split(/\s+/).slice(0,3).join(" ");return(n.length>18?n.slice(0,17).trimEnd()+"…":n).toUpperCase()}function Kpe(r){if(!r)return"other";const e=r.toLowerCase();return/\b(go\b|ship|launch|proceed|approve|yes|adopt|migrate\b)/.test(e)?"go":/\b(defer|postpone|delay|wait|later|q[2-9]|next\s+(?:quarter|year))/.test(e)?"defer":/\b(no-go|no\b|reject|abandon|stop|cancel|block)/.test(e)?"hold":/\b(pivot|phased|poc|proof.?of.?concept|pilot|partial|subset|scope\s+down)/.test(e)?"pivot":"other"}function N$(r,e){return r.rounds.find(i=>i.round===e)??null}function j$(r){if(!r.reactions)return 0;const e=(r.reactions.match(/\*\*[a-z][a-z0-9-]+\*\*/g)??[]).length;return e>0?e:(r.reactions.match(/^####\s+/gm)??[]).length}function Vpe(r,e){if(!r.reactions)return[];const i=new Set(e),n=[],s=/\*\*([a-z][a-z0-9-]+)\*\*/g;let o;for(;(o=s.exec(r.reactions))!==null;)i.has(o[1])&&!n.includes(o[1])&&n.push(o[1]);return n}function Ype(r){return r.openQuestions?(r.openQuestions.match(/^\s*[-*\d]/gm)??[]).length:0}function Xpe(r){const e=r.frontmatter.rounds_planned||r.personas.reduce((h,l)=>Math.max(h,...l.rounds.map(u=>u.round),0),0),i=r.personas.length,n=r.personas.reduce((h,l)=>h+l.rounds.reduce((u,d)=>u+j$(d),0),0);let s=0,o=0;if(r.finalReport){const h=r.finalReport.content,l=h.match(/##\s+Open\s+risks\s*\n([\s\S]*?)(?=^##\s+|\Z)/im);l&&(s=(l[1].match(/^\s*[-*]/gm)??[]).length);const u=h.match(/##\s+Minority\s+views\s*\n([\s\S]*?)(?=^##\s+|\Z)/im);if(u){const d=u[1].trim();d.length>0&&!/\(none\)|n\/?a/i.test(d)&&(o=Math.max(1,(d.match(/^\s*[-*]/gm)??[]).length))}}return{rounds:e,personas:i,pushbacks:n,openRisks:s,minorityViews:o}}function Zpe(r){let e=0;for(let i=0;i<r.length;i++)e=e*31+r.charCodeAt(i)>>>0;return e%360}const BR=["◈","◉","◎","◆","◇","✦","✧","❖","⬡","⬢","▲","▼","●","■","◐","◑","◒","◓"];function Qpe(r){let e=0;for(let i=0;i<r.length;i++)e=e*31+r.charCodeAt(i)>>>0;return BR[e%BR.length]}function Jpe(r){const e=(r||"").toLowerCase();return e.includes("opus")?245:e.includes("sonnet")?195:e.includes("haiku")?160:280}function ege(r){const e={verdict:"",appendix:null,sections:[]},i=/^##\s+(.+?)\s*\n([\s\S]*?)(?=^##\s+|\Z)/gim;let n;for(;(n=i.exec(r))!==null;){const s=n[1].trim(),o=n[2].trim();if(!e.verdict&&/^verdict\b/i.test(s)){e.verdict=o;continue}if(/^appendix\b/i.test(s)){e.appendix||(e.appendix={heading:s,body:o});continue}e.sections.push({heading:s,body:o})}return e}function rp({slug:r,size:e=36,title:i,onClick:n}){const s=Zpe(r),o=`linear-gradient(135deg, hsl(${s} 72% 52%), hsl(${(s+36)%360} 72% 44%))`,h=Qpe(r);return a.jsx("span",{className:"council-avatar",onClick:n,title:i??r,style:{width:e,height:e,fontSize:e*.45,background:o,cursor:n?"pointer":"default"},"aria-label":r,children:h})}const MC=122,LC=48,A$=[{id:"p1",x:189,y:36,title:"Architect",sub:"systems",delay:0},{id:"p2",x:322,y:113,title:"Pragmatist",sub:"shipping",delay:.2},{id:"p3",x:322,y:267,title:"Skeptic",sub:"risk",delay:.4},{id:"p4",x:189,y:344,title:"Researcher",sub:"evidence",delay:.6},{id:"p5",x:56,y:267,title:"Advocate",sub:"the user",delay:.8},{id:"p6",x:56,y:113,title:"Strategist",sub:"long game",delay:1}],Zk={};for(const r of A$)Zk[r.id]={cx:r.x+MC/2,cy:r.y+LC/2,w:MC,h:LC};Zk.syn={cx:566,cy:214,w:132,h:96};const tge=_$(Zk),RC=(r,e,i=.1)=>tge(r,e,i),rge=[["p1","p4"],["p5","p1"],["p1","p3"],["p2","p5"],["p2","p6"],["p3","p6"],["p4","p2"],["p4","p6"],["p5","p3"]],ige=rge.map(([r,e],i)=>({id:`${r}-${e}`,d:RC(r,e),arrow:!0,thin:!0,dur:2.5+i%3*.25,delay:i*.27%2.5})),M$={viewBox:"0 0 700 412",ariaLabel:"A council of six persona sub-agents reads each other’s reasoning across the table, round after round, then the resolved debate converges into a synthesizer that writes one decision report.",nodes:[...A$.map(r=>({id:r.id,x:r.x,y:r.y,w:MC,h:LC,title:r.title,sub:r.sub,variant:"region",breathe:!0,breatheDelay:r.delay})),{id:"syn",x:500,y:166,w:132,h:96,title:"synthesizer",sub:"decision report",variant:"rem"}],edges:[...ige,{id:"rounds",d:"M 250 214 L 250 214",comet:!1,label:{text:"↻ rounds",x:250,y:214}},{id:"p2-syn",d:RC("p2","syn"),arrow:!0,dur:2.4,delay:.5},{id:"p3-syn",d:RC("p3","syn"),arrow:!0,dur:2.4,delay:1}]},L$="dreamcontext.dashboard.councilShowcaseDismissed";function nge(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(L$)==="1"}catch{return!1}}function sge(){return a.jsxs("div",{className:"council-stage",children:[a.jsx("span",{className:"council-stage-tag",children:"Agents · Lab"}),a.jsx(kc,{spec:M$,className:"council-stage-flow"})]})}function age(){const[r,e]=B.useState(nge);if(r)return null;const i=()=>{e(!0);try{window.localStorage.setItem(L$,"1")}catch{}};return a.jsxs("div",{className:"council-banner",children:[a.jsxs("div",{className:"council-banner-text",children:[a.jsx("p",{className:"council-intro-kicker",children:"How Council works"}),a.jsx("p",{className:"council-banner-body",children:"A panel of persona sub-agents debates your decision across rounds, sees each other’s reasoning, then a synthesizer writes one traceable verdict."})]}),a.jsx("div",{className:"council-banner-flow",children:a.jsx(kc,{spec:M$,size:"mini"})}),a.jsx("button",{type:"button",className:"council-banner-close",onClick:i,"aria-label":"Hide explainer",title:"Hide explainer",children:"✕"})]})}function oge({onNew:r}){return a.jsxs("div",{className:"council-intro",children:[a.jsx("div",{className:"council-intro-mark",children:a.jsx(cb,{size:40,glow:!0})}),a.jsx("p",{className:"council-intro-kicker",children:"Lab · Council"}),a.jsxs("h2",{className:"council-intro-title",children:["Put your hardest decisions to a ",a.jsx("span",{children:"council"}),"."]}),a.jsx("p",{className:"council-intro-lead",children:"When one perspective isn’t enough, Council convenes a panel of AI personas to debate the question across rounds, expose each other’s reasoning, and synthesize a verdict you can trace back to who argued what."}),a.jsx(sge,{}),a.jsxs("button",{type:"button",className:"council-new-btn council-intro-cta",onClick:r,children:[a.jsx("span",{"aria-hidden":!0,children:"+"})," Start your first debate"]}),a.jsx("p",{className:"council-intro-foot",children:"Council is experimental. Debates are convened from Claude today — this page is where you read them back."})]})}const lge=[{value:"all",label:"All"},{value:"in_progress",label:"In progress"},{value:"synthesizing",label:"Synthesizing"},{value:"complete",label:"Complete"},{value:"promoted",label:"Promoted"}];function cge(r,e,i){var s;if(i!=="all"&&(i==="in_progress"&&!r.status.endsWith("_running")||i==="synthesizing"&&r.status!=="synthesizing"||i==="complete"&&r.status!=="complete"||i==="promoted"&&!r.promoted_to_knowledge))return!1;if(!e.trim())return!0;const n=e.trim().toLowerCase();return!!((r.topic||"").toLowerCase().includes(n)||r.id.toLowerCase().includes(n)||(s=r.personaSlugs)!=null&&s.some(o=>o.toLowerCase().includes(n)))}function hge(r){return r==="complete"?"council-hall-status--complete":r==="synthesizing"?"council-hall-status--synth":r.endsWith("_running")?"council-hall-status--running":"council-hall-status--pending"}function uge(r){return r==="complete"?"Complete":r==="synthesizing"?"Synthesizing":r.endsWith("_running")?"In progress":"Pending"}function dge({debates:r,onOpen:e,onNew:i}){const{t:n}=wr(),[s,o]=B.useState(""),[h,l]=B.useState("all"),u=B.useMemo(()=>r.filter(d=>cge(d,s,h)),[r,s,h]);return r.length===0?a.jsx(oge,{onNew:i}):a.jsxs("div",{className:"council-hall",children:[a.jsx(age,{}),a.jsxs("div",{className:"council-hall-bar",children:[a.jsxs("label",{className:"council-hall-search",children:[a.jsx("span",{"aria-hidden":!0,children:"🔍"}),a.jsx("input",{type:"search",value:s,onChange:d=>o(d.target.value),placeholder:n("council.search.placeholder")})]}),a.jsx("select",{className:"council-hall-filter",value:h,onChange:d=>l(d.target.value),"aria-label":n("council.filter.status"),children:lge.map(d=>a.jsx("option",{value:d.value,children:d.label},d.value))}),a.jsxs("span",{className:"council-hall-count",children:[u.length," / ",r.length]}),a.jsxs("button",{type:"button",className:"council-new-btn",onClick:i,children:[a.jsx("span",{"aria-hidden":!0,children:"+"})," ",n("council.new")]})]}),u.length===0?a.jsx("div",{className:"council-empty",children:a.jsx("p",{className:"council-empty-msg",children:n("council.empty.nomatch")})}):a.jsx("div",{className:"council-hall-grid",children:u.map(d=>a.jsxs("button",{type:"button",className:"council-hall-card",onClick:()=>e(d.id),children:[a.jsxs("div",{className:"council-hall-card-head",children:[a.jsxs("span",{className:`council-hall-status ${hge(d.status)}`,children:[a.jsx("span",{className:"council-hall-status-dot"}),uge(d.status)]}),a.jsxs("span",{className:"council-hall-rounds",children:["R",d.current_round,"/",d.rounds_planned]})]}),a.jsx("h3",{className:"council-hall-topic",children:d.topic||d.id}),a.jsxs("div",{className:"council-hall-foot",children:[d.personaSlugs&&d.personaSlugs.length>0&&a.jsxs("div",{className:"council-hall-avatars","aria-label":`${d.personaSlugs.length} personas`,children:[d.personaSlugs.slice(0,6).map((g,f)=>a.jsx("span",{className:"council-hall-avatar-wrap",style:{zIndex:10-f},children:a.jsx(rp,{slug:g,size:20})},g)),d.personaSlugs.length>6&&a.jsxs("span",{className:"council-hall-avatar-more",children:["+",d.personaSlugs.length-6]})]}),a.jsx("span",{className:"council-hall-date",children:d.updated_at||d.created_at}),d.promoted_to_knowledge&&a.jsx("span",{className:"council-hall-promoted",title:"Promoted to knowledge",children:"📜"})]})]},d.id))})]})}function fge(r){var e,i;if(r==="complete")return{label:"Complete",tone:"complete"};if(r==="synthesizing")return{label:"Synthesizing",tone:"synth"};if(/_running$/.test(r)){const n=(e=r.match(/^round_(\d+)_running$/))==null?void 0:e[1];return{label:n?`Round ${n} running`:"Running",tone:"running"}}if(/_complete$/.test(r)){const n=(i=r.match(/^round_(\d+)_complete$/))==null?void 0:i[1];return{label:n?`Round ${n} done`:"Round done",tone:"pending"}}return r==="created"?{label:"Created",tone:"pending"}:{label:r,tone:"pending"}}function pge({status:r,size:e="md"}){const{label:i,tone:n}=fge(r);return a.jsxs("span",{className:`council-status council-status--${n} council-status--${e}`,children:[a.jsx("span",{className:"council-status-dot"}),i]})}function Fd({value:r,label:e,tone:i="default"}){return a.jsxs("div",{className:`council-stat-tile council-stat-tile--${i}`,children:[a.jsx("div",{className:"council-stat-value",children:r}),a.jsx("div",{className:"council-stat-label",children:e})]})}function gge({debate:r,onCiteJump:e,onAgentJump:i}){const{t:n}=wr(),s=B.useMemo(()=>Xpe(r),[r]),o=r.finalReport?ege(r.finalReport.content):null,h=r.personas.map(u=>u.slug),l=u=>{const d=u.toLowerCase();return/\b(risk|danger|warning|caveat)/.test(d)?"council-ov-card--risks":/\b(minority|dissent|objection)/.test(d)?"council-ov-card--minority":/^why\b/.test(d)?"council-ov-card--why":""};return a.jsxs("div",{className:"council-ov",children:[a.jsxs("section",{className:"council-ov-problem",children:[a.jsx("div",{className:"council-ov-label",children:"Problem"}),a.jsx("h2",{className:"council-ov-topic",children:r.frontmatter.topic||r.frontmatter.id}),r.frontmatter.promoted_to_knowledge&&a.jsxs("div",{className:"council-ov-promoted",children:[a.jsx("span",{children:"📜"}),a.jsxs("span",{children:["Promoted to knowledge: ",a.jsx("code",{children:r.frontmatter.promoted_to_knowledge})]})]})]}),!o&&a.jsxs("section",{className:"council-ov-pending",children:[a.jsx("div",{className:"council-ov-label",children:n("council.verdict.awaitingSynthesis")}),a.jsx("p",{children:n("council.verdict.synthPending")}),r.roundLog&&a.jsxs("div",{className:"council-roundlog",children:[a.jsx("h4",{children:"Round log"}),a.jsx("div",{className:"council-sheet-prose",dangerouslySetInnerHTML:{__html:or.parse(r.roundLog)}})]})]}),o&&a.jsxs(a.Fragment,{children:[a.jsxs("section",{className:"council-ov-verdict",children:[a.jsx("div",{className:"council-ov-label",children:"Verdict"}),a.jsx("div",{className:"council-ov-verdict-text",dangerouslySetInnerHTML:{__html:or.parse(o.verdict||"*No verdict section found.*")}})]}),a.jsxs("div",{className:"council-ov-stats",children:[a.jsx(Fd,{value:s.rounds,label:"rounds"}),a.jsx(Fd,{value:s.personas,label:"personas"}),a.jsx(Fd,{value:s.pushbacks,label:"pushbacks"}),a.jsx(Fd,{value:s.openRisks,label:"open risks",tone:"warning"}),a.jsx(Fd,{value:s.minorityViews,label:"dissent",tone:"dissent"})]}),o.sections.length>0&&a.jsx("div",{className:"council-ov-sections",children:o.sections.map(u=>a.jsxs("section",{className:`council-ov-card ${l(u.heading)}`,children:[a.jsx("h3",{children:u.heading}),a.jsx(mge,{text:u.body,knownSlugs:h,onCiteJump:e,onAgentJump:i})]},u.heading))}),o.appendix&&a.jsxs("details",{className:"council-ov-appendix",children:[a.jsx("summary",{children:o.appendix.heading}),a.jsx("div",{className:"council-sheet-prose",dangerouslySetInnerHTML:{__html:or.parse(o.appendix.body)}})]})]})]})}function mge({text:r,knownSlugs:e,onCiteJump:i,onAgentJump:n}){const s=[],o=new Set(e);let h=r.replace(/([a-z][a-z0-9-]+)\s+in\s+R(\d+)/g,(m,y,w)=>{if(!o.has(y))return m;const _=s.length;return s.push({slug:y,round:Number(w)}),`\0CITE${_}\0`});const l=[];h=h.replace(/\*\*([a-z][a-z0-9-]+)\*\*/g,(m,y)=>{if(!o.has(y))return m;const w=l.length;return l.push(y),`\0AGENT${w}\0`});const d=or.parse(h).split(/\u0000(CITE|AGENT)(\d+)\u0000/),g=[];let f=0;for(;f<d.length;){const m=d[f];if(f+2<d.length&&(d[f+1]==="CITE"||d[f+1]==="AGENT")){g.push(a.jsx("span",{dangerouslySetInnerHTML:{__html:m}},`h-${f}`));const y=d[f+1],w=Number(d[f+2]);if(y==="CITE"){const _=s[w];g.push(a.jsxs("button",{type:"button",className:"council-cite-chip",onClick:()=>i(_.slug,_.round),children:[a.jsx(rp,{slug:_.slug,size:14}),a.jsx("span",{children:_.slug}),a.jsxs("span",{className:"council-cite-round",children:["R",_.round]})]},`c-${f}`))}else{const _=l[w];g.push(a.jsx("button",{type:"button",className:"council-inline-slug",onClick:()=>n(_),children:_},`a-${f}`))}f+=3}else g.push(a.jsx("span",{dangerouslySetInnerHTML:{__html:m}},`h-${f}`)),f+=1}return a.jsx("div",{className:"council-sheet-prose council-citation-prose",children:g})}function R$({model:r}){const e=Jpe(r),i=r?r.charAt(0).toUpperCase()+r.slice(1):"unknown";return a.jsx("span",{className:"council-model-badge",style:{background:`hsl(${e} 85% 55% / 0.14)`,color:`hsl(${e} 85% 40%)`,borderColor:`hsl(${e} 85% 55% / 0.35)`},title:`Model: ${i}`,children:i})}function yge(r,e){if(!e.trim())return!0;const i=e.trim().toLowerCase();if(r.slug.toLowerCase().includes(i))return!0;for(const n of r.rounds)if([n.executiveSummary,n.position,n.reasoning,n.reactions,n.openQuestions].filter(Boolean).join(`
515
515
  `).toLowerCase().includes(i))return!0;return!1}function Qk(r,e){if(!e.trim())return r;const n=e.trim().replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return r.replace(new RegExp(`(${n})`,"gi"),"<mark>$1</mark>")}function bge({debate:r,focusSlug:e}){const{t:i}=wr(),[n,s]=B.useState(""),[o,h]=B.useState(()=>new Set),l=B.useRef(null),u=B.useMemo(()=>r.personas.filter(g=>yge(g,n)),[r.personas,n]);B.useEffect(()=>{if(!e)return;h(f=>{const m=new Set(f);return m.delete(e),m});const g=setTimeout(()=>{var m;const f=(m=l.current)==null?void 0:m.querySelector(`[data-agent="${e}"]`);f==null||f.scrollIntoView({behavior:"smooth",block:"start"})},30);return()=>clearTimeout(g)},[e]);const d=g=>{h(f=>{const m=new Set(f);return m.has(g)?m.delete(g):m.add(g),m})};return a.jsxs("div",{className:"council-transcript",ref:l,children:[a.jsxs("div",{className:"council-transcript-searchbar",children:[a.jsxs("label",{className:"council-transcript-search",children:[a.jsx("span",{"aria-hidden":!0,children:"🔍"}),a.jsx("input",{type:"search",value:n,onChange:g=>s(g.target.value),placeholder:i("council.search.transcript")})]}),a.jsxs("span",{className:"council-transcript-count",children:[u.length," of ",r.personas.length," persona",r.personas.length===1?"":"s"]})]}),a.jsxs("div",{className:"council-transcript-body",children:[u.length===0&&a.jsx("div",{className:"council-empty",children:"No personas match this search."}),u.map(g=>a.jsx(vge,{persona:g,query:n,collapsed:o.has(g.slug),highlighted:e===g.slug,onToggle:()=>d(g.slug)},g.slug))]})]})}function vge({persona:r,query:e,collapsed:i,highlighted:n,onToggle:s}){return a.jsxs("article",{className:`council-transcript-block ${n?"is-highlighted":""}`,"data-agent":r.slug,children:[a.jsxs("header",{className:"council-transcript-block-head",onClick:s,children:[a.jsxs("div",{className:"council-transcript-block-title",children:[a.jsx(rp,{slug:r.slug,size:24}),a.jsxs("div",{children:[a.jsx("h3",{className:"council-transcript-block-name",children:r.slug}),a.jsxs("div",{className:"council-transcript-block-meta",children:[a.jsx(R$,{model:r.frontmatter.model}),r.frontmatter.aspects.slice(0,4).map(o=>a.jsx("span",{className:"council-aspect",children:o},o))]})]})]}),a.jsx("span",{className:`council-transcript-chev ${i?"":"is-open"}`,"aria-hidden":!0,children:"▸"})]}),!i&&a.jsxs("div",{className:"council-transcript-block-body",children:[r.persona&&a.jsxs("section",{className:"council-sheet-section",children:[a.jsx("h4",{children:"Persona prompt"}),a.jsx("div",{className:"council-sheet-prose",dangerouslySetInnerHTML:{__html:Qk(or.parse(r.persona),e)}})]}),r.rounds.length===0&&a.jsx("div",{className:"council-sheet-empty",children:"No rounds submitted."}),r.rounds.slice().sort((o,h)=>h.round-o.round).map(o=>a.jsx(xge,{round:o,crossContext:r.crossContext[o.round]??null,query:e},o.round)),r.researches.length>0&&a.jsxs("section",{className:"council-sheet-section",children:[a.jsx("h4",{children:"Research notes"}),a.jsx("ul",{className:"council-research-list",children:r.researches.map(o=>a.jsxs("li",{children:[a.jsx("span",{className:"council-research-topic",children:o.topic}),a.jsx("span",{className:"council-research-date",children:o.added_at})]},o.slug))})]})]})]})}function xge({round:r,crossContext:e,query:i}){const n=E$(r.position);return a.jsxs("section",{className:"council-round-panel",children:[a.jsxs("header",{className:"council-round-panel-head",children:[a.jsxs("h4",{className:"council-round-panel-title",children:["Round ",r.round]}),n&&a.jsx("span",{className:"council-chip-pos",children:n})]}),e&&a.jsxs("blockquote",{className:"council-crosscontext",children:[a.jsx("strong",{children:"Cross-context loaded"}),a.jsx("div",{className:"council-sheet-prose",dangerouslySetInnerHTML:{__html:Qk(or.parse(e),i)}})]}),r.executiveSummary&&a.jsx($d,{title:"Executive summary",body:r.executiveSummary,query:i}),r.position&&a.jsx($d,{title:"Position",body:r.position,query:i}),r.reasoning&&a.jsx($d,{title:"Reasoning",body:r.reasoning,query:i}),r.reactions&&a.jsx($d,{title:"Reactions to peers",body:r.reactions,query:i}),r.openQuestions&&a.jsx($d,{title:"Open questions",body:r.openQuestions,query:i})]})}function $d({title:r,body:e,query:i}){const n=Qk(or.parse(e),i);return a.jsxs("div",{className:"council-round-sub",children:[a.jsx("h5",{className:"council-round-sub-title",children:r}),a.jsx("div",{className:"council-sheet-prose",dangerouslySetInnerHTML:{__html:n}})]})}function B$(r,e){return e.trim()?r?[r.executiveSummary,r.position,r.reasoning].filter(Boolean).join(`
516
- `).toLowerCase().includes(e.trim().toLowerCase()):!1:!0}function _ge({debate:r,query:e,onQueryChange:i,selected:n,onSelectCell:s,onClearSelection:o}){const h=B.useRef(null),l=B.useMemo(()=>Array.from({length:Math.max(1,r.frontmatter.rounds_planned)},(g,f)=>f+1),[r.frontmatter.rounds_planned]),u=B.useMemo(()=>r.personas.map(g=>g.slug),[r.personas]),d=B.useMemo(()=>{if(!e.trim())return null;let g=0;for(const f of r.personas)for(const m of l)B$(N$(f,m),e)&&g++;return g},[e,r,l]);return B.useEffect(()=>{if(!n)return;const g=f=>{const m=f.target;if(m&&["INPUT","TEXTAREA"].includes(m.tagName))return;if(f.key==="Escape"){o();return}const y=r.personas.findIndex(_=>_.slug===n.slug);if(y===-1)return;const w=r.frontmatter.rounds_planned;f.key==="ArrowRight"&&n.round<w?(f.preventDefault(),s(n.slug,n.round+1)):f.key==="ArrowLeft"&&n.round>1?(f.preventDefault(),s(n.slug,n.round-1)):f.key==="ArrowDown"&&y<r.personas.length-1?(f.preventDefault(),s(r.personas[y+1].slug,n.round)):f.key==="ArrowUp"&&y>0&&(f.preventDefault(),s(r.personas[y-1].slug,n.round))};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[n,r,o,s]),B.useEffect(()=>{if(!n||!h.current)return;const g=h.current.querySelector(`[data-persona="${n.slug}"][data-round="${n.round}"]`);g==null||g.scrollIntoView({behavior:"smooth",block:"center"})},[n]),a.jsxs("div",{className:"council-matrix",children:[a.jsxs("div",{className:"council-matrix-bar",children:[a.jsxs("label",{className:"council-matrix-search-input",children:[a.jsx("span",{className:"council-matrix-search-icon","aria-hidden":!0,children:"🔍"}),a.jsx("input",{type:"search",value:e,onChange:g=>i(g.target.value),placeholder:"Filter cells by text…"}),e&&a.jsx("button",{type:"button",className:"council-matrix-search-clear",onClick:()=>i(""),children:"×"})]}),d!=null&&a.jsxs("span",{className:"council-matrix-count",children:[d," match",d===1?"":"es"]})]}),a.jsx("div",{className:"council-matrix-scroll",ref:h,children:a.jsxs("div",{className:"council-matrix-grid",style:{gridTemplateColumns:`180px repeat(${l.length}, minmax(220px, 1fr))`},children:[a.jsx("div",{className:"council-matrix-corner","aria-hidden":!0}),l.map(g=>{const f=r.frontmatter.status===`round_${g}_running`,m=r.frontmatter.current_round>=g&&!f;return a.jsxs("div",{className:`council-round-head ${f?"is-running":""} ${m?"is-done":""}`,children:["Round ",g]},`h-${g}`)}),r.personas.map(g=>a.jsx(Cge,{persona:g,rounds:l,debate:r,query:e,selected:n,knownSlugs:u,onSelectCell:s},g.slug))]})})]})}function Cge({persona:r,rounds:e,debate:i,query:n,selected:s,knownSlugs:o,onSelectCell:h}){return a.jsxs(a.Fragment,{children:[a.jsxs("aside",{className:"council-matrix-row-head",children:[a.jsx(rp,{slug:r.slug,size:22}),a.jsxs("div",{className:"council-matrix-row-id",children:[a.jsx("div",{className:"council-matrix-row-name",children:r.slug}),a.jsx(R$,{model:r.frontmatter.model})]})]}),e.map(l=>{const u=N$(r,l),d=i.frontmatter.status===`round_${l}_running`,g=!!s&&s.slug===r.slug&&s.round===l,f=B$(u,n),m=!!n.trim()&&!f;return a.jsx(wge,{personaSlug:r.slug,round:l,data:u,isRunning:d,active:g,dimmed:m,knownSlugs:o,onSelect:h},l)})]})}function wge({personaSlug:r,round:e,data:i,isRunning:n,active:s,dimmed:o,knownSlugs:h,onSelect:l}){if(!i)return a.jsx("div",{className:`council-cell council-cell--empty ${n?"council-cell--pending":""} ${o?"is-dimmed":""}`,"data-persona":r,"data-round":e,children:a.jsx("span",{className:"council-cell-empty-label",children:n?"awaiting…":"— silent —"})});const u=E$(i.position),d=Kpe(i.position),g=j$(i),f=Ype(i),m=Vpe(i,h);return a.jsxs("button",{type:"button",className:`council-cell council-cell--${d} ${s?"is-active":""} ${o?"is-dimmed":""}`,"data-persona":r,"data-round":e,onClick:()=>l(r,e),children:[a.jsxs("div",{className:"council-cell-top",children:[u&&a.jsx("span",{className:`council-chip-pos council-chip-pos--${d}`,children:u}),(g>0||f>0)&&a.jsxs("span",{className:"council-cell-meta",children:[g>0&&a.jsxs(a.Fragment,{children:["↯ ",g]}),g>0&&f>0&&a.jsx("span",{children:" · "}),f>0&&a.jsxs(a.Fragment,{children:["? ",f]})]})]}),!s&&i.executiveSummary&&a.jsx("p",{className:"council-cell-exec",children:i.executiveSummary}),s&&a.jsxs("div",{className:"council-cell-full",children:[i.executiveSummary&&a.jsx(Pd,{title:"Executive summary",children:a.jsx("p",{children:i.executiveSummary})}),i.position&&a.jsx(Pd,{title:"Position",children:a.jsx("div",{dangerouslySetInnerHTML:{__html:or.parse(i.position)}})}),i.reasoning&&a.jsx(Pd,{title:"Reasoning",children:a.jsx("div",{dangerouslySetInnerHTML:{__html:or.parse(i.reasoning)}})}),i.reactions&&a.jsxs(Pd,{title:"Reactions to peers",children:[a.jsx("div",{dangerouslySetInnerHTML:{__html:or.parse(i.reactions)}}),m.length>0&&a.jsx("div",{className:"council-cell-react-chips",children:m.map(y=>a.jsxs("span",{className:"council-cell-react-chip",children:[a.jsx(rp,{slug:y,size:14}),a.jsx("span",{children:y})]},y))})]}),i.openQuestions&&a.jsx(Pd,{title:"Open questions",children:a.jsx("div",{dangerouslySetInnerHTML:{__html:or.parse(i.openQuestions)}})})]})]})}function Pd({title:r,children:e}){return a.jsxs("section",{className:"council-cell-sub",children:[a.jsx("h5",{children:r}),a.jsx("div",{className:"council-cell-sub-body",children:e})]})}function OR(r){return r==="complete"||r==="synthesizing"?"overview":"matrix"}function kge({debate:r,onBack:e}){const{t:i}=wr(),[n,s]=B.useState(()=>OR(r.frontmatter.status)),[o,h]=B.useState(""),[l,u]=B.useState(null),[d,g]=B.useState(null);B.useEffect(()=>{s(OR(r.frontmatter.status)),h(""),u(null),g(null)},[r.frontmatter.id]);const f=(w,_)=>{s("matrix"),u({slug:w,round:_})},m=w=>{s("agents"),g(w)},y=()=>{var w;return(w=navigator.clipboard)==null?void 0:w.writeText(r.frontmatter.id).catch(()=>{})};return a.jsxs("div",{className:"council-detail",children:[a.jsxs("header",{className:"council-detail-head",children:[a.jsxs("button",{type:"button",className:"council-detail-back",onClick:e,children:["← ",i("council.title")]}),a.jsxs("div",{className:"council-detail-meta",children:[a.jsx(pge,{status:r.frontmatter.status}),a.jsxs("span",{className:"council-detail-rounds",children:["R",r.frontmatter.current_round,"/",r.frontmatter.rounds_planned]}),a.jsx("span",{className:"council-session-dot",children:"·"}),a.jsx("span",{className:"council-detail-date",children:r.frontmatter.created_at}),a.jsx("span",{className:"council-session-dot",children:"·"}),a.jsx("button",{type:"button",className:"council-session-id",onClick:y,title:"Copy debate id",children:r.frontmatter.id})]})]}),a.jsxs("nav",{className:"council-tabs",role:"tablist",children:[a.jsx(k_,{active:n==="overview",onClick:()=>s("overview"),label:"Overview"}),a.jsx(k_,{active:n==="agents",onClick:()=>s("agents"),label:"Agents"}),a.jsx(k_,{active:n==="matrix",onClick:()=>s("matrix"),label:"Matrix"})]}),a.jsxs("div",{className:"council-detail-body",children:[n==="overview"&&a.jsx(gge,{debate:r,onCiteJump:f,onAgentJump:m}),n==="agents"&&a.jsx(bge,{debate:r,focusSlug:d}),n==="matrix"&&a.jsx(_ge,{debate:r,query:o,onQueryChange:h,selected:l,onSelectCell:(w,_)=>u({slug:w,round:_}),onClearSelection:()=>u(null)})]})]})}function k_({active:r,onClick:e,label:i}){return a.jsx("button",{type:"button",role:"tab","aria-selected":r,className:`council-tab ${r?"is-active":""}`,onClick:e,children:i})}const DR="/council";function Sge({onClose:r}){const[e,i]=B.useState(!1);B.useEffect(()=>{const s=o=>{o.key==="Escape"&&r()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[r]);const n=()=>{var s;(s=navigator.clipboard)==null||s.writeText(DR).then(()=>{i(!0),window.setTimeout(()=>i(!1),1600)}).catch(()=>{})};return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"council-modal-scrim",onClick:r}),a.jsxs("div",{className:"council-modal",role:"dialog","aria-modal":"true","aria-label":"Start a new debate",children:[a.jsxs("header",{className:"council-modal-head",children:[a.jsxs("h2",{className:"council-modal-title",children:["Start a debate",a.jsx("span",{className:"council-lab-badge",children:"Lab"})]}),a.jsx("button",{type:"button",className:"council-modal-close",onClick:r,"aria-label":"Close",children:"✕"})]}),a.jsx("p",{className:"council-modal-lede",children:"Council convenes a panel of AI personas to debate a hard decision across several rounds, exposes each one to the others' reasoning, then synthesizes a final verdict you can trace back to who argued what."}),a.jsxs("div",{className:"council-modal-soon",children:[a.jsx("span",{className:"council-modal-soon-tag",children:"Coming soon"}),a.jsxs("p",{children:["Soon this button will open ",a.jsx("strong",{children:"Sleepy"})," pre-filled with a debate prompt so you can convene a council without leaving the dashboard. That flow isn't wired up yet."]})]}),a.jsxs("div",{className:"council-modal-now",children:[a.jsx("span",{className:"council-ov-label",children:"Right now"}),a.jsx("p",{className:"council-modal-now-body",children:"Open Claude in your project and run the Council skill:"}),a.jsxs("div",{className:"council-modal-cmd",children:[a.jsx("code",{children:DR}),a.jsx("button",{type:"button",className:"council-modal-cmd-copy",onClick:n,children:e?"Copied":"Copy"})]}),a.jsxs("p",{className:"council-modal-hint",children:["Tip: phrases like ",a.jsx("em",{children:'"debate this"'})," or ",a.jsx("em",{children:'"help me decide"'})," also prompt Council automatically. Finished debates show up here, where you can read every round, the agent matrix, and the final report."]})]}),a.jsx("footer",{className:"council-modal-foot",children:a.jsx("button",{type:"button",className:"council-modal-btn",onClick:r,children:"Got it"})})]})]})}function Tge(){const{t:r}=wr(),{data:e,isLoading:i,isError:n,error:s}=Wpe(),[o,h]=B.useState(null),[l,u]=B.useState(!1),{data:d,isLoading:g}=Gpe(o);return i?a.jsx("div",{className:"loading",children:r("common.loading")}):n?a.jsxs("div",{className:"error-state",children:["Failed to load council sessions. ",s==null?void 0:s.message]}):o?a.jsxs("div",{className:"council-page council-page--detail",children:[g&&a.jsx("div",{className:"loading",children:"Loading session…"}),d&&a.jsx(kge,{debate:d,onBack:()=>h(null)})]}):a.jsxs("div",{className:"council-page",children:[a.jsx(dge,{debates:e??[],onOpen:h,onNew:()=>u(!0)}),l&&a.jsx(Sge,{onClose:()=>u(!1)})]})}function Ege(){return Yt({queryKey:["config"],queryFn:()=>De.get("/config"),select:r=>r.config})}function Nge(){const r=Pt();return Vt({mutationFn:e=>De.patch("/config",e),onSuccess:()=>{r.invalidateQueries({queryKey:["config"]})}})}function jge(){return Yt({queryKey:["vaults"],queryFn:()=>De.get("/vaults")})}function Age(){return Yt({queryKey:["connections"],queryFn:()=>De.get("/connections"),select:r=>r.connections})}function Mge(){const r=Pt();return Vt({mutationFn:e=>De.post("/connections",e),onSuccess:()=>{r.invalidateQueries({queryKey:["connections"]}),r.invalidateQueries({queryKey:["vaults"]}),r.invalidateQueries({queryKey:["launcher-status"]}),r.invalidateQueries({queryKey:["launcher-federation-graph"]})}})}function Lge(){const r=Pt();return Vt({mutationFn:e=>De.del(`/connections/${encodeURIComponent(e)}`),onSuccess:()=>{r.invalidateQueries({queryKey:["connections"]}),r.invalidateQueries({queryKey:["vaults"]}),r.invalidateQueries({queryKey:["launcher-status"]}),r.invalidateQueries({queryKey:["launcher-federation-graph"]})}})}function Rge(){return Yt({queryKey:["federation","inbox"],queryFn:()=>De.get("/federation/inbox")})}function Bge(){return Vt({mutationFn:()=>De.post("/federation/sync",{})})}const IR=["out","in","both"];function Oge({shareable:r,onToggleShareable:e,shareablePending:i}){const{t:n}=wr(),{data:s}=jge(),{data:o}=Age(),h=Mge(),l=Lge(),{data:u}=Rge(),d=Bge(),[g,f]=B.useState(""),[m,y]=B.useState("both"),[w,_]=B.useState(null),b=(s==null?void 0:s.vaults)??[],x=(s==null?void 0:s.current)??null,C=o??[],k=new Set(C.map(E=>E.vault)),T=b.filter(E=>E.name!==x&&!k.has(E.name)),N=()=>{if(_(null),!g){_(n("federation.error.pick_vault"));return}h.mutate({vault:g,direction:m},{onSuccess:()=>{f(""),y("both")},onError:E=>_(E instanceof Error?E.message:String(E))})},A=(E,L)=>{h.mutate({vault:E.vault,direction:L,topics:E.topics})},j=(E,L)=>{const O=L.split(",").map(D=>D.trim()).filter(Boolean);h.mutate({vault:E.vault,direction:E.direction,topics:O.length>0?O:null})};return a.jsxs("section",{className:"settings-section",children:[a.jsxs("div",{className:"fed-head",children:[a.jsx("h2",{className:"settings-section-title",children:n("settings.federation")}),a.jsxs("label",{className:"fed-sharing-toggle settings-checkbox-label",title:n("federation.shareable.hint"),children:[a.jsx("input",{type:"checkbox",className:"settings-checkbox",checked:r,disabled:i,onChange:E=>e(E.target.checked)}),a.jsx("span",{children:n("federation.shareable.label")})]})]}),a.jsx(r5,{variant:"embedded"}),a.jsxs("details",{className:"fed-advanced",children:[a.jsx("summary",{className:"fed-advanced-summary",children:n("federation.advanced")}),a.jsxs("div",{className:"fed-card",children:[a.jsxs("div",{className:"fed-card-head",children:[a.jsx("h3",{className:"fed-card-title",children:n("federation.vaults")}),a.jsx("p",{className:"fed-card-desc",children:n("federation.vaults.desc")})]}),b.length===0?a.jsx("p",{className:"settings-field-hint",children:n("federation.vaults.empty")}):a.jsx("ul",{className:"fed-vault-list",children:b.map(E=>a.jsxs("li",{className:`fed-vault-item${E.name===x?" fed-vault-item--current":""}`,children:[a.jsx("span",{className:"fed-vault-name",children:E.name}),E.name===x&&a.jsx("span",{className:"fed-badge",children:n("federation.current")}),a.jsx("span",{className:"fed-vault-path",children:E.path})]},E.name))})]}),a.jsxs("div",{className:"fed-card",children:[a.jsxs("div",{className:"fed-card-head",children:[a.jsx("h3",{className:"fed-card-title",children:n("federation.connections")}),a.jsx("p",{className:"fed-card-desc",children:n("federation.connections.desc")})]}),C.length===0?a.jsx("p",{className:"settings-field-hint",children:n("federation.connections.empty")}):a.jsx("ul",{className:"fed-conn-list",children:C.map(E=>{var L;return a.jsxs("li",{className:"fed-conn-item",children:[a.jsxs("div",{className:"fed-conn-head",children:[a.jsx("span",{className:"fed-conn-name",children:E.vault}),E.status==="stale"&&a.jsx("span",{className:"fed-badge fed-badge--stale",children:n("federation.stale")}),a.jsx("button",{className:"btn fed-conn-remove",onClick:()=>l.mutate(E.vault),disabled:l.isPending,children:n("federation.remove")})]}),a.jsxs("div",{className:"fed-conn-controls",children:[a.jsx("div",{className:"fed-direction",role:"group","aria-label":n("federation.direction"),children:IR.map(O=>a.jsx("button",{className:`fed-dir-btn${E.direction===O?" fed-dir-btn--active":""}`,onClick:()=>A(E,O),disabled:h.isPending,children:n(`federation.direction.${O}`)},O))}),a.jsx("input",{className:"settings-text-input fed-topics-input",defaultValue:((L=E.topics)==null?void 0:L.join(", "))??"",placeholder:n("federation.topics.placeholder"),onBlur:O=>{const D=O.target.value.split(",").map(z=>z.trim()).filter(Boolean).join(", "),K=(E.topics??[]).join(", ");D!==K&&j(E,O.target.value)}})]}),a.jsx("p",{className:"settings-field-hint fed-dir-hint",children:n(`federation.direction.${E.direction}.hint`)})]},E.vault)})})]}),a.jsxs("div",{className:"fed-card",children:[a.jsxs("div",{className:"fed-card-head",children:[a.jsx("h3",{className:"fed-card-title",children:n("federation.add")}),a.jsx("p",{className:"fed-card-desc",children:n("federation.add.desc")})]}),T.length===0?a.jsx("p",{className:"settings-field-hint",children:n("federation.add.none")}):a.jsxs("div",{className:"fed-add-row",children:[a.jsxs("select",{className:"settings-text-input",value:g,onChange:E=>f(E.target.value),children:[a.jsx("option",{value:"",children:n("federation.add.pick")}),T.map(E=>a.jsx("option",{value:E.name,children:E.name},E.name))]}),a.jsx("div",{className:"fed-direction",role:"group","aria-label":n("federation.direction"),children:IR.map(E=>a.jsx("button",{className:`fed-dir-btn${m===E?" fed-dir-btn--active":""}`,onClick:()=>y(E),children:n(`federation.direction.${E}`)},E))}),a.jsx("button",{className:"btn btn--primary",onClick:N,disabled:h.isPending||!g,children:n("federation.connect")})]}),T.length>0&&a.jsx("p",{className:"settings-field-hint fed-dir-hint",children:n(`federation.direction.${m}.hint`)}),w&&a.jsx("p",{className:"settings-test-err",children:w})]}),a.jsxs("div",{className:"fed-card",children:[a.jsxs("div",{className:"fed-card-head",children:[a.jsx("h3",{className:"fed-card-title",children:n("federation.inbox")}),a.jsx("p",{className:"fed-card-desc",children:n("federation.inbox.desc")})]}),(()=>{const E=(u==null?void 0:u.pending)??[],L=(u==null?void 0:u.consumed)??[],O=(u==null?void 0:u.quarantined)??[];return E.length===0&&L.length===0&&O.length===0?a.jsx("p",{className:"settings-field-hint",children:n("federation.inbox.empty")}):a.jsxs(a.Fragment,{children:[E.length>0&&a.jsxs("div",{className:"fed-inbox-group",children:[a.jsxs("h4",{className:"fed-inbox-group-title",children:[n("federation.inbox.pending")," (",E.length,")"]}),a.jsx("ul",{className:"fed-entry-list",children:E.map(D=>a.jsx(FR,{entry:D,fromLabel:n("federation.inbox.from")},`p-${D.id}`))})]}),L.length>0&&a.jsxs("div",{className:"fed-inbox-group",children:[a.jsxs("h4",{className:"fed-inbox-group-title",children:[n("federation.inbox.consumed")," (",L.length,")"]}),a.jsx("ul",{className:"fed-entry-list fed-entry-list--consumed",children:L.map(D=>a.jsx(FR,{entry:D,fromLabel:n("federation.inbox.from")},`c-${D.id}`))})]}),O.length>0&&a.jsxs("div",{className:"fed-inbox-group",children:[a.jsxs("h4",{className:"fed-inbox-group-title fed-inbox-group-title--warn",children:[n("federation.inbox.quarantined")," (",O.length,")"]}),a.jsx("ul",{className:"fed-entry-list",children:O.map(D=>a.jsxs("li",{className:"fed-entry fed-entry--quarantined",children:[a.jsx("code",{className:"fed-entry-file",children:D.file}),a.jsxs("span",{className:"fed-entry-meta",children:["v",D.version]})]},`q-${D.file}`))})]})]})})()]}),a.jsxs("div",{className:"fed-card",children:[a.jsxs("div",{className:"fed-card-head",children:[a.jsx("h3",{className:"fed-card-title",children:n("federation.preview.title")}),a.jsx("p",{className:"fed-card-desc",children:n("federation.preview.hint")})]}),a.jsx("div",{className:"fed-preview-head",children:a.jsx("button",{className:"btn btn--secondary",onClick:()=>d.mutate(),disabled:d.isPending,children:d.isPending?n("federation.preview.running"):n("federation.preview")})}),d.isError&&a.jsx("p",{className:"settings-test-err",children:d.error instanceof Error?d.error.message:String(d.error)}),d.data&&a.jsx(Dge,{deltas:d.data.deltas,t:n})]})]})]})}function FR({entry:r,fromLabel:e}){return a.jsxs("li",{className:"fed-entry",children:[a.jsxs("div",{className:"fed-entry-head",children:[a.jsx("span",{className:"fed-entry-title",children:r.title}),a.jsx("span",{className:`fed-entry-kind fed-entry-kind--${r.kind}`,children:r.kind})]}),a.jsxs("span",{className:"fed-entry-meta",children:[e," ",a.jsx("strong",{children:r.origin.vault}),r.origin.sourceTimestamp?` · ${r.origin.sourceTimestamp}`:""]})]})}function Dge({deltas:r,t:e}){return r.length===0?a.jsx("p",{className:"settings-field-hint",children:e("federation.preview.none")}):a.jsx("ul",{className:"fed-delta-list",children:r.map(i=>{let n;return i.stale?n=e("federation.preview.stale"):i.consented?i.entries.length===0?n=e("federation.preview.nodelta"):n=`${i.entries.length} ${e("federation.preview.entries")}`:n=e("federation.preview.noconsent"),a.jsxs("li",{className:"fed-delta",children:[a.jsxs("div",{className:"fed-delta-head",children:[a.jsx("span",{className:"fed-delta-vault",children:i.vault}),a.jsx("span",{className:"fed-delta-status",children:n})]}),i.entries.length>0&&a.jsx("ul",{className:"fed-entry-list",children:i.entries.map((s,o)=>a.jsx("li",{className:"fed-entry",children:a.jsxs("div",{className:"fed-entry-head",children:[a.jsx("span",{className:"fed-entry-title",children:s.title}),a.jsx("span",{className:`fed-entry-kind fed-entry-kind--${s.kind}`,children:s.kind})]})},`${i.vault}-${o}`))})]},i.vault)})})}function Ige(r){return Yt({queryKey:["embedding-model-status"],queryFn:()=>De.get("/embeddings/status"),enabled:r,retry:!1,refetchInterval:e=>{var i;return((i=e.state.data)==null?void 0:i.state)==="downloading"?1500:!1}})}function Fge(){const r=Pt();return Vt({mutationFn:()=>De.post("/embeddings/download",{}),onSuccess:e=>r.setQueryData(["embedding-model-status"],e)})}function $ge(r){return Yt({queryKey:["embedding-index-status"],queryFn:()=>De.get("/embeddings/index/status"),enabled:r,retry:!1,refetchInterval:e=>{var i;return((i=e.state.data)==null?void 0:i.state)==="building"?1500:!1}})}function Pge(){const r=Pt();return Vt({mutationFn:()=>De.post("/embeddings/index",{}),onSuccess:e=>r.setQueryData(["embedding-index-status"],e)})}function S_(r){return`${(r/(1024*1024)).toFixed(0)} MB`}function $R({pct:r,label:e}){return a.jsx("div",{className:"embed-model-bar",role:"progressbar","aria-label":e,"aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,children:a.jsx("div",{className:"embed-model-bar-fill",style:{width:`${r}%`}})})}function zge(){const{t:r}=wr(),{data:e,isLoading:i}=Ige(!0),n=Fge(),s=(e==null?void 0:e.state)==="ready",{data:o,isLoading:h}=$ge(!!s),l=Pge(),u=B.useRef(!1);B.useEffect(()=>{u.current||!e||e.state!=="not_downloaded"||!e.packageInstalled||(u.current=!0,n.mutate())},[e,n]);const d=B.useRef(!1);if(B.useEffect(()=>{d.current||!s||!o||o.state!=="not_built"||(d.current=!0,l.mutate())},[s,o,l]),i||!e)return a.jsx("div",{className:"embed-model-card",children:a.jsx("span",{className:"embed-model-status embed-model-status--muted",children:r("settings.recall.embed.checking")})});if(!e.packageInstalled)return a.jsxs("div",{className:"embed-model-card embed-model-card--error",children:[a.jsxs("span",{className:"embed-model-status embed-model-status--error",children:["✗ ",r("settings.recall.embed.no_runtime")]}),a.jsx("p",{className:"settings-field-hint",children:r("settings.recall.embed.no_runtime.hint")})]});if(e.state==="error")return a.jsxs("div",{className:"embed-model-card embed-model-card--error",children:[a.jsxs("span",{className:"embed-model-status embed-model-status--error",children:["✗ ",r("settings.recall.embed.failed")]}),e.error&&a.jsx("p",{className:"embed-model-errdetail",children:e.error}),a.jsx("button",{type:"button",className:"embed-model-btn",onClick:()=>n.mutate(),disabled:n.isPending,children:n.isPending?r("settings.recall.embed.starting"):r("settings.recall.embed.retry")})]});if(e.state==="downloading"){const f=e.totalBytes>0?`${S_(e.loadedBytes)} / ${S_(e.totalBytes)}`:null;return a.jsxs("div",{className:"embed-model-card",children:[a.jsxs("div",{className:"embed-model-row",children:[a.jsxs("span",{className:"embed-model-status",children:["⏳ ",r("settings.recall.embed.downloading")," ",e.progress,"%"]}),f&&a.jsx("span",{className:"embed-model-meta",children:f})]}),a.jsx($R,{pct:e.progress,label:r("settings.recall.embed.downloading")}),a.jsxs("p",{className:"settings-field-hint",children:[r("settings.recall.embed.step1of2")," · ",r("settings.recall.embed.downloading.hint")]})]})}if(e.state==="not_downloaded")return a.jsxs("div",{className:"embed-model-card",children:[a.jsx("p",{className:"settings-field-hint",children:r("settings.recall.embed.needed")}),a.jsx("button",{type:"button",className:"embed-model-btn embed-model-btn--primary",onClick:()=>n.mutate(),disabled:n.isPending,children:n.isPending?r("settings.recall.embed.starting"):r("settings.recall.embed.download")})]});if(h||!o)return a.jsx("div",{className:"embed-model-card",children:a.jsx("span",{className:"embed-model-status embed-model-status--muted",children:r("settings.recall.embed.checking")})});if(o.state==="error")return a.jsxs("div",{className:"embed-model-card embed-model-card--error",children:[a.jsxs("span",{className:"embed-model-status embed-model-status--error",children:["✗ ",r("settings.recall.embed.index_failed")]}),o.error&&a.jsx("p",{className:"embed-model-errdetail",children:o.error}),a.jsx("button",{type:"button",className:"embed-model-btn",onClick:()=>l.mutate(),disabled:l.isPending,children:l.isPending?r("settings.recall.embed.starting"):r("settings.recall.embed.retry")})]});if(o.state==="building"){const f=o.total>0?`${o.done} / ${o.total}`:null;return a.jsxs("div",{className:"embed-model-card",children:[a.jsxs("div",{className:"embed-model-row",children:[a.jsxs("span",{className:"embed-model-status",children:["⏳ ",r("settings.recall.embed.indexing")," ",o.progress,"%"]}),f&&a.jsx("span",{className:"embed-model-meta",children:f})]}),a.jsx($R,{pct:o.progress,label:r("settings.recall.embed.indexing")}),a.jsxs("p",{className:"settings-field-hint",children:[r("settings.recall.embed.step2of2")," · ",r("settings.recall.embed.indexing.hint")]})]})}if(o.state==="not_built")return a.jsxs("div",{className:"embed-model-card",children:[a.jsx("p",{className:"settings-field-hint",children:r("settings.recall.embed.index_needed")}),a.jsx("button",{type:"button",className:"embed-model-btn embed-model-btn--primary",onClick:()=>l.mutate(),disabled:l.isPending,children:l.isPending?r("settings.recall.embed.starting"):r("settings.recall.embed.build_index")})]});const g=e.totalBytes>0?S_(e.totalBytes):"~113 MB";return a.jsxs("div",{className:"embed-model-card embed-model-card--ready",children:[a.jsxs("span",{className:"embed-model-status embed-model-status--ready",children:["✓ ",r("settings.recall.embed.ready")]}),a.jsxs("span",{className:"embed-model-meta",children:[g," · ",o.chunks," ",r("settings.recall.embed.chunks")," · ",r("settings.recall.embed.local")]})]})}function qge(){const{data:r,isLoading:e}=tue(),i=iue(),[n,s]=B.useState(""),[o,h]=B.useState(null);B.useEffect(()=>{s((r==null?void 0:r.raw)??"")},[r]);const l=(r==null?void 0:r.warnings)??[],u=(r==null?void 0:r.customFields)??[];return a.jsxs("section",{className:"settings-section",children:[a.jsxs("h2",{className:"settings-section-title",children:["Task Format & Custom Fields",a.jsx("span",{className:"settings-beta-badge",children:"BETA"})]}),a.jsxs("p",{className:"settings-field-hint",children:["Declare custom fields for this project — they’re written to ",a.jsx("code",{children:"overrides/task.md"})," (committed to git) and apply to everyone: the CLI, the dashboard, the main agent, and sleep agents. Required fields must be set on every task. Custom fields sync to ClickUp / GitHub."]}),a.jsxs("details",{className:"tov-doc",children:[a.jsx("summary",{children:"How the format works"}),a.jsxs("div",{className:"tov-doc-body",children:[a.jsxs("p",{children:[a.jsx("code",{children:"_dream_context/overrides/task.md"})," has two parts — YAML frontmatter plus a body. With no file, tasks use the shipped defaults (nothing changes)."]}),a.jsxs("p",{children:[a.jsxs("strong",{children:["1. Frontmatter ",a.jsx("code",{children:"custom_fields:"})]})," — a list; each field accepts:"]}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"name"})," — display name (required)."]}),a.jsxs("li",{children:[a.jsx("code",{children:"key"})," — stable id used by the CLI and backend (optional; defaults to the snake_cased name)."]}),a.jsxs("li",{children:[a.jsx("code",{children:"type"})," — ",a.jsx("code",{children:"text"}),", ",a.jsx("code",{children:"number"}),", ",a.jsx("code",{children:"select"}),", or ",a.jsx("code",{children:"date"}),"."]}),a.jsxs("li",{children:[a.jsx("code",{children:"required"})," — ",a.jsx("code",{children:"true"})," to force the agent to set it on every task (default: optional)."]}),a.jsxs("li",{children:[a.jsx("code",{children:"options"})," — the allowed values, for a ",a.jsx("code",{children:"select"}),"."]}),a.jsxs("li",{children:[a.jsx("code",{children:"sync"})," — ",a.jsx("code",{children:"[clickup, github]"})," (both by default): which backend(s) the field syncs to."]}),a.jsxs("li",{children:[a.jsx("code",{children:"prompt"})," — tells the agent how to fill the field; shown in every agent’s briefing."]})]}),a.jsxs("p",{children:[a.jsx("strong",{children:"2. Body"})," — your task template (the sections a new task scaffolds with;"," ",a.jsx("code",{children:"{{WHY}}"})," is a placeholder), plus an optional ",a.jsx("code",{children:"## Agent Instructions"})," ","section the agents follow when creating a task (it is stripped from the created task). The body is edited via git/CLI — the box below is a read-only preview."]}),a.jsxs("p",{className:"tov-doc-note",children:["Values are set with ",a.jsx("code",{children:"tasks field <slug> <key> <value>"})," or"," ",a.jsx("code",{children:"tasks create --field key=value"}),", and show up wherever a task is read or listed. A malformed field is skipped with a warning — never fatal."]})]})]}),u.length>0&&a.jsx("div",{className:"tov-fields",children:u.map(d=>{var g;return a.jsxs("div",{className:"tov-field",children:[a.jsx("span",{className:"tov-field-name",children:d.name}),a.jsx("span",{className:`tov-field-req${d.required?" tov-field-req--on":""}`,children:d.required?"required":"optional"}),a.jsxs("span",{className:"tov-field-meta",children:["id ",a.jsx("code",{children:d.key})," · ",d.type,d.type==="select"&&((g=d.options)!=null&&g.length)?` (${d.options.join(", ")})`:"",` · ${d.sync.join("+")||"none"}`]}),d.prompt&&a.jsxs("span",{className:"tov-field-prompt",children:["“",d.prompt,"”"]}),a.jsxs("div",{className:"tov-field-actions",children:[a.jsx("button",{type:"button",className:"tov-edit",title:"Edit field","aria-label":`Edit field ${d.name}`,onClick:()=>h(d),children:"✎"}),a.jsx("button",{type:"button",className:"tov-remove",title:"Remove field","aria-label":`Remove field ${d.name}`,onClick:()=>{(o==null?void 0:o.key)===d.key&&h(null),i.mutate(d.key)},children:"×"})]})]},d.key)})}),o?a.jsx(yC,{initial:o,onClose:()=>h(null)},o.key):a.jsx(yC,{},"add"),l.length>0&&a.jsx("ul",{className:"tov-warnings",children:l.map((d,g)=>a.jsxs("li",{children:["⚠ ",d]},g))}),a.jsxs("label",{className:"tov-preview-label",children:["Generated ",a.jsx("code",{children:"overrides/task.md"})," — read-only"]}),a.jsx("textarea",{className:"tov-editor",spellCheck:!1,value:n,readOnly:!0,placeholder:e?"Loading…":"No override yet — add a custom field above to create it.",rows:14})]})}function ol({children:r,...e}){return a.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:r})}function Hge(r){return a.jsxs(ol,{...r,children:[a.jsx("rect",{x:"3.5",y:"3.5",width:"7",height:"7",rx:"1.75"}),a.jsx("rect",{x:"13.5",y:"3.5",width:"7",height:"7",rx:"1.75"}),a.jsx("rect",{x:"3.5",y:"13.5",width:"7",height:"7",rx:"1.75"}),a.jsx("rect",{x:"13.5",y:"13.5",width:"7",height:"7",rx:"1.75"})]})}function Uge(r){return a.jsx(ol,{...r,children:a.jsx("path",{d:"M6.5 18.5a4 4 0 0 1-.7-7.94 5.25 5.25 0 0 1 10.16-1.9A3.75 3.75 0 0 1 17.5 18.5H6.5Z"})})}function Wge(r){return a.jsxs(ol,{...r,children:[a.jsx("ellipse",{cx:"12",cy:"6",rx:"7",ry:"3"}),a.jsx("path",{d:"M5 6v6c0 1.66 3.13 3 7 3s7-1.34 7-3V6"}),a.jsx("path",{d:"M5 12v6c0 1.66 3.13 3 7 3s7-1.34 7-3v-6"})]})}function Gge(r){return a.jsxs(ol,{...r,children:[a.jsx("circle",{cx:"6",cy:"12",r:"2.5"}),a.jsx("circle",{cx:"18",cy:"6",r:"2.5"}),a.jsx("circle",{cx:"18",cy:"18",r:"2.5"}),a.jsx("path",{d:"M8.2 10.8 15.8 7.2M8.2 13.2l7.6 3.6"})]})}function Kge(r){return a.jsxs(ol,{...r,children:[a.jsx("path",{d:"M8 6h12M8 12h12M8 18h12"}),a.jsx("circle",{cx:"4",cy:"6",r:"1.25",fill:"currentColor",stroke:"none"}),a.jsx("circle",{cx:"4",cy:"12",r:"1.25",fill:"currentColor",stroke:"none"}),a.jsx("circle",{cx:"4",cy:"18",r:"1.25",fill:"currentColor",stroke:"none"})]})}function Vge(r){return a.jsxs(ol,{...r,children:[a.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2.25"}),a.jsx("path",{d:"M7.5 9.5 10 12l-2.5 2.5M12.5 14.5h4"})]})}function Yge(r){return a.jsx(ol,{...r,children:a.jsx("path",{d:"M20.5 14.3A8.25 8.25 0 0 1 9.7 3.5a8.25 8.25 0 1 0 10.8 10.8Z"})})}function Xge(r){return a.jsxs(ol,{...r,children:[a.jsx("path",{d:"M6.5 17.5a4 4 0 0 1-.7-7.94 5.25 5.25 0 0 1 10.16-1.9A3.75 3.75 0 0 1 17.5 17.5H6.5Z"}),a.jsx("path",{d:"M9.5 13.5 12 11l2.5 2.5M12 11v6.5"})]})}const Zge={platforms:Hge,tasks:Uge,memory:Wge,connections:Gge,format:Kge,brain:Xge,agents:Vge,sleepy:Yge};function Qge(r){const e=r.trim().replace(/\.git$/,"").replace(/\/+$/,"").match(/github\.com[/:]([^/]+)\/([^/]+)$/i);if(e){const i=`${e[1]}/${e[2]}`;return{name:i,web:`https://github.com/${i}`}}return{name:r,web:null}}function Jge(){var T,N,A,j,E;const{t:r}=wr(),{data:e}=VC(),{data:i}=KC(),n=a7(),s=o7(),[o,h]=B.useState("create"),[l,u]=B.useState(""),[d,g]=B.useState(!0),[f,m]=B.useState(""),[y,w]=B.useState(null);if(!(e!=null&&e.connected)||!i)return null;const _=n.isPending||s.isPending,b=((T=n.error)==null?void 0:T.message)??((N=s.error)==null?void 0:N.message)??null,x=()=>{w(null),n.reset(),s.reset()},C=()=>{x(),n.mutate({name:l.trim()||void 0,private:d,confirmed:!d},{onSuccess:L=>w(L)})},k=()=>{f.trim()&&(x(),s.mutate(f.trim(),{onSuccess:L=>w(L)}))};if(y){const L=((A=y.sync)==null?void 0:A.action)==="error";return a.jsxs("div",{className:"origin-setup origin-setup--done",children:[a.jsxs("p",{className:"origin-setup-title",children:[a.jsx("span",{className:"origin-setup-mark","aria-hidden":"true",children:a.jsx(Xo,{size:14})}),r("brain.origin.connected").replace("{repo}",y.fullName??y.remote)]}),a.jsx("p",{className:`origin-setup-outcome${L?" origin-setup-outcome--warn":""}`,children:L?((E=(j=y.sync)==null?void 0:j.failure)==null?void 0:E.message)??r("brain.origin.firstSyncFailed"):r("brain.origin.firstSyncOk")})]})}return i.codeOrigin?a.jsx(eme,{origin:i.codeOrigin}):a.jsxs("div",{className:"origin-setup",children:[a.jsx("p",{className:"origin-setup-title",children:r("brain.origin.title")}),a.jsx("p",{className:"settings-field-hint",children:r("brain.origin.desc")}),a.jsxs("div",{className:"origin-setup-tabs",role:"tablist",children:[a.jsx("button",{role:"tab","aria-selected":o==="create",className:`origin-setup-tab${o==="create"?" origin-setup-tab--active":""}`,onClick:()=>{h("create"),x()},children:r("brain.origin.tab.create")}),a.jsx("button",{role:"tab","aria-selected":o==="attach",className:`origin-setup-tab${o==="attach"?" origin-setup-tab--active":""}`,onClick:()=>{h("attach"),x()},children:r("brain.origin.tab.attach")})]}),o==="create"?a.jsxs("div",{className:"origin-setup-form",children:[a.jsx("input",{className:"settings-text-input",type:"text",value:l,placeholder:r("brain.origin.namePlaceholder"),onChange:L=>u(L.target.value),disabled:_}),a.jsxs("label",{className:"settings-checkbox-label origin-setup-private",children:[a.jsx("input",{type:"checkbox",className:"settings-checkbox",checked:d,disabled:_,onChange:L=>g(L.target.checked)}),a.jsx("span",{children:r("brain.origin.private")})]}),!d&&a.jsx("p",{className:"origin-setup-warn",children:r("brain.origin.publicWarn")}),a.jsx("button",{className:"btn btn--primary",onClick:C,disabled:_,children:n.isPending?r("brain.origin.creating"):r("brain.origin.createBtn")})]}):a.jsxs("div",{className:"origin-setup-form",children:[a.jsx("input",{className:"settings-text-input",type:"text",value:f,placeholder:r("brain.origin.urlPlaceholder"),onChange:L=>m(L.target.value),disabled:_,onKeyDown:L=>{L.key==="Enter"&&k()}}),a.jsx("p",{className:"settings-field-hint",children:r("brain.origin.attachHint")}),a.jsx("button",{className:"btn btn--primary",onClick:k,disabled:_||!f.trim(),children:s.isPending?r("brain.origin.attaching"):r("brain.origin.attachBtn")})]}),b&&a.jsx("p",{className:"origin-setup-error",children:b})]})}function eme({origin:r}){var x,C;const{t:e}=wr(),i=l7(),n=c7(),[s,o]=B.useState(!1),[h,l]=B.useState(!1),[u,d]=B.useState(""),{name:g,web:f}=Qge(r),m=i.isPending||n.isPending,y=((x=i.error)==null?void 0:x.message)??((C=n.error)==null?void 0:C.message)??null,w=()=>{o(!1),d(""),i.reset()},_=()=>{u.trim()&&i.mutate(u.trim(),{onSuccess:w})},b=()=>{n.mutate(void 0,{onSuccess:()=>l(!1)})};return a.jsxs("div",{className:"origin-setup origin-setup--connected",children:[a.jsxs("p",{className:"origin-setup-title",children:[a.jsx("span",{className:"origin-setup-mark","aria-hidden":"true",children:a.jsx(Xo,{size:14})}),e("brain.origin.connectedTitle")]}),a.jsxs("div",{className:"origin-connected-repo",children:[f?a.jsx("a",{className:"origin-connected-name",href:f,target:"_blank",rel:"noreferrer",children:g}):a.jsx("span",{className:"origin-connected-name",children:g}),a.jsx("span",{className:"origin-connected-url",children:r})]}),s?a.jsxs("div",{className:"origin-setup-form",children:[a.jsx("input",{className:"settings-text-input",type:"text",value:u,placeholder:e("brain.origin.urlPlaceholder"),onChange:k=>d(k.target.value),disabled:m,onKeyDown:k=>{k.key==="Enter"&&_()},autoFocus:!0}),a.jsx("p",{className:"settings-field-hint",children:e("brain.origin.changeHint")}),a.jsxs("div",{className:"origin-connected-actions",children:[a.jsx("button",{className:"btn btn--primary btn--sm",onClick:_,disabled:m||!u.trim(),children:i.isPending?e("brain.origin.updating"):e("brain.origin.updateBtn")}),a.jsx("button",{className:"btn btn--sm",onClick:w,disabled:m,children:e("common.cancel")})]})]}):h?a.jsxs("div",{className:"origin-connected-actions",children:[a.jsx("span",{className:"origin-connected-detach-warn",children:e("brain.origin.detachWarn")}),a.jsx("button",{className:"btn btn--danger btn--sm",onClick:b,disabled:m,children:n.isPending?e("brain.origin.detaching"):e("brain.origin.detachConfirm")}),a.jsx("button",{className:"btn btn--sm",onClick:()=>{n.reset(),l(!1)},disabled:m,children:e("common.cancel")})]}):a.jsxs("div",{className:"origin-connected-actions",children:[a.jsx("button",{className:"btn btn--sm",onClick:()=>{n.reset(),o(!0)},disabled:m,children:e("brain.origin.changeBtn")}),a.jsx("button",{className:"btn btn--sm",onClick:()=>{i.reset(),l(!0)},disabled:m,children:e("brain.origin.detachBtn")})]}),y&&a.jsx("p",{className:"origin-setup-error",children:y})]})}const fb=["linked-repos"];function tme(){return Yt({queryKey:fb,queryFn:()=>De.get("/linked-repos"),select:r=>r.repos})}function rme(){const r=Pt();return Vt({mutationFn:e=>De.post("/linked-repos/link",e),onSuccess:()=>r.invalidateQueries({queryKey:fb})})}function ime(){const r=Pt();return Vt({mutationFn:e=>De.post("/linked-repos/clone",{name:e,confirmed:!0}),onSuccess:()=>r.invalidateQueries({queryKey:fb})})}function nme(){const r=Pt();return Vt({mutationFn:e=>De.post("/linked-repos/unlink",{name:e}),onSuccess:()=>r.invalidateQueries({queryKey:fb})})}function sme(){var m,y,w;const{t:r}=wr(),{data:e}=tme(),i=rme(),n=ime(),s=nme(),[o,h]=B.useState(""),[l,u]=B.useState(null),d=i.isPending||n.isPending||s.isPending,g=((m=i.error)==null?void 0:m.message)??((y=n.error)==null?void 0:y.message)??((w=s.error)==null?void 0:w.message)??null,f=async()=>{const _=o.trim();if(!_)return;i.reset();const b=await AB();b&&i.mutate({name:_,path:b},{onSuccess:()=>h("")})};return a.jsxs("div",{className:"linked-repos",children:[a.jsx("p",{className:"linked-repos-title",children:r("linkedRepos.title")}),a.jsx("p",{className:"settings-field-hint",children:r("linkedRepos.desc")}),e&&e.length>0?a.jsx("ul",{className:"linked-repos-list",children:e.map(_=>a.jsxs("li",{className:"linked-repos-item",children:[a.jsxs("div",{className:"linked-repos-item-main",children:[a.jsx("span",{className:"linked-repos-name",children:_.name}),a.jsx("span",{className:"linked-repos-url",children:_.gitRemoteUrl}),_.present?a.jsx("span",{className:"linked-repos-path",children:_.path}):a.jsx("span",{className:"linked-repos-missing",children:r("linkedRepos.missing")})]}),a.jsxs("div",{className:"linked-repos-item-actions",children:[!_.present&&(l===_.name?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"linked-repos-trust-warn",children:r("linkedRepos.trustWarn")}),a.jsx("button",{className:"btn btn--primary btn--sm",disabled:d,onClick:()=>n.mutate(_.name,{onSuccess:()=>u(null)}),children:n.isPending?r("linkedRepos.cloning"):r("linkedRepos.cloneConfirm")}),a.jsx("button",{className:"btn btn--sm",disabled:d,onClick:()=>u(null),children:r("common.cancel")})]}):a.jsx("button",{className:"btn btn--sm",disabled:d,onClick:()=>{n.reset(),u(_.name)},children:r("linkedRepos.clone")})),a.jsx("button",{className:"btn btn--sm",disabled:d,onClick:()=>s.mutate(_.name),children:r("linkedRepos.unlink")})]})]},_.gitRemoteUrl))}):a.jsx("p",{className:"settings-field-hint",children:r("linkedRepos.empty")}),a.jsxs("div",{className:"linked-repos-add",children:[a.jsx("input",{className:"settings-text-input",type:"text",value:o,placeholder:r("linkedRepos.namePlaceholder"),onChange:_=>h(_.target.value),disabled:d}),a.jsx("button",{className:"btn btn--primary btn--sm",disabled:d||!o.trim(),onClick:f,children:i.isPending?r("linkedRepos.adding"):r("linkedRepos.add")})]}),g&&a.jsx("p",{className:"linked-repos-error",children:g})]})}function ame(r){const e=[];r.metaKey&&e.push("Cmd"),r.ctrlKey&&e.push("Ctrl"),r.altKey&&e.push("Alt"),r.shiftKey&&e.push("Shift");let i=r.key;return["Meta","Control","Alt","Shift"].includes(i)||(i===" "?i="Space":i.length===1?i=i.toUpperCase():i=i.charAt(0).toUpperCase()+i.slice(1),e.length===0)?null:[...e,i].join("+")}const ome=[{id:"claude",labelKey:"settings.platform.claude"}],lme=[{mode:"haiku",labelKey:"settings.recall.haiku.label",hintKey:"settings.recall.haiku.hint"},{mode:"raw",labelKey:"settings.recall.raw.label",hintKey:"settings.recall.raw.hint"},{mode:"hybrid",labelKey:"settings.recall.hybrid.label",hintKey:"settings.recall.hybrid.hint",experimental:!0},{mode:"off",labelKey:"settings.recall.off.label",hintKey:"settings.recall.off.hint"}],T_={platforms:[],disableNativeMemory:!0},cme=[{id:"platforms",labelKey:"settings.nav.platforms",descKey:"settings.navdesc.platforms"},{id:"tasks",labelKey:"settings.nav.tasks",descKey:"settings.navdesc.tasks"},{id:"memory",labelKey:"settings.nav.memory",descKey:"settings.navdesc.memory"},{id:"connections",labelKey:"settings.nav.connections",descKey:"settings.navdesc.connections"},{id:"brain",labelKey:"settings.nav.brain",descKey:"settings.navdesc.brain"},{id:"format",labelKey:"settings.nav.format",descKey:"settings.navdesc.format",beta:!0},{id:"agents",labelKey:"settings.nav.agents",descKey:"settings.navdesc.agents",desktopOnly:!0,beta:!0},{id:"sleepy",labelKey:"settings.nav.sleepy",descKey:"settings.navdesc.sleepy",desktopOnly:!0,lab:!0}];function hme({focus:r}){var gt,nt;const{t:e}=wr(),i=Pt(),{data:n,isLoading:s,isError:o}=Ege(),h=Nge(),{data:l}=Ek(),u=((l==null?void 0:l.desktop)??!1)||qi(),{data:d}=n7(),g=s7(),[f,m]=B.useState(()=>wF()),{data:y}=ob(),w=Ple(),_=(y==null?void 0:y.recall_mode)??"haiku",[b,x]=B.useState("platforms"),C=cme.filter(ge=>!ge.desktopOnly||u),[k,T]=B.useState(T_.platforms),[N,A]=B.useState(T_.disableNativeMemory),[j,E]=B.useState(!1),[L,O]=B.useState("clickup"),[D,K]=B.useState(""),[z,H]=B.useState(""),[P,$]=B.useState(""),[W,V]=B.useState(""),[F,G]=B.useState(""),[U,X]=B.useState(""),[ee,re]=B.useState(""),[le,fe]=B.useState(null),[ie,I]=B.useState(!1),[Z,J]=B.useState(null),[ne,ce]=B.useState(null),[xe,Ve]=B.useState(!1),[We,et]=B.useState(null),[de,Ne]=B.useState(!1),[he,He]=B.useState(!1),[ut,zt]=B.useState(()=>Aw()),[At,Lt]=B.useState(!1),qt=ge=>{zt(ge),_Q(ge),_1(ge)},[mt,Te]=B.useState(null),[Ie,Be]=B.useState(!1),Je=B.useRef(null);B.useEffect(()=>{if(!u)return;let ge=!1;return gF().then(qe=>{ge||Te(qe)}),()=>{ge=!0}},[u]);const vt=ge=>{Te(ge),Wle(ge)},{data:lt}=Yt({queryKey:["tasks-sync-status"],queryFn:()=>De.get("/tasks/sync-status"),select:ge=>ge.status}),{data:Nt}=Yt({queryKey:["tasks-token-status"],queryFn:()=>De.get("/tasks/token-status"),enabled:j}),ke=Nt&&Nt.backend===L?Nt:void 0,{data:dt}=Yt({queryKey:["tasks-containers"],queryFn:()=>De.get("/tasks/containers"),select:ge=>ge.containers,enabled:j,staleTime:300*1e3}),at=ge=>{const qe=(dt??[]).find(kt=>kt.path===ge);qe&&(L==="github"?(V(qe.ids.owner??""),G(qe.ids.repo??"")):(K(qe.ids.teamId??""),H(qe.ids.spaceId??""),$(qe.ids.listId??"")),Ae())},ve=async()=>{const ge=j?L:"local",qe=(L==="github"?ee:U).trim();try{return await h.mutateAsync({platforms:k,disableNativeMemory:N,taskBackend:ge,...j&&L==="clickup"?{clickup:{teamId:D||void 0,spaceId:z||void 0,listId:P||void 0}}:{},...j&&L==="github"?{github:{owner:W||void 0,repo:F||void 0}}:{}}),j&&qe&&await De.post("/tasks/token",{token:qe}),qe&&(L==="github"?re(""):X("")),await Promise.all([i.invalidateQueries({queryKey:["tasks-token-status"]}),i.invalidateQueries({queryKey:["tasks-containers"]}),i.invalidateQueries({queryKey:["tasks-sync-status"]})]),Ne(!1),et(null),!0}catch(kt){return et(kt instanceof Error?kt.message:String(kt)),!1}},ye=ge=>ge.errors.length>0?`⚠ ${ge.errors[0]}`:ge.created.length>0?`✓ ${e("settings.cloud_tasks.provision_created")}: ${ge.created.join(", ")}${ge.backfilled>0?` · ${e("settings.cloud_tasks.provision_backfilled").replace("{n}",String(ge.backfilled))}`:""}`:`✓ ${e("settings.cloud_tasks.provision_nothing")}`,rt=ge=>!ge||!ge.set?e("settings.cloud_tasks.api_key_none"):ge.source==="env"?`${e("settings.cloud_tasks.api_key_env")} ${ge.masked??""}`.trim():`${e("settings.cloud_tasks.api_key_set")} ${ge.masked??""}`.trim(),Ze=async()=>{Ve(!0),J(null),ce(null);try{if(!await ve())return;const{result:ge}=await De.post("/tasks/provision",{dryRun:!0});ge.created.length===0&&ge.errors.length===0?J(`✓ ${e("settings.cloud_tasks.provision_nothing")}`):ce(ge)}catch(ge){J(`⚠ ${ge instanceof Error?ge.message:String(ge)}`)}finally{Ve(!1)}},xt=async()=>{Ve(!0),J(null);try{const{result:ge}=await De.post("/tasks/provision",{dryRun:!1});ce(null),J(ye(ge)),i.invalidateQueries({queryKey:["tasks-sync-status"]})}catch(ge){J(`⚠ ${ge instanceof Error?ge.message:String(ge)}`)}finally{Ve(!1)}};if(B.useEffect(()=>{var kt,se,ue,be,Ee;const ge=n??T_;T(ge.platforms),A(ge.disableNativeMemory??!0);const qe=n;E((qe==null?void 0:qe.taskBackend)==="clickup"||(qe==null?void 0:qe.taskBackend)==="github"),O((qe==null?void 0:qe.taskBackend)==="github"?"github":"clickup"),K(((kt=qe==null?void 0:qe.clickup)==null?void 0:kt.teamId)??""),H(((se=qe==null?void 0:qe.clickup)==null?void 0:se.spaceId)??""),$(((ue=qe==null?void 0:qe.clickup)==null?void 0:ue.listId)??""),V(((be=qe==null?void 0:qe.github)==null?void 0:be.owner)??""),G(((Ee=qe==null?void 0:qe.github)==null?void 0:Ee.repo)??""),Ne(!1),He(!1)},[n]),B.useEffect(()=>{(r==null?void 0:r.id)==="brain"&&x("brain")},[r==null?void 0:r.id,r==null?void 0:r.nonce]),s)return a.jsx("div",{className:"loading",children:e("common.loading")});if(o)return a.jsx("div",{className:"error-state",children:e("common.error")});const pt=ge=>{T(qe=>{const kt=qe.includes(ge)?qe.filter(se=>se!==ge):[...qe,ge];return Ne(!0),He(!1),kt})},wt=()=>{A(ge=>!ge),Ne(!0),He(!1)},ae=async()=>{He(!1),await ve()&&He(!0)},Ae=()=>{Ne(!0),He(!1)},Ye=(n==null?void 0:n.shareable)===!0,ot=ge=>{h.mutate({shareable:ge})},Ft=async()=>{I(!0),fe(null),ce(null);try{if(!await ve())return;fe(await De.post("/tasks/sync-test",{}))}catch(ge){fe({ok:!1,backend:L,error:ge instanceof Error?ge.message:String(ge)})}finally{I(!1)}};return a.jsxs("div",{className:"settings-page",children:[a.jsx("div",{className:"settings-header",children:a.jsxs("div",{className:"settings-save-row",children:[he&&!de&&a.jsx("span",{className:"settings-saved",children:e("settings.saved")}),h.isError&&a.jsx("span",{className:"settings-error",children:e("common.error")}),a.jsx("button",{className:"btn btn--primary",onClick:ae,disabled:!de||h.isPending,children:h.isPending?e("settings.saving"):e("settings.save")})]})}),n===null&&a.jsx("div",{className:"settings-empty-notice",children:e("settings.no_config")}),a.jsxs("div",{className:"settings-body",children:[a.jsx("nav",{className:"settings-nav","aria-label":e("settings.title"),children:C.map(ge=>{const qe=Zge[ge.id],kt=b===ge.id;return a.jsxs("button",{type:"button",className:`settings-nav-item${kt?" settings-nav-item--active":""}`,"aria-current":kt?"page":void 0,onClick:()=>x(ge.id),children:[a.jsx("span",{className:"settings-nav-icon","aria-hidden":"true",children:qe?a.jsx(qe,{}):null}),a.jsxs("span",{className:"settings-nav-text",children:[a.jsxs("span",{className:"settings-nav-label",children:[e(ge.labelKey),ge.lab&&a.jsx("span",{className:"settings-lab-badge",children:e("nav.lab")}),ge.beta&&a.jsx("span",{className:"settings-beta-badge",children:"BETA"})]}),a.jsx("span",{className:"settings-nav-desc",children:e(ge.descKey)})]})]},ge.id)})}),a.jsxs("div",{className:"settings-content",children:[b==="platforms"&&a.jsxs("section",{className:"settings-section",children:[a.jsxs("div",{className:"settings-section-head",children:[a.jsx("h2",{className:"settings-section-title",children:e("settings.platforms")}),a.jsx("p",{className:"settings-section-desc",children:e("settings.desc.platforms")})]}),a.jsx("div",{className:"settings-checkboxes",children:ome.map(({id:ge,labelKey:qe})=>a.jsxs("label",{className:"settings-checkbox-label",children:[a.jsx("input",{type:"checkbox",className:"settings-checkbox",checked:k.includes(ge),onChange:()=>pt(ge)}),a.jsx("span",{children:e(qe)})]},ge))})]}),b==="tasks"&&a.jsxs("section",{className:"settings-section",children:[a.jsxs("div",{className:"settings-section-head",children:[a.jsx("h2",{className:"settings-section-title",children:e("settings.tasks")}),a.jsx("p",{className:"settings-section-desc",children:e("settings.desc.tasks")})]}),a.jsxs("div",{className:"settings-checkboxes",children:[a.jsxs("label",{className:"settings-checkbox-label",children:[a.jsx("input",{type:"checkbox",className:"settings-checkbox",checked:j,onChange:()=>{E(ge=>!ge),Ae()}}),a.jsx("span",{children:e("settings.cloud_tasks.label")})]}),a.jsx("p",{className:"settings-field-hint",children:e(L==="github"?"settings.cloud_tasks.github.hint":"settings.cloud_tasks.hint")}),j&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"settings-field-row",children:[a.jsx("label",{children:e("settings.cloud_tasks.provider")}),a.jsxs("select",{className:"settings-text-input",value:L,onChange:ge=>{const qe=ge.target.value;O(qe),fe(null),Ae()},children:[a.jsx("option",{value:"clickup",children:e("settings.cloud_tasks.provider.clickup")}),a.jsx("option",{value:"github",children:e("settings.cloud_tasks.provider.github")})]})]}),L==="clickup"&&a.jsxs(a.Fragment,{children:[(dt??[]).length>0&&a.jsxs("div",{className:"settings-field-row",children:[a.jsx("label",{children:e("settings.cloud_tasks.list_label")}),a.jsx(mf,{value:P?((gt=(dt??[]).find(ge=>ge.ids.listId===P))==null?void 0:gt.path)??null:null,options:(dt??[]).map(ge=>({value:ge.path,label:ge.path})),placeholder:e("settings.cloud_tasks.list_pick"),searchPlaceholder:e("settings.cloud_tasks.list_search"),clearLabel:e("settings.cloud_tasks.keep_current"),onChange:at})]}),a.jsxs("div",{className:"settings-field-row",children:[a.jsx("label",{children:e("settings.cloud_tasks.team")}),a.jsx("input",{className:"settings-text-input",value:D,onChange:ge=>{K(ge.target.value),Ae()}})]}),a.jsxs("div",{className:"settings-field-row",children:[a.jsx("label",{children:e("settings.cloud_tasks.space")}),a.jsx("input",{className:"settings-text-input",value:z,onChange:ge=>{H(ge.target.value),Ae()}})]}),a.jsxs("div",{className:"settings-field-row",children:[a.jsx("label",{children:e("settings.cloud_tasks.list")}),a.jsx("input",{className:"settings-text-input",value:P,onChange:ge=>{$(ge.target.value),Ae()}})]}),a.jsxs("div",{className:"settings-field-row",children:[a.jsx("label",{children:e("settings.cloud_tasks.api_key")}),a.jsx("input",{type:"password",className:"settings-text-input",autoComplete:"off",value:U,placeholder:ke!=null&&ke.set?ke.masked??"••••••••":e("settings.cloud_tasks.api_key_placeholder"),onChange:ge=>{X(ge.target.value),Ae()}})]}),a.jsx("p",{className:"settings-field-hint",children:rt(ke)}),a.jsx("p",{className:"settings-field-hint",children:e("settings.cloud_tasks.token_hint")})]}),L==="github"&&a.jsxs(a.Fragment,{children:[(dt??[]).length>0&&a.jsxs("div",{className:"settings-field-row",children:[a.jsx("label",{children:e("settings.cloud_tasks.github.repo_picker")}),a.jsx(mf,{value:W&&F?`${W}/${F}`:null,options:(dt??[]).map(ge=>({value:ge.path,label:ge.path})),placeholder:e("settings.cloud_tasks.github.pick"),searchPlaceholder:e("settings.cloud_tasks.github.search"),clearLabel:e("settings.cloud_tasks.keep_current"),onChange:at})]}),a.jsxs("div",{className:"settings-field-row",children:[a.jsx("label",{children:e("settings.cloud_tasks.github.owner")}),a.jsx("input",{className:"settings-text-input",value:W,onChange:ge=>{V(ge.target.value),Ae()}})]}),a.jsxs("div",{className:"settings-field-row",children:[a.jsx("label",{children:e("settings.cloud_tasks.github.repo")}),a.jsx("input",{className:"settings-text-input",value:F,onChange:ge=>{G(ge.target.value),Ae()}})]}),a.jsxs("div",{className:"settings-field-row",children:[a.jsx("label",{children:e("settings.cloud_tasks.api_key")}),a.jsx("input",{type:"password",className:"settings-text-input",autoComplete:"off",value:ee,placeholder:ke!=null&&ke.set?ke.masked??"••••••••":e("settings.cloud_tasks.api_key_placeholder"),onChange:ge=>{re(ge.target.value),Ae()}})]}),a.jsx("p",{className:"settings-field-hint",children:rt(ke)}),a.jsx("p",{className:"settings-field-hint",children:e("settings.cloud_tasks.github.token_hint")})]}),a.jsxs("div",{className:"settings-test-row",children:[a.jsx("button",{className:"btn btn--secondary",onClick:Ft,disabled:ie||xe,children:e(ie?"settings.cloud_tasks.testing":"settings.cloud_tasks.test")}),a.jsx("button",{className:"btn btn--secondary",onClick:Ze,disabled:xe||ie,children:e(xe&&!ne?L==="github"?"settings.cloud_tasks.github.provisioning":"settings.cloud_tasks.provisioning":L==="github"?"settings.cloud_tasks.github.provision":"settings.cloud_tasks.provision")}),le&&le.ok&&a.jsxs("span",{className:"settings-test-ok",children:["✓ ",le.note??`${e("settings.cloud_tasks.test_ok")} ${le.user}`]}),le&&!le.ok&&a.jsxs("span",{className:"settings-test-err",children:["✗ ",le.error]})]}),We&&a.jsxs("p",{className:"settings-test-err",children:["✗ ",We]}),Z&&a.jsx("p",{className:"settings-field-hint",children:Z}),ne&&a.jsxs("div",{className:"settings-provision-preview",children:[a.jsx("p",{className:"settings-provision-preview-title",children:e(L==="github"?"settings.cloud_tasks.github.preview_title":"settings.cloud_tasks.preview_title")}),ne.created.length>0&&a.jsxs("p",{className:"settings-provision-line",children:[a.jsx("span",{className:"settings-provision-badge settings-provision-badge--new",children:e("settings.cloud_tasks.preview_will_create").replace("{n}",String(ne.created.length))})," ",ne.created.join(", ")]}),ne.existing.length>0&&a.jsxs("p",{className:"settings-provision-line settings-provision-line--muted",children:[a.jsx("span",{className:"settings-provision-badge",children:e("settings.cloud_tasks.preview_existing").replace("{n}",String(ne.existing.length))})," ",ne.existing.join(", ")]}),a.jsxs("div",{className:"settings-provision-actions",children:[a.jsx("button",{className:"btn btn--primary",onClick:xt,disabled:xe,children:xe?e("settings.cloud_tasks.provision_creating"):e("settings.cloud_tasks.provision_confirm").replace("{n}",String(ne.created.length))}),a.jsx("button",{className:"btn btn--ghost",onClick:()=>ce(null),disabled:xe,children:e("settings.cloud_tasks.provision_cancel")})]})]}),lt&&lt.backend!=="local"&&a.jsxs("p",{className:"settings-sync-badge",children:[e("settings.cloud_tasks.status"),": ",lt.pendingPush," ",e("settings.cloud_tasks.pending"),lt.conflicts>0&&` · ${lt.conflicts} ${e("settings.cloud_tasks.conflicts")}`]})]})]})]}),b==="format"&&a.jsx(qge,{}),b==="memory"&&a.jsxs("section",{className:"settings-section",children:[a.jsxs("div",{className:"settings-section-head",children:[a.jsx("h2",{className:"settings-section-title",children:e("settings.memory")}),a.jsx("p",{className:"settings-section-desc",children:e("settings.desc.memory")})]}),a.jsxs("div",{className:"settings-checkboxes",children:[a.jsxs("label",{className:"settings-checkbox-label",children:[a.jsx("input",{type:"checkbox",className:"settings-checkbox",checked:N,onChange:wt}),a.jsx("span",{children:e("settings.native_memory.label")})]}),a.jsx("p",{className:"settings-field-hint",children:e("settings.native_memory.hint")})]}),a.jsxs("div",{className:"settings-subsection",children:[a.jsx("h3",{className:"settings-nav-label",children:e("settings.recall.title")}),a.jsx("p",{className:"settings-field-hint settings-recall-desc",children:e("settings.recall.desc")}),a.jsx("div",{className:"settings-checkboxes",role:"radiogroup","aria-label":e("settings.recall.title"),children:lme.map(({mode:ge,labelKey:qe,hintKey:kt,experimental:se})=>a.jsxs("div",{children:[a.jsxs("label",{className:"settings-checkbox-label",children:[a.jsx("input",{type:"radio",name:"recall-mode",className:"settings-checkbox",checked:_===ge,disabled:w.isPending,onChange:()=>w.mutate({recall_mode:ge})}),a.jsxs("span",{children:[e(qe),se&&a.jsx("span",{className:"settings-beta-badge",children:e("settings.recall.experimental")})]})]}),a.jsx("p",{className:"settings-field-hint",children:e(kt)}),ge==="hybrid"&&_==="hybrid"&&a.jsx(zge,{})]},ge))}),w.isError&&a.jsxs("p",{className:"settings-test-err",children:["✗ ",e("common.error")]})]})]}),b==="connections"&&a.jsx(Oge,{shareable:Ye,onToggleShareable:ot,shareablePending:h.isPending}),b==="brain"&&a.jsxs("section",{className:"settings-section",children:[a.jsxs("div",{className:"fed-head",children:[a.jsxs("div",{className:"settings-section-head",children:[a.jsx("h2",{className:"settings-section-title",children:e("settings.brain")}),a.jsx("p",{className:"settings-section-desc",children:e("settings.desc.brain")})]}),a.jsxs("label",{className:"fed-sharing-toggle settings-checkbox-label",title:e("brain.cloudSync.hint"),children:[a.jsx("input",{type:"checkbox",className:"settings-checkbox",checked:(d==null?void 0:d.enabled)??!1,disabled:g.isPending,onChange:ge=>g.mutate(ge.target.checked)}),a.jsxs("span",{children:[e("brain.cloudSync.label"),d&&a.jsxs("span",{className:"settings-field-hint brain-cloudsync-source",children:[" ","(",d.source==="explicit"?e("brain.cloudSync.source.explicit"):e("brain.cloudSync.source.derived"),")"]})]})]})]}),a.jsx("p",{className:"settings-section-desc",children:e("brain.cloudSync.desc")}),g.isError&&a.jsx("p",{className:"settings-field-hint brain-scope-error",children:((nt=g.error)==null?void 0:nt.message)??e("brain.cloudSync.error")}),a.jsxs("div",{className:"settings-subsection",children:[a.jsx("h3",{className:"settings-nav-label",children:e("brain.auth.title")}),a.jsx(xce,{}),a.jsx(Jge,{}),a.jsx(sme,{})]}),a.jsxs("div",{className:"settings-subsection",children:[a.jsxs("label",{className:"fed-sharing-toggle settings-checkbox-label",title:e("brain.scope.autoCheckpoint.hint"),children:[a.jsx("input",{type:"checkbox",checked:f,onChange:ge=>{m(ge.target.checked),wce(ge.target.checked)}}),a.jsx("span",{children:e("brain.scope.autoCheckpoint.label")})]}),a.jsx("p",{className:"settings-field-hint",children:e("brain.scope.autoCheckpoint.hint")})]})]}),b==="agents"&&u&&a.jsxs("section",{className:"settings-section",children:[a.jsxs("h2",{className:"settings-section-title",children:[e("settings.agents.title"),a.jsx("span",{className:"settings-beta-badge",children:"BETA"})]}),mt?a.jsxs("div",{className:"settings-checkboxes",children:[a.jsxs("label",{className:"settings-checkbox-label",children:[a.jsx("input",{type:"checkbox",className:"settings-checkbox",checked:mt.enabled,onChange:()=>vt({...mt,enabled:!mt.enabled})}),a.jsx("span",{children:e("settings.agents.enable")})]}),a.jsx("p",{className:"settings-field-hint",children:e("settings.agents.enable_hint")}),mt.enabled&&a.jsxs(a.Fragment,{children:[a.jsxs("label",{className:"settings-checkbox-label",children:[a.jsx("input",{type:"checkbox",className:"settings-checkbox",checked:mt.restoreTabs,onChange:()=>vt({...mt,restoreTabs:!mt.restoreTabs})}),a.jsx("span",{children:e("settings.agents.restore_tabs")})]}),a.jsx("p",{className:"settings-field-hint",children:e("settings.agents.restore_tabs_hint")}),a.jsxs("div",{className:"settings-field-row",children:[a.jsx("label",{children:e("settings.agents.default_agent")}),a.jsx("select",{className:"settings-text-input",value:mt.defaultAgent,onChange:ge=>vt({...mt,defaultAgent:ge.target.value}),children:a.jsx("option",{value:"claude",children:e("settings.agents.agent.claude")})})]}),a.jsx("p",{className:"settings-field-hint",children:e("settings.agents.default_agent_hint")}),a.jsxs("label",{className:"settings-checkbox-label",children:[a.jsx("input",{type:"checkbox",className:"settings-checkbox",checked:mt.autoTitle,onChange:()=>vt({...mt,autoTitle:!mt.autoTitle})}),a.jsx("span",{children:e("settings.agents.auto_title")})]}),a.jsx("p",{className:"settings-field-hint",children:e("settings.agents.auto_title_hint")}),a.jsxs("div",{className:"settings-field-row",children:[a.jsx("label",{children:e("settings.agents.hotkey")}),a.jsx("input",{className:"settings-text-input",readOnly:!0,value:Ie?e("settings.agents.hotkey_capturing"):Kle(mt.hotkey),onFocus:()=>{Be(!0),Je.current=null},onBlur:()=>{Be(!1),Je.current=null},onKeyDown:ge=>{if(ge.preventDefault(),ge.key==="Backspace"||ge.key==="Delete"){vt({...mt,hotkey:""}),Je.current=null,Be(!1),ge.currentTarget.blur();return}const qe=vF(ge);if(qe){if(ge.repeat)return;const se=Date.now(),ue=Je.current;ue&&ue.token===qe&&se-ue.ts<=yF?(Je.current=null,vt({...mt,hotkey:`${qe}+${qe}`}),Be(!1),ge.currentTarget.blur()):Je.current={token:qe,ts:se};return}Je.current=null;const kt=mF(ge);kt&&(vt({...mt,hotkey:kt}),Be(!1),ge.currentTarget.blur())}})]}),a.jsx("p",{className:"settings-field-hint",children:e("settings.agents.hotkey_hint")})]})]}):a.jsx("p",{className:"settings-field-hint",children:e("common.loading")})]}),b==="sleepy"&&u&&a.jsxs("section",{className:"settings-section",children:[a.jsxs("h2",{className:"settings-section-title",children:["Sleepy — notch quick-capture",a.jsx("span",{className:"settings-lab-badge",children:e("nav.lab")})]}),a.jsxs("div",{className:"settings-checkboxes",children:[a.jsxs("label",{className:"settings-checkbox-label",children:[a.jsx("input",{type:"checkbox",className:"settings-checkbox",checked:ut.enabled,onChange:()=>qt({...ut,enabled:!ut.enabled})}),a.jsx("span",{children:"Enable Sleepy"})]}),a.jsx("p",{className:"settings-field-hint",children:"Press the hotkey anywhere to drop a capture bar under the notch: pick a project, type a thought, hit return — it's saved to that project's memory and learned."}),ut.enabled&&a.jsxs("div",{className:"settings-field-row",children:[a.jsx("label",{children:"Hotkey"}),a.jsx("input",{className:"settings-text-input",readOnly:!0,value:At?"Press a key combo…":ut.hotkey,onFocus:()=>Lt(!0),onBlur:()=>Lt(!1),onKeyDown:ge=>{ge.preventDefault();const qe=ame(ge);qe&&(qt({...ut,hotkey:qe}),Lt(!1),ge.currentTarget.blur())}})]})]})]})]})]})]})}function O$(){return Yt({queryKey:["packs"],queryFn:()=>De.get("/packs")})}function ume(){const r=Pt();return Vt({mutationFn:e=>De.post(`/packs/${encodeURIComponent(e)}/install`,{}),onSuccess:()=>{r.invalidateQueries({queryKey:["packs"]})}})}function dme(){const r=Pt();return Vt({mutationFn:e=>De.del(`/packs/${encodeURIComponent(e)}`),onSuccess:()=>{r.invalidateQueries({queryKey:["packs"]})}})}function fme(r){return"base"in r}function D$({item:r,onActionDone:e}){const{t:i}=wr(),n=ume(),s=dme(),o=r.installed,h=o?s:n,l=h.isPending,u=h.isError,d=i(o?"packs.action.remove":"packs.action.install"),g=i(o?"packs.action.removing":"packs.action.installing"),f=l?g:d,m=y=>{y.stopPropagation(),y.preventDefault(),!l&&h.mutate(r.name,{onSuccess:()=>e==null?void 0:e()})};return a.jsxs("div",{className:"packs-card-actions",children:[a.jsx("button",{type:"button",className:`packs-action-btn btn btn--ghost${o?" packs-action-btn--danger":""}`,onClick:m,disabled:l,"aria-invalid":u||void 0,"aria-busy":l||void 0,children:f}),u&&a.jsx("span",{className:"packs-action-error",role:"alert",children:i("packs.action.error")})]})}function pme({item:r,onClose:e}){const{t:i}=wr(),n=B.useCallback(s=>{s.target===s.currentTarget&&e()},[e]);return B.useEffect(()=>{const s=o=>{o.key==="Escape"&&e()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[e]),a.jsx("div",{className:"packs-modal-overlay",onClick:n,"aria-modal":"true",role:"dialog","aria-label":r.name,children:a.jsxs("div",{className:"packs-modal-panel",children:[a.jsxs("div",{className:"packs-modal-header",children:[a.jsxs("div",{className:"packs-modal-title-row",children:[a.jsx("h2",{className:"packs-modal-name",children:r.name}),r.installed&&a.jsx("span",{className:"packs-installed-pill",children:i("settings.packs.installed")})]}),a.jsxs("div",{className:"packs-modal-header-actions",children:[a.jsx(D$,{item:r,onActionDone:e}),a.jsx("button",{className:"packs-modal-close btn btn--ghost",type:"button",onClick:e,"aria-label":i("packs.detail.close"),children:i("packs.detail.close")})]})]}),r.description&&a.jsx("p",{className:"packs-modal-desc",children:r.description}),r.tags.length>0&&a.jsx("div",{className:"packs-modal-tags",children:r.tags.map(s=>a.jsx("span",{className:"task-tag","data-hue":na(s),children:s},s))}),fme(r)&&a.jsxs(a.Fragment,{children:[r.base&&a.jsxs("div",{className:"packs-modal-section",children:[a.jsx("h3",{className:"packs-modal-section-title",children:i("packs.detail.base")}),a.jsx("p",{className:"packs-modal-mono",children:r.base})]}),r.subSkills.length>0&&a.jsxs("div",{className:"packs-modal-section",children:[a.jsx("h3",{className:"packs-modal-section-title",children:i("packs.detail.subskills")}),a.jsx("ul",{className:"packs-modal-subskills",children:r.subSkills.map(s=>a.jsxs("li",{className:"packs-modal-subskill",children:[a.jsx("span",{className:"packs-modal-subskill-name",children:s.name}),s.description&&a.jsx("span",{className:"packs-modal-subskill-desc",children:s.description})]},s.name))})]}),r.relatedAgents&&r.relatedAgents.length>0&&a.jsxs("div",{className:"packs-modal-section",children:[a.jsx("h3",{className:"packs-modal-section-title",children:i("packs.detail.agents")}),a.jsx("ul",{className:"packs-modal-agents",children:r.relatedAgents.map(s=>a.jsx("li",{className:"packs-modal-agent",children:s},s))})]})]})]})})}function PR({item:r,onClick:e}){const{t:i}=wr(),n=s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),e(r))};return a.jsxs("div",{className:"packs-card packs-card--clickable",role:"button",tabIndex:0,onClick:()=>e(r),onKeyDown:n,"aria-label":r.name,children:[a.jsxs("div",{className:"packs-card-header",children:[a.jsx("span",{className:"packs-card-name",children:r.name}),r.installed&&a.jsx("span",{className:"packs-installed-pill",children:i("settings.packs.installed")})]}),r.description&&a.jsx("p",{className:"packs-card-desc",children:r.description}),r.tags.length>0&&a.jsx("div",{className:"packs-card-tags",children:r.tags.map(s=>a.jsx("span",{className:"task-tag","data-hue":na(s),children:s},s))}),a.jsx(D$,{item:r})]})}function gme(){const{t:r}=wr(),{data:e,isLoading:i,isError:n,error:s}=O$(),[o,h]=B.useState(null);if(i)return a.jsx("div",{className:"loading",children:r("common.loading")});if(n)return a.jsxs("div",{className:"error-state",children:[r("common.error")," ",s==null?void 0:s.message]});const l=(e==null?void 0:e.packs)??[],u=(e==null?void 0:e.standalone)??[];return a.jsxs("div",{className:"packs-page",children:[l.length===0&&u.length===0&&a.jsx("div",{className:"packs-empty",children:r("common.empty")}),l.length>0&&a.jsxs("section",{className:"packs-section",children:[a.jsx("h2",{className:"packs-section-title",children:r("packs.section.packs")}),a.jsx("div",{className:"packs-grid",children:l.map(d=>a.jsx(PR,{item:d,onClick:h},d.name))})]}),u.length>0&&a.jsxs("section",{className:"packs-section",children:[a.jsx("h2",{className:"packs-section-title",children:r("packs.section.standalone")}),a.jsx("div",{className:"packs-grid",children:u.map(d=>a.jsx(PR,{item:d,onClick:h},d.name))})]}),o!==null&&a.jsx(pme,{item:o,onClose:()=>h(null)})]})}function mme(){return a.jsxs("header",{className:"about-hero",children:[a.jsxs("div",{className:"about-hero-copy",children:[a.jsxs("a",{className:"about-lockup",href:"#top","aria-label":"dreamcontext",children:[a.jsx(cb,{size:34,className:"about-lockup-mark",glow:!0}),a.jsxs("span",{className:"about-lockup-word",children:["dream",a.jsx("span",{style:{color:"var(--color-accent)"},children:"context"})]})]}),a.jsxs("h1",{className:"about-title",children:["The persistent brain for",a.jsx("span",{className:"about-title-accent",children:" AI natives."})]}),a.jsxs("p",{className:"about-lead",children:["It remembers every decision you made, knows how your project is structured, and is learning to act on that knowledge — so every session starts ",a.jsx("em",{children:"ready"})," instead of blind. Built for founders and builders, technical or not."]}),a.jsxs("div",{className:"about-compat",children:[a.jsx("span",{className:"about-compat-mark","aria-hidden":"true",children:"✓"}),"Works with ",a.jsx("strong",{children:"Claude Code"})]}),a.jsxs("div",{className:"about-cta-row",children:[a.jsx("code",{className:"about-command",children:"npm i -g dreamcontext"}),a.jsx("a",{className:"about-link-btn",href:"https://www.npmjs.com/package/dreamcontext",target:"_blank",rel:"noreferrer",children:"npm ↗"}),a.jsx("a",{className:"about-link-btn about-link-btn--ghost",href:"https://github.com/meanllbrl/dreamcontext",target:"_blank",rel:"noreferrer",children:"GitHub ↗"})]})]}),a.jsxs("div",{className:"about-hero-media",children:[a.jsx("div",{className:"about-hero-aura","aria-hidden":"true"}),a.jsxs("video",{className:"about-hero-video",autoPlay:!0,muted:!0,loop:!0,playsInline:!0,poster:"/media/brain-hero.png",children:[a.jsx("source",{src:"/media/brain.webm",type:"video/webm"}),a.jsx("source",{src:"/media/brain.mp4",type:"video/mp4"})]})]})]})}function yme(){return a.jsxs("section",{className:"about-section",children:[a.jsx("p",{className:"about-kicker",children:"The problem"}),a.jsx("h2",{className:"about-h2",children:"Your project is bigger than anyone can hold."}),a.jsxs("p",{className:"about-section-lead",children:["dreamcontext isn't a memory file. It builds a deep understanding of your whole project — the company, the codebase, even how you work — then ",a.jsx("em",{children:"surfaces what's hiding"}),": the scattered decisions, the forgotten reasons, the connections no one wrote down. Because it never forgets and sees the whole graph, the agent sometimes understands your project better than you do."]}),a.jsxs("div",{className:"about-contrast",children:[a.jsxs("div",{className:"about-contrast-card about-contrast-card--bad",children:[a.jsx("span",{className:"about-contrast-tag",children:"Without dreamcontext"}),a.jsxs("ul",{children:[a.jsx("li",{children:"Decisions scatter across chats, commits, and your head"}),a.jsx("li",{children:`The "why" behind last month's choice is already gone`}),a.jsx("li",{children:"You re-explain the project from scratch every session"}),a.jsx("li",{children:"Blind to the connections between what you've decided"})]})]}),a.jsxs("div",{className:"about-contrast-card about-contrast-card--good",children:[a.jsx("span",{className:"about-contrast-tag",children:"With dreamcontext"}),a.jsxs("ul",{children:[a.jsx("li",{children:"Deep understanding of the whole project, across every session"}),a.jsx("li",{children:"Surfaces the hidden links between scattered decisions"}),a.jsx("li",{children:"Holds the whole picture — company, code, and work-life context"}),a.jsx("li",{children:"Gets sharper every time it consolidates what changed"})]})]})]})]})}function dn(r,e,i,n){const s=(e+n)/2;return`M ${r} ${e} C ${r} ${s}, ${i} ${s}, ${i} ${n}`}const Jk=[{file:"soul",region:"Identity",glyph:"◆"},{file:"user",region:"Episodic",glyph:"◉"},{file:"memory",region:"Semantic",glyph:"✦"},{file:"knowledge",region:"Procedural",glyph:"⚙"},{file:"state",region:"Working",glyph:"▦"},{file:"data-structures",region:"Schema",glyph:"▤"},{file:"skills",region:"Capabilities",glyph:"✧"},{file:"sub-agents",region:"Workers",glyph:"⬡"}],Dl=600,pb=250,I$=92,gc=4,zR=(1200-gc*pb)/(gc+1),eS=196,bme=320,vme=bme-eS,xme=120,F$=470,_me=548,qR=632;function $$(r){return zR+r*(pb+zR)}function P$(r){return $$(r)+pb/2}function z$(r){return eS+r*vme}const Cme=Jk.map((r,e)=>{const i=e%gc,n=Math.floor(e/gc);return{id:`cat-${r.file}`,x:$$(i),y:z$(n),w:pb,h:I$,title:r.file,sub:r.region,glyph:r.glyph,variant:"region",breathe:!0,breatheDelay:e*.18}}),wme=Jk.slice(0,gc).map((r,e)=>({id:`fan-${e}`,d:dn(Dl,xme,P$(e),eS),travel:220,delay:e*.18,dur:2.6})),kme=Jk.map((r,e)=>{const i=e%gc,n=Math.floor(e/gc);return{id:`conv-${r.file}`,d:dn(P$(i),z$(n)+I$,Dl,F$),travel:300,delay:.5+e*.12,dur:2.8}}),Sme={viewBox:"0 0 1200 780",ariaLabel:"How dreamcontext works: a SessionStart hook preloads eight context categories — identity, episodic, semantic, procedural, working, schema, capabilities and workers — with zero tool calls. The agent then works with the whole picture, and RemSleep parallel specialists consolidate the session and feed the distilled knowledge back into the context categories. The loop is the product.",nodes:[{id:"hook",x:Dl-215,y:40,w:430,h:80,title:"SessionStart hook fires",sub:"preloads context · 0 tool calls",variant:"hook"},...Cme,{id:"agent",x:Dl-250,y:F$,w:500,h:78,title:"Your agent works with the whole picture",sub:"no re-exploring · no blind search spiral",variant:"agent"},{id:"rem",x:Dl-200,y:qR,w:400,h:78,title:"RemSleep — parallel specialists",sub:"multi-agent consolidation",variant:"rem"}],edges:[...wme,...kme,{id:"agent-rem",d:`M ${Dl} ${_me} L ${Dl} ${qR}`,travel:90,delay:1.6,dur:1.8},{id:"feedback",d:"M 800 671 C 1140 671, 1170 470, 1170 300 C 1170 170, 1110 170, 1010 170",dashed:!0,travel:520,delay:0,dur:4.2,label:{text:"consolidates & feeds back",x:1180,y:420,rotate:90}}]},Ks=550,gb=300,q$=116,HR=3,UR=(1100-HR*gb)/(HR+1),tS=280,Tme=196,H$=470,Eme=540,WR=596;function U$(r){return UR+r*(gb+UR)}function W$(r){return U$(r)+gb/2}const rS=[{id:"sleep-tasks",title:"sleep-tasks",sub:"state/*.md tasks"},{id:"sleep-state",title:"sleep-state",sub:"soul · user · memory · core 3-6 · data-structures · changelog · releases"},{id:"sleep-product",title:"sleep-product",sub:"knowledge/ + features/ · conditional"}],Nme=rS.map((r,e)=>({id:r.id,x:U$(e),y:tS,w:gb,h:q$,title:r.title,sub:r.sub,variant:"region",breathe:!0,breatheDelay:e*.25})),jme=rS.map((r,e)=>({id:`fan-${r.id}`,d:dn(Ks,Tme,W$(e),tS),travel:200,delay:e*.3,dur:2.4})),Ame=rS.map((r,e)=>({id:`conv-${r.id}`,d:dn(W$(e),tS+q$,Ks,H$),travel:200,delay:.9+e*.2,dur:2.4})),Mme={viewBox:"0 0 1100 680",ariaLabel:"Sleep consolidation: sessions accumulate sleep debt; running sleep start fans out to three parallel specialists — sleep-tasks updates task files, sleep-state updates core files, changelog and releases, and sleep-product conditionally updates knowledge and feature docs. Their reports converge into updated system knowledge, then sleep done resets the debt.",nodes:[{id:"debt",x:Ks-230,y:36,w:460,h:76,title:"Sessions accumulate → sleep debt",sub:"Alert · Drowsy · Sleepy · Must Sleep",variant:"accent"},{id:"sleep-start",x:Ks-130,y:132,w:260,h:64,title:"sleep start",sub:"pins the epoch",variant:"hook"},...Nme,{id:"converge",x:Ks-220,y:H$,w:440,h:70,title:"system knowledge updated",sub:"reports stitched into one summary",variant:"agent"},{id:"sleep-done",x:Ks-130,y:WR,w:260,h:64,title:"sleep done",sub:"debt reset",variant:"rem"}],edges:[{id:"debt-start",d:`M ${Ks} 112 L ${Ks} 132`,travel:26,delay:0,dur:1.4},...jme,...Ame,{id:"converge-done",d:`M ${Ks} ${Eme} L ${Ks} ${WR}`,travel:64,delay:1.8,dur:1.8}]},BC=230,G$=230,GR=132,OC=[{id:"prompt",x:40,title:"Your prompt",sub:"any language",variant:"hook"},{id:"bm25",x:320,title:"BM25F keyword match",sub:"field-weighted · stemming · synonyms",variant:"region"},{id:"haiku",x:600,title:"Haiku recall",sub:"smallest cloud agent · 0-3 docs · BM25 fallback",variant:"region"},{id:"snapshot",x:880,title:"SessionStart snapshot",sub:"warm + cold knowledge · features · index · pinned",variant:"rem"}],Lme=OC.map(r=>({id:r.id,x:r.x,y:BC-GR/2,w:G$,h:GR,title:r.title,sub:r.sub,variant:r.variant})),Rme=OC.slice(0,-1).map((r,e)=>{const i=OC[e+1],n=r.x+G$,s=i.x;return{id:`pipe-${r.id}`,d:`M ${n} ${BC} L ${s} ${BC}`,travel:s-n,delay:e*.4,dur:2.2}}),Bme={viewBox:"0 0 1150 460",ariaLabel:"Memory recall pipeline: your prompt is matched by field-weighted BM25F keyword search with stemming and synonyms; a small Haiku cloud agent picks zero to three directly relevant docs (falling back to BM25 when unavailable); and the SessionStart snapshot assembles warm and cold knowledge, features, the index and pinned docs.",nodes:Lme,edges:Rme},Ome=[{n:"01",title:"It loads",body:"A SessionStart hook preloads the whole project picture — soul, user, memory, knowledge and state, plus data-structures, skills and sub-agents — before the agent makes a single tool call."},{n:"02",title:"It works",body:"With identity, history, procedures, schema and capabilities already in context, your agent works against the real project — no re-exploring, no blind search spiral, no re-teaching what it learned last time."},{n:"03",title:"It sleeps",body:"RemSleep is multi-agent: parallel specialists consolidate the session in their own domains and feed the distilled knowledge back into those context files — so the next session starts even sharper."}];function Dme(){return a.jsxs("section",{className:"about-section",children:[a.jsx("p",{className:"about-kicker",children:"How it works"}),a.jsx("h2",{className:"about-h2",children:"A brain that loads, works, and sleeps — across your whole system."}),a.jsxs("p",{className:"about-section-lead",children:["Three moves, repeated every session. A hook preloads the entire context set with"," ",a.jsx("em",{children:"zero tool calls"}),", your agent works with the whole picture, and a multi-agent RemSleep cycle consolidates what changed. The loop is the product."]}),a.jsx(kc,{spec:Sme}),a.jsx("div",{className:"hiw2-steps",children:Ome.map(r=>a.jsxs("div",{className:"hiw2-step",children:[a.jsx("span",{className:"hiw2-step-n",children:r.n}),a.jsx("h3",{className:"hiw2-step-title",children:r.title}),a.jsx("p",{className:"hiw2-step-body",children:r.body})]},r.n))})]})}const Ime=[{level:"Alert",range:"0–3",note:"fresh — nothing to consolidate yet"},{level:"Drowsy",range:"4–6",note:"consolidation offered"},{level:"Sleepy",range:"7–9",note:"advisory note prepended"},{level:"Must Sleep",range:"10+",note:"critical directive prepended"}],Fme=[{name:"sleep-tasks",domain:"state/*.md — logs progress, bumps statuses, reconciles task bodies and workflow nodes.",always:!0},{name:"sleep-state",domain:"soul · user · memory · data-structures · CHANGELOG · RELEASES — surgical core-file updates with an anti-bloat sweep.",always:!0},{name:"sleep-product",domain:"knowledge/ (incl. features/ PRDs) — writes and refreshes knowledge files and feature PRDs.",always:!1}];function $me(){return a.jsxs("section",{className:"about-section",children:[a.jsx("p",{className:"about-kicker",children:"How sleep works"}),a.jsx("h2",{className:"about-h2",children:"It sleeps to remember — like REM, but for your project."}),a.jsxs("p",{className:"about-section-lead",children:["Every session adds ",a.jsx("em",{children:"sleep debt"}),". When it builds up, one command fans out to parallel specialists that fold what changed back into the brain — then resets the meter."]}),a.jsx(kc,{spec:Mme}),a.jsxs("div",{className:"sleepf-cards",children:[a.jsxs("article",{className:"sleepf-card sleepf-card--debt",children:[a.jsx("h3",{className:"sleepf-card-title",children:"Debt accumulates across sessions"}),a.jsx("p",{className:"sleepf-card-body",children:"Each session scores by how much changed; the score adds to a running debt total that crosses graduated thresholds, so consolidation urgency is never ambiguous."}),a.jsx("ul",{className:"sleepf-debt",children:Ime.map(r=>a.jsxs("li",{className:"sleepf-debt-row",children:[a.jsx("span",{className:"sleepf-debt-level",children:r.level}),a.jsx("span",{className:"sleepf-debt-range",children:r.range}),a.jsx("span",{className:"sleepf-debt-note",children:r.note})]},r.level))})]}),a.jsxs("article",{className:"sleepf-card",children:[a.jsx("h3",{className:"sleepf-card-title",children:"Specialists run in parallel"}),a.jsxs("p",{className:"sleepf-card-body",children:[a.jsx("code",{className:"sleepf-cmd",children:"sleep start"})," pins the epoch, then the main agent dispatches the specialists together in a single message — each updating a distinct knowledge domain, never editing outside it."]}),a.jsx("ul",{className:"sleepf-specialists",children:Fme.map(r=>a.jsxs("li",{className:"sleepf-spec-row",children:[a.jsx("code",{className:"sleepf-spec-name",children:r.name}),a.jsx("span",{className:`sleepf-spec-badge${r.always?" sleepf-spec-badge--always":""}`,children:r.always?"always fires":"conditional"}),a.jsx("span",{className:"sleepf-spec-domain",children:r.domain})]},r.name))})]}),a.jsxs("article",{className:"sleepf-card sleepf-card--done",children:[a.jsxs("h3",{className:"sleepf-card-title",children:[a.jsx("code",{className:"sleepf-cmd",children:"sleep done"})," resets the debt"]}),a.jsxs("p",{className:"sleepf-card-body",children:["Their reports converge into one stitched summary of updated system knowledge. The main agent calls ",a.jsx("code",{className:"sleepf-cmd",children:"sleep done"}),", which records the consolidation and resets the debt to zero — ready for the next cycle."]})]})]})]})}const Pme=[{n:"01",tag:"Keyword match",title:"Field-weighted BM25F",body:"Your prompt is matched against the corpus — knowledge, features, tasks, memory and changelog — with field weighting, stemming and synonym expansion. It runs locally in under 100ms, with zero token overhead."},{n:"02",tag:"Intent recall",title:"The Haiku agent",body:"The smallest cloud agent reads your full prompt and a relevance-ranked corpus index, then returns only the 0–3 documents that are directly relevant — resolving intent across languages. If it is unavailable, the pipeline falls back to raw BM25."},{n:"03",tag:"Session start",title:"The snapshot assembles",body:"At SessionStart a hook composes the knowledge distribution — warm and cold knowledge, the features summary, the knowledge index, and pinned docs — and hands it to the agent so it begins each session already oriented."}];function zme(){return a.jsxs("section",{className:"about-section",children:[a.jsx("p",{className:"about-kicker",children:"How the system remembers"}),a.jsx("h2",{className:"about-h2",children:"The right memory, surfaced before you ask."}),a.jsxs("p",{className:"about-section-lead",children:["Remembering is a read pipeline. Three stages take a prompt — or a fresh session — and put exactly the relevant context in front of the agent, so it works on what you actually meant. It ",a.jsx("em",{children:"augments"})," the agent's reach; you stay in the driver's seat."]}),a.jsx(kc,{spec:Bme}),a.jsx("div",{className:"recallf-stages",children:Pme.map(r=>a.jsxs("article",{className:"recallf-stage",children:[a.jsxs("div",{className:"recallf-stage-head",children:[a.jsx("span",{className:"recallf-stage-n",children:r.n}),a.jsx("span",{className:"recallf-stage-tag",children:r.tag})]}),a.jsx("h3",{className:"recallf-stage-title",children:r.title}),a.jsx("p",{className:"recallf-stage-body",children:r.body})]},r.n))})]})}const KR=[{file:"0.soul",glyph:"◆",region:"Identity",brain:"sense of self",desc:"Who it is — purpose, principles, and the rules it must never break."},{file:"1.user",glyph:"◉",region:"Episodic",brain:"lived history",desc:"What you did and decided, session over session."},{file:"2.memory",glyph:"✦",region:"Semantic",brain:"durable facts",desc:"What's true about the project — facts that hold across every session."},{file:"data-structures/",glyph:"▤",region:"Schema",brain:"mental models",desc:"The shapes of your data — the structures everything else is built on."},{file:"knowledge/",glyph:"⚙",region:"Procedural",brain:"learned skill",desc:"How to do things here — patterns, recipes, and hard-won know-how.",rides:{label:"skills",desc:"capabilities it can pick up and apply"}},{file:"state/",glyph:"▦",region:"Working",brain:"in attention",desc:"What's in flight right now — tasks, features, and the sleep cycle.",rides:{label:"sub-agents",desc:"workers it directs under your steer"}}];function qme(){return a.jsxs("section",{className:"about-section arch","aria-labelledby":"arch-heading",children:[a.jsx("p",{className:"about-kicker",children:"The architecture"}),a.jsx("h2",{className:"about-h2",id:"arch-heading",children:"Memory, organized like a mind."}),a.jsx("p",{className:"about-section-lead",children:"Knowledge isn't one flat file. It's laid down in strata — each a purpose-built region that mirrors a part of the brain — so the agent reaches for the right kind of memory at the right moment."}),a.jsxs("div",{className:"arch-stage",role:"img","aria-label":"A cross-section of the project's memory, stacked as layered brain regions.",children:[a.jsx("div",{className:"arch-glow","aria-hidden":"true"}),a.jsx("ol",{className:"arch-stack",children:KR.map((r,e)=>a.jsxs("li",{className:"arch-stratum",style:{"--i":e,"--n":KR.length},children:[a.jsx("div",{className:"arch-edge","aria-hidden":"true"}),a.jsxs("div",{className:"arch-face",children:[a.jsx("span",{className:"arch-glyph","aria-hidden":"true",children:r.glyph}),a.jsxs("div",{className:"arch-meta",children:[a.jsxs("div",{className:"arch-meta-top",children:[a.jsx("code",{className:"arch-file",children:r.file}),a.jsx("span",{className:"arch-region",children:r.region}),a.jsx("span",{className:"arch-brain",children:r.brain})]}),a.jsx("p",{className:"arch-desc",children:r.desc})]}),r.rides?a.jsxs("div",{className:"arch-rides",children:[a.jsx("span",{className:"arch-rides-plus","aria-hidden":"true",children:"+"}),a.jsx("span",{className:"arch-rides-label",children:r.rides.label}),a.jsx("span",{className:"arch-rides-desc",children:r.rides.desc})]}):null]})]},r.file))})]}),a.jsxs("p",{className:"arch-foot",children:["Six strata, one mind — read top-down, the agent goes from"," ",a.jsx("em",{children:"who it is"})," to ",a.jsx("em",{children:"what it's doing right now"}),"."]})]})}function Hme(r){return"base"in r}function VR({item:r}){const e=Hme(r)?"pack":"standalone",i=e==="pack"?"pack":r.tags[0]??"standalone";return a.jsxs("li",{className:"marquee-card",children:[a.jsx("span",{className:`marquee-chip marquee-chip--${e}`,children:i}),a.jsx("span",{className:"marquee-card-name",children:r.name}),r.description&&a.jsx("p",{className:"marquee-card-desc",children:r.description})]})}function Ume(){const{data:r,isLoading:e,isError:i}=O$(),n=B.useMemo(()=>r?[...r.packs,...r.standalone]:[],[r]),s=Math.min(60,Math.max(40,n.length*2.2)),o=a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"about-kicker",children:"Skill packs"}),a.jsx("h2",{className:"about-h2",children:"A growing library of expertise."}),a.jsx("p",{className:"about-section-lead",children:"The agent loads the right pack for the task — and more are added all the time."})]});return e?a.jsxs("section",{className:"about-section",children:[o,a.jsx("div",{className:"marquee-viewport marquee-viewport--static","aria-hidden":"true",children:a.jsx("ul",{className:"marquee-track marquee-track--skeleton",children:Array.from({length:6}).map((h,l)=>a.jsx("li",{className:"marquee-card marquee-card--skeleton"},l))})}),a.jsx("p",{className:"marquee-status",children:"Loading packs…"})]}):i||n.length===0?a.jsx("section",{className:"about-section",children:o}):a.jsxs("section",{className:"about-section",children:[o,a.jsxs("div",{className:"marquee-viewport",style:{"--marquee-duration":`${s}s`},children:[a.jsx("ul",{className:"marquee-track",children:n.map(h=>a.jsx(VR,{item:h},`a-${h.name}`))}),a.jsx("ul",{className:"marquee-track marquee-track--dup","aria-hidden":"true",children:n.map(h=>a.jsx(VR,{item:h},`b-${h.name}`))})]})]})}const ll="0 0 360 170";function K$(r,e,i){return{viewBox:ll,ariaLabel:r,nodes:[{id:"a",x:20,y:50,w:140,h:70,title:e.title,sub:e.sub,variant:e.variant??"hook"},{id:"b",x:200,y:50,w:140,h:70,title:i.title,sub:i.sub,variant:i.variant??"rem"}],edges:[{id:"a-b",d:"M 160 85 L 200 85",travel:40,dur:2}]}}const Wme={viewBox:ll,ariaLabel:"Context snapshot: a SessionStart hook injects the soul, memory, active tasks and knowledge index straight into the agent with zero tool calls.",nodes:[{id:"hook",x:110,y:12,w:140,h:50,title:"SessionStart",sub:"0 tool calls",variant:"hook"},{id:"brain",x:16,y:100,w:150,h:56,title:"project brain",sub:"soul · memory · tasks",variant:"region",breathe:!0},{id:"agent",x:194,y:100,w:150,h:56,title:"your agent",sub:"oriented",variant:"agent"}],edges:[{id:"h-b",d:dn(180,62,91,100),travel:80,dur:2.2},{id:"b-a",d:"M 166 128 L 194 128",travel:28,dur:1.6,delay:.5}]},Gme={viewBox:ll,ariaLabel:"Memory recall: a question is scored by BM25 keyword match, optionally refined by a small Haiku agent, returning the most relevant docs in under 100 milliseconds.",nodes:[{id:"q",x:14,y:52,w:96,h:66,title:"question",sub:"any language",variant:"hook"},{id:"bm25",x:132,y:52,w:96,h:66,title:"BM25",sub:"+ Haiku",variant:"region",breathe:!0},{id:"docs",x:250,y:52,w:96,h:66,title:"top docs",sub:"<100ms",variant:"rem"}],edges:[{id:"q-b",d:"M 110 85 L 132 85",travel:22,dur:1.6},{id:"b-d",d:"M 228 85 L 250 85",travel:22,dur:1.6,delay:.4}]},Kme={viewBox:ll,ariaLabel:"RemSleep: accumulated sleep debt triggers a fan-out to three parallel specialists that consolidate the session and reset the meter.",nodes:[{id:"debt",x:108,y:10,w:144,h:46,title:"sleep debt",sub:"crosses threshold",variant:"accent"},{id:"s1",x:14,y:92,w:100,h:50,title:"sleep-tasks",variant:"region",breathe:!0},{id:"s2",x:130,y:92,w:100,h:50,title:"sleep-state",variant:"region",breathe:!0,breatheDelay:.2},{id:"s3",x:246,y:92,w:100,h:50,title:"sleep-product",variant:"region",breathe:!0,breatheDelay:.4}],edges:[{id:"d-1",d:dn(180,56,64,92),travel:90,dur:2.2},{id:"d-2",d:"M 180 56 L 180 92",travel:36,dur:1.8,delay:.2},{id:"d-3",d:dn(180,56,296,92),travel:90,dur:2.2,delay:.4}]},Vme={viewBox:ll,ariaLabel:"Brain-region core files: soul, user, memory and the knowledge index sit in a numbered band the snapshot always loads.",nodes:[{id:"soul",x:14,y:24,w:158,h:54,title:"0.soul",sub:"identity · rules",variant:"region",breathe:!0},{id:"mem",x:188,y:24,w:158,h:54,title:"2.memory",sub:"decisions · issues",variant:"region",breathe:!0,breatheDelay:.2},{id:"user",x:14,y:96,w:158,h:54,title:"1.user",sub:"preferences",variant:"region",breathe:!0,breatheDelay:.4},{id:"know",x:188,y:96,w:158,h:54,title:"knowledge",sub:"index · pinned",variant:"region",breathe:!0,breatheDelay:.6}],edges:[]},Yme={viewBox:ll,ariaLabel:"Tag-based relation graph: knowledge, features and tasks link through shared tags into a navigable brain view.",nodes:[{id:"tag",x:110,y:58,w:140,h:54,title:"shared tag",sub:"the edge",variant:"accent",breathe:!0},{id:"k",x:14,y:10,w:110,h:44,title:"knowledge",variant:"region"},{id:"f",x:236,y:10,w:110,h:44,title:"features",variant:"region"},{id:"t",x:125,y:122,w:110,h:40,title:"tasks",variant:"region"}],edges:[{id:"k-tag",d:dn(69,54,150,58),travel:90,dur:2.4},{id:"f-tag",d:dn(291,54,210,58),travel:90,dur:2.4,delay:.4},{id:"t-tag",d:"M 180 122 L 180 112",travel:12,dur:1.6,delay:.8}]},Xme={viewBox:ll,ariaLabel:"Task management: each task carries a LIFO changelog viewable as a Kanban board, an Eisenhower matrix, or RICE-scored.",nodes:[{id:"task",x:16,y:50,w:130,h:70,title:"task .md",sub:"LIFO changelog",variant:"hook"},{id:"views",x:200,y:24,w:144,h:44,title:"Kanban",variant:"region",breathe:!0},{id:"eis",x:200,y:74,w:144,h:40,title:"Eisenhower",variant:"region",breathe:!0,breatheDelay:.2},{id:"rice",x:200,y:120,w:144,h:40,title:"RICE score",variant:"region",breathe:!0,breatheDelay:.4}],edges:[{id:"t-k",d:dn(146,85,272,46),travel:90,dur:2.2},{id:"t-e",d:"M 146 85 L 200 94",travel:56,dur:2,delay:.3},{id:"t-r",d:dn(146,85,272,140),travel:90,dur:2.2,delay:.6}]},Zme={viewBox:ll,ariaLabel:"Sub-agents: the main agent fans work out to briefed specialist sub-agents that report back, keeping the main context small.",nodes:[{id:"main",x:110,y:12,w:140,h:46,title:"main agent",variant:"agent"},{id:"a",x:16,y:96,w:96,h:50,title:"reviewer",variant:"region",breathe:!0},{id:"b",x:132,y:96,w:96,h:50,title:"planner",variant:"region",breathe:!0,breatheDelay:.2},{id:"c",x:248,y:96,w:96,h:50,title:"researcher",variant:"region",breathe:!0,breatheDelay:.4}],edges:[{id:"m-a",d:dn(180,58,64,96),travel:90,dur:2.2},{id:"m-b",d:"M 180 58 L 180 96",travel:38,dur:1.8,delay:.2},{id:"m-c",d:dn(180,58,296,96),travel:90,dur:2.2,delay:.4}]},Qme={viewBox:"0 0 400 232",ariaLabel:"Council: three persona sub-agents debate each other in a cycle — each sees the others’ reasoning, round after round — then the debate converges into a synthesizer that writes one decision report.",nodes:[{id:"p1",x:70,y:14,w:96,h:46,title:"persona",sub:"lens A",variant:"region",breathe:!0},{id:"p2",x:18,y:118,w:96,h:46,title:"persona",sub:"lens B",variant:"region",breathe:!0,breatheDelay:.25},{id:"p3",x:130,y:118,w:96,h:46,title:"persona",sub:"lens C",variant:"region",breathe:!0,breatheDelay:.5},{id:"syn",x:286,y:70,w:104,h:72,title:"synthesizer",sub:"decision report",variant:"rem"}],edges:[{id:"p1-p2",d:"M 96 60 L 80 118",travel:60,dur:1.8},{id:"p2-p3",d:"M 114 141 L 130 141",travel:16,dur:1.1,delay:.3,label:{text:"↻ rounds",x:118,y:95}},{id:"p3-p1",d:"M 178 118 L 152 60",travel:60,dur:1.8,delay:.6},{id:"p1-syn",d:dn(166,40,286,96),travel:130,dur:2.4,delay:.4},{id:"p3-syn",d:dn(226,136,286,116),travel:76,dur:2.2,delay:.9}]},Jme={viewBox:"0 0 1000 330",ariaLabel:"Goal-skill orchestration: a goal-planner drafts a file-by-file plan; parallel reviewers vote SOLID or NEEDS_WORK and loop back to the planner until solid; the plan is persisted as a task; a goal-implementer builds to the acceptance criteria; a code reviewer and then a goal-validator each gate the result, looping back to the implementer on FAIL; every gate is capped at three retries before escalating to the user, after which the work ships as a task in review.",nodes:[{id:"plan",x:20,y:40,w:140,h:86,title:"planner",sub:"file-by-file plan",variant:"agent"},{id:"plan-review",x:184,y:40,w:140,h:86,title:"plan review",sub:"SOLID · NEEDS_WORK",variant:"region",breathe:!0},{id:"impl",x:348,y:40,w:140,h:86,title:"implementer",sub:"builds to criteria",variant:"agent"},{id:"code-review",x:512,y:40,w:140,h:86,title:"code review",sub:"PASS · FAIL",variant:"region",breathe:!0,breatheDelay:.2},{id:"validate",x:676,y:40,w:140,h:86,title:"validator",sub:"tests · PASS · FAIL",variant:"region",breathe:!0,breatheDelay:.4},{id:"done",x:840,y:40,w:140,h:86,title:"shipped",sub:"task → in_review",variant:"rem"}],edges:[{id:"f1",d:"M 160 83 L 184 83",dur:2},{id:"f2",d:"M 324 83 L 348 83",dur:2,delay:.2},{id:"f3",d:"M 488 83 L 512 83",dur:2,delay:.1},{id:"f4",d:"M 652 83 L 676 83",dur:2,delay:.2},{id:"f5",d:"M 816 83 L 840 83",dur:2,delay:.3},{id:"l1",d:"M 254 126 C 254 196, 90 196, 90 126",dashed:!0,dur:3.2,delay:.5,label:{text:"↻ ≤3",x:172,y:186}},{id:"l2",d:"M 582 126 C 582 196, 418 196, 418 126",dashed:!0,dur:3.2,delay:.7,label:{text:"↻ ≤3",x:500,y:186}},{id:"l3",d:"M 746 126 C 746 262, 418 262, 418 126",dashed:!0,dur:3.6,delay:.9,label:{text:"↻ ≤3",x:582,y:252}}]},eye=K$("Skill packs: curated domain packs install a base skill plus on-demand sub-skills into the agent.",{title:"skill pack",sub:"engineering · design · growth",variant:"hook"},{title:"agent gains",sub:"base + sub-skills",variant:"rem"}),tye=K$("Knowledge base: tagged knowledge files are indexed every session; pinned files load warm, the rest load cold on demand.",{title:"knowledge/*.md",sub:"tagged · indexed",variant:"region"},{title:"snapshot",sub:"warm + cold",variant:"rem"}),V$=[{id:"context-snapshot",title:"Context snapshot",tagline:"Every session starts with the whole brain, zero tool calls.",body:"A SessionStart hook injects your project identity, user preferences, memory, active tasks and the knowledge index straight into the agent — so it orients instantly instead of grepping around blind.",defaultOpen:!0,tag:"Memory",flow:Wme},{id:"memory-recall",title:"Memory recall",tagline:'Ask "where did we decide X?" and get an answer in under 100ms.',body:"A deterministic BM25 search ranks every knowledge file, PRD, task, memory entry and changelog line — optionally sharpened by a small Haiku agent — so the right context surfaces without scrolling or grepping. Handles English, Turkish and mixed queries.",defaultOpen:!0,tag:"Memory",flow:Gme},{id:"rem-sleep",title:"RemSleep consolidation",tagline:"It sleeps to remember — multi-agent consolidation, like REM.",body:"Sessions accumulate sleep debt; when it builds up, one command fans out to three parallel specialists that fold what changed back into the brain, then resets the meter. Knowledge compounds instead of decaying.",defaultOpen:!0,tag:"Sleep",flow:Kme},{id:"brain-regions",title:"Brain-region core files",tagline:"A numbered band of core files — soul, user, memory, knowledge.",body:"The brain is a handful of small, always-loaded files: identity and rules, user preferences, durable memory, and the knowledge index. Kept lightweight on purpose so the snapshot stays under budget every session.",defaultOpen:!0,tag:"Memory",flow:Vme},{id:"knowledge-base",title:"Knowledge base",tagline:"Tagged research that loads warm when pinned, cold on demand.",body:"Deep research and domain context live in tagged knowledge files the snapshot indexes every session. Pin the critical ones to load them in full; the rest stay one read away when an agent needs them.",defaultOpen:!0,tag:"Knowledge",flow:tye},{id:"brain-graph",title:"Relation graph (Brain view)",tagline:"Knowledge, features and tasks linked through shared tags.",body:"A tag-based graph connects every knowledge file, feature and task into one navigable Brain view — so you can see how the parts of a project relate instead of reading them one file at a time.",defaultOpen:!0,tag:"Knowledge",flow:Yme},{id:"task-management",title:"Task management",tagline:"LIFO changelogs, viewable as Kanban, Eisenhower or RICE.",body:"Each task is a Markdown file with a LIFO changelog, so any session reads where the last one left off. View the backlog as a Kanban board, triage it on an Eisenhower matrix, or rank it numerically with RICE — Reach × Impact × Confidence ÷ Effort.",defaultOpen:!0,tag:"Tasks",flow:Xme},{id:"skill-packs",title:"Skill packs",tagline:"Curated, installable skills by domain — one command.",body:"Extend an agent with domain packs — engineering, design, growth, brand-voice and more — each a base skill plus on-demand sub-skills. Install interactively or name a pack directly; prerequisites resolve automatically.",defaultOpen:!0,tag:"Skills",flow:eye},{id:"sub-agents",title:"Sub-agents",tagline:"Fan work out to briefed specialists; keep the main context lean.",body:"The main agent dispatches focused sub-agents — reviewers, planners, researchers — each launched with a lightweight context briefing so it knows the project structure without any tool calls. They report back; the main thread stays small.",defaultOpen:!0,tag:"Agents",flow:Zme},{id:"council",title:"Council",tagline:"Persona sub-agents debate a hard call, a synthesizer decides.",body:"For a non-trivial decision, Council spins up 3–10 persona sub-agents that debate across rounds, see each other's reasoning, then hand off to a dedicated synthesizer that writes one decision report — promotable straight into knowledge.",defaultOpen:!0,tag:"Agents",flow:Qme},{id:"goal-skill",title:"Goal-skill orchestration",tagline:"Plan it, review it, build it, review it, validate it — on a leash.",body:"Turn the main agent into an orchestrator. A goal-planner drafts a file-by-file plan; parallel reviewers vote SOLID or NEEDS_WORK and bounce it back until it holds; the plan is persisted as a task; a goal-implementer builds to the acceptance criteria; then a code reviewer and a goal-validator each gate the result, looping back to the implementer on a fail. Every gate is capped at three retries and escalates to you instead of spinning.",defaultOpen:!0,tag:"Agents",flow:Jme},{id:"bookmarking",title:"Bookmarking (salience)",tagline:"High-signal moments tagged so sleep can find them later.",body:"Corrections, error-to-fix turns and decisions are auto-bookmarked during a session, marking the moments worth keeping — so consolidation folds the right learnings into the brain without manual flagging.",defaultOpen:!1,tag:"Memory",glyph:"◈"},{id:"warm-cold-knowledge",title:"Warm vs cold knowledge",tagline:"Pinned files load in full; the rest stay one read away.",body:"Pinned (warm) knowledge is inlined into every snapshot; unpinned (cold) knowledge appears only in the index and loads on demand. The split keeps the always-on context small while nothing gets lost.",defaultOpen:!1,tag:"Knowledge",glyph:"❄"},{id:"feature-prds",title:"Feature PRDs",tagline:"Living docs that capture not just what was built, but why.",body:"Each feature has a PRD with user stories, acceptance criteria and design decisions that update as work progresses — so an agent understands the product surface without reconstructing it from conversation history.",defaultOpen:!1,tag:"Knowledge",glyph:"▤"},{id:"versions-releases",title:"Versions & releases",tagline:"Changelog and release readiness tracked in the brain.",body:"A structured changelog and release notes live alongside the context, so version history and release readiness are part of the brain the agent reads — not an afterthought scattered across commits.",defaultOpen:!1,tag:"Knowledge",glyph:"⎇"},{id:"multi-vault",title:"Multi-vault registry",tagline:"Switch between project brains from one global registry.",body:"A global vault registry tracks every project brain on your machine. List, add and remove vaults, then point the dashboard at any one — so multiple projects each keep their own clean context.",defaultOpen:!1,tag:"Setup",glyph:"▦"},{id:"multi-product",title:"Multi-product support",tagline:"Per-product knowledge auto-injected from the active task.",body:"Monorepos and portfolios get a product namespace: per-product knowledge and data structures, plus automatic injection of the right product's knowledge at session start when the active task carries a product tag.",defaultOpen:!1,tag:"Knowledge",glyph:"◫"},{id:"manifest-install",title:"Manifest install & update",tagline:"Clean upgrades — stale files tracked and removed, not layered.",body:"A manifest tracks every file dreamcontext owns, so updates remove what a new version drops instead of leaving stale agents and configs behind. Includes a one-line install script and an in-session update nudge.",defaultOpen:!1,tag:"Setup",glyph:"⟳"},{id:"project-init",title:"Project initialization",tagline:"Blank repo to agent-aware workspace in under a minute.",body:"One init command scaffolds the whole context directory, detects your tech stack, runs token substitution on the templates, and wires up the Claude Code hooks — no manual setup.",defaultOpen:!1,tag:"Setup",glyph:"⊕"},{id:"control-panel",title:"Control panel",tagline:"Configure platforms, packs and vaults in the browser.",body:"The dashboard control panel closes the loop on configuration — edit platforms and skill packs, see which packs are actually installed on disk, manage vaults, and get notified in-app when a newer version ships.",defaultOpen:!1,tag:"Setup",glyph:"⚙"},{id:"multi-review",title:"Multi-review",tagline:"Route a diff to niche reviewers, get one merged report.",body:"A router classifies a diff by domain and dispatches specialist reviewers — security, frontend, cloud functions, edge cases — in parallel; a coordinator dedupes their findings into a single report. Each specialist reviews against your live project rules.",defaultOpen:!1,tag:"Agents",glyph:"⊜"},{id:"continuous-capture",title:"Continuous capture",tagline:"Session digests and auto-bookmarks, searchable next session.",body:"Transcripts are digested and indexed as you work, so a decision from one session is searchable in the next — before any sleep consolidation runs. Capture is down-weighted so it never crowds out curated knowledge.",defaultOpen:!1,tag:"Memory",glyph:"◌"},{id:"context-gate",title:"Context gate",tagline:"Nudges the agent to load relevant skills before it acts.",body:"A prompt-time hook detects when an installed skill is plausibly relevant and injects a directive to review the full skill list and invoke what fits — deliberately not a pre-selected top-N, so the right skill is never anchored out.",defaultOpen:!1,tag:"Skills",glyph:"⊳"},{id:"auto-dashboard",title:"Auto-open dashboard hook",tagline:"The dashboard surfaces itself when it is worth a look.",body:"A hook can open the dashboard at the right moment so the visual view of tasks, knowledge and the brain is one glance away — without you remembering to launch it.",defaultOpen:!1,tag:"Setup",glyph:"◰"},{id:"post-edit-hook",title:"Post-edit format & typecheck",tagline:"Format and typecheck fire automatically after an edit.",body:"A post-edit hook runs your formatter and type checker right after the agent changes a file, so problems surface immediately instead of piling up — keeping the working tree clean as work proceeds.",defaultOpen:!1,tag:"Setup",glyph:"✓"},{id:"marketing-pack",title:"Marketing pack",tagline:"Brand-voice and growth skills for going to market.",body:"A bundled set of go-to-market skills — brand voice, growth, performance marketing — so the same agent that builds a feature can help position and launch it, on-brand.",defaultOpen:!1,tag:"Skills",glyph:"✦"}],DC=V$.filter(r=>r.defaultOpen),YR=V$.filter(r=>!r.defaultOpen),ns=DC.length,E_=16,rye=62,iye=.72,nye=40,sye=140,aye=8;function oye(){const[r,e]=B.useState(0),i=B.useId(),n=B.useRef([]),s=B.useRef([]),o=B.useRef([]),h=B.useRef(null),l=B.useRef(null),u=B.useRef(null),d=B.useRef(!1),g=B.useRef(0),f=b=>`${i}-tab-${b}`,m=b=>`${i}-panel-${b}`,y=B.useCallback(b=>{const x=Math.max(0,Math.min(ns-1,b));x!==g.current&&(g.current=x,e(x))},[]);B.useLayoutEffect(()=>{const b=h.current,x=l.current;if(!b||!x)return;d.current=window.matchMedia("(prefers-reduced-motion: reduce)").matches;const C=b.closest(".shell-main")??null,k=C??window;let T=0;const N=()=>{T=0;const L=b.getBoundingClientRect(),O=C?C.getBoundingClientRect().top:0,D=L.height-x.offsetHeight;if(D<=0)return;const K=Math.max(0,Math.min(1,(O+E_-L.top)/D));u.current&&(u.current.style.transform=`scaleX(${K})`);const z=K*(ns-1);for(let H=0;H<ns;H++){const P=s.current[H];if(!P)continue;const $=H-z,W=Math.abs($);P.style.opacity=String(Math.max(0,1-W/iye)),P.style.transform=d.current?"none":`translate3d(0, ${$*nye}px, 0)`;const V=W<.5;P.style.zIndex=V?"2":"1",P.style.pointerEvents=V?"auto":"none";const F=W<1.05;o.current[H]!==F&&(o.current[H]=F,P.classList.toggle("feat-panel--near",F))}y(Math.round(z))};let A=0;const j=()=>{if(!C)return;const L=b.getBoundingClientRect(),O=L.height-x.offsetHeight;if(O<=0)return;const D=(C.getBoundingClientRect().top+E_-L.top)/O;if(D<=.012||D>=.988)return;const z=(Math.round(D*(ns-1))/(ns-1)-D)*O;Math.abs(z)<aye||C.scrollTo({top:C.scrollTop+z,behavior:d.current?"auto":"smooth"})},E=()=>{T||(T=requestAnimationFrame(N)),A&&clearTimeout(A),A=window.setTimeout(j,sye)};return k.addEventListener("scroll",E,{passive:!0}),window.addEventListener("resize",E),N(),()=>{k.removeEventListener("scroll",E),window.removeEventListener("resize",E),T&&cancelAnimationFrame(T),A&&clearTimeout(A)}},[y]);const w=B.useCallback(b=>{const x=h.current,C=l.current,k=x==null?void 0:x.closest(".shell-main");if(!x||!C||!k){y(b);return}const T=x.getBoundingClientRect(),N=T.height-C.offsetHeight;if(N<=0){y(b);return}const j=b/(ns-1)*N-(k.getBoundingClientRect().top+E_-T.top);k.scrollTo({top:k.scrollTop+j,behavior:d.current?"auto":"smooth"})},[y]);function _(b){var C;let x=g.current;if(b.key==="ArrowDown"||b.key==="ArrowRight")x=(g.current+1)%ns;else if(b.key==="ArrowUp"||b.key==="ArrowLeft")x=(g.current-1+ns)%ns;else if(b.key==="Home")x=0;else if(b.key==="End")x=ns-1;else return;b.preventDefault(),y(x),(C=n.current[x])==null||C.focus(),w(x)}return a.jsxs("section",{className:"about-section feat-section",children:[a.jsx("div",{className:"feat-scroller",ref:h,style:{"--feat-track-h":`${ns*rye}vh`},children:a.jsxs("div",{className:"feat-sticky",ref:l,children:[a.jsx("p",{className:"about-kicker",children:"Everything inside"}),a.jsx("h2",{className:"about-h2",children:"One brain, many faculties."}),a.jsxs("p",{className:"about-section-lead",children:["Every capability dreamcontext gives your agents — ",a.jsx("em",{children:"scroll to move through them, or pick one."})]}),a.jsxs("div",{className:"feat-spotlight",children:[a.jsxs("div",{className:"feat-rail-wrap",children:[a.jsxs("div",{className:"feat-rail-head","aria-hidden":"true",children:[a.jsxs("span",{className:"feat-rail-step",children:[String(r+1).padStart(2,"0")," ",a.jsxs("i",{children:["/ ",String(ns).padStart(2,"0")]})]}),a.jsx("div",{className:"feat-rail-track",children:a.jsx("span",{className:"feat-rail-fill",ref:u})})]}),a.jsx("div",{className:"feat-rail",role:"tablist","aria-orientation":"vertical","aria-label":"Core faculties",onKeyDown:_,children:DC.map((b,x)=>{const C=x===r;return a.jsxs("button",{ref:k=>{n.current[x]=k},id:f(x),role:"tab",type:"button","aria-selected":C,"aria-controls":m(x),tabIndex:C?0:-1,className:`feat-rail-item${C?" feat-rail-item--active":""}`,onClick:()=>{y(x),w(x)},children:[a.jsx("span",{className:"feat-rail-title",children:b.title}),b.tag&&a.jsx("span",{className:"feat-rail-tag",children:b.tag})]},b.id)})})]}),a.jsx("div",{className:"feat-stage",children:DC.map((b,x)=>a.jsxs("div",{ref:C=>{s.current[x]=C},className:"feat-panel",role:"tabpanel",id:m(x),"aria-labelledby":f(x),"aria-hidden":x!==r,tabIndex:x===r?0:-1,children:[a.jsxs("div",{className:"feat-stage-head",children:[b.tag&&a.jsx("span",{className:"feat-stage-chip",children:b.tag}),a.jsx("h3",{className:"feat-stage-title",children:b.title})]}),a.jsx("p",{className:"feat-stage-body",children:b.body}),b.flow&&a.jsx(kc,{spec:b.flow,className:"feat-stage-flow"})]},b.id))})]})]})}),a.jsxs("div",{className:"feat-more",children:[a.jsxs("div",{className:"feat-more-head",children:[a.jsx("span",{className:"feat-more-label",children:"Everything else"}),a.jsx("span",{className:"feat-more-count",children:YR.length})]}),a.jsx("div",{className:"feat-more-grid",children:YR.map(b=>a.jsxs("div",{className:"feat-more-card",children:[a.jsx("span",{className:"feat-more-glyph","aria-hidden":"true",children:b.glyph??"✦"}),a.jsxs("div",{className:"feat-more-meta",children:[a.jsx("span",{className:"feat-more-title",children:b.title}),a.jsx("span",{className:"feat-more-tagline",children:b.tagline})]})]},b.id))})]})]})}const lye=[{cmd:"dreamcontext init",hint:"# set up the brain"},{cmd:"dreamcontext dashboard",hint:"# open this dashboard"},{cmd:"dreamcontext sleep",hint:"# consolidate the session"}];function cye(){return a.jsxs("section",{className:"closing","aria-labelledby":"closing-heading",children:[a.jsx("h2",{className:"closing-title",id:"closing-heading",children:"So — what is this?"}),a.jsxs("p",{className:"closing-body",children:[a.jsx("strong",{children:"dreamcontext"})," is a small CLI that gives your AI coding agents a structured, persistent brain across sessions. It pre-loads what matters, keeps a living map of your project, and consolidates new knowledge as you go — so you stop paying, every single session, to re-teach the agent what it already learned."]}),a.jsx("div",{className:"closing-cmds",role:"list",children:lye.map(r=>a.jsxs("div",{className:"closing-cmd",role:"listitem",children:[a.jsx("span",{className:"closing-cmd-c","aria-hidden":"true",children:"$"}),a.jsx("span",{className:"closing-cmd-text",children:r.cmd}),a.jsx("span",{className:"closing-cmd-hint",children:r.hint})]},r.cmd))}),a.jsx("p",{className:"closing-foot",children:"You're looking at the dashboard now. The brain graph, tasks, and sleep state in the sidebar are this project's actual memory — live."})]})}function hye(){return a.jsxs("div",{className:"about","data-testid":"about-page",children:[a.jsx(mme,{}),a.jsx(yme,{}),a.jsx(Dme,{}),a.jsx($me,{}),a.jsx(zme,{}),a.jsx(qme,{}),a.jsx(Ume,{}),a.jsx(oye,{}),a.jsx(cye,{})]})}function uye(){return Yt({queryKey:["taxonomy"],queryFn:()=>De.get("/taxonomy")})}const dye={domain:"Domain",layer:"Layer",kind:"Kind",topic:"Topic"};function XR({tag:r,count:e,dimmed:i}){return a.jsxs("span",{className:`taxonomy-chip${i?" taxonomy-chip--dim":""}`,"data-hue":na(r),title:e>0?`${e} use${e===1?"":"s"}`:"unused",children:[a.jsx("span",{className:"taxonomy-chip-label",children:r}),e>0&&a.jsx("span",{className:"taxonomy-chip-count",children:e})]})}function nm({label:r,count:e,children:i,defaultOpen:n=!1}){const[s,o]=B.useState(n);return e===0?null:a.jsxs("div",{className:"taxonomy-expandable",children:[a.jsxs("button",{className:"taxonomy-expandable-header",onClick:()=>o(h=>!h),"aria-expanded":s,children:[a.jsx("span",{className:"taxonomy-expandable-chevron",children:s?"▾":"▸"}),a.jsx("span",{className:"taxonomy-expandable-label",children:r}),a.jsx("span",{className:"taxonomy-expandable-badge",children:e})]}),s&&a.jsx("div",{className:"taxonomy-expandable-body",children:i})]})}function fye(){const{t:r}=wr(),{data:e,isLoading:i,isError:n,error:s}=uye();if(i)return a.jsx("div",{className:"loading",children:r("common.loading")});if(n)return a.jsxs("div",{className:"error-state",children:["Failed to load taxonomy. ",s==null?void 0:s.message]});if(!e)return null;const{vocabulary:o,usage:h,audit:l}=e,u=["domain","layer","kind","topic"],d=l.untagged.length===0&&l.nonCanonical.length===0&&l.orphan.length===0&&l.nearDups.length===0;return a.jsxs("div",{className:"taxonomy-page",children:[a.jsxs("section",{className:"taxonomy-section",children:[a.jsx("h2",{className:"taxonomy-section-heading",children:"Faceted Tags"}),a.jsx("div",{className:"taxonomy-facets",children:u.map(g=>{const f=o.facetTags[g]??[];return f.length===0?null:a.jsxs("div",{className:"taxonomy-facet-group",children:[a.jsx("span",{className:"taxonomy-facet-label",children:dye[g]??g}),a.jsx("div",{className:"taxonomy-chip-cluster",children:f.map(m=>{const y=h[m]??0;return a.jsx(XR,{tag:m,count:y,dimmed:y===0},m)})})]},g)})})]}),o.bareTags.length>0&&a.jsxs("section",{className:"taxonomy-section",children:[a.jsx("h2",{className:"taxonomy-section-heading",children:"Bare Tags"}),a.jsx("div",{className:"taxonomy-chip-cluster",children:o.bareTags.map(g=>{const f=h[g]??0;return a.jsx(XR,{tag:g,count:f,dimmed:f===0},g)})})]}),Object.keys(o.aliases).length>0&&a.jsxs("section",{className:"taxonomy-section",children:[a.jsx("h2",{className:"taxonomy-section-heading",children:"Aliases"}),a.jsx("div",{className:"taxonomy-alias-list",children:Object.entries(o.aliases).map(([g,f])=>a.jsxs("div",{className:"taxonomy-alias-pair",children:[a.jsx("span",{className:"taxonomy-chip taxonomy-chip--alias","data-hue":na(g),children:a.jsx("span",{className:"taxonomy-chip-label",children:g})}),a.jsx("span",{className:"taxonomy-alias-arrow","aria-hidden":"true",children:"→"}),a.jsx("span",{className:"taxonomy-chip","data-hue":na(f),children:a.jsx("span",{className:"taxonomy-chip-label",children:f})})]},g))})]}),a.jsxs("section",{className:"taxonomy-section",children:[a.jsx("h2",{className:"taxonomy-section-heading",children:"Drift Audit"}),d?a.jsxs("div",{className:"taxonomy-healthy",children:[a.jsx("span",{className:"taxonomy-healthy-icon",children:"✓"}),a.jsx("span",{children:"Taxonomy healthy — no drift detected."})]}):a.jsxs("div",{className:"taxonomy-audit-panel",children:[a.jsx(nm,{label:"Untagged docs",count:l.untagged.length,defaultOpen:l.untagged.length>0,children:a.jsx("ul",{className:"taxonomy-audit-list",children:l.untagged.map(g=>a.jsx("li",{className:"taxonomy-audit-item",children:a.jsx("code",{children:g})},g))})}),a.jsx(nm,{label:"Non-canonical tags",count:l.nonCanonical.length,defaultOpen:l.nonCanonical.length>0,children:a.jsx("ul",{className:"taxonomy-audit-list",children:l.nonCanonical.map((g,f)=>a.jsxs("li",{className:"taxonomy-audit-item taxonomy-audit-item--suggest",children:[a.jsx("code",{className:"taxonomy-audit-doc",children:g.doc}),a.jsx("span",{className:"taxonomy-audit-tag",children:g.tag}),g.suggestion!==g.tag&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"taxonomy-alias-arrow","aria-hidden":"true",children:"→"}),a.jsx("span",{className:"taxonomy-audit-suggestion",children:g.suggestion})]})]},f))})}),a.jsx(nm,{label:"Orphan tags",count:l.orphan.length,defaultOpen:l.orphan.length>0,children:a.jsx("ul",{className:"taxonomy-audit-list",children:l.orphan.map(g=>a.jsx("li",{className:"taxonomy-audit-item",children:a.jsx("span",{className:"taxonomy-audit-tag",children:g})},g))})}),a.jsx(nm,{label:"Near-duplicates",count:l.nearDups.length,defaultOpen:l.nearDups.length>0,children:a.jsx("ul",{className:"taxonomy-audit-list",children:l.nearDups.map(([g,f],m)=>a.jsxs("li",{className:"taxonomy-audit-item taxonomy-audit-item--pair",children:[a.jsx("span",{className:"taxonomy-audit-tag",children:g}),a.jsx("span",{className:"taxonomy-alias-arrow","aria-hidden":"true",children:"≈"}),a.jsx("span",{className:"taxonomy-audit-tag",children:f})]},m))})})]})]})]})}function pye(){const{health:r,serverCurrent:e}=GC();return!r||e?null:a.jsxs("div",{className:"stale-server-banner",children:["⚠ The dashboard server is running an older build (",r.version??"unknown"," vs ","0.17.0",") — some actions will fail. Restart it: ",a.jsx("code",{children:"dreamcontext dashboard"})]})}const ZR=new Rz({defaultOptions:{queries:{staleTime:5e3,retry:1,refetchOnWindowFocus:!0,refetchInterval:15e3,refetchIntervalInBackground:!1},mutations:{retry:0}}});function gye({nav:r}){const e=(n,s)=>{const o={tasks:"tasks",knowledge:"knowledge",core:"core"};r.navigate(o[n],s)},i={id:r.focusId,nonce:r.nonce};switch(r.page){case"brain":return a.jsx(Hpe,{onNavigate:e});case"tasks":return a.jsx(Fde,{focus:i});case"roadmap":return a.jsx(Afe,{});case"lab":return a.jsx(Zfe,{});case"sleep":return a.jsx(npe,{});case"core":return a.jsx(hpe,{onNavigateTaxonomy:()=>r.navigate("taxonomy",null),focus:i});case"knowledge":return a.jsx(_pe,{focus:i});case"council":return a.jsx(Tge,{});case"settings":return a.jsx(hme,{focus:i});case"packs":return a.jsx(gme,{});case"taxonomy":return a.jsx(fye,{});case"about":return a.jsx(hye,{})}}class sm extends B.Component{constructor(){super(...arguments);Wt(this,"state",{error:null})}static getDerivedStateFromError(i){return{error:i}}render(){return this.state.error?a.jsxs("div",{className:"error-boundary",children:[a.jsx("h1",{children:"Something went wrong."}),a.jsx("p",{children:this.state.error.message}),a.jsx("button",{onClick:()=>window.location.reload(),children:"Reload"})]}):this.props.children}}const iS=new URLSearchParams(window.location.search),IC=iS.get("vault"),mye=iS.get("capture")==="1",yye=iS.get("perch")==="1";IC&&WC(IC);function bye(){return B.useEffect(()=>{CQ().then(e=>_1(e));const r=e=>{(e.key===null||e.key===y5)&&_1(Aw())};return window.addEventListener("storage",r),()=>window.removeEventListener("storage",r)},[]),null}function vye(){return mye?a.jsx(sm,{children:a.jsx(LQ,{})}):yye?a.jsx(sm,{children:a.jsx(BQ,{})}):IC?a.jsx(sm,{children:a.jsx(tN,{client:ZR,children:a.jsx(DQ,{children:a.jsx(oA,{children:a.jsxs(sN,{children:[a.jsx(yL,{}),a.jsx(pye,{}),a.jsx(uhe,{children:r=>a.jsx(gye,{nav:r})}),a.jsx(Zhe,{}),a.jsx(bL,{})]})})})})}):a.jsx(sm,{children:a.jsx(tN,{client:ZR,children:a.jsx(oA,{children:a.jsxs(sN,{children:[a.jsx(yL,{}),a.jsx(bye,{}),a.jsx(sZ,{}),a.jsx(bL,{})]})})})})}const xye=!!window.__TAURI_INTERNALS__;xye&&navigator.platform.toLowerCase().includes("mac")&&document.documentElement.classList.add("tauri-overlay");lz.createRoot(document.getElementById("root")).render(a.jsx(B.StrictMode,{children:a.jsx(vye,{})}));export{q5 as $,Aye as A,Vo as B,UQ as C,si as D,tee as E,ak as F,M5 as G,zte as H,xee as I,Tte as J,sJ as K,Tf as L,Nye as M,Xy as N,OJ as O,P5 as P,uA as Q,uee as R,A1 as S,Pte as T,Vf as U,Bs as V,ze as W,$e as X,HJ as Y,Lte as Z,q as _,YJ as a,gK as a$,oee as a0,gA as a1,pA as a2,Fye as a3,Rye as a4,Dye as a5,Oye as a6,Mye as a7,qw as a8,Iye as a9,tne as aA,ene as aB,YO as aC,wX as aD,nie as aE,S5 as aF,lee as aG,pu as aH,Eye as aI,Ly as aJ,Fm as aK,$U as aL,hO as aM,Qf as aN,rie as aO,tie as aP,kX as aQ,JC as aR,Ao as aS,_f as aT,vN as aU,Qq as aV,SW as aW,yO as aX,bO as aY,pK as aZ,Im as a_,Lye as aa,oh as ab,Pye as ac,$ye as ad,Bye as ae,jie as af,i6 as ag,Xye as ah,Nte as ai,un as aj,Ya as ak,kd as al,ok as am,QD as an,dc as ao,r4 as ap,ar as aq,ra as ar,Mt as as,Mne as at,Yye as au,Zye as av,Kye as aw,It as ax,Vye as ay,ane as az,VJ as b,Pm as b$,mu as b0,Ml as b1,hG as b2,PN as b3,As as b4,dW as b5,ow as b6,oK as b7,mK as b8,yu as b9,tX as bA,KV as bB,Ut as bC,SX as bD,GV as bE,wO as bF,QN as bG,Jl as bH,K7 as bI,Ce as bJ,B as bK,UO as bL,WO as bM,GO as bN,a as bO,RN as bP,vW as bQ,TW as bR,jW as bS,My as bT,bK as bU,aw as bV,uO as bW,jK as bX,pG as bY,bG as bZ,Uf as b_,kW as ba,EW as bb,CK as bc,yW as bd,sw as be,ZN as bf,Bt as bg,i4 as bh,Sk as bi,Tn as bj,Wq as bk,QC as bl,XB as bm,Hf as bn,JB as bo,Tye as bp,AN as bq,jN as br,HQ as bs,ji as bt,que as bu,Dr as bv,cw as bw,rX as bx,eX as by,GY as bz,Mr as c,sl as c0,XN as c1,lw as c2,dO as c3,r1 as c4,Cye as c5,Zt as c6,cB as c7,Rk as c8,kye as c9,ebe as ca,$C as cb,wye as cc,Xt as d,z5 as e,Ei as f,ZJ as g,Ga as h,Ms as i,Mte as j,Yf as k,tt as l,e4 as m,jye as n,Jye as o,QJ as p,JJ as q,Qye as r,XJ as s,Ete as t,Ts as u,Yie as v,Ute as w,zye as x,Qo as y,KJ as z};
516
+ `).toLowerCase().includes(e.trim().toLowerCase()):!1:!0}function _ge({debate:r,query:e,onQueryChange:i,selected:n,onSelectCell:s,onClearSelection:o}){const h=B.useRef(null),l=B.useMemo(()=>Array.from({length:Math.max(1,r.frontmatter.rounds_planned)},(g,f)=>f+1),[r.frontmatter.rounds_planned]),u=B.useMemo(()=>r.personas.map(g=>g.slug),[r.personas]),d=B.useMemo(()=>{if(!e.trim())return null;let g=0;for(const f of r.personas)for(const m of l)B$(N$(f,m),e)&&g++;return g},[e,r,l]);return B.useEffect(()=>{if(!n)return;const g=f=>{const m=f.target;if(m&&["INPUT","TEXTAREA"].includes(m.tagName))return;if(f.key==="Escape"){o();return}const y=r.personas.findIndex(_=>_.slug===n.slug);if(y===-1)return;const w=r.frontmatter.rounds_planned;f.key==="ArrowRight"&&n.round<w?(f.preventDefault(),s(n.slug,n.round+1)):f.key==="ArrowLeft"&&n.round>1?(f.preventDefault(),s(n.slug,n.round-1)):f.key==="ArrowDown"&&y<r.personas.length-1?(f.preventDefault(),s(r.personas[y+1].slug,n.round)):f.key==="ArrowUp"&&y>0&&(f.preventDefault(),s(r.personas[y-1].slug,n.round))};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[n,r,o,s]),B.useEffect(()=>{if(!n||!h.current)return;const g=h.current.querySelector(`[data-persona="${n.slug}"][data-round="${n.round}"]`);g==null||g.scrollIntoView({behavior:"smooth",block:"center"})},[n]),a.jsxs("div",{className:"council-matrix",children:[a.jsxs("div",{className:"council-matrix-bar",children:[a.jsxs("label",{className:"council-matrix-search-input",children:[a.jsx("span",{className:"council-matrix-search-icon","aria-hidden":!0,children:"🔍"}),a.jsx("input",{type:"search",value:e,onChange:g=>i(g.target.value),placeholder:"Filter cells by text…"}),e&&a.jsx("button",{type:"button",className:"council-matrix-search-clear",onClick:()=>i(""),children:"×"})]}),d!=null&&a.jsxs("span",{className:"council-matrix-count",children:[d," match",d===1?"":"es"]})]}),a.jsx("div",{className:"council-matrix-scroll",ref:h,children:a.jsxs("div",{className:"council-matrix-grid",style:{gridTemplateColumns:`180px repeat(${l.length}, minmax(220px, 1fr))`},children:[a.jsx("div",{className:"council-matrix-corner","aria-hidden":!0}),l.map(g=>{const f=r.frontmatter.status===`round_${g}_running`,m=r.frontmatter.current_round>=g&&!f;return a.jsxs("div",{className:`council-round-head ${f?"is-running":""} ${m?"is-done":""}`,children:["Round ",g]},`h-${g}`)}),r.personas.map(g=>a.jsx(Cge,{persona:g,rounds:l,debate:r,query:e,selected:n,knownSlugs:u,onSelectCell:s},g.slug))]})})]})}function Cge({persona:r,rounds:e,debate:i,query:n,selected:s,knownSlugs:o,onSelectCell:h}){return a.jsxs(a.Fragment,{children:[a.jsxs("aside",{className:"council-matrix-row-head",children:[a.jsx(rp,{slug:r.slug,size:22}),a.jsxs("div",{className:"council-matrix-row-id",children:[a.jsx("div",{className:"council-matrix-row-name",children:r.slug}),a.jsx(R$,{model:r.frontmatter.model})]})]}),e.map(l=>{const u=N$(r,l),d=i.frontmatter.status===`round_${l}_running`,g=!!s&&s.slug===r.slug&&s.round===l,f=B$(u,n),m=!!n.trim()&&!f;return a.jsx(wge,{personaSlug:r.slug,round:l,data:u,isRunning:d,active:g,dimmed:m,knownSlugs:o,onSelect:h},l)})]})}function wge({personaSlug:r,round:e,data:i,isRunning:n,active:s,dimmed:o,knownSlugs:h,onSelect:l}){if(!i)return a.jsx("div",{className:`council-cell council-cell--empty ${n?"council-cell--pending":""} ${o?"is-dimmed":""}`,"data-persona":r,"data-round":e,children:a.jsx("span",{className:"council-cell-empty-label",children:n?"awaiting…":"— silent —"})});const u=E$(i.position),d=Kpe(i.position),g=j$(i),f=Ype(i),m=Vpe(i,h);return a.jsxs("button",{type:"button",className:`council-cell council-cell--${d} ${s?"is-active":""} ${o?"is-dimmed":""}`,"data-persona":r,"data-round":e,onClick:()=>l(r,e),children:[a.jsxs("div",{className:"council-cell-top",children:[u&&a.jsx("span",{className:`council-chip-pos council-chip-pos--${d}`,children:u}),(g>0||f>0)&&a.jsxs("span",{className:"council-cell-meta",children:[g>0&&a.jsxs(a.Fragment,{children:["↯ ",g]}),g>0&&f>0&&a.jsx("span",{children:" · "}),f>0&&a.jsxs(a.Fragment,{children:["? ",f]})]})]}),!s&&i.executiveSummary&&a.jsx("p",{className:"council-cell-exec",children:i.executiveSummary}),s&&a.jsxs("div",{className:"council-cell-full",children:[i.executiveSummary&&a.jsx(Pd,{title:"Executive summary",children:a.jsx("p",{children:i.executiveSummary})}),i.position&&a.jsx(Pd,{title:"Position",children:a.jsx("div",{dangerouslySetInnerHTML:{__html:or.parse(i.position)}})}),i.reasoning&&a.jsx(Pd,{title:"Reasoning",children:a.jsx("div",{dangerouslySetInnerHTML:{__html:or.parse(i.reasoning)}})}),i.reactions&&a.jsxs(Pd,{title:"Reactions to peers",children:[a.jsx("div",{dangerouslySetInnerHTML:{__html:or.parse(i.reactions)}}),m.length>0&&a.jsx("div",{className:"council-cell-react-chips",children:m.map(y=>a.jsxs("span",{className:"council-cell-react-chip",children:[a.jsx(rp,{slug:y,size:14}),a.jsx("span",{children:y})]},y))})]}),i.openQuestions&&a.jsx(Pd,{title:"Open questions",children:a.jsx("div",{dangerouslySetInnerHTML:{__html:or.parse(i.openQuestions)}})})]})]})}function Pd({title:r,children:e}){return a.jsxs("section",{className:"council-cell-sub",children:[a.jsx("h5",{children:r}),a.jsx("div",{className:"council-cell-sub-body",children:e})]})}function OR(r){return r==="complete"||r==="synthesizing"?"overview":"matrix"}function kge({debate:r,onBack:e}){const{t:i}=wr(),[n,s]=B.useState(()=>OR(r.frontmatter.status)),[o,h]=B.useState(""),[l,u]=B.useState(null),[d,g]=B.useState(null);B.useEffect(()=>{s(OR(r.frontmatter.status)),h(""),u(null),g(null)},[r.frontmatter.id]);const f=(w,_)=>{s("matrix"),u({slug:w,round:_})},m=w=>{s("agents"),g(w)},y=()=>{var w;return(w=navigator.clipboard)==null?void 0:w.writeText(r.frontmatter.id).catch(()=>{})};return a.jsxs("div",{className:"council-detail",children:[a.jsxs("header",{className:"council-detail-head",children:[a.jsxs("button",{type:"button",className:"council-detail-back",onClick:e,children:["← ",i("council.title")]}),a.jsxs("div",{className:"council-detail-meta",children:[a.jsx(pge,{status:r.frontmatter.status}),a.jsxs("span",{className:"council-detail-rounds",children:["R",r.frontmatter.current_round,"/",r.frontmatter.rounds_planned]}),a.jsx("span",{className:"council-session-dot",children:"·"}),a.jsx("span",{className:"council-detail-date",children:r.frontmatter.created_at}),a.jsx("span",{className:"council-session-dot",children:"·"}),a.jsx("button",{type:"button",className:"council-session-id",onClick:y,title:"Copy debate id",children:r.frontmatter.id})]})]}),a.jsxs("nav",{className:"council-tabs",role:"tablist",children:[a.jsx(k_,{active:n==="overview",onClick:()=>s("overview"),label:"Overview"}),a.jsx(k_,{active:n==="agents",onClick:()=>s("agents"),label:"Agents"}),a.jsx(k_,{active:n==="matrix",onClick:()=>s("matrix"),label:"Matrix"})]}),a.jsxs("div",{className:"council-detail-body",children:[n==="overview"&&a.jsx(gge,{debate:r,onCiteJump:f,onAgentJump:m}),n==="agents"&&a.jsx(bge,{debate:r,focusSlug:d}),n==="matrix"&&a.jsx(_ge,{debate:r,query:o,onQueryChange:h,selected:l,onSelectCell:(w,_)=>u({slug:w,round:_}),onClearSelection:()=>u(null)})]})]})}function k_({active:r,onClick:e,label:i}){return a.jsx("button",{type:"button",role:"tab","aria-selected":r,className:`council-tab ${r?"is-active":""}`,onClick:e,children:i})}const DR="/council";function Sge({onClose:r}){const[e,i]=B.useState(!1);B.useEffect(()=>{const s=o=>{o.key==="Escape"&&r()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[r]);const n=()=>{var s;(s=navigator.clipboard)==null||s.writeText(DR).then(()=>{i(!0),window.setTimeout(()=>i(!1),1600)}).catch(()=>{})};return a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"council-modal-scrim",onClick:r}),a.jsxs("div",{className:"council-modal",role:"dialog","aria-modal":"true","aria-label":"Start a new debate",children:[a.jsxs("header",{className:"council-modal-head",children:[a.jsxs("h2",{className:"council-modal-title",children:["Start a debate",a.jsx("span",{className:"council-lab-badge",children:"Lab"})]}),a.jsx("button",{type:"button",className:"council-modal-close",onClick:r,"aria-label":"Close",children:"✕"})]}),a.jsx("p",{className:"council-modal-lede",children:"Council convenes a panel of AI personas to debate a hard decision across several rounds, exposes each one to the others' reasoning, then synthesizes a final verdict you can trace back to who argued what."}),a.jsxs("div",{className:"council-modal-soon",children:[a.jsx("span",{className:"council-modal-soon-tag",children:"Coming soon"}),a.jsxs("p",{children:["Soon this button will open ",a.jsx("strong",{children:"Sleepy"})," pre-filled with a debate prompt so you can convene a council without leaving the dashboard. That flow isn't wired up yet."]})]}),a.jsxs("div",{className:"council-modal-now",children:[a.jsx("span",{className:"council-ov-label",children:"Right now"}),a.jsx("p",{className:"council-modal-now-body",children:"Open Claude in your project and run the Council skill:"}),a.jsxs("div",{className:"council-modal-cmd",children:[a.jsx("code",{children:DR}),a.jsx("button",{type:"button",className:"council-modal-cmd-copy",onClick:n,children:e?"Copied":"Copy"})]}),a.jsxs("p",{className:"council-modal-hint",children:["Tip: phrases like ",a.jsx("em",{children:'"debate this"'})," or ",a.jsx("em",{children:'"help me decide"'})," also prompt Council automatically. Finished debates show up here, where you can read every round, the agent matrix, and the final report."]})]}),a.jsx("footer",{className:"council-modal-foot",children:a.jsx("button",{type:"button",className:"council-modal-btn",onClick:r,children:"Got it"})})]})]})}function Tge(){const{t:r}=wr(),{data:e,isLoading:i,isError:n,error:s}=Wpe(),[o,h]=B.useState(null),[l,u]=B.useState(!1),{data:d,isLoading:g}=Gpe(o);return i?a.jsx("div",{className:"loading",children:r("common.loading")}):n?a.jsxs("div",{className:"error-state",children:["Failed to load council sessions. ",s==null?void 0:s.message]}):o?a.jsxs("div",{className:"council-page council-page--detail",children:[g&&a.jsx("div",{className:"loading",children:"Loading session…"}),d&&a.jsx(kge,{debate:d,onBack:()=>h(null)})]}):a.jsxs("div",{className:"council-page",children:[a.jsx(dge,{debates:e??[],onOpen:h,onNew:()=>u(!0)}),l&&a.jsx(Sge,{onClose:()=>u(!1)})]})}function Ege(){return Yt({queryKey:["config"],queryFn:()=>De.get("/config"),select:r=>r.config})}function Nge(){const r=Pt();return Vt({mutationFn:e=>De.patch("/config",e),onSuccess:()=>{r.invalidateQueries({queryKey:["config"]})}})}function jge(){return Yt({queryKey:["vaults"],queryFn:()=>De.get("/vaults")})}function Age(){return Yt({queryKey:["connections"],queryFn:()=>De.get("/connections"),select:r=>r.connections})}function Mge(){const r=Pt();return Vt({mutationFn:e=>De.post("/connections",e),onSuccess:()=>{r.invalidateQueries({queryKey:["connections"]}),r.invalidateQueries({queryKey:["vaults"]}),r.invalidateQueries({queryKey:["launcher-status"]}),r.invalidateQueries({queryKey:["launcher-federation-graph"]})}})}function Lge(){const r=Pt();return Vt({mutationFn:e=>De.del(`/connections/${encodeURIComponent(e)}`),onSuccess:()=>{r.invalidateQueries({queryKey:["connections"]}),r.invalidateQueries({queryKey:["vaults"]}),r.invalidateQueries({queryKey:["launcher-status"]}),r.invalidateQueries({queryKey:["launcher-federation-graph"]})}})}function Rge(){return Yt({queryKey:["federation","inbox"],queryFn:()=>De.get("/federation/inbox")})}function Bge(){return Vt({mutationFn:()=>De.post("/federation/sync",{})})}const IR=["out","in","both"];function Oge({shareable:r,onToggleShareable:e,shareablePending:i}){const{t:n}=wr(),{data:s}=jge(),{data:o}=Age(),h=Mge(),l=Lge(),{data:u}=Rge(),d=Bge(),[g,f]=B.useState(""),[m,y]=B.useState("both"),[w,_]=B.useState(null),b=(s==null?void 0:s.vaults)??[],x=(s==null?void 0:s.current)??null,C=o??[],k=new Set(C.map(E=>E.vault)),T=b.filter(E=>E.name!==x&&!k.has(E.name)),N=()=>{if(_(null),!g){_(n("federation.error.pick_vault"));return}h.mutate({vault:g,direction:m},{onSuccess:()=>{f(""),y("both")},onError:E=>_(E instanceof Error?E.message:String(E))})},A=(E,L)=>{h.mutate({vault:E.vault,direction:L,topics:E.topics})},j=(E,L)=>{const O=L.split(",").map(D=>D.trim()).filter(Boolean);h.mutate({vault:E.vault,direction:E.direction,topics:O.length>0?O:null})};return a.jsxs("section",{className:"settings-section",children:[a.jsxs("div",{className:"fed-head",children:[a.jsx("h2",{className:"settings-section-title",children:n("settings.federation")}),a.jsxs("label",{className:"fed-sharing-toggle settings-checkbox-label",title:n("federation.shareable.hint"),children:[a.jsx("input",{type:"checkbox",className:"settings-checkbox",checked:r,disabled:i,onChange:E=>e(E.target.checked)}),a.jsx("span",{children:n("federation.shareable.label")})]})]}),a.jsx(r5,{variant:"embedded"}),a.jsxs("details",{className:"fed-advanced",children:[a.jsx("summary",{className:"fed-advanced-summary",children:n("federation.advanced")}),a.jsxs("div",{className:"fed-card",children:[a.jsxs("div",{className:"fed-card-head",children:[a.jsx("h3",{className:"fed-card-title",children:n("federation.vaults")}),a.jsx("p",{className:"fed-card-desc",children:n("federation.vaults.desc")})]}),b.length===0?a.jsx("p",{className:"settings-field-hint",children:n("federation.vaults.empty")}):a.jsx("ul",{className:"fed-vault-list",children:b.map(E=>a.jsxs("li",{className:`fed-vault-item${E.name===x?" fed-vault-item--current":""}`,children:[a.jsx("span",{className:"fed-vault-name",children:E.name}),E.name===x&&a.jsx("span",{className:"fed-badge",children:n("federation.current")}),a.jsx("span",{className:"fed-vault-path",children:E.path})]},E.name))})]}),a.jsxs("div",{className:"fed-card",children:[a.jsxs("div",{className:"fed-card-head",children:[a.jsx("h3",{className:"fed-card-title",children:n("federation.connections")}),a.jsx("p",{className:"fed-card-desc",children:n("federation.connections.desc")})]}),C.length===0?a.jsx("p",{className:"settings-field-hint",children:n("federation.connections.empty")}):a.jsx("ul",{className:"fed-conn-list",children:C.map(E=>{var L;return a.jsxs("li",{className:"fed-conn-item",children:[a.jsxs("div",{className:"fed-conn-head",children:[a.jsx("span",{className:"fed-conn-name",children:E.vault}),E.status==="stale"&&a.jsx("span",{className:"fed-badge fed-badge--stale",children:n("federation.stale")}),a.jsx("button",{className:"btn fed-conn-remove",onClick:()=>l.mutate(E.vault),disabled:l.isPending,children:n("federation.remove")})]}),a.jsxs("div",{className:"fed-conn-controls",children:[a.jsx("div",{className:"fed-direction",role:"group","aria-label":n("federation.direction"),children:IR.map(O=>a.jsx("button",{className:`fed-dir-btn${E.direction===O?" fed-dir-btn--active":""}`,onClick:()=>A(E,O),disabled:h.isPending,children:n(`federation.direction.${O}`)},O))}),a.jsx("input",{className:"settings-text-input fed-topics-input",defaultValue:((L=E.topics)==null?void 0:L.join(", "))??"",placeholder:n("federation.topics.placeholder"),onBlur:O=>{const D=O.target.value.split(",").map(z=>z.trim()).filter(Boolean).join(", "),K=(E.topics??[]).join(", ");D!==K&&j(E,O.target.value)}})]}),a.jsx("p",{className:"settings-field-hint fed-dir-hint",children:n(`federation.direction.${E.direction}.hint`)})]},E.vault)})})]}),a.jsxs("div",{className:"fed-card",children:[a.jsxs("div",{className:"fed-card-head",children:[a.jsx("h3",{className:"fed-card-title",children:n("federation.add")}),a.jsx("p",{className:"fed-card-desc",children:n("federation.add.desc")})]}),T.length===0?a.jsx("p",{className:"settings-field-hint",children:n("federation.add.none")}):a.jsxs("div",{className:"fed-add-row",children:[a.jsxs("select",{className:"settings-text-input",value:g,onChange:E=>f(E.target.value),children:[a.jsx("option",{value:"",children:n("federation.add.pick")}),T.map(E=>a.jsx("option",{value:E.name,children:E.name},E.name))]}),a.jsx("div",{className:"fed-direction",role:"group","aria-label":n("federation.direction"),children:IR.map(E=>a.jsx("button",{className:`fed-dir-btn${m===E?" fed-dir-btn--active":""}`,onClick:()=>y(E),children:n(`federation.direction.${E}`)},E))}),a.jsx("button",{className:"btn btn--primary",onClick:N,disabled:h.isPending||!g,children:n("federation.connect")})]}),T.length>0&&a.jsx("p",{className:"settings-field-hint fed-dir-hint",children:n(`federation.direction.${m}.hint`)}),w&&a.jsx("p",{className:"settings-test-err",children:w})]}),a.jsxs("div",{className:"fed-card",children:[a.jsxs("div",{className:"fed-card-head",children:[a.jsx("h3",{className:"fed-card-title",children:n("federation.inbox")}),a.jsx("p",{className:"fed-card-desc",children:n("federation.inbox.desc")})]}),(()=>{const E=(u==null?void 0:u.pending)??[],L=(u==null?void 0:u.consumed)??[],O=(u==null?void 0:u.quarantined)??[];return E.length===0&&L.length===0&&O.length===0?a.jsx("p",{className:"settings-field-hint",children:n("federation.inbox.empty")}):a.jsxs(a.Fragment,{children:[E.length>0&&a.jsxs("div",{className:"fed-inbox-group",children:[a.jsxs("h4",{className:"fed-inbox-group-title",children:[n("federation.inbox.pending")," (",E.length,")"]}),a.jsx("ul",{className:"fed-entry-list",children:E.map(D=>a.jsx(FR,{entry:D,fromLabel:n("federation.inbox.from")},`p-${D.id}`))})]}),L.length>0&&a.jsxs("div",{className:"fed-inbox-group",children:[a.jsxs("h4",{className:"fed-inbox-group-title",children:[n("federation.inbox.consumed")," (",L.length,")"]}),a.jsx("ul",{className:"fed-entry-list fed-entry-list--consumed",children:L.map(D=>a.jsx(FR,{entry:D,fromLabel:n("federation.inbox.from")},`c-${D.id}`))})]}),O.length>0&&a.jsxs("div",{className:"fed-inbox-group",children:[a.jsxs("h4",{className:"fed-inbox-group-title fed-inbox-group-title--warn",children:[n("federation.inbox.quarantined")," (",O.length,")"]}),a.jsx("ul",{className:"fed-entry-list",children:O.map(D=>a.jsxs("li",{className:"fed-entry fed-entry--quarantined",children:[a.jsx("code",{className:"fed-entry-file",children:D.file}),a.jsxs("span",{className:"fed-entry-meta",children:["v",D.version]})]},`q-${D.file}`))})]})]})})()]}),a.jsxs("div",{className:"fed-card",children:[a.jsxs("div",{className:"fed-card-head",children:[a.jsx("h3",{className:"fed-card-title",children:n("federation.preview.title")}),a.jsx("p",{className:"fed-card-desc",children:n("federation.preview.hint")})]}),a.jsx("div",{className:"fed-preview-head",children:a.jsx("button",{className:"btn btn--secondary",onClick:()=>d.mutate(),disabled:d.isPending,children:d.isPending?n("federation.preview.running"):n("federation.preview")})}),d.isError&&a.jsx("p",{className:"settings-test-err",children:d.error instanceof Error?d.error.message:String(d.error)}),d.data&&a.jsx(Dge,{deltas:d.data.deltas,t:n})]})]})]})}function FR({entry:r,fromLabel:e}){return a.jsxs("li",{className:"fed-entry",children:[a.jsxs("div",{className:"fed-entry-head",children:[a.jsx("span",{className:"fed-entry-title",children:r.title}),a.jsx("span",{className:`fed-entry-kind fed-entry-kind--${r.kind}`,children:r.kind})]}),a.jsxs("span",{className:"fed-entry-meta",children:[e," ",a.jsx("strong",{children:r.origin.vault}),r.origin.sourceTimestamp?` · ${r.origin.sourceTimestamp}`:""]})]})}function Dge({deltas:r,t:e}){return r.length===0?a.jsx("p",{className:"settings-field-hint",children:e("federation.preview.none")}):a.jsx("ul",{className:"fed-delta-list",children:r.map(i=>{let n;return i.stale?n=e("federation.preview.stale"):i.consented?i.entries.length===0?n=e("federation.preview.nodelta"):n=`${i.entries.length} ${e("federation.preview.entries")}`:n=e("federation.preview.noconsent"),a.jsxs("li",{className:"fed-delta",children:[a.jsxs("div",{className:"fed-delta-head",children:[a.jsx("span",{className:"fed-delta-vault",children:i.vault}),a.jsx("span",{className:"fed-delta-status",children:n})]}),i.entries.length>0&&a.jsx("ul",{className:"fed-entry-list",children:i.entries.map((s,o)=>a.jsx("li",{className:"fed-entry",children:a.jsxs("div",{className:"fed-entry-head",children:[a.jsx("span",{className:"fed-entry-title",children:s.title}),a.jsx("span",{className:`fed-entry-kind fed-entry-kind--${s.kind}`,children:s.kind})]})},`${i.vault}-${o}`))})]},i.vault)})})}function Ige(r){return Yt({queryKey:["embedding-model-status"],queryFn:()=>De.get("/embeddings/status"),enabled:r,retry:!1,refetchInterval:e=>{var i;return((i=e.state.data)==null?void 0:i.state)==="downloading"?1500:!1}})}function Fge(){const r=Pt();return Vt({mutationFn:()=>De.post("/embeddings/download",{}),onSuccess:e=>r.setQueryData(["embedding-model-status"],e)})}function $ge(r){return Yt({queryKey:["embedding-index-status"],queryFn:()=>De.get("/embeddings/index/status"),enabled:r,retry:!1,refetchInterval:e=>{var i;return((i=e.state.data)==null?void 0:i.state)==="building"?1500:!1}})}function Pge(){const r=Pt();return Vt({mutationFn:()=>De.post("/embeddings/index",{}),onSuccess:e=>r.setQueryData(["embedding-index-status"],e)})}function S_(r){return`${(r/(1024*1024)).toFixed(0)} MB`}function $R({pct:r,label:e}){return a.jsx("div",{className:"embed-model-bar",role:"progressbar","aria-label":e,"aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,children:a.jsx("div",{className:"embed-model-bar-fill",style:{width:`${r}%`}})})}function zge(){const{t:r}=wr(),{data:e,isLoading:i}=Ige(!0),n=Fge(),s=(e==null?void 0:e.state)==="ready",{data:o,isLoading:h}=$ge(!!s),l=Pge(),u=B.useRef(!1);B.useEffect(()=>{u.current||!e||e.state!=="not_downloaded"||!e.packageInstalled||(u.current=!0,n.mutate())},[e,n]);const d=B.useRef(!1);if(B.useEffect(()=>{d.current||!s||!o||o.state!=="not_built"||(d.current=!0,l.mutate())},[s,o,l]),i||!e)return a.jsx("div",{className:"embed-model-card",children:a.jsx("span",{className:"embed-model-status embed-model-status--muted",children:r("settings.recall.embed.checking")})});if(!e.packageInstalled)return a.jsxs("div",{className:"embed-model-card embed-model-card--error",children:[a.jsxs("span",{className:"embed-model-status embed-model-status--error",children:["✗ ",r("settings.recall.embed.no_runtime")]}),a.jsx("p",{className:"settings-field-hint",children:r("settings.recall.embed.no_runtime.hint")})]});if(e.state==="error")return a.jsxs("div",{className:"embed-model-card embed-model-card--error",children:[a.jsxs("span",{className:"embed-model-status embed-model-status--error",children:["✗ ",r("settings.recall.embed.failed")]}),e.error&&a.jsx("p",{className:"embed-model-errdetail",children:e.error}),a.jsx("button",{type:"button",className:"embed-model-btn",onClick:()=>n.mutate(),disabled:n.isPending,children:n.isPending?r("settings.recall.embed.starting"):r("settings.recall.embed.retry")})]});if(e.state==="downloading"){const f=e.totalBytes>0?`${S_(e.loadedBytes)} / ${S_(e.totalBytes)}`:null;return a.jsxs("div",{className:"embed-model-card",children:[a.jsxs("div",{className:"embed-model-row",children:[a.jsxs("span",{className:"embed-model-status",children:["⏳ ",r("settings.recall.embed.downloading")," ",e.progress,"%"]}),f&&a.jsx("span",{className:"embed-model-meta",children:f})]}),a.jsx($R,{pct:e.progress,label:r("settings.recall.embed.downloading")}),a.jsxs("p",{className:"settings-field-hint",children:[r("settings.recall.embed.step1of2")," · ",r("settings.recall.embed.downloading.hint")]})]})}if(e.state==="not_downloaded")return a.jsxs("div",{className:"embed-model-card",children:[a.jsx("p",{className:"settings-field-hint",children:r("settings.recall.embed.needed")}),a.jsx("button",{type:"button",className:"embed-model-btn embed-model-btn--primary",onClick:()=>n.mutate(),disabled:n.isPending,children:n.isPending?r("settings.recall.embed.starting"):r("settings.recall.embed.download")})]});if(h||!o)return a.jsx("div",{className:"embed-model-card",children:a.jsx("span",{className:"embed-model-status embed-model-status--muted",children:r("settings.recall.embed.checking")})});if(o.state==="error")return a.jsxs("div",{className:"embed-model-card embed-model-card--error",children:[a.jsxs("span",{className:"embed-model-status embed-model-status--error",children:["✗ ",r("settings.recall.embed.index_failed")]}),o.error&&a.jsx("p",{className:"embed-model-errdetail",children:o.error}),a.jsx("button",{type:"button",className:"embed-model-btn",onClick:()=>l.mutate(),disabled:l.isPending,children:l.isPending?r("settings.recall.embed.starting"):r("settings.recall.embed.retry")})]});if(o.state==="building"){const f=o.total>0?`${o.done} / ${o.total}`:null;return a.jsxs("div",{className:"embed-model-card",children:[a.jsxs("div",{className:"embed-model-row",children:[a.jsxs("span",{className:"embed-model-status",children:["⏳ ",r("settings.recall.embed.indexing")," ",o.progress,"%"]}),f&&a.jsx("span",{className:"embed-model-meta",children:f})]}),a.jsx($R,{pct:o.progress,label:r("settings.recall.embed.indexing")}),a.jsxs("p",{className:"settings-field-hint",children:[r("settings.recall.embed.step2of2")," · ",r("settings.recall.embed.indexing.hint")]})]})}if(o.state==="not_built")return a.jsxs("div",{className:"embed-model-card",children:[a.jsx("p",{className:"settings-field-hint",children:r("settings.recall.embed.index_needed")}),a.jsx("button",{type:"button",className:"embed-model-btn embed-model-btn--primary",onClick:()=>l.mutate(),disabled:l.isPending,children:l.isPending?r("settings.recall.embed.starting"):r("settings.recall.embed.build_index")})]});const g=e.totalBytes>0?S_(e.totalBytes):"~113 MB";return a.jsxs("div",{className:"embed-model-card embed-model-card--ready",children:[a.jsxs("span",{className:"embed-model-status embed-model-status--ready",children:["✓ ",r("settings.recall.embed.ready")]}),a.jsxs("span",{className:"embed-model-meta",children:[g," · ",o.chunks," ",r("settings.recall.embed.chunks")," · ",r("settings.recall.embed.local")]})]})}function qge(){const{data:r,isLoading:e}=tue(),i=iue(),[n,s]=B.useState(""),[o,h]=B.useState(null);B.useEffect(()=>{s((r==null?void 0:r.raw)??"")},[r]);const l=(r==null?void 0:r.warnings)??[],u=(r==null?void 0:r.customFields)??[];return a.jsxs("section",{className:"settings-section",children:[a.jsxs("h2",{className:"settings-section-title",children:["Task Format & Custom Fields",a.jsx("span",{className:"settings-beta-badge",children:"BETA"})]}),a.jsxs("p",{className:"settings-field-hint",children:["Declare custom fields for this project — they’re written to ",a.jsx("code",{children:"overrides/task.md"})," (committed to git) and apply to everyone: the CLI, the dashboard, the main agent, and sleep agents. Required fields must be set on every task. Custom fields sync to ClickUp / GitHub."]}),a.jsxs("details",{className:"tov-doc",children:[a.jsx("summary",{children:"How the format works"}),a.jsxs("div",{className:"tov-doc-body",children:[a.jsxs("p",{children:[a.jsx("code",{children:"_dream_context/overrides/task.md"})," has two parts — YAML frontmatter plus a body. With no file, tasks use the shipped defaults (nothing changes)."]}),a.jsxs("p",{children:[a.jsxs("strong",{children:["1. Frontmatter ",a.jsx("code",{children:"custom_fields:"})]})," — a list; each field accepts:"]}),a.jsxs("ul",{children:[a.jsxs("li",{children:[a.jsx("code",{children:"name"})," — display name (required)."]}),a.jsxs("li",{children:[a.jsx("code",{children:"key"})," — stable id used by the CLI and backend (optional; defaults to the snake_cased name)."]}),a.jsxs("li",{children:[a.jsx("code",{children:"type"})," — ",a.jsx("code",{children:"text"}),", ",a.jsx("code",{children:"number"}),", ",a.jsx("code",{children:"select"}),", or ",a.jsx("code",{children:"date"}),"."]}),a.jsxs("li",{children:[a.jsx("code",{children:"required"})," — ",a.jsx("code",{children:"true"})," to force the agent to set it on every task (default: optional)."]}),a.jsxs("li",{children:[a.jsx("code",{children:"options"})," — the allowed values, for a ",a.jsx("code",{children:"select"}),"."]}),a.jsxs("li",{children:[a.jsx("code",{children:"sync"})," — ",a.jsx("code",{children:"[clickup, github]"})," (both by default): which backend(s) the field syncs to."]}),a.jsxs("li",{children:[a.jsx("code",{children:"prompt"})," — tells the agent how to fill the field; shown in every agent’s briefing."]})]}),a.jsxs("p",{children:[a.jsx("strong",{children:"2. Body"})," — your task template (the sections a new task scaffolds with;"," ",a.jsx("code",{children:"{{WHY}}"})," is a placeholder), plus an optional ",a.jsx("code",{children:"## Agent Instructions"})," ","section the agents follow when creating a task (it is stripped from the created task). The body is edited via git/CLI — the box below is a read-only preview."]}),a.jsxs("p",{className:"tov-doc-note",children:["Values are set with ",a.jsx("code",{children:"tasks field <slug> <key> <value>"})," or"," ",a.jsx("code",{children:"tasks create --field key=value"}),", and show up wherever a task is read or listed. A malformed field is skipped with a warning — never fatal."]})]})]}),u.length>0&&a.jsx("div",{className:"tov-fields",children:u.map(d=>{var g;return a.jsxs("div",{className:"tov-field",children:[a.jsx("span",{className:"tov-field-name",children:d.name}),a.jsx("span",{className:`tov-field-req${d.required?" tov-field-req--on":""}`,children:d.required?"required":"optional"}),a.jsxs("span",{className:"tov-field-meta",children:["id ",a.jsx("code",{children:d.key})," · ",d.type,d.type==="select"&&((g=d.options)!=null&&g.length)?` (${d.options.join(", ")})`:"",` · ${d.sync.join("+")||"none"}`]}),d.prompt&&a.jsxs("span",{className:"tov-field-prompt",children:["“",d.prompt,"”"]}),a.jsxs("div",{className:"tov-field-actions",children:[a.jsx("button",{type:"button",className:"tov-edit",title:"Edit field","aria-label":`Edit field ${d.name}`,onClick:()=>h(d),children:"✎"}),a.jsx("button",{type:"button",className:"tov-remove",title:"Remove field","aria-label":`Remove field ${d.name}`,onClick:()=>{(o==null?void 0:o.key)===d.key&&h(null),i.mutate(d.key)},children:"×"})]})]},d.key)})}),o?a.jsx(yC,{initial:o,onClose:()=>h(null)},o.key):a.jsx(yC,{},"add"),l.length>0&&a.jsx("ul",{className:"tov-warnings",children:l.map((d,g)=>a.jsxs("li",{children:["⚠ ",d]},g))}),a.jsxs("label",{className:"tov-preview-label",children:["Generated ",a.jsx("code",{children:"overrides/task.md"})," — read-only"]}),a.jsx("textarea",{className:"tov-editor",spellCheck:!1,value:n,readOnly:!0,placeholder:e?"Loading…":"No override yet — add a custom field above to create it.",rows:14})]})}function ol({children:r,...e}){return a.jsx("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...e,children:r})}function Hge(r){return a.jsxs(ol,{...r,children:[a.jsx("rect",{x:"3.5",y:"3.5",width:"7",height:"7",rx:"1.75"}),a.jsx("rect",{x:"13.5",y:"3.5",width:"7",height:"7",rx:"1.75"}),a.jsx("rect",{x:"3.5",y:"13.5",width:"7",height:"7",rx:"1.75"}),a.jsx("rect",{x:"13.5",y:"13.5",width:"7",height:"7",rx:"1.75"})]})}function Uge(r){return a.jsx(ol,{...r,children:a.jsx("path",{d:"M6.5 18.5a4 4 0 0 1-.7-7.94 5.25 5.25 0 0 1 10.16-1.9A3.75 3.75 0 0 1 17.5 18.5H6.5Z"})})}function Wge(r){return a.jsxs(ol,{...r,children:[a.jsx("ellipse",{cx:"12",cy:"6",rx:"7",ry:"3"}),a.jsx("path",{d:"M5 6v6c0 1.66 3.13 3 7 3s7-1.34 7-3V6"}),a.jsx("path",{d:"M5 12v6c0 1.66 3.13 3 7 3s7-1.34 7-3v-6"})]})}function Gge(r){return a.jsxs(ol,{...r,children:[a.jsx("circle",{cx:"6",cy:"12",r:"2.5"}),a.jsx("circle",{cx:"18",cy:"6",r:"2.5"}),a.jsx("circle",{cx:"18",cy:"18",r:"2.5"}),a.jsx("path",{d:"M8.2 10.8 15.8 7.2M8.2 13.2l7.6 3.6"})]})}function Kge(r){return a.jsxs(ol,{...r,children:[a.jsx("path",{d:"M8 6h12M8 12h12M8 18h12"}),a.jsx("circle",{cx:"4",cy:"6",r:"1.25",fill:"currentColor",stroke:"none"}),a.jsx("circle",{cx:"4",cy:"12",r:"1.25",fill:"currentColor",stroke:"none"}),a.jsx("circle",{cx:"4",cy:"18",r:"1.25",fill:"currentColor",stroke:"none"})]})}function Vge(r){return a.jsxs(ol,{...r,children:[a.jsx("rect",{x:"3.5",y:"4.5",width:"17",height:"15",rx:"2.25"}),a.jsx("path",{d:"M7.5 9.5 10 12l-2.5 2.5M12.5 14.5h4"})]})}function Yge(r){return a.jsx(ol,{...r,children:a.jsx("path",{d:"M20.5 14.3A8.25 8.25 0 0 1 9.7 3.5a8.25 8.25 0 1 0 10.8 10.8Z"})})}function Xge(r){return a.jsxs(ol,{...r,children:[a.jsx("path",{d:"M6.5 17.5a4 4 0 0 1-.7-7.94 5.25 5.25 0 0 1 10.16-1.9A3.75 3.75 0 0 1 17.5 17.5H6.5Z"}),a.jsx("path",{d:"M9.5 13.5 12 11l2.5 2.5M12 11v6.5"})]})}const Zge={platforms:Hge,tasks:Uge,memory:Wge,connections:Gge,format:Kge,brain:Xge,agents:Vge,sleepy:Yge};function Qge(r){const e=r.trim().replace(/\.git$/,"").replace(/\/+$/,"").match(/github\.com[/:]([^/]+)\/([^/]+)$/i);if(e){const i=`${e[1]}/${e[2]}`;return{name:i,web:`https://github.com/${i}`}}return{name:r,web:null}}function Jge(){var T,N,A,j,E;const{t:r}=wr(),{data:e}=VC(),{data:i}=KC(),n=a7(),s=o7(),[o,h]=B.useState("create"),[l,u]=B.useState(""),[d,g]=B.useState(!0),[f,m]=B.useState(""),[y,w]=B.useState(null);if(!(e!=null&&e.connected)||!i)return null;const _=n.isPending||s.isPending,b=((T=n.error)==null?void 0:T.message)??((N=s.error)==null?void 0:N.message)??null,x=()=>{w(null),n.reset(),s.reset()},C=()=>{x(),n.mutate({name:l.trim()||void 0,private:d,confirmed:!d},{onSuccess:L=>w(L)})},k=()=>{f.trim()&&(x(),s.mutate(f.trim(),{onSuccess:L=>w(L)}))};if(y){const L=((A=y.sync)==null?void 0:A.action)==="error";return a.jsxs("div",{className:"origin-setup origin-setup--done",children:[a.jsxs("p",{className:"origin-setup-title",children:[a.jsx("span",{className:"origin-setup-mark","aria-hidden":"true",children:a.jsx(Xo,{size:14})}),r("brain.origin.connected").replace("{repo}",y.fullName??y.remote)]}),a.jsx("p",{className:`origin-setup-outcome${L?" origin-setup-outcome--warn":""}`,children:L?((E=(j=y.sync)==null?void 0:j.failure)==null?void 0:E.message)??r("brain.origin.firstSyncFailed"):r("brain.origin.firstSyncOk")})]})}return i.codeOrigin?a.jsx(eme,{origin:i.codeOrigin}):a.jsxs("div",{className:"origin-setup",children:[a.jsx("p",{className:"origin-setup-title",children:r("brain.origin.title")}),a.jsx("p",{className:"settings-field-hint",children:r("brain.origin.desc")}),a.jsxs("div",{className:"origin-setup-tabs",role:"tablist",children:[a.jsx("button",{role:"tab","aria-selected":o==="create",className:`origin-setup-tab${o==="create"?" origin-setup-tab--active":""}`,onClick:()=>{h("create"),x()},children:r("brain.origin.tab.create")}),a.jsx("button",{role:"tab","aria-selected":o==="attach",className:`origin-setup-tab${o==="attach"?" origin-setup-tab--active":""}`,onClick:()=>{h("attach"),x()},children:r("brain.origin.tab.attach")})]}),o==="create"?a.jsxs("div",{className:"origin-setup-form",children:[a.jsx("input",{className:"settings-text-input",type:"text",value:l,placeholder:r("brain.origin.namePlaceholder"),onChange:L=>u(L.target.value),disabled:_}),a.jsxs("label",{className:"settings-checkbox-label origin-setup-private",children:[a.jsx("input",{type:"checkbox",className:"settings-checkbox",checked:d,disabled:_,onChange:L=>g(L.target.checked)}),a.jsx("span",{children:r("brain.origin.private")})]}),!d&&a.jsx("p",{className:"origin-setup-warn",children:r("brain.origin.publicWarn")}),a.jsx("button",{className:"btn btn--primary",onClick:C,disabled:_,children:n.isPending?r("brain.origin.creating"):r("brain.origin.createBtn")})]}):a.jsxs("div",{className:"origin-setup-form",children:[a.jsx("input",{className:"settings-text-input",type:"text",value:f,placeholder:r("brain.origin.urlPlaceholder"),onChange:L=>m(L.target.value),disabled:_,onKeyDown:L=>{L.key==="Enter"&&k()}}),a.jsx("p",{className:"settings-field-hint",children:r("brain.origin.attachHint")}),a.jsx("button",{className:"btn btn--primary",onClick:k,disabled:_||!f.trim(),children:s.isPending?r("brain.origin.attaching"):r("brain.origin.attachBtn")})]}),b&&a.jsx("p",{className:"origin-setup-error",children:b})]})}function eme({origin:r}){var x,C;const{t:e}=wr(),i=l7(),n=c7(),[s,o]=B.useState(!1),[h,l]=B.useState(!1),[u,d]=B.useState(""),{name:g,web:f}=Qge(r),m=i.isPending||n.isPending,y=((x=i.error)==null?void 0:x.message)??((C=n.error)==null?void 0:C.message)??null,w=()=>{o(!1),d(""),i.reset()},_=()=>{u.trim()&&i.mutate(u.trim(),{onSuccess:w})},b=()=>{n.mutate(void 0,{onSuccess:()=>l(!1)})};return a.jsxs("div",{className:"origin-setup origin-setup--connected",children:[a.jsxs("p",{className:"origin-setup-title",children:[a.jsx("span",{className:"origin-setup-mark","aria-hidden":"true",children:a.jsx(Xo,{size:14})}),e("brain.origin.connectedTitle")]}),a.jsxs("div",{className:"origin-connected-repo",children:[f?a.jsx("a",{className:"origin-connected-name",href:f,target:"_blank",rel:"noreferrer",children:g}):a.jsx("span",{className:"origin-connected-name",children:g}),a.jsx("span",{className:"origin-connected-url",children:r})]}),s?a.jsxs("div",{className:"origin-setup-form",children:[a.jsx("input",{className:"settings-text-input",type:"text",value:u,placeholder:e("brain.origin.urlPlaceholder"),onChange:k=>d(k.target.value),disabled:m,onKeyDown:k=>{k.key==="Enter"&&_()},autoFocus:!0}),a.jsx("p",{className:"settings-field-hint",children:e("brain.origin.changeHint")}),a.jsxs("div",{className:"origin-connected-actions",children:[a.jsx("button",{className:"btn btn--primary btn--sm",onClick:_,disabled:m||!u.trim(),children:i.isPending?e("brain.origin.updating"):e("brain.origin.updateBtn")}),a.jsx("button",{className:"btn btn--sm",onClick:w,disabled:m,children:e("common.cancel")})]})]}):h?a.jsxs("div",{className:"origin-connected-actions",children:[a.jsx("span",{className:"origin-connected-detach-warn",children:e("brain.origin.detachWarn")}),a.jsx("button",{className:"btn btn--danger btn--sm",onClick:b,disabled:m,children:n.isPending?e("brain.origin.detaching"):e("brain.origin.detachConfirm")}),a.jsx("button",{className:"btn btn--sm",onClick:()=>{n.reset(),l(!1)},disabled:m,children:e("common.cancel")})]}):a.jsxs("div",{className:"origin-connected-actions",children:[a.jsx("button",{className:"btn btn--sm",onClick:()=>{n.reset(),o(!0)},disabled:m,children:e("brain.origin.changeBtn")}),a.jsx("button",{className:"btn btn--sm",onClick:()=>{i.reset(),l(!0)},disabled:m,children:e("brain.origin.detachBtn")})]}),y&&a.jsx("p",{className:"origin-setup-error",children:y})]})}const fb=["linked-repos"];function tme(){return Yt({queryKey:fb,queryFn:()=>De.get("/linked-repos"),select:r=>r.repos})}function rme(){const r=Pt();return Vt({mutationFn:e=>De.post("/linked-repos/link",e),onSuccess:()=>r.invalidateQueries({queryKey:fb})})}function ime(){const r=Pt();return Vt({mutationFn:e=>De.post("/linked-repos/clone",{name:e,confirmed:!0}),onSuccess:()=>r.invalidateQueries({queryKey:fb})})}function nme(){const r=Pt();return Vt({mutationFn:e=>De.post("/linked-repos/unlink",{name:e}),onSuccess:()=>r.invalidateQueries({queryKey:fb})})}function sme(){var m,y,w;const{t:r}=wr(),{data:e}=tme(),i=rme(),n=ime(),s=nme(),[o,h]=B.useState(""),[l,u]=B.useState(null),d=i.isPending||n.isPending||s.isPending,g=((m=i.error)==null?void 0:m.message)??((y=n.error)==null?void 0:y.message)??((w=s.error)==null?void 0:w.message)??null,f=async()=>{const _=o.trim();if(!_)return;i.reset();const b=await AB();b&&i.mutate({name:_,path:b},{onSuccess:()=>h("")})};return a.jsxs("div",{className:"linked-repos",children:[a.jsx("p",{className:"linked-repos-title",children:r("linkedRepos.title")}),a.jsx("p",{className:"settings-field-hint",children:r("linkedRepos.desc")}),e&&e.length>0?a.jsx("ul",{className:"linked-repos-list",children:e.map(_=>a.jsxs("li",{className:"linked-repos-item",children:[a.jsxs("div",{className:"linked-repos-item-main",children:[a.jsx("span",{className:"linked-repos-name",children:_.name}),a.jsx("span",{className:"linked-repos-url",children:_.gitRemoteUrl}),_.present?a.jsx("span",{className:"linked-repos-path",children:_.path}):a.jsx("span",{className:"linked-repos-missing",children:r("linkedRepos.missing")})]}),a.jsxs("div",{className:"linked-repos-item-actions",children:[!_.present&&(l===_.name?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"linked-repos-trust-warn",children:r("linkedRepos.trustWarn")}),a.jsx("button",{className:"btn btn--primary btn--sm",disabled:d,onClick:()=>n.mutate(_.name,{onSuccess:()=>u(null)}),children:n.isPending?r("linkedRepos.cloning"):r("linkedRepos.cloneConfirm")}),a.jsx("button",{className:"btn btn--sm",disabled:d,onClick:()=>u(null),children:r("common.cancel")})]}):a.jsx("button",{className:"btn btn--sm",disabled:d,onClick:()=>{n.reset(),u(_.name)},children:r("linkedRepos.clone")})),a.jsx("button",{className:"btn btn--sm",disabled:d,onClick:()=>s.mutate(_.name),children:r("linkedRepos.unlink")})]})]},_.gitRemoteUrl))}):a.jsx("p",{className:"settings-field-hint",children:r("linkedRepos.empty")}),a.jsxs("div",{className:"linked-repos-add",children:[a.jsx("input",{className:"settings-text-input",type:"text",value:o,placeholder:r("linkedRepos.namePlaceholder"),onChange:_=>h(_.target.value),disabled:d}),a.jsx("button",{className:"btn btn--primary btn--sm",disabled:d||!o.trim(),onClick:f,children:i.isPending?r("linkedRepos.adding"):r("linkedRepos.add")})]}),g&&a.jsx("p",{className:"linked-repos-error",children:g})]})}function ame(r){const e=[];r.metaKey&&e.push("Cmd"),r.ctrlKey&&e.push("Ctrl"),r.altKey&&e.push("Alt"),r.shiftKey&&e.push("Shift");let i=r.key;return["Meta","Control","Alt","Shift"].includes(i)||(i===" "?i="Space":i.length===1?i=i.toUpperCase():i=i.charAt(0).toUpperCase()+i.slice(1),e.length===0)?null:[...e,i].join("+")}const ome=[{id:"claude",labelKey:"settings.platform.claude"}],lme=[{mode:"haiku",labelKey:"settings.recall.haiku.label",hintKey:"settings.recall.haiku.hint"},{mode:"raw",labelKey:"settings.recall.raw.label",hintKey:"settings.recall.raw.hint"},{mode:"hybrid",labelKey:"settings.recall.hybrid.label",hintKey:"settings.recall.hybrid.hint",experimental:!0},{mode:"off",labelKey:"settings.recall.off.label",hintKey:"settings.recall.off.hint"}],T_={platforms:[],disableNativeMemory:!0},cme=[{id:"platforms",labelKey:"settings.nav.platforms",descKey:"settings.navdesc.platforms"},{id:"tasks",labelKey:"settings.nav.tasks",descKey:"settings.navdesc.tasks"},{id:"memory",labelKey:"settings.nav.memory",descKey:"settings.navdesc.memory"},{id:"connections",labelKey:"settings.nav.connections",descKey:"settings.navdesc.connections"},{id:"brain",labelKey:"settings.nav.brain",descKey:"settings.navdesc.brain"},{id:"format",labelKey:"settings.nav.format",descKey:"settings.navdesc.format",beta:!0},{id:"agents",labelKey:"settings.nav.agents",descKey:"settings.navdesc.agents",desktopOnly:!0,beta:!0},{id:"sleepy",labelKey:"settings.nav.sleepy",descKey:"settings.navdesc.sleepy",desktopOnly:!0,lab:!0}];function hme({focus:r}){var gt,nt;const{t:e}=wr(),i=Pt(),{data:n,isLoading:s,isError:o}=Ege(),h=Nge(),{data:l}=Ek(),u=((l==null?void 0:l.desktop)??!1)||qi(),{data:d}=n7(),g=s7(),[f,m]=B.useState(()=>wF()),{data:y}=ob(),w=Ple(),_=(y==null?void 0:y.recall_mode)??"haiku",[b,x]=B.useState("platforms"),C=cme.filter(ge=>!ge.desktopOnly||u),[k,T]=B.useState(T_.platforms),[N,A]=B.useState(T_.disableNativeMemory),[j,E]=B.useState(!1),[L,O]=B.useState("clickup"),[D,K]=B.useState(""),[z,H]=B.useState(""),[P,$]=B.useState(""),[W,V]=B.useState(""),[F,G]=B.useState(""),[U,X]=B.useState(""),[ee,re]=B.useState(""),[le,fe]=B.useState(null),[ie,I]=B.useState(!1),[Z,J]=B.useState(null),[ne,ce]=B.useState(null),[xe,Ve]=B.useState(!1),[We,et]=B.useState(null),[de,Ne]=B.useState(!1),[he,He]=B.useState(!1),[ut,zt]=B.useState(()=>Aw()),[At,Lt]=B.useState(!1),qt=ge=>{zt(ge),_Q(ge),_1(ge)},[mt,Te]=B.useState(null),[Ie,Be]=B.useState(!1),Je=B.useRef(null);B.useEffect(()=>{if(!u)return;let ge=!1;return gF().then(qe=>{ge||Te(qe)}),()=>{ge=!0}},[u]);const vt=ge=>{Te(ge),Wle(ge)},{data:lt}=Yt({queryKey:["tasks-sync-status"],queryFn:()=>De.get("/tasks/sync-status"),select:ge=>ge.status}),{data:Nt}=Yt({queryKey:["tasks-token-status"],queryFn:()=>De.get("/tasks/token-status"),enabled:j}),ke=Nt&&Nt.backend===L?Nt:void 0,{data:dt}=Yt({queryKey:["tasks-containers"],queryFn:()=>De.get("/tasks/containers"),select:ge=>ge.containers,enabled:j,staleTime:300*1e3}),at=ge=>{const qe=(dt??[]).find(kt=>kt.path===ge);qe&&(L==="github"?(V(qe.ids.owner??""),G(qe.ids.repo??"")):(K(qe.ids.teamId??""),H(qe.ids.spaceId??""),$(qe.ids.listId??"")),Ae())},ve=async()=>{const ge=j?L:"local",qe=(L==="github"?ee:U).trim();try{return await h.mutateAsync({platforms:k,disableNativeMemory:N,taskBackend:ge,...j&&L==="clickup"?{clickup:{teamId:D||void 0,spaceId:z||void 0,listId:P||void 0}}:{},...j&&L==="github"?{github:{owner:W||void 0,repo:F||void 0}}:{}}),j&&qe&&await De.post("/tasks/token",{token:qe}),qe&&(L==="github"?re(""):X("")),await Promise.all([i.invalidateQueries({queryKey:["tasks-token-status"]}),i.invalidateQueries({queryKey:["tasks-containers"]}),i.invalidateQueries({queryKey:["tasks-sync-status"]})]),Ne(!1),et(null),!0}catch(kt){return et(kt instanceof Error?kt.message:String(kt)),!1}},ye=ge=>ge.errors.length>0?`⚠ ${ge.errors[0]}`:ge.created.length>0?`✓ ${e("settings.cloud_tasks.provision_created")}: ${ge.created.join(", ")}${ge.backfilled>0?` · ${e("settings.cloud_tasks.provision_backfilled").replace("{n}",String(ge.backfilled))}`:""}`:`✓ ${e("settings.cloud_tasks.provision_nothing")}`,rt=ge=>!ge||!ge.set?e("settings.cloud_tasks.api_key_none"):ge.source==="env"?`${e("settings.cloud_tasks.api_key_env")} ${ge.masked??""}`.trim():`${e("settings.cloud_tasks.api_key_set")} ${ge.masked??""}`.trim(),Ze=async()=>{Ve(!0),J(null),ce(null);try{if(!await ve())return;const{result:ge}=await De.post("/tasks/provision",{dryRun:!0});ge.created.length===0&&ge.errors.length===0?J(`✓ ${e("settings.cloud_tasks.provision_nothing")}`):ce(ge)}catch(ge){J(`⚠ ${ge instanceof Error?ge.message:String(ge)}`)}finally{Ve(!1)}},xt=async()=>{Ve(!0),J(null);try{const{result:ge}=await De.post("/tasks/provision",{dryRun:!1});ce(null),J(ye(ge)),i.invalidateQueries({queryKey:["tasks-sync-status"]})}catch(ge){J(`⚠ ${ge instanceof Error?ge.message:String(ge)}`)}finally{Ve(!1)}};if(B.useEffect(()=>{var kt,se,ue,be,Ee;const ge=n??T_;T(ge.platforms),A(ge.disableNativeMemory??!0);const qe=n;E((qe==null?void 0:qe.taskBackend)==="clickup"||(qe==null?void 0:qe.taskBackend)==="github"),O((qe==null?void 0:qe.taskBackend)==="github"?"github":"clickup"),K(((kt=qe==null?void 0:qe.clickup)==null?void 0:kt.teamId)??""),H(((se=qe==null?void 0:qe.clickup)==null?void 0:se.spaceId)??""),$(((ue=qe==null?void 0:qe.clickup)==null?void 0:ue.listId)??""),V(((be=qe==null?void 0:qe.github)==null?void 0:be.owner)??""),G(((Ee=qe==null?void 0:qe.github)==null?void 0:Ee.repo)??""),Ne(!1),He(!1)},[n]),B.useEffect(()=>{(r==null?void 0:r.id)==="brain"&&x("brain")},[r==null?void 0:r.id,r==null?void 0:r.nonce]),s)return a.jsx("div",{className:"loading",children:e("common.loading")});if(o)return a.jsx("div",{className:"error-state",children:e("common.error")});const pt=ge=>{T(qe=>{const kt=qe.includes(ge)?qe.filter(se=>se!==ge):[...qe,ge];return Ne(!0),He(!1),kt})},wt=()=>{A(ge=>!ge),Ne(!0),He(!1)},ae=async()=>{He(!1),await ve()&&He(!0)},Ae=()=>{Ne(!0),He(!1)},Ye=(n==null?void 0:n.shareable)===!0,ot=ge=>{h.mutate({shareable:ge})},Ft=async()=>{I(!0),fe(null),ce(null);try{if(!await ve())return;fe(await De.post("/tasks/sync-test",{}))}catch(ge){fe({ok:!1,backend:L,error:ge instanceof Error?ge.message:String(ge)})}finally{I(!1)}};return a.jsxs("div",{className:"settings-page",children:[a.jsx("div",{className:"settings-header",children:a.jsxs("div",{className:"settings-save-row",children:[he&&!de&&a.jsx("span",{className:"settings-saved",children:e("settings.saved")}),h.isError&&a.jsx("span",{className:"settings-error",children:e("common.error")}),a.jsx("button",{className:"btn btn--primary",onClick:ae,disabled:!de||h.isPending,children:h.isPending?e("settings.saving"):e("settings.save")})]})}),n===null&&a.jsx("div",{className:"settings-empty-notice",children:e("settings.no_config")}),a.jsxs("div",{className:"settings-body",children:[a.jsx("nav",{className:"settings-nav","aria-label":e("settings.title"),children:C.map(ge=>{const qe=Zge[ge.id],kt=b===ge.id;return a.jsxs("button",{type:"button",className:`settings-nav-item${kt?" settings-nav-item--active":""}`,"aria-current":kt?"page":void 0,onClick:()=>x(ge.id),children:[a.jsx("span",{className:"settings-nav-icon","aria-hidden":"true",children:qe?a.jsx(qe,{}):null}),a.jsxs("span",{className:"settings-nav-text",children:[a.jsxs("span",{className:"settings-nav-label",children:[e(ge.labelKey),ge.lab&&a.jsx("span",{className:"settings-lab-badge",children:e("nav.lab")}),ge.beta&&a.jsx("span",{className:"settings-beta-badge",children:"BETA"})]}),a.jsx("span",{className:"settings-nav-desc",children:e(ge.descKey)})]})]},ge.id)})}),a.jsxs("div",{className:"settings-content",children:[b==="platforms"&&a.jsxs("section",{className:"settings-section",children:[a.jsxs("div",{className:"settings-section-head",children:[a.jsx("h2",{className:"settings-section-title",children:e("settings.platforms")}),a.jsx("p",{className:"settings-section-desc",children:e("settings.desc.platforms")})]}),a.jsx("div",{className:"settings-checkboxes",children:ome.map(({id:ge,labelKey:qe})=>a.jsxs("label",{className:"settings-checkbox-label",children:[a.jsx("input",{type:"checkbox",className:"settings-checkbox",checked:k.includes(ge),onChange:()=>pt(ge)}),a.jsx("span",{children:e(qe)})]},ge))})]}),b==="tasks"&&a.jsxs("section",{className:"settings-section",children:[a.jsxs("div",{className:"settings-section-head",children:[a.jsx("h2",{className:"settings-section-title",children:e("settings.tasks")}),a.jsx("p",{className:"settings-section-desc",children:e("settings.desc.tasks")})]}),a.jsxs("div",{className:"settings-checkboxes",children:[a.jsxs("label",{className:"settings-checkbox-label",children:[a.jsx("input",{type:"checkbox",className:"settings-checkbox",checked:j,onChange:()=>{E(ge=>!ge),Ae()}}),a.jsx("span",{children:e("settings.cloud_tasks.label")})]}),a.jsx("p",{className:"settings-field-hint",children:e(L==="github"?"settings.cloud_tasks.github.hint":"settings.cloud_tasks.hint")}),j&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"settings-field-row",children:[a.jsx("label",{children:e("settings.cloud_tasks.provider")}),a.jsxs("select",{className:"settings-text-input",value:L,onChange:ge=>{const qe=ge.target.value;O(qe),fe(null),Ae()},children:[a.jsx("option",{value:"clickup",children:e("settings.cloud_tasks.provider.clickup")}),a.jsx("option",{value:"github",children:e("settings.cloud_tasks.provider.github")})]})]}),L==="clickup"&&a.jsxs(a.Fragment,{children:[(dt??[]).length>0&&a.jsxs("div",{className:"settings-field-row",children:[a.jsx("label",{children:e("settings.cloud_tasks.list_label")}),a.jsx(mf,{value:P?((gt=(dt??[]).find(ge=>ge.ids.listId===P))==null?void 0:gt.path)??null:null,options:(dt??[]).map(ge=>({value:ge.path,label:ge.path})),placeholder:e("settings.cloud_tasks.list_pick"),searchPlaceholder:e("settings.cloud_tasks.list_search"),clearLabel:e("settings.cloud_tasks.keep_current"),onChange:at})]}),a.jsxs("div",{className:"settings-field-row",children:[a.jsx("label",{children:e("settings.cloud_tasks.team")}),a.jsx("input",{className:"settings-text-input",value:D,onChange:ge=>{K(ge.target.value),Ae()}})]}),a.jsxs("div",{className:"settings-field-row",children:[a.jsx("label",{children:e("settings.cloud_tasks.space")}),a.jsx("input",{className:"settings-text-input",value:z,onChange:ge=>{H(ge.target.value),Ae()}})]}),a.jsxs("div",{className:"settings-field-row",children:[a.jsx("label",{children:e("settings.cloud_tasks.list")}),a.jsx("input",{className:"settings-text-input",value:P,onChange:ge=>{$(ge.target.value),Ae()}})]}),a.jsxs("div",{className:"settings-field-row",children:[a.jsx("label",{children:e("settings.cloud_tasks.api_key")}),a.jsx("input",{type:"password",className:"settings-text-input",autoComplete:"off",value:U,placeholder:ke!=null&&ke.set?ke.masked??"••••••••":e("settings.cloud_tasks.api_key_placeholder"),onChange:ge=>{X(ge.target.value),Ae()}})]}),a.jsx("p",{className:"settings-field-hint",children:rt(ke)}),a.jsx("p",{className:"settings-field-hint",children:e("settings.cloud_tasks.token_hint")})]}),L==="github"&&a.jsxs(a.Fragment,{children:[(dt??[]).length>0&&a.jsxs("div",{className:"settings-field-row",children:[a.jsx("label",{children:e("settings.cloud_tasks.github.repo_picker")}),a.jsx(mf,{value:W&&F?`${W}/${F}`:null,options:(dt??[]).map(ge=>({value:ge.path,label:ge.path})),placeholder:e("settings.cloud_tasks.github.pick"),searchPlaceholder:e("settings.cloud_tasks.github.search"),clearLabel:e("settings.cloud_tasks.keep_current"),onChange:at})]}),a.jsxs("div",{className:"settings-field-row",children:[a.jsx("label",{children:e("settings.cloud_tasks.github.owner")}),a.jsx("input",{className:"settings-text-input",value:W,onChange:ge=>{V(ge.target.value),Ae()}})]}),a.jsxs("div",{className:"settings-field-row",children:[a.jsx("label",{children:e("settings.cloud_tasks.github.repo")}),a.jsx("input",{className:"settings-text-input",value:F,onChange:ge=>{G(ge.target.value),Ae()}})]}),a.jsxs("div",{className:"settings-field-row",children:[a.jsx("label",{children:e("settings.cloud_tasks.api_key")}),a.jsx("input",{type:"password",className:"settings-text-input",autoComplete:"off",value:ee,placeholder:ke!=null&&ke.set?ke.masked??"••••••••":e("settings.cloud_tasks.api_key_placeholder"),onChange:ge=>{re(ge.target.value),Ae()}})]}),a.jsx("p",{className:"settings-field-hint",children:rt(ke)}),a.jsx("p",{className:"settings-field-hint",children:e("settings.cloud_tasks.github.token_hint")})]}),a.jsxs("div",{className:"settings-test-row",children:[a.jsx("button",{className:"btn btn--secondary",onClick:Ft,disabled:ie||xe,children:e(ie?"settings.cloud_tasks.testing":"settings.cloud_tasks.test")}),a.jsx("button",{className:"btn btn--secondary",onClick:Ze,disabled:xe||ie,children:e(xe&&!ne?L==="github"?"settings.cloud_tasks.github.provisioning":"settings.cloud_tasks.provisioning":L==="github"?"settings.cloud_tasks.github.provision":"settings.cloud_tasks.provision")}),le&&le.ok&&a.jsxs("span",{className:"settings-test-ok",children:["✓ ",le.note??`${e("settings.cloud_tasks.test_ok")} ${le.user}`]}),le&&!le.ok&&a.jsxs("span",{className:"settings-test-err",children:["✗ ",le.error]})]}),We&&a.jsxs("p",{className:"settings-test-err",children:["✗ ",We]}),Z&&a.jsx("p",{className:"settings-field-hint",children:Z}),ne&&a.jsxs("div",{className:"settings-provision-preview",children:[a.jsx("p",{className:"settings-provision-preview-title",children:e(L==="github"?"settings.cloud_tasks.github.preview_title":"settings.cloud_tasks.preview_title")}),ne.created.length>0&&a.jsxs("p",{className:"settings-provision-line",children:[a.jsx("span",{className:"settings-provision-badge settings-provision-badge--new",children:e("settings.cloud_tasks.preview_will_create").replace("{n}",String(ne.created.length))})," ",ne.created.join(", ")]}),ne.existing.length>0&&a.jsxs("p",{className:"settings-provision-line settings-provision-line--muted",children:[a.jsx("span",{className:"settings-provision-badge",children:e("settings.cloud_tasks.preview_existing").replace("{n}",String(ne.existing.length))})," ",ne.existing.join(", ")]}),a.jsxs("div",{className:"settings-provision-actions",children:[a.jsx("button",{className:"btn btn--primary",onClick:xt,disabled:xe,children:xe?e("settings.cloud_tasks.provision_creating"):e("settings.cloud_tasks.provision_confirm").replace("{n}",String(ne.created.length))}),a.jsx("button",{className:"btn btn--ghost",onClick:()=>ce(null),disabled:xe,children:e("settings.cloud_tasks.provision_cancel")})]})]}),lt&&lt.backend!=="local"&&a.jsxs("p",{className:"settings-sync-badge",children:[e("settings.cloud_tasks.status"),": ",lt.pendingPush," ",e("settings.cloud_tasks.pending"),lt.conflicts>0&&` · ${lt.conflicts} ${e("settings.cloud_tasks.conflicts")}`]})]})]})]}),b==="format"&&a.jsx(qge,{}),b==="memory"&&a.jsxs("section",{className:"settings-section",children:[a.jsxs("div",{className:"settings-section-head",children:[a.jsx("h2",{className:"settings-section-title",children:e("settings.memory")}),a.jsx("p",{className:"settings-section-desc",children:e("settings.desc.memory")})]}),a.jsxs("div",{className:"settings-checkboxes",children:[a.jsxs("label",{className:"settings-checkbox-label",children:[a.jsx("input",{type:"checkbox",className:"settings-checkbox",checked:N,onChange:wt}),a.jsx("span",{children:e("settings.native_memory.label")})]}),a.jsx("p",{className:"settings-field-hint",children:e("settings.native_memory.hint")})]}),a.jsxs("div",{className:"settings-subsection",children:[a.jsx("h3",{className:"settings-nav-label",children:e("settings.recall.title")}),a.jsx("p",{className:"settings-field-hint settings-recall-desc",children:e("settings.recall.desc")}),a.jsx("div",{className:"settings-checkboxes",role:"radiogroup","aria-label":e("settings.recall.title"),children:lme.map(({mode:ge,labelKey:qe,hintKey:kt,experimental:se})=>a.jsxs("div",{children:[a.jsxs("label",{className:"settings-checkbox-label",children:[a.jsx("input",{type:"radio",name:"recall-mode",className:"settings-checkbox",checked:_===ge,disabled:w.isPending,onChange:()=>w.mutate({recall_mode:ge})}),a.jsxs("span",{children:[e(qe),se&&a.jsx("span",{className:"settings-beta-badge",children:e("settings.recall.experimental")})]})]}),a.jsx("p",{className:"settings-field-hint",children:e(kt)}),ge==="hybrid"&&_==="hybrid"&&a.jsx(zge,{})]},ge))}),w.isError&&a.jsxs("p",{className:"settings-test-err",children:["✗ ",e("common.error")]})]})]}),b==="connections"&&a.jsx(Oge,{shareable:Ye,onToggleShareable:ot,shareablePending:h.isPending}),b==="brain"&&a.jsxs("section",{className:"settings-section",children:[a.jsxs("div",{className:"fed-head",children:[a.jsxs("div",{className:"settings-section-head",children:[a.jsx("h2",{className:"settings-section-title",children:e("settings.brain")}),a.jsx("p",{className:"settings-section-desc",children:e("settings.desc.brain")})]}),a.jsxs("label",{className:"fed-sharing-toggle settings-checkbox-label",title:e("brain.cloudSync.hint"),children:[a.jsx("input",{type:"checkbox",className:"settings-checkbox",checked:(d==null?void 0:d.enabled)??!1,disabled:g.isPending,onChange:ge=>g.mutate(ge.target.checked)}),a.jsxs("span",{children:[e("brain.cloudSync.label"),d&&a.jsxs("span",{className:"settings-field-hint brain-cloudsync-source",children:[" ","(",d.source==="explicit"?e("brain.cloudSync.source.explicit"):e("brain.cloudSync.source.derived"),")"]})]})]})]}),a.jsx("p",{className:"settings-section-desc",children:e("brain.cloudSync.desc")}),g.isError&&a.jsx("p",{className:"settings-field-hint brain-scope-error",children:((nt=g.error)==null?void 0:nt.message)??e("brain.cloudSync.error")}),a.jsxs("div",{className:"settings-subsection",children:[a.jsx("h3",{className:"settings-nav-label",children:e("brain.auth.title")}),a.jsx(xce,{}),a.jsx(Jge,{}),a.jsx(sme,{})]}),a.jsxs("div",{className:"settings-subsection",children:[a.jsxs("label",{className:"fed-sharing-toggle settings-checkbox-label",title:e("brain.scope.autoCheckpoint.hint"),children:[a.jsx("input",{type:"checkbox",checked:f,onChange:ge=>{m(ge.target.checked),wce(ge.target.checked)}}),a.jsx("span",{children:e("brain.scope.autoCheckpoint.label")})]}),a.jsx("p",{className:"settings-field-hint",children:e("brain.scope.autoCheckpoint.hint")})]})]}),b==="agents"&&u&&a.jsxs("section",{className:"settings-section",children:[a.jsxs("h2",{className:"settings-section-title",children:[e("settings.agents.title"),a.jsx("span",{className:"settings-beta-badge",children:"BETA"})]}),mt?a.jsxs("div",{className:"settings-checkboxes",children:[a.jsxs("label",{className:"settings-checkbox-label",children:[a.jsx("input",{type:"checkbox",className:"settings-checkbox",checked:mt.enabled,onChange:()=>vt({...mt,enabled:!mt.enabled})}),a.jsx("span",{children:e("settings.agents.enable")})]}),a.jsx("p",{className:"settings-field-hint",children:e("settings.agents.enable_hint")}),mt.enabled&&a.jsxs(a.Fragment,{children:[a.jsxs("label",{className:"settings-checkbox-label",children:[a.jsx("input",{type:"checkbox",className:"settings-checkbox",checked:mt.restoreTabs,onChange:()=>vt({...mt,restoreTabs:!mt.restoreTabs})}),a.jsx("span",{children:e("settings.agents.restore_tabs")})]}),a.jsx("p",{className:"settings-field-hint",children:e("settings.agents.restore_tabs_hint")}),a.jsxs("div",{className:"settings-field-row",children:[a.jsx("label",{children:e("settings.agents.default_agent")}),a.jsx("select",{className:"settings-text-input",value:mt.defaultAgent,onChange:ge=>vt({...mt,defaultAgent:ge.target.value}),children:a.jsx("option",{value:"claude",children:e("settings.agents.agent.claude")})})]}),a.jsx("p",{className:"settings-field-hint",children:e("settings.agents.default_agent_hint")}),a.jsxs("label",{className:"settings-checkbox-label",children:[a.jsx("input",{type:"checkbox",className:"settings-checkbox",checked:mt.autoTitle,onChange:()=>vt({...mt,autoTitle:!mt.autoTitle})}),a.jsx("span",{children:e("settings.agents.auto_title")})]}),a.jsx("p",{className:"settings-field-hint",children:e("settings.agents.auto_title_hint")}),a.jsxs("div",{className:"settings-field-row",children:[a.jsx("label",{children:e("settings.agents.hotkey")}),a.jsx("input",{className:"settings-text-input",readOnly:!0,value:Ie?e("settings.agents.hotkey_capturing"):Kle(mt.hotkey),onFocus:()=>{Be(!0),Je.current=null},onBlur:()=>{Be(!1),Je.current=null},onKeyDown:ge=>{if(ge.preventDefault(),ge.key==="Backspace"||ge.key==="Delete"){vt({...mt,hotkey:""}),Je.current=null,Be(!1),ge.currentTarget.blur();return}const qe=vF(ge);if(qe){if(ge.repeat)return;const se=Date.now(),ue=Je.current;ue&&ue.token===qe&&se-ue.ts<=yF?(Je.current=null,vt({...mt,hotkey:`${qe}+${qe}`}),Be(!1),ge.currentTarget.blur()):Je.current={token:qe,ts:se};return}Je.current=null;const kt=mF(ge);kt&&(vt({...mt,hotkey:kt}),Be(!1),ge.currentTarget.blur())}})]}),a.jsx("p",{className:"settings-field-hint",children:e("settings.agents.hotkey_hint")})]})]}):a.jsx("p",{className:"settings-field-hint",children:e("common.loading")})]}),b==="sleepy"&&u&&a.jsxs("section",{className:"settings-section",children:[a.jsxs("h2",{className:"settings-section-title",children:["Sleepy — notch quick-capture",a.jsx("span",{className:"settings-lab-badge",children:e("nav.lab")})]}),a.jsxs("div",{className:"settings-checkboxes",children:[a.jsxs("label",{className:"settings-checkbox-label",children:[a.jsx("input",{type:"checkbox",className:"settings-checkbox",checked:ut.enabled,onChange:()=>qt({...ut,enabled:!ut.enabled})}),a.jsx("span",{children:"Enable Sleepy"})]}),a.jsx("p",{className:"settings-field-hint",children:"Press the hotkey anywhere to drop a capture bar under the notch: pick a project, type a thought, hit return — it's saved to that project's memory and learned."}),ut.enabled&&a.jsxs("div",{className:"settings-field-row",children:[a.jsx("label",{children:"Hotkey"}),a.jsx("input",{className:"settings-text-input",readOnly:!0,value:At?"Press a key combo…":ut.hotkey,onFocus:()=>Lt(!0),onBlur:()=>Lt(!1),onKeyDown:ge=>{ge.preventDefault();const qe=ame(ge);qe&&(qt({...ut,hotkey:qe}),Lt(!1),ge.currentTarget.blur())}})]})]})]})]})]})]})}function O$(){return Yt({queryKey:["packs"],queryFn:()=>De.get("/packs")})}function ume(){const r=Pt();return Vt({mutationFn:e=>De.post(`/packs/${encodeURIComponent(e)}/install`,{}),onSuccess:()=>{r.invalidateQueries({queryKey:["packs"]})}})}function dme(){const r=Pt();return Vt({mutationFn:e=>De.del(`/packs/${encodeURIComponent(e)}`),onSuccess:()=>{r.invalidateQueries({queryKey:["packs"]})}})}function fme(r){return"base"in r}function D$({item:r,onActionDone:e}){const{t:i}=wr(),n=ume(),s=dme(),o=r.installed,h=o?s:n,l=h.isPending,u=h.isError,d=i(o?"packs.action.remove":"packs.action.install"),g=i(o?"packs.action.removing":"packs.action.installing"),f=l?g:d,m=y=>{y.stopPropagation(),y.preventDefault(),!l&&h.mutate(r.name,{onSuccess:()=>e==null?void 0:e()})};return a.jsxs("div",{className:"packs-card-actions",children:[a.jsx("button",{type:"button",className:`packs-action-btn btn btn--ghost${o?" packs-action-btn--danger":""}`,onClick:m,disabled:l,"aria-invalid":u||void 0,"aria-busy":l||void 0,children:f}),u&&a.jsx("span",{className:"packs-action-error",role:"alert",children:i("packs.action.error")})]})}function pme({item:r,onClose:e}){const{t:i}=wr(),n=B.useCallback(s=>{s.target===s.currentTarget&&e()},[e]);return B.useEffect(()=>{const s=o=>{o.key==="Escape"&&e()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[e]),a.jsx("div",{className:"packs-modal-overlay",onClick:n,"aria-modal":"true",role:"dialog","aria-label":r.name,children:a.jsxs("div",{className:"packs-modal-panel",children:[a.jsxs("div",{className:"packs-modal-header",children:[a.jsxs("div",{className:"packs-modal-title-row",children:[a.jsx("h2",{className:"packs-modal-name",children:r.name}),r.installed&&a.jsx("span",{className:"packs-installed-pill",children:i("settings.packs.installed")})]}),a.jsxs("div",{className:"packs-modal-header-actions",children:[a.jsx(D$,{item:r,onActionDone:e}),a.jsx("button",{className:"packs-modal-close btn btn--ghost",type:"button",onClick:e,"aria-label":i("packs.detail.close"),children:i("packs.detail.close")})]})]}),r.description&&a.jsx("p",{className:"packs-modal-desc",children:r.description}),r.tags.length>0&&a.jsx("div",{className:"packs-modal-tags",children:r.tags.map(s=>a.jsx("span",{className:"task-tag","data-hue":na(s),children:s},s))}),fme(r)&&a.jsxs(a.Fragment,{children:[r.base&&a.jsxs("div",{className:"packs-modal-section",children:[a.jsx("h3",{className:"packs-modal-section-title",children:i("packs.detail.base")}),a.jsx("p",{className:"packs-modal-mono",children:r.base})]}),r.subSkills.length>0&&a.jsxs("div",{className:"packs-modal-section",children:[a.jsx("h3",{className:"packs-modal-section-title",children:i("packs.detail.subskills")}),a.jsx("ul",{className:"packs-modal-subskills",children:r.subSkills.map(s=>a.jsxs("li",{className:"packs-modal-subskill",children:[a.jsx("span",{className:"packs-modal-subskill-name",children:s.name}),s.description&&a.jsx("span",{className:"packs-modal-subskill-desc",children:s.description})]},s.name))})]}),r.relatedAgents&&r.relatedAgents.length>0&&a.jsxs("div",{className:"packs-modal-section",children:[a.jsx("h3",{className:"packs-modal-section-title",children:i("packs.detail.agents")}),a.jsx("ul",{className:"packs-modal-agents",children:r.relatedAgents.map(s=>a.jsx("li",{className:"packs-modal-agent",children:s},s))})]})]})]})})}function PR({item:r,onClick:e}){const{t:i}=wr(),n=s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),e(r))};return a.jsxs("div",{className:"packs-card packs-card--clickable",role:"button",tabIndex:0,onClick:()=>e(r),onKeyDown:n,"aria-label":r.name,children:[a.jsxs("div",{className:"packs-card-header",children:[a.jsx("span",{className:"packs-card-name",children:r.name}),r.installed&&a.jsx("span",{className:"packs-installed-pill",children:i("settings.packs.installed")})]}),r.description&&a.jsx("p",{className:"packs-card-desc",children:r.description}),r.tags.length>0&&a.jsx("div",{className:"packs-card-tags",children:r.tags.map(s=>a.jsx("span",{className:"task-tag","data-hue":na(s),children:s},s))}),a.jsx(D$,{item:r})]})}function gme(){const{t:r}=wr(),{data:e,isLoading:i,isError:n,error:s}=O$(),[o,h]=B.useState(null);if(i)return a.jsx("div",{className:"loading",children:r("common.loading")});if(n)return a.jsxs("div",{className:"error-state",children:[r("common.error")," ",s==null?void 0:s.message]});const l=(e==null?void 0:e.packs)??[],u=(e==null?void 0:e.standalone)??[];return a.jsxs("div",{className:"packs-page",children:[l.length===0&&u.length===0&&a.jsx("div",{className:"packs-empty",children:r("common.empty")}),l.length>0&&a.jsxs("section",{className:"packs-section",children:[a.jsx("h2",{className:"packs-section-title",children:r("packs.section.packs")}),a.jsx("div",{className:"packs-grid",children:l.map(d=>a.jsx(PR,{item:d,onClick:h},d.name))})]}),u.length>0&&a.jsxs("section",{className:"packs-section",children:[a.jsx("h2",{className:"packs-section-title",children:r("packs.section.standalone")}),a.jsx("div",{className:"packs-grid",children:u.map(d=>a.jsx(PR,{item:d,onClick:h},d.name))})]}),o!==null&&a.jsx(pme,{item:o,onClose:()=>h(null)})]})}function mme(){return a.jsxs("header",{className:"about-hero",children:[a.jsxs("div",{className:"about-hero-copy",children:[a.jsxs("a",{className:"about-lockup",href:"#top","aria-label":"dreamcontext",children:[a.jsx(cb,{size:34,className:"about-lockup-mark",glow:!0}),a.jsxs("span",{className:"about-lockup-word",children:["dream",a.jsx("span",{style:{color:"var(--color-accent)"},children:"context"})]})]}),a.jsxs("h1",{className:"about-title",children:["The persistent brain for",a.jsx("span",{className:"about-title-accent",children:" AI natives."})]}),a.jsxs("p",{className:"about-lead",children:["It remembers every decision you made, knows how your project is structured, and is learning to act on that knowledge — so every session starts ",a.jsx("em",{children:"ready"})," instead of blind. Built for founders and builders, technical or not."]}),a.jsxs("div",{className:"about-compat",children:[a.jsx("span",{className:"about-compat-mark","aria-hidden":"true",children:"✓"}),"Works with ",a.jsx("strong",{children:"Claude Code"})]}),a.jsxs("div",{className:"about-cta-row",children:[a.jsx("code",{className:"about-command",children:"npm i -g dreamcontext"}),a.jsx("a",{className:"about-link-btn",href:"https://www.npmjs.com/package/dreamcontext",target:"_blank",rel:"noreferrer",children:"npm ↗"}),a.jsx("a",{className:"about-link-btn about-link-btn--ghost",href:"https://github.com/meanllbrl/dreamcontext",target:"_blank",rel:"noreferrer",children:"GitHub ↗"})]})]}),a.jsxs("div",{className:"about-hero-media",children:[a.jsx("div",{className:"about-hero-aura","aria-hidden":"true"}),a.jsxs("video",{className:"about-hero-video",autoPlay:!0,muted:!0,loop:!0,playsInline:!0,poster:"/media/brain-hero.png",children:[a.jsx("source",{src:"/media/brain.webm",type:"video/webm"}),a.jsx("source",{src:"/media/brain.mp4",type:"video/mp4"})]})]})]})}function yme(){return a.jsxs("section",{className:"about-section",children:[a.jsx("p",{className:"about-kicker",children:"The problem"}),a.jsx("h2",{className:"about-h2",children:"Your project is bigger than anyone can hold."}),a.jsxs("p",{className:"about-section-lead",children:["dreamcontext isn't a memory file. It builds a deep understanding of your whole project — the company, the codebase, even how you work — then ",a.jsx("em",{children:"surfaces what's hiding"}),": the scattered decisions, the forgotten reasons, the connections no one wrote down. Because it never forgets and sees the whole graph, the agent sometimes understands your project better than you do."]}),a.jsxs("div",{className:"about-contrast",children:[a.jsxs("div",{className:"about-contrast-card about-contrast-card--bad",children:[a.jsx("span",{className:"about-contrast-tag",children:"Without dreamcontext"}),a.jsxs("ul",{children:[a.jsx("li",{children:"Decisions scatter across chats, commits, and your head"}),a.jsx("li",{children:`The "why" behind last month's choice is already gone`}),a.jsx("li",{children:"You re-explain the project from scratch every session"}),a.jsx("li",{children:"Blind to the connections between what you've decided"})]})]}),a.jsxs("div",{className:"about-contrast-card about-contrast-card--good",children:[a.jsx("span",{className:"about-contrast-tag",children:"With dreamcontext"}),a.jsxs("ul",{children:[a.jsx("li",{children:"Deep understanding of the whole project, across every session"}),a.jsx("li",{children:"Surfaces the hidden links between scattered decisions"}),a.jsx("li",{children:"Holds the whole picture — company, code, and work-life context"}),a.jsx("li",{children:"Gets sharper every time it consolidates what changed"})]})]})]})]})}function dn(r,e,i,n){const s=(e+n)/2;return`M ${r} ${e} C ${r} ${s}, ${i} ${s}, ${i} ${n}`}const Jk=[{file:"soul",region:"Identity",glyph:"◆"},{file:"user",region:"Episodic",glyph:"◉"},{file:"memory",region:"Semantic",glyph:"✦"},{file:"knowledge",region:"Procedural",glyph:"⚙"},{file:"state",region:"Working",glyph:"▦"},{file:"data-structures",region:"Schema",glyph:"▤"},{file:"skills",region:"Capabilities",glyph:"✧"},{file:"sub-agents",region:"Workers",glyph:"⬡"}],Dl=600,pb=250,I$=92,gc=4,zR=(1200-gc*pb)/(gc+1),eS=196,bme=320,vme=bme-eS,xme=120,F$=470,_me=548,qR=632;function $$(r){return zR+r*(pb+zR)}function P$(r){return $$(r)+pb/2}function z$(r){return eS+r*vme}const Cme=Jk.map((r,e)=>{const i=e%gc,n=Math.floor(e/gc);return{id:`cat-${r.file}`,x:$$(i),y:z$(n),w:pb,h:I$,title:r.file,sub:r.region,glyph:r.glyph,variant:"region",breathe:!0,breatheDelay:e*.18}}),wme=Jk.slice(0,gc).map((r,e)=>({id:`fan-${e}`,d:dn(Dl,xme,P$(e),eS),travel:220,delay:e*.18,dur:2.6})),kme=Jk.map((r,e)=>{const i=e%gc,n=Math.floor(e/gc);return{id:`conv-${r.file}`,d:dn(P$(i),z$(n)+I$,Dl,F$),travel:300,delay:.5+e*.12,dur:2.8}}),Sme={viewBox:"0 0 1200 780",ariaLabel:"How dreamcontext works: a SessionStart hook preloads eight context categories — identity, episodic, semantic, procedural, working, schema, capabilities and workers — with zero tool calls. The agent then works with the whole picture, and RemSleep parallel specialists consolidate the session and feed the distilled knowledge back into the context categories. The loop is the product.",nodes:[{id:"hook",x:Dl-215,y:40,w:430,h:80,title:"SessionStart hook fires",sub:"preloads context · 0 tool calls",variant:"hook"},...Cme,{id:"agent",x:Dl-250,y:F$,w:500,h:78,title:"Your agent works with the whole picture",sub:"no re-exploring · no blind search spiral",variant:"agent"},{id:"rem",x:Dl-200,y:qR,w:400,h:78,title:"RemSleep — parallel specialists",sub:"multi-agent consolidation",variant:"rem"}],edges:[...wme,...kme,{id:"agent-rem",d:`M ${Dl} ${_me} L ${Dl} ${qR}`,travel:90,delay:1.6,dur:1.8},{id:"feedback",d:"M 800 671 C 1140 671, 1170 470, 1170 300 C 1170 170, 1110 170, 1010 170",dashed:!0,travel:520,delay:0,dur:4.2,label:{text:"consolidates & feeds back",x:1180,y:420,rotate:90}}]},Ks=550,gb=300,q$=116,HR=3,UR=(1100-HR*gb)/(HR+1),tS=280,Tme=196,H$=470,Eme=540,WR=596;function U$(r){return UR+r*(gb+UR)}function W$(r){return U$(r)+gb/2}const rS=[{id:"sleep-tasks",title:"sleep-tasks",sub:"state/*.md tasks"},{id:"sleep-state",title:"sleep-state",sub:"soul · user · memory · core 3-6 · data-structures · changelog · releases"},{id:"sleep-product",title:"sleep-product",sub:"knowledge/ + features/ · conditional"}],Nme=rS.map((r,e)=>({id:r.id,x:U$(e),y:tS,w:gb,h:q$,title:r.title,sub:r.sub,variant:"region",breathe:!0,breatheDelay:e*.25})),jme=rS.map((r,e)=>({id:`fan-${r.id}`,d:dn(Ks,Tme,W$(e),tS),travel:200,delay:e*.3,dur:2.4})),Ame=rS.map((r,e)=>({id:`conv-${r.id}`,d:dn(W$(e),tS+q$,Ks,H$),travel:200,delay:.9+e*.2,dur:2.4})),Mme={viewBox:"0 0 1100 680",ariaLabel:"Sleep consolidation: sessions accumulate sleep debt; running sleep start fans out to three parallel specialists — sleep-tasks updates task files, sleep-state updates core files, changelog and releases, and sleep-product conditionally updates knowledge and feature docs. Their reports converge into updated system knowledge, then sleep done resets the debt.",nodes:[{id:"debt",x:Ks-230,y:36,w:460,h:76,title:"Sessions accumulate → sleep debt",sub:"Alert · Drowsy · Sleepy · Must Sleep",variant:"accent"},{id:"sleep-start",x:Ks-130,y:132,w:260,h:64,title:"sleep start",sub:"pins the epoch",variant:"hook"},...Nme,{id:"converge",x:Ks-220,y:H$,w:440,h:70,title:"system knowledge updated",sub:"reports stitched into one summary",variant:"agent"},{id:"sleep-done",x:Ks-130,y:WR,w:260,h:64,title:"sleep done",sub:"debt reset",variant:"rem"}],edges:[{id:"debt-start",d:`M ${Ks} 112 L ${Ks} 132`,travel:26,delay:0,dur:1.4},...jme,...Ame,{id:"converge-done",d:`M ${Ks} ${Eme} L ${Ks} ${WR}`,travel:64,delay:1.8,dur:1.8}]},BC=230,G$=230,GR=132,OC=[{id:"prompt",x:40,title:"Your prompt",sub:"any language",variant:"hook"},{id:"bm25",x:320,title:"BM25F keyword match",sub:"field-weighted · stemming · synonyms",variant:"region"},{id:"haiku",x:600,title:"Haiku recall",sub:"smallest cloud agent · 0-3 docs · BM25 fallback",variant:"region"},{id:"snapshot",x:880,title:"SessionStart snapshot",sub:"warm + cold knowledge · features · index · pinned",variant:"rem"}],Lme=OC.map(r=>({id:r.id,x:r.x,y:BC-GR/2,w:G$,h:GR,title:r.title,sub:r.sub,variant:r.variant})),Rme=OC.slice(0,-1).map((r,e)=>{const i=OC[e+1],n=r.x+G$,s=i.x;return{id:`pipe-${r.id}`,d:`M ${n} ${BC} L ${s} ${BC}`,travel:s-n,delay:e*.4,dur:2.2}}),Bme={viewBox:"0 0 1150 460",ariaLabel:"Memory recall pipeline: your prompt is matched by field-weighted BM25F keyword search with stemming and synonyms; a small Haiku cloud agent picks zero to three directly relevant docs (falling back to BM25 when unavailable); and the SessionStart snapshot assembles warm and cold knowledge, features, the index and pinned docs.",nodes:Lme,edges:Rme},Ome=[{n:"01",title:"It loads",body:"A SessionStart hook preloads the whole project picture — soul, user, memory, knowledge and state, plus data-structures, skills and sub-agents — before the agent makes a single tool call."},{n:"02",title:"It works",body:"With identity, history, procedures, schema and capabilities already in context, your agent works against the real project — no re-exploring, no blind search spiral, no re-teaching what it learned last time."},{n:"03",title:"It sleeps",body:"RemSleep is multi-agent: parallel specialists consolidate the session in their own domains and feed the distilled knowledge back into those context files — so the next session starts even sharper."}];function Dme(){return a.jsxs("section",{className:"about-section",children:[a.jsx("p",{className:"about-kicker",children:"How it works"}),a.jsx("h2",{className:"about-h2",children:"A brain that loads, works, and sleeps — across your whole system."}),a.jsxs("p",{className:"about-section-lead",children:["Three moves, repeated every session. A hook preloads the entire context set with"," ",a.jsx("em",{children:"zero tool calls"}),", your agent works with the whole picture, and a multi-agent RemSleep cycle consolidates what changed. The loop is the product."]}),a.jsx(kc,{spec:Sme}),a.jsx("div",{className:"hiw2-steps",children:Ome.map(r=>a.jsxs("div",{className:"hiw2-step",children:[a.jsx("span",{className:"hiw2-step-n",children:r.n}),a.jsx("h3",{className:"hiw2-step-title",children:r.title}),a.jsx("p",{className:"hiw2-step-body",children:r.body})]},r.n))})]})}const Ime=[{level:"Alert",range:"0–3",note:"fresh — nothing to consolidate yet"},{level:"Drowsy",range:"4–6",note:"consolidation offered"},{level:"Sleepy",range:"7–9",note:"advisory note prepended"},{level:"Must Sleep",range:"10+",note:"critical directive prepended"}],Fme=[{name:"sleep-tasks",domain:"state/*.md — logs progress, bumps statuses, reconciles task bodies and workflow nodes.",always:!0},{name:"sleep-state",domain:"soul · user · memory · data-structures · CHANGELOG · RELEASES — surgical core-file updates with an anti-bloat sweep.",always:!0},{name:"sleep-product",domain:"knowledge/ (incl. features/ PRDs) — writes and refreshes knowledge files and feature PRDs.",always:!1}];function $me(){return a.jsxs("section",{className:"about-section",children:[a.jsx("p",{className:"about-kicker",children:"How sleep works"}),a.jsx("h2",{className:"about-h2",children:"It sleeps to remember — like REM, but for your project."}),a.jsxs("p",{className:"about-section-lead",children:["Every session adds ",a.jsx("em",{children:"sleep debt"}),". When it builds up, one command fans out to parallel specialists that fold what changed back into the brain — then resets the meter."]}),a.jsx(kc,{spec:Mme}),a.jsxs("div",{className:"sleepf-cards",children:[a.jsxs("article",{className:"sleepf-card sleepf-card--debt",children:[a.jsx("h3",{className:"sleepf-card-title",children:"Debt accumulates across sessions"}),a.jsx("p",{className:"sleepf-card-body",children:"Each session scores by how much changed; the score adds to a running debt total that crosses graduated thresholds, so consolidation urgency is never ambiguous."}),a.jsx("ul",{className:"sleepf-debt",children:Ime.map(r=>a.jsxs("li",{className:"sleepf-debt-row",children:[a.jsx("span",{className:"sleepf-debt-level",children:r.level}),a.jsx("span",{className:"sleepf-debt-range",children:r.range}),a.jsx("span",{className:"sleepf-debt-note",children:r.note})]},r.level))})]}),a.jsxs("article",{className:"sleepf-card",children:[a.jsx("h3",{className:"sleepf-card-title",children:"Specialists run in parallel"}),a.jsxs("p",{className:"sleepf-card-body",children:[a.jsx("code",{className:"sleepf-cmd",children:"sleep start"})," pins the epoch, then the main agent dispatches the specialists together in a single message — each updating a distinct knowledge domain, never editing outside it."]}),a.jsx("ul",{className:"sleepf-specialists",children:Fme.map(r=>a.jsxs("li",{className:"sleepf-spec-row",children:[a.jsx("code",{className:"sleepf-spec-name",children:r.name}),a.jsx("span",{className:`sleepf-spec-badge${r.always?" sleepf-spec-badge--always":""}`,children:r.always?"always fires":"conditional"}),a.jsx("span",{className:"sleepf-spec-domain",children:r.domain})]},r.name))})]}),a.jsxs("article",{className:"sleepf-card sleepf-card--done",children:[a.jsxs("h3",{className:"sleepf-card-title",children:[a.jsx("code",{className:"sleepf-cmd",children:"sleep done"})," resets the debt"]}),a.jsxs("p",{className:"sleepf-card-body",children:["Their reports converge into one stitched summary of updated system knowledge. The main agent calls ",a.jsx("code",{className:"sleepf-cmd",children:"sleep done"}),", which records the consolidation and resets the debt to zero — ready for the next cycle."]})]})]})]})}const Pme=[{n:"01",tag:"Keyword match",title:"Field-weighted BM25F",body:"Your prompt is matched against the corpus — knowledge, features, tasks, memory and changelog — with field weighting, stemming and synonym expansion. It runs locally in under 100ms, with zero token overhead."},{n:"02",tag:"Intent recall",title:"The Haiku agent",body:"The smallest cloud agent reads your full prompt and a relevance-ranked corpus index, then returns only the 0–3 documents that are directly relevant — resolving intent across languages. If it is unavailable, the pipeline falls back to raw BM25."},{n:"03",tag:"Session start",title:"The snapshot assembles",body:"At SessionStart a hook composes the knowledge distribution — warm and cold knowledge, the features summary, the knowledge index, and pinned docs — and hands it to the agent so it begins each session already oriented."}];function zme(){return a.jsxs("section",{className:"about-section",children:[a.jsx("p",{className:"about-kicker",children:"How the system remembers"}),a.jsx("h2",{className:"about-h2",children:"The right memory, surfaced before you ask."}),a.jsxs("p",{className:"about-section-lead",children:["Remembering is a read pipeline. Three stages take a prompt — or a fresh session — and put exactly the relevant context in front of the agent, so it works on what you actually meant. It ",a.jsx("em",{children:"augments"})," the agent's reach; you stay in the driver's seat."]}),a.jsx(kc,{spec:Bme}),a.jsx("div",{className:"recallf-stages",children:Pme.map(r=>a.jsxs("article",{className:"recallf-stage",children:[a.jsxs("div",{className:"recallf-stage-head",children:[a.jsx("span",{className:"recallf-stage-n",children:r.n}),a.jsx("span",{className:"recallf-stage-tag",children:r.tag})]}),a.jsx("h3",{className:"recallf-stage-title",children:r.title}),a.jsx("p",{className:"recallf-stage-body",children:r.body})]},r.n))})]})}const KR=[{file:"0.soul",glyph:"◆",region:"Identity",brain:"sense of self",desc:"Who it is — purpose, principles, and the rules it must never break."},{file:"1.user",glyph:"◉",region:"Episodic",brain:"lived history",desc:"What you did and decided, session over session."},{file:"2.memory",glyph:"✦",region:"Semantic",brain:"durable facts",desc:"What's true about the project — facts that hold across every session."},{file:"data-structures/",glyph:"▤",region:"Schema",brain:"mental models",desc:"The shapes of your data — the structures everything else is built on."},{file:"knowledge/",glyph:"⚙",region:"Procedural",brain:"learned skill",desc:"How to do things here — patterns, recipes, and hard-won know-how.",rides:{label:"skills",desc:"capabilities it can pick up and apply"}},{file:"state/",glyph:"▦",region:"Working",brain:"in attention",desc:"What's in flight right now — tasks, features, and the sleep cycle.",rides:{label:"sub-agents",desc:"workers it directs under your steer"}}];function qme(){return a.jsxs("section",{className:"about-section arch","aria-labelledby":"arch-heading",children:[a.jsx("p",{className:"about-kicker",children:"The architecture"}),a.jsx("h2",{className:"about-h2",id:"arch-heading",children:"Memory, organized like a mind."}),a.jsx("p",{className:"about-section-lead",children:"Knowledge isn't one flat file. It's laid down in strata — each a purpose-built region that mirrors a part of the brain — so the agent reaches for the right kind of memory at the right moment."}),a.jsxs("div",{className:"arch-stage",role:"img","aria-label":"A cross-section of the project's memory, stacked as layered brain regions.",children:[a.jsx("div",{className:"arch-glow","aria-hidden":"true"}),a.jsx("ol",{className:"arch-stack",children:KR.map((r,e)=>a.jsxs("li",{className:"arch-stratum",style:{"--i":e,"--n":KR.length},children:[a.jsx("div",{className:"arch-edge","aria-hidden":"true"}),a.jsxs("div",{className:"arch-face",children:[a.jsx("span",{className:"arch-glyph","aria-hidden":"true",children:r.glyph}),a.jsxs("div",{className:"arch-meta",children:[a.jsxs("div",{className:"arch-meta-top",children:[a.jsx("code",{className:"arch-file",children:r.file}),a.jsx("span",{className:"arch-region",children:r.region}),a.jsx("span",{className:"arch-brain",children:r.brain})]}),a.jsx("p",{className:"arch-desc",children:r.desc})]}),r.rides?a.jsxs("div",{className:"arch-rides",children:[a.jsx("span",{className:"arch-rides-plus","aria-hidden":"true",children:"+"}),a.jsx("span",{className:"arch-rides-label",children:r.rides.label}),a.jsx("span",{className:"arch-rides-desc",children:r.rides.desc})]}):null]})]},r.file))})]}),a.jsxs("p",{className:"arch-foot",children:["Six strata, one mind — read top-down, the agent goes from"," ",a.jsx("em",{children:"who it is"})," to ",a.jsx("em",{children:"what it's doing right now"}),"."]})]})}function Hme(r){return"base"in r}function VR({item:r}){const e=Hme(r)?"pack":"standalone",i=e==="pack"?"pack":r.tags[0]??"standalone";return a.jsxs("li",{className:"marquee-card",children:[a.jsx("span",{className:`marquee-chip marquee-chip--${e}`,children:i}),a.jsx("span",{className:"marquee-card-name",children:r.name}),r.description&&a.jsx("p",{className:"marquee-card-desc",children:r.description})]})}function Ume(){const{data:r,isLoading:e,isError:i}=O$(),n=B.useMemo(()=>r?[...r.packs,...r.standalone]:[],[r]),s=Math.min(60,Math.max(40,n.length*2.2)),o=a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"about-kicker",children:"Skill packs"}),a.jsx("h2",{className:"about-h2",children:"A growing library of expertise."}),a.jsx("p",{className:"about-section-lead",children:"The agent loads the right pack for the task — and more are added all the time."})]});return e?a.jsxs("section",{className:"about-section",children:[o,a.jsx("div",{className:"marquee-viewport marquee-viewport--static","aria-hidden":"true",children:a.jsx("ul",{className:"marquee-track marquee-track--skeleton",children:Array.from({length:6}).map((h,l)=>a.jsx("li",{className:"marquee-card marquee-card--skeleton"},l))})}),a.jsx("p",{className:"marquee-status",children:"Loading packs…"})]}):i||n.length===0?a.jsx("section",{className:"about-section",children:o}):a.jsxs("section",{className:"about-section",children:[o,a.jsxs("div",{className:"marquee-viewport",style:{"--marquee-duration":`${s}s`},children:[a.jsx("ul",{className:"marquee-track",children:n.map(h=>a.jsx(VR,{item:h},`a-${h.name}`))}),a.jsx("ul",{className:"marquee-track marquee-track--dup","aria-hidden":"true",children:n.map(h=>a.jsx(VR,{item:h},`b-${h.name}`))})]})]})}const ll="0 0 360 170";function K$(r,e,i){return{viewBox:ll,ariaLabel:r,nodes:[{id:"a",x:20,y:50,w:140,h:70,title:e.title,sub:e.sub,variant:e.variant??"hook"},{id:"b",x:200,y:50,w:140,h:70,title:i.title,sub:i.sub,variant:i.variant??"rem"}],edges:[{id:"a-b",d:"M 160 85 L 200 85",travel:40,dur:2}]}}const Wme={viewBox:ll,ariaLabel:"Context snapshot: a SessionStart hook injects the soul, memory, active tasks and knowledge index straight into the agent with zero tool calls.",nodes:[{id:"hook",x:110,y:12,w:140,h:50,title:"SessionStart",sub:"0 tool calls",variant:"hook"},{id:"brain",x:16,y:100,w:150,h:56,title:"project brain",sub:"soul · memory · tasks",variant:"region",breathe:!0},{id:"agent",x:194,y:100,w:150,h:56,title:"your agent",sub:"oriented",variant:"agent"}],edges:[{id:"h-b",d:dn(180,62,91,100),travel:80,dur:2.2},{id:"b-a",d:"M 166 128 L 194 128",travel:28,dur:1.6,delay:.5}]},Gme={viewBox:ll,ariaLabel:"Memory recall: a question is scored by BM25 keyword match, optionally refined by a small Haiku agent, returning the most relevant docs in under 100 milliseconds.",nodes:[{id:"q",x:14,y:52,w:96,h:66,title:"question",sub:"any language",variant:"hook"},{id:"bm25",x:132,y:52,w:96,h:66,title:"BM25",sub:"+ Haiku",variant:"region",breathe:!0},{id:"docs",x:250,y:52,w:96,h:66,title:"top docs",sub:"<100ms",variant:"rem"}],edges:[{id:"q-b",d:"M 110 85 L 132 85",travel:22,dur:1.6},{id:"b-d",d:"M 228 85 L 250 85",travel:22,dur:1.6,delay:.4}]},Kme={viewBox:ll,ariaLabel:"RemSleep: accumulated sleep debt triggers a fan-out to three parallel specialists that consolidate the session and reset the meter.",nodes:[{id:"debt",x:108,y:10,w:144,h:46,title:"sleep debt",sub:"crosses threshold",variant:"accent"},{id:"s1",x:14,y:92,w:100,h:50,title:"sleep-tasks",variant:"region",breathe:!0},{id:"s2",x:130,y:92,w:100,h:50,title:"sleep-state",variant:"region",breathe:!0,breatheDelay:.2},{id:"s3",x:246,y:92,w:100,h:50,title:"sleep-product",variant:"region",breathe:!0,breatheDelay:.4}],edges:[{id:"d-1",d:dn(180,56,64,92),travel:90,dur:2.2},{id:"d-2",d:"M 180 56 L 180 92",travel:36,dur:1.8,delay:.2},{id:"d-3",d:dn(180,56,296,92),travel:90,dur:2.2,delay:.4}]},Vme={viewBox:ll,ariaLabel:"Brain-region core files: soul, user, memory and the knowledge index sit in a numbered band the snapshot always loads.",nodes:[{id:"soul",x:14,y:24,w:158,h:54,title:"0.soul",sub:"identity · rules",variant:"region",breathe:!0},{id:"mem",x:188,y:24,w:158,h:54,title:"2.memory",sub:"decisions · issues",variant:"region",breathe:!0,breatheDelay:.2},{id:"user",x:14,y:96,w:158,h:54,title:"1.user",sub:"preferences",variant:"region",breathe:!0,breatheDelay:.4},{id:"know",x:188,y:96,w:158,h:54,title:"knowledge",sub:"index · pinned",variant:"region",breathe:!0,breatheDelay:.6}],edges:[]},Yme={viewBox:ll,ariaLabel:"Tag-based relation graph: knowledge, features and tasks link through shared tags into a navigable brain view.",nodes:[{id:"tag",x:110,y:58,w:140,h:54,title:"shared tag",sub:"the edge",variant:"accent",breathe:!0},{id:"k",x:14,y:10,w:110,h:44,title:"knowledge",variant:"region"},{id:"f",x:236,y:10,w:110,h:44,title:"features",variant:"region"},{id:"t",x:125,y:122,w:110,h:40,title:"tasks",variant:"region"}],edges:[{id:"k-tag",d:dn(69,54,150,58),travel:90,dur:2.4},{id:"f-tag",d:dn(291,54,210,58),travel:90,dur:2.4,delay:.4},{id:"t-tag",d:"M 180 122 L 180 112",travel:12,dur:1.6,delay:.8}]},Xme={viewBox:ll,ariaLabel:"Task management: each task carries a LIFO changelog viewable as a Kanban board, an Eisenhower matrix, or RICE-scored.",nodes:[{id:"task",x:16,y:50,w:130,h:70,title:"task .md",sub:"LIFO changelog",variant:"hook"},{id:"views",x:200,y:24,w:144,h:44,title:"Kanban",variant:"region",breathe:!0},{id:"eis",x:200,y:74,w:144,h:40,title:"Eisenhower",variant:"region",breathe:!0,breatheDelay:.2},{id:"rice",x:200,y:120,w:144,h:40,title:"RICE score",variant:"region",breathe:!0,breatheDelay:.4}],edges:[{id:"t-k",d:dn(146,85,272,46),travel:90,dur:2.2},{id:"t-e",d:"M 146 85 L 200 94",travel:56,dur:2,delay:.3},{id:"t-r",d:dn(146,85,272,140),travel:90,dur:2.2,delay:.6}]},Zme={viewBox:ll,ariaLabel:"Sub-agents: the main agent fans work out to briefed specialist sub-agents that report back, keeping the main context small.",nodes:[{id:"main",x:110,y:12,w:140,h:46,title:"main agent",variant:"agent"},{id:"a",x:16,y:96,w:96,h:50,title:"reviewer",variant:"region",breathe:!0},{id:"b",x:132,y:96,w:96,h:50,title:"planner",variant:"region",breathe:!0,breatheDelay:.2},{id:"c",x:248,y:96,w:96,h:50,title:"researcher",variant:"region",breathe:!0,breatheDelay:.4}],edges:[{id:"m-a",d:dn(180,58,64,96),travel:90,dur:2.2},{id:"m-b",d:"M 180 58 L 180 96",travel:38,dur:1.8,delay:.2},{id:"m-c",d:dn(180,58,296,96),travel:90,dur:2.2,delay:.4}]},Qme={viewBox:"0 0 400 232",ariaLabel:"Council: three persona sub-agents debate each other in a cycle — each sees the others’ reasoning, round after round — then the debate converges into a synthesizer that writes one decision report.",nodes:[{id:"p1",x:70,y:14,w:96,h:46,title:"persona",sub:"lens A",variant:"region",breathe:!0},{id:"p2",x:18,y:118,w:96,h:46,title:"persona",sub:"lens B",variant:"region",breathe:!0,breatheDelay:.25},{id:"p3",x:130,y:118,w:96,h:46,title:"persona",sub:"lens C",variant:"region",breathe:!0,breatheDelay:.5},{id:"syn",x:286,y:70,w:104,h:72,title:"synthesizer",sub:"decision report",variant:"rem"}],edges:[{id:"p1-p2",d:"M 96 60 L 80 118",travel:60,dur:1.8},{id:"p2-p3",d:"M 114 141 L 130 141",travel:16,dur:1.1,delay:.3,label:{text:"↻ rounds",x:118,y:95}},{id:"p3-p1",d:"M 178 118 L 152 60",travel:60,dur:1.8,delay:.6},{id:"p1-syn",d:dn(166,40,286,96),travel:130,dur:2.4,delay:.4},{id:"p3-syn",d:dn(226,136,286,116),travel:76,dur:2.2,delay:.9}]},Jme={viewBox:"0 0 1000 330",ariaLabel:"Goal-skill orchestration: a goal-planner drafts a file-by-file plan; parallel reviewers vote SOLID or NEEDS_WORK and loop back to the planner until solid; the plan is persisted as a task; a goal-implementer builds to the acceptance criteria; a code reviewer and then a goal-validator each gate the result, looping back to the implementer on FAIL; every gate is capped at three retries before escalating to the user, after which the work ships as a task in review.",nodes:[{id:"plan",x:20,y:40,w:140,h:86,title:"planner",sub:"file-by-file plan",variant:"agent"},{id:"plan-review",x:184,y:40,w:140,h:86,title:"plan review",sub:"SOLID · NEEDS_WORK",variant:"region",breathe:!0},{id:"impl",x:348,y:40,w:140,h:86,title:"implementer",sub:"builds to criteria",variant:"agent"},{id:"code-review",x:512,y:40,w:140,h:86,title:"code review",sub:"PASS · FAIL",variant:"region",breathe:!0,breatheDelay:.2},{id:"validate",x:676,y:40,w:140,h:86,title:"validator",sub:"tests · PASS · FAIL",variant:"region",breathe:!0,breatheDelay:.4},{id:"done",x:840,y:40,w:140,h:86,title:"shipped",sub:"task → in_review",variant:"rem"}],edges:[{id:"f1",d:"M 160 83 L 184 83",dur:2},{id:"f2",d:"M 324 83 L 348 83",dur:2,delay:.2},{id:"f3",d:"M 488 83 L 512 83",dur:2,delay:.1},{id:"f4",d:"M 652 83 L 676 83",dur:2,delay:.2},{id:"f5",d:"M 816 83 L 840 83",dur:2,delay:.3},{id:"l1",d:"M 254 126 C 254 196, 90 196, 90 126",dashed:!0,dur:3.2,delay:.5,label:{text:"↻ ≤3",x:172,y:186}},{id:"l2",d:"M 582 126 C 582 196, 418 196, 418 126",dashed:!0,dur:3.2,delay:.7,label:{text:"↻ ≤3",x:500,y:186}},{id:"l3",d:"M 746 126 C 746 262, 418 262, 418 126",dashed:!0,dur:3.6,delay:.9,label:{text:"↻ ≤3",x:582,y:252}}]},eye=K$("Skill packs: curated domain packs install a base skill plus on-demand sub-skills into the agent.",{title:"skill pack",sub:"engineering · design · growth",variant:"hook"},{title:"agent gains",sub:"base + sub-skills",variant:"rem"}),tye=K$("Knowledge base: tagged knowledge files are indexed every session; pinned files load warm, the rest load cold on demand.",{title:"knowledge/*.md",sub:"tagged · indexed",variant:"region"},{title:"snapshot",sub:"warm + cold",variant:"rem"}),V$=[{id:"context-snapshot",title:"Context snapshot",tagline:"Every session starts with the whole brain, zero tool calls.",body:"A SessionStart hook injects your project identity, user preferences, memory, active tasks and the knowledge index straight into the agent — so it orients instantly instead of grepping around blind.",defaultOpen:!0,tag:"Memory",flow:Wme},{id:"memory-recall",title:"Memory recall",tagline:'Ask "where did we decide X?" and get an answer in under 100ms.',body:"A deterministic BM25 search ranks every knowledge file, PRD, task, memory entry and changelog line — optionally sharpened by a small Haiku agent — so the right context surfaces without scrolling or grepping. Handles English, Turkish and mixed queries.",defaultOpen:!0,tag:"Memory",flow:Gme},{id:"rem-sleep",title:"RemSleep consolidation",tagline:"It sleeps to remember — multi-agent consolidation, like REM.",body:"Sessions accumulate sleep debt; when it builds up, one command fans out to three parallel specialists that fold what changed back into the brain, then resets the meter. Knowledge compounds instead of decaying.",defaultOpen:!0,tag:"Sleep",flow:Kme},{id:"brain-regions",title:"Brain-region core files",tagline:"A numbered band of core files — soul, user, memory, knowledge.",body:"The brain is a handful of small, always-loaded files: identity and rules, user preferences, durable memory, and the knowledge index. Kept lightweight on purpose so the snapshot stays under budget every session.",defaultOpen:!0,tag:"Memory",flow:Vme},{id:"knowledge-base",title:"Knowledge base",tagline:"Tagged research that loads warm when pinned, cold on demand.",body:"Deep research and domain context live in tagged knowledge files the snapshot indexes every session. Pin the critical ones to load them in full; the rest stay one read away when an agent needs them.",defaultOpen:!0,tag:"Knowledge",flow:tye},{id:"brain-graph",title:"Relation graph (Brain view)",tagline:"Knowledge, features and tasks linked through shared tags.",body:"A tag-based graph connects every knowledge file, feature and task into one navigable Brain view — so you can see how the parts of a project relate instead of reading them one file at a time.",defaultOpen:!0,tag:"Knowledge",flow:Yme},{id:"task-management",title:"Task management",tagline:"LIFO changelogs, viewable as Kanban, Eisenhower or RICE.",body:"Each task is a Markdown file with a LIFO changelog, so any session reads where the last one left off. View the backlog as a Kanban board, triage it on an Eisenhower matrix, or rank it numerically with RICE — Reach × Impact × Confidence ÷ Effort.",defaultOpen:!0,tag:"Tasks",flow:Xme},{id:"skill-packs",title:"Skill packs",tagline:"Curated, installable skills by domain — one command.",body:"Extend an agent with domain packs — engineering, design, growth, brand-voice and more — each a base skill plus on-demand sub-skills. Install interactively or name a pack directly; prerequisites resolve automatically.",defaultOpen:!0,tag:"Skills",flow:eye},{id:"sub-agents",title:"Sub-agents",tagline:"Fan work out to briefed specialists; keep the main context lean.",body:"The main agent dispatches focused sub-agents — reviewers, planners, researchers — each launched with a lightweight context briefing so it knows the project structure without any tool calls. They report back; the main thread stays small.",defaultOpen:!0,tag:"Agents",flow:Zme},{id:"council",title:"Council",tagline:"Persona sub-agents debate a hard call, a synthesizer decides.",body:"For a non-trivial decision, Council spins up 3–10 persona sub-agents that debate across rounds, see each other's reasoning, then hand off to a dedicated synthesizer that writes one decision report — promotable straight into knowledge.",defaultOpen:!0,tag:"Agents",flow:Qme},{id:"goal-skill",title:"Goal-skill orchestration",tagline:"Plan it, review it, build it, review it, validate it — on a leash.",body:"Turn the main agent into an orchestrator. A goal-planner drafts a file-by-file plan; parallel reviewers vote SOLID or NEEDS_WORK and bounce it back until it holds; the plan is persisted as a task; a goal-implementer builds to the acceptance criteria; then a code reviewer and a goal-validator each gate the result, looping back to the implementer on a fail. Every gate is capped at three retries and escalates to you instead of spinning.",defaultOpen:!0,tag:"Agents",flow:Jme},{id:"bookmarking",title:"Bookmarking (salience)",tagline:"High-signal moments tagged so sleep can find them later.",body:"Corrections, error-to-fix turns and decisions are auto-bookmarked during a session, marking the moments worth keeping — so consolidation folds the right learnings into the brain without manual flagging.",defaultOpen:!1,tag:"Memory",glyph:"◈"},{id:"warm-cold-knowledge",title:"Warm vs cold knowledge",tagline:"Pinned files load in full; the rest stay one read away.",body:"Pinned (warm) knowledge is inlined into every snapshot; unpinned (cold) knowledge appears only in the index and loads on demand. The split keeps the always-on context small while nothing gets lost.",defaultOpen:!1,tag:"Knowledge",glyph:"❄"},{id:"feature-prds",title:"Feature PRDs",tagline:"Living docs that capture not just what was built, but why.",body:"Each feature has a PRD with user stories, acceptance criteria and design decisions that update as work progresses — so an agent understands the product surface without reconstructing it from conversation history.",defaultOpen:!1,tag:"Knowledge",glyph:"▤"},{id:"versions-releases",title:"Versions & releases",tagline:"Changelog and release readiness tracked in the brain.",body:"A structured changelog and release notes live alongside the context, so version history and release readiness are part of the brain the agent reads — not an afterthought scattered across commits.",defaultOpen:!1,tag:"Knowledge",glyph:"⎇"},{id:"multi-vault",title:"Multi-vault registry",tagline:"Switch between project brains from one global registry.",body:"A global vault registry tracks every project brain on your machine. List, add and remove vaults, then point the dashboard at any one — so multiple projects each keep their own clean context.",defaultOpen:!1,tag:"Setup",glyph:"▦"},{id:"multi-product",title:"Multi-product support",tagline:"Per-product knowledge auto-injected from the active task.",body:"Monorepos and portfolios get a product namespace: per-product knowledge and data structures, plus automatic injection of the right product's knowledge at session start when the active task carries a product tag.",defaultOpen:!1,tag:"Knowledge",glyph:"◫"},{id:"manifest-install",title:"Manifest install & update",tagline:"Clean upgrades — stale files tracked and removed, not layered.",body:"A manifest tracks every file dreamcontext owns, so updates remove what a new version drops instead of leaving stale agents and configs behind. Includes a one-line install script and an in-session update nudge.",defaultOpen:!1,tag:"Setup",glyph:"⟳"},{id:"project-init",title:"Project initialization",tagline:"Blank repo to agent-aware workspace in under a minute.",body:"One init command scaffolds the whole context directory, detects your tech stack, runs token substitution on the templates, and wires up the Claude Code hooks — no manual setup.",defaultOpen:!1,tag:"Setup",glyph:"⊕"},{id:"control-panel",title:"Control panel",tagline:"Configure platforms, packs and vaults in the browser.",body:"The dashboard control panel closes the loop on configuration — edit platforms and skill packs, see which packs are actually installed on disk, manage vaults, and get notified in-app when a newer version ships.",defaultOpen:!1,tag:"Setup",glyph:"⚙"},{id:"multi-review",title:"Multi-review",tagline:"Route a diff to niche reviewers, get one merged report.",body:"A router classifies a diff by domain and dispatches specialist reviewers — security, frontend, cloud functions, edge cases — in parallel; a coordinator dedupes their findings into a single report. Each specialist reviews against your live project rules.",defaultOpen:!1,tag:"Agents",glyph:"⊜"},{id:"continuous-capture",title:"Continuous capture",tagline:"Session digests and auto-bookmarks, searchable next session.",body:"Transcripts are digested and indexed as you work, so a decision from one session is searchable in the next — before any sleep consolidation runs. Capture is down-weighted so it never crowds out curated knowledge.",defaultOpen:!1,tag:"Memory",glyph:"◌"},{id:"context-gate",title:"Context gate",tagline:"Nudges the agent to load relevant skills before it acts.",body:"A prompt-time hook detects when an installed skill is plausibly relevant and injects a directive to review the full skill list and invoke what fits — deliberately not a pre-selected top-N, so the right skill is never anchored out.",defaultOpen:!1,tag:"Skills",glyph:"⊳"},{id:"auto-dashboard",title:"Auto-open dashboard hook",tagline:"The dashboard surfaces itself when it is worth a look.",body:"A hook can open the dashboard at the right moment so the visual view of tasks, knowledge and the brain is one glance away — without you remembering to launch it.",defaultOpen:!1,tag:"Setup",glyph:"◰"},{id:"post-edit-hook",title:"Post-edit format & typecheck",tagline:"Format and typecheck fire automatically after an edit.",body:"A post-edit hook runs your formatter and type checker right after the agent changes a file, so problems surface immediately instead of piling up — keeping the working tree clean as work proceeds.",defaultOpen:!1,tag:"Setup",glyph:"✓"},{id:"marketing-pack",title:"Marketing pack",tagline:"Brand-voice and growth skills for going to market.",body:"A bundled set of go-to-market skills — brand voice, growth, performance marketing — so the same agent that builds a feature can help position and launch it, on-brand.",defaultOpen:!1,tag:"Skills",glyph:"✦"}],DC=V$.filter(r=>r.defaultOpen),YR=V$.filter(r=>!r.defaultOpen),ns=DC.length,E_=16,rye=62,iye=.72,nye=40,sye=140,aye=8;function oye(){const[r,e]=B.useState(0),i=B.useId(),n=B.useRef([]),s=B.useRef([]),o=B.useRef([]),h=B.useRef(null),l=B.useRef(null),u=B.useRef(null),d=B.useRef(!1),g=B.useRef(0),f=b=>`${i}-tab-${b}`,m=b=>`${i}-panel-${b}`,y=B.useCallback(b=>{const x=Math.max(0,Math.min(ns-1,b));x!==g.current&&(g.current=x,e(x))},[]);B.useLayoutEffect(()=>{const b=h.current,x=l.current;if(!b||!x)return;d.current=window.matchMedia("(prefers-reduced-motion: reduce)").matches;const C=b.closest(".shell-main")??null,k=C??window;let T=0;const N=()=>{T=0;const L=b.getBoundingClientRect(),O=C?C.getBoundingClientRect().top:0,D=L.height-x.offsetHeight;if(D<=0)return;const K=Math.max(0,Math.min(1,(O+E_-L.top)/D));u.current&&(u.current.style.transform=`scaleX(${K})`);const z=K*(ns-1);for(let H=0;H<ns;H++){const P=s.current[H];if(!P)continue;const $=H-z,W=Math.abs($);P.style.opacity=String(Math.max(0,1-W/iye)),P.style.transform=d.current?"none":`translate3d(0, ${$*nye}px, 0)`;const V=W<.5;P.style.zIndex=V?"2":"1",P.style.pointerEvents=V?"auto":"none";const F=W<1.05;o.current[H]!==F&&(o.current[H]=F,P.classList.toggle("feat-panel--near",F))}y(Math.round(z))};let A=0;const j=()=>{if(!C)return;const L=b.getBoundingClientRect(),O=L.height-x.offsetHeight;if(O<=0)return;const D=(C.getBoundingClientRect().top+E_-L.top)/O;if(D<=.012||D>=.988)return;const z=(Math.round(D*(ns-1))/(ns-1)-D)*O;Math.abs(z)<aye||C.scrollTo({top:C.scrollTop+z,behavior:d.current?"auto":"smooth"})},E=()=>{T||(T=requestAnimationFrame(N)),A&&clearTimeout(A),A=window.setTimeout(j,sye)};return k.addEventListener("scroll",E,{passive:!0}),window.addEventListener("resize",E),N(),()=>{k.removeEventListener("scroll",E),window.removeEventListener("resize",E),T&&cancelAnimationFrame(T),A&&clearTimeout(A)}},[y]);const w=B.useCallback(b=>{const x=h.current,C=l.current,k=x==null?void 0:x.closest(".shell-main");if(!x||!C||!k){y(b);return}const T=x.getBoundingClientRect(),N=T.height-C.offsetHeight;if(N<=0){y(b);return}const j=b/(ns-1)*N-(k.getBoundingClientRect().top+E_-T.top);k.scrollTo({top:k.scrollTop+j,behavior:d.current?"auto":"smooth"})},[y]);function _(b){var C;let x=g.current;if(b.key==="ArrowDown"||b.key==="ArrowRight")x=(g.current+1)%ns;else if(b.key==="ArrowUp"||b.key==="ArrowLeft")x=(g.current-1+ns)%ns;else if(b.key==="Home")x=0;else if(b.key==="End")x=ns-1;else return;b.preventDefault(),y(x),(C=n.current[x])==null||C.focus(),w(x)}return a.jsxs("section",{className:"about-section feat-section",children:[a.jsx("div",{className:"feat-scroller",ref:h,style:{"--feat-track-h":`${ns*rye}vh`},children:a.jsxs("div",{className:"feat-sticky",ref:l,children:[a.jsx("p",{className:"about-kicker",children:"Everything inside"}),a.jsx("h2",{className:"about-h2",children:"One brain, many faculties."}),a.jsxs("p",{className:"about-section-lead",children:["Every capability dreamcontext gives your agents — ",a.jsx("em",{children:"scroll to move through them, or pick one."})]}),a.jsxs("div",{className:"feat-spotlight",children:[a.jsxs("div",{className:"feat-rail-wrap",children:[a.jsxs("div",{className:"feat-rail-head","aria-hidden":"true",children:[a.jsxs("span",{className:"feat-rail-step",children:[String(r+1).padStart(2,"0")," ",a.jsxs("i",{children:["/ ",String(ns).padStart(2,"0")]})]}),a.jsx("div",{className:"feat-rail-track",children:a.jsx("span",{className:"feat-rail-fill",ref:u})})]}),a.jsx("div",{className:"feat-rail",role:"tablist","aria-orientation":"vertical","aria-label":"Core faculties",onKeyDown:_,children:DC.map((b,x)=>{const C=x===r;return a.jsxs("button",{ref:k=>{n.current[x]=k},id:f(x),role:"tab",type:"button","aria-selected":C,"aria-controls":m(x),tabIndex:C?0:-1,className:`feat-rail-item${C?" feat-rail-item--active":""}`,onClick:()=>{y(x),w(x)},children:[a.jsx("span",{className:"feat-rail-title",children:b.title}),b.tag&&a.jsx("span",{className:"feat-rail-tag",children:b.tag})]},b.id)})})]}),a.jsx("div",{className:"feat-stage",children:DC.map((b,x)=>a.jsxs("div",{ref:C=>{s.current[x]=C},className:"feat-panel",role:"tabpanel",id:m(x),"aria-labelledby":f(x),"aria-hidden":x!==r,tabIndex:x===r?0:-1,children:[a.jsxs("div",{className:"feat-stage-head",children:[b.tag&&a.jsx("span",{className:"feat-stage-chip",children:b.tag}),a.jsx("h3",{className:"feat-stage-title",children:b.title})]}),a.jsx("p",{className:"feat-stage-body",children:b.body}),b.flow&&a.jsx(kc,{spec:b.flow,className:"feat-stage-flow"})]},b.id))})]})]})}),a.jsxs("div",{className:"feat-more",children:[a.jsxs("div",{className:"feat-more-head",children:[a.jsx("span",{className:"feat-more-label",children:"Everything else"}),a.jsx("span",{className:"feat-more-count",children:YR.length})]}),a.jsx("div",{className:"feat-more-grid",children:YR.map(b=>a.jsxs("div",{className:"feat-more-card",children:[a.jsx("span",{className:"feat-more-glyph","aria-hidden":"true",children:b.glyph??"✦"}),a.jsxs("div",{className:"feat-more-meta",children:[a.jsx("span",{className:"feat-more-title",children:b.title}),a.jsx("span",{className:"feat-more-tagline",children:b.tagline})]})]},b.id))})]})]})}const lye=[{cmd:"dreamcontext init",hint:"# set up the brain"},{cmd:"dreamcontext dashboard",hint:"# open this dashboard"},{cmd:"dreamcontext sleep",hint:"# consolidate the session"}];function cye(){return a.jsxs("section",{className:"closing","aria-labelledby":"closing-heading",children:[a.jsx("h2",{className:"closing-title",id:"closing-heading",children:"So — what is this?"}),a.jsxs("p",{className:"closing-body",children:[a.jsx("strong",{children:"dreamcontext"})," is a small CLI that gives your AI coding agents a structured, persistent brain across sessions. It pre-loads what matters, keeps a living map of your project, and consolidates new knowledge as you go — so you stop paying, every single session, to re-teach the agent what it already learned."]}),a.jsx("div",{className:"closing-cmds",role:"list",children:lye.map(r=>a.jsxs("div",{className:"closing-cmd",role:"listitem",children:[a.jsx("span",{className:"closing-cmd-c","aria-hidden":"true",children:"$"}),a.jsx("span",{className:"closing-cmd-text",children:r.cmd}),a.jsx("span",{className:"closing-cmd-hint",children:r.hint})]},r.cmd))}),a.jsx("p",{className:"closing-foot",children:"You're looking at the dashboard now. The brain graph, tasks, and sleep state in the sidebar are this project's actual memory — live."})]})}function hye(){return a.jsxs("div",{className:"about","data-testid":"about-page",children:[a.jsx(mme,{}),a.jsx(yme,{}),a.jsx(Dme,{}),a.jsx($me,{}),a.jsx(zme,{}),a.jsx(qme,{}),a.jsx(Ume,{}),a.jsx(oye,{}),a.jsx(cye,{})]})}function uye(){return Yt({queryKey:["taxonomy"],queryFn:()=>De.get("/taxonomy")})}const dye={domain:"Domain",layer:"Layer",kind:"Kind",topic:"Topic"};function XR({tag:r,count:e,dimmed:i}){return a.jsxs("span",{className:`taxonomy-chip${i?" taxonomy-chip--dim":""}`,"data-hue":na(r),title:e>0?`${e} use${e===1?"":"s"}`:"unused",children:[a.jsx("span",{className:"taxonomy-chip-label",children:r}),e>0&&a.jsx("span",{className:"taxonomy-chip-count",children:e})]})}function nm({label:r,count:e,children:i,defaultOpen:n=!1}){const[s,o]=B.useState(n);return e===0?null:a.jsxs("div",{className:"taxonomy-expandable",children:[a.jsxs("button",{className:"taxonomy-expandable-header",onClick:()=>o(h=>!h),"aria-expanded":s,children:[a.jsx("span",{className:"taxonomy-expandable-chevron",children:s?"▾":"▸"}),a.jsx("span",{className:"taxonomy-expandable-label",children:r}),a.jsx("span",{className:"taxonomy-expandable-badge",children:e})]}),s&&a.jsx("div",{className:"taxonomy-expandable-body",children:i})]})}function fye(){const{t:r}=wr(),{data:e,isLoading:i,isError:n,error:s}=uye();if(i)return a.jsx("div",{className:"loading",children:r("common.loading")});if(n)return a.jsxs("div",{className:"error-state",children:["Failed to load taxonomy. ",s==null?void 0:s.message]});if(!e)return null;const{vocabulary:o,usage:h,audit:l}=e,u=["domain","layer","kind","topic"],d=l.untagged.length===0&&l.nonCanonical.length===0&&l.orphan.length===0&&l.nearDups.length===0;return a.jsxs("div",{className:"taxonomy-page",children:[a.jsxs("section",{className:"taxonomy-section",children:[a.jsx("h2",{className:"taxonomy-section-heading",children:"Faceted Tags"}),a.jsx("div",{className:"taxonomy-facets",children:u.map(g=>{const f=o.facetTags[g]??[];return f.length===0?null:a.jsxs("div",{className:"taxonomy-facet-group",children:[a.jsx("span",{className:"taxonomy-facet-label",children:dye[g]??g}),a.jsx("div",{className:"taxonomy-chip-cluster",children:f.map(m=>{const y=h[m]??0;return a.jsx(XR,{tag:m,count:y,dimmed:y===0},m)})})]},g)})})]}),o.bareTags.length>0&&a.jsxs("section",{className:"taxonomy-section",children:[a.jsx("h2",{className:"taxonomy-section-heading",children:"Bare Tags"}),a.jsx("div",{className:"taxonomy-chip-cluster",children:o.bareTags.map(g=>{const f=h[g]??0;return a.jsx(XR,{tag:g,count:f,dimmed:f===0},g)})})]}),Object.keys(o.aliases).length>0&&a.jsxs("section",{className:"taxonomy-section",children:[a.jsx("h2",{className:"taxonomy-section-heading",children:"Aliases"}),a.jsx("div",{className:"taxonomy-alias-list",children:Object.entries(o.aliases).map(([g,f])=>a.jsxs("div",{className:"taxonomy-alias-pair",children:[a.jsx("span",{className:"taxonomy-chip taxonomy-chip--alias","data-hue":na(g),children:a.jsx("span",{className:"taxonomy-chip-label",children:g})}),a.jsx("span",{className:"taxonomy-alias-arrow","aria-hidden":"true",children:"→"}),a.jsx("span",{className:"taxonomy-chip","data-hue":na(f),children:a.jsx("span",{className:"taxonomy-chip-label",children:f})})]},g))})]}),a.jsxs("section",{className:"taxonomy-section",children:[a.jsx("h2",{className:"taxonomy-section-heading",children:"Drift Audit"}),d?a.jsxs("div",{className:"taxonomy-healthy",children:[a.jsx("span",{className:"taxonomy-healthy-icon",children:"✓"}),a.jsx("span",{children:"Taxonomy healthy — no drift detected."})]}):a.jsxs("div",{className:"taxonomy-audit-panel",children:[a.jsx(nm,{label:"Untagged docs",count:l.untagged.length,defaultOpen:l.untagged.length>0,children:a.jsx("ul",{className:"taxonomy-audit-list",children:l.untagged.map(g=>a.jsx("li",{className:"taxonomy-audit-item",children:a.jsx("code",{children:g})},g))})}),a.jsx(nm,{label:"Non-canonical tags",count:l.nonCanonical.length,defaultOpen:l.nonCanonical.length>0,children:a.jsx("ul",{className:"taxonomy-audit-list",children:l.nonCanonical.map((g,f)=>a.jsxs("li",{className:"taxonomy-audit-item taxonomy-audit-item--suggest",children:[a.jsx("code",{className:"taxonomy-audit-doc",children:g.doc}),a.jsx("span",{className:"taxonomy-audit-tag",children:g.tag}),g.suggestion!==g.tag&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"taxonomy-alias-arrow","aria-hidden":"true",children:"→"}),a.jsx("span",{className:"taxonomy-audit-suggestion",children:g.suggestion})]})]},f))})}),a.jsx(nm,{label:"Orphan tags",count:l.orphan.length,defaultOpen:l.orphan.length>0,children:a.jsx("ul",{className:"taxonomy-audit-list",children:l.orphan.map(g=>a.jsx("li",{className:"taxonomy-audit-item",children:a.jsx("span",{className:"taxonomy-audit-tag",children:g})},g))})}),a.jsx(nm,{label:"Near-duplicates",count:l.nearDups.length,defaultOpen:l.nearDups.length>0,children:a.jsx("ul",{className:"taxonomy-audit-list",children:l.nearDups.map(([g,f],m)=>a.jsxs("li",{className:"taxonomy-audit-item taxonomy-audit-item--pair",children:[a.jsx("span",{className:"taxonomy-audit-tag",children:g}),a.jsx("span",{className:"taxonomy-alias-arrow","aria-hidden":"true",children:"≈"}),a.jsx("span",{className:"taxonomy-audit-tag",children:f})]},m))})})]})]})]})}function pye(){const{health:r,serverCurrent:e}=GC();return!r||e?null:a.jsxs("div",{className:"stale-server-banner",children:["⚠ The dashboard server is running an older build (",r.version??"unknown"," vs ","0.17.1",") — some actions will fail. Restart it: ",a.jsx("code",{children:"dreamcontext dashboard"})]})}const ZR=new Rz({defaultOptions:{queries:{staleTime:5e3,retry:1,refetchOnWindowFocus:!0,refetchInterval:15e3,refetchIntervalInBackground:!1},mutations:{retry:0}}});function gye({nav:r}){const e=(n,s)=>{const o={tasks:"tasks",knowledge:"knowledge",core:"core"};r.navigate(o[n],s)},i={id:r.focusId,nonce:r.nonce};switch(r.page){case"brain":return a.jsx(Hpe,{onNavigate:e});case"tasks":return a.jsx(Fde,{focus:i});case"roadmap":return a.jsx(Afe,{});case"lab":return a.jsx(Zfe,{});case"sleep":return a.jsx(npe,{});case"core":return a.jsx(hpe,{onNavigateTaxonomy:()=>r.navigate("taxonomy",null),focus:i});case"knowledge":return a.jsx(_pe,{focus:i});case"council":return a.jsx(Tge,{});case"settings":return a.jsx(hme,{focus:i});case"packs":return a.jsx(gme,{});case"taxonomy":return a.jsx(fye,{});case"about":return a.jsx(hye,{})}}class sm extends B.Component{constructor(){super(...arguments);Wt(this,"state",{error:null})}static getDerivedStateFromError(i){return{error:i}}render(){return this.state.error?a.jsxs("div",{className:"error-boundary",children:[a.jsx("h1",{children:"Something went wrong."}),a.jsx("p",{children:this.state.error.message}),a.jsx("button",{onClick:()=>window.location.reload(),children:"Reload"})]}):this.props.children}}const iS=new URLSearchParams(window.location.search),IC=iS.get("vault"),mye=iS.get("capture")==="1",yye=iS.get("perch")==="1";IC&&WC(IC);function bye(){return B.useEffect(()=>{CQ().then(e=>_1(e));const r=e=>{(e.key===null||e.key===y5)&&_1(Aw())};return window.addEventListener("storage",r),()=>window.removeEventListener("storage",r)},[]),null}function vye(){return mye?a.jsx(sm,{children:a.jsx(LQ,{})}):yye?a.jsx(sm,{children:a.jsx(BQ,{})}):IC?a.jsx(sm,{children:a.jsx(tN,{client:ZR,children:a.jsx(DQ,{children:a.jsx(oA,{children:a.jsxs(sN,{children:[a.jsx(yL,{}),a.jsx(pye,{}),a.jsx(uhe,{children:r=>a.jsx(gye,{nav:r})}),a.jsx(Zhe,{}),a.jsx(bL,{})]})})})})}):a.jsx(sm,{children:a.jsx(tN,{client:ZR,children:a.jsx(oA,{children:a.jsxs(sN,{children:[a.jsx(yL,{}),a.jsx(bye,{}),a.jsx(sZ,{}),a.jsx(bL,{})]})})})})}const xye=!!window.__TAURI_INTERNALS__;xye&&navigator.platform.toLowerCase().includes("mac")&&document.documentElement.classList.add("tauri-overlay");lz.createRoot(document.getElementById("root")).render(a.jsx(B.StrictMode,{children:a.jsx(vye,{})}));export{q5 as $,Aye as A,Vo as B,UQ as C,si as D,tee as E,ak as F,M5 as G,zte as H,xee as I,Tte as J,sJ as K,Tf as L,Nye as M,Xy as N,OJ as O,P5 as P,uA as Q,uee as R,A1 as S,Pte as T,Vf as U,Bs as V,ze as W,$e as X,HJ as Y,Lte as Z,q as _,YJ as a,gK as a$,oee as a0,gA as a1,pA as a2,Fye as a3,Rye as a4,Dye as a5,Oye as a6,Mye as a7,qw as a8,Iye as a9,tne as aA,ene as aB,YO as aC,wX as aD,nie as aE,S5 as aF,lee as aG,pu as aH,Eye as aI,Ly as aJ,Fm as aK,$U as aL,hO as aM,Qf as aN,rie as aO,tie as aP,kX as aQ,JC as aR,Ao as aS,_f as aT,vN as aU,Qq as aV,SW as aW,yO as aX,bO as aY,pK as aZ,Im as a_,Lye as aa,oh as ab,Pye as ac,$ye as ad,Bye as ae,jie as af,i6 as ag,Xye as ah,Nte as ai,un as aj,Ya as ak,kd as al,ok as am,QD as an,dc as ao,r4 as ap,ar as aq,ra as ar,Mt as as,Mne as at,Yye as au,Zye as av,Kye as aw,It as ax,Vye as ay,ane as az,VJ as b,Pm as b$,mu as b0,Ml as b1,hG as b2,PN as b3,As as b4,dW as b5,ow as b6,oK as b7,mK as b8,yu as b9,tX as bA,KV as bB,Ut as bC,SX as bD,GV as bE,wO as bF,QN as bG,Jl as bH,K7 as bI,Ce as bJ,B as bK,UO as bL,WO as bM,GO as bN,a as bO,RN as bP,vW as bQ,TW as bR,jW as bS,My as bT,bK as bU,aw as bV,uO as bW,jK as bX,pG as bY,bG as bZ,Uf as b_,kW as ba,EW as bb,CK as bc,yW as bd,sw as be,ZN as bf,Bt as bg,i4 as bh,Sk as bi,Tn as bj,Wq as bk,QC as bl,XB as bm,Hf as bn,JB as bo,Tye as bp,AN as bq,jN as br,HQ as bs,ji as bt,que as bu,Dr as bv,cw as bw,rX as bx,eX as by,GY as bz,Mr as c,sl as c0,XN as c1,lw as c2,dO as c3,r1 as c4,Cye as c5,Zt as c6,cB as c7,Rk as c8,kye as c9,ebe as ca,$C as cb,wye as cc,Xt as d,z5 as e,Ei as f,ZJ as g,Ga as h,Ms as i,Mte as j,Yf as k,tt as l,e4 as m,jye as n,Jye as o,QJ as p,JJ as q,Qye as r,XJ as s,Ete as t,Ts as u,Yie as v,Ute as w,zye as x,Qo as y,KJ as z};