colonynote 1.0.4 → 1.0.5

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 (87) hide show
  1. package/dist/client/assets/{arc-DSm-RaVr.js → arc-ZUytxQLt.js} +1 -1
  2. package/dist/client/assets/architecture-YZFGNWBL-BTrOsuUM.js +1 -0
  3. package/dist/client/assets/{architectureDiagram-Q4EWVU46-CZLkcXEU.js → architectureDiagram-Q4EWVU46-DAs7Nxb1.js} +1 -1
  4. package/dist/client/assets/{blockDiagram-DXYQGD6D-BIkEPxKz.js → blockDiagram-DXYQGD6D-Ni-UtM9U.js} +1 -1
  5. package/dist/client/assets/{c4Diagram-AHTNJAMY-DW9AMP9p.js → c4Diagram-AHTNJAMY-BRGbLkKl.js} +1 -1
  6. package/dist/client/assets/channel-CSAMjJ-K.js +1 -0
  7. package/dist/client/assets/{chunk-2KRD3SAO-C4Qbkeh6.js → chunk-2KRD3SAO-Bg9TL4pI.js} +1 -1
  8. package/dist/client/assets/{chunk-4BX2VUAB-V4q4lWzd.js → chunk-4BX2VUAB-B1Jo4ACq.js} +1 -1
  9. package/dist/client/assets/{chunk-4TB4RGXK-DB-d_vNA.js → chunk-4TB4RGXK-D1uSKsQk.js} +1 -1
  10. package/dist/client/assets/{chunk-55IACEB6-CeyAgZBc.js → chunk-55IACEB6-Isozlh3d.js} +1 -1
  11. package/dist/client/assets/{chunk-67CJDMHE-BBw0WAOh.js → chunk-67CJDMHE-RkMdOmDg.js} +1 -1
  12. package/dist/client/assets/{chunk-7N4EOEYR-Cxb6rW7C.js → chunk-7N4EOEYR-CC1YthZ0.js} +1 -1
  13. package/dist/client/assets/{chunk-AA7GKIK3-BDbtHddU.js → chunk-AA7GKIK3-DW1BUwzB.js} +1 -1
  14. package/dist/client/assets/{chunk-CIAEETIT-D75f5scq.js → chunk-CIAEETIT-BztiXFX_.js} +1 -1
  15. package/dist/client/assets/{chunk-EDXVE4YY-f7yHK1J5.js → chunk-EDXVE4YY-LvqpGf7R.js} +1 -1
  16. package/dist/client/assets/{chunk-FMBD7UC4-BrsebJHn.js → chunk-FMBD7UC4-bHbbN2EH.js} +1 -1
  17. package/dist/client/assets/{chunk-FOC6F5B3-LOYM7Ijt.js → chunk-FOC6F5B3-BPe7a8B7.js} +1 -1
  18. package/dist/client/assets/{chunk-K5T4RW27-MT5BPI9v.js → chunk-K5T4RW27-DXV4R6zX.js} +1 -1
  19. package/dist/client/assets/{chunk-KGLVRYIC-BzIJXoe7.js → chunk-KGLVRYIC-CkvQkiyX.js} +1 -1
  20. package/dist/client/assets/{chunk-LIHQZDEY-CNuU_ULt.js → chunk-LIHQZDEY-Bz5RHsud.js} +1 -1
  21. package/dist/client/assets/{chunk-ORNJ4GCN-BaVV1JMy.js → chunk-ORNJ4GCN-BXLJ-I9I.js} +1 -1
  22. package/dist/client/assets/{chunk-OYMX7WX6-D4H7q0h3.js → chunk-OYMX7WX6-Bo-YaVq2.js} +1 -1
  23. package/dist/client/assets/chunk-QZHKN3VN-CCSpvfnX.js +1 -0
  24. package/dist/client/assets/{chunk-YZCP3GAM-Cp3hplAD.js → chunk-YZCP3GAM-CUjuqVjA.js} +1 -1
  25. package/dist/client/assets/classDiagram-6PBFFD2Q-hHHRH44v.js +1 -0
  26. package/dist/client/assets/classDiagram-v2-HSJHXN6E-DVELpVSz.js +1 -0
  27. package/dist/client/assets/clone-CnI8n-00.js +1 -0
  28. package/dist/client/assets/{cose-bilkent-S5V4N54A-bGZdzWSO.js → cose-bilkent-S5V4N54A-DXGm3qlJ.js} +1 -1
  29. package/dist/client/assets/{dagre-Bhg2j5Q-.js → dagre-DLRHgKIB.js} +1 -1
  30. package/dist/client/assets/{dagre-KV5264BT-nII8ZsHR.js → dagre-KV5264BT-DycDPLvk.js} +1 -1
  31. package/dist/client/assets/{diagram-5BDNPKRD-BM8q9EVD.js → diagram-5BDNPKRD-BwHShOSK.js} +1 -1
  32. package/dist/client/assets/{diagram-G4DWMVQ6-BMvG4j4w.js → diagram-G4DWMVQ6-D26Y-K60.js} +1 -1
  33. package/dist/client/assets/{diagram-MMDJMWI5-CJJrq4a9.js → diagram-MMDJMWI5-Aer2TE2o.js} +1 -1
  34. package/dist/client/assets/{diagram-TYMM5635-Yh2GKgsa.js → diagram-TYMM5635-Cw5eaPxt.js} +1 -1
  35. package/dist/client/assets/{erDiagram-SMLLAGMA-BcGYe7Fu.js → erDiagram-SMLLAGMA-C0F2shsj.js} +1 -1
  36. package/dist/client/assets/{flatten-D8I9C_O5.js → flatten-259UzxGw.js} +1 -1
  37. package/dist/client/assets/{flowDiagram-DWJPFMVM-Do3g4K2l.js → flowDiagram-DWJPFMVM-CojOtGGR.js} +1 -1
  38. package/dist/client/assets/{ganttDiagram-T4ZO3ILL-CvrXJI9J.js → ganttDiagram-T4ZO3ILL-Ckrhb2jW.js} +1 -1
  39. package/dist/client/assets/gitGraph-7Q5UKJZL-Cy9m9YL_.js +1 -0
  40. package/dist/client/assets/{gitGraphDiagram-UUTBAWPF-BjF3QLKl.js → gitGraphDiagram-UUTBAWPF-DcMqSrzm.js} +1 -1
  41. package/dist/client/assets/{graphlib-CKAZAx7x.js → graphlib-CP-xlbS-.js} +1 -1
  42. package/dist/client/assets/{index-CTHc76FQ.js → index-B3fIsvPY.js} +4 -4
  43. package/dist/client/assets/index-BgJQzDzi.css +1 -0
  44. package/dist/client/assets/info-OMHHGYJF-Z2GUE1Ui.js +1 -0
  45. package/dist/client/assets/{infoDiagram-42DDH7IO-Cjy15hPp.js → infoDiagram-42DDH7IO-Bec012fF.js} +1 -1
  46. package/dist/client/assets/{ishikawaDiagram-UXIWVN3A-CPNhMvZ9.js → ishikawaDiagram-UXIWVN3A-DCxCTNWg.js} +1 -1
  47. package/dist/client/assets/{journeyDiagram-VCZTEJTY-DMyqUj7-.js → journeyDiagram-VCZTEJTY-BaNNdz_C.js} +1 -1
  48. package/dist/client/assets/{kanban-definition-6JOO6SKY-DLR7DxlV.js → kanban-definition-6JOO6SKY-CF8ekLbq.js} +1 -1
  49. package/dist/client/assets/{linear-DLY2jjMU.js → linear--lYZPCym.js} +1 -1
  50. package/dist/client/assets/{mermaid-parser.core-DWHRsgrw.js → mermaid-parser.core-BiB98L-e.js} +2 -2
  51. package/dist/client/assets/{mindmap-definition-QFDTVHPH-CAQScysO.js → mindmap-definition-QFDTVHPH-BesPvEwN.js} +1 -1
  52. package/dist/client/assets/packet-4T2RLAQJ-Ca05trHp.js +1 -0
  53. package/dist/client/assets/pie-ZZUOXDRM-Ci9vQaCC.js +1 -0
  54. package/dist/client/assets/{pieDiagram-DEJITSTG-BrA-y-DL.js → pieDiagram-DEJITSTG-CFOdV-Od.js} +1 -1
  55. package/dist/client/assets/{quadrantDiagram-34T5L4WZ-9JsDXHfE.js → quadrantDiagram-34T5L4WZ-BqkfwC_k.js} +1 -1
  56. package/dist/client/assets/radar-PYXPWWZC-cGObd7Fe.js +1 -0
  57. package/dist/client/assets/{reduce-xGeYEvWp.js → reduce-Bv9KOHMM.js} +1 -1
  58. package/dist/client/assets/{requirementDiagram-MS252O5E-BHBd2BKs.js → requirementDiagram-MS252O5E-DE2y_tGJ.js} +1 -1
  59. package/dist/client/assets/{sankeyDiagram-XADWPNL6-CdZ_btXM.js → sankeyDiagram-XADWPNL6-BlyRgjI6.js} +1 -1
  60. package/dist/client/assets/{sequenceDiagram-FGHM5R23-C0l9yDS6.js → sequenceDiagram-FGHM5R23-BvFb9l2D.js} +1 -1
  61. package/dist/client/assets/{stateDiagram-FHFEXIEX-CkP8P5HT.js → stateDiagram-FHFEXIEX-CXoHchSk.js} +1 -1
  62. package/dist/client/assets/stateDiagram-v2-QKLJ7IA2-BLHyyGW-.js +1 -0
  63. package/dist/client/assets/{timeline-definition-GMOUNBTQ-DpFBpAmW.js → timeline-definition-GMOUNBTQ-C98Wdp1r.js} +1 -1
  64. package/dist/client/assets/treeView-SZITEDCU-nhj6xl9u.js +1 -0
  65. package/dist/client/assets/treemap-W4RFUUIX-DlVm9AB2.js +1 -0
  66. package/dist/client/assets/{vennDiagram-DHZGUBPP-DqIGX6AX.js → vennDiagram-DHZGUBPP-C31SdZnU.js} +1 -1
  67. package/dist/client/assets/wardley-RL74JXVD-B3ABBnYV.js +1 -0
  68. package/dist/client/assets/{wardleyDiagram-NUSXRM2D-BeFnIG4_.js → wardleyDiagram-NUSXRM2D-BY9wpPZs.js} +1 -1
  69. package/dist/client/assets/{xychartDiagram-5P7HB3ND-BTaqJ4lb.js → xychartDiagram-5P7HB3ND-DMLeR5iW.js} +1 -1
  70. package/dist/client/index.html +2 -2
  71. package/package.json +1 -1
  72. package/dist/client/assets/architecture-YZFGNWBL-B9hf81yV.js +0 -1
  73. package/dist/client/assets/channel-DI2caX9f.js +0 -1
  74. package/dist/client/assets/chunk-QZHKN3VN-NUwM75IC.js +0 -1
  75. package/dist/client/assets/classDiagram-6PBFFD2Q-X9uc3nLS.js +0 -1
  76. package/dist/client/assets/classDiagram-v2-HSJHXN6E-D4QapdxP.js +0 -1
  77. package/dist/client/assets/clone-B3YSWJ1F.js +0 -1
  78. package/dist/client/assets/gitGraph-7Q5UKJZL-BG4fbrFS.js +0 -1
  79. package/dist/client/assets/index-BhfhYy1l.css +0 -1
  80. package/dist/client/assets/info-OMHHGYJF-Bb1ToEww.js +0 -1
  81. package/dist/client/assets/packet-4T2RLAQJ-gGLnBGVI.js +0 -1
  82. package/dist/client/assets/pie-ZZUOXDRM-CpzAT3MO.js +0 -1
  83. package/dist/client/assets/radar-PYXPWWZC-DI_eFsWT.js +0 -1
  84. package/dist/client/assets/stateDiagram-v2-QKLJ7IA2-CAjToO-Y.js +0 -1
  85. package/dist/client/assets/treeView-SZITEDCU-DeKpEcwG.js +0 -1
  86. package/dist/client/assets/treemap-W4RFUUIX-YXnCqr6Z.js +0 -1
  87. package/dist/client/assets/wardley-RL74JXVD-FUuTBDZ3.js +0 -1
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/katex-BAACGBI_.js","assets/chunk-Dlc7tRH4.js","assets/dagre-KV5264BT-nII8ZsHR.js","assets/dagre-Bhg2j5Q-.js","assets/graphlib-CKAZAx7x.js","assets/identity-CQcu21F9.js","assets/reduce-xGeYEvWp.js","assets/flatten-D8I9C_O5.js","assets/clone-B3YSWJ1F.js","assets/cose-bilkent-S5V4N54A-bGZdzWSO.js","assets/cytoscape.esm-DT0IEibP.js","assets/c4Diagram-AHTNJAMY-DW9AMP9p.js","assets/chunk-YZCP3GAM-Cp3hplAD.js","assets/flowDiagram-DWJPFMVM-Do3g4K2l.js","assets/channel-DI2caX9f.js","assets/chunk-55IACEB6-CeyAgZBc.js","assets/chunk-EDXVE4YY-f7yHK1J5.js","assets/chunk-FMBD7UC4-BrsebJHn.js","assets/erDiagram-SMLLAGMA-BcGYe7Fu.js","assets/gitGraphDiagram-UUTBAWPF-BjF3QLKl.js","assets/mermaid-parser.core-DWHRsgrw.js","assets/chunk-K5T4RW27-MT5BPI9v.js","assets/chunk-2KRD3SAO-C4Qbkeh6.js","assets/chunk-67CJDMHE-BBw0WAOh.js","assets/chunk-7N4EOEYR-Cxb6rW7C.js","assets/chunk-AA7GKIK3-BDbtHddU.js","assets/chunk-CIAEETIT-D75f5scq.js","assets/chunk-FOC6F5B3-LOYM7Ijt.js","assets/chunk-KGLVRYIC-BzIJXoe7.js","assets/chunk-LIHQZDEY-CNuU_ULt.js","assets/chunk-ORNJ4GCN-BaVV1JMy.js","assets/chunk-4BX2VUAB-V4q4lWzd.js","assets/chunk-QZHKN3VN-NUwM75IC.js","assets/ganttDiagram-T4ZO3ILL-CvrXJI9J.js","assets/linear-DLY2jjMU.js","assets/defaultLocale-ClcAPJ5U.js","assets/init-TU6eJ00_.js","assets/infoDiagram-42DDH7IO-Cjy15hPp.js","assets/pieDiagram-DEJITSTG-BrA-y-DL.js","assets/path-yo4Xej8w.js","assets/ordinal-DCsgWfZW.js","assets/arc-DSm-RaVr.js","assets/array-C0548cPn.js","assets/quadrantDiagram-34T5L4WZ-9JsDXHfE.js","assets/xychartDiagram-5P7HB3ND-BTaqJ4lb.js","assets/requirementDiagram-MS252O5E-BHBd2BKs.js","assets/sequenceDiagram-FGHM5R23-C0l9yDS6.js","assets/classDiagram-6PBFFD2Q-X9uc3nLS.js","assets/chunk-4TB4RGXK-DB-d_vNA.js","assets/classDiagram-v2-HSJHXN6E-D4QapdxP.js","assets/stateDiagram-FHFEXIEX-CkP8P5HT.js","assets/chunk-OYMX7WX6-D4H7q0h3.js","assets/stateDiagram-v2-QKLJ7IA2-CAjToO-Y.js","assets/journeyDiagram-VCZTEJTY-DMyqUj7-.js","assets/timeline-definition-GMOUNBTQ-DpFBpAmW.js","assets/mindmap-definition-QFDTVHPH-CAQScysO.js","assets/kanban-definition-6JOO6SKY-DLR7DxlV.js","assets/sankeyDiagram-XADWPNL6-CdZ_btXM.js","assets/diagram-TYMM5635-Yh2GKgsa.js","assets/diagram-MMDJMWI5-CJJrq4a9.js","assets/blockDiagram-DXYQGD6D-BIkEPxKz.js","assets/diagram-5BDNPKRD-BM8q9EVD.js","assets/architectureDiagram-Q4EWVU46-CZLkcXEU.js","assets/ishikawaDiagram-UXIWVN3A-CPNhMvZ9.js","assets/rough.esm-DulVNktb.js","assets/vennDiagram-DHZGUBPP-DqIGX6AX.js","assets/diagram-G4DWMVQ6-BMvG4j4w.js","assets/wardleyDiagram-NUSXRM2D-BeFnIG4_.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/katex-BAACGBI_.js","assets/chunk-Dlc7tRH4.js","assets/dagre-KV5264BT-DycDPLvk.js","assets/dagre-DLRHgKIB.js","assets/graphlib-CP-xlbS-.js","assets/identity-CQcu21F9.js","assets/reduce-Bv9KOHMM.js","assets/flatten-259UzxGw.js","assets/clone-CnI8n-00.js","assets/cose-bilkent-S5V4N54A-DXGm3qlJ.js","assets/cytoscape.esm-DT0IEibP.js","assets/c4Diagram-AHTNJAMY-BRGbLkKl.js","assets/chunk-YZCP3GAM-CUjuqVjA.js","assets/flowDiagram-DWJPFMVM-CojOtGGR.js","assets/channel-CSAMjJ-K.js","assets/chunk-55IACEB6-Isozlh3d.js","assets/chunk-EDXVE4YY-LvqpGf7R.js","assets/chunk-FMBD7UC4-bHbbN2EH.js","assets/erDiagram-SMLLAGMA-C0F2shsj.js","assets/gitGraphDiagram-UUTBAWPF-DcMqSrzm.js","assets/mermaid-parser.core-BiB98L-e.js","assets/chunk-K5T4RW27-DXV4R6zX.js","assets/chunk-2KRD3SAO-Bg9TL4pI.js","assets/chunk-67CJDMHE-RkMdOmDg.js","assets/chunk-7N4EOEYR-CC1YthZ0.js","assets/chunk-AA7GKIK3-DW1BUwzB.js","assets/chunk-CIAEETIT-BztiXFX_.js","assets/chunk-FOC6F5B3-BPe7a8B7.js","assets/chunk-KGLVRYIC-CkvQkiyX.js","assets/chunk-LIHQZDEY-Bz5RHsud.js","assets/chunk-ORNJ4GCN-BXLJ-I9I.js","assets/chunk-4BX2VUAB-B1Jo4ACq.js","assets/chunk-QZHKN3VN-CCSpvfnX.js","assets/ganttDiagram-T4ZO3ILL-Ckrhb2jW.js","assets/linear--lYZPCym.js","assets/defaultLocale-ClcAPJ5U.js","assets/init-TU6eJ00_.js","assets/infoDiagram-42DDH7IO-Bec012fF.js","assets/pieDiagram-DEJITSTG-CFOdV-Od.js","assets/path-yo4Xej8w.js","assets/ordinal-DCsgWfZW.js","assets/arc-ZUytxQLt.js","assets/array-C0548cPn.js","assets/quadrantDiagram-34T5L4WZ-BqkfwC_k.js","assets/xychartDiagram-5P7HB3ND-DMLeR5iW.js","assets/requirementDiagram-MS252O5E-DE2y_tGJ.js","assets/sequenceDiagram-FGHM5R23-BvFb9l2D.js","assets/classDiagram-6PBFFD2Q-hHHRH44v.js","assets/chunk-4TB4RGXK-D1uSKsQk.js","assets/classDiagram-v2-HSJHXN6E-DVELpVSz.js","assets/stateDiagram-FHFEXIEX-CXoHchSk.js","assets/chunk-OYMX7WX6-Bo-YaVq2.js","assets/stateDiagram-v2-QKLJ7IA2-BLHyyGW-.js","assets/journeyDiagram-VCZTEJTY-BaNNdz_C.js","assets/timeline-definition-GMOUNBTQ-C98Wdp1r.js","assets/mindmap-definition-QFDTVHPH-BesPvEwN.js","assets/kanban-definition-6JOO6SKY-CF8ekLbq.js","assets/sankeyDiagram-XADWPNL6-BlyRgjI6.js","assets/diagram-TYMM5635-Cw5eaPxt.js","assets/diagram-MMDJMWI5-Aer2TE2o.js","assets/blockDiagram-DXYQGD6D-Ni-UtM9U.js","assets/diagram-5BDNPKRD-BwHShOSK.js","assets/architectureDiagram-Q4EWVU46-DAs7Nxb1.js","assets/ishikawaDiagram-UXIWVN3A-DCxCTNWg.js","assets/rough.esm-DulVNktb.js","assets/vennDiagram-DHZGUBPP-C31SdZnU.js","assets/diagram-G4DWMVQ6-D26Y-K60.js","assets/wardleyDiagram-NUSXRM2D-BY9wpPZs.js"])))=>i.map(i=>d[i]);
2
2
  import{o as e,r as t,t as n}from"./chunk-Dlc7tRH4.js";import{n as r,t as i}from"./path-yo4Xej8w.js";import{t as a}from"./array-C0548cPn.js";import{C as o,E as s,O as c,S as l,T as u,_ as d,b as f,c as p,d as m,f as h,g,h as _,i as v,m as y,n as b,p as x,r as S,s as C,t as w,u as T,v as E,w as D,x as O}from"./identity-CQcu21F9.js";import{t as k}from"./rough.esm-DulVNktb.js";import{t as A}from"./katex-BAACGBI_.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var ee=n((e=>{var t=Symbol.for(`react.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.provider`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.iterator;function p(e){return typeof e!=`object`||!e?null:(e=f&&e[f]||e[`@@iterator`],typeof e==`function`?e:null)}var m={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,g={};function _(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}_.prototype.isReactComponent={},_.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`setState(...): takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},_.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function v(){}v.prototype=_.prototype;function y(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||m}var b=y.prototype=new v;b.constructor=y,h(b,_.prototype),b.isPureReactComponent=!0;var x=Array.isArray,S=Object.prototype.hasOwnProperty,C={current:null},w={key:!0,ref:!0,__self:!0,__source:!0};function T(e,n,r){var i,a={},o=null,s=null;if(n!=null)for(i in n.ref!==void 0&&(s=n.ref),n.key!==void 0&&(o=``+n.key),n)S.call(n,i)&&!w.hasOwnProperty(i)&&(a[i]=n[i]);var c=arguments.length-2;if(c===1)a.children=r;else if(1<c){for(var l=Array(c),u=0;u<c;u++)l[u]=arguments[u+2];a.children=l}if(e&&e.defaultProps)for(i in c=e.defaultProps,c)a[i]===void 0&&(a[i]=c[i]);return{$$typeof:t,type:e,key:o,ref:s,props:a,_owner:C.current}}function E(e,n){return{$$typeof:t,type:e.type,key:n,ref:e.ref,props:e.props,_owner:e._owner}}function D(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function O(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var k=/\/+/g;function A(e,t){return typeof e==`object`&&e&&e.key!=null?O(``+e.key):t.toString(36)}function ee(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0}}if(c)return c=e,o=o(c),e=a===``?`.`+A(c,0):a,x(o)?(i=``,e!=null&&(i=e.replace(k,`$&/`)+`/`),ee(o,r,i,``,function(e){return e})):o!=null&&(D(o)&&(o=E(o,i+(!o.key||c&&c.key===o.key?``:(``+o.key).replace(k,`$&/`)+`/`)+e)),r.push(o)),1;if(c=0,a=a===``?`.`:a+`:`,x(e))for(var l=0;l<e.length;l++){s=e[l];var u=a+A(s,l);c+=ee(s,r,i,u,o)}else if(u=p(e),typeof u==`function`)for(e=u.call(e),l=0;!(s=e.next()).done;)s=s.value,u=a+A(s,l++),c+=ee(s,r,i,u,o);else if(s===`object`)throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`);return c}function j(e,t,n){if(e==null)return e;var r=[],i=0;return ee(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function te(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var M={current:null},ne={transition:null},N={ReactCurrentDispatcher:M,ReactCurrentBatchConfig:ne,ReactCurrentOwner:C};function re(){throw Error(`act(...) is not supported in production builds of React.`)}e.Children={map:j,forEach:function(e,t,n){j(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return j(e,function(){t++}),t},toArray:function(e){return j(e,function(e){return e})||[]},only:function(e){if(!D(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}},e.Component=_,e.Fragment=r,e.Profiler=a,e.PureComponent=y,e.StrictMode=i,e.Suspense=l,e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=N,e.act=re,e.cloneElement=function(e,n,r){if(e==null)throw Error(`React.cloneElement(...): The argument must be a React element, but you passed `+e+`.`);var i=h({},e.props),a=e.key,o=e.ref,s=e._owner;if(n!=null){if(n.ref!==void 0&&(o=n.ref,s=C.current),n.key!==void 0&&(a=``+n.key),e.type&&e.type.defaultProps)var c=e.type.defaultProps;for(l in n)S.call(n,l)&&!w.hasOwnProperty(l)&&(i[l]=n[l]===void 0&&c!==void 0?c[l]:n[l])}var l=arguments.length-2;if(l===1)i.children=r;else if(1<l){c=Array(l);for(var u=0;u<l;u++)c[u]=arguments[u+2];i.children=c}return{$$typeof:t,type:e.type,key:a,ref:o,props:i,_owner:s}},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:o,_context:e},e.Consumer=e},e.createElement=T,e.createFactory=function(e){var t=T.bind(null,e);return t.type=e,t},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=D,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:te}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=ne.transition;ne.transition={};try{e()}finally{ne.transition=t}},e.unstable_act=re,e.useCallback=function(e,t){return M.current.useCallback(e,t)},e.useContext=function(e){return M.current.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e){return M.current.useDeferredValue(e)},e.useEffect=function(e,t){return M.current.useEffect(e,t)},e.useId=function(){return M.current.useId()},e.useImperativeHandle=function(e,t,n){return M.current.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return M.current.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return M.current.useLayoutEffect(e,t)},e.useMemo=function(e,t){return M.current.useMemo(e,t)},e.useReducer=function(e,t,n){return M.current.useReducer(e,t,n)},e.useRef=function(e){return M.current.useRef(e)},e.useState=function(e){return M.current.useState(e)},e.useSyncExternalStore=function(e,t,n){return M.current.useSyncExternalStore(e,t,n)},e.useTransition=function(){return M.current.useTransition()},e.version=`18.3.1`})),j=n(((e,t)=>{t.exports=ee()})),te=n((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=typeof setTimeout==`function`?setTimeout:null,_=typeof clearTimeout==`function`?clearTimeout:null,v=typeof setImmediate<`u`?setImmediate:null;typeof navigator<`u`&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function b(e){if(h=!1,y(e),!m)if(n(c)!==null)m=!0,j(x);else{var t=n(l);t!==null&&te(b,t.startTime-e)}}function x(t,i){m=!1,h&&(h=!1,_(w),w=-1),p=!0;var a=f;try{for(y(i),d=n(c);d!==null&&(!(d.expirationTime>i)||t&&!D());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=i);i=e.unstable_now(),typeof s==`function`?d.callback=s:d===n(c)&&r(c),y(i)}else r(c);d=n(c)}if(d!==null)var u=!0;else{var g=n(l);g!==null&&te(b,g.startTime-i),u=!1}return u}finally{d=null,f=a,p=!1}}var S=!1,C=null,w=-1,T=5,E=-1;function D(){return!(e.unstable_now()-E<T)}function O(){if(C!==null){var t=e.unstable_now();E=t;var n=!0;try{n=C(!0,t)}finally{n?k():(S=!1,C=null)}}else S=!1}var k;if(typeof v==`function`)k=function(){v(O)};else if(typeof MessageChannel<`u`){var A=new MessageChannel,ee=A.port2;A.port1.onmessage=O,k=function(){ee.postMessage(null)}}else k=function(){g(O,0)};function j(e){C=e,S||(S=!0,k())}function te(t,n){w=g(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){m||p||(m=!0,j(x))},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):T=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(_(w),w=-1):h=!0,te(b,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,j(x))),r},e.unstable_shouldYield=D,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),M=n(((e,t)=>{t.exports=te()})),ne=n((e=>{var t=j(),n=M();function r(e){for(var t=`https://reactjs.org/docs/error-decoder.html?invariant=`+e,n=1;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n]);return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}var i=new Set,a={};function o(e,t){s(e,t),s(e+`Capture`,t)}function s(e,t){for(a[e]=t,e=0;e<t.length;e++)i.add(t[e])}var c=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),l=Object.prototype.hasOwnProperty,u=/^[: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]*$/,d={},f={};function p(e){return l.call(f,e)?!0:l.call(d,e)?!1:u.test(e)?f[e]=!0:(d[e]=!0,!1)}function m(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case`function`:case`symbol`:return!0;case`boolean`:return r?!1:n===null?(e=e.toLowerCase().slice(0,5),e!==`data-`&&e!==`aria-`):!n.acceptsBooleans;default:return!1}}function h(e,t,n,r){if(t==null||m(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function g(e,t,n,r,i,a,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=o}var _={};`children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style`.split(` `).forEach(function(e){_[e]=new g(e,0,!1,e,null,!1,!1)}),[[`acceptCharset`,`accept-charset`],[`className`,`class`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`]].forEach(function(e){var t=e[0];_[t]=new g(t,1,!1,e[1],null,!1,!1)}),[`contentEditable`,`draggable`,`spellCheck`,`value`].forEach(function(e){_[e]=new g(e,2,!1,e.toLowerCase(),null,!1,!1)}),[`autoReverse`,`externalResourcesRequired`,`focusable`,`preserveAlpha`].forEach(function(e){_[e]=new g(e,2,!1,e,null,!1,!1)}),`allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope`.split(` `).forEach(function(e){_[e]=new g(e,3,!1,e.toLowerCase(),null,!1,!1)}),[`checked`,`multiple`,`muted`,`selected`].forEach(function(e){_[e]=new g(e,3,!0,e,null,!1,!1)}),[`capture`,`download`].forEach(function(e){_[e]=new g(e,4,!1,e,null,!1,!1)}),[`cols`,`rows`,`size`,`span`].forEach(function(e){_[e]=new g(e,6,!1,e,null,!1,!1)}),[`rowSpan`,`start`].forEach(function(e){_[e]=new g(e,5,!1,e.toLowerCase(),null,!1,!1)});var v=/[\-:]([a-z])/g;function y(e){return e[1].toUpperCase()}`accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height`.split(` `).forEach(function(e){var t=e.replace(v,y);_[t]=new g(t,1,!1,e,null,!1,!1)}),`xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type`.split(` `).forEach(function(e){var t=e.replace(v,y);_[t]=new g(t,1,!1,e,`http://www.w3.org/1999/xlink`,!1,!1)}),[`xml:base`,`xml:lang`,`xml:space`].forEach(function(e){var t=e.replace(v,y);_[t]=new g(t,1,!1,e,`http://www.w3.org/XML/1998/namespace`,!1,!1)}),[`tabIndex`,`crossOrigin`].forEach(function(e){_[e]=new g(e,1,!1,e.toLowerCase(),null,!1,!1)}),_.xlinkHref=new g(`xlinkHref`,1,!1,`xlink:href`,`http://www.w3.org/1999/xlink`,!0,!1),[`src`,`href`,`action`,`formAction`].forEach(function(e){_[e]=new g(e,1,!1,e.toLowerCase(),null,!0,!0)});function b(e,t,n,r){var i=_.hasOwnProperty(t)?_[t]:null;(i===null?r||!(2<t.length)||t[0]!==`o`&&t[0]!==`O`||t[1]!==`n`&&t[1]!==`N`:i.type!==0)&&(h(t,n,i,r)&&(n=null),r||i===null?p(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,``+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:``:n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&!0===n?``:``+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var x=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,S=Symbol.for(`react.element`),C=Symbol.for(`react.portal`),w=Symbol.for(`react.fragment`),T=Symbol.for(`react.strict_mode`),E=Symbol.for(`react.profiler`),D=Symbol.for(`react.provider`),O=Symbol.for(`react.context`),k=Symbol.for(`react.forward_ref`),A=Symbol.for(`react.suspense`),ee=Symbol.for(`react.suspense_list`),te=Symbol.for(`react.memo`),ne=Symbol.for(`react.lazy`),N=Symbol.for(`react.offscreen`),re=Symbol.iterator;function ie(e){return typeof e!=`object`||!e?null:(e=re&&e[re]||e[`@@iterator`],typeof e==`function`?e:null)}var ae=Object.assign,oe;function P(e){if(oe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);oe=t&&t[1]||``}return`
3
3
  `+oe+e}var se=!1;function ce(e,t){if(!e||se)return``;se=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(t,[])}catch(e){var r=e}Reflect.construct(e,[],t)}else{try{t.call()}catch(e){r=e}e.call(t.prototype)}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&typeof t.stack==`string`){for(var i=t.stack.split(`
4
4
  `),a=r.stack.split(`
@@ -526,8 +526,8 @@ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error
526
526
  L0,20`)},`requirement_arrow`),requirement_contains:W((e,t,n)=>{let r=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-requirement_containsStart`).attr(`refX`,0).attr(`refY`,10).attr(`markerWidth`,20).attr(`markerHeight`,20).attr(`orient`,`auto`).append(`g`);r.append(`circle`).attr(`cx`,10).attr(`cy`,10).attr(`r`,9).attr(`fill`,`none`),r.append(`line`).attr(`x1`,1).attr(`x2`,19).attr(`y1`,10).attr(`y2`,10),r.append(`line`).attr(`y1`,1).attr(`y2`,19).attr(`x1`,10).attr(`x2`,10)},`requirement_contains`),requirement_arrow_neo:W((e,t,n)=>{let{themeVariables:r}=II(),{strokeWidth:i}=r;e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-requirement_arrowEnd`).attr(`refX`,20).attr(`refY`,10).attr(`markerWidth`,20).attr(`markerHeight`,20).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).attr(`stroke-width`,`${i}`).attr(`viewBox`,`0 0 25 20`).append(`path`).attr(`d`,`M0,0
527
527
  L20,10
528
528
  M20,10
529
- L0,20`).attr(`stroke-linejoin`,`miter`)},`requirement_arrow_neo`),requirement_contains_neo:W((e,t,n)=>{let{themeVariables:r}=II(),{strokeWidth:i}=r,a=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-requirement_containsStart`).attr(`refX`,0).attr(`refY`,10).attr(`markerWidth`,20).attr(`markerHeight`,20).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`g`);a.append(`circle`).attr(`cx`,10).attr(`cy`,10).attr(`r`,9).attr(`fill`,`none`),a.append(`line`).attr(`x1`,1).attr(`x2`,19).attr(`y1`,10).attr(`y2`,10),a.append(`line`).attr(`y1`,1).attr(`y2`,19).attr(`x1`,10).attr(`x2`,10),a.selectAll(`*`).attr(`stroke-width`,`${i}`)},`requirement_contains_neo`)},v$=g$,y$={common:_L,getConfig:II,insertCluster:kX,insertEdge:f$,insertEdgeLabel:n$,insertMarkers:v$,insertNode:UQ,interpolateToCurve:eq,labelHelper:gX,log:G,positionEdgeLabel:i$},b$={},x$=W(e=>{for(let t of e)b$[t.name]=t},`registerLayoutLoaders`);W(()=>{x$([{name:`dagre`,loader:W(async()=>await PF(()=>import(`./dagre-KV5264BT-nII8ZsHR.js`),__vite__mapDeps([2,3,4,5,6,7,8])),`loader`)},...[{name:`cose-bilkent`,loader:W(async()=>await PF(()=>import(`./cose-bilkent-S5V4N54A-bGZdzWSO.js`),__vite__mapDeps([9,1,10])),`loader`)}]])},`registerDefaultLayoutLoaders`)();var S$=W(async(e,t)=>{if(!(e.layoutAlgorithm in b$))throw Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(let t of e.nodes){let n=t.domId||t.id;t.domId=`${e.diagramId}-${n}`}let n=b$[e.layoutAlgorithm],r=await n.loader(),{theme:i,themeVariables:a}=e.config,{useGradient:o,gradientStart:s,gradientStop:c}=a,l=t.attr(`id`);if(t.append(`defs`).append(`filter`).attr(`id`,`${l}-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`,`${i?.includes(`dark`)?`#FFFFFF`:`#000000`}`),t.append(`defs`).append(`filter`).attr(`id`,`${l}-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`,`${i?.includes(`dark`)?`#FFFFFF`:`#000000`}`),o){let e=t.append(`linearGradient`).attr(`id`,t.attr(`id`)+`-gradient`).attr(`gradientUnits`,`objectBoundingBox`).attr(`x1`,`0%`).attr(`y1`,`0%`).attr(`x2`,`100%`).attr(`y2`,`0%`);e.append(`svg:stop`).attr(`offset`,`0%`).attr(`stop-color`,s).attr(`stop-opacity`,1),e.append(`svg:stop`).attr(`offset`,`100%`).attr(`stop-color`,c).attr(`stop-opacity`,1)}return r.render(e,t,y$,{algorithm:n.algorithm})},`render`),C$=W((e=``,{fallback:t=`dagre`}={})=>{if(e in b$)return e;if(t in b$)return G.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw Error(`Both layout algorithms ${e} and ${t} are not registered.`)},`getRegisteredLayoutAlgorithm`),w$=`comm`,T$=`rule`,E$=`decl`,D$=`@import`,O$=`@namespace`,k$=`@keyframes`,A$=`@layer`,j$=Math.abs,M$=String.fromCharCode;function N$(e){return e.trim()}function P$(e,t,n){return e.replace(t,n)}function F$(e,t){return e.charCodeAt(t)|0}function I$(e,t,n){return e.slice(t,n)}function L$(e){return e.length}function R$(e){return e.length}function z$(e,t){return t.push(e),e}var B$=1,V$=1,H$=0,U$=0,W$=0,G$=``;function K$(e,t,n,r,i,a,o,s){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:B$,column:V$,length:o,return:``,siblings:s}}function q$(){return W$}function J$(){return W$=U$>0?F$(G$,--U$):0,V$--,W$===10&&(V$=1,B$--),W$}function Y$(){return W$=U$<H$?F$(G$,U$++):0,V$++,W$===10&&(V$=1,B$++),W$}function X$(){return F$(G$,U$)}function Z$(){return U$}function Q$(e,t){return I$(G$,e,t)}function $$(e){switch(e){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 e1(e){return B$=V$=1,H$=L$(G$=e),U$=0,[]}function t1(e){return G$=``,e}function n1(e){return N$(Q$(U$-1,a1(e===91?e+2:e===40?e+1:e)))}function r1(e){for(;(W$=X$())&&W$<33;)Y$();return $$(e)>2||$$(W$)>3?``:` `}function i1(e,t){for(;--t&&Y$()&&!(W$<48||W$>102||W$>57&&W$<65||W$>70&&W$<97););return Q$(e,Z$()+(t<6&&X$()==32&&Y$()==32))}function a1(e){for(;Y$();)switch(W$){case e:return U$;case 34:case 39:e!==34&&e!==39&&a1(W$);break;case 40:e===41&&a1(e);break;case 92:Y$();break}return U$}function o1(e,t){for(;Y$()&&e+W$!==57&&!(e+W$===84&&X$()===47););return`/*`+Q$(t,U$-1)+`*`+M$(e===47?e:Y$())}function s1(e){for(;!$$(X$());)Y$();return Q$(e,U$)}function c1(e){return t1(l1(``,null,null,null,[``],e=e1(e),0,[0],e))}function l1(e,t,n,r,i,a,o,s,c){for(var l=0,u=0,d=o,f=0,p=0,m=0,h=1,g=1,_=1,v=0,y=0,b=``,x=i,S=a,C=r,w=b;g;)switch(m=y,y=Y$()){case 40:m!=108&&F$(w,d-1)==58?(v++,w+=`(`):w+=n1(y);break;case 41:v--,w+=`)`;break;case 34:case 39:case 91:w+=n1(y);break;case 9:case 10:case 13:case 32:if(v>0){w+=M$(y);break}w+=r1(m);break;case 92:w+=i1(Z$()-1,7);continue;case 47:switch(X$()){case 42:case 47:z$(d1(o1(Y$(),Z$()),t,n,c),c),($$(m||1)==5||$$(X$()||1)==5)&&L$(w)&&I$(w,-1,void 0)!==` `&&(w+=` `);break;default:w+=`/`}break;case 123*h:s[l++]=L$(w)*_;case 125*h:case 59:case 0:if(v>0&&y){w+=M$(y);break}switch(y){case 0:case 125:g=0;case 59+u:_==-1&&(w=P$(w,/\f/g,``)),p>0&&(L$(w)-d||h===0)&&z$(p>32?f1(w+`;`,r,n,d-1,c):f1(P$(w,` `,``)+`;`,r,n,d-2,c),c);break;case 59:w+=`;`;default:if(z$(C=u1(w,t,n,l,u,i,s,b,x=[],S=[],d,a),a),y===123)if(u===0)l1(w,t,C,C,x,a,d,s,S);else{switch(f){case 99:if(F$(w,3)===110)break;case 108:if(F$(w,2)===97)break;default:u=0;case 100:case 109:case 115:}u?l1(e,C,C,r&&z$(u1(e,C,C,0,0,i,s,b,i,x=[],d,S),S),i,S,d,s,r?x:S):l1(w,C,C,C,[``],S,0,s,S)}}l=u=p=0,h=_=1,b=w=``,d=o;break;case 58:d=1+L$(w),p=m;default:if(h<1){if(y==123)--h;else if(y==125&&h++==0&&J$()==125)continue}switch(w+=M$(y),y*h){case 38:_=u>0?1:(w+=`\f`,-1);break;case 44:if(v>0)break;s[l++]=(L$(w)-1)*_,_=1;break;case 64:X$()===45&&(w+=n1(Y$())),f=X$(),u=d=L$(b=w+=s1(Z$())),y++;break;case 45:m===45&&L$(w)==2&&(h=0)}}return a}function u1(e,t,n,r,i,a,o,s,c,l,u,d){for(var f=i-1,p=i===0?a:[``],m=R$(p),h=0,g=0,_=0;h<r;++h)for(var v=0,y=I$(e,f+1,f=j$(g=o[h])),b=e;v<m;++v)(b=N$(g>0?p[v]+` `+y:P$(y,/&\f/g,p[v])))&&(c[_++]=b);return K$(e,t,n,i===0?T$:s,c,l,u,d)}function d1(e,t,n,r){return K$(e,t,n,w$,M$(q$()),I$(e,2,-2),0,r)}function f1(e,t,n,r,i){return K$(e,t,n,E$,I$(e,0,r),I$(e,r+1,-1),r,i)}function p1(e,t){for(var n=``,r=0;r<e.length;r++)n+=t(e[r],r,e,t)||``;return n}function m1(e,t,n,r){switch(e.type){case A$:if(e.children.length)break;case D$:case O$:case E$:return e.return=e.return||e.value;case w$:return``;case k$:return e.return=e.value+`{`+p1(e.children,r)+`}`;case T$:if(!L$(e.value=e.props.join(`,`)))return``}return L$(n=p1(e.children,r))?e.return=e.value+`{`+n+`}`:``}var h1=y(Object.keys,Object),g1=Object.prototype.hasOwnProperty;function _1(e){if(!x(e))return h1(e);var t=[];for(var n in Object(e))g1.call(e,n)&&n!=`constructor`&&t.push(n);return t}var v1=l(c,`DataView`),y1=l(c,`Promise`),b1=l(c,`Set`),x1=l(c,`WeakMap`),S1=`[object Map]`,C1=`[object Object]`,w1=`[object Promise]`,T1=`[object Set]`,E1=`[object WeakMap]`,D1=`[object DataView]`,O1=o(v1),k1=o(f),A1=o(y1),j1=o(b1),M1=o(x1),N1=s;(v1&&N1(new v1(new ArrayBuffer(1)))!=D1||f&&N1(new f)!=S1||y1&&N1(y1.resolve())!=w1||b1&&N1(new b1)!=T1||x1&&N1(new x1)!=E1)&&(N1=function(e){var t=s(e),n=t==C1?e.constructor:void 0,r=n?o(n):``;if(r)switch(r){case O1:return D1;case k1:return S1;case A1:return w1;case j1:return T1;case M1:return E1}return t});var P1=N1,F1=`[object Map]`,I1=`[object Set]`,L1=Object.prototype.hasOwnProperty;function R1(e){if(e==null)return!0;if(p(e)&&(T(e)||typeof e==`string`||typeof e.splice==`function`||C(e)||v(e)||m(e)))return!e.length;var t=P1(e);if(t==F1||t==I1)return!e.size;if(x(e))return!_1(e).length;for(var n in e)if(L1.call(e,n))return!1;return!0}var z1=`c4`,B1={id:z1,detector:W(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./c4Diagram-AHTNJAMY-DW9AMP9p.js`);return{diagram:e}},__vite__mapDeps([11,12]));return{id:z1,diagram:e}},`loader`)},V1=`flowchart`,H1={id:V1,detector:W((e,t)=>t?.flowchart?.defaultRenderer===`dagre-wrapper`||t?.flowchart?.defaultRenderer===`elk`?!1:/^\s*graph/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./flowDiagram-DWJPFMVM-Do3g4K2l.js`);return{diagram:e}},__vite__mapDeps([13,14,15,16,17,12]));return{id:V1,diagram:e}},`loader`)},U1=`flowchart-v2`,W1={id:U1,detector:W((e,t)=>t?.flowchart?.defaultRenderer===`dagre-d3`?!1:(t?.flowchart?.defaultRenderer===`elk`&&(t.layout=`elk`),/^\s*graph/.test(e)&&t?.flowchart?.defaultRenderer===`dagre-wrapper`?!0:/^\s*flowchart/.test(e)),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./flowDiagram-DWJPFMVM-Do3g4K2l.js`);return{diagram:e}},__vite__mapDeps([13,14,15,16,17,12]));return{id:U1,diagram:e}},`loader`)},G1=`er`,K1={id:G1,detector:W(e=>/^\s*erDiagram/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./erDiagram-SMLLAGMA-BcGYe7Fu.js`);return{diagram:e}},__vite__mapDeps([18,14,15,16]));return{id:G1,diagram:e}},`loader`)},q1=`gitGraph`,J1={id:q1,detector:W(e=>/^\s*gitGraph/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./gitGraphDiagram-UUTBAWPF-BjF3QLKl.js`);return{diagram:e}},__vite__mapDeps([19,20,21,1,6,5,7,22,23,24,25,26,27,28,29,30,31,32]));return{id:q1,diagram:e}},`loader`)},Y1=`gantt`,X1={id:Y1,detector:W(e=>/^\s*gantt/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./ganttDiagram-T4ZO3ILL-CvrXJI9J.js`);return{diagram:e}},__vite__mapDeps([33,1,34,35,36]));return{id:Y1,diagram:e}},`loader`)},Z1=`info`,Q1={id:Z1,detector:W(e=>/^\s*info/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./infoDiagram-42DDH7IO-Cjy15hPp.js`);return{diagram:e}},__vite__mapDeps([37,20,21,1,6,5,7,22,23,24,25,26,27,28,29,30]));return{id:Z1,diagram:e}},`loader`)},$1=`pie`,e0={id:$1,detector:W(e=>/^\s*pie/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./pieDiagram-DEJITSTG-BrA-y-DL.js`);return{diagram:e}},__vite__mapDeps([38,20,21,1,6,5,7,22,23,24,25,26,27,28,29,30,39,40,36,41,42,31]));return{id:$1,diagram:e}},`loader`)},t0=`quadrantChart`,n0={id:t0,detector:W(e=>/^\s*quadrantChart/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./quadrantDiagram-34T5L4WZ-9JsDXHfE.js`);return{diagram:e}},__vite__mapDeps([43,34,35,36]));return{id:t0,diagram:e}},`loader`)},r0=`xychart`,i0={id:r0,detector:W(e=>/^\s*xychart(-beta)?/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./xychartDiagram-5P7HB3ND-BTaqJ4lb.js`);return{diagram:e}},__vite__mapDeps([44,34,35,36,40]));return{id:r0,diagram:e}},`loader`)},a0=`requirement`,o0={id:a0,detector:W(e=>/^\s*requirement(Diagram)?/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./requirementDiagram-MS252O5E-BHBd2BKs.js`);return{diagram:e}},__vite__mapDeps([45,15,16]));return{id:a0,diagram:e}},`loader`)},s0=`sequence`,c0={id:s0,detector:W(e=>/^\s*sequenceDiagram/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./sequenceDiagram-FGHM5R23-C0l9yDS6.js`);return{diagram:e}},__vite__mapDeps([46,32,12]));return{id:s0,diagram:e}},`loader`)},l0=`class`,u0={id:l0,detector:W((e,t)=>t?.class?.defaultRenderer===`dagre-wrapper`?!1:/^\s*classDiagram/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./classDiagram-6PBFFD2Q-X9uc3nLS.js`);return{diagram:e}},__vite__mapDeps([47,48,15,16,17,12]));return{id:l0,diagram:e}},`loader`)},d0=`classDiagram`,f0={id:d0,detector:W((e,t)=>/^\s*classDiagram/.test(e)&&t?.class?.defaultRenderer===`dagre-wrapper`?!0:/^\s*classDiagram-v2/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./classDiagram-v2-HSJHXN6E-D4QapdxP.js`);return{diagram:e}},__vite__mapDeps([49,48,15,16,17,12]));return{id:d0,diagram:e}},`loader`)},p0=`state`,m0={id:p0,detector:W((e,t)=>t?.state?.defaultRenderer===`dagre-wrapper`?!1:/^\s*stateDiagram/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./stateDiagram-FHFEXIEX-CkP8P5HT.js`);return{diagram:e}},__vite__mapDeps([50,3,4,5,6,7,15,16,51]));return{id:p0,diagram:e}},`loader`)},h0=`stateDiagram`,g0={id:h0,detector:W((e,t)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&t?.state?.defaultRenderer===`dagre-wrapper`),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./stateDiagram-v2-QKLJ7IA2-CAjToO-Y.js`);return{diagram:e}},__vite__mapDeps([52,15,16,51]));return{id:h0,diagram:e}},`loader`)},_0=`journey`,v0={id:_0,detector:W(e=>/^\s*journey/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./journeyDiagram-VCZTEJTY-DMyqUj7-.js`);return{diagram:e}},__vite__mapDeps([53,41,39,17,12]));return{id:_0,diagram:e}},`loader`)},y0={draw:W((e,t,n)=>{G.debug(`rendering svg for syntax error
530
- `);let r=aH(t),i=r.append(`g`);r.attr(`viewBox`,`0 0 2412 512`),bL(r,100,512,!0),i.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`),i.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`),i.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`),i.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`),i.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`),i.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`),i.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`),i.append(`text`).attr(`class`,`error-text`).attr(`x`,1250).attr(`y`,400).attr(`font-size`,`100px`).style(`text-anchor`,`middle`).text(`mermaid version ${n}`)},`draw`)},b0=y0,x0={db:{},renderer:y0,parser:{parse:W(()=>{},`parse`)}},S0=`flowchart-elk`,C0={id:S0,detector:W((e,t={})=>/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer===`elk`?(t.layout=`elk`,!0):!1,`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./flowDiagram-DWJPFMVM-Do3g4K2l.js`);return{diagram:e}},__vite__mapDeps([13,14,15,16,17,12]));return{id:S0,diagram:e}},`loader`)},w0=`timeline`,T0={id:w0,detector:W(e=>/^\s*timeline/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./timeline-definition-GMOUNBTQ-DpFBpAmW.js`);return{diagram:e}},__vite__mapDeps([54,41,39]));return{id:w0,diagram:e}},`loader`)},E0=`mindmap`,D0={id:E0,detector:W(e=>/^\s*mindmap/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./mindmap-definition-QFDTVHPH-CAQScysO.js`);return{diagram:e}},__vite__mapDeps([55,15,16]));return{id:E0,diagram:e}},`loader`)},O0=`kanban`,k0={id:O0,detector:W(e=>/^\s*kanban/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./kanban-definition-6JOO6SKY-DLR7DxlV.js`);return{diagram:e}},__vite__mapDeps([56,17]));return{id:O0,diagram:e}},`loader`)},A0=`sankey`,j0={id:A0,detector:W(e=>/^\s*sankey(-beta)?/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./sankeyDiagram-XADWPNL6-CdZ_btXM.js`);return{diagram:e}},__vite__mapDeps([57,40,36]));return{id:A0,diagram:e}},`loader`)},M0=`packet`,N0={id:M0,detector:W(e=>/^\s*packet(-beta)?/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./diagram-TYMM5635-Yh2GKgsa.js`);return{diagram:e}},__vite__mapDeps([58,20,21,1,6,5,7,22,23,24,25,26,27,28,29,30,31]));return{id:M0,diagram:e}},`loader`)},P0=`radar`,F0={id:P0,detector:W(e=>/^\s*radar-beta/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./diagram-MMDJMWI5-CJJrq4a9.js`);return{diagram:e}},__vite__mapDeps([59,20,21,1,6,5,7,22,23,24,25,26,27,28,29,30,31]));return{id:P0,diagram:e}},`loader`)},I0=`block`,L0={id:I0,detector:W(e=>/^\s*block(-beta)?/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./blockDiagram-DXYQGD6D-BIkEPxKz.js`);return{diagram:e}},__vite__mapDeps([60,4,5,6,14,8,17]));return{id:I0,diagram:e}},`loader`)},R0=`treeView`,z0={id:R0,detector:W(e=>/^\s*treeView-beta/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./diagram-5BDNPKRD-BM8q9EVD.js`);return{diagram:e}},__vite__mapDeps([61,20,21,1,6,5,7,22,23,24,25,26,27,28,29,30,31,32]));return{id:R0,diagram:e}},`loader`)},B0=`architecture`,V0={id:B0,detector:W(e=>/^\s*architecture/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./architectureDiagram-Q4EWVU46-CZLkcXEU.js`);return{diagram:e}},__vite__mapDeps([62,1,20,21,6,5,7,22,23,24,25,26,27,28,29,30,10,31]));return{id:B0,diagram:e}},`loader`)},H0=`ishikawa`,U0={id:H0,detector:W(e=>/^\s*ishikawa(-beta)?\b/i.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./ishikawaDiagram-UXIWVN3A-CPNhMvZ9.js`);return{diagram:e}},__vite__mapDeps([63,64]));return{id:H0,diagram:e}},`loader`)},W0=`venn`,Hie={id:W0,detector:W(e=>/^\s*venn-beta/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./vennDiagram-DHZGUBPP-DqIGX6AX.js`);return{diagram:e}},__vite__mapDeps([65,64]));return{id:W0,diagram:e}},`loader`)},G0=`treemap`,K0={id:G0,detector:W(e=>/^\s*treemap/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./diagram-G4DWMVQ6-BMvG4j4w.js`);return{diagram:e}},__vite__mapDeps([66,20,21,1,6,5,7,22,23,24,25,26,27,28,29,30,35,40,36,31,16]));return{id:G0,diagram:e}},`loader`)},q0=`wardley-beta`,J0={id:q0,detector:W(e=>/^\s*wardley-beta/i.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./wardleyDiagram-NUSXRM2D-BeFnIG4_.js`);return{diagram:e}},__vite__mapDeps([67,20,21,1,6,5,7,22,23,24,25,26,27,28,29,30,31]));return{id:q0,diagram:e}},`loader`)},Y0=!1,X0=W(()=>{Y0||(Y0=!0,qL(`error`,x0,e=>e.toLowerCase().trim()===`error`),qL(`---`,{db:{clear:W(()=>{},`clear`)},styles:{},renderer:{draw:W(()=>{},`draw`)},parser:{parse:W(()=>{throw 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:W(()=>null,`init`)},e=>e.toLowerCase().trimStart().startsWith(`---`)),VF(C0,D0,V0),VF(B1,k0,f0,u0,K1,X1,Q1,e0,o0,c0,W1,H1,T0,J1,g0,m0,v0,n0,j0,N0,i0,L0,z0,F0,U0,K0,Hie,J0))},`addDiagrams`),Z0=W(async()=>{G.debug(`Loading registered diagrams`);let e=(await Promise.allSettled(Object.entries(zF).map(async([e,{detector:t,loader:n}])=>{if(n)try{JL(e)}catch{try{let{diagram:e,id:r}=await n();qL(r,e,t)}catch(t){throw G.error(`Failed to load external diagram with key ${e}. Removing from detectors.`),delete zF[e],t}}}))).filter(e=>e.status===`rejected`);if(e.length>0){G.error(`Failed to load ${e.length} external diagrams`);for(let t of e)G.error(t);throw Error(`Failed to load ${e.length} external diagrams`)}},`loadRegisteredDiagrams`),Q0=`graphics-document document`;function $0(e,t){e.attr(`role`,Q0),t!==``&&e.attr(`aria-roledescription`,t)}W($0,`setA11yDiagramInfo`);function e2(e,t,n,r){if(e.insert!==void 0){if(n){let t=`chart-desc-${r}`;e.attr(`aria-describedby`,t),e.insert(`desc`,`:first-child`).attr(`id`,t).text(n)}if(t){let n=`chart-title-${r}`;e.attr(`aria-labelledby`,n),e.insert(`title`,`:first-child`).attr(`id`,n).text(t)}}}W(e2,`addSVGa11yTitleDescription`);var t2=class e{constructor(e,t,n,r,i){this.type=e,this.text=t,this.db=n,this.parser=r,this.renderer=i}static{W(this,`Diagram`)}static async fromText(t,n={}){let r=II(),i=BF(t,r);t=Aq(t)+`
529
+ L0,20`).attr(`stroke-linejoin`,`miter`)},`requirement_arrow_neo`),requirement_contains_neo:W((e,t,n)=>{let{themeVariables:r}=II(),{strokeWidth:i}=r,a=e.append(`defs`).append(`marker`).attr(`id`,n+`_`+t+`-requirement_containsStart`).attr(`refX`,0).attr(`refY`,10).attr(`markerWidth`,20).attr(`markerHeight`,20).attr(`orient`,`auto`).attr(`markerUnits`,`userSpaceOnUse`).append(`g`);a.append(`circle`).attr(`cx`,10).attr(`cy`,10).attr(`r`,9).attr(`fill`,`none`),a.append(`line`).attr(`x1`,1).attr(`x2`,19).attr(`y1`,10).attr(`y2`,10),a.append(`line`).attr(`y1`,1).attr(`y2`,19).attr(`x1`,10).attr(`x2`,10),a.selectAll(`*`).attr(`stroke-width`,`${i}`)},`requirement_contains_neo`)},v$=g$,y$={common:_L,getConfig:II,insertCluster:kX,insertEdge:f$,insertEdgeLabel:n$,insertMarkers:v$,insertNode:UQ,interpolateToCurve:eq,labelHelper:gX,log:G,positionEdgeLabel:i$},b$={},x$=W(e=>{for(let t of e)b$[t.name]=t},`registerLayoutLoaders`);W(()=>{x$([{name:`dagre`,loader:W(async()=>await PF(()=>import(`./dagre-KV5264BT-DycDPLvk.js`),__vite__mapDeps([2,3,4,5,6,7,8])),`loader`)},...[{name:`cose-bilkent`,loader:W(async()=>await PF(()=>import(`./cose-bilkent-S5V4N54A-DXGm3qlJ.js`),__vite__mapDeps([9,1,10])),`loader`)}]])},`registerDefaultLayoutLoaders`)();var S$=W(async(e,t)=>{if(!(e.layoutAlgorithm in b$))throw Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(let t of e.nodes){let n=t.domId||t.id;t.domId=`${e.diagramId}-${n}`}let n=b$[e.layoutAlgorithm],r=await n.loader(),{theme:i,themeVariables:a}=e.config,{useGradient:o,gradientStart:s,gradientStop:c}=a,l=t.attr(`id`);if(t.append(`defs`).append(`filter`).attr(`id`,`${l}-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`,`${i?.includes(`dark`)?`#FFFFFF`:`#000000`}`),t.append(`defs`).append(`filter`).attr(`id`,`${l}-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`,`${i?.includes(`dark`)?`#FFFFFF`:`#000000`}`),o){let e=t.append(`linearGradient`).attr(`id`,t.attr(`id`)+`-gradient`).attr(`gradientUnits`,`objectBoundingBox`).attr(`x1`,`0%`).attr(`y1`,`0%`).attr(`x2`,`100%`).attr(`y2`,`0%`);e.append(`svg:stop`).attr(`offset`,`0%`).attr(`stop-color`,s).attr(`stop-opacity`,1),e.append(`svg:stop`).attr(`offset`,`100%`).attr(`stop-color`,c).attr(`stop-opacity`,1)}return r.render(e,t,y$,{algorithm:n.algorithm})},`render`),C$=W((e=``,{fallback:t=`dagre`}={})=>{if(e in b$)return e;if(t in b$)return G.warn(`Layout algorithm ${e} is not registered. Using ${t} as fallback.`),t;throw Error(`Both layout algorithms ${e} and ${t} are not registered.`)},`getRegisteredLayoutAlgorithm`),w$=`comm`,T$=`rule`,E$=`decl`,D$=`@import`,O$=`@namespace`,k$=`@keyframes`,A$=`@layer`,j$=Math.abs,M$=String.fromCharCode;function N$(e){return e.trim()}function P$(e,t,n){return e.replace(t,n)}function F$(e,t){return e.charCodeAt(t)|0}function I$(e,t,n){return e.slice(t,n)}function L$(e){return e.length}function R$(e){return e.length}function z$(e,t){return t.push(e),e}var B$=1,V$=1,H$=0,U$=0,W$=0,G$=``;function K$(e,t,n,r,i,a,o,s){return{value:e,root:t,parent:n,type:r,props:i,children:a,line:B$,column:V$,length:o,return:``,siblings:s}}function q$(){return W$}function J$(){return W$=U$>0?F$(G$,--U$):0,V$--,W$===10&&(V$=1,B$--),W$}function Y$(){return W$=U$<H$?F$(G$,U$++):0,V$++,W$===10&&(V$=1,B$++),W$}function X$(){return F$(G$,U$)}function Z$(){return U$}function Q$(e,t){return I$(G$,e,t)}function $$(e){switch(e){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 e1(e){return B$=V$=1,H$=L$(G$=e),U$=0,[]}function t1(e){return G$=``,e}function n1(e){return N$(Q$(U$-1,a1(e===91?e+2:e===40?e+1:e)))}function r1(e){for(;(W$=X$())&&W$<33;)Y$();return $$(e)>2||$$(W$)>3?``:` `}function i1(e,t){for(;--t&&Y$()&&!(W$<48||W$>102||W$>57&&W$<65||W$>70&&W$<97););return Q$(e,Z$()+(t<6&&X$()==32&&Y$()==32))}function a1(e){for(;Y$();)switch(W$){case e:return U$;case 34:case 39:e!==34&&e!==39&&a1(W$);break;case 40:e===41&&a1(e);break;case 92:Y$();break}return U$}function o1(e,t){for(;Y$()&&e+W$!==57&&!(e+W$===84&&X$()===47););return`/*`+Q$(t,U$-1)+`*`+M$(e===47?e:Y$())}function s1(e){for(;!$$(X$());)Y$();return Q$(e,U$)}function c1(e){return t1(l1(``,null,null,null,[``],e=e1(e),0,[0],e))}function l1(e,t,n,r,i,a,o,s,c){for(var l=0,u=0,d=o,f=0,p=0,m=0,h=1,g=1,_=1,v=0,y=0,b=``,x=i,S=a,C=r,w=b;g;)switch(m=y,y=Y$()){case 40:m!=108&&F$(w,d-1)==58?(v++,w+=`(`):w+=n1(y);break;case 41:v--,w+=`)`;break;case 34:case 39:case 91:w+=n1(y);break;case 9:case 10:case 13:case 32:if(v>0){w+=M$(y);break}w+=r1(m);break;case 92:w+=i1(Z$()-1,7);continue;case 47:switch(X$()){case 42:case 47:z$(d1(o1(Y$(),Z$()),t,n,c),c),($$(m||1)==5||$$(X$()||1)==5)&&L$(w)&&I$(w,-1,void 0)!==` `&&(w+=` `);break;default:w+=`/`}break;case 123*h:s[l++]=L$(w)*_;case 125*h:case 59:case 0:if(v>0&&y){w+=M$(y);break}switch(y){case 0:case 125:g=0;case 59+u:_==-1&&(w=P$(w,/\f/g,``)),p>0&&(L$(w)-d||h===0)&&z$(p>32?f1(w+`;`,r,n,d-1,c):f1(P$(w,` `,``)+`;`,r,n,d-2,c),c);break;case 59:w+=`;`;default:if(z$(C=u1(w,t,n,l,u,i,s,b,x=[],S=[],d,a),a),y===123)if(u===0)l1(w,t,C,C,x,a,d,s,S);else{switch(f){case 99:if(F$(w,3)===110)break;case 108:if(F$(w,2)===97)break;default:u=0;case 100:case 109:case 115:}u?l1(e,C,C,r&&z$(u1(e,C,C,0,0,i,s,b,i,x=[],d,S),S),i,S,d,s,r?x:S):l1(w,C,C,C,[``],S,0,s,S)}}l=u=p=0,h=_=1,b=w=``,d=o;break;case 58:d=1+L$(w),p=m;default:if(h<1){if(y==123)--h;else if(y==125&&h++==0&&J$()==125)continue}switch(w+=M$(y),y*h){case 38:_=u>0?1:(w+=`\f`,-1);break;case 44:if(v>0)break;s[l++]=(L$(w)-1)*_,_=1;break;case 64:X$()===45&&(w+=n1(Y$())),f=X$(),u=d=L$(b=w+=s1(Z$())),y++;break;case 45:m===45&&L$(w)==2&&(h=0)}}return a}function u1(e,t,n,r,i,a,o,s,c,l,u,d){for(var f=i-1,p=i===0?a:[``],m=R$(p),h=0,g=0,_=0;h<r;++h)for(var v=0,y=I$(e,f+1,f=j$(g=o[h])),b=e;v<m;++v)(b=N$(g>0?p[v]+` `+y:P$(y,/&\f/g,p[v])))&&(c[_++]=b);return K$(e,t,n,i===0?T$:s,c,l,u,d)}function d1(e,t,n,r){return K$(e,t,n,w$,M$(q$()),I$(e,2,-2),0,r)}function f1(e,t,n,r,i){return K$(e,t,n,E$,I$(e,0,r),I$(e,r+1,-1),r,i)}function p1(e,t){for(var n=``,r=0;r<e.length;r++)n+=t(e[r],r,e,t)||``;return n}function m1(e,t,n,r){switch(e.type){case A$:if(e.children.length)break;case D$:case O$:case E$:return e.return=e.return||e.value;case w$:return``;case k$:return e.return=e.value+`{`+p1(e.children,r)+`}`;case T$:if(!L$(e.value=e.props.join(`,`)))return``}return L$(n=p1(e.children,r))?e.return=e.value+`{`+n+`}`:``}var h1=y(Object.keys,Object),g1=Object.prototype.hasOwnProperty;function _1(e){if(!x(e))return h1(e);var t=[];for(var n in Object(e))g1.call(e,n)&&n!=`constructor`&&t.push(n);return t}var v1=l(c,`DataView`),y1=l(c,`Promise`),b1=l(c,`Set`),x1=l(c,`WeakMap`),S1=`[object Map]`,C1=`[object Object]`,w1=`[object Promise]`,T1=`[object Set]`,E1=`[object WeakMap]`,D1=`[object DataView]`,O1=o(v1),k1=o(f),A1=o(y1),j1=o(b1),M1=o(x1),N1=s;(v1&&N1(new v1(new ArrayBuffer(1)))!=D1||f&&N1(new f)!=S1||y1&&N1(y1.resolve())!=w1||b1&&N1(new b1)!=T1||x1&&N1(new x1)!=E1)&&(N1=function(e){var t=s(e),n=t==C1?e.constructor:void 0,r=n?o(n):``;if(r)switch(r){case O1:return D1;case k1:return S1;case A1:return w1;case j1:return T1;case M1:return E1}return t});var P1=N1,F1=`[object Map]`,I1=`[object Set]`,L1=Object.prototype.hasOwnProperty;function R1(e){if(e==null)return!0;if(p(e)&&(T(e)||typeof e==`string`||typeof e.splice==`function`||C(e)||v(e)||m(e)))return!e.length;var t=P1(e);if(t==F1||t==I1)return!e.size;if(x(e))return!_1(e).length;for(var n in e)if(L1.call(e,n))return!1;return!0}var z1=`c4`,B1={id:z1,detector:W(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./c4Diagram-AHTNJAMY-BRGbLkKl.js`);return{diagram:e}},__vite__mapDeps([11,12]));return{id:z1,diagram:e}},`loader`)},V1=`flowchart`,H1={id:V1,detector:W((e,t)=>t?.flowchart?.defaultRenderer===`dagre-wrapper`||t?.flowchart?.defaultRenderer===`elk`?!1:/^\s*graph/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./flowDiagram-DWJPFMVM-CojOtGGR.js`);return{diagram:e}},__vite__mapDeps([13,14,15,16,17,12]));return{id:V1,diagram:e}},`loader`)},U1=`flowchart-v2`,W1={id:U1,detector:W((e,t)=>t?.flowchart?.defaultRenderer===`dagre-d3`?!1:(t?.flowchart?.defaultRenderer===`elk`&&(t.layout=`elk`),/^\s*graph/.test(e)&&t?.flowchart?.defaultRenderer===`dagre-wrapper`?!0:/^\s*flowchart/.test(e)),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./flowDiagram-DWJPFMVM-CojOtGGR.js`);return{diagram:e}},__vite__mapDeps([13,14,15,16,17,12]));return{id:U1,diagram:e}},`loader`)},G1=`er`,K1={id:G1,detector:W(e=>/^\s*erDiagram/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./erDiagram-SMLLAGMA-C0F2shsj.js`);return{diagram:e}},__vite__mapDeps([18,14,15,16]));return{id:G1,diagram:e}},`loader`)},q1=`gitGraph`,J1={id:q1,detector:W(e=>/^\s*gitGraph/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./gitGraphDiagram-UUTBAWPF-DcMqSrzm.js`);return{diagram:e}},__vite__mapDeps([19,20,21,1,6,5,7,22,23,24,25,26,27,28,29,30,31,32]));return{id:q1,diagram:e}},`loader`)},Y1=`gantt`,X1={id:Y1,detector:W(e=>/^\s*gantt/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./ganttDiagram-T4ZO3ILL-Ckrhb2jW.js`);return{diagram:e}},__vite__mapDeps([33,1,34,35,36]));return{id:Y1,diagram:e}},`loader`)},Z1=`info`,Q1={id:Z1,detector:W(e=>/^\s*info/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./infoDiagram-42DDH7IO-Bec012fF.js`);return{diagram:e}},__vite__mapDeps([37,20,21,1,6,5,7,22,23,24,25,26,27,28,29,30]));return{id:Z1,diagram:e}},`loader`)},$1=`pie`,e0={id:$1,detector:W(e=>/^\s*pie/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./pieDiagram-DEJITSTG-CFOdV-Od.js`);return{diagram:e}},__vite__mapDeps([38,20,21,1,6,5,7,22,23,24,25,26,27,28,29,30,39,40,36,41,42,31]));return{id:$1,diagram:e}},`loader`)},t0=`quadrantChart`,n0={id:t0,detector:W(e=>/^\s*quadrantChart/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./quadrantDiagram-34T5L4WZ-BqkfwC_k.js`);return{diagram:e}},__vite__mapDeps([43,34,35,36]));return{id:t0,diagram:e}},`loader`)},r0=`xychart`,i0={id:r0,detector:W(e=>/^\s*xychart(-beta)?/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./xychartDiagram-5P7HB3ND-DMLeR5iW.js`);return{diagram:e}},__vite__mapDeps([44,34,35,36,40]));return{id:r0,diagram:e}},`loader`)},a0=`requirement`,o0={id:a0,detector:W(e=>/^\s*requirement(Diagram)?/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./requirementDiagram-MS252O5E-DE2y_tGJ.js`);return{diagram:e}},__vite__mapDeps([45,15,16]));return{id:a0,diagram:e}},`loader`)},s0=`sequence`,c0={id:s0,detector:W(e=>/^\s*sequenceDiagram/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./sequenceDiagram-FGHM5R23-BvFb9l2D.js`);return{diagram:e}},__vite__mapDeps([46,32,12]));return{id:s0,diagram:e}},`loader`)},l0=`class`,u0={id:l0,detector:W((e,t)=>t?.class?.defaultRenderer===`dagre-wrapper`?!1:/^\s*classDiagram/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./classDiagram-6PBFFD2Q-hHHRH44v.js`);return{diagram:e}},__vite__mapDeps([47,48,15,16,17,12]));return{id:l0,diagram:e}},`loader`)},d0=`classDiagram`,f0={id:d0,detector:W((e,t)=>/^\s*classDiagram/.test(e)&&t?.class?.defaultRenderer===`dagre-wrapper`?!0:/^\s*classDiagram-v2/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./classDiagram-v2-HSJHXN6E-DVELpVSz.js`);return{diagram:e}},__vite__mapDeps([49,48,15,16,17,12]));return{id:d0,diagram:e}},`loader`)},p0=`state`,m0={id:p0,detector:W((e,t)=>t?.state?.defaultRenderer===`dagre-wrapper`?!1:/^\s*stateDiagram/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./stateDiagram-FHFEXIEX-CXoHchSk.js`);return{diagram:e}},__vite__mapDeps([50,3,4,5,6,7,15,16,51]));return{id:p0,diagram:e}},`loader`)},h0=`stateDiagram`,g0={id:h0,detector:W((e,t)=>!!(/^\s*stateDiagram-v2/.test(e)||/^\s*stateDiagram/.test(e)&&t?.state?.defaultRenderer===`dagre-wrapper`),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./stateDiagram-v2-QKLJ7IA2-BLHyyGW-.js`);return{diagram:e}},__vite__mapDeps([52,15,16,51]));return{id:h0,diagram:e}},`loader`)},_0=`journey`,v0={id:_0,detector:W(e=>/^\s*journey/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./journeyDiagram-VCZTEJTY-BaNNdz_C.js`);return{diagram:e}},__vite__mapDeps([53,41,39,17,12]));return{id:_0,diagram:e}},`loader`)},y0={draw:W((e,t,n)=>{G.debug(`rendering svg for syntax error
530
+ `);let r=aH(t),i=r.append(`g`);r.attr(`viewBox`,`0 0 2412 512`),bL(r,100,512,!0),i.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`),i.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`),i.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`),i.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`),i.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`),i.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`),i.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`),i.append(`text`).attr(`class`,`error-text`).attr(`x`,1250).attr(`y`,400).attr(`font-size`,`100px`).style(`text-anchor`,`middle`).text(`mermaid version ${n}`)},`draw`)},b0=y0,x0={db:{},renderer:y0,parser:{parse:W(()=>{},`parse`)}},S0=`flowchart-elk`,C0={id:S0,detector:W((e,t={})=>/^\s*flowchart-elk/.test(e)||/^\s*(flowchart|graph)/.test(e)&&t?.flowchart?.defaultRenderer===`elk`?(t.layout=`elk`,!0):!1,`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./flowDiagram-DWJPFMVM-CojOtGGR.js`);return{diagram:e}},__vite__mapDeps([13,14,15,16,17,12]));return{id:S0,diagram:e}},`loader`)},w0=`timeline`,T0={id:w0,detector:W(e=>/^\s*timeline/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./timeline-definition-GMOUNBTQ-C98Wdp1r.js`);return{diagram:e}},__vite__mapDeps([54,41,39]));return{id:w0,diagram:e}},`loader`)},E0=`mindmap`,D0={id:E0,detector:W(e=>/^\s*mindmap/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./mindmap-definition-QFDTVHPH-BesPvEwN.js`);return{diagram:e}},__vite__mapDeps([55,15,16]));return{id:E0,diagram:e}},`loader`)},O0=`kanban`,k0={id:O0,detector:W(e=>/^\s*kanban/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./kanban-definition-6JOO6SKY-CF8ekLbq.js`);return{diagram:e}},__vite__mapDeps([56,17]));return{id:O0,diagram:e}},`loader`)},A0=`sankey`,j0={id:A0,detector:W(e=>/^\s*sankey(-beta)?/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./sankeyDiagram-XADWPNL6-BlyRgjI6.js`);return{diagram:e}},__vite__mapDeps([57,40,36]));return{id:A0,diagram:e}},`loader`)},M0=`packet`,N0={id:M0,detector:W(e=>/^\s*packet(-beta)?/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./diagram-TYMM5635-Cw5eaPxt.js`);return{diagram:e}},__vite__mapDeps([58,20,21,1,6,5,7,22,23,24,25,26,27,28,29,30,31]));return{id:M0,diagram:e}},`loader`)},P0=`radar`,F0={id:P0,detector:W(e=>/^\s*radar-beta/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./diagram-MMDJMWI5-Aer2TE2o.js`);return{diagram:e}},__vite__mapDeps([59,20,21,1,6,5,7,22,23,24,25,26,27,28,29,30,31]));return{id:P0,diagram:e}},`loader`)},I0=`block`,L0={id:I0,detector:W(e=>/^\s*block(-beta)?/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./blockDiagram-DXYQGD6D-Ni-UtM9U.js`);return{diagram:e}},__vite__mapDeps([60,4,5,6,14,8,17]));return{id:I0,diagram:e}},`loader`)},R0=`treeView`,z0={id:R0,detector:W(e=>/^\s*treeView-beta/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./diagram-5BDNPKRD-BwHShOSK.js`);return{diagram:e}},__vite__mapDeps([61,20,21,1,6,5,7,22,23,24,25,26,27,28,29,30,31,32]));return{id:R0,diagram:e}},`loader`)},B0=`architecture`,V0={id:B0,detector:W(e=>/^\s*architecture/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./architectureDiagram-Q4EWVU46-DAs7Nxb1.js`);return{diagram:e}},__vite__mapDeps([62,1,20,21,6,5,7,22,23,24,25,26,27,28,29,30,10,31]));return{id:B0,diagram:e}},`loader`)},H0=`ishikawa`,U0={id:H0,detector:W(e=>/^\s*ishikawa(-beta)?\b/i.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./ishikawaDiagram-UXIWVN3A-DCxCTNWg.js`);return{diagram:e}},__vite__mapDeps([63,64]));return{id:H0,diagram:e}},`loader`)},W0=`venn`,Hie={id:W0,detector:W(e=>/^\s*venn-beta/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./vennDiagram-DHZGUBPP-C31SdZnU.js`);return{diagram:e}},__vite__mapDeps([65,64]));return{id:W0,diagram:e}},`loader`)},G0=`treemap`,K0={id:G0,detector:W(e=>/^\s*treemap/.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./diagram-G4DWMVQ6-D26Y-K60.js`);return{diagram:e}},__vite__mapDeps([66,20,21,1,6,5,7,22,23,24,25,26,27,28,29,30,35,40,36,31,16]));return{id:G0,diagram:e}},`loader`)},q0=`wardley-beta`,J0={id:q0,detector:W(e=>/^\s*wardley-beta/i.test(e),`detector`),loader:W(async()=>{let{diagram:e}=await PF(async()=>{let{diagram:e}=await import(`./wardleyDiagram-NUSXRM2D-BY9wpPZs.js`);return{diagram:e}},__vite__mapDeps([67,20,21,1,6,5,7,22,23,24,25,26,27,28,29,30,31]));return{id:q0,diagram:e}},`loader`)},Y0=!1,X0=W(()=>{Y0||(Y0=!0,qL(`error`,x0,e=>e.toLowerCase().trim()===`error`),qL(`---`,{db:{clear:W(()=>{},`clear`)},styles:{},renderer:{draw:W(()=>{},`draw`)},parser:{parse:W(()=>{throw 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:W(()=>null,`init`)},e=>e.toLowerCase().trimStart().startsWith(`---`)),VF(C0,D0,V0),VF(B1,k0,f0,u0,K1,X1,Q1,e0,o0,c0,W1,H1,T0,J1,g0,m0,v0,n0,j0,N0,i0,L0,z0,F0,U0,K0,Hie,J0))},`addDiagrams`),Z0=W(async()=>{G.debug(`Loading registered diagrams`);let e=(await Promise.allSettled(Object.entries(zF).map(async([e,{detector:t,loader:n}])=>{if(n)try{JL(e)}catch{try{let{diagram:e,id:r}=await n();qL(r,e,t)}catch(t){throw G.error(`Failed to load external diagram with key ${e}. Removing from detectors.`),delete zF[e],t}}}))).filter(e=>e.status===`rejected`);if(e.length>0){G.error(`Failed to load ${e.length} external diagrams`);for(let t of e)G.error(t);throw Error(`Failed to load ${e.length} external diagrams`)}},`loadRegisteredDiagrams`),Q0=`graphics-document document`;function $0(e,t){e.attr(`role`,Q0),t!==``&&e.attr(`aria-roledescription`,t)}W($0,`setA11yDiagramInfo`);function e2(e,t,n,r){if(e.insert!==void 0){if(n){let t=`chart-desc-${r}`;e.attr(`aria-describedby`,t),e.insert(`desc`,`:first-child`).attr(`id`,t).text(n)}if(t){let n=`chart-title-${r}`;e.attr(`aria-labelledby`,n),e.insert(`title`,`:first-child`).attr(`id`,n).text(t)}}}W(e2,`addSVGa11yTitleDescription`);var t2=class e{constructor(e,t,n,r,i){this.type=e,this.text=t,this.db=n,this.parser=r,this.renderer=i}static{W(this,`Diagram`)}static async fromText(t,n={}){let r=II(),i=BF(t,r);t=Aq(t)+`
531
531
  `;try{JL(i)}catch{let e=UF(i);if(!e)throw new RF(`Diagram ${i} not found.`);let{id:t,diagram:n}=await e();qL(t,n)}let{db:a,parser:o,renderer:s,init:c}=JL(i);return o.parser&&(o.parser.yy=a),a.clear?.(),c?.(r),n.title&&a.setDiagramTitle?.(n.title),await o.parse(t),new e(i,t,a,o,s)}async render(e,t){await this.renderer.draw(this.text,e,t,this)}getParser(){return this.parser}getType(){return this.type}},n2=[],r2=W(()=>{n2.forEach(e=>{e()}),n2=[]},`attachFunctions`),i2=W(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,``).trimStart(),`cleanupComments`);function a2(e){let t=e.match(FF);if(!t)return{text:e,metadata:{}};let n=WG(t[1],{schema:UG})??{};n=typeof n==`object`&&!Array.isArray(n)?n:{};let r={};return n.displayMode&&(r.displayMode=n.displayMode.toString()),n.title&&(r.title=n.title.toString()),n.config&&(r.config=n.config),{text:e.slice(t[0].length),metadata:r}}W(a2,`extractFrontMatter`);var o2=W(e=>e.replace(/\r\n?/g,`
532
532
  `).replace(/<(\w+)([^>]*)>/g,(e,t,n)=>`<`+t+n.replace(/="([^"]*)"/g,`='$1'`)+`>`),`cleanupText`),s2=W(e=>{let{text:t,metadata:n}=a2(e),{displayMode:r,title:i,config:a={}}=n;return r&&(a.gantt||={},a.gantt.displayMode=r),{title:i,config:a,text:t}},`processFrontmatter`),c2=W(e=>{let t=kq.detectInit(e)??{},n=kq.detectDirective(e,`wrap`);return Array.isArray(n)?t.wrap=n.some(({type:e})=>e===`wrap`):n?.type===`wrap`&&(t.wrap=!0),{text:QK(e),directive:t}},`processDirectives`);function l2(e){let t=s2(o2(e)),n=c2(t.text),r=Oq(t.config,n.directive);return e=i2(n.text),{code:e,title:t.title,config:r}}W(l2,`preprocessDiagram`);function u2(e){let t=new TextEncoder().encode(e),n=Array.from(t,e=>String.fromCodePoint(e)).join(``);return btoa(n)}W(u2,`toBase64`);var d2=5e4,f2=`graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa`,p2=`sandbox`,m2=`loose`,h2=`http://www.w3.org/2000/svg`,g2=`http://www.w3.org/1999/xlink`,_2=`http://www.w3.org/1999/xhtml`,v2=`100%`,y2=`100%`,b2=`border:0;margin:0;`,x2=`margin:0`,S2=`allow-top-navigation-by-user-activation allow-popups`,C2=`The "iframe" tag is not supported by your browser.`,w2=[`foreignobject`],T2=[`dominant-baseline`];function E2(e){let t=l2(e);return zI(),RI(t.config??{}),t}W(E2,`processAndSetConfigs`);async function D2(e,t){X0();try{let{code:t,config:n}=E2(e);return{diagramType:(await R2(t)).type,config:n}}catch(e){if(t?.suppressErrors)return!1;throw e}}W(D2,`parse`);var O2=W((e,t,n=[])=>`
533
533
  .${e} ${t} { ${n.join(` !important; `)} !important; }`,`cssImportantStyles`),k2=W((e,t=new Map)=>{let n=``;if(e.themeCSS!==void 0&&(n+=`
@@ -569,7 +569,7 @@ ${e.themeCSS}`),e.fontFamily!==void 0&&(n+=`
569
569
  `+e.slice(o+1):c+=e.slice(i),c.slice(1)}function Oae(e){for(var t=``,n=0,r,i=0;i<e.length;n>=65536?i+=2:i++)n=R6(e,i),r=A6[n],!r&&F6(n)?(t+=e[i],n>=65536&&(t+=e[i+1])):t+=r||yae(n);return t}function kae(e,t,n){var r=``,i=e.tag,a,o,s;for(a=0,o=n.length;a<o;a+=1)s=n[a],e.replacer&&(s=e.replacer.call(n,String(a),s)),(X6(e,t,s,!1,!1)||s===void 0&&X6(e,t,null,!1,!1))&&(r!==``&&(r+=`,`+(e.condenseFlow?``:` `)),r+=e.dump);e.tag=i,e.dump=`[`+r+`]`}function J6(e,t,n,r){var i=``,a=e.tag,o,s,c;for(o=0,s=n.length;o<s;o+=1)c=n[o],e.replacer&&(c=e.replacer.call(n,String(o),c)),(X6(e,t+1,c,!0,!0,!1,!0)||c===void 0&&X6(e,t+1,null,!0,!0,!1,!0))&&((!r||i!==``)&&(i+=N6(e,t)),e.dump&&S6===e.dump.charCodeAt(0)?i+=`-`:i+=`- `,i+=e.dump);e.tag=a,e.dump=i||`[]`}function Aae(e,t,n){var r=``,i=e.tag,a=Object.keys(n),o,s,c,l,u;for(o=0,s=a.length;o<s;o+=1)u=``,r!==``&&(u+=`, `),e.condenseFlow&&(u+=`"`),c=a[o],l=n[c],e.replacer&&(l=e.replacer.call(n,c,l)),X6(e,t,c,!1,!1)&&(e.dump.length>1024&&(u+=`? `),u+=e.dump+(e.condenseFlow?`"`:``)+`:`+(e.condenseFlow?``:` `),X6(e,t,l,!1,!1)&&(u+=e.dump,r+=u));e.tag=i,e.dump=`{`+r+`}`}function jae(e,t,n,r){var i=``,a=e.tag,o=Object.keys(n),s,c,l,u,d,f;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys==`function`)o.sort(e.sortKeys);else if(e.sortKeys)throw new v4(`sortKeys must be a boolean or a function`);for(s=0,c=o.length;s<c;s+=1)f=``,(!r||i!==``)&&(f+=N6(e,t)),l=o[s],u=n[l],e.replacer&&(u=e.replacer.call(n,l,u)),X6(e,t+1,l,!0,!0,!0)&&(d=e.tag!==null&&e.tag!==`?`||e.dump&&e.dump.length>1024,d&&(e.dump&&S6===e.dump.charCodeAt(0)?f+=`?`:f+=`? `),f+=e.dump,d&&(f+=N6(e,t)),X6(e,t+1,u,!0,d)&&(e.dump&&S6===e.dump.charCodeAt(0)?f+=`:`:f+=`: `,f+=e.dump,i+=f));e.tag=a,e.dump=i||`{}`}function Y6(e,t,n){var r,i=n?e.explicitTypes:e.implicitTypes,a,o,s,c;for(a=0,o=i.length;a<o;a+=1)if(s=i[a],(s.instanceOf||s.predicate)&&(!s.instanceOf||typeof t==`object`&&t instanceof s.instanceOf)&&(!s.predicate||s.predicate(t))){if(n?s.multi&&s.representName?e.tag=s.representName(t):e.tag=s.tag:e.tag=`?`,s.represent){if(c=e.styleMap[s.tag]||s.defaultStyle,y6.call(s.represent)===`[object Function]`)r=s.represent(t,c);else if(b6.call(s.represent,c))r=s.represent[c](t,c);else throw new v4(`!<`+s.tag+`> tag resolver accepts not "`+c+`" style`);e.dump=r}return!0}return!1}function X6(e,t,n,r,i,a,o){e.tag=null,e.dump=n,Y6(e,n,!1)||Y6(e,n,!0);var s=y6.call(e.dump),c=r,l;r&&=e.flowLevel<0||e.flowLevel>t;var u=s===`[object Object]`||s===`[object Array]`,d,f;if(u&&(d=e.duplicates.indexOf(n),f=d!==-1),(e.tag!==null&&e.tag!==`?`||f||e.indent!==2&&t>0)&&(i=!1),f&&e.usedDuplicates[d])e.dump=`*ref_`+d;else{if(u&&f&&!e.usedDuplicates[d]&&(e.usedDuplicates[d]=!0),s===`[object Object]`)r&&Object.keys(e.dump).length!==0?(jae(e,t,e.dump,i),f&&(e.dump=`&ref_`+d+e.dump)):(Aae(e,t,e.dump),f&&(e.dump=`&ref_`+d+` `+e.dump));else if(s===`[object Array]`)r&&e.dump.length!==0?(e.noArrayIndent&&!o&&t>0?J6(e,t-1,e.dump,i):J6(e,t,e.dump,i),f&&(e.dump=`&ref_`+d+e.dump)):(kae(e,t,e.dump),f&&(e.dump=`&ref_`+d+` `+e.dump));else if(s===`[object String]`)e.tag!==`?`&&Eae(e,e.dump,t,a,c);else if(s===`[object Undefined]`)return!1;else{if(e.skipInvalid)return!1;throw new v4(`unacceptable kind of an object to dump `+s)}e.tag!==null&&e.tag!==`?`&&(l=encodeURI(e.tag[0]===`!`?e.tag.slice(1):e.tag).replace(/!/g,`%21`),l=e.tag[0]===`!`?`!`+l:l.slice(0,18)===`tag:yaml.org,2002:`?`!!`+l.slice(18):`!<`+l+`>`,e.dump=l+` `+e.dump)}return!0}function Mae(e,t){var n=[],r=[],i,a;for(Z6(e,n,r),i=0,a=r.length;i<a;i+=1)t.duplicates.push(n[r[i]]);t.usedDuplicates=Array(a)}function Z6(e,t,n){var r,i,a;if(typeof e==`object`&&e)if(i=t.indexOf(e),i!==-1)n.indexOf(i)===-1&&n.push(i);else if(t.push(e),Array.isArray(e))for(i=0,a=e.length;i<a;i+=1)Z6(e[i],t,n);else for(r=Object.keys(e),i=0,a=r.length;i<a;i+=1)Z6(e[r[i]],t,n)}function Nae(e,t){t||={};var n=new xae(t);n.noRefs||Mae(e,n);var r=e;return n.replacer&&(r=n.replacer.call({"":r},``,r)),X6(n,0,r,!0,!0)?n.dump+`
570
570
  `:``}var Pae={dump:Nae},Fae=v6.load;v6.loadAll;var Iae=Pae.dump;function Lae(e){return Object.entries(e).map(([e,t])=>({key:e,value:t instanceof Date?t.toISOString().split(`T`)[0]:Array.isArray(t)?t.map(e=>String(e??``)).join(`, `):typeof t==`object`&&t?JSON.stringify(t):String(t??``)}))}function Rae(e){let t={};for(let n of e)n.key&&(t[n.key]=n.value);return t}function zae(e){try{let t=Fae(e);if(typeof t==`object`&&t)return t}catch{}return{}}function Bae({rawFrontmatter:e,onFrontmatterChange:t}){let[n,r]=(0,F.useState)([]);(0,F.useEffect)(()=>{if(!e){r([]);return}r(Lae(zae(e)))},[e]);let i=(0,F.useCallback)(e=>{let n=Rae(e);Object.keys(n).length>0?t(Iae(n,{lineWidth:-1}).trim()):t(null)},[t]),a=(0,F.useCallback)((e,t)=>{r(n=>{let r=n.map((n,r)=>r===e?{...n,key:t}:n);return i(r),r})},[i]),o=(0,F.useCallback)((e,t)=>{r(n=>{let r=n.map((n,r)=>r===e?{...n,value:t}:n);return i(r),r})},[i]),s=(0,F.useCallback)(()=>{r(e=>{let t=[...e,{key:``,value:``}];return i(t),t})},[i]),c=(0,F.useCallback)(e=>{r(t=>{let n=t.filter((t,n)=>n!==e);return i(n),n})},[i]);return n.length===0?null:(0,z.jsxs)(`div`,{className:`frontmatter-panel`,children:[(0,z.jsx)(`div`,{className:`frontmatter-panel-header`,children:`Metadata`}),(0,z.jsx)(`div`,{className:`frontmatter-fields`,children:n.map((e,t)=>(0,z.jsxs)(`div`,{className:`frontmatter-field`,children:[(0,z.jsx)(`input`,{className:`frontmatter-key-input`,value:e.key,onChange:e=>a(t,e.target.value),placeholder:`key`}),(0,z.jsx)(`span`,{className:`frontmatter-separator`,children:`:`}),(0,z.jsx)(`input`,{className:`frontmatter-value-input`,value:e.value,onChange:e=>o(t,e.target.value),placeholder:`value`}),(0,z.jsx)(`button`,{className:`frontmatter-remove-btn`,onClick:()=>c(t),title:`删除字段`,children:(0,z.jsx)(Je,{className:`size-3.5`})})]},t))}),(0,z.jsxs)(`button`,{className:`frontmatter-add-btn`,onClick:s,children:[(0,z.jsx)(Ve,{className:`size-3.5`}),`添加字段`]})]})}var Vae=/^---\r?\n([\s\S]*?)\r?\n---\r?\n?/;function Q6(e){let t=e.match(Vae);return t?{frontmatter:t[1].trim(),body:e.slice(t[0].length)}:{frontmatter:null,body:e}}function $6(e){return e.replace(/&/g,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`)}function e8(e){let t=[],n=[],r=e.replace(/```[\s\S]*?```/g,e=>(t.push(e),`\0CODEBLOCK${t.length-1}\0`));return r=r.replace(/`[^`]+`/g,e=>(n.push(e),`\0INLINECODE${n.length-1}\0`)),r=r.replace(/^\$\$([\s\S]*?)\$\$$/gm,(e,t)=>`<div data-type="mathBlock" data-latex="${$6(t.trim())}"></div>`),r=r.replace(/(?<!\$)\$([^$\n]+?)\$(?!\$)/g,(e,t)=>`<span data-type="mathInline" data-latex="${$6(t.trim())}"></span>`),r=r.replace(/\0CODEBLOCK(\d+)\0/g,(e,n)=>t[+n]),r=r.replace(/\0INLINECODE(\d+)\0/g,(e,t)=>n[+t]),r}var Hae=Sy.create({name:`mathInline`,group:`inline`,inline:!0,atom:!0,addAttributes(){return{latex:{default:``,parseHTML:e=>e.getAttribute(`data-latex`)||``,renderHTML:e=>e.latex?{"data-latex":e.latex}:{}}}},parseHTML(){return[{tag:`span[data-type="mathInline"]`,getAttrs:e=>({latex:e.getAttribute(`data-latex`)||``})}]},renderHTML({node:e,HTMLAttributes:t}){return[`span`,Y_({"data-type":`mathInline`},t),e.attrs.latex||``]},addNodeView(){return({node:e})=>{let t=document.createElement(`span`);t.className=`math-inline`,t.contentEditable=`false`;let n=e=>{if(e)try{A.render(e,t,{throwOnError:!1,displayMode:!1}),t.classList.remove(`math-error`)}catch{t.textContent=`$${e}$`,t.classList.add(`math-error`)}else t.textContent=`$$`};return n(e.attrs.latex),{dom:t,update:e=>e.type.name===`mathInline`?(n(e.attrs.latex),!0):!1}}},addStorage(){return{markdown:{serialize(e,t){e.write(`$${t.attrs.latex}$`)}}}}}),Uae=Sy.create({name:`mathBlock`,group:`block`,atom:!0,addAttributes(){return{latex:{default:``,parseHTML:e=>e.getAttribute(`data-latex`)||``,renderHTML:e=>e.latex?{"data-latex":e.latex}:{}}}},parseHTML(){return[{tag:`div[data-type="mathBlock"]`,getAttrs:e=>({latex:e.getAttribute(`data-latex`)||``})}]},renderHTML({node:e,HTMLAttributes:t}){return[`div`,Y_({"data-type":`mathBlock`},t),e.attrs.latex||``]},addNodeView(){return({node:e})=>{let t=document.createElement(`div`);t.className=`math-block`,t.contentEditable=`false`;let n=e=>{if(e)try{A.render(e,t,{throwOnError:!1,displayMode:!0}),t.classList.remove(`math-error`)}catch{t.textContent=`$$${e}$$`,t.classList.add(`math-error`)}else t.textContent=`$$$$`};return n(e.attrs.latex),{dom:t,update:e=>e.type.name===`mathBlock`?(n(e.attrs.latex),!0):!1}}},addStorage(){return{markdown:{serialize(e,t){e.write(`$$
571
571
  `),e.write(t.attrs.latex),e.write(`
572
- $$`),e.closeBlock(t)}}}}}),t8=class e{static instance=null;queue=[];running=new Set;cache=new Map;MAX_CONCURRENT=2;MAX_CACHE_SIZE=50;static getInstance(){return e.instance||=new e,e.instance}request(e,t,n,r){let i=this.getCacheKey(t,n),a=this.cache.get(i);if(a){r(a);return}this.cancel(e),this.queue.push({id:e,source:t,theme:n,callback:r}),this.processQueue()}cancel(e){let t=this.queue.findIndex(t=>t.id===e);t!==-1&&this.queue.splice(t,1),this.running.delete(e)}getCacheKey(e,t){return`${t}::${e}`}getFromCache(e,t){let n=this.getCacheKey(e,t),r=this.cache.get(n);return r?(this.cache.delete(n),this.cache.set(n,r),r):null}setCache(e,t,n){let r=this.getCacheKey(e,t);for(this.cache.has(r)&&this.cache.delete(r);this.cache.size>=this.MAX_CACHE_SIZE;){let e=this.cache.keys().next().value;e!==void 0&&this.cache.delete(e)}this.cache.set(r,n)}processQueue(){if(this.running.size>=this.MAX_CONCURRENT||this.queue.length===0)return;let e=this.queue.shift();e&&(this.running.add(e.id),this.runRender(e))}async runRender(e){let t=this.getFromCache(e.source,e.theme);if(t){this.running.has(e.id)&&(this.running.delete(e.id),e.callback(t)),this.processQueue();return}try{t4.initialize({startOnLoad:!1,theme:e.theme,suppressErrorRendering:!0});let t=`mermaid-queued-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,{svg:n}=await t4.render(t,e.source),r={svg:n,error:``};this.setCache(e.source,e.theme,r),this.running.has(e.id)&&(this.running.delete(e.id),e.callback(r))}catch(t){let n={svg:``,error:t.message||`Mermaid render error`};this.setCache(e.source,e.theme,n),this.running.has(e.id)&&(this.running.delete(e.id),e.callback(n))}finally{this.processQueue()}}}.getInstance(),Wae=KN(UN);function Gae(e,t){let n=t.substring(0,t.lastIndexOf(`/`)),r=e;if(e.startsWith(`./`))r=n+e.slice(1);else if(e.startsWith(`../`)){let t=n,i=e.slice(3);for(;i.startsWith(`../`);){let e=t.lastIndexOf(`/`);if(e<=0)break;t=t.substring(0,e),i=i.slice(3)}r=i.startsWith(`../`)?e:t+`/`+i}else e.startsWith(`/`)||(r=n+`/`+e);return decodeURIComponent(r)}function Kae(e,t,n){if(e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`data:`)||!t||!n)return e;let r;return r=e.startsWith(`/`)?e:Gae(e,t),`/api/files${r}?root=${encodeURIComponent(n)}`}var n8={path:null,rootPath:null};function qae({node:e,updateAttributes:t,selected:n,editor:r,getPos:i}){let a=e.attrs.language===`mermaid`,[o,s]=(0,F.useState)(``),[c,l]=(0,F.useState)(``),[u,d]=(0,F.useState)(!1),[f,p]=(0,F.useState)(0),[m,h]=(0,F.useState)(!1),[g,_]=(0,F.useState)(!1),[v,y]=(0,F.useState)(!1),b=(0,F.useRef)(null),x=(0,F.useRef)(`mermaid-${Date.now()}-${Math.random().toString(36).substr(2,9)}`),S=(0,F.useCallback)(async()=>{let t=e.textContent;if(t){if(navigator.clipboard?.writeText)await navigator.clipboard.writeText(t);else{let e=document.createElement(`textarea`);e.value=t,e.style.position=`fixed`,e.style.opacity=`0`,document.body.appendChild(e),e.select(),document.execCommand(`copy`),document.body.removeChild(e)}h(!0),setTimeout(()=>h(!1),1500)}},[e.textContent]),C=e.textContent;return(0,F.useEffect)(()=>{let e=()=>{p(e=>e+1)};return window.addEventListener(`theme-change`,e),()=>window.removeEventListener(`theme-change`,e)},[]),(0,F.useEffect)(()=>{if(!a)return;let e=b.current;if(!e)return;let t=new IntersectionObserver(([e])=>{_(e.isIntersecting)},{rootMargin:`200px`});return t.observe(e),()=>t.disconnect()},[a]),(0,F.useEffect)(()=>{if(!a){s(``),l(``),y(!1);return}if(!C){s(``),l(``),y(!1);return}if(!g){o||y(!1);return}let e=document.documentElement.classList.contains(`dark`)?`dark`:`default`;return y(!0),x.current=`mermaid-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,t8.request(x.current,C,e,e=>{s(e.svg),l(e.error),y(!1)}),()=>{t8.cancel(x.current)}},[a,C,g,f]),(0,z.jsxs)(jb,{className:`code-block-wrapper ${n?`selected`:``}`,children:[(0,z.jsxs)(`div`,{className:`code-block-header`,children:[(0,z.jsxs)(`select`,{contentEditable:!1,value:e.attrs.language||``,onChange:e=>t({language:e.target.value}),children:[(0,z.jsx)(`option`,{value:``,children:`Plain Text`}),(0,z.jsx)(`option`,{value:`mermaid`,children:`Mermaid`}),(0,z.jsx)(`option`,{value:`javascript`,children:`JavaScript`}),(0,z.jsx)(`option`,{value:`typescript`,children:`TypeScript`}),(0,z.jsx)(`option`,{value:`html`,children:`HTML`}),(0,z.jsx)(`option`,{value:`css`,children:`CSS`}),(0,z.jsx)(`option`,{value:`python`,children:`Python`}),(0,z.jsx)(`option`,{value:`java`,children:`Java`}),(0,z.jsx)(`option`,{value:`cpp`,children:`C++`}),(0,z.jsx)(`option`,{value:`go`,children:`Go`}),(0,z.jsx)(`option`,{value:`rust`,children:`Rust`}),(0,z.jsx)(`option`,{value:`json`,children:`JSON`}),(0,z.jsx)(`option`,{value:`markdown`,children:`Markdown`}),(0,z.jsx)(`option`,{value:`bash`,children:`Bash`})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,z.jsx)(`button`,{className:`code-block-copy-btn`,contentEditable:!1,onClick:S,title:m?`已复制`:`复制代码`,children:m?(0,z.jsx)(me,{className:`size-4`}):(0,z.jsx)(be,{className:`size-4`})}),a&&(0,z.jsx)(`button`,{className:`mermaid-fullscreen-btn`,contentEditable:!1,onClick:()=>d(!0),title:`全屏预览`,children:(0,z.jsx)(Fe,{className:`size-4`})})]})]}),a?(0,z.jsx)(`div`,{ref:b,className:`mermaid-preview`,contentEditable:!1,children:c?(0,z.jsxs)(`div`,{className:`mermaid-error`,children:[`Mermaid Error: `,c]}):o?(0,z.jsx)(`div`,{className:`mermaid-svg-container`,dangerouslySetInnerHTML:{__html:o}}):v?(0,z.jsx)(`div`,{className:`mermaid-loading`,children:`渲染中...`}):(0,z.jsx)(`div`,{className:`mermaid-placeholder`,children:`滚动查看图表`})}):(0,z.jsx)(`pre`,{className:`code-block`,children:(0,z.jsx)(`code`,{children:(0,z.jsx)(Ab,{})})}),a&&(0,z.jsx)(i4,{source:C,open:u,onOpenChange:e=>d(e),onSourceChange:e=>{let t=typeof i==`function`?i():i;t!=null&&r.commands.command(({tr:n})=>{let r=t+1,i=r+e.length;return n.replaceWith(r,i,n.doc.type.schema.text(e)),!0})}})]})}var Jae=jw.extend({addNodeView(){return zb(qae)}}).configure({lowlight:Wae});function Yae({value:e,onChange:t,mode:n,placeholder:r,readOnly:i,path:a,rootPath:o,scrollPosition:s,onLinkClick:c}){n8.path=a??null,n8.rootPath=o??null;let l=(0,F.useRef)(!1),u=(0,F.useRef)(e),d=(0,F.useRef)(0),f=(0,F.useRef)(null),[p,m]=(0,F.useState)(()=>typeof window>`u`?!1:window.innerWidth<768),{frontmatter:h,body:g}=Q6(e),_=e8(g),[v,y]=(0,F.useState)(h);f.current=v;let b=(0,F.useRef)(null);(0,F.useEffect)(()=>{y(h)},[h]);let x=(0,F.useCallback)(e=>{y(e),f.current=e;let n=b.current;if(n)try{let r=n.storage.markdown,i=r&&typeof r.getMarkdown==`function`?r.getMarkdown():n.getText(),a=i;e&&(a=`---\n${e}\n---\n${i}`),a!==u.current&&(u.current=a,t(a))}catch(e){console.error(`Failed to rebuild content with frontmatter:`,e)}},[t]);(0,F.useEffect)(()=>{let e=()=>m(window.innerWidth<768);return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]);let S=Eb({extensions:[Cw.configure({codeBlock:!1,link:!1,underline:!1}),Jae,Mw.configure({placeholder:r||`在这里输入 Markdown...`}),ak.configure({html:!0,transformPastedText:!0,transformCopiedText:!0}),uj.configure({resizable:!0}),ZA,XA,YA,JC,qC.configure({nested:!0}),xC.configure({openOnClick:!1}),fj.extend({addAttributes(){return{...this.parent?.(),style:{default:null},class:{default:null},htmlAttrs:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?`img[src]`:`img[src]:not([src^="data:"])`,getAttrs:e=>{let t=e,n=[`src`,`alt`,`title`,`width`,`height`,`style`,`class`,`htmlAttrs`,`draggable`],r={};for(let e of t.attributes)n.includes(e.name)||(r[e.name]=e.value);return{src:t.getAttribute(`src`),alt:t.getAttribute(`alt`),title:t.getAttribute(`title`),width:t.getAttribute(`width`),height:t.getAttribute(`height`),style:t.getAttribute(`style`),class:t.getAttribute(`class`),htmlAttrs:Object.keys(r).length>0?JSON.stringify(r):null}}}]},addStorage(){return{markdown:{serialize(e,t){if(t.attrs.width||t.attrs.height||t.attrs.style||t.attrs.class||t.attrs.htmlAttrs){let n={src:t.attrs.src};if(t.attrs.alt&&(n.alt=t.attrs.alt),t.attrs.title&&(n.title=t.attrs.title),t.attrs.width&&(n.width=String(t.attrs.width)),t.attrs.height&&(n.height=String(t.attrs.height)),t.attrs.style&&(n.style=t.attrs.style),t.attrs.class&&(n.class=t.attrs.class),t.attrs.htmlAttrs)try{let e=JSON.parse(t.attrs.htmlAttrs);Object.assign(n,e)}catch{}let r=Object.entries(n).map(([e,t])=>`${e}="${t.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`)}"`).join(` `);e.write(`<img ${r}>`)}else{let n=e.esc(t.attrs.alt||``),r=e.esc(t.attrs.src||``),i=t.attrs.title?` "${e.esc(t.attrs.title)}"`:``;e.write(`![${n}](${r}${i})`)}e.closeBlock(t)}}}},addNodeView(){return({node:e})=>{let t=document.createElement(`img`),n=(n=e)=>{t.src=Kae(n.attrs.src,n8.path,n8.rootPath),n.attrs.alt?t.alt=n.attrs.alt:t.removeAttribute(`alt`),n.attrs.title?t.title=n.attrs.title:t.removeAttribute(`title`),n.attrs.width?t.setAttribute(`width`,String(n.attrs.width)):t.removeAttribute(`width`),n.attrs.height?t.setAttribute(`height`,String(n.attrs.height)):t.removeAttribute(`height`),t.className=n.attrs.class||``,t.style.cssText=n.attrs.style||``;let r=[`src`,`alt`,`title`,`width`,`height`,`style`,`class`,`contenteditable`,`draggable`];for(let e of Array.from(t.attributes))r.includes(e.name)||t.removeAttribute(e.name);if(n.attrs.htmlAttrs)try{let e=JSON.parse(n.attrs.htmlAttrs);for(let[n,r]of Object.entries(e))r!=null&&t.setAttribute(n,String(r))}catch{}};return n(),{dom:t,update:e=>e.type.name===`image`?(n(e),!0):!1}}}}).configure({allowBase64:!0}),hj.configure({multicolor:!0}),ZC,Rj,Hae,Uae],content:_,editable:!i&&n===`wysiwyg`,onUpdate:({editor:e})=>{if(!l.current)try{let n=e.storage.markdown,r=n&&typeof n.getMarkdown==`function`?n.getMarkdown():e.getText(),i=f.current,a=r;i&&(a=`---\n${i}\n---\n${r}`),a!==u.current&&(u.current=a,t(a))}catch(n){console.error(`Failed to get markdown:`,n);let r=e.getText();r!==u.current&&(u.current=r,t(r))}}});return b.current=S,(0,F.useEffect)(()=>{S&&S.view.updateState(S.state)},[a,o,S]),(0,F.useEffect)(()=>{if(!S||l.current)return;let{frontmatter:t,body:n}=Q6(e);f.current=t;let r=e8(n),i=``;try{let e=S.storage.markdown;i=e&&typeof e.getMarkdown==`function`?e.getMarkdown():S.getText()}catch{i=S.getText()}if(i===n){u.current=e;return}let{from:a,to:o}=S.state.selection;l.current=!0,S.commands.setContent(r),u.current=e,requestAnimationFrame(()=>{l.current=!1;try{let e=S.state.doc.content.size,t=Math.min(a,e),n=Math.min(o,e);t>=0&&n>=0&&S.commands.setTextSelection({from:t,to:n})}catch{S.commands.setTextSelection({from:0,to:0})}})},[S,e]),(0,F.useEffect)(()=>{S&&S.setEditable(!i&&n===`wysiwyg`)},[S,i,n]),(0,F.useEffect)(()=>{if(!a||!c)return;let e=e=>{let t=e.target.closest(`a`);if(!t)return;let n=document.querySelector(`.tiptap-editor`);if(!n||!n.contains(t))return;e.preventDefault(),e.stopPropagation();let r=t.getAttribute(`href`);if(!r)return;if(r.startsWith(`http://`)||r.startsWith(`https://`)||r.startsWith(`mailto:`)||r.startsWith(`#`)){window.open(r,`_blank`,`noopener,noreferrer`);return}let i=a.substring(0,a.lastIndexOf(`/`)),o=r;if(r.startsWith(`./`))o=i+r.slice(1);else if(r.startsWith(`../`)){let e=i,t=r.slice(3);for(;t.startsWith(`../`);){let n=e.lastIndexOf(`/`);if(n<=0)break;e=e.substring(0,n),t=t.slice(3)}o=t.startsWith(`../`)?r:e+`/`+t}else r.startsWith(`/`)||(o=i+`/`+r);o=decodeURIComponent(o),c(o)};return document.addEventListener(`click`,e,!0),()=>document.removeEventListener(`click`,e,!0)},[a,c]),(0,F.useEffect)(()=>{if(n===`source`){let e=document.querySelector(`.editor-textarea`);if(e){let t=d.current||s||0;t>0&&requestAnimationFrame(()=>{e.scrollTop=t})}}else if(n===`wysiwyg`){let e=document.querySelector(`.editor-textarea`);e&&(d.current=e.scrollTop);let t=d.current||s||0;if(t>0){let e=document.querySelector(`.tiptap-editor`);e&&requestAnimationFrame(()=>{e.scrollTop=t})}}},[n,s]),n===`source`?(0,z.jsx)(`textarea`,{className:`editor-textarea`,value:e,onChange:e=>t(e.target.value),placeholder:r||`在这里输入 Markdown...`,readOnly:i,spellCheck:!1}):(0,z.jsxs)(`div`,{className:`tiptap-editor-root tiptap-editor`,children:[(0,z.jsx)(`div`,{className:`tiptap-editor-toolbar-area`,children:n===`wysiwyg`&&!p&&(0,z.jsx)(c4,{editor:S,variant:`desktop`})}),(0,z.jsxs)(`div`,{className:`tiptap-editor-scroll-area`,children:[(0,z.jsx)(Bae,{rawFrontmatter:v,onFrontmatterChange:x}),(0,z.jsx)(vb,{editor:S,className:`tiptap-editor-content`})]}),p&&n===`wysiwyg`&&(0,z.jsx)(c4,{editor:S,variant:`mobile`})]})}function r8(e){let t=e+`CollectionProvider`,[n,r]=yr(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=F.useRef(null),a=F.useRef(new Map).current;return(0,z.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=Dr(s),l=F.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,z.jsx)(c,{ref:er(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=Dr(u),p=F.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=F.useRef(null),s=er(t,o),c=a(u,n);return F.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,z.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return F.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:l,ItemSlot:p},m,r]}var Xae=F.createContext(void 0);function i8(e){let t=F.useContext(Xae);return e||t||`ltr`}var Zae=[`top`,`right`,`bottom`,`left`],a8=Math.min,o8=Math.max,s8=Math.round,c8=Math.floor,l8=e=>({x:e,y:e}),Qae={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function u8(e,t,n){return o8(e,a8(t,n))}function d8(e,t){return typeof e==`function`?e(t):e}function f8(e){return e.split(`-`)[0]}function p8(e){return e.split(`-`)[1]}function m8(e){return e===`x`?`y`:`x`}function h8(e){return e===`y`?`height`:`width`}function g8(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function _8(e){return m8(g8(e))}function $ae(e,t,n){n===void 0&&(n=!1);let r=p8(e),i=_8(e),a=h8(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=x8(o)),[o,x8(o)]}function eoe(e){let t=x8(e);return[v8(e),t,v8(t)]}function v8(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var y8=[`left`,`right`],b8=[`right`,`left`],toe=[`top`,`bottom`],noe=[`bottom`,`top`];function roe(e,t,n){switch(e){case`top`:case`bottom`:return n?t?b8:y8:t?y8:b8;case`left`:case`right`:return t?toe:noe;default:return[]}}function ioe(e,t,n,r){let i=p8(e),a=roe(f8(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(v8)))),a}function x8(e){let t=f8(e);return Qae[t]+e.slice(t.length)}function aoe(e){return{top:0,right:0,bottom:0,left:0,...e}}function S8(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:aoe(e)}function C8(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function w8(e,t,n){let{reference:r,floating:i}=e,a=g8(t),o=_8(t),s=h8(o),c=f8(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(p8(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function ooe(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=d8(t,e),p=S8(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=C8(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=C8(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var soe=50,coe=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:ooe},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=w8(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<soe&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=w8(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},loe=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=d8(e,t)||{};if(l==null)return{};let d=S8(u),f={x:n,y:r},p=_8(i),m=h8(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=a8(d[_],T),D=a8(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,ee=u8(O,A,k),j=!c.arrow&&p8(i)!=null&&A!==ee&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,te=j?A<O?A-O:A-k:0;return{[p]:f[p]+te,data:{[p]:ee,centerOffset:A-ee-te,...j&&{alignmentOffset:te}},reset:j}}}),uoe=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=d8(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=f8(r),_=g8(o),v=f8(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[x8(o)]:eoe(o)),x=p!==`none`;!d&&x&&b.push(...ioe(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=$ae(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==g8(t))||T.every(e=>g8(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=g8(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function T8(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function E8(e){return Zae.some(t=>e[t]>=0)}var doe=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=d8(e,t);switch(i){case`referenceHidden`:{let e=T8(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:E8(e)}}}case`escaped`:{let e=T8(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:E8(e)}}}default:return{}}}}},D8=new Set([`left`,`top`]);async function foe(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=f8(n),s=p8(n),c=g8(n)===`y`,l=D8.has(o)?-1:1,u=a&&c?-1:1,d=d8(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var poe=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await foe(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},moe=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=d8(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=g8(f8(i)),p=m8(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=u8(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=u8(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},hoe=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=d8(e,t),u={x:n,y:r},d=g8(i),f=m8(d),p=u[f],m=u[d],h=d8(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=D8.has(f8(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},goe=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=d8(e,t),u=await o.detectOverflow(t,l),d=f8(i),f=p8(i),p=g8(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=a8(h-u[g],v),x=a8(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=o8(u.left,0),t=o8(u.right,0),n=o8(u.top,0),r=o8(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:o8(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:o8(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function O8(){return typeof window<`u`}function k8(e){return M8(e)?(e.nodeName||``).toLowerCase():`#document`}function A8(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function j8(e){return((M8(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function M8(e){return O8()?e instanceof Node||e instanceof A8(e).Node:!1}function N8(e){return O8()?e instanceof Element||e instanceof A8(e).Element:!1}function P8(e){return O8()?e instanceof HTMLElement||e instanceof A8(e).HTMLElement:!1}function F8(e){return!O8()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof A8(e).ShadowRoot}function I8(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=U8(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function _oe(e){return/^(table|td|th)$/.test(k8(e))}function L8(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var voe=/transform|translate|scale|rotate|perspective|filter/,yoe=/paint|layout|strict|content/,R8=e=>!!e&&e!==`none`,z8;function B8(e){let t=N8(e)?U8(e):e;return R8(t.transform)||R8(t.translate)||R8(t.scale)||R8(t.rotate)||R8(t.perspective)||!V8()&&(R8(t.backdropFilter)||R8(t.filter))||voe.test(t.willChange||``)||yoe.test(t.contain||``)}function boe(e){let t=G8(e);for(;P8(t)&&!H8(t);){if(B8(t))return t;if(L8(t))return null;t=G8(t)}return null}function V8(){return z8??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),z8}function H8(e){return/^(html|body|#document)$/.test(k8(e))}function U8(e){return A8(e).getComputedStyle(e)}function W8(e){return N8(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function G8(e){if(k8(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||F8(e)&&e.host||j8(e);return F8(t)?t.host:t}function K8(e){let t=G8(e);return H8(t)?e.ownerDocument?e.ownerDocument.body:e.body:P8(t)&&I8(t)?t:K8(t)}function q8(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=K8(e),i=r===e.ownerDocument?.body,a=A8(r);if(i){let e=J8(a);return t.concat(a,a.visualViewport||[],I8(r)?r:[],e&&n?q8(e):[])}else return t.concat(r,q8(r,[],n))}function J8(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Y8(e){let t=U8(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=P8(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=s8(n)!==a||s8(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function X8(e){return N8(e)?e:e.contextElement}function Z8(e){let t=X8(e);if(!P8(t))return l8(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Y8(t),o=(a?s8(n.width):n.width)/r,s=(a?s8(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var xoe=l8(0);function Q8(e){let t=A8(e);return!V8()||!t.visualViewport?xoe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Soe(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==A8(e)?!1:t}function $8(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=X8(e),o=l8(1);t&&(r?N8(r)&&(o=Z8(r)):o=Z8(e));let s=Soe(a,n,r)?Q8(a):l8(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=A8(a),t=r&&N8(r)?A8(r):r,n=e,i=J8(n);for(;i&&r&&t!==n;){let e=Z8(i),t=i.getBoundingClientRect(),r=U8(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=A8(i),i=J8(n)}}return C8({width:u,height:d,x:c,y:l})}function e5(e,t){let n=W8(e).scrollLeft;return t?t.left+n:$8(j8(e)).left+n}function t5(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-e5(e,n),y:n.top+t.scrollTop}}function Coe(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=j8(r),s=t?L8(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=l8(1),u=l8(0),d=P8(r);if((d||!d&&!a)&&((k8(r)!==`body`||I8(o))&&(c=W8(r)),d)){let e=$8(r);l=Z8(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?t5(o,c):l8(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function woe(e){return Array.from(e.getClientRects())}function Toe(e){let t=j8(e),n=W8(e),r=e.ownerDocument.body,i=o8(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=o8(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+e5(e),s=-n.scrollTop;return U8(r).direction===`rtl`&&(o+=o8(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var n5=25;function Eoe(e,t){let n=A8(e),r=j8(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=V8();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=e5(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=n5&&(a-=o)}else l<=n5&&(a+=l);return{width:a,height:o,x:s,y:c}}function Doe(e,t){let n=$8(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=P8(e)?Z8(e):l8(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function r5(e,t,n){let r;if(t===`viewport`)r=Eoe(e,n);else if(t===`document`)r=Toe(j8(e));else if(N8(t))r=Doe(t,n);else{let n=Q8(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return C8(r)}function i5(e,t){let n=G8(e);return n===t||!N8(n)||H8(n)?!1:U8(n).position===`fixed`||i5(n,t)}function Ooe(e,t){let n=t.get(e);if(n)return n;let r=q8(e,[],!1).filter(e=>N8(e)&&k8(e)!==`body`),i=null,a=U8(e).position===`fixed`,o=a?G8(e):e;for(;N8(o)&&!H8(o);){let t=U8(o),n=B8(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||I8(o)&&!n&&i5(e,o))?r=r.filter(e=>e!==o):i=t,o=G8(o)}return t.set(e,r),r}function koe(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?L8(t)?[]:Ooe(t,this._c):[].concat(n),r],o=r5(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=r5(t,a[e],i);s=o8(n.top,s),c=a8(n.right,c),l=a8(n.bottom,l),u=o8(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Aoe(e){let{width:t,height:n}=Y8(e);return{width:t,height:n}}function joe(e,t,n){let r=P8(t),i=j8(t),a=n===`fixed`,o=$8(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=l8(0);function l(){c.x=e5(i)}if(r||!r&&!a)if((k8(t)!==`body`||I8(i))&&(s=W8(t)),r){let e=$8(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?t5(i,s):l8(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function a5(e){return U8(e).position===`static`}function o5(e,t){if(!P8(e)||U8(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return j8(e)===n&&(n=n.ownerDocument.body),n}function s5(e,t){let n=A8(e);if(L8(e))return n;if(!P8(e)){let t=G8(e);for(;t&&!H8(t);){if(N8(t)&&!a5(t))return t;t=G8(t)}return n}let r=o5(e,t);for(;r&&_oe(r)&&a5(r);)r=o5(r,t);return r&&H8(r)&&a5(r)&&!B8(r)?n:r||boe(e)||n}var Moe=async function(e){let t=this.getOffsetParent||s5,n=this.getDimensions,r=await n(e.floating);return{reference:joe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Noe(e){return U8(e).direction===`rtl`}var Poe={convertOffsetParentRelativeRectToViewportRelativeRect:Coe,getDocumentElement:j8,getClippingRect:koe,getOffsetParent:s5,getElementRects:Moe,getClientRects:woe,getDimensions:Aoe,getScale:Z8,isElement:N8,isRTL:Noe};function c5(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Foe(e,t){let n=null,r,i=j8(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=c8(d),h=c8(i.clientWidth-(u+f)),g=c8(i.clientHeight-(d+p)),_=c8(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:o8(0,a8(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!c5(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Ioe(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=X8(e),u=i||a?[...l?q8(l):[],...t?q8(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Foe(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?$8(e):null;c&&g();function g(){let t=$8(e);h&&!c5(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Loe=poe,Roe=moe,zoe=uoe,Boe=goe,Voe=doe,l5=loe,Hoe=hoe,Uoe=(e,t,n)=>{let r=new Map,i={platform:Poe,...n},a={...i.platform,_c:r};return coe(e,t,{...i,platform:a})},u5=typeof document<`u`?F.useLayoutEffect:function(){};function d5(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!d5(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!d5(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function f5(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function p5(e,t){let n=f5(e);return Math.round(t*n)/n}function m5(e){let t=F.useRef(e);return u5(()=>{t.current=e}),t}function Woe(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=F.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=F.useState(r);d5(f,r)||p(r);let[m,h]=F.useState(null),[g,_]=F.useState(null),v=F.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=F.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=F.useRef(null),C=F.useRef(null),w=F.useRef(u),T=c!=null,E=m5(c),D=m5(i),O=m5(l),k=F.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),Uoe(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!d5(w.current,t)&&(w.current=t,Er.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);u5(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=F.useRef(!1);u5(()=>(A.current=!0,()=>{A.current=!1}),[]),u5(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let ee=F.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),j=F.useMemo(()=>({reference:b,floating:x}),[b,x]),te=F.useMemo(()=>{let e={position:n,left:0,top:0};if(!j.floating)return e;let t=p5(j.floating,u.x),r=p5(j.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...f5(j.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,j.floating,u.x,u.y]);return F.useMemo(()=>({...u,update:k,refs:ee,elements:j,floatingStyles:te}),[u,k,ee,j,te])}var Goe=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:l5({element:r.current,padding:i}).fn(n):r?l5({element:r,padding:i}).fn(n):{}}}},Koe=(e,t)=>{let n=Loe(e);return{name:n.name,fn:n.fn,options:[e,t]}},qoe=(e,t)=>{let n=Roe(e);return{name:n.name,fn:n.fn,options:[e,t]}},Joe=(e,t)=>({fn:Hoe(e).fn,options:[e,t]}),Yoe=(e,t)=>{let n=zoe(e);return{name:n.name,fn:n.fn,options:[e,t]}},Xoe=(e,t)=>{let n=Boe(e);return{name:n.name,fn:n.fn,options:[e,t]}},Zoe=(e,t)=>{let n=Voe(e);return{name:n.name,fn:n.fn,options:[e,t]}},Qoe=(e,t)=>{let n=Goe(e);return{name:n.name,fn:n.fn,options:[e,t]}},$oe=`Arrow`,h5=F.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,z.jsx)(Pr.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,z.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});h5.displayName=$oe;var ese=h5;function tse(e){let[t,n]=F.useState(void 0);return xr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var g5=`Popper`,[_5,v5]=yr(g5),[nse,y5]=_5(g5),b5=e=>{let{__scopePopper:t,children:n}=e,[r,i]=F.useState(null);return(0,z.jsx)(nse,{scope:t,anchor:r,onAnchorChange:i,children:n})};b5.displayName=g5;var x5=`PopperAnchor`,S5=F.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=y5(x5,n),o=F.useRef(null),s=er(t,o),c=F.useRef(null);return F.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,z.jsx)(Pr.div,{...i,ref:s})});S5.displayName=x5;var C5=`PopperContent`,[rse,ise]=_5(C5),w5=F.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=y5(C5,n),[_,v]=F.useState(null),y=er(t,e=>v(e)),[b,x]=F.useState(null),S=tse(b),C=S?.width??0,w=S?.height??0,T=r+(a===`center`?``:`-`+a),E=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},D=Array.isArray(l)?l:[l],O=D.length>0,k={padding:E,boundary:D.filter(ose),altBoundary:O},{refs:A,floatingStyles:ee,placement:j,isPositioned:te,middlewareData:M}=Woe({strategy:`fixed`,placement:T,whileElementsMounted:(...e)=>Ioe(...e,{animationFrame:p===`always`}),elements:{reference:g.anchor},middleware:[Koe({mainAxis:i+w,alignmentAxis:o}),c&&qoe({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?Joe():void 0,...k}),c&&Yoe({...k}),Xoe({...k,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),b&&Qoe({element:b,padding:s}),sse({arrowWidth:C,arrowHeight:w}),f&&Zoe({strategy:`referenceHidden`,...k})]}),[ne,N]=D5(j),re=hi(m);xr(()=>{te&&re?.()},[te,re]);let ie=M.arrow?.x,ae=M.arrow?.y,oe=M.arrow?.centerOffset!==0,[P,se]=F.useState();return xr(()=>{_&&se(window.getComputedStyle(_).zIndex)},[_]),(0,z.jsx)(`div`,{ref:A.setFloating,"data-radix-popper-content-wrapper":``,style:{...ee,transform:te?ee.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:P,"--radix-popper-transform-origin":[M.transformOrigin?.x,M.transformOrigin?.y].join(` `),...M.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,z.jsx)(rse,{scope:n,placedSide:ne,onArrowChange:x,arrowX:ie,arrowY:ae,shouldHideArrow:oe,children:(0,z.jsx)(Pr.div,{"data-side":ne,"data-align":N,...h,ref:y,style:{...h.style,animation:te?void 0:`none`}})})})});w5.displayName=C5;var T5=`PopperArrow`,ase={top:`bottom`,right:`left`,bottom:`top`,left:`right`},E5=F.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=ise(T5,n),a=ase[i.placedSide];return(0,z.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,z.jsx)(ese,{...r,ref:t,style:{...r.style,display:`block`}})})});E5.displayName=T5;function ose(e){return e!==null}var sse=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=D5(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function D5(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var O5=b5,cse=S5,lse=w5,use=E5,k5=`rovingFocusGroup.onEntryFocus`,dse={bubbles:!1,cancelable:!0},A5=`RovingFocusGroup`,[j5,M5,fse]=r8(A5),[pse,N5]=yr(A5,[fse]),[mse,hse]=pse(A5),P5=F.forwardRef((e,t)=>(0,z.jsx)(j5.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,z.jsx)(j5.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,z.jsx)(gse,{...e,ref:t})})}));P5.displayName=A5;var gse=F.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=F.useRef(null),p=er(t,f),m=i8(a),[h,g]=Cr({prop:o,defaultProp:s??null,onChange:c,caller:A5}),[_,v]=F.useState(!1),y=hi(l),b=M5(n),x=F.useRef(!1),[S,C]=F.useState(0);return F.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(k5,y),()=>e.removeEventListener(k5,y)},[y]),(0,z.jsx)(mse,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:F.useCallback(e=>g(e),[g]),onItemShiftTab:F.useCallback(()=>v(!0),[]),onFocusableItemAdd:F.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:F.useCallback(()=>C(e=>e-1),[]),children:(0,z.jsx)(Pr.div,{tabIndex:_||S===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:_r(e.onMouseDown,()=>{x.current=!0}),onFocus:_r(e.onFocus,e=>{let t=!x.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(k5,dse);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=b().filter(e=>e.focusable);L5([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}x.current=!1}),onBlur:_r(e.onBlur,()=>v(!1))})})}),F5=`RovingFocusGroupItem`,I5=F.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=Ur(),l=a||c,u=hse(F5,n),d=u.currentTabStopId===l,f=M5(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u;return F.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),(0,z.jsx)(j5.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,z.jsx)(Pr.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:_r(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:_r(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:_r(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=yse(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?bse(n,r+1):n.slice(r+1)}setTimeout(()=>L5(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})});I5.displayName=F5;var _se={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function vse(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function yse(e,t,n){let r=vse(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return _se[r]}function L5(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function bse(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var xse=P5,Sse=I5,R5=[`Enter`,` `],Cse=[`ArrowDown`,`PageUp`,`Home`],z5=[`ArrowUp`,`PageDown`,`End`],wse=[...Cse,...z5],Tse={ltr:[...R5,`ArrowRight`],rtl:[...R5,`ArrowLeft`]},Ese={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},B5=`Menu`,[V5,Dse,Ose]=r8(B5),[H5,U5]=yr(B5,[Ose,v5,N5]),W5=v5(),G5=N5(),[K5,q5]=H5(B5),[kse,J5]=H5(B5),Y5=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=W5(t),[c,l]=F.useState(null),u=F.useRef(!1),d=hi(a),f=i8(i);return F.useEffect(()=>{let e=()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),(0,z.jsx)(O5,{...s,children:(0,z.jsx)(K5,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,z.jsx)(kse,{scope:t,onClose:F.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};Y5.displayName=B5;var Ase=`MenuAnchor`,X5=F.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=W5(n);return(0,z.jsx)(cse,{...i,...r,ref:t})});X5.displayName=Ase;var Z5=`MenuPortal`,[jse,Q5]=H5(Z5,{forceMount:void 0}),$5=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=q5(Z5,t);return(0,z.jsx)(jse,{scope:t,forceMount:n,children:(0,z.jsx)(Lr,{present:n||a.open,children:(0,z.jsx)(qi,{asChild:!0,container:i,children:r})})})};$5.displayName=Z5;var e7=`MenuContent`,[Mse,t7]=H5(e7),n7=F.forwardRef((e,t)=>{let n=Q5(e7,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=q5(e7,e.__scopeMenu),o=J5(e7,e.__scopeMenu);return(0,z.jsx)(V5.Provider,{scope:e.__scopeMenu,children:(0,z.jsx)(Lr,{present:r||a.open,children:(0,z.jsx)(V5.Slot,{scope:e.__scopeMenu,children:o.modal?(0,z.jsx)(Nse,{...i,ref:t}):(0,z.jsx)(Pse,{...i,ref:t})})})})}),Nse=F.forwardRef((e,t)=>{let n=q5(e7,e.__scopeMenu),r=F.useRef(null),i=er(t,r);return F.useEffect(()=>{let e=r.current;if(e)return ho(e)},[]),(0,z.jsx)(r7,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:_r(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Pse=F.forwardRef((e,t)=>{let n=q5(e7,e.__scopeMenu);return(0,z.jsx)(r7,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Fse=Dr(`MenuContent.ScrollLock`),r7=F.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=q5(e7,n),_=J5(e7,n),v=W5(n),y=G5(n),b=Dse(n),[x,S]=F.useState(null),C=F.useRef(null),w=er(t,C,g.onContentChange),T=F.useRef(0),E=F.useRef(``),D=F.useRef(0),O=F.useRef(null),k=F.useRef(`right`),A=F.useRef(0),ee=m?ao:F.Fragment,j=m?{as:Fse,allowPinchZoom:!0}:void 0,te=e=>{let t=E.current+e,n=b().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=qse(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){E.current=t,window.clearTimeout(T.current),t!==``&&(T.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};F.useEffect(()=>()=>window.clearTimeout(T.current),[]),Yi();let M=F.useCallback(e=>k.current===O.current?.side&&Yse(e,O.current?.area),[]);return(0,z.jsx)(Mse,{scope:n,searchRef:E,onItemEnter:F.useCallback(e=>{M(e)&&e.preventDefault()},[M]),onItemLeave:F.useCallback(e=>{M(e)||(C.current?.focus(),S(null))},[M]),onTriggerLeave:F.useCallback(e=>{M(e)&&e.preventDefault()},[M]),pointerGraceTimerRef:D,onPointerGraceIntentChange:F.useCallback(e=>{O.current=e},[]),children:(0,z.jsx)(ee,{...j,children:(0,z.jsx)(Pi,{asChild:!0,trapped:i,onMountAutoFocus:_r(a,e=>{e.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,z.jsx)(Ci,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,z.jsx)(xse,{asChild:!0,...y,dir:_.dir,orientation:`vertical`,loop:r,currentTabStopId:x,onCurrentTabStopIdChange:S,onEntryFocus:_r(c,e=>{_.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,z.jsx)(lse,{role:`menu`,"aria-orientation":`vertical`,"data-state":D7(g.open),"data-radix-menu-content":``,dir:_.dir,...v,...h,ref:w,style:{outline:`none`,...h.style},onKeyDown:_r(h.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&te(e.key));let i=C.current;if(e.target!==i||!wse.includes(e.key))return;e.preventDefault();let a=b().filter(e=>!e.disabled).map(e=>e.ref.current);z5.includes(e.key)&&a.reverse(),Gse(a)}),onBlur:_r(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(T.current),E.current=``)}),onPointerMove:_r(e.onPointerMove,A7(e=>{let t=e.target,n=A.current!==e.clientX;e.currentTarget.contains(t)&&n&&(k.current=e.clientX>A.current?`right`:`left`,A.current=e.clientX)}))})})})})})})});n7.displayName=e7;var Ise=`MenuGroup`,i7=F.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,z.jsx)(Pr.div,{role:`group`,...r,ref:t})});i7.displayName=Ise;var Lse=`MenuLabel`,a7=F.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,z.jsx)(Pr.div,{...r,ref:t})});a7.displayName=Lse;var o7=`MenuItem`,s7=`menu.itemSelect`,c7=F.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=F.useRef(null),o=J5(o7,e.__scopeMenu),s=t7(o7,e.__scopeMenu),c=er(t,a),l=F.useRef(!1),u=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(s7,{bubbles:!0,cancelable:!0});e.addEventListener(s7,e=>r?.(e),{once:!0}),Fr(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,z.jsx)(l7,{...i,ref:c,disabled:n,onClick:_r(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:_r(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:_r(e.onKeyDown,e=>{let t=s.searchRef.current!==``;n||t&&e.key===` `||R5.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});c7.displayName=o7;var l7=F.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=t7(o7,n),s=G5(n),c=F.useRef(null),l=er(t,c),[u,d]=F.useState(!1),[f,p]=F.useState(``);return F.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,z.jsx)(V5.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,z.jsx)(Sse,{asChild:!0,...s,focusable:!r,children:(0,z.jsx)(Pr.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:_r(e.onPointerMove,A7(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:_r(e.onPointerLeave,A7(e=>o.onItemLeave(e))),onFocus:_r(e.onFocus,()=>d(!0)),onBlur:_r(e.onBlur,()=>d(!1))})})})}),Rse=`MenuCheckboxItem`,u7=F.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,z.jsx)(g7,{scope:e.__scopeMenu,checked:n,children:(0,z.jsx)(c7,{role:`menuitemcheckbox`,"aria-checked":O7(n)?`mixed`:n,...i,ref:t,"data-state":k7(n),onSelect:_r(i.onSelect,()=>r?.(O7(n)?!0:!n),{checkForDefaultPrevented:!1})})})});u7.displayName=Rse;var d7=`MenuRadioGroup`,[zse,Bse]=H5(d7,{value:void 0,onValueChange:()=>{}}),f7=F.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=hi(r);return(0,z.jsx)(zse,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,z.jsx)(i7,{...i,ref:t})})});f7.displayName=d7;var p7=`MenuRadioItem`,m7=F.forwardRef((e,t)=>{let{value:n,...r}=e,i=Bse(p7,e.__scopeMenu),a=n===i.value;return(0,z.jsx)(g7,{scope:e.__scopeMenu,checked:a,children:(0,z.jsx)(c7,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":k7(a),onSelect:_r(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});m7.displayName=p7;var h7=`MenuItemIndicator`,[g7,Vse]=H5(h7,{checked:!1}),_7=F.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=Vse(h7,n);return(0,z.jsx)(Lr,{present:r||O7(a.checked)||a.checked===!0,children:(0,z.jsx)(Pr.span,{...i,ref:t,"data-state":k7(a.checked)})})});_7.displayName=h7;var Hse=`MenuSeparator`,v7=F.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,z.jsx)(Pr.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});v7.displayName=Hse;var Use=`MenuArrow`,y7=F.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=W5(n);return(0,z.jsx)(use,{...i,...r,ref:t})});y7.displayName=Use;var b7=`MenuSub`,[Wse,x7]=H5(b7),S7=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=q5(b7,t),o=W5(t),[s,c]=F.useState(null),[l,u]=F.useState(null),d=hi(i);return F.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,z.jsx)(O5,{...o,children:(0,z.jsx)(K5,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,z.jsx)(Wse,{scope:t,contentId:Ur(),triggerId:Ur(),trigger:s,onTriggerChange:c,children:n})})})};S7.displayName=b7;var C7=`MenuSubTrigger`,w7=F.forwardRef((e,t)=>{let n=q5(C7,e.__scopeMenu),r=J5(C7,e.__scopeMenu),i=x7(C7,e.__scopeMenu),a=t7(C7,e.__scopeMenu),o=F.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=F.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return F.useEffect(()=>u,[u]),F.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]),(0,z.jsx)(X5,{asChild:!0,...l,children:(0,z.jsx)(l7,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":i.contentId,"data-state":D7(n.open),...e,ref:$n(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:_r(e.onPointerMove,A7(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:_r(e.onPointerLeave,A7(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:_r(e.onKeyDown,t=>{let i=a.searchRef.current!==``;e.disabled||i&&t.key===` `||Tse[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});w7.displayName=C7;var T7=`MenuSubContent`,E7=F.forwardRef((e,t)=>{let n=Q5(e7,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=q5(e7,e.__scopeMenu),o=J5(e7,e.__scopeMenu),s=x7(T7,e.__scopeMenu),c=F.useRef(null),l=er(t,c);return(0,z.jsx)(V5.Provider,{scope:e.__scopeMenu,children:(0,z.jsx)(Lr,{present:r||a.open,children:(0,z.jsx)(V5.Slot,{scope:e.__scopeMenu,children:(0,z.jsx)(r7,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:l,align:`start`,side:o.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{o.isUsingKeyboardRef.current&&c.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:_r(e.onFocusOutside,e=>{e.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:_r(e.onEscapeKeyDown,e=>{o.onClose(),e.preventDefault()}),onKeyDown:_r(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=Ese[o.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),s.trigger?.focus(),e.preventDefault())})})})})})});E7.displayName=T7;function D7(e){return e?`open`:`closed`}function O7(e){return e===`indeterminate`}function k7(e){return O7(e)?`indeterminate`:e?`checked`:`unchecked`}function Gse(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Kse(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function qse(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Kse(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function Jse(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function Yse(e,t){return t?Jse({x:e.clientX,y:e.clientY},t):!1}function A7(e){return t=>t.pointerType===`mouse`?e(t):void 0}var Xse=Y5,Zse=X5,Qse=$5,$se=n7,ece=i7,tce=a7,nce=c7,rce=u7,ice=f7,ace=m7,oce=_7,sce=v7,cce=y7,lce=S7,uce=w7,dce=E7,j7=`ContextMenu`,[fce,pce]=yr(j7,[U5]),M7=U5(),[mce,N7]=fce(j7),P7=e=>{let{__scopeContextMenu:t,children:n,onOpenChange:r,dir:i,modal:a=!0}=e,[o,s]=F.useState(!1),c=M7(t),l=hi(r),u=F.useCallback(e=>{s(e),l(e)},[l]);return(0,z.jsx)(mce,{scope:t,open:o,onOpenChange:u,modal:a,children:(0,z.jsx)(Xse,{...c,dir:i,open:o,onOpenChange:u,modal:a,children:n})})};P7.displayName=j7;var F7=`ContextMenuTrigger`,I7=F.forwardRef((e,t)=>{let{__scopeContextMenu:n,disabled:r=!1,...i}=e,a=N7(F7,n),o=M7(n),s=F.useRef({x:0,y:0}),c=F.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...s.current})}),l=F.useRef(0),u=F.useCallback(()=>window.clearTimeout(l.current),[]),d=e=>{s.current={x:e.clientX,y:e.clientY},a.onOpenChange(!0)};return F.useEffect(()=>u,[u]),F.useEffect(()=>void(r&&u()),[r,u]),(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Zse,{...o,virtualRef:c}),(0,z.jsx)(Pr.span,{"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,...i,ref:t,style:{WebkitTouchCallout:`none`,...e.style},onContextMenu:r?e.onContextMenu:_r(e.onContextMenu,e=>{u(),d(e),e.preventDefault()}),onPointerDown:r?e.onPointerDown:_r(e.onPointerDown,Y7(e=>{u(),l.current=window.setTimeout(()=>d(e),700)})),onPointerMove:r?e.onPointerMove:_r(e.onPointerMove,Y7(u)),onPointerCancel:r?e.onPointerCancel:_r(e.onPointerCancel,Y7(u)),onPointerUp:r?e.onPointerUp:_r(e.onPointerUp,Y7(u))})]})});I7.displayName=F7;var hce=`ContextMenuPortal`,L7=e=>{let{__scopeContextMenu:t,...n}=e,r=M7(t);return(0,z.jsx)(Qse,{...r,...n})};L7.displayName=hce;var R7=`ContextMenuContent`,z7=F.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=N7(R7,n),a=M7(n),o=F.useRef(!1);return(0,z.jsx)($se,{...a,...r,ref:t,side:`right`,sideOffset:2,align:`start`,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),!t.defaultPrevented&&o.current&&t.preventDefault(),o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),!t.defaultPrevented&&!i.modal&&(o.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-context-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-context-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-context-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-context-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});z7.displayName=R7;var gce=`ContextMenuGroup`,_ce=F.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=M7(n);return(0,z.jsx)(ece,{...i,...r,ref:t})});_ce.displayName=gce;var vce=`ContextMenuLabel`,B7=F.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=M7(n);return(0,z.jsx)(tce,{...i,...r,ref:t})});B7.displayName=vce;var yce=`ContextMenuItem`,V7=F.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=M7(n);return(0,z.jsx)(nce,{...i,...r,ref:t})});V7.displayName=yce;var bce=`ContextMenuCheckboxItem`,H7=F.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=M7(n);return(0,z.jsx)(rce,{...i,...r,ref:t})});H7.displayName=bce;var xce=`ContextMenuRadioGroup`,Sce=F.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=M7(n);return(0,z.jsx)(ice,{...i,...r,ref:t})});Sce.displayName=xce;var Cce=`ContextMenuRadioItem`,U7=F.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=M7(n);return(0,z.jsx)(ace,{...i,...r,ref:t})});U7.displayName=Cce;var wce=`ContextMenuItemIndicator`,W7=F.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=M7(n);return(0,z.jsx)(oce,{...i,...r,ref:t})});W7.displayName=wce;var Tce=`ContextMenuSeparator`,G7=F.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=M7(n);return(0,z.jsx)(sce,{...i,...r,ref:t})});G7.displayName=Tce;var Ece=`ContextMenuArrow`,Dce=F.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=M7(n);return(0,z.jsx)(cce,{...i,...r,ref:t})});Dce.displayName=Ece;var K7=`ContextMenuSub`,Oce=e=>{let{__scopeContextMenu:t,children:n,onOpenChange:r,open:i,defaultOpen:a}=e,o=M7(t),[s,c]=Cr({prop:i,defaultProp:a??!1,onChange:r,caller:K7});return(0,z.jsx)(lce,{...o,open:s,onOpenChange:c,children:n})};Oce.displayName=K7;var kce=`ContextMenuSubTrigger`,q7=F.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=M7(n);return(0,z.jsx)(uce,{...i,...r,ref:t})});q7.displayName=kce;var Ace=`ContextMenuSubContent`,J7=F.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=M7(n);return(0,z.jsx)(dce,{...i,...r,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-context-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-context-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-context-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-context-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});J7.displayName=Ace;function Y7(e){return t=>t.pointerType===`mouse`?void 0:e(t)}var jce=P7,Mce=I7,Nce=L7,X7=z7,Z7=B7,Q7=V7,$7=H7,e9=U7,t9=W7,n9=G7,r9=q7,i9=J7,a9=jce,o9=Mce,Pce=F.forwardRef(({className:e,inset:t,children:n,...r},i)=>(0,z.jsx)(r9,{ref:i,className:R(`flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground`,t&&`pl-8`,e),...r,children:n}));Pce.displayName=r9.displayName;var Fce=F.forwardRef(({className:e,...t},n)=>(0,z.jsx)(i9,{ref:n,className:R(`z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...t}));Fce.displayName=i9.displayName;var s9=F.forwardRef(({className:e,...t},n)=>(0,z.jsx)(Nce,{children:(0,z.jsx)(X7,{ref:n,className:R(`z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...t})}));s9.displayName=X7.displayName;var c9=F.forwardRef(({className:e,inset:t,...n},r)=>(0,z.jsx)(Q7,{ref:r,className:R(`relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,t&&`pl-8`,e),...n}));c9.displayName=Q7.displayName;var Ice=F.forwardRef(({className:e,children:t,checked:n,...r},i)=>(0,z.jsxs)($7,{ref:i,className:R(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),checked:n,...r,children:[(0,z.jsx)(`span`,{className:`absolute left-2 flex size-3.5 items-center justify-center`,children:(0,z.jsx)(t9,{children:(0,z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`size-4`,children:(0,z.jsx)(`path`,{d:`M20 6 9 17l-5-5`})})})}),t]}));Ice.displayName=$7.displayName;var Lce=F.forwardRef(({className:e,children:t,...n},r)=>(0,z.jsxs)(e9,{ref:r,className:R(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),...n,children:[(0,z.jsx)(`span`,{className:`absolute left-2 flex size-3.5 items-center justify-center`,children:(0,z.jsx)(t9,{children:(0,z.jsx)(`div`,{className:`size-2 rounded-full bg-current`})})}),t]}));Lce.displayName=e9.displayName;var Rce=F.forwardRef(({className:e,inset:t,...n},r)=>(0,z.jsx)(Z7,{ref:r,className:R(`px-2 py-1.5 text-sm font-semibold text-foreground`,t&&`pl-8`,e),...n}));Rce.displayName=Z7.displayName;var l9=F.forwardRef(({className:e,...t},n)=>(0,z.jsx)(n9,{ref:n,className:R(`-mx-1 my-1 h-px bg-border`,e),...t}));l9.displayName=n9.displayName;var zce=({className:e,...t})=>(0,z.jsx)(`span`,{className:R(`ml-auto text-xs tracking-widest text-muted-foreground`,e),...t});zce.displayName=`ContextMenuShortcut`;function Bce(e,t){return e?t?.find(t=>t.path===e)?.name||e.split(`/`).pop()||e:``}var u9=[`#2563eb`,`#059669`,`#d97706`,`#7c3aed`,`#e11d48`,`#0891b2`];function Vce(e){return u9[e%u9.length]}var Hce=(0,F.memo)(function({tabOrder:e,tabs:t,activeTabKey:n,onActivate:r,onCloseRequest:i,onTogglePin:a,onCloseOtherTabs:o,onCloseRightTabs:s,onCloseLeftTabs:c,onCloseAllTabs:l,onCloseGroupTabs:u,onCloseOtherGroupTabs:d,isMobile:f,rightContent:p,dirs:m}){if(e.length===0)return null;let h=(0,F.useMemo)(()=>{let n=new Map;for(let r of e){let e=t.get(r);if(!e)continue;let i=e.rootPath;n.has(i)||n.set(i,[]),n.get(i).push(r)}return n},[e,t]),g=h.size>1,_=(0,F.useMemo)(()=>{let e=new Map,t=0;for(let[n]of h.entries())e.set(n,t++);return e},[h]),v=Array.from(h.entries()).map(([e,p],h)=>{let v=Vce(_.get(e)??0);return(0,z.jsxs)(`div`,{className:`flex items-center gap-1.5 shrink-0`,children:[g&&h>0&&(0,z.jsx)(`div`,{className:`flex items-center self-stretch px-1 shrink-0`,children:(0,z.jsx)(`div`,{className:`w-[2px] h-5 rounded-full`,style:{backgroundColor:v}})}),g&&(0,z.jsxs)(a9,{children:[(0,z.jsx)(o9,{asChild:!0,children:(0,z.jsx)(`span`,{className:`px-2 py-1 text-[10px] font-medium text-muted-foreground bg-muted/40 rounded shrink-0 select-none cursor-pointer`,style:{color:v},children:Bce(e,m)})}),(0,z.jsxs)(s9,{onOpenAutoFocus:e=>e.preventDefault(),children:[(0,z.jsx)(c9,{onClick:()=>u(e),children:`关闭分组`}),(0,z.jsx)(c9,{onClick:()=>d(e),children:`关闭分组其他`})]})]}),p.map(e=>{let u=t.get(e);if(!u)return null;let d=u.path.split(`/`).pop()||u.path,p=e===n,m=u.content!==u.lastSavedContent,h=u.isPinned,_=u.isPreview;return(0,z.jsxs)(a9,{children:[(0,z.jsx)(o9,{asChild:!0,children:(0,z.jsxs)(`div`,{className:R(`group flex items-center gap-1.5 text-xs cursor-pointer rounded-lg border shrink-0 select-none transition-all duration-150`,f?`px-3 py-2 gap-1.5 min-w-[100px] max-w-[180px]`:`px-3 py-1.5 gap-1.5 min-w-[100px] max-w-[200px]`,p?`bg-background text-foreground border-border shadow-sm translate-y-[-1px]`:`bg-transparent text-muted-foreground border-transparent hover:bg-muted/50`),onClick:()=>r(e),onDoubleClick:()=>a(e),children:[g&&!h&&(0,z.jsx)(`span`,{className:`size-1.5 rounded-full shrink-0`,style:{backgroundColor:v}}),h&&(0,z.jsx)(Be,{className:`size-3 text-muted-foreground shrink-0 fill-muted-foreground`}),m&&!h&&(0,z.jsx)(`span`,{className:`size-1.5 rounded-full bg-primary shrink-0`}),(0,z.jsx)(`span`,{className:R(`truncate flex-1`,_&&`italic opacity-80`),children:d}),!h&&(!f||p)&&(0,z.jsx)(gr,{variant:`ghost`,size:`icon`,className:R(`shrink-0 rounded-sm`,f?`size-6 min-w-6 min-h-6`:`size-5 min-w-5 min-h-5`,f?`opacity-100`:`opacity-0 group-hover:opacity-100`,p?`hover:bg-muted`:`hover:bg-muted/50`),onClick:t=>{t.stopPropagation(),a(e)},title:`固定标签`,children:(0,z.jsx)(Be,{className:f?`size-4`:`size-3`})}),h&&(!f||p)&&(0,z.jsx)(gr,{variant:`ghost`,size:`icon`,className:R(`shrink-0 rounded-sm`,f?`size-6 min-w-6 min-h-6`:`size-5 min-w-5 min-h-5`,f?`opacity-100`:`opacity-0 group-hover:opacity-100`,p?`hover:bg-muted`:`hover:bg-muted/50`),onClick:t=>{t.stopPropagation(),a(e)},title:`取消固定`,children:(0,z.jsx)(Be,{className:R(`fill-muted-foreground`,f?`size-4`:`size-3`)})}),(0,z.jsx)(gr,{variant:`ghost`,size:`icon`,className:R(`shrink-0 rounded-sm`,f?`size-6 min-w-6 min-h-6`:`size-5 min-w-5 min-h-5`,f?`opacity-100`:`opacity-0 group-hover:opacity-100`,p?`hover:bg-muted`:`hover:bg-muted/50`),onClick:t=>{t.stopPropagation(),i(e)},title:`关闭标签`,children:(0,z.jsx)(Je,{className:f?`size-4`:`size-3`})})]})}),(0,z.jsxs)(s9,{onOpenAutoFocus:e=>e.preventDefault(),children:[(0,z.jsx)(c9,{onClick:()=>i(e),children:`关闭标签`}),(0,z.jsx)(c9,{onClick:()=>o(e),children:`关闭其他标签`}),(0,z.jsx)(c9,{onClick:()=>s(e),children:`关闭右侧标签`}),(0,z.jsx)(c9,{onClick:()=>c(e),children:`关闭左侧标签`}),(0,z.jsx)(l9,{}),(0,z.jsx)(c9,{onClick:()=>a(e),children:h?`取消固定`:`固定标签`}),(0,z.jsx)(l9,{}),(0,z.jsx)(c9,{onClick:()=>l(),children:`关闭所有标签`})]})]},e)})]},e??`null`)});return(0,z.jsxs)(`div`,{className:`flex items-center bg-muted/20 border-b border-border shrink-0`,children:[f?(0,z.jsx)(`div`,{className:`flex items-center gap-1.5 px-2 py-2 overflow-x-auto overflow-y-hidden flex-1 tabbar-scroll-hide`,style:{WebkitOverflowScrolling:`touch`},children:v}):(0,z.jsxs)(a9,{children:[(0,z.jsx)(o9,{asChild:!0,children:(0,z.jsx)(`div`,{className:`flex items-center gap-1.5 px-3 py-2 overflow-x-auto overflow-y-hidden flex-1 tabbar-scroll-hide`,style:{WebkitOverflowScrolling:`touch`},children:v})}),(0,z.jsx)(s9,{onOpenAutoFocus:e=>e.preventDefault(),children:(0,z.jsx)(c9,{onClick:()=>l(),children:`关闭所有标签`})})]}),p&&(0,z.jsx)(`div`,{className:`flex items-center gap-2 px-3 h-9 shrink-0 text-xs text-muted-foreground`,children:p})]})}),Uce=(0,F.memo)(function({visible:e,onClose:t,onCreate:n,currentDir:r}){let[i,a]=(0,F.useState)(``),[o,s]=(0,F.useState)(!1),c=(0,F.useRef)(null);(0,F.useEffect)(()=>{e&&(s(!1),a(`.md`),setTimeout(()=>{c.current?.setSelectionRange(0,0),c.current?.focus()},50))},[e]);let l=()=>{i.trim()&&(n(i.trim(),o,r),a(``),t())},u=e=>{e||t()},d=e=>{e.key===`Enter`&&l()},f=r?r.split(`/`).filter(Boolean).join(` / `):`目录`;return(0,z.jsx)(is,{open:e,onOpenChange:u,children:(0,z.jsxs)(cs,{side:`bottom`,className:`rounded-t-2xl`,noClose:!0,children:[(0,z.jsxs)(ls,{className:`text-left`,children:[(0,z.jsx)(ds,{children:`新建`}),(0,z.jsxs)(fs,{children:[`位置: `,f]})]}),(0,z.jsxs)(`div`,{className:`space-y-4 mt-4`,children:[(0,z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,z.jsxs)(gr,{variant:o?`outline`:`default`,onClick:()=>{s(!1),i||(a(`.md`),setTimeout(()=>{c.current?.setSelectionRange(0,0),c.current?.focus()},0))},className:`flex-1 h-11`,children:[(0,z.jsx)(we,{className:`size-4 mr-2`}),`Markdown`]}),(0,z.jsxs)(gr,{variant:o?`default`:`outline`,onClick:()=>{s(!0),i===`.md`&&a(``)},className:`flex-1 h-11`,children:[(0,z.jsx)(ke,{className:`size-4 mr-2`}),`文件夹`]})]}),(0,z.jsx)(Zn,{ref:c,placeholder:o?`文件夹名称`:`文件名称,如 note.md`,value:i,onChange:e=>a(e.target.value),onKeyDown:d,className:`h-11`,autoFocus:!0}),(0,z.jsxs)(`div`,{className:`flex gap-2 justify-end pt-2`,children:[(0,z.jsx)(gr,{variant:`outline`,onClick:t,children:`取消`}),(0,z.jsx)(gr,{onClick:l,children:`创建`})]})]})]})})});function Wce(e,t){return t||e.replace(/\\/g,`/`).split(`/`).filter(Boolean).pop()||e}function Gce({open:e,onOpenChange:t,onSelect:n,activeRoot:r,groups:i}){let[a,o]=(0,F.useState)(``),[s,c]=(0,F.useState)([]),[l,u]=(0,F.useState)(0),[d,f]=(0,F.useState)(!1),[p,m]=(0,F.useState)(!1),[h,g]=(0,F.useState)(`all`),_=(0,F.useRef)(null);(0,F.useEffect)(()=>{m(window.innerWidth<768)},[]),(0,F.useEffect)(()=>{e&&r?g(r):e&&g(`all`)},[e,r]),(0,F.useEffect)(()=>{e?setTimeout(()=>_.current?.focus(),100):(o(``),c([]),u(0))},[e]),(0,F.useEffect)(()=>{if(!a.trim()){c([]),u(0);return}let e=setTimeout(()=>{f(!0);let e=new URL(`/api/files/search`,window.location.origin);e.searchParams.set(`q`,a),e.searchParams.set(`limit`,`50`),h!==`all`&&e.searchParams.set(`root`,h),fetch(e.toString()).then(e=>e.json()).then(e=>{c(e.results||[]),u(0)}).catch(console.error).finally(()=>f(!1))},200);return()=>clearTimeout(e)},[a,h]);let v=(0,F.useCallback)((e,r)=>{n(e,r),t(!1)},[n,t]),y=(0,F.useCallback)(e=>{if(e.key===`ArrowDown`)e.preventDefault(),u(e=>Math.min(e+1,s.length-1));else if(e.key===`ArrowUp`)e.preventDefault(),u(e=>Math.max(e-1,0));else if(e.key===`Enter`&&s.length>0){e.preventDefault();let t=s[l];v(t.path,t.rootPath)}else e.key===`Escape`&&t(!1)},[s,l,v,t]);return(0,F.useEffect)(()=>{let n=n=>{n.key===`Escape`&&e&&t(!1)};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t]),e?(0,z.jsxs)(`div`,{className:`fixed inset-0 z-50 flex flex-col bg-background/95 backdrop-blur-sm`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 border-b border-border`,children:[p&&(0,z.jsx)(gr,{variant:`ghost`,size:`icon`,onClick:()=>t(!1),children:(0,z.jsx)(de,{className:`size-5`})}),(0,z.jsxs)(`div`,{className:`relative flex-1`,children:[(0,z.jsx)(We,{className:`absolute left-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground`}),(0,z.jsx)(Zn,{ref:_,type:`text`,placeholder:`搜索文件或内容...`,value:a,onChange:e=>o(e.target.value),onKeyDown:y,className:`pl-9 pr-20`}),!a&&(0,z.jsx)(`span`,{className:`absolute right-10 top-1/2 -translate-y-1/2 text-xs text-muted-foreground pointer-events-none`,children:`⌘K`}),a&&(0,z.jsx)(`button`,{onClick:()=>o(``),className:`absolute right-3 top-1/2 -translate-y-1/2`,children:(0,z.jsx)(Je,{className:`size-4 text-muted-foreground hover:text-foreground`})})]}),(0,z.jsx)(gr,{variant:`ghost`,size:`icon`,onClick:()=>t(!1),children:(0,z.jsx)(Je,{className:`size-5`})})]}),i&&i.length>0&&(0,z.jsxs)(`div`,{className:`flex items-center gap-1 px-4 py-2 border-b border-border overflow-x-auto`,children:[(0,z.jsx)(`span`,{className:`text-xs text-muted-foreground shrink-0 mr-1`,children:`搜索范围:`}),(0,z.jsx)(gr,{variant:h===`all`?`default`:`ghost`,size:`sm`,className:`text-xs h-7 shrink-0`,onClick:()=>g(`all`),children:`全部`}),i.map(e=>(0,z.jsx)(gr,{variant:h===e.root.path?`default`:`ghost`,size:`sm`,className:`text-xs h-7 shrink-0`,onClick:()=>g(e.root.path),children:Wce(e.root.path,e.root.name)},e.root.path))]}),(0,z.jsxs)(`div`,{className:`flex-1 overflow-y-auto`,children:[d&&(0,z.jsxs)(`div`,{className:`flex items-center justify-center py-12 text-muted-foreground`,children:[(0,z.jsx)(Pe,{className:`size-5 mr-2 animate-spin`}),(0,z.jsx)(`span`,{className:`text-sm`,children:`搜索中...`})]}),!d&&a&&s.length===0&&(0,z.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-12 text-muted-foreground`,children:[(0,z.jsx)(We,{className:`size-10 mb-3 opacity-50`}),(0,z.jsx)(`span`,{className:`text-sm`,children:`未找到相关结果`})]}),!d&&!a&&(0,z.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-12 text-muted-foreground`,children:[(0,z.jsx)(We,{className:`size-10 mb-3 opacity-50`}),(0,z.jsx)(`span`,{className:`text-sm`,children:`输入关键词搜索文件名或内容`})]}),s.length>0&&(0,z.jsx)(`div`,{className:`py-2`,children:s.map((e,t)=>(0,z.jsxs)(`button`,{onClick:()=>v(e.path,e.rootPath),className:R(`w-full px-4 py-3 flex items-start gap-3 text-left hover:bg-accent transition-colors`,t===l&&`bg-accent`),children:[(0,z.jsx)(we,{className:`size-5 mt-0.5 text-muted-foreground shrink-0`}),(0,z.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,z.jsx)(`span`,{className:`font-medium truncate`,children:e.name}),e.rootName&&(0,z.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-muted text-muted-foreground`,children:e.rootName})]}),e.matchedLine&&(0,z.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1 line-clamp-2`,children:e.matchedLine}),(0,z.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1 truncate`,children:e.path})]})]},`${e.rootPath}:${e.path}`))})]}),s.length>0&&(0,z.jsxs)(`div`,{className:`px-4 py-2 border-t border-border text-xs text-muted-foreground flex items-center justify-between`,children:[(0,z.jsxs)(`span`,{children:[s.length,` 个结果`]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(`span`,{className:`px-1.5 py-0.5 rounded bg-accent`,children:`↑↓`}),(0,z.jsx)(`span`,{children:`选择`}),(0,z.jsx)(`span`,{className:`px-1.5 py-0.5 rounded bg-accent`,children:`Enter`}),(0,z.jsx)(`span`,{children:`打开`})]})]})]}):null}var d9=Xo,Kce=Qo,f9=F.forwardRef(({className:e,...t},n)=>(0,z.jsx)($o,{ref:n,className:R(`fixed inset-0 z-50 bg-black/80 animate-fade-in`,e),...t}));f9.displayName=$o.displayName;var p9=F.forwardRef(({className:e,children:t,...n},r)=>(0,z.jsxs)(Kce,{children:[(0,z.jsx)(f9,{}),(0,z.jsxs)(es,{ref:r,className:R(`fixed left-[50%] top-[50%] z-50 grid w-[calc(100%-2rem)] max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 animate-zoom-in rounded-lg max-h-[calc(100vh-2rem)] overflow-y-auto`,e),...n,children:[t,(0,z.jsxs)(rs,{className:`absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground`,children:[(0,z.jsx)(Je,{className:`size-4`}),(0,z.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]}));p9.displayName=es.displayName;var m9=({className:e,...t})=>(0,z.jsx)(`div`,{className:R(`flex flex-col space-y-1.5 text-center sm:text-left`,e),...t});m9.displayName=`DialogHeader`;var h9=({className:e,...t})=>(0,z.jsx)(`div`,{className:R(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,e),...t});h9.displayName=`DialogFooter`;var g9=F.forwardRef(({className:e,...t},n)=>(0,z.jsx)(ts,{ref:n,className:R(`text-lg font-semibold leading-none tracking-tight`,e),...t}));g9.displayName=ts.displayName;var _9=F.forwardRef(({className:e,...t},n)=>(0,z.jsx)(ns,{ref:n,className:R(`text-sm text-muted-foreground`,e),...t}));_9.displayName=ns.displayName;function qce({open:e,onOpenChange:t,item:n,onRename:r}){let[i,a]=(0,F.useState)(``),o=(0,F.useRef)(null);(0,F.useEffect)(()=>{if(n&&(a(n.name),n.type===`file`)){let e=n.name.lastIndexOf(`.`);e>0&&setTimeout(()=>{o.current?.setSelectionRange(e,e)},0)}},[n]);let s=()=>{n&&i.trim()&&(r(n.path,i.trim(),n.rootPath,n.type===`directory`),t(!1))};return n?(0,z.jsx)(d9,{open:e,onOpenChange:t,children:(0,z.jsxs)(p9,{className:`sm:max-w-[400px]`,children:[(0,z.jsxs)(m9,{children:[(0,z.jsx)(g9,{children:`重命名`}),(0,z.jsxs)(_9,{children:[`输入新的名称来重命名「`,n.name,`」`]})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-2 py-2`,children:[n.type===`directory`?(0,z.jsx)(ke,{className:`size-5 shrink-0 text-muted-foreground`}):(0,z.jsx)(Te,{className:`size-5 shrink-0 text-muted-foreground`}),(0,z.jsx)(Zn,{ref:o,value:i,onChange:e=>a(e.target.value),onKeyDown:e=>{e.key===`Enter`&&s()},autoFocus:!0})]}),(0,z.jsxs)(h9,{children:[(0,z.jsx)(gr,{variant:`outline`,onClick:()=>t(!1),children:`取消`}),(0,z.jsx)(gr,{onClick:s,disabled:!i.trim(),children:`确定`})]})]})}):null}function Jce(e,[t,n]){return Math.min(n,Math.max(t,e))}function Yce(e,t){return F.useReducer((e,n)=>t[e][n]??e,e)}var v9=`ScrollArea`,[y9,Xce]=yr(v9),[Zce,b9]=y9(v9),x9=F.forwardRef((e,t)=>{let{__scopeScrollArea:n,type:r=`hover`,dir:i,scrollHideDelay:a=600,...o}=e,[s,c]=F.useState(null),[l,u]=F.useState(null),[d,f]=F.useState(null),[p,m]=F.useState(null),[h,g]=F.useState(null),[_,v]=F.useState(0),[y,b]=F.useState(0),[x,S]=F.useState(!1),[C,w]=F.useState(!1),T=er(t,e=>c(e)),E=i8(i);return(0,z.jsx)(Zce,{scope:n,type:r,dir:E,scrollHideDelay:a,scrollArea:s,viewport:l,onViewportChange:u,content:d,onContentChange:f,scrollbarX:p,onScrollbarXChange:m,scrollbarXEnabled:x,onScrollbarXEnabledChange:S,scrollbarY:h,onScrollbarYChange:g,scrollbarYEnabled:C,onScrollbarYEnabledChange:w,onCornerWidthChange:v,onCornerHeightChange:b,children:(0,z.jsx)(Pr.div,{dir:E,...o,ref:T,style:{position:`relative`,"--radix-scroll-area-corner-width":_+`px`,"--radix-scroll-area-corner-height":y+`px`,...e.style}})})});x9.displayName=v9;var S9=`ScrollAreaViewport`,C9=F.forwardRef((e,t)=>{let{__scopeScrollArea:n,children:r,nonce:i,...a}=e,o=b9(S9,n),s=er(t,F.useRef(null),o.onViewportChange);return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}`},nonce:i}),(0,z.jsx)(Pr.div,{"data-radix-scroll-area-viewport":``,...a,ref:s,style:{overflowX:o.scrollbarXEnabled?`scroll`:`hidden`,overflowY:o.scrollbarYEnabled?`scroll`:`hidden`,...e.style},children:(0,z.jsx)(`div`,{ref:o.onContentChange,style:{minWidth:`100%`,display:`table`},children:r})})]})});C9.displayName=S9;var w9=`ScrollAreaScrollbar`,T9=F.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=b9(w9,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=i,s=e.orientation===`horizontal`;return F.useEffect(()=>(s?a(!0):o(!0),()=>{s?a(!1):o(!1)}),[s,a,o]),i.type===`hover`?(0,z.jsx)(Qce,{...r,ref:t,forceMount:n}):i.type===`scroll`?(0,z.jsx)($ce,{...r,ref:t,forceMount:n}):i.type===`auto`?(0,z.jsx)(E9,{...r,ref:t,forceMount:n}):i.type===`always`?(0,z.jsx)(D9,{...r,ref:t}):null});T9.displayName=w9;var Qce=F.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=b9(w9,e.__scopeScrollArea),[a,o]=F.useState(!1);return F.useEffect(()=>{let e=i.scrollArea,t=0;if(e){let n=()=>{window.clearTimeout(t),o(!0)},r=()=>{t=window.setTimeout(()=>o(!1),i.scrollHideDelay)};return e.addEventListener(`pointerenter`,n),e.addEventListener(`pointerleave`,r),()=>{window.clearTimeout(t),e.removeEventListener(`pointerenter`,n),e.removeEventListener(`pointerleave`,r)}}},[i.scrollArea,i.scrollHideDelay]),(0,z.jsx)(Lr,{present:n||a,children:(0,z.jsx)(E9,{"data-state":a?`visible`:`hidden`,...r,ref:t})})}),$ce=F.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=b9(w9,e.__scopeScrollArea),a=e.orientation===`horizontal`,o=B9(()=>c(`SCROLL_END`),100),[s,c]=Yce(`hidden`,{hidden:{SCROLL:`scrolling`},scrolling:{SCROLL_END:`idle`,POINTER_ENTER:`interacting`},interacting:{SCROLL:`interacting`,POINTER_LEAVE:`idle`},idle:{HIDE:`hidden`,SCROLL:`scrolling`,POINTER_ENTER:`interacting`}});return F.useEffect(()=>{if(s===`idle`){let e=window.setTimeout(()=>c(`HIDE`),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[s,i.scrollHideDelay,c]),F.useEffect(()=>{let e=i.viewport,t=a?`scrollLeft`:`scrollTop`;if(e){let n=e[t],r=()=>{let r=e[t];n!==r&&(c(`SCROLL`),o()),n=r};return e.addEventListener(`scroll`,r),()=>e.removeEventListener(`scroll`,r)}},[i.viewport,a,c,o]),(0,z.jsx)(Lr,{present:n||s!==`hidden`,children:(0,z.jsx)(D9,{"data-state":s===`hidden`?`hidden`:`visible`,...r,ref:t,onPointerEnter:_r(e.onPointerEnter,()=>c(`POINTER_ENTER`)),onPointerLeave:_r(e.onPointerLeave,()=>c(`POINTER_LEAVE`))})})}),E9=F.forwardRef((e,t)=>{let n=b9(w9,e.__scopeScrollArea),{forceMount:r,...i}=e,[a,o]=F.useState(!1),s=e.orientation===`horizontal`,c=B9(()=>{if(n.viewport){let e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;o(s?e:t)}},10);return V9(n.viewport,c),V9(n.content,c),(0,z.jsx)(Lr,{present:r||a,children:(0,z.jsx)(D9,{"data-state":a?`visible`:`hidden`,...i,ref:t})})}),D9=F.forwardRef((e,t)=>{let{orientation:n=`vertical`,...r}=e,i=b9(w9,e.__scopeScrollArea),a=F.useRef(null),o=F.useRef(0),[s,c]=F.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=F9(s.viewport,s.content),u={...r,sizes:s,onSizesChange:c,hasThumb:l>0&&l<1,onThumbChange:e=>a.current=e,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:e=>o.current=e};function d(e,t){return ale(e,o.current,s,t)}return n===`horizontal`?(0,z.jsx)(ele,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollLeft,t=L9(e,s,i.dir);a.current.style.transform=`translate3d(${t}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=d(e,i.dir))}}):n===`vertical`?(0,z.jsx)(tle,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollTop,t=L9(e,s);a.current.style.transform=`translate3d(0, ${t}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=d(e))}}):null}),ele=F.forwardRef((e,t)=>{let{sizes:n,onSizesChange:r,...i}=e,a=b9(w9,e.__scopeScrollArea),[o,s]=F.useState(),c=F.useRef(null),l=er(t,c,a.onScrollbarXChange);return F.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,z.jsx)(k9,{"data-orientation":`horizontal`,...i,ref:l,sizes:n,style:{bottom:0,left:a.dir===`rtl`?`var(--radix-scroll-area-corner-width)`:0,right:a.dir===`ltr`?`var(--radix-scroll-area-corner-width)`:0,"--radix-scroll-area-thumb-width":I9(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),z9(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:P9(o.paddingLeft),paddingEnd:P9(o.paddingRight)}})}})}),tle=F.forwardRef((e,t)=>{let{sizes:n,onSizesChange:r,...i}=e,a=b9(w9,e.__scopeScrollArea),[o,s]=F.useState(),c=F.useRef(null),l=er(t,c,a.onScrollbarYChange);return F.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,z.jsx)(k9,{"data-orientation":`vertical`,...i,ref:l,sizes:n,style:{top:0,right:a.dir===`ltr`?0:void 0,left:a.dir===`rtl`?0:void 0,bottom:`var(--radix-scroll-area-corner-height)`,"--radix-scroll-area-thumb-height":I9(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),z9(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:P9(o.paddingTop),paddingEnd:P9(o.paddingBottom)}})}})}),[nle,O9]=y9(w9),k9=F.forwardRef((e,t)=>{let{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:a,onThumbPointerUp:o,onThumbPointerDown:s,onThumbPositionChange:c,onDragScroll:l,onWheelScroll:u,onResize:d,...f}=e,p=b9(w9,n),[m,h]=F.useState(null),g=er(t,e=>h(e)),_=F.useRef(null),v=F.useRef(``),y=p.viewport,b=r.content-r.viewport,x=hi(u),S=hi(c),C=B9(d,10);function w(e){_.current&&l({x:e.clientX-_.current.left,y:e.clientY-_.current.top})}return F.useEffect(()=>{let e=e=>{let t=e.target;m?.contains(t)&&x(e,b)};return document.addEventListener(`wheel`,e,{passive:!1}),()=>document.removeEventListener(`wheel`,e,{passive:!1})},[y,m,b,x]),F.useEffect(S,[r,S]),V9(m,C),V9(p.content,C),(0,z.jsx)(nle,{scope:n,scrollbar:m,hasThumb:i,onThumbChange:hi(a),onThumbPointerUp:hi(o),onThumbPositionChange:S,onThumbPointerDown:hi(s),children:(0,z.jsx)(Pr.div,{...f,ref:g,style:{position:`absolute`,...f.style},onPointerDown:_r(e.onPointerDown,e=>{e.button===0&&(e.target.setPointerCapture(e.pointerId),_.current=m.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect=`none`,p.viewport&&(p.viewport.style.scrollBehavior=`auto`),w(e))}),onPointerMove:_r(e.onPointerMove,w),onPointerUp:_r(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=v.current,p.viewport&&(p.viewport.style.scrollBehavior=``),_.current=null})})})}),A9=`ScrollAreaThumb`,j9=F.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=O9(A9,e.__scopeScrollArea);return(0,z.jsx)(Lr,{present:n||i.hasThumb,children:(0,z.jsx)(rle,{ref:t,...r})})}),rle=F.forwardRef((e,t)=>{let{__scopeScrollArea:n,style:r,...i}=e,a=b9(A9,n),o=O9(A9,n),{onThumbPositionChange:s}=o,c=er(t,e=>o.onThumbChange(e)),l=F.useRef(void 0),u=B9(()=>{l.current&&=(l.current(),void 0)},100);return F.useEffect(()=>{let e=a.viewport;if(e){let t=()=>{u(),l.current||(l.current=ole(e,s),s())};return s(),e.addEventListener(`scroll`,t),()=>e.removeEventListener(`scroll`,t)}},[a.viewport,u,s]),(0,z.jsx)(Pr.div,{"data-state":o.hasThumb?`visible`:`hidden`,...i,ref:c,style:{width:`var(--radix-scroll-area-thumb-width)`,height:`var(--radix-scroll-area-thumb-height)`,...r},onPointerDownCapture:_r(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;o.onThumbPointerDown({x:n,y:r})}),onPointerUp:_r(e.onPointerUp,o.onThumbPointerUp)})});j9.displayName=A9;var M9=`ScrollAreaCorner`,N9=F.forwardRef((e,t)=>{let n=b9(M9,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!==`scroll`&&r?(0,z.jsx)(ile,{...e,ref:t}):null});N9.displayName=M9;var ile=F.forwardRef((e,t)=>{let{__scopeScrollArea:n,...r}=e,i=b9(M9,n),[a,o]=F.useState(0),[s,c]=F.useState(0),l=!!(a&&s);return V9(i.scrollbarX,()=>{let e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),c(e)}),V9(i.scrollbarY,()=>{let e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),o(e)}),l?(0,z.jsx)(Pr.div,{...r,ref:t,style:{width:a,height:s,position:`absolute`,right:i.dir===`ltr`?0:void 0,left:i.dir===`rtl`?0:void 0,bottom:0,...e.style}}):null});function P9(e){return e?parseInt(e,10):0}function F9(e,t){let n=e/t;return isNaN(n)?0:n}function I9(e){let t=F9(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function ale(e,t,n,r=`ltr`){let i=I9(n),a=i/2,o=t||a,s=i-o,c=n.scrollbar.paddingStart+o,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r===`ltr`?[0,u]:[u*-1,0];return R9([c,l],d)(e)}function L9(e,t,n=`ltr`){let r=I9(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=Jce(e,n===`ltr`?[0,o]:[o*-1,0]);return R9([0,o],[0,s])(c)}function R9(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function z9(e,t){return e>0&&e<t}var ole=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function i(){let a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,s=n.top!==a.top;(o||s)&&t(),n=a,r=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(r)};function B9(e,t){let n=hi(e),r=F.useRef(0);return F.useEffect(()=>()=>window.clearTimeout(r.current),[]),F.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function V9(e,t){let n=hi(t);xr(()=>{let t=0;if(e){let r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}var H9=x9,sle=C9,cle=N9,U9=F.forwardRef(({className:e,children:t,...n},r)=>(0,z.jsxs)(H9,{ref:r,className:R(`relative overflow-hidden`,e),...n,children:[(0,z.jsx)(sle,{className:`h-full w-full rounded-[inherit]`,children:t}),(0,z.jsx)(W9,{}),(0,z.jsx)(cle,{})]}));U9.displayName=H9.displayName;var W9=F.forwardRef(({className:e,orientation:t=`vertical`,...n},r)=>(0,z.jsx)(T9,{ref:r,orientation:t,className:R(`flex touch-none select-none transition-colors`,t===`vertical`&&`h-full w-2.5 border-l border-l-transparent p-[1px]`,t===`horizontal`&&`h-2.5 flex-col border-t border-t-transparent p-[1px]`,e),...n,children:(0,z.jsx)(j9,{className:`relative flex-1 rounded-full bg-border`})}));W9.displayName=T9.displayName;function G9({node:e,selectedPath:t,onSelect:n,expandedPaths:r,onToggleExpand:i,currentItemPath:a,rootPath:o}){if(e.type!==`directory`)return null;let s=r.has(e.path),c=t===e.path,l=e.path===a||a.startsWith(e.path+`/`),u=e.children&&e.children.length>0;return(0,z.jsxs)(`div`,{className:`select-none`,children:[(0,z.jsxs)(`div`,{className:R(`flex items-center gap-1 py-1.5 px-2 rounded-md cursor-pointer hover:bg-accent`,c&&`bg-accent`,l&&`opacity-50 pointer-events-none`),onClick:()=>!l&&n(e.path),children:[(0,z.jsx)(`button`,{onClick:t=>{t.stopPropagation(),u&&!l&&i(e.path)},className:R(`size-5 flex items-center justify-center rounded hover:bg-accent`,(!u||l)&&`invisible`),children:(0,z.jsx)(ge,{className:R(`size-3.5 transition-transform`,s&&`rotate-90`)})}),s?(0,z.jsx)(De,{className:`size-4 shrink-0 text-muted-foreground`}):(0,z.jsx)(ke,{className:`size-4 shrink-0 text-muted-foreground`}),(0,z.jsx)(`span`,{className:`text-sm truncate flex-1`,children:e.name}),c&&(0,z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`移动到这里`})]}),s&&u&&(0,z.jsx)(`div`,{className:`ml-4`,children:e.children.map(e=>(0,z.jsx)(G9,{node:e,selectedPath:t,onSelect:n,expandedPaths:r,onToggleExpand:i,currentItemPath:a,rootPath:o},e.path))})]})}function lle({open:e,onOpenChange:t,item:n,groups:r,onMove:i}){let[a,o]=(0,F.useState)(``),[s,c]=(0,F.useState)(null),[l,u]=(0,F.useState)(null),[d,f]=(0,F.useState)(new Set);(0,F.useEffect)(()=>{n&&e&&(o(n.path.substring(0,n.path.lastIndexOf(`/`))||`/`),c(n.rootPath),u(n.rootPath))},[n,e]);let p=e=>{f(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},m=()=>{if(n&&a!==null&&s!==null&&l!==null){let e=n.path.split(`/`).pop()||``,r=a===`/`?`/${e}`:`${a}/${e}`;(r!==n.path||l!==s)&&i(n.path,r,l,s),t(!1)}};if(!n)return null;let h=r.find(e=>e.root.path===s)?.files||[],g=a?a===`/`?`目录`:a.split(`/`).filter(Boolean).join(` / `):``;return(0,z.jsx)(d9,{open:e,onOpenChange:t,children:(0,z.jsxs)(p9,{className:`sm:max-w-[480px] max-h-[80vh] flex flex-col`,children:[(0,z.jsxs)(m9,{children:[(0,z.jsx)(g9,{children:`移动到`}),(0,z.jsxs)(_9,{children:[`选择要将「`,n.name,`」移动到的目标位置`]})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-2 py-2 text-sm text-muted-foreground`,children:[(0,z.jsx)(we,{className:`size-4 shrink-0`}),(0,z.jsx)(`span`,{className:`truncate`,children:n.name})]}),r.length>1&&(0,z.jsxs)(`div`,{className:`mb-3`,children:[(0,z.jsx)(`label`,{className:`text-xs text-muted-foreground mb-1.5 block`,children:`目标目录`}),(0,z.jsx)(`select`,{value:s||``,onChange:e=>{c(e.target.value),o(`/`),f(new Set)},className:`w-full px-3 py-2 text-sm border rounded-md bg-background`,children:r.map(e=>(0,z.jsx)(`option`,{value:e.root.path,children:e.root.path.split(`/`).pop()||e.root.path},e.root.path))})]}),(0,z.jsx)(U9,{className:`h-[300px] border rounded-md`,children:(0,z.jsxs)(`div`,{className:`p-2 space-y-0.5`,children:[(0,z.jsxs)(`div`,{className:R(`flex items-center gap-1 py-1.5 px-2 rounded-md cursor-pointer hover:bg-accent`,a===`/`&&`bg-accent`),onClick:()=>o(`/`),children:[(0,z.jsx)(ke,{className:`size-4 shrink-0 text-muted-foreground`}),(0,z.jsx)(`span`,{className:`text-sm`,children:`目录`}),a===`/`&&(0,z.jsx)(`span`,{className:`text-xs text-muted-foreground ml-auto`,children:`移动到这里`})]}),h.map(e=>(0,z.jsx)(G9,{node:e,selectedPath:a,onSelect:o,expandedPaths:d,onToggleExpand:p,currentItemPath:n.path,rootPath:s||``},e.path))]})}),(0,z.jsxs)(`div`,{className:`text-xs text-muted-foreground py-2`,children:[`目标位置: `,(0,z.jsx)(`span`,{className:`font-medium text-foreground`,children:g})]}),(0,z.jsxs)(h9,{children:[(0,z.jsx)(gr,{variant:`outline`,onClick:()=>t(!1),children:`取消`}),(0,z.jsx)(gr,{onClick:m,disabled:a===null,children:`移动`})]})]})})}function K9({node:e,selectedPath:t,onSelect:n,expandedPaths:r,onToggleExpand:i,currentItemPath:a,rootPath:o}){if(e.type!==`directory`)return null;let s=r.has(e.path),c=t===e.path,l=e.path===a||a.startsWith(e.path+`/`),u=e.children&&e.children.length>0;return(0,z.jsxs)(`div`,{className:`select-none`,children:[(0,z.jsxs)(`div`,{className:R(`flex items-center gap-1 py-1.5 px-2 rounded-md cursor-pointer hover:bg-accent`,c&&`bg-accent`,l&&`opacity-50 pointer-events-none`),onClick:()=>!l&&n(e.path),children:[(0,z.jsx)(`button`,{onClick:t=>{t.stopPropagation(),u&&!l&&i(e.path)},className:R(`size-5 flex items-center justify-center rounded hover:bg-accent`,(!u||l)&&`invisible`),children:(0,z.jsx)(ge,{className:R(`size-3.5 transition-transform`,s&&`rotate-90`)})}),s?(0,z.jsx)(De,{className:`size-4 shrink-0 text-muted-foreground`}):(0,z.jsx)(ke,{className:`size-4 shrink-0 text-muted-foreground`}),(0,z.jsx)(`span`,{className:`text-sm truncate flex-1`,children:e.name}),c&&(0,z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`复制到这里`})]}),s&&u&&(0,z.jsx)(`div`,{className:`ml-4`,children:e.children.map(e=>(0,z.jsx)(K9,{node:e,selectedPath:t,onSelect:n,expandedPaths:r,onToggleExpand:i,currentItemPath:a,rootPath:o},e.path))})]})}function ule({open:e,onOpenChange:t,item:n,groups:r,onCopy:i}){let[a,o]=(0,F.useState)(``),[s,c]=(0,F.useState)(null),[l,u]=(0,F.useState)(null),[d,f]=(0,F.useState)(new Set);(0,F.useEffect)(()=>{n&&e&&(o(n.path.substring(0,n.path.lastIndexOf(`/`))||`/`),c(n.rootPath),u(n.rootPath))},[n,e]);let p=e=>{f(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},m=()=>{if(n&&a!==null&&s!==null&&l!==null){let e=n.path.split(`/`).pop()||``,r=a===`/`?`/${e}`:`${a}/${e}`;i(n.path,r,l,s),t(!1)}};if(!n)return null;let h=r.find(e=>e.root.path===s)?.files||[],g=a?a===`/`?`目录`:a.split(`/`).filter(Boolean).join(` / `):``;return(0,z.jsx)(d9,{open:e,onOpenChange:t,children:(0,z.jsxs)(p9,{className:`sm:max-w-[480px] max-h-[80vh] flex flex-col`,children:[(0,z.jsxs)(m9,{children:[(0,z.jsx)(g9,{children:`复制到`}),(0,z.jsxs)(_9,{children:[`选择要将「`,n.name,`」复制到的目标位置`]})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-2 py-2 text-sm text-muted-foreground`,children:[(0,z.jsx)(we,{className:`size-4 shrink-0`}),(0,z.jsx)(`span`,{className:`truncate`,children:n.name})]}),r.length>1&&(0,z.jsxs)(`div`,{className:`mb-3`,children:[(0,z.jsx)(`label`,{className:`text-xs text-muted-foreground mb-1.5 block`,children:`目标目录`}),(0,z.jsx)(`select`,{value:s||``,onChange:e=>{c(e.target.value),o(`/`),f(new Set)},className:`w-full px-3 py-2 text-sm border rounded-md bg-background`,children:r.map(e=>(0,z.jsx)(`option`,{value:e.root.path,children:e.root.path.split(`/`).pop()||e.root.path},e.root.path))})]}),(0,z.jsx)(U9,{className:`h-[300px] border rounded-md`,children:(0,z.jsxs)(`div`,{className:`p-2 space-y-0.5`,children:[(0,z.jsxs)(`div`,{className:R(`flex items-center gap-1 py-1.5 px-2 rounded-md cursor-pointer hover:bg-accent`,a===`/`&&`bg-accent`),onClick:()=>o(`/`),children:[(0,z.jsx)(ke,{className:`size-4 shrink-0 text-muted-foreground`}),(0,z.jsx)(`span`,{className:`text-sm`,children:`目录`}),a===`/`&&(0,z.jsx)(`span`,{className:`text-xs text-muted-foreground ml-auto`,children:`复制到这里`})]}),h.map(e=>(0,z.jsx)(K9,{node:e,selectedPath:a,onSelect:o,expandedPaths:d,onToggleExpand:p,currentItemPath:n.path,rootPath:s||``},e.path))]})}),(0,z.jsxs)(`div`,{className:`text-xs text-muted-foreground py-2`,children:[`目标位置: `,(0,z.jsx)(`span`,{className:`font-medium text-foreground`,children:g})]}),(0,z.jsxs)(h9,{children:[(0,z.jsx)(gr,{variant:`outline`,onClick:()=>t(!1),children:`取消`}),(0,z.jsx)(gr,{onClick:m,disabled:a===null,children:`复制`})]})]})})}var q9=F.forwardRef(({className:e,checked:t,onCheckedChange:n,onClick:r,...i},a)=>(0,z.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":t,"data-state":t?`checked`:`unchecked`,ref:a,onClick:e=>{r?.(e),n&&n(!t)},className:R(`peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50`,`data-[state=checked]:bg-primary data-[state=unchecked]:bg-input`,e),...i,children:(0,z.jsx)(`span`,{"data-state":t?`checked`:`unchecked`,className:R(`pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform`,`data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0`)})}));q9.displayName=`Switch`;function dle({open:e,onOpenChange:t}){let[n,r]=F.useState({showHiddenFiles:!1,allowedExtensions:`.md,.markdown,.mdown,.mkdn,.mkd,.mdwn,.mkdown,.ron`,ignore:{patterns:``}}),[i,a]=F.useState(!1),[o,s]=F.useState(null),[c,l]=F.useState(()=>typeof window>`u`?!1:window.innerWidth<768);F.useEffect(()=>{let e=()=>l(window.innerWidth<768);return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),F.useEffect(()=>{e&&fetch(`/api/files/config`).then(e=>e.json()).then(e=>{r({showHiddenFiles:e.showHiddenFiles??!1,allowedExtensions:(e.allowedExtensions||[]).join(`,`),ignore:{patterns:(e.ignore?.patterns||[]).join(`
572
+ $$`),e.closeBlock(t)}}}}}),t8=class e{static instance=null;queue=[];running=new Set;cache=new Map;MAX_CONCURRENT=2;MAX_CACHE_SIZE=50;static getInstance(){return e.instance||=new e,e.instance}request(e,t,n,r){let i=this.getCacheKey(t,n),a=this.cache.get(i);if(a){r(a);return}this.cancel(e),this.queue.push({id:e,source:t,theme:n,callback:r}),this.processQueue()}cancel(e){let t=this.queue.findIndex(t=>t.id===e);t!==-1&&this.queue.splice(t,1),this.running.delete(e)}getCacheKey(e,t){return`${t}::${e}`}getFromCache(e,t){let n=this.getCacheKey(e,t),r=this.cache.get(n);return r?(this.cache.delete(n),this.cache.set(n,r),r):null}setCache(e,t,n){let r=this.getCacheKey(e,t);for(this.cache.has(r)&&this.cache.delete(r);this.cache.size>=this.MAX_CACHE_SIZE;){let e=this.cache.keys().next().value;e!==void 0&&this.cache.delete(e)}this.cache.set(r,n)}processQueue(){if(this.running.size>=this.MAX_CONCURRENT||this.queue.length===0)return;let e=this.queue.shift();e&&(this.running.add(e.id),this.runRender(e))}async runRender(e){let t=this.getFromCache(e.source,e.theme);if(t){this.running.has(e.id)&&(this.running.delete(e.id),e.callback(t)),this.processQueue();return}try{t4.initialize({startOnLoad:!1,theme:e.theme,suppressErrorRendering:!0});let t=`mermaid-queued-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,{svg:n}=await t4.render(t,e.source),r={svg:n,error:``};this.setCache(e.source,e.theme,r),this.running.has(e.id)&&(this.running.delete(e.id),e.callback(r))}catch(t){let n={svg:``,error:t.message||`Mermaid render error`};this.setCache(e.source,e.theme,n),this.running.has(e.id)&&(this.running.delete(e.id),e.callback(n))}finally{this.processQueue()}}}.getInstance(),Wae=KN(UN);function Gae(e,t){let n=t.substring(0,t.lastIndexOf(`/`)),r=e;if(e.startsWith(`./`))r=n+e.slice(1);else if(e.startsWith(`../`)){let t=n,i=e.slice(3);for(;i.startsWith(`../`);){let e=t.lastIndexOf(`/`);if(e<=0)break;t=t.substring(0,e),i=i.slice(3)}r=i.startsWith(`../`)?e:t+`/`+i}else e.startsWith(`/`)||(r=n+`/`+e);return decodeURIComponent(r)}function Kae(e,t,n){if(e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`data:`)||!t||!n)return e;let r;return r=e.startsWith(`/`)?e:Gae(e,t),`/api/files${r}?root=${encodeURIComponent(n)}`}var n8={path:null,rootPath:null};function qae({node:e,updateAttributes:t,selected:n,editor:r,getPos:i}){let a=e.attrs.language===`mermaid`,[o,s]=(0,F.useState)(``),[c,l]=(0,F.useState)(``),[u,d]=(0,F.useState)(!1),[f,p]=(0,F.useState)(0),[m,h]=(0,F.useState)(!1),[g,_]=(0,F.useState)(!1),[v,y]=(0,F.useState)(!1),b=(0,F.useRef)(null),x=(0,F.useRef)(`mermaid-${Date.now()}-${Math.random().toString(36).substr(2,9)}`),S=(0,F.useCallback)(async()=>{let t=e.textContent;if(t){if(navigator.clipboard?.writeText)await navigator.clipboard.writeText(t);else{let e=document.createElement(`textarea`);e.value=t,e.style.position=`fixed`,e.style.opacity=`0`,document.body.appendChild(e),e.select(),document.execCommand(`copy`),document.body.removeChild(e)}h(!0),setTimeout(()=>h(!1),1500)}},[e.textContent]),C=e.textContent;return(0,F.useEffect)(()=>{let e=()=>{p(e=>e+1)};return window.addEventListener(`theme-change`,e),()=>window.removeEventListener(`theme-change`,e)},[]),(0,F.useEffect)(()=>{if(!a)return;let e=b.current;if(!e)return;let t=new IntersectionObserver(([e])=>{_(e.isIntersecting)},{rootMargin:`200px`});return t.observe(e),()=>t.disconnect()},[a]),(0,F.useEffect)(()=>{if(!a){s(``),l(``),y(!1);return}if(!C){s(``),l(``),y(!1);return}if(!g){o||y(!1);return}let e=document.documentElement.classList.contains(`dark`)?`dark`:`default`;return y(!0),x.current=`mermaid-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,t8.request(x.current,C,e,e=>{s(e.svg),l(e.error),y(!1)}),()=>{t8.cancel(x.current)}},[a,C,g,f]),(0,z.jsxs)(jb,{className:`code-block-wrapper ${n?`selected`:``}`,children:[(0,z.jsxs)(`div`,{className:`code-block-header`,children:[(0,z.jsxs)(`select`,{contentEditable:!1,value:e.attrs.language||``,onChange:e=>t({language:e.target.value}),children:[(0,z.jsx)(`option`,{value:``,children:`Plain Text`}),(0,z.jsx)(`option`,{value:`mermaid`,children:`Mermaid`}),(0,z.jsx)(`option`,{value:`javascript`,children:`JavaScript`}),(0,z.jsx)(`option`,{value:`typescript`,children:`TypeScript`}),(0,z.jsx)(`option`,{value:`html`,children:`HTML`}),(0,z.jsx)(`option`,{value:`css`,children:`CSS`}),(0,z.jsx)(`option`,{value:`python`,children:`Python`}),(0,z.jsx)(`option`,{value:`java`,children:`Java`}),(0,z.jsx)(`option`,{value:`cpp`,children:`C++`}),(0,z.jsx)(`option`,{value:`go`,children:`Go`}),(0,z.jsx)(`option`,{value:`rust`,children:`Rust`}),(0,z.jsx)(`option`,{value:`json`,children:`JSON`}),(0,z.jsx)(`option`,{value:`markdown`,children:`Markdown`}),(0,z.jsx)(`option`,{value:`bash`,children:`Bash`})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,z.jsx)(`button`,{className:`code-block-copy-btn`,contentEditable:!1,onClick:S,title:m?`已复制`:`复制代码`,children:m?(0,z.jsx)(me,{className:`size-4`}):(0,z.jsx)(be,{className:`size-4`})}),a&&(0,z.jsx)(`button`,{className:`mermaid-fullscreen-btn`,contentEditable:!1,onClick:()=>d(!0),title:`全屏预览`,children:(0,z.jsx)(Fe,{className:`size-4`})})]})]}),a?(0,z.jsx)(`div`,{ref:b,className:`mermaid-preview`,contentEditable:!1,children:c?(0,z.jsxs)(`div`,{className:`mermaid-error`,children:[`Mermaid Error: `,c]}):o?(0,z.jsx)(`div`,{className:`mermaid-svg-container`,dangerouslySetInnerHTML:{__html:o}}):v?(0,z.jsx)(`div`,{className:`mermaid-loading`,children:`渲染中...`}):(0,z.jsx)(`div`,{className:`mermaid-placeholder`,children:`滚动查看图表`})}):(0,z.jsx)(`pre`,{className:`code-block`,children:(0,z.jsx)(`code`,{children:(0,z.jsx)(Ab,{})})}),a&&(0,z.jsx)(i4,{source:C,open:u,onOpenChange:e=>d(e),onSourceChange:e=>{let t=typeof i==`function`?i():i;t!=null&&r.commands.command(({tr:n})=>{let r=t+1,i=r+e.length;return n.replaceWith(r,i,n.doc.type.schema.text(e)),!0})}})]})}var Jae=jw.extend({addNodeView(){return zb(qae)}}).configure({lowlight:Wae});function Yae({value:e,onChange:t,mode:n,placeholder:r,readOnly:i,path:a,rootPath:o,scrollPosition:s,onLinkClick:c}){n8.path=a??null,n8.rootPath=o??null;let l=(0,F.useRef)(!1),u=(0,F.useRef)(e),d=(0,F.useRef)(0),f=(0,F.useRef)(null),[p,m]=(0,F.useState)(()=>typeof window>`u`?!1:window.innerWidth<768),{frontmatter:h,body:g}=Q6(e),_=e8(g),[v,y]=(0,F.useState)(h);f.current=v;let b=(0,F.useRef)(null);(0,F.useEffect)(()=>{y(h)},[h]);let x=(0,F.useCallback)(e=>{y(e),f.current=e;let n=b.current;if(n)try{let r=n.storage.markdown,i=r&&typeof r.getMarkdown==`function`?r.getMarkdown():n.getText(),a=i;e&&(a=`---\n${e}\n---\n${i}`),a!==u.current&&(u.current=a,t(a))}catch(e){console.error(`Failed to rebuild content with frontmatter:`,e)}},[t]);(0,F.useEffect)(()=>{let e=()=>m(window.innerWidth<768);return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]);let S=Eb({extensions:[Cw.configure({codeBlock:!1,link:!1,underline:!1}),Jae,Mw.configure({placeholder:r||`在这里输入 Markdown...`}),ak.configure({html:!0,transformPastedText:!0,transformCopiedText:!0}),uj.configure({resizable:!0}),ZA,XA,YA,JC,qC.configure({nested:!0}),xC.configure({openOnClick:!1}),fj.extend({addAttributes(){return{...this.parent?.(),style:{default:null},class:{default:null},htmlAttrs:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?`img[src]`:`img[src]:not([src^="data:"])`,getAttrs:e=>{let t=e,n=[`src`,`alt`,`title`,`width`,`height`,`style`,`class`,`htmlAttrs`,`draggable`],r={};for(let e of t.attributes)n.includes(e.name)||(r[e.name]=e.value);return{src:t.getAttribute(`src`),alt:t.getAttribute(`alt`),title:t.getAttribute(`title`),width:t.getAttribute(`width`),height:t.getAttribute(`height`),style:t.getAttribute(`style`),class:t.getAttribute(`class`),htmlAttrs:Object.keys(r).length>0?JSON.stringify(r):null}}}]},addStorage(){return{markdown:{serialize(e,t){if(t.attrs.width||t.attrs.height||t.attrs.style||t.attrs.class||t.attrs.htmlAttrs){let n={src:t.attrs.src};if(t.attrs.alt&&(n.alt=t.attrs.alt),t.attrs.title&&(n.title=t.attrs.title),t.attrs.width&&(n.width=String(t.attrs.width)),t.attrs.height&&(n.height=String(t.attrs.height)),t.attrs.style&&(n.style=t.attrs.style),t.attrs.class&&(n.class=t.attrs.class),t.attrs.htmlAttrs)try{let e=JSON.parse(t.attrs.htmlAttrs);Object.assign(n,e)}catch{}let r=Object.entries(n).map(([e,t])=>`${e}="${t.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`)}"`).join(` `);e.write(`<img ${r}>`)}else{let n=e.esc(t.attrs.alt||``),r=e.esc(t.attrs.src||``),i=t.attrs.title?` "${e.esc(t.attrs.title)}"`:``;e.write(`![${n}](${r}${i})`)}e.closeBlock(t)}}}},addNodeView(){return({node:e})=>{let t=document.createElement(`img`),n=(n=e)=>{t.src=Kae(n.attrs.src,n8.path,n8.rootPath),n.attrs.alt?t.alt=n.attrs.alt:t.removeAttribute(`alt`),n.attrs.title?t.title=n.attrs.title:t.removeAttribute(`title`),n.attrs.width?t.setAttribute(`width`,String(n.attrs.width)):t.removeAttribute(`width`),n.attrs.height?t.setAttribute(`height`,String(n.attrs.height)):t.removeAttribute(`height`),t.className=n.attrs.class||``,t.style.cssText=n.attrs.style||``;let r=[`src`,`alt`,`title`,`width`,`height`,`style`,`class`,`contenteditable`,`draggable`];for(let e of Array.from(t.attributes))r.includes(e.name)||t.removeAttribute(e.name);if(n.attrs.htmlAttrs)try{let e=JSON.parse(n.attrs.htmlAttrs);for(let[n,r]of Object.entries(e))r!=null&&t.setAttribute(n,String(r))}catch{}};return n(),{dom:t,update:e=>e.type.name===`image`?(n(e),!0):!1}}}}).configure({allowBase64:!0}),hj.configure({multicolor:!0}),ZC,Rj,Hae,Uae],content:_,editable:!i&&n===`wysiwyg`,onUpdate:({editor:e})=>{if(!l.current)try{let n=e.storage.markdown,r=n&&typeof n.getMarkdown==`function`?n.getMarkdown():e.getText(),i=f.current,a=r;i&&(a=`---\n${i}\n---\n${r}`),a!==u.current&&(u.current=a,t(a))}catch(n){console.error(`Failed to get markdown:`,n);let r=e.getText();r!==u.current&&(u.current=r,t(r))}}});return b.current=S,(0,F.useEffect)(()=>{S&&S.view.updateState(S.state)},[a,o,S]),(0,F.useEffect)(()=>{if(!S||l.current)return;let{frontmatter:t,body:n}=Q6(e);f.current=t;let r=e8(n),i=``;try{let e=S.storage.markdown;i=e&&typeof e.getMarkdown==`function`?e.getMarkdown():S.getText()}catch{i=S.getText()}if(i===n){u.current=e;return}let{from:a,to:o}=S.state.selection;l.current=!0,S.commands.setContent(r),u.current=e,requestAnimationFrame(()=>{l.current=!1;try{let e=S.state.doc.content.size,t=Math.min(a,e),n=Math.min(o,e);t>=0&&n>=0&&S.commands.setTextSelection({from:t,to:n})}catch{S.commands.setTextSelection({from:0,to:0})}})},[S,e]),(0,F.useEffect)(()=>{S&&S.setEditable(!i&&n===`wysiwyg`)},[S,i,n]),(0,F.useEffect)(()=>{if(!a||!c)return;let e=e=>{let t=e.target.closest(`a`);if(!t)return;let n=document.querySelector(`.tiptap-editor`);if(!n||!n.contains(t))return;e.preventDefault(),e.stopPropagation();let r=t.getAttribute(`href`);if(!r)return;if(r.startsWith(`http://`)||r.startsWith(`https://`)||r.startsWith(`mailto:`)||r.startsWith(`#`)){window.open(r,`_blank`,`noopener,noreferrer`);return}let i=a.substring(0,a.lastIndexOf(`/`)),o=r;if(r.startsWith(`./`))o=i+r.slice(1);else if(r.startsWith(`../`)){let e=i,t=r.slice(3);for(;t.startsWith(`../`);){let n=e.lastIndexOf(`/`);if(n<=0)break;e=e.substring(0,n),t=t.slice(3)}o=t.startsWith(`../`)?r:e+`/`+t}else r.startsWith(`/`)||(o=i+`/`+r);o=decodeURIComponent(o),c(o)};return document.addEventListener(`click`,e,!0),()=>document.removeEventListener(`click`,e,!0)},[a,c]),(0,F.useEffect)(()=>{if(n===`source`){let e=document.querySelector(`.editor-textarea`);if(e){let t=d.current||s||0;t>0&&requestAnimationFrame(()=>{e.scrollTop=t})}}else if(n===`wysiwyg`){let e=document.querySelector(`.editor-textarea`);e&&(d.current=e.scrollTop);let t=d.current||s||0;if(t>0){let e=document.querySelector(`.tiptap-editor`);e&&requestAnimationFrame(()=>{e.scrollTop=t})}}},[n,s]),n===`source`?(0,z.jsx)(`textarea`,{className:`editor-textarea`,value:e,onChange:e=>t(e.target.value),placeholder:r||`在这里输入 Markdown...`,readOnly:i,spellCheck:!1}):(0,z.jsxs)(`div`,{className:`tiptap-editor-root tiptap-editor`,children:[(0,z.jsx)(`div`,{className:`tiptap-editor-toolbar-area`,children:n===`wysiwyg`&&!p&&(0,z.jsx)(c4,{editor:S,variant:`desktop`})}),(0,z.jsxs)(`div`,{className:`tiptap-editor-scroll-area`,children:[(0,z.jsx)(Bae,{rawFrontmatter:v,onFrontmatterChange:x}),(0,z.jsx)(vb,{editor:S,className:`tiptap-editor-content`})]}),p&&n===`wysiwyg`&&(0,z.jsx)(c4,{editor:S,variant:`mobile`})]})}function r8(e){let t=e+`CollectionProvider`,[n,r]=yr(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=F.useRef(null),a=F.useRef(new Map).current;return(0,z.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=Dr(s),l=F.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,z.jsx)(c,{ref:er(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=Dr(u),p=F.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=F.useRef(null),s=er(t,o),c=a(u,n);return F.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,z.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return F.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:l,ItemSlot:p},m,r]}var Xae=F.createContext(void 0);function i8(e){let t=F.useContext(Xae);return e||t||`ltr`}var Zae=[`top`,`right`,`bottom`,`left`],a8=Math.min,o8=Math.max,s8=Math.round,c8=Math.floor,l8=e=>({x:e,y:e}),Qae={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function u8(e,t,n){return o8(e,a8(t,n))}function d8(e,t){return typeof e==`function`?e(t):e}function f8(e){return e.split(`-`)[0]}function p8(e){return e.split(`-`)[1]}function m8(e){return e===`x`?`y`:`x`}function h8(e){return e===`y`?`height`:`width`}function g8(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function _8(e){return m8(g8(e))}function $ae(e,t,n){n===void 0&&(n=!1);let r=p8(e),i=_8(e),a=h8(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=x8(o)),[o,x8(o)]}function eoe(e){let t=x8(e);return[v8(e),t,v8(t)]}function v8(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var y8=[`left`,`right`],b8=[`right`,`left`],toe=[`top`,`bottom`],noe=[`bottom`,`top`];function roe(e,t,n){switch(e){case`top`:case`bottom`:return n?t?b8:y8:t?y8:b8;case`left`:case`right`:return t?toe:noe;default:return[]}}function ioe(e,t,n,r){let i=p8(e),a=roe(f8(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(v8)))),a}function x8(e){let t=f8(e);return Qae[t]+e.slice(t.length)}function aoe(e){return{top:0,right:0,bottom:0,left:0,...e}}function S8(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:aoe(e)}function C8(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function w8(e,t,n){let{reference:r,floating:i}=e,a=g8(t),o=_8(t),s=h8(o),c=f8(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(p8(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function ooe(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=d8(t,e),p=S8(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=C8(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=C8(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var soe=50,coe=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:ooe},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=w8(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<soe&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=w8(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},loe=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=d8(e,t)||{};if(l==null)return{};let d=S8(u),f={x:n,y:r},p=_8(i),m=h8(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=a8(d[_],T),D=a8(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,ee=u8(O,A,k),j=!c.arrow&&p8(i)!=null&&A!==ee&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,te=j?A<O?A-O:A-k:0;return{[p]:f[p]+te,data:{[p]:ee,centerOffset:A-ee-te,...j&&{alignmentOffset:te}},reset:j}}}),uoe=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=d8(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=f8(r),_=g8(o),v=f8(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[x8(o)]:eoe(o)),x=p!==`none`;!d&&x&&b.push(...ioe(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=$ae(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==g8(t))||T.every(e=>g8(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=g8(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function T8(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function E8(e){return Zae.some(t=>e[t]>=0)}var doe=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=d8(e,t);switch(i){case`referenceHidden`:{let e=T8(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:E8(e)}}}case`escaped`:{let e=T8(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:E8(e)}}}default:return{}}}}},D8=new Set([`left`,`top`]);async function foe(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=f8(n),s=p8(n),c=g8(n)===`y`,l=D8.has(o)?-1:1,u=a&&c?-1:1,d=d8(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var poe=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await foe(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},moe=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=d8(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=g8(f8(i)),p=m8(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=u8(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=u8(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},hoe=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=d8(e,t),u={x:n,y:r},d=g8(i),f=m8(d),p=u[f],m=u[d],h=d8(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=D8.has(f8(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},goe=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=d8(e,t),u=await o.detectOverflow(t,l),d=f8(i),f=p8(i),p=g8(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=a8(h-u[g],v),x=a8(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=o8(u.left,0),t=o8(u.right,0),n=o8(u.top,0),r=o8(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:o8(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:o8(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function O8(){return typeof window<`u`}function k8(e){return M8(e)?(e.nodeName||``).toLowerCase():`#document`}function A8(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function j8(e){return((M8(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function M8(e){return O8()?e instanceof Node||e instanceof A8(e).Node:!1}function N8(e){return O8()?e instanceof Element||e instanceof A8(e).Element:!1}function P8(e){return O8()?e instanceof HTMLElement||e instanceof A8(e).HTMLElement:!1}function F8(e){return!O8()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof A8(e).ShadowRoot}function I8(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=U8(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function _oe(e){return/^(table|td|th)$/.test(k8(e))}function L8(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var voe=/transform|translate|scale|rotate|perspective|filter/,yoe=/paint|layout|strict|content/,R8=e=>!!e&&e!==`none`,z8;function B8(e){let t=N8(e)?U8(e):e;return R8(t.transform)||R8(t.translate)||R8(t.scale)||R8(t.rotate)||R8(t.perspective)||!V8()&&(R8(t.backdropFilter)||R8(t.filter))||voe.test(t.willChange||``)||yoe.test(t.contain||``)}function boe(e){let t=G8(e);for(;P8(t)&&!H8(t);){if(B8(t))return t;if(L8(t))return null;t=G8(t)}return null}function V8(){return z8??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),z8}function H8(e){return/^(html|body|#document)$/.test(k8(e))}function U8(e){return A8(e).getComputedStyle(e)}function W8(e){return N8(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function G8(e){if(k8(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||F8(e)&&e.host||j8(e);return F8(t)?t.host:t}function K8(e){let t=G8(e);return H8(t)?e.ownerDocument?e.ownerDocument.body:e.body:P8(t)&&I8(t)?t:K8(t)}function q8(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=K8(e),i=r===e.ownerDocument?.body,a=A8(r);if(i){let e=J8(a);return t.concat(a,a.visualViewport||[],I8(r)?r:[],e&&n?q8(e):[])}else return t.concat(r,q8(r,[],n))}function J8(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Y8(e){let t=U8(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=P8(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=s8(n)!==a||s8(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function X8(e){return N8(e)?e:e.contextElement}function Z8(e){let t=X8(e);if(!P8(t))return l8(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Y8(t),o=(a?s8(n.width):n.width)/r,s=(a?s8(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var xoe=l8(0);function Q8(e){let t=A8(e);return!V8()||!t.visualViewport?xoe:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Soe(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==A8(e)?!1:t}function $8(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=X8(e),o=l8(1);t&&(r?N8(r)&&(o=Z8(r)):o=Z8(e));let s=Soe(a,n,r)?Q8(a):l8(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=A8(a),t=r&&N8(r)?A8(r):r,n=e,i=J8(n);for(;i&&r&&t!==n;){let e=Z8(i),t=i.getBoundingClientRect(),r=U8(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=A8(i),i=J8(n)}}return C8({width:u,height:d,x:c,y:l})}function e5(e,t){let n=W8(e).scrollLeft;return t?t.left+n:$8(j8(e)).left+n}function t5(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-e5(e,n),y:n.top+t.scrollTop}}function Coe(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=j8(r),s=t?L8(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=l8(1),u=l8(0),d=P8(r);if((d||!d&&!a)&&((k8(r)!==`body`||I8(o))&&(c=W8(r)),d)){let e=$8(r);l=Z8(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?t5(o,c):l8(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function woe(e){return Array.from(e.getClientRects())}function Toe(e){let t=j8(e),n=W8(e),r=e.ownerDocument.body,i=o8(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=o8(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+e5(e),s=-n.scrollTop;return U8(r).direction===`rtl`&&(o+=o8(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var n5=25;function Eoe(e,t){let n=A8(e),r=j8(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=V8();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=e5(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=n5&&(a-=o)}else l<=n5&&(a+=l);return{width:a,height:o,x:s,y:c}}function Doe(e,t){let n=$8(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=P8(e)?Z8(e):l8(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function r5(e,t,n){let r;if(t===`viewport`)r=Eoe(e,n);else if(t===`document`)r=Toe(j8(e));else if(N8(t))r=Doe(t,n);else{let n=Q8(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return C8(r)}function i5(e,t){let n=G8(e);return n===t||!N8(n)||H8(n)?!1:U8(n).position===`fixed`||i5(n,t)}function Ooe(e,t){let n=t.get(e);if(n)return n;let r=q8(e,[],!1).filter(e=>N8(e)&&k8(e)!==`body`),i=null,a=U8(e).position===`fixed`,o=a?G8(e):e;for(;N8(o)&&!H8(o);){let t=U8(o),n=B8(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||I8(o)&&!n&&i5(e,o))?r=r.filter(e=>e!==o):i=t,o=G8(o)}return t.set(e,r),r}function koe(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?L8(t)?[]:Ooe(t,this._c):[].concat(n),r],o=r5(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=r5(t,a[e],i);s=o8(n.top,s),c=a8(n.right,c),l=a8(n.bottom,l),u=o8(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Aoe(e){let{width:t,height:n}=Y8(e);return{width:t,height:n}}function joe(e,t,n){let r=P8(t),i=j8(t),a=n===`fixed`,o=$8(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=l8(0);function l(){c.x=e5(i)}if(r||!r&&!a)if((k8(t)!==`body`||I8(i))&&(s=W8(t)),r){let e=$8(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?t5(i,s):l8(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function a5(e){return U8(e).position===`static`}function o5(e,t){if(!P8(e)||U8(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return j8(e)===n&&(n=n.ownerDocument.body),n}function s5(e,t){let n=A8(e);if(L8(e))return n;if(!P8(e)){let t=G8(e);for(;t&&!H8(t);){if(N8(t)&&!a5(t))return t;t=G8(t)}return n}let r=o5(e,t);for(;r&&_oe(r)&&a5(r);)r=o5(r,t);return r&&H8(r)&&a5(r)&&!B8(r)?n:r||boe(e)||n}var Moe=async function(e){let t=this.getOffsetParent||s5,n=this.getDimensions,r=await n(e.floating);return{reference:joe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Noe(e){return U8(e).direction===`rtl`}var Poe={convertOffsetParentRelativeRectToViewportRelativeRect:Coe,getDocumentElement:j8,getClippingRect:koe,getOffsetParent:s5,getElementRects:Moe,getClientRects:woe,getDimensions:Aoe,getScale:Z8,isElement:N8,isRTL:Noe};function c5(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Foe(e,t){let n=null,r,i=j8(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=c8(d),h=c8(i.clientWidth-(u+f)),g=c8(i.clientHeight-(d+p)),_=c8(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:o8(0,a8(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!c5(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Ioe(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=X8(e),u=i||a?[...l?q8(l):[],...t?q8(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Foe(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?$8(e):null;c&&g();function g(){let t=$8(e);h&&!c5(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Loe=poe,Roe=moe,zoe=uoe,Boe=goe,Voe=doe,l5=loe,Hoe=hoe,Uoe=(e,t,n)=>{let r=new Map,i={platform:Poe,...n},a={...i.platform,_c:r};return coe(e,t,{...i,platform:a})},u5=typeof document<`u`?F.useLayoutEffect:function(){};function d5(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!d5(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!d5(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function f5(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function p5(e,t){let n=f5(e);return Math.round(t*n)/n}function m5(e){let t=F.useRef(e);return u5(()=>{t.current=e}),t}function Woe(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=F.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=F.useState(r);d5(f,r)||p(r);let[m,h]=F.useState(null),[g,_]=F.useState(null),v=F.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=F.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=F.useRef(null),C=F.useRef(null),w=F.useRef(u),T=c!=null,E=m5(c),D=m5(i),O=m5(l),k=F.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),Uoe(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!d5(w.current,t)&&(w.current=t,Er.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);u5(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=F.useRef(!1);u5(()=>(A.current=!0,()=>{A.current=!1}),[]),u5(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let ee=F.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),j=F.useMemo(()=>({reference:b,floating:x}),[b,x]),te=F.useMemo(()=>{let e={position:n,left:0,top:0};if(!j.floating)return e;let t=p5(j.floating,u.x),r=p5(j.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...f5(j.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,j.floating,u.x,u.y]);return F.useMemo(()=>({...u,update:k,refs:ee,elements:j,floatingStyles:te}),[u,k,ee,j,te])}var Goe=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:l5({element:r.current,padding:i}).fn(n):r?l5({element:r,padding:i}).fn(n):{}}}},Koe=(e,t)=>{let n=Loe(e);return{name:n.name,fn:n.fn,options:[e,t]}},qoe=(e,t)=>{let n=Roe(e);return{name:n.name,fn:n.fn,options:[e,t]}},Joe=(e,t)=>({fn:Hoe(e).fn,options:[e,t]}),Yoe=(e,t)=>{let n=zoe(e);return{name:n.name,fn:n.fn,options:[e,t]}},Xoe=(e,t)=>{let n=Boe(e);return{name:n.name,fn:n.fn,options:[e,t]}},Zoe=(e,t)=>{let n=Voe(e);return{name:n.name,fn:n.fn,options:[e,t]}},Qoe=(e,t)=>{let n=Goe(e);return{name:n.name,fn:n.fn,options:[e,t]}},$oe=`Arrow`,h5=F.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,z.jsx)(Pr.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,z.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});h5.displayName=$oe;var ese=h5;function tse(e){let[t,n]=F.useState(void 0);return xr(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var g5=`Popper`,[_5,v5]=yr(g5),[nse,y5]=_5(g5),b5=e=>{let{__scopePopper:t,children:n}=e,[r,i]=F.useState(null);return(0,z.jsx)(nse,{scope:t,anchor:r,onAnchorChange:i,children:n})};b5.displayName=g5;var x5=`PopperAnchor`,S5=F.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=y5(x5,n),o=F.useRef(null),s=er(t,o),c=F.useRef(null);return F.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,z.jsx)(Pr.div,{...i,ref:s})});S5.displayName=x5;var C5=`PopperContent`,[rse,ise]=_5(C5),w5=F.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=y5(C5,n),[_,v]=F.useState(null),y=er(t,e=>v(e)),[b,x]=F.useState(null),S=tse(b),C=S?.width??0,w=S?.height??0,T=r+(a===`center`?``:`-`+a),E=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},D=Array.isArray(l)?l:[l],O=D.length>0,k={padding:E,boundary:D.filter(ose),altBoundary:O},{refs:A,floatingStyles:ee,placement:j,isPositioned:te,middlewareData:M}=Woe({strategy:`fixed`,placement:T,whileElementsMounted:(...e)=>Ioe(...e,{animationFrame:p===`always`}),elements:{reference:g.anchor},middleware:[Koe({mainAxis:i+w,alignmentAxis:o}),c&&qoe({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?Joe():void 0,...k}),c&&Yoe({...k}),Xoe({...k,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),b&&Qoe({element:b,padding:s}),sse({arrowWidth:C,arrowHeight:w}),f&&Zoe({strategy:`referenceHidden`,...k})]}),[ne,N]=D5(j),re=hi(m);xr(()=>{te&&re?.()},[te,re]);let ie=M.arrow?.x,ae=M.arrow?.y,oe=M.arrow?.centerOffset!==0,[P,se]=F.useState();return xr(()=>{_&&se(window.getComputedStyle(_).zIndex)},[_]),(0,z.jsx)(`div`,{ref:A.setFloating,"data-radix-popper-content-wrapper":``,style:{...ee,transform:te?ee.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:P,"--radix-popper-transform-origin":[M.transformOrigin?.x,M.transformOrigin?.y].join(` `),...M.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,z.jsx)(rse,{scope:n,placedSide:ne,onArrowChange:x,arrowX:ie,arrowY:ae,shouldHideArrow:oe,children:(0,z.jsx)(Pr.div,{"data-side":ne,"data-align":N,...h,ref:y,style:{...h.style,animation:te?void 0:`none`}})})})});w5.displayName=C5;var T5=`PopperArrow`,ase={top:`bottom`,right:`left`,bottom:`top`,left:`right`},E5=F.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=ise(T5,n),a=ase[i.placedSide];return(0,z.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,z.jsx)(ese,{...r,ref:t,style:{...r.style,display:`block`}})})});E5.displayName=T5;function ose(e){return e!==null}var sse=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=D5(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function D5(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var O5=b5,cse=S5,lse=w5,use=E5,k5=`rovingFocusGroup.onEntryFocus`,dse={bubbles:!1,cancelable:!0},A5=`RovingFocusGroup`,[j5,M5,fse]=r8(A5),[pse,N5]=yr(A5,[fse]),[mse,hse]=pse(A5),P5=F.forwardRef((e,t)=>(0,z.jsx)(j5.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,z.jsx)(j5.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,z.jsx)(gse,{...e,ref:t})})}));P5.displayName=A5;var gse=F.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=F.useRef(null),p=er(t,f),m=i8(a),[h,g]=Cr({prop:o,defaultProp:s??null,onChange:c,caller:A5}),[_,v]=F.useState(!1),y=hi(l),b=M5(n),x=F.useRef(!1),[S,C]=F.useState(0);return F.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(k5,y),()=>e.removeEventListener(k5,y)},[y]),(0,z.jsx)(mse,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:F.useCallback(e=>g(e),[g]),onItemShiftTab:F.useCallback(()=>v(!0),[]),onFocusableItemAdd:F.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:F.useCallback(()=>C(e=>e-1),[]),children:(0,z.jsx)(Pr.div,{tabIndex:_||S===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:_r(e.onMouseDown,()=>{x.current=!0}),onFocus:_r(e.onFocus,e=>{let t=!x.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(k5,dse);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=b().filter(e=>e.focusable);L5([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}x.current=!1}),onBlur:_r(e.onBlur,()=>v(!1))})})}),F5=`RovingFocusGroupItem`,I5=F.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=Ur(),l=a||c,u=hse(F5,n),d=u.currentTabStopId===l,f=M5(n),{onFocusableItemAdd:p,onFocusableItemRemove:m,currentTabStopId:h}=u;return F.useEffect(()=>{if(r)return p(),()=>m()},[r,p,m]),(0,z.jsx)(j5.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,z.jsx)(Pr.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:_r(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:_r(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:_r(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=yse(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?bse(n,r+1):n.slice(r+1)}setTimeout(()=>L5(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:h!=null}):o})})});I5.displayName=F5;var _se={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function vse(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function yse(e,t,n){let r=vse(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return _se[r]}function L5(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function bse(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var xse=P5,Sse=I5,R5=[`Enter`,` `],Cse=[`ArrowDown`,`PageUp`,`Home`],z5=[`ArrowUp`,`PageDown`,`End`],wse=[...Cse,...z5],Tse={ltr:[...R5,`ArrowRight`],rtl:[...R5,`ArrowLeft`]},Ese={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},B5=`Menu`,[V5,Dse,Ose]=r8(B5),[H5,U5]=yr(B5,[Ose,v5,N5]),W5=v5(),G5=N5(),[K5,q5]=H5(B5),[kse,J5]=H5(B5),Y5=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=W5(t),[c,l]=F.useState(null),u=F.useRef(!1),d=hi(a),f=i8(i);return F.useEffect(()=>{let e=()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),(0,z.jsx)(O5,{...s,children:(0,z.jsx)(K5,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,z.jsx)(kse,{scope:t,onClose:F.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};Y5.displayName=B5;var Ase=`MenuAnchor`,X5=F.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=W5(n);return(0,z.jsx)(cse,{...i,...r,ref:t})});X5.displayName=Ase;var Z5=`MenuPortal`,[jse,Q5]=H5(Z5,{forceMount:void 0}),$5=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=q5(Z5,t);return(0,z.jsx)(jse,{scope:t,forceMount:n,children:(0,z.jsx)(Lr,{present:n||a.open,children:(0,z.jsx)(qi,{asChild:!0,container:i,children:r})})})};$5.displayName=Z5;var e7=`MenuContent`,[Mse,t7]=H5(e7),n7=F.forwardRef((e,t)=>{let n=Q5(e7,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=q5(e7,e.__scopeMenu),o=J5(e7,e.__scopeMenu);return(0,z.jsx)(V5.Provider,{scope:e.__scopeMenu,children:(0,z.jsx)(Lr,{present:r||a.open,children:(0,z.jsx)(V5.Slot,{scope:e.__scopeMenu,children:o.modal?(0,z.jsx)(Nse,{...i,ref:t}):(0,z.jsx)(Pse,{...i,ref:t})})})})}),Nse=F.forwardRef((e,t)=>{let n=q5(e7,e.__scopeMenu),r=F.useRef(null),i=er(t,r);return F.useEffect(()=>{let e=r.current;if(e)return ho(e)},[]),(0,z.jsx)(r7,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:_r(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Pse=F.forwardRef((e,t)=>{let n=q5(e7,e.__scopeMenu);return(0,z.jsx)(r7,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Fse=Dr(`MenuContent.ScrollLock`),r7=F.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=q5(e7,n),_=J5(e7,n),v=W5(n),y=G5(n),b=Dse(n),[x,S]=F.useState(null),C=F.useRef(null),w=er(t,C,g.onContentChange),T=F.useRef(0),E=F.useRef(``),D=F.useRef(0),O=F.useRef(null),k=F.useRef(`right`),A=F.useRef(0),ee=m?ao:F.Fragment,j=m?{as:Fse,allowPinchZoom:!0}:void 0,te=e=>{let t=E.current+e,n=b().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=qse(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){E.current=t,window.clearTimeout(T.current),t!==``&&(T.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};F.useEffect(()=>()=>window.clearTimeout(T.current),[]),Yi();let M=F.useCallback(e=>k.current===O.current?.side&&Yse(e,O.current?.area),[]);return(0,z.jsx)(Mse,{scope:n,searchRef:E,onItemEnter:F.useCallback(e=>{M(e)&&e.preventDefault()},[M]),onItemLeave:F.useCallback(e=>{M(e)||(C.current?.focus(),S(null))},[M]),onTriggerLeave:F.useCallback(e=>{M(e)&&e.preventDefault()},[M]),pointerGraceTimerRef:D,onPointerGraceIntentChange:F.useCallback(e=>{O.current=e},[]),children:(0,z.jsx)(ee,{...j,children:(0,z.jsx)(Pi,{asChild:!0,trapped:i,onMountAutoFocus:_r(a,e=>{e.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,z.jsx)(Ci,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,z.jsx)(xse,{asChild:!0,...y,dir:_.dir,orientation:`vertical`,loop:r,currentTabStopId:x,onCurrentTabStopIdChange:S,onEntryFocus:_r(c,e=>{_.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,z.jsx)(lse,{role:`menu`,"aria-orientation":`vertical`,"data-state":D7(g.open),"data-radix-menu-content":``,dir:_.dir,...v,...h,ref:w,style:{outline:`none`,...h.style},onKeyDown:_r(h.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&te(e.key));let i=C.current;if(e.target!==i||!wse.includes(e.key))return;e.preventDefault();let a=b().filter(e=>!e.disabled).map(e=>e.ref.current);z5.includes(e.key)&&a.reverse(),Gse(a)}),onBlur:_r(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(T.current),E.current=``)}),onPointerMove:_r(e.onPointerMove,A7(e=>{let t=e.target,n=A.current!==e.clientX;e.currentTarget.contains(t)&&n&&(k.current=e.clientX>A.current?`right`:`left`,A.current=e.clientX)}))})})})})})})});n7.displayName=e7;var Ise=`MenuGroup`,i7=F.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,z.jsx)(Pr.div,{role:`group`,...r,ref:t})});i7.displayName=Ise;var Lse=`MenuLabel`,a7=F.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,z.jsx)(Pr.div,{...r,ref:t})});a7.displayName=Lse;var o7=`MenuItem`,s7=`menu.itemSelect`,c7=F.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=F.useRef(null),o=J5(o7,e.__scopeMenu),s=t7(o7,e.__scopeMenu),c=er(t,a),l=F.useRef(!1),u=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(s7,{bubbles:!0,cancelable:!0});e.addEventListener(s7,e=>r?.(e),{once:!0}),Fr(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,z.jsx)(l7,{...i,ref:c,disabled:n,onClick:_r(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:_r(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:_r(e.onKeyDown,e=>{let t=s.searchRef.current!==``;n||t&&e.key===` `||R5.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});c7.displayName=o7;var l7=F.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=t7(o7,n),s=G5(n),c=F.useRef(null),l=er(t,c),[u,d]=F.useState(!1),[f,p]=F.useState(``);return F.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,z.jsx)(V5.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,z.jsx)(Sse,{asChild:!0,...s,focusable:!r,children:(0,z.jsx)(Pr.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:_r(e.onPointerMove,A7(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:_r(e.onPointerLeave,A7(e=>o.onItemLeave(e))),onFocus:_r(e.onFocus,()=>d(!0)),onBlur:_r(e.onBlur,()=>d(!1))})})})}),Rse=`MenuCheckboxItem`,u7=F.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,z.jsx)(g7,{scope:e.__scopeMenu,checked:n,children:(0,z.jsx)(c7,{role:`menuitemcheckbox`,"aria-checked":O7(n)?`mixed`:n,...i,ref:t,"data-state":k7(n),onSelect:_r(i.onSelect,()=>r?.(O7(n)?!0:!n),{checkForDefaultPrevented:!1})})})});u7.displayName=Rse;var d7=`MenuRadioGroup`,[zse,Bse]=H5(d7,{value:void 0,onValueChange:()=>{}}),f7=F.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=hi(r);return(0,z.jsx)(zse,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,z.jsx)(i7,{...i,ref:t})})});f7.displayName=d7;var p7=`MenuRadioItem`,m7=F.forwardRef((e,t)=>{let{value:n,...r}=e,i=Bse(p7,e.__scopeMenu),a=n===i.value;return(0,z.jsx)(g7,{scope:e.__scopeMenu,checked:a,children:(0,z.jsx)(c7,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":k7(a),onSelect:_r(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});m7.displayName=p7;var h7=`MenuItemIndicator`,[g7,Vse]=H5(h7,{checked:!1}),_7=F.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=Vse(h7,n);return(0,z.jsx)(Lr,{present:r||O7(a.checked)||a.checked===!0,children:(0,z.jsx)(Pr.span,{...i,ref:t,"data-state":k7(a.checked)})})});_7.displayName=h7;var Hse=`MenuSeparator`,v7=F.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,z.jsx)(Pr.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});v7.displayName=Hse;var Use=`MenuArrow`,y7=F.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=W5(n);return(0,z.jsx)(use,{...i,...r,ref:t})});y7.displayName=Use;var b7=`MenuSub`,[Wse,x7]=H5(b7),S7=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=q5(b7,t),o=W5(t),[s,c]=F.useState(null),[l,u]=F.useState(null),d=hi(i);return F.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,z.jsx)(O5,{...o,children:(0,z.jsx)(K5,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,z.jsx)(Wse,{scope:t,contentId:Ur(),triggerId:Ur(),trigger:s,onTriggerChange:c,children:n})})})};S7.displayName=b7;var C7=`MenuSubTrigger`,w7=F.forwardRef((e,t)=>{let n=q5(C7,e.__scopeMenu),r=J5(C7,e.__scopeMenu),i=x7(C7,e.__scopeMenu),a=t7(C7,e.__scopeMenu),o=F.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=F.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return F.useEffect(()=>u,[u]),F.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]),(0,z.jsx)(X5,{asChild:!0,...l,children:(0,z.jsx)(l7,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":i.contentId,"data-state":D7(n.open),...e,ref:$n(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:_r(e.onPointerMove,A7(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:_r(e.onPointerLeave,A7(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:_r(e.onKeyDown,t=>{let i=a.searchRef.current!==``;e.disabled||i&&t.key===` `||Tse[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});w7.displayName=C7;var T7=`MenuSubContent`,E7=F.forwardRef((e,t)=>{let n=Q5(e7,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=q5(e7,e.__scopeMenu),o=J5(e7,e.__scopeMenu),s=x7(T7,e.__scopeMenu),c=F.useRef(null),l=er(t,c);return(0,z.jsx)(V5.Provider,{scope:e.__scopeMenu,children:(0,z.jsx)(Lr,{present:r||a.open,children:(0,z.jsx)(V5.Slot,{scope:e.__scopeMenu,children:(0,z.jsx)(r7,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:l,align:`start`,side:o.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{o.isUsingKeyboardRef.current&&c.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:_r(e.onFocusOutside,e=>{e.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:_r(e.onEscapeKeyDown,e=>{o.onClose(),e.preventDefault()}),onKeyDown:_r(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=Ese[o.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),s.trigger?.focus(),e.preventDefault())})})})})})});E7.displayName=T7;function D7(e){return e?`open`:`closed`}function O7(e){return e===`indeterminate`}function k7(e){return O7(e)?`indeterminate`:e?`checked`:`unchecked`}function Gse(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Kse(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function qse(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Kse(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function Jse(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function Yse(e,t){return t?Jse({x:e.clientX,y:e.clientY},t):!1}function A7(e){return t=>t.pointerType===`mouse`?e(t):void 0}var Xse=Y5,Zse=X5,Qse=$5,$se=n7,ece=i7,tce=a7,nce=c7,rce=u7,ice=f7,ace=m7,oce=_7,sce=v7,cce=y7,lce=S7,uce=w7,dce=E7,j7=`ContextMenu`,[fce,pce]=yr(j7,[U5]),M7=U5(),[mce,N7]=fce(j7),P7=e=>{let{__scopeContextMenu:t,children:n,onOpenChange:r,dir:i,modal:a=!0}=e,[o,s]=F.useState(!1),c=M7(t),l=hi(r),u=F.useCallback(e=>{s(e),l(e)},[l]);return(0,z.jsx)(mce,{scope:t,open:o,onOpenChange:u,modal:a,children:(0,z.jsx)(Xse,{...c,dir:i,open:o,onOpenChange:u,modal:a,children:n})})};P7.displayName=j7;var F7=`ContextMenuTrigger`,I7=F.forwardRef((e,t)=>{let{__scopeContextMenu:n,disabled:r=!1,...i}=e,a=N7(F7,n),o=M7(n),s=F.useRef({x:0,y:0}),c=F.useRef({getBoundingClientRect:()=>DOMRect.fromRect({width:0,height:0,...s.current})}),l=F.useRef(0),u=F.useCallback(()=>window.clearTimeout(l.current),[]),d=e=>{s.current={x:e.clientX,y:e.clientY},a.onOpenChange(!0)};return F.useEffect(()=>u,[u]),F.useEffect(()=>void(r&&u()),[r,u]),(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Zse,{...o,virtualRef:c}),(0,z.jsx)(Pr.span,{"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,...i,ref:t,style:{WebkitTouchCallout:`none`,...e.style},onContextMenu:r?e.onContextMenu:_r(e.onContextMenu,e=>{u(),d(e),e.preventDefault()}),onPointerDown:r?e.onPointerDown:_r(e.onPointerDown,Y7(e=>{u(),l.current=window.setTimeout(()=>d(e),700)})),onPointerMove:r?e.onPointerMove:_r(e.onPointerMove,Y7(u)),onPointerCancel:r?e.onPointerCancel:_r(e.onPointerCancel,Y7(u)),onPointerUp:r?e.onPointerUp:_r(e.onPointerUp,Y7(u))})]})});I7.displayName=F7;var hce=`ContextMenuPortal`,L7=e=>{let{__scopeContextMenu:t,...n}=e,r=M7(t);return(0,z.jsx)(Qse,{...r,...n})};L7.displayName=hce;var R7=`ContextMenuContent`,z7=F.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=N7(R7,n),a=M7(n),o=F.useRef(!1);return(0,z.jsx)($se,{...a,...r,ref:t,side:`right`,sideOffset:2,align:`start`,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),!t.defaultPrevented&&o.current&&t.preventDefault(),o.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),!t.defaultPrevented&&!i.modal&&(o.current=!0)},style:{...e.style,"--radix-context-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-context-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-context-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-context-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-context-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});z7.displayName=R7;var gce=`ContextMenuGroup`,_ce=F.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=M7(n);return(0,z.jsx)(ece,{...i,...r,ref:t})});_ce.displayName=gce;var vce=`ContextMenuLabel`,B7=F.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=M7(n);return(0,z.jsx)(tce,{...i,...r,ref:t})});B7.displayName=vce;var yce=`ContextMenuItem`,V7=F.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=M7(n);return(0,z.jsx)(nce,{...i,...r,ref:t})});V7.displayName=yce;var bce=`ContextMenuCheckboxItem`,H7=F.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=M7(n);return(0,z.jsx)(rce,{...i,...r,ref:t})});H7.displayName=bce;var xce=`ContextMenuRadioGroup`,Sce=F.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=M7(n);return(0,z.jsx)(ice,{...i,...r,ref:t})});Sce.displayName=xce;var Cce=`ContextMenuRadioItem`,U7=F.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=M7(n);return(0,z.jsx)(ace,{...i,...r,ref:t})});U7.displayName=Cce;var wce=`ContextMenuItemIndicator`,W7=F.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=M7(n);return(0,z.jsx)(oce,{...i,...r,ref:t})});W7.displayName=wce;var Tce=`ContextMenuSeparator`,G7=F.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=M7(n);return(0,z.jsx)(sce,{...i,...r,ref:t})});G7.displayName=Tce;var Ece=`ContextMenuArrow`,Dce=F.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=M7(n);return(0,z.jsx)(cce,{...i,...r,ref:t})});Dce.displayName=Ece;var K7=`ContextMenuSub`,Oce=e=>{let{__scopeContextMenu:t,children:n,onOpenChange:r,open:i,defaultOpen:a}=e,o=M7(t),[s,c]=Cr({prop:i,defaultProp:a??!1,onChange:r,caller:K7});return(0,z.jsx)(lce,{...o,open:s,onOpenChange:c,children:n})};Oce.displayName=K7;var kce=`ContextMenuSubTrigger`,q7=F.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=M7(n);return(0,z.jsx)(uce,{...i,...r,ref:t})});q7.displayName=kce;var Ace=`ContextMenuSubContent`,J7=F.forwardRef((e,t)=>{let{__scopeContextMenu:n,...r}=e,i=M7(n);return(0,z.jsx)(dce,{...i,...r,ref:t,style:{...e.style,"--radix-context-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-context-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-context-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-context-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-context-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});J7.displayName=Ace;function Y7(e){return t=>t.pointerType===`mouse`?void 0:e(t)}var jce=P7,Mce=I7,Nce=L7,X7=z7,Z7=B7,Q7=V7,$7=H7,e9=U7,t9=W7,n9=G7,r9=q7,i9=J7,a9=jce,o9=Mce,Pce=F.forwardRef(({className:e,inset:t,children:n,...r},i)=>(0,z.jsx)(r9,{ref:i,className:R(`flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground`,t&&`pl-8`,e),...r,children:n}));Pce.displayName=r9.displayName;var Fce=F.forwardRef(({className:e,...t},n)=>(0,z.jsx)(i9,{ref:n,className:R(`z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...t}));Fce.displayName=i9.displayName;var s9=F.forwardRef(({className:e,...t},n)=>(0,z.jsx)(Nce,{children:(0,z.jsx)(X7,{ref:n,className:R(`z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2`,e),...t})}));s9.displayName=X7.displayName;var c9=F.forwardRef(({className:e,inset:t,...n},r)=>(0,z.jsx)(Q7,{ref:r,className:R(`relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,t&&`pl-8`,e),...n}));c9.displayName=Q7.displayName;var Ice=F.forwardRef(({className:e,children:t,checked:n,...r},i)=>(0,z.jsxs)($7,{ref:i,className:R(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),checked:n,...r,children:[(0,z.jsx)(`span`,{className:`absolute left-2 flex size-3.5 items-center justify-center`,children:(0,z.jsx)(t9,{children:(0,z.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`24`,height:`24`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,className:`size-4`,children:(0,z.jsx)(`path`,{d:`M20 6 9 17l-5-5`})})})}),t]}));Ice.displayName=$7.displayName;var Lce=F.forwardRef(({className:e,children:t,...n},r)=>(0,z.jsxs)(e9,{ref:r,className:R(`relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),...n,children:[(0,z.jsx)(`span`,{className:`absolute left-2 flex size-3.5 items-center justify-center`,children:(0,z.jsx)(t9,{children:(0,z.jsx)(`div`,{className:`size-2 rounded-full bg-current`})})}),t]}));Lce.displayName=e9.displayName;var Rce=F.forwardRef(({className:e,inset:t,...n},r)=>(0,z.jsx)(Z7,{ref:r,className:R(`px-2 py-1.5 text-sm font-semibold text-foreground`,t&&`pl-8`,e),...n}));Rce.displayName=Z7.displayName;var l9=F.forwardRef(({className:e,...t},n)=>(0,z.jsx)(n9,{ref:n,className:R(`-mx-1 my-1 h-px bg-border`,e),...t}));l9.displayName=n9.displayName;var zce=({className:e,...t})=>(0,z.jsx)(`span`,{className:R(`ml-auto text-xs tracking-widest text-muted-foreground`,e),...t});zce.displayName=`ContextMenuShortcut`;function Bce(e,t){return e?t?.find(t=>t.path===e)?.name||e.split(`/`).pop()||e:``}var u9=[`#2563eb`,`#059669`,`#d97706`,`#7c3aed`,`#e11d48`,`#0891b2`];function Vce(e){return u9[e%u9.length]}var Hce=(0,F.memo)(function({tabOrder:e,tabs:t,activeTabKey:n,onActivate:r,onCloseRequest:i,onTogglePin:a,onCloseOtherTabs:o,onCloseRightTabs:s,onCloseLeftTabs:c,onCloseAllTabs:l,onCloseGroupTabs:u,onCloseOtherGroupTabs:d,isMobile:f,rightContent:p,dirs:m}){if(e.length===0)return null;let h=(0,F.useMemo)(()=>{let n=new Map;for(let r of e){let e=t.get(r);if(!e)continue;let i=e.rootPath;n.has(i)||n.set(i,[]),n.get(i).push(r)}return n},[e,t]),g=h.size>1,_=(0,F.useMemo)(()=>{let e=new Map,t=0;for(let[n]of h.entries())e.set(n,t++);return e},[h]),v=Array.from(h.entries()).map(([e,p],h)=>{let v=Vce(_.get(e)??0);return(0,z.jsxs)(`div`,{className:`flex items-center gap-1.5 shrink-0`,children:[g&&h>0&&(0,z.jsx)(`div`,{className:R(`flex items-center self-stretch shrink-0`,f?`px-0.5`:`px-1`),children:(0,z.jsx)(`div`,{className:R(`rounded-full`,f?`w-[1.5px] h-4`:`w-[2px] h-5`),style:{backgroundColor:v}})}),g&&(0,z.jsxs)(a9,{children:[(0,z.jsx)(o9,{asChild:!0,children:(0,z.jsx)(`span`,{className:`px-2 py-1 text-[10px] font-medium text-muted-foreground bg-muted/40 rounded shrink-0 select-none cursor-pointer`,style:{color:v},children:Bce(e,m)})}),(0,z.jsxs)(s9,{onOpenAutoFocus:e=>e.preventDefault(),children:[(0,z.jsx)(c9,{onClick:()=>u(e),children:`关闭分组`}),(0,z.jsx)(c9,{onClick:()=>d(e),children:`关闭分组其他`})]})]}),p.map(e=>{let u=t.get(e);if(!u)return null;let d=u.path.split(`/`).pop()||u.path,p=e===n,m=u.content!==u.lastSavedContent,h=u.isPinned,_=u.isPreview;return(0,z.jsxs)(a9,{children:[(0,z.jsx)(o9,{asChild:!0,children:(0,z.jsxs)(`div`,{className:R(`group flex items-center gap-1.5 text-xs cursor-pointer rounded-lg border shrink-0 select-none transition-all duration-150`,f?`px-1.5 py-[3px] gap-0.5 min-w-[52px] text-[10px]`:`px-3 py-1.5 gap-1.5 min-w-[100px] max-w-[200px]`,p?`bg-background text-foreground border-border shadow-sm translate-y-[-1px]`:`bg-transparent text-muted-foreground border-transparent hover:bg-muted/50`),onClick:()=>r(e),onDoubleClick:()=>a(e),children:[f&&p&&(0,z.jsx)(`button`,{className:R(`shrink-0 flex items-center justify-center rounded-sm opacity-100`,p?`hover:bg-muted`:`hover:bg-muted/50`),onClick:t=>{t.stopPropagation(),a(e)},title:h?`取消固定`:`固定标签`,children:(0,z.jsx)(Be,{className:R(`size-2.5`,h&&`fill-muted-foreground`)})}),g&&!h&&(0,z.jsx)(`span`,{className:R(`rounded-full shrink-0`,f?`size-1`:`size-1.5`),style:{backgroundColor:v}}),m&&!h&&(0,z.jsx)(`span`,{className:R(`rounded-full bg-primary shrink-0`,f?`size-1`:`size-1.5`)}),(0,z.jsx)(`span`,{className:R(f?`flex-1`:`truncate flex-1`,_&&`italic opacity-80`),children:d}),f?(0,z.jsx)(`button`,{className:R(`shrink-0 flex items-center justify-center rounded-sm opacity-100`,p?`hover:bg-muted`:`hover:bg-muted/50`),onClick:t=>{t.stopPropagation(),i(e)},title:`关闭标签`,children:(0,z.jsx)(Je,{className:`size-2.5`})}):(0,z.jsx)(gr,{variant:`ghost`,size:`icon`,className:R(`shrink-0 rounded-sm size-5 min-w-5 min-h-5 opacity-100`,p?`hover:bg-muted`:`hover:bg-muted/50`),onClick:t=>{t.stopPropagation(),i(e)},title:`关闭标签`,children:(0,z.jsx)(Je,{className:`size-3`})})]})}),(0,z.jsxs)(s9,{onOpenAutoFocus:e=>e.preventDefault(),children:[(0,z.jsx)(c9,{onClick:()=>i(e),children:`关闭标签`}),(0,z.jsx)(c9,{onClick:()=>o(e),children:`关闭其他标签`}),(0,z.jsx)(c9,{onClick:()=>s(e),children:`关闭右侧标签`}),(0,z.jsx)(c9,{onClick:()=>c(e),children:`关闭左侧标签`}),(0,z.jsx)(l9,{}),(0,z.jsx)(c9,{onClick:()=>a(e),children:h?`取消固定`:`固定标签`}),(0,z.jsx)(l9,{}),(0,z.jsx)(c9,{onClick:()=>l(),children:`关闭所有标签`})]})]},e)})]},e??`null`)});return(0,z.jsxs)(`div`,{className:`flex items-center bg-muted/20 border-b border-border shrink-0`,children:[f?(0,z.jsx)(`div`,{className:`flex items-center gap-0.5 px-1.5 py-1 overflow-x-auto overflow-y-hidden flex-1 tabbar-scroll-hide`,style:{WebkitOverflowScrolling:`touch`},children:v}):(0,z.jsxs)(a9,{children:[(0,z.jsx)(o9,{asChild:!0,children:(0,z.jsx)(`div`,{className:`flex items-center gap-1.5 px-3 py-2 overflow-x-auto overflow-y-hidden flex-1 tabbar-scroll-hide`,style:{WebkitOverflowScrolling:`touch`},children:v})}),(0,z.jsx)(s9,{onOpenAutoFocus:e=>e.preventDefault(),children:(0,z.jsx)(c9,{onClick:()=>l(),children:`关闭所有标签`})})]}),p&&(0,z.jsx)(`div`,{className:`flex items-center gap-2 px-3 h-9 shrink-0 text-xs text-muted-foreground`,children:p})]})}),Uce=(0,F.memo)(function({visible:e,onClose:t,onCreate:n,currentDir:r}){let[i,a]=(0,F.useState)(``),[o,s]=(0,F.useState)(!1),c=(0,F.useRef)(null);(0,F.useEffect)(()=>{e&&(s(!1),a(`.md`),setTimeout(()=>{c.current?.setSelectionRange(0,0),c.current?.focus()},50))},[e]);let l=()=>{i.trim()&&(n(i.trim(),o,r),a(``),t())},u=e=>{e||t()},d=e=>{e.key===`Enter`&&l()},f=r?r.split(`/`).filter(Boolean).join(` / `):`目录`;return(0,z.jsx)(is,{open:e,onOpenChange:u,children:(0,z.jsxs)(cs,{side:`bottom`,className:`rounded-t-2xl`,noClose:!0,children:[(0,z.jsxs)(ls,{className:`text-left`,children:[(0,z.jsx)(ds,{children:`新建`}),(0,z.jsxs)(fs,{children:[`位置: `,f]})]}),(0,z.jsxs)(`div`,{className:`space-y-4 mt-4`,children:[(0,z.jsxs)(`div`,{className:`flex gap-2`,children:[(0,z.jsxs)(gr,{variant:o?`outline`:`default`,onClick:()=>{s(!1),i||(a(`.md`),setTimeout(()=>{c.current?.setSelectionRange(0,0),c.current?.focus()},0))},className:`flex-1 h-11`,children:[(0,z.jsx)(we,{className:`size-4 mr-2`}),`Markdown`]}),(0,z.jsxs)(gr,{variant:o?`default`:`outline`,onClick:()=>{s(!0),i===`.md`&&a(``)},className:`flex-1 h-11`,children:[(0,z.jsx)(ke,{className:`size-4 mr-2`}),`文件夹`]})]}),(0,z.jsx)(Zn,{ref:c,placeholder:o?`文件夹名称`:`文件名称,如 note.md`,value:i,onChange:e=>a(e.target.value),onKeyDown:d,className:`h-11`,autoFocus:!0}),(0,z.jsxs)(`div`,{className:`flex gap-2 justify-end pt-2`,children:[(0,z.jsx)(gr,{variant:`outline`,onClick:t,children:`取消`}),(0,z.jsx)(gr,{onClick:l,children:`创建`})]})]})]})})});function Wce(e,t){return t||e.replace(/\\/g,`/`).split(`/`).filter(Boolean).pop()||e}function Gce({open:e,onOpenChange:t,onSelect:n,activeRoot:r,groups:i}){let[a,o]=(0,F.useState)(``),[s,c]=(0,F.useState)([]),[l,u]=(0,F.useState)(0),[d,f]=(0,F.useState)(!1),[p,m]=(0,F.useState)(!1),[h,g]=(0,F.useState)(`all`),_=(0,F.useRef)(null);(0,F.useEffect)(()=>{m(window.innerWidth<768)},[]),(0,F.useEffect)(()=>{e&&r?g(r):e&&g(`all`)},[e,r]),(0,F.useEffect)(()=>{e?setTimeout(()=>_.current?.focus(),100):(o(``),c([]),u(0))},[e]),(0,F.useEffect)(()=>{if(!a.trim()){c([]),u(0);return}let e=setTimeout(()=>{f(!0);let e=new URL(`/api/files/search`,window.location.origin);e.searchParams.set(`q`,a),e.searchParams.set(`limit`,`50`),h!==`all`&&e.searchParams.set(`root`,h),fetch(e.toString()).then(e=>e.json()).then(e=>{c(e.results||[]),u(0)}).catch(console.error).finally(()=>f(!1))},200);return()=>clearTimeout(e)},[a,h]);let v=(0,F.useCallback)((e,r)=>{n(e,r),t(!1)},[n,t]),y=(0,F.useCallback)(e=>{if(e.key===`ArrowDown`)e.preventDefault(),u(e=>Math.min(e+1,s.length-1));else if(e.key===`ArrowUp`)e.preventDefault(),u(e=>Math.max(e-1,0));else if(e.key===`Enter`&&s.length>0){e.preventDefault();let t=s[l];v(t.path,t.rootPath)}else e.key===`Escape`&&t(!1)},[s,l,v,t]);return(0,F.useEffect)(()=>{let n=n=>{n.key===`Escape`&&e&&t(!1)};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t]),e?(0,z.jsxs)(`div`,{className:`fixed inset-0 z-50 flex flex-col bg-background/95 backdrop-blur-sm`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 border-b border-border`,children:[p&&(0,z.jsx)(gr,{variant:`ghost`,size:`icon`,onClick:()=>t(!1),children:(0,z.jsx)(de,{className:`size-5`})}),(0,z.jsxs)(`div`,{className:`relative flex-1`,children:[(0,z.jsx)(We,{className:`absolute left-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground`}),(0,z.jsx)(Zn,{ref:_,type:`text`,placeholder:`搜索文件或内容...`,value:a,onChange:e=>o(e.target.value),onKeyDown:y,className:`pl-9 pr-20`}),!a&&(0,z.jsx)(`span`,{className:`absolute right-10 top-1/2 -translate-y-1/2 text-xs text-muted-foreground pointer-events-none`,children:`⌘K`}),a&&(0,z.jsx)(`button`,{onClick:()=>o(``),className:`absolute right-3 top-1/2 -translate-y-1/2`,children:(0,z.jsx)(Je,{className:`size-4 text-muted-foreground hover:text-foreground`})})]}),(0,z.jsx)(gr,{variant:`ghost`,size:`icon`,onClick:()=>t(!1),children:(0,z.jsx)(Je,{className:`size-5`})})]}),i&&i.length>0&&(0,z.jsxs)(`div`,{className:`flex items-center gap-1 px-4 py-2 border-b border-border overflow-x-auto`,children:[(0,z.jsx)(`span`,{className:`text-xs text-muted-foreground shrink-0 mr-1`,children:`搜索范围:`}),(0,z.jsx)(gr,{variant:h===`all`?`default`:`ghost`,size:`sm`,className:`text-xs h-7 shrink-0`,onClick:()=>g(`all`),children:`全部`}),i.map(e=>(0,z.jsx)(gr,{variant:h===e.root.path?`default`:`ghost`,size:`sm`,className:`text-xs h-7 shrink-0`,onClick:()=>g(e.root.path),children:Wce(e.root.path,e.root.name)},e.root.path))]}),(0,z.jsxs)(`div`,{className:`flex-1 overflow-y-auto`,children:[d&&(0,z.jsxs)(`div`,{className:`flex items-center justify-center py-12 text-muted-foreground`,children:[(0,z.jsx)(Pe,{className:`size-5 mr-2 animate-spin`}),(0,z.jsx)(`span`,{className:`text-sm`,children:`搜索中...`})]}),!d&&a&&s.length===0&&(0,z.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-12 text-muted-foreground`,children:[(0,z.jsx)(We,{className:`size-10 mb-3 opacity-50`}),(0,z.jsx)(`span`,{className:`text-sm`,children:`未找到相关结果`})]}),!d&&!a&&(0,z.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-12 text-muted-foreground`,children:[(0,z.jsx)(We,{className:`size-10 mb-3 opacity-50`}),(0,z.jsx)(`span`,{className:`text-sm`,children:`输入关键词搜索文件名或内容`})]}),s.length>0&&(0,z.jsx)(`div`,{className:`py-2`,children:s.map((e,t)=>(0,z.jsxs)(`button`,{onClick:()=>v(e.path,e.rootPath),className:R(`w-full px-4 py-3 flex items-start gap-3 text-left hover:bg-accent transition-colors`,t===l&&`bg-accent`),children:[(0,z.jsx)(we,{className:`size-5 mt-0.5 text-muted-foreground shrink-0`}),(0,z.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,z.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,z.jsx)(`span`,{className:`font-medium truncate`,children:e.name}),e.rootName&&(0,z.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-muted text-muted-foreground`,children:e.rootName})]}),e.matchedLine&&(0,z.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1 line-clamp-2`,children:e.matchedLine}),(0,z.jsx)(`p`,{className:`text-xs text-muted-foreground mt-1 truncate`,children:e.path})]})]},`${e.rootPath}:${e.path}`))})]}),s.length>0&&(0,z.jsxs)(`div`,{className:`px-4 py-2 border-t border-border text-xs text-muted-foreground flex items-center justify-between`,children:[(0,z.jsxs)(`span`,{children:[s.length,` 个结果`]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(`span`,{className:`px-1.5 py-0.5 rounded bg-accent`,children:`↑↓`}),(0,z.jsx)(`span`,{children:`选择`}),(0,z.jsx)(`span`,{className:`px-1.5 py-0.5 rounded bg-accent`,children:`Enter`}),(0,z.jsx)(`span`,{children:`打开`})]})]})]}):null}var d9=Xo,Kce=Qo,f9=F.forwardRef(({className:e,...t},n)=>(0,z.jsx)($o,{ref:n,className:R(`fixed inset-0 z-50 bg-black/80 animate-fade-in`,e),...t}));f9.displayName=$o.displayName;var p9=F.forwardRef(({className:e,children:t,...n},r)=>(0,z.jsxs)(Kce,{children:[(0,z.jsx)(f9,{}),(0,z.jsxs)(es,{ref:r,className:R(`fixed left-[50%] top-[50%] z-50 grid w-[calc(100%-2rem)] max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 animate-zoom-in rounded-lg max-h-[calc(100vh-2rem)] overflow-y-auto`,e),...n,children:[t,(0,z.jsxs)(rs,{className:`absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground`,children:[(0,z.jsx)(Je,{className:`size-4`}),(0,z.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]}));p9.displayName=es.displayName;var m9=({className:e,...t})=>(0,z.jsx)(`div`,{className:R(`flex flex-col space-y-1.5 text-center sm:text-left`,e),...t});m9.displayName=`DialogHeader`;var h9=({className:e,...t})=>(0,z.jsx)(`div`,{className:R(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,e),...t});h9.displayName=`DialogFooter`;var g9=F.forwardRef(({className:e,...t},n)=>(0,z.jsx)(ts,{ref:n,className:R(`text-lg font-semibold leading-none tracking-tight`,e),...t}));g9.displayName=ts.displayName;var _9=F.forwardRef(({className:e,...t},n)=>(0,z.jsx)(ns,{ref:n,className:R(`text-sm text-muted-foreground`,e),...t}));_9.displayName=ns.displayName;function qce({open:e,onOpenChange:t,item:n,onRename:r}){let[i,a]=(0,F.useState)(``),o=(0,F.useRef)(null);(0,F.useEffect)(()=>{if(n&&(a(n.name),n.type===`file`)){let e=n.name.lastIndexOf(`.`);e>0&&setTimeout(()=>{o.current?.setSelectionRange(e,e)},0)}},[n]);let s=()=>{n&&i.trim()&&(r(n.path,i.trim(),n.rootPath,n.type===`directory`),t(!1))};return n?(0,z.jsx)(d9,{open:e,onOpenChange:t,children:(0,z.jsxs)(p9,{className:`sm:max-w-[400px]`,children:[(0,z.jsxs)(m9,{children:[(0,z.jsx)(g9,{children:`重命名`}),(0,z.jsxs)(_9,{children:[`输入新的名称来重命名「`,n.name,`」`]})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-2 py-2`,children:[n.type===`directory`?(0,z.jsx)(ke,{className:`size-5 shrink-0 text-muted-foreground`}):(0,z.jsx)(Te,{className:`size-5 shrink-0 text-muted-foreground`}),(0,z.jsx)(Zn,{ref:o,value:i,onChange:e=>a(e.target.value),onKeyDown:e=>{e.key===`Enter`&&s()},autoFocus:!0})]}),(0,z.jsxs)(h9,{children:[(0,z.jsx)(gr,{variant:`outline`,onClick:()=>t(!1),children:`取消`}),(0,z.jsx)(gr,{onClick:s,disabled:!i.trim(),children:`确定`})]})]})}):null}function Jce(e,[t,n]){return Math.min(n,Math.max(t,e))}function Yce(e,t){return F.useReducer((e,n)=>t[e][n]??e,e)}var v9=`ScrollArea`,[y9,Xce]=yr(v9),[Zce,b9]=y9(v9),x9=F.forwardRef((e,t)=>{let{__scopeScrollArea:n,type:r=`hover`,dir:i,scrollHideDelay:a=600,...o}=e,[s,c]=F.useState(null),[l,u]=F.useState(null),[d,f]=F.useState(null),[p,m]=F.useState(null),[h,g]=F.useState(null),[_,v]=F.useState(0),[y,b]=F.useState(0),[x,S]=F.useState(!1),[C,w]=F.useState(!1),T=er(t,e=>c(e)),E=i8(i);return(0,z.jsx)(Zce,{scope:n,type:r,dir:E,scrollHideDelay:a,scrollArea:s,viewport:l,onViewportChange:u,content:d,onContentChange:f,scrollbarX:p,onScrollbarXChange:m,scrollbarXEnabled:x,onScrollbarXEnabledChange:S,scrollbarY:h,onScrollbarYChange:g,scrollbarYEnabled:C,onScrollbarYEnabledChange:w,onCornerWidthChange:v,onCornerHeightChange:b,children:(0,z.jsx)(Pr.div,{dir:E,...o,ref:T,style:{position:`relative`,"--radix-scroll-area-corner-width":_+`px`,"--radix-scroll-area-corner-height":y+`px`,...e.style}})})});x9.displayName=v9;var S9=`ScrollAreaViewport`,C9=F.forwardRef((e,t)=>{let{__scopeScrollArea:n,children:r,nonce:i,...a}=e,o=b9(S9,n),s=er(t,F.useRef(null),o.onViewportChange);return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}`},nonce:i}),(0,z.jsx)(Pr.div,{"data-radix-scroll-area-viewport":``,...a,ref:s,style:{overflowX:o.scrollbarXEnabled?`scroll`:`hidden`,overflowY:o.scrollbarYEnabled?`scroll`:`hidden`,...e.style},children:(0,z.jsx)(`div`,{ref:o.onContentChange,style:{minWidth:`100%`,display:`table`},children:r})})]})});C9.displayName=S9;var w9=`ScrollAreaScrollbar`,T9=F.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=b9(w9,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:o}=i,s=e.orientation===`horizontal`;return F.useEffect(()=>(s?a(!0):o(!0),()=>{s?a(!1):o(!1)}),[s,a,o]),i.type===`hover`?(0,z.jsx)(Qce,{...r,ref:t,forceMount:n}):i.type===`scroll`?(0,z.jsx)($ce,{...r,ref:t,forceMount:n}):i.type===`auto`?(0,z.jsx)(E9,{...r,ref:t,forceMount:n}):i.type===`always`?(0,z.jsx)(D9,{...r,ref:t}):null});T9.displayName=w9;var Qce=F.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=b9(w9,e.__scopeScrollArea),[a,o]=F.useState(!1);return F.useEffect(()=>{let e=i.scrollArea,t=0;if(e){let n=()=>{window.clearTimeout(t),o(!0)},r=()=>{t=window.setTimeout(()=>o(!1),i.scrollHideDelay)};return e.addEventListener(`pointerenter`,n),e.addEventListener(`pointerleave`,r),()=>{window.clearTimeout(t),e.removeEventListener(`pointerenter`,n),e.removeEventListener(`pointerleave`,r)}}},[i.scrollArea,i.scrollHideDelay]),(0,z.jsx)(Lr,{present:n||a,children:(0,z.jsx)(E9,{"data-state":a?`visible`:`hidden`,...r,ref:t})})}),$ce=F.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=b9(w9,e.__scopeScrollArea),a=e.orientation===`horizontal`,o=B9(()=>c(`SCROLL_END`),100),[s,c]=Yce(`hidden`,{hidden:{SCROLL:`scrolling`},scrolling:{SCROLL_END:`idle`,POINTER_ENTER:`interacting`},interacting:{SCROLL:`interacting`,POINTER_LEAVE:`idle`},idle:{HIDE:`hidden`,SCROLL:`scrolling`,POINTER_ENTER:`interacting`}});return F.useEffect(()=>{if(s===`idle`){let e=window.setTimeout(()=>c(`HIDE`),i.scrollHideDelay);return()=>window.clearTimeout(e)}},[s,i.scrollHideDelay,c]),F.useEffect(()=>{let e=i.viewport,t=a?`scrollLeft`:`scrollTop`;if(e){let n=e[t],r=()=>{let r=e[t];n!==r&&(c(`SCROLL`),o()),n=r};return e.addEventListener(`scroll`,r),()=>e.removeEventListener(`scroll`,r)}},[i.viewport,a,c,o]),(0,z.jsx)(Lr,{present:n||s!==`hidden`,children:(0,z.jsx)(D9,{"data-state":s===`hidden`?`hidden`:`visible`,...r,ref:t,onPointerEnter:_r(e.onPointerEnter,()=>c(`POINTER_ENTER`)),onPointerLeave:_r(e.onPointerLeave,()=>c(`POINTER_LEAVE`))})})}),E9=F.forwardRef((e,t)=>{let n=b9(w9,e.__scopeScrollArea),{forceMount:r,...i}=e,[a,o]=F.useState(!1),s=e.orientation===`horizontal`,c=B9(()=>{if(n.viewport){let e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;o(s?e:t)}},10);return V9(n.viewport,c),V9(n.content,c),(0,z.jsx)(Lr,{present:r||a,children:(0,z.jsx)(D9,{"data-state":a?`visible`:`hidden`,...i,ref:t})})}),D9=F.forwardRef((e,t)=>{let{orientation:n=`vertical`,...r}=e,i=b9(w9,e.__scopeScrollArea),a=F.useRef(null),o=F.useRef(0),[s,c]=F.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=F9(s.viewport,s.content),u={...r,sizes:s,onSizesChange:c,hasThumb:l>0&&l<1,onThumbChange:e=>a.current=e,onThumbPointerUp:()=>o.current=0,onThumbPointerDown:e=>o.current=e};function d(e,t){return ale(e,o.current,s,t)}return n===`horizontal`?(0,z.jsx)(ele,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollLeft,t=L9(e,s,i.dir);a.current.style.transform=`translate3d(${t}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=d(e,i.dir))}}):n===`vertical`?(0,z.jsx)(tle,{...u,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollTop,t=L9(e,s);a.current.style.transform=`translate3d(0, ${t}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=d(e))}}):null}),ele=F.forwardRef((e,t)=>{let{sizes:n,onSizesChange:r,...i}=e,a=b9(w9,e.__scopeScrollArea),[o,s]=F.useState(),c=F.useRef(null),l=er(t,c,a.onScrollbarXChange);return F.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,z.jsx)(k9,{"data-orientation":`horizontal`,...i,ref:l,sizes:n,style:{bottom:0,left:a.dir===`rtl`?`var(--radix-scroll-area-corner-width)`:0,right:a.dir===`ltr`?`var(--radix-scroll-area-corner-width)`:0,"--radix-scroll-area-thumb-width":I9(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),z9(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:P9(o.paddingLeft),paddingEnd:P9(o.paddingRight)}})}})}),tle=F.forwardRef((e,t)=>{let{sizes:n,onSizesChange:r,...i}=e,a=b9(w9,e.__scopeScrollArea),[o,s]=F.useState(),c=F.useRef(null),l=er(t,c,a.onScrollbarYChange);return F.useEffect(()=>{c.current&&s(getComputedStyle(c.current))},[c]),(0,z.jsx)(k9,{"data-orientation":`vertical`,...i,ref:l,sizes:n,style:{top:0,right:a.dir===`ltr`?0:void 0,left:a.dir===`rtl`?0:void 0,bottom:`var(--radix-scroll-area-corner-height)`,"--radix-scroll-area-thumb-height":I9(n)+`px`,...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(a.viewport){let r=a.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),z9(r,n)&&t.preventDefault()}},onResize:()=>{c.current&&a.viewport&&o&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:P9(o.paddingTop),paddingEnd:P9(o.paddingBottom)}})}})}),[nle,O9]=y9(w9),k9=F.forwardRef((e,t)=>{let{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:a,onThumbPointerUp:o,onThumbPointerDown:s,onThumbPositionChange:c,onDragScroll:l,onWheelScroll:u,onResize:d,...f}=e,p=b9(w9,n),[m,h]=F.useState(null),g=er(t,e=>h(e)),_=F.useRef(null),v=F.useRef(``),y=p.viewport,b=r.content-r.viewport,x=hi(u),S=hi(c),C=B9(d,10);function w(e){_.current&&l({x:e.clientX-_.current.left,y:e.clientY-_.current.top})}return F.useEffect(()=>{let e=e=>{let t=e.target;m?.contains(t)&&x(e,b)};return document.addEventListener(`wheel`,e,{passive:!1}),()=>document.removeEventListener(`wheel`,e,{passive:!1})},[y,m,b,x]),F.useEffect(S,[r,S]),V9(m,C),V9(p.content,C),(0,z.jsx)(nle,{scope:n,scrollbar:m,hasThumb:i,onThumbChange:hi(a),onThumbPointerUp:hi(o),onThumbPositionChange:S,onThumbPointerDown:hi(s),children:(0,z.jsx)(Pr.div,{...f,ref:g,style:{position:`absolute`,...f.style},onPointerDown:_r(e.onPointerDown,e=>{e.button===0&&(e.target.setPointerCapture(e.pointerId),_.current=m.getBoundingClientRect(),v.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect=`none`,p.viewport&&(p.viewport.style.scrollBehavior=`auto`),w(e))}),onPointerMove:_r(e.onPointerMove,w),onPointerUp:_r(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=v.current,p.viewport&&(p.viewport.style.scrollBehavior=``),_.current=null})})})}),A9=`ScrollAreaThumb`,j9=F.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=O9(A9,e.__scopeScrollArea);return(0,z.jsx)(Lr,{present:n||i.hasThumb,children:(0,z.jsx)(rle,{ref:t,...r})})}),rle=F.forwardRef((e,t)=>{let{__scopeScrollArea:n,style:r,...i}=e,a=b9(A9,n),o=O9(A9,n),{onThumbPositionChange:s}=o,c=er(t,e=>o.onThumbChange(e)),l=F.useRef(void 0),u=B9(()=>{l.current&&=(l.current(),void 0)},100);return F.useEffect(()=>{let e=a.viewport;if(e){let t=()=>{u(),l.current||(l.current=ole(e,s),s())};return s(),e.addEventListener(`scroll`,t),()=>e.removeEventListener(`scroll`,t)}},[a.viewport,u,s]),(0,z.jsx)(Pr.div,{"data-state":o.hasThumb?`visible`:`hidden`,...i,ref:c,style:{width:`var(--radix-scroll-area-thumb-width)`,height:`var(--radix-scroll-area-thumb-height)`,...r},onPointerDownCapture:_r(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;o.onThumbPointerDown({x:n,y:r})}),onPointerUp:_r(e.onPointerUp,o.onThumbPointerUp)})});j9.displayName=A9;var M9=`ScrollAreaCorner`,N9=F.forwardRef((e,t)=>{let n=b9(M9,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!==`scroll`&&r?(0,z.jsx)(ile,{...e,ref:t}):null});N9.displayName=M9;var ile=F.forwardRef((e,t)=>{let{__scopeScrollArea:n,...r}=e,i=b9(M9,n),[a,o]=F.useState(0),[s,c]=F.useState(0),l=!!(a&&s);return V9(i.scrollbarX,()=>{let e=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(e),c(e)}),V9(i.scrollbarY,()=>{let e=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(e),o(e)}),l?(0,z.jsx)(Pr.div,{...r,ref:t,style:{width:a,height:s,position:`absolute`,right:i.dir===`ltr`?0:void 0,left:i.dir===`rtl`?0:void 0,bottom:0,...e.style}}):null});function P9(e){return e?parseInt(e,10):0}function F9(e,t){let n=e/t;return isNaN(n)?0:n}function I9(e){let t=F9(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function ale(e,t,n,r=`ltr`){let i=I9(n),a=i/2,o=t||a,s=i-o,c=n.scrollbar.paddingStart+o,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r===`ltr`?[0,u]:[u*-1,0];return R9([c,l],d)(e)}function L9(e,t,n=`ltr`){let r=I9(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=Jce(e,n===`ltr`?[0,o]:[o*-1,0]);return R9([0,o],[0,s])(c)}function R9(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function z9(e,t){return e>0&&e<t}var ole=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function i(){let a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,s=n.top!==a.top;(o||s)&&t(),n=a,r=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(r)};function B9(e,t){let n=hi(e),r=F.useRef(0);return F.useEffect(()=>()=>window.clearTimeout(r.current),[]),F.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function V9(e,t){let n=hi(t);xr(()=>{let t=0;if(e){let r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}var H9=x9,sle=C9,cle=N9,U9=F.forwardRef(({className:e,children:t,...n},r)=>(0,z.jsxs)(H9,{ref:r,className:R(`relative overflow-hidden`,e),...n,children:[(0,z.jsx)(sle,{className:`h-full w-full rounded-[inherit]`,children:t}),(0,z.jsx)(W9,{}),(0,z.jsx)(cle,{})]}));U9.displayName=H9.displayName;var W9=F.forwardRef(({className:e,orientation:t=`vertical`,...n},r)=>(0,z.jsx)(T9,{ref:r,orientation:t,className:R(`flex touch-none select-none transition-colors`,t===`vertical`&&`h-full w-2.5 border-l border-l-transparent p-[1px]`,t===`horizontal`&&`h-2.5 flex-col border-t border-t-transparent p-[1px]`,e),...n,children:(0,z.jsx)(j9,{className:`relative flex-1 rounded-full bg-border`})}));W9.displayName=T9.displayName;function G9({node:e,selectedPath:t,onSelect:n,expandedPaths:r,onToggleExpand:i,currentItemPath:a,rootPath:o}){if(e.type!==`directory`)return null;let s=r.has(e.path),c=t===e.path,l=e.path===a||a.startsWith(e.path+`/`),u=e.children&&e.children.length>0;return(0,z.jsxs)(`div`,{className:`select-none`,children:[(0,z.jsxs)(`div`,{className:R(`flex items-center gap-1 py-1.5 px-2 rounded-md cursor-pointer hover:bg-accent`,c&&`bg-accent`,l&&`opacity-50 pointer-events-none`),onClick:()=>!l&&n(e.path),children:[(0,z.jsx)(`button`,{onClick:t=>{t.stopPropagation(),u&&!l&&i(e.path)},className:R(`size-5 flex items-center justify-center rounded hover:bg-accent`,(!u||l)&&`invisible`),children:(0,z.jsx)(ge,{className:R(`size-3.5 transition-transform`,s&&`rotate-90`)})}),s?(0,z.jsx)(De,{className:`size-4 shrink-0 text-muted-foreground`}):(0,z.jsx)(ke,{className:`size-4 shrink-0 text-muted-foreground`}),(0,z.jsx)(`span`,{className:`text-sm truncate flex-1`,children:e.name}),c&&(0,z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`移动到这里`})]}),s&&u&&(0,z.jsx)(`div`,{className:`ml-4`,children:e.children.map(e=>(0,z.jsx)(G9,{node:e,selectedPath:t,onSelect:n,expandedPaths:r,onToggleExpand:i,currentItemPath:a,rootPath:o},e.path))})]})}function lle({open:e,onOpenChange:t,item:n,groups:r,onMove:i}){let[a,o]=(0,F.useState)(``),[s,c]=(0,F.useState)(null),[l,u]=(0,F.useState)(null),[d,f]=(0,F.useState)(new Set);(0,F.useEffect)(()=>{n&&e&&(o(n.path.substring(0,n.path.lastIndexOf(`/`))||`/`),c(n.rootPath),u(n.rootPath))},[n,e]);let p=e=>{f(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},m=()=>{if(n&&a!==null&&s!==null&&l!==null){let e=n.path.split(`/`).pop()||``,r=a===`/`?`/${e}`:`${a}/${e}`;(r!==n.path||l!==s)&&i(n.path,r,l,s),t(!1)}};if(!n)return null;let h=r.find(e=>e.root.path===s)?.files||[],g=a?a===`/`?`目录`:a.split(`/`).filter(Boolean).join(` / `):``;return(0,z.jsx)(d9,{open:e,onOpenChange:t,children:(0,z.jsxs)(p9,{className:`sm:max-w-[480px] max-h-[80vh] flex flex-col`,children:[(0,z.jsxs)(m9,{children:[(0,z.jsx)(g9,{children:`移动到`}),(0,z.jsxs)(_9,{children:[`选择要将「`,n.name,`」移动到的目标位置`]})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-2 py-2 text-sm text-muted-foreground`,children:[(0,z.jsx)(we,{className:`size-4 shrink-0`}),(0,z.jsx)(`span`,{className:`truncate`,children:n.name})]}),r.length>1&&(0,z.jsxs)(`div`,{className:`mb-3`,children:[(0,z.jsx)(`label`,{className:`text-xs text-muted-foreground mb-1.5 block`,children:`目标目录`}),(0,z.jsx)(`select`,{value:s||``,onChange:e=>{c(e.target.value),o(`/`),f(new Set)},className:`w-full px-3 py-2 text-sm border rounded-md bg-background`,children:r.map(e=>(0,z.jsx)(`option`,{value:e.root.path,children:e.root.path.split(`/`).pop()||e.root.path},e.root.path))})]}),(0,z.jsx)(U9,{className:`h-[300px] border rounded-md`,children:(0,z.jsxs)(`div`,{className:`p-2 space-y-0.5`,children:[(0,z.jsxs)(`div`,{className:R(`flex items-center gap-1 py-1.5 px-2 rounded-md cursor-pointer hover:bg-accent`,a===`/`&&`bg-accent`),onClick:()=>o(`/`),children:[(0,z.jsx)(ke,{className:`size-4 shrink-0 text-muted-foreground`}),(0,z.jsx)(`span`,{className:`text-sm`,children:`目录`}),a===`/`&&(0,z.jsx)(`span`,{className:`text-xs text-muted-foreground ml-auto`,children:`移动到这里`})]}),h.map(e=>(0,z.jsx)(G9,{node:e,selectedPath:a,onSelect:o,expandedPaths:d,onToggleExpand:p,currentItemPath:n.path,rootPath:s||``},e.path))]})}),(0,z.jsxs)(`div`,{className:`text-xs text-muted-foreground py-2`,children:[`目标位置: `,(0,z.jsx)(`span`,{className:`font-medium text-foreground`,children:g})]}),(0,z.jsxs)(h9,{children:[(0,z.jsx)(gr,{variant:`outline`,onClick:()=>t(!1),children:`取消`}),(0,z.jsx)(gr,{onClick:m,disabled:a===null,children:`移动`})]})]})})}function K9({node:e,selectedPath:t,onSelect:n,expandedPaths:r,onToggleExpand:i,currentItemPath:a,rootPath:o}){if(e.type!==`directory`)return null;let s=r.has(e.path),c=t===e.path,l=e.path===a||a.startsWith(e.path+`/`),u=e.children&&e.children.length>0;return(0,z.jsxs)(`div`,{className:`select-none`,children:[(0,z.jsxs)(`div`,{className:R(`flex items-center gap-1 py-1.5 px-2 rounded-md cursor-pointer hover:bg-accent`,c&&`bg-accent`,l&&`opacity-50 pointer-events-none`),onClick:()=>!l&&n(e.path),children:[(0,z.jsx)(`button`,{onClick:t=>{t.stopPropagation(),u&&!l&&i(e.path)},className:R(`size-5 flex items-center justify-center rounded hover:bg-accent`,(!u||l)&&`invisible`),children:(0,z.jsx)(ge,{className:R(`size-3.5 transition-transform`,s&&`rotate-90`)})}),s?(0,z.jsx)(De,{className:`size-4 shrink-0 text-muted-foreground`}):(0,z.jsx)(ke,{className:`size-4 shrink-0 text-muted-foreground`}),(0,z.jsx)(`span`,{className:`text-sm truncate flex-1`,children:e.name}),c&&(0,z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`复制到这里`})]}),s&&u&&(0,z.jsx)(`div`,{className:`ml-4`,children:e.children.map(e=>(0,z.jsx)(K9,{node:e,selectedPath:t,onSelect:n,expandedPaths:r,onToggleExpand:i,currentItemPath:a,rootPath:o},e.path))})]})}function ule({open:e,onOpenChange:t,item:n,groups:r,onCopy:i}){let[a,o]=(0,F.useState)(``),[s,c]=(0,F.useState)(null),[l,u]=(0,F.useState)(null),[d,f]=(0,F.useState)(new Set);(0,F.useEffect)(()=>{n&&e&&(o(n.path.substring(0,n.path.lastIndexOf(`/`))||`/`),c(n.rootPath),u(n.rootPath))},[n,e]);let p=e=>{f(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},m=()=>{if(n&&a!==null&&s!==null&&l!==null){let e=n.path.split(`/`).pop()||``,r=a===`/`?`/${e}`:`${a}/${e}`;i(n.path,r,l,s),t(!1)}};if(!n)return null;let h=r.find(e=>e.root.path===s)?.files||[],g=a?a===`/`?`目录`:a.split(`/`).filter(Boolean).join(` / `):``;return(0,z.jsx)(d9,{open:e,onOpenChange:t,children:(0,z.jsxs)(p9,{className:`sm:max-w-[480px] max-h-[80vh] flex flex-col`,children:[(0,z.jsxs)(m9,{children:[(0,z.jsx)(g9,{children:`复制到`}),(0,z.jsxs)(_9,{children:[`选择要将「`,n.name,`」复制到的目标位置`]})]}),(0,z.jsxs)(`div`,{className:`flex items-center gap-2 py-2 text-sm text-muted-foreground`,children:[(0,z.jsx)(we,{className:`size-4 shrink-0`}),(0,z.jsx)(`span`,{className:`truncate`,children:n.name})]}),r.length>1&&(0,z.jsxs)(`div`,{className:`mb-3`,children:[(0,z.jsx)(`label`,{className:`text-xs text-muted-foreground mb-1.5 block`,children:`目标目录`}),(0,z.jsx)(`select`,{value:s||``,onChange:e=>{c(e.target.value),o(`/`),f(new Set)},className:`w-full px-3 py-2 text-sm border rounded-md bg-background`,children:r.map(e=>(0,z.jsx)(`option`,{value:e.root.path,children:e.root.path.split(`/`).pop()||e.root.path},e.root.path))})]}),(0,z.jsx)(U9,{className:`h-[300px] border rounded-md`,children:(0,z.jsxs)(`div`,{className:`p-2 space-y-0.5`,children:[(0,z.jsxs)(`div`,{className:R(`flex items-center gap-1 py-1.5 px-2 rounded-md cursor-pointer hover:bg-accent`,a===`/`&&`bg-accent`),onClick:()=>o(`/`),children:[(0,z.jsx)(ke,{className:`size-4 shrink-0 text-muted-foreground`}),(0,z.jsx)(`span`,{className:`text-sm`,children:`目录`}),a===`/`&&(0,z.jsx)(`span`,{className:`text-xs text-muted-foreground ml-auto`,children:`复制到这里`})]}),h.map(e=>(0,z.jsx)(K9,{node:e,selectedPath:a,onSelect:o,expandedPaths:d,onToggleExpand:p,currentItemPath:n.path,rootPath:s||``},e.path))]})}),(0,z.jsxs)(`div`,{className:`text-xs text-muted-foreground py-2`,children:[`目标位置: `,(0,z.jsx)(`span`,{className:`font-medium text-foreground`,children:g})]}),(0,z.jsxs)(h9,{children:[(0,z.jsx)(gr,{variant:`outline`,onClick:()=>t(!1),children:`取消`}),(0,z.jsx)(gr,{onClick:m,disabled:a===null,children:`复制`})]})]})})}var q9=F.forwardRef(({className:e,checked:t,onCheckedChange:n,onClick:r,...i},a)=>(0,z.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":t,"data-state":t?`checked`:`unchecked`,ref:a,onClick:e=>{r?.(e),n&&n(!t)},className:R(`peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50`,`data-[state=checked]:bg-primary data-[state=unchecked]:bg-input`,e),...i,children:(0,z.jsx)(`span`,{"data-state":t?`checked`:`unchecked`,className:R(`pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform`,`data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0`)})}));q9.displayName=`Switch`;function dle({open:e,onOpenChange:t}){let[n,r]=F.useState({showHiddenFiles:!1,allowedExtensions:`.md,.markdown,.mdown,.mkdn,.mkd,.mdwn,.mkdown,.ron`,ignore:{patterns:``}}),[i,a]=F.useState(!1),[o,s]=F.useState(null),[c,l]=F.useState(()=>typeof window>`u`?!1:window.innerWidth<768);F.useEffect(()=>{let e=()=>l(window.innerWidth<768);return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),F.useEffect(()=>{e&&fetch(`/api/files/config`).then(e=>e.json()).then(e=>{r({showHiddenFiles:e.showHiddenFiles??!1,allowedExtensions:(e.allowedExtensions||[]).join(`,`),ignore:{patterns:(e.ignore?.patterns||[]).join(`
573
573
  `)}}),s(null)}).catch(()=>{s(`Failed to load settings`)})},[e]);let u=F.useCallback(async()=>{a(!0),s(null);try{let e=n.allowedExtensions.split(`,`).map(e=>e.trim()).filter(e=>e.startsWith(`.`)),r=n.ignore.patterns.split(`
574
574
  `).map(e=>e.trim()).filter(Boolean);if(!(await fetch(`/api/files/config`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({showHiddenFiles:n.showHiddenFiles,allowedExtensions:e,ignore:{patterns:r}})})).ok)throw Error(`Failed to save settings`);t(!1),window.dispatchEvent(new CustomEvent(`config-changed`))}catch{s(`Failed to save settings`)}finally{a(!1)}},[n,t]),d=(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(`div`,{className:`grid gap-6 py-4`,children:[(0,z.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,z.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,z.jsx)(`label`,{htmlFor:`show-hidden`,className:`text-sm font-medium leading-none`,children:`显示隐藏文件`}),(0,z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`显示以 . 开头的文件和文件夹`})]}),(0,z.jsx)(q9,{id:`show-hidden`,checked:n.showHiddenFiles,onCheckedChange:e=>r(t=>({...t,showHiddenFiles:e}))})]}),(0,z.jsxs)(`div`,{className:`space-y-2`,children:[(0,z.jsx)(`label`,{htmlFor:`extensions`,className:`text-sm font-medium leading-none`,children:`文件扩展名`}),(0,z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`允许的文件扩展名,用逗号分隔`}),(0,z.jsx)(`textarea`,{id:`extensions`,value:n.allowedExtensions,onChange:e=>r(t=>({...t,allowedExtensions:e.target.value})),placeholder:`.md,.markdown,.mdown,.mkdn,.mkd,.mdwn,.mkdown,.ron`,rows:3,className:`flex w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50`})]}),(0,z.jsxs)(`div`,{className:`border-t border-border pt-4 space-y-4`,children:[(0,z.jsx)(`div`,{className:`text-sm font-medium`,children:`忽略设置`}),(0,z.jsxs)(`div`,{className:`space-y-2`,children:[(0,z.jsx)(`label`,{htmlFor:`ignore-patterns`,className:`text-sm font-medium leading-none`,children:`全局忽略模式`}),(0,z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`每行一个模式,支持 glob 语法(如 node_modules/, *.log)`}),(0,z.jsx)(`textarea`,{id:`ignore-patterns`,value:n.ignore.patterns,onChange:e=>r(t=>({...t,ignore:{...t.ignore,patterns:e.target.value}})),placeholder:`node_modules/
575
575
  dist/