@intent-hq/web 2.310.1 → 2.310.2

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 (251) hide show
  1. package/package.json +1 -1
  2. package/web/app/immutable/assets/{DiagramPresentation.fimBl1wP.css → DiagramPresentation.Bfi3xHm0.css} +1 -1
  3. package/web/app/immutable/chunks/-xK_vQQs.js +1 -0
  4. package/web/app/immutable/chunks/{CQe4IdgR.js → 189zCzpy.js} +1 -1
  5. package/web/app/immutable/chunks/6XLvYn_R.js +4 -0
  6. package/web/app/immutable/chunks/{BIxkRFIj.js → 7LPFBi2V.js} +2 -2
  7. package/web/app/immutable/chunks/{D81gRUjY.js → 9Al7uANH.js} +1 -1
  8. package/web/app/immutable/chunks/{xMirTl3q.js → 9Ax53qRD.js} +2 -2
  9. package/web/app/immutable/chunks/{DQEBW0YT.js → 9U2m-KE4.js} +1 -1
  10. package/web/app/immutable/chunks/{t9id1Dgw.js → B08PB3d6.js} +1 -1
  11. package/web/app/immutable/chunks/B1wLVJWc.js +7 -0
  12. package/web/app/immutable/chunks/B1zCpBoo.js +217 -0
  13. package/web/app/immutable/chunks/{CsYRAdgB.js → B2-LFLJm.js} +1 -1
  14. package/web/app/immutable/chunks/{B4dTn6xv.js → B3NZDdp-.js} +1 -1
  15. package/web/app/immutable/chunks/{r1_PrlQL.js → B3u9yhMd.js} +1 -1
  16. package/web/app/immutable/chunks/{DzvQOT8_.js → B6ACa1PM.js} +1 -1
  17. package/web/app/immutable/chunks/{DXOCO_oS.js → B7VxeONz.js} +1 -1
  18. package/web/app/immutable/chunks/{CEdLQlJ6.js → BGOzArFr.js} +6 -6
  19. package/web/app/immutable/chunks/{Bfkn2BGM.js → BGSgFd0R.js} +1 -1
  20. package/web/app/immutable/chunks/{C7oH1dbI.js → BHMk19Fd.js} +1 -1
  21. package/web/app/immutable/chunks/{DUkegami.js → BRp0P9cF.js} +1 -1
  22. package/web/app/immutable/chunks/{BtHVXttl.js → BS3KKa6i.js} +5 -5
  23. package/web/app/immutable/chunks/{Bhcwd2SW.js → BSN7-Qxa.js} +4 -4
  24. package/web/app/immutable/chunks/{CnmCWFKQ.js → BU1SD4F5.js} +2 -2
  25. package/web/app/immutable/chunks/BUvLOETw.js +8 -0
  26. package/web/app/immutable/chunks/{CwH3s3Sg.js → B_CxKeY9.js} +1 -1
  27. package/web/app/immutable/chunks/{CsASRGy9.js → B_F8B07u.js} +5 -5
  28. package/web/app/immutable/chunks/{D-9LH0ah.js → B_u6ph9g.js} +1 -1
  29. package/web/app/immutable/chunks/{CHH2PtZ7.js → BbajLcMi.js} +1 -1
  30. package/web/app/immutable/chunks/{TQIai6Ne.js → BcGA_XKM.js} +79 -79
  31. package/web/app/immutable/chunks/Bdj20t_M.js +200 -0
  32. package/web/app/immutable/chunks/{Si43_nYW.js → BfVF2I5Q.js} +3 -3
  33. package/web/app/immutable/chunks/{B20hJMKp.js → BgjzIHmr.js} +2 -2
  34. package/web/app/immutable/chunks/BhFdeIZl.js +1 -0
  35. package/web/app/immutable/chunks/{CeEeQIAV.js → BjS3bCVA.js} +1 -1
  36. package/web/app/immutable/chunks/Bl1SUWQK.js +1 -0
  37. package/web/app/immutable/chunks/BtFywNMt.js +40 -0
  38. package/web/app/immutable/chunks/{B_D0NLtg.js → BwThkZnv.js} +1 -1
  39. package/web/app/immutable/chunks/ByGoYv9M.js +1 -0
  40. package/web/app/immutable/chunks/Bz2AaX7v.js +38 -0
  41. package/web/app/immutable/chunks/{j0ThtFJc.js → BzqKIdEP.js} +1 -1
  42. package/web/app/immutable/chunks/{BV9p4X5I.js → C-27EQSK.js} +6 -6
  43. package/web/app/immutable/chunks/C2FKcF8a.js +99 -0
  44. package/web/app/immutable/chunks/{D04E4MVv.js → C2ypXh8V.js} +4 -4
  45. package/web/app/immutable/chunks/{DaEQgqyy.js → C5bjHjx4.js} +1 -1
  46. package/web/app/immutable/chunks/{C-Mmob1s.js → C64YVcCh.js} +1 -1
  47. package/web/app/immutable/chunks/{BV7dztYI.js → C7-VQsLR.js} +1 -1
  48. package/web/app/immutable/chunks/C7ldC6zu.js +41 -0
  49. package/web/app/immutable/chunks/{CgAIOmc3.js → C7xfOFNZ.js} +4 -4
  50. package/web/app/immutable/chunks/{phowbgF-.js → CAt8c0ls.js} +1 -1
  51. package/web/app/immutable/chunks/CC-vc0Sh.js +2 -0
  52. package/web/app/immutable/chunks/{DjEB6QMF.js → CDmxeAFz.js} +1 -1
  53. package/web/app/immutable/chunks/{DevHtnbn.js → CLUug_7o.js} +1 -1
  54. package/web/app/immutable/chunks/{CPvhRhlk.js → CLyqqizl.js} +11 -11
  55. package/web/app/immutable/chunks/{DQulsXJ7.js → CO5Qz17e.js} +1 -1
  56. package/web/app/immutable/chunks/{B9r0JXjW.js → COBtdbv4.js} +1 -1
  57. package/web/app/immutable/chunks/COZ8XMYr.js +2 -0
  58. package/web/app/immutable/chunks/{qMHHnffV.js → CQK97B3l.js} +1 -1
  59. package/web/app/immutable/chunks/{CQf-fH5v.js → CYTBw0CY.js} +1 -1
  60. package/web/app/immutable/chunks/{CUvX4uDB.js → CZLMJ41d.js} +3 -3
  61. package/web/app/immutable/chunks/{Cuozo7M1.js → CZqaUHhn.js} +1 -1
  62. package/web/app/immutable/chunks/CeVWos-t.js +1 -0
  63. package/web/app/immutable/chunks/CepoDpYW.js +1 -0
  64. package/web/app/immutable/chunks/{DdAxykhC.js → CiBABzvX.js} +1 -1
  65. package/web/app/immutable/chunks/{D8SVxzqF.js → CjcP6chv.js} +1 -1
  66. package/web/app/immutable/chunks/{EZw3rvya.js → CkactGV1.js} +30 -30
  67. package/web/app/immutable/chunks/ClebXGIM.js +141 -0
  68. package/web/app/immutable/chunks/{BCm8Gasf.js → CnfDI0G9.js} +1 -1
  69. package/web/app/immutable/chunks/{BEhoKnQT.js → CoiqgZqV.js} +1 -1
  70. package/web/app/immutable/chunks/{DRMT9vvq.js → CpQksukT.js} +1 -1
  71. package/web/app/immutable/chunks/CrX2GQl1.js +1 -0
  72. package/web/app/immutable/chunks/{DCeW9_0X.js → CtDXgUYh.js} +2 -2
  73. package/web/app/immutable/chunks/CvEzUeZj.js +39 -0
  74. package/web/app/immutable/chunks/{CCIGQjYf.js → CxP8jrn2.js} +1 -1
  75. package/web/app/immutable/chunks/{D411lQkp.js → D2XAsGw-.js} +1 -1
  76. package/web/app/immutable/chunks/D3in5AGo.js +34 -0
  77. package/web/app/immutable/chunks/D3ma4MWK.js +84 -0
  78. package/web/app/immutable/chunks/{_F3xl3RI.js → D3p4HGPq.js} +1 -1
  79. package/web/app/immutable/chunks/D57k4GEE.js +344 -0
  80. package/web/app/immutable/chunks/{BUSwtV99.js → D5mZ2XGM.js} +1 -1
  81. package/web/app/immutable/chunks/{D_9AVJm5.js → DE1vhlzN.js} +1 -1
  82. package/web/app/immutable/chunks/{CWyh7Yhz.js → DI-WSiIl.js} +1 -1
  83. package/web/app/immutable/chunks/DMfS3QUv.js +213 -0
  84. package/web/app/immutable/chunks/DMmGJ3th.js +140 -0
  85. package/web/app/immutable/chunks/DPADHNob.js +3 -0
  86. package/web/app/immutable/chunks/DPcySxOl.js +24 -0
  87. package/web/app/immutable/chunks/{ejL3HmTG.js → DQNwUygY.js} +3 -3
  88. package/web/app/immutable/chunks/{BGLkcG6I.js → DR3ukAe9.js} +2 -2
  89. package/web/app/immutable/chunks/{BmDskjjc.js → DRKyy5zo.js} +1 -1
  90. package/web/app/immutable/chunks/DTpCNXVX.js +62 -0
  91. package/web/app/immutable/chunks/DW02E8JU.js +291 -0
  92. package/web/app/immutable/chunks/{BKY64haD.js → DbnaPZDp.js} +6 -6
  93. package/web/app/immutable/chunks/Dhhgf7-r.js +36 -0
  94. package/web/app/immutable/chunks/{C8CCN24q.js → DjaKy3j_.js} +1 -1
  95. package/web/app/immutable/chunks/{C0DDaBnV.js → Dk4znOdW.js} +1 -1
  96. package/web/app/immutable/chunks/{R7gFhaG_.js → Dl1xcl6N.js} +1 -1
  97. package/web/app/immutable/chunks/Dmv_LV6R.js +106 -0
  98. package/web/app/immutable/chunks/{BNg3GOxL.js → Dr28se2A.js} +2 -2
  99. package/web/app/immutable/chunks/Dr_BXnmT.js +169 -0
  100. package/web/app/immutable/chunks/{ByGsJxdn.js → Dvt2xumc.js} +1 -1
  101. package/web/app/immutable/chunks/DxHqMweQ.js +27 -0
  102. package/web/app/immutable/chunks/Dyv7eW7r.js +1 -0
  103. package/web/app/immutable/chunks/{CBHPIqXg.js → DzDnAGVP.js} +1 -1
  104. package/web/app/immutable/chunks/{C0Yks_oS.js → IIWxUL8F.js} +1 -1
  105. package/web/app/immutable/chunks/IjQ_akx8.js +24 -0
  106. package/web/app/immutable/chunks/{DeopB2f-.js → JFNcUgqI.js} +3 -3
  107. package/web/app/immutable/chunks/{dtB9lR1B.js → JvGvDA7z.js} +1 -1
  108. package/web/app/immutable/chunks/{BsP5G0Fo.js → LXPDKlyI.js} +1 -1
  109. package/web/app/immutable/chunks/{zXW6V5sa.js → M5rEGvXZ.js} +1 -1
  110. package/web/app/immutable/chunks/{DOVnLHFz.js → O55LMojB.js} +1 -1
  111. package/web/app/immutable/chunks/{t3bi-ExW.js → O86272iX.js} +2 -2
  112. package/web/app/immutable/chunks/{D-o9b0Cd.js → PW60rHG1.js} +2 -2
  113. package/web/app/immutable/chunks/{fULl8IO9.js → UzQ5fjmd.js} +7 -7
  114. package/web/app/immutable/chunks/VmPClZ6P.js +98 -0
  115. package/web/app/immutable/chunks/WKN7DEK1.js +292 -0
  116. package/web/app/immutable/chunks/{7KTbkf4W.js → YuniekLU.js} +2 -2
  117. package/web/app/immutable/chunks/{DxlwMmI8.js → _Q4NEhG2.js} +1 -1
  118. package/web/app/immutable/chunks/{DMGAuSgb.js → _sFm91KN.js} +4 -4
  119. package/web/app/immutable/chunks/{Drg52kVf.js → cF0DaKkd.js} +1 -1
  120. package/web/app/immutable/chunks/{DOHtPCK9.js → d9OF_ecy.js} +1 -1
  121. package/web/app/immutable/chunks/eHLf0w_s.js +1 -0
  122. package/web/app/immutable/chunks/ey5Fwige.js +1 -0
  123. package/web/app/immutable/chunks/gq2RHuUM.js +120 -0
  124. package/web/app/immutable/chunks/{BKGPkCRs.js → hJG5qV93.js} +1 -1
  125. package/web/app/immutable/chunks/jfltPaLX.js +370 -0
  126. package/web/app/immutable/chunks/{BBTS8ZOM.js → l0v05b1J.js} +3 -3
  127. package/web/app/immutable/chunks/{CnszEr0a.js → le8iLKoG.js} +1 -1
  128. package/web/app/immutable/chunks/{CoeuT-m3.js → mCGfnSaU.js} +1 -1
  129. package/web/app/immutable/chunks/{B0X6Qy4e.js → mNrkfPcL.js} +1 -1
  130. package/web/app/immutable/chunks/{DLm51UIm.js → tzNFwvLY.js} +1 -1
  131. package/web/app/immutable/chunks/{Coy9jSf1.js → xL2Hl8pt.js} +1 -1
  132. package/web/app/immutable/chunks/{qOCErwrn.js → yEkT96At.js} +1 -1
  133. package/web/app/immutable/chunks/{DhdMM_zt.js → yGxUPrAb.js} +14 -14
  134. package/web/app/immutable/entry/{app.DlF41taB.js → app.CWgSMPHo.js} +2 -2
  135. package/web/app/immutable/entry/start.DRM4Ek1S.js +1 -0
  136. package/web/app/immutable/nodes/{0.BLjNhnkb.js → 0.DsHcmAxw.js} +1 -1
  137. package/web/app/immutable/nodes/{1.DaghOy3j.js → 1.CkY-7ake.js} +1 -1
  138. package/web/app/immutable/nodes/{10.CbV_flkh.js → 10.CdTsXOpX.js} +1 -1
  139. package/web/app/immutable/nodes/{14.N_oC1pv5.js → 14.juvATfIp.js} +1 -1
  140. package/web/app/immutable/nodes/{16.Cn0uYbJe.js → 16.DuXLhJX1.js} +2 -2
  141. package/web/app/immutable/nodes/{2.CMERPJYK.js → 2.DL0H4Ehj.js} +8 -8
  142. package/web/app/immutable/nodes/{3.Dk5w9XeG.js → 3.CsarMzm8.js} +1 -1
  143. package/web/app/immutable/nodes/{4.CvLiKH0B.js → 4.DOKXGcKD.js} +1 -1
  144. package/web/app/immutable/nodes/{5.BL5oLCOi.js → 5.5nmYhZgy.js} +1 -1
  145. package/web/app/immutable/nodes/{6.DiKzgiKt.js → 6.BMO8vjvw.js} +1 -1
  146. package/web/app/immutable/nodes/{7.CM-hNW3A.js → 7.Rmoc-ypk.js} +1 -1
  147. package/web/app/immutable/nodes/{8.BThIGSQR.js → 8.Dy5AT1iw.js} +2 -2
  148. package/web/app/immutable/nodes/{9.D70tN3NX.js → 9.Dtv2dSUT.js} +18 -18
  149. package/web/app/version.json +1 -1
  150. package/web/index.html +9 -9
  151. package/web/app/immutable/chunks/-SL67XKV.js +0 -1
  152. package/web/app/immutable/chunks/351KaJp_.js +0 -24
  153. package/web/app/immutable/chunks/7Iuyw4Ow.js +0 -106
  154. package/web/app/immutable/chunks/9ySBq1wF.js +0 -36
  155. package/web/app/immutable/chunks/B2safKX4.js +0 -1
  156. package/web/app/immutable/chunks/B8QrskMI.js +0 -139
  157. package/web/app/immutable/chunks/BCO4VeSA.js +0 -1
  158. package/web/app/immutable/chunks/BCaDoF8Y.js +0 -1
  159. package/web/app/immutable/chunks/BEdJCn-8.js +0 -1
  160. package/web/app/immutable/chunks/BGBb6fI-.js +0 -120
  161. package/web/app/immutable/chunks/BGQ3htf5.js +0 -1
  162. package/web/app/immutable/chunks/BKLEAopb.js +0 -7
  163. package/web/app/immutable/chunks/BKSgn5w-.js +0 -1
  164. package/web/app/immutable/chunks/BOXqfDS_.js +0 -40
  165. package/web/app/immutable/chunks/BP_ooGOd.js +0 -24
  166. package/web/app/immutable/chunks/BQApP15C.js +0 -99
  167. package/web/app/immutable/chunks/BS6cE8e9.js +0 -231
  168. package/web/app/immutable/chunks/BTXk2yGf.js +0 -96
  169. package/web/app/immutable/chunks/BVrOGXf1.js +0 -78
  170. package/web/app/immutable/chunks/BZoKWA-r.js +0 -96
  171. package/web/app/immutable/chunks/BbiXTFqz.js +0 -1
  172. package/web/app/immutable/chunks/BgmKjqUX.js +0 -1
  173. package/web/app/immutable/chunks/Bk7xBWHf.js +0 -34
  174. package/web/app/immutable/chunks/BoiNnj2h.js +0 -1
  175. package/web/app/immutable/chunks/BrVvVCxw.js +0 -1
  176. package/web/app/immutable/chunks/ByM2DIOs.js +0 -1
  177. package/web/app/immutable/chunks/ByzYvvQp.js +0 -70
  178. package/web/app/immutable/chunks/Bz0SnIMO.js +0 -1
  179. package/web/app/immutable/chunks/C1IwSyrV.js +0 -99
  180. package/web/app/immutable/chunks/C9gL5x04.js +0 -39
  181. package/web/app/immutable/chunks/C9nyJoiB.js +0 -41
  182. package/web/app/immutable/chunks/CBV2Z_QZ.js +0 -89
  183. package/web/app/immutable/chunks/CDHds8o_.js +0 -3
  184. package/web/app/immutable/chunks/CHIHAnR-.js +0 -1
  185. package/web/app/immutable/chunks/CHj2oCmD.js +0 -39
  186. package/web/app/immutable/chunks/CIXNMjfT.js +0 -206
  187. package/web/app/immutable/chunks/CKFDW9cI.js +0 -24
  188. package/web/app/immutable/chunks/CKQlE_M1.js +0 -88
  189. package/web/app/immutable/chunks/CSBhPNbN.js +0 -206
  190. package/web/app/immutable/chunks/CSLTsum9.js +0 -38
  191. package/web/app/immutable/chunks/CSbiiZpm.js +0 -354
  192. package/web/app/immutable/chunks/CToDhNW4.js +0 -1
  193. package/web/app/immutable/chunks/CYFK9YEX.js +0 -168
  194. package/web/app/immutable/chunks/CcGF51wP.js +0 -1
  195. package/web/app/immutable/chunks/Cd5vVJw4.js +0 -292
  196. package/web/app/immutable/chunks/CgjSMAIJ.js +0 -120
  197. package/web/app/immutable/chunks/Ck7B90Kr.js +0 -38
  198. package/web/app/immutable/chunks/CkAILno9.js +0 -62
  199. package/web/app/immutable/chunks/CkawHIFZ.js +0 -1
  200. package/web/app/immutable/chunks/ClXr1b-t.js +0 -8
  201. package/web/app/immutable/chunks/CmWBRPmR.js +0 -24
  202. package/web/app/immutable/chunks/Cmo-9vFV.js +0 -1
  203. package/web/app/immutable/chunks/CoFCa7Mb.js +0 -231
  204. package/web/app/immutable/chunks/CrcLvVto.js +0 -84
  205. package/web/app/immutable/chunks/Cs_Q6mos.js +0 -1
  206. package/web/app/immutable/chunks/CsnLwu9F.js +0 -2
  207. package/web/app/immutable/chunks/CuYeKLE8.js +0 -8
  208. package/web/app/immutable/chunks/CvOaoHrI.js +0 -1
  209. package/web/app/immutable/chunks/CvYzv8kf.js +0 -1
  210. package/web/app/immutable/chunks/CxRm1vYn.js +0 -342
  211. package/web/app/immutable/chunks/CyfBUrNA.js +0 -1
  212. package/web/app/immutable/chunks/D1QKDDLH.js +0 -1
  213. package/web/app/immutable/chunks/D61DwhDw.js +0 -3
  214. package/web/app/immutable/chunks/DBAJPVI_.js +0 -1
  215. package/web/app/immutable/chunks/DBt8jmEX.js +0 -40
  216. package/web/app/immutable/chunks/DD-T_Om0.js +0 -178
  217. package/web/app/immutable/chunks/DEOiJZFa.js +0 -168
  218. package/web/app/immutable/chunks/DHW4IXFj.js +0 -36
  219. package/web/app/immutable/chunks/DJ0w8Oax.js +0 -129
  220. package/web/app/immutable/chunks/DJ52BT20.js +0 -1
  221. package/web/app/immutable/chunks/DK1048Bw.js +0 -129
  222. package/web/app/immutable/chunks/DZ0nrC9W.js +0 -162
  223. package/web/app/immutable/chunks/DeRneTJF.js +0 -106
  224. package/web/app/immutable/chunks/Df6EnPla.js +0 -4
  225. package/web/app/immutable/chunks/DfMKUxMU.js +0 -30
  226. package/web/app/immutable/chunks/DkH3yb1j.js +0 -34
  227. package/web/app/immutable/chunks/Doxgswr3.js +0 -4
  228. package/web/app/immutable/chunks/Dt53cexP.js +0 -1
  229. package/web/app/immutable/chunks/Dx6eBL0x.js +0 -1
  230. package/web/app/immutable/chunks/HP7Asd0t.js +0 -2
  231. package/web/app/immutable/chunks/HP8lGamR.js +0 -257
  232. package/web/app/immutable/chunks/HzpfURmp.js +0 -84
  233. package/web/app/immutable/chunks/PJfe_iA1.js +0 -1
  234. package/web/app/immutable/chunks/PXMyYXQv.js +0 -1
  235. package/web/app/immutable/chunks/Qi3HrsAm.js +0 -1
  236. package/web/app/immutable/chunks/S1FanOB0.js +0 -162
  237. package/web/app/immutable/chunks/SuMU9B9i.js +0 -1
  238. package/web/app/immutable/chunks/UaGv-ChR.js +0 -257
  239. package/web/app/immutable/chunks/YqyEOqRv.js +0 -178
  240. package/web/app/immutable/chunks/_MGNV7ZN.js +0 -338
  241. package/web/app/immutable/chunks/_lZu5Dth.js +0 -292
  242. package/web/app/immutable/chunks/gzjZWAx8.js +0 -62
  243. package/web/app/immutable/chunks/hqSEunOk.js +0 -15
  244. package/web/app/immutable/chunks/nGCCQCpO.js +0 -1
  245. package/web/app/immutable/chunks/o-kBqlaj.js +0 -7
  246. package/web/app/immutable/chunks/opO2fBQB.js +0 -1
  247. package/web/app/immutable/chunks/pdFamTTi.js +0 -7
  248. package/web/app/immutable/chunks/rEI8JpP3.js +0 -1
  249. package/web/app/immutable/chunks/s5P9UVzf.js +0 -1
  250. package/web/app/immutable/chunks/sIHUXgeh.js +0 -41
  251. package/web/app/immutable/entry/start.CCtO40vu.js +0 -1
@@ -1,2 +1,2 @@
1
- import{t as Mt,bq as ae,_ as Ar,a_ as re,by as Ut,bu as be,bs as Zt,b as jt,bo as d}from"./7rNOGHzs.js";import{bs as Et,ca as ke,aD as e,bH as u,a5 as R,bA as P,W as s,bn as Lt,bV as O,c9 as i,aA as oe,c6 as Ot,ay as ue,be as Ge,b$ as et,b_ as F,bO as g,bS as p,bl as S,aB as k,bj as Vr,aw as tt,ai as Nr,c5 as pr,a as gr,a7 as je,aj as vt,cd as Wr,br as Br}from"./B8o4lNgr.js";import{E as mr,F as Or}from"./DCaHy20k.js";import{s as rt,l as yt,k as or,h as Pt}from"./DmsDslNo.js";import{c as St}from"./CiENRH6A.js";import{b as _r}from"./D2g8BuR1.js";import{Hq as V,n5 as hr,uI as wr,uH as br,JF as Hr,JG as qr,eu as Jr,ev as Xr,J4 as ir,lg as Ht,AM as nr,rp as sr,nt as Kr,yo as Yr,a9 as lr,HW as Gr,Ib as Zr,mH as Qr,iA as ea,n7 as ta,u7 as ra,yL as aa,J3 as oa}from"./CRwmdgt6.js";import{g as ia}from"./CoSk1zgY.js";import{a as na,g as sa,i as la,c as da,h as ca,d as ua,e as dr,f as fa,b as qt}from"./BAEcHnha.js";import{by as va,bL as pa,dl as ga}from"./KQTrHxko.js";import{w as cr,d as ma}from"./7TuwH0wv.js";import{f as _a}from"./CPQdU3ZA.js";import{n as Jt}from"./lfJ8pseq.js";import{f as Ce,ax as ha}from"./Bgegixo2.js";import"./CQ4a5a4v.js";import{F as Qe,ab as wa,at as ba,aX as xa,b1 as Tt,co as ya,cp as Pa,bk as $a,cN as ka,c5 as Ia}from"./CFejQM6t.js";import{g as Fa,i as Ca,w as ur}from"./DSjRkndX.js";import{c as Sa}from"./ChTqQfQN.js";import"./D-cnPaTJ.js";import{V as Da}from"./BV9p4X5I.js";import{i as Xt,b as Ta,a as Ra}from"./H2jLkRRS.js";import{C as Yt,p as Ma}from"./KbdMwrlk.js";import{M as Ua}from"./Bhcwd2SW.js";import{t as Kt,u as xr}from"./DzMmhJrp.js";import"./DFHyIdsA.js";import"./Ck-Ax5yG.js";import{M as Dt}from"./yI5lBaQ8.js";import{V as ja}from"./CZERqHN7.js";import{bN as Ea,b4 as La}from"./TQIai6Ne.js";import{ak as za}from"./EZw3rvya.js";const yr=V.createSelector((Y,x)=>hr(Y.pdfPreview.previews,x));var Aa=k('<div class="flex shrink-0 flex-wrap items-center justify-center gap-2 border-b border-border p-2"><!> <span aria-live="polite"> </span> <!> <!> <span> </span> <!></div> <div class="min-h-0 flex-1 overflow-auto p-4"><canvas class="mx-auto block" role="img"></canvas></div>',1),Va=k('<div class="flex h-full min-h-0 flex-col" data-testid="pdf-viewer"><!></div>');function Gt(Y,x){if(new.target)return Mt({component:Gt,...Y});Et(x,!0);const Ie=()=>be(xe,"$preview",at),[at,ie]=Zt();let $=ae(x,"workspaceId",7),ne=ae(x,"filePath",7),Fe=ae(x,"gitRootId",7);const Se=crypto.randomUUID(),xe=yr(Se),_e=new WeakMap;let Q=O(null),qe=O(void 0),N=O(1),B=O(1),se=O(!0),E=O(!1),Le=O(null),Ne=O(0);const ye=i(()=>Ie()?.error??e(Le)),De=i(()=>e(ye)==="missing"?d.file_pdf_missing_error():e(ye)==="large"?d.file_pdf_large_error():e(ye)==="invalid"?d.file_pdf_invalid_error():e(ye)==="password"?d.file_pdf_password_error():d.file_pdf_load_error());ke(()=>{const l=$(),y=ne();e(Ne);const L=crypto.randomUUID();return V.dispatch(wr(Se,L,l,y,...Fe()?[{gitRootId:Fe()}]:[])),()=>{V.dispatch(br(Se,L))}}),ke(()=>{const l=Ie()?.url;let y=!1,L;if(u(Q,null),u(Le,null),u(se,!0),u(N,1),u(B,1),!!l)return(async()=>{try{const{loadPdfDocument:X}=await Ar(async()=>{const{loadPdfDocument:he}=await import("./BqoyBPEG.js");return{loadPdfDocument:he}},[],import.meta.url);if(y)return;L=X(l);const le=await L.promise;y||u(Q,le)}catch(X){if(y)return;u(Le,X instanceof Error&&X.name==="PasswordException"?"password":X instanceof Error&&X.name==="InvalidPDFException"?"invalid":"load",!0)}finally{y||u(se,!1)}})(),()=>{y=!0,L?.destroy()}}),ke(()=>{const l=e(Q),y=e(qe),L=e(N),X=e(B);if(!l||!y)return;let le=!1,he,U;const de=()=>{if(!U)return;const K=(_e.get(U)??1)-1;K?_e.set(U,K):(_e.delete(U),U.cleanup()),U=void 0};return u(E,!0),(async()=>{try{if(U=await l.getPage(L),_e.set(U,(_e.get(U)??0)+1),le){de();return}const K=U.getViewport({scale:X}),ee=Math.min(window.devicePixelRatio||1,2,Math.sqrt(16e6/(K.width*K.height)));y.width=Math.ceil(K.width*ee),y.height=Math.ceil(K.height*ee),y.style.width=`${K.width}px`,y.style.height=`${K.height}px`,he=U.render({canvas:y,viewport:K,transform:[ee,0,0,ee,0,0]}),await he.promise}catch{le||u(Le,"invalid")}finally{le||u(E,!1)}})(),()=>{le=!0,he?.cancel(),he?he.promise.then(de,de):de()}});var We={get workspaceId(){return $()},set workspaceId(l){$(l),oe()},get filePath(){return ne()},set filePath(l){ne(l),oe()},get gitRootId(){return Fe()},set gitRootId(l){Fe(l),oe()},$set:Ut,$on:(l,y)=>jt(x,l,y)},o=Va(),c=R(o);{var M=l=>{{const y=X=>{Ge();var le=et();F(()=>g(le,e(De))),s(X,le)};let L=i(()=>d.ui_combobox_retry_label());Fa(l,{onRetry:()=>Ot(Ne),get retryLabel(){return e(L)},class:"m-auto",message:y,$$slots:{message:!0}})}},m=l=>{{let y=i(()=>d.file_pdf_loading_label());Ca(l,{get label(){return e(y)},count:1,class:"p-4"})}},w=l=>{var y=Aa(),L=ue(y),X=R(L);{let ge=i(()=>e(N)<=1);Ce(X,{variant:"ghost",size:"compact",get disabled(){return e(ge)},onclick:()=>Ot(N,-1),children:(Pe,Xe)=>{Ge();var $e=et();F(fe=>g($e,fe),[()=>d.file_pdf_previous_label()]),s(Pe,$e)},$$slots:{default:!0}})}var le=p(X,2),he=S(le,!0),U=p(le,2);{let ge=i(()=>e(N)>=e(Q).numPages);Ce(U,{variant:"ghost",size:"compact",get disabled(){return e(ge)},onclick:()=>Ot(N),children:(Pe,Xe)=>{Ge();var $e=et();F(fe=>g($e,fe),[()=>d.file_pdf_next_label()]),s(Pe,$e)},$$slots:{default:!0}})}var de=p(U,2);{let ge=i(()=>e(B)<=.25);Ce(de,{variant:"ghost",size:"compact",get disabled(){return e(ge)},onclick:()=>u(B,Math.max(.25,e(B)-.25),!0),children:(Pe,Xe)=>{Ge();var $e=et();F(fe=>g($e,fe),[()=>d.editor_fileViewer_zoomOut_tooltip()]),s(Pe,$e)},$$slots:{default:!0}})}var K=p(de,2),ee=S(K,!0),ot=p(K,2);{let ge=i(()=>e(B)>=3);Ce(ot,{variant:"ghost",size:"compact",get disabled(){return e(ge)},onclick:()=>u(B,Math.min(3,e(B)+.25),!0),children:(Pe,Xe)=>{Ge();var $e=et();F(fe=>g($e,fe),[()=>d.editor_fileViewer_zoomIn_tooltip()]),s(Pe,$e)},$$slots:{default:!0}})}P(L);var it=p(L,2),Je=R(it);let Ze;_r(Je,ge=>u(qe,ge),()=>e(qe)),P(it),F((ge,Pe,Xe)=>{g(he,ge),g(ee,Pe),rt(it,"aria-busy",e(E)),rt(Je,"aria-label",Xe),Ze=yt(Je,"",Ze,{visibility:e(E)?"hidden":"visible"})},[()=>d.file_pdf_page_label({page:Kt(e(N)),total:Kt(e(Q).numPages)}),()=>xr(e(B),{style:"percent"}),()=>d.file_pdf_canvas_ariaLabel({name:ne(),page:Kt(e(N))})]),s(l,y)};re(c,l=>{e(ye)?l(M):e(se)||Ie()?.status==="loading"?l(m,1):e(Q)&&l(w,2)})}P(o),s(Y,o);var ze=Lt(We);return ie(),ze}const Na=V.createSelector((Y,x)=>hr(Y.videoPreview.previews,x));var Wa=k('<p role="status"> </p>'),Ba=k('<p role="alert"> </p>'),Oa=k('<div class="flex flex-col items-center gap-3 p-6 text-center text-sm text-subtle"><p class="break-all"> </p> <!> <!></div>'),Ha=k('<video controls="" preload="metadata" playsinline="" class="max-w-full max-h-full" data-testid="file-video"> </video>',2),qa=k('<div class="min-h-0 flex-1 flex items-center justify-center bg-background"><!></div>');function Pr(Y,x){if(new.target)return Mt({component:Pr,...Y});Et(x,!0);const Ie=()=>be(qe,"$preview",at),[at,ie]=Zt();let $=ae(x,"sourceUrl",7),ne=ae(x,"fileName",7),Fe=ae(x,"allowDownload",7),Se=ae(x,"downloading",7),xe=ae(x,"onDownload",7),_e=O(null);const Q=crypto.randomUUID(),qe=Na(Q),N=i(()=>Ie()?.status==="loading"),B=i(()=>e(_e)??Ie()?.error);let se=!1,E=!1;Vr(()=>{E=!0,V.dispatch(Hr(Q))});function Le(){if(E||e(N))return;const m=$().startsWith("workspace-file://")?new URL($()):null;if(se||!m||!m.pathname.toLowerCase().endsWith(".mp4")){u(_e,"unsupported");return}se=!0,m.searchParams.set("preview","h264"),V.dispatch(qr(Q,m.hostname,m.toString()))}function Ne(m){if(E)return;const w=m.currentTarget.error?.code;w===2?u(_e,"network"):w!==1&&Le()}var ye={get sourceUrl(){return $()},set sourceUrl(m){$(m),oe()},get fileName(){return ne()},set fileName(m){ne(m),oe()},get allowDownload(){return Fe()},set allowDownload(m){Fe(m),oe()},get downloading(){return Se()},set downloading(m){Se(m),oe()},get onDownload(){return xe()},set onDownload(m){xe(m),oe()},$set:Ut,$on:(m,w)=>jt(x,m,w)},De=qa(),We=R(De);{var o=m=>{var w=Oa(),ze=R(w),l=S(ze,!0),y=p(ze,2);{var L=U=>{var de=Wa(),K=S(de,!0);F(ee=>g(K,ee),[()=>d.editor_fileViewer_videoPreparing_label()]),s(U,de)},X=U=>{var de=Ba(),K=S(de,!0);F(ee=>g(K,ee),[()=>e(B)==="network"?d.editor_fileViewer_videoLoad_error():d.editor_fileViewer_videoUnsupported_label()]),s(U,de)};re(y,U=>{e(N)?U(L):U(X,-1)})}var le=p(y,2);{var he=U=>{Ce(U,{variant:"secondary",size:"sm",get onclick(){return xe()},get disabled(){return Se()},children:(de,K)=>{Ge();var ee=et();F(ot=>g(ee,ot),[()=>d.layout_fileTab_downloadFile_label()]),s(de,ee)},$$slots:{default:!0}})};re(le,U=>{Fe()&&U(he)})}P(w),F(()=>g(l,ne())),s(m,w)},c=m=>{var w=Ha(),ze=S(w,!0);F(l=>{rt(w,"src",Ie()?.url??$()),g(ze,l)},[()=>d.editor_fileViewer_videoUnsupported_label()]),tt("error",w,Ne),tt("loadedmetadata",w,l=>{l.currentTarget.videoWidth===0&&Le()}),s(m,w)};re(We,m=>{e(B)||e(N)?m(o):m(c,-1)})}P(De),s(Y,De);var M=Lt(ye);return ie(),M}var Ja=k('<!> <span class="text-xs text-subtle min-w-[50px] text-center"> </span> <!> <div class="w-px h-5 bg-border mx-1"></div>',1),Xa=k('<div class="min-h-0 flex-1 flex flex-col"><div class="flex items-center gap-2 p-2 border-b border-border bg-muted/30"><!> <!> <div class="w-px h-5 bg-border mx-1"></div> <!> <!> <div class="ml-auto text-xs text-subtle"> </div></div> <div><img draggable="false" class="max-w-full max-h-full object-contain"/></div></div>'),Ka=k('<div class="min-h-0 flex-1 flex flex-col"><div class="flex items-center gap-2 p-2 border-b border-border bg-muted/30"><!> <!> <div class="ml-auto text-xs text-subtle"> </div></div> <div><img draggable="false" class="max-w-full max-h-full object-contain"/></div></div>'),Ya=k('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19V6l12-3v13M9 19c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zm12-3c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zM9 10l12-3"></path></svg></div> <div class="text-sm text-subtle mb-4"> </div> <audio controls="" class="w-full max-w-md"><source/> </audio></div>'),Ga=k("<!> ",1),Za=k('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"></path></svg></div> <p class="text-sm text-subtle mb-4"> </p> <!></div>'),Qa=k('<th class="border border-border px-2 py-1 text-left text-xs font-medium bg-muted"> </th>'),eo=k('<td class="border border-border px-2 py-1 text-xs"> </td>'),to=k("<tr></tr>"),ro=k('<div class="flex-1 overflow-auto p-4"><table class="w-full border-collapse"><thead><tr></tr></thead><tbody></tbody></table></div>'),ao=k('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"></path></svg></div> <p class="text-sm text-subtle mb-2"> </p> <p class="text-xs text-subtle"> </p></div>'),oo=k('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 3v2m6-2v2M9 19v2m6-2v2M5 9H3m2 6H3m18-6h-2m2 6h-2M7 19h10a2 2 0 002-2V7a2 2 0 00-2-2H7a2 2 0 00-2 2v10a2 2 0 002 2zM9 9h6v6H9V9z"></path></svg></div> <p class="text-sm text-subtle mb-2"> </p> <p class="text-xs text-subtle"> </p></div>'),io=k('<div class="h-full flex flex-col"><!></div>');function Rt(Y,x){if(new.target)return Mt({component:Rt,...Y});Et(x,!0);const Ie=t=>{var a=Ja(),f=ue(a);{let D=i(()=>d.editor_fileViewer_zoomOut_tooltip());Ce(f,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:de,get title(){return e(D)},children:(T,H)=>{Qe(T,{get icon(){return ya},size:"sm"})},$$slots:{default:!0}})}var _=p(f,2),h=S(_,!0),j=p(_,2);{let D=i(()=>d.editor_fileViewer_zoomIn_tooltip());Ce(j,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:U,get title(){return e(D)},children:(T,H)=>{Qe(T,{get icon(){return Pa},size:"sm"})},$$slots:{default:!0}})}Ge(2),F(()=>g(h,e(Le))),s(t,a)},at=Sa("FileViewer");let ie=ae(x,"filePath",7),$=ae(x,"fileContent",7,""),ne=ae(x,"sourceUrl",7),Fe=ae(x,"language",7),Se=ae(x,"isBinary",7),xe=ae(x,"allowDownload",7,!0),_e=ae(x,"onDownload",7),Q=ae(x,"downloading",7,!1);const qe=t=>{const a=t.split(".").pop()?.toLowerCase()||"";return["png","jpg","jpeg","gif","webp","bmp","ico","avif"].includes(a)?"image":a==="svg"?"svg":["mp4","webm","ogg","mov","avi"].includes(a)?"video":["mp3","wav","ogg","m4a","flac"].includes(a)?"audio":a==="pdf"?"pdf":["md","markdown"].includes(a)?"markdown":a==="json"?"json":a==="csv"?"csv":["yaml","yml"].includes(a)?"yaml":a==="xml"?"xml":["zip","tar","gz","rar","7z","bz2"].includes(a)?"archive":["exe","dll","so","dylib","wasm"].includes(a)?"binary":"text"},N=i(()=>qe(ie())),B=i(()=>ie().split("/").pop()||d.editor_fileViewer_unknown_fallback());let se=O(100),E=O(0);const Le=i(()=>xr(e(se)/100,{style:"percent",maximumFractionDigits:0}));let Ne=O(!1),ye=O(0),De=O(0),We=O(0),o=O(0),c=O(!1),M=null;function m(){const t=M;M=null,u(c,!1),t?.viewport.hasPointerCapture(t.pointerId)&&t.viewport.releasePointerCapture(t.pointerId)}function w(t){if(t.button!==0||!t.isPrimary||M)return;const a=t.currentTarget;a.setPointerCapture(t.pointerId),M={pointerId:t.pointerId,x:t.clientX,y:t.clientY,viewport:a},u(c,!0),t.preventDefault()}function ze(t){if(!(!M||t.pointerId!==M.pointerId)){if((t.buttons&1)===0){m();return}u(We,M.viewport.scrollLeft,!0),u(o,M.viewport.scrollTop,!0),u(ye,e(ye)+(t.clientX-M.x)),u(De,e(De)+(t.clientY-M.y)),M.x=t.clientX,M.y=t.clientY}}function l(t){t.pointerId===M?.pointerId&&m()}ke(()=>{ie(),ne(),e(se),e(E),u(We,0),u(o,0)}),ke(()=>(ie(),ne(),pr(()=>{m(),u(ye,0),u(De,0)}),m));const y=t=>{const a=t.split(".").pop()?.toLowerCase();return a==="jpg"||a==="jpeg"?"image/jpeg":a==="png"?"image/png":a==="gif"?"image/gif":a==="webp"?"image/webp":"application/octet-stream"},L=t=>{const a=t.split(".").pop()?.toLowerCase();if(a==="mp4")return"video/mp4";if(a==="webm")return"video/webm"},X=()=>{if(ne())return ne();if(typeof $()=="string")return $().startsWith("data:")||$().startsWith("http")?$():Se()?`data:${y(ie())};base64,${$()}`:`data:${y(ie())};base64,${$()}`;if($()instanceof ArrayBuffer){const a=new Uint8Array($()).reduce((_,h)=>_+String.fromCharCode(h),""),f=btoa(a);return`data:${y(ie())};base64,${f}`}return""},le=()=>{if(ne())return ne();const t=L(ie());if(!t)return"";if(typeof $()=="string")return $().startsWith("data:")||$().startsWith("http")?$():`data:${t};base64,${$()}`;const a=new Uint8Array($()),f=[],_=32768;for(let h=0;h<a.length;h+=_)f.push(String.fromCharCode(...a.subarray(h,h+_)));return`data:${t};base64,${btoa(f.join(""))}`},he=()=>{const t=typeof $()=="string"?new TextEncoder().encode($()):new Uint8Array($()),a=[],f=32768;for(let _=0;_<t.length;_+=f)a.push(String.fromCharCode(...t.subarray(_,_+f)));return`data:image/svg+xml;base64,${btoa(a.join(""))}`},U=()=>{u(se,Math.min(e(se)+25,500),!0)},de=()=>{u(se,Math.max(e(se)-25,25),!0)},K=()=>{u(E,(e(E)+90)%360)},ee=()=>{if(!xe()||Q())return;if(_e()){_e()();return}const t=document.createElement("a");t.href=e(N)==="video"?le():e(N)==="svg"?he():X(),t.download=e(B),t.click()},ot=async()=>{try{const t=X(),a=new Image;a.crossOrigin="anonymous";const f=await new Promise((_,h)=>{a.onload=()=>{const j=document.createElement("canvas");j.width=a.naturalWidth,j.height=a.naturalHeight;const D=j.getContext("2d");if(!D){h(new Error("Failed to get canvas context"));return}D.drawImage(a,0,0),j.toBlob(T=>{T?_(T):h(new Error("Failed to create blob from canvas"))},"image/png",1)},a.onerror=()=>h(new Error("Failed to load image")),a.src=t});await navigator.clipboard.write([new ClipboardItem({"image/png":f})]),u(Ne,!0),setTimeout(()=>u(Ne,!1),2e3)}catch(t){at.error("Failed to copy image:",t)}},it=t=>{try{const a=JSON.parse(t);return JSON.stringify(a,null,2)}catch{return t}},Je=t=>t.split(`
2
- `).map(f=>f.split(",").map(_=>_.trim()));var Ze={get filePath(){return ie()},set filePath(t){ie(t),oe()},get fileContent(){return $()},set fileContent(t=""){$(t),oe()},get sourceUrl(){return ne()},set sourceUrl(t){ne(t),oe()},get language(){return Fe()},set language(t){Fe(t),oe()},get isBinary(){return Se()},set isBinary(t){Se(t),oe()},get allowDownload(){return xe()},set allowDownload(t=!0){xe(t),oe()},get onDownload(){return _e()},set onDownload(t){_e(t),oe()},get downloading(){return Q()},set downloading(t=!1){Q(t),oe()},$set:Ut,$on:(t,a)=>jt(x,t,a)},ge=io();tt("blur",gr,m);var Pe=R(ge);{var Xe=t=>{var a=Xa(),f=R(a),_=R(f);Ie(_);var h=p(_,2);{let te=i(()=>d.editor_fileViewer_rotate_tooltip());Ce(h,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:K,get title(){return e(te)},children:(we,Te)=>{Qe(we,{get icon(){return wa},size:"sm"})},$$slots:{default:!0}})}var j=p(h,4);{let te=i(()=>d.editor_fileViewer_copyImage_tooltip());Ce(j,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:ot,get title(){return e(te)},children:(we,Te)=>{var Ee=je(),Be=ue(Ee);{var At=Ke=>{Qe(Ke,{get icon(){return ba},size:"sm",class:"text-green-500"})},pt=Ke=>{Qe(Ke,{get icon(){return xa},size:"sm"})};re(Be,Ke=>{e(Ne)?Ke(At):Ke(pt,-1)})}s(we,Ee)},$$slots:{default:!0}})}var D=p(j,2);{let te=i(()=>!xe()||Q()),we=i(()=>d.editor_fileViewer_download_tooltip());Ce(D,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:ee,get disabled(){return e(te)},get title(){return e(we)},children:(Te,Ee)=>{Qe(Te,{get icon(){return Tt},size:"sm"})},$$slots:{default:!0}})}var T=p(D,2),H=S(T,!0);P(f);var z=p(f,2),G=S(z);P(a),F(te=>{g(H,e(B)),or(z,1,`relative min-h-0 flex-1 overflow-auto bg-checkered flex items-center justify-center p-4 select-none ${e(c)?"cursor-grabbing":"cursor-grab"}`,"svelte-1uj35xu"),yt(z,`--pan-scroll-x: ${e(We)??""}px; --pan-scroll-y: ${e(o)??""}px;`),rt(G,"src",te),rt(G,"alt",e(B)),yt(G,`translate: ${e(ye)??""}px ${e(De)??""}px; transform: scale(${e(se)/100}) rotate(${e(E)??""}deg); transition: transform 0.2s;`)},[()=>X()]),vt("pointerdown",z,w),vt("pointermove",z,ze),vt("pointerup",z,l),tt("pointercancel",z,l),tt("lostpointercapture",z,l),s(t,a)},$e=t=>{var a=Ka(),f=R(a),_=R(f);Ie(_);var h=p(_,2);{let z=i(()=>!xe()||Q()),G=i(()=>d.editor_fileViewer_download_tooltip());Ce(h,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:ee,get disabled(){return e(z)},get title(){return e(G)},children:(te,we)=>{Qe(te,{get icon(){return Tt},size:"sm"})},$$slots:{default:!0}})}var j=p(h,2),D=S(j,!0);P(f);var T=p(f,2),H=S(T);P(a),F(z=>{g(D,e(B)),or(T,1,`relative min-h-0 flex-1 overflow-auto bg-checkered flex items-center justify-center p-4 select-none ${e(c)?"cursor-grabbing":"cursor-grab"}`,"svelte-1uj35xu"),yt(T,`--pan-scroll-x: ${e(We)??""}px; --pan-scroll-y: ${e(o)??""}px;`),rt(H,"src",z),rt(H,"alt",e(B)),yt(H,`translate: ${e(ye)??""}px ${e(De)??""}px; transform: scale(${e(se)/100});`)},[()=>he()]),vt("pointerdown",T,w),vt("pointermove",T,ze),vt("pointerup",T,l),tt("pointercancel",T,l),tt("lostpointercapture",T,l),s(t,a)},fe=t=>{const a=i(le);var f=je(),_=ue(f);mr(_,()=>ie()+e(a),h=>{Pr(h,{get sourceUrl(){return e(a)},get fileName(){return e(B)},get allowDownload(){return xe()},get downloading(){return Q()},onDownload:ee})}),s(t,f)},nt=t=>{var a=Ya(),f=p(R(a),2),_=S(f,!0),h=p(f,2),j=R(h),D=p(j);P(h),P(a),F((T,H)=>{g(_,e(B)),rt(j,"src",T),g(D,` ${H??""}`)},[()=>X(),()=>d.editor_fileViewer_audioUnsupported_label()]),s(t,a)},$t=t=>{var a=Za(),f=p(R(a),2),_=S(f,!0),h=p(f,2);{let j=i(()=>!xe()||Q());Ce(h,{size:"sm",variant:"secondary",onclick:ee,get disabled(){return e(j)},children:(D,T)=>{var H=Ga(),z=ue(H);Qe(z,{get icon(){return Tt},size:"sm",class:"mr-2"});var G=p(z);F(te=>g(G,` ${te??""}`),[()=>d.editor_fileViewer_downloadPdf_label()]),s(D,H)},$$slots:{default:!0}})}P(a),F(j=>g(_,j),[()=>d.editor_fileViewer_pdfUnavailable_label()]),s(t,a)},ct=t=>{{let a=i(()=>it($().toString()));Yt(t,{get value(){return e(a)},language:"json",get fileName(){return ie()},lineNumbers:!0,readOnly:!0})}},ut=t=>{const a=i(()=>Je($().toString()));var f=ro(),_=R(f),h=R(_),j=R(h);Pt(j,23,()=>e(a)[0]||[],(T,H)=>`header-${H}-${T}`,(T,H)=>{var z=Qa(),G=S(z,!0);F(()=>g(G,e(H))),s(T,z)}),P(j),P(h);var D=p(h);Pt(D,23,()=>e(a).slice(1),(T,H)=>`row-${H}`,(T,H,z)=>{var G=to();Pt(G,23,()=>e(H),(te,we)=>`cell-${e(z)}-${we}`,(te,we)=>{var Te=eo(),Ee=S(Te,!0);F(()=>g(Ee,e(we))),s(te,Te)}),P(G),s(T,G)}),P(D),P(_),P(f),s(t,f)},kt=t=>{var a=ao(),f=p(R(a),2),_=S(f,!0),h=p(f,2),j=S(h,!0);P(a),F(D=>{g(_,e(B)),g(j,D)},[()=>d.editor_fileViewer_archive_label()]),s(t,a)},zt=t=>{var a=oo(),f=p(R(a),2),_=S(f,!0),h=p(f,2),j=S(h,!0);P(a),F(D=>{g(_,e(B)),g(j,D)},[()=>d.editor_fileViewer_binary_label()]),s(t,a)},It=t=>{{let a=i(()=>$().toString());Yt(t,{get value(){return e(a)},get language(){return Fe()},get fileName(){return ie()},lineNumbers:!0,highlightActiveLine:!0})}};re(Pe,t=>{e(N)==="image"?t(Xe):e(N)==="svg"?t($e,1):e(N)==="video"?t(fe,2):e(N)==="audio"?t(nt,3):e(N)==="pdf"?t($t,4):e(N)==="json"?t(ct,5):e(N)==="csv"?t(ut,6):e(N)==="archive"?t(kt,7):e(N)==="binary"?t(zt,8):t(It,-1)})}return P(ge),s(Y,ge),Lt(Ze)}Nr(["pointerdown","pointermove","pointerup"]);const no=/access denied|permission denied|outside (?:the )?workspace/i,so=/file not found|no such file or directory/i;function lo(Y){return no.test(Y)?"access-denied":Y===d.files_read_notFound_error()||so.test(Y)?"not-found":"generic"}function co(Y){switch(Y){case"access-denied":return d.layout_fileTab_errorAccessDenied_label();case"not-found":return d.layout_fileTab_errorNotFound_label();case"generic":return d.layout_fileTab_errorGeneric_label()}}var uo=k("<!> <!>",1),fo=k("<!> <!> <!>",1),vo=k('<div class="flex flex-col items-center justify-center h-full text-subtle gap-2"><p> </p> <p class="text-xs"> </p></div>'),fr=k('<div class="flex h-full items-center justify-center p-4 text-subtle"><p role="alert"> </p></div>'),po=k('<div class="flex h-full items-center justify-center text-subtle"><p> </p></div>'),vr=k('<div class="flex items-center justify-center h-full text-subtle"><p> </p></div>'),go=k('<div class="flex items-center gap-3"><!> <!></div>'),mo=k('<div class="flex flex-col h-full"><div class="flex-1 p-4 space-y-2"></div></div>'),_o=k('<p class="text-xs"> </p>'),ho=k("<li><!></li>"),wo=k('<p class="text-xs mt-2"> </p> <ul class="flex flex-col items-center gap-1"></ul>',1),bo=k('<div class="flex flex-col items-center justify-center h-full text-subtle gap-2"><p class="text-danger" role="alert"> </p> <p class="text-xs font-mono"> </p> <!> <!></div>'),xo=k('<div class="flex flex-col items-center justify-center h-full text-subtle gap-3 p-4"><p> </p> <p class="text-xs break-all"> </p> <!></div>'),yo=k('<div class="h-full overflow-auto p-4"><!></div>');function Po(Y,x){if(new.target)return Mt({component:Po,...Y});Et(x,!0);const Ie=()=>be($e,"$workspace",E),at=()=>be(X,"$fileContentStore",E),ie=()=>be(le,"$fileLoadingStore",E),$=()=>be(he,"$fileSavingStore",E),ne=()=>be(U,"$fileErrorStore",E),Fe=()=>be(de,"$fileNotFoundCandidatesStore",E),Se=()=>be(K,"$isFileBinaryStore",E),xe=()=>be(ee,"$isFileDirtyStore",E),_e=()=>be(ot,"$fileLastUpdatedStore",E),Q=()=>be(it,"$ftChanges$",E),qe=()=>be(Xe,"$gutterRead$",E),N=()=>be(De,"$lineWrapping",E),B=()=>be(We,"$diffIndicators",E),se=()=>be(ge,"$rootMediaPreview",E),[E,Le]=Zt(),Ne=r=>{var n=uo(),I=ue(n);{var C=pe=>{var Ae=je(),Oe=ue(Ae);St(Oe,()=>Dt,(ft,_t)=>{_t(ft,{get icon(){return $a},get label(){return e(_)},disabled:!0})}),s(pe,Ae)};re(I,pe=>{!e(te)&&!e(l)&&!e(t)&&pe(C)})}var ve=p(I,2);{var Re=pe=>{{let Ae=i(()=>!e(Ft)||!e(z)),Oe=i(()=>!e(l)&&(!e(Ft)||!e(z)));ja(pe,{embedded:!0,showFold:!1,showSplit:!1,get showPreview(){return e(Ft)},get previewEnabled(){return e(z)},onTogglePreview:()=>u(z,!e(z)),get showWrap(){return e(Ae)},get wrapEnabled(){return N()},onToggleWrap:()=>V.dispatch(Zr()),get showDiff(){return e(Oe)},get diffEnabled(){return B()},onToggleDiff:()=>V.dispatch(Gr())})}};re(ve,pe=>{o().filePath&&!e(te)&&!e(t)&&pe(Re)})}s(r,n)},ye=r=>{var n=je(),I=ue(n);{var C=ve=>{var Re=fo(),pe=ue(Re);{var Ae=Ve=>{var Ye=je(),lt=ue(Ye);{let ht=i(()=>d.layout_fileTab_goToChanges_tooltip());St(lt,()=>Dt,(wt,bt)=>{bt(wt,{get icon(){return Ia},get label(){return e(ht)},onclick:Tr})})}s(Ve,Ye)};re(pe,Ve=>{e(kr)&&Ve(Ae)})}var Oe=p(pe,2);{var ft=Ve=>{var Ye=je(),lt=ue(Ye);{let ht=i(()=>d.layout_fileTab_downloadFile_label()),wt=i(()=>!e(gt)||e(st));St(lt,()=>Dt,(bt,Nt)=>{Nt(bt,{get icon(){return Tt},get label(){return e(ht)},onclick:Ct,get disabled(){return e(wt)}})})}s(Ve,Ye)};re(Oe,Ve=>{e(Be)&&Ve(ft)})}var _t=p(Oe,2);{let Ve=i(()=>d.layout_fileTab_deleteFile_tooltip());St(_t,()=>Dt,(Ye,lt)=>{lt(Ye,{get icon(){return ka},get label(){return e(Ve)},onclick:Rr,destructive:!0})})}s(ve,Re)};re(I,ve=>{o().filePath&&!e(te)&&!e(l)&&ve(C)})}s(r,n)},De=Ea(),We=La();let o=ae(x,"tab",7),c=ae(x,"workspaceId",7),M=ae(x,"isActive",7),m=ae(x,"isPanelFocused",7);ke(()=>{const r=c();if(!(!M()||!r||e(w)))return V.dispatch(Jr(r,"files")),()=>V.dispatch(Xr(r,"files"))});const w=i(()=>typeof o().data?.gitRootId=="string"?o().data.gitRootId:void 0),ze=i(()=>typeof o().data?.gitRootPath=="string"?o().data.gitRootPath:void 0),l=i(()=>!!e(w)),y=i(()=>o().filePath?_a(o().filePath,e(w)):o().filePath),L=Wr(e(y));ke(()=>{L.set(e(y))});const X=na(c(),L),le=sa(c(),L),he=la(c(),L),U=da(c(),L),de=ca(c(),L),K=ua(c(),L),ee=dr(c(),L),ot=fa(c(),L),it=va(c()),Je=ia(),Ze=crypto.randomUUID(),ge=yr(Ze),Pe=`file-gutter:${crypto.randomUUID()}`,Xe=pa(c(),Pe),$e=ga(c()),fe=i(()=>Ie()?.worktreePath||Ie()?.repositoryPath||Ie()?.path||null),nt=i(at),$t=i(ie),ct=i($),ut=i(ne),kt=i(()=>e(ut)?lo(e(ut)):"generic"),zt=5,It=i(()=>(Fe()??[]).slice(0,zt)),t=i(Se),a=i(xe),f=i(_e),_=i(()=>e(ct)?d.ui_saveIndicator_saving_tooltip():e(a)?d.ui_saveIndicator_autoSaving_tooltip():d.ui_saveIndicator_saved_tooltip());let h=O(null),j=O(Br([])),D=O(null),T=O(void 0),H=O(void 0),z=O(!0);ke(()=>{const r=o().data?.line,n=o().data?.jumpTimestamp;!r||n!==void 0&&n===e(H)||(u(H,n,!0),u(T,{line:r},!0),u(z,!1))});const G=i(()=>e(w)?cr(o().filePath,e(ze)):null),te=i(()=>e(w)?!e(G):!!(o().filePath&&(Ta(o().filePath)||e(fe)&&Ra(o().filePath,e(fe))))),we=i(()=>o().filePath&&e(fe)?Xt(o().filePath)?o().filePath:`${e(fe)}/${o().filePath}`:null),Te=i(()=>!!o().filePath&&/\.pdf$/i.test(o().filePath)),Ee=i(()=>!!o().filePath&&/\.(?:png|jpe?g|gif|webp|mp4|webm)$/i.test(o().filePath)),Be=i(()=>c()&&/^[A-Za-z0-9._-]+$/.test(c())?cr(o().filePath,e(fe)):null),At=i(()=>!e(w)&&e(Be)?e(Be).split("/").slice(0,-1).join("/"):void 0),pt=i(()=>e(Te)||e(Ee)?e(Be):null),Ke=i(()=>e(w)&&e(Ee)?{png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",mp4:"video/mp4",webm:"video/webm"}[o().filePath?.split(".").pop()?.toLowerCase()??""]:void 0);ke(()=>{if(!M()||!e(w)||!e(G)||!e(Ke))return;const r=crypto.randomUUID();return V.dispatch(wr(Ze,r,c(),e(G),{gitRootId:e(w),mimeType:e(Ke)})),()=>V.dispatch(br(Ze,r))});let st=O(!1);const gt=i(()=>!!e(Be)&&!e($t)&&(!e(Ee)||e(D)===e(Be))),Qt=i(()=>e(D)&&c()?`workspace-file://${c()}/${e(D).split("/").map(encodeURIComponent).join("/")}`:null),Vt=i(()=>o().filePath?ta(o().filePath):"plaintext"),Ft=i(()=>e(Vt)==="markdown");ke(()=>{if(!M()||e(Te)||e(w))return;const r=e(pt),n=o().filePath,I=c(),C=o().id;if(u(D,null),!r||!n||!I)return;let ve=!1;const Re=()=>!ve&&c()===I&&o().id===C&&o().filePath===n;return(async()=>{let pe=!1;try{pe=(await ha("file.stat",{workspaceId:I,path:r}))?.isFile===!0}catch{}if(!Re())return;if(pe){u(D,r,!0);return}if(!/\.(?:png|jpe?g|gif|webp|mp4|webm)$/i.test(r)){u(D,r,!0);return}const{candidates:Ae,truncated:Oe}=await Da(I,r);if(Re()){if(!Oe&&Ae.length===1){V.dispatch(ir(I,n,Ae[0],C));return}u(D,r,!0)}})(),()=>{ve=!0}});function $r(r,n){return!!(r.file===n||r.relativePath===n||r.relativePath&&n.endsWith("/"+r.relativePath)||r.file&&n.endsWith("/"+r.file)||r.relativePath&&r.relativePath.endsWith("/"+n)||r.file&&r.file.endsWith("/"+n))}const mt=i(()=>e(l)||!o().filePath?null:Q().find(r=>$r(r,o().filePath))??null),kr=i(()=>!!e(mt));ke(()=>{if(e(l))return;const r=c(),n=o().filePath,I=e(fe);return()=>{if(!r||!n)return;const C=qt.select(V.state,r,n);if(C?.kind!=="editable-text")return;const ve=Ht(C.localContent),Re=dr.select(V.state,r,n),pe=Xt(n)?n:I?`${I}/${n}`:null;Re&&pe&&V.dispatch(nr(r,n,pe,ve))}}),ke(()=>{const r=o().filePath,n=e(we),I=c();if(!M())return;const C=!e(w)&&!!r&&Xt(r)&&!e(fe);r&&I&&!e(te)&&!e(Ee)&&!e(Te)&&!C&&(e(w)&&e(G)&&e(y)?V.dispatch(sr(I,e(y),n??r,{gitRoot:{id:e(w),relativePath:e(G)}})):V.dispatch(sr(I,r,n??r)))});function Ir(){return e(nt)??""}function Fr(r){e(l)||e(t)||!o().filePath||!c()||!e(we)||V.dispatch(oa(c(),o().filePath,Ht(r)))}function Cr(){if(e(l)||e(t)||!o().filePath||!e(we)||e(nt)===null||e(ct))return;const r=qt.select(V.state,c(),o().filePath);r?.kind==="editable-text"&&V.dispatch(nr(c(),o().filePath,e(we),Ht(r.localContent)))}function Sr(r){const n=o().filePath;!n||!c()||(V.dispatch(aa(c(),n)),V.dispatch(ir(c(),n,r,o().id)))}ke(()=>{const r=o().filePath,n=e(mt);if(!r||!n){u(j,[],!0);return}if(!M())return;const I=c(),C=crypto.randomUUID();return V.dispatch(Kr(I,Pe,C,{kind:"diffs",path:r,staged:n.stage==="staged"})),()=>{V.dispatch(Yr(I,Pe,C))}}),ke(()=>{const r=qe(),n=r?.result?.kind==="diffs"?r.result.chunks:[],I=n.find(C=>C.file===o().filePath)??n[0];u(j,I?Ma(I.chunks.map(C=>({oldStart:C.oldStart,oldLines:C.oldLines,newStart:C.newStart,newLines:C.newLines,lines:C.lines.map(ve=>(ve.type===lr.Addition?"+":ve.type===lr.Deletion?"-":" ")+ve.content)}))):[],!0)});function Dr(r){const n=/Mac|iPhone|iPad|iPod/.test(navigator.userAgent),I=Re=>Or(r,za(Re),n);if(I("editor.save")){r.preventDefault(),e(a)&&!e(ct)&&Cr();return}const C=I("editor.undo")?"undo":I("editor.redo")?"redo":I("editor.toggle-task-list")?"toggle-task-list":I("editor.copy")?"copy":I("editor.select-all")?"select-all":null;if(!C||e(l)&&C!=="copy"&&C!=="select-all")return;C!=="toggle-task-list"&&e(h)?.runShortcut(C)&&r.preventDefault()}function Tr(r){if(!o().filePath||!e(mt))return;const n=r?.metaKey||r?.ctrlKey||!1,C=r?.target?.closest("[data-panel-id]")?.getAttribute("data-panel-id")??void 0;V.dispatch(ra(c(),e(mt),{filePath:o().filePath,changeId:e(mt).id,openInAdjacentPanel:n,sourcePanelId:C}))}async function Ct(){const r=e(Be);if(!(e(l)||!r||!c()||!e(gt)||e(st))){u(st,!0);try{const n=await ma(c(),r,e(fe));!n?.success&&!n?.canceled&&Jt.error(n?.error?.message||d.layout_fileTab_downloadFailed_error())}catch{Jt.error(d.layout_fileTab_downloadFailed_error())}finally{u(st,!1)}}}function Rr(){const r=e(we);if(e(l)||!o().filePath||!c()||!r)return;const n=Qr(qt.select(V.state,c(),o().filePath));if(!n){Jt.error(d.ui_reversibleActions_failed_error({message:d.fileExplorer_tree_undoUnavailable_error()}));return}V.dispatch(ea(c(),o().filePath,{absolutePath:r,tabId:o().id,snapshot:n}))}ke(()=>{if(!Je||!M())return;const r={isDirty:!e(l)&&e(a),isSaving:!e(l)&&e(ct)};pr(()=>{Je.registerActions({display:Ne,actions:ye}),Je.registerState(r)})});var Mr={get tab(){return o()},set tab(r){o(r),oe()},get workspaceId(){return c()},set workspaceId(r){c(r),oe()},get isActive(){return M()},set isActive(r){M(r),oe()},get isPanelFocused(){return m()},set isPanelFocused(r){m(r),oe()},$set:Ut,$on:(r,n)=>jt(x,r,n)},er=je();tt("keydown",gr,r=>M()&&Dr(r));var Ur=ue(er);{var jr=r=>{var n=je(),I=ue(n);mr(I,()=>o().filePath,C=>{var ve=je(),Re=ue(ve);{var pe=b=>{var v=vo(),A=R(v),q=S(A,!0),W=p(A,2),Me=S(W,!0);P(v),F(Z=>{g(q,Z),g(Me,o().filePath)},[()=>d.layout_fileTab_outsideWorkspace_label()]),s(b,v)},Ae=b=>{var v=je(),A=ue(v);{var q=W=>{Gt(W,{get workspaceId(){return c()},get filePath(){return e(G)},get gitRootId(){return e(w)}})};re(A,W=>{M()&&W(q)})}s(b,v)},Oe=b=>{var v=je(),A=ue(v);{var q=Z=>{var J=fr(),ce=R(J),Ue=S(ce,!0);P(J),F(me=>g(Ue,me),[()=>d.layout_fileTab_errorLoading_label()]),s(Z,J)},W=Z=>{Rt(Z,{get filePath(){return o().filePath},get sourceUrl(){return se().url},allowDownload:!1})},Me=Z=>{var J=po(),ce=R(J),Ue=S(ce,!0);P(J),F(me=>g(Ue,me),[()=>d.layout_fileTab_preparing_label()]),s(Z,J)};re(A,Z=>{se()?.error?Z(q):se()?.url?Z(W,1):Z(Me,-1)})}s(b,v)},ft=b=>{var v=je(),A=ue(v);{var q=W=>{Gt(W,{get workspaceId(){return c()},get filePath(){return e(pt)}})};re(A,W=>{M()&&W(q)})}s(b,v)},_t=b=>{var v=fr(),A=R(v),q=S(A,!0);P(v),F(W=>g(q,W),[()=>d.file_pdf_load_error()]),s(b,v)},Ve=b=>{{let v=i(()=>e(D)??o().filePath),A=i(()=>!e(l)&&e(gt));Rt(b,{get filePath(){return e(v)},get sourceUrl(){return e(Qt)},onDownload:Ct,get allowDownload(){return e(A)},get downloading(){return e(st)}})}},Ye=b=>{var v=vr(),A=R(v),q=S(A,!0);P(v),F(W=>g(q,W),[()=>d.layout_fileTab_preparing_label()]),s(b,v)},lt=b=>{var v=mo(),A=R(v);Pt(A,20,()=>[...Array(20).keys()],q=>q,(q,W)=>{var Me=go(),Z=R(Me);ur(Z,{class:"h-3 w-8 shrink-0"});var J=p(Z,2);ur(J,{class:"h-3",style:`width: ${30+Math.random()*60}%`}),P(Me),s(q,Me)}),P(A),P(v),s(b,v)},ht=b=>{var v=bo(),A=R(v),q=S(A,!0),W=p(A,2),Me=S(W,!0),Z=p(W,2);{var J=me=>{var He=_o(),dt=S(He,!0);F(()=>g(dt,e(ut))),s(me,He)};re(Z,me=>{e(kt)==="generic"&&me(J)})}var ce=p(Z,2);{var Ue=me=>{var He=wo(),dt=ue(He),Wt=S(dt,!0),tr=p(dt,2);Pt(tr,20,()=>e(It),xt=>xt,(xt,rr)=>{var Bt=ho(),Lr=R(Bt);Ce(Lr,{variant:"link",size:"compact",class:"h-auto p-0 font-mono text-xs",onclick:()=>Sr(rr),children:(zr,$o)=>{Ge();var ar=et();F(()=>g(ar,rr)),s(zr,ar)},$$slots:{default:!0}}),P(Bt),s(xt,Bt)}),P(tr),F(xt=>g(Wt,xt),[()=>d.layout_fileTab_didYouMean_label()]),s(me,He)};re(ce,me=>{e(It).length>0&&me(Ue)})}P(v),F(me=>{g(q,me),g(Me,o().filePath)},[()=>co(e(kt))]),s(b,v)},wt=b=>{var v=xo(),A=R(v),q=S(A,!0),W=p(A,2),Me=S(W,!0),Z=p(W,2);{var J=ce=>{{let Ue=i(()=>!e(gt)||e(st));Ce(ce,{variant:"secondary",size:"sm",onclick:Ct,get disabled(){return e(Ue)},children:(me,He)=>{Ge();var dt=et();F(Wt=>g(dt,Wt),[()=>d.layout_fileTab_downloadFile_label()]),s(me,dt)},$$slots:{default:!0}})}};re(Z,ce=>{!e(l)&&e(Be)&&ce(J)})}P(v),F(ce=>{g(q,ce),g(Me,o().filePath)},[()=>d.editor_fileViewer_binary_label()]),s(b,v)},bt=b=>{const v=i(()=>o().filePath?.toLowerCase().endsWith(".svg"));var A=je(),q=ue(A);{var W=J=>{{let ce=i(()=>o().filePath||""),Ue=i(()=>!e(l)&&e(gt));Rt(J,{get filePath(){return e(ce)},get fileContent(){return e(nt)},get language(){return e(Vt)},get isBinary(){return e(t)},onDownload:Ct,get allowDownload(){return e(Ue)},get downloading(){return e(st)}})}},Me=J=>{var ce=yo(),Ue=R(ce);Ua(Ue,{get content(){return e(nt)},get workspaceId(){return c()},get relativeMediaBase(){return e(At)},renderRichFencesAsCode:!0,renderDiagrams:!0}),P(ce),s(J,ce)},Z=J=>{var ce=Ir,Ue=Fr;{let me=i(()=>B()?e(j):[]);_r(Yt(J,{get value(){return ce()},set value(He){Ue(He)},get language(){return e(Vt)},get readOnly(){return e(l)},get fileName(){return o().filePath},get workspaceId(){return c()},get filePath(){return o().filePath},get lineWrapping(){return N()},get lineChanges(){return e(me)},get jumpTo(){return e(T)},get externalContentVersion(){return e(f)},get isPanelFocused(){return m()}}),He=>u(h,He,!0),()=>e(h))}};re(q,J=>{e(v)?J(W):e(Ft)&&e(z)?J(Me,1):J(Z,-1)})}s(b,A)},Nt=b=>{var v=vr(),A=R(v),q=S(A,!0);P(v),F(W=>g(q,W),[()=>d.layout_fileTab_preparing_label()]),s(b,v)};re(Re,b=>{e(te)?b(pe):e(w)&&e(Te)&&e(G)?b(Ae,1):e(w)&&e(Ee)?b(Oe,2):e(Te)&&e(pt)?b(ft,3):e(Te)?b(_t,4):e(Qt)?b(Ve,5):e(Ee)?b(Ye,6):e($t)?b(lt,7):e(ut)?b(ht,8):e(t)?b(wt,9):e(nt)!==null?b(bt,10):b(Nt,-1)})}s(C,ve)}),s(r,n)};re(Ur,r=>{o().filePath&&r(jr)})}s(Y,er);var Er=Lt(Mr);return Le(),Er}export{Po as default};
1
+ import{t as Mt,bq as ae,_ as Ar,a_ as re,by as Ut,bu as be,bs as Zt,b as jt,bo as d}from"./7rNOGHzs.js";import{bs as Et,ca as ke,aD as e,bH as u,a5 as R,bA as P,W as s,bn as Lt,bV as O,c9 as i,aA as oe,c6 as Ot,ay as ue,be as Ge,b$ as et,b_ as F,bO as g,bS as p,bl as S,aB as k,bj as Vr,aw as tt,ai as Wr,c5 as pr,a as gr,a7 as je,aj as vt,cd as Nr,br as Br}from"./B8o4lNgr.js";import{E as mr,F as Or}from"./DCaHy20k.js";import{s as rt,l as yt,k as or,h as Pt}from"./DmsDslNo.js";import{c as St}from"./CiENRH6A.js";import{b as _r}from"./D2g8BuR1.js";import{Hq as V,n5 as hr,uI as wr,uH as br,JF as Hr,JG as qr,eu as Jr,ev as Xr,J4 as ir,lg as Ht,AM as nr,rp as sr,nt as Kr,yo as Yr,a9 as lr,HW as Gr,Ib as Zr,mH as Qr,iA as ea,n7 as ta,u7 as ra,yL as aa,J3 as oa}from"./CRwmdgt6.js";import{g as ia}from"./CoSk1zgY.js";import{a as na,g as sa,i as la,c as da,h as ca,d as ua,e as dr,f as fa,b as qt}from"./BAEcHnha.js";import{by as va,bL as pa,dl as ga}from"./KQTrHxko.js";import{w as cr,d as ma}from"./7TuwH0wv.js";import{f as _a}from"./CPQdU3ZA.js";import{n as Jt}from"./lfJ8pseq.js";import{f as Ce,ax as ha}from"./Bgegixo2.js";import"./CQ4a5a4v.js";import{F as Qe,ab as wa,at as ba,aX as xa,b1 as Tt,co as ya,cp as Pa,bk as $a,cN as ka,c5 as Ia}from"./CFejQM6t.js";import{g as Fa,i as Ca,w as ur}from"./DSjRkndX.js";import{c as Sa}from"./ChTqQfQN.js";import"./D-cnPaTJ.js";import{V as Da}from"./C-27EQSK.js";import{i as Xt,b as Ta,a as Ra}from"./H2jLkRRS.js";import{C as Yt,p as Ma}from"./KbdMwrlk.js";import{M as Ua}from"./BSN7-Qxa.js";import{t as Kt,u as xr}from"./DzMmhJrp.js";import"./DFHyIdsA.js";import"./Ck-Ax5yG.js";import{M as Dt}from"./yI5lBaQ8.js";import{V as ja}from"./CZERqHN7.js";import{bO as Ea,b5 as La}from"./BcGA_XKM.js";import{ak as za}from"./CkactGV1.js";const yr=V.createSelector((Y,x)=>hr(Y.pdfPreview.previews,x));var Aa=k('<div class="flex shrink-0 flex-wrap items-center justify-center gap-2 border-b border-border p-2"><!> <span aria-live="polite"> </span> <!> <!> <span> </span> <!></div> <div class="min-h-0 flex-1 overflow-auto p-4"><canvas class="mx-auto block" role="img"></canvas></div>',1),Va=k('<div class="flex h-full min-h-0 flex-col" data-testid="pdf-viewer"><!></div>');function Gt(Y,x){if(new.target)return Mt({component:Gt,...Y});Et(x,!0);const Ie=()=>be(xe,"$preview",at),[at,ie]=Zt();let $=ae(x,"workspaceId",7),ne=ae(x,"filePath",7),Fe=ae(x,"gitRootId",7);const Se=crypto.randomUUID(),xe=yr(Se),_e=new WeakMap;let Q=O(null),qe=O(void 0),W=O(1),B=O(1),se=O(!0),E=O(!1),Le=O(null),We=O(0);const ye=i(()=>Ie()?.error??e(Le)),De=i(()=>e(ye)==="missing"?d.file_pdf_missing_error():e(ye)==="large"?d.file_pdf_large_error():e(ye)==="invalid"?d.file_pdf_invalid_error():e(ye)==="password"?d.file_pdf_password_error():d.file_pdf_load_error());ke(()=>{const l=$(),y=ne();e(We);const L=crypto.randomUUID();return V.dispatch(wr(Se,L,l,y,...Fe()?[{gitRootId:Fe()}]:[])),()=>{V.dispatch(br(Se,L))}}),ke(()=>{const l=Ie()?.url;let y=!1,L;if(u(Q,null),u(Le,null),u(se,!0),u(W,1),u(B,1),!!l)return(async()=>{try{const{loadPdfDocument:X}=await Ar(async()=>{const{loadPdfDocument:he}=await import("./BqoyBPEG.js");return{loadPdfDocument:he}},[],import.meta.url);if(y)return;L=X(l);const le=await L.promise;y||u(Q,le)}catch(X){if(y)return;u(Le,X instanceof Error&&X.name==="PasswordException"?"password":X instanceof Error&&X.name==="InvalidPDFException"?"invalid":"load",!0)}finally{y||u(se,!1)}})(),()=>{y=!0,L?.destroy()}}),ke(()=>{const l=e(Q),y=e(qe),L=e(W),X=e(B);if(!l||!y)return;let le=!1,he,U;const de=()=>{if(!U)return;const K=(_e.get(U)??1)-1;K?_e.set(U,K):(_e.delete(U),U.cleanup()),U=void 0};return u(E,!0),(async()=>{try{if(U=await l.getPage(L),_e.set(U,(_e.get(U)??0)+1),le){de();return}const K=U.getViewport({scale:X}),ee=Math.min(window.devicePixelRatio||1,2,Math.sqrt(16e6/(K.width*K.height)));y.width=Math.ceil(K.width*ee),y.height=Math.ceil(K.height*ee),y.style.width=`${K.width}px`,y.style.height=`${K.height}px`,he=U.render({canvas:y,viewport:K,transform:[ee,0,0,ee,0,0]}),await he.promise}catch{le||u(Le,"invalid")}finally{le||u(E,!1)}})(),()=>{le=!0,he?.cancel(),he?he.promise.then(de,de):de()}});var Ne={get workspaceId(){return $()},set workspaceId(l){$(l),oe()},get filePath(){return ne()},set filePath(l){ne(l),oe()},get gitRootId(){return Fe()},set gitRootId(l){Fe(l),oe()},$set:Ut,$on:(l,y)=>jt(x,l,y)},o=Va(),c=R(o);{var M=l=>{{const y=X=>{Ge();var le=et();F(()=>g(le,e(De))),s(X,le)};let L=i(()=>d.ui_combobox_retry_label());Fa(l,{onRetry:()=>Ot(We),get retryLabel(){return e(L)},class:"m-auto",message:y,$$slots:{message:!0}})}},m=l=>{{let y=i(()=>d.file_pdf_loading_label());Ca(l,{get label(){return e(y)},count:1,class:"p-4"})}},w=l=>{var y=Aa(),L=ue(y),X=R(L);{let ge=i(()=>e(W)<=1);Ce(X,{variant:"ghost",size:"compact",get disabled(){return e(ge)},onclick:()=>Ot(W,-1),children:(Pe,Xe)=>{Ge();var $e=et();F(fe=>g($e,fe),[()=>d.file_pdf_previous_label()]),s(Pe,$e)},$$slots:{default:!0}})}var le=p(X,2),he=S(le,!0),U=p(le,2);{let ge=i(()=>e(W)>=e(Q).numPages);Ce(U,{variant:"ghost",size:"compact",get disabled(){return e(ge)},onclick:()=>Ot(W),children:(Pe,Xe)=>{Ge();var $e=et();F(fe=>g($e,fe),[()=>d.file_pdf_next_label()]),s(Pe,$e)},$$slots:{default:!0}})}var de=p(U,2);{let ge=i(()=>e(B)<=.25);Ce(de,{variant:"ghost",size:"compact",get disabled(){return e(ge)},onclick:()=>u(B,Math.max(.25,e(B)-.25),!0),children:(Pe,Xe)=>{Ge();var $e=et();F(fe=>g($e,fe),[()=>d.editor_fileViewer_zoomOut_tooltip()]),s(Pe,$e)},$$slots:{default:!0}})}var K=p(de,2),ee=S(K,!0),ot=p(K,2);{let ge=i(()=>e(B)>=3);Ce(ot,{variant:"ghost",size:"compact",get disabled(){return e(ge)},onclick:()=>u(B,Math.min(3,e(B)+.25),!0),children:(Pe,Xe)=>{Ge();var $e=et();F(fe=>g($e,fe),[()=>d.editor_fileViewer_zoomIn_tooltip()]),s(Pe,$e)},$$slots:{default:!0}})}P(L);var it=p(L,2),Je=R(it);let Ze;_r(Je,ge=>u(qe,ge),()=>e(qe)),P(it),F((ge,Pe,Xe)=>{g(he,ge),g(ee,Pe),rt(it,"aria-busy",e(E)),rt(Je,"aria-label",Xe),Ze=yt(Je,"",Ze,{visibility:e(E)?"hidden":"visible"})},[()=>d.file_pdf_page_label({page:Kt(e(W)),total:Kt(e(Q).numPages)}),()=>xr(e(B),{style:"percent"}),()=>d.file_pdf_canvas_ariaLabel({name:ne(),page:Kt(e(W))})]),s(l,y)};re(c,l=>{e(ye)?l(M):e(se)||Ie()?.status==="loading"?l(m,1):e(Q)&&l(w,2)})}P(o),s(Y,o);var ze=Lt(Ne);return ie(),ze}const Wa=V.createSelector((Y,x)=>hr(Y.videoPreview.previews,x));var Na=k('<p role="status"> </p>'),Ba=k('<p role="alert"> </p>'),Oa=k('<div class="flex flex-col items-center gap-3 p-6 text-center text-sm text-subtle"><p class="break-all"> </p> <!> <!></div>'),Ha=k('<video controls="" preload="metadata" playsinline="" class="max-w-full max-h-full" data-testid="file-video"> </video>',2),qa=k('<div class="min-h-0 flex-1 flex items-center justify-center bg-background"><!></div>');function Pr(Y,x){if(new.target)return Mt({component:Pr,...Y});Et(x,!0);const Ie=()=>be(qe,"$preview",at),[at,ie]=Zt();let $=ae(x,"sourceUrl",7),ne=ae(x,"fileName",7),Fe=ae(x,"allowDownload",7),Se=ae(x,"downloading",7),xe=ae(x,"onDownload",7),_e=O(null);const Q=crypto.randomUUID(),qe=Wa(Q),W=i(()=>Ie()?.status==="loading"),B=i(()=>e(_e)??Ie()?.error);let se=!1,E=!1;Vr(()=>{E=!0,V.dispatch(Hr(Q))});function Le(){if(E||e(W))return;const m=$().startsWith("workspace-file://")?new URL($()):null;if(se||!m||!m.pathname.toLowerCase().endsWith(".mp4")){u(_e,"unsupported");return}se=!0,m.searchParams.set("preview","h264"),V.dispatch(qr(Q,m.hostname,m.toString()))}function We(m){if(E)return;const w=m.currentTarget.error?.code;w===2?u(_e,"network"):w!==1&&Le()}var ye={get sourceUrl(){return $()},set sourceUrl(m){$(m),oe()},get fileName(){return ne()},set fileName(m){ne(m),oe()},get allowDownload(){return Fe()},set allowDownload(m){Fe(m),oe()},get downloading(){return Se()},set downloading(m){Se(m),oe()},get onDownload(){return xe()},set onDownload(m){xe(m),oe()},$set:Ut,$on:(m,w)=>jt(x,m,w)},De=qa(),Ne=R(De);{var o=m=>{var w=Oa(),ze=R(w),l=S(ze,!0),y=p(ze,2);{var L=U=>{var de=Na(),K=S(de,!0);F(ee=>g(K,ee),[()=>d.editor_fileViewer_videoPreparing_label()]),s(U,de)},X=U=>{var de=Ba(),K=S(de,!0);F(ee=>g(K,ee),[()=>e(B)==="network"?d.editor_fileViewer_videoLoad_error():d.editor_fileViewer_videoUnsupported_label()]),s(U,de)};re(y,U=>{e(W)?U(L):U(X,-1)})}var le=p(y,2);{var he=U=>{Ce(U,{variant:"secondary",size:"sm",get onclick(){return xe()},get disabled(){return Se()},children:(de,K)=>{Ge();var ee=et();F(ot=>g(ee,ot),[()=>d.layout_fileTab_downloadFile_label()]),s(de,ee)},$$slots:{default:!0}})};re(le,U=>{Fe()&&U(he)})}P(w),F(()=>g(l,ne())),s(m,w)},c=m=>{var w=Ha(),ze=S(w,!0);F(l=>{rt(w,"src",Ie()?.url??$()),g(ze,l)},[()=>d.editor_fileViewer_videoUnsupported_label()]),tt("error",w,We),tt("loadedmetadata",w,l=>{l.currentTarget.videoWidth===0&&Le()}),s(m,w)};re(Ne,m=>{e(B)||e(W)?m(o):m(c,-1)})}P(De),s(Y,De);var M=Lt(ye);return ie(),M}var Ja=k('<!> <span class="text-xs text-subtle min-w-[50px] text-center"> </span> <!> <div class="w-px h-5 bg-border mx-1"></div>',1),Xa=k('<div class="min-h-0 flex-1 flex flex-col"><div class="flex items-center gap-2 p-2 border-b border-border bg-muted/30"><!> <!> <div class="w-px h-5 bg-border mx-1"></div> <!> <!> <div class="ml-auto text-xs text-subtle"> </div></div> <div><img draggable="false" class="max-w-full max-h-full object-contain"/></div></div>'),Ka=k('<div class="min-h-0 flex-1 flex flex-col"><div class="flex items-center gap-2 p-2 border-b border-border bg-muted/30"><!> <!> <div class="ml-auto text-xs text-subtle"> </div></div> <div><img draggable="false" class="max-w-full max-h-full object-contain"/></div></div>'),Ya=k('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19V6l12-3v13M9 19c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zm12-3c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zM9 10l12-3"></path></svg></div> <div class="text-sm text-subtle mb-4"> </div> <audio controls="" class="w-full max-w-md"><source/> </audio></div>'),Ga=k("<!> ",1),Za=k('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"></path></svg></div> <p class="text-sm text-subtle mb-4"> </p> <!></div>'),Qa=k('<th class="border border-border px-2 py-1 text-left text-xs font-medium bg-muted"> </th>'),eo=k('<td class="border border-border px-2 py-1 text-xs"> </td>'),to=k("<tr></tr>"),ro=k('<div class="flex-1 overflow-auto p-4"><table class="w-full border-collapse"><thead><tr></tr></thead><tbody></tbody></table></div>'),ao=k('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"></path></svg></div> <p class="text-sm text-subtle mb-2"> </p> <p class="text-xs text-subtle"> </p></div>'),oo=k('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 3v2m6-2v2M9 19v2m6-2v2M5 9H3m2 6H3m18-6h-2m2 6h-2M7 19h10a2 2 0 002-2V7a2 2 0 00-2-2H7a2 2 0 00-2 2v10a2 2 0 002 2zM9 9h6v6H9V9z"></path></svg></div> <p class="text-sm text-subtle mb-2"> </p> <p class="text-xs text-subtle"> </p></div>'),io=k('<div class="h-full flex flex-col"><!></div>');function Rt(Y,x){if(new.target)return Mt({component:Rt,...Y});Et(x,!0);const Ie=t=>{var a=Ja(),f=ue(a);{let D=i(()=>d.editor_fileViewer_zoomOut_tooltip());Ce(f,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:de,get title(){return e(D)},children:(T,H)=>{Qe(T,{get icon(){return ya},size:"sm"})},$$slots:{default:!0}})}var _=p(f,2),h=S(_,!0),j=p(_,2);{let D=i(()=>d.editor_fileViewer_zoomIn_tooltip());Ce(j,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:U,get title(){return e(D)},children:(T,H)=>{Qe(T,{get icon(){return Pa},size:"sm"})},$$slots:{default:!0}})}Ge(2),F(()=>g(h,e(Le))),s(t,a)},at=Sa("FileViewer");let ie=ae(x,"filePath",7),$=ae(x,"fileContent",7,""),ne=ae(x,"sourceUrl",7),Fe=ae(x,"language",7),Se=ae(x,"isBinary",7),xe=ae(x,"allowDownload",7,!0),_e=ae(x,"onDownload",7),Q=ae(x,"downloading",7,!1);const qe=t=>{const a=t.split(".").pop()?.toLowerCase()||"";return["png","jpg","jpeg","gif","webp","bmp","ico","avif"].includes(a)?"image":a==="svg"?"svg":["mp4","webm","ogg","mov","avi"].includes(a)?"video":["mp3","wav","ogg","m4a","flac"].includes(a)?"audio":a==="pdf"?"pdf":["md","markdown"].includes(a)?"markdown":a==="json"?"json":a==="csv"?"csv":["yaml","yml"].includes(a)?"yaml":a==="xml"?"xml":["zip","tar","gz","rar","7z","bz2"].includes(a)?"archive":["exe","dll","so","dylib","wasm"].includes(a)?"binary":"text"},W=i(()=>qe(ie())),B=i(()=>ie().split("/").pop()||d.editor_fileViewer_unknown_fallback());let se=O(100),E=O(0);const Le=i(()=>xr(e(se)/100,{style:"percent",maximumFractionDigits:0}));let We=O(!1),ye=O(0),De=O(0),Ne=O(0),o=O(0),c=O(!1),M=null;function m(){const t=M;M=null,u(c,!1),t?.viewport.hasPointerCapture(t.pointerId)&&t.viewport.releasePointerCapture(t.pointerId)}function w(t){if(t.button!==0||!t.isPrimary||M)return;const a=t.currentTarget;a.setPointerCapture(t.pointerId),M={pointerId:t.pointerId,x:t.clientX,y:t.clientY,viewport:a},u(c,!0),t.preventDefault()}function ze(t){if(!(!M||t.pointerId!==M.pointerId)){if((t.buttons&1)===0){m();return}u(Ne,M.viewport.scrollLeft,!0),u(o,M.viewport.scrollTop,!0),u(ye,e(ye)+(t.clientX-M.x)),u(De,e(De)+(t.clientY-M.y)),M.x=t.clientX,M.y=t.clientY}}function l(t){t.pointerId===M?.pointerId&&m()}ke(()=>{ie(),ne(),e(se),e(E),u(Ne,0),u(o,0)}),ke(()=>(ie(),ne(),pr(()=>{m(),u(ye,0),u(De,0)}),m));const y=t=>{const a=t.split(".").pop()?.toLowerCase();return a==="jpg"||a==="jpeg"?"image/jpeg":a==="png"?"image/png":a==="gif"?"image/gif":a==="webp"?"image/webp":"application/octet-stream"},L=t=>{const a=t.split(".").pop()?.toLowerCase();if(a==="mp4")return"video/mp4";if(a==="webm")return"video/webm"},X=()=>{if(ne())return ne();if(typeof $()=="string")return $().startsWith("data:")||$().startsWith("http")?$():Se()?`data:${y(ie())};base64,${$()}`:`data:${y(ie())};base64,${$()}`;if($()instanceof ArrayBuffer){const a=new Uint8Array($()).reduce((_,h)=>_+String.fromCharCode(h),""),f=btoa(a);return`data:${y(ie())};base64,${f}`}return""},le=()=>{if(ne())return ne();const t=L(ie());if(!t)return"";if(typeof $()=="string")return $().startsWith("data:")||$().startsWith("http")?$():`data:${t};base64,${$()}`;const a=new Uint8Array($()),f=[],_=32768;for(let h=0;h<a.length;h+=_)f.push(String.fromCharCode(...a.subarray(h,h+_)));return`data:${t};base64,${btoa(f.join(""))}`},he=()=>{const t=typeof $()=="string"?new TextEncoder().encode($()):new Uint8Array($()),a=[],f=32768;for(let _=0;_<t.length;_+=f)a.push(String.fromCharCode(...t.subarray(_,_+f)));return`data:image/svg+xml;base64,${btoa(a.join(""))}`},U=()=>{u(se,Math.min(e(se)+25,500),!0)},de=()=>{u(se,Math.max(e(se)-25,25),!0)},K=()=>{u(E,(e(E)+90)%360)},ee=()=>{if(!xe()||Q())return;if(_e()){_e()();return}const t=document.createElement("a");t.href=e(W)==="video"?le():e(W)==="svg"?he():X(),t.download=e(B),t.click()},ot=async()=>{try{const t=X(),a=new Image;a.crossOrigin="anonymous";const f=await new Promise((_,h)=>{a.onload=()=>{const j=document.createElement("canvas");j.width=a.naturalWidth,j.height=a.naturalHeight;const D=j.getContext("2d");if(!D){h(new Error("Failed to get canvas context"));return}D.drawImage(a,0,0),j.toBlob(T=>{T?_(T):h(new Error("Failed to create blob from canvas"))},"image/png",1)},a.onerror=()=>h(new Error("Failed to load image")),a.src=t});await navigator.clipboard.write([new ClipboardItem({"image/png":f})]),u(We,!0),setTimeout(()=>u(We,!1),2e3)}catch(t){at.error("Failed to copy image:",t)}},it=t=>{try{const a=JSON.parse(t);return JSON.stringify(a,null,2)}catch{return t}},Je=t=>t.split(`
2
+ `).map(f=>f.split(",").map(_=>_.trim()));var Ze={get filePath(){return ie()},set filePath(t){ie(t),oe()},get fileContent(){return $()},set fileContent(t=""){$(t),oe()},get sourceUrl(){return ne()},set sourceUrl(t){ne(t),oe()},get language(){return Fe()},set language(t){Fe(t),oe()},get isBinary(){return Se()},set isBinary(t){Se(t),oe()},get allowDownload(){return xe()},set allowDownload(t=!0){xe(t),oe()},get onDownload(){return _e()},set onDownload(t){_e(t),oe()},get downloading(){return Q()},set downloading(t=!1){Q(t),oe()},$set:Ut,$on:(t,a)=>jt(x,t,a)},ge=io();tt("blur",gr,m);var Pe=R(ge);{var Xe=t=>{var a=Xa(),f=R(a),_=R(f);Ie(_);var h=p(_,2);{let te=i(()=>d.editor_fileViewer_rotate_tooltip());Ce(h,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:K,get title(){return e(te)},children:(we,Te)=>{Qe(we,{get icon(){return wa},size:"sm"})},$$slots:{default:!0}})}var j=p(h,4);{let te=i(()=>d.editor_fileViewer_copyImage_tooltip());Ce(j,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:ot,get title(){return e(te)},children:(we,Te)=>{var Ee=je(),Be=ue(Ee);{var At=Ke=>{Qe(Ke,{get icon(){return ba},size:"sm",class:"text-green-500"})},pt=Ke=>{Qe(Ke,{get icon(){return xa},size:"sm"})};re(Be,Ke=>{e(We)?Ke(At):Ke(pt,-1)})}s(we,Ee)},$$slots:{default:!0}})}var D=p(j,2);{let te=i(()=>!xe()||Q()),we=i(()=>d.editor_fileViewer_download_tooltip());Ce(D,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:ee,get disabled(){return e(te)},get title(){return e(we)},children:(Te,Ee)=>{Qe(Te,{get icon(){return Tt},size:"sm"})},$$slots:{default:!0}})}var T=p(D,2),H=S(T,!0);P(f);var z=p(f,2),G=S(z);P(a),F(te=>{g(H,e(B)),or(z,1,`relative min-h-0 flex-1 overflow-auto bg-checkered flex items-center justify-center p-4 select-none ${e(c)?"cursor-grabbing":"cursor-grab"}`,"svelte-1uj35xu"),yt(z,`--pan-scroll-x: ${e(Ne)??""}px; --pan-scroll-y: ${e(o)??""}px;`),rt(G,"src",te),rt(G,"alt",e(B)),yt(G,`translate: ${e(ye)??""}px ${e(De)??""}px; transform: scale(${e(se)/100}) rotate(${e(E)??""}deg); transition: transform 0.2s;`)},[()=>X()]),vt("pointerdown",z,w),vt("pointermove",z,ze),vt("pointerup",z,l),tt("pointercancel",z,l),tt("lostpointercapture",z,l),s(t,a)},$e=t=>{var a=Ka(),f=R(a),_=R(f);Ie(_);var h=p(_,2);{let z=i(()=>!xe()||Q()),G=i(()=>d.editor_fileViewer_download_tooltip());Ce(h,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:ee,get disabled(){return e(z)},get title(){return e(G)},children:(te,we)=>{Qe(te,{get icon(){return Tt},size:"sm"})},$$slots:{default:!0}})}var j=p(h,2),D=S(j,!0);P(f);var T=p(f,2),H=S(T);P(a),F(z=>{g(D,e(B)),or(T,1,`relative min-h-0 flex-1 overflow-auto bg-checkered flex items-center justify-center p-4 select-none ${e(c)?"cursor-grabbing":"cursor-grab"}`,"svelte-1uj35xu"),yt(T,`--pan-scroll-x: ${e(Ne)??""}px; --pan-scroll-y: ${e(o)??""}px;`),rt(H,"src",z),rt(H,"alt",e(B)),yt(H,`translate: ${e(ye)??""}px ${e(De)??""}px; transform: scale(${e(se)/100});`)},[()=>he()]),vt("pointerdown",T,w),vt("pointermove",T,ze),vt("pointerup",T,l),tt("pointercancel",T,l),tt("lostpointercapture",T,l),s(t,a)},fe=t=>{const a=i(le);var f=je(),_=ue(f);mr(_,()=>ie()+e(a),h=>{Pr(h,{get sourceUrl(){return e(a)},get fileName(){return e(B)},get allowDownload(){return xe()},get downloading(){return Q()},onDownload:ee})}),s(t,f)},nt=t=>{var a=Ya(),f=p(R(a),2),_=S(f,!0),h=p(f,2),j=R(h),D=p(j);P(h),P(a),F((T,H)=>{g(_,e(B)),rt(j,"src",T),g(D,` ${H??""}`)},[()=>X(),()=>d.editor_fileViewer_audioUnsupported_label()]),s(t,a)},$t=t=>{var a=Za(),f=p(R(a),2),_=S(f,!0),h=p(f,2);{let j=i(()=>!xe()||Q());Ce(h,{size:"sm",variant:"secondary",onclick:ee,get disabled(){return e(j)},children:(D,T)=>{var H=Ga(),z=ue(H);Qe(z,{get icon(){return Tt},size:"sm",class:"mr-2"});var G=p(z);F(te=>g(G,` ${te??""}`),[()=>d.editor_fileViewer_downloadPdf_label()]),s(D,H)},$$slots:{default:!0}})}P(a),F(j=>g(_,j),[()=>d.editor_fileViewer_pdfUnavailable_label()]),s(t,a)},ct=t=>{{let a=i(()=>it($().toString()));Yt(t,{get value(){return e(a)},language:"json",get fileName(){return ie()},lineNumbers:!0,readOnly:!0})}},ut=t=>{const a=i(()=>Je($().toString()));var f=ro(),_=R(f),h=R(_),j=R(h);Pt(j,23,()=>e(a)[0]||[],(T,H)=>`header-${H}-${T}`,(T,H)=>{var z=Qa(),G=S(z,!0);F(()=>g(G,e(H))),s(T,z)}),P(j),P(h);var D=p(h);Pt(D,23,()=>e(a).slice(1),(T,H)=>`row-${H}`,(T,H,z)=>{var G=to();Pt(G,23,()=>e(H),(te,we)=>`cell-${e(z)}-${we}`,(te,we)=>{var Te=eo(),Ee=S(Te,!0);F(()=>g(Ee,e(we))),s(te,Te)}),P(G),s(T,G)}),P(D),P(_),P(f),s(t,f)},kt=t=>{var a=ao(),f=p(R(a),2),_=S(f,!0),h=p(f,2),j=S(h,!0);P(a),F(D=>{g(_,e(B)),g(j,D)},[()=>d.editor_fileViewer_archive_label()]),s(t,a)},zt=t=>{var a=oo(),f=p(R(a),2),_=S(f,!0),h=p(f,2),j=S(h,!0);P(a),F(D=>{g(_,e(B)),g(j,D)},[()=>d.editor_fileViewer_binary_label()]),s(t,a)},It=t=>{{let a=i(()=>$().toString());Yt(t,{get value(){return e(a)},get language(){return Fe()},get fileName(){return ie()},lineNumbers:!0,highlightActiveLine:!0})}};re(Pe,t=>{e(W)==="image"?t(Xe):e(W)==="svg"?t($e,1):e(W)==="video"?t(fe,2):e(W)==="audio"?t(nt,3):e(W)==="pdf"?t($t,4):e(W)==="json"?t(ct,5):e(W)==="csv"?t(ut,6):e(W)==="archive"?t(kt,7):e(W)==="binary"?t(zt,8):t(It,-1)})}return P(ge),s(Y,ge),Lt(Ze)}Wr(["pointerdown","pointermove","pointerup"]);const no=/access denied|permission denied|outside (?:the )?workspace/i,so=/file not found|no such file or directory/i;function lo(Y){return no.test(Y)?"access-denied":Y===d.files_read_notFound_error()||so.test(Y)?"not-found":"generic"}function co(Y){switch(Y){case"access-denied":return d.layout_fileTab_errorAccessDenied_label();case"not-found":return d.layout_fileTab_errorNotFound_label();case"generic":return d.layout_fileTab_errorGeneric_label()}}var uo=k("<!> <!>",1),fo=k("<!> <!> <!>",1),vo=k('<div class="flex flex-col items-center justify-center h-full text-subtle gap-2"><p> </p> <p class="text-xs"> </p></div>'),fr=k('<div class="flex h-full items-center justify-center p-4 text-subtle"><p role="alert"> </p></div>'),po=k('<div class="flex h-full items-center justify-center text-subtle"><p> </p></div>'),vr=k('<div class="flex items-center justify-center h-full text-subtle"><p> </p></div>'),go=k('<div class="flex items-center gap-3"><!> <!></div>'),mo=k('<div class="flex flex-col h-full"><div class="flex-1 p-4 space-y-2"></div></div>'),_o=k('<p class="text-xs"> </p>'),ho=k("<li><!></li>"),wo=k('<p class="text-xs mt-2"> </p> <ul class="flex flex-col items-center gap-1"></ul>',1),bo=k('<div class="flex flex-col items-center justify-center h-full text-subtle gap-2"><p class="text-danger" role="alert"> </p> <p class="text-xs font-mono"> </p> <!> <!></div>'),xo=k('<div class="flex flex-col items-center justify-center h-full text-subtle gap-3 p-4"><p> </p> <p class="text-xs break-all"> </p> <!></div>'),yo=k('<div class="h-full overflow-auto p-4"><!></div>');function Po(Y,x){if(new.target)return Mt({component:Po,...Y});Et(x,!0);const Ie=()=>be($e,"$workspace",E),at=()=>be(X,"$fileContentStore",E),ie=()=>be(le,"$fileLoadingStore",E),$=()=>be(he,"$fileSavingStore",E),ne=()=>be(U,"$fileErrorStore",E),Fe=()=>be(de,"$fileNotFoundCandidatesStore",E),Se=()=>be(K,"$isFileBinaryStore",E),xe=()=>be(ee,"$isFileDirtyStore",E),_e=()=>be(ot,"$fileLastUpdatedStore",E),Q=()=>be(it,"$ftChanges$",E),qe=()=>be(Xe,"$gutterRead$",E),W=()=>be(De,"$lineWrapping",E),B=()=>be(Ne,"$diffIndicators",E),se=()=>be(ge,"$rootMediaPreview",E),[E,Le]=Zt(),We=r=>{var n=uo(),I=ue(n);{var C=pe=>{var Ae=je(),Oe=ue(Ae);St(Oe,()=>Dt,(ft,_t)=>{_t(ft,{get icon(){return $a},get label(){return e(_)},disabled:!0})}),s(pe,Ae)};re(I,pe=>{!e(te)&&!e(l)&&!e(t)&&pe(C)})}var ve=p(I,2);{var Re=pe=>{{let Ae=i(()=>!e(Ft)||!e(z)),Oe=i(()=>!e(l)&&(!e(Ft)||!e(z)));ja(pe,{embedded:!0,showFold:!1,showSplit:!1,get showPreview(){return e(Ft)},get previewEnabled(){return e(z)},onTogglePreview:()=>u(z,!e(z)),get showWrap(){return e(Ae)},get wrapEnabled(){return W()},onToggleWrap:()=>V.dispatch(Zr()),get showDiff(){return e(Oe)},get diffEnabled(){return B()},onToggleDiff:()=>V.dispatch(Gr())})}};re(ve,pe=>{o().filePath&&!e(te)&&!e(t)&&pe(Re)})}s(r,n)},ye=r=>{var n=je(),I=ue(n);{var C=ve=>{var Re=fo(),pe=ue(Re);{var Ae=Ve=>{var Ye=je(),lt=ue(Ye);{let ht=i(()=>d.layout_fileTab_goToChanges_tooltip());St(lt,()=>Dt,(wt,bt)=>{bt(wt,{get icon(){return Ia},get label(){return e(ht)},onclick:Tr})})}s(Ve,Ye)};re(pe,Ve=>{e(kr)&&Ve(Ae)})}var Oe=p(pe,2);{var ft=Ve=>{var Ye=je(),lt=ue(Ye);{let ht=i(()=>d.layout_fileTab_downloadFile_label()),wt=i(()=>!e(gt)||e(st));St(lt,()=>Dt,(bt,Wt)=>{Wt(bt,{get icon(){return Tt},get label(){return e(ht)},onclick:Ct,get disabled(){return e(wt)}})})}s(Ve,Ye)};re(Oe,Ve=>{e(Be)&&Ve(ft)})}var _t=p(Oe,2);{let Ve=i(()=>d.layout_fileTab_deleteFile_tooltip());St(_t,()=>Dt,(Ye,lt)=>{lt(Ye,{get icon(){return ka},get label(){return e(Ve)},onclick:Rr,destructive:!0})})}s(ve,Re)};re(I,ve=>{o().filePath&&!e(te)&&!e(l)&&ve(C)})}s(r,n)},De=Ea(),Ne=La();let o=ae(x,"tab",7),c=ae(x,"workspaceId",7),M=ae(x,"isActive",7),m=ae(x,"isPanelFocused",7);ke(()=>{const r=c();if(!(!M()||!r||e(w)))return V.dispatch(Jr(r,"files")),()=>V.dispatch(Xr(r,"files"))});const w=i(()=>typeof o().data?.gitRootId=="string"?o().data.gitRootId:void 0),ze=i(()=>typeof o().data?.gitRootPath=="string"?o().data.gitRootPath:void 0),l=i(()=>!!e(w)),y=i(()=>o().filePath?_a(o().filePath,e(w)):o().filePath),L=Nr(e(y));ke(()=>{L.set(e(y))});const X=na(c(),L),le=sa(c(),L),he=la(c(),L),U=da(c(),L),de=ca(c(),L),K=ua(c(),L),ee=dr(c(),L),ot=fa(c(),L),it=va(c()),Je=ia(),Ze=crypto.randomUUID(),ge=yr(Ze),Pe=`file-gutter:${crypto.randomUUID()}`,Xe=pa(c(),Pe),$e=ga(c()),fe=i(()=>Ie()?.worktreePath||Ie()?.repositoryPath||Ie()?.path||null),nt=i(at),$t=i(ie),ct=i($),ut=i(ne),kt=i(()=>e(ut)?lo(e(ut)):"generic"),zt=5,It=i(()=>(Fe()??[]).slice(0,zt)),t=i(Se),a=i(xe),f=i(_e),_=i(()=>e(ct)?d.ui_saveIndicator_saving_tooltip():e(a)?d.ui_saveIndicator_autoSaving_tooltip():d.ui_saveIndicator_saved_tooltip());let h=O(null),j=O(Br([])),D=O(null),T=O(void 0),H=O(void 0),z=O(!0);ke(()=>{const r=o().data?.line,n=o().data?.jumpTimestamp;!r||n!==void 0&&n===e(H)||(u(H,n,!0),u(T,{line:r},!0),u(z,!1))});const G=i(()=>e(w)?cr(o().filePath,e(ze)):null),te=i(()=>e(w)?!e(G):!!(o().filePath&&(Ta(o().filePath)||e(fe)&&Ra(o().filePath,e(fe))))),we=i(()=>o().filePath&&e(fe)?Xt(o().filePath)?o().filePath:`${e(fe)}/${o().filePath}`:null),Te=i(()=>!!o().filePath&&/\.pdf$/i.test(o().filePath)),Ee=i(()=>!!o().filePath&&/\.(?:png|jpe?g|gif|webp|mp4|webm)$/i.test(o().filePath)),Be=i(()=>c()&&/^[A-Za-z0-9._-]+$/.test(c())?cr(o().filePath,e(fe)):null),At=i(()=>!e(w)&&e(Be)?e(Be).split("/").slice(0,-1).join("/"):void 0),pt=i(()=>e(Te)||e(Ee)?e(Be):null),Ke=i(()=>e(w)&&e(Ee)?{png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",mp4:"video/mp4",webm:"video/webm"}[o().filePath?.split(".").pop()?.toLowerCase()??""]:void 0);ke(()=>{if(!M()||!e(w)||!e(G)||!e(Ke))return;const r=crypto.randomUUID();return V.dispatch(wr(Ze,r,c(),e(G),{gitRootId:e(w),mimeType:e(Ke)})),()=>V.dispatch(br(Ze,r))});let st=O(!1);const gt=i(()=>!!e(Be)&&!e($t)&&(!e(Ee)||e(D)===e(Be))),Qt=i(()=>e(D)&&c()?`workspace-file://${c()}/${e(D).split("/").map(encodeURIComponent).join("/")}`:null),Vt=i(()=>o().filePath?ta(o().filePath):"plaintext"),Ft=i(()=>e(Vt)==="markdown");ke(()=>{if(!M()||e(Te)||e(w))return;const r=e(pt),n=o().filePath,I=c(),C=o().id;if(u(D,null),!r||!n||!I)return;let ve=!1;const Re=()=>!ve&&c()===I&&o().id===C&&o().filePath===n;return(async()=>{let pe=!1;try{pe=(await ha("file.stat",{workspaceId:I,path:r}))?.isFile===!0}catch{}if(!Re())return;if(pe){u(D,r,!0);return}if(!/\.(?:png|jpe?g|gif|webp|mp4|webm)$/i.test(r)){u(D,r,!0);return}const{candidates:Ae,truncated:Oe}=await Da(I,r);if(Re()){if(!Oe&&Ae.length===1){V.dispatch(ir(I,n,Ae[0],C));return}u(D,r,!0)}})(),()=>{ve=!0}});function $r(r,n){return!!(r.file===n||r.relativePath===n||r.relativePath&&n.endsWith("/"+r.relativePath)||r.file&&n.endsWith("/"+r.file)||r.relativePath&&r.relativePath.endsWith("/"+n)||r.file&&r.file.endsWith("/"+n))}const mt=i(()=>e(l)||!o().filePath?null:Q().find(r=>$r(r,o().filePath))??null),kr=i(()=>!!e(mt));ke(()=>{if(e(l))return;const r=c(),n=o().filePath,I=e(fe);return()=>{if(!r||!n)return;const C=qt.select(V.state,r,n);if(C?.kind!=="editable-text")return;const ve=Ht(C.localContent),Re=dr.select(V.state,r,n),pe=Xt(n)?n:I?`${I}/${n}`:null;Re&&pe&&V.dispatch(nr(r,n,pe,ve))}}),ke(()=>{const r=o().filePath,n=e(we),I=c();if(!M())return;const C=!e(w)&&!!r&&Xt(r)&&!e(fe);r&&I&&!e(te)&&!e(Ee)&&!e(Te)&&!C&&(e(w)&&e(G)&&e(y)?V.dispatch(sr(I,e(y),n??r,{gitRoot:{id:e(w),relativePath:e(G)}})):V.dispatch(sr(I,r,n??r)))});function Ir(){return e(nt)??""}function Fr(r){e(l)||e(t)||!o().filePath||!c()||!e(we)||V.dispatch(oa(c(),o().filePath,Ht(r)))}function Cr(){if(e(l)||e(t)||!o().filePath||!e(we)||e(nt)===null||e(ct))return;const r=qt.select(V.state,c(),o().filePath);r?.kind==="editable-text"&&V.dispatch(nr(c(),o().filePath,e(we),Ht(r.localContent)))}function Sr(r){const n=o().filePath;!n||!c()||(V.dispatch(aa(c(),n)),V.dispatch(ir(c(),n,r,o().id)))}ke(()=>{const r=o().filePath,n=e(mt);if(!r||!n){u(j,[],!0);return}if(!M())return;const I=c(),C=crypto.randomUUID();return V.dispatch(Kr(I,Pe,C,{kind:"diffs",path:r,staged:n.stage==="staged"})),()=>{V.dispatch(Yr(I,Pe,C))}}),ke(()=>{const r=qe(),n=r?.result?.kind==="diffs"?r.result.chunks:[],I=n.find(C=>C.file===o().filePath)??n[0];u(j,I?Ma(I.chunks.map(C=>({oldStart:C.oldStart,oldLines:C.oldLines,newStart:C.newStart,newLines:C.newLines,lines:C.lines.map(ve=>(ve.type===lr.Addition?"+":ve.type===lr.Deletion?"-":" ")+ve.content)}))):[],!0)});function Dr(r){const n=/Mac|iPhone|iPad|iPod/.test(navigator.userAgent),I=Re=>Or(r,za(Re),n);if(I("editor.save")){r.preventDefault(),e(a)&&!e(ct)&&Cr();return}const C=I("editor.undo")?"undo":I("editor.redo")?"redo":I("editor.toggle-task-list")?"toggle-task-list":I("editor.copy")?"copy":I("editor.select-all")?"select-all":null;if(!C||e(l)&&C!=="copy"&&C!=="select-all")return;C!=="toggle-task-list"&&e(h)?.runShortcut(C)&&r.preventDefault()}function Tr(r){if(!o().filePath||!e(mt))return;const n=r?.metaKey||r?.ctrlKey||!1,C=r?.target?.closest("[data-panel-id]")?.getAttribute("data-panel-id")??void 0;V.dispatch(ra(c(),e(mt),{filePath:o().filePath,changeId:e(mt).id,openInAdjacentPanel:n,sourcePanelId:C}))}async function Ct(){const r=e(Be);if(!(e(l)||!r||!c()||!e(gt)||e(st))){u(st,!0);try{const n=await ma(c(),r,e(fe));!n?.success&&!n?.canceled&&Jt.error(n?.error?.message||d.layout_fileTab_downloadFailed_error())}catch{Jt.error(d.layout_fileTab_downloadFailed_error())}finally{u(st,!1)}}}function Rr(){const r=e(we);if(e(l)||!o().filePath||!c()||!r)return;const n=Qr(qt.select(V.state,c(),o().filePath));if(!n){Jt.error(d.ui_reversibleActions_failed_error({message:d.fileExplorer_tree_undoUnavailable_error()}));return}V.dispatch(ea(c(),o().filePath,{absolutePath:r,tabId:o().id,snapshot:n}))}ke(()=>{if(!Je||!M())return;const r={isDirty:!e(l)&&e(a),isSaving:!e(l)&&e(ct)};pr(()=>{Je.registerActions({display:We,actions:ye}),Je.registerState(r)})});var Mr={get tab(){return o()},set tab(r){o(r),oe()},get workspaceId(){return c()},set workspaceId(r){c(r),oe()},get isActive(){return M()},set isActive(r){M(r),oe()},get isPanelFocused(){return m()},set isPanelFocused(r){m(r),oe()},$set:Ut,$on:(r,n)=>jt(x,r,n)},er=je();tt("keydown",gr,r=>M()&&Dr(r));var Ur=ue(er);{var jr=r=>{var n=je(),I=ue(n);mr(I,()=>o().filePath,C=>{var ve=je(),Re=ue(ve);{var pe=b=>{var v=vo(),A=R(v),q=S(A,!0),N=p(A,2),Me=S(N,!0);P(v),F(Z=>{g(q,Z),g(Me,o().filePath)},[()=>d.layout_fileTab_outsideWorkspace_label()]),s(b,v)},Ae=b=>{var v=je(),A=ue(v);{var q=N=>{Gt(N,{get workspaceId(){return c()},get filePath(){return e(G)},get gitRootId(){return e(w)}})};re(A,N=>{M()&&N(q)})}s(b,v)},Oe=b=>{var v=je(),A=ue(v);{var q=Z=>{var J=fr(),ce=R(J),Ue=S(ce,!0);P(J),F(me=>g(Ue,me),[()=>d.layout_fileTab_errorLoading_label()]),s(Z,J)},N=Z=>{Rt(Z,{get filePath(){return o().filePath},get sourceUrl(){return se().url},allowDownload:!1})},Me=Z=>{var J=po(),ce=R(J),Ue=S(ce,!0);P(J),F(me=>g(Ue,me),[()=>d.layout_fileTab_preparing_label()]),s(Z,J)};re(A,Z=>{se()?.error?Z(q):se()?.url?Z(N,1):Z(Me,-1)})}s(b,v)},ft=b=>{var v=je(),A=ue(v);{var q=N=>{Gt(N,{get workspaceId(){return c()},get filePath(){return e(pt)}})};re(A,N=>{M()&&N(q)})}s(b,v)},_t=b=>{var v=fr(),A=R(v),q=S(A,!0);P(v),F(N=>g(q,N),[()=>d.file_pdf_load_error()]),s(b,v)},Ve=b=>{{let v=i(()=>e(D)??o().filePath),A=i(()=>!e(l)&&e(gt));Rt(b,{get filePath(){return e(v)},get sourceUrl(){return e(Qt)},onDownload:Ct,get allowDownload(){return e(A)},get downloading(){return e(st)}})}},Ye=b=>{var v=vr(),A=R(v),q=S(A,!0);P(v),F(N=>g(q,N),[()=>d.layout_fileTab_preparing_label()]),s(b,v)},lt=b=>{var v=mo(),A=R(v);Pt(A,20,()=>[...Array(20).keys()],q=>q,(q,N)=>{var Me=go(),Z=R(Me);ur(Z,{class:"h-3 w-8 shrink-0"});var J=p(Z,2);ur(J,{class:"h-3",style:`width: ${30+Math.random()*60}%`}),P(Me),s(q,Me)}),P(A),P(v),s(b,v)},ht=b=>{var v=bo(),A=R(v),q=S(A,!0),N=p(A,2),Me=S(N,!0),Z=p(N,2);{var J=me=>{var He=_o(),dt=S(He,!0);F(()=>g(dt,e(ut))),s(me,He)};re(Z,me=>{e(kt)==="generic"&&me(J)})}var ce=p(Z,2);{var Ue=me=>{var He=wo(),dt=ue(He),Nt=S(dt,!0),tr=p(dt,2);Pt(tr,20,()=>e(It),xt=>xt,(xt,rr)=>{var Bt=ho(),Lr=R(Bt);Ce(Lr,{variant:"link",size:"compact",class:"h-auto p-0 font-mono text-xs",onclick:()=>Sr(rr),children:(zr,$o)=>{Ge();var ar=et();F(()=>g(ar,rr)),s(zr,ar)},$$slots:{default:!0}}),P(Bt),s(xt,Bt)}),P(tr),F(xt=>g(Nt,xt),[()=>d.layout_fileTab_didYouMean_label()]),s(me,He)};re(ce,me=>{e(It).length>0&&me(Ue)})}P(v),F(me=>{g(q,me),g(Me,o().filePath)},[()=>co(e(kt))]),s(b,v)},wt=b=>{var v=xo(),A=R(v),q=S(A,!0),N=p(A,2),Me=S(N,!0),Z=p(N,2);{var J=ce=>{{let Ue=i(()=>!e(gt)||e(st));Ce(ce,{variant:"secondary",size:"sm",onclick:Ct,get disabled(){return e(Ue)},children:(me,He)=>{Ge();var dt=et();F(Nt=>g(dt,Nt),[()=>d.layout_fileTab_downloadFile_label()]),s(me,dt)},$$slots:{default:!0}})}};re(Z,ce=>{!e(l)&&e(Be)&&ce(J)})}P(v),F(ce=>{g(q,ce),g(Me,o().filePath)},[()=>d.editor_fileViewer_binary_label()]),s(b,v)},bt=b=>{const v=i(()=>o().filePath?.toLowerCase().endsWith(".svg"));var A=je(),q=ue(A);{var N=J=>{{let ce=i(()=>o().filePath||""),Ue=i(()=>!e(l)&&e(gt));Rt(J,{get filePath(){return e(ce)},get fileContent(){return e(nt)},get language(){return e(Vt)},get isBinary(){return e(t)},onDownload:Ct,get allowDownload(){return e(Ue)},get downloading(){return e(st)}})}},Me=J=>{var ce=yo(),Ue=R(ce);Ua(Ue,{get content(){return e(nt)},get workspaceId(){return c()},get relativeMediaBase(){return e(At)},renderRichFencesAsCode:!0,renderDiagrams:!0}),P(ce),s(J,ce)},Z=J=>{var ce=Ir,Ue=Fr;{let me=i(()=>B()?e(j):[]);_r(Yt(J,{get value(){return ce()},set value(He){Ue(He)},get language(){return e(Vt)},get readOnly(){return e(l)},get fileName(){return o().filePath},get workspaceId(){return c()},get filePath(){return o().filePath},get lineWrapping(){return W()},get lineChanges(){return e(me)},get jumpTo(){return e(T)},get externalContentVersion(){return e(f)},get isPanelFocused(){return m()}}),He=>u(h,He,!0),()=>e(h))}};re(q,J=>{e(v)?J(N):e(Ft)&&e(z)?J(Me,1):J(Z,-1)})}s(b,A)},Wt=b=>{var v=vr(),A=R(v),q=S(A,!0);P(v),F(N=>g(q,N),[()=>d.layout_fileTab_preparing_label()]),s(b,v)};re(Re,b=>{e(te)?b(pe):e(w)&&e(Te)&&e(G)?b(Ae,1):e(w)&&e(Ee)?b(Oe,2):e(Te)&&e(pt)?b(ft,3):e(Te)?b(_t,4):e(Qt)?b(Ve,5):e(Ee)?b(Ye,6):e($t)?b(lt,7):e(ut)?b(ht,8):e(t)?b(wt,9):e(nt)!==null?b(bt,10):b(Wt,-1)})}s(C,ve)}),s(r,n)};re(Ur,r=>{o().filePath&&r(jr)})}s(Y,er);var Er=Lt(Mr);return Le(),Er}export{Po as default};
@@ -1,4 +1,4 @@
1
- var vo=Object.defineProperty;var bo=(e,t,i)=>t in e?vo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var v=(e,t,i)=>bo(e,typeof t!="symbol"?t+"":t,i);import{t as ir,bq as M,a_ as we,by as nr,b as rr,bu as dn,bs as So,bo as je}from"./7rNOGHzs.js";import{bs as or,a5 as De,ay as hn,bS as Xe,aD as C,bA as ke,b_ as Me,bO as rt,W as le,bl as Xt,be as Hi,bn as sr,c9 as ne,aA as I,b$ as ar,aB as ge,ai as yo,bV as Te,br as Co,ca as $e,bH as Y,c5 as dt,bk as xo,bj as Lo,aj as wo,c0 as fn}from"./B8o4lNgr.js";import{h as ko,i as Eo,k as un,l as pi,s as cn}from"./DmsDslNo.js";import{b as Ro}from"./C3hWtekV.js";import{b as pn}from"./D2g8BuR1.js";import{h as Ao,c as Ye,w as lr,N as O,O as Jt,a_ as Qe,a as dr,j as hr,P as Je,H as fr,i as ur,a9 as cr,U as Ho,f as To,e as pr,T as Do,g as Mo,S as Io,a3 as Ze,a2 as Ve,C as Fo,G as gr,F as No,I as Po,A as At,af as zo,_ as Ht,ab as Tt,v as St,a0 as Ti,s as J,r as Ue,al as wt,D as Uo,d as _o,a8 as mr,b as gn,u as mn,aE as Oo,am as ct,aa as Bo,K as Le,M as Ut,L as Vo,$ as Dt,E as Wo,aj as vr,a5 as Go,a1 as vn,t as br,ad as ft,a4 as kt,ac as ot,ae as Sr,B as gi,a7 as mi,k as jo,aD as bn}from"./DhdMM_zt.js";import{F as vi,c5 as $o,bg as qo,aw as Ko,av as Xo}from"./CFejQM6t.js";import{f as Di}from"./Bgegixo2.js";import{g as Yo}from"./C_n9DeKj.js";import{d as Qo}from"./D-cnPaTJ.js";import{P as Jo}from"./EZw3rvya.js";import{t as Sn}from"./DzMmhJrp.js";class Zo extends Ao{constructor(){super(...arguments),this.tokenize=ts}equals(t,i,n){return n.ignoreWhitespace?((!n.newlineIsToken||!t.includes(`
1
+ var vo=Object.defineProperty;var bo=(e,t,i)=>t in e?vo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var v=(e,t,i)=>bo(e,typeof t!="symbol"?t+"":t,i);import{t as ir,bq as M,a_ as we,by as nr,b as rr,bu as dn,bs as So,bo as je}from"./7rNOGHzs.js";import{bs as or,a5 as De,ay as hn,bS as Xe,aD as C,bA as ke,b_ as Me,bO as rt,W as le,bl as Xt,be as Hi,bn as sr,c9 as ne,aA as I,b$ as ar,aB as ge,ai as yo,bV as Te,br as Co,ca as $e,bH as Y,c5 as dt,bk as xo,bj as Lo,aj as wo,c0 as fn}from"./B8o4lNgr.js";import{h as ko,i as Eo,k as un,l as pi,s as cn}from"./DmsDslNo.js";import{b as Ro}from"./C3hWtekV.js";import{b as pn}from"./D2g8BuR1.js";import{h as Ao,c as Ye,w as lr,N as O,O as Jt,a_ as Qe,a as dr,j as hr,P as Je,H as fr,i as ur,a9 as cr,U as Ho,f as To,e as pr,T as Do,g as Mo,S as Io,a3 as Ze,a2 as Ve,C as Fo,G as gr,F as No,I as Po,A as At,af as zo,_ as Ht,ab as Tt,v as St,a0 as Ti,s as J,r as Ue,al as wt,D as Uo,d as _o,a8 as mr,b as gn,u as mn,aE as Oo,am as ct,aa as Bo,K as Le,M as Ut,L as Vo,$ as Dt,E as Wo,aj as vr,a5 as Go,a1 as vn,t as br,ad as ft,a4 as kt,ac as ot,ae as Sr,B as gi,a7 as mi,k as jo,aD as bn}from"./yGxUPrAb.js";import{F as vi,c5 as $o,bg as qo,aw as Ko,av as Xo}from"./CFejQM6t.js";import{f as Di}from"./Bgegixo2.js";import{g as Yo}from"./C_n9DeKj.js";import{d as Qo}from"./D-cnPaTJ.js";import{P as Jo}from"./CkactGV1.js";import{t as Sn}from"./DzMmhJrp.js";class Zo extends Ao{constructor(){super(...arguments),this.tokenize=ts}equals(t,i,n){return n.ignoreWhitespace?((!n.newlineIsToken||!t.includes(`
2
2
  `))&&(t=t.trim()),(!n.newlineIsToken||!i.includes(`
3
3
  `))&&(i=i.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(t.endsWith(`
4
4
  `)&&(t=t.slice(0,-1)),i.endsWith(`
@@ -1 +1 @@
1
- import{t as I,bq as s,a_ as G,by as z,br as O,b as N,bu as K,bs as U}from"./7rNOGHzs.js";import{aG as V,bs as A,c5 as p,aD as x,a5 as R,bS as X,bf as P,bA as W,W as S,bn as M,c9 as B,aA as n,aB as E,ca as T,a7 as Z,ay as $}from"./B8o4lNgr.js";import{s as q}from"./CQ4a5a4v.js";import{c as L,f as k}from"./DmsDslNo.js";import{b as Y}from"./D2g8BuR1.js";import{u as ee,c as D,s as te,b as re,a as ae}from"./D2AmAQEr.js";import{C as se}from"./DSjRkndX.js";import{Hq as ne,rM as oe,bk as ie}from"./CRwmdgt6.js";import{aY as de}from"./EZw3rvya.js";import{m as ce}from"./DY0zw3Os.js";import{bH as le}from"./CB-g50lR.js";import{M as ue}from"./lfJ8pseq.js";const fe=Symbol("card-group"),ve=()=>V(fe);var me=new Set(["$$slots","$$events","$$legacy","ref","class","inert","interactive","level","border","selected","media","children"]),be=E('<div data-slot="card-media" class="shrink-0 p-4"><!></div>'),ge=E("<div><!> <!></div>");function he(o,e){if(new.target)return I({component:he,...o});A(e,!0);let i=s(e,"ref",15,null),c=s(e,"class",7),a=s(e,"inert",7,!1),u=s(e,"interactive",7,!1),v=s(e,"level",7),f=s(e,"border",7),l=s(e,"selected",7,!1),b=s(e,"media",7),r=s(e,"children",7),g=O(e,me);const m=ve(),w=B(()=>f()==="outlined"||f()===void 0&&(!m||m.border==="outlined"&&m.separated)),y=ee(),d=D(p(()=>v()??y+1));te(d);const C=D(d+1);var j={get ref(){return i()},set ref(t=null){i(t),n()},get class(){return c()},set class(t){c(t),n()},get inert(){return a()},set inert(t=!1){a(t),n()},get interactive(){return u()},set interactive(t=!1){u(t),n()},get level(){return v()},set level(t){v(t),n()},get border(){return f()},set border(t){f(t),n()},get selected(){return l()},set selected(t=!1){l(t),n()},get media(){return b()},set media(t){b(t),n()},get children(){return r()},set children(t){r(t),n()},$set:z,$on:(t,_)=>N(e,t,_)},h=ge();L(h,t=>({"data-slot":"card","data-selected":l()||void 0,"data-orientation":m?.orientation,"data-surface-level":d,"data-inert":a()||void 0,"data-interactive":u()||void 0,inert:a(),class:t,...g}),[()=>k("flex min-w-0 flex-col overflow-hidden rounded-md text-card-foreground",x(w)?m?"border border-border bg-transparent":ae(d):"bg-transparent",l()&&"bg-selected",m?.orientation==="inline"&&"flex-row items-center [&>[data-slot=card-header]]:min-w-0 [&>[data-slot=card-header]]:flex-1",m&&"relative",u()?k("cursor-pointer transition-[background-color,box-shadow] duration-(--motion-fast) ease-(--ease-standard)","focus-visible:outline focus-visible:-outline-offset-1","active:bg-active data-[state=pressed]:bg-active motion-reduce:transition-none",re(C)):"",c())]);var H=R(h);{var F=t=>{var _=be(),Q=R(_);q(Q,b),W(_),S(t,_)};G(H,t=>{b()&&t(F)})}var J=X(H,2);return q(J,()=>r()??P),W(h),Y(h,t=>i(t),()=>i()),S(o,h),M(j)}var _e=new Set(["$$slots","$$events","$$legacy","ref","class","flush","children"]),pe=E("<div><!></div>");function Se(o,e){if(new.target)return I({component:Se,...o});A(e,!0);let i=s(e,"ref",15,null),c=s(e,"class",7),a=s(e,"flush",7,!1),u=s(e,"children",7),v=O(e,_e);var f={get ref(){return i()},set ref(r=null){i(r),n()},get class(){return c()},set class(r){c(r),n()},get flush(){return a()},set flush(r=!1){a(r),n()},get children(){return u()},set children(r){u(r),n()},$set:z,$on:(r,g)=>N(e,r,g)},l=pe();L(l,r=>({"data-slot":"card-content","data-flush":a()||void 0,class:r,...v}),[()=>k("type-body min-w-0",a()?"p-0":k(se,"py-4 first:pt-4"),c())]);var b=R(l);return q(b,()=>u()??P),W(l),Y(l,r=>i(r),()=>i()),S(o,l),M(f)}function Ee(o){const e=()=>ne.dispatch(oe({quiet:o.quiet}));T(()=>{o.key?.(),o.active()&&p(e)});const i=B(()=>o.workspaces().some(a=>a.status===ie.Retired));let c=p(()=>x(i));T(()=>{const a=x(i);p(()=>{c&&!a&&o.active()&&e(),c=a})})}function ke(o,e){if(new.target)return I({component:ke,...o});A(e,!0);const i=()=>K(l,"$connected$",a),c=()=>K(b,"$slot$",a),[a,u]=U();let v=s(e,"workspaceId",7),f=s(e,"size",7,"default");const l=ce(),b=le(de(()=>v()));var r={get workspaceId(){return v()},set workspaceId(d){v(d),n()},get size(){return f()},set size(d="default"){f(d),n()},$set:z,$on:(d,C)=>N(e,d,C)},g=Z(),m=$(g);{var w=d=>{ue(d,{get slot(){return c()},get size(){return f()}})};G(m,d=>{i()&&c()!==null&&d(w)})}S(o,g);var y=M(r);return u(),y}export{he as C,ke as W,Se as a,Ee as r};
1
+ import{t as I,bq as s,a_ as G,by as z,br as O,b as N,bu as K,bs as U}from"./7rNOGHzs.js";import{aG as V,bs as A,c5 as p,aD as x,a5 as R,bS as X,bf as P,bA as W,W as S,bn as M,c9 as B,aA as n,aB as E,ca as T,a7 as Z,ay as $}from"./B8o4lNgr.js";import{s as q}from"./CQ4a5a4v.js";import{c as L,f as k}from"./DmsDslNo.js";import{b as Y}from"./D2g8BuR1.js";import{u as ee,c as D,s as te,b as re,a as ae}from"./D2AmAQEr.js";import{C as se}from"./DSjRkndX.js";import{Hq as ne,rM as oe,bk as ie}from"./CRwmdgt6.js";import{aY as de}from"./CkactGV1.js";import{m as ce}from"./DY0zw3Os.js";import{bH as le}from"./CB-g50lR.js";import{M as ue}from"./lfJ8pseq.js";const fe=Symbol("card-group"),ve=()=>V(fe);var me=new Set(["$$slots","$$events","$$legacy","ref","class","inert","interactive","level","border","selected","media","children"]),be=E('<div data-slot="card-media" class="shrink-0 p-4"><!></div>'),ge=E("<div><!> <!></div>");function he(o,e){if(new.target)return I({component:he,...o});A(e,!0);let i=s(e,"ref",15,null),c=s(e,"class",7),a=s(e,"inert",7,!1),u=s(e,"interactive",7,!1),v=s(e,"level",7),f=s(e,"border",7),l=s(e,"selected",7,!1),b=s(e,"media",7),r=s(e,"children",7),g=O(e,me);const m=ve(),w=B(()=>f()==="outlined"||f()===void 0&&(!m||m.border==="outlined"&&m.separated)),y=ee(),d=D(p(()=>v()??y+1));te(d);const C=D(d+1);var j={get ref(){return i()},set ref(t=null){i(t),n()},get class(){return c()},set class(t){c(t),n()},get inert(){return a()},set inert(t=!1){a(t),n()},get interactive(){return u()},set interactive(t=!1){u(t),n()},get level(){return v()},set level(t){v(t),n()},get border(){return f()},set border(t){f(t),n()},get selected(){return l()},set selected(t=!1){l(t),n()},get media(){return b()},set media(t){b(t),n()},get children(){return r()},set children(t){r(t),n()},$set:z,$on:(t,_)=>N(e,t,_)},h=ge();L(h,t=>({"data-slot":"card","data-selected":l()||void 0,"data-orientation":m?.orientation,"data-surface-level":d,"data-inert":a()||void 0,"data-interactive":u()||void 0,inert:a(),class:t,...g}),[()=>k("flex min-w-0 flex-col overflow-hidden rounded-md text-card-foreground",x(w)?m?"border border-border bg-transparent":ae(d):"bg-transparent",l()&&"bg-selected",m?.orientation==="inline"&&"flex-row items-center [&>[data-slot=card-header]]:min-w-0 [&>[data-slot=card-header]]:flex-1",m&&"relative",u()?k("cursor-pointer transition-[background-color,box-shadow] duration-(--motion-fast) ease-(--ease-standard)","focus-visible:outline focus-visible:-outline-offset-1","active:bg-active data-[state=pressed]:bg-active motion-reduce:transition-none",re(C)):"",c())]);var H=R(h);{var F=t=>{var _=be(),Q=R(_);q(Q,b),W(_),S(t,_)};G(H,t=>{b()&&t(F)})}var J=X(H,2);return q(J,()=>r()??P),W(h),Y(h,t=>i(t),()=>i()),S(o,h),M(j)}var _e=new Set(["$$slots","$$events","$$legacy","ref","class","flush","children"]),pe=E("<div><!></div>");function Se(o,e){if(new.target)return I({component:Se,...o});A(e,!0);let i=s(e,"ref",15,null),c=s(e,"class",7),a=s(e,"flush",7,!1),u=s(e,"children",7),v=O(e,_e);var f={get ref(){return i()},set ref(r=null){i(r),n()},get class(){return c()},set class(r){c(r),n()},get flush(){return a()},set flush(r=!1){a(r),n()},get children(){return u()},set children(r){u(r),n()},$set:z,$on:(r,g)=>N(e,r,g)},l=pe();L(l,r=>({"data-slot":"card-content","data-flush":a()||void 0,class:r,...v}),[()=>k("type-body min-w-0",a()?"p-0":k(se,"py-4 first:pt-4"),c())]);var b=R(l);return q(b,()=>u()??P),W(l),Y(l,r=>i(r),()=>i()),S(o,l),M(f)}function Ee(o){const e=()=>ne.dispatch(oe({quiet:o.quiet}));T(()=>{o.key?.(),o.active()&&p(e)});const i=B(()=>o.workspaces().some(a=>a.status===ie.Retired));let c=p(()=>x(i));T(()=>{const a=x(i);p(()=>{c&&!a&&o.active()&&e(),c=a})})}function ke(o,e){if(new.target)return I({component:ke,...o});A(e,!0);const i=()=>K(l,"$connected$",a),c=()=>K(b,"$slot$",a),[a,u]=U();let v=s(e,"workspaceId",7),f=s(e,"size",7,"default");const l=ce(),b=le(de(()=>v()));var r={get workspaceId(){return v()},set workspaceId(d){v(d),n()},get size(){return f()},set size(d="default"){f(d),n()},$set:z,$on:(d,C)=>N(e,d,C)},g=Z(),m=$(g);{var w=d=>{ue(d,{get slot(){return c()},get size(){return f()}})};G(m,d=>{i()&&c()!==null&&d(w)})}S(o,g);var y=M(r);return u(),y}export{he as C,ke as W,Se as a,Ee as r};
@@ -0,0 +1,7 @@
1
+ import{bf as pi,a5 as mi,a9 as $t,bi as yi,a6 as bi,bg as wi,c as a,aN as Ut,bd as Ai,I as Ci,w as Si,a7 as Dt,bb as Ri,v as Gt,W as _i,ah as ki,H as Ti,aK as Xt}from"./D57k4GEE.js";import{i as Di}from"./Gi6I4Gst.js";import{o as Pi}from"./CmKTTxBW.js";import{l as Nt}from"./ey5Fwige.js";function vi(e,t,i){e=+e,t=+t,i=(n=arguments.length)<2?(t=e,e=0,1):n<3?1:+i;for(var s=-1,n=Math.max(0,Math.ceil((t-e)/i))|0,o=new Array(n);++s<n;)o[s]=e+s*i;return o}function St(){var e=Pi().unknown(void 0),t=e.domain,i=e.range,s=0,n=1,o,l,p=!1,d=0,u=0,b=.5;delete e.unknown;function A(){var m=t().length,E=n<s,v=E?n:s,L=E?s:n;o=(L-v)/Math.max(1,m-d+u*2),p&&(o=Math.floor(o)),v+=(L-v-o*(m-d))*b,l=o*(1-d),p&&(v=Math.round(v),l=Math.round(l));var M=vi(m).map(function(w){return v+o*w});return i(E?M.reverse():M)}return e.domain=function(m){return arguments.length?(t(m),A()):t()},e.range=function(m){return arguments.length?([s,n]=m,s=+s,n=+n,A()):[s,n]},e.rangeRound=function(m){return[s,n]=m,s=+s,n=+n,p=!0,A()},e.bandwidth=function(){return l},e.step=function(){return o},e.round=function(m){return arguments.length?(p=!!m,A()):p},e.padding=function(m){return arguments.length?(d=Math.min(1,u=+m),A()):d},e.paddingInner=function(m){return arguments.length?(d=Math.min(1,m),A()):d},e.paddingOuter=function(m){return arguments.length?(u=+m,A()):u},e.align=function(m){return arguments.length?(b=Math.max(0,Math.min(1,m)),A()):b},e.copy=function(){return St(t(),[s,n]).round(p).paddingInner(d).paddingOuter(u).align(b)},Di.apply(A(),arguments)}var Rt=(function(){var e=a(function(F,r,g,x){for(g=g||{},x=F.length;x--;g[F[x]]=r);return g},"o"),t=[1,10,12,14,16,18,19,21,23],i=[2,6],s=[1,3],n=[1,5],o=[1,6],l=[1,7],p=[1,5,10,12,14,16,18,19,21,23,36,37,38],d=[1,25],u=[1,26],b=[1,28],A=[1,29],m=[1,30],E=[1,31],v=[1,32],L=[1,33],M=[1,34],w=[1,35],D=[1,36],c=[1,37],B=[1,43],W=[1,42],X=[1,47],N=[1,50],k=[1,10,12,14,16,18,19,21,23,36,37,38],H=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38],S=[1,10,12,14,16,18,19,21,23,24,26,28,29,36,37,38,42,43,44,45,46,47,48,49,50,51],R=[1,65],O=[26,28],T={trace:a(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,dataPoints:25,SQUARE_BRACES_END:26,dataPoint:27,COMMA:28,NUMBER_WITH_DECIMAL:29,STR:30,xAxisData:31,bandData:32,ARROW_DELIMITER:33,commaSeparatedTexts:34,yAxisData:35,NEWLINE:36,SEMI:37,EOF:38,alphaNum:39,MD_STR:40,alphaNumToken:41,AMP:42,NUM:43,ALPHA:44,PLUS:45,EQUALS:46,MULT:47,DOT:48,BRKT:49,MINUS:50,UNDERSCORE:51,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",28:"COMMA",29:"NUMBER_WITH_DECIMAL",30:"STR",33:"ARROW_DELIMITER",36:"NEWLINE",37:"SEMI",38:"EOF",40:"MD_STR",42:"AMP",43:"NUM",44:"ALPHA",45:"PLUS",46:"EQUALS",47:"MULT",48:"DOT",49:"BRKT",50:"MINUS",51:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[27,2],[27,1],[13,1],[13,2],[13,1],[31,1],[31,3],[32,3],[34,3],[34,1],[15,1],[15,2],[15,1],[35,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[39,1],[39,2],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1],[41,1]],performAction:a(function(r,g,x,f,_,h,lt){var y=h.length-1;switch(_){case 5:f.setOrientation(h[y]);break;case 9:f.setDiagramTitle(h[y].text.trim());break;case 12:f.setLineData({text:"",type:"text"},h[y]);break;case 13:f.setLineData(h[y-1],h[y]);break;case 14:f.setBarData({text:"",type:"text"},h[y]);break;case 15:f.setBarData(h[y-1],h[y]);break;case 16:this.$=h[y].trim(),f.setAccTitle(this.$);break;case 17:case 18:this.$=h[y].trim(),f.setAccDescription(this.$);break;case 19:this.$=h[y-1];break;case 20:case 30:this.$=[h[y-2],...h[y]];break;case 21:case 31:this.$=[h[y]];break;case 22:this.$={value:Number(h[y-1]),label:h[y]};break;case 23:this.$={value:Number(h[y]),label:""};break;case 24:f.setXAxisTitle(h[y]);break;case 25:f.setXAxisTitle(h[y-1]);break;case 26:f.setXAxisTitle({type:"text",text:""});break;case 27:f.setXAxisBand(h[y]);break;case 28:f.setXAxisRangeData(Number(h[y-2]),Number(h[y]));break;case 29:this.$=h[y-1];break;case 32:f.setYAxisTitle(h[y]);break;case 33:f.setYAxisTitle(h[y-1]);break;case 34:f.setYAxisTitle({type:"text",text:""});break;case 35:f.setYAxisRangeData(Number(h[y-2]),Number(h[y]));break;case 39:this.$={text:h[y],type:"text"};break;case 40:this.$={text:h[y],type:"text"};break;case 41:this.$={text:h[y],type:"markdown"};break;case 42:this.$=h[y];break;case 43:this.$=h[y-1]+""+h[y];break}},"anonymous"),table:[e(t,i,{3:1,4:2,7:4,5:s,36:n,37:o,38:l}),{1:[3]},e(t,i,{4:2,7:4,3:8,5:s,36:n,37:o,38:l}),e(t,i,{4:2,7:4,6:9,3:10,5:s,8:[1,11],36:n,37:o,38:l}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},e(p,[2,36]),e(p,[2,37]),e(p,[2,38]),{1:[2,1]},e(t,i,{4:2,7:4,3:21,5:s,36:n,37:o,38:l}),{1:[2,3]},e(p,[2,5]),e(t,[2,7],{4:22,36:n,37:o,38:l}),{11:23,30:d,39:24,40:u,41:27,42:b,43:A,44:m,45:E,46:v,47:L,48:M,49:w,50:D,51:c},{11:39,13:38,24:B,29:W,30:d,31:40,32:41,39:24,40:u,41:27,42:b,43:A,44:m,45:E,46:v,47:L,48:M,49:w,50:D,51:c},{11:45,15:44,29:X,30:d,35:46,39:24,40:u,41:27,42:b,43:A,44:m,45:E,46:v,47:L,48:M,49:w,50:D,51:c},{11:49,17:48,24:N,30:d,39:24,40:u,41:27,42:b,43:A,44:m,45:E,46:v,47:L,48:M,49:w,50:D,51:c},{11:52,17:51,24:N,30:d,39:24,40:u,41:27,42:b,43:A,44:m,45:E,46:v,47:L,48:M,49:w,50:D,51:c},{20:[1,53]},{22:[1,54]},e(k,[2,18]),{1:[2,2]},e(k,[2,8]),e(k,[2,9]),e(H,[2,39],{41:55,42:b,43:A,44:m,45:E,46:v,47:L,48:M,49:w,50:D,51:c}),e(H,[2,40]),e(H,[2,41]),e(S,[2,42]),e(S,[2,44]),e(S,[2,45]),e(S,[2,46]),e(S,[2,47]),e(S,[2,48]),e(S,[2,49]),e(S,[2,50]),e(S,[2,51]),e(S,[2,52]),e(S,[2,53]),e(k,[2,10]),e(k,[2,24],{32:41,31:56,24:B,29:W}),e(k,[2,26]),e(k,[2,27]),{33:[1,57]},{11:59,30:d,34:58,39:24,40:u,41:27,42:b,43:A,44:m,45:E,46:v,47:L,48:M,49:w,50:D,51:c},e(k,[2,11]),e(k,[2,32],{35:60,29:X}),e(k,[2,34]),{33:[1,61]},e(k,[2,12]),{17:62,24:N},{25:63,27:64,29:R},e(k,[2,14]),{17:66,24:N},e(k,[2,16]),e(k,[2,17]),e(S,[2,43]),e(k,[2,25]),{29:[1,67]},{26:[1,68]},{26:[2,31],28:[1,69]},e(k,[2,33]),{29:[1,70]},e(k,[2,13]),{26:[1,71]},{26:[2,21],28:[1,72]},e(O,[2,23],{30:[1,73]}),e(k,[2,15]),e(k,[2,28]),e(k,[2,29]),{11:59,30:d,34:74,39:24,40:u,41:27,42:b,43:A,44:m,45:E,46:v,47:L,48:M,49:w,50:D,51:c},e(k,[2,35]),e(k,[2,19]),{25:75,27:64,29:R},e(O,[2,22]),{26:[2,30]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],74:[2,30],75:[2,20]},parseError:a(function(r,g){if(g.recoverable)this.trace(r);else{var x=new Error(r);throw x.hash=g,x}},"parseError"),parse:a(function(r){var g=this,x=[0],f=[],_=[null],h=[],lt=this.table,y="",dt=0,Ot=0,ui=2,Vt=1,di=h.slice.call(arguments,1),P=Object.create(this.lexer),$={yy:{}};for(var bt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,bt)&&($.yy[bt]=this.yy[bt]);P.setInput(r,$.yy),$.yy.lexer=P,$.yy.parser=this,typeof P.yylloc>"u"&&(P.yylloc={});var wt=P.yylloc;h.push(wt);var xi=P.options&&P.options.ranges;typeof $.yy.parseError=="function"?this.parseError=$.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function fi(z){x.length=x.length-2*z,_.length=_.length-z,h.length=h.length-z}a(fi,"popStack");function Wt(){var z;return z=f.pop()||P.lex()||Vt,typeof z!="number"&&(z instanceof Array&&(f=z,z=f.pop()),z=g.symbols_[z]||z),z}a(Wt,"lex");for(var I,U,V,At,j={},xt,Y,Ft,ft;;){if(U=x[x.length-1],this.defaultActions[U]?V=this.defaultActions[U]:((I===null||typeof I>"u")&&(I=Wt()),V=lt[U]&&lt[U][I]),typeof V>"u"||!V.length||!V[0]){var Ct="";ft=[];for(xt in lt[U])this.terminals_[xt]&&xt>ui&&ft.push("'"+this.terminals_[xt]+"'");P.showPosition?Ct="Parse error on line "+(dt+1)+`:
2
+ `+P.showPosition()+`
3
+ Expecting `+ft.join(", ")+", got '"+(this.terminals_[I]||I)+"'":Ct="Parse error on line "+(dt+1)+": Unexpected "+(I==Vt?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError(Ct,{text:P.match,token:this.terminals_[I]||I,line:P.yylineno,loc:wt,expected:ft})}if(V[0]instanceof Array&&V.length>1)throw new Error("Parse Error: multiple actions possible at state: "+U+", token: "+I);switch(V[0]){case 1:x.push(I),_.push(P.yytext),h.push(P.yylloc),x.push(V[1]),I=null,Ot=P.yyleng,y=P.yytext,dt=P.yylineno,wt=P.yylloc;break;case 2:if(Y=this.productions_[V[1]][1],j.$=_[_.length-Y],j._$={first_line:h[h.length-(Y||1)].first_line,last_line:h[h.length-1].last_line,first_column:h[h.length-(Y||1)].first_column,last_column:h[h.length-1].last_column},xi&&(j._$.range=[h[h.length-(Y||1)].range[0],h[h.length-1].range[1]]),At=this.performAction.apply(j,[y,Ot,dt,$.yy,V[1],_,h].concat(di)),typeof At<"u")return At;Y&&(x=x.slice(0,-1*Y*2),_=_.slice(0,-1*Y),h=h.slice(0,-1*Y)),x.push(this.productions_[V[1]][0]),_.push(j.$),h.push(j._$),Ft=lt[x[x.length-2]][x[x.length-1]],x.push(Ft);break;case 3:return!0}}return!0},"parse")},rt=(function(){var F={EOF:1,parseError:a(function(g,x){if(this.yy.parser)this.yy.parser.parseError(g,x);else throw new Error(g)},"parseError"),setInput:a(function(r,g){return this.yy=g||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:a(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var g=r.match(/(?:\r\n?|\n).*/g);return g?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:a(function(r){var g=r.length,x=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-g),this.offset-=g;var f=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),x.length-1&&(this.yylineno-=x.length-1);var _=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:x?(x.length===f.length?this.yylloc.first_column:0)+f[f.length-x.length].length-x[0].length:this.yylloc.first_column-g},this.options.ranges&&(this.yylloc.range=[_[0],_[0]+this.yyleng-g]),this.yyleng=this.yytext.length,this},"unput"),more:a(function(){return this._more=!0,this},"more"),reject:a(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:a(function(r){this.unput(this.match.slice(r))},"less"),pastInput:a(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:a(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:a(function(){var r=this.pastInput(),g=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
5
+ `+g+"^"},"showPosition"),test_match:a(function(r,g){var x,f,_;if(this.options.backtrack_lexer&&(_={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(_.yylloc.range=this.yylloc.range.slice(0))),f=r[0].match(/(?:\r\n?|\n).*/g),f&&(this.yylineno+=f.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:f?f[f.length-1].length-f[f.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+r[0].length},this.yytext+=r[0],this.match+=r[0],this.matches=r,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(r[0].length),this.matched+=r[0],x=this.performAction.call(this,this.yy,this,g,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),x)return x;if(this._backtrack){for(var h in _)this[h]=_[h];return!1}return!1},"test_match"),next:a(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var r,g,x,f;this._more||(this.yytext="",this.match="");for(var _=this._currentRules(),h=0;h<_.length;h++)if(x=this._input.match(this.rules[_[h]]),x&&(!g||x[0].length>g[0].length)){if(g=x,f=h,this.options.backtrack_lexer){if(r=this.test_match(x,_[h]),r!==!1)return r;if(this._backtrack){g=!1;continue}else return!1}else if(!this.options.flex)break}return g?(r=this.test_match(g,_[f]),r!==!1?r:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
6
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:a(function(){var g=this.next();return g||this.lex()},"lex"),begin:a(function(g){this.conditionStack.push(g)},"begin"),popState:a(function(){var g=this.conditionStack.length-1;return g>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:a(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:a(function(g){return g=this.conditionStack.length-1-Math.abs(g||0),g>=0?this.conditionStack[g]:"INITIAL"},"topState"),pushState:a(function(g){this.begin(g)},"pushState"),stateStackSize:a(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:a(function(g,x,f,_){switch(f){case 0:break;case 1:break;case 2:return this.popState(),36;case 3:return this.popState(),36;case 4:return 36;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;case 8:return this.popState(),"acc_title_value";case 9:return this.pushState("acc_descr"),21;case 10:return this.popState(),"acc_descr_value";case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";case 18:return this.pushState("axis_data"),"Y_AXIS";case 19:return this.pushState("axis_band_data"),24;case 20:return 33;case 21:return this.pushState("data"),16;case 22:return this.pushState("data"),18;case 23:return this.pushState("data_inner"),24;case 24:return 29;case 25:return this.popState(),26;case 26:this.popState();break;case 27:this.pushState("string");break;case 28:this.popState();break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 44;case 33:return"COLON";case 34:return 45;case 35:return 28;case 36:return 46;case 37:return 47;case 38:return 49;case 39:return 51;case 40:return 48;case 41:return 42;case 42:return 50;case 43:return 43;case 44:break;case 45:return 37;case 46:return 38}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\})/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}};return F})();T.lexer=rt;function q(){this.yy={}}return a(q,"Parser"),q.prototype=T,T.Parser=q,new q})();Rt.parser=Rt;var Li=Rt;function pt(e){return e.type==="bar"}a(pt,"isBarPlot");function mt(e){return e.type==="band"}a(mt,"isBandAxisData");function K(e){return e.type==="linear"}a(K,"isLinearAxisData");var Q,Pt=(Q=class{constructor(t){this.parentGroup=t}getMaxDimension(t,i){if(!this.parentGroup)return{width:t.reduce((u,b)=>Math.max(b.length,u),0)*i,height:i};const s={width:0,height:0},n=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",i),o=n.node()?.getScreenCTM?.(),l=a(u=>u&&u>0?u:1,"toScale"),p=l(o?.a),d=l(o?.d);for(const u of t){const b=Ti(n,1,u),A=b?b.width/p:u.length*i,m=b?b.height/d:i;s.width=Math.max(s.width,A),s.height=Math.max(s.height,m)}return n.remove(),s}},a(Q,"TextDimensionCalculatorWithFont"),Q),Yt=.7,Ht=.2,Z,qt=(Z=class{constructor(t,i,s,n){this.axisConfig=t,this.title=i,this.textDimensionCalculator=s,this.axisThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.normalizedLabelRotationInRad=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.normalizedLabelRotationInRad=this.axisConfig.labelRotation>=-90&&this.axisConfig.labelRotation<=90?this.axisConfig.labelRotation*Math.PI/180:0}setRange(t){this.range=t,this.axisPosition==="left"||this.axisPosition==="right"?this.boundingRect.height=t[1]-t[0]:this.boundingRect.width=t[1]-t[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(t){this.axisPosition=t,this.setRange(this.range)}getTickDistance(){const t=this.getRange();return Math.abs(t[0]-t[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(t=>t.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){Yt*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(Yt*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(t){let i=t.height;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const s=this.getLabelDimension(),n=Ht*t.width;this.outerPadding=Math.min(s.width/2,n);let o=s.height;this.axisPosition==="bottom"&&this.normalizedLabelRotationInRad!==0&&(o=Math.max(o,Math.abs(Math.sin(this.normalizedLabelRotationInRad)*s.width)+Math.abs(Math.cos(this.normalizedLabelRotationInRad)*s.height))),o+=this.axisConfig.labelPadding*2,this.labelTextHeight=s.height,o<=i&&(i-=o,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=s.height+this.axisConfig.titlePadding*2;this.titleTextHeight=s.height,n<=i&&(i-=n,this.showTitle=!0)}this.boundingRect.width=t.width,this.boundingRect.height=t.height-i}calculateSpaceIfDrawnVertical(t){let i=t.width;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const s=this.getLabelDimension(),n=Ht*t.height;this.outerPadding=Math.min(s.height/2,n);const o=s.width+this.axisConfig.labelPadding*2;o<=i&&(i-=o,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const s=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),n=s.height+this.axisConfig.titlePadding*2;this.titleTextHeight=s.height,n<=i&&(i-=n,this.showTitle=!0)}this.boundingRect.width=t.width-i,this.boundingRect.height=t.height}calculateSpace(t){return this.axisPosition==="left"||this.axisPosition==="right"?this.calculateSpaceIfDrawnVertical(t):this.calculateSpaceIfDrawnHorizontally(t),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateOffsetByRotation(t){const i=this.normalizedLabelRotationInRad;return i===0?0:Math.sin(i)*this.getLabelDimension()[t]/2}getDrawableElementsForLeftAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${i},${this.boundingRect.y} L ${i},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(i),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))}),this.showTick){const i=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map(s=>({path:`M ${i},${this.getScaleValue(s)} L ${i-this.axisConfig.tickLength},${this.getScaleValue(s)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForBottomAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.y+this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.getScaleValue(i)+this.calculateOffsetByRotation("height"),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0)+Math.abs(this.calculateOffsetByRotation("width")),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:this.normalizedLabelRotationInRad*180/Math.PI,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const i=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map(s=>({path:`M ${this.getScaleValue(s)},${i} L ${this.getScaleValue(s)},${i+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForTopAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.getScaleValue(i),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const i=this.boundingRect.y;t.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(s=>({path:`M ${this.getScaleValue(s)},${i+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(s)},${i+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");return this.axisPosition==="bottom"?this.getDrawableElementsForBottomAxis():this.axisPosition==="top"?this.getDrawableElementsForTopAxis():[]}},a(Z,"BaseAxis"),Z),J,Ei=(J=class extends qt{constructor(t,i,s,n,o){super(t,n,o,i),this.categories=s,this.scale=St().domain(this.categories).range(this.getRange())}setRange(t){super.setRange(t)}recalculateScale(){this.scale=St().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),Ut.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(t){return this.scale(t)??this.getRange()[0]}},a(J,"BandAxis"),J),tt,Mi=(tt=class extends qt{constructor(t,i,s,n,o){super(t,n,o,i),this.domain=s,this.scale=Nt().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const t=[...this.domain];this.axisPosition==="left"&&t.reverse(),this.scale=Nt().domain(t).range(this.getRange())}getScaleValue(t){return this.scale(t)}},a(tt,"LinearAxis"),tt);function _t(e,t,i,s){const n=new Pt(s);return mt(e)?new Ei(t,i,e.categories,e.title,n):new Mi(t,i,[e.min,e.max],e.title,n)}a(_t,"getAxis");var it,Ii=(it=class{constructor(t,i,s,n){this.textDimensionCalculator=t,this.chartConfig=i,this.chartData=s,this.chartThemeConfig=n,this.titleWidth=0,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){const i=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),s=Math.max(i.width,t.width),n=i.height+2*this.chartConfig.titlePadding;return n<=t.height&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=s,this.boundingRect.height=n,this.titleWidth=i.width,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}alignTo(t,i){const s=Math.min(this.titleWidth,this.chartConfig.width)/2,n=Math.min(Math.max((t+i)/2,s),this.chartConfig.width-s);this.boundingRect.x=n-s,this.boundingRect.width=s*2}getDrawableElements(){const t=[];return this.showChartTitle&&t.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),t}},a(it,"ChartTitle"),it);function jt(e,t,i,s){const n=new Pt(s);return new Ii(n,e,t,i)}a(jt,"getChartTitleComponent");var zi=.75,Bi=.5,Oi=.35;function kt(e){return{fontSize:e,markerSize:e*zi,markerSpacing:e*Oi,itemSpacing:e*Bi}}a(kt,"getLegendLayout");var et,Vi=(et=class{constructor(t,i,s,n){this.textDimensionCalculator=t,this.chartConfig=i,this.chartData=s,this.chartThemeConfig=n,this.boundingRect={x:0,y:0,width:0,height:0},this.visiblePlots=[]}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){if(this.visiblePlots=this.chartConfig.showLegend?this.chartData.plots.filter(u=>u.title):[],this.visiblePlots.length===0)return this.boundingRect.width=0,this.boundingRect.height=0,{width:0,height:0};const{fontSize:i,markerSize:s,markerSpacing:n,itemSpacing:o}=kt(this.chartConfig.legendFontSize),l=this.textDimensionCalculator.getMaxDimension(this.visiblePlots.map(u=>u.title),i),p=this.chartConfig.legendPadding*2+s+n+l.width,d=this.chartConfig.legendPadding*2+this.visiblePlots.length*i+(this.visiblePlots.length-1)*o;return p<=t.width&&d<=t.height?(this.boundingRect.width=p,this.boundingRect.height=d):(this.visiblePlots=[],this.boundingRect.width=0,this.boundingRect.height=0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(this.visiblePlots.length===0)return[];const{fontSize:t,markerSize:i,markerSpacing:s,itemSpacing:n}=kt(this.chartConfig.legendFontSize),o=t+n,l=this.boundingRect.x+this.chartConfig.legendPadding,p=this.boundingRect.y+this.chartConfig.legendPadding,d=[],u=[];for(const[b,A]of this.visiblePlots.entries())if(pt(A))d.push({x:l,y:p+b*o,width:i,height:i,fill:A.fill,strokeFill:A.fill,strokeWidth:0});else{const m=p+b*o+i/2;u.push({path:`M ${l},${m} L ${l+i},${m}`,strokeFill:A.strokeFill,strokeWidth:A.strokeWidth})}return[{groupTexts:["legend","markers"],type:"rect",data:d},{groupTexts:["legend","markers"],type:"path",data:u},{groupTexts:["legend","label"],type:"text",data:this.visiblePlots.map((b,A)=>({text:b.title,x:l+i+s,y:p+A*o+i/2,fill:this.chartThemeConfig.legendTextColor,fontSize:t,rotation:0,verticalPos:"middle",horizontalPos:"left"}))}]}},a(et,"ChartLegend"),et);function Kt(e,t,i,s){const n=new Pt(s);return new Vi(n,e,t,i)}a(Kt,"getChartLegendComponent");var st,Wi=(st=class{constructor(t,i,s,n,o){this.plotData=t,this.xAxis=i,this.yAxis=s,this.orientation=n,this.plotIndex=o}getDrawableElement(){const t=this.plotData.data.map(n=>[this.xAxis.getScaleValue(n[0]),this.yAxis.getScaleValue(n[1])]);let i;if(this.orientation==="horizontal"?i=Xt().y(n=>n[0]).x(n=>n[1])(t):i=Xt().x(n=>n[0]).y(n=>n[1])(t),!i)return[];const s=[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:i,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}];if(this.plotData.pointLabels&&this.plotData.pointLabels.length>0){const l=[];for(const[p,[d,u]]of t.entries()){const b=this.plotData.pointLabels[p];b&&(this.orientation==="horizontal"?l.push({x:u+10,y:d,text:b,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"left",fontSize:12,rotation:0}):l.push({x:d,y:u-10,text:b,fill:this.plotData.strokeFill,verticalPos:"middle",horizontalPos:"center",fontSize:12,rotation:0}))}l.length>0&&s.push({groupTexts:["plot",`line-plot-${this.plotIndex}`,"labels"],type:"text",data:l})}return s}},a(st,"LinePlot"),st),nt,Fi=(nt=class{constructor(t,i,s,n,o,l){this.barData=t,this.boundingRect=i,this.xAxis=s,this.yAxis=n,this.orientation=o,this.plotIndex=l}getDrawableElement(){const t=this.barData.data.map(o=>[this.xAxis.getScaleValue(o[0]),this.yAxis.getScaleValue(o[1])]),s=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*(1-.05),n=s/2;return this.orientation==="horizontal"?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(o=>({x:this.boundingRect.x,y:o[0]-n,height:s,width:o[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(o=>({x:o[0]-n,y:o[1],width:s,height:this.boundingRect.y+this.boundingRect.height-o[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},a(nt,"BarPlot"),nt),at,Xi=(at=class{constructor(t,i,s){this.chartConfig=t,this.chartData=i,this.chartThemeConfig=s,this.boundingRect={x:0,y:0,width:0,height:0}}setAxes(t,i){this.xAxis=t,this.yAxis=i}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){return this.boundingRect.width=t.width,this.boundingRect.height=t.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error("Axes must be passed to render Plots");const t=[];for(const[i,s]of this.chartData.plots.entries())switch(s.type){case"line":{const n=new Wi(s,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...n.getDrawableElement())}break;case"bar":{const n=new Fi(s,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...n.getDrawableElement())}break}return t}},a(at,"BasePlot"),at);function Qt(e,t,i){return new Xi(e,t,i)}a(Qt,"getPlotComponent");var ot,Ni=(ot=class{constructor(t,i,s,n){this.chartConfig=t,this.chartData=i,this.componentStore={title:jt(t,i,s,n),plot:Qt(t,i,s),legend:Kt(t,i,s,n),xAxis:_t(i.xAxis,t.xAxis,{titleColor:s.xAxisTitleColor,labelColor:s.xAxisLabelColor,tickColor:s.xAxisTickColor,axisLineColor:s.xAxisLineColor},n),yAxis:_t(i.yAxis,t.yAxis,{titleColor:s.yAxisTitleColor,labelColor:s.yAxisLabelColor,tickColor:s.yAxisTickColor,axisLineColor:s.yAxisLineColor},n)}}calculateVerticalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,s=0,n=0,o={width:0,height:0},l=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),p=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),d=this.componentStore.plot.calculateSpace({width:l,height:p});t-=d.width,i-=d.height,d=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),n=d.height,i-=d.height,this.componentStore.xAxis.setAxisPosition("bottom"),d=this.componentStore.xAxis.calculateSpace({width:t,height:i}),i-=d.height,this.componentStore.yAxis.setAxisPosition("left"),d=this.componentStore.yAxis.calculateSpace({width:t,height:i}),s=d.width,t-=d.width,o=this.componentStore.legend.calculateSpace({width:t,height:p}),t-=o.width,t>0&&(l+=t,t=0),i>0&&(p+=i,i=0),this.componentStore.plot.calculateSpace({width:l,height:p}),this.componentStore.plot.setBoundingBoxXY({x:s,y:n}),this.componentStore.title.alignTo(s,s+l),this.componentStore.legend.setBoundingBoxXY({x:s+l,y:n+Math.max((p-o.height)/2,0)}),this.componentStore.xAxis.setRange([s,s+l]),this.componentStore.xAxis.setBoundingBoxXY({x:s,y:n+p}),this.componentStore.yAxis.setRange([n,n+p]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:n}),this.chartData.plots.some(u=>pt(u))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,s=0,n=0,o=0,l={width:0,height:0},p=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),d=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),u=this.componentStore.plot.calculateSpace({width:p,height:d});t-=u.width,i-=u.height,u=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),s=u.height,i-=u.height,this.componentStore.xAxis.setAxisPosition("left"),u=this.componentStore.xAxis.calculateSpace({width:t,height:i}),t-=u.width,n=u.width,this.componentStore.yAxis.setAxisPosition("top"),u=this.componentStore.yAxis.calculateSpace({width:t,height:i}),i-=u.height,o=s+u.height,l=this.componentStore.legend.calculateSpace({width:t,height:d}),t-=l.width,t>0&&(p+=t,t=0),i>0&&(d+=i,i=0),this.componentStore.plot.calculateSpace({width:p,height:d}),this.componentStore.plot.setBoundingBoxXY({x:n,y:o}),this.componentStore.title.alignTo(n,n+p),this.componentStore.legend.setBoundingBoxXY({x:n+p,y:o+Math.max((d-l.height)/2,0)}),this.componentStore.yAxis.setRange([n,n+p]),this.componentStore.yAxis.setBoundingBoxXY({x:n,y:s}),this.componentStore.xAxis.setRange([o,o+d]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:o}),this.chartData.plots.some(b=>pt(b))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){this.chartConfig.chartOrientation==="horizontal"?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();const t=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(const i of Object.values(this.componentStore))t.push(...i.getDrawableElements());return t}},a(ot,"Orchestrator"),ot),ht,Yi=(ht=class{static build(t,i,s,n){return new Ni(t,i,s,n).getDrawableElement()}},a(ht,"XYChartBuilder"),ht),ct=0,Zt,gt=Et(),ut=Lt(),C=Mt(),Tt=ut.plotColorPalette.split(",").map(e=>e.trim()),yt=!1,vt=!1;function Lt(){const e=ki(),t=Dt();return Gt(e.xyChart,t.themeVariables.xyChart)}a(Lt,"getChartDefaultThemeConfig");function Et(){const e=Dt();return Gt(_i.xyChart,e.xyChart)}a(Et,"getChartDefaultConfig");function Mt(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}a(Mt,"getChartDefaultData");function G(e){const t=Dt();return Ri(e.trim(),t)}a(G,"textSanitizer");function Jt(e){Zt=e}a(Jt,"setTmpSVGG");function ti(e){e==="horizontal"?gt.chartOrientation="horizontal":gt.chartOrientation="vertical"}a(ti,"setOrientation");function ii(e){C.xAxis.title=G(e.text)}a(ii,"setXAxisTitle");function It(e,t){C.xAxis={type:"linear",title:C.xAxis.title,min:e,max:t},yt=!0}a(It,"setXAxisRangeData");function ei(e){C.xAxis={type:"band",title:C.xAxis.title,categories:e.map(t=>G(t.text))},yt=!0}a(ei,"setXAxisBand");function si(e){C.yAxis.title=G(e.text)}a(si,"setYAxisTitle");function ni(e,t){C.yAxis={type:"linear",title:C.yAxis.title,min:e,max:t},vt=!0}a(ni,"setYAxisRangeData");function ai(e){const t=Math.min(...e),i=Math.max(...e),s=K(C.yAxis)?C.yAxis.min:1/0,n=K(C.yAxis)?C.yAxis.max:-1/0;C.yAxis={type:"linear",title:C.yAxis.title,min:Math.min(s,t),max:Math.max(n,i)}}a(ai,"setYAxisRangeFromPlotData");function zt(e){let t=[];if(e.length===0)return t;if(!yt){const i=K(C.xAxis)?C.xAxis.min:1/0,s=K(C.xAxis)?C.xAxis.max:-1/0;It(Math.min(i,1),Math.max(s,e.length))}if(mt(C.xAxis)&&e.length>C.xAxis.categories.length&&(e=e.slice(0,C.xAxis.categories.length)),vt||ai(e),mt(C.xAxis)&&(t=C.xAxis.categories.map((i,s)=>[i,e[s]])),K(C.xAxis)){const i=C.xAxis.min,s=C.xAxis.max;if(e.length===1)t=[[`${i}`,e[0]]];else{const n=(s-i)/(e.length-1);t=e.map((o,l)=>[`${i+l*n}`,o])}}return t}a(zt,"transformDataWithoutCategory");function Bt(e){return Tt[e===0?0:e%Tt.length]}a(Bt,"getPlotColorFromPalette");function oi(e,t){const i=t.map(l=>l.value),s=t.map(l=>l.label?G(l.label):""),n=zt(i),o=s.some(l=>l!=="");C.plots.push({type:"line",title:G(e.text),strokeFill:Bt(ct),strokeWidth:2,data:n,...o?{pointLabels:s}:{}}),ct++}a(oi,"setLineData");function hi(e,t){const i=t.map(n=>n.value),s=zt(i);C.plots.push({type:"bar",title:G(e.text),fill:Bt(ct),data:s}),ct++}a(hi,"setBarData");function ri(){if(C.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return C.title=$t(),Yi.build(gt,C,ut,Zt)}a(ri,"getDrawableElem");function li(){return ut}a(li,"getChartThemeConfig");function ci(){return gt}a(ci,"getChartConfig");function gi(){return C}a(gi,"getXYChartData");var Hi=a(function(){Si(),ct=0,gt=Et(),C=Mt(),ut=Lt(),Tt=ut.plotColorPalette.split(",").map(e=>e.trim()),yt=!1,vt=!1},"clear"),$i={getDrawableElem:ri,clear:Hi,setAccTitle:wi,getAccTitle:bi,setDiagramTitle:yi,getDiagramTitle:$t,getAccDescription:mi,setAccDescription:pi,setOrientation:ti,setXAxisTitle:ii,setXAxisRangeData:It,setXAxisBand:ei,setYAxisTitle:si,setYAxisRangeData:ni,setLineData:oi,setBarData:hi,setTmpSVGG:Jt,getChartThemeConfig:li,getChartConfig:ci,getXYChartData:gi},Ui=a((e,t,i,s)=>{const n=s.db,o=n.getChartThemeConfig(),l=n.getChartConfig(),p=n.getXYChartData().plots[0].data.map(w=>w[1]);function d(w){return w==="top"?"text-before-edge":"middle"}a(d,"getDominantBaseLine");function u(w){return w==="left"?"start":w==="right"?"end":"middle"}a(u,"getTextAnchor");function b(w){return`translate(${w.x}, ${w.y}) rotate(${w.rotation||0})`}a(b,"getTextTransformation"),Ut.debug(`Rendering xychart chart
7
+ `+e);const A=Ai(t),m=A.append("g").attr("class","main"),E=m.append("rect").attr("width",l.width).attr("height",l.height).attr("class","background");Ci(A,l.height,l.width,!0),A.attr("viewBox",`0 0 ${l.width} ${l.height}`),E.attr("fill",o.backgroundColor),n.setTmpSVGG(A.append("g").attr("class","mermaid-tmp-group"));const v=n.getDrawableElem(),L={};function M(w){let D=m,c="";for(const[B]of w.entries()){let W=m;B>0&&L[c]&&(W=L[c]),c+=w[B],D=L[c],D||(D=L[c]=W.append("g").attr("class",w[B]))}return D}a(M,"getGroup");for(const w of v){if(w.data.length===0)continue;const D=M(w.groupTexts);switch(w.type){case"rect":if(D.selectAll("rect").data(w.data).enter().append("rect").attr("x",c=>c.x).attr("y",c=>c.y).attr("width",c=>c.width).attr("height",c=>c.height).attr("fill",c=>c.fill).attr("stroke",c=>c.strokeFill).attr("stroke-width",c=>c.strokeWidth),l.showDataLabel){const c=l.showDataLabelOutsideBar;if(l.chartOrientation==="horizontal"){let B=function(R,O){const{data:T,label:rt}=R;return O*rt.length*W<=T.width-X};a(B,"fitsHorizontally");const W=.7,X=10,N=w.data.map((R,O)=>({data:R,label:p[O].toString()})).filter(R=>R.data.width>0&&R.data.height>0),k=N.map(R=>{const{data:O}=R;let T=O.height*.7;for(;!B(R,T)&&T>0;)T-=1;return T}),H=Math.floor(Math.min(...k)),S=a(R=>c?R.data.x+R.data.width+X:R.data.x+R.data.width-X,"determineLabelXPosition");D.selectAll("text").data(N).enter().append("text").attr("x",S).attr("y",R=>R.data.y+R.data.height/2).attr("text-anchor",c?"start":"end").attr("dominant-baseline","middle").attr("fill",o.dataLabelColor).attr("font-size",`${H}px`).text(R=>R.label)}else{let B=function(S,R,O){const{data:T,label:rt}=S,F=R*rt.length*.7,r=T.x+T.width/2,g=r-F/2,x=r+F/2,f=g>=T.x&&x<=T.x+T.width,_=T.y+O+R<=T.y+T.height;return f&&_};a(B,"fitsInBar");const W=10,X=w.data.map((S,R)=>({data:S,label:p[R].toString()})).filter(S=>S.data.width>0&&S.data.height>0),N=X.map(S=>{const{data:R,label:O}=S;let T=R.width/(O.length*.7);for(;!B(S,T,W)&&T>0;)T-=1;return T}),k=Math.floor(Math.min(...N)),H=a(S=>c?S.data.y-W:S.data.y+W,"determineLabelYPosition");D.selectAll("text").data(X).enter().append("text").attr("x",S=>S.data.x+S.data.width/2).attr("y",H).attr("text-anchor","middle").attr("dominant-baseline",c?"auto":"hanging").attr("fill",o.dataLabelColor).attr("font-size",`${k}px`).text(S=>S.label)}}break;case"text":D.selectAll("text").data(w.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",c=>c.fill).attr("font-size",c=>c.fontSize).attr("dominant-baseline",c=>d(c.verticalPos)).attr("text-anchor",c=>u(c.horizontalPos)).attr("transform",c=>b(c)).text(c=>c.text);break;case"path":D.selectAll("path").data(w.data).enter().append("path").attr("d",c=>c.path).attr("fill",c=>c.fill?c.fill:"none").attr("stroke",c=>c.strokeFill).attr("stroke-width",c=>c.strokeWidth);break}}},"draw"),Gi={draw:Ui},Zi={parser:Li,db:$i,renderer:Gi};export{Zi as diagram};