@ibiz-template-plugin/ibiz-file-previewer 0.0.21 → 0.0.23

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 (535) hide show
  1. package/dist/index.es.js +559 -63
  2. package/dist/index.legacy.js +1 -1
  3. package/dist/style.css +1 -1
  4. package/dist/types/src/const/type.d.ts +1 -0
  5. package/dist/types/src/util/index.d.ts +1 -0
  6. package/dist/types/src/util/static-resource.d.ts +28 -0
  7. package/dist/vditor/dist/css/content-theme/ant-design.css +210 -0
  8. package/dist/vditor/dist/css/content-theme/dark.css +123 -0
  9. package/dist/vditor/dist/css/content-theme/light.css +101 -0
  10. package/dist/vditor/dist/css/content-theme/wechat.css +94 -0
  11. package/dist/vditor/dist/images/emoji/b3log.png +0 -0
  12. package/dist/vditor/dist/images/emoji/chainbook.png +0 -0
  13. package/dist/vditor/dist/images/emoji/doge.png +0 -0
  14. package/dist/vditor/dist/images/emoji/hacpai.png +0 -0
  15. package/dist/vditor/dist/images/emoji/huaji.gif +0 -0
  16. package/dist/vditor/dist/images/emoji/latke.png +0 -0
  17. package/dist/vditor/dist/images/emoji/liandi.png +0 -0
  18. package/dist/vditor/dist/images/emoji/lute.png +0 -0
  19. package/dist/vditor/dist/images/emoji/octocat.png +0 -0
  20. package/dist/vditor/dist/images/emoji/pipe.png +0 -0
  21. package/dist/vditor/dist/images/emoji/siyuan.png +0 -0
  22. package/dist/vditor/dist/images/emoji/solo.png +0 -0
  23. package/dist/vditor/dist/images/emoji/sym.png +0 -0
  24. package/dist/vditor/dist/images/emoji/trollface.png +0 -0
  25. package/dist/vditor/dist/images/emoji/vditor.png +0 -0
  26. package/dist/vditor/dist/images/emoji/wide.png +0 -0
  27. package/dist/vditor/dist/images/emoji/wulian.png +0 -0
  28. package/dist/vditor/dist/images/img-loading.svg +1 -0
  29. package/dist/vditor/dist/images/logo.png +0 -0
  30. package/dist/vditor/dist/index.css +1823 -0
  31. package/dist/vditor/dist/index.d.ts +82 -0
  32. package/dist/vditor/dist/index.js +15995 -0
  33. package/dist/vditor/dist/index.min.js +1 -0
  34. package/dist/vditor/dist/js/abcjs/abcjs_basic.min.js +3 -0
  35. package/dist/vditor/dist/js/echarts/echarts.min.js +45 -0
  36. package/dist/vditor/dist/js/flowchart.js/flowchart.min.js +8 -0
  37. package/dist/vditor/dist/js/graphviz/full.render.js +90 -0
  38. package/dist/vditor/dist/js/graphviz/viz.js +333 -0
  39. package/dist/vditor/dist/js/highlight.js/LICENSE +29 -0
  40. package/dist/vditor/dist/js/highlight.js/highlight.min.js +3835 -0
  41. package/dist/vditor/dist/js/highlight.js/styles/a11y-dark.min.css +7 -0
  42. package/dist/vditor/dist/js/highlight.js/styles/a11y-light.min.css +7 -0
  43. package/dist/vditor/dist/js/highlight.js/styles/agate.min.css +20 -0
  44. package/dist/vditor/dist/js/highlight.js/styles/an-old-hope.min.css +9 -0
  45. package/dist/vditor/dist/js/highlight.js/styles/androidstudio.min.css +1 -0
  46. package/dist/vditor/dist/js/highlight.js/styles/ant-design.min.css +84 -0
  47. package/dist/vditor/dist/js/highlight.js/styles/arduino-light.min.css +1 -0
  48. package/dist/vditor/dist/js/highlight.js/styles/arta.min.css +1 -0
  49. package/dist/vditor/dist/js/highlight.js/styles/ascetic.min.css +1 -0
  50. package/dist/vditor/dist/js/highlight.js/styles/atom-one-dark-reasonable.min.css +1 -0
  51. package/dist/vditor/dist/js/highlight.js/styles/atom-one-dark.min.css +1 -0
  52. package/dist/vditor/dist/js/highlight.js/styles/atom-one-light.min.css +1 -0
  53. package/dist/vditor/dist/js/highlight.js/styles/base16/3024.min.css +7 -0
  54. package/dist/vditor/dist/js/highlight.js/styles/base16/apathy.min.css +7 -0
  55. package/dist/vditor/dist/js/highlight.js/styles/base16/apprentice.min.css +7 -0
  56. package/dist/vditor/dist/js/highlight.js/styles/base16/ashes.min.css +7 -0
  57. package/dist/vditor/dist/js/highlight.js/styles/base16/atelier-cave-light.min.css +7 -0
  58. package/dist/vditor/dist/js/highlight.js/styles/base16/atelier-cave.min.css +7 -0
  59. package/dist/vditor/dist/js/highlight.js/styles/base16/atelier-dune-light.min.css +7 -0
  60. package/dist/vditor/dist/js/highlight.js/styles/base16/atelier-dune.min.css +7 -0
  61. package/dist/vditor/dist/js/highlight.js/styles/base16/atelier-estuary-light.min.css +7 -0
  62. package/dist/vditor/dist/js/highlight.js/styles/base16/atelier-estuary.min.css +7 -0
  63. package/dist/vditor/dist/js/highlight.js/styles/base16/atelier-forest-light.min.css +7 -0
  64. package/dist/vditor/dist/js/highlight.js/styles/base16/atelier-forest.min.css +7 -0
  65. package/dist/vditor/dist/js/highlight.js/styles/base16/atelier-heath-light.min.css +7 -0
  66. package/dist/vditor/dist/js/highlight.js/styles/base16/atelier-heath.min.css +7 -0
  67. package/dist/vditor/dist/js/highlight.js/styles/base16/atelier-lakeside-light.min.css +7 -0
  68. package/dist/vditor/dist/js/highlight.js/styles/base16/atelier-lakeside.min.css +7 -0
  69. package/dist/vditor/dist/js/highlight.js/styles/base16/atelier-plateau-light.min.css +7 -0
  70. package/dist/vditor/dist/js/highlight.js/styles/base16/atelier-plateau.min.css +7 -0
  71. package/dist/vditor/dist/js/highlight.js/styles/base16/atelier-savanna-light.min.css +7 -0
  72. package/dist/vditor/dist/js/highlight.js/styles/base16/atelier-savanna.min.css +7 -0
  73. package/dist/vditor/dist/js/highlight.js/styles/base16/atelier-seaside-light.min.css +7 -0
  74. package/dist/vditor/dist/js/highlight.js/styles/base16/atelier-seaside.min.css +7 -0
  75. package/dist/vditor/dist/js/highlight.js/styles/base16/atelier-sulphurpool-light.min.css +7 -0
  76. package/dist/vditor/dist/js/highlight.js/styles/base16/atelier-sulphurpool.min.css +7 -0
  77. package/dist/vditor/dist/js/highlight.js/styles/base16/atlas.min.css +7 -0
  78. package/dist/vditor/dist/js/highlight.js/styles/base16/bespin.min.css +7 -0
  79. package/dist/vditor/dist/js/highlight.js/styles/base16/black-metal-bathory.min.css +7 -0
  80. package/dist/vditor/dist/js/highlight.js/styles/base16/black-metal-burzum.min.css +7 -0
  81. package/dist/vditor/dist/js/highlight.js/styles/base16/black-metal-dark-funeral.min.css +7 -0
  82. package/dist/vditor/dist/js/highlight.js/styles/base16/black-metal-gorgoroth.min.css +7 -0
  83. package/dist/vditor/dist/js/highlight.js/styles/base16/black-metal-immortal.min.css +7 -0
  84. package/dist/vditor/dist/js/highlight.js/styles/base16/black-metal-khold.min.css +7 -0
  85. package/dist/vditor/dist/js/highlight.js/styles/base16/black-metal-marduk.min.css +7 -0
  86. package/dist/vditor/dist/js/highlight.js/styles/base16/black-metal-mayhem.min.css +7 -0
  87. package/dist/vditor/dist/js/highlight.js/styles/base16/black-metal-nile.min.css +7 -0
  88. package/dist/vditor/dist/js/highlight.js/styles/base16/black-metal-venom.min.css +7 -0
  89. package/dist/vditor/dist/js/highlight.js/styles/base16/black-metal.min.css +7 -0
  90. package/dist/vditor/dist/js/highlight.js/styles/base16/brewer.min.css +7 -0
  91. package/dist/vditor/dist/js/highlight.js/styles/base16/bright.min.css +7 -0
  92. package/dist/vditor/dist/js/highlight.js/styles/base16/brogrammer.min.css +7 -0
  93. package/dist/vditor/dist/js/highlight.js/styles/base16/brush-trees-dark.min.css +7 -0
  94. package/dist/vditor/dist/js/highlight.js/styles/base16/brush-trees.min.css +7 -0
  95. package/dist/vditor/dist/js/highlight.js/styles/base16/chalk.min.css +7 -0
  96. package/dist/vditor/dist/js/highlight.js/styles/base16/circus.min.css +7 -0
  97. package/dist/vditor/dist/js/highlight.js/styles/base16/classic-dark.min.css +7 -0
  98. package/dist/vditor/dist/js/highlight.js/styles/base16/classic-light.min.css +7 -0
  99. package/dist/vditor/dist/js/highlight.js/styles/base16/codeschool.min.css +7 -0
  100. package/dist/vditor/dist/js/highlight.js/styles/base16/colors.min.css +7 -0
  101. package/dist/vditor/dist/js/highlight.js/styles/base16/cupcake.min.css +7 -0
  102. package/dist/vditor/dist/js/highlight.js/styles/base16/cupertino.min.css +7 -0
  103. package/dist/vditor/dist/js/highlight.js/styles/base16/danqing.min.css +7 -0
  104. package/dist/vditor/dist/js/highlight.js/styles/base16/darcula.min.css +7 -0
  105. package/dist/vditor/dist/js/highlight.js/styles/base16/dark-violet.min.css +7 -0
  106. package/dist/vditor/dist/js/highlight.js/styles/base16/darkmoss.min.css +7 -0
  107. package/dist/vditor/dist/js/highlight.js/styles/base16/darktooth.min.css +7 -0
  108. package/dist/vditor/dist/js/highlight.js/styles/base16/decaf.min.css +7 -0
  109. package/dist/vditor/dist/js/highlight.js/styles/base16/default-dark.min.css +7 -0
  110. package/dist/vditor/dist/js/highlight.js/styles/base16/default-light.min.css +7 -0
  111. package/dist/vditor/dist/js/highlight.js/styles/base16/dirtysea.min.css +7 -0
  112. package/dist/vditor/dist/js/highlight.js/styles/base16/dracula.min.css +7 -0
  113. package/dist/vditor/dist/js/highlight.js/styles/base16/edge-dark.min.css +7 -0
  114. package/dist/vditor/dist/js/highlight.js/styles/base16/edge-light.min.css +7 -0
  115. package/dist/vditor/dist/js/highlight.js/styles/base16/eighties.min.css +7 -0
  116. package/dist/vditor/dist/js/highlight.js/styles/base16/embers.min.css +7 -0
  117. package/dist/vditor/dist/js/highlight.js/styles/base16/equilibrium-dark.min.css +7 -0
  118. package/dist/vditor/dist/js/highlight.js/styles/base16/equilibrium-gray-dark.min.css +7 -0
  119. package/dist/vditor/dist/js/highlight.js/styles/base16/equilibrium-gray-light.min.css +7 -0
  120. package/dist/vditor/dist/js/highlight.js/styles/base16/equilibrium-light.min.css +7 -0
  121. package/dist/vditor/dist/js/highlight.js/styles/base16/espresso.min.css +7 -0
  122. package/dist/vditor/dist/js/highlight.js/styles/base16/eva-dim.min.css +7 -0
  123. package/dist/vditor/dist/js/highlight.js/styles/base16/eva.min.css +7 -0
  124. package/dist/vditor/dist/js/highlight.js/styles/base16/flat.min.css +7 -0
  125. package/dist/vditor/dist/js/highlight.js/styles/base16/framer.min.css +7 -0
  126. package/dist/vditor/dist/js/highlight.js/styles/base16/fruit-soda.min.css +7 -0
  127. package/dist/vditor/dist/js/highlight.js/styles/base16/gigavolt.min.css +7 -0
  128. package/dist/vditor/dist/js/highlight.js/styles/base16/github.min.css +7 -0
  129. package/dist/vditor/dist/js/highlight.js/styles/base16/google-dark.min.css +7 -0
  130. package/dist/vditor/dist/js/highlight.js/styles/base16/google-light.min.css +7 -0
  131. package/dist/vditor/dist/js/highlight.js/styles/base16/grayscale-dark.min.css +7 -0
  132. package/dist/vditor/dist/js/highlight.js/styles/base16/grayscale-light.min.css +7 -0
  133. package/dist/vditor/dist/js/highlight.js/styles/base16/green-screen.min.css +7 -0
  134. package/dist/vditor/dist/js/highlight.js/styles/base16/gruvbox-dark-hard.min.css +7 -0
  135. package/dist/vditor/dist/js/highlight.js/styles/base16/gruvbox-dark-medium.min.css +7 -0
  136. package/dist/vditor/dist/js/highlight.js/styles/base16/gruvbox-dark-pale.min.css +7 -0
  137. package/dist/vditor/dist/js/highlight.js/styles/base16/gruvbox-dark-soft.min.css +7 -0
  138. package/dist/vditor/dist/js/highlight.js/styles/base16/gruvbox-light-hard.min.css +7 -0
  139. package/dist/vditor/dist/js/highlight.js/styles/base16/gruvbox-light-medium.min.css +7 -0
  140. package/dist/vditor/dist/js/highlight.js/styles/base16/gruvbox-light-soft.min.css +7 -0
  141. package/dist/vditor/dist/js/highlight.js/styles/base16/hardcore.min.css +7 -0
  142. package/dist/vditor/dist/js/highlight.js/styles/base16/harmonic16-dark.min.css +7 -0
  143. package/dist/vditor/dist/js/highlight.js/styles/base16/harmonic16-light.min.css +7 -0
  144. package/dist/vditor/dist/js/highlight.js/styles/base16/heetch-dark.min.css +7 -0
  145. package/dist/vditor/dist/js/highlight.js/styles/base16/heetch-light.min.css +7 -0
  146. package/dist/vditor/dist/js/highlight.js/styles/base16/helios.min.css +7 -0
  147. package/dist/vditor/dist/js/highlight.js/styles/base16/hopscotch.min.css +7 -0
  148. package/dist/vditor/dist/js/highlight.js/styles/base16/horizon-dark.min.css +7 -0
  149. package/dist/vditor/dist/js/highlight.js/styles/base16/horizon-light.min.css +7 -0
  150. package/dist/vditor/dist/js/highlight.js/styles/base16/humanoid-dark.min.css +7 -0
  151. package/dist/vditor/dist/js/highlight.js/styles/base16/humanoid-light.min.css +7 -0
  152. package/dist/vditor/dist/js/highlight.js/styles/base16/ia-dark.min.css +7 -0
  153. package/dist/vditor/dist/js/highlight.js/styles/base16/ia-light.min.css +7 -0
  154. package/dist/vditor/dist/js/highlight.js/styles/base16/icy-dark.min.css +7 -0
  155. package/dist/vditor/dist/js/highlight.js/styles/base16/ir-black.min.css +7 -0
  156. package/dist/vditor/dist/js/highlight.js/styles/base16/isotope.min.css +7 -0
  157. package/dist/vditor/dist/js/highlight.js/styles/base16/kimber.min.css +7 -0
  158. package/dist/vditor/dist/js/highlight.js/styles/base16/london-tube.min.css +7 -0
  159. package/dist/vditor/dist/js/highlight.js/styles/base16/macintosh.min.css +7 -0
  160. package/dist/vditor/dist/js/highlight.js/styles/base16/marrakesh.min.css +7 -0
  161. package/dist/vditor/dist/js/highlight.js/styles/base16/materia.min.css +7 -0
  162. package/dist/vditor/dist/js/highlight.js/styles/base16/material-darker.min.css +7 -0
  163. package/dist/vditor/dist/js/highlight.js/styles/base16/material-lighter.min.css +7 -0
  164. package/dist/vditor/dist/js/highlight.js/styles/base16/material-palenight.min.css +7 -0
  165. package/dist/vditor/dist/js/highlight.js/styles/base16/material-vivid.min.css +7 -0
  166. package/dist/vditor/dist/js/highlight.js/styles/base16/material.min.css +7 -0
  167. package/dist/vditor/dist/js/highlight.js/styles/base16/mellow-purple.min.css +7 -0
  168. package/dist/vditor/dist/js/highlight.js/styles/base16/mexico-light.min.css +7 -0
  169. package/dist/vditor/dist/js/highlight.js/styles/base16/mocha.min.css +7 -0
  170. package/dist/vditor/dist/js/highlight.js/styles/base16/monokai.min.css +7 -0
  171. package/dist/vditor/dist/js/highlight.js/styles/base16/nebula.min.css +7 -0
  172. package/dist/vditor/dist/js/highlight.js/styles/base16/nord.min.css +7 -0
  173. package/dist/vditor/dist/js/highlight.js/styles/base16/nova.min.css +7 -0
  174. package/dist/vditor/dist/js/highlight.js/styles/base16/ocean.min.css +7 -0
  175. package/dist/vditor/dist/js/highlight.js/styles/base16/oceanicnext.min.css +7 -0
  176. package/dist/vditor/dist/js/highlight.js/styles/base16/one-light.min.css +7 -0
  177. package/dist/vditor/dist/js/highlight.js/styles/base16/onedark.min.css +7 -0
  178. package/dist/vditor/dist/js/highlight.js/styles/base16/outrun-dark.min.css +7 -0
  179. package/dist/vditor/dist/js/highlight.js/styles/base16/papercolor-dark.min.css +7 -0
  180. package/dist/vditor/dist/js/highlight.js/styles/base16/papercolor-light.min.css +7 -0
  181. package/dist/vditor/dist/js/highlight.js/styles/base16/paraiso.min.css +7 -0
  182. package/dist/vditor/dist/js/highlight.js/styles/base16/pasque.min.css +7 -0
  183. package/dist/vditor/dist/js/highlight.js/styles/base16/phd.min.css +7 -0
  184. package/dist/vditor/dist/js/highlight.js/styles/base16/pico.min.css +7 -0
  185. package/dist/vditor/dist/js/highlight.js/styles/base16/pop.min.css +7 -0
  186. package/dist/vditor/dist/js/highlight.js/styles/base16/porple.min.css +7 -0
  187. package/dist/vditor/dist/js/highlight.js/styles/base16/qualia.min.css +7 -0
  188. package/dist/vditor/dist/js/highlight.js/styles/base16/railscasts.min.css +7 -0
  189. package/dist/vditor/dist/js/highlight.js/styles/base16/rebecca.min.css +7 -0
  190. package/dist/vditor/dist/js/highlight.js/styles/base16/ros-pine-dawn.min.css +7 -0
  191. package/dist/vditor/dist/js/highlight.js/styles/base16/ros-pine-moon.min.css +7 -0
  192. package/dist/vditor/dist/js/highlight.js/styles/base16/ros-pine.min.css +7 -0
  193. package/dist/vditor/dist/js/highlight.js/styles/base16/sagelight.min.css +7 -0
  194. package/dist/vditor/dist/js/highlight.js/styles/base16/sandcastle.min.css +7 -0
  195. package/dist/vditor/dist/js/highlight.js/styles/base16/seti-ui.min.css +7 -0
  196. package/dist/vditor/dist/js/highlight.js/styles/base16/shapeshifter.min.css +7 -0
  197. package/dist/vditor/dist/js/highlight.js/styles/base16/silk-dark.min.css +7 -0
  198. package/dist/vditor/dist/js/highlight.js/styles/base16/silk-light.min.css +7 -0
  199. package/dist/vditor/dist/js/highlight.js/styles/base16/snazzy.min.css +7 -0
  200. package/dist/vditor/dist/js/highlight.js/styles/base16/solar-flare-light.min.css +7 -0
  201. package/dist/vditor/dist/js/highlight.js/styles/base16/solar-flare.min.css +7 -0
  202. package/dist/vditor/dist/js/highlight.js/styles/base16/solarized-dark.min.css +7 -0
  203. package/dist/vditor/dist/js/highlight.js/styles/base16/solarized-light.min.css +7 -0
  204. package/dist/vditor/dist/js/highlight.js/styles/base16/spacemacs.min.css +7 -0
  205. package/dist/vditor/dist/js/highlight.js/styles/base16/summercamp.min.css +7 -0
  206. package/dist/vditor/dist/js/highlight.js/styles/base16/summerfruit-dark.min.css +7 -0
  207. package/dist/vditor/dist/js/highlight.js/styles/base16/summerfruit-light.min.css +7 -0
  208. package/dist/vditor/dist/js/highlight.js/styles/base16/synth-midnight-terminal-dark.min.css +7 -0
  209. package/dist/vditor/dist/js/highlight.js/styles/base16/synth-midnight-terminal-light.min.css +7 -0
  210. package/dist/vditor/dist/js/highlight.js/styles/base16/tango.min.css +7 -0
  211. package/dist/vditor/dist/js/highlight.js/styles/base16/tender.min.css +7 -0
  212. package/dist/vditor/dist/js/highlight.js/styles/base16/tomorrow-night.min.css +7 -0
  213. package/dist/vditor/dist/js/highlight.js/styles/base16/tomorrow.min.css +7 -0
  214. package/dist/vditor/dist/js/highlight.js/styles/base16/twilight.min.css +7 -0
  215. package/dist/vditor/dist/js/highlight.js/styles/base16/unikitty-dark.min.css +7 -0
  216. package/dist/vditor/dist/js/highlight.js/styles/base16/unikitty-light.min.css +7 -0
  217. package/dist/vditor/dist/js/highlight.js/styles/base16/vulcan.min.css +7 -0
  218. package/dist/vditor/dist/js/highlight.js/styles/base16/windows-10-light.min.css +7 -0
  219. package/dist/vditor/dist/js/highlight.js/styles/base16/windows-10.min.css +7 -0
  220. package/dist/vditor/dist/js/highlight.js/styles/base16/windows-95-light.min.css +7 -0
  221. package/dist/vditor/dist/js/highlight.js/styles/base16/windows-95.min.css +7 -0
  222. package/dist/vditor/dist/js/highlight.js/styles/base16/windows-high-contrast-light.min.css +7 -0
  223. package/dist/vditor/dist/js/highlight.js/styles/base16/windows-high-contrast.min.css +7 -0
  224. package/dist/vditor/dist/js/highlight.js/styles/base16/windows-nt-light.min.css +7 -0
  225. package/dist/vditor/dist/js/highlight.js/styles/base16/windows-nt.min.css +7 -0
  226. package/dist/vditor/dist/js/highlight.js/styles/base16/woodland.min.css +7 -0
  227. package/dist/vditor/dist/js/highlight.js/styles/base16/xcode-dusk.min.css +7 -0
  228. package/dist/vditor/dist/js/highlight.js/styles/base16/zenburn.min.css +7 -0
  229. package/dist/vditor/dist/js/highlight.js/styles/brown-paper.min.css +1 -0
  230. package/dist/vditor/dist/js/highlight.js/styles/brown-papersq.png +0 -0
  231. package/dist/vditor/dist/js/highlight.js/styles/codepen-embed.min.css +1 -0
  232. package/dist/vditor/dist/js/highlight.js/styles/color-brewer.min.css +1 -0
  233. package/dist/vditor/dist/js/highlight.js/styles/dark.min.css +1 -0
  234. package/dist/vditor/dist/js/highlight.js/styles/default.min.css +9 -0
  235. package/dist/vditor/dist/js/highlight.js/styles/devibeans.min.css +7 -0
  236. package/dist/vditor/dist/js/highlight.js/styles/docco.min.css +1 -0
  237. package/dist/vditor/dist/js/highlight.js/styles/far.min.css +1 -0
  238. package/dist/vditor/dist/js/highlight.js/styles/felipec.min.css +7 -0
  239. package/dist/vditor/dist/js/highlight.js/styles/foundation.min.css +1 -0
  240. package/dist/vditor/dist/js/highlight.js/styles/github-dark-dimmed.min.css +9 -0
  241. package/dist/vditor/dist/js/highlight.js/styles/github-dark.min.css +10 -0
  242. package/dist/vditor/dist/js/highlight.js/styles/github.min.css +10 -0
  243. package/dist/vditor/dist/js/highlight.js/styles/gml.min.css +1 -0
  244. package/dist/vditor/dist/js/highlight.js/styles/googlecode.min.css +1 -0
  245. package/dist/vditor/dist/js/highlight.js/styles/gradient-dark.min.css +1 -0
  246. package/dist/vditor/dist/js/highlight.js/styles/gradient-light.min.css +1 -0
  247. package/dist/vditor/dist/js/highlight.js/styles/grayscale.min.css +1 -0
  248. package/dist/vditor/dist/js/highlight.js/styles/hybrid.min.css +1 -0
  249. package/dist/vditor/dist/js/highlight.js/styles/idea.min.css +1 -0
  250. package/dist/vditor/dist/js/highlight.js/styles/intellij-light.min.css +1 -0
  251. package/dist/vditor/dist/js/highlight.js/styles/ir-black.min.css +1 -0
  252. package/dist/vditor/dist/js/highlight.js/styles/isbl-editor-dark.min.css +1 -0
  253. package/dist/vditor/dist/js/highlight.js/styles/isbl-editor-light.min.css +1 -0
  254. package/dist/vditor/dist/js/highlight.js/styles/kimbie-dark.min.css +1 -0
  255. package/dist/vditor/dist/js/highlight.js/styles/kimbie-light.min.css +1 -0
  256. package/dist/vditor/dist/js/highlight.js/styles/lightfair.min.css +1 -0
  257. package/dist/vditor/dist/js/highlight.js/styles/lioshi.min.css +1 -0
  258. package/dist/vditor/dist/js/highlight.js/styles/magula.min.css +1 -0
  259. package/dist/vditor/dist/js/highlight.js/styles/mono-blue.min.css +1 -0
  260. package/dist/vditor/dist/js/highlight.js/styles/monokai-sublime.min.css +1 -0
  261. package/dist/vditor/dist/js/highlight.js/styles/monokai.min.css +1 -0
  262. package/dist/vditor/dist/js/highlight.js/styles/night-owl.min.css +1 -0
  263. package/dist/vditor/dist/js/highlight.js/styles/nnfx-dark.min.css +10 -0
  264. package/dist/vditor/dist/js/highlight.js/styles/nnfx-light.min.css +10 -0
  265. package/dist/vditor/dist/js/highlight.js/styles/nord.min.css +1 -0
  266. package/dist/vditor/dist/js/highlight.js/styles/obsidian.min.css +1 -0
  267. package/dist/vditor/dist/js/highlight.js/styles/panda-syntax-dark.min.css +1 -0
  268. package/dist/vditor/dist/js/highlight.js/styles/panda-syntax-light.min.css +1 -0
  269. package/dist/vditor/dist/js/highlight.js/styles/paraiso-dark.min.css +1 -0
  270. package/dist/vditor/dist/js/highlight.js/styles/paraiso-light.min.css +1 -0
  271. package/dist/vditor/dist/js/highlight.js/styles/pojoaque.jpg +0 -0
  272. package/dist/vditor/dist/js/highlight.js/styles/pojoaque.min.css +1 -0
  273. package/dist/vditor/dist/js/highlight.js/styles/purebasic.min.css +1 -0
  274. package/dist/vditor/dist/js/highlight.js/styles/qtcreator-dark.min.css +1 -0
  275. package/dist/vditor/dist/js/highlight.js/styles/qtcreator-light.min.css +1 -0
  276. package/dist/vditor/dist/js/highlight.js/styles/rainbow.min.css +1 -0
  277. package/dist/vditor/dist/js/highlight.js/styles/routeros.min.css +1 -0
  278. package/dist/vditor/dist/js/highlight.js/styles/school-book.min.css +1 -0
  279. package/dist/vditor/dist/js/highlight.js/styles/shades-of-purple.min.css +1 -0
  280. package/dist/vditor/dist/js/highlight.js/styles/srcery.min.css +1 -0
  281. package/dist/vditor/dist/js/highlight.js/styles/stackoverflow-dark.min.css +13 -0
  282. package/dist/vditor/dist/js/highlight.js/styles/stackoverflow-light.min.css +13 -0
  283. package/dist/vditor/dist/js/highlight.js/styles/sunburst.min.css +1 -0
  284. package/dist/vditor/dist/js/highlight.js/styles/tokyo-night-dark.min.css +8 -0
  285. package/dist/vditor/dist/js/highlight.js/styles/tokyo-night-light.min.css +8 -0
  286. package/dist/vditor/dist/js/highlight.js/styles/tomorrow-night-blue.min.css +1 -0
  287. package/dist/vditor/dist/js/highlight.js/styles/tomorrow-night-bright.min.css +1 -0
  288. package/dist/vditor/dist/js/highlight.js/styles/vs.min.css +1 -0
  289. package/dist/vditor/dist/js/highlight.js/styles/vs2015.min.css +1 -0
  290. package/dist/vditor/dist/js/highlight.js/styles/xcode.min.css +1 -0
  291. package/dist/vditor/dist/js/highlight.js/styles/xt256.min.css +1 -0
  292. package/dist/vditor/dist/js/highlight.js/third-languages.js +135 -0
  293. package/dist/vditor/dist/js/i18n/de_DE.js +86 -0
  294. package/dist/vditor/dist/js/i18n/en_US.js +86 -0
  295. package/dist/vditor/dist/js/i18n/es_ES.js +86 -0
  296. package/dist/vditor/dist/js/i18n/fr_FR.js +86 -0
  297. package/dist/vditor/dist/js/i18n/ja_JP.js +86 -0
  298. package/dist/vditor/dist/js/i18n/ko_KR.js +86 -0
  299. package/dist/vditor/dist/js/i18n/pt_BR.js +86 -0
  300. package/dist/vditor/dist/js/i18n/ru_RU.js +86 -0
  301. package/dist/vditor/dist/js/i18n/sv_SE.js +86 -0
  302. package/dist/vditor/dist/js/i18n/vi_VN.js +86 -0
  303. package/dist/vditor/dist/js/i18n/zh_CN.js +86 -0
  304. package/dist/vditor/dist/js/i18n/zh_TW.js +86 -0
  305. package/dist/vditor/dist/js/icons/ant.js +174 -0
  306. package/dist/vditor/dist/js/icons/material.js +195 -0
  307. package/dist/vditor/dist/js/katex/fonts/KaTeX_AMS-Regular.ttf +0 -0
  308. package/dist/vditor/dist/js/katex/fonts/KaTeX_AMS-Regular.woff +0 -0
  309. package/dist/vditor/dist/js/katex/fonts/KaTeX_AMS-Regular.woff2 +0 -0
  310. package/dist/vditor/dist/js/katex/fonts/KaTeX_Caligraphic-Bold.ttf +0 -0
  311. package/dist/vditor/dist/js/katex/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
  312. package/dist/vditor/dist/js/katex/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
  313. package/dist/vditor/dist/js/katex/fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
  314. package/dist/vditor/dist/js/katex/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
  315. package/dist/vditor/dist/js/katex/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
  316. package/dist/vditor/dist/js/katex/fonts/KaTeX_Fraktur-Bold.ttf +0 -0
  317. package/dist/vditor/dist/js/katex/fonts/KaTeX_Fraktur-Bold.woff +0 -0
  318. package/dist/vditor/dist/js/katex/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
  319. package/dist/vditor/dist/js/katex/fonts/KaTeX_Fraktur-Regular.ttf +0 -0
  320. package/dist/vditor/dist/js/katex/fonts/KaTeX_Fraktur-Regular.woff +0 -0
  321. package/dist/vditor/dist/js/katex/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
  322. package/dist/vditor/dist/js/katex/fonts/KaTeX_Main-Bold.ttf +0 -0
  323. package/dist/vditor/dist/js/katex/fonts/KaTeX_Main-Bold.woff +0 -0
  324. package/dist/vditor/dist/js/katex/fonts/KaTeX_Main-Bold.woff2 +0 -0
  325. package/dist/vditor/dist/js/katex/fonts/KaTeX_Main-BoldItalic.ttf +0 -0
  326. package/dist/vditor/dist/js/katex/fonts/KaTeX_Main-BoldItalic.woff +0 -0
  327. package/dist/vditor/dist/js/katex/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
  328. package/dist/vditor/dist/js/katex/fonts/KaTeX_Main-Italic.ttf +0 -0
  329. package/dist/vditor/dist/js/katex/fonts/KaTeX_Main-Italic.woff +0 -0
  330. package/dist/vditor/dist/js/katex/fonts/KaTeX_Main-Italic.woff2 +0 -0
  331. package/dist/vditor/dist/js/katex/fonts/KaTeX_Main-Regular.ttf +0 -0
  332. package/dist/vditor/dist/js/katex/fonts/KaTeX_Main-Regular.woff +0 -0
  333. package/dist/vditor/dist/js/katex/fonts/KaTeX_Main-Regular.woff2 +0 -0
  334. package/dist/vditor/dist/js/katex/fonts/KaTeX_Math-BoldItalic.ttf +0 -0
  335. package/dist/vditor/dist/js/katex/fonts/KaTeX_Math-BoldItalic.woff +0 -0
  336. package/dist/vditor/dist/js/katex/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
  337. package/dist/vditor/dist/js/katex/fonts/KaTeX_Math-Italic.ttf +0 -0
  338. package/dist/vditor/dist/js/katex/fonts/KaTeX_Math-Italic.woff +0 -0
  339. package/dist/vditor/dist/js/katex/fonts/KaTeX_Math-Italic.woff2 +0 -0
  340. package/dist/vditor/dist/js/katex/fonts/KaTeX_SansSerif-Bold.ttf +0 -0
  341. package/dist/vditor/dist/js/katex/fonts/KaTeX_SansSerif-Bold.woff +0 -0
  342. package/dist/vditor/dist/js/katex/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
  343. package/dist/vditor/dist/js/katex/fonts/KaTeX_SansSerif-Italic.ttf +0 -0
  344. package/dist/vditor/dist/js/katex/fonts/KaTeX_SansSerif-Italic.woff +0 -0
  345. package/dist/vditor/dist/js/katex/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
  346. package/dist/vditor/dist/js/katex/fonts/KaTeX_SansSerif-Regular.ttf +0 -0
  347. package/dist/vditor/dist/js/katex/fonts/KaTeX_SansSerif-Regular.woff +0 -0
  348. package/dist/vditor/dist/js/katex/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
  349. package/dist/vditor/dist/js/katex/fonts/KaTeX_Script-Regular.ttf +0 -0
  350. package/dist/vditor/dist/js/katex/fonts/KaTeX_Script-Regular.woff +0 -0
  351. package/dist/vditor/dist/js/katex/fonts/KaTeX_Script-Regular.woff2 +0 -0
  352. package/dist/vditor/dist/js/katex/fonts/KaTeX_Size1-Regular.ttf +0 -0
  353. package/dist/vditor/dist/js/katex/fonts/KaTeX_Size1-Regular.woff +0 -0
  354. package/dist/vditor/dist/js/katex/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  355. package/dist/vditor/dist/js/katex/fonts/KaTeX_Size2-Regular.ttf +0 -0
  356. package/dist/vditor/dist/js/katex/fonts/KaTeX_Size2-Regular.woff +0 -0
  357. package/dist/vditor/dist/js/katex/fonts/KaTeX_Size2-Regular.woff2 +0 -0
  358. package/dist/vditor/dist/js/katex/fonts/KaTeX_Size3-Regular.ttf +0 -0
  359. package/dist/vditor/dist/js/katex/fonts/KaTeX_Size3-Regular.woff +0 -0
  360. package/dist/vditor/dist/js/katex/fonts/KaTeX_Size3-Regular.woff2 +0 -0
  361. package/dist/vditor/dist/js/katex/fonts/KaTeX_Size4-Regular.ttf +0 -0
  362. package/dist/vditor/dist/js/katex/fonts/KaTeX_Size4-Regular.woff +0 -0
  363. package/dist/vditor/dist/js/katex/fonts/KaTeX_Size4-Regular.woff2 +0 -0
  364. package/dist/vditor/dist/js/katex/fonts/KaTeX_Typewriter-Regular.ttf +0 -0
  365. package/dist/vditor/dist/js/katex/fonts/KaTeX_Typewriter-Regular.woff +0 -0
  366. package/dist/vditor/dist/js/katex/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
  367. package/dist/vditor/dist/js/katex/katex.min.css +1 -0
  368. package/dist/vditor/dist/js/katex/katex.min.js +1 -0
  369. package/dist/vditor/dist/js/katex/mhchem.min.js +1 -0
  370. package/dist/vditor/dist/js/lute/lute.min.js +72 -0
  371. package/dist/vditor/dist/js/markmap/katex.min.css +1 -0
  372. package/dist/vditor/dist/js/markmap/markmap.min.js +8251 -0
  373. package/dist/vditor/dist/js/markmap/prism.css +140 -0
  374. package/dist/vditor/dist/js/mathjax/LICENSE +202 -0
  375. package/dist/vditor/dist/js/mathjax/a11y/assistive-mml.js +1 -0
  376. package/dist/vditor/dist/js/mathjax/a11y/complexity.js +1 -0
  377. package/dist/vditor/dist/js/mathjax/a11y/explorer.js +1 -0
  378. package/dist/vditor/dist/js/mathjax/a11y/semantic-enrich.js +1 -0
  379. package/dist/vditor/dist/js/mathjax/input/asciimath.js +1 -0
  380. package/dist/vditor/dist/js/mathjax/input/mml/entities.js +1 -0
  381. package/dist/vditor/dist/js/mathjax/input/mml.js +1 -0
  382. package/dist/vditor/dist/js/mathjax/input/tex/extensions/action.js +1 -0
  383. package/dist/vditor/dist/js/mathjax/input/tex/extensions/all-packages.js +1 -0
  384. package/dist/vditor/dist/js/mathjax/input/tex/extensions/ams.js +1 -0
  385. package/dist/vditor/dist/js/mathjax/input/tex/extensions/amscd.js +1 -0
  386. package/dist/vditor/dist/js/mathjax/input/tex/extensions/autoload.js +1 -0
  387. package/dist/vditor/dist/js/mathjax/input/tex/extensions/bbox.js +1 -0
  388. package/dist/vditor/dist/js/mathjax/input/tex/extensions/boldsymbol.js +1 -0
  389. package/dist/vditor/dist/js/mathjax/input/tex/extensions/braket.js +1 -0
  390. package/dist/vditor/dist/js/mathjax/input/tex/extensions/bussproofs.js +1 -0
  391. package/dist/vditor/dist/js/mathjax/input/tex/extensions/cancel.js +1 -0
  392. package/dist/vditor/dist/js/mathjax/input/tex/extensions/color.js +1 -0
  393. package/dist/vditor/dist/js/mathjax/input/tex/extensions/colorV2.js +1 -0
  394. package/dist/vditor/dist/js/mathjax/input/tex/extensions/configMacros.js +1 -0
  395. package/dist/vditor/dist/js/mathjax/input/tex/extensions/enclose.js +1 -0
  396. package/dist/vditor/dist/js/mathjax/input/tex/extensions/extpfeil.js +1 -0
  397. package/dist/vditor/dist/js/mathjax/input/tex/extensions/html.js +1 -0
  398. package/dist/vditor/dist/js/mathjax/input/tex/extensions/mhchem.js +1 -0
  399. package/dist/vditor/dist/js/mathjax/input/tex/extensions/newcommand.js +1 -0
  400. package/dist/vditor/dist/js/mathjax/input/tex/extensions/noerrors.js +1 -0
  401. package/dist/vditor/dist/js/mathjax/input/tex/extensions/noundefined.js +1 -0
  402. package/dist/vditor/dist/js/mathjax/input/tex/extensions/physics.js +1 -0
  403. package/dist/vditor/dist/js/mathjax/input/tex/extensions/require.js +1 -0
  404. package/dist/vditor/dist/js/mathjax/input/tex/extensions/tagFormat.js +1 -0
  405. package/dist/vditor/dist/js/mathjax/input/tex/extensions/textmacros.js +1 -0
  406. package/dist/vditor/dist/js/mathjax/input/tex/extensions/unicode.js +1 -0
  407. package/dist/vditor/dist/js/mathjax/input/tex/extensions/verb.js +1 -0
  408. package/dist/vditor/dist/js/mathjax/input/tex-base.js +1 -0
  409. package/dist/vditor/dist/js/mathjax/input/tex-full.js +1 -0
  410. package/dist/vditor/dist/js/mathjax/input/tex.js +1 -0
  411. package/dist/vditor/dist/js/mathjax/sre/mathmaps/de.js +104 -0
  412. package/dist/vditor/dist/js/mathjax/sre/mathmaps/en.js +110 -0
  413. package/dist/vditor/dist/js/mathjax/sre/mathmaps/es.js +104 -0
  414. package/dist/vditor/dist/js/mathjax/sre/mathmaps/fr.js +104 -0
  415. package/dist/vditor/dist/js/mathjax/sre/mathmaps/mathmaps_ie.js +518 -0
  416. package/dist/vditor/dist/js/mathjax/sre/mathmaps/nemeth.js +104 -0
  417. package/dist/vditor/dist/js/mathjax/sre/sre-node.js +11 -0
  418. package/dist/vditor/dist/js/mathjax/sre/sre_browser.js +1633 -0
  419. package/dist/vditor/dist/js/mathjax/tex-svg-full.js +1 -0
  420. package/dist/vditor/dist/js/mermaid/mermaid.min.js +2607 -0
  421. package/dist/vditor/dist/js/plantuml/plantuml-encoder.min.js +1 -0
  422. package/dist/vditor/dist/js/smiles-drawer/smiles-drawer.min.js +71 -0
  423. package/dist/vditor/dist/method.d.ts +51 -0
  424. package/dist/vditor/dist/method.js +2673 -0
  425. package/dist/vditor/dist/method.min.js +1 -0
  426. package/dist/vditor/dist/ts/constants.d.ts +45 -0
  427. package/dist/vditor/dist/ts/devtools/index.d.ts +7 -0
  428. package/dist/vditor/dist/ts/export/index.d.ts +4 -0
  429. package/dist/vditor/dist/ts/hint/index.d.ts +14 -0
  430. package/dist/vditor/dist/ts/ir/expandMarker.d.ts +1 -0
  431. package/dist/vditor/dist/ts/ir/highlightToolbarIR.d.ts +1 -0
  432. package/dist/vditor/dist/ts/ir/index.d.ts +13 -0
  433. package/dist/vditor/dist/ts/ir/input.d.ts +1 -0
  434. package/dist/vditor/dist/ts/ir/process.d.ts +8 -0
  435. package/dist/vditor/dist/ts/ir/processKeydown.d.ts +1 -0
  436. package/dist/vditor/dist/ts/markdown/SMILESRender.d.ts +1 -0
  437. package/dist/vditor/dist/ts/markdown/abcRender.d.ts +1 -0
  438. package/dist/vditor/dist/ts/markdown/adapterRender.d.ts +41 -0
  439. package/dist/vditor/dist/ts/markdown/anchorRender.d.ts +1 -0
  440. package/dist/vditor/dist/ts/markdown/chartRender.d.ts +1 -0
  441. package/dist/vditor/dist/ts/markdown/codeRender.d.ts +1 -0
  442. package/dist/vditor/dist/ts/markdown/flowchartRender.d.ts +1 -0
  443. package/dist/vditor/dist/ts/markdown/getHTML.d.ts +1 -0
  444. package/dist/vditor/dist/ts/markdown/getMarkdown.d.ts +1 -0
  445. package/dist/vditor/dist/ts/markdown/graphvizRender.d.ts +1 -0
  446. package/dist/vditor/dist/ts/markdown/highlightRender.d.ts +1 -0
  447. package/dist/vditor/dist/ts/markdown/lazyLoadImageRender.d.ts +6 -0
  448. package/dist/vditor/dist/ts/markdown/markmapRender.d.ts +1 -0
  449. package/dist/vditor/dist/ts/markdown/mathRender.d.ts +9 -0
  450. package/dist/vditor/dist/ts/markdown/mediaRender.d.ts +1 -0
  451. package/dist/vditor/dist/ts/markdown/mermaidRender.d.ts +1 -0
  452. package/dist/vditor/dist/ts/markdown/mindmapRender.d.ts +1 -0
  453. package/dist/vditor/dist/ts/markdown/outlineRender.d.ts +1 -0
  454. package/dist/vditor/dist/ts/markdown/plantumlRender.d.ts +1 -0
  455. package/dist/vditor/dist/ts/markdown/previewRender.d.ts +2 -0
  456. package/dist/vditor/dist/ts/markdown/setLute.d.ts +1 -0
  457. package/dist/vditor/dist/ts/markdown/speechRender.d.ts +6 -0
  458. package/dist/vditor/dist/ts/outline/index.d.ts +7 -0
  459. package/dist/vditor/dist/ts/preview/image.d.ts +1 -0
  460. package/dist/vditor/dist/ts/preview/index.d.ts +10 -0
  461. package/dist/vditor/dist/ts/resize/index.d.ts +6 -0
  462. package/dist/vditor/dist/ts/sv/combineFootnote.d.ts +6 -0
  463. package/dist/vditor/dist/ts/sv/index.d.ts +13 -0
  464. package/dist/vditor/dist/ts/sv/inputEvent.d.ts +1 -0
  465. package/dist/vditor/dist/ts/sv/process.d.ts +11 -0
  466. package/dist/vditor/dist/ts/sv/processKeydown.d.ts +1 -0
  467. package/dist/vditor/dist/ts/tip/index.d.ts +6 -0
  468. package/dist/vditor/dist/ts/toolbar/Both.d.ts +5 -0
  469. package/dist/vditor/dist/ts/toolbar/Br.d.ts +4 -0
  470. package/dist/vditor/dist/ts/toolbar/CodeTheme.d.ts +6 -0
  471. package/dist/vditor/dist/ts/toolbar/ContentTheme.d.ts +6 -0
  472. package/dist/vditor/dist/ts/toolbar/Counter.d.ts +6 -0
  473. package/dist/vditor/dist/ts/toolbar/Custom.d.ts +5 -0
  474. package/dist/vditor/dist/ts/toolbar/Devtools.d.ts +5 -0
  475. package/dist/vditor/dist/ts/toolbar/Divider.d.ts +4 -0
  476. package/dist/vditor/dist/ts/toolbar/EditMode.d.ts +8 -0
  477. package/dist/vditor/dist/ts/toolbar/Emoji.d.ts +7 -0
  478. package/dist/vditor/dist/ts/toolbar/Export.d.ts +6 -0
  479. package/dist/vditor/dist/ts/toolbar/Fullscreen.d.ts +6 -0
  480. package/dist/vditor/dist/ts/toolbar/Headings.d.ts +7 -0
  481. package/dist/vditor/dist/ts/toolbar/Help.d.ts +5 -0
  482. package/dist/vditor/dist/ts/toolbar/Indent.d.ts +5 -0
  483. package/dist/vditor/dist/ts/toolbar/Info.d.ts +5 -0
  484. package/dist/vditor/dist/ts/toolbar/InsertAfter.d.ts +5 -0
  485. package/dist/vditor/dist/ts/toolbar/InsertBefore.d.ts +5 -0
  486. package/dist/vditor/dist/ts/toolbar/MenuItem.d.ts +5 -0
  487. package/dist/vditor/dist/ts/toolbar/Outdent.d.ts +5 -0
  488. package/dist/vditor/dist/ts/toolbar/Outline.d.ts +5 -0
  489. package/dist/vditor/dist/ts/toolbar/Preview.d.ts +6 -0
  490. package/dist/vditor/dist/ts/toolbar/Record.d.ts +6 -0
  491. package/dist/vditor/dist/ts/toolbar/Redo.d.ts +5 -0
  492. package/dist/vditor/dist/ts/toolbar/Undo.d.ts +5 -0
  493. package/dist/vditor/dist/ts/toolbar/Upload.d.ts +6 -0
  494. package/dist/vditor/dist/ts/toolbar/index.d.ts +10 -0
  495. package/dist/vditor/dist/ts/toolbar/setToolbar.d.ts +20 -0
  496. package/dist/vditor/dist/ts/ui/initUI.d.ts +4 -0
  497. package/dist/vditor/dist/ts/ui/setCodeTheme.d.ts +1 -0
  498. package/dist/vditor/dist/ts/ui/setContentTheme.d.ts +1 -0
  499. package/dist/vditor/dist/ts/ui/setPreviewMode.d.ts +1 -0
  500. package/dist/vditor/dist/ts/ui/setTheme.d.ts +1 -0
  501. package/dist/vditor/dist/ts/undo/index.d.ts +19 -0
  502. package/dist/vditor/dist/ts/upload/getElement.d.ts +1 -0
  503. package/dist/vditor/dist/ts/upload/index.d.ts +8 -0
  504. package/dist/vditor/dist/ts/upload/setHeaders.d.ts +1 -0
  505. package/dist/vditor/dist/ts/util/Options.d.ts +8 -0
  506. package/dist/vditor/dist/ts/util/RecordMedia.d.ts +18 -0
  507. package/dist/vditor/dist/ts/util/addScript.d.ts +2 -0
  508. package/dist/vditor/dist/ts/util/addStyle.d.ts +1 -0
  509. package/dist/vditor/dist/ts/util/code160to32.d.ts +1 -0
  510. package/dist/vditor/dist/ts/util/compatibility.d.ts +7 -0
  511. package/dist/vditor/dist/ts/util/editorCommonEvent.d.ts +9 -0
  512. package/dist/vditor/dist/ts/util/fixBrowserBehavior.d.ts +39 -0
  513. package/dist/vditor/dist/ts/util/function.d.ts +3 -0
  514. package/dist/vditor/dist/ts/util/getSelectText.d.ts +1 -0
  515. package/dist/vditor/dist/ts/util/hasClosest.d.ts +9 -0
  516. package/dist/vditor/dist/ts/util/hasClosestByHeadings.d.ts +2 -0
  517. package/dist/vditor/dist/ts/util/highlightToolbar.d.ts +1 -0
  518. package/dist/vditor/dist/ts/util/hotKey.d.ts +1 -0
  519. package/dist/vditor/dist/ts/util/log.d.ts +1 -0
  520. package/dist/vditor/dist/ts/util/merge.d.ts +1 -0
  521. package/dist/vditor/dist/ts/util/processCode.d.ts +2 -0
  522. package/dist/vditor/dist/ts/util/selection.d.ts +14 -0
  523. package/dist/vditor/dist/ts/util/toc.d.ts +5 -0
  524. package/dist/vditor/dist/ts/wysiwyg/afterRenderEvent.d.ts +5 -0
  525. package/dist/vditor/dist/ts/wysiwyg/highlightToolbarWYSIWYG.d.ts +4 -0
  526. package/dist/vditor/dist/ts/wysiwyg/index.d.ts +22 -0
  527. package/dist/vditor/dist/ts/wysiwyg/inlineTag.d.ts +10 -0
  528. package/dist/vditor/dist/ts/wysiwyg/input.d.ts +1 -0
  529. package/dist/vditor/dist/ts/wysiwyg/processKeydown.d.ts +2 -0
  530. package/dist/vditor/dist/ts/wysiwyg/renderDomByMd.d.ts +5 -0
  531. package/dist/vditor/dist/ts/wysiwyg/setHeading.d.ts +2 -0
  532. package/dist/vditor/dist/ts/wysiwyg/showCode.d.ts +1 -0
  533. package/dist/vditor/dist/ts/wysiwyg/toolbarEvent.d.ts +1 -0
  534. package/dist/vditor/dist/types/index.d.ts +921 -0
  535. package/package.json +4 -2
@@ -1 +1 @@
1
- !function(){function e(e,n,r,i){var o=t(s(1&i?e.prototype:e),n,r);return 2&i&&"function"==typeof o?function(e){return o.apply(r,e)}:o}function t(){return t="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=s(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},t.apply(null,arguments)}function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function r(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach(function(t){i(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function i(e,t,n){return(t=g(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e){var t="function"==typeof Map?new Map:void 0;return o=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(l())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var i=new(e.bind.apply(e,r));return n&&d(i,n.prototype),i}(e,arguments,s(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),d(n,e)},o(e)}function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,u,a=[],l=!0,s=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){s=!0,i=e}finally{try{if(!l&&null!=n.return&&(u=n.return(),Object(u)!==u))return}finally{if(s)throw i}}return a}}(e,t)||f(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t,n){return t=s(t),function(e,t){if(t&&("object"==w(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,l()?Reflect.construct(t,n||[],s(e).constructor):t.apply(e,n))}function l(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(l=function(){return!!e})()}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&d(e,t)}function d(e,t){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},d(e,t)}function p(e){return function(e){if(Array.isArray(e))return h(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||f(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,t){if(e){if("string"==typeof e)return h(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function m(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,g(r.key),r)}}function D(e,t,n){return t&&v(e.prototype,t),n&&v(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function g(e){var t=function(e,t){if("object"!=w(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=w(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==w(t)?t:t+""}function b(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var l=r&&r.prototype instanceof a?r:a,s=Object.create(l.prototype);return y(s,"_invoke",function(n,r,i){var o,a,l,s=0,c=i||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return o=t,a=0,l=e,p.n=n,u}};function f(n,r){for(a=n,l=r,t=0;!d&&s&&!i&&t<c.length;t++){var i,o=c[t],f=p.p,h=o[2];n>3?(i=h===r)&&(l=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=f&&((i=n<2&&f<o[1])?(a=0,p.v=r,p.n=o[1]):f<h&&(i=n<3||o[0]>r||r>h)&&(o[4]=n,o[5]=r,p.n=h,a=0))}if(i||n>1)return u;throw d=!0,r}return function(i,c,h){if(s>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,h),a=c,l=h;(t=a<2?e:l)||!d;){o||(a?a<3?(a>1&&(p.n=-1),f(a,l)):p.n=l:p.v=l);try{if(s=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(l=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(d=p.n<0)?l:n.call(r,p))!==u)break}catch(t){o=e,a=1,l=t}finally{s=1}}return{value:t,done:d}}}(n,i,o),!0),s}var u={};function a(){}function l(){}function s(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(y(t={},r,function(){return this}),t),d=s.prototype=a.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,y(e,i,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=s,y(d,"constructor",s),y(s,"constructor",l),l.displayName="GeneratorFunction",y(s,i,"GeneratorFunction"),y(d),y(d,i,"Generator"),y(d,r,function(){return this}),y(d,"toString",function(){return"[object Generator]"}),(b=function(){return{w:o,m:p}})()}function y(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}y=function(e,t,n,r){function o(t,n){y(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},y(e,t,n,r)}function E(e,t,n,r,i,o,u){try{var a=e[o](u),l=a.value}catch(e){return void n(e)}a.done?t(l):Promise.resolve(l).then(r,i)}function C(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function u(e){E(o,r,i,u,a,"next",e)}function a(e){E(o,r,i,u,a,"throw",e)}u(void 0)})}}function w(e){return w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},w(e)}System.register("iBizFilePreviewer",[],function(t,n){"use strict";return{execute:function(){var n,l,s,d,h,v,g,y,E,A,_,F,k={},S=[],T=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,x=Array.isArray;function B(e,t){for(var n in t)e[n]=t[n];return e}function L(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function M(e,t,r){var i,o,u,a={};for(u in t)"key"==u?i=t[u]:"ref"==u?o=t[u]:a[u]=t[u];if(arguments.length>2&&(a.children=arguments.length>3?n.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(u in e.defaultProps)void 0===a[u]&&(a[u]=e.defaultProps[u]);return N(e,a,i,o,null)}function N(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==i?++s:i,__i:-1,__u:0};return null==i&&null!=l.vnode&&l.vnode(o),o}function O(e){return e.children}function H(e,t){this.props=e,this.context=t}function I(e,t){if(null==t)return e.__?I(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?I(e):null}function P(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return P(e)}}function j(e){(!e.__d&&(e.__d=!0)&&h.push(e)&&!R.__r++||v!=l.debounceRendering)&&((v=l.debounceRendering)||g)(R)}function R(){for(var e,t,n,r,i,o,u,a=1;h.length;)h.length>a&&h.sort(y),e=h.shift(),a=h.length,e.__d&&(n=void 0,r=void 0,i=(r=(t=e).__v).__e,o=[],u=[],t.__P&&((n=B({},r)).__v=r.__v+1,l.vnode&&l.vnode(n),X(t.__P,n,r,t.__n,t.__P.namespaceURI,32&r.__u?[i]:null,o,null==i?I(r):i,!!(32&r.__u),u),n.__v=r.__v,n.__.__k[n.__i]=n,J(o,n,u),r.__e=r.__=null,n.__e!=i&&P(n)));R.__r=0}function q(e,t,n,r,i,o,u,a,l,s,c){var d,p,f,h,m,v,D,g=r&&r.__k||S,b=t.length;for(l=function(e,t,n,r,i){var o,u,a,l,s,c=n.length,d=c,p=0;for(e.__k=new Array(i),o=0;o<i;o++)null!=(u=t[o])&&"boolean"!=typeof u&&"function"!=typeof u?("string"==typeof u||"number"==typeof u||"bigint"==typeof u||u.constructor==String?u=e.__k[o]=N(null,u,null,null,null):x(u)?u=e.__k[o]=N(O,{children:u},null,null,null):void 0===u.constructor&&u.__b>0?u=e.__k[o]=N(u.type,u.props,u.key,u.ref?u.ref:null,u.__v):e.__k[o]=u,l=o+p,u.__=e,u.__b=e.__b+1,a=null,-1!=(s=u.__i=z(u,n,l,d))&&(d--,(a=n[s])&&(a.__u|=2)),null==a||null==a.__v?(-1==s&&(i>c?p--:i<c&&p++),"function"!=typeof u.type&&(u.__u|=4)):s!=l&&(s==l-1?p--:s==l+1?p++:(s>l?p--:p++,u.__u|=4))):e.__k[o]=null;if(d)for(o=0;o<c;o++)null!=(a=n[o])&&!(2&a.__u)&&(a.__e==r&&(r=I(a)),ee(a,a));return r}(n,t,g,l,b),d=0;d<b;d++)null!=(f=n.__k[d])&&(p=-1==f.__i?k:g[f.__i]||k,f.__i=d,v=X(e,f,p,i,o,u,a,l,s,c),h=f.__e,f.ref&&p.ref!=f.ref&&(p.ref&&Q(p.ref,null,f),c.push(f.ref,f.__c||h,f)),null==m&&null!=h&&(m=h),(D=!!(4&f.__u))||p.__k===f.__k?l=U(f,l,e,D):"function"==typeof f.type&&void 0!==v?l=v:h&&(l=h.nextSibling),f.__u&=-7);return n.__e=m,l}function U(e,t,n,r){var i,o;if("function"==typeof e.type){for(i=e.__k,o=0;i&&o<i.length;o++)i[o]&&(i[o].__=e,t=U(i[o],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=I(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function V(e,t){return t=t||[],null==e||"boolean"==typeof e||(x(e)?e.some(function(e){V(e,t)}):t.push(e)),t}function z(e,t,n,r){var i,o,u,a=e.key,l=e.type,s=t[n],c=null!=s&&!(2&s.__u);if(null===s&&null==a||c&&a==s.key&&l==s.type)return n;if(r>(c?1:0))for(i=n-1,o=n+1;i>=0||o<t.length;)if(null!=(s=t[u=i>=0?i--:o++])&&!(2&s.__u)&&a==s.key&&l==s.type)return u;return-1}function W(e,t,n){"-"==t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||T.test(t)?n:n+"px"}function G(e,t,n,r,i){var o,u;e:if("style"==t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||W(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||W(e.style,t,n[t])}else if("o"==t[0]&&"n"==t[1])o=t!=(t=t.replace(E,"$1")),u=t.toLowerCase(),t=u in e||"onFocusOut"==t||"onFocusIn"==t?u.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r?n.u=r.u:(n.u=A,e.addEventListener(t,o?F:_,o)):e.removeEventListener(t,o?F:_,o);else{if("http://www.w3.org/2000/svg"==i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function K(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t.t)t.t=A++;else if(t.t<n.u)return;return n(l.event?l.event(t):t)}}}function X(e,t,n,r,i,o,u,a,s,c){var d,p,f,h,m,v,D,g,b,y,E,C,w,A,_,F,k,S=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(s=!!(32&n.__u),o=[a=t.__e=n.__e]),(d=l.__b)&&d(t);e:if("function"==typeof S)try{if(g=t.props,b="prototype"in S&&S.prototype.render,y=(d=S.contextType)&&r[d.__c],E=d?y?y.props.value:d.__:r,n.__c?D=(p=t.__c=n.__c).__=p.__E:(b?t.__c=p=new S(g,E):(t.__c=p=new H(g,E),p.constructor=S,p.render=te),y&&y.sub(p),p.state||(p.state={}),p.__n=r,f=p.__d=!0,p.__h=[],p._sb=[]),b&&null==p.__s&&(p.__s=p.state),b&&null!=S.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=B({},p.__s)),B(p.__s,S.getDerivedStateFromProps(g,p.__s))),h=p.props,m=p.state,p.__v=t,f)b&&null==S.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),b&&null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(b&&null==S.getDerivedStateFromProps&&g!==h&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(g,E),t.__v==n.__v||!p.__e&&null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(g,p.__s,E)){for(t.__v!=n.__v&&(p.props=g,p.state=p.__s,p.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),C=0;C<p._sb.length;C++)p.__h.push(p._sb[C]);p._sb=[],p.__h.length&&u.push(p);break e}null!=p.componentWillUpdate&&p.componentWillUpdate(g,p.__s,E),b&&null!=p.componentDidUpdate&&p.__h.push(function(){p.componentDidUpdate(h,m,v)})}if(p.context=E,p.props=g,p.__P=e,p.__e=!1,w=l.__r,A=0,b){for(p.state=p.__s,p.__d=!1,w&&w(t),d=p.render(p.props,p.state,p.context),_=0;_<p._sb.length;_++)p.__h.push(p._sb[_]);p._sb=[]}else do{p.__d=!1,w&&w(t),d=p.render(p.props,p.state,p.context),p.state=p.__s}while(p.__d&&++A<25);p.state=p.__s,null!=p.getChildContext&&(r=B(B({},r),p.getChildContext())),b&&!f&&null!=p.getSnapshotBeforeUpdate&&(v=p.getSnapshotBeforeUpdate(h,m)),F=d,null!=d&&d.type===O&&null==d.key&&(F=$(d.props.children)),a=q(e,x(F)?F:[F],t,n,r,i,o,u,a,s,c),p.base=t.__e,t.__u&=-161,p.__h.length&&u.push(p),D&&(p.__E=p.__=null)}catch(e){if(t.__v=null,s||null!=o)if(e.then){for(t.__u|=s?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;o[o.indexOf(a)]=null,t.__e=a}else{for(k=o.length;k--;)L(o[k]);Z(t)}else t.__e=n.__e,t.__k=n.__k,e.then||Z(t);l.__e(e,t,n)}else null==o&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):a=t.__e=Y(n.__e,t,n,r,i,o,u,s,c);return(d=l.diffed)&&d(t),128&t.__u?void 0:a}function Z(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(Z)}function J(e,t,n){for(var r=0;r<n.length;r++)Q(n[r],n[++r],n[++r]);l.__c&&l.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){l.__e(e,t.__v)}})}function $(e){return"object"!=w(e)||null==e||e.__b&&e.__b>0?e:x(e)?e.map($):B({},e)}function Y(e,t,r,i,o,u,a,s,c){var d,p,f,h,m,v,D,g=r.props||k,b=t.props,y=t.type;if("svg"==y?o="http://www.w3.org/2000/svg":"math"==y?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),null!=u)for(d=0;d<u.length;d++)if((m=u[d])&&"setAttribute"in m==!!y&&(y?m.localName==y:3==m.nodeType)){e=m,u[d]=null;break}if(null==e){if(null==y)return document.createTextNode(b);e=document.createElementNS(o,y,b.is&&b),s&&(l.__m&&l.__m(t,u),s=!1),u=null}if(null==y)g===b||s&&e.data==b||(e.data=b);else{if(u=u&&n.call(e.childNodes),!s&&null!=u)for(g={},d=0;d<e.attributes.length;d++)g[(m=e.attributes[d]).name]=m.value;for(d in g)if(m=g[d],"children"==d);else if("dangerouslySetInnerHTML"==d)f=m;else if(!(d in b)){if("value"==d&&"defaultValue"in b||"checked"==d&&"defaultChecked"in b)continue;G(e,d,null,m,o)}for(d in b)m=b[d],"children"==d?h=m:"dangerouslySetInnerHTML"==d?p=m:"value"==d?v=m:"checked"==d?D=m:s&&"function"!=typeof m||g[d]===m||G(e,d,m,g[d],o);if(p)s||f&&(p.__html==f.__html||p.__html==e.innerHTML)||(e.innerHTML=p.__html),t.__k=[];else if(f&&(e.innerHTML=""),q("template"==t.type?e.content:e,x(h)?h:[h],t,r,i,"foreignObject"==y?"http://www.w3.org/1999/xhtml":o,u,a,u?u[0]:r.__k&&I(r,0),s,c),null!=u)for(d=u.length;d--;)L(u[d]);s||(d="value","progress"==y&&null==v?e.removeAttribute("value"):null!=v&&(v!==e[d]||"progress"==y&&!v||"option"==y&&v!=g[d])&&G(e,d,v,g[d],o),d="checked",null!=D&&D!=e[d]&&G(e,d,D,g[d],o))}return e}function Q(e,t,n){try{if("function"==typeof e){var r="function"==typeof e.__u;r&&e.__u(),r&&null==t||(e.__u=e(t))}else e.current=t}catch(e){l.__e(e,n)}}function ee(e,t,n){var r,i;if(l.unmount&&l.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||Q(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){l.__e(e,t)}r.base=r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&ee(r[i],t,n||"function"!=typeof e.type);n||L(e.__e),e.__c=e.__=e.__e=void 0}function te(e,t,n){return this.constructor(e,n)}function ne(e,t,r){var i,o,u;t==document&&(t=document.documentElement),l.__&&l.__(e,t),i=!1?null:t.__k,o=[],u=[],X(t,e=t.__k=M(O,null,[e]),i||k,k,t.namespaceURI,i?null:t.firstChild?n.call(t.childNodes):null,o,i?i.__e:t.firstChild,false,u),J(o,e,u)}n=S.slice,l={__e:function(e,t,n,r){for(var i,o,u;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),u=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,r||{}),u=i.__d),u)return i.__E=i}catch(t){e=t}throw e}},s=0,d=function(e){return null!=e&&void 0===e.constructor},H.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=B({},this.state),"function"==typeof e&&(e=e(B({},n),this.props)),e&&B(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),j(this))},H.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),j(this))},H.prototype.render=O,h=[],g="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,y=function(e,t){return e.__v.__b-t.__v.__b},R.__r=0,E=/(PointerCapture)$|Capture$/i,A=0,_=K(!1),F=K(!0);var re,ie,oe,ue,ae=0,le=[],se=l,ce=se.__b,de=se.__r,pe=se.diffed,fe=se.__c,he=se.unmount,me=se.__;function ve(e,t){se.__h&&se.__h(ie,e,ae||t),ae=0;var n=ie.__H||(ie.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function De(e){return ae=1,function(e,t,n){var r=ve(re++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):ke(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=ie,!ie.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter(function(e){return!!e.__c});if(i.every(function(e){return!e.__N}))return!o||o.call(this,e,t,n);var u=r.__c.props!==e;return i.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(u=!0)}}),o&&o.call(this,e,t,n)||u};ie.__f=!0;var o=ie.shouldComponentUpdate,u=ie.componentWillUpdate;ie.componentWillUpdate=function(e,t,n){if(this.__e){var r=o;o=void 0,i(e,t,n),o=r}u&&u.call(this,e,t,n)},ie.shouldComponentUpdate=i}return r.__N||r.__}(ke,e)}function ge(e,t){var n=ve(re++,3);!se.__s&&Fe(n.__H,t)&&(n.__=e,n.u=t,ie.__H.__h.push(n))}function be(e){return ae=5,ye(function(){return{current:e}},[])}function ye(e,t){var n=ve(re++,7);return Fe(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Ee(){for(var e;e=le.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Ae),e.__H.__h.forEach(_e),e.__H.__h=[]}catch(Te){e.__H.__h=[],se.__e(Te,e.__v)}}se.__b=function(e){ie=null,ce&&ce(e)},se.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),me&&me(e,t)},se.__r=function(e){de&&de(e),re=0;var t=(ie=e.__c).__H;t&&(oe===ie?(t.__h=[],ie.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(Ae),t.__h.forEach(_e),t.__h=[],re=0)),oe=ie},se.diffed=function(e){pe&&pe(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==le.push(t)&&ue===se.requestAnimationFrame||((ue=se.requestAnimationFrame)||we)(Ee)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),oe=ie=null},se.__c=function(e,t){t.some(function(e){try{e.__h.forEach(Ae),e.__h=e.__h.filter(function(e){return!e.__||_e(e)})}catch(ie){t.some(function(e){e.__h&&(e.__h=[])}),t=[],se.__e(ie,e.__v)}}),fe&&fe(e,t)},se.unmount=function(e){he&&he(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{Ae(e)}catch(e){t=e}}),n.__H=void 0,t&&se.__e(t,n.__v))};var Ce="function"==typeof requestAnimationFrame;function we(e){var t,n=function(){clearTimeout(r),Ce&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Ce&&(t=requestAnimationFrame(n))}function Ae(e){var t=ie,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),ie=t}function _e(e){var t=ie;e.__c=e.__(),ie=t}function Fe(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function ke(e,t){return"function"==typeof t?t(e):t}var Se=Symbol.for("preact-signals");function Te(){if(Oe>1)Oe--;else{for(var e,t=!1;void 0!==Ne;){var n=Ne;for(Ne=void 0,He++;void 0!==n;){var r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&qe(n))try{n.c()}catch(n){t||(e=n,t=!0)}n=r}}if(He=0,Oe--,t)throw e}}var xe=void 0;function Be(e){var t=xe;xe=void 0;try{return e()}finally{xe=t}}var Le,Me,Ne=void 0,Oe=0,He=0,Ie=0;function Pe(e){if(void 0!==xe){var t=e.n;if(void 0===t||t.t!==xe)return t={i:0,S:e,p:xe.s,n:void 0,t:xe,e:void 0,x:void 0,r:t},void 0!==xe.s&&(xe.s.n=t),xe.s=t,e.n=t,32&xe.f&&e.S(t),t;if(-1===t.i)return t.i=0,void 0!==t.n&&(t.n.p=t.p,void 0!==t.p&&(t.p.n=t.n),t.p=xe.s,t.n=void 0,xe.s.n=t,xe.s=t),t}}function je(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.W=null==t?void 0:t.watched,this.Z=null==t?void 0:t.unwatched,this.name=null==t?void 0:t.name}function Re(e,t){return new je(e,t)}function qe(e){for(var t=e.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function Ue(e){for(var t=e.s;void 0!==t;t=t.n){var n=t.S.n;if(void 0!==n&&(t.r=n),t.S.n=t,t.i=-1,void 0===t.n){e.s=t;break}}}function Ve(e){for(var t=e.s,n=void 0;void 0!==t;){var r=t.p;-1===t.i?(t.S.U(t),void 0!==r&&(r.n=t.n),void 0!==t.n&&(t.n.p=r)):n=t,t.S.n=t.r,void 0!==t.r&&(t.r=void 0),t=r}e.s=n}function ze(e,t){je.call(this,void 0),this.x=e,this.s=void 0,this.g=Ie-1,this.f=4,this.W=null==t?void 0:t.watched,this.Z=null==t?void 0:t.unwatched,this.name=null==t?void 0:t.name}function We(e,t){return new ze(e,t)}function Ge(e){var t=e.u;if(e.u=void 0,"function"==typeof t){Oe++;var n=xe;xe=void 0;try{t()}catch(Te){throw e.f&=-2,e.f|=8,Ke(e),Te}finally{xe=n,Te()}}}function Ke(e){for(var t=e.s;void 0!==t;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Ge(e)}function Xe(e){if(xe!==this)throw new Error("Out-of-order effect");Ve(this),xe=e,this.f&=-2,8&this.f&&Ke(this),Te()}function Ze(e,t){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=null==t?void 0:t.name}function Je(e,t){var n=new Ze(e,t);try{n.c()}catch(e){throw n.d(),e}var r=n.d.bind(n);return r[Symbol.dispose]=r,r}function $e(e,t){l[e]=t.bind(null,l[e]||function(){})}function Ye(e){Me&&Me(),Me=e&&e.S()}function Qe(e){var t=this,n=e.data,r=tt(n);r.value=n;var i=ye(function(){for(var e=t.__v;e=e.__;)if(e.__c){e.__c.__$f|=4;break}return t.__$u.c=function(){var e;d(i.peek())||3!==(null==(e=t.base)?void 0:e.nodeType)?(t.__$f|=1,t.setState({})):t.base.data=i.peek()},We(function(){var e=r.value.value;return 0===e?0:!0===e?"":e||""})},[]);return i.value}function et(e,t,n,r){var i=t in e&&void 0===e.ownerSVGElement,o=Re(n);return{o:function(e,t){o.value=e,r=t},d:Je(function(){var n=o.value.value;r[t]!==n&&(r[t]=n,i?e[t]=n:n?e.setAttribute(t,n):e.removeAttribute(t))})}}function tt(e){return ye(function(){return Re(e)},[])}function nt(e){var t=be(e);return t.current=e,Le.__$f|=4,ye(function(){return We(function(){return t.current()})},[])}je.prototype.brand=Se,je.prototype.h=function(){return!0},je.prototype.S=function(e){var t=this,n=this.t;n!==e&&void 0===e.e&&(e.x=n,this.t=e,void 0!==n?n.e=e:Be(function(){var e;null==(e=t.W)||e.call(t)}))},je.prototype.U=function(e){var t=this;if(void 0!==this.t){var n=e.e,r=e.x;void 0!==n&&(n.x=r,e.e=void 0),void 0!==r&&(r.e=n,e.x=void 0),e===this.t&&(this.t=r,void 0===r&&Be(function(){var e;null==(e=t.Z)||e.call(t)}))}},je.prototype.subscribe=function(e){var t=this;return Je(function(){var n=t.value,r=xe;xe=void 0;try{e(n)}finally{xe=r}},{name:"sub"})},je.prototype.valueOf=function(){return this.value},je.prototype.toString=function(){return this.value+""},je.prototype.toJSON=function(){return this.value},je.prototype.peek=function(){var e=xe;xe=void 0;try{return this.value}finally{xe=e}},Object.defineProperty(je.prototype,"value",{get:function(){var e=Pe(this);return void 0!==e&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(He>100)throw new Error("Cycle detected");this.v=e,this.i++,Ie++,Oe++;try{for(var t=this.t;void 0!==t;t=t.x)t.t.N()}finally{Te()}}}}),ze.prototype=new je,ze.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f))return!0;if(this.f&=-5,this.g===Ie)return!0;if(this.g=Ie,this.f|=1,this.i>0&&!qe(this))return this.f&=-2,!0;var e=xe;try{Ue(this),xe=this;var t=this.x();(16&this.f||this.v!==t||0===this.i)&&(this.v=t,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return xe=e,Ve(this),this.f&=-2,!0},ze.prototype.S=function(e){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t)}je.prototype.S.call(this,e)},ze.prototype.U=function(e){if(void 0!==this.t&&(je.prototype.U.call(this,e),void 0===this.t)){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t)}},ze.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;void 0!==e;e=e.x)e.t.N()}},Object.defineProperty(ze.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=Pe(this);if(this.h(),void 0!==e&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),Ze.prototype.c=function(){var e=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var t=this.x();"function"==typeof t&&(this.u=t)}finally{e()}},Ze.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Ge(this),Ue(this),Oe++;var e=xe;return xe=this,Xe.bind(this,e)},Ze.prototype.N=function(){2&this.f||(this.f|=2,this.o=Ne,Ne=this)},Ze.prototype.d=function(){this.f|=8,1&this.f||Ke(this)},Ze.prototype.dispose=function(){this.d()},Qe.displayName="_st",Object.defineProperties(je.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Qe},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),$e("__b",function(e,t){if("string"==typeof t.type){var n,r=t.props;for(var i in r)if("children"!==i){var o=r[i];o instanceof je&&(n||(t.__np=n={}),n[i]=o,r[i]=o.peek())}}e(t)}),$e("__r",function(e,t){Ye();var n,r=t.__c;r&&(r.__$f&=-2,void 0===(n=r.__$u)&&(r.__$u=n=function(){var e;return Je(function(){e=this}),e.c=function(){r.__$f|=1,r.setState({})},e}())),Le=r,Ye(n),e(t)}),$e("__e",function(e,t,n,r){Ye(),Le=void 0,e(t,n,r)}),$e("diffed",function(e,t){var n;if(Ye(),Le=void 0,"string"==typeof t.type&&(n=t.__e)){var r=t.__np,i=t.props;if(r){var o=n.U;if(o)for(var u in o){var a=o[u];void 0===a||u in r||(a.d(),o[u]=void 0)}else n.U=o={};for(var l in r){var s=o[l],c=r[l];void 0===s?(s=et(n,l,c,i),o[l]=s):s.o(c,i)}}}e(t)}),$e("unmount",function(e,t){if("string"==typeof t.type){var n=t.__e;if(n){var r=n.U;if(r)for(var i in n.U=void 0,r){var o=r[i];o&&o.d()}}}else{var u=t.__c;if(u){var a=u.__$u;a&&(u.__$u=void 0,a.d())}}e(t)}),$e("__h",function(e,t,n,r){(r<3||9===r)&&(t.__$f|=2),e(t,n,r)}),H.prototype.shouldComponentUpdate=function(e,t){var n=this.__$u;if(!(n&&void 0!==n.s||4&this.__$f))return!0;if(3&this.__$f)return!0;for(var r in t)return!0;for(var i in e)if("__source"!==i&&e[i]!==this.props[i])return!0;for(var o in this.props)if(!(o in e))return!0;return!1};var rt=t("ActionType",function(e){return e.DOWNORIGINAL="DOWNORIGINAL",e.COPYTEXTCONTENT="COPYTEXTCONTENT",e.DOWNPDF="DOWNPDF",e.DOWNMD="DOWNMD",e}(rt||{})),it=function(e){return e.AUTO="auto",e.WIDTH="width",e.PAGE="page",e}(it||{}),ot=t("FileType",function(e){return e.HTML="html",e.MD="md",e.TXT="txt",e.JSON="json",e.XML="xml",e.DOC="doc",e.DOCX="docx",e.XLS="xls",e.XLSX="xlsx",e.WPS="wps",e.ET="et",e.PDF="pdf",e.OFD="ofd",e.PPT="ppt",e.PPTX="pptx",e.VSD="vsd",e.JPG="jpg",e.PNG="png",e.GIF="gif",e.SVG="svg",e.BMP="bmp",e.WEBP="webp",e.JPEG="jpeg",e.ICO="ico",e.UNKNOWN="UNKNOWN",e}(ot||{})),ut=function(e){return e.HTML="HTML",e.MD="MD",e.TXT="TXT",e.PDF="PDF",e.IMG="IMG",e.UNKNOWN="UNKNOWN",e}(ut||{}),at=new Map([["html",["HTML"]],["md",["MD"]],["xls",["HTML"]],["xlsx",["HTML"]],["et",["HTML"]],["txt",["MD"]],["json",["MD"]],["xml",["MD"]],["pdf",["PDF"]],["ofd",["PDF"]],["doc",["PDF","HTML"]],["docx",["PDF","HTML"]],["wps",["PDF","HTML"]],["ppt",["PDF"]],["pptx",["PDF"]],["jpg",["IMG"]],["png",["IMG"]],["gif",["IMG"]],["svg",["IMG"]],["bmp",["IMG"]],["jpeg",["IMG"]],["webp",["IMG"]],["ico",["IMG"]]]),lt=[{lable:"自动缩放",value:it.AUTO},{lable:"适合页宽",value:it.WIDTH},{lable:"适合页面",value:it.PAGE}],st=function(e){var t,n=null===(t=e.split(".").pop())||void 0===t?void 0:t.toLowerCase(),r=ot.UNKNOWN;switch(n){case"html":r=ot.HTML;break;case"md":r=ot.MD;break;case"txt":r=ot.TXT;break;case"json":r=ot.JSON;break;case"xml":r=ot.XML;break;case"doc":r=ot.DOC;break;case"docx":r=ot.DOCX;break;case"xls":r=ot.XLS;break;case"xlsx":r=ot.XLSX;break;case"wps":r=ot.WPS;break;case"et":r=ot.ET;break;case"pdf":r=ot.PDF;break;case"ofd":r=ot.OFD;break;case"ppt":r=ot.PPT;break;case"pptx":r=ot.PPTX;break;case"vsd":r=ot.VSD;break;case"jpg":r=ot.JPG;break;case"png":r=ot.PNG;break;case"gif":r=ot.GIF;break;case"svg":r=ot.SVG;break;case"bmp":r=ot.BMP;break;case"jpeg":r=ot.JPEG;break;case"webp":r=ot.WEBP;break;case"ico":r=ot.ICO;break;default:r=ot.UNKNOWN}return r},ct=function(e,t){var n=null,r=0;return function(){for(var i=arguments.length,o=new Array(i),u=0;u<i;u++)o[u]=arguments[u];var a=Date.now(),l=t-(a-r);l<=0?(r=a,n&&(clearTimeout(n),n=null),e.apply(void 0,o)):(n&&clearTimeout(n),n=setTimeout(function(){r=Date.now(),n=null,e.apply(void 0,o)},l))}},dt=function(e){var t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.left="-999999px",t.style.top="-999999px",document.body.appendChild(t),t.focus(),t.select();try{var n=document.execCommand("copy");return document.body.removeChild(t),!!n}catch(r){return document.body.removeChild(t),!1}},pt=function(){var e=C(b().m(function e(t){return b().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!navigator.clipboard||!window.isSecureContext){e.n=4;break}return e.p=1,e.n=2,navigator.clipboard.writeText(t);case 2:return e.a(2,!0);case 3:return e.p=3,e.v,e.a(2,dt(t));case 4:return e.a(2,dt(t));case 5:return e.a(2)}},e,null,[[1,3]])}));return function(t){return e.apply(this,arguments)}}(),ft=0;function ht(e,t,n,r,i,o){t||(t={});var u,a,s=t;if("ref"in s)for(a in s={},t)"ref"==a?u=t[a]:s[a]=t[a];var c={type:e,props:s,key:n,ref:u,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--ft,__i:-1,__u:0,__source:i,__self:o};if("function"==typeof e&&(u=e.defaultProps))for(a in u)void 0===s[a]&&(s[a]=u[a]);return l.vnode&&l.vnode(c),c}var mt=function(e){var t=be(null);return ge(function(){if(t.current){var n=t.current.attachShadow({mode:"open"}),r='\n <style>\n .content-container {\n height: 100%;\n width: 100%;\n }\n </style>\n <div class="content-container">\n '.concat(e.controller.state.value.content,"\n </div>\n ");n.innerHTML=r}e.onInitialization()},[]),ht("div",{className:"file-preview-html ".concat(e.controller.state.value.theme),children:ht("div",{ref:t,className:"container"})})},vt=function(){return ht("svg",{class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",children:ht("path",{d:"M853.333333 544H170.666667c-17.066667 0-32-14.933333-32-32s14.933333-32 32-32h682.666666c17.066667 0 32 14.933333 32 32s-14.933333 32-32 32z",fill:"currentColor"})})},Dt=function(){return ht("svg",{class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",children:ht("path",{d:"M483.555556 483.555556v-284.444445a28.444444 28.444444 0 0 1 56.888888 0v284.444445h284.444445a28.444444 28.444444 0 1 1 0 56.888888h-284.444445v284.444445a28.444444 28.444444 0 1 1-56.888888 0v-284.444445h-284.444445a28.444444 28.444444 0 0 1 0-56.888888h284.444445z",fill:"currentColor"})})},gt=function(){return ht("svg",{class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",children:[ht("path",{fill:"currentColor",d:"M505.7 661c3.2 4.1 9.4 4.1 12.6 0l112-141.7c4.1-5.2 0.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8z"}),ht("path",{fill:"currentColor",d:"M878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"})]})},bt=function(){return ht("svg",{class:"icon",viewBox:"0 0 1118 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",children:ht("path",{d:"M977.721197 605.255979l139.674457-162.953533-97.865236 0C985.496408 192.517959 771.28235 0 512.139674 0 229.2989 0 0 229.2989 0 512.139674c0 277.346913 220.452851 503.200509 495.704647 511.860326l0-93.162863C271.899609 922.223879 93.116304 738.039829 93.116304 512.139674c0-231.440575 187.582795-419.02337 419.02337-419.02337 207.649359 0 379.96108 150.988088 413.250159 349.186142L838.04674 442.302446 977.721197 605.255979z",fill:"currentColor"})})},yt=function(){return ht("svg",{class:"icon",viewBox:"0 0 1118 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",children:ht("path",{d:"M621.691007 930.837137l0 93.162863C896.942803 1015.340184 1117.395653 789.486587 1117.395653 512.139674c0-282.840775-229.2989-512.139674-512.139674-512.139674C346.113304 0 131.899245 192.517959 97.818678 442.302446L0 442.302446 139.674457 605.255979l139.674457-162.953533L192.00582 442.302446C225.294899 244.104392 397.60662 93.116304 605.255979 93.116304c231.440575 0 419.02337 187.582795 419.02337 419.02337C1024.279349 738.039829 845.496044 922.223879 621.691007 930.837137z",fill:"currentColor"})})},Et=function(){return ht("svg",{class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",children:ht("path",{d:"M112 912h368V544H112v368z m80-288h208v208H192V624zM544 112v368h368V112H544z m288 288H624V192h208v208zM112 480h368V112H112v368z m80-288h208v208H192V192z m352 720h368V544H544v368z m80-288h208v208H624V624z",fill:"currentColor"})})},Ct=function(){return ht("svg",{class:"icon",viewBox:"0 0 1025 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"16.015625",height:"16",children:ht("path",{d:"M131.339914 423.017198c-9.52111 9.670597-9.400291 25.229558 0.270306 34.750668 9.670597 9.522134 25.229558 9.401315 34.750668-0.269282l320.722863-325.740925 0 798.397108c0 13.5716 11.001648 24.573248 24.573248 24.573248 13.5716 0 24.573248-11.001648 24.573248-24.573248L536.230246 135.522485l315.80719 320.551874c9.523157 9.667525 25.084167 9.783224 34.750668 0.259043 9.667525-9.524181 9.784248-25.083143 0.259043-34.750668L552.305246 81.813557c-11.058985-11.331339-25.865391-17.688643-41.702849-17.905707-0.277473-0.004096-0.554946-0.005119-0.832419-0.005119-15.559985 0-30.237381 5.957989-41.412066 16.831651-0.124914 0.121842-0.249828 0.245732-0.372694 0.370646L131.339914 423.017198z",fill:"currentColor"})})},wt=function(){return ht("svg",{class:"icon",viewBox:"0 0 1025 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"16.015625",height:"16",children:ht("path",{d:"M467.985218 937.525717c0.122866 0.124914 0.24778 0.248804 0.372694 0.370646 11.174684 10.873662 25.852081 16.831651 41.412066 16.831651 0.277473 0 0.554946-0.001024 0.832419-0.005119 15.837458-0.217064 30.643864-6.574368 41.702849-17.905707l334.741901-339.769178c9.525205-9.667525 9.408482-25.226487-0.259043-34.750668-9.666501-9.524181-25.227511-9.408482-34.750668 0.259043l-315.80719 320.551874L536.230246 88.475979c0-13.5716-11.001648-24.573248-24.573248-24.573248-13.5716 0-24.573248 11.001648-24.573248 24.573248l0 798.397108L166.360888 561.132161c-9.52111-9.670597-25.080071-9.791415-34.750668-0.269282-9.670597 9.52111-9.791415 25.080071-0.270306 34.750668L467.985218 937.525717z",fill:"currentColor"})})},At=function(){return ht("svg",{class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",children:ht("path",{d:"M512 608c-6.4 0-19.2 0-25.6-6.4l-128-128c-12.8-12.8-12.8-32 0-44.8s32-12.8 44.8 0L512 531.2l102.4-102.4c12.8-12.8 32-12.8 44.8 0s12.8 32 0 44.8l-128 128C531.2 608 518.4 608 512 608z",fill:"currentColor"})})},_t=function(){return ht("svg",{class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",children:ht("path",{d:"M512 950.86c-210.65 0-386.92-149.21-429.35-347.43H190.9L74.61 486.4 8.78 420.57C2.92 449.83 0 480.55 0 512s2.92 62.17 8.78 91.43C51.2 842.6 260.39 1024 512 1024c208.46 0 386.92-123.61 466.65-302.08l-55.59-55.59C860.16 832.37 699.98 950.86 512 950.86zM1015.22 420.57C972.8 181.39 763.61 0 512 0 303.54 0 125.08 123.61 45.35 302.08l55.59 56.32C163.11 192.37 324.02 73.14 512 73.14c210.65 0 386.92 149.21 429.35 347.43H833.1l116.29 116.29 65.83 65.83c5.85-29.26 8.78-59.25 8.78-90.7s-2.92-62.16-8.78-91.42z",fill:"currentColor"})})},Ft=function(e){return ht("svg",{class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:e.size,height:e.size,children:[ht("path",{d:"M512 61.44a40.96 40.96 0 0 1 40.96 40.96v122.88a40.96 40.96 0 1 1-81.92 0V102.4A40.96 40.96 0 0 1 512 61.44z",fill:"currentColor",opacity:".9"}),ht("path",{d:"M737.28 121.792a40.96 40.96 0 0 1 14.992 55.952l-61.44 106.432a40.96 40.96 0 1 1-70.944-40.96l61.44-106.432a40.96 40.96 0 0 1 55.952-14.992z",fill:"currentColor",opacity:".8"}),ht("path",{d:"M902.208 286.72a40.96 40.96 0 0 1-14.992 55.952l-106.432 61.44a40.96 40.96 0 0 1-40.96-70.944l106.432-61.44a40.96 40.96 0 0 1 55.952 14.992z",fill:"currentColor",opacity:".76"}),ht("path",{d:"M962.56 512a40.96 40.96 0 0 1-40.96 40.96h-122.88a40.96 40.96 0 1 1 0-81.92h122.88A40.96 40.96 0 0 1 962.56 512z",fill:"currentColor",opacity:".7"}),ht("path",{d:"M902.208 737.28a40.96 40.96 0 0 1-55.952 14.992l-106.432-61.44a40.96 40.96 0 1 1 40.96-70.944l106.432 61.44a40.96 40.96 0 0 1 14.992 55.952z",fill:"currentColor",opacity:".6","p-id":"4720"}),ht("path",{d:"M737.28 902.208a40.96 40.96 0 0 1-55.952-14.992l-61.44-106.432a40.96 40.96 0 0 1 70.944-40.96l61.44 106.432a40.96 40.96 0 0 1-14.992 55.952z",fill:"currentColor",opacity:".5","p-id":"4721"}),ht("path",{d:"M512 962.56a40.96 40.96 0 0 1-40.96-40.96v-122.88a40.96 40.96 0 1 1 81.92 0v122.88A40.96 40.96 0 0 1 512 962.56z",fill:"currentColor",opacity:".4","p-id":"4722"}),ht("path",{d:"M286.72 902.208a40.96 40.96 0 0 1-14.992-55.952l61.44-106.432a40.96 40.96 0 1 1 70.944 40.96l-61.44 106.432a40.96 40.96 0 0 1-55.952 14.992z",fill:"currentColor",opacity:".3","p-id":"4723"}),ht("path",{d:"M121.792 737.28a40.96 40.96 0 0 1 14.992-55.952l106.432-61.44a40.96 40.96 0 0 1 40.96 70.944l-106.432 61.44a40.96 40.96 0 0 1-55.952-14.992z",fill:"currentColor",opacity:".2","p-id":"4724"}),ht("path",{d:"M61.44 512a40.96 40.96 0 0 1 40.96-40.96h122.88a40.96 40.96 0 1 1 0 81.92H102.4A40.96 40.96 0 0 1 61.44 512z",fill:"currentColor",opacity:".1","p-id":"4725"}),ht("path",{d:"M121.792 286.72a40.96 40.96 0 0 1 55.952-14.992l106.432 61.44a40.96 40.96 0 1 1-40.96 70.944l-106.432-61.44a40.96 40.96 0 0 1-14.992-55.952z",fill:"currentColor",opacity:".04","p-id":"4726"}),ht("path",{d:"M286.72 121.792a40.96 40.96 0 0 1 55.952 14.992l61.44 106.432a40.96 40.96 0 0 1-70.944 40.96l-61.44-106.432a40.96 40.96 0 0 1 14.992-55.952z",fill:"currentColor","p-id":"4727"})]})};function kt(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function St(e,t){this.props=e,this.context=t}(St.prototype=new H).isPureReactComponent=!0,St.prototype.shouldComponentUpdate=function(e,t){return kt(this.props,e)||kt(this.state,t)};var Tt=l.__b;l.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Tt&&Tt(e)};var xt=l.__e;l.__e=function(e,t,n,r){if(e.then)for(var i,o=t;o=o.__;)if((i=o.__c)&&i.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),i.__c(e,t);xt(e,t,n,r)};var Bt=l.unmount;function Lt(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(e){"function"==typeof e.__c&&e.__c()}),e.__c.__H=null),null!=(e=function(e,t){for(var n in t)e[n]=t[n];return e}({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(e){return Lt(e,t,n)})),e}function Mt(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return Mt(e,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function Nt(){this.__u=0,this.o=null,this.__b=null}function Ot(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Ht(){this.i=null,this.l=null}l.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Bt&&Bt(e)},(Nt.prototype=new H).__c=function(e,t){var n=t.__c,r=this;null==r.o&&(r.o=[]),r.o.push(n);var i=Ot(r.__v),o=!1,u=function(){o||(o=!0,n.__R=null,i?i(a):a())};n.__R=u;var a=function(){if(! --r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=Mt(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.o.pop();)t.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(u,u)},Nt.prototype.componentWillUnmount=function(){this.o=[]},Nt.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=Lt(this.__b,n,r.__O=r.__P)}this.__b=null}var i=t.__a&&M(O,null,e.fallback);return i&&(i.__u&=-33),[M(O,null,t.__a?null:e.children),i]};var It=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};function Pt(e){return this.getChildContext=function(){return e.context},e.children}function jt(e){var t=this,n=e.h;if(t.componentWillUnmount=function(){ne(null,t.v),t.v=null,t.h=null},t.h&&t.h!==n&&t.componentWillUnmount(),!t.v){for(var r=t.__v;null!==r&&!r.__m&&null!==r.__;)r=r.__;t.h=n,t.v={nodeType:1,parentNode:n,childNodes:[],__k:{__m:r.__m},contains:function(){return!0},insertBefore:function(e,n){this.childNodes.push(e),t.h.insertBefore(e,n)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.h.removeChild(e)}}}ne(M(Pt,{context:t.context},e.__v),t.v)}(Ht.prototype=new H).__a=function(e){var t=this,n=Ot(t.__v),r=t.l.get(e);return r[0]++,function(i){var o=function(){t.props.revealOrder?(r.push(i),It(t,e,r)):i()};n?n(o):o()}},Ht.prototype.render=function(e){this.i=null,this.l=new Map;var t=V(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},Ht.prototype.componentDidUpdate=Ht.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){It(e,n,t)})};var Rt="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,qt=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Ut=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Vt=/[A-Z0-9]/g,zt="undefined"!=typeof document,Wt=function(e){return("undefined"!=typeof Symbol&&"symbol"==w(Symbol())?/fil|che|rad/:/fil|che|ra/).test(e)};H.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(H.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Gt=l.event;function Kt(){}function Xt(){return this.cancelBubble}function Zt(){return this.defaultPrevented}l.event=function(e){return Gt&&(e=Gt(e)),e.persist=Kt,e.isPropagationStopped=Xt,e.isDefaultPrevented=Zt,e.nativeEvent=e};var Jt={enumerable:!1,configurable:!0,get:function(){return this.class}},$t=l.vnode;l.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,r={},i=-1===n.indexOf("-");for(var o in t){var u=t[o];if(!("value"===o&&"defaultValue"in t&&null==u||zt&&"children"===o&&"noscript"===n||"class"===o||"className"===o)){var a=o.toLowerCase();"defaultValue"===o&&"value"in t&&null==t.value?o="value":"download"===o&&!0===u?u="":"translate"===a&&"no"===u?u=!1:"o"===a[0]&&"n"===a[1]?"ondoubleclick"===a?o="ondblclick":"onchange"!==a||"input"!==n&&"textarea"!==n||Wt(t.type)?"onfocus"===a?o="onfocusin":"onblur"===a?o="onfocusout":Ut.test(o)&&(o=a):a=o="oninput":i&&qt.test(o)?o=o.replace(Vt,"-$&").toLowerCase():null===u&&(u=void 0),"oninput"===a&&r[o=a]&&(o="oninputCapture"),r[o]=u}}"select"==n&&r.multiple&&Array.isArray(r.value)&&(r.value=V(t.children).forEach(function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)})),"select"==n&&null!=r.defaultValue&&(r.value=V(t.children).forEach(function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value})),t.class&&!t.className?(r.class=t.class,Object.defineProperty(r,"className",Jt)):(t.className&&!t.class||t.class&&t.className)&&(r.class=r.className=t.className),e.props=r}(e),e.$$typeof=Rt,$t&&$t(e)};var Yt=l.__r;l.__r=function(e){Yt&&Yt(e),e.__c};var Qt=l.diffed;l.diffed=function(e){Qt&&Qt(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value)};var en=function(e){var t=e.to,n=void 0===t?"body":t,r=e.children,i=be(null);return ge(function(){var e=document.querySelector(n);return e&&(i.current=e),function(){i.current&&(i.current=null)}},[n]),i.current?function(e,t){var n=M(jt,{__v:e,h:t});return n.containerInfo=t,n}(r,i.current):null},tn=function(e){var t=e.controller,n=nt(function(){var e=t.state.value,n=e.mode,r=e.scale,i=e.rotate,o=e.offsetX,u=e.offsetY,a=e.enableTransition,l=o/r,s=u/r;switch(i%360){case 90:case-270:var c=[s,-l];l=c[0],s=c[1];break;case 180:case-180:var d=[-l,-s];l=d[0],s=d[1];break;case 270:case-90:var p=[-s,l];l=p[0],s=p[1]}var f={transform:"scale(".concat(r,") rotate(").concat(i,"deg) translate(").concat(l,"px, ").concat(s,"px)"),transition:a?"transform .3s":""};return n===it.WIDTH&&(f.width="100%"),n===it.PAGE&&(f.height="100%"),f});return ge(function(){t.state.value.fileType===ot.SVG&&e.onInitialization()},[]),ht("div",{className:"file-preview-image ".concat(t.state.value.theme),children:[t.state.value.fileType===ot.SVG?ht("div",{className:"svg-container",style:n.value,dangerouslySetInnerHTML:{__html:t.state.value.content},onMouseDown:function(e){return t.handleMouseDown(e)}}):ht("img",{style:n.value,src:t.state.value.content,onLoad:function(){return e.onInitialization()},onError:function(){return e.onInitialization()},onMouseDown:function(e){return t.handleMouseDown(e)}}),ht(en,{to:"#custom-controls",children:ht("div",{className:"image-toolbar-container",children:[ht("button",{title:"逆时针",className:"control-btn",onClick:function(){return t.handleRotateChange(-90)},children:ht("span",{className:"icon",children:ht(yt,{})})}),ht("button",{title:"顺时针",className:"control-btn",onClick:function(){return t.handleRotateChange(90)},children:ht("span",{className:"icon",children:ht(bt,{})})}),ht("select",{className:"img-mode",value:t.state.value.mode,onChange:function(e){var n=e.target.value;t.switchMode(n)},children:lt.map(function(e,t){return ht("option",{label:e.lable,value:e.value},t)})}),ht("div",{className:"zoom",children:[ht("button",{title:"缩小",className:"control-btn",onClick:function(e){t.zoomOutPreview(e)},children:ht("span",{className:"icon",children:ht(vt,{})})}),ht("span",{className:"zoom-level",children:[Math.round(100*t.state.value.scale),"%"]}),ht("button",{title:"放大",className:"control-btn",onClick:function(e){t.zoomInPreview(e)},children:ht("span",{className:"icon",children:ht(Dt,{})})})]}),ht("button",{title:"重置",className:"control-btn",onClick:function(){t.reSet()},children:ht("span",{className:"icon",children:ht(_t,{})})})]})})]})};"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function nn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var rn={exports:{}};!function(e){var t;t=function(){return function(){var e={173:function(e){var t=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32},n=-1;t.Diff=function(e,t){return[e,t]},t.prototype.diff_main=function(e,n,r,i){void 0===i&&(i=this.Diff_Timeout<=0?Number.MAX_VALUE:(new Date).getTime()+1e3*this.Diff_Timeout);var o=i;if(null==e||null==n)throw new Error("Null input. (diff_main)");if(e==n)return e?[new t.Diff(0,e)]:[];void 0===r&&(r=!0);var u=r,a=this.diff_commonPrefix(e,n),l=e.substring(0,a);e=e.substring(a),n=n.substring(a),a=this.diff_commonSuffix(e,n);var s=e.substring(e.length-a);e=e.substring(0,e.length-a),n=n.substring(0,n.length-a);var c=this.diff_compute_(e,n,u,o);return l&&c.unshift(new t.Diff(0,l)),s&&c.push(new t.Diff(0,s)),this.diff_cleanupMerge(c),c},t.prototype.diff_compute_=function(e,r,i,o){var u;if(!e)return[new t.Diff(1,r)];if(!r)return[new t.Diff(n,e)];var a=e.length>r.length?e:r,l=e.length>r.length?r:e,s=a.indexOf(l);if(-1!=s)return u=[new t.Diff(1,a.substring(0,s)),new t.Diff(0,l),new t.Diff(1,a.substring(s+l.length))],e.length>r.length&&(u[0][0]=u[2][0]=n),u;if(1==l.length)return[new t.Diff(n,e),new t.Diff(1,r)];var c=this.diff_halfMatch_(e,r);if(c){var d=c[0],p=c[1],f=c[2],h=c[3],m=c[4],v=this.diff_main(d,f,i,o),D=this.diff_main(p,h,i,o);return v.concat([new t.Diff(0,m)],D)}return i&&e.length>100&&r.length>100?this.diff_lineMode_(e,r,o):this.diff_bisect_(e,r,o)},t.prototype.diff_lineMode_=function(e,r,i){var o=this.diff_linesToChars_(e,r);e=o.chars1,r=o.chars2;var u=o.lineArray,a=this.diff_main(e,r,!1,i);this.diff_charsToLines_(a,u),this.diff_cleanupSemantic(a),a.push(new t.Diff(0,""));for(var l=0,s=0,c=0,d="",p="";l<a.length;){switch(a[l][0]){case 1:c++,p+=a[l][1];break;case n:s++,d+=a[l][1];break;case 0:if(s>=1&&c>=1){a.splice(l-s-c,s+c),l=l-s-c;for(var f=this.diff_main(d,p,!1,i),h=f.length-1;h>=0;h--)a.splice(l,0,f[h]);l+=f.length}c=0,s=0,d="",p=""}l++}return a.pop(),a},t.prototype.diff_bisect_=function(e,r,i){for(var o=e.length,u=r.length,a=Math.ceil((o+u)/2),l=a,s=2*a,c=new Array(s),d=new Array(s),p=0;p<s;p++)c[p]=-1,d[p]=-1;c[l+1]=0,d[l+1]=0;for(var f=o-u,h=f%2!=0,m=0,v=0,D=0,g=0,b=0;b<a&&!((new Date).getTime()>i);b++){for(var y=-b+m;y<=b-v;y+=2){for(var E=l+y,C=(k=y==-b||y!=b&&c[E-1]<c[E+1]?c[E+1]:c[E-1]+1)-y;k<o&&C<u&&e.charAt(k)==r.charAt(C);)k++,C++;if(c[E]=k,k>o)v+=2;else if(C>u)m+=2;else if(h&&(_=l+f-y)>=0&&_<s&&-1!=d[_]&&k>=(A=o-d[_]))return this.diff_bisectSplit_(e,r,k,C,i)}for(var w=-b+D;w<=b-g;w+=2){for(var A,_=l+w,F=(A=w==-b||w!=b&&d[_-1]<d[_+1]?d[_+1]:d[_-1]+1)-w;A<o&&F<u&&e.charAt(o-A-1)==r.charAt(u-F-1);)A++,F++;if(d[_]=A,A>o)g+=2;else if(F>u)D+=2;else if(!h){var k;if((E=l+f-w)>=0&&E<s&&-1!=c[E])if(C=l+(k=c[E])-E,k>=(A=o-A))return this.diff_bisectSplit_(e,r,k,C,i)}}}return[new t.Diff(n,e),new t.Diff(1,r)]},t.prototype.diff_bisectSplit_=function(e,t,n,r,i){var o=e.substring(0,n),u=t.substring(0,r),a=e.substring(n),l=t.substring(r),s=this.diff_main(o,u,!1,i),c=this.diff_main(a,l,!1,i);return s.concat(c)},t.prototype.diff_linesToChars_=function(e,t){var n=[],r={};function i(e){for(var t="",i=0,u=-1,a=n.length;u<e.length-1;){-1==(u=e.indexOf("\n",i))&&(u=e.length-1);var l=e.substring(i,u+1);(r.hasOwnProperty?r.hasOwnProperty(l):void 0!==r[l])?t+=String.fromCharCode(r[l]):(a==o&&(l=e.substring(i),u=e.length),t+=String.fromCharCode(a),r[l]=a,n[a++]=l),i=u+1}return t}n[0]="";var o=4e4,u=i(e);return o=65535,{chars1:u,chars2:i(t),lineArray:n}},t.prototype.diff_charsToLines_=function(e,t){for(var n=0;n<e.length;n++){for(var r=e[n][1],i=[],o=0;o<r.length;o++)i[o]=t[r.charCodeAt(o)];e[n][1]=i.join("")}},t.prototype.diff_commonPrefix=function(e,t){if(!e||!t||e.charAt(0)!=t.charAt(0))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,o=0;n<i;)e.substring(o,i)==t.substring(o,i)?o=n=i:r=i,i=Math.floor((r-n)/2+n);return i},t.prototype.diff_commonSuffix=function(e,t){if(!e||!t||e.charAt(e.length-1)!=t.charAt(t.length-1))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,o=0;n<i;)e.substring(e.length-i,e.length-o)==t.substring(t.length-i,t.length-o)?o=n=i:r=i,i=Math.floor((r-n)/2+n);return i},t.prototype.diff_commonOverlap_=function(e,t){var n=e.length,r=t.length;if(0==n||0==r)return 0;n>r?e=e.substring(n-r):n<r&&(t=t.substring(0,n));var i=Math.min(n,r);if(e==t)return i;for(var o=0,u=1;;){var a=e.substring(i-u),l=t.indexOf(a);if(-1==l)return o;u+=l,0!=l&&e.substring(i-u)!=t.substring(0,u)||(o=u,u++)}},t.prototype.diff_halfMatch_=function(e,t){if(this.Diff_Timeout<=0)return null;var n=e.length>t.length?e:t,r=e.length>t.length?t:e;if(n.length<4||2*r.length<n.length)return null;var i=this;function o(e,t,n){for(var r,o,u,a,l=e.substring(n,n+Math.floor(e.length/4)),s=-1,c="";-1!=(s=t.indexOf(l,s+1));){var d=i.diff_commonPrefix(e.substring(n),t.substring(s)),p=i.diff_commonSuffix(e.substring(0,n),t.substring(0,s));c.length<p+d&&(c=t.substring(s-p,s)+t.substring(s,s+d),r=e.substring(0,n-p),o=e.substring(n+d),u=t.substring(0,s-p),a=t.substring(s+d))}return 2*c.length>=e.length?[r,o,u,a,c]:null}var u,a,l,s,c,d=o(n,r,Math.ceil(n.length/4)),p=o(n,r,Math.ceil(n.length/2));return d||p?(u=p?d&&d[4].length>p[4].length?d:p:d,e.length>t.length?(a=u[0],l=u[1],s=u[2],c=u[3]):(s=u[0],c=u[1],a=u[2],l=u[3]),[a,l,s,c,u[4]]):null},t.prototype.diff_cleanupSemantic=function(e){for(var r=!1,i=[],o=0,u=null,a=0,l=0,s=0,c=0,d=0;a<e.length;)0==e[a][0]?(i[o++]=a,l=c,s=d,c=0,d=0,u=e[a][1]):(1==e[a][0]?c+=e[a][1].length:d+=e[a][1].length,u&&u.length<=Math.max(l,s)&&u.length<=Math.max(c,d)&&(e.splice(i[o-1],0,new t.Diff(n,u)),e[i[o-1]+1][0]=1,o--,a=--o>0?i[o-1]:-1,l=0,s=0,c=0,d=0,u=null,r=!0)),a++;for(r&&this.diff_cleanupMerge(e),this.diff_cleanupSemanticLossless(e),a=1;a<e.length;){if(e[a-1][0]==n&&1==e[a][0]){var p=e[a-1][1],f=e[a][1],h=this.diff_commonOverlap_(p,f),m=this.diff_commonOverlap_(f,p);h>=m?(h>=p.length/2||h>=f.length/2)&&(e.splice(a,0,new t.Diff(0,f.substring(0,h))),e[a-1][1]=p.substring(0,p.length-h),e[a+1][1]=f.substring(h),a++):(m>=p.length/2||m>=f.length/2)&&(e.splice(a,0,new t.Diff(0,p.substring(0,m))),e[a-1][0]=1,e[a-1][1]=f.substring(0,f.length-m),e[a+1][0]=n,e[a+1][1]=p.substring(m),a++),a++}a++}},t.prototype.diff_cleanupSemanticLossless=function(e){function n(e,n){if(!e||!n)return 6;var r=e.charAt(e.length-1),i=n.charAt(0),o=r.match(t.nonAlphaNumericRegex_),u=i.match(t.nonAlphaNumericRegex_),a=o&&r.match(t.whitespaceRegex_),l=u&&i.match(t.whitespaceRegex_),s=a&&r.match(t.linebreakRegex_),c=l&&i.match(t.linebreakRegex_),d=s&&e.match(t.blanklineEndRegex_),p=c&&n.match(t.blanklineStartRegex_);return d||p?5:s||c?4:o&&!a&&l?3:a||l?2:o||u?1:0}for(var r=1;r<e.length-1;){if(0==e[r-1][0]&&0==e[r+1][0]){var i=e[r-1][1],o=e[r][1],u=e[r+1][1],a=this.diff_commonSuffix(i,o);if(a){var l=o.substring(o.length-a);i=i.substring(0,i.length-a),o=l+o.substring(0,o.length-a),u=l+u}for(var s=i,c=o,d=u,p=n(i,o)+n(o,u);o.charAt(0)===u.charAt(0);){i+=o.charAt(0),o=o.substring(1)+u.charAt(0),u=u.substring(1);var f=n(i,o)+n(o,u);f>=p&&(p=f,s=i,c=o,d=u)}e[r-1][1]!=s&&(s?e[r-1][1]=s:(e.splice(r-1,1),r--),e[r][1]=c,d?e[r+1][1]=d:(e.splice(r+1,1),r--))}r++}},t.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,t.whitespaceRegex_=/\s/,t.linebreakRegex_=/[\r\n]/,t.blanklineEndRegex_=/\n\r?\n$/,t.blanklineStartRegex_=/^\r?\n\r?\n/,t.prototype.diff_cleanupEfficiency=function(e){for(var r=!1,i=[],o=0,u=null,a=0,l=!1,s=!1,c=!1,d=!1;a<e.length;)0==e[a][0]?(e[a][1].length<this.Diff_EditCost&&(c||d)?(i[o++]=a,l=c,s=d,u=e[a][1]):(o=0,u=null),c=d=!1):(e[a][0]==n?d=!0:c=!0,u&&(l&&s&&c&&d||u.length<this.Diff_EditCost/2&&l+s+c+d==3)&&(e.splice(i[o-1],0,new t.Diff(n,u)),e[i[o-1]+1][0]=1,o--,u=null,l&&s?(c=d=!0,o=0):(a=--o>0?i[o-1]:-1,c=d=!1),r=!0)),a++;r&&this.diff_cleanupMerge(e)},t.prototype.diff_cleanupMerge=function(e){e.push(new t.Diff(0,""));for(var r,i=0,o=0,u=0,a="",l="";i<e.length;)switch(e[i][0]){case 1:u++,l+=e[i][1],i++;break;case n:o++,a+=e[i][1],i++;break;case 0:o+u>1?(0!==o&&0!==u&&(0!==(r=this.diff_commonPrefix(l,a))&&(i-o-u>0&&0==e[i-o-u-1][0]?e[i-o-u-1][1]+=l.substring(0,r):(e.splice(0,0,new t.Diff(0,l.substring(0,r))),i++),l=l.substring(r),a=a.substring(r)),0!==(r=this.diff_commonSuffix(l,a))&&(e[i][1]=l.substring(l.length-r)+e[i][1],l=l.substring(0,l.length-r),a=a.substring(0,a.length-r))),i-=o+u,e.splice(i,o+u),a.length&&(e.splice(i,0,new t.Diff(n,a)),i++),l.length&&(e.splice(i,0,new t.Diff(1,l)),i++),i++):0!==i&&0==e[i-1][0]?(e[i-1][1]+=e[i][1],e.splice(i,1)):i++,u=0,o=0,a="",l=""}""===e[e.length-1][1]&&e.pop();var s=!1;for(i=1;i<e.length-1;)0==e[i-1][0]&&0==e[i+1][0]&&(e[i][1].substring(e[i][1].length-e[i-1][1].length)==e[i-1][1]?(e[i][1]=e[i-1][1]+e[i][1].substring(0,e[i][1].length-e[i-1][1].length),e[i+1][1]=e[i-1][1]+e[i+1][1],e.splice(i-1,1),s=!0):e[i][1].substring(0,e[i+1][1].length)==e[i+1][1]&&(e[i-1][1]+=e[i+1][1],e[i][1]=e[i][1].substring(e[i+1][1].length)+e[i+1][1],e.splice(i+1,1),s=!0)),i++;s&&this.diff_cleanupMerge(e)},t.prototype.diff_xIndex=function(e,t){var r,i=0,o=0,u=0,a=0;for(r=0;r<e.length&&(1!==e[r][0]&&(i+=e[r][1].length),e[r][0]!==n&&(o+=e[r][1].length),!(i>t));r++)u=i,a=o;return e.length!=r&&e[r][0]===n?a:a+(t-u)},t.prototype.diff_prettyHtml=function(e){for(var t=[],r=/&/g,i=/</g,o=/>/g,u=/\n/g,a=0;a<e.length;a++){var l=e[a][0],s=e[a][1].replace(r,"&amp;").replace(i,"&lt;").replace(o,"&gt;").replace(u,"&para;<br>");switch(l){case 1:t[a]='<ins style="background:#e6ffe6;">'+s+"</ins>";break;case n:t[a]='<del style="background:#ffe6e6;">'+s+"</del>";break;case 0:t[a]="<span>"+s+"</span>"}}return t.join("")},t.prototype.diff_text1=function(e){for(var t=[],n=0;n<e.length;n++)1!==e[n][0]&&(t[n]=e[n][1]);return t.join("")},t.prototype.diff_text2=function(e){for(var t=[],r=0;r<e.length;r++)e[r][0]!==n&&(t[r]=e[r][1]);return t.join("")},t.prototype.diff_levenshtein=function(e){for(var t=0,r=0,i=0,o=0;o<e.length;o++){var u=e[o][0],a=e[o][1];switch(u){case 1:r+=a.length;break;case n:i+=a.length;break;case 0:t+=Math.max(r,i),r=0,i=0}}return t+=Math.max(r,i)},t.prototype.diff_toDelta=function(e){for(var t=[],r=0;r<e.length;r++)switch(e[r][0]){case 1:t[r]="+"+encodeURI(e[r][1]);break;case n:t[r]="-"+e[r][1].length;break;case 0:t[r]="="+e[r][1].length}return t.join("\t").replace(/%20/g," ")},t.prototype.diff_fromDelta=function(e,r){for(var i=[],o=0,u=0,a=r.split(/\t/g),l=0;l<a.length;l++){var s=a[l].substring(1);switch(a[l].charAt(0)){case"+":try{i[o++]=new t.Diff(1,decodeURI(s))}catch(p){throw new Error("Illegal escape in diff_fromDelta: "+s)}break;case"-":case"=":var c=parseInt(s,10);if(isNaN(c)||c<0)throw new Error("Invalid number in diff_fromDelta: "+s);var d=e.substring(u,u+=c);"="==a[l].charAt(0)?i[o++]=new t.Diff(0,d):i[o++]=new t.Diff(n,d);break;default:if(a[l])throw new Error("Invalid diff operation in diff_fromDelta: "+a[l])}}if(u!=e.length)throw new Error("Delta length ("+u+") does not equal source text length ("+e.length+").");return i},t.prototype.match_main=function(e,t,n){if(null==e||null==t||null==n)throw new Error("Null input. (match_main)");return n=Math.max(0,Math.min(n,e.length)),e==t?0:e.length?e.substring(n,n+t.length)==t?n:this.match_bitap_(e,t,n):-1},t.prototype.match_bitap_=function(e,t,n){if(t.length>this.Match_MaxBits)throw new Error("Pattern too long for this browser.");var r=this.match_alphabet_(t),i=this;function o(e,r){var o=e/t.length,u=Math.abs(n-r);return i.Match_Distance?o+u/i.Match_Distance:u?1:o}var u=this.Match_Threshold,a=e.indexOf(t,n);-1!=a&&(u=Math.min(o(0,a),u),-1!=(a=e.lastIndexOf(t,n+t.length))&&(u=Math.min(o(0,a),u)));var l,s,c=1<<t.length-1;a=-1;for(var d,p=t.length+e.length,f=0;f<t.length;f++){for(l=0,s=p;l<s;)o(f,n+s)<=u?l=s:p=s,s=Math.floor((p-l)/2+l);p=s;var h=Math.max(1,n-s+1),m=Math.min(n+s,e.length)+t.length,v=Array(m+2);v[m+1]=(1<<f)-1;for(var D=m;D>=h;D--){var g=r[e.charAt(D-1)];if(v[D]=0===f?(v[D+1]<<1|1)&g:(v[D+1]<<1|1)&g|(d[D+1]|d[D])<<1|1|d[D+1],v[D]&c){var b=o(f,D-1);if(b<=u){if(u=b,!((a=D-1)>n))break;h=Math.max(1,2*n-a)}}}if(o(f+1,n)>u)break;d=v}return a},t.prototype.match_alphabet_=function(e){for(var t={},n=0;n<e.length;n++)t[e.charAt(n)]=0;for(n=0;n<e.length;n++)t[e.charAt(n)]|=1<<e.length-n-1;return t},t.prototype.patch_addContext_=function(e,n){if(0!=n.length){if(null===e.start2)throw Error("patch not initialized");for(var r=n.substring(e.start2,e.start2+e.length1),i=0;n.indexOf(r)!=n.lastIndexOf(r)&&r.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)i+=this.Patch_Margin,r=n.substring(e.start2-i,e.start2+e.length1+i);i+=this.Patch_Margin;var o=n.substring(e.start2-i,e.start2);o&&e.diffs.unshift(new t.Diff(0,o));var u=n.substring(e.start2+e.length1,e.start2+e.length1+i);u&&e.diffs.push(new t.Diff(0,u)),e.start1-=o.length,e.start2-=o.length,e.length1+=o.length+u.length,e.length2+=o.length+u.length}},t.prototype.patch_make=function(e,r,i){var o,u;if("string"==typeof e&&"string"==typeof r&&void 0===i)o=e,(u=this.diff_main(o,r,!0)).length>2&&(this.diff_cleanupSemantic(u),this.diff_cleanupEfficiency(u));else if(e&&"object"==w(e)&&void 0===r&&void 0===i)u=e,o=this.diff_text1(u);else if("string"==typeof e&&r&&"object"==w(r)&&void 0===i)o=e,u=r;else{if("string"!=typeof e||"string"!=typeof r||!i||"object"!=w(i))throw new Error("Unknown call format to patch_make.");o=e,u=i}if(0===u.length)return[];for(var a=[],l=new t.patch_obj,s=0,c=0,d=0,p=o,f=o,h=0;h<u.length;h++){var m=u[h][0],v=u[h][1];switch(s||0===m||(l.start1=c,l.start2=d),m){case 1:l.diffs[s++]=u[h],l.length2+=v.length,f=f.substring(0,d)+v+f.substring(d);break;case n:l.length1+=v.length,l.diffs[s++]=u[h],f=f.substring(0,d)+f.substring(d+v.length);break;case 0:v.length<=2*this.Patch_Margin&&s&&u.length!=h+1?(l.diffs[s++]=u[h],l.length1+=v.length,l.length2+=v.length):v.length>=2*this.Patch_Margin&&s&&(this.patch_addContext_(l,p),a.push(l),l=new t.patch_obj,s=0,p=f,c=d)}1!==m&&(c+=v.length),m!==n&&(d+=v.length)}return s&&(this.patch_addContext_(l,p),a.push(l)),a},t.prototype.patch_deepCopy=function(e){for(var n=[],r=0;r<e.length;r++){var i=e[r],o=new t.patch_obj;o.diffs=[];for(var u=0;u<i.diffs.length;u++)o.diffs[u]=new t.Diff(i.diffs[u][0],i.diffs[u][1]);o.start1=i.start1,o.start2=i.start2,o.length1=i.length1,o.length2=i.length2,n[r]=o}return n},t.prototype.patch_apply=function(e,t){if(0==e.length)return[t,[]];e=this.patch_deepCopy(e);var r=this.patch_addPadding(e);t=r+t+r,this.patch_splitMax(e);for(var i=0,o=[],u=0;u<e.length;u++){var a,l,s=e[u].start2+i,c=this.diff_text1(e[u].diffs),d=-1;if(c.length>this.Match_MaxBits?-1!=(a=this.match_main(t,c.substring(0,this.Match_MaxBits),s))&&(-1==(d=this.match_main(t,c.substring(c.length-this.Match_MaxBits),s+c.length-this.Match_MaxBits))||a>=d)&&(a=-1):a=this.match_main(t,c,s),-1==a)o[u]=!1,i-=e[u].length2-e[u].length1;else if(o[u]=!0,i=a-s,c==(l=-1==d?t.substring(a,a+c.length):t.substring(a,d+this.Match_MaxBits)))t=t.substring(0,a)+this.diff_text2(e[u].diffs)+t.substring(a+c.length);else{var p=this.diff_main(c,l,!1);if(c.length>this.Match_MaxBits&&this.diff_levenshtein(p)/c.length>this.Patch_DeleteThreshold)o[u]=!1;else{this.diff_cleanupSemanticLossless(p);for(var f,h=0,m=0;m<e[u].diffs.length;m++){var v=e[u].diffs[m];0!==v[0]&&(f=this.diff_xIndex(p,h)),1===v[0]?t=t.substring(0,a+f)+v[1]+t.substring(a+f):v[0]===n&&(t=t.substring(0,a+f)+t.substring(a+this.diff_xIndex(p,h+v[1].length))),v[0]!==n&&(h+=v[1].length)}}}}return[t=t.substring(r.length,t.length-r.length),o]},t.prototype.patch_addPadding=function(e){for(var n=this.Patch_Margin,r="",i=1;i<=n;i++)r+=String.fromCharCode(i);for(i=0;i<e.length;i++)e[i].start1+=n,e[i].start2+=n;var o=e[0],u=o.diffs;if(0==u.length||0!=u[0][0])u.unshift(new t.Diff(0,r)),o.start1-=n,o.start2-=n,o.length1+=n,o.length2+=n;else if(n>u[0][1].length){var a=n-u[0][1].length;u[0][1]=r.substring(u[0][1].length)+u[0][1],o.start1-=a,o.start2-=a,o.length1+=a,o.length2+=a}return 0==(u=(o=e[e.length-1]).diffs).length||0!=u[u.length-1][0]?(u.push(new t.Diff(0,r)),o.length1+=n,o.length2+=n):n>u[u.length-1][1].length&&(a=n-u[u.length-1][1].length,u[u.length-1][1]+=r.substring(0,a),o.length1+=a,o.length2+=a),r},t.prototype.patch_splitMax=function(e){for(var r=this.Match_MaxBits,i=0;i<e.length;i++)if(!(e[i].length1<=r)){var o=e[i];e.splice(i--,1);for(var u=o.start1,a=o.start2,l="";0!==o.diffs.length;){var s=new t.patch_obj,c=!0;for(s.start1=u-l.length,s.start2=a-l.length,""!==l&&(s.length1=s.length2=l.length,s.diffs.push(new t.Diff(0,l)));0!==o.diffs.length&&s.length1<r-this.Patch_Margin;){var d=o.diffs[0][0],p=o.diffs[0][1];1===d?(s.length2+=p.length,a+=p.length,s.diffs.push(o.diffs.shift()),c=!1):d===n&&1==s.diffs.length&&0==s.diffs[0][0]&&p.length>2*r?(s.length1+=p.length,u+=p.length,c=!1,s.diffs.push(new t.Diff(d,p)),o.diffs.shift()):(p=p.substring(0,r-s.length1-this.Patch_Margin),s.length1+=p.length,u+=p.length,0===d?(s.length2+=p.length,a+=p.length):c=!1,s.diffs.push(new t.Diff(d,p)),p==o.diffs[0][1]?o.diffs.shift():o.diffs[0][1]=o.diffs[0][1].substring(p.length))}l=(l=this.diff_text2(s.diffs)).substring(l.length-this.Patch_Margin);var f=this.diff_text1(o.diffs).substring(0,this.Patch_Margin);""!==f&&(s.length1+=f.length,s.length2+=f.length,0!==s.diffs.length&&0===s.diffs[s.diffs.length-1][0]?s.diffs[s.diffs.length-1][1]+=f:s.diffs.push(new t.Diff(0,f))),c||e.splice(++i,0,s)}}},t.prototype.patch_toText=function(e){for(var t=[],n=0;n<e.length;n++)t[n]=e[n];return t.join("")},t.prototype.patch_fromText=function(e){var r=[];if(!e)return r;for(var i=e.split("\n"),o=0,u=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;o<i.length;){var a=i[o].match(u);if(!a)throw new Error("Invalid patch string: "+i[o]);var l=new t.patch_obj;for(r.push(l),l.start1=parseInt(a[1],10),""===a[2]?(l.start1--,l.length1=1):"0"==a[2]?l.length1=0:(l.start1--,l.length1=parseInt(a[2],10)),l.start2=parseInt(a[3],10),""===a[4]?(l.start2--,l.length2=1):"0"==a[4]?l.length2=0:(l.start2--,l.length2=parseInt(a[4],10)),o++;o<i.length;){var s=i[o].charAt(0);try{var c=decodeURI(i[o].substring(1))}catch(d){throw new Error("Illegal escape in patch_fromText: "+c)}if("-"==s)l.diffs.push(new t.Diff(n,c));else if("+"==s)l.diffs.push(new t.Diff(1,c));else if(" "==s)l.diffs.push(new t.Diff(0,c));else{if("@"==s)break;if(""!==s)throw new Error('Invalid patch mode "'+s+'" in: '+c)}o++}}return r},(t.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0}).prototype.toString=function(){for(var e,t=["@@ -"+(0===this.length1?this.start1+",0":1==this.length1?this.start1+1:this.start1+1+","+this.length1)+" +"+(0===this.length2?this.start2+",0":1==this.length2?this.start2+1:this.start2+1+","+this.length2)+" @@\n"],r=0;r<this.diffs.length;r++){switch(this.diffs[r][0]){case 1:e="+";break;case n:e="-";break;case 0:e=" "}t[r+1]=e+encodeURI(this.diffs[r][1])+"\n"}return t.join("").replace(/%20/g," ")},e.exports=t,e.exports.diff_match_patch=t,e.exports.DIFF_DELETE=n,e.exports.DIFF_INSERT=1,e.exports.DIFF_EQUAL=0},408:function(e,t,n){n.d(t,{default:function(){return N}});var r=n(135),i=n(840),o=n(775),u=n(428),a=n(325),l=n(483),s=n(999),c=function(e){void 0===e&&(e=document);var t=function(e){var t=document.createElement("img");t.src=e.getAttribute("data-src"),t.addEventListener("load",function(){e.getAttribute("style")||e.getAttribute("class")||e.getAttribute("width")||e.getAttribute("height")||t.naturalHeight>t.naturalWidth&&t.naturalWidth/t.naturalHeight<document.querySelector(".vditor-reset").clientWidth/(window.innerHeight-40)&&t.naturalHeight>window.innerHeight-40&&(e.style.height=window.innerHeight-40+"px"),e.src=t.src}),e.removeAttribute("data-src")};if(!("IntersectionObserver"in window))return e.querySelectorAll("img").forEach(function(e){e.getAttribute("data-src")&&t(e)}),!1;window.vditorImageIntersectionObserver?(window.vditorImageIntersectionObserver.disconnect(),e.querySelectorAll("img").forEach(function(e){window.vditorImageIntersectionObserver.observe(e)})):(window.vditorImageIntersectionObserver=new IntersectionObserver(function(e){e.forEach(function(e){(void 0===e.isIntersecting?0!==e.intersectionRatio:e.isIntersecting)&&e.target.getAttribute("data-src")&&t(e.target)})}),e.querySelectorAll("img").forEach(function(e){window.vditorImageIntersectionObserver.observe(e)}))},d=n(472),p=n(280),f=n(637),h=n(825),m=n(11),v=n(194),D=n(436),g=n(229),b=n(145),y=n(538),E=n(413),C=n(106),w=n(673),A=n(214),_=n(810),F=function(e,t){if(void 0===t&&(t="zh_CN"),"undefined"!=typeof speechSynthesis&&"undefined"!=typeof SpeechSynthesisUtterance){var n=function(){var e,n;return speechSynthesis.getVoices().forEach(function(r){r.lang===t.replace("_","-")&&(e=r),r.default&&(n=r)}),e||(e=n),e},r='<svg><use xlink:href="#vditor-icon-play"></use></svg>',i='<svg><use xlink:href="#vditor-icon-pause"></use></svg>';document.getElementById("vditorIconScript")||(r='<svg viewBox="0 0 32 32"><path d="M3.436 0l25.128 16-25.128 16v-32z"></path></svg>',i='<svg viewBox="0 0 32 32"><path d="M20.617 0h9.128v32h-9.128v-32zM2.255 32v-32h9.128v32h-9.128z"></path></svg>');var o=document.querySelector(".vditor-speech");o||((o=document.createElement("button")).className="vditor-speech",e.insertAdjacentElement("beforeend",o),void 0!==speechSynthesis.onvoiceschanged&&(speechSynthesis.onvoiceschanged=n));var u=n(),a=new SpeechSynthesisUtterance;a.voice=u,a.onend=a.onerror=function(){o.style.display="none",speechSynthesis.cancel(),o.classList.remove("vditor-speech--current"),o.innerHTML=r},e.addEventListener(void 0!==window.ontouchstart?"touchend":"click",function(t){var n=t.target;if(n.classList.contains("vditor-speech")||n.parentElement.classList.contains("vditor-speech"))return o.classList.contains("vditor-speech--current")?speechSynthesis.speaking&&(speechSynthesis.paused?(speechSynthesis.resume(),o.innerHTML=i):(speechSynthesis.pause(),o.innerHTML=r)):(a.text=o.getAttribute("data-text"),speechSynthesis.speak(a),o.classList.add("vditor-speech--current"),o.innerHTML=i),(0,_.Hc)(window.vditorSpeechRange),void e.focus();if(o.style.display="none",speechSynthesis.cancel(),o.classList.remove("vditor-speech--current"),o.innerHTML=r,0!==getSelection().rangeCount){var u=getSelection().getRangeAt(0),l=u.toString().trim();if(l){window.vditorSpeechRange=u.cloneRange();var s=u.getBoundingClientRect();o.innerHTML=r,o.style.display="block",o.style.top=s.top+s.height+document.querySelector("html").scrollTop-20+"px",void 0!==window.ontouchstart?o.style.left=t.changedTouches[t.changedTouches.length-1].pageX+2+"px":o.style.left=t.clientX+2+"px",o.setAttribute("data-text",l)}}})}},k=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function u(e){try{l(r.next(e))}catch(Pe){o(Pe)}}function a(e){try{l(r.throw(e))}catch(Pe){o(Pe)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(u,a)}l((r=r.apply(e,t||[])).next())})},S=function(e,t){var n,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(u=0)),u;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,r=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){u=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){u.label=a[1];break}if(6===a[0]&&u.label<i[1]){u.label=i[1],i=a;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(a);break}i[2]&&u.ops.pop(),u.trys.pop();continue}a=t.call(e,u)}catch(Pe){a=[6,Pe],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}},T=function(e){var t,n={anchor:0,cdn:b.g.CDN,customEmoji:{},emojiPath:"".concat(b.g.CDN,"/dist/images/emoji"),hljs:b.g.HLJS_OPTIONS,icon:"ant",lang:"zh_CN",markdown:b.g.MARKDOWN_OPTIONS,math:b.g.MATH_OPTIONS,mode:"light",speech:{enable:!1},render:{media:{enable:!0}},theme:b.g.THEME_OPTIONS};return e.cdn&&((null===(t=e.theme)||void 0===t?void 0:t.path)||(n.theme.path="".concat(e.cdn,"/dist/css/content-theme")),e.emojiPath||(n.emojiPath="".concat(e.cdn,"/dist/images/emoji"))),(0,w.T)(n,e)},x=function(e,t){var n=T(t);return(0,E.G)("".concat(n.cdn,"/dist/js/lute/lute.min.js"),"vditorLuteScript").then(function(){var r=(0,A.X)({autoSpace:n.markdown.autoSpace,gfmAutoLink:n.markdown.gfmAutoLink,codeBlockPreview:n.markdown.codeBlockPreview,emojiSite:n.emojiPath,emojis:n.customEmoji,fixTermTypo:n.markdown.fixTermTypo,footnotes:n.markdown.footnotes,headingAnchor:0!==n.anchor,inlineMathDigit:n.math.inlineDigit,lazyLoadImage:n.lazyLoadImage,linkBase:n.markdown.linkBase,linkPrefix:n.markdown.linkPrefix,listStyle:n.markdown.listStyle,mark:n.markdown.mark,mathBlockPreview:n.markdown.mathBlockPreview,paragraphBeginningSpace:n.markdown.paragraphBeginningSpace,sanitize:n.markdown.sanitize,toc:n.markdown.toc});return(null==t?void 0:t.renderers)&&r.SetJSRenderers({renderers:{Md2HTML:t.renderers}}),r.SetHeadingID(!0),r.Md2HTML(e)})},B=function(e,t,n){return k(void 0,void 0,void 0,function(){var i,D,b,w;return S(this,function(A){switch(A.label){case 0:return i=T(n),[4,x(t,i)];case 1:if(D=A.sent(),i.transform&&(D=i.transform(D)),e.innerHTML=D,e.classList.add("vditor-reset"),i.i18n)return[3,5];if(["de_DE","en_US","es_ES","fr_FR","ja_JP","ko_KR","pt_BR","ru_RU","sv_SE","vi_VN","zh_CN","zh_TW"].includes(i.lang))return[3,2];throw new Error("options.lang error, see https://ld246.com/article/1549638745630#options");case 2:return w=(b="vditorI18nScript")+i.lang,document.querySelectorAll('head script[id^="'.concat(b,'"]')).forEach(function(e){e.id!==w&&document.head.removeChild(e)}),[4,(0,E.G)("".concat(i.cdn,"/dist/js/i18n/").concat(i.lang,".js"),w)];case 3:A.sent(),A.label=4;case 4:return[3,6];case 5:window.VditorI18n=i.i18n,A.label=6;case 6:return i.icon?[4,(0,E.G)("".concat(i.cdn,"/dist/js/icons/").concat(i.icon,".js"),"vditorIconScript")]:[3,8];case 7:A.sent(),A.label=8;case 8:return(0,y.Z)(i.theme.current,i.theme.path),1===i.anchor&&e.classList.add("vditor-reset--anchor"),(0,u.O)(e,i.hljs),(0,s.s)(i.hljs,e,i.cdn),(0,d.H)(e,{cdn:i.cdn,math:i.math}),(0,f.i)(e,i.cdn,i.mode),(0,h.J)(e,i.cdn,i.mode),(0,m.K)(e,i.cdn),(0,a.P)(e,i.cdn),(0,l.v)(e,i.cdn),(0,o.p)(e,i.cdn,i.mode),(0,v.P)(e,i.cdn,i.mode),(0,g.B)(e,i.cdn),(0,r.Q)(e,i.cdn),i.render.media.enable&&(0,p.Y)(e),i.speech.enable&&F(e),0!==i.anchor&&(_=i.anchor,document.querySelectorAll(".vditor-anchor").forEach(function(e){1===_&&e.classList.add("vditor-anchor--left"),e.onclick=function(){var t=e.getAttribute("href").substr(1),n=document.getElementById("vditorAnchor-"+t).offsetTop;document.querySelector("html").scrollTop=n}}),window.onhashchange=function(){var e=document.getElementById("vditorAnchor-"+decodeURIComponent(window.location.hash.substr(1)));e&&(document.querySelector("html").scrollTop=e.offsetTop)}),i.after&&i.after(),i.lazyLoadImage&&c(e),e.addEventListener("click",function(t){var n=(0,C.lG)(t.target,"SPAN");if(n&&(0,C.fb)(n,"vditor-toc")){var r=e.querySelector("#"+n.getAttribute("data-target-id"));r&&window.scrollTo(window.scrollX,r.offsetTop)}}),[2]}var _})})},L=n(190),M=n(580),N=function(){function e(){}return e.adapterRender=i,e.previewImage=L.E,e.codeRender=u.O,e.graphvizRender=l.v,e.highlightRender=s.s,e.mathRender=d.H,e.mermaidRender=f.i,e.SMILESRender=h.J,e.markmapRender=m.K,e.flowchartRender=a.P,e.chartRender=o.p,e.abcRender=r.Q,e.mindmapRender=v.P,e.plantumlRender=g.B,e.outlineRender=D.k,e.mediaRender=p.Y,e.speechRender=F,e.lazyLoadImageRender=c,e.md2html=x,e.preview=B,e.setCodeTheme=M.Y,e.setContentTheme=y.Z,e}()},145:function(e,t,n){n.d(t,{H:function(){return r},g:function(){return i}});var r="3.11.2",i=function(){function e(){}return e.ZWSP="​",e.DROP_EDITOR="application/editor",e.MOBILE_WIDTH=520,e.CLASS_MENU_DISABLED="vditor-menu--disabled",e.EDIT_TOOLBARS=["emoji","headings","bold","italic","strike","link","list","ordered-list","outdent","indent","check","line","quote","code","inline-code","insert-after","insert-before","upload","record","table"],e.CODE_THEME=["a11y-dark","agate","an-old-hope","androidstudio","arta","atom-one-dark","atom-one-dark-reasonable","base16/3024","base16/apathy","base16/apprentice","base16/ashes","base16/atelier-cave","base16/atelier-dune","base16/atelier-estuary","base16/atelier-forest","base16/atelier-heath","base16/atelier-lakeside","base16/atelier-plateau","base16/atelier-savanna","base16/atelier-seaside","base16/atelier-sulphurpool","base16/atlas","base16/bespin","base16/black-metal","base16/black-metal-bathory","base16/black-metal-burzum","base16/black-metal-dark-funeral","base16/black-metal-gorgoroth","base16/black-metal-immortal","base16/black-metal-khold","base16/black-metal-marduk","base16/black-metal-mayhem","base16/black-metal-nile","base16/black-metal-venom","base16/brewer","base16/bright","base16/brogrammer","base16/brush-trees-dark","base16/chalk","base16/circus","base16/classic-dark","base16/codeschool","base16/colors","base16/danqing","base16/darcula","base16/dark-violet","base16/darkmoss","base16/darktooth","base16/decaf","base16/default-dark","base16/dracula","base16/edge-dark","base16/eighties","base16/embers","base16/equilibrium-dark","base16/equilibrium-gray-dark","base16/espresso","base16/eva","base16/eva-dim","base16/flat","base16/framer","base16/gigavolt","base16/google-dark","base16/grayscale-dark","base16/green-screen","base16/gruvbox-dark-hard","base16/gruvbox-dark-medium","base16/gruvbox-dark-pale","base16/gruvbox-dark-soft","base16/hardcore","base16/harmonic16-dark","base16/heetch-dark","base16/helios","base16/hopscotch","base16/horizon-dark","base16/humanoid-dark","base16/ia-dark","base16/icy-dark","base16/ir-black","base16/isotope","base16/kimber","base16/london-tube","base16/macintosh","base16/marrakesh","base16/materia","base16/material","base16/material-darker","base16/material-palenight","base16/material-vivid","base16/mellow-purple","base16/mocha","base16/monokai","base16/nebula","base16/nord","base16/nova","base16/ocean","base16/oceanicnext","base16/onedark","base16/outrun-dark","base16/papercolor-dark","base16/paraiso","base16/pasque","base16/phd","base16/pico","base16/pop","base16/porple","base16/qualia","base16/railscasts","base16/rebecca","base16/ros-pine","base16/ros-pine-moon","base16/sandcastle","base16/seti-ui","base16/silk-dark","base16/snazzy","base16/solar-flare","base16/solarized-dark","base16/spacemacs","base16/summercamp","base16/summerfruit-dark","base16/synth-midnight-terminal-dark","base16/tango","base16/tender","base16/tomorrow-night","base16/twilight","base16/unikitty-dark","base16/vulcan","base16/windows-10","base16/windows-95","base16/windows-high-contrast","base16/windows-nt","base16/woodland","base16/xcode-dusk","base16/zenburn","codepen-embed","dark","devibeans","far","felipec","github-dark","github-dark-dimmed","gml","gradient-dark","hybrid","ir-black","isbl-editor-dark","kimbie-dark","lioshi","monokai","monokai-sublime","night-owl","nnfx-dark","nord","obsidian","panda-syntax-dark","paraiso-dark","pojoaque","qtcreator-dark","rainbow","shades-of-purple","srcery","stackoverflow-dark","sunburst","tomorrow-night-blue","tomorrow-night-bright","tokyo-night-dark","vs2015","xt256","ant-design","a11y-light","arduino-light","ascetic","atom-one-light","base16/atelier-cave-light","base16/atelier-dune-light","base16/atelier-estuary-light","base16/atelier-forest-light","base16/atelier-heath-light","base16/atelier-lakeside-light","base16/atelier-plateau-light","base16/atelier-savanna-light","base16/atelier-seaside-light","base16/atelier-sulphurpool-light","base16/brush-trees","base16/classic-light","base16/cupcake","base16/cupertino","base16/default-light","base16/dirtysea","base16/edge-light","base16/equilibrium-gray-light","base16/equilibrium-light","base16/fruit-soda","base16/github","base16/google-light","base16/grayscale-light","base16/gruvbox-light-hard","base16/gruvbox-light-medium","base16/gruvbox-light-soft","base16/harmonic16-light","base16/heetch-light","base16/humanoid-light","base16/horizon-light","base16/ia-light","base16/material-lighter","base16/mexico-light","base16/one-light","base16/papercolor-light","base16/ros-pine-dawn","base16/sagelight","base16/shapeshifter","base16/silk-light","base16/solar-flare-light","base16/solarized-light","base16/summerfruit-light","base16/synth-midnight-terminal-light","base16/tomorrow","base16/unikitty-light","base16/windows-10-light","base16/windows-95-light","base16/windows-high-contrast-light","brown-paper","base16/windows-nt-light","color-brewer","docco","foundation","github","googlecode","gradient-light","grayscale","idea","intellij-light","isbl-editor-light","kimbie-light","lightfair","magula","mono-blue","nnfx-light","panda-syntax-light","paraiso-light","purebasic","qtcreator-light","routeros","school-book","stackoverflow-light","tokyo-night-light","vs","xcode","default"],e.ALIAS_CODE_LANGUAGES=["abc","plantuml","mermaid","flowchart","echarts","mindmap","graphviz","math","markmap","smiles","js","ts","html","toml","c#","bat"],e.CDN="https://unpkg.com/vditor@".concat("3.11.2"),e.MARKDOWN_OPTIONS={autoSpace:!1,gfmAutoLink:!0,codeBlockPreview:!0,fixTermTypo:!1,footnotes:!0,linkBase:"",linkPrefix:"",listStyle:!1,mark:!1,mathBlockPreview:!0,paragraphBeginningSpace:!1,sanitize:!0,toc:!1},e.HLJS_OPTIONS={enable:!0,lineNumber:!1,defaultLang:"",style:"github"},e.MATH_OPTIONS={engine:"KaTeX",inlineDigit:!1,macros:{}},e.THEME_OPTIONS={current:"light",list:{"ant-design":"Ant Design",dark:"Dark",light:"Light",wechat:"WeChat"},path:"".concat(e.CDN,"/dist/css/content-theme")},e}()},825:function(e,t,n){n.d(t,{J:function(){return a}});var r=n(145),i=n(413),o=n(840),u=n(494),a=function(e,t,n){void 0===e&&(e=document),void 0===t&&(t=r.g.CDN);var a=o.SMILESRenderAdapter.getElements(e);a.length>0&&(0,i.G)("".concat(t,"/dist/js/smiles-drawer/smiles-drawer.min.js?v=2.1.7"),"vditorAbcjsScript").then(function(){var e=new SmiDrawer({},{});a.forEach(function(t){var r=o.SMILESRenderAdapter.getCode(t).trim();if("true"!==t.getAttribute("data-processed")&&""!==r.trim()){var i="smiles"+(0,u.Wb)();t.innerHTML='<svg id="'.concat(i,'"></svg>'),e.draw(r,"#"+i,"dark"===n?"dark":void 0),t.setAttribute("data-processed","true")}})})}},135:function(e,t,n){n.d(t,{Q:function(){return u}});var r=n(145),i=n(413),o=n(840),u=function(e,t){void 0===e&&(e=document),void 0===t&&(t=r.g.CDN);var n=o.abcRenderAdapter.getElements(e);n.length>0&&(0,i.G)("".concat(t,"/dist/js/abcjs/abcjs_basic.min.js"),"vditorAbcjsScript").then(function(){n.forEach(function(e){e.parentElement.classList.contains("vditor-wysiwyg__pre")||e.parentElement.classList.contains("vditor-ir__marker--pre")||"true"!==e.getAttribute("data-processed")&&(ABCJS.renderAbc(e,o.abcRenderAdapter.getCode(e).trim()),e.style.overflowX="auto",e.setAttribute("data-processed","true"))})})}},840:function(e,t,n){n.r(t),n.d(t,{mathRenderAdapter:function(){return r},SMILESRenderAdapter:function(){return i},mermaidRenderAdapter:function(){return o},markmapRenderAdapter:function(){return u},mindmapRenderAdapter:function(){return a},chartRenderAdapter:function(){return l},abcRenderAdapter:function(){return s},graphvizRenderAdapter:function(){return c},flowchartRenderAdapter:function(){return d},plantumlRenderAdapter:function(){return p}});var r={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-math")}},i={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-smiles")}},o={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-mermaid")}},u={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-markmap")}},a={getCode:function(e){return e.getAttribute("data-code")},getElements:function(e){return e.querySelectorAll(".language-mindmap")}},l={getCode:function(e){return e.innerText},getElements:function(e){return e.querySelectorAll(".language-echarts")}},s={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-abc")}},c={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-graphviz")}},d={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-flowchart")}},p={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-plantuml")}}},775:function(e,t,n){n.d(t,{p:function(){return s}});var r=n(145),i=n(413),o=n(840),u=n(494),a=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function u(e){try{l(r.next(e))}catch(Pe){o(Pe)}}function a(e){try{l(r.throw(e))}catch(Pe){o(Pe)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(u,a)}l((r=r.apply(e,t||[])).next())})},l=function(e,t){var n,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(u=0)),u;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,r=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){u=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){u.label=a[1];break}if(6===a[0]&&u.label<i[1]){u.label=i[1],i=a;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(a);break}i[2]&&u.ops.pop(),u.trys.pop();continue}a=t.call(e,u)}catch(Pe){a=[6,Pe],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}},s=function(e,t,n){void 0===e&&(e=document),void 0===t&&(t=r.g.CDN);var s=o.chartRenderAdapter.getElements(e);s.length>0&&(0,i.G)("".concat(t,"/dist/js/echarts/echarts.min.js?v=5.5.1"),"vditorEchartsScript").then(function(){s.forEach(function(e){return a(void 0,void 0,void 0,function(){var t,r,i;return l(this,function(a){switch(a.label){case 0:if(e.parentElement.classList.contains("vditor-wysiwyg__pre")||e.parentElement.classList.contains("vditor-ir__marker--pre"))return[2];if(!(t=o.chartRenderAdapter.getCode(e).trim()))return[2];a.label=1;case 1:return a.trys.push([1,3,,4]),"true"===e.getAttribute("data-processed")?[2]:[4,(0,u.Qf)(t)];case 2:return r=a.sent(),echarts.init(e,"dark"===n?"dark":void 0).setOption(r),e.setAttribute("data-processed","true"),[3,4];case 3:return i=a.sent(),e.className="vditor-reset--error",e.innerHTML="echarts render error: <br>".concat(i),[3,4];case 4:return[2]}})})})})}},428:function(e,t,n){n.d(t,{O:function(){return o}});var r=n(105),i=n(145),o=function(e,t){Array.from(e.querySelectorAll("pre > code")).filter(function(t,n){return!(t.parentElement.classList.contains("vditor-wysiwyg__pre")||t.parentElement.classList.contains("vditor-ir__marker--pre")||t.classList.contains("language-mermaid")||t.classList.contains("language-flowchart")||t.classList.contains("language-echarts")||t.classList.contains("language-mindmap")||t.classList.contains("language-plantuml")||t.classList.contains("language-markmap")||t.classList.contains("language-abc")||t.classList.contains("language-graphviz")||t.classList.contains("language-math")||t.classList.contains("language-smiles")||t.style.maxHeight.indexOf("px")>-1||e.classList.contains("vditor-preview")&&n>5)}).forEach(function(e){var n,o,u,a=e.innerText;if(e.classList.contains("highlight-chroma")){var l=e.cloneNode(!0);l.querySelectorAll(".highlight-ln").forEach(function(e){e.remove()}),a=l.innerText}else a.endsWith("\n")&&(a=a.substr(0,a.length-1));var s='<svg><use xlink:href="#vditor-icon-copy"></use></svg>';document.getElementById("vditorIconScript")||(s='<svg viewBox="0 0 32 32"><path d="M22.545-0h-17.455c-1.6 0-2.909 1.309-2.909 2.909v20.364h2.909v-20.364h17.455v-2.909zM26.909 5.818h-16c-1.6 0-2.909 1.309-2.909 2.909v20.364c0 1.6 1.309 2.909 2.909 2.909h16c1.6 0 2.909-1.309 2.909-2.909v-20.364c0-1.6-1.309-2.909-2.909-2.909zM26.909 29.091h-16v-20.364h16v20.364z"></path></svg>');var c=document.createElement("div");c.className="vditor-copy",c.innerHTML='<span aria-label="'.concat((null===(n=window.VditorI18n)||void 0===n?void 0:n.copy)||"复制","\"\nonmouseover=\"this.setAttribute('aria-label', '").concat((null===(o=window.VditorI18n)||void 0===o?void 0:o.copy)||"复制","')\"\nclass=\"vditor-tooltipped vditor-tooltipped__w\"\nonclick=\"event.stopPropagation();this.previousElementSibling.select();document.execCommand('copy');this.setAttribute('aria-label', '").concat((null===(u=window.VditorI18n)||void 0===u?void 0:u.copied)||"已复制","');this.previousElementSibling.blur()\">").concat(s,"</span>");var d=document.createElement("textarea");d.value=(0,r.X)(a),c.insertAdjacentElement("afterbegin",d),t&&t.renderMenu&&t.renderMenu(e,c),e.before(c),e.style.maxHeight=window.outerHeight-40+"px",e.insertAdjacentHTML("afterend",'<span style="position: absolute">'.concat(i.g.ZWSP,"</span>"))})}},325:function(e,t,n){n.d(t,{P:function(){return u}});var r=n(145),i=n(413),o=n(840),u=function(e,t){void 0===t&&(t=r.g.CDN);var n=o.flowchartRenderAdapter.getElements(e);0!==n.length&&(0,i.G)("".concat(t,"/dist/js/flowchart.js/flowchart.min.js"),"vditorFlowchartScript").then(function(){n.forEach(function(e){if("true"!==e.getAttribute("data-processed")){var t=flowchart.parse(o.flowchartRenderAdapter.getCode(e));e.innerHTML="",t.drawSVG(e),e.setAttribute("data-processed","true")}})})}},483:function(e,t,n){n.d(t,{v:function(){return u}});var r=n(145),i=n(413),o=n(840),u=function(e,t){void 0===t&&(t=r.g.CDN);var n=o.graphvizRenderAdapter.getElements(e);0!==n.length&&(0,i.G)("".concat(t,"/dist/js/graphviz/viz.js"),"vditorGraphVizScript").then(function(){n.forEach(function(e){var t=o.graphvizRenderAdapter.getCode(e);if(!e.parentElement.classList.contains("vditor-wysiwyg__pre")&&!e.parentElement.classList.contains("vditor-ir__marker--pre")&&"true"!==e.getAttribute("data-processed")&&""!==t.trim()){try{var n=new Blob(["importScripts('".concat(document.getElementById("vditorGraphVizScript").src.replace("viz.js","full.render.js"),"');")],{type:"application/javascript"}),r=(window.URL||window.webkitURL).createObjectURL(n),i=new Worker(r);new Viz({worker:i}).renderSVGElement(t).then(function(t){e.innerHTML=t.outerHTML}).catch(function(t){e.innerHTML="graphviz render error: <br>".concat(t),e.className="vditor-reset--error"})}catch(e){}e.setAttribute("data-processed","true")}})})}},999:function(e,t,n){n.d(t,{s:function(){return u}});var r=n(145),i=n(413),o=n(290),u=function(e,t,n){void 0===t&&(t=document),void 0===n&&(n=r.g.CDN);var u=e.style;r.g.CODE_THEME.includes(u)||(u="github");var a=document.getElementById("vditorHljsStyle"),l="".concat(n,"/dist/js/highlight.js/styles/").concat(u,".min.css");a&&a.getAttribute("href")!==l&&a.remove(),(0,o.c)("".concat(n,"/dist/js/highlight.js/styles/").concat(u,".min.css"),"vditorHljsStyle"),!1!==e.enable&&0!==t.querySelectorAll("pre > code").length&&(0,i.G)("".concat(n,"/dist/js/highlight.js/highlight.min.js?v=11.7.0"),"vditorHljsScript").then(function(){(0,i.G)("".concat(n,"/dist/js/highlight.js/third-languages.js?v=1.0.1"),"vditorHljsThirdScript").then(function(){t.querySelectorAll("pre > code").forEach(function(t){if(!t.parentElement.classList.contains("vditor-ir__marker--pre")&&!t.parentElement.classList.contains("vditor-wysiwyg__pre")&&!(t.classList.contains("language-mermaid")||t.classList.contains("language-flowchart")||t.classList.contains("language-echarts")||t.classList.contains("language-mindmap")||t.classList.contains("language-plantuml")||t.classList.contains("language-smiles")||t.classList.contains("language-abc")||t.classList.contains("language-graphviz")||t.classList.contains("language-math"))){""!==e.defaultLang&&-1===t.className.indexOf("language-")&&t.classList.add("language-"+e.defaultLang);var n=t.className.replace("language-","");if(window.hljs.getLanguage(n)||(n="plaintext"),t.innerHTML=window.hljs.highlight(t.textContent,{language:n,ignoreIllegals:!0}).value,t.classList.add("hljs"),e.lineNumber){t.classList.add("vditor-linenumber");var r=t.querySelector(".vditor-linenumber__temp");r||((r=document.createElement("div")).className="vditor-linenumber__temp",t.insertAdjacentElement("beforeend",r));var i=getComputedStyle(t).whiteSpace,o=!1;"pre-wrap"!==i&&"pre-line"!==i||(o=!0);var u="",a=t.textContent.split(/\r\n|\r|\n/g);a.pop(),a.map(function(e){var t="";o&&(r.textContent=e||"\n",t=' style="height:'.concat(r.getBoundingClientRect().height,'px"')),u+="<span".concat(t,"></span>")}),r.style.display="none",u='<span class="vditor-linenumber__rows">'.concat(u,"</span>"),t.insertAdjacentHTML("beforeend",u)}}})})})}},11:function(e,t,n){n.d(t,{K:function(){return l}});var r=n(145),i=n(413),o=n(840),u={},a=function(e,t){var n=window.markmap,r=n.Transformer,i=n.Markmap,o=n.deriveOptions;n.globalCSS;var a=new r;e.innerHTML='<svg style="width:100%"></svg>';var l=e.firstChild,s=i.create(l,null),c=function(e,t){var n=e.transform(t),r=Object.keys(n.features).filter(function(e){return!u[e]});r.forEach(function(e){u[e]=!0});var i=e.getAssets(r),o=i.styles,a=i.scripts,l=window.markmap;return o&&l.loadCSS(o),a&&l.loadJS(a),n}(a,t),d=c.root,p=c.frontmatter,f=o(null==p?void 0:p.markmap);s.setData(d,f),s.fit()},l=function(e,t){void 0===e&&(e=document),void 0===t&&(t=r.g.CDN);var n=o.markmapRenderAdapter.getElements(e);0!==n.length&&(0,i.G)("".concat(t,"/dist/js/markmap/markmap.min.js"),"vditorMarkerScript").then(function(){n.forEach(function(e){var t=o.markmapRenderAdapter.getCode(e);if("true"!==e.getAttribute("data-processed")&&""!==t.trim()){var n=document.createElement("div");n.className="language-markmap",e.parentNode.appendChild(n),a(n,t),"CODE"==e.parentNode.childNodes[0].nodeName&&e.parentNode.removeChild(e.parentNode.childNodes[0])}})})}},472:function(e,t,n){n.d(t,{H:function(){return l}});var r=n(145),i=n(413),o=n(290),u=n(105),a=n(840),l=function(e,t){void 0===e&&(e=document);var n=a.mathRenderAdapter.getElements(e);if(0!==n.length){var l={cdn:r.g.CDN,math:{engine:"KaTeX",inlineDigit:!1,macros:{}}};if(t&&t.math&&(t.math=Object.assign({},l.math,t.math)),"KaTeX"===(t=Object.assign({},l,t)).math.engine)(0,o.c)("".concat(t.cdn,"/dist/js/katex/katex.min.css?v=0.16.9"),"vditorKatexStyle"),(0,i.G)("".concat(t.cdn,"/dist/js/katex/katex.min.js?v=0.16.9"),"vditorKatexScript").then(function(){(0,i.G)("".concat(t.cdn,"/dist/js/katex/mhchem.min.js?v=0.16.9"),"vditorKatexChemScript").then(function(){n.forEach(function(e){if(!e.parentElement.classList.contains("vditor-wysiwyg__pre")&&!e.parentElement.classList.contains("vditor-ir__marker--pre")&&!e.getAttribute("data-math")){var n=(0,u.X)(a.mathRenderAdapter.getCode(e));e.setAttribute("data-math",n);try{e.innerHTML=katex.renderToString(n,{displayMode:"DIV"===e.tagName,output:"html",macros:t.math.macros})}catch(Pe){e.innerHTML=Pe.message,e.className="language-math vditor-reset--error"}e.addEventListener("copy",function(e){e.stopPropagation(),e.preventDefault();var t=e.currentTarget.closest(".language-math");e.clipboardData.setData("text/html",t.innerHTML),e.clipboardData.setData("text/plain",t.getAttribute("data-math"))})}})})});else if("MathJax"===t.math.engine){window.MathJax||(window.MathJax={loader:{paths:{mathjax:"".concat(t.cdn,"/dist/js/mathjax")}},startup:{typeset:!1},tex:{macros:t.math.macros}},Object.assign(window.MathJax,t.math.mathJaxOptions)),(0,i.J)("".concat(t.cdn,"/dist/js/mathjax/tex-svg-full.js"),"protyleMathJaxScript");var s=function(e,t){var n=(0,u.X)(e.textContent).trim(),r=window.MathJax.getMetricsFor(e);r.display="DIV"===e.tagName,window.MathJax.tex2svgPromise(n,r).then(function(r){e.innerHTML="",e.setAttribute("data-math",n),e.append(r),window.MathJax.startup.document.clear(),window.MathJax.startup.document.updateDocument();var i=r.querySelector('[data-mml-node="merror"]');i&&""!==i.textContent.trim()&&(e.innerHTML=i.textContent.trim(),e.className="vditor-reset--error"),t&&t()})};window.MathJax.startup.promise.then(function(){for(var e=[],t=function(t){var r=n[t];r.parentElement.classList.contains("vditor-wysiwyg__pre")||r.parentElement.classList.contains("vditor-ir__marker--pre")||r.getAttribute("data-math")||!(0,u.X)(r.textContent).trim()||e.push(function(e){t===n.length-1?s(r):s(r,e)})},r=0;r<n.length;r++)t(r);!function(e){if(0!==e.length){var t=0,n=e[e.length-1],r=function(){var i=e[t++];i===n?i():i(r)};r()}}(e)})}}}},280:function(e,t,n){n.d(t,{Y:function(){return i}});var r=n(494),i=function(e){e&&e.querySelectorAll("a").forEach(function(e){var t=e.getAttribute("href");t&&(t.match(/^.+.(mp4|m4v|ogg|ogv|webm)$/)?function(e,t){e.insertAdjacentHTML("afterend",'<video controls="controls" src="'.concat(t,'"></video>')),e.remove()}(e,t):t.match(/^.+.(mp3|wav|flac)$/)?function(e,t){e.insertAdjacentHTML("afterend",'<audio controls="controls" src="'.concat(t,'"></audio>')),e.remove()}(e,t):function(e,t){var n=t.match(/\/\/(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))([\w|-]{11})(?:(?:[\?&]t=)(\S+))?/),i=t.match(/\/\/v\.youku\.com\/v_show\/id_(\w+)=*\.html/),o=t.match(/\/\/v\.qq\.com\/x\/cover\/.*\/([^\/]+)\.html\??.*/),u=t.match(/(?:www\.|\/\/)coub\.com\/view\/(\w+)/),a=t.match(/(?:www\.|\/\/)facebook\.com\/([^\/]+)\/videos\/([0-9]+)/),l=t.match(/.+dailymotion.com\/(video|hub)\/(\w+)\?/),s=t.match(/(?:www\.|\/\/)bilibili\.com\/video\/(\w+)/),c=t.match(/(?:www\.|\/\/)ted\.com\/talks\/(\w+)/);if(n&&11===n[1].length)e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//www.youtube.com/embed/'.concat(n[1]+(n[2]?"?start="+n[2]:""),'"></iframe>')),e.remove();else if(i&&i[1])e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//player.youku.com/embed/'.concat(i[1],'"></iframe>')),e.remove();else if(o&&o[1])e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="https://v.qq.com/txp/iframe/player.html?vid='.concat(o[1],'"></iframe>')),e.remove();else if(u&&u[1])e.insertAdjacentHTML("afterend",'<iframe class="iframe__video"\n src="//coub.com/embed/'.concat(u[1],'?muted=false&autostart=false&originalSize=true&startWithHD=true"></iframe>')),e.remove();else if(a&&a[0])e.insertAdjacentHTML("afterend",'<iframe class="iframe__video"\n src="https://www.facebook.com/plugins/video.php?href='.concat(encodeURIComponent(a[0]),'"></iframe>')),e.remove();else if(l&&l[2])e.insertAdjacentHTML("afterend",'<iframe class="iframe__video"\n src="https://www.dailymotion.com/embed/video/'.concat(l[2],'"></iframe>')),e.remove();else if(t.indexOf("bilibili.com")>-1&&(t.indexOf("bvid=")>-1||s&&s[1])){var d={bvid:(0,r.on)("bvid",t)||s&&s[1],page:"1",high_quality:"1",as_wide:"1",allowfullscreen:"true",autoplay:"0"};new URL(t.startsWith("http")?t:"https:"+t).search.split("&").forEach(function(e,t){if(e){0===t&&(e=e.substr(1));var n=e.split("=");d[n[0]]=n[1]}});var p="https://player.bilibili.com/player.html?",f=Object.keys(d);f.forEach(function(e,t){p+="".concat(e,"=").concat(d[e]),t<f.length-1&&(p+="&")}),e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="'.concat(p,'"></iframe>')),e.remove()}else c&&c[1]&&(e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//embed.ted.com/talks/'.concat(c[1],'"></iframe>')),e.remove())}(e,t))})}},637:function(e,t,n){n.d(t,{i:function(){return s}});var r=n(145),i=n(413),o=n(840),u=n(494),a=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function u(e){try{l(r.next(e))}catch(Pe){o(Pe)}}function a(e){try{l(r.throw(e))}catch(Pe){o(Pe)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(u,a)}l((r=r.apply(e,t||[])).next())})},l=function(e,t){var n,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(u=0)),u;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,r=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){u=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){u.label=a[1];break}if(6===a[0]&&u.label<i[1]){u.label=i[1],i=a;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(a);break}i[2]&&u.ops.pop(),u.trys.pop();continue}a=t.call(e,u)}catch(Pe){a=[6,Pe],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}},s=function(e,t,n){void 0===e&&(e=document),void 0===t&&(t=r.g.CDN);var s=o.mermaidRenderAdapter.getElements(e);0!==s.length&&(0,i.G)("".concat(t,"/dist/js/mermaid/mermaid.min.js?v=11.6.0"),"vditorMermaidScript").then(function(){var e={securityLevel:"loose",altFontFamily:"sans-serif",fontFamily:"sans-serif",startOnLoad:!1,flowchart:{htmlLabels:!0,useMaxWidth:!0},sequence:{useMaxWidth:!0,diagramMarginX:8,diagramMarginY:8,boxMargin:8,showSequenceNumbers:!0},gantt:{leftPadding:75,rightPadding:20}};"dark"===n&&(e.theme="dark"),mermaid.initialize(e),s.forEach(function(e){return a(void 0,void 0,void 0,function(){var t,n,r,i,a;return l(this,function(l){switch(l.label){case 0:if(t=o.mermaidRenderAdapter.getCode(e),"true"===e.getAttribute("data-processed")||""===t.trim())return[2];n="mermaid"+(0,u.Wb)(),l.label=1;case 1:return l.trys.push([1,3,,4]),[4,mermaid.render(n,e.textContent)];case 2:return r=l.sent(),e.innerHTML=r.svg,[3,4];case 3:return i=l.sent(),a=document.querySelector("#"+n),e.innerHTML="".concat(a.outerHTML,'<br>\n<div style="text-align: left"><small>').concat(i.message.replace(/\n/,"<br>"),"</small></div>"),a.parentElement.remove(),[3,4];case 4:return e.setAttribute("data-processed","true"),[2]}})})})})}},194:function(e,t,n){n.d(t,{P:function(){return u}});var r=n(145),i=n(413),o=n(840),u=function(e,t,n){void 0===e&&(e=document),void 0===t&&(t=r.g.CDN);var u=o.mindmapRenderAdapter.getElements(e);u.length>0&&(0,i.G)("".concat(t,"/dist/js/echarts/echarts.min.js?v=5.5.1"),"vditorEchartsScript").then(function(){u.forEach(function(e){if(!e.parentElement.classList.contains("vditor-wysiwyg__pre")&&!e.parentElement.classList.contains("vditor-ir__marker--pre")){var t=o.mindmapRenderAdapter.getCode(e);if(t)try{if("true"===e.getAttribute("data-processed"))return;echarts.init(e,"dark"===n?"dark":void 0).setOption({series:[{data:[JSON.parse(decodeURIComponent(t))],initialTreeDepth:-1,itemStyle:{borderWidth:0,color:"#4285f4"},label:{backgroundColor:"#f6f8fa",borderColor:"#d1d5da",borderRadius:5,borderWidth:.5,color:"#586069",lineHeight:20,offset:[-5,0],padding:[0,5],position:"insideRight"},lineStyle:{color:"#d1d5da",width:1},roam:!0,symbol:function(e,t){var n;return(null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.children)?"circle":"path://"},type:"tree"}],tooltip:{trigger:"item",triggerOn:"mousemove"}}),e.setAttribute("data-processed","true")}catch(r){e.className="vditor-reset--error",e.innerHTML="mindmap render error: <br>".concat(r)}}})})}},436:function(e,t,n){n.d(t,{k:function(){return o}});var r=n(771),i=n(472),o=function(e,t,n){var o="",u=[];if(Array.from(e.children).forEach(function(e,t){if((0,r.W)(e)){if(n){var i=e.id.lastIndexOf("_");e.id=e.id.substring(0,-1===i?void 0:i)+"_"+t}u.push(e.id),o+=e.outerHTML.replace("<wbr>","")}}),""===o)return t.innerHTML="","";var a=document.createElement("div");if(n)n.lute.SetToC(!0),"wysiwyg"!==n.currentMode||n.preview.element.contains(e)?"ir"!==n.currentMode||n.preview.element.contains(e)?a.innerHTML=n.lute.HTML2VditorDOM("<p>[ToC]</p>"+o):a.innerHTML=n.lute.SpinVditorIRDOM("<p>[ToC]</p>"+o):a.innerHTML=n.lute.SpinVditorDOM("<p>[ToC]</p>"+o),n.lute.SetToC(n.options.preview.markdown.toc);else{t.classList.add("vditor-outline");var l=Lute.New();l.SetToC(!0),a.innerHTML=l.HTML2VditorDOM("<p>[ToC]</p>"+o)}var s=a.firstElementChild.querySelectorAll("li > span[data-target-id]");return s.forEach(function(e,t){if(e.nextElementSibling&&"UL"===e.nextElementSibling.tagName){var n="<svg class='vditor-outline__action'><use xlink:href='#vditor-icon-down'></use></svg>";document.getElementById("vditorIconScript")||(n='<svg class="vditor-outline__action" viewBox="0 0 32 32"><path d="M3.76 6.12l12.24 12.213 12.24-12.213 3.76 3.76-16 16-16-16 3.76-3.76z"></path></svg>'),e.innerHTML="".concat(n,"<span>").concat(e.innerHTML,"</span>")}else e.innerHTML="<svg></svg><span>".concat(e.innerHTML,"</span>");e.setAttribute("data-target-id",u[t])}),o=a.firstElementChild.innerHTML,0===s.length?(t.innerHTML="",o):(t.innerHTML=o,n&&(0,i.H)(t,{cdn:n.options.cdn,math:n.options.preview.math}),t.firstElementChild.addEventListener("click",function(r){for(var i=r.target;i&&!i.isEqualNode(t);){if(i.classList.contains("vditor-outline__action")){i.classList.contains("vditor-outline__action--close")?(i.classList.remove("vditor-outline__action--close"),i.parentElement.nextElementSibling.setAttribute("style","display:block")):(i.classList.add("vditor-outline__action--close"),i.parentElement.nextElementSibling.setAttribute("style","display:none")),r.preventDefault(),r.stopPropagation();break}if(i.getAttribute("data-target-id")){r.preventDefault(),r.stopPropagation();var o=document.getElementById(i.getAttribute("data-target-id"));if(!o)return;if(n)if("auto"===n.options.height){var u=o.offsetTop+n.element.offsetTop;n.options.toolbarConfig.pin||(u+=n.toolbar.element.offsetHeight),window.scrollTo(window.scrollX,u)}else n.element.offsetTop<window.scrollY&&window.scrollTo(window.scrollX,n.element.offsetTop),n.preview.element.contains(e)?e.parentElement.scrollTop=o.offsetTop:e.scrollTop=o.offsetTop;else window.scrollTo(window.scrollX,o.offsetTop);break}i=i.parentElement}}),o)}},229:function(e,t,n){n.d(t,{B:function(){return u}});var r=n(145),i=n(413),o=n(840),u=function(e,t){void 0===e&&(e=document),void 0===t&&(t=r.g.CDN);var n=o.plantumlRenderAdapter.getElements(e);0!==n.length&&(0,i.G)("".concat(t,"/dist/js/plantuml/plantuml-encoder.min.js"),"vditorPlantumlScript").then(function(){n.forEach(function(e){if(!e.parentElement.classList.contains("vditor-wysiwyg__pre")&&!e.parentElement.classList.contains("vditor-ir__marker--pre")){var t=o.plantumlRenderAdapter.getCode(e).trim();if(t)try{e.innerHTML='<object type="image/svg+xml" data="https://www.plantuml.com/plantuml/svg/~1'.concat(plantumlEncoder.encode(t),'"/>')}catch(n){e.className="vditor-reset--error",e.innerHTML="plantuml render error: <br>".concat(n)}}})})}},214:function(e,t,n){n.d(t,{X:function(){return r}});var r=function(e){var t=Lute.New();return t.PutEmojis(e.emojis),t.SetEmojiSite(e.emojiSite),t.SetHeadingAnchor(e.headingAnchor),t.SetInlineMathAllowDigitAfterOpenMarker(e.inlineMathDigit),t.SetAutoSpace(e.autoSpace),t.SetToC(e.toc),t.SetFootnotes(e.footnotes),t.SetFixTermTypo(e.fixTermTypo),t.SetVditorCodeBlockPreview(e.codeBlockPreview),t.SetVditorMathBlockPreview(e.mathBlockPreview),t.SetSanitize(e.sanitize),t.SetChineseParagraphBeginningSpace(e.paragraphBeginningSpace),t.SetRenderListStyle(e.listStyle),t.SetLinkBase(e.linkBase),t.SetLinkPrefix(e.linkPrefix),t.SetMark(e.mark),t.SetGFMAutoLink(e.gfmAutoLink),e.lazyLoadImage&&t.SetImageLazyLoading(e.lazyLoadImage),t}},190:function(e,t,n){n.d(t,{E:function(){return r}});var r=function(e,t,n){void 0===n&&(n="classic");var r=e.getBoundingClientRect();document.body.insertAdjacentHTML("beforeend",'<div class="vditor vditor-img'.concat("dark"===n?" vditor--dark":"",'">\n <div class="vditor-img__bar">\n <span class="vditor-img__btn" data-deg="0">\n <svg><use xlink:href="#vditor-icon-redo"></use></svg>\n ').concat(window.VditorI18n.spin,"\n </span>\n <span class=\"vditor-img__btn\" onclick=\"this.parentElement.parentElement.outerHTML = '';document.body.style.overflow = ''\">\n X &nbsp;").concat(window.VditorI18n.close,'\n </span>\n </div>\n <div class="vditor-img__img" onclick="this.parentElement.outerHTML = \'\';document.body.style.overflow = \'\'">\n <img style="width: ').concat(e.width,"px;height:").concat(e.height,"px;transform: translate3d(").concat(r.left,"px, ").concat(r.top-36,'px, 0)" src="').concat(e.getAttribute("src"),'">\n </div>\n</div>')),document.body.style.overflow="hidden";var i=document.querySelector(".vditor-img img"),o="translate3d(".concat(Math.max(0,window.innerWidth-e.naturalWidth)/2,"px, ").concat(Math.max(0,window.innerHeight-36-e.naturalHeight)/2,"px, 0)");setTimeout(function(){i.setAttribute("style","transition: transform .3s ease-in-out;transform: ".concat(o)),setTimeout(function(){i.parentElement.scrollTo((i.parentElement.scrollWidth-i.parentElement.clientWidth)/2,(i.parentElement.scrollHeight-i.parentElement.clientHeight)/2)},400)});var u=document.querySelector(".vditor-img__btn");u.addEventListener("click",function(){var t=parseInt(u.getAttribute("data-deg"),10)+90;t/90%2==1&&e.naturalWidth>i.parentElement.clientHeight?i.style.transform="translate3d(".concat(Math.max(0,window.innerWidth-e.naturalWidth)/2,"px, ").concat(e.naturalWidth/2-e.naturalHeight/2,"px, 0) rotateZ(").concat(t,"deg)"):i.style.transform="".concat(o," rotateZ(").concat(t,"deg)"),u.setAttribute("data-deg",t.toString()),setTimeout(function(){i.parentElement.scrollTo((i.parentElement.scrollWidth-i.parentElement.clientWidth)/2,(i.parentElement.scrollHeight-i.parentElement.clientHeight)/2)},400)})}},580:function(e,t,n){n.d(t,{Y:function(){return o}});var r=n(145),i=n(290),o=function(e,t){void 0===t&&(t=r.g.CDN),r.g.CODE_THEME.includes(e)||(e="github");var n=document.getElementById("vditorHljsStyle"),o="".concat(t,"/dist/js/highlight.js/styles/").concat(e,".min.css");n?n.getAttribute("href")!==o&&(n.remove(),(0,i.c)(o,"vditorHljsStyle")):(0,i.c)(o,"vditorHljsStyle")}},538:function(e,t,n){n.d(t,{Z:function(){return i}});var r=n(290),i=function(e,t){if(e&&t){var n=document.getElementById("vditorContentTheme"),i="".concat(t,"/").concat(e,".css");n?n.getAttribute("href")!==i&&(n.remove(),(0,r.c)(i,"vditorContentTheme")):(0,r.c)(i,"vditorContentTheme")}}},413:function(e,t,n){n.d(t,{J:function(){return r},G:function(){return i}});var r=function(e,t){if(document.getElementById(t))return!1;var n=new XMLHttpRequest;n.open("GET",e,!1),n.setRequestHeader("Accept","text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01"),n.send("");var r=document.createElement("script");r.type="text/javascript",r.text=n.responseText,r.id=t,document.head.appendChild(r)},i=function(e,t){return new Promise(function(n,r){if(document.getElementById(t))return n(!0),!1;var i=document.createElement("script");i.src=e,i.async=!0,document.head.appendChild(i),i.onerror=function(e){r(e)},i.onload=function(){if(document.getElementById(t))return i.remove(),n(!0),!1;i.id=t,n(!0)}})}},290:function(e,t,n){n.d(t,{c:function(){return r}});var r=function(e,t){if(!document.getElementById(t)){var n=document.createElement("link");n.id=t,n.rel="stylesheet",n.type="text/css",n.href=e,document.getElementsByTagName("head")[0].appendChild(n)}}},105:function(e,t,n){n.d(t,{X:function(){return r}});var r=function(e){return e.replace(/\u00a0/g," ")}},410:function(e,t,n){n.d(t,{G6:function(){return r},vU:function(){return i},pK:function(){return o},Le:function(){return u},yl:function(){return a},ns:function(){return l},i7:function(){return s}});var r=function(){return navigator.userAgent.indexOf("Safari")>-1&&-1===navigator.userAgent.indexOf("Chrome")},i=function(){return navigator.userAgent.toLowerCase().indexOf("firefox")>-1},o=function(){try{return"undefined"!=typeof localStorage}catch(Pe){return!1}},u=function(){return navigator.userAgent.indexOf("iPhone")>-1?"touchstart":"click"},a=function(e){return navigator.platform.toUpperCase().indexOf("MAC")>=0?!(!e.metaKey||e.ctrlKey):!(e.metaKey||!e.ctrlKey)},l=function(e){return/Mac/.test(navigator.platform)||"iPhone"===navigator.platform?e.indexOf("⇧")>-1&&i()&&(e=e.replace(";",":").replace("=","+").replace("-","_")):(e=(e=e.startsWith("⌘")?e.replace("⌘","⌘+"):e.startsWith("⌥")&&"⌘"!==e.substr(1,1)?e.replace("⌥","⌥+"):e.replace("⇧⌘","⌘+⇧+").replace("⌥⌘","⌥+⌘+")).replace("⌘","Ctrl").replace("⇧","Shift").replace("⌥","Alt")).indexOf("Shift")>-1&&(e=e.replace(";",":").replace("=","+").replace("-","_")),e},s=function(){return/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}},494:function(e,t,n){n.d(t,{Wb:function(){return r},on:function(){return i},Qf:function(){return o}});var r=function(){return([1e7].toString()+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,function(e){return(parseInt(e,10)^window.crypto.getRandomValues(new Uint32Array(1))[0]&15>>parseInt(e,10)/4).toString(16)})},i=function(e,t){void 0===t&&(t=window.location.search);var n=t.substring(t.indexOf("?")),r=n.indexOf("#");return new URLSearchParams(n.substring(0,r>=0?r:void 0)).get(e)},o=function(e){return Function('"use strict";return ('.concat(e,")"))()}},106:function(e,t,n){n.d(t,{JQ:function(){return i},E2:function(){return o},O9:function(){return u},a1:function(){return a},F9:function(){return l},lG:function(){return s},fb:function(){return c},DX:function(){return d}});var r=n(771),i=function(e,t){for(var n=c(e,t),r=!1,i=!1;n&&!n.classList.contains("vditor-reset")&&!i;)(r=c(n.parentElement,t))?n=r:i=!0;return n||!1},o=function(e,t){for(var n=(0,r.S)(e,t),i=!1,o=!1;n&&!n.classList.contains("vditor-reset")&&!o;)(i=(0,r.S)(n.parentElement,t))?n=i:o=!0;return n||!1},u=function(e){var t=o(e,"UL"),n=o(e,"OL"),r=t;return n&&(!t||t&&n.contains(t))&&(r=n),r},a=function(e,t,n){if(!e)return!1;3===e.nodeType&&(e=e.parentElement);for(var r=e,i=!1;r&&!i&&!r.classList.contains("vditor-reset");)r.getAttribute(t)===n?i=!0:r=r.parentElement;return i&&r},l=function(e){if(!e)return!1;3===e.nodeType&&(e=e.parentElement);var t=e,n=!1,r=a(e,"data-block","0");if(r)return r;for(;t&&!n&&!t.classList.contains("vditor-reset");)"H1"===t.tagName||"H2"===t.tagName||"H3"===t.tagName||"H4"===t.tagName||"H5"===t.tagName||"H6"===t.tagName||"P"===t.tagName||"BLOCKQUOTE"===t.tagName||"OL"===t.tagName||"UL"===t.tagName?n=!0:t=t.parentElement;return n&&t},s=function(e,t){if(!e)return!1;3===e.nodeType&&(e=e.parentElement);for(var n=e,r=!1;n&&!r&&!n.classList.contains("vditor-reset");)n.nodeName===t?r=!0:n=n.parentElement;return r&&n},c=function(e,t){if(!e)return!1;3===e.nodeType&&(e=e.parentElement);for(var n=e,r=!1;n&&!r&&!n.classList.contains("vditor-reset");)n.classList.contains(t)?r=!0:n=n.parentElement;return r&&n},d=function(e){for(;e&&e.lastChild;)e=e.lastChild;return e}},771:function(e,t,n){n.d(t,{S:function(){return r},W:function(){return i}});var r=function(e,t){if(!e)return!1;3===e.nodeType&&(e=e.parentElement);for(var n=e,r=!1;n&&!r&&!n.classList.contains("vditor-reset");)0===n.nodeName.indexOf(t)?r=!0:n=n.parentElement;return r&&n},i=function(e){var t=r(e,"H");return!(!t||2!==t.tagName.length||"HR"===t.tagName)&&t}},673:function(e,t,n){n.d(t,{T:function(){return r}});var r=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n={},i=function(e){for(var t in e)e.hasOwnProperty(t)&&("[object Object]"===Object.prototype.toString.call(e[t])?n[t]=r(n[t],e[t]):n[t]=e[t])},o=0;o<e.length;o++)i(e[o]);return n}},810:function(e,t,n){n.d(t,{zh:function(){return u},Ny:function(){return a},Gb:function(){return l},Hc:function(){return s},im:function(){return c},$j:function(){return d},ib:function(){return p},oC:function(){return f}});var r=n(145),i=n(410),o=n(106),u=function(e){var t,n=e[e.currentMode].element;return getSelection().rangeCount>0&&(t=getSelection().getRangeAt(0),n.isEqualNode(t.startContainer)||n.contains(t.startContainer))?t:e[e.currentMode].range?e[e.currentMode].range:(n.focus(),(t=n.ownerDocument.createRange()).setStart(n,0),t.collapse(!0),t)},a=function(e){var t=window.getSelection().getRangeAt(0);if(!e.contains(t.startContainer)&&!(0,o.fb)(t.startContainer,"vditor-panel--none"))return{left:0,top:0};var n,r=e.parentElement.getBoundingClientRect();if(0===t.getClientRects().length)if(3===t.startContainer.nodeType){var i=t.startContainer.parentElement;if(!(i&&i.getClientRects().length>0))return{left:0,top:0};n=i.getClientRects()[0]}else{var u=t.startContainer.children;if(u[t.startOffset]&&u[t.startOffset].getClientRects().length>0)n=u[t.startOffset].getClientRects()[0];else if(t.startContainer.childNodes.length>0){var a=t.cloneRange();t.selectNode(t.startContainer.childNodes[Math.max(0,t.startOffset-1)]),n=t.getClientRects()[0],t.setEnd(a.endContainer,a.endOffset),t.setStart(a.startContainer,a.startOffset)}else n=t.startContainer.getClientRects()[0];if(!n){for(var l=t.startContainer.childNodes[t.startOffset];!l.getClientRects||l.getClientRects&&0===l.getClientRects().length;)l=l.parentElement;n=l.getClientRects()[0]}}else n=t.getClientRects()[0];return{left:n.left-r.left,top:n.top-r.top}},l=function(e,t){if(!t){if(0===getSelection().rangeCount)return!1;t=getSelection().getRangeAt(0)}var n=t.commonAncestorContainer;return e.isEqualNode(n)||e.contains(n)},s=function(e){var t=window.getSelection();t.removeAllRanges(),t.addRange(e)},c=function(e,t,n){var r={end:0,start:0};if(!n){if(0===getSelection().rangeCount)return r;n=window.getSelection().getRangeAt(0)}if(l(t,n)){var i=n.cloneRange();e.childNodes[0]&&e.childNodes[0].childNodes[0]?i.setStart(e.childNodes[0].childNodes[0],0):i.selectNodeContents(e),i.setEnd(n.startContainer,n.startOffset),r.start=i.toString().length,r.end=r.start+n.toString().length}return r},d=function(e,t,n){var r=0,i=0,o=n.childNodes[i],u=!1,a=!1;e=Math.max(0,e),t=Math.max(0,t);var l=n.ownerDocument.createRange();for(l.setStart(o||n,0),l.collapse(!0);!a&&o;){var c=r+o.textContent.length;if(!u&&e>=r&&e<=c&&(0===e?l.setStart(o,0):3===o.childNodes[0].nodeType?l.setStart(o.childNodes[0],e-r):o.nextSibling?l.setStartBefore(o.nextSibling):l.setStartAfter(o),u=!0,e===t)){a=!0;break}u&&t>=r&&t<=c&&(0===t?l.setEnd(o,0):3===o.childNodes[0].nodeType?l.setEnd(o.childNodes[0],t-r):o.nextSibling?l.setEndBefore(o.nextSibling):l.setEndAfter(o),a=!0),r=c,o=n.childNodes[++i]}return!a&&n.childNodes[i-1]&&l.setStartBefore(n.childNodes[i-1]),s(l),l},p=function(e,t){var n=e.querySelector("wbr");if(n){if(n.previousElementSibling)if(n.previousElementSibling.isSameNode(n.previousSibling)){if(n.previousElementSibling.lastChild)return t.setStartBefore(n),t.collapse(!0),s(t),!(0,i.i7)()||"EM"!==n.previousElementSibling.tagName&&"STRONG"!==n.previousElementSibling.tagName&&"S"!==n.previousElementSibling.tagName||(t.insertNode(document.createTextNode(r.g.ZWSP)),t.collapse(!1)),void n.remove();t.setStartAfter(n.previousElementSibling)}else t.setStart(n.previousSibling,n.previousSibling.textContent.length);else n.previousSibling?t.setStart(n.previousSibling,n.previousSibling.textContent.length):n.nextSibling?3===n.nextSibling.nodeType?t.setStart(n.nextSibling,0):t.setStartBefore(n.nextSibling):t.setStart(n.parentElement,0);t.collapse(!0),n.remove(),s(t)}},f=function(e,t){var n=document.createElement("div");n.innerHTML=e;var r=n.querySelectorAll("p");1===r.length&&!r[0].previousSibling&&!r[0].nextSibling&&t[t.currentMode].element.children.length>0&&"P"===n.firstElementChild.tagName&&(e=r[0].innerHTML.trim());var i=document.createElement("div");i.innerHTML=e;var a=u(t);if(""!==a.toString()&&(t[t.currentMode].preventInput=!0,document.execCommand("delete",!1,"")),i.firstElementChild&&"0"===i.firstElementChild.getAttribute("data-block")){i.lastElementChild.insertAdjacentHTML("beforeend","<wbr>");var l=(0,o.F9)(a.startContainer);if(l){var c=(0,o.lG)(a.startContainer,"LI");c&&"UL"===i.firstElementChild.tagName?c.insertAdjacentHTML("afterend",i.firstElementChild.innerHTML):l.insertAdjacentHTML("afterend",i.innerHTML)}else t[t.currentMode].element.insertAdjacentHTML("beforeend",i.innerHTML);p(t[t.currentMode].element,a)}else{var d=document.createElement("template");d.innerHTML=e,a.insertNode(d.content.cloneNode(!0)),a.collapse(!1),s(a)}}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return function(){n.d(r,{default:function(){return Er}});var e,t=n(408),i=n(145),o=n(105),u=function(e){return"sv"===e.currentMode?(0,o.X)("".concat(e.sv.element.textContent,"\n").replace(/\n\n$/,"\n")):"wysiwyg"===e.currentMode?e.lute.VditorDOM2Md(e.wysiwyg.element.innerHTML):"ir"===e.currentMode?e.lute.VditorIRDOM2Md(e.ir.element.innerHTML):""},a=n(413),l=function(){function e(){this.element=document.createElement("div"),this.element.className="vditor-devtools",this.element.innerHTML='<div class="vditor-reset--error"></div><div style="height: 100%;"></div>'}return e.prototype.renderEchart=function(e){var t=this;"block"===e.devtools.element.style.display&&(0,a.G)("".concat(e.options.cdn,"/dist/js/echarts/echarts.min.js?v=5.5.1"),"vditorEchartsScript").then(function(){t.ASTChart||(t.ASTChart=echarts.init(e.devtools.element.lastElementChild));try{t.element.lastElementChild.style.display="block",t.element.firstElementChild.innerHTML="",t.ASTChart.setOption({series:[{data:JSON.parse(e.lute.RenderEChartsJSON(u(e))),initialTreeDepth:-1,label:{align:"left",backgroundColor:"rgba(68, 77, 86, .68)",borderRadius:3,color:"#d1d5da",fontSize:12,lineHeight:12,offset:[9,12],padding:[2,4,2,4],position:"top",verticalAlign:"middle"},lineStyle:{color:"#4285f4",type:"curve",width:1},orient:"vertical",roam:!0,type:"tree"}],toolbox:{bottom:25,emphasis:{iconStyle:{color:"#4285f4"}},feature:{restore:{show:!0},saveAsImage:{show:!0}},right:15,show:!0}}),t.ASTChart.resize()}catch(Pe){t.element.lastElementChild.style.display="none",t.element.firstElementChild.innerHTML=Pe}})},e}(),s=n(410),c=function(e,t){t.forEach(function(t){if(e[t]){var n=e[t].children[0];n&&n.classList.contains("vditor-menu--current")&&n.classList.remove("vditor-menu--current")}})},d=function(e,t){t.forEach(function(t){if(e[t]){var n=e[t].children[0];n&&!n.classList.contains("vditor-menu--current")&&n.classList.add("vditor-menu--current")}})},p=function(e,t){t.forEach(function(t){if(e[t]){var n=e[t].children[0];n&&n.classList.contains(i.g.CLASS_MENU_DISABLED)&&n.classList.remove(i.g.CLASS_MENU_DISABLED)}})},f=function(e,t){t.forEach(function(t){if(e[t]){var n=e[t].children[0];n&&!n.classList.contains(i.g.CLASS_MENU_DISABLED)&&n.classList.add(i.g.CLASS_MENU_DISABLED)}})},h=function(e,t){t.forEach(function(t){e[t]&&e[t]&&(e[t].style.display="none")})},m=function(e,t){t.forEach(function(t){e[t]&&e[t]&&(e[t].style.display="block")})},v=function(e,t,n){t.includes("subToolbar")&&(e.toolbar.element.querySelectorAll(".vditor-hint").forEach(function(e){n&&e.isEqualNode(n)||(e.style.display="none")}),e.toolbar.elements.emoji&&(e.toolbar.elements.emoji.lastElementChild.style.display="none")),t.includes("hint")&&(e.hint.element.style.display="none"),e.wysiwyg.popover&&t.includes("popover")&&(e.wysiwyg.popover.style.display="none")},D=function(e,t,n,r){n.addEventListener((0,s.Le)(),function(r){r.preventDefault(),r.stopPropagation(),n.classList.contains(i.g.CLASS_MENU_DISABLED)||(e.toolbar.element.querySelectorAll(".vditor-hint--current").forEach(function(e){e.classList.remove("vditor-hint--current")}),"block"===t.style.display?t.style.display="none":(v(e,["subToolbar","hint","popover"],n.parentElement.parentElement),n.classList.contains("vditor-tooltipped")||n.classList.add("vditor-hint--current"),t.style.display="block",e.toolbar.element.getBoundingClientRect().right-n.getBoundingClientRect().right<250?t.classList.add("vditor-panel--left"):t.classList.remove("vditor-panel--left")))})},g=n(106),b=n(771),y=n(135),E=n(775),C=n(428),A=n(325),_=n(483),F=n(999),k=n(472),S=n(637),T=n(11),x=n(194),B=n(229),L=n(825),M=function(e,t){if(e)if("html-block"!==e.parentElement.getAttribute("data-type")){var n=e.firstElementChild.className.replace("language-","");"abc"===n?(0,y.Q)(e,t.options.cdn):"mermaid"===n?(0,S.i)(e,t.options.cdn,t.options.theme):"smiles"===n?(0,L.J)(e,t.options.cdn,t.options.theme):"markmap"===n?(0,T.K)(e,t.options.cdn):"flowchart"===n?(0,A.P)(e,t.options.cdn):"echarts"===n?(0,E.p)(e,t.options.cdn,t.options.theme):"mindmap"===n?(0,x.P)(e,t.options.cdn,t.options.theme):"plantuml"===n?(0,B.B)(e,t.options.cdn):"graphviz"===n?(0,_.v)(e,t.options.cdn):"math"===n?(0,k.H)(e,{cdn:t.options.cdn,math:t.options.preview.math}):t.options.customRenders.find(function(r){if(r.language===n)return r.render(e,t),!0})||((0,F.s)(Object.assign({},t.options.preview.hljs),e,t.options.cdn),(0,C.O)(e,t.options.preview.hljs)),e.setAttribute("data-render","1")}else e.setAttribute("data-render","1")},N=n(810),O=function(e){if("sv"!==e.currentMode){var t=e[e.currentMode].element,n=e.outline.render(e);""===n&&(n="[ToC]"),t.querySelectorAll('[data-type="toc-block"]').forEach(function(t){t.innerHTML=n,(0,k.H)(t,{cdn:e.options.cdn,math:e.options.preview.math})})}},H=function(e,t){var n=(0,g.lG)(e.target,"SPAN");if(n&&(0,g.fb)(n,"vditor-toc")){var r=t[t.currentMode].element.querySelector("#"+n.getAttribute("data-target-id"));if(r)if("auto"===t.options.height){var i=r.offsetTop+t.element.offsetTop;t.options.toolbarConfig.pin||(i+=t.toolbar.element.offsetHeight),window.scrollTo(window.scrollX,i)}else t.element.offsetTop<window.scrollY&&window.scrollTo(window.scrollX,t.element.offsetTop),t[t.currentMode].element.scrollTop=r.offsetTop}},I=function(e,t,n,r){if(e.previousElementSibling&&e.previousElementSibling.classList.contains("vditor-toc")){if("Backspace"===n.key&&0===(0,N.im)(e,t[t.currentMode].element,r).start)return e.previousElementSibling.remove(),Nt(t),!0;if(kt(t,n,r,e,e.previousElementSibling))return!0}if(e.nextElementSibling&&e.nextElementSibling.classList.contains("vditor-toc")){if("Delete"===n.key&&(0,N.im)(e,t[t.currentMode].element,r).start>=e.textContent.trimRight().length)return e.nextElementSibling.remove(),Nt(t),!0;if(Ft(t,n,r,e,e.nextElementSibling))return!0}if("Backspace"===n.key||"Delete"===n.key){var i=(0,g.fb)(r.startContainer,"vditor-toc");if(i)return i.remove(),Nt(t),!0}},P=function(e,t,n,r){void 0===n&&(n=!1);var o=(0,g.F9)(t.startContainer);if(o&&!n&&"code-block"!==o.getAttribute("data-type")){if(Lt(o.innerHTML)&&o.previousElementSibling||Mt(o.innerHTML))return;for(var a=(0,N.im)(o,e.ir.element,t).start,l=!0,s=a-1;s>o.textContent.substr(0,a).lastIndexOf("\n");s--)if(" "!==o.textContent.charAt(s)&&"\t"!==o.textContent.charAt(s)){l=!1;break}0===a&&(l=!1);var c=!0;for(s=a-1;s<o.textContent.length;s++)if(" "!==o.textContent.charAt(s)&&"\n"!==o.textContent.charAt(s)){c=!1;break}if(l)return void("function"==typeof e.options.input&&e.options.input(u(e)));if(c&&/^#{1,6} $/.test(o.textContent)&&(c=!1),c&&!(0,g.fb)(t.startContainer,"vditor-ir__marker")){var d=t.startContainer.previousSibling;return d&&3!==d.nodeType&&d.classList.contains("vditor-ir__node--expand")&&d.classList.remove("vditor-ir__node--expand"),void("function"==typeof e.options.input&&e.options.input(u(e)))}}if(e.ir.element.querySelectorAll(".vditor-ir__node--expand").forEach(function(e){e.classList.remove("vditor-ir__node--expand")}),o||(o=e.ir.element),!o.querySelector("wbr")){var p=(0,g.fb)(t.startContainer,"vditor-ir__preview");p?p.previousElementSibling.insertAdjacentHTML("beforeend","<wbr>"):t.insertNode(document.createElement("wbr"))}o.querySelectorAll("[style]").forEach(function(e){e.removeAttribute("style")}),"link-ref-defs-block"===o.getAttribute("data-type")&&(o=e.ir.element);var f,h=o.isEqualNode(e.ir.element),m=(0,g.a1)(o,"data-type","footnotes-block"),v="";if(h)v=o.innerHTML;else{var D=(0,b.S)(t.startContainer,"BLOCKQUOTE"),y=(0,g.O9)(t.startContainer);if(y&&(o=y),D&&(!y||y&&!D.contains(y))&&(o=D),m&&(o=m),v=o.outerHTML,"UL"===o.tagName||"OL"===o.tagName){var E=o.previousElementSibling,C=o.nextElementSibling;!E||"UL"!==E.tagName&&"OL"!==E.tagName||(v=E.outerHTML+v,E.remove()),!C||"UL"!==C.tagName&&"OL"!==C.tagName||(v+=C.outerHTML,C.remove()),v=v.replace("<div><wbr><br></div>","<li><p><wbr><br></p></li>")}else o.previousElementSibling&&""!==o.previousElementSibling.textContent.replace(i.g.ZWSP,"")&&r&&"insertParagraph"===r.inputType&&(v=o.previousElementSibling.outerHTML+v,o.previousElementSibling.remove());o.innerText.startsWith("```")||(e.ir.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(e){e&&!o.isEqualNode(e)&&(v+=e.outerHTML,e.remove())}),e.ir.element.querySelectorAll("[data-type='footnotes-block']").forEach(function(e){e&&!o.isEqualNode(e)&&(v+=e.outerHTML,e.remove())}))}if(e.options.debugger,v=e.lute.SpinVditorIRDOM(v),e.options.debugger,h)o.innerHTML=v;else if(o.outerHTML=v,m){var w=(0,g.a1)(e.ir.element.querySelector("wbr"),"data-type","footnotes-def");if(w){var A=w.textContent,_=A.substring(1,A.indexOf("]:")),F=e.ir.element.querySelector('sup[data-type="footnotes-ref"][data-footnotes-label="'.concat(_,'"]'));F&&F.setAttribute("aria-label",A.substr(_.length+3).trim().substr(0,24))}}var k,S=e.ir.element.querySelectorAll("[data-type='link-ref-defs-block']");S.forEach(function(e,t){0===t?f=e:(f.insertAdjacentHTML("beforeend",e.innerHTML),e.remove())}),S.length>0&&e.ir.element.insertAdjacentElement("beforeend",S[0]);var T=e.ir.element.querySelectorAll("[data-type='footnotes-block']");T.forEach(function(e,t){0===t?k=e:(k.insertAdjacentHTML("beforeend",e.innerHTML),e.remove())}),T.length>0&&e.ir.element.insertAdjacentElement("beforeend",T[0]),(0,N.ib)(e.ir.element,t),e.ir.element.querySelectorAll(".vditor-ir__preview[data-render='2']").forEach(function(t){M(t,e)}),O(e),en(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})},j=function(e,t){if(""===e)return!1;if(-1===e.indexOf("⇧")&&-1===e.indexOf("⌘")&&-1===e.indexOf("⌥"))return!((0,s.yl)(t)||t.altKey||t.shiftKey||t.code!==e);if("⇧Tab"===e)return!((0,s.yl)(t)||t.altKey||!t.shiftKey||"Tab"!==t.code);var n=e.split("");if(e.startsWith("⌥")){var r=3===n.length?n[2]:n[1];return!((3===n.length?!(0,s.yl)(t):(0,s.yl)(t))||!t.altKey||t.shiftKey||t.code!==(/^[0-9]$/.test(r)?"Digit":"Key")+r)}"⌘Enter"===e&&(n=["⌘","Enter"]);var i=n.length>2&&"⇧"===n[0],o=i?n[2]:n[1];return!i||!(0,s.vU)()&&/Mac/.test(navigator.platform)||("-"===o?o="_":"="===o&&(o="+")),!(!(0,s.yl)(t)||t.key.toLowerCase()!==o.toLowerCase()||t.altKey||!(!i&&!t.shiftKey||i&&t.shiftKey))},R=function(e,t){t.ir.element.querySelectorAll(".vditor-ir__node--expand").forEach(function(e){e.classList.remove("vditor-ir__node--expand")});var n=(0,g.JQ)(e.startContainer,"vditor-ir__node"),r=!e.collapsed&&(0,g.JQ)(e.endContainer,"vditor-ir__node");if(e.collapsed||n&&n===r){n&&(n.classList.add("vditor-ir__node--expand"),n.classList.remove("vditor-ir__node--hidden"),(0,N.Hc)(e));var i=function(e){var t=e.startContainer;if(3===t.nodeType&&t.nodeValue.length!==e.startOffset)return!1;for(var n=t.nextSibling;n&&""===n.textContent;)n=n.nextSibling;if(!n){var r=(0,g.fb)(t,"vditor-ir__marker");if(r&&!r.nextSibling){var i=t.parentElement.parentElement.nextSibling;if(i&&3!==i.nodeType&&i.classList.contains("vditor-ir__node"))return i}return!1}return!(!n||3===n.nodeType||!n.classList.contains("vditor-ir__node")||n.getAttribute("data-block"))&&n}(e);if(i)return i.classList.add("vditor-ir__node--expand"),void i.classList.remove("vditor-ir__node--hidden");var o=function(e){var t=e.startContainer,n=t.previousSibling;return!(3!==t.nodeType||0!==e.startOffset||!n||3===n.nodeType||!n.classList.contains("vditor-ir__node")||n.getAttribute("data-block"))&&n}(e);return o?(o.classList.add("vditor-ir__node--expand"),void o.classList.remove("vditor-ir__node--hidden")):void 0}},q=n(190),U=function(e,t){e.querySelectorAll("[data-type=footnotes-link]").forEach(function(e){for(var n=e.parentElement,r=n.nextSibling;r&&r.textContent.startsWith(" ");){var i=r;i.childNodes.forEach(function(e){n.append(e.cloneNode(!0))}),r=r.nextSibling,i.remove()}t&&t(n)})},V=function(e,t){var n,r=getSelection().getRangeAt(0).cloneRange(),i=r.startContainer;3!==r.startContainer.nodeType&&"DIV"===r.startContainer.tagName&&(i=r.startContainer.childNodes[r.startOffset-1]);var o=(0,g.a1)(i,"data-block","0");if(o&&t&&("deleteContentBackward"===t.inputType||" "===t.data)){for(var u=(0,N.im)(o,e.sv.element,r).start,a=!0,l=u-1;l>o.textContent.substr(0,u).lastIndexOf("\n");l--)if(" "!==o.textContent.charAt(l)&&"\t"!==o.textContent.charAt(l)){a=!1;break}if(0===u&&(a=!1),a)return void at(e);if("deleteContentBackward"===t.inputType){var s=(0,g.a1)(i,"data-type","code-block-open-marker")||(0,g.a1)(i,"data-type","code-block-close-marker");if(s){var c;if("code-block-close-marker"===s.getAttribute("data-type")&&(c=it(i,"code-block-open-marker")))return c.textContent=s.textContent,void at(e);if("code-block-open-marker"===s.getAttribute("data-type")&&(c=it(i,"code-block-close-marker",!1)))return c.textContent=s.textContent,void at(e)}var d=(0,g.a1)(i,"data-type","math-block-open-marker");if(d){var p=d.nextElementSibling.nextElementSibling;return void(p&&"math-block-close-marker"===p.getAttribute("data-type")&&(p.remove(),at(e)))}o.querySelectorAll('[data-type="code-block-open-marker"]').forEach(function(e){1===e.textContent.length&&e.remove()}),o.querySelectorAll('[data-type="code-block-close-marker"]').forEach(function(e){1===e.textContent.length&&e.remove()});var f=(0,g.a1)(i,"data-type","heading-marker");if(f&&-1===f.textContent.indexOf("#"))return void at(e)}if((" "===t.data||"deleteContentBackward"===t.inputType)&&((0,g.a1)(i,"data-type","padding")||(0,g.a1)(i,"data-type","li-marker")||(0,g.a1)(i,"data-type","task-marker")||(0,g.a1)(i,"data-type","blockquote-marker")))return void at(e)}if(o&&"$$"===o.textContent.trimRight())at(e);else{o||(o=e.sv.element),"link-ref-defs-block"===(null===(n=o.firstElementChild)||void 0===n?void 0:n.getAttribute("data-type"))&&(o=e.sv.element),(0,g.a1)(i,"data-type","footnotes-link")&&(o=e.sv.element),-1===o.textContent.indexOf(Lute.Caret)&&r.insertNode(document.createTextNode(Lute.Caret)),o.querySelectorAll("[style]").forEach(function(e){e.removeAttribute("style")}),o.querySelectorAll("font").forEach(function(e){e.outerHTML=e.innerHTML});var h=o.textContent,m=o.isEqualNode(e.sv.element);if(m)h=o.textContent;else{o.previousElementSibling&&(h=o.previousElementSibling.textContent+h,o.previousElementSibling.remove()),o.previousElementSibling&&0===h.indexOf("---\n")&&(h=o.previousElementSibling.textContent+h,o.previousElementSibling.remove());var v="";e.sv.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(e,t){e&&!o.isEqualNode(e.parentElement)&&(v+=e.parentElement.textContent+"\n",e.parentElement.remove())}),e.sv.element.querySelectorAll("[data-type='footnotes-link']").forEach(function(e,t){e&&!o.isEqualNode(e.parentElement)&&(v+=e.parentElement.textContent+"\n",e.parentElement.remove())}),h=v+h}h=ot(h,e),m?o.innerHTML=h:o.outerHTML=h,e.sv.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(t){e.sv.element.insertAdjacentElement("beforeend",t.parentElement)}),U(e.sv.element,function(t){e.sv.element.insertAdjacentElement("beforeend",t)}),(0,N.ib)(e.sv.element,r),et(e),at(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})}},z=n(538),W=function(e){"dark"===e.options.theme?e.element.classList.add("vditor--dark"):e.element.classList.remove("vditor--dark")},G=function(e){var t=window.innerWidth<=i.g.MOBILE_WIDTH?10:35;if("none"!==e.wysiwyg.element.parentElement.style.display){var n=(e.wysiwyg.element.parentElement.clientWidth-e.options.preview.maxWidth)/2;e.wysiwyg.element.style.padding="10px ".concat(Math.max(t,n),"px")}"none"!==e.ir.element.parentElement.style.display&&(n=(e.ir.element.parentElement.clientWidth-e.options.preview.maxWidth)/2,e.ir.element.style.padding="10px ".concat(Math.max(t,n),"px")),"block"!==e.preview.element.style.display?e.toolbar.element.style.paddingLeft=Math.max(5,parseInt(e[e.currentMode].element.style.paddingLeft||"0",10)+("left"===e.options.outline.position?e.outline.element.offsetWidth:0))+"px":e.toolbar.element.style.paddingLeft=5+("left"===e.options.outline.position?e.outline.element.offsetWidth:0)+"px"},K=function(e){if(e.options.typewriterMode){var t=window.innerHeight;"number"==typeof e.options.height?(t=e.options.height,"number"==typeof e.options.minHeight&&(t=Math.max(t,e.options.minHeight)),t=Math.min(window.innerHeight,t)):t=e.element.clientHeight,e.element.classList.contains("vditor--fullscreen")&&(t=window.innerHeight),e[e.currentMode].element.style.setProperty("--editor-bottom",(t-e.toolbar.element.offsetHeight)/2+"px")}};function X(){window.removeEventListener("resize",e)}var Z,J,$,Y,Q,ee,te,ne,re,ie,oe,ue,ae,le,se,ce,de,pe,fe,he,me,ve,De,ge,be=function(t){K(t),X(),window.addEventListener("resize",e=function(){G(t),K(t)});var n=(0,s.pK)()&&localStorage.getItem(t.options.cache.id);return t.options.cache.enable&&n||(t.options.value?n=t.options.value:t.originalInnerHTML?n=t.lute.HTML2Md(t.originalInnerHTML):t.options.cache.enable||(n="")),n||""},ye=function(e){clearTimeout(e[e.currentMode].hlToolbarTimeoutId),e[e.currentMode].hlToolbarTimeoutId=window.setTimeout(function(){if("false"!==e[e.currentMode].element.getAttribute("contenteditable")&&(0,N.Gb)(e[e.currentMode].element)){c(e.toolbar.elements,i.g.EDIT_TOOLBARS),p(e.toolbar.elements,i.g.EDIT_TOOLBARS);var t=(0,N.zh)(e),n=t.startContainer;3===t.startContainer.nodeType&&(n=t.startContainer.parentElement),n.classList.contains("vditor-reset")&&(n=n.childNodes[t.startOffset]),("sv"===e.currentMode?(0,g.a1)(n,"data-type","heading"):(0,b.W)(n))&&d(e.toolbar.elements,["headings"]),("sv"===e.currentMode?(0,g.a1)(n,"data-type","blockquote"):(0,g.lG)(n,"BLOCKQUOTE"))&&d(e.toolbar.elements,["quote"]),(0,g.a1)(n,"data-type","strong")&&d(e.toolbar.elements,["bold"]),(0,g.a1)(n,"data-type","em")&&d(e.toolbar.elements,["italic"]),(0,g.a1)(n,"data-type","s")&&d(e.toolbar.elements,["strike"]),(0,g.a1)(n,"data-type","a")&&d(e.toolbar.elements,["link"]);var r=(0,g.lG)(n,"LI");r?(r.classList.contains("vditor-task")?d(e.toolbar.elements,["check"]):"OL"===r.parentElement.tagName?d(e.toolbar.elements,["ordered-list"]):"UL"===r.parentElement.tagName&&d(e.toolbar.elements,["list"]),p(e.toolbar.elements,["outdent","indent"])):f(e.toolbar.elements,["outdent","indent"]),(0,g.a1)(n,"data-type","code-block")&&(f(e.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","inline-code","upload","link","table","record"]),d(e.toolbar.elements,["code"])),(0,g.a1)(n,"data-type","code")&&(f(e.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","upload","link","table","record"]),d(e.toolbar.elements,["inline-code"])),(0,g.a1)(n,"data-type","table")&&f(e.toolbar.elements,["headings","list","ordered-list","check","line","quote","code","table"])}},200)},Ee=function(e,t){void 0===t&&(t={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),t.enableHint&&e.hint.render(e),clearTimeout(e.wysiwyg.afterRenderTimeoutId),e.wysiwyg.afterRenderTimeoutId=window.setTimeout(function(){if(!e.wysiwyg.composingLock){var n=u(e);"function"==typeof e.options.input&&t.enableInput&&e.options.input(n),e.options.counter.enable&&e.counter.render(e,n),e.options.cache.enable&&(0,s.pK)()&&(localStorage.setItem(e.options.cache.id,n),e.options.cache.after&&e.options.cache.after(n)),e.devtools&&e.devtools.renderEchart(e),t.enableAddUndoStack&&e.undo.addToUndoStack(e)}},e.options.undoDelay)},Ce=function(e){for(var t="",n=e.nextSibling;n;)3===n.nodeType?t+=n.textContent:t+=n.outerHTML,n=n.nextSibling;return t},we=function(e){for(var t="",n=e.previousSibling;n;)t=3===n.nodeType?n.textContent+t:n.outerHTML+t,n=n.previousSibling;return t},Ae=function(e,t){Array.from(e.wysiwyg.element.childNodes).find(function(n){if(3===n.nodeType){var r=document.createElement("p");r.setAttribute("data-block","0"),r.textContent=n.textContent;var i=3===t.startContainer.nodeType?t.startOffset:n.textContent.length;return n.parentNode.insertBefore(r,n),n.remove(),t.setStart(r.firstChild,Math.min(r.firstChild.textContent.length,i)),t.collapse(!0),(0,N.Hc)(t),!0}if(!n.getAttribute("data-block"))return"P"===n.tagName?n.remove():("DIV"===n.tagName?(t.insertNode(document.createElement("wbr")),n.outerHTML='<p data-block="0">'.concat(n.innerHTML,"</p>")):"BR"===n.tagName?n.outerHTML='<p data-block="0">'.concat(n.outerHTML,"<wbr></p>"):(t.insertNode(document.createElement("wbr")),n.outerHTML='<p data-block="0">'.concat(n.outerHTML,"</p>")),(0,N.ib)(e.wysiwyg.element,t),t=getSelection().getRangeAt(0)),!0})},_e=function(e,t){var n=(0,N.zh)(e),r=(0,g.F9)(n.startContainer);r||(r=n.startContainer.childNodes[n.startOffset]),r||0!==e.wysiwyg.element.children.length||(r=e.wysiwyg.element),r&&!r.classList.contains("vditor-wysiwyg__block")&&(n.insertNode(document.createElement("wbr")),"<wbr>"===r.innerHTML.trim()&&(r.innerHTML="<wbr><br>"),"BLOCKQUOTE"===r.tagName||r.classList.contains("vditor-reset")?r.innerHTML="<".concat(t,' data-block="0">').concat(r.innerHTML.trim(),"</").concat(t,">"):r.outerHTML="<".concat(t,' data-block="0">').concat(r.innerHTML.trim(),"</").concat(t,">"),(0,N.ib)(e.wysiwyg.element,n),O(e))},Fe=function(e){var t=getSelection().getRangeAt(0),n=(0,g.F9)(t.startContainer);n||(n=t.startContainer.childNodes[t.startOffset]),n&&(t.insertNode(document.createElement("wbr")),n.outerHTML='<p data-block="0">'.concat(n.innerHTML,"</p>"),(0,N.ib)(e.wysiwyg.element,t)),e.wysiwyg.popover.style.display="none"},ke=function(e,t,n){void 0===n&&(n=!0);var r=e.previousElementSibling,i=r.ownerDocument.createRange();"CODE"===r.tagName?(r.style.display="inline-block",n?i.setStart(r.firstChild,1):i.selectNodeContents(r)):(r.style.display="block",r.firstChild.firstChild||r.firstChild.appendChild(document.createTextNode("")),i.selectNodeContents(r.firstChild)),n?i.collapse(!0):i.collapse(!1),(0,N.Hc)(i),e.firstElementChild.classList.contains("language-mindmap")||et(t)},Se=function(e,t){if(j("⇧⌘X",t)){var n=e.wysiwyg.popover.querySelector('[data-type="remove"]');return n&&n.click(),t.preventDefault(),!0}},Te=function(e){clearTimeout(e.wysiwyg.hlToolbarTimeoutId),e.wysiwyg.hlToolbarTimeoutId=window.setTimeout(function(){if("false"!==e.wysiwyg.element.getAttribute("contenteditable")&&(0,N.Gb)(e.wysiwyg.element)){c(e.toolbar.elements,i.g.EDIT_TOOLBARS),p(e.toolbar.elements,i.g.EDIT_TOOLBARS);var t=getSelection().getRangeAt(0),n=t.startContainer;n=3===t.startContainer.nodeType?t.startContainer.parentElement:n.childNodes[t.startOffset>=n.childNodes.length?n.childNodes.length-1:t.startOffset];var r=(0,g.a1)(n,"data-type","footnotes-block");if(r)return e.wysiwyg.popover.innerHTML="",Ne(r,e),je(e,"footnotes-block"),void xe(e,r);var o=(0,g.lG)(n,"LI");o?(o.classList.contains("vditor-task")?d(e.toolbar.elements,["check"]):"OL"===o.parentElement.tagName?d(e.toolbar.elements,["ordered-list"]):"UL"===o.parentElement.tagName&&d(e.toolbar.elements,["list"]),p(e.toolbar.elements,["outdent","indent"])):f(e.toolbar.elements,["outdent","indent"]),(0,g.lG)(n,"BLOCKQUOTE")&&d(e.toolbar.elements,["quote"]),((0,g.lG)(n,"B")||(0,g.lG)(n,"STRONG"))&&d(e.toolbar.elements,["bold"]),((0,g.lG)(n,"I")||(0,g.lG)(n,"EM"))&&d(e.toolbar.elements,["italic"]),((0,g.lG)(n,"STRIKE")||(0,g.lG)(n,"S"))&&d(e.toolbar.elements,["strike"]),e.wysiwyg.element.querySelectorAll(".vditor-comment--focus").forEach(function(e){e.classList.remove("vditor-comment--focus")});var a=(0,g.fb)(n,"vditor-comment");if(a){var l=a.getAttribute("data-cmtids").split(" ");if(l.length>1&&a.nextSibling.isSameNode(a.nextElementSibling)){var h=a.nextElementSibling.getAttribute("data-cmtids").split(" ");l.find(function(e){if(h.includes(e))return l=[e],!0})}e.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(e){e.getAttribute("data-cmtids").indexOf(l[0])>-1&&e.classList.add("vditor-comment--focus")})}var m=(0,g.lG)(n,"A");m&&d(e.toolbar.elements,["link"]);var v=(0,g.lG)(n,"TABLE"),D=(0,b.W)(n);(0,g.lG)(n,"CODE")?(0,g.lG)(n,"PRE")?(f(e.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","inline-code","upload","link","table","record"]),d(e.toolbar.elements,["code"])):(f(e.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","upload","link","table","record"]),d(e.toolbar.elements,["inline-code"])):D?(f(e.toolbar.elements,["bold"]),d(e.toolbar.elements,["headings"])):v&&f(e.toolbar.elements,["table"]);var y=(0,g.fb)(n,"vditor-toc");if(y)return e.wysiwyg.popover.innerHTML="",Ne(y,e),je(e,"vditor-toc"),void xe(e,y);var E=(0,b.S)(n,"BLOCKQUOTE");if(E&&(e.wysiwyg.popover.innerHTML="",Le(t,E,e),Me(t,E,e),Ne(E,e),je(e,"blockquote"),xe(e,E)),o&&(e.wysiwyg.popover.innerHTML="",Le(t,o,e),Me(t,o,e),Ne(o,e),je(e,"li"),xe(e,o)),v){e.options.lang,e.options,e.wysiwyg.popover.innerHTML="";var C=function(){var t=v.rows.length,n=v.rows[0].cells.length,r=parseInt(P.value,10)||t,i=parseInt(R.value,10)||n;if(r!==t||n!==i){if(n!==i)for(var o=i-n,a=0;a<v.rows.length;a++)if(o>0)for(var l=0;l<o;l++)0===a?v.rows[a].lastElementChild.insertAdjacentHTML("afterend","<th> </th>"):v.rows[a].lastElementChild.insertAdjacentHTML("afterend","<td> </td>");else for(var s=n-1;s>=i;s--)v.rows[a].cells[s].remove();if(t!==r){var c=r-t;if(c>0){for(var d="<tr>",p=0;p<i;p++)d+="<td> </td>";for(var f=0;f<c;f++)v.querySelector("tbody")?v.querySelector("tbody").insertAdjacentHTML("beforeend",d):v.querySelector("thead").insertAdjacentHTML("afterend",d+"</tr>")}else for(p=t-1;p>=r;p--)v.rows[p].remove(),1===v.rows.length&&v.querySelector("tbody").remove()}"function"==typeof e.options.input&&e.options.input(u(e))}},w=function(n){Bt(v,n),"right"===n?(k.classList.remove("vditor-icon--current"),S.classList.remove("vditor-icon--current"),T.classList.add("vditor-icon--current")):"center"===n?(k.classList.remove("vditor-icon--current"),T.classList.remove("vditor-icon--current"),S.classList.add("vditor-icon--current")):(S.classList.remove("vditor-icon--current"),T.classList.remove("vditor-icon--current"),k.classList.add("vditor-icon--current")),(0,N.Hc)(t),Ee(e)},A=(0,g.lG)(n,"TD"),_=(0,g.lG)(n,"TH"),F="left";A?F=A.getAttribute("align")||"left":_&&(F=_.getAttribute("align")||"center");var k=document.createElement("button");k.setAttribute("type","button"),k.setAttribute("aria-label",window.VditorI18n.alignLeft+"<"+(0,s.ns)("⇧⌘L")+">"),k.setAttribute("data-type","left"),k.innerHTML='<svg><use xlink:href="#vditor-icon-align-left"></use></svg>',k.className="vditor-icon vditor-tooltipped vditor-tooltipped__n"+("left"===F?" vditor-icon--current":""),k.onclick=function(){w("left")};var S=document.createElement("button");S.setAttribute("type","button"),S.setAttribute("aria-label",window.VditorI18n.alignCenter+"<"+(0,s.ns)("⇧⌘C")+">"),S.setAttribute("data-type","center"),S.innerHTML='<svg><use xlink:href="#vditor-icon-align-center"></use></svg>',S.className="vditor-icon vditor-tooltipped vditor-tooltipped__n"+("center"===F?" vditor-icon--current":""),S.onclick=function(){w("center")};var T=document.createElement("button");T.setAttribute("type","button"),T.setAttribute("aria-label",window.VditorI18n.alignRight+"<"+(0,s.ns)("⇧⌘R")+">"),T.setAttribute("data-type","right"),T.innerHTML='<svg><use xlink:href="#vditor-icon-align-right"></use></svg>',T.className="vditor-icon vditor-tooltipped vditor-tooltipped__n"+("right"===F?" vditor-icon--current":""),T.onclick=function(){w("right")};var x=document.createElement("button");x.setAttribute("type","button"),x.setAttribute("aria-label",window.VditorI18n.insertRowBelow+"<"+(0,s.ns)("⌘=")+">"),x.setAttribute("data-type","insertRow"),x.innerHTML='<svg><use xlink:href="#vditor-icon-insert-row"></use></svg>',x.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",x.onclick=function(){var n=getSelection().getRangeAt(0).startContainer,r=(0,g.lG)(n,"TD")||(0,g.lG)(n,"TH");r&&Pt(e,t,r)};var B=document.createElement("button");B.setAttribute("type","button"),B.setAttribute("aria-label",window.VditorI18n.insertRowAbove+"<"+(0,s.ns)("⇧⌘F")+">"),B.setAttribute("data-type","insertRow"),B.innerHTML='<svg><use xlink:href="#vditor-icon-insert-rowb"></use></svg>',B.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",B.onclick=function(){var n=getSelection().getRangeAt(0).startContainer,r=(0,g.lG)(n,"TD")||(0,g.lG)(n,"TH");r&&jt(e,t,r)};var L=document.createElement("button");L.setAttribute("type","button"),L.setAttribute("aria-label",window.VditorI18n.insertColumnRight+"<"+(0,s.ns)("⇧⌘=")+">"),L.setAttribute("data-type","insertColumn"),L.innerHTML='<svg><use xlink:href="#vditor-icon-insert-column"></use></svg>',L.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",L.onclick=function(){var t=getSelection().getRangeAt(0).startContainer,n=(0,g.lG)(t,"TD")||(0,g.lG)(t,"TH");n&&Rt(e,v,n)};var O=document.createElement("button");O.setAttribute("type","button"),O.setAttribute("aria-label",window.VditorI18n.insertColumnLeft+"<"+(0,s.ns)("⇧⌘G")+">"),O.setAttribute("data-type","insertColumn"),O.innerHTML='<svg><use xlink:href="#vditor-icon-insert-columnb"></use></svg>',O.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",O.onclick=function(){var t=getSelection().getRangeAt(0).startContainer,n=(0,g.lG)(t,"TD")||(0,g.lG)(t,"TH");n&&Rt(e,v,n,"beforebegin")};var H=document.createElement("button");H.setAttribute("type","button"),H.setAttribute("aria-label",window.VditorI18n["delete-row"]+"<"+(0,s.ns)("⌘-")+">"),H.setAttribute("data-type","deleteRow"),H.innerHTML='<svg><use xlink:href="#vditor-icon-delete-row"></use></svg>',H.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",H.onclick=function(){var n=getSelection().getRangeAt(0).startContainer,r=(0,g.lG)(n,"TD")||(0,g.lG)(n,"TH");r&&qt(e,t,r)};var I=document.createElement("button");I.setAttribute("type","button"),I.setAttribute("aria-label",window.VditorI18n["delete-column"]+"<"+(0,s.ns)("⇧⌘-")+">"),I.setAttribute("data-type","deleteColumn"),I.innerHTML='<svg><use xlink:href="#vditor-icon-delete-column"></use></svg>',I.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",I.onclick=function(){var n=getSelection().getRangeAt(0).startContainer,r=(0,g.lG)(n,"TD")||(0,g.lG)(n,"TH");r&&Ut(e,t,v,r)},(Z=document.createElement("span")).setAttribute("aria-label",window.VditorI18n.row),Z.className="vditor-tooltipped vditor-tooltipped__n";var P=document.createElement("input");Z.appendChild(P),P.type="number",P.min="1",P.className="vditor-input",P.style.width="42px",P.style.textAlign="center",P.setAttribute("placeholder",window.VditorI18n.row),P.value=v.rows.length.toString(),P.oninput=function(){C()},P.onkeydown=function(n){if(!n.isComposing)return"Tab"===n.key?(R.focus(),R.select(),void n.preventDefault()):void(Se(e,n)||Ie(n,t))};var j=document.createElement("span");j.setAttribute("aria-label",window.VditorI18n.column),j.className="vditor-tooltipped vditor-tooltipped__n";var R=document.createElement("input");j.appendChild(R),R.type="number",R.min="1",R.className="vditor-input",R.style.width="42px",R.style.textAlign="center",R.setAttribute("placeholder",window.VditorI18n.column),R.value=v.rows[0].cells.length.toString(),R.oninput=function(){C()},R.onkeydown=function(n){if(!n.isComposing)return"Tab"===n.key?(P.focus(),P.select(),void n.preventDefault()):void(Se(e,n)||Ie(n,t))},Le(t,v,e),Me(t,v,e),Ne(v,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",k),e.wysiwyg.popover.insertAdjacentElement("beforeend",S),e.wysiwyg.popover.insertAdjacentElement("beforeend",T),e.wysiwyg.popover.insertAdjacentElement("beforeend",B),e.wysiwyg.popover.insertAdjacentElement("beforeend",x),e.wysiwyg.popover.insertAdjacentElement("beforeend",O),e.wysiwyg.popover.insertAdjacentElement("beforeend",L),e.wysiwyg.popover.insertAdjacentElement("beforeend",H),e.wysiwyg.popover.insertAdjacentElement("beforeend",I),e.wysiwyg.popover.insertAdjacentElement("beforeend",Z),e.wysiwyg.popover.insertAdjacentHTML("beforeend"," x "),e.wysiwyg.popover.insertAdjacentElement("beforeend",j),je(e,"table"),xe(e,v)}var q=(0,g.a1)(n,"data-type","link-ref");q&&Be(e,q,t);var U=(0,g.a1)(n,"data-type","footnotes-ref");if(U){e.options.lang,e.options,e.wysiwyg.popover.innerHTML="",(Z=document.createElement("span")).setAttribute("aria-label",window.VditorI18n.footnoteRef+"<"+(0,s.ns)("⌥Enter")+">"),Z.className="vditor-tooltipped vditor-tooltipped__n";var V=document.createElement("input");Z.appendChild(V),V.className="vditor-input",V.setAttribute("placeholder",window.VditorI18n.footnoteRef+"<"+(0,s.ns)("⌥Enter")+">"),V.style.width="120px",V.value=U.getAttribute("data-footnotes-label"),V.oninput=function(){""!==V.value.trim()&&U.setAttribute("data-footnotes-label",V.value),"function"==typeof e.options.input&&e.options.input(u(e))},V.onkeydown=function(n){n.isComposing||Se(e,n)||Ie(n,t)},Ne(U,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",Z),je(e,"footnotes-ref"),xe(e,U)}var z=(0,g.fb)(n,"vditor-wysiwyg__block"),W=!!z&&z.getAttribute("data-type").indexOf("block")>-1;if(e.wysiwyg.element.querySelectorAll(".vditor-wysiwyg__preview").forEach(function(e){(!z||z&&W&&!z.contains(e))&&(e.previousElementSibling.style.display="none")}),z&&W){if(e.wysiwyg.popover.innerHTML="",Le(t,z,e),Me(t,z,e),Ne(z,e),"code-block"===z.getAttribute("data-type")){var G=document.createElement("span");G.setAttribute("aria-label",window.VditorI18n.language+"<"+(0,s.ns)("⌥Enter")+">"),G.className="vditor-tooltipped vditor-tooltipped__n";var K=document.createElement("input");G.appendChild(K);var X=z.firstElementChild.firstElementChild;K.className="vditor-input",K.setAttribute("placeholder",window.VditorI18n.language+"<"+(0,s.ns)("⌥Enter")+">"),K.value=X.className.indexOf("language-")>-1?X.className.split("-")[1].split(" ")[0]:"",K.oninput=function(n){""!==K.value.trim()?X.className="language-".concat(K.value):(X.className="",e.hint.recentLanguage=""),z.lastElementChild.classList.contains("vditor-wysiwyg__preview")&&(z.lastElementChild.innerHTML=z.firstElementChild.innerHTML,M(z.lastElementChild,e)),Ee(e),1===n.detail&&(t.setStart(X.firstChild,0),t.collapse(!0),(0,N.Hc)(t))},K.onkeydown=function(n){if(!n.isComposing&&!Se(e,n)){if("Escape"===n.key&&"block"===e.hint.element.style.display)return e.hint.element.style.display="none",void n.preventDefault();e.hint.select(n,e),Ie(n,t)}},K.onkeyup=function(t){var n,r;if(!t.isComposing&&"Enter"!==t.key&&"ArrowUp"!==t.key&&"Escape"!==t.key&&"ArrowDown"!==t.key){var o=[],u=K.value.substring(0,K.selectionStart);(e.options.preview.hljs.langs||i.g.ALIAS_CODE_LANGUAGES.concat((null!==(r=null===(n=window.hljs)||void 0===n?void 0:n.listLanguages())&&void 0!==r?r:[]).sort())).forEach(function(e){e.indexOf(u.toLowerCase())>-1&&o.push({html:e,value:e})}),e.hint.genHTML(o,u,e),t.preventDefault()}},e.wysiwyg.popover.insertAdjacentElement("beforeend",G),je(e,"code-block")}else je(e,"block");xe(e,z)}else z=void 0;if(D){var Z;e.wysiwyg.popover.innerHTML="",(Z=document.createElement("span")).setAttribute("aria-label","ID<"+(0,s.ns)("⌥Enter")+">"),Z.className="vditor-tooltipped vditor-tooltipped__n";var J=document.createElement("input");Z.appendChild(J),J.className="vditor-input",J.setAttribute("placeholder","ID<"+(0,s.ns)("⌥Enter")+">"),J.style.width="120px",J.value=D.getAttribute("data-id")||"",J.oninput=function(){D.setAttribute("data-id",J.value),"function"==typeof e.options.input&&e.options.input(u(e))},J.onkeydown=function(n){n.isComposing||Se(e,n)||Ie(n,t)},Le(t,D,e),Me(t,D,e),Ne(D,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",Z),je(e,"heading"),xe(e,D)}if(m&&He(e,m,t),!(E||o||v||z||m||q||U||D||y)){var $=(0,g.a1)(n,"data-block","0");$&&$.parentElement.isEqualNode(e.wysiwyg.element)?(e.wysiwyg.popover.innerHTML="",Le(t,$,e),Me(t,$,e),Ne($,e),je(e,"block"),xe(e,$)):e.wysiwyg.popover.style.display="none"}e.wysiwyg.element.querySelectorAll('span[data-type="backslash"] > span').forEach(function(e){e.style.display="none"});var Y=(0,g.a1)(t.startContainer,"data-type","backslash");Y&&(Y.querySelector("span").style.display="inline")}},200)},xe=function(e,t){var n=t,r=(0,g.lG)(t,"TABLE");r&&(n=r),e.wysiwyg.popover.style.left="0",e.wysiwyg.popover.style.display="block",e.wysiwyg.popover.style.top=Math.max(-8,n.offsetTop-21-e.wysiwyg.element.scrollTop)+"px",e.wysiwyg.popover.style.left=Math.min(n.offsetLeft,e.wysiwyg.element.clientWidth-e.wysiwyg.popover.clientWidth)+"px",e.wysiwyg.popover.setAttribute("data-top",(n.offsetTop-21).toString())},Be=function(e,t,n){void 0===n&&(n=getSelection().getRangeAt(0)),e.wysiwyg.popover.innerHTML="";var r=function(){""!==o.value.trim()&&("IMG"===t.tagName?t.setAttribute("alt",o.value):t.textContent=o.value),""!==l.value.trim()&&t.setAttribute("data-link-label",l.value),"function"==typeof e.options.input&&e.options.input(u(e))},i=document.createElement("span");i.setAttribute("aria-label",window.VditorI18n.textIsNotEmpty),i.className="vditor-tooltipped vditor-tooltipped__n";var o=document.createElement("input");i.appendChild(o),o.className="vditor-input",o.setAttribute("placeholder",window.VditorI18n.textIsNotEmpty),o.style.width="120px",o.value=t.getAttribute("alt")||t.textContent,o.oninput=function(){r()},o.onkeydown=function(r){Se(e,r)||Ie(r,n)||Oe(e,t,r,l)};var a=document.createElement("span");a.setAttribute("aria-label",window.VditorI18n.linkRef),a.className="vditor-tooltipped vditor-tooltipped__n";var l=document.createElement("input");a.appendChild(l),l.className="vditor-input",l.setAttribute("placeholder",window.VditorI18n.linkRef),l.value=t.getAttribute("data-link-label"),l.oninput=function(){r()},l.onkeydown=function(r){Se(e,r)||Ie(r,n)||Oe(e,t,r,o)},Ne(t,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",i),e.wysiwyg.popover.insertAdjacentElement("beforeend",a),je(e,"link-ref"),xe(e,t)},Le=function(e,t,n){var r=t.previousElementSibling;if(r&&(t.parentElement.isEqualNode(n.wysiwyg.element)||"LI"===t.tagName)){var i=document.createElement("button");i.setAttribute("type","button"),i.setAttribute("data-type","up"),i.setAttribute("aria-label",window.VditorI18n.up+"<"+(0,s.ns)("⇧⌘U")+">"),i.innerHTML='<svg><use xlink:href="#vditor-icon-up"></use></svg>',i.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",i.onclick=function(){e.insertNode(document.createElement("wbr")),r.insertAdjacentElement("beforebegin",t),(0,N.ib)(n.wysiwyg.element,e),Ee(n),Te(n),et(n)},n.wysiwyg.popover.insertAdjacentElement("beforeend",i)}},Me=function(e,t,n){var r=t.nextElementSibling;if(r&&(t.parentElement.isEqualNode(n.wysiwyg.element)||"LI"===t.tagName)){var i=document.createElement("button");i.setAttribute("type","button"),i.setAttribute("data-type","down"),i.setAttribute("aria-label",window.VditorI18n.down+"<"+(0,s.ns)("⇧⌘D")+">"),i.innerHTML='<svg><use xlink:href="#vditor-icon-down"></use></svg>',i.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",i.onclick=function(){e.insertNode(document.createElement("wbr")),r.insertAdjacentElement("afterend",t),(0,N.ib)(n.wysiwyg.element,e),Ee(n),Te(n),et(n)},n.wysiwyg.popover.insertAdjacentElement("beforeend",i)}},Ne=function(e,t){var n=document.createElement("button");n.setAttribute("type","button"),n.setAttribute("data-type","remove"),n.setAttribute("aria-label",window.VditorI18n.remove+"<"+(0,s.ns)("⇧⌘X")+">"),n.innerHTML='<svg><use xlink:href="#vditor-icon-trashcan"></use></svg>',n.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",n.onclick=function(){var n=(0,N.zh)(t);n.setStartAfter(e),(0,N.Hc)(n),e.remove(),Ee(t),Te(t),["H1","H2","H3","H4","H5","H6"].includes(e.tagName)&&O(t)},t.wysiwyg.popover.insertAdjacentElement("beforeend",n)},Oe=function(e,t,n,r){if(!n.isComposing){if("Tab"===n.key)return r.focus(),r.select(),void n.preventDefault();if(!(0,s.yl)(n)&&!n.shiftKey&&n.altKey&&"Enter"===n.key){var o=(0,N.zh)(e);t.insertAdjacentHTML("afterend",i.g.ZWSP),o.setStartAfter(t.nextSibling),o.collapse(!0),(0,N.Hc)(o),n.preventDefault()}}},He=function(e,t,n){e.wysiwyg.popover.innerHTML="";var r=function(){""!==o.value.trim()&&(t.innerHTML=o.value),t.setAttribute("href",a.value),t.setAttribute("title",s.value),Ee(e)};t.querySelectorAll("[data-marker]").forEach(function(e){e.removeAttribute("data-marker")});var i=document.createElement("span");i.setAttribute("aria-label",window.VditorI18n.textIsNotEmpty),i.className="vditor-tooltipped vditor-tooltipped__n";var o=document.createElement("input");i.appendChild(o),o.className="vditor-input",o.setAttribute("placeholder",window.VditorI18n.textIsNotEmpty),o.style.width="120px",o.value=t.innerHTML||"",o.oninput=function(){r()},o.onkeydown=function(r){Se(e,r)||Ie(r,n)||Oe(e,t,r,a)};var u=document.createElement("span");u.setAttribute("aria-label",window.VditorI18n.link),u.className="vditor-tooltipped vditor-tooltipped__n";var a=document.createElement("input");u.appendChild(a),a.className="vditor-input",a.setAttribute("placeholder",window.VditorI18n.link),a.value=t.getAttribute("href")||"",a.oninput=function(){r()},a.onkeydown=function(r){Se(e,r)||Ie(r,n)||Oe(e,t,r,s)};var l=document.createElement("span");l.setAttribute("aria-label",window.VditorI18n.tooltipText),l.className="vditor-tooltipped vditor-tooltipped__n";var s=document.createElement("input");l.appendChild(s),s.className="vditor-input",s.setAttribute("placeholder",window.VditorI18n.tooltipText),s.style.width="60px",s.value=t.getAttribute("title")||"",s.oninput=function(){r()},s.onkeydown=function(r){Se(e,r)||Ie(r,n)||Oe(e,t,r,o)},Ne(t,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",i),e.wysiwyg.popover.insertAdjacentElement("beforeend",u),e.wysiwyg.popover.insertAdjacentElement("beforeend",l),je(e,"a"),xe(e,t)},Ie=function(e,t){if(!(0,s.yl)(e)&&!e.shiftKey&&"Enter"===e.key||"Escape"===e.key)return t&&(0,N.Hc)(t),e.preventDefault(),e.stopPropagation(),!0},je=function(e,t){e.options.customWysiwygToolbar(t,e.wysiwyg.popover)},Re=function(e){"wysiwyg"===e.currentMode?Te(e):"ir"===e.currentMode&&ye(e)},qe=function(e,t,n){void 0===n&&(n={enableAddUndoStack:!0,enableHint:!1,enableInput:!0});var r=e.wysiwyg.element;r.innerHTML=e.lute.Md2VditorDOM(t),r.querySelectorAll(".vditor-wysiwyg__preview[data-render='2']").forEach(function(t){M(t,e),t.previousElementSibling.setAttribute("style","display:none")}),Ee(e,n)},Ue=function(e,t,n){for(var r=e.startContainer.parentElement,o=!1,u="",a="",l=function(e){var t=we(e.startContainer),n=Ce(e.startContainer),r=e.startContainer.textContent,o=e.startOffset,u="",a="";return(""!==r.substr(0,o)&&r.substr(0,o)!==i.g.ZWSP||t)&&(u="".concat(t).concat(r.substr(0,o))),(""!==r.substr(o)&&r.substr(o)!==i.g.ZWSP||n)&&(a="".concat(r.substr(o)).concat(n)),{afterHTML:a,beforeHTML:u}}(e),s=l.beforeHTML,c=l.afterHTML;r&&!o;){var d=r.tagName;if("STRIKE"===d&&(d="S"),"I"===d&&(d="EM"),"B"===d&&(d="STRONG"),"S"===d||"STRONG"===d||"EM"===d){var p="",f="",h="";"0"!==r.parentElement.getAttribute("data-block")&&(f=we(r),h=Ce(r)),(s||f)&&(s=p="".concat(f,"<").concat(d,">").concat(s,"</").concat(d,">")),("bold"===n&&"STRONG"===d||"italic"===n&&"EM"===d||"strikeThrough"===n&&"S"===d)&&(p+="".concat(u).concat(i.g.ZWSP,"<wbr>").concat(a),o=!0),(c||h)&&(p+=c="<".concat(d,">").concat(c,"</").concat(d,">").concat(h)),"0"!==r.parentElement.getAttribute("data-block")?(r=r.parentElement).innerHTML=p:(r.outerHTML=p,r=r.parentElement),u="<".concat(d,">")+u,a="</".concat(d,">")+a}else o=!0}(0,N.ib)(t.wysiwyg.element,e)},Ve=function(e,t){var n,r=this;this.element=document.createElement("div"),t.className&&(n=this.element.classList).add.apply(n,t.className.split(" "));var o=t.hotkey?" <".concat((0,s.ns)(t.hotkey),">"):"";2===t.level&&(o=t.hotkey?" &lt;".concat((0,s.ns)(t.hotkey),"&gt;"):"");var u=t.tip?t.tip+o:"".concat(window.VditorI18n[t.name]).concat(o),a="upload"===t.name?"div":"button";if(2===t.level)this.element.innerHTML="<".concat(a,' data-type="').concat(t.name,'">').concat(u,"</").concat(a,">");else{this.element.classList.add("vditor-toolbar__item");var l=document.createElement(a);l.setAttribute("data-type",t.name),l.className="vditor-tooltipped vditor-tooltipped__".concat(t.tipPosition),l.setAttribute("aria-label",u),l.innerHTML=t.icon,this.element.appendChild(l)}t.prefix&&this.element.children[0].addEventListener((0,s.Le)(),function(n){n.preventDefault(),r.element.firstElementChild.classList.contains(i.g.CLASS_MENU_DISABLED)||("wysiwyg"===e.currentMode?function(e,t,n){if(!(e.wysiwyg.composingLock&&n instanceof CustomEvent)){var r=!0,o=!0;e.wysiwyg.element.querySelector("wbr")&&e.wysiwyg.element.querySelector("wbr").remove();var u=(0,N.zh)(e),a=t.getAttribute("data-type");if(t.classList.contains("vditor-menu--current"))if("strike"===a&&(a="strikeThrough"),"quote"===a){var l=(0,g.lG)(u.startContainer,"BLOCKQUOTE");l||(l=u.startContainer.childNodes[u.startOffset]),l&&(r=!1,t.classList.remove("vditor-menu--current"),u.insertNode(document.createElement("wbr")),l.outerHTML=""===l.innerHTML.trim()?'<p data-block="0">'.concat(l.innerHTML,"</p>"):l.innerHTML,(0,N.ib)(e.wysiwyg.element,u))}else if("inline-code"===a){var s=(0,g.lG)(u.startContainer,"CODE");s||(s=u.startContainer.childNodes[u.startOffset]),s&&(s.outerHTML=s.innerHTML.replace(i.g.ZWSP,"")+"<wbr>",(0,N.ib)(e.wysiwyg.element,u))}else"link"===a?u.collapsed?(u.selectNode(u.startContainer.parentElement),document.execCommand("unlink",!1,"")):document.execCommand("unlink",!1,""):"check"===a||"list"===a||"ordered-list"===a?(St(e,u,a),(0,N.ib)(e.wysiwyg.element,u),r=!1,t.classList.remove("vditor-menu--current")):(r=!1,t.classList.remove("vditor-menu--current"),""===u.toString()?Ue(u,e,a):document.execCommand(a,!1,""));else{0===e.wysiwyg.element.childNodes.length&&(e.wysiwyg.element.innerHTML='<p data-block="0"><wbr></p>',(0,N.ib)(e.wysiwyg.element,u));var d=(0,g.F9)(u.startContainer);if("quote"===a){if(d||(d=u.startContainer.childNodes[u.startOffset]),d){r=!1,t.classList.add("vditor-menu--current"),u.insertNode(document.createElement("wbr"));var p=(0,g.lG)(u.startContainer,"LI");p&&d.contains(p)?p.innerHTML='<blockquote data-block="0">'.concat(p.innerHTML,"</blockquote>"):d.outerHTML='<blockquote data-block="0">'.concat(d.outerHTML,"</blockquote>"),(0,N.ib)(e.wysiwyg.element,u)}}else if("check"===a||"list"===a||"ordered-list"===a)St(e,u,a,!1),(0,N.ib)(e.wysiwyg.element,u),r=!1,c(e.toolbar.elements,["check","list","ordered-list"]),t.classList.add("vditor-menu--current");else if("inline-code"===a){if(""===u.toString())(f=document.createElement("code")).textContent=i.g.ZWSP,u.insertNode(f),u.setStart(f.firstChild,1),u.collapse(!0),(0,N.Hc)(u);else if(3===u.startContainer.nodeType){var f=document.createElement("code");u.surroundContents(f),u.insertNode(f),(0,N.Hc)(u)}t.classList.add("vditor-menu--current")}else if("code"===a)(f=document.createElement("div")).className="vditor-wysiwyg__block",f.setAttribute("data-type","code-block"),f.setAttribute("data-block","0"),f.setAttribute("data-marker","```"),""===u.toString()?f.innerHTML="<pre><code><wbr>\n</code></pre>":(f.innerHTML="<pre><code>".concat(u.toString(),"<wbr></code></pre>"),u.deleteContents()),u.insertNode(f),d&&(d.outerHTML=e.lute.SpinVditorDOM(d.outerHTML)),(0,N.ib)(e.wysiwyg.element,u),e.wysiwyg.element.querySelectorAll(".vditor-wysiwyg__preview[data-render='2']").forEach(function(t){M(t,e)}),t.classList.add("vditor-menu--disabled");else if("link"===a){if(""===u.toString()){var h=document.createElement("a");h.innerText=i.g.ZWSP,u.insertNode(h),u.setStart(h.firstChild,1),u.collapse(!0),He(e,h,u);var m=e.wysiwyg.popover.querySelector("input");m.value="",m.focus(),o=!1}else{(f=document.createElement("a")).setAttribute("href",""),f.innerHTML=u.toString(),u.surroundContents(f),u.insertNode(f),(0,N.Hc)(u),He(e,f,u);var v=e.wysiwyg.popover.querySelectorAll("input");v[0].value=f.innerText,v[1].focus()}r=!1,t.classList.add("vditor-menu--current")}else if("table"===a){var D='<table data-block="0"><thead><tr><th>col1<wbr></th><th>col2</th><th>col3</th></tr></thead><tbody><tr><td> </td><td> </td><td> </td></tr><tr><td> </td><td> </td><td> </td></tr></tbody></table>';if(""===u.toString().trim())d&&""===d.innerHTML.trim().replace(i.g.ZWSP,"")?d.outerHTML=D:document.execCommand("insertHTML",!1,D),u.selectNode(e.wysiwyg.element.querySelector("wbr").previousSibling),e.wysiwyg.element.querySelector("wbr").remove(),(0,N.Hc)(u);else{D='<table data-block="0"><thead><tr>';var b=u.toString().split("\n"),y=b[0].split(",").length>b[0].split("\t").length?",":"\t";b.forEach(function(e,t){0===t?(e.split(y).forEach(function(e,t){D+="<th>".concat(e,0===t?"<wbr></th>":"</th>")}),D+="</tr></thead>"):(D+=1===t?"<tbody><tr>":"<tr>",e.split(y).forEach(function(e){D+="<td>".concat(e,"</td>")}),D+="</tr>")}),D+="</tbody></table>",document.execCommand("insertHTML",!1,D),(0,N.ib)(e.wysiwyg.element,u)}r=!1,t.classList.add("vditor-menu--disabled")}else if("line"===a){if(d){var E='<hr data-block="0"><p data-block="0"><wbr>\n</p>';""===d.innerHTML.trim()?d.outerHTML=E:d.insertAdjacentHTML("afterend",E),(0,N.ib)(e.wysiwyg.element,u)}}else if(r=!1,t.classList.add("vditor-menu--current"),"strike"===a&&(a="strikeThrough"),""!==u.toString()||"bold"!==a&&"italic"!==a&&"strikeThrough"!==a)document.execCommand(a,!1,"");else{var C="strong";"italic"===a?C="em":"strikeThrough"===a&&(C="s"),(f=document.createElement(C)).textContent=i.g.ZWSP,u.insertNode(f),f.previousSibling&&f.previousSibling.textContent===i.g.ZWSP&&(f.previousSibling.textContent=""),u.setStart(f.firstChild,1),u.collapse(!0),(0,N.Hc)(u)}}r&&Te(e),o&&Ee(e)}}(e,r.element.children[0],n):"ir"===e.currentMode?rn(e,r.element.children[0],t.prefix||"",t.suffix||""):st(e,r.element.children[0],t.prefix||"",t.suffix||""))})},ze=(Z=function(e,t){return Z=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Z(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Z(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),We=function(e,t,n){var r;if("string"!=typeof n?(v(e,["subToolbar","hint"]),n.preventDefault(),r=u(e)):r=n,e.currentMode!==t||"string"==typeof n){if(e.devtools&&e.devtools.renderEchart(e),"both"===e.options.preview.mode&&"sv"===t?e.preview.element.style.display="block":e.preview.element.style.display="none",p(e.toolbar.elements,i.g.EDIT_TOOLBARS),c(e.toolbar.elements,i.g.EDIT_TOOLBARS),f(e.toolbar.elements,["outdent","indent"]),"ir"===t)h(e.toolbar.elements,["both"]),m(e.toolbar.elements,["outdent","indent","outline","insert-before","insert-after"]),e.sv.element.style.display="none",e.wysiwyg.element.parentElement.style.display="none",e.ir.element.parentElement.style.display="block",e.lute.SetVditorIR(!0),e.lute.SetVditorWYSIWYG(!1),e.lute.SetVditorSV(!1),e.currentMode="ir",e.ir.element.innerHTML=e.lute.Md2VditorIRDOM(r),en(e,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),G(e),e.ir.element.querySelectorAll(".vditor-ir__preview[data-render='2']").forEach(function(t){M(t,e)}),e.ir.element.querySelectorAll(".vditor-toc").forEach(function(t){(0,k.H)(t,{cdn:e.options.cdn,math:e.options.preview.math})});else if("wysiwyg"===t)h(e.toolbar.elements,["both"]),m(e.toolbar.elements,["outdent","indent","outline","insert-before","insert-after"]),e.sv.element.style.display="none",e.wysiwyg.element.parentElement.style.display="block",e.ir.element.parentElement.style.display="none",e.lute.SetVditorIR(!1),e.lute.SetVditorWYSIWYG(!0),e.lute.SetVditorSV(!1),e.currentMode="wysiwyg",G(e),qe(e,r,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),e.wysiwyg.element.querySelectorAll(".vditor-toc").forEach(function(t){(0,k.H)(t,{cdn:e.options.cdn,math:e.options.preview.math})}),e.wysiwyg.popover.style.display="none";else if("sv"===t){m(e.toolbar.elements,["both"]),h(e.toolbar.elements,["outdent","indent","outline","insert-before","insert-after"]),e.wysiwyg.element.parentElement.style.display="none",e.ir.element.parentElement.style.display="none",("both"===e.options.preview.mode||"editor"===e.options.preview.mode)&&(e.sv.element.style.display="block"),e.lute.SetVditorIR(!1),e.lute.SetVditorWYSIWYG(!1),e.lute.SetVditorSV(!0),e.currentMode="sv";var o=ot(r,e);"<div data-block='0'></div>"===o&&(o=""),e.sv.element.innerHTML=o,U(e.sv.element),at(e,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),G(e)}e.undo.resetIcon(e),"string"!=typeof n&&(e[e.currentMode].element.focus(),Re(e)),O(e),K(e),e.toolbar.elements["edit-mode"]&&(e.toolbar.elements["edit-mode"].querySelectorAll("button").forEach(function(e){e.classList.remove("vditor-menu--current")}),e.toolbar.elements["edit-mode"].querySelector('button[data-mode="'.concat(e.currentMode,'"]')).classList.add("vditor-menu--current")),e.outline.toggle(e,"sv"!==e.currentMode&&e.options.outline.enable,"string"!=typeof n)}},Ge=function(e){function t(t,n){var r=e.call(this,t,n)||this,i=document.createElement("div");return i.className="vditor-hint".concat(2===n.level?"":" vditor-panel--arrow"),i.innerHTML='<button data-mode="wysiwyg">'.concat(window.VditorI18n.wysiwyg," &lt;").concat((0,s.ns)("⌥⌘7"),'></button>\n<button data-mode="ir">').concat(window.VditorI18n.instantRendering," &lt;").concat((0,s.ns)("⌥⌘8"),'></button>\n<button data-mode="sv">').concat(window.VditorI18n.splitView," &lt;").concat((0,s.ns)("⌥⌘9"),"></button>"),r.element.appendChild(i),r._bindEvent(t,i,n),r}return ze(t,e),t.prototype._bindEvent=function(e,t,n){var r=this.element.children[0];D(e,t,r,n.level),t.children.item(0).addEventListener((0,s.Le)(),function(t){We(e,"wysiwyg",t),t.preventDefault(),t.stopPropagation()}),t.children.item(1).addEventListener((0,s.Le)(),function(t){We(e,"ir",t),t.preventDefault(),t.stopPropagation()}),t.children.item(2).addEventListener((0,s.Le)(),function(t){We(e,"sv",t),t.preventDefault(),t.stopPropagation()})},t}(Ve),Ke=function(e,t){return(0,N.Gb)(e,t)?getSelection().toString():""},Xe=function(e,t){t.addEventListener("focus",function(){e.options.focus&&e.options.focus(u(e)),v(e,["subToolbar","hint"])})},Ze=function(e,t){t.addEventListener("dblclick",function(t){"IMG"===t.target.tagName&&(e.options.image.preview?e.options.image.preview(t.target):e.options.image.isPreview&&(0,q.E)(t.target,e.options.lang,e.options.theme))})},Je=function(e,t){t.addEventListener("blur",function(t){if("ir"===e.currentMode){var n=e.ir.element.querySelector(".vditor-ir__node--expand");n&&n.classList.remove("vditor-ir__node--expand")}else"wysiwyg"!==e.currentMode||e.wysiwyg.selectPopover.contains(t.relatedTarget)||e.wysiwyg.hideComment();e[e.currentMode].range=(0,N.zh)(e),e.options.blur&&e.options.blur(u(e))})},$e=function(e,t){t.addEventListener("dragstart",function(e){e.dataTransfer.setData(i.g.DROP_EDITOR,i.g.DROP_EDITOR)}),t.addEventListener("drop",function(t){t.dataTransfer.getData(i.g.DROP_EDITOR)?Nt(e):(t.dataTransfer.types.includes("Files")||t.dataTransfer.types.includes("text/html"))&&Jt(e,t,{pasteCode:function(e){document.execCommand("insertHTML",!1,e)}})})},Ye=function(e,t,n){t.addEventListener("copy",function(t){return n(t,e)})},Qe=function(e,t,n){t.addEventListener("cut",function(t){n(t,e),e.options.comment.enable&&"wysiwyg"===e.currentMode&&e.wysiwyg.getComments(e),document.execCommand("delete")})},et=function(e){if("wysiwyg"===e.currentMode&&e.options.comment.enable&&e.options.comment.adjustTop(e.wysiwyg.getComments(e,!0)),e.options.typewriterMode){var t=e[e.currentMode].element,n=(0,N.Ny)(t).top;"auto"!==e.options.height||e.element.classList.contains("vditor--fullscreen")||window.scrollTo(window.scrollX,n+e.element.offsetTop+e.toolbar.element.offsetHeight-window.innerHeight/2+10),("auto"!==e.options.height||e.element.classList.contains("vditor--fullscreen"))&&(t.scrollTop=n+t.scrollTop-t.clientHeight/2+10)}},tt=function(e,t){t.addEventListener("keydown",function(t){if(!t.isComposing&&e.options.keydown&&e.options.keydown(t),!(e.options.hint.extend.length>1||e.toolbar.elements.emoji)||!e.hint.select(t,e)){if(e.options.comment.enable&&"wysiwyg"===e.currentMode&&("Backspace"===t.key||j("⌘X",t))&&e.wysiwyg.getComments(e),"sv"===e.currentMode){if(function(e,t){var n,r,i,o,u;if(e.sv.composingLock=t.isComposing,t.isComposing)return!1;if(-1!==t.key.indexOf("Arrow")||"Meta"===t.key||"Control"===t.key||"Alt"===t.key||"Shift"===t.key||"CapsLock"===t.key||"Escape"===t.key||/^F\d{1,2}$/.test(t.key)||e.undo.recordFirstPosition(e,t),"Enter"!==t.key&&"Tab"!==t.key&&"Backspace"!==t.key&&-1===t.key.indexOf("Arrow")&&!(0,s.yl)(t)&&"Escape"!==t.key)return!1;var a=(0,N.zh)(e),l=a.startContainer;3!==a.startContainer.nodeType&&"DIV"===a.startContainer.tagName&&(l=a.startContainer.childNodes[a.startOffset-1]);var c=(0,g.a1)(l,"data-type","text"),d=(0,g.a1)(l,"data-type","blockquote-marker");if(!d&&0===a.startOffset&&c&&c.previousElementSibling&&"blockquote-marker"===c.previousElementSibling.getAttribute("data-type")&&(d=c.previousElementSibling),d&&"Enter"===t.key&&!(0,s.yl)(t)&&!t.altKey&&""===d.nextElementSibling.textContent.trim()&&(0,N.im)(d,e.sv.element,a).start===d.textContent.length)return"padding"===(null===(n=d.previousElementSibling)||void 0===n?void 0:n.getAttribute("data-type"))&&d.previousElementSibling.setAttribute("data-action","enter-remove"),d.remove(),at(e),t.preventDefault(),!0;var p=(0,g.a1)(l,"data-type","li-marker"),f=(0,g.a1)(l,"data-type","task-marker"),h=p;if(h||f&&"task-marker"!==f.nextElementSibling.getAttribute("data-type")&&(h=f),h||0!==a.startOffset||!c||!c.previousElementSibling||"li-marker"!==c.previousElementSibling.getAttribute("data-type")&&"task-marker"!==c.previousElementSibling.getAttribute("data-type")||(h=c.previousElementSibling),h){var m=(0,N.im)(h,e.sv.element,a).start,v="task-marker"===h.getAttribute("data-type"),D=h;if(v&&(D=h.previousElementSibling.previousElementSibling.previousElementSibling),m===h.textContent.length){if("Enter"===t.key&&!(0,s.yl)(t)&&!t.altKey&&!t.shiftKey&&""===h.nextElementSibling.textContent.trim())return"padding"===(null===(r=D.previousElementSibling)||void 0===r?void 0:r.getAttribute("data-type"))?(D.previousElementSibling.remove(),V(e)):(v&&(D.remove(),h.previousElementSibling.previousElementSibling.remove(),h.previousElementSibling.remove()),h.nextElementSibling.remove(),h.remove(),at(e)),t.preventDefault(),!0;if("Tab"===t.key)return t.shiftKey?"padding"===D.previousElementSibling.getAttribute("data-type")&&D.previousElementSibling.remove():D.insertAdjacentHTML("beforebegin",'<span data-type="padding">'.concat(D.textContent.replace(/\S/g," "),"</span>")),/^\d/.test(D.textContent)&&(D.textContent=D.textContent.replace(/^\d{1,}/,"1"),a.selectNodeContents(h.firstChild),a.collapse(!1)),V(e),t.preventDefault(),!0}}if(Ht(e,a,t))return!0;var y=(0,g.a1)(l,"data-block","0"),E=(0,b.S)(l,"SPAN");if("Enter"===t.key&&!(0,s.yl)(t)&&!t.altKey&&!t.shiftKey&&y){var C=!1,w=y.textContent.match(/^\n+/);(0,N.im)(y,e.sv.element).start<=(w?w[0].length:0)&&(C=!0);var A="\n";if(E){if("enter-remove"===(null===(i=E.previousElementSibling)||void 0===i?void 0:i.getAttribute("data-action")))return E.previousElementSibling.remove(),at(e),t.preventDefault(),!0;A+=ut(E)}return a.insertNode(document.createTextNode(A)),a.collapse(!1),y&&""!==y.textContent.trim()&&!C?V(e):at(e),t.preventDefault(),!0}if("Backspace"===t.key&&!(0,s.yl)(t)&&!t.altKey&&!t.shiftKey){if(E&&"newline"===(null===(o=E.previousElementSibling)||void 0===o?void 0:o.getAttribute("data-type"))&&1===(0,N.im)(E,e.sv.element,a).start&&-1===E.getAttribute("data-type").indexOf("code-block-"))return a.setStart(E,0),a.extractContents(),""!==E.textContent.trim()?V(e):at(e),t.preventDefault(),!0;if(y&&0===(0,N.im)(y,e.sv.element,a).start&&y.previousElementSibling){a.extractContents();var _=y.previousElementSibling.lastElementChild;return"newline"===_.getAttribute("data-type")&&(_.remove(),_=y.previousElementSibling.lastElementChild),"newline"!==_.getAttribute("data-type")&&(_.insertAdjacentHTML("afterend",y.innerHTML),y.remove()),""===y.textContent.trim()||(null===(u=y.previousElementSibling)||void 0===u?void 0:u.querySelector('[data-type="code-block-open-marker"]'))?("newline"!==_.getAttribute("data-type")&&(a.selectNodeContents(_.lastChild),a.collapse(!1)),at(e)):V(e),t.preventDefault(),!0}}return!1}(e,t))return}else if("wysiwyg"===e.currentMode){if(function(e,t){if(e.wysiwyg.composingLock=t.isComposing,t.isComposing)return!1;-1!==t.key.indexOf("Arrow")||"Meta"===t.key||"Control"===t.key||"Alt"===t.key||"Shift"===t.key||"CapsLock"===t.key||"Escape"===t.key||/^F\d{1,2}$/.test(t.key)||e.undo.recordFirstPosition(e,t);var n=(0,N.zh)(e),r=n.startContainer;if(!bt(t,e,r))return!1;if(yt(n,e,t),Xt(n),"Enter"!==t.key&&"Tab"!==t.key&&"Backspace"!==t.key&&-1===t.key.indexOf("Arrow")&&!(0,s.yl)(t)&&"Escape"!==t.key&&"Delete"!==t.key)return!1;var o=(0,g.F9)(r),u=(0,g.lG)(r,"P");if(It(t,e,u,n))return!0;if(Ot(n,e,u,t))return!0;if(Vt(e,t,n))return!0;var a=(0,g.fb)(r,"vditor-wysiwyg__block");if(a){if("Escape"===t.key&&2===a.children.length)return e.wysiwyg.popover.style.display="none",a.firstElementChild.style.display="none",e.wysiwyg.element.blur(),t.preventDefault(),!0;if(!(0,s.yl)(t)&&!t.shiftKey&&t.altKey&&"Enter"===t.key&&"code-block"===a.getAttribute("data-type")){var l=e.wysiwyg.popover.querySelector(".vditor-input");return l.focus(),l.select(),t.preventDefault(),!0}if("0"===a.getAttribute("data-block")){if(zt(e,t,a.firstElementChild,n))return!0;if(Ft(e,t,n,a.firstElementChild,a))return!0;if("yaml-front-matter"!==a.getAttribute("data-type")&&kt(e,t,n,a.firstElementChild,a))return!0}}if(Wt(e,n,t,u))return!0;var c=(0,g.E2)(r,"BLOCKQUOTE");if(c&&!t.shiftKey&&t.altKey&&"Enter"===t.key){(0,s.yl)(t)?n.setStartBefore(c):n.setStartAfter(c),(0,N.Hc)(n);var d=document.createElement("p");return d.setAttribute("data-block","0"),d.innerHTML="\n",n.insertNode(d),n.collapse(!0),(0,N.Hc)(n),Ee(e),et(e),t.preventDefault(),!0}var p,f=(0,b.W)(r);if(f){if("H6"===f.tagName&&r.textContent.length===n.startOffset&&!(0,s.yl)(t)&&!t.shiftKey&&!t.altKey&&"Enter"===t.key){var h=document.createElement("p");return h.textContent="\n",h.setAttribute("data-block","0"),r.parentElement.insertAdjacentElement("afterend",h),n.setStart(h,0),(0,N.Hc)(n),Ee(e),et(e),t.preventDefault(),!0}var m;if(j("⌘=",t))return(m=parseInt(f.tagName.substr(1),10)-1)>0&&(_e(e,"h".concat(m)),Ee(e)),t.preventDefault(),!0;if(j("⌘-",t))return(m=parseInt(f.tagName.substr(1),10)+1)<7&&(_e(e,"h".concat(m)),Ee(e)),t.preventDefault(),!0;"Backspace"!==t.key||(0,s.yl)(t)||t.shiftKey||t.altKey||1!==f.textContent.length||Fe(e)}if(Gt(e,n,t))return!0;if(t.altKey&&"Enter"===t.key&&!(0,s.yl)(t)&&!t.shiftKey){var v=(0,g.lG)(r,"A"),D=(0,g.a1)(r,"data-type","link-ref"),y=(0,g.a1)(r,"data-type","footnotes-ref");if(v||D||y||f&&2===f.tagName.length){var E=e.wysiwyg.popover.querySelector("input");E.focus(),E.select()}}if(Se(e,t))return!0;if(j("⇧⌘U",t)&&(p=e.wysiwyg.popover.querySelector('[data-type="up"]')))return p.click(),t.preventDefault(),!0;if(j("⇧⌘D",t)&&(p=e.wysiwyg.popover.querySelector('[data-type="down"]')))return p.click(),t.preventDefault(),!0;if(Ht(e,n,t))return!0;if(!(0,s.yl)(t)&&t.shiftKey&&!t.altKey&&"Enter"===t.key&&"LI"!==r.parentElement.tagName&&"P"!==r.parentElement.tagName)return["STRONG","STRIKE","S","I","EM","B"].includes(r.parentElement.tagName)?n.insertNode(document.createTextNode("\n"+i.g.ZWSP)):n.insertNode(document.createTextNode("\n")),n.collapse(!1),(0,N.Hc)(n),Ee(e),et(e),t.preventDefault(),!0;if("Backspace"===t.key&&!(0,s.yl)(t)&&!t.shiftKey&&!t.altKey&&""===n.toString()){if(Kt(e,n,t,u))return!0;if(o){if(o.previousElementSibling&&o.previousElementSibling.classList.contains("vditor-wysiwyg__block")&&"0"===o.previousElementSibling.getAttribute("data-block")&&"UL"!==o.tagName&&"OL"!==o.tagName){var C=(0,N.im)(o,e.wysiwyg.element,n).start;if(0===C&&0===n.startOffset||1===C&&o.innerText.startsWith(i.g.ZWSP))return ke(o.previousElementSibling.lastElementChild,e,!1),""===o.innerHTML.trim().replace(i.g.ZWSP,"")&&(o.remove(),Ee(e)),t.preventDefault(),!0}var w=n.startOffset;if(""===n.toString()&&3===r.nodeType&&"\n"===r.textContent.charAt(w-2)&&r.textContent.charAt(w-1)!==i.g.ZWSP&&["STRONG","STRIKE","S","I","EM","B"].includes(r.parentElement.tagName))return r.textContent=r.textContent.substring(0,w-1)+i.g.ZWSP,n.setStart(r,w),n.collapse(!0),Ee(e),t.preventDefault(),!0;r.textContent===i.g.ZWSP&&1===n.startOffset&&!r.previousSibling&&function(e){for(var t=e.startContainer.nextSibling;t&&""===t.textContent;)t=t.nextSibling;return!(!t||3===t.nodeType||"CODE"!==t.tagName&&"math-inline"!==t.getAttribute("data-type")&&"html-entity"!==t.getAttribute("data-type")&&"html-inline"!==t.getAttribute("data-type"))}(n)&&(r.textContent=""),o.querySelectorAll("span.vditor-wysiwyg__block[data-type='math-inline']").forEach(function(e){e.firstElementChild.style.display="inline",e.lastElementChild.style.display="none"}),o.querySelectorAll("span.vditor-wysiwyg__block[data-type='html-entity']").forEach(function(e){e.firstElementChild.style.display="inline",e.lastElementChild.style.display="none"})}}if((0,s.vU)()&&1===n.startOffset&&r.textContent.indexOf(i.g.ZWSP)>-1&&r.previousSibling&&3!==r.previousSibling.nodeType&&"CODE"===r.previousSibling.tagName&&("Backspace"===t.key||"ArrowLeft"===t.key))return n.selectNodeContents(r.previousSibling),n.collapse(!1),t.preventDefault(),!0;if(Zt(t,o,n))return t.preventDefault(),!0;if(Et(n,t.key),"ArrowDown"===t.key){var A=r.nextSibling;A&&3!==A.nodeType&&"math-inline"===A.getAttribute("data-type")&&n.setStartAfter(A)}return!(!o||!I(o,e,t,n)||(t.preventDefault(),0))}(e,t))return}else if("ir"===e.currentMode&&function(e,t){if(e.ir.composingLock=t.isComposing,t.isComposing)return!1;-1!==t.key.indexOf("Arrow")||"Meta"===t.key||"Control"===t.key||"Alt"===t.key||"Shift"===t.key||"CapsLock"===t.key||"Escape"===t.key||/^F\d{1,2}$/.test(t.key)||e.undo.recordFirstPosition(e,t);var n=(0,N.zh)(e),r=n.startContainer;if(!bt(t,e,r))return!1;if(yt(n,e,t),Xt(n),"Enter"!==t.key&&"Tab"!==t.key&&"Backspace"!==t.key&&-1===t.key.indexOf("Arrow")&&!(0,s.yl)(t)&&"Escape"!==t.key&&"Delete"!==t.key)return!1;var o=(0,g.a1)(r,"data-newline","1");if(!(0,s.yl)(t)&&!t.altKey&&!t.shiftKey&&"Enter"===t.key&&o&&n.startOffset<o.textContent.length){var u=o.previousElementSibling;u&&(n.insertNode(document.createTextNode(u.textContent)),n.collapse(!1));var a=o.nextSibling;a&&(n.insertNode(document.createTextNode(a.textContent)),n.collapse(!0))}var l=(0,g.lG)(r,"P");if(It(t,e,l,n))return!0;if(Ot(n,e,l,t))return!0;if(Wt(e,n,t,l))return!0;var c=(0,g.fb)(r,"vditor-ir__marker--pre");if(c&&"PRE"===c.tagName){var d=c.firstChild;if(zt(e,t,c,n))return!0;if(("math-block"===d.getAttribute("data-type")||"html-block"===d.getAttribute("data-type"))&&kt(e,t,n,d,c.parentElement))return!0;if(Ft(e,t,n,d,c.parentElement))return!0}var p=(0,g.a1)(r,"data-type","code-block-info");if(p){if("Enter"===t.key||"Tab"===t.key)return n.selectNodeContents(p.nextElementSibling.firstChild),n.collapse(!0),t.preventDefault(),v(e,["hint"]),!0;if("Backspace"===t.key){var f=(0,N.im)(p,e.ir.element).start;1===f&&n.setStart(r,0),2===f&&(e.hint.recentLanguage="")}if(kt(e,t,n,p,p.parentElement))return v(e,["hint"]),!0}var h=(0,g.lG)(r,"TD")||(0,g.lG)(r,"TH");if(t.key.indexOf("Arrow")>-1&&h){var m=wt(h);if(m&&kt(e,t,n,h,m))return!0;var D=At(h);if(D&&Ft(e,t,n,h,D))return!0}if(Vt(e,t,n))return!0;if(Gt(e,n,t))return!0;if(Ht(e,n,t))return!0;var y=(0,b.W)(r);if(y){var E;if(j("⌘=",t))return(E=y.querySelector(".vditor-ir__marker--heading"))&&E.textContent.trim().length>1&&tn(e,E.textContent.substr(1)),t.preventDefault(),!0;if(j("⌘-",t))return(E=y.querySelector(".vditor-ir__marker--heading"))&&E.textContent.trim().length<6&&tn(e,E.textContent.trim()+"# "),t.preventDefault(),!0}var C=(0,g.F9)(r);if("Backspace"===t.key&&!(0,s.yl)(t)&&!t.shiftKey&&!t.altKey&&""===n.toString()){if(Kt(e,n,t,l))return!0;if(C&&C.previousElementSibling&&"UL"!==C.tagName&&"OL"!==C.tagName&&("code-block"===C.previousElementSibling.getAttribute("data-type")||"math-block"===C.previousElementSibling.getAttribute("data-type"))){var w=(0,N.im)(C,e.ir.element,n).start;if(0===w||1===w&&C.innerText.startsWith(i.g.ZWSP))return n.selectNodeContents(C.previousElementSibling.querySelector(".vditor-ir__marker--pre code")),n.collapse(!1),R(n,e),""===C.textContent.trim().replace(i.g.ZWSP,"")&&(C.remove(),en(e)),t.preventDefault(),!0}if(y){var A=y.firstElementChild.textContent.length;(0,N.im)(y,e.ir.element).start===A&&0!==A&&(n.setStart(y.firstElementChild.firstChild,A-1),n.collapse(!0),(0,N.Hc)(n))}}return!(("ArrowUp"!==t.key&&"ArrowDown"!==t.key||!C||(C.querySelectorAll(".vditor-ir__node").forEach(function(e){e.contains(r)||e.classList.add("vditor-ir__node--hidden")}),!Zt(t,C,n)))&&(Et(n,t.key),!C||!I(C,e,t,n)||(t.preventDefault(),0)))}(e,t))return;if(e.options.ctrlEnter&&j("⌘Enter",t))return e.options.ctrlEnter(u(e)),void t.preventDefault();if(j("⌘Z",t)&&!e.toolbar.elements.undo)return e.undo.undo(e),void t.preventDefault();if(j("⌘Y",t)&&!e.toolbar.elements.redo)return e.undo.redo(e),void t.preventDefault();if("Escape"===t.key)return"block"===e.hint.element.style.display?e.hint.element.style.display="none":e.options.esc&&!t.isComposing&&e.options.esc(u(e)),void t.preventDefault();if((0,s.yl)(t)&&t.altKey&&!t.shiftKey&&/^Digit[1-6]$/.test(t.code)){if("wysiwyg"===e.currentMode){var n=t.code.replace("Digit","H");(0,g.lG)(getSelection().getRangeAt(0).startContainer,n)?Fe(e):_e(e,n),Ee(e)}else"sv"===e.currentMode?lt(e,"#".repeat(parseInt(t.code.replace("Digit",""),10))+" "):"ir"===e.currentMode&&tn(e,"#".repeat(parseInt(t.code.replace("Digit",""),10))+" ");return t.preventDefault(),!0}if((0,s.yl)(t)&&t.altKey&&!t.shiftKey&&/^Digit[7-9]$/.test(t.code))return"Digit7"===t.code?We(e,"wysiwyg",t):"Digit8"===t.code?We(e,"ir",t):"Digit9"===t.code&&We(e,"sv",t),!0;e.options.toolbar.find(function(n){return!n.hotkey||n.toolbar?!!n.toolbar&&!!n.toolbar.find(function(n){return!!n.hotkey&&(j(n.hotkey,t)?(e.toolbar.elements[n.name].children[0].dispatchEvent(new CustomEvent((0,s.Le)())),t.preventDefault(),!0):void 0)}):j(n.hotkey,t)?(e.toolbar.elements[n.name].children[0].dispatchEvent(new CustomEvent((0,s.Le)())),t.preventDefault(),!0):void 0})}})},nt=function(e,t){t.addEventListener("selectstart",function(n){t.onmouseup=function(){setTimeout(function(){var t=Ke(e[e.currentMode].element);t.trim()?("wysiwyg"===e.currentMode&&e.options.comment.enable&&((0,g.a1)(n.target,"data-type","footnotes-block")||(0,g.a1)(n.target,"data-type","link-ref-defs-block")?e.wysiwyg.hideComment():e.wysiwyg.showComment()),e.options.select&&e.options.select(t)):("wysiwyg"===e.currentMode&&e.options.comment.enable&&e.wysiwyg.hideComment(),"function"==typeof e.options.unSelect&&e.options.unSelect())})}})},rt=function(e,t){var n=(0,N.zh)(e);n.extractContents(),n.insertNode(document.createTextNode(Lute.Caret)),n.insertNode(document.createTextNode(t));var r=(0,g.a1)(n.startContainer,"data-block","0");r||(r=e.sv.element);var i=e.lute.SpinVditorSVDOM(r.textContent);i="<div data-block='0'>"+i.replace(/<span data-type="newline"><br \/><span style="display: none">\n<\/span><\/span><span data-type="newline"><br \/><span style="display: none">\n<\/span><\/span></g,'<span data-type="newline"><br /><span style="display: none">\n</span></span><span data-type="newline"><br /><span style="display: none">\n</span></span></div><div data-block="0"><')+"</div>",r.isEqualNode(e.sv.element)?r.innerHTML=i:r.outerHTML=i,U(e.sv.element),(0,N.ib)(e.sv.element,n),et(e)},it=function(e,t,n){void 0===n&&(n=!0);var r=e;for(3===r.nodeType&&(r=r.parentElement);r;){if(r.getAttribute("data-type")===t)return r;r=n?r.previousElementSibling:r.nextElementSibling}return!1},ot=function(e,t){return t.options.debugger,e="<div data-block='0'>"+t.lute.SpinVditorSVDOM(e).replace(/<span data-type="newline"><br \/><span style="display: none">\n<\/span><\/span><span data-type="newline"><br \/><span style="display: none">\n<\/span><\/span></g,'<span data-type="newline"><br /><span style="display: none">\n</span></span><span data-type="newline"><br /><span style="display: none">\n</span></span></div><div data-block="0"><')+"</div>",t.options.debugger,e},ut=function(e){var t=e.getAttribute("data-type"),n=e.previousElementSibling,r=t&&"text"!==t&&"table"!==t&&"heading-marker"!==t&&"newline"!==t&&"yaml-front-matter-open-marker"!==t&&"yaml-front-matter-close-marker"!==t&&"code-block-info"!==t&&"code-block-close-marker"!==t&&"code-block-open-marker"!==t?e.textContent:"",i=!1;for("newline"===t&&(i=!0);n&&!i;){var o=n.getAttribute("data-type");if("li-marker"===o||"blockquote-marker"===o||"task-marker"===o||"padding"===o){var u=n.textContent;if("li-marker"!==o||"code-block-open-marker"!==t&&"code-block-info"!==t)if("code-block-close-marker"===t&&n.nextElementSibling.isSameNode(e)){var a=it(e,"code-block-open-marker");a&&a.previousElementSibling&&(n=a.previousElementSibling,r=u+r)}else r=u+r;else r=u.replace(/\S/g," ")+r}else"newline"===o&&(i=!0);n=n.previousElementSibling}return r},at=function(e,t){void 0===t&&(t={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),t.enableHint&&e.hint.render(e),e.preview.render(e);var n=u(e);"function"==typeof e.options.input&&t.enableInput&&e.options.input(n),e.options.counter.enable&&e.counter.render(e,n),e.options.cache.enable&&(0,s.pK)()&&(localStorage.setItem(e.options.cache.id,n),e.options.cache.after&&e.options.cache.after(n)),e.devtools&&e.devtools.renderEchart(e),clearTimeout(e.sv.processTimeoutId),e.sv.processTimeoutId=window.setTimeout(function(){t.enableAddUndoStack&&!e.sv.composingLock&&e.undo.addToUndoStack(e)},e.options.undoDelay)},lt=function(e,t){var n=(0,N.zh)(e),r=(0,b.S)(n.startContainer,"SPAN");r&&""!==r.textContent.trim()&&(t="\n"+t),n.collapse(!0),document.execCommand("insertHTML",!1,t)},st=function(e,t,n,r){var i=(0,N.zh)(e),o=t.getAttribute("data-type");0===e.sv.element.childNodes.length&&(e.sv.element.innerHTML='<span data-type="p" data-block="0"><span data-type="text"><wbr></span></span><span data-type="newline"><br><span style="display: none">\n</span></span>',(0,N.ib)(e.sv.element,i));var u=(0,g.F9)(i.startContainer),a=(0,b.S)(i.startContainer,"SPAN");if(u){if("link"===o){var l=void 0;return l=""===i.toString()?"".concat(n).concat(Lute.Caret).concat(r):"".concat(n).concat(i.toString()).concat(r.replace(")",Lute.Caret+")")),void document.execCommand("insertHTML",!1,l)}if("italic"===o||"bold"===o||"strike"===o||"inline-code"===o||"code"===o||"table"===o||"line"===o)return l=void 0,l=""===i.toString()?"".concat(n).concat(Lute.Caret).concat("code"===o?"":r):"".concat(n).concat(i.toString()).concat(Lute.Caret).concat("code"===o?"":r),"table"===o||"code"===o&&a&&""!==a.textContent?l="\n\n"+l:"line"===o&&(l="\n\n".concat(n,"\n").concat(Lute.Caret)),void document.execCommand("insertHTML",!1,l);if(("check"===o||"list"===o||"ordered-list"===o||"quote"===o)&&a){var s="* ";"check"===o?s="* [ ] ":"ordered-list"===o?s="1. ":"quote"===o&&(s="> ");var c=it(a,"newline");return c?c.insertAdjacentText("afterend",s):u.insertAdjacentText("afterbegin",s),void V(e)}(0,N.ib)(e.sv.element,i),at(e)}},ct=function(e){switch(e.currentMode){case"ir":return e.ir.element;case"wysiwyg":return e.wysiwyg.element;case"sv":return e.sv.element}},dt=function(e,t){e.options.upload.setHeaders&&(e.options.upload.headers=e.options.upload.setHeaders()),e.options.upload.headers&&Object.keys(e.options.upload.headers).forEach(function(n){t.setRequestHeader(n,e.options.upload.headers[n])})},pt=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function u(e){try{l(r.next(e))}catch(Pe){o(Pe)}}function a(e){try{l(r.throw(e))}catch(Pe){o(Pe)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(u,a)}l((r=r.apply(e,t||[])).next())})},ft=function(e,t){var n,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(u=0)),u;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,r=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){u=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){u.label=a[1];break}if(6===a[0]&&u.label<i[1]){u.label=i[1],i=a;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(a);break}i[2]&&u.ops.pop(),u.trys.pop();continue}a=t.call(e,u)}catch(Pe){a=[6,Pe],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}},ht=function(){this.isUploading=!1,this.element=document.createElement("div"),this.element.className="vditor-upload"},mt=function(e,t,n){return pt(void 0,void 0,void 0,function(){var r,i,o,u,a,l,s,c,d,p,f,h,m,v;return ft(this,function(D){switch(D.label){case 0:for(r=[],i=!0===e.options.upload.multiple?t.length:1,h=0;h<i;h++)(o=t[h])instanceof DataTransferItem&&(o=o.getAsFile()),r.push(o);return e.options.upload.handler?[4,e.options.upload.handler(r)]:[3,2];case 1:return u=D.sent(),n&&(n.value=""),"string"==typeof u?(e.tip.show(u),[2]):[2];case 2:return e.options.upload.url&&e.upload?e.options.upload.file?[4,e.options.upload.file(r)]:[3,4]:(n&&(n.value=""),e.tip.show("please config: options.upload.url"),[2]);case 3:r=D.sent(),D.label=4;case 4:if(e.options.upload.validate&&"string"==typeof(u=e.options.upload.validate(r)))return e.tip.show(u),[2];if(a=ct(e),e.upload.range=(0,N.zh)(e),l=function(e,t){e.tip.hide();var n=[],r="",i="";e.options.lang,e.options;for(var o=function(o,u){var a=t[u],l=!0;a.name||(r+="<li>".concat(window.VditorI18n.nameEmpty,"</li>"),l=!1),a.size>e.options.upload.max&&(r+="<li>".concat(a.name," ").concat(window.VditorI18n.over," ").concat(e.options.upload.max/1024/1024,"M</li>"),l=!1);var s=a.name.lastIndexOf("."),c=a.name.substr(s),d=e.options.upload.filename(a.name.substr(0,s))+c;e.options.upload.accept&&(e.options.upload.accept.split(",").some(function(e){var t=e.trim();if(0===t.indexOf(".")){if(c.toLowerCase()===t.toLowerCase())return!0}else if(a.type.split("/")[0]===t.split("/")[0])return!0;return!1})||(r+="<li>".concat(a.name," ").concat(window.VditorI18n.fileTypeError,"</li>"),l=!1)),l&&(n.push(a),i+="<li>".concat(d," ").concat(window.VditorI18n.uploading,' <a class="vditorCancelUpload" href="javascript:void(0)">').concat(window.VditorI18n.cancelUpload,"</a></li>"))},u=t.length,a=0;a<u;a++)o(0,a);if(e.tip.show("<ul>".concat(r).concat(i,"</ul>")),e.options.upload.cancel){var l=e.tip.element.querySelector(".vditorCancelUpload");l&&l.addEventListener("click",function(){e.options.upload.cancel(n),e.tip.hide(),e.upload.isUploading=!1})}return n}(e,r),0===l.length)return n&&(n.value=""),[2];for(s=new FormData,c=e.options.upload.extraData,d=0,p=Object.keys(c);d<p.length;d++)f=p[d],s.append(f,c[f]);for(h=0,m=l.length;h<m;h++)s.append(e.options.upload.fieldName,l[h]);return v=new XMLHttpRequest,e.upload.xhr=v,v.open("POST",e.options.upload.url),e.options.upload.token&&v.setRequestHeader("X-Upload-Token",e.options.upload.token),e.options.upload.withCredentials&&(v.withCredentials=!0),dt(e,v),e.upload.isUploading=!0,a.setAttribute("contenteditable","false"),v.onreadystatechange=function(){if(v.readyState===XMLHttpRequest.DONE){if(e.upload.isUploading=!1,a.setAttribute("contenteditable","true"),v.status>=200&&v.status<300)if(e.options.upload.success)e.options.upload.success(a,v.responseText);else{var r=v.responseText;e.options.upload.format&&(r=e.options.upload.format(t,v.responseText)),function(e,t){ct(t).focus();var n=JSON.parse(e),r="";1===n.code&&(r="".concat(n.msg)),n.data.errFiles&&n.data.errFiles.length>0&&(r="<ul><li>".concat(r,"</li>"),n.data.errFiles.forEach(function(e){var n=e.lastIndexOf("."),i=t.options.upload.filename(e.substr(0,n))+e.substr(n);r+="<li>".concat(i," ").concat(window.VditorI18n.uploadError,"</li>")}),r+="</ul>"),r?t.tip.show(r):t.tip.hide();var i="";Object.keys(n.data.succMap).forEach(function(e){var r=n.data.succMap[e],o=e.lastIndexOf("."),u=e.substr(o),a=t.options.upload.filename(e.substr(0,o))+u;0===(u=u.toLowerCase()).indexOf(".wav")||0===u.indexOf(".mp3")||0===u.indexOf(".ogg")?"wysiwyg"===t.currentMode?i+='<div class="vditor-wysiwyg__block" data-type="html-block"\n data-block="0"><pre><code>&lt;audio controls="controls" src="'.concat(r,'"&gt;&lt;/audio&gt;</code></pre><pre class="vditor-wysiwyg__preview" data-render="1"><audio controls="controls" src="').concat(r,'"></audio></pre></div>\n'):"ir"===t.currentMode?i+='<audio controls="controls" src="'.concat(r,'"></audio>\n'):i+="[".concat(a,"](").concat(r,")\n"):0===u.indexOf(".apng")||0===u.indexOf(".bmp")||0===u.indexOf(".gif")||0===u.indexOf(".ico")||0===u.indexOf(".cur")||0===u.indexOf(".jpg")||0===u.indexOf(".jpeg")||0===u.indexOf(".jfif")||0===u.indexOf(".pjp")||0===u.indexOf(".pjpeg")||0===u.indexOf(".png")||0===u.indexOf(".svg")||0===u.indexOf(".webp")?"wysiwyg"===t.currentMode?i+='<img alt="'.concat(a,'" src="').concat(r,'">\n'):i+="![".concat(a,"](").concat(r,")\n"):"wysiwyg"===t.currentMode?i+='<a href="'.concat(r,'">').concat(a,"</a>\n"):i+="[".concat(a,"](").concat(r,")\n")}),(0,N.Hc)(t.upload.range),document.execCommand("insertHTML",!1,i),t.upload.range=getSelection().getRangeAt(0).cloneRange()}(r,e)}else e.options.upload.error?e.options.upload.error(v.responseText):e.tip.show(v.responseText);n&&(n.value=""),e.upload.element.style.display="none",e.upload.xhr=void 0}},v.upload.onprogress=function(t){if(t.lengthComputable){var n=t.loaded/t.total*100;e.upload.element.style.display="block",e.upload.element.style.width=n+"%"}},v.send(s),[2]}})})},vt=function(e,t,n){var r,o=(0,g.F9)(t.startContainer);if(o||(o=e.wysiwyg.element),n&&"formatItalic"!==n.inputType&&"deleteByDrag"!==n.inputType&&"insertFromDrop"!==n.inputType&&"formatBold"!==n.inputType&&"formatRemove"!==n.inputType&&"formatStrikeThrough"!==n.inputType&&"insertUnorderedList"!==n.inputType&&"insertOrderedList"!==n.inputType&&"formatOutdent"!==n.inputType&&"formatIndent"!==n.inputType&&""!==n.inputType||!n){var u=function(e){for(var t=e.previousSibling;t;){if(3!==t.nodeType&&"A"===t.tagName&&!t.previousSibling&&""===t.innerHTML.replace(i.g.ZWSP,"")&&t.nextSibling)return t;t=t.previousSibling}return!1}(t.startContainer);u&&u.remove(),e.wysiwyg.element.querySelectorAll("wbr").forEach(function(e){e.remove()}),t.insertNode(document.createElement("wbr")),o.querySelectorAll("[style]").forEach(function(e){e.removeAttribute("style")}),o.querySelectorAll(".vditor-comment").forEach(function(e){""===e.textContent.trim()&&(e.classList.remove("vditor-comment","vditor-comment--focus"),e.removeAttribute("data-cmtids"))}),null===(r=o.previousElementSibling)||void 0===r||r.querySelectorAll(".vditor-comment").forEach(function(e){""===e.textContent.trim()&&(e.classList.remove("vditor-comment","vditor-comment--focus"),e.removeAttribute("data-cmtids"))});var a="";"link-ref-defs-block"===o.getAttribute("data-type")&&(o=e.wysiwyg.element);var l,s=o.isEqualNode(e.wysiwyg.element),c=(0,g.a1)(o,"data-type","footnotes-block");if(s)a=o.innerHTML;else{var d=(0,g.O9)(t.startContainer);if(d&&!c){var p=(0,b.S)(t.startContainer,"BLOCKQUOTE");o=p?(0,g.F9)(t.startContainer)||o:d}if(c&&(o=c),a=o.outerHTML,"UL"===o.tagName||"OL"===o.tagName){var f=o.previousElementSibling,h=o.nextElementSibling;!f||"UL"!==f.tagName&&"OL"!==f.tagName||(a=f.outerHTML+a,f.remove()),!h||"UL"!==h.tagName&&"OL"!==h.tagName||(a+=h.outerHTML,h.remove()),a=a.replace("<div><wbr><br></div>","<li><p><wbr><br></p></li>")}o.innerText.startsWith("```")||(e.wysiwyg.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(e){e&&!o.isEqualNode(e)&&(a+=e.outerHTML,e.remove())}),e.wysiwyg.element.querySelectorAll("[data-type='footnotes-block']").forEach(function(e){e&&!o.isEqualNode(e)&&(a+=e.outerHTML,e.remove())}))}if('<p data-block="0">```<wbr></p>'===(a=a.replace(/<\/(strong|b)><strong data-marker="\W{2}">/g,"").replace(/<\/(em|i)><em data-marker="\W{1}">/g,"").replace(/<\/(s|strike)><s data-marker="~{1,2}">/g,""))&&e.hint.recentLanguage&&(a='<p data-block="0">```<wbr></p>'.replace("```","```"+e.hint.recentLanguage)),e.options.debugger,a=e.lute.SpinVditorDOM(a),e.options.debugger,s)o.innerHTML=a;else if(o.outerHTML=a,c){var m=(0,g.E2)(e.wysiwyg.element.querySelector("wbr"),"LI");if(m){var v=e.wysiwyg.element.querySelector('sup[data-type="footnotes-ref"][data-footnotes-label="'.concat(m.getAttribute("data-marker"),'"]'));v&&v.setAttribute("aria-label",m.textContent.trim().substr(0,24))}}var D,y=e.wysiwyg.element.querySelectorAll("[data-type='link-ref-defs-block']");y.forEach(function(e,t){0===t?l=e:(l.insertAdjacentHTML("beforeend",e.innerHTML),e.remove())}),y.length>0&&e.wysiwyg.element.insertAdjacentElement("beforeend",y[0]);var E=e.wysiwyg.element.querySelectorAll("[data-type='footnotes-block']");E.forEach(function(e,t){0===t?D=e:(D.insertAdjacentHTML("beforeend",e.innerHTML),e.remove())}),E.length>0&&e.wysiwyg.element.insertAdjacentElement("beforeend",E[0]),(0,N.ib)(e.wysiwyg.element,t),e.wysiwyg.element.querySelectorAll(".vditor-wysiwyg__preview[data-render='2']").forEach(function(t){M(t,e)}),n&&("deleteContentBackward"===n.inputType||"deleteContentForward"===n.inputType)&&e.options.comment.enable&&(e.wysiwyg.triggerRemoveComment(e),e.options.comment.adjustTop(e.wysiwyg.getComments(e,!0)))}O(e),Ee(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})},Dt=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function u(e){try{l(r.next(e))}catch(Pe){o(Pe)}}function a(e){try{l(r.throw(e))}catch(Pe){o(Pe)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(u,a)}l((r=r.apply(e,t||[])).next())})},gt=function(e,t){var n,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(u=0)),u;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,r=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){u=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){u.label=a[1];break}if(6===a[0]&&u.label<i[1]){u.label=i[1],i=a;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(a);break}i[2]&&u.ops.pop(),u.trys.pop();continue}a=t.call(e,u)}catch(Pe){a=[6,Pe],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}},bt=function(e,t,n){if(229===e.keyCode&&""===e.code&&"Unidentified"===e.key&&"sv"!==t.currentMode){var r=(0,g.F9)(n);if(r&&""===r.textContent.trim())return t[t.currentMode].composingLock=!0,!1}return!0},yt=function(e,t,n){if(!("Enter"===n.key||"Tab"===n.key||"Backspace"===n.key||n.key.indexOf("Arrow")>-1||(0,s.yl)(n)||"Escape"===n.key||n.shiftKey||n.altKey)){var r=(0,g.lG)(e.startContainer,"P")||(0,g.lG)(e.startContainer,"LI");if(r&&0===(0,N.im)(r,t[t.currentMode].element,e).start){r.nodeValue&&(r.nodeValue=r.nodeValue.replace(/\u2006/g,""));var o=document.createTextNode(i.g.ZWSP);e.insertNode(o),e.setStartAfter(o)}}},Et=function(e,t){if("ArrowDown"===t||"ArrowUp"===t){var n=(0,g.a1)(e.startContainer,"data-type","math-inline")||(0,g.a1)(e.startContainer,"data-type","html-entity")||(0,g.a1)(e.startContainer,"data-type","html-inline");n&&("ArrowDown"===t&&e.setStartAfter(n.parentElement),"ArrowUp"===t&&e.setStartBefore(n.parentElement))}},Ct=function(e,t){var n=(0,N.zh)(e),r=(0,g.F9)(n.startContainer);r&&(r.insertAdjacentHTML(t,'<p data-block="0">'.concat(i.g.ZWSP,"<wbr>\n</p>")),(0,N.ib)(e[e.currentMode].element,n),Re(e),Nt(e))},wt=function(e){var t=(0,g.lG)(e,"TABLE");return!(!t||!t.rows[0].cells[0].isSameNode(e))&&t},At=function(e){var t=(0,g.lG)(e,"TABLE");return!(!t||!t.lastElementChild.lastElementChild.lastElementChild.isSameNode(e))&&t},_t=function(e,t,n){void 0===n&&(n=!0);var r=e.previousElementSibling;return r||(r=e.parentElement.previousElementSibling?e.parentElement.previousElementSibling.lastElementChild:"TBODY"===e.parentElement.parentElement.tagName&&e.parentElement.parentElement.previousElementSibling?e.parentElement.parentElement.previousElementSibling.lastElementChild.lastElementChild:null),r&&(t.selectNodeContents(r),n||t.collapse(!1),(0,N.Hc)(t)),r},Ft=function(e,t,n,r,o){var u=(0,N.im)(r,e[e.currentMode].element,n);if("ArrowDown"===t.key&&-1===r.textContent.trimRight().substr(u.start).indexOf("\n")||"ArrowRight"===t.key&&u.start>=r.textContent.trimRight().length){var a=o.nextElementSibling;return!a||a&&("TABLE"===a.tagName||a.getAttribute("data-type"))?(o.insertAdjacentHTML("afterend",'<p data-block="0">'.concat(i.g.ZWSP,"<wbr></p>")),(0,N.ib)(e[e.currentMode].element,n)):(n.selectNodeContents(a),n.collapse(!0),(0,N.Hc)(n)),t.preventDefault(),!0}return!1},kt=function(e,t,n,r,o){var u=(0,N.im)(r,e[e.currentMode].element,n);if("ArrowUp"===t.key&&-1===r.textContent.substr(0,u.start).indexOf("\n")||("ArrowLeft"===t.key||"Backspace"===t.key&&""===n.toString())&&0===u.start){var a=o.previousElementSibling;return!a||a&&("TABLE"===a.tagName||a.getAttribute("data-type"))?(o.insertAdjacentHTML("beforebegin",'<p data-block="0">'.concat(i.g.ZWSP,"<wbr></p>")),(0,N.ib)(e[e.currentMode].element,n)):(n.selectNodeContents(a),n.collapse(!1),(0,N.Hc)(n)),t.preventDefault(),!0}return!1},St=function(e,t,n,r){void 0===r&&(r=!0);var i=(0,g.lG)(t.startContainer,"LI");if(e[e.currentMode].element.querySelectorAll("wbr").forEach(function(e){e.remove()}),t.insertNode(document.createElement("wbr")),r&&i){for(var o="",u=0;u<i.parentElement.childElementCount;u++){var a=i.parentElement.children[u].querySelector("input");a&&a.remove(),o+='<p data-block="0">'.concat(i.parentElement.children[u].innerHTML.trimLeft(),"</p>")}i.parentElement.insertAdjacentHTML("beforebegin",o),i.parentElement.remove()}else if(i)if("check"===n)i.parentElement.querySelectorAll("li").forEach(function(e){e.insertAdjacentHTML("afterbegin",'<input type="checkbox" />'.concat(0===e.textContent.indexOf(" ")?"":" ")),e.classList.add("vditor-task")});else{i.querySelector("input")&&i.parentElement.querySelectorAll("li").forEach(function(e){e.querySelector("input").remove(),e.classList.remove("vditor-task")});var l=void 0;"list"===n?(l=document.createElement("ul")).setAttribute("data-marker","*"):(l=document.createElement("ol")).setAttribute("data-marker","1."),l.setAttribute("data-block","0"),l.setAttribute("data-tight",i.parentElement.getAttribute("data-tight")),l.innerHTML=i.parentElement.innerHTML,i.parentElement.parentNode.replaceChild(l,i.parentElement)}else{var s=(0,g.a1)(t.startContainer,"data-block","0");s||(e[e.currentMode].element.querySelector("wbr").remove(),(s=e[e.currentMode].element.querySelector("p")).innerHTML="<wbr>"),"check"===n?(s.insertAdjacentHTML("beforebegin",'<ul data-block="0"><li class="vditor-task"><input type="checkbox" /> '.concat(s.innerHTML,"</li></ul>")),s.remove()):"list"===n?(s.insertAdjacentHTML("beforebegin",'<ul data-block="0"><li>'.concat(s.innerHTML,"</li></ul>")),s.remove()):"ordered-list"===n&&(s.insertAdjacentHTML("beforebegin",'<ol data-block="0"><li>'.concat(s.innerHTML,"</li></ol>")),s.remove())}},Tt=function(e,t,n){var r=t.previousElementSibling;if(t&&r){var i=[t];Array.from(n.cloneContents().children).forEach(function(e,n){3!==e.nodeType&&t&&""!==e.textContent.trim()&&t.getAttribute("data-node-id")===e.getAttribute("data-node-id")&&(0!==n&&i.push(t),t=t.nextElementSibling)}),e[e.currentMode].element.querySelectorAll("wbr").forEach(function(e){e.remove()}),n.insertNode(document.createElement("wbr"));var o=r.parentElement,u="";i.forEach(function(e){var t=e.getAttribute("data-marker");1!==t.length&&(t="1".concat(t.slice(-1))),u+='<li data-node-id="'.concat(e.getAttribute("data-node-id"),'" data-marker="').concat(t,'">').concat(e.innerHTML,"</li>"),e.remove()}),r.insertAdjacentHTML("beforeend","<".concat(o.tagName,' data-block="0">').concat(u,"</").concat(o.tagName,">")),"wysiwyg"===e.currentMode?o.outerHTML=e.lute.SpinVditorDOM(o.outerHTML):o.outerHTML=e.lute.SpinVditorIRDOM(o.outerHTML),(0,N.ib)(e[e.currentMode].element,n);var a=(0,g.O9)(n.startContainer);a&&a.querySelectorAll(".vditor-".concat(e.currentMode,"__preview[data-render='2']")).forEach(function(t){M(t,e),"wysiwyg"===e.currentMode&&t.previousElementSibling.setAttribute("style","display:none")}),Nt(e),Re(e)}else e[e.currentMode].element.focus()},xt=function(e,t,n,r){var i=(0,g.lG)(t.parentElement,"LI");if(i){e[e.currentMode].element.querySelectorAll("wbr").forEach(function(e){e.remove()}),n.insertNode(document.createElement("wbr"));var o=t.parentElement,u=o.cloneNode(),a=[t];Array.from(n.cloneContents().children).forEach(function(e,n){3!==e.nodeType&&t&&""!==e.textContent.trim()&&t.getAttribute("data-node-id")===e.getAttribute("data-node-id")&&(0!==n&&a.push(t),t=t.nextElementSibling)});var l=!1,s="";o.querySelectorAll("li").forEach(function(e){l&&(s+=e.outerHTML,e.nextElementSibling||e.previousElementSibling?e.remove():e.parentElement.remove()),e.isSameNode(a[a.length-1])&&(l=!0)}),a.reverse().forEach(function(e){i.insertAdjacentElement("afterend",e)}),s&&(u.innerHTML=s,a[0].insertAdjacentElement("beforeend",u)),"wysiwyg"===e.currentMode?r.outerHTML=e.lute.SpinVditorDOM(r.outerHTML):r.outerHTML=e.lute.SpinVditorIRDOM(r.outerHTML),(0,N.ib)(e[e.currentMode].element,n);var c=(0,g.O9)(n.startContainer);c&&c.querySelectorAll(".vditor-".concat(e.currentMode,"__preview[data-render='2']")).forEach(function(t){M(t,e),"wysiwyg"===e.currentMode&&t.previousElementSibling.setAttribute("style","display:none")}),Nt(e),Re(e)}else e[e.currentMode].element.focus()},Bt=function(e,t){for(var n=getSelection().getRangeAt(0).startContainer.parentElement,r=e.rows[0].cells.length,i=e.rows.length,o=0,u=0;u<i;u++)for(var a=0;a<r;a++)if(e.rows[u].cells[a].isSameNode(n)){o=a;break}for(var l=0;l<i;l++)e.rows[l].cells[o].setAttribute("align",t)},Lt=function(e){var t=e.trimRight().split("\n").pop();return""!==t&&(""===t.replace(/ |-/g,"")||""===t.replace(/ |_/g,"")||""===t.replace(/ |\*/g,""))&&t.replace(/ /g,"").length>2&&!(t.indexOf("-")>-1&&-1===t.trimLeft().indexOf(" ")&&e.trimRight().split("\n").length>1)&&0!==t.indexOf(" ")&&0!==t.indexOf("\t")},Mt=function(e){var t=e.trimRight().split("\n");return 0!==(e=t.pop()).indexOf(" ")&&0!==e.indexOf("\t")&&""!==(e=e.trimLeft())&&0!==t.length&&(""===e.replace(/-/g,"")||""===e.replace(/=/g,""))},Nt=function(e,t){void 0===t&&(t={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),"wysiwyg"===e.currentMode?Ee(e,t):"ir"===e.currentMode?en(e,t):"sv"===e.currentMode&&at(e,t)},Ot=function(e,t,n,r){var o,u=e.startContainer,a=(0,g.lG)(u,"LI");if(a){if(!(0,s.yl)(r)&&!r.altKey&&"Enter"===r.key&&!r.shiftKey&&n&&a.contains(n)&&n.nextElementSibling)return a&&!a.textContent.endsWith("\n")&&a.insertAdjacentText("beforeend","\n"),e.insertNode(document.createTextNode("\n\n")),e.collapse(!1),Nt(t),r.preventDefault(),!0;if(!((0,s.yl)(r)||r.shiftKey||r.altKey||"Backspace"!==r.key||a.previousElementSibling||""!==e.toString()||0!==(0,N.im)(a,t[t.currentMode].element,e).start))return a.nextElementSibling?(a.parentElement.insertAdjacentHTML("beforebegin",'<p data-block="0"><wbr>'.concat(a.innerHTML,"</p>")),a.remove()):a.parentElement.outerHTML='<p data-block="0"><wbr>'.concat(a.innerHTML,"</p>"),(0,N.ib)(t[t.currentMode].element,e),Nt(t),r.preventDefault(),!0;if(!(0,s.yl)(r)&&!r.shiftKey&&!r.altKey&&"Backspace"===r.key&&""===a.textContent.trim().replace(i.g.ZWSP,"")&&""===e.toString()&&"LI"===(null===(o=a.previousElementSibling)||void 0===o?void 0:o.tagName))return a.previousElementSibling.insertAdjacentText("beforeend","\n\n"),e.selectNodeContents(a.previousElementSibling),e.collapse(!1),a.remove(),(0,N.ib)(t[t.currentMode].element,e),Nt(t),r.preventDefault(),!0;if(!(0,s.yl)(r)&&!r.altKey&&"Tab"===r.key){var l=!1;if((0===e.startOffset&&(3===u.nodeType&&!u.previousSibling||3!==u.nodeType&&"LI"===u.nodeName)||a.classList.contains("vditor-task")&&1===e.startOffset&&3!==u.previousSibling.nodeType&&"INPUT"===u.previousSibling.tagName)&&(l=!0),l||""!==e.toString())return r.shiftKey?xt(t,a,e,a.parentElement):Tt(t,a,e),r.preventDefault(),!0}}return!1},Ht=function(e,t,n){if(e.options.tab&&"Tab"===n.key)return n.shiftKey||(""===t.toString()?(t.insertNode(document.createTextNode(e.options.tab)),t.collapse(!1)):(t.extractContents(),t.insertNode(document.createTextNode(e.options.tab)),t.collapse(!1))),(0,N.Hc)(t),Nt(e),n.preventDefault(),!0},It=function(e,t,n,r){if(n){if(!(0,s.yl)(e)&&!e.altKey&&"Enter"===e.key){var i=String.raw(J||(c=["",""],d=["",""],Object.defineProperty?Object.defineProperty(c,"raw",{value:d}):c.raw=d,J=c),n.textContent).replace(/\\\|/g,"").trim(),o=i.split("|");if(i.startsWith("|")&&i.endsWith("|")&&o.length>3){var u=o.map(function(){return"---"}).join("|");return u=n.textContent+"\n"+u.substring(3,u.length-3)+"\n|<wbr>",n.outerHTML=t.lute.SpinVditorDOM(u),(0,N.ib)(t[t.currentMode].element,r),Nt(t),et(t),e.preventDefault(),!0}if(Lt(n.innerHTML)&&n.previousElementSibling){var a="",l=n.innerHTML.trimRight().split("\n");return l.length>1&&(l.pop(),a='<p data-block="0">'.concat(l.join("\n"),"</p>")),n.insertAdjacentHTML("afterend","".concat(a,'<hr data-block="0"><p data-block="0"><wbr>\n</p>')),n.remove(),(0,N.ib)(t[t.currentMode].element,r),Nt(t),et(t),e.preventDefault(),!0}if(Mt(n.innerHTML))return"wysiwyg"===t.currentMode?n.outerHTML=t.lute.SpinVditorDOM(n.innerHTML+'<p data-block="0"><wbr>\n</p>'):n.outerHTML=t.lute.SpinVditorIRDOM(n.innerHTML+'<p data-block="0"><wbr>\n</p>'),(0,N.ib)(t[t.currentMode].element,r),Nt(t),et(t),e.preventDefault(),!0}var c,d;if(r.collapsed&&n.previousElementSibling&&"Backspace"===e.key&&!(0,s.yl)(e)&&!e.altKey&&!e.shiftKey&&n.textContent.trimRight().split("\n").length>1&&0===(0,N.im)(n,t[t.currentMode].element,r).start){var p=(0,g.DX)(n.previousElementSibling);return p.textContent.endsWith("\n")||(p.textContent=p.textContent+"\n"),p.parentElement.insertAdjacentHTML("beforeend","<wbr>".concat(n.innerHTML)),n.remove(),(0,N.ib)(t[t.currentMode].element,r),!1}return!1}},Pt=function(e,t,n){for(var r="",i=0;i<n.parentElement.childElementCount;i++)r+='<td align="'.concat(n.parentElement.children[i].getAttribute("align"),'"> </td>');"TH"===n.tagName?n.parentElement.parentElement.insertAdjacentHTML("afterend","<tbody><tr>".concat(r,"</tr></tbody>")):n.parentElement.insertAdjacentHTML("afterend","<tr>".concat(r,"</tr>")),Nt(e)},jt=function(e,t,n){for(var r="",i=0;i<n.parentElement.childElementCount;i++)"TH"===n.tagName?r+='<th align="'.concat(n.parentElement.children[i].getAttribute("align"),'"> </th>'):r+='<td align="'.concat(n.parentElement.children[i].getAttribute("align"),'"> </td>');if("TH"===n.tagName){n.parentElement.parentElement.insertAdjacentHTML("beforebegin","<thead><tr>".concat(r,"</tr></thead>")),t.insertNode(document.createElement("wbr"));var o=n.parentElement.innerHTML.replace(/<th>/g,"<td>").replace(/<\/th>/g,"</td>");n.parentElement.parentElement.nextElementSibling.insertAdjacentHTML("afterbegin",o),n.parentElement.parentElement.remove(),(0,N.ib)(e.ir.element,t)}else n.parentElement.insertAdjacentHTML("beforebegin","<tr>".concat(r,"</tr>"));Nt(e)},Rt=function(e,t,n,r){void 0===r&&(r="afterend");for(var i=0,o=n.previousElementSibling;o;)i++,o=o.previousElementSibling;for(var u=0;u<t.rows.length;u++)0===u?t.rows[u].cells[i].insertAdjacentHTML(r,"<th> </th>"):t.rows[u].cells[i].insertAdjacentHTML(r,"<td> </td>");Nt(e)},qt=function(e,t,n){if("TD"===n.tagName){var r=n.parentElement.parentElement;n.parentElement.previousElementSibling?t.selectNodeContents(n.parentElement.previousElementSibling.lastElementChild):t.selectNodeContents(r.previousElementSibling.lastElementChild.lastElementChild),1===r.childElementCount?r.remove():n.parentElement.remove(),t.collapse(!1),(0,N.Hc)(t),Nt(e)}},Ut=function(e,t,n,r){for(var i=0,o=r.previousElementSibling;o;)i++,o=o.previousElementSibling;(r.previousElementSibling||r.nextElementSibling)&&(t.selectNodeContents(r.previousElementSibling||r.nextElementSibling),t.collapse(!0));for(var u=0;u<n.rows.length;u++){var a=n.rows[u].cells;if(1===a.length){n.remove(),Re(e);break}a[i].remove()}(0,N.Hc)(t),Nt(e)},Vt=function(e,t,n){var r=n.startContainer,i=(0,g.lG)(r,"TD")||(0,g.lG)(r,"TH");if(i){if(!(0,s.yl)(t)&&!t.altKey&&"Enter"===t.key){i.lastElementChild&&(!i.lastElementChild||i.lastElementChild.isSameNode(i.lastChild)&&"BR"===i.lastElementChild.tagName)||i.insertAdjacentHTML("beforeend","<br>");var o=document.createElement("br");return n.insertNode(o),n.setStartAfter(o),Nt(e),et(e),t.preventDefault(),!0}if("Tab"===t.key)return t.shiftKey?(_t(i,n),t.preventDefault(),!0):((d=i.nextElementSibling)||(d=i.parentElement.nextElementSibling?i.parentElement.nextElementSibling.firstElementChild:"THEAD"===i.parentElement.parentElement.tagName&&i.parentElement.parentElement.nextElementSibling?i.parentElement.parentElement.nextElementSibling.firstElementChild.firstElementChild:null),d&&(n.selectNodeContents(d),(0,N.Hc)(n)),t.preventDefault(),!0);var u=i.parentElement.parentElement.parentElement;if("ArrowUp"===t.key){if(t.preventDefault(),"TH"===i.tagName)return u.previousElementSibling?(n.selectNodeContents(u.previousElementSibling),n.collapse(!1),(0,N.Hc)(n)):Ct(e,"beforebegin"),!0;for(var a=0,l=i.parentElement;a<l.cells.length&&!l.cells[a].isSameNode(i);a++);var c=l.previousElementSibling;return c||(c=l.parentElement.previousElementSibling.firstChild),n.selectNodeContents(c.cells[a]),n.collapse(!1),(0,N.Hc)(n),!0}if("ArrowDown"===t.key){var d;if(t.preventDefault(),!(l=i.parentElement).nextElementSibling&&"TD"===i.tagName)return u.nextElementSibling?(n.selectNodeContents(u.nextElementSibling),n.collapse(!0),(0,N.Hc)(n)):Ct(e,"afterend"),!0;for(a=0;a<l.cells.length&&!l.cells[a].isSameNode(i);a++);return(d=l.nextElementSibling)||(d=l.parentElement.nextElementSibling.firstChild),n.selectNodeContents(d.cells[a]),n.collapse(!0),(0,N.Hc)(n),!0}if("wysiwyg"===e.currentMode&&!(0,s.yl)(t)&&"Enter"===t.key&&!t.shiftKey&&t.altKey){var p=e.wysiwyg.popover.querySelector(".vditor-input");return p.focus(),p.select(),t.preventDefault(),!0}if(!(0,s.yl)(t)&&!t.shiftKey&&!t.altKey&&"Backspace"===t.key&&0===n.startOffset&&""===n.toString())return!_t(i,n,!1)&&u&&(""===u.textContent.trim()?(u.outerHTML='<p data-block="0"><wbr>\n</p>',(0,N.ib)(e[e.currentMode].element,n)):(n.setStartBefore(u),n.collapse(!0)),Nt(e)),t.preventDefault(),!0;if(j("⇧⌘F",t))return jt(e,n,i),t.preventDefault(),!0;if(j("⌘=",t))return Pt(e,n,i),t.preventDefault(),!0;if(j("⇧⌘G",t))return Rt(e,u,i,"beforebegin"),t.preventDefault(),!0;if(j("⇧⌘=",t))return Rt(e,u,i),t.preventDefault(),!0;if(j("⌘-",t))return qt(e,n,i),t.preventDefault(),!0;if(j("⇧⌘-",t))return Ut(e,n,u,i),t.preventDefault(),!0;if(j("⇧⌘L",t)){if("ir"===e.currentMode)return Bt(u,"left"),Nt(e),t.preventDefault(),!0;if(f=e.wysiwyg.popover.querySelector('[data-type="left"]'))return f.click(),t.preventDefault(),!0}if(j("⇧⌘C",t)){if("ir"===e.currentMode)return Bt(u,"center"),Nt(e),t.preventDefault(),!0;if(f=e.wysiwyg.popover.querySelector('[data-type="center"]'))return f.click(),t.preventDefault(),!0}if(j("⇧⌘R",t)){if("ir"===e.currentMode)return Bt(u,"right"),Nt(e),t.preventDefault(),!0;var f;if(f=e.wysiwyg.popover.querySelector('[data-type="right"]'))return f.click(),t.preventDefault(),!0}}return!1},zt=function(e,t,n,r){if("PRE"===n.tagName&&j("⌘A",t))return r.selectNodeContents(n.firstElementChild),t.preventDefault(),!0;if(e.options.tab&&"Tab"===t.key&&!t.shiftKey&&""===r.toString())return r.insertNode(document.createTextNode(e.options.tab)),r.collapse(!1),Nt(e),t.preventDefault(),!0;if("Backspace"===t.key&&!(0,s.yl)(t)&&!t.shiftKey&&!t.altKey){var i=(0,N.im)(n,e[e.currentMode].element,r);if((0===i.start||1===i.start&&"\n"===n.innerText)&&""===r.toString())return n.parentElement.outerHTML='<p data-block="0"><wbr>'.concat(n.firstElementChild.innerHTML,"</p>"),(0,N.ib)(e[e.currentMode].element,r),Nt(e),t.preventDefault(),!0}return!(0,s.yl)(t)&&!t.altKey&&"Enter"===t.key&&(n.firstElementChild.textContent.endsWith("\n")||n.firstElementChild.insertAdjacentText("beforeend","\n"),r.extractContents(),r.insertNode(document.createTextNode("\n")),r.collapse(!1),(0,N.Hc)(r),(0,s.vU)()||("wysiwyg"===e.currentMode?vt(e,r):P(e,r)),et(e),t.preventDefault(),!0)},Wt=function(e,t,n,r){var o=t.startContainer,u=(0,g.lG)(o,"BLOCKQUOTE");if(u&&""===t.toString()){if("Backspace"===n.key&&!(0,s.yl)(n)&&!n.shiftKey&&!n.altKey&&0===(0,N.im)(u,e[e.currentMode].element,t).start)return t.insertNode(document.createElement("wbr")),u.outerHTML=u.innerHTML,(0,N.ib)(e[e.currentMode].element,t),Nt(e),n.preventDefault(),!0;if(r&&"Enter"===n.key&&!(0,s.yl)(n)&&!n.shiftKey&&!n.altKey&&"BLOCKQUOTE"===r.parentElement.tagName){var a=!1;if("\n"===r.innerHTML.replace(i.g.ZWSP,"")||""===r.innerHTML.replace(i.g.ZWSP,"")?(a=!0,r.remove()):r.innerHTML.endsWith("\n\n")&&(0,N.im)(r,e[e.currentMode].element,t).start===r.textContent.length-1&&(r.innerHTML=r.innerHTML.substr(0,r.innerHTML.length-2),a=!0),a)return u.insertAdjacentHTML("afterend",'<p data-block="0">'.concat(i.g.ZWSP,"<wbr>\n</p>")),(0,N.ib)(e[e.currentMode].element,t),Nt(e),n.preventDefault(),!0}var l=(0,g.F9)(o);if("wysiwyg"===e.currentMode&&l&&j("⇧⌘;",n))return t.insertNode(document.createElement("wbr")),l.outerHTML='<blockquote data-block="0">'.concat(l.outerHTML,"</blockquote>"),(0,N.ib)(e.wysiwyg.element,t),Ee(e),n.preventDefault(),!0;if(Ft(e,n,t,u,u))return!0;if(kt(e,n,t,u,u))return!0}return!1},Gt=function(e,t,n){var r=t.startContainer,i=(0,g.lG)(r,"LI");if(i&&i.classList.contains("vditor-task")){if(j("⇧⌘J",n)){var o=i.firstElementChild;return o.checked?o.removeAttribute("checked"):o.setAttribute("checked","checked"),Nt(e),n.preventDefault(),!0}if("Backspace"===n.key&&!(0,s.yl)(n)&&!n.shiftKey&&!n.altKey&&""===t.toString()&&1===t.startOffset&&(3===r.nodeType&&r.previousSibling&&"INPUT"===r.previousSibling.tagName||3!==r.nodeType)){var u=i.previousElementSibling;return i.querySelector("input").remove(),u?((0,g.DX)(u).parentElement.insertAdjacentHTML("beforeend","<wbr>"+i.innerHTML.trim()),i.remove()):(i.parentElement.insertAdjacentHTML("beforebegin",'<p data-block="0"><wbr>'.concat(i.innerHTML.trim()||"\n","</p>")),i.nextElementSibling?i.remove():i.parentElement.remove()),(0,N.ib)(e[e.currentMode].element,t),Nt(e),n.preventDefault(),!0}if("Enter"===n.key&&!(0,s.yl)(n)&&!n.shiftKey&&!n.altKey){if(""===i.textContent.trim())if((0,g.fb)(i.parentElement,"vditor-task")){var a=(0,g.O9)(r);a&&xt(e,i,t,a)}else if(i.nextElementSibling){var l="",c="",d=!1;Array.from(i.parentElement.children).forEach(function(e){i.isSameNode(e)?d=!0:d?l+=e.outerHTML:c+=e.outerHTML});var p=i.parentElement.tagName,f="OL"===i.parentElement.tagName?"":' data-marker="'.concat(i.parentElement.getAttribute("data-marker"),'"'),h="";c&&(h="UL"===i.parentElement.tagName?"":' start="1"',c="<".concat(p,' data-tight="true"').concat(f,' data-block="0">').concat(c,"</").concat(p,">")),i.parentElement.outerHTML="".concat(c,'<p data-block="0"><wbr>\n</p><').concat(p,'\n data-tight="true"').concat(f,' data-block="0"').concat(h,">").concat(l,"</").concat(p,">")}else i.parentElement.insertAdjacentHTML("afterend",'<p data-block="0"><wbr>\n</p>'),1===i.parentElement.querySelectorAll("li").length?i.parentElement.remove():i.remove();else 3!==r.nodeType&&0===t.startOffset&&"INPUT"===r.firstChild.tagName?t.setStart(r.childNodes[1],1):(t.setEndAfter(i.lastChild),i.insertAdjacentHTML("afterend",'<li class="vditor-task" data-marker="'.concat(i.getAttribute("data-marker"),'"><input type="checkbox"> <wbr></li>')),document.querySelector("wbr").after(t.extractContents()));return(0,N.ib)(e[e.currentMode].element,t),Nt(e),et(e),n.preventDefault(),!0}}return!1},Kt=function(e,t,n,r){if(3!==t.startContainer.nodeType){var i=t.startContainer.children[t.startOffset];if(i&&"HR"===i.tagName)return t.selectNodeContents(i.previousElementSibling),t.collapse(!1),n.preventDefault(),!0}if(r){var o=r.previousElementSibling;if(o&&0===(0,N.im)(r,e[e.currentMode].element,t).start&&((0,s.vU)()&&"HR"===o.tagName||"TABLE"===o.tagName)){if("TABLE"===o.tagName){var u=o.lastElementChild.lastElementChild.lastElementChild;u.innerHTML=u.innerHTML.trimLeft()+"<wbr>"+r.textContent.trim(),r.remove()}else o.remove();return(0,N.ib)(e[e.currentMode].element,t),Nt(e),n.preventDefault(),!0}}return!1},Xt=function(e){(0,s.vU)()&&3!==e.startContainer.nodeType&&"HR"===e.startContainer.tagName&&e.setStartBefore(e.startContainer)},Zt=function(e,t,n){var r,i;if(!(0,s.vU)())return!1;if("ArrowUp"===e.key&&t&&"TABLE"===(null===(r=t.previousElementSibling)||void 0===r?void 0:r.tagName)){var o=t.previousElementSibling;return n.selectNodeContents(o.rows[o.rows.length-1].lastElementChild),n.collapse(!1),e.preventDefault(),!0}return!("ArrowDown"!==e.key||!t||"TABLE"!==(null===(i=t.nextElementSibling)||void 0===i?void 0:i.tagName)||(n.selectNodeContents(t.nextElementSibling.rows[0].cells[0]),n.collapse(!0),e.preventDefault(),0))},Jt=function(e,t,n){return Dt(void 0,void 0,void 0,function(){var r,o,u,a,l,s,c,d,p,f,h,m,v,D,b,y;return gt(this,function(E){switch(E.label){case 0:return"true"!==e[e.currentMode].element.getAttribute("contenteditable")?[2]:(t.stopPropagation(),t.preventDefault(),"clipboardData"in t?(r=t.clipboardData.getData("text/html"),o=t.clipboardData.getData("text/plain"),u=t.clipboardData.files):(r=t.dataTransfer.getData("text/html"),o=t.dataTransfer.getData("text/plain"),t.dataTransfer.types.includes("Files")&&(u=t.dataTransfer.items)),a={},l=function(t,n){if(!n)return["",Lute.WalkContinue];if(e.options.upload.renderLinkDest)return e.options.upload.renderLinkDest(e,t,n);var r=t.TokensStr();if(34===t.__internal_object__.Parent.Type&&r&&-1===r.indexOf("file://")&&e.options.upload.linkToImgUrl){var i=new XMLHttpRequest;i.open("POST",e.options.upload.linkToImgUrl),e.options.upload.token&&i.setRequestHeader("X-Upload-Token",e.options.upload.token),e.options.upload.withCredentials&&(i.withCredentials=!0),dt(e,i),i.setRequestHeader("Content-Type","application/json; charset=utf-8"),i.onreadystatechange=function(){if(i.readyState===XMLHttpRequest.DONE){if(200===i.status){var t=i.responseText;e.options.upload.linkToImgFormat&&(t=e.options.upload.linkToImgFormat(i.responseText));var n=JSON.parse(t);if(0!==n.code)return void e.tip.show(n.msg);var r=n.data.originalURL;if("sv"===e.currentMode)e.sv.element.querySelectorAll(".vditor-sv__marker--link").forEach(function(e){e.textContent===r&&(e.textContent=n.data.url)});else{var o=e[e.currentMode].element.querySelector('img[src="'.concat(r,'"]'));o.src=n.data.url,"ir"===e.currentMode&&(o.previousElementSibling.previousElementSibling.innerHTML=n.data.url)}Nt(e)}else e.tip.show(i.responseText);e.options.upload.linkToImgCallback&&e.options.upload.linkToImgCallback(i.responseText)}},i.send(JSON.stringify({url:r}))}return"ir"===e.currentMode?['<span class="vditor-ir__marker vditor-ir__marker--link">'.concat(Lute.EscapeHTMLStr(r),"</span>"),Lute.WalkContinue]:"wysiwyg"===e.currentMode?["",Lute.WalkContinue]:['<span class="vditor-sv__marker--link">'.concat(Lute.EscapeHTMLStr(r),"</span>"),Lute.WalkContinue]},r.replace(/&amp;/g,"&").replace(/<(|\/)(html|body|meta)[^>]*?>/gi,"").trim()!=='<a href="'.concat(o,'">').concat(o,"</a>")&&r.replace(/&amp;/g,"&").replace(/<(|\/)(html|body|meta)[^>]*?>/gi,"").trim()!=='\x3c!--StartFragment--\x3e<a href="'.concat(o,'">').concat(o,"</a>\x3c!--EndFragment--\x3e")||(r=""),(s=(new DOMParser).parseFromString(r,"text/html")).body&&(r=s.body.innerHTML),r=Lute.Sanitize(r),e.wysiwyg.getComments(e),c=e[e.currentMode].element.scrollHeight,d=function(e,t,n){void 0===n&&(n="sv");var r=document.createElement("div");r.innerHTML=e;var i=!1;1===r.childElementCount&&r.lastElementChild.style.fontFamily.indexOf("monospace")>-1&&(i=!0);var o=r.querySelectorAll("pre");if(1===r.childElementCount&&1===o.length&&"vditor-wysiwyg"!==o[0].className&&"vditor-sv"!==o[0].className&&(i=!0),0===e.indexOf('\n<p class="p1">')&&(i=!0),1===r.childElementCount&&"TABLE"===r.firstElementChild.tagName&&r.querySelector(".line-number")&&r.querySelector(".line-content")&&(i=!0),i){var u=t||e;return/\n/.test(u)||1===o.length?"wysiwyg"===n?'<div class="vditor-wysiwyg__block" data-block="0" data-type="code-block"><pre><code>'.concat(u.replace(/&/g,"&amp;").replace(/</g,"&lt;"),"<wbr></code></pre></div>"):"\n```\n"+u.replace(/&/g,"&amp;").replace(/</g,"&lt;")+"\n```":"wysiwyg"===n?"<code>".concat(u.replace(/&/g,"&amp;").replace(/</g,"&lt;"),"</code><wbr>"):"`".concat(u,"`")}return!1}(r,o,e.currentMode),(p="sv"===e.currentMode?(0,g.a1)(t.target,"data-type","code-block"):(0,g.lG)(t.target,"CODE"))?("sv"===e.currentMode?document.execCommand("insertHTML",!1,o.replace(/&/g,"&amp;").replace(/</g,"&lt;")):(f=(0,N.im)(t.target,e[e.currentMode].element),"PRE"!==p.parentElement.tagName&&(o+=i.g.ZWSP),p.textContent=p.textContent.substring(0,f.start)+o+p.textContent.substring(f.end),(0,N.$j)(f.start+o.length,f.start+o.length,p.parentElement),(null===(y=p.parentElement)||void 0===y?void 0:y.nextElementSibling.classList.contains("vditor-".concat(e.currentMode,"__preview")))&&(p.parentElement.nextElementSibling.innerHTML=p.outerHTML,M(p.parentElement.nextElementSibling,e))),[3,10]):[3,1]);case 1:return d?(n.pasteCode(d),[3,10]):[3,2];case 2:return""===r.trim()?[3,5]:((h=document.createElement("div")).innerHTML=r,e.options.upload.base64ToLink?[3,4]:[4,$t(e,h,("clipboardData"in t?t.clipboardData:t.dataTransfer).getData("text/rtf"))]);case 3:E.sent(),E.label=4;case 4:return h.querySelectorAll("[style]").forEach(function(e){e.removeAttribute("style")}),h.querySelectorAll(".vditor-copy").forEach(function(e){e.remove()}),"ir"===e.currentMode?(a.HTML2VditorIRDOM={renderLinkDest:l},e.lute.SetJSRenderers({renderers:a}),(0,N.oC)(e.lute.HTML2VditorIRDOM(h.innerHTML),e)):"wysiwyg"===e.currentMode?(a.HTML2VditorDOM={renderLinkDest:l},e.lute.SetJSRenderers({renderers:a}),(0,N.oC)(e.lute.HTML2VditorDOM(h.innerHTML),e)):(a.Md2VditorSVDOM={renderLinkDest:l},e.lute.SetJSRenderers({renderers:a}),rt(e,e.lute.HTML2Md(h.innerHTML).trimRight())),e.outline.render(e),[3,10];case 5:return u.length>0?e.options.upload.url||e.options.upload.handler?[4,mt(e,u)]:[3,7]:[3,9];case 6:return E.sent(),[3,8];case 7:m=new FileReader,"clipboardData"in t?(u=t.clipboardData.files,v=u[0]):t.dataTransfer.types.includes("Files")&&(u=t.dataTransfer.items,v=u[0].getAsFile()),v&&v.type.startsWith("image")&&(m.readAsDataURL(v),m.onload=function(){var t="";"wysiwyg"===e.currentMode?t+='<img alt="'.concat(v.name,'" src="').concat(m.result.toString(),'">\n'):t+="![".concat(v.name,"](").concat(m.result.toString(),")\n"),document.execCommand("insertHTML",!1,t)}),E.label=8;case 8:return[3,10];case 9:""!==o.trim()&&0===u.length&&(""!==(b=(0,N.zh)(e)).toString()&&e.lute.IsValidLinkDest(o)&&(o="[".concat(b.toString(),"](").concat(o,")")),"ir"===e.currentMode?(a.Md2VditorIRDOM={renderLinkDest:l},e.lute.SetJSRenderers({renderers:a}),(0,N.oC)(Lute.Sanitize(e.lute.Md2VditorIRDOM(o)),e)):"wysiwyg"===e.currentMode?(a.Md2VditorDOM={renderLinkDest:l},e.lute.SetJSRenderers({renderers:a}),(0,N.oC)(Lute.Sanitize(e.lute.Md2VditorDOM(o)),e)):(a.Md2VditorSVDOM={renderLinkDest:l},e.lute.SetJSRenderers({renderers:a}),rt(e,o)),e.outline.render(e)),E.label=10;case 10:return"sv"!==e.currentMode&&((D=(0,g.F9)((0,N.zh)(e).startContainer))&&(b=(0,N.zh)(e),e[e.currentMode].element.querySelectorAll("wbr").forEach(function(e){e.remove()}),b.insertNode(document.createElement("wbr")),"wysiwyg"===e.currentMode?D.outerHTML=e.lute.SpinVditorDOM(D.outerHTML):D.outerHTML=e.lute.SpinVditorIRDOM(D.outerHTML),(0,N.ib)(e[e.currentMode].element,b)),e[e.currentMode].element.querySelectorAll(".vditor-".concat(e.currentMode,"__preview[data-render='2']")).forEach(function(t){M(t,e)})),e.wysiwyg.triggerRemoveComment(e),Nt(e),e[e.currentMode].element.scrollHeight-c>Math.min(e[e.currentMode].element.clientHeight,window.innerHeight)/2&&et(e),[2]}})})},$t=function(e,t,n){return Dt(void 0,void 0,void 0,function(){var r,i,o,u,a,l,s,c,d,p,f,h,m,v,D;return gt(this,function(g){switch(g.label){case 0:if(!n)return[2];if(r=/{\\pict[\s\S]+?\\bliptag-?\d+(\\blipupi-?\d+)?({\\\*\\blipuid\s?[\da-fA-F]+)?[\s}]*?/,i=new RegExp("(?:("+r.source+"))([\\da-fA-F\\s]+)\\}","g"),o=n.match(i),u=[],o)for(a=0,l=o;a<l.length;a++)s=l[a],c=void 0,s.includes("\\pngblip")?c="image/png":s.includes("\\jpegblip")&&(c="image/jpeg"),c&&u.push({hex:s.replace(r,"").replace(/[^\da-fA-F]/g,""),type:c});for(d=[],Yt(t,function(e){if("V:SHAPE"===e.tagName)return Yt(e,function(t){"V:IMAGEDATA"===t.tagName&&d.push({shape:e,img:t})}),!1}),m=0;m<d.length;m++)p=document.createElement("img"),f="data:"+u[m].type+";base64,"+btoa((u[m].hex.match(/\w{2}/g)||[]).map(function(e){return String.fromCharCode(parseInt(e,16))}).join("")),p.src=f,p.title=d[m].img.getAttribute("title"),d[m].shape.parentNode.replaceChild(p,d[m].shape);h=t.querySelectorAll("img"),m=0,g.label=1;case 1:return m<h.length?(v=h[m].src||"")?(D=h[m],[4,e.options.upload.base64ToLink(v)]):[3,3]:[3,4];case 2:D.src=g.sent(),g.label=3;case 3:return m++,[3,1];case 4:return[2]}})})},Yt=function(e,t){if(!1!==t(e))for(var n=0;n<e.children.length;n++)Yt(e.children[n],t)},Qt=function(e){var t,n;e.hint.render(e);var r=(0,N.zh)(e).startContainer,o=(0,g.a1)(r,"data-type","code-block-info");if(o)if(""===o.textContent.replace(i.g.ZWSP,"")&&e.hint.recentLanguage)o.textContent=i.g.ZWSP+e.hint.recentLanguage,(0,N.zh)(e).selectNodeContents(o);else{var u=[],a=o.textContent.substring(0,(0,N.im)(o,e.ir.element).start).replace(i.g.ZWSP,"");(e.options.preview.hljs.langs||i.g.ALIAS_CODE_LANGUAGES.concat((null!==(n=null===(t=window.hljs)||void 0===t?void 0:t.listLanguages())&&void 0!==n?n:[]).sort())).forEach(function(e){e.indexOf(a.toLowerCase())>-1&&u.push({html:e,value:e})}),e.hint.genHTML(u,a,e)}},en=function(e,t){void 0===t&&(t={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),t.enableHint&&Qt(e),clearTimeout(e.ir.processTimeoutId),e.ir.processTimeoutId=window.setTimeout(function(){if(!e.ir.composingLock){var n=u(e);"function"==typeof e.options.input&&t.enableInput&&e.options.input(n),e.options.counter.enable&&e.counter.render(e,n),e.options.cache.enable&&(0,s.pK)()&&(localStorage.setItem(e.options.cache.id,n),e.options.cache.after&&e.options.cache.after(n)),e.devtools&&e.devtools.renderEchart(e),t.enableAddUndoStack&&e.undo.addToUndoStack(e)}},e.options.undoDelay)},tn=function(e,t){var n=(0,N.zh)(e),r=(0,g.F9)(n.startContainer)||n.startContainer;if(r){var i=r.querySelector(".vditor-ir__marker--heading");i?i.innerHTML=t:(r.insertAdjacentText("afterbegin",t),n.selectNodeContents(r),n.collapse(!1)),P(e,n.cloneRange()),ye(e)}},nn=function(e,t,n){var r=(0,g.a1)(e.startContainer,"data-type",n);if(r){r.firstElementChild.remove(),r.lastElementChild.remove(),e.insertNode(document.createElement("wbr"));var i=document.createElement("div");i.innerHTML=t.lute.SpinVditorIRDOM(r.outerHTML),r.outerHTML=i.firstElementChild.innerHTML.trim()}},rn=function(e,t,n,r){var i=(0,N.zh)(e),o=t.getAttribute("data-type"),u=i.startContainer;3===u.nodeType&&(u=u.parentElement);var a=!0;if(t.classList.contains("vditor-menu--current"))if("quote"===o){var l=(0,g.lG)(u,"BLOCKQUOTE");l&&(i.insertNode(document.createElement("wbr")),l.outerHTML=""===l.innerHTML.trim()?'<p data-block="0">'.concat(l.innerHTML,"</p>"):l.innerHTML)}else if("link"===o){var s=(0,g.a1)(i.startContainer,"data-type","a");if(s){var d=(0,g.fb)(i.startContainer,"vditor-ir__link");d?(i.insertNode(document.createElement("wbr")),s.outerHTML=d.innerHTML):s.outerHTML=s.querySelector(".vditor-ir__link").innerHTML+"<wbr>"}}else"italic"===o?nn(i,e,"em"):"bold"===o?nn(i,e,"strong"):"strike"===o?nn(i,e,"s"):"inline-code"===o?nn(i,e,"code"):"check"!==o&&"list"!==o&&"ordered-list"!==o||(St(e,i,o),a=!1,t.classList.remove("vditor-menu--current"));else{0===e.ir.element.childNodes.length&&(e.ir.element.innerHTML='<p data-block="0"><wbr></p>',(0,N.ib)(e.ir.element,i));var p=(0,g.F9)(i.startContainer);if("line"===o){if(p){var f='<hr data-block="0"><p data-block="0"><wbr>\n</p>';""===p.innerHTML.trim()?p.outerHTML=f:p.insertAdjacentHTML("afterend",f)}}else if("quote"===o)p&&(i.insertNode(document.createElement("wbr")),p.outerHTML='<blockquote data-block="0">'.concat(p.outerHTML,"</blockquote>"),a=!1,t.classList.add("vditor-menu--current"));else if("link"===o){var h=void 0;h=""===i.toString()?"".concat(n,"<wbr>").concat(r):"".concat(n).concat(i.toString()).concat(r.replace(")","<wbr>)")),document.execCommand("insertHTML",!1,h),a=!1,t.classList.add("vditor-menu--current")}else if("italic"===o||"bold"===o||"strike"===o||"inline-code"===o||"code"===o||"table"===o){h=void 0,""===i.toString()?h="".concat(n,"<wbr>").concat(r):(h="code"===o?"".concat(n,"\n").concat(i.toString(),"<wbr>").concat(r):"table"===o?"".concat(n).concat(i.toString(),"<wbr>").concat(r):"".concat(n).concat(i.toString()).concat(r,"<wbr>"),i.deleteContents()),"table"!==o&&"code"!==o||(h="\n"+h+"\n\n");var m=document.createElement("span");m.innerHTML=h,i.insertNode(m),P(e,i),"table"===o&&(i.selectNodeContents(getSelection().getRangeAt(0).startContainer.parentElement),(0,N.Hc)(i))}else"check"!==o&&"list"!==o&&"ordered-list"!==o||(St(e,i,o,!1),a=!1,c(e.toolbar.elements,["check","list","ordered-list"]),t.classList.add("vditor-menu--current"))}(0,N.ib)(e.ir.element,i),en(e),a&&ye(e)},on=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function u(e){try{l(r.next(e))}catch(Pe){o(Pe)}}function a(e){try{l(r.throw(e))}catch(Pe){o(Pe)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(u,a)}l((r=r.apply(e,t||[])).next())})},un=function(e,t){var n,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(u=0)),u;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,r=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){u=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){u.label=a[1];break}if(6===a[0]&&u.label<i[1]){u.label=i[1],i=a;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(a);break}i[2]&&u.ops.pop(),u.trys.pop();continue}a=t.call(e,u)}catch(Pe){a=[6,Pe],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}},an=function(){function e(e){var t=this;this.splitChar="",this.lastIndex=-1,this.fillEmoji=function(e,n){t.element.style.display="none";var r=decodeURIComponent(e.getAttribute("data-value")),o=window.getSelection().getRangeAt(0);if("ir"===n.currentMode){var u=(0,g.a1)(o.startContainer,"data-type","code-block-info");if(u)return u.textContent=i.g.ZWSP+r.trimRight(),o.selectNodeContents(u),o.collapse(!1),en(n),u.parentElement.querySelectorAll("code").forEach(function(e){e.className="language-"+r.trimRight()}),M(u.parentElement.querySelector(".vditor-ir__preview"),n),void(t.recentLanguage=r.trimRight())}if("wysiwyg"===n.currentMode&&3!==o.startContainer.nodeType){var a=o.startContainer,l=void 0;if((l=a.classList.contains("vditor-input")?a:a.firstElementChild)&&l.classList.contains("vditor-input"))return l.value=r.trimRight(),o.selectNodeContents(l),o.collapse(!1),l.dispatchEvent(new CustomEvent("input",{detail:1})),void(t.recentLanguage=r.trimRight())}if(o.setStart(o.startContainer,t.lastIndex),o.deleteContents(),n.options.hint.parse?"sv"===n.currentMode?(0,N.oC)(n.lute.SpinVditorSVDOM(r),n):"wysiwyg"===n.currentMode?(0,N.oC)(n.lute.SpinVditorDOM(r),n):(0,N.oC)(n.lute.SpinVditorIRDOM(r),n):(0,N.oC)(r,n),":"===t.splitChar&&r.indexOf(":")>-1&&"sv"!==n.currentMode&&o.insertNode(document.createTextNode(" ")),o.collapse(!1),(0,N.Hc)(o),"wysiwyg"===n.currentMode)(s=(0,g.fb)(o.startContainer,"vditor-wysiwyg__block"))&&s.lastElementChild.classList.contains("vditor-wysiwyg__preview")&&(s.lastElementChild.innerHTML=s.firstElementChild.innerHTML,M(s.lastElementChild,n));else if("ir"===n.currentMode){var s;(s=(0,g.fb)(o.startContainer,"vditor-ir__marker--pre"))&&s.nextElementSibling.classList.contains("vditor-ir__preview")&&(s.nextElementSibling.innerHTML=s.innerHTML,M(s.nextElementSibling,n))}Nt(n)},this.timeId=-1,this.element=document.createElement("div"),this.element.className="vditor-hint",this.recentLanguage="",e.push({key:":"})}return e.prototype.render=function(e){var t=this;if(window.getSelection().focusNode){var n,r=getSelection().getRangeAt(0);n=r.startContainer.textContent.substring(0,r.startOffset)||"";var i=this.getKey(n,e.options.hint.extend);if(void 0===i)this.element.style.display="none",clearTimeout(this.timeId);else if(":"===this.splitChar){var o=""===i?e.options.hint.emoji:e.lute.GetEmojis(),u=[];Object.keys(o).forEach(function(e){0===e.indexOf(i.toLowerCase())&&(o[e].indexOf(".")>-1?u.push({html:'<img src="'.concat(o[e],'" title=":').concat(e,':"/> :').concat(e,":"),value:":".concat(e,":")}):u.push({html:'<span class="vditor-hint__emoji">'.concat(o[e],"</span>").concat(e),value:o[e]}))}),this.genHTML(u,i,e)}else e.options.hint.extend.forEach(function(n){n.key===t.splitChar&&(clearTimeout(t.timeId),t.timeId=window.setTimeout(function(){return on(t,void 0,void 0,function(){var t;return un(this,function(r){switch(r.label){case 0:return t=this.genHTML,[4,n.hint(i)];case 1:return t.apply(this,[r.sent(),i,e]),[2]}})})},e.options.hint.delay))})}},e.prototype.genHTML=function(e,t,n){var r=this;if(0!==e.length){var i=n[n.currentMode].element,o=(0,N.Ny)(i),u=o.left+("left"===n.options.outline.position?n.outline.element.offsetWidth:0),a=o.top,l="";e.forEach(function(e,n){if(!(n>7)){var r=e.html;if(""!==t){var i=r.lastIndexOf(">")+1,o=r.substr(i),u=o.toLowerCase().indexOf(t.toLowerCase());u>-1&&(o=o.substring(0,u)+"<b>"+o.substring(u,u+t.length)+"</b>"+o.substring(u+t.length),r=r.substr(0,i)+o)}l+='<button type="button" data-value="'.concat(encodeURIComponent(e.value),' "\n').concat(0===n?"class='vditor-hint--current'":"","> ").concat(r,"</button>")}}),this.element.innerHTML=l;var s=parseInt(document.defaultView.getComputedStyle(i,null).getPropertyValue("line-height"),10);this.element.style.top="".concat(a+(s||22),"px"),this.element.style.left="".concat(u,"px"),this.element.style.display="block",this.element.style.right="auto",this.element.querySelectorAll("button").forEach(function(e){e.addEventListener("click",function(t){r.fillEmoji(e,n),t.preventDefault()})}),this.element.getBoundingClientRect().bottom>window.innerHeight&&(this.element.style.top="".concat(a-this.element.offsetHeight,"px")),this.element.getBoundingClientRect().right>window.innerWidth&&(this.element.style.left="auto",this.element.style.right="0")}else this.element.style.display="none"},e.prototype.select=function(e,t){if(0===this.element.querySelectorAll("button").length||"none"===this.element.style.display)return!1;var n=this.element.querySelector(".vditor-hint--current");if("ArrowDown"===e.key)return e.preventDefault(),e.stopPropagation(),n.removeAttribute("class"),n.nextElementSibling?n.nextElementSibling.className="vditor-hint--current":this.element.children[0].className="vditor-hint--current",!0;if("ArrowUp"===e.key){if(e.preventDefault(),e.stopPropagation(),n.removeAttribute("class"),n.previousElementSibling)n.previousElementSibling.className="vditor-hint--current";else{var r=this.element.children.length;this.element.children[r-1].className="vditor-hint--current"}return!0}return!((0,s.yl)(e)||e.shiftKey||e.altKey||"Enter"!==e.key||e.isComposing||(e.preventDefault(),e.stopPropagation(),this.fillEmoji(n,t),0))},e.prototype.getKey=function(e,t){var n,r=this;if(this.lastIndex=-1,this.splitChar="",t.forEach(function(t){var n=e.lastIndexOf(t.key);r.lastIndex<n&&(r.splitChar=t.key,r.lastIndex=n)}),-1===this.lastIndex)return n;var i=e.split(this.splitChar),u=i[i.length-1];if(i.length>1&&u.trim()===u)if(2===i.length&&""===i[0]&&i[1].length<32)n=i[1];else{var a=i[i.length-2].slice(-1);" "===(0,o.X)(a)&&u.length<32&&(n=u)}return n},e}(),ln=function(){function e(e){this.composingLock=!1;var t=document.createElement("div");t.className="vditor-ir",t.innerHTML='<pre class="vditor-reset" placeholder="'.concat(e.options.placeholder,'"\n contenteditable="true" spellcheck="false"></pre>'),this.element=t.firstElementChild,this.bindEvent(e),Xe(e,this.element),Ze(e,this.element),Je(e,this.element),tt(e,this.element),nt(e,this.element),$e(e,this.element),Ye(e,this.element,this.copy),Qe(e,this.element,this.copy)}return e.prototype.copy=function(e,t){var n=getSelection().getRangeAt(0);if(""!==n.toString()){e.stopPropagation(),e.preventDefault();var r=document.createElement("div");r.appendChild(n.cloneContents()),e.clipboardData.setData("text/plain",t.lute.VditorIRDOM2Md(r.innerHTML).trim()),e.clipboardData.setData("text/html","")}},e.prototype.bindEvent=function(e){var t=this;this.element.addEventListener("paste",function(t){Jt(e,t,{pasteCode:function(e){document.execCommand("insertHTML",!1,e)}})}),this.element.addEventListener("scroll",function(){v(e,["hint"])}),this.element.addEventListener("compositionstart",function(e){t.composingLock=!0}),this.element.addEventListener("compositionend",function(n){(0,s.vU)()||P(e,getSelection().getRangeAt(0).cloneRange()),t.composingLock=!1}),this.element.addEventListener("input",function(n){if("deleteByDrag"!==n.inputType&&"insertFromDrop"!==n.inputType)return t.preventInput?(t.preventInput=!1,void en(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})):void(t.composingLock||"‘"===n.data||"“"===n.data||"《"===n.data||P(e,getSelection().getRangeAt(0).cloneRange(),!1,n))}),this.element.addEventListener("click",function(n){if("INPUT"===n.target.tagName)return n.target.checked?n.target.setAttribute("checked","checked"):n.target.removeAttribute("checked"),t.preventInput=!0,void en(e);var r=(0,N.zh)(e),o=(0,g.fb)(n.target,"vditor-ir__preview");if(o||(o=(0,g.fb)(r.startContainer,"vditor-ir__preview")),o&&(o.previousElementSibling.firstElementChild?r.selectNodeContents(o.previousElementSibling.firstElementChild):r.selectNodeContents(o.previousElementSibling),r.collapse(!0),(0,N.Hc)(r),et(e)),"IMG"===n.target.tagName){var u=n.target.parentElement.querySelector(".vditor-ir__marker--link");u&&(r.selectNode(u),(0,N.Hc)(r))}var a=(0,g.a1)(n.target,"data-type","a");if(!a||a.classList.contains("vditor-ir__node--expand")){if(n.target.isEqualNode(t.element)&&t.element.lastElementChild&&r.collapsed){var l=t.element.lastElementChild.getBoundingClientRect();n.y>l.top+l.height&&("P"===t.element.lastElementChild.tagName&&""===t.element.lastElementChild.textContent.trim().replace(i.g.ZWSP,"")?(r.selectNodeContents(t.element.lastElementChild),r.collapse(!1)):(t.element.insertAdjacentHTML("beforeend",'<p data-block="0">'.concat(i.g.ZWSP,"<wbr></p>")),(0,N.ib)(t.element,r)))}""===r.toString()?R(r,e):setTimeout(function(){R((0,N.zh)(e),e)}),H(n,e),ye(e)}else e.options.link.click?e.options.link.click(a.querySelector(":scope > .vditor-ir__marker--link")):e.options.link.isOpen&&window.open(a.querySelector(":scope > .vditor-ir__marker--link").textContent)}),this.element.addEventListener("keyup",function(n){if(!n.isComposing&&!(0,s.yl)(n))if("Enter"===n.key&&et(e),ye(e),"Backspace"!==n.key&&"Delete"!==n.key||""===e.ir.element.innerHTML||1!==e.ir.element.childNodes.length||!e.ir.element.firstElementChild||"P"!==e.ir.element.firstElementChild.tagName||0!==e.ir.element.firstElementChild.childElementCount||""!==e.ir.element.textContent&&"\n"!==e.ir.element.textContent){var r=(0,N.zh)(e);"Backspace"===n.key?((0,s.vU)()&&"\n"===r.startContainer.textContent&&1===r.startOffset&&(r.startContainer.textContent="",R(r,e)),t.element.querySelectorAll(".language-math").forEach(function(e){var t=e.querySelector("br");t&&t.remove()})):n.key.indexOf("Arrow")>-1?("ArrowLeft"!==n.key&&"ArrowRight"!==n.key||Qt(e),R(r,e)):229===n.keyCode&&""===n.code&&"Unidentified"===n.key&&R(r,e);var o=(0,g.fb)(r.startContainer,"vditor-ir__preview");if(o){if("ArrowUp"===n.key||"ArrowLeft"===n.key)return o.previousElementSibling.firstElementChild?r.selectNodeContents(o.previousElementSibling.firstElementChild):r.selectNodeContents(o.previousElementSibling),r.collapse(!1),n.preventDefault(),!0;if("SPAN"===o.tagName&&("ArrowDown"===n.key||"ArrowRight"===n.key))return"html-entity"===o.parentElement.getAttribute("data-type")?(o.parentElement.insertAdjacentText("afterend",i.g.ZWSP),r.setStart(o.parentElement.nextSibling,1)):r.selectNodeContents(o.parentElement.lastElementChild),r.collapse(!1),n.preventDefault(),!0}}else e.ir.element.innerHTML=""})},e}(),sn=function(e){return"sv"===e.currentMode?e.lute.Md2HTML(u(e)):"wysiwyg"===e.currentMode?e.lute.VditorDOM2HTML(e.wysiwyg.element.innerHTML):"ir"===e.currentMode?e.lute.VditorIRDOM2HTML(e.ir.element.innerHTML):void 0},cn=n(214),dn=n(436),pn=function(){function e(e){this.element=document.createElement("div"),this.element.className="vditor-outline",this.element.innerHTML='<div class="vditor-outline__title">'.concat(e,'</div>\n<div class="vditor-outline__content"></div>')}return e.prototype.render=function(e){return"block"===e.preview.element.style.display?(0,dn.k)(e.preview.previewElement,this.element.lastElementChild,e):(0,dn.k)(e[e.currentMode].element,this.element.lastElementChild,e)},e.prototype.toggle=function(e,t,n){var r;void 0===t&&(t=!0),void 0===n&&(n=!0);var o=null===(r=e.toolbar.elements.outline)||void 0===r?void 0:r.firstElementChild;if(t&&window.innerWidth>=i.g.MOBILE_WIDTH?(this.element.style.display="block",this.render(e),null==o||o.classList.add("vditor-menu--current")):(this.element.style.display="none",null==o||o.classList.remove("vditor-menu--current")),n&&getSelection().rangeCount>0){var u=getSelection().getRangeAt(0);e[e.currentMode].element.contains(u.startContainer)&&(0,N.Hc)(u)}G(e)},e}(),fn=n(280),hn=function(){function e(e){var t=this;this.element=document.createElement("div"),this.element.className="vditor-preview",this.previewElement=document.createElement("div"),this.previewElement.className="vditor-reset",e.options.classes.preview&&this.previewElement.classList.add(e.options.classes.preview),this.previewElement.style.maxWidth=e.options.preview.maxWidth+"px",this.previewElement.addEventListener("copy",function(n){if("TEXTAREA"!==n.target.tagName){var r=document.createElement("div");r.className="vditor-reset",r.appendChild(getSelection().getRangeAt(0).cloneContents()),t.copyToX(e,r,"default"),n.preventDefault()}}),this.previewElement.addEventListener("click",function(n){var r=(0,g.lG)(n.target,"SPAN");if(r&&(0,g.fb)(r,"vditor-toc")){var i=t.previewElement.querySelector("#"+r.getAttribute("data-target-id"));i&&(t.element.scrollTop=i.offsetTop)}else{if("A"===n.target.tagName)return e.options.link.click?e.options.link.click(n.target):e.options.link.isOpen&&window.open(n.target.getAttribute("href")),void n.preventDefault();"IMG"===n.target.tagName&&(e.options.image.preview?e.options.image.preview(n.target):e.options.image.isPreview&&(0,q.E)(n.target,e.options.lang,e.options.theme))}}),this.element.appendChild(this.previewElement);var n=e.options.preview.actions;if(0!==n.length){var r=document.createElement("div");r.className="vditor-preview__action";for(var i=[],o=0;o<n.length;o++){var u=n[o];if("object"!==w(u))switch(u){case"desktop":i.push('<button type="button" class="vditor-preview__action--current" data-type="desktop">Desktop</button>');break;case"tablet":i.push('<button type="button" data-type="tablet">Tablet</button>');break;case"mobile":i.push('<button type="button" data-type="mobile">Mobile/Wechat</button>');break;case"mp-wechat":i.push('<button type="button" data-type="mp-wechat" class="vditor-tooltipped vditor-tooltipped__w" aria-label="复制到公众号"><svg><use xlink:href="#vditor-icon-mp-wechat"></use></svg></button>');break;case"zhihu":i.push('<button type="button" data-type="zhihu" class="vditor-tooltipped vditor-tooltipped__w" aria-label="复制到知乎"><svg><use xlink:href="#vditor-icon-zhihu"></use></svg></button>')}else i.push('<button type="button" data-type="'.concat(u.key,'" class="').concat(u.className,'"').concat(u.tooltip?' aria-label="'.concat(u.tooltip,'"'):"",'">').concat(u.text,"</button>"))}r.innerHTML=i.join(""),r.addEventListener((0,s.Le)(),function(i){var o=(0,b.S)(i.target,"BUTTON");if(o){var u=o.getAttribute("data-type"),a=n.find(function(e){return(null==e?void 0:e.key)===u});a?a.click(u):"mp-wechat"!==u&&"zhihu"!==u?(t.previewElement.style.width="desktop"===u?"auto":"tablet"===u?"780px":"360px",t.previewElement.scrollWidth>t.previewElement.parentElement.clientWidth&&(t.previewElement.style.width="auto"),t.render(e),r.querySelectorAll("button").forEach(function(e){e.classList.remove("vditor-preview__action--current")}),o.classList.add("vditor-preview__action--current")):t.copyToX(e,t.previewElement.cloneNode(!0),u)}}),this.element.insertBefore(r,this.previewElement)}}return e.prototype.render=function(e,t){var n=this;if(clearTimeout(this.mdTimeoutId),"none"!==this.element.style.display)if(t)this.previewElement.innerHTML=t;else if(""!==u(e).replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")){var r=(new Date).getTime(),i=u(e);this.mdTimeoutId=window.setTimeout(function(){if(e.options.preview.url){var t=new XMLHttpRequest;t.open("POST",e.options.preview.url),t.setRequestHeader("Content-Type","application/json;charset=UTF-8"),t.onreadystatechange=function(){if(t.readyState===XMLHttpRequest.DONE)if(200===t.status){var o=JSON.parse(t.responseText);if(0!==o.code)return void e.tip.show(o.msg);e.options.preview.transform&&(o.data=e.options.preview.transform(o.data)),n.previewElement.innerHTML=o.data,n.afterRender(e,r)}else{var u=e.lute.Md2HTML(i);e.options.preview.transform&&(u=e.options.preview.transform(u)),n.previewElement.innerHTML=u,n.afterRender(e,r)}},t.send(JSON.stringify({markdownText:i}))}else{var o=e.lute.Md2HTML(i);e.options.preview.transform&&(o=e.options.preview.transform(o)),n.previewElement.innerHTML=o,n.afterRender(e,r)}},e.options.preview.delay)}else this.previewElement.innerHTML="";else"renderPerformance"===this.element.getAttribute("data-type")&&e.tip.hide()},e.prototype.afterRender=function(e,t){e.options.preview.parse&&e.options.preview.parse(this.element);var n=(new Date).getTime()-t;(new Date).getTime()-t>2600?(e.tip.show(window.VditorI18n.performanceTip.replace("${x}",n.toString())),e.preview.element.setAttribute("data-type","renderPerformance")):"renderPerformance"===e.preview.element.getAttribute("data-type")&&(e.tip.hide(),e.preview.element.removeAttribute("data-type"));var r=e.preview.element.querySelector(".vditor-comment--focus");r&&r.classList.remove("vditor-comment--focus"),(0,C.O)(e.preview.previewElement,e.options.preview.hljs),(0,F.s)(e.options.preview.hljs,e.preview.previewElement,e.options.cdn),(0,S.i)(e.preview.previewElement,e.options.cdn,e.options.theme),(0,T.K)(e.preview.previewElement,e.options.cdn),(0,L.J)(e.preview.previewElement,e.options.cdn,e.options.theme),(0,A.P)(e.preview.previewElement,e.options.cdn),(0,_.v)(e.preview.previewElement,e.options.cdn),(0,E.p)(e.preview.previewElement,e.options.cdn,e.options.theme),(0,x.P)(e.preview.previewElement,e.options.cdn,e.options.theme),(0,B.B)(e.preview.previewElement,e.options.cdn),(0,y.Q)(e.preview.previewElement,e.options.cdn),e.options.preview.render.media.enable&&(0,fn.Y)(e.preview.previewElement),e.options.customRenders.forEach(function(t){t.render(e.preview.previewElement,e)});var i=e.preview.element,o=e.outline.render(e);""===o&&(o="[ToC]"),i.querySelectorAll('[data-type="toc-block"]').forEach(function(t){t.innerHTML=o,(0,k.H)(t,{cdn:e.options.cdn,math:e.options.preview.math})}),(0,k.H)(e.preview.previewElement,{cdn:e.options.cdn,math:e.options.preview.math})},e.prototype.copyToX=function(e,t,n){void 0===n&&(n="mp-wechat"),"zhihu"!==n?t.querySelectorAll(".katex-html .base").forEach(function(e){e.style.display="initial"}):t.querySelectorAll(".language-math").forEach(function(e){e.outerHTML='<img class="Formula-image" data-eeimg="true" src="//www.zhihu.com/equation?tex=" alt="'.concat(e.getAttribute("data-math"),'\\" style="display: block; margin: 0 auto; max-width: 100%;">')}),t.style.backgroundColor="#fff",t.querySelectorAll("code").forEach(function(e){e.style.backgroundImage="none"}),this.element.append(t);var r=t.ownerDocument.createRange();r.selectNode(t),(0,N.Hc)(r),document.execCommand("copy"),t.remove(),e.tip.show(["zhihu","mp-wechat"].includes(n)?"已复制,可到".concat("zhihu"===n?"知乎":"微信公众号平台","进行粘贴"):"已复制到剪切板")},e}(),mn=function(){function e(e){this.element=document.createElement("div"),this.element.className="vditor-resize vditor-resize--".concat(e.options.resize.position),this.element.innerHTML='<div><svg><use xlink:href="#vditor-icon-resize"></use></svg></div>',this.bindEvent(e)}return e.prototype.bindEvent=function(e){var t=this;this.element.addEventListener("mousedown",function(n){var r=document,i=n.clientY,o=e.element.offsetHeight,u=63+e.element.querySelector(".vditor-toolbar").clientHeight;r.ondragstart=function(){return!1},window.captureEvents&&window.captureEvents(),t.element.classList.add("vditor-resize--selected"),r.onmousemove=function(t){"top"===e.options.resize.position?e.element.style.height=Math.max(u,o+(i-t.clientY))+"px":e.element.style.height=Math.max(u,o+(t.clientY-i))+"px",e.options.typewriterMode&&(e.sv.element.style.paddingBottom=e.sv.element.parentElement.offsetHeight/2+"px")},r.onmouseup=function(){e.options.resize.after&&e.options.resize.after(e.element.offsetHeight-o),window.captureEvents&&window.captureEvents(),r.onmousemove=null,r.onmouseup=null,r.ondragstart=null,r.onselectstart=null,r.onselect=null,t.element.classList.remove("vditor-resize--selected")}})},e}(),vn=function(){function e(e){this.composingLock=!1,this.element=document.createElement("pre"),this.element.className="vditor-sv vditor-reset",this.element.setAttribute("placeholder",e.options.placeholder),this.element.setAttribute("contenteditable","true"),this.element.setAttribute("spellcheck","false"),this.bindEvent(e),Xe(e,this.element),Je(e,this.element),tt(e,this.element),nt(e,this.element),$e(e,this.element),Ye(e,this.element,this.copy),Qe(e,this.element,this.copy)}return e.prototype.copy=function(e,t){e.stopPropagation(),e.preventDefault(),e.clipboardData.setData("text/plain",Ke(t[t.currentMode].element))},e.prototype.bindEvent=function(e){var t=this;this.element.addEventListener("paste",function(t){Jt(e,t,{pasteCode:function(e){document.execCommand("insertHTML",!1,e)}})}),this.element.addEventListener("scroll",function(){if("block"===e.preview.element.style.display){var n=t.element.scrollTop,r=t.element.clientHeight,i=t.element.scrollHeight-parseFloat(t.element.style.paddingBottom||"0"),o=e.preview.element;o.scrollTop=n/r>.5?(n+r)*o.scrollHeight/i-r:n*o.scrollHeight/i}}),this.element.addEventListener("compositionstart",function(e){t.composingLock=!0}),this.element.addEventListener("compositionend",function(n){(0,s.vU)()||V(e,n),t.composingLock=!1}),this.element.addEventListener("input",function(n){if("deleteByDrag"!==n.inputType&&"insertFromDrop"!==n.inputType&&!t.composingLock&&"‘"!==n.data&&"“"!==n.data&&"《"!==n.data)return t.preventInput?(t.preventInput=!1,void at(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})):void V(e,n)}),this.element.addEventListener("keyup",function(t){t.isComposing||(0,s.yl)(t)||("Backspace"!==t.key&&"Delete"!==t.key||""===e.sv.element.innerHTML||1!==e.sv.element.childNodes.length||!e.sv.element.firstElementChild||"DIV"!==e.sv.element.firstElementChild.tagName||2!==e.sv.element.firstElementChild.childElementCount||""!==e.sv.element.firstElementChild.textContent&&"\n"!==e.sv.element.textContent?"Enter"===t.key&&et(e):e.sv.element.innerHTML="")})},e}(),Dn=function(){function e(){this.element=document.createElement("div"),this.element.className="vditor-tip"}return e.prototype.show=function(e,t){var n=this;void 0===t&&(t=6e3),this.element.className="vditor-tip vditor-tip--show",0===t?(this.element.innerHTML='<div class="vditor-tip__content">'.concat(e,'\n<div class="vditor-tip__close">X</div></div>'),this.element.querySelector(".vditor-tip__close").addEventListener("click",function(){n.hide()})):(this.element.innerHTML='<div class="vditor-tip__content">'.concat(e,"</div>"),setTimeout(function(){n.hide()},t)),this.element.removeAttribute("style"),setTimeout(function(){n.element.getBoundingClientRect().top<46&&(n.element.style.position="fixed",n.element.style.top="46px")},150)},e.prototype.hide=function(){this.element.className="vditor-messageElementtip",this.element.innerHTML=""},e}(),gn=function(e,t){if(t.options.preview.mode!==e){switch(t.options.preview.mode=e,e){case"both":t.sv.element.style.display="block",t.preview.element.style.display="block",t.preview.render(t),d(t.toolbar.elements,["both"]);break;case"editor":t.sv.element.style.display="block",t.preview.element.style.display="none",c(t.toolbar.elements,["both"])}t.devtools&&t.devtools.renderEchart(t)}},bn=($=function(e,t){return $=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},$(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}$(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),yn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return"both"===t.options.preview.mode&&r.element.children[0].classList.add("vditor-menu--current"),r.element.children[0].addEventListener((0,s.Le)(),function(e){r.element.firstElementChild.classList.contains(i.g.CLASS_MENU_DISABLED)||(e.preventDefault(),"sv"===t.currentMode&&("both"===t.options.preview.mode?gn("editor",t):gn("both",t)))}),r}return bn(t,e),t}(Ve),En=function(){this.element=document.createElement("div"),this.element.className="vditor-toolbar__br"},Cn=n(580),wn=(Y=function(e,t){return Y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Y(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Y(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),An=function(e){function t(t,n){var r=e.call(this,t,n)||this,o=r.element.children[0],u=document.createElement("div");u.className="vditor-hint".concat(2===n.level?"":" vditor-panel--arrow");var a="";return i.g.CODE_THEME.forEach(function(e){a+="<button>".concat(e,"</button>")}),u.innerHTML='<div style="overflow: auto;max-height:'.concat(window.innerHeight/2,'px">').concat(a,"</div>"),u.addEventListener((0,s.Le)(),function(e){"BUTTON"===e.target.tagName&&(v(t,["subToolbar"]),t.options.preview.hljs.style=e.target.textContent,(0,Cn.Y)(e.target.textContent,t.options.cdn),e.preventDefault(),e.stopPropagation())}),r.element.appendChild(u),D(t,u,o,n.level),r}return wn(t,e),t}(Ve),_n=(Q=function(e,t){return Q=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Q(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Q(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),Fn=function(e){function t(t,n){var r=e.call(this,t,n)||this,i=r.element.children[0],o=document.createElement("div");o.className="vditor-hint".concat(2===n.level?"":" vditor-panel--arrow");var u="";return Object.keys(t.options.preview.theme.list).forEach(function(e){u+='<button data-type="'.concat(e,'">').concat(t.options.preview.theme.list[e],"</button>")}),o.innerHTML='<div style="overflow: auto;max-height:'.concat(window.innerHeight/2,'px">').concat(u,"</div>"),o.addEventListener((0,s.Le)(),function(e){"BUTTON"===e.target.tagName&&(v(t,["subToolbar"]),t.options.preview.theme.current=e.target.getAttribute("data-type"),(0,z.Z)(t.options.preview.theme.current,t.options.preview.theme.path),e.preventDefault(),e.stopPropagation())}),r.element.appendChild(o),D(t,o,i,n.level),r}return _n(t,e),t}(Ve),kn=function(){function e(e){this.element=document.createElement("span"),this.element.className="vditor-counter vditor-tooltipped vditor-tooltipped__nw",this.render(e,"")}return e.prototype.render=function(e,t){var n=t.endsWith("\n")?t.length-1:t.length;if("text"===e.options.counter.type&&e[e.currentMode]){var r=e[e.currentMode].element.cloneNode(!0);r.querySelectorAll(".vditor-wysiwyg__preview").forEach(function(e){e.remove()}),n=r.textContent.length}"number"==typeof e.options.counter.max?(n>e.options.counter.max?this.element.className="vditor-counter vditor-counter--error":this.element.className="vditor-counter",this.element.innerHTML="".concat(n,"/").concat(e.options.counter.max)):this.element.innerHTML="".concat(n),this.element.setAttribute("aria-label",e.options.counter.type),e.options.counter.after&&e.options.counter.after(n,{enable:e.options.counter.enable,max:e.options.counter.max,type:e.options.counter.type})},e}(),Sn=(ee=function(e,t){return ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},ee(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}ee(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),Tn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.children[0].innerHTML=n.icon,r.element.children[0].addEventListener((0,s.Le)(),function(e){e.preventDefault(),e.currentTarget.classList.contains(i.g.CLASS_MENU_DISABLED)||n.click(e,t)}),r}return Sn(t,e),t}(Ve),xn=(te=function(e,t){return te=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},te(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}te(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),Bn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.firstElementChild.addEventListener((0,s.Le)(),function(e){var n=r.element.firstElementChild;n.classList.contains(i.g.CLASS_MENU_DISABLED)||(e.preventDefault(),n.classList.contains("vditor-menu--current")?(n.classList.remove("vditor-menu--current"),t.devtools.element.style.display="none",G(t)):(n.classList.add("vditor-menu--current"),t.devtools.element.style.display="block",G(t),t.devtools.renderEchart(t)))}),r}return xn(t,e),t}(Ve),Ln=function(){this.element=document.createElement("div"),this.element.className="vditor-toolbar__divider"},Mn=(ne=function(e,t){return ne=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},ne(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}ne(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),Nn=function(e){function t(t,n){var r=e.call(this,t,n)||this,i=document.createElement("div");i.className="vditor-panel vditor-panel--arrow";var o="";return Object.keys(t.options.hint.emoji).forEach(function(e){var n=t.options.hint.emoji[e];n.indexOf(".")>-1?o+='<button data-value=":'.concat(e,': " data-key=":').concat(e,':"><img\ndata-value=":').concat(e,': " data-key=":').concat(e,':" class="vditor-emojis__icon" src="').concat(n,'"/></button>'):o+='<button data-value="'.concat(n,' "\n data-key="').concat(e,'"><span class="vditor-emojis__icon">').concat(n,"</span></button>")}),i.innerHTML='<div class="vditor-emojis" style="max-height: '.concat("auto"===t.options.height?"auto":t.options.height-80,'px">').concat(o,'</div><div class="vditor-emojis__tail">\n <span class="vditor-emojis__tip"></span><span>').concat(t.options.hint.emojiTail||"","</span>\n</div>"),r.element.appendChild(i),D(t,i,r.element.firstElementChild,n.level),r.bindEvent(t),r}return Mn(t,e),t.prototype.bindEvent=function(e){var t=this;this.element.lastElementChild.addEventListener((0,s.Le)(),function(n){var r=(0,b.S)(n.target,"BUTTON");if(r){n.preventDefault();var i=r.getAttribute("data-value"),o=(0,N.zh)(e),u=i;if("wysiwyg"===e.currentMode?u=e.lute.SpinVditorDOM(i):"ir"===e.currentMode&&(u=e.lute.SpinVditorIRDOM(i)),i.indexOf(":")>-1&&"sv"!==e.currentMode){var a=document.createElement("div");a.innerHTML=u,u=a.firstElementChild.firstElementChild.outerHTML+" ",(0,N.oC)(u,e)}else o.extractContents(),o.insertNode(document.createTextNode(i)),(0,g.F9)(o.startContainer)||Ae(e,o);o.collapse(!1),(0,N.Hc)(o),t.element.lastElementChild.style.display="none",Nt(e)}}),this.element.lastElementChild.addEventListener("mouseover",function(e){var n=(0,b.S)(e.target,"BUTTON");n&&(t.element.querySelector(".vditor-emojis__tip").innerHTML=n.getAttribute("data-key"))})},t}(Ve),On=function(e,t,n){var r=document.createElement("a");"download"in r?(r.download=n,r.style.display="none",r.href=URL.createObjectURL(new Blob([t])),document.body.appendChild(r),r.click(),r.remove()):e.tip.show(window.VditorI18n.downloadTip,0)},Hn=(re=function(e,t){return re=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},re(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}re(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),In=function(e){function t(t,n){var r=e.call(this,t,n)||this,i=r.element.children[0],o=document.createElement("div");return o.className="vditor-hint".concat(2===n.level?"":" vditor-panel--arrow"),o.innerHTML='<button data-type="markdown">Markdown</button>\n<button data-type="pdf">PDF</button>\n<button data-type="html">HTML</button>',o.addEventListener((0,s.Le)(),function(e){var n=e.target;if("BUTTON"===n.tagName){switch(n.getAttribute("data-type")){case"markdown":!function(e){var t=u(e);On(e,t,t.substr(0,10)+".md")}(t);break;case"pdf":!function(e){e.tip.show(window.VditorI18n.generate,3800);var t=document.querySelector("#vditorExportIframe");t.contentDocument.open(),t.contentDocument.write('<link rel="stylesheet" href="'.concat(e.options.cdn,'/dist/index.css"/>\n<script src="').concat(e.options.cdn,'/dist/method.min.js"><\/script>\n<div id="preview" style="width: 800px"></div>\n<script>\nwindow.addEventListener("message", (e) => {\n if(!e.data) {\n return;\n }\n Vditor.preview(document.getElementById(\'preview\'), e.data, {\n cdn: "').concat(e.options.cdn,'",\n markdown: {\n theme: ').concat(JSON.stringify(e.options.preview.theme),'\n },\n hljs: {\n style: "').concat(e.options.preview.hljs.style,'"\n }\n });\n setTimeout(() => {\n window.print();\n }, 3600);\n}, false);\n<\/script>')),t.contentDocument.close(),setTimeout(function(){t.contentWindow.postMessage(u(e),"*")},200)}(t);break;case"html":!function(e){var t=sn(e),n='<html><head><link rel="stylesheet" type="text/css" href="'.concat(e.options.cdn,'/dist/index.css"/>\n<script src="').concat(e.options.cdn,"/dist/js/i18n/").concat(e.options.lang,'.js"><\/script>\n<script src="').concat(e.options.cdn,'/dist/method.min.js"><\/script></head>\n<body><div class="vditor-reset" id="preview">').concat(t,"</div>\n<script>\n const previewElement = document.getElementById('preview')\n Vditor.setContentTheme('").concat(e.options.preview.theme.current,"', '").concat(e.options.preview.theme.path,"');\n Vditor.codeRender(previewElement);\n Vditor.highlightRender(").concat(JSON.stringify(e.options.preview.hljs),", previewElement, '").concat(e.options.cdn,"');\n Vditor.mathRender(previewElement, {\n cdn: '").concat(e.options.cdn,"',\n math: ").concat(JSON.stringify(e.options.preview.math),",\n });\n Vditor.mermaidRender(previewElement, '").concat(e.options.cdn,"', '").concat(e.options.theme,"');\n Vditor.SMILESRender(previewElement, '").concat(e.options.cdn,"', '").concat(e.options.theme,"');\n Vditor.markmapRender(previewElement, '").concat(e.options.cdn,"');\n Vditor.flowchartRender(previewElement, '").concat(e.options.cdn,"');\n Vditor.graphvizRender(previewElement, '").concat(e.options.cdn,"');\n Vditor.chartRender(previewElement, '").concat(e.options.cdn,"', '").concat(e.options.theme,"');\n Vditor.mindmapRender(previewElement, '").concat(e.options.cdn,"', '").concat(e.options.theme,"');\n Vditor.abcRender(previewElement, '").concat(e.options.cdn,"');\n ").concat(e.options.preview.render.media.enable?"Vditor.mediaRender(previewElement);":"",'\n Vditor.speechRender(previewElement);\n<\/script>\n<script src="').concat(e.options.cdn,"/dist/js/icons/").concat(e.options.icon,'.js"><\/script></body></html>');On(e,n,t.substr(0,10)+".html")}(t)}v(t,["subToolbar"]),e.preventDefault(),e.stopPropagation()}}),r.element.appendChild(o),D(t,o,i,n.level),r}return Hn(t,e),t}(Ve),Pn=(ie=function(e,t){return ie=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},ie(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}ie(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),jn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r._bindEvent(t,n),r}return Pn(t,e),t.prototype._bindEvent=function(e,t){this.element.children[0].addEventListener((0,s.Le)(),function(n){n.preventDefault(),e.element.className.includes("vditor--fullscreen")?(t.level||(this.innerHTML=t.icon),e.element.style.zIndex="",document.body.style.overflow="",e.element.classList.remove("vditor--fullscreen"),Object.keys(e.toolbar.elements).forEach(function(t){var n=e.toolbar.elements[t].firstChild;n&&(n.className=n.className.replace("__s","__n"),e.options.toolbar.forEach(function(e){"string"!=typeof e&&e.tipPosition&&e.name===n.dataset.type&&(n.className="vditor-tooltipped vditor-tooltipped__".concat(e.tipPosition))}))}),e.counter&&(e.counter.element.className=e.counter.element.className.replace("__s","__n"))):(t.level||(this.innerHTML='<svg><use xlink:href="#vditor-icon-contract"></use></svg>'),e.element.style.zIndex=e.options.fullscreen.index.toString(),document.body.style.overflow="hidden",e.element.classList.add("vditor--fullscreen"),Object.keys(e.toolbar.elements).forEach(function(t){var n=e.toolbar.elements[t].firstChild;n&&(n.className=n.className.replace("__n","__s"))}),e.counter&&(e.counter.element.className=e.counter.element.className.replace("__n","__s"))),e.devtools&&e.devtools.renderEchart(e),t.click&&t.click(n,e),G(e),K(e)})},t}(Ve),Rn=(oe=function(e,t){return oe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},oe(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}oe(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),qn=function(e){function t(t,n){var r=e.call(this,t,n)||this,i=document.createElement("div");return i.className="vditor-hint vditor-panel--arrow",i.innerHTML='<button data-tag="h1" data-value="# ">'.concat(window.VditorI18n.heading1," ").concat((0,s.ns)("&lt;⌥⌘1>"),'</button>\n<button data-tag="h2" data-value="## ">').concat(window.VditorI18n.heading2," &lt;").concat((0,s.ns)("⌥⌘2"),'></button>\n<button data-tag="h3" data-value="### ">').concat(window.VditorI18n.heading3," &lt;").concat((0,s.ns)("⌥⌘3"),'></button>\n<button data-tag="h4" data-value="#### ">').concat(window.VditorI18n.heading4," &lt;").concat((0,s.ns)("⌥⌘4"),'></button>\n<button data-tag="h5" data-value="##### ">').concat(window.VditorI18n.heading5," &lt;").concat((0,s.ns)("⌥⌘5"),'></button>\n<button data-tag="h6" data-value="###### ">').concat(window.VditorI18n.heading6," &lt;").concat((0,s.ns)("⌥⌘6"),"></button>"),r.element.appendChild(i),r._bindEvent(t,i),r}return Rn(t,e),t.prototype._bindEvent=function(e,t){var n=this.element.children[0];n.addEventListener((0,s.Le)(),function(r){r.preventDefault(),clearTimeout(e.wysiwyg.afterRenderTimeoutId),clearTimeout(e.ir.processTimeoutId),clearTimeout(e.sv.processTimeoutId),n.classList.contains(i.g.CLASS_MENU_DISABLED)||(n.blur(),n.classList.contains("vditor-menu--current")?("wysiwyg"===e.currentMode?(Fe(e),Ee(e)):"ir"===e.currentMode&&tn(e,""),n.classList.remove("vditor-menu--current")):(v(e,["subToolbar"]),t.style.display="block"))});for(var r=0;r<6;r++)t.children.item(r).addEventListener((0,s.Le)(),function(r){r.preventDefault(),"wysiwyg"===e.currentMode?(_e(e,r.target.getAttribute("data-tag")),Ee(e),n.classList.add("vditor-menu--current")):"ir"===e.currentMode?(tn(e,r.target.getAttribute("data-value")),n.classList.add("vditor-menu--current")):lt(e,r.target.getAttribute("data-value")),t.style.display="none"})},t}(Ve),Un=(ue=function(e,t){return ue=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},ue(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}ue(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),Vn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.children[0].addEventListener((0,s.Le)(),function(e){e.preventDefault(),t.tip.show('<div style="margin-bottom:14px;font-size: 14px;line-height: 22px;min-width:300px;max-width: 360px;display: flex;">\n<div style="margin-top: 14px;flex: 1">\n <div>Markdown 使用指南</div>\n <ul style="list-style: none">\n <li><a href="https://ld246.com/article/1583308420519" target="_blank">语法速查手册</a></li>\n <li><a href="https://ld246.com/article/1583129520165" target="_blank">基础语法</a></li>\n <li><a href="https://ld246.com/article/1583305480675" target="_blank">扩展语法</a></li>\n <li><a href="https://ld246.com/article/1582778815353" target="_blank">键盘快捷键</a></li>\n </ul>\n</div>\n<div style="margin-top: 14px;flex: 1">\n <div>Vditor 支持</div>\n <ul style="list-style: none">\n <li><a href="https://github.com/Vanessa219/vditor/issues" target="_blank">Issues</a></li>\n <li><a href="https://ld246.com/tag/vditor" target="_blank">官方讨论区</a></li>\n <li><a href="https://ld246.com/article/1549638745630" target="_blank">开发手册</a></li>\n <li><a href="https://ld246.com/guide/markdown" target="_blank">演示地址</a></li>\n </ul>\n</div></div>',0)}),r}return Un(t,e),t}(Ve),zn=(ae=function(e,t){return ae=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},ae(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}ae(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),Wn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.children[0].addEventListener((0,s.Le)(),function(e){if(e.preventDefault(),!r.element.firstElementChild.classList.contains(i.g.CLASS_MENU_DISABLED)&&"sv"!==t.currentMode){var n=(0,N.zh)(t),o=(0,g.lG)(n.startContainer,"LI");o&&Tt(t,o,n)}}),r}return zn(t,e),t}(Ve),Gn=(le=function(e,t){return le=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},le(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}le(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),Kn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.children[0].addEventListener((0,s.Le)(),function(e){e.preventDefault(),t.tip.show('<div style="max-width: 520px; font-size: 14px;line-height: 22px;margin-bottom: 14px;">\n<p style="text-align: center;margin: 14px 0">\n <em>下一代的 Markdown 编辑器,为未来而构建</em>\n</p>\n<div style="display: flex;margin-bottom: 14px;flex-wrap: wrap;align-items: center">\n <img src="https://unpkg.com/vditor/dist/images/logo.png" style="margin: 0 auto;height: 68px"/>\n <div>&nbsp;&nbsp;</div>\n <div style="flex: 1;min-width: 250px">\n Vditor 是一款浏览器端的 Markdown 编辑器,支持所见即所得、即时渲染(类似 Typora)和分屏预览模式。\n 它使用 TypeScript 实现,支持原生 JavaScript 以及 Vue、React、Angular 和 Svelte 等框架。\n </div>\n</div>\n<div style="display: flex;flex-wrap: wrap;">\n <ul style="list-style: none;flex: 1;min-width:148px">\n <li>\n 项目地址:<a href="https://b3log.org/vditor" target="_blank">b3log.org/vditor</a>\n </li>\n <li>\n 开源协议:MIT\n </li>\n </ul>\n <ul style="list-style: none;margin-right: 18px">\n <li>\n 组件版本:Vditor v'.concat(i.H," / Lute v").concat(Lute.Version,'\n </li>\n <li>\n 赞助捐赠:<a href="https://ld246.com/sponsor" target="_blank">https://ld246.com/sponsor</a>\n </li>\n </ul>\n</div>\n</div>'),0)}),r}return Gn(t,e),t}(Ve),Xn=(se=function(e,t){return se=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},se(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}se(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),Zn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.children[0].addEventListener((0,s.Le)(),function(e){e.preventDefault(),r.element.firstElementChild.classList.contains(i.g.CLASS_MENU_DISABLED)||"sv"===t.currentMode||Ct(t,"afterend")}),r}return Xn(t,e),t}(Ve),Jn=(ce=function(e,t){return ce=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},ce(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}ce(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),$n=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.children[0].addEventListener((0,s.Le)(),function(e){e.preventDefault(),r.element.firstElementChild.classList.contains(i.g.CLASS_MENU_DISABLED)||"sv"===t.currentMode||Ct(t,"beforebegin")}),r}return Jn(t,e),t}(Ve),Yn=(de=function(e,t){return de=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},de(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}de(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),Qn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.children[0].addEventListener((0,s.Le)(),function(e){if(e.preventDefault(),!r.element.firstElementChild.classList.contains(i.g.CLASS_MENU_DISABLED)&&"sv"!==t.currentMode){var n=(0,N.zh)(t),o=(0,g.lG)(n.startContainer,"LI");o&&xt(t,o,n,o.parentElement)}}),r}return Yn(t,e),t}(Ve),er=(pe=function(e,t){return pe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},pe(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}pe(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),tr=function(e){function t(t,n){var r=e.call(this,t,n)||this;return t.options.outline&&r.element.firstElementChild.classList.add("vditor-menu--current"),r.element.children[0].addEventListener((0,s.Le)(),function(e){e.preventDefault(),t.toolbar.elements.outline.firstElementChild.classList.contains(i.g.CLASS_MENU_DISABLED)||(t.options.outline.enable=!r.element.firstElementChild.classList.contains("vditor-menu--current"),t.outline.toggle(t,t.options.outline.enable))}),r}return er(t,e),t}(Ve),nr=(fe=function(e,t){return fe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},fe(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}fe(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),rr=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r._bindEvent(t),r}return nr(t,e),t.prototype._bindEvent=function(e){var t=this;this.element.children[0].addEventListener((0,s.Le)(),function(n){n.preventDefault();var r=t.element.firstElementChild;if(!r.classList.contains(i.g.CLASS_MENU_DISABLED)){var o=i.g.EDIT_TOOLBARS.concat(["both","edit-mode","devtools"]);r.classList.contains("vditor-menu--current")?(r.classList.remove("vditor-menu--current"),"sv"===e.currentMode?(e.sv.element.style.display="block","both"===e.options.preview.mode?e.preview.element.style.display="block":e.preview.element.style.display="none"):(e[e.currentMode].element.parentElement.style.display="block",e.preview.element.style.display="none"),p(e.toolbar.elements,o),e.outline.render(e)):(f(e.toolbar.elements,o),e.preview.element.style.display="block","sv"===e.currentMode?e.sv.element.style.display="none":e[e.currentMode].element.parentElement.style.display="none",e.preview.render(e),r.classList.add("vditor-menu--current"),v(e,["subToolbar","hint","popover"]),setTimeout(function(){e.outline.render(e)},e.options.preview.delay+10)),G(e)}})},t}(Ve),ir=function(){function e(e){var t;if(this.SAMPLE_RATE=5e3,this.isRecording=!1,this.readyFlag=!1,this.leftChannel=[],this.rightChannel=[],this.recordingLength=0,"undefined"!=typeof AudioContext)t=new AudioContext;else{if(!webkitAudioContext)return;t=new webkitAudioContext}this.DEFAULT_SAMPLE_RATE=t.sampleRate;var n=t.createGain();t.createMediaStreamSource(e).connect(n),this.recorder=t.createScriptProcessor(2048,2,1),this.recorder.onaudioprocess=null,n.connect(this.recorder),this.recorder.connect(t.destination),this.readyFlag=!0}return e.prototype.cloneChannelData=function(e,t){this.leftChannel.push(new Float32Array(e)),this.rightChannel.push(new Float32Array(t)),this.recordingLength+=2048},e.prototype.startRecordingNewWavFile=function(){this.readyFlag&&(this.isRecording=!0,this.leftChannel.length=this.rightChannel.length=0,this.recordingLength=0)},e.prototype.stopRecording=function(){this.isRecording=!1},e.prototype.buildWavFileBlob=function(){for(var e=this.mergeBuffers(this.leftChannel),t=this.mergeBuffers(this.rightChannel),n=new Float32Array(e.length),r=0;r<e.length;++r)n[r]=.5*(e[r]+t[r]);this.DEFAULT_SAMPLE_RATE>this.SAMPLE_RATE&&(n=this.downSampleBuffer(n,this.SAMPLE_RATE));var i=44+2*n.length,o=new ArrayBuffer(i),u=new DataView(o);this.writeUTFBytes(u,0,"RIFF"),u.setUint32(4,i,!0),this.writeUTFBytes(u,8,"WAVE"),this.writeUTFBytes(u,12,"fmt "),u.setUint32(16,16,!0),u.setUint16(20,1,!0),u.setUint16(22,1,!0),u.setUint32(24,this.SAMPLE_RATE,!0),u.setUint32(28,2*this.SAMPLE_RATE,!0),u.setUint16(32,2,!0),u.setUint16(34,16,!0);var a=2*n.length;this.writeUTFBytes(u,36,"data"),u.setUint32(40,a,!0);for(var l=n.length,s=44,c=0;c<l;c++)u.setInt16(s,32767*n[c],!0),s+=2;return new Blob([u],{type:"audio/wav"})},e.prototype.downSampleBuffer=function(e,t){if(t===this.DEFAULT_SAMPLE_RATE)return e;if(t>this.DEFAULT_SAMPLE_RATE)return e;for(var n=this.DEFAULT_SAMPLE_RATE/t,r=Math.round(e.length/n),i=new Float32Array(r),o=0,u=0;o<i.length;){for(var a=Math.round((o+1)*n),l=0,s=0,c=u;c<a&&c<e.length;c++)l+=e[c],s++;i[o]=l/s,o++,u=a}return i},e.prototype.mergeBuffers=function(e){for(var t=new Float32Array(this.recordingLength),n=0,r=e.length,i=0;i<r;++i){var o=e[i];t.set(o,n),n+=o.length}return t},e.prototype.writeUTFBytes=function(e,t,n){for(var r=n.length,i=0;i<r;i++)e.setUint8(t+i,n.charCodeAt(i))},e}(),or=(he=function(e,t){return he=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},he(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}he(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),ur=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r._bindEvent(t),r}return or(t,e),t.prototype._bindEvent=function(e){var t,n=this;this.element.children[0].addEventListener((0,s.Le)(),function(r){if(r.preventDefault(),!n.element.firstElementChild.classList.contains(i.g.CLASS_MENU_DISABLED)){var o=e[e.currentMode].element;if(t)if(t.isRecording){t.stopRecording(),e.tip.hide();var u=new File([t.buildWavFileBlob()],"record".concat((new Date).getTime(),".wav"),{type:"video/webm"});mt(e,[u]),n.element.children[0].classList.remove("vditor-menu--current")}else e.tip.show(window.VditorI18n.recording),o.setAttribute("contenteditable","false"),t.startRecordingNewWavFile(),n.element.children[0].classList.add("vditor-menu--current");else navigator.mediaDevices.getUserMedia({audio:!0}).then(function(r){(t=new ir(r)).recorder.onaudioprocess=function(e){if(t.isRecording){var n=e.inputBuffer.getChannelData(0),r=e.inputBuffer.getChannelData(1);t.cloneChannelData(n,r)}},t.startRecordingNewWavFile(),e.tip.show(window.VditorI18n.recording),o.setAttribute("contenteditable","false"),n.element.children[0].classList.add("vditor-menu--current")}).catch(function(){e.tip.show(window.VditorI18n["record-tip"])})}})},t}(Ve),ar=(me=function(e,t){return me=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},me(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}me(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),lr=function(e){function t(t,n){var r=e.call(this,t,n)||this;return f({redo:r.element},["redo"]),r.element.children[0].addEventListener((0,s.Le)(),function(e){e.preventDefault(),r.element.firstElementChild.classList.contains(i.g.CLASS_MENU_DISABLED)||t.undo.redo(t)}),r}return ar(t,e),t}(Ve),sr=(ve=function(e,t){return ve=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},ve(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}ve(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),cr=function(e){function t(t,n){var r=e.call(this,t,n)||this;return f({undo:r.element},["undo"]),r.element.children[0].addEventListener((0,s.Le)(),function(e){e.preventDefault(),r.element.firstElementChild.classList.contains(i.g.CLASS_MENU_DISABLED)||t.undo.undo(t)}),r}return sr(t,e),t}(Ve),dr=(De=function(e,t){return De=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},De(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}De(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),pr=function(e){function t(t,n){var r=e.call(this,t,n)||this,i='<input type="file"';return t.options.upload.multiple&&(i+=' multiple="multiple"'),t.options.upload.accept&&(i+=' accept="'.concat(t.options.upload.accept,'"')),r.element.children[0].innerHTML="".concat(n.icon||'<svg><use xlink:href="#vditor-icon-upload"></use></svg>').concat(i,">"),r._bindEvent(t),r}return dr(t,e),t.prototype._bindEvent=function(e){var t=this;this.element.children[0].addEventListener((0,s.Le)(),function(e){if(t.element.firstElementChild.classList.contains(i.g.CLASS_MENU_DISABLED))return e.stopPropagation(),void e.preventDefault()}),this.element.querySelector("input").addEventListener("change",function(n){if(t.element.firstElementChild.classList.contains(i.g.CLASS_MENU_DISABLED))return n.stopPropagation(),void n.preventDefault();0!==n.target.files.length&&mt(e,n.target.files,n.target)})},t}(Ve),fr=function(){function e(e){var t=this,n=e.options;this.elements={},this.element=document.createElement("div"),this.element.className="vditor-toolbar",n.toolbar.forEach(function(n,r){var i=t.genItem(e,n,r);if(t.element.appendChild(i),n.toolbar){var o=document.createElement("div");o.className="vditor-hint vditor-panel--arrow",o.addEventListener((0,s.Le)(),function(e){o.style.display="none"}),n.toolbar.forEach(function(n,i){n.level=2,o.appendChild(t.genItem(e,n,r+i))}),i.appendChild(o),D(e,o,i.children[0])}}),e.options.toolbarConfig.hide&&this.element.classList.add("vditor-toolbar--hide"),e.options.toolbarConfig.pin&&this.element.classList.add("vditor-toolbar--pin"),e.options.counter.enable&&(e.counter=new kn(e),this.element.appendChild(e.counter.element))}return e.prototype.updateConfig=function(e,t){e.options.toolbarConfig=Object.assign({hide:!1,pin:!1},t),e.options.toolbarConfig.hide?this.element.classList.add("vditor-toolbar--hide"):this.element.classList.remove("vditor-toolbar--hide"),e.options.toolbarConfig.pin?this.element.classList.add("vditor-toolbar--pin"):this.element.classList.remove("vditor-toolbar--pin")},e.prototype.genItem=function(e,t,n){var r;switch(t.name){case"bold":case"italic":case"more":case"strike":case"line":case"quote":case"list":case"ordered-list":case"check":case"code":case"inline-code":case"link":case"table":r=new Ve(e,t);break;case"emoji":r=new Nn(e,t);break;case"headings":r=new qn(e,t);break;case"|":r=new Ln;break;case"br":r=new En;break;case"undo":r=new cr(e,t);break;case"redo":r=new lr(e,t);break;case"help":r=new Vn(e,t);break;case"both":r=new yn(e,t);break;case"preview":r=new rr(e,t);break;case"fullscreen":r=new jn(e,t);break;case"upload":r=new pr(e,t);break;case"record":r=new ur(e,t);break;case"info":r=new Kn(e,t);break;case"edit-mode":r=new Ge(e,t);break;case"devtools":r=new Bn(e,t);break;case"outdent":r=new Qn(e,t);break;case"indent":r=new Wn(e,t);break;case"outline":r=new tr(e,t);break;case"insert-after":r=new Zn(e,t);break;case"insert-before":r=new $n(e,t);break;case"code-theme":r=new An(e,t);break;case"content-theme":r=new Fn(e,t);break;case"export":r=new In(e,t);break;default:r=new Tn(e,t)}if(r){var i=t.name;return"br"!==i&&"|"!==i||(i+=n),this.elements[i]=r.element,r.element}},e}(),hr=n(173),mr=function(){function e(){this.stackSize=50,this.resetStack(),this.dmp=new hr}return e.prototype.clearStack=function(e){this.resetStack(),this.resetIcon(e)},e.prototype.resetIcon=function(e){e.toolbar&&(this[e.currentMode].undoStack.length>1?p(e.toolbar.elements,["undo"]):f(e.toolbar.elements,["undo"]),0!==this[e.currentMode].redoStack.length?p(e.toolbar.elements,["redo"]):f(e.toolbar.elements,["redo"]))},e.prototype.undo=function(e){if("false"!==e[e.currentMode].element.getAttribute("contenteditable")&&!(this[e.currentMode].undoStack.length<2)){var t=this[e.currentMode].undoStack.pop();t&&(this[e.currentMode].redoStack.push(t),this.renderDiff(t,e),this[e.currentMode].hasUndo=!0,v(e,["hint"]))}},e.prototype.redo=function(e){if("false"!==e[e.currentMode].element.getAttribute("contenteditable")){var t=this[e.currentMode].redoStack.pop();t&&(this[e.currentMode].undoStack.push(t),this.renderDiff(t,e,!0))}},e.prototype.recordFirstPosition=function(e,t){if(0!==getSelection().rangeCount&&!(1!==this[e.currentMode].undoStack.length||0===this[e.currentMode].undoStack[0].length||this[e.currentMode].redoStack.length>0||(0,s.vU)()&&"Backspace"===t.key||(0,s.G6)())){var n=this.addCaret(e);n.replace("<wbr>","").replace(" vditor-ir__node--expand","")===this[e.currentMode].undoStack[0][0].diffs[0][1].replace("<wbr>","")&&(this[e.currentMode].undoStack[0][0].diffs[0][1]=n,this[e.currentMode].lastText=n)}},e.prototype.addToUndoStack=function(e){var t=this.addCaret(e,!0),n=this.dmp.diff_main(t,this[e.currentMode].lastText,!0),r=this.dmp.patch_make(t,this[e.currentMode].lastText,n);0===r.length&&this[e.currentMode].undoStack.length>0||(this[e.currentMode].lastText=t,this[e.currentMode].undoStack.push(r),this[e.currentMode].undoStack.length>this.stackSize&&this[e.currentMode].undoStack.shift(),this[e.currentMode].hasUndo&&(this[e.currentMode].redoStack=[],this[e.currentMode].hasUndo=!1,f(e.toolbar.elements,["redo"])),this[e.currentMode].undoStack.length>1&&p(e.toolbar.elements,["undo"]))},e.prototype.renderDiff=function(e,t,n){var r;if(void 0===n&&(n=!1),n){var i=this.dmp.patch_deepCopy(e).reverse();i.forEach(function(e){e.diffs.forEach(function(e){e[0]=-e[0]})}),r=this.dmp.patch_apply(i,this[t.currentMode].lastText)[0]}else r=this.dmp.patch_apply(e,this[t.currentMode].lastText)[0];if(this[t.currentMode].lastText=r,t[t.currentMode].element.innerHTML=r,"sv"!==t.currentMode&&(t[t.currentMode].element.querySelectorAll(".vditor-".concat(t.currentMode,"__preview")).forEach(function(e){e.parentElement.querySelector(".language-echarts")&&("ir"===t.currentMode?e.parentElement.outerHTML=t.lute.SpinVditorIRDOM(e.parentElement.outerHTML):e.parentElement.outerHTML=t.lute.SpinVditorDOM(e.parentElement.outerHTML))}),t[t.currentMode].element.querySelectorAll(".vditor-".concat(t.currentMode,"__preview[data-render='2']")).forEach(function(e){M(e,t)})),t[t.currentMode].element.querySelector("wbr"))(0,N.ib)(t[t.currentMode].element,t[t.currentMode].element.ownerDocument.createRange()),et(t);else{var o=getSelection().getRangeAt(0);o.setEndBefore(t[t.currentMode].element),o.collapse(!1)}O(t),Nt(t,{enableAddUndoStack:!1,enableHint:!1,enableInput:!0}),Re(t),t[t.currentMode].element.querySelectorAll(".vditor-".concat(t.currentMode,"__preview[data-render='2']")).forEach(function(e){M(e,t)}),this[t.currentMode].undoStack.length>1?p(t.toolbar.elements,["undo"]):f(t.toolbar.elements,["undo"]),0!==this[t.currentMode].redoStack.length?p(t.toolbar.elements,["redo"]):f(t.toolbar.elements,["redo"])},e.prototype.resetStack=function(){this.ir={hasUndo:!1,lastText:"",redoStack:[],undoStack:[]},this.sv={hasUndo:!1,lastText:"",redoStack:[],undoStack:[]},this.wysiwyg={hasUndo:!1,lastText:"",redoStack:[],undoStack:[]}},e.prototype.addCaret=function(e,t){var n;if(void 0===t&&(t=!1),0!==getSelection().rangeCount&&!e[e.currentMode].element.querySelector("wbr")){var r=getSelection().getRangeAt(0);if(e[e.currentMode].element.contains(r.startContainer)){n=r.cloneRange();var i=document.createElement("span");i.className="vditor-wbr",r.insertNode(i)}}var o=e[e.currentMode].element.cloneNode(!0);o.querySelectorAll(".vditor-".concat(e.currentMode,"__preview[data-render='1']")).forEach(function(e){e.firstElementChild&&(e.firstElementChild.classList.contains("language-echarts")||e.firstElementChild.classList.contains("language-plantuml")||e.firstElementChild.classList.contains("language-mindmap")?(e.firstElementChild.removeAttribute("_echarts_instance_"),e.firstElementChild.removeAttribute("data-processed"),e.firstElementChild.innerHTML=e.previousElementSibling.firstElementChild.innerHTML,e.setAttribute("data-render","2")):e.firstElementChild.classList.contains("language-math")&&(e.setAttribute("data-render","2"),e.firstElementChild.textContent=e.firstElementChild.getAttribute("data-math"),e.firstElementChild.removeAttribute("data-math")))});var u=o.innerHTML;return e[e.currentMode].element.querySelectorAll(".vditor-wbr").forEach(function(e){e.remove()}),t&&n&&(0,N.Hc)(n),u.replace('<span class="vditor-wbr"></span>',"<wbr>")},e}(),vr=n(673),Dr=function(){function e(e){this.defaultOptions={rtl:!1,after:void 0,cache:{enable:!0},cdn:i.g.CDN,classes:{preview:""},comment:{enable:!1},counter:{enable:!1,type:"markdown"},customRenders:[],debugger:!1,fullscreen:{index:90},height:"auto",hint:{delay:200,emoji:{"+1":"👍","-1":"👎",confused:"😕",eyes:"👀️",heart:"❤️",rocket:"🚀️",smile:"😄",tada:"🎉️"},emojiPath:"".concat(i.g.CDN,"/dist/images/emoji"),extend:[],parse:!0},icon:"ant",lang:"zh_CN",mode:"ir",outline:{enable:!1,position:"left"},placeholder:"",preview:{actions:["desktop","tablet","mobile","mp-wechat","zhihu"],delay:1e3,hljs:i.g.HLJS_OPTIONS,markdown:i.g.MARKDOWN_OPTIONS,math:i.g.MATH_OPTIONS,maxWidth:800,mode:"both",theme:i.g.THEME_OPTIONS,render:{media:{enable:!0}}},link:{isOpen:!0},image:{isPreview:!0},resize:{enable:!1,position:"bottom"},theme:"classic",toolbar:["emoji","headings","bold","italic","strike","link","|","list","ordered-list","check","outdent","indent","|","quote","line","code","inline-code","insert-before","insert-after","|","upload","record","table","|","undo","redo","|","fullscreen","edit-mode",{name:"more",toolbar:["both","code-theme","content-theme","export","outline","preview","devtools","info","help"]}],toolbarConfig:{hide:!1,pin:!1},typewriterMode:!1,undoDelay:800,upload:{extraData:{},fieldName:"file[]",filename:function(e){return e.replace(/\W/g,"")},linkToImgUrl:"",max:10485760,multiple:!0,url:"",withCredentials:!1},value:"",width:"auto"},this.options=e}return e.prototype.merge=function(){var e,t,n,r,i,o,u,a,l;this.options&&(this.options.toolbar?this.options.toolbar=this.mergeToolbar(this.options.toolbar):this.options.toolbar=this.mergeToolbar(this.defaultOptions.toolbar),(null===(t=null===(e=this.options.preview)||void 0===e?void 0:e.theme)||void 0===t?void 0:t.list)&&(this.defaultOptions.preview.theme.list=this.options.preview.theme.list),(null===(i=null===(r=null===(n=this.options.preview)||void 0===n?void 0:n.render)||void 0===r?void 0:r.media)||void 0===i?void 0:i.enable)&&(this.defaultOptions.preview.render.media.enable=this.options.preview.render.media.enable),(null===(o=this.options.hint)||void 0===o?void 0:o.emoji)&&(this.defaultOptions.hint.emoji=this.options.hint.emoji),this.options.comment&&(this.defaultOptions.comment=this.options.comment),this.options.cdn&&((null===(a=null===(u=this.options.preview)||void 0===u?void 0:u.theme)||void 0===a?void 0:a.path)||(this.defaultOptions.preview.theme.path="".concat(this.options.cdn,"/dist/css/content-theme")),(null===(l=this.options.hint)||void 0===l?void 0:l.emojiPath)||(this.defaultOptions.hint.emojiPath="".concat(this.options.cdn,"/dist/images/emoji"))));var s=(0,vr.T)(this.defaultOptions,this.options);if(s.cache.enable&&!s.cache.id)throw new Error("need options.cache.id, see https://ld246.com/article/1549638745630#options");return s},e.prototype.mergeToolbar=function(e){var t=this,n=[{icon:'<svg><use xlink:href="#vditor-icon-export"></use></svg>',name:"export",tipPosition:"ne"},{hotkey:"⌘E",icon:'<svg><use xlink:href="#vditor-icon-emoji"></use></svg>',name:"emoji",tipPosition:"ne"},{hotkey:"⌘H",icon:'<svg><use xlink:href="#vditor-icon-headings"></use></svg>',name:"headings",tipPosition:"ne"},{hotkey:"⌘B",icon:'<svg><use xlink:href="#vditor-icon-bold"></use></svg>',name:"bold",prefix:"**",suffix:"**",tipPosition:"ne"},{hotkey:"⌘I",icon:'<svg><use xlink:href="#vditor-icon-italic"></use></svg>',name:"italic",prefix:"*",suffix:"*",tipPosition:"ne"},{hotkey:"⌘D",icon:'<svg><use xlink:href="#vditor-icon-strike"></use></svg>',name:"strike",prefix:"~~",suffix:"~~",tipPosition:"ne"},{hotkey:"⌘K",icon:'<svg><use xlink:href="#vditor-icon-link"></use></svg>',name:"link",prefix:"[",suffix:"](https://)",tipPosition:"n"},{name:"|"},{hotkey:"⌘L",icon:'<svg><use xlink:href="#vditor-icon-list"></use></svg>',name:"list",prefix:"* ",tipPosition:"n"},{hotkey:"⌘O",icon:'<svg><use xlink:href="#vditor-icon-ordered-list"></use></svg>',name:"ordered-list",prefix:"1. ",tipPosition:"n"},{hotkey:"⌘J",icon:'<svg><use xlink:href="#vditor-icon-check"></use></svg>',name:"check",prefix:"* [ ] ",tipPosition:"n"},{hotkey:"⇧⌘I",icon:'<svg><use xlink:href="#vditor-icon-outdent"></use></svg>',name:"outdent",tipPosition:"n"},{hotkey:"⇧⌘O",icon:'<svg><use xlink:href="#vditor-icon-indent"></use></svg>',name:"indent",tipPosition:"n"},{name:"|"},{hotkey:"⌘;",icon:'<svg><use xlink:href="#vditor-icon-quote"></use></svg>',name:"quote",prefix:"> ",tipPosition:"n"},{hotkey:"⇧⌘H",icon:'<svg><use xlink:href="#vditor-icon-line"></use></svg>',name:"line",prefix:"---",tipPosition:"n"},{hotkey:"⌘U",icon:'<svg><use xlink:href="#vditor-icon-code"></use></svg>',name:"code",prefix:"```",suffix:"\n```",tipPosition:"n"},{hotkey:"⌘G",icon:'<svg><use xlink:href="#vditor-icon-inline-code"></use></svg>',name:"inline-code",prefix:"`",suffix:"`",tipPosition:"n"},{hotkey:"⇧⌘B",icon:'<svg><use xlink:href="#vditor-icon-before"></use></svg>',name:"insert-before",tipPosition:"n"},{hotkey:"⇧⌘E",icon:'<svg><use xlink:href="#vditor-icon-after"></use></svg>',name:"insert-after",tipPosition:"n"},{name:"|"},{icon:'<svg><use xlink:href="#vditor-icon-upload"></use></svg>',name:"upload",tipPosition:"n"},{icon:'<svg><use xlink:href="#vditor-icon-record"></use></svg>',name:"record",tipPosition:"n"},{hotkey:"⌘M",icon:'<svg><use xlink:href="#vditor-icon-table"></use></svg>',name:"table",prefix:"| col1",suffix:" | col2 | col3 |\n| --- | --- | --- |\n| | | |\n| | | |",tipPosition:"n"},{name:"|"},{hotkey:"⌘Z",icon:'<svg><use xlink:href="#vditor-icon-undo"></use></svg>',name:"undo",tipPosition:"nw"},{hotkey:"⌘Y",icon:'<svg><use xlink:href="#vditor-icon-redo"></use></svg>',name:"redo",tipPosition:"nw"},{name:"|"},{icon:'<svg><use xlink:href="#vditor-icon-more"></use></svg>',name:"more",tipPosition:"e"},{hotkey:"⌘'",icon:'<svg><use xlink:href="#vditor-icon-fullscreen"></use></svg>',name:"fullscreen",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-edit"></use></svg>',name:"edit-mode",tipPosition:"nw"},{hotkey:"⌘P",icon:'<svg><use xlink:href="#vditor-icon-both"></use></svg>',name:"both",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-preview"></use></svg>',name:"preview",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-align-center"></use></svg>',name:"outline",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-theme"></use></svg>',name:"content-theme",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-code-theme"></use></svg>',name:"code-theme",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-bug"></use></svg>',name:"devtools",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-info"></use></svg>',name:"info",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-help"></use></svg>',name:"help",tipPosition:"nw"},{name:"br"}],r=[];return e.forEach(function(e){var i=e;n.forEach(function(t){"string"==typeof e&&t.name===e&&(i=t),"object"===w(e)&&t.name===e.name&&(i=Object.assign({},t,e))}),e.toolbar&&(i.toolbar=t.mergeToolbar(e.toolbar)),r.push(i)}),r},e}(),gr=function(){function e(e){var t=this;this.composingLock=!1,this.commentIds=[];var n=document.createElement("div");n.className="vditor-wysiwyg",n.innerHTML='<pre class="vditor-reset" placeholder="'.concat(e.options.placeholder,'"\n contenteditable="true" spellcheck="false"></pre>\n<div class="vditor-panel vditor-panel--none"></div>\n<div class="vditor-panel vditor-panel--none">\n <button type="button" aria-label="').concat(window.VditorI18n.comment,'" class="vditor-icon vditor-tooltipped vditor-tooltipped__n">\n <svg><use xlink:href="#vditor-icon-comment"></use></svg>\n </button>\n</div>'),this.element=n.firstElementChild,this.popover=n.firstElementChild.nextElementSibling,this.selectPopover=n.lastElementChild,this.bindEvent(e),Xe(e,this.element),Ze(e,this.element),Je(e,this.element),tt(e,this.element),nt(e,this.element),$e(e,this.element),Ye(e,this.element,this.copy),Qe(e,this.element,this.copy),e.options.comment.enable&&(this.selectPopover.querySelector("button").onclick=function(){var n,r,o=Lute.NewNodeID(),u=getSelection().getRangeAt(0),a=u.cloneRange(),l=u.extractContents(),s=!1,c=!1;l.childNodes.forEach(function(e,t){var i=!1;if(3===e.nodeType?i=!0:e.classList.contains("vditor-comment")?e.classList.contains("vditor-comment")&&e.setAttribute("data-cmtids",e.getAttribute("data-cmtids")+" "+o):i=!0,i)if(3!==e.nodeType&&"0"===e.getAttribute("data-block")&&0===t&&a.startOffset>0)e.innerHTML='<span class="vditor-comment" data-cmtids="'.concat(o,'">').concat(e.innerHTML,"</span>"),n=e;else if(3!==e.nodeType&&"0"===e.getAttribute("data-block")&&t===l.childNodes.length-1&&a.endOffset<a.endContainer.textContent.length)e.innerHTML='<span class="vditor-comment" data-cmtids="'.concat(o,'">').concat(e.innerHTML,"</span>"),r=e;else if(3!==e.nodeType&&"0"===e.getAttribute("data-block"))0===t?s=!0:t===l.childNodes.length-1&&(c=!0),e.innerHTML='<span class="vditor-comment" data-cmtids="'.concat(o,'">').concat(e.innerHTML,"</span>");else{var u=document.createElement("span");u.classList.add("vditor-comment"),u.setAttribute("data-cmtids",o),e.parentNode.insertBefore(u,e),u.appendChild(e)}});var d=(0,g.F9)(a.startContainer);d&&(n?(d.insertAdjacentHTML("beforeend",n.innerHTML),n.remove()):""===d.textContent.trim().replace(i.g.ZWSP,"")&&s&&d.remove());var p=(0,g.F9)(a.endContainer);p&&(r?(p.insertAdjacentHTML("afterbegin",r.innerHTML),r.remove()):""===p.textContent.trim().replace(i.g.ZWSP,"")&&c&&p.remove()),u.insertNode(l),e.options.comment.add(o,u.toString(),t.getComments(e,!0)),Ee(e,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),t.hideComment()})}return e.prototype.getComments=function(e,t){var n=this;if(void 0===t&&(t=!1),"wysiwyg"!==e.currentMode||!e.options.comment.enable)return[];this.commentIds=[],this.element.querySelectorAll(".vditor-comment").forEach(function(e){n.commentIds=n.commentIds.concat(e.getAttribute("data-cmtids").split(" "))}),this.commentIds=Array.from(new Set(this.commentIds));var r=[];return t?(this.commentIds.forEach(function(e){r.push({id:e,top:n.element.querySelector('.vditor-comment[data-cmtids="'.concat(e,'"]')).offsetTop})}),r):void 0},e.prototype.triggerRemoveComment=function(e){if("wysiwyg"===e.currentMode&&e.options.comment.enable&&e.wysiwyg.commentIds.length>0){var t=JSON.parse(JSON.stringify(this.commentIds));this.getComments(e);var n=function(e,t){var n=new Set(t);return e.filter(function(e){return!n.has(e)})}(t,this.commentIds);n.length>0&&e.options.comment.remove(n)}},e.prototype.showComment=function(){var e=(0,N.Ny)(this.element);this.selectPopover.setAttribute("style","left:".concat(e.left,"px;display:block;top:").concat(Math.max(-8,e.top-21),"px"))},e.prototype.hideComment=function(){this.selectPopover.setAttribute("style","display:none")},e.prototype.unbindListener=function(){window.removeEventListener("scroll",this.scrollListener)},e.prototype.copy=function(e,t){var n=getSelection().getRangeAt(0);if(""!==n.toString()){e.stopPropagation(),e.preventDefault();var r=(0,g.lG)(n.startContainer,"CODE"),i=(0,g.lG)(n.endContainer,"CODE");if(r&&i&&i.isSameNode(r)){var o="";return o="PRE"===r.parentElement.tagName?n.toString():"`"+n.toString()+"`",e.clipboardData.setData("text/plain",o),void e.clipboardData.setData("text/html","")}var u=(0,g.lG)(n.startContainer,"A"),a=(0,g.lG)(n.endContainer,"A");if(u&&a&&a.isSameNode(u)){var l=u.getAttribute("title")||"";return l&&(l=' "'.concat(l,'"')),e.clipboardData.setData("text/plain","[".concat(n.toString(),"](").concat(u.getAttribute("href")).concat(l,")")),void e.clipboardData.setData("text/html","")}var s=document.createElement("div");s.appendChild(n.cloneContents()),e.clipboardData.setData("text/plain",t.lute.VditorDOM2Md(s.innerHTML).trim()),e.clipboardData.setData("text/html","")}},e.prototype.bindEvent=function(e){var t=this;this.unbindListener(),window.addEventListener("scroll",this.scrollListener=function(){if(v(e,["hint"]),"block"===t.popover.style.display&&"block"===t.selectPopover.style.display){var n=parseInt(t.popover.getAttribute("data-top"),10);if("auto"===e.options.height){if(e.options.toolbarConfig.pin){var r=Math.max(n,window.scrollY-e.element.offsetTop-8)+"px";"block"===t.popover.style.display&&(t.popover.style.top=r),"block"===t.selectPopover.style.display&&(t.selectPopover.style.top=r)}}else if(e.options.toolbarConfig.pin&&0===e.toolbar.element.getBoundingClientRect().top){var i=Math.max(window.scrollY-e.element.offsetTop-8,Math.min(n-e.wysiwyg.element.scrollTop,t.element.clientHeight-21))+"px";"block"===t.popover.style.display&&(t.popover.style.top=i),"block"===t.selectPopover.style.display&&(t.selectPopover.style.top=i)}}}),this.element.addEventListener("scroll",function(){if(v(e,["hint"]),e.options.comment&&e.options.comment.enable&&e.options.comment.scroll&&e.options.comment.scroll(e.wysiwyg.element.scrollTop),"block"===t.popover.style.display){var n=parseInt(t.popover.getAttribute("data-top"),10)-e.wysiwyg.element.scrollTop,r=-8;e.options.toolbarConfig.pin&&0===e.toolbar.element.getBoundingClientRect().top&&(r=window.scrollY-e.element.offsetTop+r);var i=Math.max(r,Math.min(n,t.element.clientHeight-21))+"px";t.popover.style.top=i,t.selectPopover.style.top=i}}),this.element.addEventListener("paste",function(t){Jt(e,t,{pasteCode:function(t){var n=(0,N.zh)(e),r=document.createElement("template");r.innerHTML=t,n.insertNode(r.content.cloneNode(!0));var i=(0,g.a1)(n.startContainer,"data-block","0");i?i.outerHTML=e.lute.SpinVditorDOM(i.outerHTML):e.wysiwyg.element.innerHTML=e.lute.SpinVditorDOM(e.wysiwyg.element.innerHTML),(0,N.ib)(e.wysiwyg.element,n)}})}),this.element.addEventListener("compositionstart",function(){t.composingLock=!0}),this.element.addEventListener("compositionend",function(n){var r=(0,b.W)(getSelection().getRangeAt(0).startContainer);r&&""===r.textContent?O(e):((0,s.vU)()||vt(e,getSelection().getRangeAt(0).cloneRange(),n),t.composingLock=!1)}),this.element.addEventListener("input",function(n){if("deleteByDrag"!==n.inputType&&"insertFromDrop"!==n.inputType){if(t.preventInput)return t.preventInput=!1,void Ee(e);if(t.composingLock||"‘"===n.data||"“"===n.data||"《"===n.data)Ee(e);else{var r=getSelection().getRangeAt(0),i=(0,g.F9)(r.startContainer);if(i||(Ae(e,r),i=(0,g.F9)(r.startContainer)),i){for(var o=(0,N.im)(i,e.wysiwyg.element,r).start,a=!0,l=o-1;l>i.textContent.substr(0,o).lastIndexOf("\n");l--)if(" "!==i.textContent.charAt(l)&&"\t"!==i.textContent.charAt(l)){a=!1;break}0===o&&(a=!1);var s=!0;for(l=o-1;l<i.textContent.length;l++)if(" "!==i.textContent.charAt(l)&&"\n"!==i.textContent.charAt(l)){s=!1;break}s&&/^#{1,6} $/.test(i.textContent)&&(s=!1);var c=(0,b.W)(getSelection().getRangeAt(0).startContainer);c&&""===c.textContent&&(O(e),c.remove()),a&&"code-block"!==i.getAttribute("data-type")||s||Mt(i.innerHTML)||Lt(i.innerHTML)&&i.previousElementSibling?"function"==typeof e.options.input&&e.options.input(u(e)):("insertParagraph"===n.inputType&&"<p><br></p><p><br></p>"===t.element.innerHTML&&i.previousElementSibling.remove(),vt(e,r,n))}}}}),this.element.addEventListener("click",function(n){if("INPUT"===n.target.tagName){var r=n.target;return r.checked?r.setAttribute("checked","checked"):r.removeAttribute("checked"),t.preventInput=!0,getSelection().rangeCount>0&&(0,N.Hc)(getSelection().getRangeAt(0)),void Ee(e)}if("IMG"!==n.target.tagName||n.target.parentElement.classList.contains("vditor-wysiwyg__preview")){var o=(0,g.lG)(n.target,"A");if(o)return e.options.link.click?e.options.link.click(o):e.options.link.isOpen&&window.open(o.getAttribute("href")),void n.preventDefault();var a=(0,N.zh)(e);if(n.target.isEqualNode(t.element)&&t.element.lastElementChild&&a.collapsed){var l=t.element.lastElementChild.getBoundingClientRect();n.y>l.top+l.height&&("P"===t.element.lastElementChild.tagName&&""===t.element.lastElementChild.textContent.trim().replace(i.g.ZWSP,"")?(a.selectNodeContents(t.element.lastElementChild),a.collapse(!1)):(t.element.insertAdjacentHTML("beforeend",'<p data-block="0">'.concat(i.g.ZWSP,"<wbr></p>")),(0,N.ib)(t.element,a)))}Te(e);var s=(0,g.fb)(n.target,"vditor-wysiwyg__preview");s||(s=(0,g.fb)((0,N.zh)(e).startContainer,"vditor-wysiwyg__preview")),s&&ke(s,e),H(n,e)}else"link-ref"===n.target.getAttribute("data-type")?Be(e,n.target):function(e,t){var n=e.target;t.wysiwyg.popover.innerHTML="";var r=function(){n.setAttribute("src",o.value),n.setAttribute("alt",l.value),n.setAttribute("title",c.value),"function"==typeof t.options.input&&t.options.input(u(t))},i=document.createElement("span");i.setAttribute("aria-label",window.VditorI18n.imageURL),i.className="vditor-tooltipped vditor-tooltipped__n";var o=document.createElement("input");i.appendChild(o),o.className="vditor-input",o.setAttribute("placeholder",window.VditorI18n.imageURL),o.value=n.getAttribute("src")||"",o.oninput=function(){r()},o.onkeydown=function(e){Se(t,e)};var a=document.createElement("span");a.setAttribute("aria-label",window.VditorI18n.alternateText),a.className="vditor-tooltipped vditor-tooltipped__n";var l=document.createElement("input");a.appendChild(l),l.className="vditor-input",l.setAttribute("placeholder",window.VditorI18n.alternateText),l.style.width="52px",l.value=n.getAttribute("alt")||"",l.oninput=function(){r()},l.onkeydown=function(e){Se(t,e)};var s=document.createElement("span");s.setAttribute("aria-label",window.VditorI18n.title),s.className="vditor-tooltipped vditor-tooltipped__n";var c=document.createElement("input");s.appendChild(c),c.className="vditor-input",c.setAttribute("placeholder",window.VditorI18n.title),c.value=n.getAttribute("title")||"",c.oninput=function(){r()},c.onkeydown=function(e){Se(t,e)},Ne(n,t),t.wysiwyg.popover.insertAdjacentElement("beforeend",i),t.wysiwyg.popover.insertAdjacentElement("beforeend",a),t.wysiwyg.popover.insertAdjacentElement("beforeend",s),je(t,"image"),xe(t,n)}(n,e)}),this.element.addEventListener("keyup",function(t){if(!t.isComposing&&!(0,s.yl)(t)){"Enter"===t.key&&et(e),"Backspace"!==t.key&&"Delete"!==t.key||""===e.wysiwyg.element.innerHTML||1!==e.wysiwyg.element.childNodes.length||!e.wysiwyg.element.firstElementChild||"P"!==e.wysiwyg.element.firstElementChild.tagName||0!==e.wysiwyg.element.firstElementChild.childElementCount||""!==e.wysiwyg.element.textContent&&"\n"!==e.wysiwyg.element.textContent||(e.wysiwyg.element.innerHTML="");var n=(0,N.zh)(e);if("Backspace"===t.key&&(0,s.vU)()&&"\n"===n.startContainer.textContent&&1===n.startOffset&&(n.startContainer.textContent=""),Ae(e,n),Te(e),"ArrowDown"===t.key||"ArrowRight"===t.key||"Backspace"===t.key||"ArrowLeft"===t.key||"ArrowUp"===t.key){"ArrowLeft"!==t.key&&"ArrowRight"!==t.key||e.hint.render(e);var r=(0,g.fb)(n.startContainer,"vditor-wysiwyg__preview");if(!r&&3!==n.startContainer.nodeType&&n.startOffset>0&&(o=n.startContainer).classList.contains("vditor-wysiwyg__block")&&(r=o.lastElementChild),r)if("none"!==r.previousElementSibling.style.display){var i=r.previousElementSibling;if("PRE"===i.tagName&&(i=i.firstElementChild),"ArrowDown"===t.key||"ArrowRight"===t.key){var o,u=function(e){for(var t=e;t&&!t.nextSibling;)t=t.parentElement;return t.nextSibling}(o=r.parentElement);if(u&&3!==u.nodeType){var a=u.querySelector(".vditor-wysiwyg__preview");if(a)return void ke(a,e)}if(3===u.nodeType){for(;0===u.textContent.length&&u.nextSibling;)u=u.nextSibling;n.setStart(u,1)}else n.setStart(u.firstChild,0)}else n.selectNodeContents(i),n.collapse(!1)}else"ArrowDown"===t.key||"ArrowRight"===t.key?ke(r,e):ke(r,e,!1)}}})},e}(),br=(ge=function(e,t){return ge=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},ge(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}ge(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),yr=function(e){function t(t,n){var r=e.call(this)||this;if(r.isDestroyed=!1,r.version=i.H,"string"==typeof t){if(n?n.cache?n.cache.id||(n.cache.id="vditor".concat(t)):n.cache={id:"vditor".concat(t)}:n={cache:{id:"vditor".concat(t)}},!document.getElementById(t))return r.showErrorTip("Failed to get element by id: ".concat(t)),r;t=document.getElementById(t)}var o=new Dr(n).merge();if(o.i18n)window.VditorI18n=o.i18n,r.init(t,o);else{if(!["de_DE","en_US","es_ES","fr_FR","ja_JP","ko_KR","pt_BR","ru_RU","sv_SE","vi_VN","zh_CN","zh_TW"].includes(o.lang))throw new Error("options.lang error, see https://ld246.com/article/1549638745630#options");var u="vditorI18nScript",l=u+o.lang;document.querySelectorAll('head script[id^="'.concat(u,'"]')).forEach(function(e){e.id!==l&&document.head.removeChild(e)}),(0,a.G)("".concat(o.cdn,"/dist/js/i18n/").concat(o.lang,".js"),l).then(function(){r.init(t,o)}).catch(function(e){r.showErrorTip("GET ".concat(o.cdn,"/dist/js/i18n/").concat(o.lang,".js net::ERR_ABORTED 404 (Not Found)"))})}return r}return br(t,e),t.prototype.showErrorTip=function(e){var t=new Dn;document.body.appendChild(t.element),t.show(e,0)},t.prototype.updateToolbarConfig=function(e){this.vditor.toolbar.updateConfig(this.vditor,e)},t.prototype.setTheme=function(e,t,n,r){this.vditor.options.theme=e,W(this.vditor),t&&(this.vditor.options.preview.theme.current=t,(0,z.Z)(t,r||this.vditor.options.preview.theme.path)),n&&(this.vditor.options.preview.hljs.style=n,(0,Cn.Y)(n,this.vditor.options.cdn))},t.prototype.getValue=function(){return u(this.vditor)},t.prototype.getCurrentMode=function(){return this.vditor.currentMode},t.prototype.focus=function(){"sv"===this.vditor.currentMode?this.vditor.sv.element.focus():"wysiwyg"===this.vditor.currentMode?this.vditor.wysiwyg.element.focus():"ir"===this.vditor.currentMode&&this.vditor.ir.element.focus()},t.prototype.blur=function(){"sv"===this.vditor.currentMode?this.vditor.sv.element.blur():"wysiwyg"===this.vditor.currentMode?this.vditor.wysiwyg.element.blur():"ir"===this.vditor.currentMode&&this.vditor.ir.element.blur()},t.prototype.disabled=function(){v(this.vditor,["subToolbar","hint","popover"]),f(this.vditor.toolbar.elements,i.g.EDIT_TOOLBARS.concat(["undo","redo","fullscreen","edit-mode"])),this.vditor[this.vditor.currentMode].element.setAttribute("contenteditable","false")},t.prototype.enable=function(){p(this.vditor.toolbar.elements,i.g.EDIT_TOOLBARS.concat(["undo","redo","fullscreen","edit-mode"])),this.vditor.undo.resetIcon(this.vditor),this.vditor[this.vditor.currentMode].element.setAttribute("contenteditable","true")},t.prototype.getSelection=function(){return"wysiwyg"===this.vditor.currentMode?Ke(this.vditor.wysiwyg.element):"sv"===this.vditor.currentMode?Ke(this.vditor.sv.element):"ir"===this.vditor.currentMode?Ke(this.vditor.ir.element):void 0},t.prototype.renderPreview=function(e){this.vditor.preview.render(this.vditor,e)},t.prototype.getCursorPosition=function(){return(0,N.Ny)(this.vditor[this.vditor.currentMode].element)},t.prototype.isUploading=function(){return this.vditor.upload.isUploading},t.prototype.clearCache=function(){this.vditor.options.cache.enable&&(0,s.pK)()&&localStorage.removeItem(this.vditor.options.cache.id)},t.prototype.disabledCache=function(){this.vditor.options.cache.enable=!1},t.prototype.enableCache=function(){if(!this.vditor.options.cache.id)throw new Error("need options.cache.id, see https://ld246.com/article/1549638745630#options");this.vditor.options.cache.enable=!0},t.prototype.html2md=function(e){return this.vditor.lute.HTML2Md(e)},t.prototype.exportJSON=function(e){return this.vditor.lute.RenderJSON(e)},t.prototype.getHTML=function(){return sn(this.vditor)},t.prototype.tip=function(e,t){this.vditor.tip.show(e,t)},t.prototype.setPreviewMode=function(e){gn(e,this.vditor)},t.prototype.deleteValue=function(){window.getSelection().isCollapsed||document.execCommand("delete",!1)},t.prototype.updateValue=function(e){document.execCommand("insertHTML",!1,e)},t.prototype.insertValue=function(e,t){void 0===t&&(t=!0);var n=(0,N.zh)(this.vditor);n.collapse(!0);var r=document.createElement("template");r.innerHTML=e,n.insertNode(r.content.cloneNode(!0)),n.collapse(!1),"sv"===this.vditor.currentMode?(this.vditor.sv.preventInput=!0,t&&V(this.vditor)):"wysiwyg"===this.vditor.currentMode?t&&vt(this.vditor,getSelection().getRangeAt(0)):"ir"===this.vditor.currentMode&&(this.vditor.ir.preventInput=!0,t&&P(this.vditor,getSelection().getRangeAt(0),!0))},t.prototype.insertMD=function(e){"ir"===this.vditor.currentMode?(0,N.oC)(this.vditor.lute.Md2VditorIRDOM(e),this.vditor):"wysiwyg"===this.vditor.currentMode?(0,N.oC)(this.vditor.lute.Md2VditorDOM(e),this.vditor):rt(this.vditor,e),this.vditor.outline.render(this.vditor),Nt(this.vditor)},t.prototype.setValue=function(e,t){var n=this;void 0===t&&(t=!1),"sv"===this.vditor.currentMode?(this.vditor.sv.element.innerHTML="<div data-block='0'>".concat(this.vditor.lute.SpinVditorSVDOM(e),"</div>"),at(this.vditor,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1})):"wysiwyg"===this.vditor.currentMode?qe(this.vditor,e,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}):(this.vditor.ir.element.innerHTML=this.vditor.lute.Md2VditorIRDOM(e),this.vditor.ir.element.querySelectorAll(".vditor-ir__preview[data-render='2']").forEach(function(e){M(e,n.vditor)}),en(this.vditor,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1})),this.vditor.outline.render(this.vditor),e||(v(this.vditor,["emoji","headings","submenu","hint"]),this.vditor.wysiwyg.popover&&(this.vditor.wysiwyg.popover.style.display="none"),this.clearCache()),t&&this.clearStack()},t.prototype.insertEmptyBlock=function(e){Ct(this.vditor,e)},t.prototype.clearStack=function(){this.vditor.undo.clearStack(this.vditor),this.vditor.undo.addToUndoStack(this.vditor)},t.prototype.destroy=function(){this.vditor.element.innerHTML=this.vditor.originalInnerHTML,this.vditor.element.classList.remove("vditor"),this.vditor.element.removeAttribute("style");var e=document.getElementById("vditorIconScript");e&&e.remove(),this.clearCache(),X(),this.vditor.wysiwyg.unbindListener(),this.vditor.options.after=void 0,this.isDestroyed=!0},t.prototype.getCommentIds=function(){return"wysiwyg"!==this.vditor.currentMode?[]:this.vditor.wysiwyg.getComments(this.vditor,!0)},t.prototype.hlCommentIds=function(e){if("wysiwyg"===this.vditor.currentMode){var t=function(t){t.classList.remove("vditor-comment--hover"),e.forEach(function(e){t.getAttribute("data-cmtids").indexOf(e)>-1&&t.classList.add("vditor-comment--hover")})};this.vditor.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(e){t(e)}),"none"!==this.vditor.preview.element.style.display&&this.vditor.preview.element.querySelectorAll(".vditor-comment").forEach(function(e){t(e)})}},t.prototype.unHlCommentIds=function(e){if("wysiwyg"===this.vditor.currentMode){var t=function(t){e.forEach(function(e){t.getAttribute("data-cmtids").indexOf(e)>-1&&t.classList.remove("vditor-comment--hover")})};this.vditor.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(e){t(e)}),"none"!==this.vditor.preview.element.style.display&&this.vditor.preview.element.querySelectorAll(".vditor-comment").forEach(function(e){t(e)})}},t.prototype.removeCommentIds=function(e){var t=this;if("wysiwyg"===this.vditor.currentMode){var n=function(e,n){var r=e.getAttribute("data-cmtids").split(" ");r.find(function(e,t){if(e===n)return r.splice(t,1),!0}),0===r.length?(e.outerHTML=e.innerHTML,(0,N.zh)(t.vditor).collapse(!0)):e.setAttribute("data-cmtids",r.join(" "))};e.forEach(function(e){t.vditor.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(t){n(t,e)}),"none"!==t.vditor.preview.element.style.display&&t.vditor.preview.element.querySelectorAll(".vditor-comment").forEach(function(t){n(t,e)})}),Ee(this.vditor,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1})}},t.prototype.init=function(e,t){var n=this;this.isDestroyed||(this.vditor={currentMode:t.mode,element:e,hint:new an(t.hint.extend),lute:void 0,options:t,originalInnerHTML:e.innerHTML,outline:new pn(window.VditorI18n.outline),tip:new Dn},this.vditor.sv=new vn(this.vditor),this.vditor.undo=new mr,this.vditor.wysiwyg=new gr(this.vditor),this.vditor.ir=new ln(this.vditor),this.vditor.toolbar=new fr(this.vditor),t.resize.enable&&(this.vditor.resize=new mn(this.vditor)),this.vditor.toolbar.elements.devtools&&(this.vditor.devtools=new l),(t.upload.url||t.upload.handler)&&(this.vditor.upload=new ht),(0,a.G)(t._lutePath||"".concat(t.cdn,"/dist/js/lute/lute.min.js"),"vditorLuteScript").then(function(){n.vditor.lute=(0,cn.X)({autoSpace:n.vditor.options.preview.markdown.autoSpace,gfmAutoLink:n.vditor.options.preview.markdown.gfmAutoLink,codeBlockPreview:n.vditor.options.preview.markdown.codeBlockPreview,emojiSite:n.vditor.options.hint.emojiPath,emojis:n.vditor.options.hint.emoji,fixTermTypo:n.vditor.options.preview.markdown.fixTermTypo,footnotes:n.vditor.options.preview.markdown.footnotes,headingAnchor:!1,inlineMathDigit:n.vditor.options.preview.math.inlineDigit,linkBase:n.vditor.options.preview.markdown.linkBase,linkPrefix:n.vditor.options.preview.markdown.linkPrefix,listStyle:n.vditor.options.preview.markdown.listStyle,mark:n.vditor.options.preview.markdown.mark,mathBlockPreview:n.vditor.options.preview.markdown.mathBlockPreview,paragraphBeginningSpace:n.vditor.options.preview.markdown.paragraphBeginningSpace,sanitize:n.vditor.options.preview.markdown.sanitize,toc:n.vditor.options.preview.markdown.toc}),n.vditor.preview=new hn(n.vditor),function(e){e.element.innerHTML="",e.element.classList.add("vditor"),e.options.rtl&&e.element.setAttribute("dir","rtl"),W(e),(0,z.Z)(e.options.preview.theme.current,e.options.preview.theme.path),"number"==typeof e.options.height?e.element.style.height=e.options.height+"px":e.element.style.height=e.options.height,"number"==typeof e.options.minHeight&&(e.element.style.minHeight=e.options.minHeight+"px"),"number"==typeof e.options.width?e.element.style.width=e.options.width+"px":e.element.style.width=e.options.width,e.element.appendChild(e.toolbar.element);var t=document.createElement("div");if(t.className="vditor-content","left"===e.options.outline.position&&t.appendChild(e.outline.element),t.appendChild(e.wysiwyg.element.parentElement),t.appendChild(e.sv.element),t.appendChild(e.ir.element.parentElement),t.appendChild(e.preview.element),e.toolbar.elements.devtools&&t.appendChild(e.devtools.element),"right"===e.options.outline.position&&(e.outline.element.classList.add("vditor-outline--right"),t.appendChild(e.outline.element)),e.upload&&t.appendChild(e.upload.element),e.options.resize.enable&&t.appendChild(e.resize.element),t.appendChild(e.hint.element),t.appendChild(e.tip.element),e.element.appendChild(t),t.addEventListener("click",function(){v(e,["subToolbar"])}),e.toolbar.elements.export&&e.element.insertAdjacentHTML("beforeend",'<iframe id="vditorExportIframe" style="width: 100%;height: 0;border: 0"></iframe>'),We(e,e.options.mode,be(e)),document.execCommand("DefaultParagraphSeparator",!1,"p"),navigator.userAgent.indexOf("iPhone")>-1&&void 0!==window.visualViewport){var n=!1,r=function(t){n||(n=!0,requestAnimationFrame(function(){n=!1;var t=e.toolbar.element;t.style.transform="none",t.getBoundingClientRect().top<0&&(t.style.transform="translate(0, ".concat(-t.getBoundingClientRect().top,"px)"))}))};window.visualViewport.addEventListener("scroll",r),window.visualViewport.addEventListener("resize",r)}}(n.vditor),t.after&&t.after(),t.icon&&(0,a.J)("".concat(t.cdn,"/dist/js/icons/").concat(t.icon,".js"),"vditorIconScript")}))},t}(t.default),Er=yr}(),r=r.default}()},e.exports=t()}(rn);var on=nn(rn.exports),un=function(e){var t=e.controller,n=be(),r=be(null);return ge(function(){n.current=new on(r.current,{theme:"classic",width:"100%",height:"100%",cache:{enable:!1},preview:{delay:1e3,actions:[]},outline:{enable:!1,position:"left"},toolbarConfig:{hide:!0},value:t.state.value.content,after:function(){!function(){if(n.current){var e=n.current.vditor;e.preview&&(e.preview.element.style.display="block","sv"===e.currentMode?e.sv.element.style.display="none":e[e.currentMode].element.parentElement.style.display="none",e.preview.render(e),setTimeout(function(){e.outline.render(e)},e.options.preview.delay+10))}}(),e.onInitialization()}})},[]),ht("div",{className:"file-preview-md ".concat(t.state.value.theme),children:[ht("div",{ref:r}),ht(en,{to:"#custom-controls",children:ht("button",{title:"目录",className:"control-btn",onClick:function(){if(n.current){var e=n.current.vditor;e.options.outline.enable=!e.options.outline.enable,e.outline.toggle(e,e.options.outline.enable)}},children:ht("span",{className:"icon",children:ht(Et,{})})})})]})};function an(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(function(t){var n=e[t],r=w(n);"object"!==r&&"function"!==r||Object.isFrozen(n)||an(n)}),e}var ln=function(){return D(function e(t){m(this,e),void 0===t.data&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1},[{key:"ignoreMatch",value:function(){this.isMatchIgnored=!0}}])}();function sn(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function cn(e){var t=Object.create(null);for(var n in e)t[n]=e[n];for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return i.forEach(function(e){for(var n in e)t[n]=e[n]}),t}var dn=function(e){return!!e.scope},pn=function(){return D(function e(t,n){m(this,e),this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)},[{key:"addText",value:function(e){this.buffer+=sn(e)}},{key:"openNode",value:function(e){if(dn(e)){var t=function(e,t){var n=t.prefix;if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){var r=e.split(".");return["".concat(n).concat(r.shift())].concat(p(r.map(function(e,t){return"".concat(e).concat("_".repeat(t+1))}))).join(" ")}return"".concat(n).concat(e)}(e.scope,{prefix:this.classPrefix});this.span(t)}}},{key:"closeNode",value:function(e){dn(e)&&(this.buffer+="</span>")}},{key:"value",value:function(){return this.buffer}},{key:"span",value:function(e){this.buffer+='<span class="'.concat(e,'">')}}])}(),fn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={children:[]};return Object.assign(t,e),t},hn=function(e){function t(e){var n;return m(this,t),(n=a(this,t)).options=e,n}return c(t,e),D(t,[{key:"addText",value:function(e){""!==e&&this.add(e)}},{key:"startScope",value:function(e){this.openNode(e)}},{key:"endScope",value:function(){this.closeNode()}},{key:"__addSublanguage",value:function(e,t){var n=e.root;t&&(n.scope="language:".concat(t)),this.add(n)}},{key:"toHTML",value:function(){return new pn(this,this.options).value()}},{key:"finalize",value:function(){return this.closeAllNodes(),!0}}])}(function(){function e(){m(this,e),this.rootNode=fn(),this.stack=[this.rootNode]}return D(e,[{key:"top",get:function(){return this.stack[this.stack.length-1]}},{key:"root",get:function(){return this.rootNode}},{key:"add",value:function(e){this.top.children.push(e)}},{key:"openNode",value:function(e){var t=fn({scope:e});this.add(t),this.stack.push(t)}},{key:"closeNode",value:function(){if(this.stack.length>1)return this.stack.pop()}},{key:"closeAllNodes",value:function(){for(;this.closeNode(););}},{key:"toJSON",value:function(){return JSON.stringify(this.rootNode,null,4)}},{key:"walk",value:function(e){return this.constructor._walk(e,this.rootNode)}}],[{key:"_walk",value:function(e,t){var n=this;return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(function(t){return n._walk(e,t)}),e.closeNode(t)),e}},{key:"_collapse",value:function(t){"string"!=typeof t&&t.children&&(t.children.every(function(e){return"string"==typeof e})?t.children=[t.children.join("")]:t.children.forEach(function(t){e._collapse(t)}))}}])}());function mn(e){return e?"string"==typeof e?e:e.source:null}function vn(e){return bn("(?=",e,")")}function Dn(e){return bn("(?:",e,")*")}function gn(e){return bn("(?:",e,")?")}function bn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.map(function(e){return mn(e)}).join("");return r}function yn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=function(e){var t=e[e.length-1];return"object"===w(t)&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}(t),i="("+(r.capture?"":"?:")+t.map(function(e){return mn(e)}).join("|")+")";return i}function En(e){return new RegExp(e.toString()+"|").exec("").length-1}var Cn=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function wn(e,t){var n=t.joinWith,r=0;return e.map(function(e){for(var t=r+=1,n=mn(e),i="";n.length>0;){var o=Cn.exec(n);if(!o){i+=n;break}i+=n.substring(0,o.index),n=n.substring(o.index+o[0].length),"\\"===o[0][0]&&o[1]?i+="\\"+String(Number(o[1])+t):(i+=o[0],"("===o[0]&&r++)}return i}).map(function(e){return"(".concat(e,")")}).join(n)}var An="[a-zA-Z]\\w*",_n="[a-zA-Z_]\\w*",Fn="\\b\\d+(\\.\\d+)?",kn="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Sn="\\b(0b[01]+)",Tn={begin:"\\\\[\\s\\S]",relevance:0},xn={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Tn]},Bn={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Tn]},Ln=function(e,t){var n=cn({scope:"comment",begin:e,end:t,contains:[]},arguments.length>2&&void 0!==arguments[2]?arguments[2]:{});n.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});var r=yn("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return n.contains.push({begin:bn(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),n},Mn=Ln("//","$"),Nn=Ln("/\\*","\\*/"),On=Ln("#","$"),Hn={scope:"number",begin:Fn,relevance:0},In={scope:"number",begin:kn,relevance:0},Pn={scope:"number",begin:Sn,relevance:0},jn={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Tn,{begin:/\[/,end:/\]/,relevance:0,contains:[Tn]}]},Rn={scope:"title",begin:An,relevance:0},qn={scope:"title",begin:_n,relevance:0},Un={begin:"\\.\\s*"+_n,relevance:0},Vn=Object.freeze({__proto__:null,APOS_STRING_MODE:xn,BACKSLASH_ESCAPE:Tn,BINARY_NUMBER_MODE:Pn,BINARY_NUMBER_RE:Sn,COMMENT:Ln,C_BLOCK_COMMENT_MODE:Nn,C_LINE_COMMENT_MODE:Mn,C_NUMBER_MODE:In,C_NUMBER_RE:kn,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":function(e,t){t.data._beginMatch=e[1]},"on:end":function(e,t){t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:On,IDENT_RE:An,MATCH_NOTHING_RE:/\b\B/,METHOD_GUARD:Un,NUMBER_MODE:Hn,NUMBER_RE:Fn,PHRASAL_WORDS_MODE:{begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},QUOTE_STRING_MODE:Bn,REGEXP_MODE:jn,RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=/^#![ ]*\//;return e.binary&&(e.begin=bn(t,/.*\b/,e.binary,/\b.*/)),cn({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":function(e,t){0!==e.index&&t.ignoreMatch()}},e)},TITLE_MODE:Rn,UNDERSCORE_IDENT_RE:_n,UNDERSCORE_TITLE_MODE:qn});function zn(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}function Wn(e,t){void 0!==e.className&&(e.scope=e.className,delete e.className)}function Gn(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=zn,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function Kn(e,t){Array.isArray(e.illegal)&&(e.illegal=yn.apply(void 0,p(e.illegal)))}function Xn(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function Zn(e,t){void 0===e.relevance&&(e.relevance=1)}var Jn=function(e,t){if(e.beforeMatch){if(e.starts)throw new Error("beforeMatch cannot be used with starts");var n=Object.assign({},e);Object.keys(e).forEach(function(t){delete e[t]}),e.keywords=n.keywords,e.begin=bn(n.beforeMatch,vn(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch}},$n=["of","and","for","in","not","or","if","then","parent","list","value"];function Yn(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"keyword",r=Object.create(null);return"string"==typeof e?i(n,e.split(" ")):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(n){Object.assign(r,Yn(e[n],t,n))}),r;function i(e,n){t&&(n=n.map(function(e){return e.toLowerCase()})),n.forEach(function(t){var n=t.split("|");r[n[0]]=[e,Qn(n[0],n[1])]})}}function Qn(e,t){return t?Number(t):function(e){return $n.includes(e.toLowerCase())}(e)?0:1}var er={},tr=function(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];(t=console).log.apply(t,["WARN: ".concat(e)].concat(r))},nr=function(e,t){er["".concat(e,"/").concat(t)]||(er["".concat(e,"/").concat(t)]=!0)},rr=new Error;function ir(e,t,n){for(var r=n.key,i=0,o=e[r],u={},a={},l=1;l<=t.length;l++)a[l+i]=o[l],u[l+i]=!0,i+=En(t[l-1]);e[r]=a,e[r]._emit=u,e[r]._multi=!0}function or(e){!function(e){e.scope&&"object"===w(e.scope)&&null!==e.scope&&(e.beginScope=e.scope,delete e.scope)}(e),"string"==typeof e.beginScope&&(e.beginScope={_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope}),function(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw rr;if("object"!==w(e.beginScope)||null===e.beginScope)throw rr;ir(e,e.begin,{key:"beginScope"}),e.begin=wn(e.begin,{joinWith:""})}}(e),function(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw rr;if("object"!==w(e.endScope)||null===e.endScope)throw rr;ir(e,e.end,{key:"endScope"}),e.end=wn(e.end,{joinWith:""})}}(e)}function ur(e){function t(t,n){return new RegExp(mn(t),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(n?"g":""))}var n=function(){return D(function e(){m(this,e),this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0},[{key:"addRule",value:function(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=En(e)+1}},{key:"compile",value:function(){0===this.regexes.length&&(this.exec=function(){return null});var e=this.regexes.map(function(e){return e[1]});this.matcherRe=t(wn(e,{joinWith:"|"}),!0),this.lastIndex=0}},{key:"exec",value:function(e){this.matcherRe.lastIndex=this.lastIndex;var t=this.matcherRe.exec(e);if(!t)return null;var n=t.findIndex(function(e,t){return t>0&&void 0!==e}),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}])}(),r=function(){return D(function e(){m(this,e),this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0},[{key:"getMatcher",value:function(e){if(this.multiRegexes[e])return this.multiRegexes[e];var t=new n;return this.rules.slice(e).forEach(function(e){var n=u(e,2),r=n[0],i=n[1];return t.addRule(r,i)}),t.compile(),this.multiRegexes[e]=t,t}},{key:"resumingScanAtSamePosition",value:function(){return 0!==this.regexIndex}},{key:"considerAll",value:function(){this.regexIndex=0}},{key:"addRule",value:function(e,t){this.rules.push([e,t]),"begin"===t.type&&this.count++}},{key:"exec",value:function(e){var t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;var n=t.exec(e);if(this.resumingScanAtSamePosition())if(n&&n.index===this.lastIndex);else{var r=this.getMatcher(0);r.lastIndex=this.lastIndex+1,n=r.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}])}();if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=cn(e.classNameAliases||{}),function n(i,o){var u,a=i;if(i.isCompiled)return a;[Wn,Xn,or,Jn].forEach(function(e){return e(i,o)}),e.compilerExtensions.forEach(function(e){return e(i,o)}),i.__beforeBegin=null,[Gn,Kn,Zn].forEach(function(e){return e(i,o)}),i.isCompiled=!0;var l=null;return"object"===w(i.keywords)&&i.keywords.$pattern&&(i.keywords=Object.assign({},i.keywords),l=i.keywords.$pattern,delete i.keywords.$pattern),l=l||/\w+/,i.keywords&&(i.keywords=Yn(i.keywords,e.case_insensitive)),a.keywordPatternRe=t(l,!0),o&&(i.begin||(i.begin=/\B|\b/),a.beginRe=t(a.begin),i.end||i.endsWithParent||(i.end=/\B|\b/),i.end&&(a.endRe=t(a.end)),a.terminatorEnd=mn(a.end)||"",i.endsWithParent&&o.terminatorEnd&&(a.terminatorEnd+=(i.end?"|":"")+o.terminatorEnd)),i.illegal&&(a.illegalRe=t(i.illegal)),i.contains||(i.contains=[]),i.contains=(u=[]).concat.apply(u,p(i.contains.map(function(e){return function(e){e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return cn(e,{variants:null},t)}));if(e.cachedVariants)return e.cachedVariants;if(ar(e))return cn(e,{starts:e.starts?cn(e.starts):null});if(Object.isFrozen(e))return cn(e);return e}("self"===e?i:e)}))),i.contains.forEach(function(e){n(e,a)}),i.starts&&n(i.starts,o),a.matcher=function(e){var t=new r;return e.contains.forEach(function(e){return t.addRule(e.begin,{rule:e,type:"begin"})}),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end"}),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t}(a),a}(e)}function ar(e){return!!e&&(e.endsWithParent||ar(e.starts))}var lr=function(e){function t(e,n){var r;return m(this,t),(r=a(this,t,[e])).name="HTMLInjectionError",r.html=n,r}return c(t,e),D(t)}(o(Error)),sr=sn,cr=cn,dr=Symbol("nomatch"),pr=function(e){var t=Object.create(null),n=Object.create(null),r=[],i=!0,o="Could not find the language '{}', did you forget to load/include a language module?",a={disableAutodetect:!0,name:"Plain text",contains:[]},l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:hn};function s(e){return l.noHighlightRe.test(e)}function c(e,t,n){var r="",i="";"object"===w(t)?(r=e,n=t.ignoreIllegals,i=t.language):(nr("10.7.0","highlight(lang, code, ...args) has been deprecated."),nr("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),i=e,r=t),void 0===n&&(n=!0);var o={code:r,language:i};b("before:highlight",o);var u=o.result?o.result:d(o.language,o.code,n);return u.code=o.code,b("after:highlight",u),u}function d(e,n,r,a){var s=Object.create(null);function c(e,t){return e.keywords[t]}function f(){if(k.keywords){var e=0;k.keywordPatternRe.lastIndex=0;for(var t=k.keywordPatternRe.exec(x),n="";t;){n+=x.substring(e,t.index);var r=A.case_insensitive?t[0].toLowerCase():t[0],i=c(k,r);if(i){var o=u(i,2),a=o[0],l=o[1];if(T.addText(n),n="",s[r]=(s[r]||0)+1,s[r]<=7&&(B+=l),a.startsWith("_"))n+=t[0];else{var d=A.classNameAliases[a]||a;m(t[0],d)}}else n+=t[0];e=k.keywordPatternRe.lastIndex,t=k.keywordPatternRe.exec(x)}n+=x.substring(e),T.addText(n)}else T.addText(x)}function h(){null!=k.subLanguage?function(){if(""!==x){var e=null;if("string"==typeof k.subLanguage){if(!t[k.subLanguage])return void T.addText(x);e=d(k.subLanguage,x,!0,S[k.subLanguage]),S[k.subLanguage]=e._top}else e=p(x,k.subLanguage.length?k.subLanguage:null);k.relevance>0&&(B+=e.relevance),T.__addSublanguage(e._emitter,e.language)}}():f(),x=""}function m(e,t){""!==e&&(T.startScope(t),T.addText(e),T.endScope())}function D(e,t){for(var n=1,r=t.length-1;n<=r;)if(e._emit[n]){var i=A.classNameAliases[e[n]]||e[n],o=t[n];i?m(o,i):(x=o,f(),x=""),n++}else n++}function g(e,t){return e.scope&&"string"==typeof e.scope&&T.openNode(A.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(m(x,A.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),x=""):e.beginScope._multi&&(D(e.beginScope,t),x="")),k=Object.create(e,{parent:{value:k}})}function b(e,t,n){var r=function(e,t){var n=e&&e.exec(t);return n&&0===n.index}(e.endRe,n);if(r){if(e["on:end"]){var i=new ln(e);e["on:end"](t,i),i.isMatchIgnored&&(r=!1)}if(r){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return b(e.parent,t,n)}function y(e){return 0===k.matcher.regexIndex?(x+=e[0],1):(N=!0,0)}function E(e){var t=e[0],r=n.substring(e.index),i=b(k,e,r);if(!i)return dr;var o=k;k.endScope&&k.endScope._wrap?(h(),m(t,k.endScope._wrap)):k.endScope&&k.endScope._multi?(h(),D(k.endScope,e)):o.skip?x+=t:(o.returnEnd||o.excludeEnd||(x+=t),h(),o.excludeEnd&&(x=t));do{k.scope&&T.closeNode(),k.skip||k.subLanguage||(B+=k.relevance),k=k.parent}while(k!==i.parent);return i.starts&&g(i.starts,e),o.returnEnd?0:t.length}var C={};function w(t,o){var u=o&&o[0];if(x+=t,null==u)return h(),0;if("begin"===C.type&&"end"===o.type&&C.index===o.index&&""===u){if(x+=n.slice(o.index,o.index+1),!i){var a=new Error("0 width match regex (".concat(e,")"));throw a.languageName=e,a.badRule=C.rule,a}return 1}if(C=o,"begin"===o.type)return function(e){for(var t=e[0],n=e.rule,r=new ln(n),i=0,o=[n.__beforeBegin,n["on:begin"]];i<o.length;i++){var u=o[i];if(u&&(u(e,r),r.isMatchIgnored))return y(t)}return n.skip?x+=t:(n.excludeBegin&&(x+=t),h(),n.returnBegin||n.excludeBegin||(x=t)),g(n,e),n.returnBegin?0:t.length}(o);if("illegal"===o.type&&!r){var l=new Error('Illegal lexeme "'+u+'" for mode "'+(k.scope||"<unnamed>")+'"');throw l.mode=k,l}if("end"===o.type){var s=E(o);if(s!==dr)return s}if("illegal"===o.type&&""===u)return x+="\n",1;if(M>1e5&&M>3*o.index)throw new Error("potential infinite loop, way more iterations than matches");return x+=u,u.length}var A=v(e);if(!A)throw o.replace("{}",e),new Error('Unknown language: "'+e+'"');var _=ur(A),F="",k=a||_,S={},T=new l.__emitter(l);!function(){for(var e=[],t=k;t!==A;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach(function(e){return T.openNode(e)})}();var x="",B=0,L=0,M=0,N=!1;try{if(A.__emitTokens)A.__emitTokens(n,T);else{for(k.matcher.considerAll();;){M++,N?N=!1:k.matcher.considerAll(),k.matcher.lastIndex=L;var O=k.matcher.exec(n);if(!O)break;var H=w(n.substring(L,O.index),O);L=O.index+H}w(n.substring(L))}return T.finalize(),F=T.toHTML(),{language:e,value:F,relevance:B,illegal:!1,_emitter:T,_top:k}}catch(I){if(I.message&&I.message.includes("Illegal"))return{language:e,value:sr(n),illegal:!0,relevance:0,_illegalBy:{message:I.message,index:L,context:n.slice(L-100,L+100),mode:I.mode,resultSoFar:F},_emitter:T};if(i)return{language:e,value:sr(n),illegal:!1,relevance:0,errorRaised:I,_emitter:T,_top:k};throw I}}function p(e,n){n=n||l.languages||Object.keys(t);var r=function(e){var t={value:sr(e),illegal:!1,relevance:0,_top:a,_emitter:new l.__emitter(l)};return t._emitter.addText(e),t}(e),i=n.filter(v).filter(g).map(function(t){return d(t,e,!1)});i.unshift(r);var o=i.sort(function(e,t){if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(v(e.language).supersetOf===t.language)return 1;if(v(t.language).supersetOf===e.language)return-1}return 0}),s=u(o,2),c=s[0],p=s[1],f=c;return f.secondBest=p,f}function f(e){var t=function(e){var t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";var n=l.languageDetectRe.exec(t);if(n){var r=v(n[1]);return r||(tr(o.replace("{}",n[1])),tr("Falling back to no-highlight mode for this block.",e)),r?n[1]:"no-highlight"}return t.split(/\s+/).find(function(e){return s(e)||v(e)})}(e);if(!s(t)&&(b("before:highlightElement",{el:e,language:t}),!e.dataset.highlighted)){if(e.children.length>0)if(l.ignoreUnescapedHTML,l.throwUnescapedHTML)throw new lr("One of your code blocks includes unescaped HTML.",e.innerHTML);var r=e.textContent,i=t?c(r,{language:t,ignoreIllegals:!0}):p(r);e.innerHTML=i.value,e.dataset.highlighted="yes",function(e,t,r){var i=t&&n[t]||r;e.classList.add("hljs"),e.classList.add("language-".concat(i))}(e,t,i.language),e.result={language:i.language,re:i.relevance,relevance:i.relevance},i.secondBest&&(e.secondBest={language:i.secondBest.language,relevance:i.secondBest.relevance}),b("after:highlightElement",{el:e,result:i,text:r})}}var h=!1;function m(){if("loading"===document.readyState)return h||window.addEventListener("DOMContentLoaded",function(){m()},!1),void(h=!0);document.querySelectorAll(l.cssSelector).forEach(f)}function v(e){return e=(e||"").toLowerCase(),t[e]||t[n[e]]}function D(e,t){var r=t.languageName;"string"==typeof e&&(e=[e]),e.forEach(function(e){n[e.toLowerCase()]=r})}function g(e){var t=v(e);return t&&!t.disableAutodetect}function b(e,t){var n=e;r.forEach(function(e){e[n]&&e[n](t)})}for(var y in Object.assign(e,{highlight:c,highlightAuto:p,highlightAll:m,highlightElement:f,highlightBlock:function(e){return nr("10.7.0","highlightBlock will be removed entirely in v12.0"),nr("10.7.0","Please use highlightElement now."),f(e)},configure:function(e){l=cr(l,e)},initHighlighting:function(){m(),nr("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")},initHighlightingOnLoad:function(){m(),nr("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")},registerLanguage:function(n,r){var o=null;try{o=r(e)}catch(u){if("Language definition for '{}' could not be registered.".replace("{}",n),!i)throw u;o=a}o.name||(o.name=n),t[n]=o,o.rawDefinition=r.bind(null,e),o.aliases&&D(o.aliases,{languageName:n})},unregisterLanguage:function(e){delete t[e];for(var r=0,i=Object.keys(n);r<i.length;r++){var o=i[r];n[o]===e&&delete n[o]}},listLanguages:function(){return Object.keys(t)},getLanguage:v,registerAliases:D,autoDetection:g,inherit:cr,addPlugin:function(e){!function(e){e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=function(t){e["before:highlightBlock"](Object.assign({block:t.el},t))}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=function(t){e["after:highlightBlock"](Object.assign({block:t.el},t))})}(e),r.push(e)},removePlugin:function(e){var t=r.indexOf(e);-1!==t&&r.splice(t,1)}}),e.debugMode=function(){i=!1},e.safeMode=function(){i=!0},e.versionString="11.11.1",e.regex={concat:bn,lookahead:vn,either:yn,optional:gn,anyNumberOfTimes:Dn},Vn)"object"===w(Vn[y])&&an(Vn[y]);return Object.assign(e,Vn),e},fr=pr({});fr.newInstance=function(){return pr({})};var hr=fr;fr.HighlightJS=fr,fr.default=fr;var mr=nn(hr);mr.registerLanguage("xml",function(e){var t=e.regex,n=t.concat(/(?:[A-Z_a-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDDC0-\uDDF3\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD40-\uDD59\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDD4A-\uDD65\uDD6F-\uDD85\uDE80-\uDEA9\uDEB0\uDEB1\uDEC2-\uDEC7\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61\uDF80-\uDF89\uDF8B\uDF8E\uDF90-\uDFB5\uDFB7\uDFD1\uDFD3]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8\uDFC0-\uDFE0]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDB0-\uDDDB\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46\uDC60-\uDFFF]|\uD810[\uDC00-\uDFFA]|\uD811[\uDC00-\uDE46]|\uD818[\uDD00-\uDD1D]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDD40-\uDD6C\uDE40-\uDE7F\uDEA0-\uDEB8\uDEBB-\uDED3\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3\uDFF2\uDFF3]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDDD0-\uDDED\uDDF0\uDEC0-\uDEDE\uDEE0-\uDEE2\uDEE4\uDEE5\uDEE7-\uDEED\uDEF0-\uDEF4\uDEFE\uDEFF\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79])/,t.optional(/(?:[\x2D\.0-9A-Z_a-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDDC0-\uDDF3\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD40-\uDD59\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDD4A-\uDD65\uDD6F-\uDD85\uDE80-\uDEA9\uDEB0\uDEB1\uDEC2-\uDEC7\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61\uDF80-\uDF89\uDF8B\uDF8E\uDF90-\uDFB5\uDFB7\uDFD1\uDFD3]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8\uDFC0-\uDFE0]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDB0-\uDDDB\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46\uDC60-\uDFFF]|\uD810[\uDC00-\uDFFA]|\uD811[\uDC00-\uDE46]|\uD818[\uDD00-\uDD1D]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDD40-\uDD6C\uDE40-\uDE7F\uDEA0-\uDEB8\uDEBB-\uDED3\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3\uDFF2\uDFF3]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDDD0-\uDDED\uDDF0\uDEC0-\uDEDE\uDEE0-\uDEE2\uDEE4\uDEE5\uDEE7-\uDEED\uDEF0-\uDEF4\uDEFE\uDEFF\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79])*:/),/(?:[\x2D\.0-9A-Z_a-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDDC0-\uDDF3\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD40-\uDD59\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDD4A-\uDD65\uDD6F-\uDD85\uDE80-\uDEA9\uDEB0\uDEB1\uDEC2-\uDEC7\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61\uDF80-\uDF89\uDF8B\uDF8E\uDF90-\uDFB5\uDFB7\uDFD1\uDFD3]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8\uDFC0-\uDFE0]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDB0-\uDDDB\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46\uDC60-\uDFFF]|\uD810[\uDC00-\uDFFA]|\uD811[\uDC00-\uDE46]|\uD818[\uDD00-\uDD1D]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDD40-\uDD6C\uDE40-\uDE7F\uDEA0-\uDEB8\uDEBB-\uDED3\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3\uDFF2\uDFF3]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDDD0-\uDDED\uDDF0\uDEC0-\uDEDE\uDEE0-\uDEE2\uDEE4\uDEE5\uDEE7-\uDEED\uDEF0-\uDEF4\uDEFE\uDEFF\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79])*/),r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},i={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(i,{begin:/\(/,end:/\)/}),u=e.inherit(e.APOS_STRING_MODE,{className:"string"}),a=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:/(?:[\x2D\.0-:A-Z_a-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDDC0-\uDDF3\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD40-\uDD59\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDD4A-\uDD65\uDD6F-\uDD85\uDE80-\uDEA9\uDEB0\uDEB1\uDEC2-\uDEC7\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61\uDF80-\uDF89\uDF8B\uDF8E\uDF90-\uDFB5\uDFB7\uDFD1\uDFD3]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8\uDFC0-\uDFE0]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDB0-\uDDDB\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46\uDC60-\uDFFF]|\uD810[\uDC00-\uDFFA]|\uD811[\uDC00-\uDE46]|\uD818[\uDD00-\uDD1D]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDD40-\uDD6C\uDE40-\uDE7F\uDEA0-\uDEB8\uDEBB-\uDED3\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3\uDFF2\uDFF3]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDDD0-\uDDED\uDDF0\uDEC0-\uDEDE\uDEE0-\uDEE2\uDEE4\uDEE5\uDEE7-\uDEED\uDEF0-\uDEF4\uDEFE\uDEFF\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79])+/,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[r]},{begin:/'/,end:/'/,contains:[r]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[i,a,u,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[i,o,a,u]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},r,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[a]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:l}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}),mr.registerLanguage("json",function(e){var t=["true","false","null"],n={scope:"literal",beginKeywords:t.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:t},contains:[{className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},{match:/[{}[\],:]/,className:"punctuation",relevance:0},e.QUOTE_STRING_MODE,n,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}});var vr=function(e){var t=e.controller,n=be(null);return ge(function(){try{n.current.textContent=t.state.value.content,mr.highlightElement(n.current)}catch(r){}finally{e.onInitialization()}},[]),ht("pre",{className:"file-preview-text ".concat(t.state.value.theme),children:ht("code",{ref:n,className:"language-".concat(t.state.value.fileType)})})},Dr=function(e){var t=e.size;return ht("div",{className:"loading-mask",children:ht("div",{className:"loading-spinner",children:ht(Ft,{size:void 0===t?24:t})})})},gr=function(e){var t=be(null),n=u(De({}),2),o=n[0],a=n[1],l=188,s=e.pages.length*l,c=u(De({start:0,end:0}),2),d=c[0],p=c[1],f=u(De(8),2),h=f[0],m=f[1],v=function(n){var r=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"UI";if(!t.current)return{start:0,end:0};var r=t.current,i=r.scrollTop,o=r.clientHeight,u=0;u="UI"===n?Math.max(0,Math.floor(i/l)-1):Math.max(0,e.currentPage-1);var a=Math.ceil(o/l);return{start:u,end:Math.min(e.pages.length,u+a+1)}}(n);m(r.start*l+8),p(r)},D=ct(function(){v()},500),g=function(){if(t.current){var e=t.current.querySelector(".thumbnail-item.active");e&&e.scrollIntoView({behavior:"smooth",block:"start"})}};return ge(function(){var e=t.current;if(e)return v(),e.addEventListener("scroll",D),function(){e.removeEventListener("scroll",D)}}),ge(function(){var e;(null===(e=t.current)||void 0===e?void 0:e.querySelector(".thumbnail-item.active"))?g():(v("DATA"),setTimeout(function(){g()},0))},[e.currentPage]),ht("div",{className:"thumbnail-panel",children:[ht("div",{className:"thumbnail-panel-header",children:ht("h3",{children:"缩略图"})}),ht("div",{className:"thumbnail-panel-content",ref:t,children:[ht("div",{class:"thumbnail-panel-phantom",style:{height:"".concat(s,"px")}}),ht("div",{className:"thumbnail-item-container",style:{transform:"translate3d(0,".concat(h,"px,0)")},children:e.pages&&e.pages.length>0&&e.pages.map(function(t,n){if(!(d.start<=n&&n<=d.end))return null;var u,l=(u=t.image_url,o[u]||!1);return ht("div",{className:"thumbnail-item ".concat(t.index===e.currentPage?"active":""),onClick:function(t){!function(t){e.onPageClick(t)}(n)},children:[!l&&ht(Dr,{}),ht("img",{src:"".concat("").concat(t.image_url),alt:t.description,className:"thumbnail-image",onLoad:function(){!function(e){a(function(t){return r(r({},t),{},i({},e.image_url,!0))})}(t)},onError:function(e){!function(e){a(function(t){return r(r({},t),{},i({},e.image_url,!0))})}(t)}}),ht("div",{className:"thumbnail-page-number",children:n+1})]},t.image_url)})})]})]})},br=function(e){var t=tt(!0),n=be(null),r=u(De({}),2),i=r[0],o=r[1],a=tt(0);ge(function(){var n={},r=e.parentDimensions,i=r.width,u=r.height;t.value?n={height:"".concat(u*e.state.value.scale,"px"),flexShrink:0}:(n={transform:"rotate(".concat(e.state.value.rotateMap[e.index]||0,"deg)"),transition:"transform .3s"},e.state.value.mode===it.WIDTH?Object.assign(n,{width:"".concat((i-24-6)*e.state.value.scale,"px")}):e.state.value.mode===it.PAGE?Object.assign(n,{height:"".concat(u*e.state.value.scale,"px")}):Object.assign(n,{width:"".concat(800*e.state.value.scale,"px")})),o(n)},[e.parentDimensions,e.state.value,t.value]);var l=function(t){var n;a.value=t,null===(n=e.onHeightChange)||void 0===n||n.call(e,e.index,t)};return ge(function(){if(n.current){var e=new ResizeObserver(function(e){var t,n=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=f(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,u=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return u=e.done,e},e:function(e){a=!0,o=e},f:function(){try{u||null==n.return||n.return()}finally{if(a)throw o}}}}(e);try{for(n.s();!(t=n.n()).done;){var r=t.value.contentRect.height;l(r)}}catch(i){n.e(i)}finally{n.f()}});return e.observe(n.current),function(){e.disconnect()}}},[e.index]),ht("div",{ref:n,className:"image-page",style:i,"data-page-index":e.index,children:[ht("img",{className:"image-content",src:"".concat("").concat(e.page.image_url),alt:e.page.description,onLoad:function(){t.value=!1},onError:function(e){t.value=!1},loading:"lazy"}),t.value&&ht(Dr,{})]})},yr=function(e){var t=e.controller,n=t.state,r=be(null),i=tt(!1),o=u(De({width:0,height:0}),2),a=o[0],l=o[1],s=be({width:0,height:0}),c=tt([]),d=tt(0),p=tt(0),f=tt(0),h=tt({startIndex:0,count:1,buffer:1}),m=nt(function(){var e=Math.max(0,h.value.startIndex),t=Math.min(n.value.items.length-1,h.value.startIndex+h.value.count+h.value.buffer);return n.value.items.slice(e,t+1)}),v=function(){var e,t=null===(e=r.current)||void 0===e?void 0:e.getBoundingClientRect();if(t){var n=Math.round(t.width),i=Math.round(t.height);s.current.width===n&&s.current.height===i||(s.current={width:n,height:i},l({width:n,height:i}))}},D=function(){var e=h.value.startIndex;return e?c.value[e].top:0},g=function(){if(r.current){var e=function(e){for(var t=0,r=n.value.items.length-1,i=null;t<=r;){var o=parseInt(String((r+t)/2)),u=c.value[o].bottom;if(u===e)return o+1;u<e?t=o+1:u>e&&((null===i||i>o)&&(i=o),r-=1)}return i}(r.current.scrollTop);return e}},b=ct(function(){if(r.current){var e=g();if(void 0===e)return;h.value.startIndex=e,f.value=D(),e!==n.value.currentPage&&t.updateState({currentPage:e})}},500),y=function(){r.current&&setTimeout(function(){var e=g();e!==n.value.currentPage&&t.updateState({currentPage:e})},0)},E=function(e){i.value=!0,h.value.startIndex=e,f.value=D(),r.current&&(r.current.scrollTop=f.value),setTimeout(function(){i.value=!1},0)},C=function(e){t.updateState({currentPage:e}),E(e)},w=function(e){var t=e.target,r=parseInt(t.value)-1;(r||0===r)&&r>=0&&r<n.value.total&&C(r)},A=function(e){if("DOWN"===e&&n.value.currentPage>0){var t=n.value.currentPage-1;C(t)}if("UP"===e&&n.value.currentPage<n.value.total-1){var r=n.value.currentPage+1;C(r)}};return ge(function(){n.value.items.slice(0,2).forEach(function(e){e&&((new Image).src="".concat("").concat(e.image_url))}),e.onInitialization(),function(){var e,t=null===(e=r.current)||void 0===e?void 0:e.getBoundingClientRect();if(t){var i=Math.round(t.height);d.value=i,p.value=i*n.value.items.length}}(),c.value=n.value.items.map(function(e,t){return{index:t,top:t*d.value,bottom:(t+1)*d.value,height:d.value}}),v();var t=new ResizeObserver(function(){requestAnimationFrame(function(){v()})});return r.current&&r&&t.observe(r.current),function(){t.disconnect()}},[]),ht("div",{className:"file-preview-image-group",children:[ht("div",{className:"image-group-left-container ".concat(n.value.showThumbnailPanel?"image-group-left-container--open":""),children:ht(gr,{pages:n.value.items,currentPage:n.value.currentPage,onPageClick:function(e){C(e)}})}),ht("div",{ref:r,className:"image-group-main-container",onScroll:function(){i.value||b()},children:[ht("div",{class:"image-group-main-phantom",style:{height:"".concat(p.value,"px")}}),ht("div",{className:"image-group-item-container",style:{transform:"translate3d(0,".concat(f.value,"px,0)")},children:m.value&&m.value.length>0&&m.value.map(function(e){return ht(br,{page:e,index:e.index,state:n,parentDimensions:a,onHeightChange:function(e,t){!function(e,t){if(0!==t){var n=t-c.value[e].height;if(n){c.value[e].height=t,c.value[e].bottom=c.value[e].bottom+n;for(var r=e+1;r<c.value.length;r++)c.value[r].top=c.value[r].top+n,c.value[r].bottom=c.value[r].bottom+n}}}(e,t)}},e.image_url)})})]}),ht(en,{to:"#custom-controls",children:ht("div",{className:"image-toolbar-container",children:[ht("button",{className:"control-btn",title:"缩略图",onClick:function(){t.switchThumbnailPanel()},children:ht(Et,{})}),ht("button",{title:"逆时针",className:"control-btn",onClick:function(){return t.handleRotateChange(-90)},children:ht("span",{className:"icon",children:ht(yt,{})})}),ht("button",{title:"顺时针",className:"control-btn",onClick:function(){return t.handleRotateChange(90)},children:ht("span",{className:"icon",children:ht(bt,{})})}),ht("button",{className:"control-btn",title:"上一页",onClick:function(){A("DOWN")},children:ht(Ct,{})}),ht("button",{className:"control-btn",title:"下一页",onClick:function(){A("UP")},children:ht(wt,{})}),ht("div",{className:"pagination",children:[ht("input",{type:"number",className:"page-input",value:n.value.currentPage+1,min:"1",max:n.value.total||1,onBlur:function(e){w(e)},onKeyDown:function(e){"Enter"===e.key&&w(e)}}),ht("div",{children:"/"}),ht("div",{children:n.value.total})]}),ht("select",{className:"img-mode",value:n.value.mode,onChange:function(e){var r=e.target.value;t.switchMode(r),E(n.value.currentPage)},children:lt.map(function(e,t){return ht("option",{label:e.lable,value:e.value},t)})}),ht("div",{className:"zoom",children:[ht("button",{title:"缩小",className:"control-btn",onClick:function(e){t.zoomOutPreview(e),y()},children:ht("span",{className:"icon",children:ht(vt,{})})}),ht("span",{className:"zoom-level",children:[Math.round(100*n.value.scale),"%"]}),ht("button",{title:"放大",className:"control-btn",onClick:function(e){t.zoomInPreview(e),y()},children:ht("span",{className:"icon",children:ht(Dt,{})})})]}),ht("button",{title:"重置",className:"control-btn",onClick:function(){t.reSet(),y()},children:ht("span",{className:"icon",children:ht(_t,{})})})]})})]})},Er=function(e){ge(function(){return document.addEventListener("click",o,!0),function(){document.removeEventListener("click",o,!0)}},[]);var t=e.controller,n=t.state,r=tt(!1),i=tt(!1),o=function(){i.value=!1,r.value=!1},u=function(e,n){switch(r.value=!1,e){case rt.DOWNORIGINAL:t.downloadOriginal(n);break;case rt.COPYTEXTCONTENT:t.copyTextContent(n);break;case rt.DOWNPDF:t.exportToPdf(n);break;case rt.DOWNMD:t.exportToMd(n)}};return ht("div",{className:"file-preview-shell ".concat(n.value.theme),children:[ht("div",{className:"preview-header",children:[ht("div",{className:"file-info",children:[ht("h3",{className:"file-name",children:n.value.fileName}),ht("div",{className:"engine-container",children:[ht("div",{className:"engine-content",children:[ht("div",{className:"engine-type ".concat(n.value.engineOptions.length>1?"is-multiple":""),children:n.value.engineType}),n.value.engineOptions.length>1&&ht("div",{className:"engine-icon",onClick:function(){n.value.engineOptions&&n.value.engineOptions.length>1&&(i.value=!i.value)},children:ht(At,{})})]}),i.value&&n.value.engineOptions.length>1&&ht("ul",{className:"engine-options",children:n.value.engineOptions.map(function(e){return ht("li",{className:"engine-option-item ".concat(e===n.value.engineType?"is-active":""),onClick:function(){var n;n=e,t.switchEngineType(n),i.value=!1},children:e})})})]})]}),ht("div",{className:"preview-controls",children:[ht("div",{className:"custom-controls",id:"custom-controls"}),ht("button",{className:"control-btn download-btn",title:"下载选项",onClick:function(){r.value=!r.value},children:ht("span",{className:"icon",children:ht(gt,{})})})]})]}),r.value&&ht("div",{className:"download-options",children:[""===n.value.fileContent&&ht("button",{className:"download-option",onClick:function(e){u(rt.DOWNORIGINAL,e)},children:"下载原文件"}),n.value.engineType!==ut.PDF&&ht("button",{className:"download-option",onClick:function(e){u(rt.COPYTEXTCONTENT,e)},children:"复制文本内容"})]}),ht("div",{className:"preview-content",children:[ht("div",{className:"preview-inner",children:n.value.isCreated&&t.preViewComp&&t.preViewController?M(t.preViewComp,{controller:t.preViewController,onInitialization:function(){t.updateState({isLoading:!1})}}):null}),n.value.isLoading&&ht(Dr,{size:48})]})]})},Cr=function(){return D(function e(t){m(this,e),i(this,"state",Re({})),this.filePreviewShell=t,this.initState()},[{key:"updateState",value:function(e){this.state.value=r(r({},this.state.value),e)}},{key:"initState",value:function(){var e=this.filePreviewShell.getState(),t=e.fileType,n=e.theme;this.updateState({content:"",theme:n,fileType:t})}},{key:"initialize",value:(t=C(b().m(function e(){var t;return b().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.getContent();case 1:t=e.v,this.updateState({content:t});case 2:return e.a(2)}},e,this)})),function(){return t.apply(this,arguments)})},{key:"getContent",value:(e=C(b().m(function e(){return b().w(function(e){for(;;)if(0===e.n)return e.a(2,"")},e)})),function(){return e.apply(this,arguments)})}]);var e,t}(),wr=function(t){function n(){return m(this,n),a(this,n,arguments)}return c(n,t),D(n,[{key:"initState",value:function(){e(n,"initState",this,3)([]),this.updateState({rotate:0,offsetX:0,offsetY:0,scale:1,mode:it.PAGE,enableTransition:!0})}},{key:"getContent",value:(r=C(b().m(function e(){var t,n,r,i,o,u;return b().w(function(e){for(;;)switch(e.p=e.n){case 0:return t=this.filePreviewShell.getOptions(),n=this.filePreviewShell.getState(),r=n.fileId,i=n.fileCat,o=n.fileType,e.p=1,e.n=2,t.getImgContent(r,o,i);case 2:return u=e.v,e.a(2,u);case 3:return e.p=3,e.v,e.a(2,"")}},e,this,[[1,3]])})),function(){return r.apply(this,arguments)})},{key:"handleRotateChange",value:function(e){var t=this.state.value.rotate;this.updateState({rotate:t+e})}},{key:"handleMouseDown",value:function(e){var t=this,n=this.state.value,r=n.offsetX,i=n.offsetY;e.preventDefault(),this.updateState({enableTransition:!1});var o=e.pageX,u=e.pageY,a=function(e){t.updateState({offsetX:r+e.pageX-o,offsetY:i+e.pageY-u})};document.addEventListener("mousemove",a);document.addEventListener("mouseup",function(){document.removeEventListener("mousemove",a),t.updateState({enableTransition:!0})},{once:!0})}},{key:"zoomOutPreview",value:function(e){var t=this.state.value.scale;this.updateState({scale:Math.max(t-.1,.5)})}},{key:"zoomInPreview",value:function(e){var t=this.state.value.scale;this.updateState({scale:Math.min(t+.1,2)})}},{key:"reSet",value:function(){this.updateState({rotate:0,offsetX:0,offsetY:0,scale:1,mode:it.PAGE,enableTransition:!0})}},{key:"switchMode",value:function(e){this.updateState({mode:e,scale:1,rotate:0,offsetX:0,offsetY:0,enableTransition:!0})}}]);var r}(Cr),Ar=function(t){function n(){return m(this,n),a(this,n,arguments)}return c(n,t),D(n,[{key:"initState",value:function(){e(n,"initState",this,3)([]),this.updateState({items:[],currentPage:0,total:0,showThumbnailPanel:!1,rotateMap:{}})}},{key:"getContent",value:(r=C(b().m(function e(){var t,n,r,i,o,u,a;return b().w(function(e){for(;;)switch(e.p=e.n){case 0:return t=this.filePreviewShell.getOptions(),n=this.filePreviewShell.getState(),r=n.fileId,i=n.fileCat,e.p=1,o=[],e.n=2,t.getContent(r,"pageindex",i);case 2:return(u=e.v)&&u.pages&&u.pages.length>0&&(o=u.pages),a=o.length,this.updateState({items:o,total:a}),e.a(2,u||{});case 3:return e.p=3,e.v,e.a(2,{})}},e,this,[[1,3]])})),function(){return r.apply(this,arguments)})},{key:"switchThumbnailPanel",value:function(){var e=this.state.value.showThumbnailPanel;this.updateState({showThumbnailPanel:!e})}},{key:"handleRotateChange",value:function(e){var t=this.state.value,n=t.currentPage,r=t.rotateMap,i=n.toString();r[i]||(r[i]=0),r[i]+=e,this.updateState({rotateMap:r})}},{key:"reSet",value:function(){e(n,"reSet",this,3)([]),this.updateState({rotateMap:{}})}}]);var r}(wr);function _r(e,t){return Array(t+1).join(e)}function Fr(e){return e.replace(/^\n*/,"")}function kr(e){for(var t=e.length;t>0&&"\n"===e[t-1];)t--;return e.substring(0,t)}function Sr(e){return kr(Fr(e))}var Tr=["ADDRESS","ARTICLE","ASIDE","AUDIO","BLOCKQUOTE","BODY","CANVAS","CENTER","DD","DIR","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","FRAMESET","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","HTML","ISINDEX","LI","MAIN","MENU","NAV","NOFRAMES","NOSCRIPT","OL","OUTPUT","P","PRE","SECTION","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR","UL"];function xr(e){return Nr(e,Tr)}var Br=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];function Lr(e){return Nr(e,Br)}var Mr=["A","TABLE","THEAD","TBODY","TFOOT","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"];function Nr(e,t){return t.indexOf(e.nodeName)>=0}function Or(e,t){return e.getElementsByTagName&&t.some(function(t){return e.getElementsByTagName(t).length})}var Hr={};function Ir(e){return e?e.replace(/(\n+\s*)+/g,"\n"):""}function Pr(e){for(var t in this.options=e,this._keep=[],this._remove=[],this.blankRule={replacement:e.blankReplacement},this.keepReplacement=e.keepReplacement,this.defaultRule={replacement:e.defaultReplacement},this.array=[],e.rules)this.array.push(e.rules[t])}function jr(e,t,n){for(var r=0;r<e.length;r++){var i=e[r];if(Rr(i,t,n))return i}}function Rr(e,t,n){var r=e.filter;if("string"==typeof r){if(r===t.nodeName.toLowerCase())return!0}else if(Array.isArray(r)){if(r.indexOf(t.nodeName.toLowerCase())>-1)return!0}else{if("function"!=typeof r)throw new TypeError("`filter` needs to be a string, array, or function");if(r.call(e,t,n))return!0}}function qr(e){var t=e.nextSibling||e.parentNode;return e.parentNode.removeChild(e),t}function Ur(e,t,n){return e&&e.parentNode===t||n(t)?t.nextSibling||t.parentNode:t.firstChild||t.nextSibling||t.parentNode}Hr.paragraph={filter:"p",replacement:function(e){return"\n\n"+e+"\n\n"}},Hr.lineBreak={filter:"br",replacement:function(e,t,n){return n.br+"\n"}},Hr.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(e,t,n){var r=Number(t.nodeName.charAt(1));return"setext"===n.headingStyle&&r<3?"\n\n"+e+"\n"+_r(1===r?"=":"-",e.length)+"\n\n":"\n\n"+_r("#",r)+" "+e+"\n\n"}},Hr.blockquote={filter:"blockquote",replacement:function(e){return"\n\n"+(e=Sr(e).replace(/^/gm,"> "))+"\n\n"}},Hr.list={filter:["ul","ol"],replacement:function(e,t){var n=t.parentNode;return"LI"===n.nodeName&&n.lastElementChild===t?"\n"+e:"\n\n"+e+"\n\n"}},Hr.listItem={filter:"li",replacement:function(e,t,n){var r=n.bulletListMarker+" ",i=t.parentNode;if("OL"===i.nodeName){var o=i.getAttribute("start"),u=Array.prototype.indexOf.call(i.children,t);r=(o?Number(o)+u:u+1)+". "}var a=/\n$/.test(e);return r+(e=(e=Sr(e)+(a?"\n":"")).replace(/\n/gm,"\n"+" ".repeat(r.length)))+(t.nextSibling?"\n":"")}},Hr.indentedCodeBlock={filter:function(e,t){return"indented"===t.codeBlockStyle&&"PRE"===e.nodeName&&e.firstChild&&"CODE"===e.firstChild.nodeName},replacement:function(e,t,n){return"\n\n "+t.firstChild.textContent.replace(/\n/g,"\n ")+"\n\n"}},Hr.fencedCodeBlock={filter:function(e,t){return"fenced"===t.codeBlockStyle&&"PRE"===e.nodeName&&e.firstChild&&"CODE"===e.firstChild.nodeName},replacement:function(e,t,n){for(var r,i=((t.firstChild.getAttribute("class")||"").match(/language-(\S+)/)||[null,""])[1],o=t.firstChild.textContent,u=n.fence.charAt(0),a=3,l=new RegExp("^"+u+"{3,}","gm");r=l.exec(o);)r[0].length>=a&&(a=r[0].length+1);var s=_r(u,a);return"\n\n"+s+i+"\n"+o.replace(/\n$/,"")+"\n"+s+"\n\n"}},Hr.horizontalRule={filter:"hr",replacement:function(e,t,n){return"\n\n"+n.hr+"\n\n"}},Hr.inlineLink={filter:function(e,t){return"inlined"===t.linkStyle&&"A"===e.nodeName&&e.getAttribute("href")},replacement:function(e,t){var n=t.getAttribute("href");n&&(n=n.replace(/([()])/g,"\\$1"));var r=Ir(t.getAttribute("title"));return r&&(r=' "'+r.replace(/"/g,'\\"')+'"'),"["+e+"]("+n+r+")"}},Hr.referenceLink={filter:function(e,t){return"referenced"===t.linkStyle&&"A"===e.nodeName&&e.getAttribute("href")},replacement:function(e,t,n){var r,i,o=t.getAttribute("href"),u=Ir(t.getAttribute("title"));switch(u&&(u=' "'+u+'"'),n.linkReferenceStyle){case"collapsed":r="["+e+"][]",i="["+e+"]: "+o+u;break;case"shortcut":r="["+e+"]",i="["+e+"]: "+o+u;break;default:var a=this.references.length+1;r="["+e+"]["+a+"]",i="["+a+"]: "+o+u}return this.references.push(i),r},references:[],append:function(e){var t="";return this.references.length&&(t="\n\n"+this.references.join("\n")+"\n\n",this.references=[]),t}},Hr.emphasis={filter:["em","i"],replacement:function(e,t,n){return e.trim()?n.emDelimiter+e+n.emDelimiter:""}},Hr.strong={filter:["strong","b"],replacement:function(e,t,n){return e.trim()?n.strongDelimiter+e+n.strongDelimiter:""}},Hr.code={filter:function(e){var t=e.previousSibling||e.nextSibling,n="PRE"===e.parentNode.nodeName&&!t;return"CODE"===e.nodeName&&!n},replacement:function(e){if(!e)return"";e=e.replace(/\r?\n|\r/g," ");for(var t=/^`|^ .*?[^ ].* $|`$/.test(e)?" ":"",n="`",r=e.match(/`+/gm)||[];-1!==r.indexOf(n);)n+="`";return n+t+e+t+n}},Hr.image={filter:"img",replacement:function(e,t){var n=Ir(t.getAttribute("alt")),r=t.getAttribute("src")||"",i=Ir(t.getAttribute("title"));return r?"!["+n+"]("+r+(i?' "'+i+'"':"")+")":""}},Pr.prototype={add:function(e,t){this.array.unshift(t)},keep:function(e){this._keep.unshift({filter:e,replacement:this.keepReplacement})},remove:function(e){this._remove.unshift({filter:e,replacement:function(){return""}})},forNode:function(e){return e.isBlank?this.blankRule:(t=jr(this.array,e,this.options))||(t=jr(this._keep,e,this.options))||(t=jr(this._remove,e,this.options))?t:this.defaultRule;var t},forEach:function(e){for(var t=0;t<this.array.length;t++)e(this.array[t],t)}};var Vr="undefined"!=typeof window?window:{};var zr,Wr,Gr=function(){var e=Vr.DOMParser,t=!1;try{(new e).parseFromString("","text/html")&&(t=!0)}catch(Pe){}return t}()?Vr.DOMParser:(zr=function(){},function(){var e=!1;try{document.implementation.createHTMLDocument("").open()}catch(Pe){Vr.ActiveXObject&&(e=!0)}return e}()?zr.prototype.parseFromString=function(e){var t=new window.ActiveXObject("htmlfile");return t.designMode="on",t.open(),t.write(e),t.close(),t}:zr.prototype.parseFromString=function(e){var t=document.implementation.createHTMLDocument("");return t.open(),t.write(e),t.close(),t},zr);function Kr(e,t){var n;"string"==typeof e?n=(Wr=Wr||new Gr).parseFromString('<x-turndown id="turndown-root">'+e+"</x-turndown>","text/html").getElementById("turndown-root"):n=e.cloneNode(!0);return function(e){var t=e.element,n=e.isBlock,r=e.isVoid,i=e.isPre||function(e){return"PRE"===e.nodeName};if(t.firstChild&&!i(t)){for(var o=null,u=!1,a=null,l=Ur(a,t,i);l!==t;){if(3===l.nodeType||4===l.nodeType){var s=l.data.replace(/[ \r\n\t]+/g," ");if(o&&!/ $/.test(o.data)||u||" "!==s[0]||(s=s.substr(1)),!s){l=qr(l);continue}l.data=s,o=l}else{if(1!==l.nodeType){l=qr(l);continue}n(l)||"BR"===l.nodeName?(o&&(o.data=o.data.replace(/ $/,"")),o=null,u=!1):r(l)||i(l)?(o=null,u=!0):o&&(u=!1)}var c=Ur(a,l,i);a=l,l=c}o&&(o.data=o.data.replace(/ $/,""),o.data||qr(o))}}({element:n,isBlock:xr,isVoid:Lr,isPre:t.preformattedCode?Xr:null}),n}function Xr(e){return"PRE"===e.nodeName||"CODE"===e.nodeName}function Zr(e,t){return e.isBlock=xr(e),e.isCode="CODE"===e.nodeName||e.parentNode.isCode,e.isBlank=function(e){return!Lr(e)&&!function(e){return Nr(e,Mr)}(e)&&/^\s*$/i.test(e.textContent)&&!function(e){return Or(e,Br)}(e)&&!function(e){return Or(e,Mr)}(e)}(e),e.flankingWhitespace=function(e,t){if(e.isBlock||t.preformattedCode&&e.isCode)return{leading:"",trailing:""};var n=function(e){var t=e.match(/^(([ \t\r\n]*)(\s*))(?:(?=\S)[\s\S]*\S)?((\s*?)([ \t\r\n]*))$/);return{leading:t[1],leadingAscii:t[2],leadingNonAscii:t[3],trailing:t[4],trailingNonAscii:t[5],trailingAscii:t[6]}}(e.textContent);n.leadingAscii&&Jr("left",e,t)&&(n.leading=n.leadingNonAscii);n.trailingAscii&&Jr("right",e,t)&&(n.trailing=n.trailingNonAscii);return{leading:n.leading,trailing:n.trailing}}(e,t),e}function Jr(e,t,n){var r,i,o;return"left"===e?(r=t.previousSibling,i=/ $/):(r=t.nextSibling,i=/^ /),r&&(3===r.nodeType?o=i.test(r.nodeValue):n.preformattedCode&&"CODE"===r.nodeName?o=!1:1!==r.nodeType||xr(r)||(o=i.test(r.textContent))),o}var $r=Array.prototype.reduce,Yr=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function Qr(e){if(!(this instanceof Qr))return new Qr(e);var t={rules:Hr,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",preformattedCode:!1,blankReplacement:function(e,t){return t.isBlock?"\n\n":""},keepReplacement:function(e,t){return t.isBlock?"\n\n"+t.outerHTML+"\n\n":t.outerHTML},defaultReplacement:function(e,t){return t.isBlock?"\n\n"+e+"\n\n":e}};this.options=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},t,e),this.rules=new Pr(this.options)}function ei(e){var t=this;return $r.call(e.childNodes,function(e,n){var r="";return 3===(n=new Zr(n,t.options)).nodeType?r=n.isCode?n.nodeValue:t.escape(n.nodeValue):1===n.nodeType&&(r=ni.call(t,n)),ri(e,r)},"")}function ti(e){var t=this;return this.rules.forEach(function(n){"function"==typeof n.append&&(e=ri(e,n.append(t.options)))}),e.replace(/^[\t\r\n]+/,"").replace(/[\t\r\n\s]+$/,"")}function ni(e){var t=this.rules.forNode(e),n=ei.call(this,e),r=e.flankingWhitespace;return(r.leading||r.trailing)&&(n=n.trim()),r.leading+t.replacement(n,e,this.options)+r.trailing}function ri(e,t){var n=kr(e),r=Fr(t),i=Math.max(e.length-n.length,t.length-r.length);return n+"\n\n".substring(0,i)+r}Qr.prototype={turndown:function(e){if(!function(e){return null!=e&&("string"==typeof e||e.nodeType&&(1===e.nodeType||9===e.nodeType||11===e.nodeType))}(e))throw new TypeError(e+" is not a string, or an element/document/fragment node.");if(""===e)return"";var t=ei.call(this,new Kr(e,this.options));return ti.call(this,t)},use:function(e){if(Array.isArray(e))for(var t=0;t<e.length;t++)this.use(e[t]);else{if("function"!=typeof e)throw new TypeError("plugin must be a Function or an Array of Functions");e(this)}return this},addRule:function(e,t){return this.rules.add(e,t),this},keep:function(e){return this.rules.keep(e),this},remove:function(e){return this.rules.remove(e),this},escape:function(e){return Yr.reduce(function(e,t){return e.replace(t[0],t[1])},e)}};var ii=function(e){function t(){return m(this,t),a(this,t,arguments)}return c(t,e),D(t,[{key:"getContent",value:(n=C(b().m(function e(){var t,n,r,i,o,u,a,l;return b().w(function(e){for(;;)switch(e.p=e.n){case 0:if(t=this.filePreviewShell.getOptions(),n=this.filePreviewShell.getState(),r=n.fileId,i=n.fileType,o=n.fileCat,u=n.fileContent,e.p=1,!u){e.n=2;break}return e.a(2,u);case 2:return e.n=3,t.getContent(r,i,o);case 3:return a=e.v,e.a(2,a||"");case 4:return e.p=4,l=e.v,e.a(2,l.message||"")}},e,this,[[1,4]])})),function(){return n.apply(this,arguments)})}]);var n}(Cr),oi=function(e){function t(){return m(this,t),a(this,t,arguments)}return c(t,e),D(t,[{key:"getContent",value:(n=C(b().m(function e(){var t,n,r,i,o,u,a,l,s,c,d;return b().w(function(e){for(;;)switch(e.p=e.n){case 0:if(t=this.filePreviewShell.getOptions(),n=this.filePreviewShell.getState(),r=n.fileId,i=n.fileCat,o=n.fileContent,e.p=1,!o){e.n=2;break}return e.a(2,o);case 2:return e.n=3,t.getContent(r,"md",i);case 3:return u=e.v,this.state.value.fileType===ot.HTML&&(a=new DOMParser,(l=a.parseFromString(u,"text/html")).body.querySelectorAll("script").forEach(function(e){return e.remove()}),l.body.querySelectorAll("style").forEach(function(e){return e.remove()}),s=l.body.innerHTML,c=new Qr({headingStyle:"atx",codeBlockStyle:"fenced"}),u=c.turndown(s)),e.a(2,u||"");case 4:return e.p=4,d=e.v,e.a(2,d.message||"")}},e,this,[[1,4]])})),function(){return n.apply(this,arguments)})}]);var n}(ii),ui=function(e){function t(){return m(this,t),a(this,t,arguments)}return c(t,e),D(t,[{key:"getContent",value:(n=C(b().m(function e(){var t,n,r,i,o,u,a;return b().w(function(e){for(;;)switch(e.p=e.n){case 0:if(t=this.filePreviewShell.getOptions(),n=this.filePreviewShell.getState(),r=n.fileId,i=n.fileCat,o=n.fileContent,e.p=1,!o){e.n=2;break}return e.a(2,o);case 2:return e.n=3,t.getContent(r,"html",i);case 3:return u=e.v,e.a(2,u||"");case 4:return e.p=4,a=e.v,e.a(2,a.message||"")}},e,this,[[1,4]])})),function(){return n.apply(this,arguments)})}]);var n}(ii),ai=function(){return D(function e(){m(this,e)},null,[{key:"registerItem",value:function(e,t,n){this.enginePreviewMap.set(e,{component:t,controller:n})}},{key:"initialize",value:function(){this.registerItem(ut.HTML,mt,function(e){return new ui(e)}),this.registerItem(ut.MD,un,function(e){return new oi(e)}),this.registerItem(ut.TXT,vr,function(e){return new ii(e)}),this.registerItem(ut.PDF,yr,function(e){return new Ar(e)}),this.registerItem(ut.IMG,tn,function(e){return new wr(e)}),this.registerItem(ut.UNKNOWN,un,function(e){return new oi(e)})}},{key:"getItem",value:function(e){return this.enginePreviewMap.get(e)||null}}])}();i(ai,"enginePreviewMap",new Map);var li=function(){return D(function e(t){m(this,e),i(this,"container",null),i(this,"preViewComp",void 0),i(this,"preViewController",void 0),i(this,"state",Re({fileName:"",fileId:"",fileCat:"",fileContent:"",theme:"dark",isLoading:!1,isCreated:!1,fileType:ot.UNKNOWN,engineType:ut.UNKNOWN,engineOptions:[]})),this.options=t,t.theme&&this.updateState({theme:t.theme}),ai.initialize(),this.getState=this.getState.bind(this)},[{key:"updateState",value:function(e){this.state.value=r(r({},this.state.value),e)}},{key:"parseParams",value:(c=C(b().m(function e(t){var n,r,i,o,u,a,l,s,c;return b().w(function(e){for(;;)switch(e.n){case 0:if(n="",r="",i="",o="",!t.content){e.n=1;break}r=t.name||"",o=t.content,e.n=4;break;case 1:if(!t.url){e.n=3;break}return e.n=2,this.options.upLoadFileToOss(t.url);case 2:(u=e.v)&&(a=u.id,l=u.name,s=u.cat,n=a,r=l,i=s),e.n=4;break;case 3:t.name&&(r=t.name),t.cat&&(i=t.cat),t.id&&(n=t.id);case 4:return c=st(r),this.updateState({fileId:n,fileName:r,fileCat:i,fileType:c,fileContent:o}),e.n=5,this.parseEngineType();case 5:return e.a(2)}},e,this)})),function(e){return c.apply(this,arguments)})},{key:"parseEngineType",value:(s=C(b().m(function e(){var t,n,r;return b().w(function(e){for(;;)switch(e.n){case 0:t=this.state.value.fileType,(n=at.get(t))&&n.length>0||(n=[ut.UNKNOWN]),r=n[0],this.updateState({engineOptions:n,engineType:r});case 1:return e.a(2)}},e,this)})),function(){return s.apply(this,arguments)})},{key:"parsePreviewItem",value:(l=C(b().m(function e(){var t,n,r;return b().w(function(e){for(;;)switch(e.n){case 0:return t=this.state.value.engineType,(n=ai.getItem(t))||(n=ai.getItem(ut.UNKNOWN)),this.preViewComp=n.component,r=n.controller(this),e.n=1,r.initialize();case 1:this.preViewController=r;case 2:return e.a(2)}},e,this)})),function(){return l.apply(this,arguments)})},{key:"mountComponent",value:function(){this.destroyComponent(),this.container=document.querySelector(this.options.selector),this.container&&ne(M(Er,{key:JSON.stringify(this.state.value),controller:this}),this.container)}},{key:"destroyComponent",value:function(){if(this.options.selector)for(var e=document.querySelector(this.options.selector);e&&e.firstChild;)e.removeChild(e.firstChild);this.container&&(ne(null,this.container),this.container=null)}},{key:"updateView",value:(a=C(b().m(function e(t){return b().w(function(e){for(;;)switch(e.n){case 0:return this.updateState({isCreated:!1,isLoading:!0}),e.n=1,this.parseParams(t);case 1:return e.n=2,this.parsePreviewItem();case 2:this.mountComponent(),this.updateState({isCreated:!0});case 3:return e.a(2)}},e,this)})),function(e){return a.apply(this,arguments)})},{key:"getOptions",value:function(){return this.options}},{key:"getState",value:function(){return this.state.value}},{key:"downloadOriginal",value:(u=C(b().m(function e(t){var n,r,i,o;return b().w(function(e){for(;;)switch(e.n){case 0:if(this.options.downLoadFile){e.n=1;break}return e.a(2);case 1:return n=this.state.value,r=n.fileId,i=n.fileName,o=n.fileCat,e.n=2,this.options.downLoadFile(r,i,o);case 2:if(!this.options.actionSuccessCallBack){e.n=3;break}return e.n=3,this.options.actionSuccessCallBack(rt.DOWNORIGINAL);case 3:return e.a(2)}},e,this)})),function(e){return u.apply(this,arguments)})},{key:"copyTextContent",value:(o=C(b().m(function e(t){var n,r,i,o,u,a,l;return b().w(function(e){for(;;)switch(e.n){case 0:if(this.options.getContent){e.n=1;break}return e.a(2);case 1:return e.n=2,pt("");case 2:if(n=this.state.value,r=n.fileId,i=n.engineType,o=n.fileCat,u=n.fileContent,""!==(a=u)){e.n=4;break}return l="HTML"===i?"html":"md",e.n=3,this.options.getContent(r,l,o);case 3:a=e.v;case 4:if(!a){e.n=5;break}return e.n=5,pt(a);case 5:if(!this.options.actionSuccessCallBack){e.n=6;break}return e.n=6,this.options.actionSuccessCallBack(rt.COPYTEXTCONTENT);case 6:return e.a(2)}},e,this)})),function(e){return o.apply(this,arguments)})},{key:"exportToPdf",value:(n=C(b().m(function e(t){return b().w(function(e){for(;;)switch(e.n){case 0:if(!this.options.actionSuccessCallBack){e.n=1;break}return e.n=1,this.options.actionSuccessCallBack(rt.DOWNPDF);case 1:return e.a(2)}},e,this)})),function(e){return n.apply(this,arguments)})},{key:"exportToMd",value:(t=C(b().m(function e(t){return b().w(function(e){for(;;)switch(e.n){case 0:if(!this.options.actionSuccessCallBack){e.n=1;break}return e.n=1,this.options.actionSuccessCallBack(rt.DOWNMD);case 1:return e.a(2)}},e,this)})),function(e){return t.apply(this,arguments)})},{key:"switchEngineType",value:(e=C(b().m(function e(t){return b().w(function(e){for(;;)switch(e.n){case 0:return this.updateState({isCreated:!1,engineType:t}),e.n=1,this.parsePreviewItem();case 1:this.mountComponent(),this.updateState({isCreated:!0});case 2:return e.a(2)}},e,this)})),function(t){return e.apply(this,arguments)})}]);var e,t,n,o,u,a,l,s,c}();t("FilePreviewShellController",li)}}})}();
1
+ !function(){function e(e,n,r,i){var o=t(l(1&i?e.prototype:e),n,r);return 2&i&&"function"==typeof o?function(e){return o.apply(r,e)}:o}function t(){return t="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=l(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},t.apply(null,arguments)}function n(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function r(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach(function(t){D(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function i(e){var t="function"==typeof Map?new Map:void 0;return i=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(a())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var i=new(e.bind.apply(e,r));return n&&c(i,n.prototype),i}(e,arguments,l(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),c(n,e)},i(e)}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o,u,a=[],l=!0,s=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(e){s=!0,i=e}finally{try{if(!l&&null!=n.return&&(u=n.return(),Object(u)!==u))return}finally{if(s)throw i}}return a}}(e,t)||p(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t,n){return t=l(t),function(e,t){if(t&&("object"==w(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,a()?Reflect.construct(t,n||[],l(e).constructor):t.apply(e,n))}function a(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(a=function(){return!!e})()}function l(e){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},l(e)}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&c(e,t)}function c(e,t){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},c(e,t)}function d(e){return function(e){if(Array.isArray(e))return f(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||p(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){if(e){if("string"==typeof e)return f(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(e,t):void 0}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function m(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,g(r.key),r)}}function v(e,t,n){return t&&m(e.prototype,t),n&&m(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function D(e,t,n){return(t=g(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(e){var t=function(e,t){if("object"!=w(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=w(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==w(t)?t:t+""}function b(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function o(n,r,i,o){var l=r&&r.prototype instanceof a?r:a,s=Object.create(l.prototype);return y(s,"_invoke",function(n,r,i){var o,a,l,s=0,c=i||[],d=!1,p={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return o=t,a=0,l=e,p.n=n,u}};function f(n,r){for(a=n,l=r,t=0;!d&&s&&!i&&t<c.length;t++){var i,o=c[t],f=p.p,h=o[2];n>3?(i=h===r)&&(l=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=f&&((i=n<2&&f<o[1])?(a=0,p.v=r,p.n=o[1]):f<h&&(i=n<3||o[0]>r||r>h)&&(o[4]=n,o[5]=r,p.n=h,a=0))}if(i||n>1)return u;throw d=!0,r}return function(i,c,h){if(s>1)throw TypeError("Generator is already running");for(d&&1===c&&f(c,h),a=c,l=h;(t=a<2?e:l)||!d;){o||(a?a<3?(a>1&&(p.n=-1),f(a,l)):p.n=l:p.v=l);try{if(s=2,o){if(a||(i="next"),t=o[i]){if(!(t=t.call(o,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,a<2&&(a=0)}else 1===a&&(t=o.return)&&t.call(o),a<2&&(l=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=e}else if((t=(d=p.n<0)?l:n.call(r,p))!==u)break}catch(t){o=e,a=1,l=t}finally{s=1}}return{value:t,done:d}}}(n,i,o),!0),s}var u={};function a(){}function l(){}function s(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(y(t={},r,function(){return this}),t),d=s.prototype=a.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,y(e,i,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=s,y(d,"constructor",s),y(s,"constructor",l),l.displayName="GeneratorFunction",y(s,i,"GeneratorFunction"),y(d),y(d,i,"Generator"),y(d,r,function(){return this}),y(d,"toString",function(){return"[object Generator]"}),(b=function(){return{w:o,m:p}})()}function y(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}y=function(e,t,n,r){function o(t,n){y(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},y(e,t,n,r)}function E(e,t,n,r,i,o,u){try{var a=e[o](u),l=a.value}catch(e){return void n(e)}a.done?t(l):Promise.resolve(l).then(r,i)}function C(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function u(e){E(o,r,i,u,a,"next",e)}function a(e){E(o,r,i,u,a,"throw",e)}u(void 0)})}}function w(e){return w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},w(e)}System.register("iBizFilePreviewer",[],function(t,n){"use strict";return{execute:function(t,n){var a,l,c,f,m,g,y,E,A,_,F,k,S={},T=[],x=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,L=Array.isArray;function B(e,t){for(var n in t)e[n]=t[n];return e}function M(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function N(e,t,n){var r,i,o,u={};for(o in t)"key"==o?r=t[o]:"ref"==o?i=t[o]:u[o]=t[o];if(arguments.length>2&&(u.children=arguments.length>3?a.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===u[o]&&(u[o]=e.defaultProps[o]);return O(e,u,r,i,null)}function O(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==i?++c:i,__i:-1,__u:0};return null==i&&null!=l.vnode&&l.vnode(o),o}function H(e){return e.children}function I(e,t){this.props=e,this.context=t}function P(e,t){if(null==t)return e.__?P(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?P(e):null}function j(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return j(e)}}function R(e){(!e.__d&&(e.__d=!0)&&m.push(e)&&!U.__r++||g!=l.debounceRendering)&&((g=l.debounceRendering)||y)(U)}function U(){for(var e,t,n,r,i,o,u,a=1;m.length;)m.length>a&&m.sort(E),e=m.shift(),a=m.length,e.__d&&(n=void 0,r=void 0,i=(r=(t=e).__v).__e,o=[],u=[],t.__P&&((n=B({},r)).__v=r.__v+1,l.vnode&&l.vnode(n),Z(t.__P,n,r,t.__n,t.__P.namespaceURI,32&r.__u?[i]:null,o,null==i?P(r):i,!!(32&r.__u),u),n.__v=r.__v,n.__.__k[n.__i]=n,$(o,n,u),r.__e=r.__=null,n.__e!=i&&j(n)));U.__r=0}function q(e,t,n,r,i,o,u,a,l,s,c){var d,p,f,h,m,v,D,g=r&&r.__k||T,b=t.length;for(l=function(e,t,n,r,i){var o,u,a,l,s,c=n.length,d=c,p=0;for(e.__k=new Array(i),o=0;o<i;o++)null!=(u=t[o])&&"boolean"!=typeof u&&"function"!=typeof u?("string"==typeof u||"number"==typeof u||"bigint"==typeof u||u.constructor==String?u=e.__k[o]=O(null,u,null,null,null):L(u)?u=e.__k[o]=O(H,{children:u},null,null,null):void 0===u.constructor&&u.__b>0?u=e.__k[o]=O(u.type,u.props,u.key,u.ref?u.ref:null,u.__v):e.__k[o]=u,l=o+p,u.__=e,u.__b=e.__b+1,a=null,-1!=(s=u.__i=W(u,n,l,d))&&(d--,(a=n[s])&&(a.__u|=2)),null==a||null==a.__v?(-1==s&&(i>c?p--:i<c&&p++),"function"!=typeof u.type&&(u.__u|=4)):s!=l&&(s==l-1?p--:s==l+1?p++:(s>l?p--:p++,u.__u|=4))):e.__k[o]=null;if(d)for(o=0;o<c;o++)null!=(a=n[o])&&!(2&a.__u)&&(a.__e==r&&(r=P(a)),te(a,a));return r}(n,t,g,l,b),d=0;d<b;d++)null!=(f=n.__k[d])&&(p=-1==f.__i?S:g[f.__i]||S,f.__i=d,v=Z(e,f,p,i,o,u,a,l,s,c),h=f.__e,f.ref&&p.ref!=f.ref&&(p.ref&&ee(p.ref,null,f),c.push(f.ref,f.__c||h,f)),null==m&&null!=h&&(m=h),(D=!!(4&f.__u))||p.__k===f.__k?l=V(f,l,e,D):"function"==typeof f.type&&void 0!==v?l=v:h&&(l=h.nextSibling),f.__u&=-7);return n.__e=m,l}function V(e,t,n,r){var i,o;if("function"==typeof e.type){for(i=e.__k,o=0;i&&o<i.length;o++)i[o]&&(i[o].__=e,t=V(i[o],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=P(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function z(e,t){return t=t||[],null==e||"boolean"==typeof e||(L(e)?e.some(function(e){z(e,t)}):t.push(e)),t}function W(e,t,n,r){var i,o,u,a=e.key,l=e.type,s=t[n],c=null!=s&&!(2&s.__u);if(null===s&&null==a||c&&a==s.key&&l==s.type)return n;if(r>(c?1:0))for(i=n-1,o=n+1;i>=0||o<t.length;)if(null!=(s=t[u=i>=0?i--:o++])&&!(2&s.__u)&&a==s.key&&l==s.type)return u;return-1}function G(e,t,n){"-"==t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||x.test(t)?n:n+"px"}function K(e,t,n,r,i){var o,u;e:if("style"==t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||G(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||G(e.style,t,n[t])}else if("o"==t[0]&&"n"==t[1])o=t!=(t=t.replace(A,"$1")),u=t.toLowerCase(),t=u in e||"onFocusOut"==t||"onFocusIn"==t?u.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r?n.u=r.u:(n.u=_,e.addEventListener(t,o?k:F,o)):e.removeEventListener(t,o?k:F,o);else{if("http://www.w3.org/2000/svg"==i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function X(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t.t)t.t=_++;else if(t.t<n.u)return;return n(l.event?l.event(t):t)}}}function Z(e,t,n,r,i,o,u,a,s,c){var d,p,f,h,m,v,D,g,b,y,E,C,w,A,_,F,k,S=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(s=!!(32&n.__u),o=[a=t.__e=n.__e]),(d=l.__b)&&d(t);e:if("function"==typeof S)try{if(g=t.props,b="prototype"in S&&S.prototype.render,y=(d=S.contextType)&&r[d.__c],E=d?y?y.props.value:d.__:r,n.__c?D=(p=t.__c=n.__c).__=p.__E:(b?t.__c=p=new S(g,E):(t.__c=p=new I(g,E),p.constructor=S,p.render=ne),y&&y.sub(p),p.state||(p.state={}),p.__n=r,f=p.__d=!0,p.__h=[],p._sb=[]),b&&null==p.__s&&(p.__s=p.state),b&&null!=S.getDerivedStateFromProps&&(p.__s==p.state&&(p.__s=B({},p.__s)),B(p.__s,S.getDerivedStateFromProps(g,p.__s))),h=p.props,m=p.state,p.__v=t,f)b&&null==S.getDerivedStateFromProps&&null!=p.componentWillMount&&p.componentWillMount(),b&&null!=p.componentDidMount&&p.__h.push(p.componentDidMount);else{if(b&&null==S.getDerivedStateFromProps&&g!==h&&null!=p.componentWillReceiveProps&&p.componentWillReceiveProps(g,E),t.__v==n.__v||!p.__e&&null!=p.shouldComponentUpdate&&!1===p.shouldComponentUpdate(g,p.__s,E)){for(t.__v!=n.__v&&(p.props=g,p.state=p.__s,p.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),C=0;C<p._sb.length;C++)p.__h.push(p._sb[C]);p._sb=[],p.__h.length&&u.push(p);break e}null!=p.componentWillUpdate&&p.componentWillUpdate(g,p.__s,E),b&&null!=p.componentDidUpdate&&p.__h.push(function(){p.componentDidUpdate(h,m,v)})}if(p.context=E,p.props=g,p.__P=e,p.__e=!1,w=l.__r,A=0,b){for(p.state=p.__s,p.__d=!1,w&&w(t),d=p.render(p.props,p.state,p.context),_=0;_<p._sb.length;_++)p.__h.push(p._sb[_]);p._sb=[]}else do{p.__d=!1,w&&w(t),d=p.render(p.props,p.state,p.context),p.state=p.__s}while(p.__d&&++A<25);p.state=p.__s,null!=p.getChildContext&&(r=B(B({},r),p.getChildContext())),b&&!f&&null!=p.getSnapshotBeforeUpdate&&(v=p.getSnapshotBeforeUpdate(h,m)),F=d,null!=d&&d.type===H&&null==d.key&&(F=Y(d.props.children)),a=q(e,L(F)?F:[F],t,n,r,i,o,u,a,s,c),p.base=t.__e,t.__u&=-161,p.__h.length&&u.push(p),D&&(p.__E=p.__=null)}catch(e){if(t.__v=null,s||null!=o)if(e.then){for(t.__u|=s?160:128;a&&8==a.nodeType&&a.nextSibling;)a=a.nextSibling;o[o.indexOf(a)]=null,t.__e=a}else{for(k=o.length;k--;)M(o[k]);J(t)}else t.__e=n.__e,t.__k=n.__k,e.then||J(t);l.__e(e,t,n)}else null==o&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):a=t.__e=Q(n.__e,t,n,r,i,o,u,s,c);return(d=l.diffed)&&d(t),128&t.__u?void 0:a}function J(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(J)}function $(e,t,n){for(var r=0;r<n.length;r++)ee(n[r],n[++r],n[++r]);l.__c&&l.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){l.__e(e,t.__v)}})}function Y(e){return"object"!=w(e)||null==e||e.__b&&e.__b>0?e:L(e)?e.map(Y):B({},e)}function Q(e,t,n,r,i,o,u,s,c){var d,p,f,h,m,v,D,g=n.props||S,b=t.props,y=t.type;if("svg"==y?i="http://www.w3.org/2000/svg":"math"==y?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),null!=o)for(d=0;d<o.length;d++)if((m=o[d])&&"setAttribute"in m==!!y&&(y?m.localName==y:3==m.nodeType)){e=m,o[d]=null;break}if(null==e){if(null==y)return document.createTextNode(b);e=document.createElementNS(i,y,b.is&&b),s&&(l.__m&&l.__m(t,o),s=!1),o=null}if(null==y)g===b||s&&e.data==b||(e.data=b);else{if(o=o&&a.call(e.childNodes),!s&&null!=o)for(g={},d=0;d<e.attributes.length;d++)g[(m=e.attributes[d]).name]=m.value;for(d in g)if(m=g[d],"children"==d);else if("dangerouslySetInnerHTML"==d)f=m;else if(!(d in b)){if("value"==d&&"defaultValue"in b||"checked"==d&&"defaultChecked"in b)continue;K(e,d,null,m,i)}for(d in b)m=b[d],"children"==d?h=m:"dangerouslySetInnerHTML"==d?p=m:"value"==d?v=m:"checked"==d?D=m:s&&"function"!=typeof m||g[d]===m||K(e,d,m,g[d],i);if(p)s||f&&(p.__html==f.__html||p.__html==e.innerHTML)||(e.innerHTML=p.__html),t.__k=[];else if(f&&(e.innerHTML=""),q("template"==t.type?e.content:e,L(h)?h:[h],t,n,r,"foreignObject"==y?"http://www.w3.org/1999/xhtml":i,o,u,o?o[0]:n.__k&&P(n,0),s,c),null!=o)for(d=o.length;d--;)M(o[d]);s||(d="value","progress"==y&&null==v?e.removeAttribute("value"):null!=v&&(v!==e[d]||"progress"==y&&!v||"option"==y&&v!=g[d])&&K(e,d,v,g[d],i),d="checked",null!=D&&D!=e[d]&&K(e,d,D,g[d],i))}return e}function ee(e,t,n){try{if("function"==typeof e){var r="function"==typeof e.__u;r&&e.__u(),r&&null==t||(e.__u=e(t))}else e.current=t}catch(e){l.__e(e,n)}}function te(e,t,n){var r,i;if(l.unmount&&l.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||ee(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){l.__e(e,t)}r.base=r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&te(r[i],t,n||"function"!=typeof e.type);n||M(e.__e),e.__c=e.__=e.__e=void 0}function ne(e,t,n){return this.constructor(e,n)}function re(e,t,n){var r,i,o;t==document&&(t=document.documentElement),l.__&&l.__(e,t),r=!1?null:t.__k,i=[],o=[],Z(t,e=t.__k=N(H,null,[e]),r||S,S,t.namespaceURI,r?null:t.firstChild?a.call(t.childNodes):null,i,r?r.__e:t.firstChild,false,o),$(i,e,o)}a=T.slice,l={__e:function(e,t,n,r){for(var i,o,u;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),u=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,r||{}),u=i.__d),u)return i.__E=i}catch(t){e=t}throw e}},c=0,f=function(e){return null!=e&&void 0===e.constructor},I.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=B({},this.state),"function"==typeof e&&(e=e(B({},n),this.props)),e&&B(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),R(this))},I.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),R(this))},I.prototype.render=H,m=[],y="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,E=function(e,t){return e.__v.__b-t.__v.__b},U.__r=0,A=/(PointerCapture)$|Capture$/i,_=0,F=X(!1),k=X(!0);var ie,oe,ue,ae,le=0,se=[],ce=l,de=ce.__b,pe=ce.__r,fe=ce.diffed,he=ce.__c,me=ce.unmount,ve=ce.__;function De(e,t){ce.__h&&ce.__h(oe,e,le||t),le=0;var n=oe.__H||(oe.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function ge(e){return le=1,function(e,t,n){var r=De(ie++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Se(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=oe,!oe.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter(function(e){return!!e.__c});if(i.every(function(e){return!e.__N}))return!o||o.call(this,e,t,n);var u=r.__c.props!==e;return i.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(u=!0)}}),o&&o.call(this,e,t,n)||u};oe.__f=!0;var o=oe.shouldComponentUpdate,u=oe.componentWillUpdate;oe.componentWillUpdate=function(e,t,n){if(this.__e){var r=o;o=void 0,i(e,t,n),o=r}u&&u.call(this,e,t,n)},oe.shouldComponentUpdate=i}return r.__N||r.__}(Se,e)}function be(e,t){var n=De(ie++,3);!ce.__s&&ke(n.__H,t)&&(n.__=e,n.u=t,oe.__H.__h.push(n))}function ye(e){return le=5,Ee(function(){return{current:e}},[])}function Ee(e,t){var n=De(ie++,7);return ke(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Ce(){for(var e;e=se.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(_e),e.__H.__h.forEach(Fe),e.__H.__h=[]}catch(xe){e.__H.__h=[],ce.__e(xe,e.__v)}}ce.__b=function(e){oe=null,de&&de(e)},ce.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),ve&&ve(e,t)},ce.__r=function(e){pe&&pe(e),ie=0;var t=(oe=e.__c).__H;t&&(ue===oe?(t.__h=[],oe.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(_e),t.__h.forEach(Fe),t.__h=[],ie=0)),ue=oe},ce.diffed=function(e){fe&&fe(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==se.push(t)&&ae===ce.requestAnimationFrame||((ae=ce.requestAnimationFrame)||Ae)(Ce)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),ue=oe=null},ce.__c=function(e,t){t.some(function(e){try{e.__h.forEach(_e),e.__h=e.__h.filter(function(e){return!e.__||Fe(e)})}catch(oe){t.some(function(e){e.__h&&(e.__h=[])}),t=[],ce.__e(oe,e.__v)}}),he&&he(e,t)},ce.unmount=function(e){me&&me(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{_e(e)}catch(e){t=e}}),n.__H=void 0,t&&ce.__e(t,n.__v))};var we="function"==typeof requestAnimationFrame;function Ae(e){var t,n=function(){clearTimeout(r),we&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);we&&(t=requestAnimationFrame(n))}function _e(e){var t=oe,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),oe=t}function Fe(e){var t=oe;e.__c=e.__(),oe=t}function ke(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function Se(e,t){return"function"==typeof t?t(e):t}var Te=Symbol.for("preact-signals");function xe(){if(He>1)He--;else{for(var e,t=!1;void 0!==Oe;){var n=Oe;for(Oe=void 0,Ie++;void 0!==n;){var r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&qe(n))try{n.c()}catch(n){t||(e=n,t=!0)}n=r}}if(Ie=0,He--,t)throw e}}var Le=void 0;function Be(e){var t=Le;Le=void 0;try{return e()}finally{Le=t}}var Me,Ne,Oe=void 0,He=0,Ie=0,Pe=0;function je(e){if(void 0!==Le){var t=e.n;if(void 0===t||t.t!==Le)return t={i:0,S:e,p:Le.s,n:void 0,t:Le,e:void 0,x:void 0,r:t},void 0!==Le.s&&(Le.s.n=t),Le.s=t,e.n=t,32&Le.f&&e.S(t),t;if(-1===t.i)return t.i=0,void 0!==t.n&&(t.n.p=t.p,void 0!==t.p&&(t.p.n=t.n),t.p=Le.s,t.n=void 0,Le.s.n=t,Le.s=t),t}}function Re(e,t){this.v=e,this.i=0,this.n=void 0,this.t=void 0,this.W=null==t?void 0:t.watched,this.Z=null==t?void 0:t.unwatched,this.name=null==t?void 0:t.name}function Ue(e,t){return new Re(e,t)}function qe(e){for(var t=e.s;void 0!==t;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function Ve(e){for(var t=e.s;void 0!==t;t=t.n){var n=t.S.n;if(void 0!==n&&(t.r=n),t.S.n=t,t.i=-1,void 0===t.n){e.s=t;break}}}function ze(e){for(var t=e.s,n=void 0;void 0!==t;){var r=t.p;-1===t.i?(t.S.U(t),void 0!==r&&(r.n=t.n),void 0!==t.n&&(t.n.p=r)):n=t,t.S.n=t.r,void 0!==t.r&&(t.r=void 0),t=r}e.s=n}function We(e,t){Re.call(this,void 0),this.x=e,this.s=void 0,this.g=Pe-1,this.f=4,this.W=null==t?void 0:t.watched,this.Z=null==t?void 0:t.unwatched,this.name=null==t?void 0:t.name}function Ge(e,t){return new We(e,t)}function Ke(e){var t=e.u;if(e.u=void 0,"function"==typeof t){He++;var n=Le;Le=void 0;try{t()}catch(xe){throw e.f&=-2,e.f|=8,Xe(e),xe}finally{Le=n,xe()}}}function Xe(e){for(var t=e.s;void 0!==t;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Ke(e)}function Ze(e){if(Le!==this)throw new Error("Out-of-order effect");ze(this),Le=e,this.f&=-2,8&this.f&&Xe(this),xe()}function Je(e,t){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=null==t?void 0:t.name}function $e(e,t){var n=new Je(e,t);try{n.c()}catch(e){throw n.d(),e}var r=n.d.bind(n);return r[Symbol.dispose]=r,r}function Ye(e,t){l[e]=t.bind(null,l[e]||function(){})}function Qe(e){Ne&&Ne(),Ne=e&&e.S()}function et(e){var t=this,n=e.data,r=nt(n);r.value=n;var i=Ee(function(){for(var e=t.__v;e=e.__;)if(e.__c){e.__c.__$f|=4;break}return t.__$u.c=function(){var e;f(i.peek())||3!==(null==(e=t.base)?void 0:e.nodeType)?(t.__$f|=1,t.setState({})):t.base.data=i.peek()},Ge(function(){var e=r.value.value;return 0===e?0:!0===e?"":e||""})},[]);return i.value}function tt(e,t,n,r){var i=t in e&&void 0===e.ownerSVGElement,o=Ue(n);return{o:function(e,t){o.value=e,r=t},d:$e(function(){var n=o.value.value;r[t]!==n&&(r[t]=n,i?e[t]=n:n?e.setAttribute(t,n):e.removeAttribute(t))})}}function nt(e){return Ee(function(){return Ue(e)},[])}function rt(e){var t=ye(e);return t.current=e,Me.__$f|=4,Ee(function(){return Ge(function(){return t.current()})},[])}Re.prototype.brand=Te,Re.prototype.h=function(){return!0},Re.prototype.S=function(e){var t=this,n=this.t;n!==e&&void 0===e.e&&(e.x=n,this.t=e,void 0!==n?n.e=e:Be(function(){var e;null==(e=t.W)||e.call(t)}))},Re.prototype.U=function(e){var t=this;if(void 0!==this.t){var n=e.e,r=e.x;void 0!==n&&(n.x=r,e.e=void 0),void 0!==r&&(r.e=n,e.x=void 0),e===this.t&&(this.t=r,void 0===r&&Be(function(){var e;null==(e=t.Z)||e.call(t)}))}},Re.prototype.subscribe=function(e){var t=this;return $e(function(){var n=t.value,r=Le;Le=void 0;try{e(n)}finally{Le=r}},{name:"sub"})},Re.prototype.valueOf=function(){return this.value},Re.prototype.toString=function(){return this.value+""},Re.prototype.toJSON=function(){return this.value},Re.prototype.peek=function(){var e=Le;Le=void 0;try{return this.value}finally{Le=e}},Object.defineProperty(Re.prototype,"value",{get:function(){var e=je(this);return void 0!==e&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(Ie>100)throw new Error("Cycle detected");this.v=e,this.i++,Pe++,He++;try{for(var t=this.t;void 0!==t;t=t.x)t.t.N()}finally{xe()}}}}),We.prototype=new Re,We.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f))return!0;if(this.f&=-5,this.g===Pe)return!0;if(this.g=Pe,this.f|=1,this.i>0&&!qe(this))return this.f&=-2,!0;var e=Le;try{Ve(this),Le=this;var t=this.x();(16&this.f||this.v!==t||0===this.i)&&(this.v=t,this.f&=-17,this.i++)}catch(e){this.v=e,this.f|=16,this.i++}return Le=e,ze(this),this.f&=-2,!0},We.prototype.S=function(e){if(void 0===this.t){this.f|=36;for(var t=this.s;void 0!==t;t=t.n)t.S.S(t)}Re.prototype.S.call(this,e)},We.prototype.U=function(e){if(void 0!==this.t&&(Re.prototype.U.call(this,e),void 0===this.t)){this.f&=-33;for(var t=this.s;void 0!==t;t=t.n)t.S.U(t)}},We.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;void 0!==e;e=e.x)e.t.N()}},Object.defineProperty(We.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=je(this);if(this.h(),void 0!==e&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),Je.prototype.c=function(){var e=this.S();try{if(8&this.f)return;if(void 0===this.x)return;var t=this.x();"function"==typeof t&&(this.u=t)}finally{e()}},Je.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Ke(this),Ve(this),He++;var e=Le;return Le=this,Ze.bind(this,e)},Je.prototype.N=function(){2&this.f||(this.f|=2,this.o=Oe,Oe=this)},Je.prototype.d=function(){this.f|=8,1&this.f||Xe(this)},Je.prototype.dispose=function(){this.d()},et.displayName="_st",Object.defineProperties(Re.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:et},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}}),Ye("__b",function(e,t){if("string"==typeof t.type){var n,r=t.props;for(var i in r)if("children"!==i){var o=r[i];o instanceof Re&&(n||(t.__np=n={}),n[i]=o,r[i]=o.peek())}}e(t)}),Ye("__r",function(e,t){Qe();var n,r=t.__c;r&&(r.__$f&=-2,void 0===(n=r.__$u)&&(r.__$u=n=function(){var e;return $e(function(){e=this}),e.c=function(){r.__$f|=1,r.setState({})},e}())),Me=r,Qe(n),e(t)}),Ye("__e",function(e,t,n,r){Qe(),Me=void 0,e(t,n,r)}),Ye("diffed",function(e,t){var n;if(Qe(),Me=void 0,"string"==typeof t.type&&(n=t.__e)){var r=t.__np,i=t.props;if(r){var o=n.U;if(o)for(var u in o){var a=o[u];void 0===a||u in r||(a.d(),o[u]=void 0)}else n.U=o={};for(var l in r){var s=o[l],c=r[l];void 0===s?(s=tt(n,l,c,i),o[l]=s):s.o(c,i)}}}e(t)}),Ye("unmount",function(e,t){if("string"==typeof t.type){var n=t.__e;if(n){var r=n.U;if(r)for(var i in n.U=void 0,r){var o=r[i];o&&o.d()}}}else{var u=t.__c;if(u){var a=u.__$u;a&&(u.__$u=void 0,a.d())}}e(t)}),Ye("__h",function(e,t,n,r){(r<3||9===r)&&(t.__$f|=2),e(t,n,r)}),I.prototype.shouldComponentUpdate=function(e,t){var n=this.__$u;if(!(n&&void 0!==n.s||4&this.__$f))return!0;if(3&this.__$f)return!0;for(var r in t)return!0;for(var i in e)if("__source"!==i&&e[i]!==this.props[i])return!0;for(var o in this.props)if(!(o in e))return!0;return!1};var it=t("ActionType",function(e){return e.DOWNORIGINAL="DOWNORIGINAL",e.COPYTEXTCONTENT="COPYTEXTCONTENT",e.DOWNPDF="DOWNPDF",e.DOWNMD="DOWNMD",e}(it||{})),ot=function(e){return e.AUTO="auto",e.WIDTH="width",e.PAGE="page",e}(ot||{}),ut=t("FileType",function(e){return e.HTML="html",e.MD="md",e.TXT="txt",e.JSON="json",e.XML="xml",e.DOC="doc",e.DOCX="docx",e.XLS="xls",e.XLSX="xlsx",e.WPS="wps",e.ET="et",e.PDF="pdf",e.OFD="ofd",e.PPT="ppt",e.PPTX="pptx",e.VSD="vsd",e.JPG="jpg",e.PNG="png",e.GIF="gif",e.SVG="svg",e.BMP="bmp",e.WEBP="webp",e.JPEG="jpeg",e.ICO="ico",e.CSV="csv",e.UNKNOWN="UNKNOWN",e}(ut||{})),at=function(e){return e.HTML="HTML",e.MD="MD",e.TXT="TXT",e.PDF="PDF",e.IMG="IMG",e.UNKNOWN="UNKNOWN",e}(at||{}),lt=new Map([["html",["HTML"]],["csv",["HTML"]],["md",["MD"]],["xls",["HTML"]],["xlsx",["HTML"]],["et",["HTML"]],["txt",["MD"]],["json",["MD"]],["xml",["MD"]],["pdf",["PDF"]],["ofd",["PDF"]],["doc",["PDF","HTML"]],["docx",["PDF","HTML"]],["wps",["PDF","HTML"]],["ppt",["PDF"]],["pptx",["PDF"]],["jpg",["IMG"]],["png",["IMG"]],["gif",["IMG"]],["svg",["IMG"]],["bmp",["IMG"]],["jpeg",["IMG"]],["webp",["IMG"]],["ico",["IMG"]]]),st=[{lable:"自动缩放",value:ot.AUTO},{lable:"适合页宽",value:ot.WIDTH},{lable:"适合页面",value:ot.PAGE}],ct=function(e){var t,n=null===(t=e.split(".").pop())||void 0===t?void 0:t.toLowerCase(),r=ut.UNKNOWN;switch(n){case"html":r=ut.HTML;break;case"md":r=ut.MD;break;case"txt":r=ut.TXT;break;case"json":r=ut.JSON;break;case"xml":r=ut.XML;break;case"doc":r=ut.DOC;break;case"docx":r=ut.DOCX;break;case"xls":r=ut.XLS;break;case"xlsx":r=ut.XLSX;break;case"wps":r=ut.WPS;break;case"et":r=ut.ET;break;case"pdf":r=ut.PDF;break;case"ofd":r=ut.OFD;break;case"ppt":r=ut.PPT;break;case"pptx":r=ut.PPTX;break;case"vsd":r=ut.VSD;break;case"jpg":r=ut.JPG;break;case"png":r=ut.PNG;break;case"gif":r=ut.GIF;break;case"svg":r=ut.SVG;break;case"bmp":r=ut.BMP;break;case"jpeg":r=ut.JPEG;break;case"webp":r=ut.WEBP;break;case"ico":r=ut.ICO;break;case"csv":r=ut.CSV;break;default:r=ut.UNKNOWN}return r},dt=function(e,t){var n=null,r=0;return function(){for(var i=arguments.length,o=new Array(i),u=0;u<i;u++)o[u]=arguments[u];var a=Date.now(),l=t-(a-r);l<=0?(r=a,n&&(clearTimeout(n),n=null),e.apply(void 0,o)):(n&&clearTimeout(n),n=setTimeout(function(){r=Date.now(),n=null,e.apply(void 0,o)},l))}},pt=function(e){var t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.left="-999999px",t.style.top="-999999px",document.body.appendChild(t),t.focus(),t.select();try{var n=document.execCommand("copy");return document.body.removeChild(t),!!n}catch(r){return document.body.removeChild(t),!1}},ft=function(){var e=C(b().m(function e(t){return b().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!navigator.clipboard||!window.isSecureContext){e.n=4;break}return e.p=1,e.n=2,navigator.clipboard.writeText(t);case 2:return e.a(2,!0);case 3:return e.p=3,e.v,e.a(2,pt(t));case 4:return e.a(2,pt(t));case 5:return e.a(2)}},e,null,[[1,3]])}));return function(t){return e.apply(this,arguments)}}();"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function ht(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function mt(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function vt(e,t){for(var n,r="",i=0,o=-1,u=0,a=0;a<=e.length;++a){if(a<e.length)n=e.charCodeAt(a);else{if(47===n)break;n=47}if(47===n){if(o===a-1||1===u);else if(o!==a-1&&2===u){if(r.length<2||2!==i||46!==r.charCodeAt(r.length-1)||46!==r.charCodeAt(r.length-2))if(r.length>2){var l=r.lastIndexOf("/");if(l!==r.length-1){-1===l?(r="",i=0):i=(r=r.slice(0,l)).length-1-r.lastIndexOf("/"),o=a,u=0;continue}}else if(2===r.length||1===r.length){r="",i=0,o=a,u=0;continue}t&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+e.slice(o+1,a):r=e.slice(o+1,a),i=a-o-1;o=a,u=0}else 46===n&&-1!==u?++u:u=-1}return r}var Dt={resolve:function(){for(var e,t="",n=!1,r=arguments.length-1;r>=-1&&!n;r--){var i;r>=0?i=arguments[r]:(void 0===e&&(e=process.cwd()),i=e),mt(i),0!==i.length&&(t=i+"/"+t,n=47===i.charCodeAt(0))}return t=vt(t,!n),n?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(e){if(mt(e),0===e.length)return".";var t=47===e.charCodeAt(0),n=47===e.charCodeAt(e.length-1);return 0!==(e=vt(e,!t)).length||t||(e="."),e.length>0&&n&&(e+="/"),t?"/"+e:e},isAbsolute:function(e){return mt(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,t=0;t<arguments.length;++t){var n=arguments[t];mt(n),n.length>0&&(void 0===e?e=n:e+="/"+n)}return void 0===e?".":Dt.normalize(e)},relative:function(e,t){if(mt(e),mt(t),e===t)return"";if((e=Dt.resolve(e))===(t=Dt.resolve(t)))return"";for(var n=1;n<e.length&&47===e.charCodeAt(n);++n);for(var r=e.length,i=r-n,o=1;o<t.length&&47===t.charCodeAt(o);++o);for(var u=t.length-o,a=i<u?i:u,l=-1,s=0;s<=a;++s){if(s===a){if(u>a){if(47===t.charCodeAt(o+s))return t.slice(o+s+1);if(0===s)return t.slice(o+s)}else i>a&&(47===e.charCodeAt(n+s)?l=s:0===s&&(l=0));break}var c=e.charCodeAt(n+s);if(c!==t.charCodeAt(o+s))break;47===c&&(l=s)}var d="";for(s=n+l+1;s<=r;++s)s!==r&&47!==e.charCodeAt(s)||(0===d.length?d+="..":d+="/..");return d.length>0?d+t.slice(o+l):(o+=l,47===t.charCodeAt(o)&&++o,t.slice(o))},_makeLong:function(e){return e},dirname:function(e){if(mt(e),0===e.length)return".";for(var t=e.charCodeAt(0),n=47===t,r=-1,i=!0,o=e.length-1;o>=1;--o)if(47===(t=e.charCodeAt(o))){if(!i){r=o;break}}else i=!1;return-1===r?n?"/":".":n&&1===r?"//":e.slice(0,r)},basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');mt(e);var n,r=0,i=-1,o=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var u=t.length-1,a=-1;for(n=e.length-1;n>=0;--n){var l=e.charCodeAt(n);if(47===l){if(!o){r=n+1;break}}else-1===a&&(o=!1,a=n+1),u>=0&&(l===t.charCodeAt(u)?-1===--u&&(i=n):(u=-1,i=a))}return r===i?i=a:-1===i&&(i=e.length),e.slice(r,i)}for(n=e.length-1;n>=0;--n)if(47===e.charCodeAt(n)){if(!o){r=n+1;break}}else-1===i&&(o=!1,i=n+1);return-1===i?"":e.slice(r,i)},extname:function(e){mt(e);for(var t=-1,n=0,r=-1,i=!0,o=0,u=e.length-1;u>=0;--u){var a=e.charCodeAt(u);if(47!==a)-1===r&&(i=!1,r=u+1),46===a?-1===t?t=u:1!==o&&(o=1):-1!==t&&(o=-1);else if(!i){n=u+1;break}}return-1===t||-1===r||0===o||1===o&&t===r-1&&t===n+1?"":e.slice(t,r)},format:function(e){if(null===e||"object"!==w(e))throw new TypeError('The "pathObject" argument must be of type Object. Received type '+w(e));return function(e,t){var n=t.dir||t.root,r=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+r:n+e+r:r}("/",e)},parse:function(e){mt(e);var t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;var n,r=e.charCodeAt(0),i=47===r;i?(t.root="/",n=1):n=0;for(var o=-1,u=0,a=-1,l=!0,s=e.length-1,c=0;s>=n;--s)if(47!==(r=e.charCodeAt(s)))-1===a&&(l=!1,a=s+1),46===r?-1===o?o=s:1!==c&&(c=1):-1!==o&&(c=-1);else if(!l){u=s+1;break}return-1===o||-1===a||0===c||1===c&&o===a-1&&o===u+1?-1!==a&&(t.base=t.name=0===u&&i?e.slice(1,a):e.slice(u,a)):(0===u&&i?(t.name=e.slice(1,o),t.base=e.slice(1,a)):(t.name=e.slice(u,o),t.base=e.slice(u,a)),t.ext=e.slice(o,a)),u>0?t.dir=e.slice(0,u-1):i&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};Dt.posix=Dt;var gt=ht(Dt),bt=function(){return v(function e(t){h(this,e),D(this,"urlReg",/^http[s]?:\/\/[^\s]*/),D(this,"baseDir",void 0),D(this,"url",void 0),this.url=new URL(t),this.baseDir=gt.dirname(this.url.pathname||this.url.hostname)},[{key:"dir",value:function(e){return this.urlReg.test(e)?e:this.url.origin+gt.resolve(this.baseDir,e)}}])}(),yt=0;function Et(e,t,n,r,i,o){t||(t={});var u,a,s=t;if("ref"in s)for(a in s={},t)"ref"==a?u=t[a]:s[a]=t[a];var c={type:e,props:s,key:n,ref:u,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--yt,__i:-1,__u:0,__source:i,__self:o};if("function"==typeof e&&(u=e.defaultProps))for(a in u)void 0===s[a]&&(s[a]=u[a]);return l.vnode&&l.vnode(c),c}var Ct=function(e){var t=ye(null);return be(function(){if(t.current){var n=t.current.attachShadow({mode:"open"}),r=getComputedStyle(t.current),i=r.getPropertyValue("--track-bg-color").trim(),o=r.getPropertyValue("--thumb-bg-color").trim(),u=r.getPropertyValue("--thumb-hover-bg-color").trim(),a="\n <style>\n ::-webkit-scrollbar {\n display: block;\n width: 6px;\n height: 6px;\n }\n ::-webkit-scrollbar-track {\n background: ".concat(i,";\n }\n ::-webkit-scrollbar-thumb {\n background: ").concat(o,";\n border-radius: 2px;\n }\n ::-webkit-scrollbar-thumb:hover {\n background: ").concat(u,";\n }\n </style>\n "),l=e.controller.state.value.content,s=l.includes("<head>")?l.replace("<head>","<head>".concat(a)):"".concat(a).concat(l),c=new Blob([s],{type:"text/html"}),d=URL.createObjectURL(c);n.innerHTML='\n <style>\n iframe {\n width: 100%;\n height: 100%;\n border: none;\n display: block;\n }\n </style>\n <iframe src="'.concat(d,'"></iframe>\n '),URL.revokeObjectURL(d),e.onInitialization()}else e.onInitialization()},[]),Et("div",{className:"file-preview-html ".concat(e.controller.state.value.theme),children:Et("div",{ref:t,className:"container"})})},wt=function(){return Et("svg",{class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",children:Et("path",{d:"M853.333333 544H170.666667c-17.066667 0-32-14.933333-32-32s14.933333-32 32-32h682.666666c17.066667 0 32 14.933333 32 32s-14.933333 32-32 32z",fill:"currentColor"})})},At=function(){return Et("svg",{class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",children:Et("path",{d:"M483.555556 483.555556v-284.444445a28.444444 28.444444 0 0 1 56.888888 0v284.444445h284.444445a28.444444 28.444444 0 1 1 0 56.888888h-284.444445v284.444445a28.444444 28.444444 0 1 1-56.888888 0v-284.444445h-284.444445a28.444444 28.444444 0 0 1 0-56.888888h284.444445z",fill:"currentColor"})})},_t=function(){return Et("svg",{class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",children:[Et("path",{fill:"currentColor",d:"M505.7 661c3.2 4.1 9.4 4.1 12.6 0l112-141.7c4.1-5.2 0.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8z"}),Et("path",{fill:"currentColor",d:"M878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"})]})},Ft=function(){return Et("svg",{class:"icon",viewBox:"0 0 1118 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",children:Et("path",{d:"M977.721197 605.255979l139.674457-162.953533-97.865236 0C985.496408 192.517959 771.28235 0 512.139674 0 229.2989 0 0 229.2989 0 512.139674c0 277.346913 220.452851 503.200509 495.704647 511.860326l0-93.162863C271.899609 922.223879 93.116304 738.039829 93.116304 512.139674c0-231.440575 187.582795-419.02337 419.02337-419.02337 207.649359 0 379.96108 150.988088 413.250159 349.186142L838.04674 442.302446 977.721197 605.255979z",fill:"currentColor"})})},kt=function(){return Et("svg",{class:"icon",viewBox:"0 0 1118 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",children:Et("path",{d:"M621.691007 930.837137l0 93.162863C896.942803 1015.340184 1117.395653 789.486587 1117.395653 512.139674c0-282.840775-229.2989-512.139674-512.139674-512.139674C346.113304 0 131.899245 192.517959 97.818678 442.302446L0 442.302446 139.674457 605.255979l139.674457-162.953533L192.00582 442.302446C225.294899 244.104392 397.60662 93.116304 605.255979 93.116304c231.440575 0 419.02337 187.582795 419.02337 419.02337C1024.279349 738.039829 845.496044 922.223879 621.691007 930.837137z",fill:"currentColor"})})},St=function(){return Et("svg",{class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",children:Et("path",{d:"M112 912h368V544H112v368z m80-288h208v208H192V624zM544 112v368h368V112H544z m288 288H624V192h208v208zM112 480h368V112H112v368z m80-288h208v208H192V192z m352 720h368V544H544v368z m80-288h208v208H624V624z",fill:"currentColor"})})},Tt=function(){return Et("svg",{class:"icon",viewBox:"0 0 1025 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"16.015625",height:"16",children:Et("path",{d:"M131.339914 423.017198c-9.52111 9.670597-9.400291 25.229558 0.270306 34.750668 9.670597 9.522134 25.229558 9.401315 34.750668-0.269282l320.722863-325.740925 0 798.397108c0 13.5716 11.001648 24.573248 24.573248 24.573248 13.5716 0 24.573248-11.001648 24.573248-24.573248L536.230246 135.522485l315.80719 320.551874c9.523157 9.667525 25.084167 9.783224 34.750668 0.259043 9.667525-9.524181 9.784248-25.083143 0.259043-34.750668L552.305246 81.813557c-11.058985-11.331339-25.865391-17.688643-41.702849-17.905707-0.277473-0.004096-0.554946-0.005119-0.832419-0.005119-15.559985 0-30.237381 5.957989-41.412066 16.831651-0.124914 0.121842-0.249828 0.245732-0.372694 0.370646L131.339914 423.017198z",fill:"currentColor"})})},xt=function(){return Et("svg",{class:"icon",viewBox:"0 0 1025 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"16.015625",height:"16",children:Et("path",{d:"M467.985218 937.525717c0.122866 0.124914 0.24778 0.248804 0.372694 0.370646 11.174684 10.873662 25.852081 16.831651 41.412066 16.831651 0.277473 0 0.554946-0.001024 0.832419-0.005119 15.837458-0.217064 30.643864-6.574368 41.702849-17.905707l334.741901-339.769178c9.525205-9.667525 9.408482-25.226487-0.259043-34.750668-9.666501-9.524181-25.227511-9.408482-34.750668 0.259043l-315.80719 320.551874L536.230246 88.475979c0-13.5716-11.001648-24.573248-24.573248-24.573248-13.5716 0-24.573248 11.001648-24.573248 24.573248l0 798.397108L166.360888 561.132161c-9.52111-9.670597-25.080071-9.791415-34.750668-0.269282-9.670597 9.52111-9.791415 25.080071-0.270306 34.750668L467.985218 937.525717z",fill:"currentColor"})})},Lt=function(){return Et("svg",{class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",children:Et("path",{d:"M512 608c-6.4 0-19.2 0-25.6-6.4l-128-128c-12.8-12.8-12.8-32 0-44.8s32-12.8 44.8 0L512 531.2l102.4-102.4c12.8-12.8 32-12.8 44.8 0s12.8 32 0 44.8l-128 128C531.2 608 518.4 608 512 608z",fill:"currentColor"})})},Bt=function(){return Et("svg",{class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",children:Et("path",{d:"M512 950.86c-210.65 0-386.92-149.21-429.35-347.43H190.9L74.61 486.4 8.78 420.57C2.92 449.83 0 480.55 0 512s2.92 62.17 8.78 91.43C51.2 842.6 260.39 1024 512 1024c208.46 0 386.92-123.61 466.65-302.08l-55.59-55.59C860.16 832.37 699.98 950.86 512 950.86zM1015.22 420.57C972.8 181.39 763.61 0 512 0 303.54 0 125.08 123.61 45.35 302.08l55.59 56.32C163.11 192.37 324.02 73.14 512 73.14c210.65 0 386.92 149.21 429.35 347.43H833.1l116.29 116.29 65.83 65.83c5.85-29.26 8.78-59.25 8.78-90.7s-2.92-62.16-8.78-91.42z",fill:"currentColor"})})},Mt=function(e){return Et("svg",{class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",width:e.size,height:e.size,children:[Et("path",{d:"M512 61.44a40.96 40.96 0 0 1 40.96 40.96v122.88a40.96 40.96 0 1 1-81.92 0V102.4A40.96 40.96 0 0 1 512 61.44z",fill:"currentColor",opacity:".9"}),Et("path",{d:"M737.28 121.792a40.96 40.96 0 0 1 14.992 55.952l-61.44 106.432a40.96 40.96 0 1 1-70.944-40.96l61.44-106.432a40.96 40.96 0 0 1 55.952-14.992z",fill:"currentColor",opacity:".8"}),Et("path",{d:"M902.208 286.72a40.96 40.96 0 0 1-14.992 55.952l-106.432 61.44a40.96 40.96 0 0 1-40.96-70.944l106.432-61.44a40.96 40.96 0 0 1 55.952 14.992z",fill:"currentColor",opacity:".76"}),Et("path",{d:"M962.56 512a40.96 40.96 0 0 1-40.96 40.96h-122.88a40.96 40.96 0 1 1 0-81.92h122.88A40.96 40.96 0 0 1 962.56 512z",fill:"currentColor",opacity:".7"}),Et("path",{d:"M902.208 737.28a40.96 40.96 0 0 1-55.952 14.992l-106.432-61.44a40.96 40.96 0 1 1 40.96-70.944l106.432 61.44a40.96 40.96 0 0 1 14.992 55.952z",fill:"currentColor",opacity:".6","p-id":"4720"}),Et("path",{d:"M737.28 902.208a40.96 40.96 0 0 1-55.952-14.992l-61.44-106.432a40.96 40.96 0 0 1 70.944-40.96l61.44 106.432a40.96 40.96 0 0 1-14.992 55.952z",fill:"currentColor",opacity:".5","p-id":"4721"}),Et("path",{d:"M512 962.56a40.96 40.96 0 0 1-40.96-40.96v-122.88a40.96 40.96 0 1 1 81.92 0v122.88A40.96 40.96 0 0 1 512 962.56z",fill:"currentColor",opacity:".4","p-id":"4722"}),Et("path",{d:"M286.72 902.208a40.96 40.96 0 0 1-14.992-55.952l61.44-106.432a40.96 40.96 0 1 1 70.944 40.96l-61.44 106.432a40.96 40.96 0 0 1-55.952 14.992z",fill:"currentColor",opacity:".3","p-id":"4723"}),Et("path",{d:"M121.792 737.28a40.96 40.96 0 0 1 14.992-55.952l106.432-61.44a40.96 40.96 0 0 1 40.96 70.944l-106.432 61.44a40.96 40.96 0 0 1-55.952-14.992z",fill:"currentColor",opacity:".2","p-id":"4724"}),Et("path",{d:"M61.44 512a40.96 40.96 0 0 1 40.96-40.96h122.88a40.96 40.96 0 1 1 0 81.92H102.4A40.96 40.96 0 0 1 61.44 512z",fill:"currentColor",opacity:".1","p-id":"4725"}),Et("path",{d:"M121.792 286.72a40.96 40.96 0 0 1 55.952-14.992l106.432 61.44a40.96 40.96 0 1 1-40.96 70.944l-106.432-61.44a40.96 40.96 0 0 1-14.992-55.952z",fill:"currentColor",opacity:".04","p-id":"4726"}),Et("path",{d:"M286.72 121.792a40.96 40.96 0 0 1 55.952 14.992l61.44 106.432a40.96 40.96 0 0 1-70.944 40.96l-61.44-106.432a40.96 40.96 0 0 1 14.992-55.952z",fill:"currentColor","p-id":"4727"})]})};function Nt(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function Ot(e,t){this.props=e,this.context=t}(Ot.prototype=new I).isPureReactComponent=!0,Ot.prototype.shouldComponentUpdate=function(e,t){return Nt(this.props,e)||Nt(this.state,t)};var Ht=l.__b;l.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Ht&&Ht(e)};var It=l.__e;l.__e=function(e,t,n,r){if(e.then)for(var i,o=t;o=o.__;)if((i=o.__c)&&i.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),i.__c(e,t);It(e,t,n,r)};var Pt=l.unmount;function jt(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(e){"function"==typeof e.__c&&e.__c()}),e.__c.__H=null),null!=(e=function(e,t){for(var n in t)e[n]=t[n];return e}({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(function(e){return jt(e,t,n)})),e}function Rt(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(e){return Rt(e,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function Ut(){this.__u=0,this.o=null,this.__b=null}function qt(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Vt(){this.i=null,this.l=null}l.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Pt&&Pt(e)},(Ut.prototype=new I).__c=function(e,t){var n=t.__c,r=this;null==r.o&&(r.o=[]),r.o.push(n);var i=qt(r.__v),o=!1,u=function(){o||(o=!0,n.__R=null,i?i(a):a())};n.__R=u;var a=function(){if(! --r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=Rt(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.o.pop();)t.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(u,u)},Ut.prototype.componentWillUnmount=function(){this.o=[]},Ut.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=jt(this.__b,n,r.__O=r.__P)}this.__b=null}var i=t.__a&&N(H,null,e.fallback);return i&&(i.__u&=-33),[N(H,null,t.__a?null:e.children),i]};var zt=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};function Wt(e){return this.getChildContext=function(){return e.context},e.children}function Gt(e){var t=this,n=e.h;if(t.componentWillUnmount=function(){re(null,t.v),t.v=null,t.h=null},t.h&&t.h!==n&&t.componentWillUnmount(),!t.v){for(var r=t.__v;null!==r&&!r.__m&&null!==r.__;)r=r.__;t.h=n,t.v={nodeType:1,parentNode:n,childNodes:[],__k:{__m:r.__m},contains:function(){return!0},insertBefore:function(e,n){this.childNodes.push(e),t.h.insertBefore(e,n)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.h.removeChild(e)}}}re(N(Wt,{context:t.context},e.__v),t.v)}(Vt.prototype=new I).__a=function(e){var t=this,n=qt(t.__v),r=t.l.get(e);return r[0]++,function(i){var o=function(){t.props.revealOrder?(r.push(i),zt(t,e,r)):i()};n?n(o):o()}},Vt.prototype.render=function(e){this.i=null,this.l=new Map;var t=z(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},Vt.prototype.componentDidUpdate=Vt.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){zt(e,n,t)})};var Kt="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,Xt=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Zt=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Jt=/[A-Z0-9]/g,$t="undefined"!=typeof document,Yt=function(e){return("undefined"!=typeof Symbol&&"symbol"==w(Symbol())?/fil|che|rad/:/fil|che|ra/).test(e)};I.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(I.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Qt=l.event;function en(){}function tn(){return this.cancelBubble}function nn(){return this.defaultPrevented}l.event=function(e){return Qt&&(e=Qt(e)),e.persist=en,e.isPropagationStopped=tn,e.isDefaultPrevented=nn,e.nativeEvent=e};var rn={enumerable:!1,configurable:!0,get:function(){return this.class}},on=l.vnode;l.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,r={},i=-1===n.indexOf("-");for(var o in t){var u=t[o];if(!("value"===o&&"defaultValue"in t&&null==u||$t&&"children"===o&&"noscript"===n||"class"===o||"className"===o)){var a=o.toLowerCase();"defaultValue"===o&&"value"in t&&null==t.value?o="value":"download"===o&&!0===u?u="":"translate"===a&&"no"===u?u=!1:"o"===a[0]&&"n"===a[1]?"ondoubleclick"===a?o="ondblclick":"onchange"!==a||"input"!==n&&"textarea"!==n||Yt(t.type)?"onfocus"===a?o="onfocusin":"onblur"===a?o="onfocusout":Zt.test(o)&&(o=a):a=o="oninput":i&&Xt.test(o)?o=o.replace(Jt,"-$&").toLowerCase():null===u&&(u=void 0),"oninput"===a&&r[o=a]&&(o="oninputCapture"),r[o]=u}}"select"==n&&r.multiple&&Array.isArray(r.value)&&(r.value=z(t.children).forEach(function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)})),"select"==n&&null!=r.defaultValue&&(r.value=z(t.children).forEach(function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value})),t.class&&!t.className?(r.class=t.class,Object.defineProperty(r,"className",rn)):(t.className&&!t.class||t.class&&t.className)&&(r.class=r.className=t.className),e.props=r}(e),e.$$typeof=Kt,on&&on(e)};var un=l.__r;l.__r=function(e){un&&un(e),e.__c};var an=l.diffed;l.diffed=function(e){an&&an(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value)};var ln=function(e){var t=e.to,n=void 0===t?"body":t,r=e.children,i=ye(null);return be(function(){var e=document.querySelector(n);return e&&(i.current=e),function(){i.current&&(i.current=null)}},[n]),i.current?function(e,t){var n=N(Gt,{__v:e,h:t});return n.containerInfo=t,n}(r,i.current):null},sn=function(e){var t=e.controller,n=rt(function(){var e=t.state.value,n=e.mode,r=e.scale,i=e.rotate,o=e.offsetX,u=e.offsetY,a=e.enableTransition,l=o/r,s=u/r;switch(i%360){case 90:case-270:var c=[s,-l];l=c[0],s=c[1];break;case 180:case-180:var d=[-l,-s];l=d[0],s=d[1];break;case 270:case-90:var p=[-s,l];l=p[0],s=p[1]}var f={transform:"scale(".concat(r,") rotate(").concat(i,"deg) translate(").concat(l,"px, ").concat(s,"px)"),transition:a?"transform .3s":""};return n===ot.WIDTH&&(f.width="100%"),n===ot.PAGE&&(f.height="100%"),f});return be(function(){t.state.value.fileType===ut.SVG&&e.onInitialization()},[]),Et("div",{className:"file-preview-image ".concat(t.state.value.theme),children:[t.state.value.fileType===ut.SVG?Et("div",{className:"svg-container",style:n.value,dangerouslySetInnerHTML:{__html:t.state.value.content},onMouseDown:function(e){return t.handleMouseDown(e)}}):Et("img",{style:n.value,src:t.state.value.content,onLoad:function(){return e.onInitialization()},onError:function(){return e.onInitialization()},onMouseDown:function(e){return t.handleMouseDown(e)}}),Et(ln,{to:"#custom-controls",children:Et("div",{className:"image-toolbar-container",children:[Et("button",{title:"逆时针",className:"control-btn",onClick:function(){return t.handleRotateChange(-90)},children:Et("span",{className:"icon",children:Et(kt,{})})}),Et("button",{title:"顺时针",className:"control-btn",onClick:function(){return t.handleRotateChange(90)},children:Et("span",{className:"icon",children:Et(Ft,{})})}),Et("select",{className:"img-mode",value:t.state.value.mode,onChange:function(e){var n=e.target.value;t.switchMode(n)},children:st.map(function(e,t){return Et("option",{label:e.lable,value:e.value},t)})}),Et("div",{className:"zoom",children:[Et("button",{title:"缩小",className:"control-btn",onClick:function(e){t.zoomOutPreview(e)},children:Et("span",{className:"icon",children:Et(wt,{})})}),Et("span",{className:"zoom-level",children:[Math.round(100*t.state.value.scale),"%"]}),Et("button",{title:"放大",className:"control-btn",onClick:function(e){t.zoomInPreview(e)},children:Et("span",{className:"icon",children:Et(At,{})})})]}),Et("button",{title:"重置",className:"control-btn",onClick:function(){t.reSet()},children:Et("span",{className:"icon",children:Et(Bt,{})})})]})})]})},cn={exports:{}};!function(e){var t;t=function(){return function(){var e={173:function(e){var t=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32},n=-1;t.Diff=function(e,t){return[e,t]},t.prototype.diff_main=function(e,n,r,i){void 0===i&&(i=this.Diff_Timeout<=0?Number.MAX_VALUE:(new Date).getTime()+1e3*this.Diff_Timeout);var o=i;if(null==e||null==n)throw new Error("Null input. (diff_main)");if(e==n)return e?[new t.Diff(0,e)]:[];void 0===r&&(r=!0);var u=r,a=this.diff_commonPrefix(e,n),l=e.substring(0,a);e=e.substring(a),n=n.substring(a),a=this.diff_commonSuffix(e,n);var s=e.substring(e.length-a);e=e.substring(0,e.length-a),n=n.substring(0,n.length-a);var c=this.diff_compute_(e,n,u,o);return l&&c.unshift(new t.Diff(0,l)),s&&c.push(new t.Diff(0,s)),this.diff_cleanupMerge(c),c},t.prototype.diff_compute_=function(e,r,i,o){var u;if(!e)return[new t.Diff(1,r)];if(!r)return[new t.Diff(n,e)];var a=e.length>r.length?e:r,l=e.length>r.length?r:e,s=a.indexOf(l);if(-1!=s)return u=[new t.Diff(1,a.substring(0,s)),new t.Diff(0,l),new t.Diff(1,a.substring(s+l.length))],e.length>r.length&&(u[0][0]=u[2][0]=n),u;if(1==l.length)return[new t.Diff(n,e),new t.Diff(1,r)];var c=this.diff_halfMatch_(e,r);if(c){var d=c[0],p=c[1],f=c[2],h=c[3],m=c[4],v=this.diff_main(d,f,i,o),D=this.diff_main(p,h,i,o);return v.concat([new t.Diff(0,m)],D)}return i&&e.length>100&&r.length>100?this.diff_lineMode_(e,r,o):this.diff_bisect_(e,r,o)},t.prototype.diff_lineMode_=function(e,r,i){var o=this.diff_linesToChars_(e,r);e=o.chars1,r=o.chars2;var u=o.lineArray,a=this.diff_main(e,r,!1,i);this.diff_charsToLines_(a,u),this.diff_cleanupSemantic(a),a.push(new t.Diff(0,""));for(var l=0,s=0,c=0,d="",p="";l<a.length;){switch(a[l][0]){case 1:c++,p+=a[l][1];break;case n:s++,d+=a[l][1];break;case 0:if(s>=1&&c>=1){a.splice(l-s-c,s+c),l=l-s-c;for(var f=this.diff_main(d,p,!1,i),h=f.length-1;h>=0;h--)a.splice(l,0,f[h]);l+=f.length}c=0,s=0,d="",p=""}l++}return a.pop(),a},t.prototype.diff_bisect_=function(e,r,i){for(var o=e.length,u=r.length,a=Math.ceil((o+u)/2),l=a,s=2*a,c=new Array(s),d=new Array(s),p=0;p<s;p++)c[p]=-1,d[p]=-1;c[l+1]=0,d[l+1]=0;for(var f=o-u,h=f%2!=0,m=0,v=0,D=0,g=0,b=0;b<a&&!((new Date).getTime()>i);b++){for(var y=-b+m;y<=b-v;y+=2){for(var E=l+y,C=(k=y==-b||y!=b&&c[E-1]<c[E+1]?c[E+1]:c[E-1]+1)-y;k<o&&C<u&&e.charAt(k)==r.charAt(C);)k++,C++;if(c[E]=k,k>o)v+=2;else if(C>u)m+=2;else if(h&&(_=l+f-y)>=0&&_<s&&-1!=d[_]&&k>=(A=o-d[_]))return this.diff_bisectSplit_(e,r,k,C,i)}for(var w=-b+D;w<=b-g;w+=2){for(var A,_=l+w,F=(A=w==-b||w!=b&&d[_-1]<d[_+1]?d[_+1]:d[_-1]+1)-w;A<o&&F<u&&e.charAt(o-A-1)==r.charAt(u-F-1);)A++,F++;if(d[_]=A,A>o)g+=2;else if(F>u)D+=2;else if(!h){var k;if((E=l+f-w)>=0&&E<s&&-1!=c[E])if(C=l+(k=c[E])-E,k>=(A=o-A))return this.diff_bisectSplit_(e,r,k,C,i)}}}return[new t.Diff(n,e),new t.Diff(1,r)]},t.prototype.diff_bisectSplit_=function(e,t,n,r,i){var o=e.substring(0,n),u=t.substring(0,r),a=e.substring(n),l=t.substring(r),s=this.diff_main(o,u,!1,i),c=this.diff_main(a,l,!1,i);return s.concat(c)},t.prototype.diff_linesToChars_=function(e,t){var n=[],r={};function i(e){for(var t="",i=0,u=-1,a=n.length;u<e.length-1;){-1==(u=e.indexOf("\n",i))&&(u=e.length-1);var l=e.substring(i,u+1);(r.hasOwnProperty?r.hasOwnProperty(l):void 0!==r[l])?t+=String.fromCharCode(r[l]):(a==o&&(l=e.substring(i),u=e.length),t+=String.fromCharCode(a),r[l]=a,n[a++]=l),i=u+1}return t}n[0]="";var o=4e4,u=i(e);return o=65535,{chars1:u,chars2:i(t),lineArray:n}},t.prototype.diff_charsToLines_=function(e,t){for(var n=0;n<e.length;n++){for(var r=e[n][1],i=[],o=0;o<r.length;o++)i[o]=t[r.charCodeAt(o)];e[n][1]=i.join("")}},t.prototype.diff_commonPrefix=function(e,t){if(!e||!t||e.charAt(0)!=t.charAt(0))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,o=0;n<i;)e.substring(o,i)==t.substring(o,i)?o=n=i:r=i,i=Math.floor((r-n)/2+n);return i},t.prototype.diff_commonSuffix=function(e,t){if(!e||!t||e.charAt(e.length-1)!=t.charAt(t.length-1))return 0;for(var n=0,r=Math.min(e.length,t.length),i=r,o=0;n<i;)e.substring(e.length-i,e.length-o)==t.substring(t.length-i,t.length-o)?o=n=i:r=i,i=Math.floor((r-n)/2+n);return i},t.prototype.diff_commonOverlap_=function(e,t){var n=e.length,r=t.length;if(0==n||0==r)return 0;n>r?e=e.substring(n-r):n<r&&(t=t.substring(0,n));var i=Math.min(n,r);if(e==t)return i;for(var o=0,u=1;;){var a=e.substring(i-u),l=t.indexOf(a);if(-1==l)return o;u+=l,0!=l&&e.substring(i-u)!=t.substring(0,u)||(o=u,u++)}},t.prototype.diff_halfMatch_=function(e,t){if(this.Diff_Timeout<=0)return null;var n=e.length>t.length?e:t,r=e.length>t.length?t:e;if(n.length<4||2*r.length<n.length)return null;var i=this;function o(e,t,n){for(var r,o,u,a,l=e.substring(n,n+Math.floor(e.length/4)),s=-1,c="";-1!=(s=t.indexOf(l,s+1));){var d=i.diff_commonPrefix(e.substring(n),t.substring(s)),p=i.diff_commonSuffix(e.substring(0,n),t.substring(0,s));c.length<p+d&&(c=t.substring(s-p,s)+t.substring(s,s+d),r=e.substring(0,n-p),o=e.substring(n+d),u=t.substring(0,s-p),a=t.substring(s+d))}return 2*c.length>=e.length?[r,o,u,a,c]:null}var u,a,l,s,c,d=o(n,r,Math.ceil(n.length/4)),p=o(n,r,Math.ceil(n.length/2));return d||p?(u=p?d&&d[4].length>p[4].length?d:p:d,e.length>t.length?(a=u[0],l=u[1],s=u[2],c=u[3]):(s=u[0],c=u[1],a=u[2],l=u[3]),[a,l,s,c,u[4]]):null},t.prototype.diff_cleanupSemantic=function(e){for(var r=!1,i=[],o=0,u=null,a=0,l=0,s=0,c=0,d=0;a<e.length;)0==e[a][0]?(i[o++]=a,l=c,s=d,c=0,d=0,u=e[a][1]):(1==e[a][0]?c+=e[a][1].length:d+=e[a][1].length,u&&u.length<=Math.max(l,s)&&u.length<=Math.max(c,d)&&(e.splice(i[o-1],0,new t.Diff(n,u)),e[i[o-1]+1][0]=1,o--,a=--o>0?i[o-1]:-1,l=0,s=0,c=0,d=0,u=null,r=!0)),a++;for(r&&this.diff_cleanupMerge(e),this.diff_cleanupSemanticLossless(e),a=1;a<e.length;){if(e[a-1][0]==n&&1==e[a][0]){var p=e[a-1][1],f=e[a][1],h=this.diff_commonOverlap_(p,f),m=this.diff_commonOverlap_(f,p);h>=m?(h>=p.length/2||h>=f.length/2)&&(e.splice(a,0,new t.Diff(0,f.substring(0,h))),e[a-1][1]=p.substring(0,p.length-h),e[a+1][1]=f.substring(h),a++):(m>=p.length/2||m>=f.length/2)&&(e.splice(a,0,new t.Diff(0,p.substring(0,m))),e[a-1][0]=1,e[a-1][1]=f.substring(0,f.length-m),e[a+1][0]=n,e[a+1][1]=p.substring(m),a++),a++}a++}},t.prototype.diff_cleanupSemanticLossless=function(e){function n(e,n){if(!e||!n)return 6;var r=e.charAt(e.length-1),i=n.charAt(0),o=r.match(t.nonAlphaNumericRegex_),u=i.match(t.nonAlphaNumericRegex_),a=o&&r.match(t.whitespaceRegex_),l=u&&i.match(t.whitespaceRegex_),s=a&&r.match(t.linebreakRegex_),c=l&&i.match(t.linebreakRegex_),d=s&&e.match(t.blanklineEndRegex_),p=c&&n.match(t.blanklineStartRegex_);return d||p?5:s||c?4:o&&!a&&l?3:a||l?2:o||u?1:0}for(var r=1;r<e.length-1;){if(0==e[r-1][0]&&0==e[r+1][0]){var i=e[r-1][1],o=e[r][1],u=e[r+1][1],a=this.diff_commonSuffix(i,o);if(a){var l=o.substring(o.length-a);i=i.substring(0,i.length-a),o=l+o.substring(0,o.length-a),u=l+u}for(var s=i,c=o,d=u,p=n(i,o)+n(o,u);o.charAt(0)===u.charAt(0);){i+=o.charAt(0),o=o.substring(1)+u.charAt(0),u=u.substring(1);var f=n(i,o)+n(o,u);f>=p&&(p=f,s=i,c=o,d=u)}e[r-1][1]!=s&&(s?e[r-1][1]=s:(e.splice(r-1,1),r--),e[r][1]=c,d?e[r+1][1]=d:(e.splice(r+1,1),r--))}r++}},t.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,t.whitespaceRegex_=/\s/,t.linebreakRegex_=/[\r\n]/,t.blanklineEndRegex_=/\n\r?\n$/,t.blanklineStartRegex_=/^\r?\n\r?\n/,t.prototype.diff_cleanupEfficiency=function(e){for(var r=!1,i=[],o=0,u=null,a=0,l=!1,s=!1,c=!1,d=!1;a<e.length;)0==e[a][0]?(e[a][1].length<this.Diff_EditCost&&(c||d)?(i[o++]=a,l=c,s=d,u=e[a][1]):(o=0,u=null),c=d=!1):(e[a][0]==n?d=!0:c=!0,u&&(l&&s&&c&&d||u.length<this.Diff_EditCost/2&&l+s+c+d==3)&&(e.splice(i[o-1],0,new t.Diff(n,u)),e[i[o-1]+1][0]=1,o--,u=null,l&&s?(c=d=!0,o=0):(a=--o>0?i[o-1]:-1,c=d=!1),r=!0)),a++;r&&this.diff_cleanupMerge(e)},t.prototype.diff_cleanupMerge=function(e){e.push(new t.Diff(0,""));for(var r,i=0,o=0,u=0,a="",l="";i<e.length;)switch(e[i][0]){case 1:u++,l+=e[i][1],i++;break;case n:o++,a+=e[i][1],i++;break;case 0:o+u>1?(0!==o&&0!==u&&(0!==(r=this.diff_commonPrefix(l,a))&&(i-o-u>0&&0==e[i-o-u-1][0]?e[i-o-u-1][1]+=l.substring(0,r):(e.splice(0,0,new t.Diff(0,l.substring(0,r))),i++),l=l.substring(r),a=a.substring(r)),0!==(r=this.diff_commonSuffix(l,a))&&(e[i][1]=l.substring(l.length-r)+e[i][1],l=l.substring(0,l.length-r),a=a.substring(0,a.length-r))),i-=o+u,e.splice(i,o+u),a.length&&(e.splice(i,0,new t.Diff(n,a)),i++),l.length&&(e.splice(i,0,new t.Diff(1,l)),i++),i++):0!==i&&0==e[i-1][0]?(e[i-1][1]+=e[i][1],e.splice(i,1)):i++,u=0,o=0,a="",l=""}""===e[e.length-1][1]&&e.pop();var s=!1;for(i=1;i<e.length-1;)0==e[i-1][0]&&0==e[i+1][0]&&(e[i][1].substring(e[i][1].length-e[i-1][1].length)==e[i-1][1]?(e[i][1]=e[i-1][1]+e[i][1].substring(0,e[i][1].length-e[i-1][1].length),e[i+1][1]=e[i-1][1]+e[i+1][1],e.splice(i-1,1),s=!0):e[i][1].substring(0,e[i+1][1].length)==e[i+1][1]&&(e[i-1][1]+=e[i+1][1],e[i][1]=e[i][1].substring(e[i+1][1].length)+e[i+1][1],e.splice(i+1,1),s=!0)),i++;s&&this.diff_cleanupMerge(e)},t.prototype.diff_xIndex=function(e,t){var r,i=0,o=0,u=0,a=0;for(r=0;r<e.length&&(1!==e[r][0]&&(i+=e[r][1].length),e[r][0]!==n&&(o+=e[r][1].length),!(i>t));r++)u=i,a=o;return e.length!=r&&e[r][0]===n?a:a+(t-u)},t.prototype.diff_prettyHtml=function(e){for(var t=[],r=/&/g,i=/</g,o=/>/g,u=/\n/g,a=0;a<e.length;a++){var l=e[a][0],s=e[a][1].replace(r,"&amp;").replace(i,"&lt;").replace(o,"&gt;").replace(u,"&para;<br>");switch(l){case 1:t[a]='<ins style="background:#e6ffe6;">'+s+"</ins>";break;case n:t[a]='<del style="background:#ffe6e6;">'+s+"</del>";break;case 0:t[a]="<span>"+s+"</span>"}}return t.join("")},t.prototype.diff_text1=function(e){for(var t=[],n=0;n<e.length;n++)1!==e[n][0]&&(t[n]=e[n][1]);return t.join("")},t.prototype.diff_text2=function(e){for(var t=[],r=0;r<e.length;r++)e[r][0]!==n&&(t[r]=e[r][1]);return t.join("")},t.prototype.diff_levenshtein=function(e){for(var t=0,r=0,i=0,o=0;o<e.length;o++){var u=e[o][0],a=e[o][1];switch(u){case 1:r+=a.length;break;case n:i+=a.length;break;case 0:t+=Math.max(r,i),r=0,i=0}}return t+=Math.max(r,i)},t.prototype.diff_toDelta=function(e){for(var t=[],r=0;r<e.length;r++)switch(e[r][0]){case 1:t[r]="+"+encodeURI(e[r][1]);break;case n:t[r]="-"+e[r][1].length;break;case 0:t[r]="="+e[r][1].length}return t.join("\t").replace(/%20/g," ")},t.prototype.diff_fromDelta=function(e,r){for(var i=[],o=0,u=0,a=r.split(/\t/g),l=0;l<a.length;l++){var s=a[l].substring(1);switch(a[l].charAt(0)){case"+":try{i[o++]=new t.Diff(1,decodeURI(s))}catch(p){throw new Error("Illegal escape in diff_fromDelta: "+s)}break;case"-":case"=":var c=parseInt(s,10);if(isNaN(c)||c<0)throw new Error("Invalid number in diff_fromDelta: "+s);var d=e.substring(u,u+=c);"="==a[l].charAt(0)?i[o++]=new t.Diff(0,d):i[o++]=new t.Diff(n,d);break;default:if(a[l])throw new Error("Invalid diff operation in diff_fromDelta: "+a[l])}}if(u!=e.length)throw new Error("Delta length ("+u+") does not equal source text length ("+e.length+").");return i},t.prototype.match_main=function(e,t,n){if(null==e||null==t||null==n)throw new Error("Null input. (match_main)");return n=Math.max(0,Math.min(n,e.length)),e==t?0:e.length?e.substring(n,n+t.length)==t?n:this.match_bitap_(e,t,n):-1},t.prototype.match_bitap_=function(e,t,n){if(t.length>this.Match_MaxBits)throw new Error("Pattern too long for this browser.");var r=this.match_alphabet_(t),i=this;function o(e,r){var o=e/t.length,u=Math.abs(n-r);return i.Match_Distance?o+u/i.Match_Distance:u?1:o}var u=this.Match_Threshold,a=e.indexOf(t,n);-1!=a&&(u=Math.min(o(0,a),u),-1!=(a=e.lastIndexOf(t,n+t.length))&&(u=Math.min(o(0,a),u)));var l,s,c=1<<t.length-1;a=-1;for(var d,p=t.length+e.length,f=0;f<t.length;f++){for(l=0,s=p;l<s;)o(f,n+s)<=u?l=s:p=s,s=Math.floor((p-l)/2+l);p=s;var h=Math.max(1,n-s+1),m=Math.min(n+s,e.length)+t.length,v=Array(m+2);v[m+1]=(1<<f)-1;for(var D=m;D>=h;D--){var g=r[e.charAt(D-1)];if(v[D]=0===f?(v[D+1]<<1|1)&g:(v[D+1]<<1|1)&g|(d[D+1]|d[D])<<1|1|d[D+1],v[D]&c){var b=o(f,D-1);if(b<=u){if(u=b,!((a=D-1)>n))break;h=Math.max(1,2*n-a)}}}if(o(f+1,n)>u)break;d=v}return a},t.prototype.match_alphabet_=function(e){for(var t={},n=0;n<e.length;n++)t[e.charAt(n)]=0;for(n=0;n<e.length;n++)t[e.charAt(n)]|=1<<e.length-n-1;return t},t.prototype.patch_addContext_=function(e,n){if(0!=n.length){if(null===e.start2)throw Error("patch not initialized");for(var r=n.substring(e.start2,e.start2+e.length1),i=0;n.indexOf(r)!=n.lastIndexOf(r)&&r.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)i+=this.Patch_Margin,r=n.substring(e.start2-i,e.start2+e.length1+i);i+=this.Patch_Margin;var o=n.substring(e.start2-i,e.start2);o&&e.diffs.unshift(new t.Diff(0,o));var u=n.substring(e.start2+e.length1,e.start2+e.length1+i);u&&e.diffs.push(new t.Diff(0,u)),e.start1-=o.length,e.start2-=o.length,e.length1+=o.length+u.length,e.length2+=o.length+u.length}},t.prototype.patch_make=function(e,r,i){var o,u;if("string"==typeof e&&"string"==typeof r&&void 0===i)o=e,(u=this.diff_main(o,r,!0)).length>2&&(this.diff_cleanupSemantic(u),this.diff_cleanupEfficiency(u));else if(e&&"object"==w(e)&&void 0===r&&void 0===i)u=e,o=this.diff_text1(u);else if("string"==typeof e&&r&&"object"==w(r)&&void 0===i)o=e,u=r;else{if("string"!=typeof e||"string"!=typeof r||!i||"object"!=w(i))throw new Error("Unknown call format to patch_make.");o=e,u=i}if(0===u.length)return[];for(var a=[],l=new t.patch_obj,s=0,c=0,d=0,p=o,f=o,h=0;h<u.length;h++){var m=u[h][0],v=u[h][1];switch(s||0===m||(l.start1=c,l.start2=d),m){case 1:l.diffs[s++]=u[h],l.length2+=v.length,f=f.substring(0,d)+v+f.substring(d);break;case n:l.length1+=v.length,l.diffs[s++]=u[h],f=f.substring(0,d)+f.substring(d+v.length);break;case 0:v.length<=2*this.Patch_Margin&&s&&u.length!=h+1?(l.diffs[s++]=u[h],l.length1+=v.length,l.length2+=v.length):v.length>=2*this.Patch_Margin&&s&&(this.patch_addContext_(l,p),a.push(l),l=new t.patch_obj,s=0,p=f,c=d)}1!==m&&(c+=v.length),m!==n&&(d+=v.length)}return s&&(this.patch_addContext_(l,p),a.push(l)),a},t.prototype.patch_deepCopy=function(e){for(var n=[],r=0;r<e.length;r++){var i=e[r],o=new t.patch_obj;o.diffs=[];for(var u=0;u<i.diffs.length;u++)o.diffs[u]=new t.Diff(i.diffs[u][0],i.diffs[u][1]);o.start1=i.start1,o.start2=i.start2,o.length1=i.length1,o.length2=i.length2,n[r]=o}return n},t.prototype.patch_apply=function(e,t){if(0==e.length)return[t,[]];e=this.patch_deepCopy(e);var r=this.patch_addPadding(e);t=r+t+r,this.patch_splitMax(e);for(var i=0,o=[],u=0;u<e.length;u++){var a,l,s=e[u].start2+i,c=this.diff_text1(e[u].diffs),d=-1;if(c.length>this.Match_MaxBits?-1!=(a=this.match_main(t,c.substring(0,this.Match_MaxBits),s))&&(-1==(d=this.match_main(t,c.substring(c.length-this.Match_MaxBits),s+c.length-this.Match_MaxBits))||a>=d)&&(a=-1):a=this.match_main(t,c,s),-1==a)o[u]=!1,i-=e[u].length2-e[u].length1;else if(o[u]=!0,i=a-s,c==(l=-1==d?t.substring(a,a+c.length):t.substring(a,d+this.Match_MaxBits)))t=t.substring(0,a)+this.diff_text2(e[u].diffs)+t.substring(a+c.length);else{var p=this.diff_main(c,l,!1);if(c.length>this.Match_MaxBits&&this.diff_levenshtein(p)/c.length>this.Patch_DeleteThreshold)o[u]=!1;else{this.diff_cleanupSemanticLossless(p);for(var f,h=0,m=0;m<e[u].diffs.length;m++){var v=e[u].diffs[m];0!==v[0]&&(f=this.diff_xIndex(p,h)),1===v[0]?t=t.substring(0,a+f)+v[1]+t.substring(a+f):v[0]===n&&(t=t.substring(0,a+f)+t.substring(a+this.diff_xIndex(p,h+v[1].length))),v[0]!==n&&(h+=v[1].length)}}}}return[t=t.substring(r.length,t.length-r.length),o]},t.prototype.patch_addPadding=function(e){for(var n=this.Patch_Margin,r="",i=1;i<=n;i++)r+=String.fromCharCode(i);for(i=0;i<e.length;i++)e[i].start1+=n,e[i].start2+=n;var o=e[0],u=o.diffs;if(0==u.length||0!=u[0][0])u.unshift(new t.Diff(0,r)),o.start1-=n,o.start2-=n,o.length1+=n,o.length2+=n;else if(n>u[0][1].length){var a=n-u[0][1].length;u[0][1]=r.substring(u[0][1].length)+u[0][1],o.start1-=a,o.start2-=a,o.length1+=a,o.length2+=a}return 0==(u=(o=e[e.length-1]).diffs).length||0!=u[u.length-1][0]?(u.push(new t.Diff(0,r)),o.length1+=n,o.length2+=n):n>u[u.length-1][1].length&&(a=n-u[u.length-1][1].length,u[u.length-1][1]+=r.substring(0,a),o.length1+=a,o.length2+=a),r},t.prototype.patch_splitMax=function(e){for(var r=this.Match_MaxBits,i=0;i<e.length;i++)if(!(e[i].length1<=r)){var o=e[i];e.splice(i--,1);for(var u=o.start1,a=o.start2,l="";0!==o.diffs.length;){var s=new t.patch_obj,c=!0;for(s.start1=u-l.length,s.start2=a-l.length,""!==l&&(s.length1=s.length2=l.length,s.diffs.push(new t.Diff(0,l)));0!==o.diffs.length&&s.length1<r-this.Patch_Margin;){var d=o.diffs[0][0],p=o.diffs[0][1];1===d?(s.length2+=p.length,a+=p.length,s.diffs.push(o.diffs.shift()),c=!1):d===n&&1==s.diffs.length&&0==s.diffs[0][0]&&p.length>2*r?(s.length1+=p.length,u+=p.length,c=!1,s.diffs.push(new t.Diff(d,p)),o.diffs.shift()):(p=p.substring(0,r-s.length1-this.Patch_Margin),s.length1+=p.length,u+=p.length,0===d?(s.length2+=p.length,a+=p.length):c=!1,s.diffs.push(new t.Diff(d,p)),p==o.diffs[0][1]?o.diffs.shift():o.diffs[0][1]=o.diffs[0][1].substring(p.length))}l=(l=this.diff_text2(s.diffs)).substring(l.length-this.Patch_Margin);var f=this.diff_text1(o.diffs).substring(0,this.Patch_Margin);""!==f&&(s.length1+=f.length,s.length2+=f.length,0!==s.diffs.length&&0===s.diffs[s.diffs.length-1][0]?s.diffs[s.diffs.length-1][1]+=f:s.diffs.push(new t.Diff(0,f))),c||e.splice(++i,0,s)}}},t.prototype.patch_toText=function(e){for(var t=[],n=0;n<e.length;n++)t[n]=e[n];return t.join("")},t.prototype.patch_fromText=function(e){var r=[];if(!e)return r;for(var i=e.split("\n"),o=0,u=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;o<i.length;){var a=i[o].match(u);if(!a)throw new Error("Invalid patch string: "+i[o]);var l=new t.patch_obj;for(r.push(l),l.start1=parseInt(a[1],10),""===a[2]?(l.start1--,l.length1=1):"0"==a[2]?l.length1=0:(l.start1--,l.length1=parseInt(a[2],10)),l.start2=parseInt(a[3],10),""===a[4]?(l.start2--,l.length2=1):"0"==a[4]?l.length2=0:(l.start2--,l.length2=parseInt(a[4],10)),o++;o<i.length;){var s=i[o].charAt(0);try{var c=decodeURI(i[o].substring(1))}catch(d){throw new Error("Illegal escape in patch_fromText: "+c)}if("-"==s)l.diffs.push(new t.Diff(n,c));else if("+"==s)l.diffs.push(new t.Diff(1,c));else if(" "==s)l.diffs.push(new t.Diff(0,c));else{if("@"==s)break;if(""!==s)throw new Error('Invalid patch mode "'+s+'" in: '+c)}o++}}return r},(t.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0}).prototype.toString=function(){for(var e,t=["@@ -"+(0===this.length1?this.start1+",0":1==this.length1?this.start1+1:this.start1+1+","+this.length1)+" +"+(0===this.length2?this.start2+",0":1==this.length2?this.start2+1:this.start2+1+","+this.length2)+" @@\n"],r=0;r<this.diffs.length;r++){switch(this.diffs[r][0]){case 1:e="+";break;case n:e="-";break;case 0:e=" "}t[r+1]=e+encodeURI(this.diffs[r][1])+"\n"}return t.join("").replace(/%20/g," ")},e.exports=t,e.exports.diff_match_patch=t,e.exports.DIFF_DELETE=n,e.exports.DIFF_INSERT=1,e.exports.DIFF_EQUAL=0},408:function(e,t,n){n.d(t,{default:function(){return N}});var r=n(135),i=n(840),o=n(775),u=n(428),a=n(325),l=n(483),s=n(999),c=function(e){void 0===e&&(e=document);var t=function(e){var t=document.createElement("img");t.src=e.getAttribute("data-src"),t.addEventListener("load",function(){e.getAttribute("style")||e.getAttribute("class")||e.getAttribute("width")||e.getAttribute("height")||t.naturalHeight>t.naturalWidth&&t.naturalWidth/t.naturalHeight<document.querySelector(".vditor-reset").clientWidth/(window.innerHeight-40)&&t.naturalHeight>window.innerHeight-40&&(e.style.height=window.innerHeight-40+"px"),e.src=t.src}),e.removeAttribute("data-src")};if(!("IntersectionObserver"in window))return e.querySelectorAll("img").forEach(function(e){e.getAttribute("data-src")&&t(e)}),!1;window.vditorImageIntersectionObserver?(window.vditorImageIntersectionObserver.disconnect(),e.querySelectorAll("img").forEach(function(e){window.vditorImageIntersectionObserver.observe(e)})):(window.vditorImageIntersectionObserver=new IntersectionObserver(function(e){e.forEach(function(e){(void 0===e.isIntersecting?0!==e.intersectionRatio:e.isIntersecting)&&e.target.getAttribute("data-src")&&t(e.target)})}),e.querySelectorAll("img").forEach(function(e){window.vditorImageIntersectionObserver.observe(e)}))},d=n(472),p=n(280),f=n(637),h=n(825),m=n(11),v=n(194),D=n(436),g=n(229),b=n(145),y=n(538),E=n(413),C=n(106),w=n(673),A=n(214),_=n(810),F=function(e,t){if(void 0===t&&(t="zh_CN"),"undefined"!=typeof speechSynthesis&&"undefined"!=typeof SpeechSynthesisUtterance){var n=function(){var e,n;return speechSynthesis.getVoices().forEach(function(r){r.lang===t.replace("_","-")&&(e=r),r.default&&(n=r)}),e||(e=n),e},r='<svg><use xlink:href="#vditor-icon-play"></use></svg>',i='<svg><use xlink:href="#vditor-icon-pause"></use></svg>';document.getElementById("vditorIconScript")||(r='<svg viewBox="0 0 32 32"><path d="M3.436 0l25.128 16-25.128 16v-32z"></path></svg>',i='<svg viewBox="0 0 32 32"><path d="M20.617 0h9.128v32h-9.128v-32zM2.255 32v-32h9.128v32h-9.128z"></path></svg>');var o=document.querySelector(".vditor-speech");o||((o=document.createElement("button")).className="vditor-speech",e.insertAdjacentElement("beforeend",o),void 0!==speechSynthesis.onvoiceschanged&&(speechSynthesis.onvoiceschanged=n));var u=n(),a=new SpeechSynthesisUtterance;a.voice=u,a.onend=a.onerror=function(){o.style.display="none",speechSynthesis.cancel(),o.classList.remove("vditor-speech--current"),o.innerHTML=r},e.addEventListener(void 0!==window.ontouchstart?"touchend":"click",function(t){var n=t.target;if(n.classList.contains("vditor-speech")||n.parentElement.classList.contains("vditor-speech"))return o.classList.contains("vditor-speech--current")?speechSynthesis.speaking&&(speechSynthesis.paused?(speechSynthesis.resume(),o.innerHTML=i):(speechSynthesis.pause(),o.innerHTML=r)):(a.text=o.getAttribute("data-text"),speechSynthesis.speak(a),o.classList.add("vditor-speech--current"),o.innerHTML=i),(0,_.Hc)(window.vditorSpeechRange),void e.focus();if(o.style.display="none",speechSynthesis.cancel(),o.classList.remove("vditor-speech--current"),o.innerHTML=r,0!==getSelection().rangeCount){var u=getSelection().getRangeAt(0),l=u.toString().trim();if(l){window.vditorSpeechRange=u.cloneRange();var s=u.getBoundingClientRect();o.innerHTML=r,o.style.display="block",o.style.top=s.top+s.height+document.querySelector("html").scrollTop-20+"px",void 0!==window.ontouchstart?o.style.left=t.changedTouches[t.changedTouches.length-1].pageX+2+"px":o.style.left=t.clientX+2+"px",o.setAttribute("data-text",l)}}})}},k=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function u(e){try{l(r.next(e))}catch(je){o(je)}}function a(e){try{l(r.throw(e))}catch(je){o(je)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(u,a)}l((r=r.apply(e,t||[])).next())})},S=function(e,t){var n,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(u=0)),u;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,r=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){u=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){u.label=a[1];break}if(6===a[0]&&u.label<i[1]){u.label=i[1],i=a;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(a);break}i[2]&&u.ops.pop(),u.trys.pop();continue}a=t.call(e,u)}catch(je){a=[6,je],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}},T=function(e){var t,n={anchor:0,cdn:b.g.CDN,customEmoji:{},emojiPath:"".concat(b.g.CDN,"/dist/images/emoji"),hljs:b.g.HLJS_OPTIONS,icon:"ant",lang:"zh_CN",markdown:b.g.MARKDOWN_OPTIONS,math:b.g.MATH_OPTIONS,mode:"light",speech:{enable:!1},render:{media:{enable:!0}},theme:b.g.THEME_OPTIONS};return e.cdn&&((null===(t=e.theme)||void 0===t?void 0:t.path)||(n.theme.path="".concat(e.cdn,"/dist/css/content-theme")),e.emojiPath||(n.emojiPath="".concat(e.cdn,"/dist/images/emoji"))),(0,w.T)(n,e)},x=function(e,t){var n=T(t);return(0,E.G)("".concat(n.cdn,"/dist/js/lute/lute.min.js"),"vditorLuteScript").then(function(){var r=(0,A.X)({autoSpace:n.markdown.autoSpace,gfmAutoLink:n.markdown.gfmAutoLink,codeBlockPreview:n.markdown.codeBlockPreview,emojiSite:n.emojiPath,emojis:n.customEmoji,fixTermTypo:n.markdown.fixTermTypo,footnotes:n.markdown.footnotes,headingAnchor:0!==n.anchor,inlineMathDigit:n.math.inlineDigit,lazyLoadImage:n.lazyLoadImage,linkBase:n.markdown.linkBase,linkPrefix:n.markdown.linkPrefix,listStyle:n.markdown.listStyle,mark:n.markdown.mark,mathBlockPreview:n.markdown.mathBlockPreview,paragraphBeginningSpace:n.markdown.paragraphBeginningSpace,sanitize:n.markdown.sanitize,toc:n.markdown.toc});return(null==t?void 0:t.renderers)&&r.SetJSRenderers({renderers:{Md2HTML:t.renderers}}),r.SetHeadingID(!0),r.Md2HTML(e)})},L=function(e,t,n){return k(void 0,void 0,void 0,function(){var i,D,b,w;return S(this,function(A){switch(A.label){case 0:return i=T(n),[4,x(t,i)];case 1:if(D=A.sent(),i.transform&&(D=i.transform(D)),e.innerHTML=D,e.classList.add("vditor-reset"),i.i18n)return[3,5];if(["de_DE","en_US","es_ES","fr_FR","ja_JP","ko_KR","pt_BR","ru_RU","sv_SE","vi_VN","zh_CN","zh_TW"].includes(i.lang))return[3,2];throw new Error("options.lang error, see https://ld246.com/article/1549638745630#options");case 2:return w=(b="vditorI18nScript")+i.lang,document.querySelectorAll('head script[id^="'.concat(b,'"]')).forEach(function(e){e.id!==w&&document.head.removeChild(e)}),[4,(0,E.G)("".concat(i.cdn,"/dist/js/i18n/").concat(i.lang,".js"),w)];case 3:A.sent(),A.label=4;case 4:return[3,6];case 5:window.VditorI18n=i.i18n,A.label=6;case 6:return i.icon?[4,(0,E.G)("".concat(i.cdn,"/dist/js/icons/").concat(i.icon,".js"),"vditorIconScript")]:[3,8];case 7:A.sent(),A.label=8;case 8:return(0,y.Z)(i.theme.current,i.theme.path),1===i.anchor&&e.classList.add("vditor-reset--anchor"),(0,u.O)(e,i.hljs),(0,s.s)(i.hljs,e,i.cdn),(0,d.H)(e,{cdn:i.cdn,math:i.math}),(0,f.i)(e,i.cdn,i.mode),(0,h.J)(e,i.cdn,i.mode),(0,m.K)(e,i.cdn),(0,a.P)(e,i.cdn),(0,l.v)(e,i.cdn),(0,o.p)(e,i.cdn,i.mode),(0,v.P)(e,i.cdn,i.mode),(0,g.B)(e,i.cdn),(0,r.Q)(e,i.cdn),i.render.media.enable&&(0,p.Y)(e),i.speech.enable&&F(e),0!==i.anchor&&(_=i.anchor,document.querySelectorAll(".vditor-anchor").forEach(function(e){1===_&&e.classList.add("vditor-anchor--left"),e.onclick=function(){var t=e.getAttribute("href").substr(1),n=document.getElementById("vditorAnchor-"+t).offsetTop;document.querySelector("html").scrollTop=n}}),window.onhashchange=function(){var e=document.getElementById("vditorAnchor-"+decodeURIComponent(window.location.hash.substr(1)));e&&(document.querySelector("html").scrollTop=e.offsetTop)}),i.after&&i.after(),i.lazyLoadImage&&c(e),e.addEventListener("click",function(t){var n=(0,C.lG)(t.target,"SPAN");if(n&&(0,C.fb)(n,"vditor-toc")){var r=e.querySelector("#"+n.getAttribute("data-target-id"));r&&window.scrollTo(window.scrollX,r.offsetTop)}}),[2]}var _})})},B=n(190),M=n(580),N=function(){function e(){}return e.adapterRender=i,e.previewImage=B.E,e.codeRender=u.O,e.graphvizRender=l.v,e.highlightRender=s.s,e.mathRender=d.H,e.mermaidRender=f.i,e.SMILESRender=h.J,e.markmapRender=m.K,e.flowchartRender=a.P,e.chartRender=o.p,e.abcRender=r.Q,e.mindmapRender=v.P,e.plantumlRender=g.B,e.outlineRender=D.k,e.mediaRender=p.Y,e.speechRender=F,e.lazyLoadImageRender=c,e.md2html=x,e.preview=L,e.setCodeTheme=M.Y,e.setContentTheme=y.Z,e}()},145:function(e,t,n){n.d(t,{H:function(){return r},g:function(){return i}});var r="3.11.2",i=function(){function e(){}return e.ZWSP="​",e.DROP_EDITOR="application/editor",e.MOBILE_WIDTH=520,e.CLASS_MENU_DISABLED="vditor-menu--disabled",e.EDIT_TOOLBARS=["emoji","headings","bold","italic","strike","link","list","ordered-list","outdent","indent","check","line","quote","code","inline-code","insert-after","insert-before","upload","record","table"],e.CODE_THEME=["a11y-dark","agate","an-old-hope","androidstudio","arta","atom-one-dark","atom-one-dark-reasonable","base16/3024","base16/apathy","base16/apprentice","base16/ashes","base16/atelier-cave","base16/atelier-dune","base16/atelier-estuary","base16/atelier-forest","base16/atelier-heath","base16/atelier-lakeside","base16/atelier-plateau","base16/atelier-savanna","base16/atelier-seaside","base16/atelier-sulphurpool","base16/atlas","base16/bespin","base16/black-metal","base16/black-metal-bathory","base16/black-metal-burzum","base16/black-metal-dark-funeral","base16/black-metal-gorgoroth","base16/black-metal-immortal","base16/black-metal-khold","base16/black-metal-marduk","base16/black-metal-mayhem","base16/black-metal-nile","base16/black-metal-venom","base16/brewer","base16/bright","base16/brogrammer","base16/brush-trees-dark","base16/chalk","base16/circus","base16/classic-dark","base16/codeschool","base16/colors","base16/danqing","base16/darcula","base16/dark-violet","base16/darkmoss","base16/darktooth","base16/decaf","base16/default-dark","base16/dracula","base16/edge-dark","base16/eighties","base16/embers","base16/equilibrium-dark","base16/equilibrium-gray-dark","base16/espresso","base16/eva","base16/eva-dim","base16/flat","base16/framer","base16/gigavolt","base16/google-dark","base16/grayscale-dark","base16/green-screen","base16/gruvbox-dark-hard","base16/gruvbox-dark-medium","base16/gruvbox-dark-pale","base16/gruvbox-dark-soft","base16/hardcore","base16/harmonic16-dark","base16/heetch-dark","base16/helios","base16/hopscotch","base16/horizon-dark","base16/humanoid-dark","base16/ia-dark","base16/icy-dark","base16/ir-black","base16/isotope","base16/kimber","base16/london-tube","base16/macintosh","base16/marrakesh","base16/materia","base16/material","base16/material-darker","base16/material-palenight","base16/material-vivid","base16/mellow-purple","base16/mocha","base16/monokai","base16/nebula","base16/nord","base16/nova","base16/ocean","base16/oceanicnext","base16/onedark","base16/outrun-dark","base16/papercolor-dark","base16/paraiso","base16/pasque","base16/phd","base16/pico","base16/pop","base16/porple","base16/qualia","base16/railscasts","base16/rebecca","base16/ros-pine","base16/ros-pine-moon","base16/sandcastle","base16/seti-ui","base16/silk-dark","base16/snazzy","base16/solar-flare","base16/solarized-dark","base16/spacemacs","base16/summercamp","base16/summerfruit-dark","base16/synth-midnight-terminal-dark","base16/tango","base16/tender","base16/tomorrow-night","base16/twilight","base16/unikitty-dark","base16/vulcan","base16/windows-10","base16/windows-95","base16/windows-high-contrast","base16/windows-nt","base16/woodland","base16/xcode-dusk","base16/zenburn","codepen-embed","dark","devibeans","far","felipec","github-dark","github-dark-dimmed","gml","gradient-dark","hybrid","ir-black","isbl-editor-dark","kimbie-dark","lioshi","monokai","monokai-sublime","night-owl","nnfx-dark","nord","obsidian","panda-syntax-dark","paraiso-dark","pojoaque","qtcreator-dark","rainbow","shades-of-purple","srcery","stackoverflow-dark","sunburst","tomorrow-night-blue","tomorrow-night-bright","tokyo-night-dark","vs2015","xt256","ant-design","a11y-light","arduino-light","ascetic","atom-one-light","base16/atelier-cave-light","base16/atelier-dune-light","base16/atelier-estuary-light","base16/atelier-forest-light","base16/atelier-heath-light","base16/atelier-lakeside-light","base16/atelier-plateau-light","base16/atelier-savanna-light","base16/atelier-seaside-light","base16/atelier-sulphurpool-light","base16/brush-trees","base16/classic-light","base16/cupcake","base16/cupertino","base16/default-light","base16/dirtysea","base16/edge-light","base16/equilibrium-gray-light","base16/equilibrium-light","base16/fruit-soda","base16/github","base16/google-light","base16/grayscale-light","base16/gruvbox-light-hard","base16/gruvbox-light-medium","base16/gruvbox-light-soft","base16/harmonic16-light","base16/heetch-light","base16/humanoid-light","base16/horizon-light","base16/ia-light","base16/material-lighter","base16/mexico-light","base16/one-light","base16/papercolor-light","base16/ros-pine-dawn","base16/sagelight","base16/shapeshifter","base16/silk-light","base16/solar-flare-light","base16/solarized-light","base16/summerfruit-light","base16/synth-midnight-terminal-light","base16/tomorrow","base16/unikitty-light","base16/windows-10-light","base16/windows-95-light","base16/windows-high-contrast-light","brown-paper","base16/windows-nt-light","color-brewer","docco","foundation","github","googlecode","gradient-light","grayscale","idea","intellij-light","isbl-editor-light","kimbie-light","lightfair","magula","mono-blue","nnfx-light","panda-syntax-light","paraiso-light","purebasic","qtcreator-light","routeros","school-book","stackoverflow-light","tokyo-night-light","vs","xcode","default"],e.ALIAS_CODE_LANGUAGES=["abc","plantuml","mermaid","flowchart","echarts","mindmap","graphviz","math","markmap","smiles","js","ts","html","toml","c#","bat"],e.CDN="https://unpkg.com/vditor@".concat("3.11.2"),e.MARKDOWN_OPTIONS={autoSpace:!1,gfmAutoLink:!0,codeBlockPreview:!0,fixTermTypo:!1,footnotes:!0,linkBase:"",linkPrefix:"",listStyle:!1,mark:!1,mathBlockPreview:!0,paragraphBeginningSpace:!1,sanitize:!0,toc:!1},e.HLJS_OPTIONS={enable:!0,lineNumber:!1,defaultLang:"",style:"github"},e.MATH_OPTIONS={engine:"KaTeX",inlineDigit:!1,macros:{}},e.THEME_OPTIONS={current:"light",list:{"ant-design":"Ant Design",dark:"Dark",light:"Light",wechat:"WeChat"},path:"".concat(e.CDN,"/dist/css/content-theme")},e}()},825:function(e,t,n){n.d(t,{J:function(){return a}});var r=n(145),i=n(413),o=n(840),u=n(494),a=function(e,t,n){void 0===e&&(e=document),void 0===t&&(t=r.g.CDN);var a=o.SMILESRenderAdapter.getElements(e);a.length>0&&(0,i.G)("".concat(t,"/dist/js/smiles-drawer/smiles-drawer.min.js?v=2.1.7"),"vditorAbcjsScript").then(function(){var e=new SmiDrawer({},{});a.forEach(function(t){var r=o.SMILESRenderAdapter.getCode(t).trim();if("true"!==t.getAttribute("data-processed")&&""!==r.trim()){var i="smiles"+(0,u.Wb)();t.innerHTML='<svg id="'.concat(i,'"></svg>'),e.draw(r,"#"+i,"dark"===n?"dark":void 0),t.setAttribute("data-processed","true")}})})}},135:function(e,t,n){n.d(t,{Q:function(){return u}});var r=n(145),i=n(413),o=n(840),u=function(e,t){void 0===e&&(e=document),void 0===t&&(t=r.g.CDN);var n=o.abcRenderAdapter.getElements(e);n.length>0&&(0,i.G)("".concat(t,"/dist/js/abcjs/abcjs_basic.min.js"),"vditorAbcjsScript").then(function(){n.forEach(function(e){e.parentElement.classList.contains("vditor-wysiwyg__pre")||e.parentElement.classList.contains("vditor-ir__marker--pre")||"true"!==e.getAttribute("data-processed")&&(ABCJS.renderAbc(e,o.abcRenderAdapter.getCode(e).trim()),e.style.overflowX="auto",e.setAttribute("data-processed","true"))})})}},840:function(e,t,n){n.r(t),n.d(t,{mathRenderAdapter:function(){return r},SMILESRenderAdapter:function(){return i},mermaidRenderAdapter:function(){return o},markmapRenderAdapter:function(){return u},mindmapRenderAdapter:function(){return a},chartRenderAdapter:function(){return l},abcRenderAdapter:function(){return s},graphvizRenderAdapter:function(){return c},flowchartRenderAdapter:function(){return d},plantumlRenderAdapter:function(){return p}});var r={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-math")}},i={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-smiles")}},o={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-mermaid")}},u={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-markmap")}},a={getCode:function(e){return e.getAttribute("data-code")},getElements:function(e){return e.querySelectorAll(".language-mindmap")}},l={getCode:function(e){return e.innerText},getElements:function(e){return e.querySelectorAll(".language-echarts")}},s={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-abc")}},c={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-graphviz")}},d={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-flowchart")}},p={getCode:function(e){return e.textContent},getElements:function(e){return e.querySelectorAll(".language-plantuml")}}},775:function(e,t,n){n.d(t,{p:function(){return s}});var r=n(145),i=n(413),o=n(840),u=n(494),a=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function u(e){try{l(r.next(e))}catch(je){o(je)}}function a(e){try{l(r.throw(e))}catch(je){o(je)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(u,a)}l((r=r.apply(e,t||[])).next())})},l=function(e,t){var n,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(u=0)),u;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,r=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){u=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){u.label=a[1];break}if(6===a[0]&&u.label<i[1]){u.label=i[1],i=a;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(a);break}i[2]&&u.ops.pop(),u.trys.pop();continue}a=t.call(e,u)}catch(je){a=[6,je],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}},s=function(e,t,n){void 0===e&&(e=document),void 0===t&&(t=r.g.CDN);var s=o.chartRenderAdapter.getElements(e);s.length>0&&(0,i.G)("".concat(t,"/dist/js/echarts/echarts.min.js?v=5.5.1"),"vditorEchartsScript").then(function(){s.forEach(function(e){return a(void 0,void 0,void 0,function(){var t,r,i;return l(this,function(a){switch(a.label){case 0:if(e.parentElement.classList.contains("vditor-wysiwyg__pre")||e.parentElement.classList.contains("vditor-ir__marker--pre"))return[2];if(!(t=o.chartRenderAdapter.getCode(e).trim()))return[2];a.label=1;case 1:return a.trys.push([1,3,,4]),"true"===e.getAttribute("data-processed")?[2]:[4,(0,u.Qf)(t)];case 2:return r=a.sent(),echarts.init(e,"dark"===n?"dark":void 0).setOption(r),e.setAttribute("data-processed","true"),[3,4];case 3:return i=a.sent(),e.className="vditor-reset--error",e.innerHTML="echarts render error: <br>".concat(i),[3,4];case 4:return[2]}})})})})}},428:function(e,t,n){n.d(t,{O:function(){return o}});var r=n(105),i=n(145),o=function(e,t){Array.from(e.querySelectorAll("pre > code")).filter(function(t,n){return!(t.parentElement.classList.contains("vditor-wysiwyg__pre")||t.parentElement.classList.contains("vditor-ir__marker--pre")||t.classList.contains("language-mermaid")||t.classList.contains("language-flowchart")||t.classList.contains("language-echarts")||t.classList.contains("language-mindmap")||t.classList.contains("language-plantuml")||t.classList.contains("language-markmap")||t.classList.contains("language-abc")||t.classList.contains("language-graphviz")||t.classList.contains("language-math")||t.classList.contains("language-smiles")||t.style.maxHeight.indexOf("px")>-1||e.classList.contains("vditor-preview")&&n>5)}).forEach(function(e){var n,o,u,a=e.innerText;if(e.classList.contains("highlight-chroma")){var l=e.cloneNode(!0);l.querySelectorAll(".highlight-ln").forEach(function(e){e.remove()}),a=l.innerText}else a.endsWith("\n")&&(a=a.substr(0,a.length-1));var s='<svg><use xlink:href="#vditor-icon-copy"></use></svg>';document.getElementById("vditorIconScript")||(s='<svg viewBox="0 0 32 32"><path d="M22.545-0h-17.455c-1.6 0-2.909 1.309-2.909 2.909v20.364h2.909v-20.364h17.455v-2.909zM26.909 5.818h-16c-1.6 0-2.909 1.309-2.909 2.909v20.364c0 1.6 1.309 2.909 2.909 2.909h16c1.6 0 2.909-1.309 2.909-2.909v-20.364c0-1.6-1.309-2.909-2.909-2.909zM26.909 29.091h-16v-20.364h16v20.364z"></path></svg>');var c=document.createElement("div");c.className="vditor-copy",c.innerHTML='<span aria-label="'.concat((null===(n=window.VditorI18n)||void 0===n?void 0:n.copy)||"复制","\"\nonmouseover=\"this.setAttribute('aria-label', '").concat((null===(o=window.VditorI18n)||void 0===o?void 0:o.copy)||"复制","')\"\nclass=\"vditor-tooltipped vditor-tooltipped__w\"\nonclick=\"event.stopPropagation();this.previousElementSibling.select();document.execCommand('copy');this.setAttribute('aria-label', '").concat((null===(u=window.VditorI18n)||void 0===u?void 0:u.copied)||"已复制","');this.previousElementSibling.blur()\">").concat(s,"</span>");var d=document.createElement("textarea");d.value=(0,r.X)(a),c.insertAdjacentElement("afterbegin",d),t&&t.renderMenu&&t.renderMenu(e,c),e.before(c),e.style.maxHeight=window.outerHeight-40+"px",e.insertAdjacentHTML("afterend",'<span style="position: absolute">'.concat(i.g.ZWSP,"</span>"))})}},325:function(e,t,n){n.d(t,{P:function(){return u}});var r=n(145),i=n(413),o=n(840),u=function(e,t){void 0===t&&(t=r.g.CDN);var n=o.flowchartRenderAdapter.getElements(e);0!==n.length&&(0,i.G)("".concat(t,"/dist/js/flowchart.js/flowchart.min.js"),"vditorFlowchartScript").then(function(){n.forEach(function(e){if("true"!==e.getAttribute("data-processed")){var t=flowchart.parse(o.flowchartRenderAdapter.getCode(e));e.innerHTML="",t.drawSVG(e),e.setAttribute("data-processed","true")}})})}},483:function(e,t,n){n.d(t,{v:function(){return u}});var r=n(145),i=n(413),o=n(840),u=function(e,t){void 0===t&&(t=r.g.CDN);var n=o.graphvizRenderAdapter.getElements(e);0!==n.length&&(0,i.G)("".concat(t,"/dist/js/graphviz/viz.js"),"vditorGraphVizScript").then(function(){n.forEach(function(e){var t=o.graphvizRenderAdapter.getCode(e);if(!e.parentElement.classList.contains("vditor-wysiwyg__pre")&&!e.parentElement.classList.contains("vditor-ir__marker--pre")&&"true"!==e.getAttribute("data-processed")&&""!==t.trim()){try{var n=new Blob(["importScripts('".concat(document.getElementById("vditorGraphVizScript").src.replace("viz.js","full.render.js"),"');")],{type:"application/javascript"}),r=(window.URL||window.webkitURL).createObjectURL(n),i=new Worker(r);new Viz({worker:i}).renderSVGElement(t).then(function(t){e.innerHTML=t.outerHTML}).catch(function(t){e.innerHTML="graphviz render error: <br>".concat(t),e.className="vditor-reset--error"})}catch(e){}e.setAttribute("data-processed","true")}})})}},999:function(e,t,n){n.d(t,{s:function(){return u}});var r=n(145),i=n(413),o=n(290),u=function(e,t,n){void 0===t&&(t=document),void 0===n&&(n=r.g.CDN);var u=e.style;r.g.CODE_THEME.includes(u)||(u="github");var a=document.getElementById("vditorHljsStyle"),l="".concat(n,"/dist/js/highlight.js/styles/").concat(u,".min.css");a&&a.getAttribute("href")!==l&&a.remove(),(0,o.c)("".concat(n,"/dist/js/highlight.js/styles/").concat(u,".min.css"),"vditorHljsStyle"),!1!==e.enable&&0!==t.querySelectorAll("pre > code").length&&(0,i.G)("".concat(n,"/dist/js/highlight.js/highlight.min.js?v=11.7.0"),"vditorHljsScript").then(function(){(0,i.G)("".concat(n,"/dist/js/highlight.js/third-languages.js?v=1.0.1"),"vditorHljsThirdScript").then(function(){t.querySelectorAll("pre > code").forEach(function(t){if(!t.parentElement.classList.contains("vditor-ir__marker--pre")&&!t.parentElement.classList.contains("vditor-wysiwyg__pre")&&!(t.classList.contains("language-mermaid")||t.classList.contains("language-flowchart")||t.classList.contains("language-echarts")||t.classList.contains("language-mindmap")||t.classList.contains("language-plantuml")||t.classList.contains("language-smiles")||t.classList.contains("language-abc")||t.classList.contains("language-graphviz")||t.classList.contains("language-math"))){""!==e.defaultLang&&-1===t.className.indexOf("language-")&&t.classList.add("language-"+e.defaultLang);var n=t.className.replace("language-","");if(window.hljs.getLanguage(n)||(n="plaintext"),t.innerHTML=window.hljs.highlight(t.textContent,{language:n,ignoreIllegals:!0}).value,t.classList.add("hljs"),e.lineNumber){t.classList.add("vditor-linenumber");var r=t.querySelector(".vditor-linenumber__temp");r||((r=document.createElement("div")).className="vditor-linenumber__temp",t.insertAdjacentElement("beforeend",r));var i=getComputedStyle(t).whiteSpace,o=!1;"pre-wrap"!==i&&"pre-line"!==i||(o=!0);var u="",a=t.textContent.split(/\r\n|\r|\n/g);a.pop(),a.map(function(e){var t="";o&&(r.textContent=e||"\n",t=' style="height:'.concat(r.getBoundingClientRect().height,'px"')),u+="<span".concat(t,"></span>")}),r.style.display="none",u='<span class="vditor-linenumber__rows">'.concat(u,"</span>"),t.insertAdjacentHTML("beforeend",u)}}})})})}},11:function(e,t,n){n.d(t,{K:function(){return l}});var r=n(145),i=n(413),o=n(840),u={},a=function(e,t){var n=window.markmap,r=n.Transformer,i=n.Markmap,o=n.deriveOptions;n.globalCSS;var a=new r;e.innerHTML='<svg style="width:100%"></svg>';var l=e.firstChild,s=i.create(l,null),c=function(e,t){var n=e.transform(t),r=Object.keys(n.features).filter(function(e){return!u[e]});r.forEach(function(e){u[e]=!0});var i=e.getAssets(r),o=i.styles,a=i.scripts,l=window.markmap;return o&&l.loadCSS(o),a&&l.loadJS(a),n}(a,t),d=c.root,p=c.frontmatter,f=o(null==p?void 0:p.markmap);s.setData(d,f),s.fit()},l=function(e,t){void 0===e&&(e=document),void 0===t&&(t=r.g.CDN);var n=o.markmapRenderAdapter.getElements(e);0!==n.length&&(0,i.G)("".concat(t,"/dist/js/markmap/markmap.min.js"),"vditorMarkerScript").then(function(){n.forEach(function(e){var t=o.markmapRenderAdapter.getCode(e);if("true"!==e.getAttribute("data-processed")&&""!==t.trim()){var n=document.createElement("div");n.className="language-markmap",e.parentNode.appendChild(n),a(n,t),"CODE"==e.parentNode.childNodes[0].nodeName&&e.parentNode.removeChild(e.parentNode.childNodes[0])}})})}},472:function(e,t,n){n.d(t,{H:function(){return l}});var r=n(145),i=n(413),o=n(290),u=n(105),a=n(840),l=function(e,t){void 0===e&&(e=document);var n=a.mathRenderAdapter.getElements(e);if(0!==n.length){var l={cdn:r.g.CDN,math:{engine:"KaTeX",inlineDigit:!1,macros:{}}};if(t&&t.math&&(t.math=Object.assign({},l.math,t.math)),"KaTeX"===(t=Object.assign({},l,t)).math.engine)(0,o.c)("".concat(t.cdn,"/dist/js/katex/katex.min.css?v=0.16.9"),"vditorKatexStyle"),(0,i.G)("".concat(t.cdn,"/dist/js/katex/katex.min.js?v=0.16.9"),"vditorKatexScript").then(function(){(0,i.G)("".concat(t.cdn,"/dist/js/katex/mhchem.min.js?v=0.16.9"),"vditorKatexChemScript").then(function(){n.forEach(function(e){if(!e.parentElement.classList.contains("vditor-wysiwyg__pre")&&!e.parentElement.classList.contains("vditor-ir__marker--pre")&&!e.getAttribute("data-math")){var n=(0,u.X)(a.mathRenderAdapter.getCode(e));e.setAttribute("data-math",n);try{e.innerHTML=katex.renderToString(n,{displayMode:"DIV"===e.tagName,output:"html",macros:t.math.macros})}catch(je){e.innerHTML=je.message,e.className="language-math vditor-reset--error"}e.addEventListener("copy",function(e){e.stopPropagation(),e.preventDefault();var t=e.currentTarget.closest(".language-math");e.clipboardData.setData("text/html",t.innerHTML),e.clipboardData.setData("text/plain",t.getAttribute("data-math"))})}})})});else if("MathJax"===t.math.engine){window.MathJax||(window.MathJax={loader:{paths:{mathjax:"".concat(t.cdn,"/dist/js/mathjax")}},startup:{typeset:!1},tex:{macros:t.math.macros}},Object.assign(window.MathJax,t.math.mathJaxOptions)),(0,i.J)("".concat(t.cdn,"/dist/js/mathjax/tex-svg-full.js"),"protyleMathJaxScript");var s=function(e,t){var n=(0,u.X)(e.textContent).trim(),r=window.MathJax.getMetricsFor(e);r.display="DIV"===e.tagName,window.MathJax.tex2svgPromise(n,r).then(function(r){e.innerHTML="",e.setAttribute("data-math",n),e.append(r),window.MathJax.startup.document.clear(),window.MathJax.startup.document.updateDocument();var i=r.querySelector('[data-mml-node="merror"]');i&&""!==i.textContent.trim()&&(e.innerHTML=i.textContent.trim(),e.className="vditor-reset--error"),t&&t()})};window.MathJax.startup.promise.then(function(){for(var e=[],t=function(t){var r=n[t];r.parentElement.classList.contains("vditor-wysiwyg__pre")||r.parentElement.classList.contains("vditor-ir__marker--pre")||r.getAttribute("data-math")||!(0,u.X)(r.textContent).trim()||e.push(function(e){t===n.length-1?s(r):s(r,e)})},r=0;r<n.length;r++)t(r);!function(e){if(0!==e.length){var t=0,n=e[e.length-1],r=function(){var i=e[t++];i===n?i():i(r)};r()}}(e)})}}}},280:function(e,t,n){n.d(t,{Y:function(){return i}});var r=n(494),i=function(e){e&&e.querySelectorAll("a").forEach(function(e){var t=e.getAttribute("href");t&&(t.match(/^.+.(mp4|m4v|ogg|ogv|webm)$/)?function(e,t){e.insertAdjacentHTML("afterend",'<video controls="controls" src="'.concat(t,'"></video>')),e.remove()}(e,t):t.match(/^.+.(mp3|wav|flac)$/)?function(e,t){e.insertAdjacentHTML("afterend",'<audio controls="controls" src="'.concat(t,'"></audio>')),e.remove()}(e,t):function(e,t){var n=t.match(/\/\/(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))([\w|-]{11})(?:(?:[\?&]t=)(\S+))?/),i=t.match(/\/\/v\.youku\.com\/v_show\/id_(\w+)=*\.html/),o=t.match(/\/\/v\.qq\.com\/x\/cover\/.*\/([^\/]+)\.html\??.*/),u=t.match(/(?:www\.|\/\/)coub\.com\/view\/(\w+)/),a=t.match(/(?:www\.|\/\/)facebook\.com\/([^\/]+)\/videos\/([0-9]+)/),l=t.match(/.+dailymotion.com\/(video|hub)\/(\w+)\?/),s=t.match(/(?:www\.|\/\/)bilibili\.com\/video\/(\w+)/),c=t.match(/(?:www\.|\/\/)ted\.com\/talks\/(\w+)/);if(n&&11===n[1].length)e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//www.youtube.com/embed/'.concat(n[1]+(n[2]?"?start="+n[2]:""),'"></iframe>')),e.remove();else if(i&&i[1])e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//player.youku.com/embed/'.concat(i[1],'"></iframe>')),e.remove();else if(o&&o[1])e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="https://v.qq.com/txp/iframe/player.html?vid='.concat(o[1],'"></iframe>')),e.remove();else if(u&&u[1])e.insertAdjacentHTML("afterend",'<iframe class="iframe__video"\n src="//coub.com/embed/'.concat(u[1],'?muted=false&autostart=false&originalSize=true&startWithHD=true"></iframe>')),e.remove();else if(a&&a[0])e.insertAdjacentHTML("afterend",'<iframe class="iframe__video"\n src="https://www.facebook.com/plugins/video.php?href='.concat(encodeURIComponent(a[0]),'"></iframe>')),e.remove();else if(l&&l[2])e.insertAdjacentHTML("afterend",'<iframe class="iframe__video"\n src="https://www.dailymotion.com/embed/video/'.concat(l[2],'"></iframe>')),e.remove();else if(t.indexOf("bilibili.com")>-1&&(t.indexOf("bvid=")>-1||s&&s[1])){var d={bvid:(0,r.on)("bvid",t)||s&&s[1],page:"1",high_quality:"1",as_wide:"1",allowfullscreen:"true",autoplay:"0"};new URL(t.startsWith("http")?t:"https:"+t).search.split("&").forEach(function(e,t){if(e){0===t&&(e=e.substr(1));var n=e.split("=");d[n[0]]=n[1]}});var p="https://player.bilibili.com/player.html?",f=Object.keys(d);f.forEach(function(e,t){p+="".concat(e,"=").concat(d[e]),t<f.length-1&&(p+="&")}),e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="'.concat(p,'"></iframe>')),e.remove()}else c&&c[1]&&(e.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//embed.ted.com/talks/'.concat(c[1],'"></iframe>')),e.remove())}(e,t))})}},637:function(e,t,n){n.d(t,{i:function(){return s}});var r=n(145),i=n(413),o=n(840),u=n(494),a=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function u(e){try{l(r.next(e))}catch(je){o(je)}}function a(e){try{l(r.throw(e))}catch(je){o(je)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(u,a)}l((r=r.apply(e,t||[])).next())})},l=function(e,t){var n,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(u=0)),u;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,r=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){u=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){u.label=a[1];break}if(6===a[0]&&u.label<i[1]){u.label=i[1],i=a;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(a);break}i[2]&&u.ops.pop(),u.trys.pop();continue}a=t.call(e,u)}catch(je){a=[6,je],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}},s=function(e,t,n){void 0===e&&(e=document),void 0===t&&(t=r.g.CDN);var s=o.mermaidRenderAdapter.getElements(e);0!==s.length&&(0,i.G)("".concat(t,"/dist/js/mermaid/mermaid.min.js?v=11.6.0"),"vditorMermaidScript").then(function(){var e={securityLevel:"loose",altFontFamily:"sans-serif",fontFamily:"sans-serif",startOnLoad:!1,flowchart:{htmlLabels:!0,useMaxWidth:!0},sequence:{useMaxWidth:!0,diagramMarginX:8,diagramMarginY:8,boxMargin:8,showSequenceNumbers:!0},gantt:{leftPadding:75,rightPadding:20}};"dark"===n&&(e.theme="dark"),mermaid.initialize(e),s.forEach(function(e){return a(void 0,void 0,void 0,function(){var t,n,r,i,a;return l(this,function(l){switch(l.label){case 0:if(t=o.mermaidRenderAdapter.getCode(e),"true"===e.getAttribute("data-processed")||""===t.trim())return[2];n="mermaid"+(0,u.Wb)(),l.label=1;case 1:return l.trys.push([1,3,,4]),[4,mermaid.render(n,e.textContent)];case 2:return r=l.sent(),e.innerHTML=r.svg,[3,4];case 3:return i=l.sent(),a=document.querySelector("#"+n),e.innerHTML="".concat(a.outerHTML,'<br>\n<div style="text-align: left"><small>').concat(i.message.replace(/\n/,"<br>"),"</small></div>"),a.parentElement.remove(),[3,4];case 4:return e.setAttribute("data-processed","true"),[2]}})})})})}},194:function(e,t,n){n.d(t,{P:function(){return u}});var r=n(145),i=n(413),o=n(840),u=function(e,t,n){void 0===e&&(e=document),void 0===t&&(t=r.g.CDN);var u=o.mindmapRenderAdapter.getElements(e);u.length>0&&(0,i.G)("".concat(t,"/dist/js/echarts/echarts.min.js?v=5.5.1"),"vditorEchartsScript").then(function(){u.forEach(function(e){if(!e.parentElement.classList.contains("vditor-wysiwyg__pre")&&!e.parentElement.classList.contains("vditor-ir__marker--pre")){var t=o.mindmapRenderAdapter.getCode(e);if(t)try{if("true"===e.getAttribute("data-processed"))return;echarts.init(e,"dark"===n?"dark":void 0).setOption({series:[{data:[JSON.parse(decodeURIComponent(t))],initialTreeDepth:-1,itemStyle:{borderWidth:0,color:"#4285f4"},label:{backgroundColor:"#f6f8fa",borderColor:"#d1d5da",borderRadius:5,borderWidth:.5,color:"#586069",lineHeight:20,offset:[-5,0],padding:[0,5],position:"insideRight"},lineStyle:{color:"#d1d5da",width:1},roam:!0,symbol:function(e,t){var n;return(null===(n=null==t?void 0:t.data)||void 0===n?void 0:n.children)?"circle":"path://"},type:"tree"}],tooltip:{trigger:"item",triggerOn:"mousemove"}}),e.setAttribute("data-processed","true")}catch(r){e.className="vditor-reset--error",e.innerHTML="mindmap render error: <br>".concat(r)}}})})}},436:function(e,t,n){n.d(t,{k:function(){return o}});var r=n(771),i=n(472),o=function(e,t,n){var o="",u=[];if(Array.from(e.children).forEach(function(e,t){if((0,r.W)(e)){if(n){var i=e.id.lastIndexOf("_");e.id=e.id.substring(0,-1===i?void 0:i)+"_"+t}u.push(e.id),o+=e.outerHTML.replace("<wbr>","")}}),""===o)return t.innerHTML="","";var a=document.createElement("div");if(n)n.lute.SetToC(!0),"wysiwyg"!==n.currentMode||n.preview.element.contains(e)?"ir"!==n.currentMode||n.preview.element.contains(e)?a.innerHTML=n.lute.HTML2VditorDOM("<p>[ToC]</p>"+o):a.innerHTML=n.lute.SpinVditorIRDOM("<p>[ToC]</p>"+o):a.innerHTML=n.lute.SpinVditorDOM("<p>[ToC]</p>"+o),n.lute.SetToC(n.options.preview.markdown.toc);else{t.classList.add("vditor-outline");var l=Lute.New();l.SetToC(!0),a.innerHTML=l.HTML2VditorDOM("<p>[ToC]</p>"+o)}var s=a.firstElementChild.querySelectorAll("li > span[data-target-id]");return s.forEach(function(e,t){if(e.nextElementSibling&&"UL"===e.nextElementSibling.tagName){var n="<svg class='vditor-outline__action'><use xlink:href='#vditor-icon-down'></use></svg>";document.getElementById("vditorIconScript")||(n='<svg class="vditor-outline__action" viewBox="0 0 32 32"><path d="M3.76 6.12l12.24 12.213 12.24-12.213 3.76 3.76-16 16-16-16 3.76-3.76z"></path></svg>'),e.innerHTML="".concat(n,"<span>").concat(e.innerHTML,"</span>")}else e.innerHTML="<svg></svg><span>".concat(e.innerHTML,"</span>");e.setAttribute("data-target-id",u[t])}),o=a.firstElementChild.innerHTML,0===s.length?(t.innerHTML="",o):(t.innerHTML=o,n&&(0,i.H)(t,{cdn:n.options.cdn,math:n.options.preview.math}),t.firstElementChild.addEventListener("click",function(r){for(var i=r.target;i&&!i.isEqualNode(t);){if(i.classList.contains("vditor-outline__action")){i.classList.contains("vditor-outline__action--close")?(i.classList.remove("vditor-outline__action--close"),i.parentElement.nextElementSibling.setAttribute("style","display:block")):(i.classList.add("vditor-outline__action--close"),i.parentElement.nextElementSibling.setAttribute("style","display:none")),r.preventDefault(),r.stopPropagation();break}if(i.getAttribute("data-target-id")){r.preventDefault(),r.stopPropagation();var o=document.getElementById(i.getAttribute("data-target-id"));if(!o)return;if(n)if("auto"===n.options.height){var u=o.offsetTop+n.element.offsetTop;n.options.toolbarConfig.pin||(u+=n.toolbar.element.offsetHeight),window.scrollTo(window.scrollX,u)}else n.element.offsetTop<window.scrollY&&window.scrollTo(window.scrollX,n.element.offsetTop),n.preview.element.contains(e)?e.parentElement.scrollTop=o.offsetTop:e.scrollTop=o.offsetTop;else window.scrollTo(window.scrollX,o.offsetTop);break}i=i.parentElement}}),o)}},229:function(e,t,n){n.d(t,{B:function(){return u}});var r=n(145),i=n(413),o=n(840),u=function(e,t){void 0===e&&(e=document),void 0===t&&(t=r.g.CDN);var n=o.plantumlRenderAdapter.getElements(e);0!==n.length&&(0,i.G)("".concat(t,"/dist/js/plantuml/plantuml-encoder.min.js"),"vditorPlantumlScript").then(function(){n.forEach(function(e){if(!e.parentElement.classList.contains("vditor-wysiwyg__pre")&&!e.parentElement.classList.contains("vditor-ir__marker--pre")){var t=o.plantumlRenderAdapter.getCode(e).trim();if(t)try{e.innerHTML='<object type="image/svg+xml" data="https://www.plantuml.com/plantuml/svg/~1'.concat(plantumlEncoder.encode(t),'"/>')}catch(n){e.className="vditor-reset--error",e.innerHTML="plantuml render error: <br>".concat(n)}}})})}},214:function(e,t,n){n.d(t,{X:function(){return r}});var r=function(e){var t=Lute.New();return t.PutEmojis(e.emojis),t.SetEmojiSite(e.emojiSite),t.SetHeadingAnchor(e.headingAnchor),t.SetInlineMathAllowDigitAfterOpenMarker(e.inlineMathDigit),t.SetAutoSpace(e.autoSpace),t.SetToC(e.toc),t.SetFootnotes(e.footnotes),t.SetFixTermTypo(e.fixTermTypo),t.SetVditorCodeBlockPreview(e.codeBlockPreview),t.SetVditorMathBlockPreview(e.mathBlockPreview),t.SetSanitize(e.sanitize),t.SetChineseParagraphBeginningSpace(e.paragraphBeginningSpace),t.SetRenderListStyle(e.listStyle),t.SetLinkBase(e.linkBase),t.SetLinkPrefix(e.linkPrefix),t.SetMark(e.mark),t.SetGFMAutoLink(e.gfmAutoLink),e.lazyLoadImage&&t.SetImageLazyLoading(e.lazyLoadImage),t}},190:function(e,t,n){n.d(t,{E:function(){return r}});var r=function(e,t,n){void 0===n&&(n="classic");var r=e.getBoundingClientRect();document.body.insertAdjacentHTML("beforeend",'<div class="vditor vditor-img'.concat("dark"===n?" vditor--dark":"",'">\n <div class="vditor-img__bar">\n <span class="vditor-img__btn" data-deg="0">\n <svg><use xlink:href="#vditor-icon-redo"></use></svg>\n ').concat(window.VditorI18n.spin,"\n </span>\n <span class=\"vditor-img__btn\" onclick=\"this.parentElement.parentElement.outerHTML = '';document.body.style.overflow = ''\">\n X &nbsp;").concat(window.VditorI18n.close,'\n </span>\n </div>\n <div class="vditor-img__img" onclick="this.parentElement.outerHTML = \'\';document.body.style.overflow = \'\'">\n <img style="width: ').concat(e.width,"px;height:").concat(e.height,"px;transform: translate3d(").concat(r.left,"px, ").concat(r.top-36,'px, 0)" src="').concat(e.getAttribute("src"),'">\n </div>\n</div>')),document.body.style.overflow="hidden";var i=document.querySelector(".vditor-img img"),o="translate3d(".concat(Math.max(0,window.innerWidth-e.naturalWidth)/2,"px, ").concat(Math.max(0,window.innerHeight-36-e.naturalHeight)/2,"px, 0)");setTimeout(function(){i.setAttribute("style","transition: transform .3s ease-in-out;transform: ".concat(o)),setTimeout(function(){i.parentElement.scrollTo((i.parentElement.scrollWidth-i.parentElement.clientWidth)/2,(i.parentElement.scrollHeight-i.parentElement.clientHeight)/2)},400)});var u=document.querySelector(".vditor-img__btn");u.addEventListener("click",function(){var t=parseInt(u.getAttribute("data-deg"),10)+90;t/90%2==1&&e.naturalWidth>i.parentElement.clientHeight?i.style.transform="translate3d(".concat(Math.max(0,window.innerWidth-e.naturalWidth)/2,"px, ").concat(e.naturalWidth/2-e.naturalHeight/2,"px, 0) rotateZ(").concat(t,"deg)"):i.style.transform="".concat(o," rotateZ(").concat(t,"deg)"),u.setAttribute("data-deg",t.toString()),setTimeout(function(){i.parentElement.scrollTo((i.parentElement.scrollWidth-i.parentElement.clientWidth)/2,(i.parentElement.scrollHeight-i.parentElement.clientHeight)/2)},400)})}},580:function(e,t,n){n.d(t,{Y:function(){return o}});var r=n(145),i=n(290),o=function(e,t){void 0===t&&(t=r.g.CDN),r.g.CODE_THEME.includes(e)||(e="github");var n=document.getElementById("vditorHljsStyle"),o="".concat(t,"/dist/js/highlight.js/styles/").concat(e,".min.css");n?n.getAttribute("href")!==o&&(n.remove(),(0,i.c)(o,"vditorHljsStyle")):(0,i.c)(o,"vditorHljsStyle")}},538:function(e,t,n){n.d(t,{Z:function(){return i}});var r=n(290),i=function(e,t){if(e&&t){var n=document.getElementById("vditorContentTheme"),i="".concat(t,"/").concat(e,".css");n?n.getAttribute("href")!==i&&(n.remove(),(0,r.c)(i,"vditorContentTheme")):(0,r.c)(i,"vditorContentTheme")}}},413:function(e,t,n){n.d(t,{J:function(){return r},G:function(){return i}});var r=function(e,t){if(document.getElementById(t))return!1;var n=new XMLHttpRequest;n.open("GET",e,!1),n.setRequestHeader("Accept","text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01"),n.send("");var r=document.createElement("script");r.type="text/javascript",r.text=n.responseText,r.id=t,document.head.appendChild(r)},i=function(e,t){return new Promise(function(n,r){if(document.getElementById(t))return n(!0),!1;var i=document.createElement("script");i.src=e,i.async=!0,document.head.appendChild(i),i.onerror=function(e){r(e)},i.onload=function(){if(document.getElementById(t))return i.remove(),n(!0),!1;i.id=t,n(!0)}})}},290:function(e,t,n){n.d(t,{c:function(){return r}});var r=function(e,t){if(!document.getElementById(t)){var n=document.createElement("link");n.id=t,n.rel="stylesheet",n.type="text/css",n.href=e,document.getElementsByTagName("head")[0].appendChild(n)}}},105:function(e,t,n){n.d(t,{X:function(){return r}});var r=function(e){return e.replace(/\u00a0/g," ")}},410:function(e,t,n){n.d(t,{G6:function(){return r},vU:function(){return i},pK:function(){return o},Le:function(){return u},yl:function(){return a},ns:function(){return l},i7:function(){return s}});var r=function(){return navigator.userAgent.indexOf("Safari")>-1&&-1===navigator.userAgent.indexOf("Chrome")},i=function(){return navigator.userAgent.toLowerCase().indexOf("firefox")>-1},o=function(){try{return"undefined"!=typeof localStorage}catch(je){return!1}},u=function(){return navigator.userAgent.indexOf("iPhone")>-1?"touchstart":"click"},a=function(e){return navigator.platform.toUpperCase().indexOf("MAC")>=0?!(!e.metaKey||e.ctrlKey):!(e.metaKey||!e.ctrlKey)},l=function(e){return/Mac/.test(navigator.platform)||"iPhone"===navigator.platform?e.indexOf("⇧")>-1&&i()&&(e=e.replace(";",":").replace("=","+").replace("-","_")):(e=(e=e.startsWith("⌘")?e.replace("⌘","⌘+"):e.startsWith("⌥")&&"⌘"!==e.substr(1,1)?e.replace("⌥","⌥+"):e.replace("⇧⌘","⌘+⇧+").replace("⌥⌘","⌥+⌘+")).replace("⌘","Ctrl").replace("⇧","Shift").replace("⌥","Alt")).indexOf("Shift")>-1&&(e=e.replace(";",":").replace("=","+").replace("-","_")),e},s=function(){return/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}},494:function(e,t,n){n.d(t,{Wb:function(){return r},on:function(){return i},Qf:function(){return o}});var r=function(){return([1e7].toString()+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,function(e){return(parseInt(e,10)^window.crypto.getRandomValues(new Uint32Array(1))[0]&15>>parseInt(e,10)/4).toString(16)})},i=function(e,t){void 0===t&&(t=window.location.search);var n=t.substring(t.indexOf("?")),r=n.indexOf("#");return new URLSearchParams(n.substring(0,r>=0?r:void 0)).get(e)},o=function(e){return Function('"use strict";return ('.concat(e,")"))()}},106:function(e,t,n){n.d(t,{JQ:function(){return i},E2:function(){return o},O9:function(){return u},a1:function(){return a},F9:function(){return l},lG:function(){return s},fb:function(){return c},DX:function(){return d}});var r=n(771),i=function(e,t){for(var n=c(e,t),r=!1,i=!1;n&&!n.classList.contains("vditor-reset")&&!i;)(r=c(n.parentElement,t))?n=r:i=!0;return n||!1},o=function(e,t){for(var n=(0,r.S)(e,t),i=!1,o=!1;n&&!n.classList.contains("vditor-reset")&&!o;)(i=(0,r.S)(n.parentElement,t))?n=i:o=!0;return n||!1},u=function(e){var t=o(e,"UL"),n=o(e,"OL"),r=t;return n&&(!t||t&&n.contains(t))&&(r=n),r},a=function(e,t,n){if(!e)return!1;3===e.nodeType&&(e=e.parentElement);for(var r=e,i=!1;r&&!i&&!r.classList.contains("vditor-reset");)r.getAttribute(t)===n?i=!0:r=r.parentElement;return i&&r},l=function(e){if(!e)return!1;3===e.nodeType&&(e=e.parentElement);var t=e,n=!1,r=a(e,"data-block","0");if(r)return r;for(;t&&!n&&!t.classList.contains("vditor-reset");)"H1"===t.tagName||"H2"===t.tagName||"H3"===t.tagName||"H4"===t.tagName||"H5"===t.tagName||"H6"===t.tagName||"P"===t.tagName||"BLOCKQUOTE"===t.tagName||"OL"===t.tagName||"UL"===t.tagName?n=!0:t=t.parentElement;return n&&t},s=function(e,t){if(!e)return!1;3===e.nodeType&&(e=e.parentElement);for(var n=e,r=!1;n&&!r&&!n.classList.contains("vditor-reset");)n.nodeName===t?r=!0:n=n.parentElement;return r&&n},c=function(e,t){if(!e)return!1;3===e.nodeType&&(e=e.parentElement);for(var n=e,r=!1;n&&!r&&!n.classList.contains("vditor-reset");)n.classList.contains(t)?r=!0:n=n.parentElement;return r&&n},d=function(e){for(;e&&e.lastChild;)e=e.lastChild;return e}},771:function(e,t,n){n.d(t,{S:function(){return r},W:function(){return i}});var r=function(e,t){if(!e)return!1;3===e.nodeType&&(e=e.parentElement);for(var n=e,r=!1;n&&!r&&!n.classList.contains("vditor-reset");)0===n.nodeName.indexOf(t)?r=!0:n=n.parentElement;return r&&n},i=function(e){var t=r(e,"H");return!(!t||2!==t.tagName.length||"HR"===t.tagName)&&t}},673:function(e,t,n){n.d(t,{T:function(){return r}});var r=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n={},i=function(e){for(var t in e)e.hasOwnProperty(t)&&("[object Object]"===Object.prototype.toString.call(e[t])?n[t]=r(n[t],e[t]):n[t]=e[t])},o=0;o<e.length;o++)i(e[o]);return n}},810:function(e,t,n){n.d(t,{zh:function(){return u},Ny:function(){return a},Gb:function(){return l},Hc:function(){return s},im:function(){return c},$j:function(){return d},ib:function(){return p},oC:function(){return f}});var r=n(145),i=n(410),o=n(106),u=function(e){var t,n=e[e.currentMode].element;return getSelection().rangeCount>0&&(t=getSelection().getRangeAt(0),n.isEqualNode(t.startContainer)||n.contains(t.startContainer))?t:e[e.currentMode].range?e[e.currentMode].range:(n.focus(),(t=n.ownerDocument.createRange()).setStart(n,0),t.collapse(!0),t)},a=function(e){var t=window.getSelection().getRangeAt(0);if(!e.contains(t.startContainer)&&!(0,o.fb)(t.startContainer,"vditor-panel--none"))return{left:0,top:0};var n,r=e.parentElement.getBoundingClientRect();if(0===t.getClientRects().length)if(3===t.startContainer.nodeType){var i=t.startContainer.parentElement;if(!(i&&i.getClientRects().length>0))return{left:0,top:0};n=i.getClientRects()[0]}else{var u=t.startContainer.children;if(u[t.startOffset]&&u[t.startOffset].getClientRects().length>0)n=u[t.startOffset].getClientRects()[0];else if(t.startContainer.childNodes.length>0){var a=t.cloneRange();t.selectNode(t.startContainer.childNodes[Math.max(0,t.startOffset-1)]),n=t.getClientRects()[0],t.setEnd(a.endContainer,a.endOffset),t.setStart(a.startContainer,a.startOffset)}else n=t.startContainer.getClientRects()[0];if(!n){for(var l=t.startContainer.childNodes[t.startOffset];!l.getClientRects||l.getClientRects&&0===l.getClientRects().length;)l=l.parentElement;n=l.getClientRects()[0]}}else n=t.getClientRects()[0];return{left:n.left-r.left,top:n.top-r.top}},l=function(e,t){if(!t){if(0===getSelection().rangeCount)return!1;t=getSelection().getRangeAt(0)}var n=t.commonAncestorContainer;return e.isEqualNode(n)||e.contains(n)},s=function(e){var t=window.getSelection();t.removeAllRanges(),t.addRange(e)},c=function(e,t,n){var r={end:0,start:0};if(!n){if(0===getSelection().rangeCount)return r;n=window.getSelection().getRangeAt(0)}if(l(t,n)){var i=n.cloneRange();e.childNodes[0]&&e.childNodes[0].childNodes[0]?i.setStart(e.childNodes[0].childNodes[0],0):i.selectNodeContents(e),i.setEnd(n.startContainer,n.startOffset),r.start=i.toString().length,r.end=r.start+n.toString().length}return r},d=function(e,t,n){var r=0,i=0,o=n.childNodes[i],u=!1,a=!1;e=Math.max(0,e),t=Math.max(0,t);var l=n.ownerDocument.createRange();for(l.setStart(o||n,0),l.collapse(!0);!a&&o;){var c=r+o.textContent.length;if(!u&&e>=r&&e<=c&&(0===e?l.setStart(o,0):3===o.childNodes[0].nodeType?l.setStart(o.childNodes[0],e-r):o.nextSibling?l.setStartBefore(o.nextSibling):l.setStartAfter(o),u=!0,e===t)){a=!0;break}u&&t>=r&&t<=c&&(0===t?l.setEnd(o,0):3===o.childNodes[0].nodeType?l.setEnd(o.childNodes[0],t-r):o.nextSibling?l.setEndBefore(o.nextSibling):l.setEndAfter(o),a=!0),r=c,o=n.childNodes[++i]}return!a&&n.childNodes[i-1]&&l.setStartBefore(n.childNodes[i-1]),s(l),l},p=function(e,t){var n=e.querySelector("wbr");if(n){if(n.previousElementSibling)if(n.previousElementSibling.isSameNode(n.previousSibling)){if(n.previousElementSibling.lastChild)return t.setStartBefore(n),t.collapse(!0),s(t),!(0,i.i7)()||"EM"!==n.previousElementSibling.tagName&&"STRONG"!==n.previousElementSibling.tagName&&"S"!==n.previousElementSibling.tagName||(t.insertNode(document.createTextNode(r.g.ZWSP)),t.collapse(!1)),void n.remove();t.setStartAfter(n.previousElementSibling)}else t.setStart(n.previousSibling,n.previousSibling.textContent.length);else n.previousSibling?t.setStart(n.previousSibling,n.previousSibling.textContent.length):n.nextSibling?3===n.nextSibling.nodeType?t.setStart(n.nextSibling,0):t.setStartBefore(n.nextSibling):t.setStart(n.parentElement,0);t.collapse(!0),n.remove(),s(t)}},f=function(e,t){var n=document.createElement("div");n.innerHTML=e;var r=n.querySelectorAll("p");1===r.length&&!r[0].previousSibling&&!r[0].nextSibling&&t[t.currentMode].element.children.length>0&&"P"===n.firstElementChild.tagName&&(e=r[0].innerHTML.trim());var i=document.createElement("div");i.innerHTML=e;var a=u(t);if(""!==a.toString()&&(t[t.currentMode].preventInput=!0,document.execCommand("delete",!1,"")),i.firstElementChild&&"0"===i.firstElementChild.getAttribute("data-block")){i.lastElementChild.insertAdjacentHTML("beforeend","<wbr>");var l=(0,o.F9)(a.startContainer);if(l){var c=(0,o.lG)(a.startContainer,"LI");c&&"UL"===i.firstElementChild.tagName?c.insertAdjacentHTML("afterend",i.firstElementChild.innerHTML):l.insertAdjacentHTML("afterend",i.innerHTML)}else t[t.currentMode].element.insertAdjacentHTML("beforeend",i.innerHTML);p(t[t.currentMode].element,a)}else{var d=document.createElement("template");d.innerHTML=e,a.insertNode(d.content.cloneNode(!0)),a.collapse(!1),s(a)}}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return function(){n.d(r,{default:function(){return Er}});var e,t=n(408),i=n(145),o=n(105),u=function(e){return"sv"===e.currentMode?(0,o.X)("".concat(e.sv.element.textContent,"\n").replace(/\n\n$/,"\n")):"wysiwyg"===e.currentMode?e.lute.VditorDOM2Md(e.wysiwyg.element.innerHTML):"ir"===e.currentMode?e.lute.VditorIRDOM2Md(e.ir.element.innerHTML):""},a=n(413),l=function(){function e(){this.element=document.createElement("div"),this.element.className="vditor-devtools",this.element.innerHTML='<div class="vditor-reset--error"></div><div style="height: 100%;"></div>'}return e.prototype.renderEchart=function(e){var t=this;"block"===e.devtools.element.style.display&&(0,a.G)("".concat(e.options.cdn,"/dist/js/echarts/echarts.min.js?v=5.5.1"),"vditorEchartsScript").then(function(){t.ASTChart||(t.ASTChart=echarts.init(e.devtools.element.lastElementChild));try{t.element.lastElementChild.style.display="block",t.element.firstElementChild.innerHTML="",t.ASTChart.setOption({series:[{data:JSON.parse(e.lute.RenderEChartsJSON(u(e))),initialTreeDepth:-1,label:{align:"left",backgroundColor:"rgba(68, 77, 86, .68)",borderRadius:3,color:"#d1d5da",fontSize:12,lineHeight:12,offset:[9,12],padding:[2,4,2,4],position:"top",verticalAlign:"middle"},lineStyle:{color:"#4285f4",type:"curve",width:1},orient:"vertical",roam:!0,type:"tree"}],toolbox:{bottom:25,emphasis:{iconStyle:{color:"#4285f4"}},feature:{restore:{show:!0},saveAsImage:{show:!0}},right:15,show:!0}}),t.ASTChart.resize()}catch(je){t.element.lastElementChild.style.display="none",t.element.firstElementChild.innerHTML=je}})},e}(),s=n(410),c=function(e,t){t.forEach(function(t){if(e[t]){var n=e[t].children[0];n&&n.classList.contains("vditor-menu--current")&&n.classList.remove("vditor-menu--current")}})},d=function(e,t){t.forEach(function(t){if(e[t]){var n=e[t].children[0];n&&!n.classList.contains("vditor-menu--current")&&n.classList.add("vditor-menu--current")}})},p=function(e,t){t.forEach(function(t){if(e[t]){var n=e[t].children[0];n&&n.classList.contains(i.g.CLASS_MENU_DISABLED)&&n.classList.remove(i.g.CLASS_MENU_DISABLED)}})},f=function(e,t){t.forEach(function(t){if(e[t]){var n=e[t].children[0];n&&!n.classList.contains(i.g.CLASS_MENU_DISABLED)&&n.classList.add(i.g.CLASS_MENU_DISABLED)}})},h=function(e,t){t.forEach(function(t){e[t]&&e[t]&&(e[t].style.display="none")})},m=function(e,t){t.forEach(function(t){e[t]&&e[t]&&(e[t].style.display="block")})},v=function(e,t,n){t.includes("subToolbar")&&(e.toolbar.element.querySelectorAll(".vditor-hint").forEach(function(e){n&&e.isEqualNode(n)||(e.style.display="none")}),e.toolbar.elements.emoji&&(e.toolbar.elements.emoji.lastElementChild.style.display="none")),t.includes("hint")&&(e.hint.element.style.display="none"),e.wysiwyg.popover&&t.includes("popover")&&(e.wysiwyg.popover.style.display="none")},D=function(e,t,n,r){n.addEventListener((0,s.Le)(),function(r){r.preventDefault(),r.stopPropagation(),n.classList.contains(i.g.CLASS_MENU_DISABLED)||(e.toolbar.element.querySelectorAll(".vditor-hint--current").forEach(function(e){e.classList.remove("vditor-hint--current")}),"block"===t.style.display?t.style.display="none":(v(e,["subToolbar","hint","popover"],n.parentElement.parentElement),n.classList.contains("vditor-tooltipped")||n.classList.add("vditor-hint--current"),t.style.display="block",e.toolbar.element.getBoundingClientRect().right-n.getBoundingClientRect().right<250?t.classList.add("vditor-panel--left"):t.classList.remove("vditor-panel--left")))})},g=n(106),b=n(771),y=n(135),E=n(775),C=n(428),A=n(325),_=n(483),F=n(999),k=n(472),S=n(637),T=n(11),x=n(194),L=n(229),B=n(825),M=function(e,t){if(e)if("html-block"!==e.parentElement.getAttribute("data-type")){var n=e.firstElementChild.className.replace("language-","");"abc"===n?(0,y.Q)(e,t.options.cdn):"mermaid"===n?(0,S.i)(e,t.options.cdn,t.options.theme):"smiles"===n?(0,B.J)(e,t.options.cdn,t.options.theme):"markmap"===n?(0,T.K)(e,t.options.cdn):"flowchart"===n?(0,A.P)(e,t.options.cdn):"echarts"===n?(0,E.p)(e,t.options.cdn,t.options.theme):"mindmap"===n?(0,x.P)(e,t.options.cdn,t.options.theme):"plantuml"===n?(0,L.B)(e,t.options.cdn):"graphviz"===n?(0,_.v)(e,t.options.cdn):"math"===n?(0,k.H)(e,{cdn:t.options.cdn,math:t.options.preview.math}):t.options.customRenders.find(function(r){if(r.language===n)return r.render(e,t),!0})||((0,F.s)(Object.assign({},t.options.preview.hljs),e,t.options.cdn),(0,C.O)(e,t.options.preview.hljs)),e.setAttribute("data-render","1")}else e.setAttribute("data-render","1")},N=n(810),O=function(e){if("sv"!==e.currentMode){var t=e[e.currentMode].element,n=e.outline.render(e);""===n&&(n="[ToC]"),t.querySelectorAll('[data-type="toc-block"]').forEach(function(t){t.innerHTML=n,(0,k.H)(t,{cdn:e.options.cdn,math:e.options.preview.math})})}},H=function(e,t){var n=(0,g.lG)(e.target,"SPAN");if(n&&(0,g.fb)(n,"vditor-toc")){var r=t[t.currentMode].element.querySelector("#"+n.getAttribute("data-target-id"));if(r)if("auto"===t.options.height){var i=r.offsetTop+t.element.offsetTop;t.options.toolbarConfig.pin||(i+=t.toolbar.element.offsetHeight),window.scrollTo(window.scrollX,i)}else t.element.offsetTop<window.scrollY&&window.scrollTo(window.scrollX,t.element.offsetTop),t[t.currentMode].element.scrollTop=r.offsetTop}},I=function(e,t,n,r){if(e.previousElementSibling&&e.previousElementSibling.classList.contains("vditor-toc")){if("Backspace"===n.key&&0===(0,N.im)(e,t[t.currentMode].element,r).start)return e.previousElementSibling.remove(),Nt(t),!0;if(kt(t,n,r,e,e.previousElementSibling))return!0}if(e.nextElementSibling&&e.nextElementSibling.classList.contains("vditor-toc")){if("Delete"===n.key&&(0,N.im)(e,t[t.currentMode].element,r).start>=e.textContent.trimRight().length)return e.nextElementSibling.remove(),Nt(t),!0;if(Ft(t,n,r,e,e.nextElementSibling))return!0}if("Backspace"===n.key||"Delete"===n.key){var i=(0,g.fb)(r.startContainer,"vditor-toc");if(i)return i.remove(),Nt(t),!0}},P=function(e,t,n,r){void 0===n&&(n=!1);var o=(0,g.F9)(t.startContainer);if(o&&!n&&"code-block"!==o.getAttribute("data-type")){if(Bt(o.innerHTML)&&o.previousElementSibling||Mt(o.innerHTML))return;for(var a=(0,N.im)(o,e.ir.element,t).start,l=!0,s=a-1;s>o.textContent.substr(0,a).lastIndexOf("\n");s--)if(" "!==o.textContent.charAt(s)&&"\t"!==o.textContent.charAt(s)){l=!1;break}0===a&&(l=!1);var c=!0;for(s=a-1;s<o.textContent.length;s++)if(" "!==o.textContent.charAt(s)&&"\n"!==o.textContent.charAt(s)){c=!1;break}if(l)return void("function"==typeof e.options.input&&e.options.input(u(e)));if(c&&/^#{1,6} $/.test(o.textContent)&&(c=!1),c&&!(0,g.fb)(t.startContainer,"vditor-ir__marker")){var d=t.startContainer.previousSibling;return d&&3!==d.nodeType&&d.classList.contains("vditor-ir__node--expand")&&d.classList.remove("vditor-ir__node--expand"),void("function"==typeof e.options.input&&e.options.input(u(e)))}}if(e.ir.element.querySelectorAll(".vditor-ir__node--expand").forEach(function(e){e.classList.remove("vditor-ir__node--expand")}),o||(o=e.ir.element),!o.querySelector("wbr")){var p=(0,g.fb)(t.startContainer,"vditor-ir__preview");p?p.previousElementSibling.insertAdjacentHTML("beforeend","<wbr>"):t.insertNode(document.createElement("wbr"))}o.querySelectorAll("[style]").forEach(function(e){e.removeAttribute("style")}),"link-ref-defs-block"===o.getAttribute("data-type")&&(o=e.ir.element);var f,h=o.isEqualNode(e.ir.element),m=(0,g.a1)(o,"data-type","footnotes-block"),v="";if(h)v=o.innerHTML;else{var D=(0,b.S)(t.startContainer,"BLOCKQUOTE"),y=(0,g.O9)(t.startContainer);if(y&&(o=y),D&&(!y||y&&!D.contains(y))&&(o=D),m&&(o=m),v=o.outerHTML,"UL"===o.tagName||"OL"===o.tagName){var E=o.previousElementSibling,C=o.nextElementSibling;!E||"UL"!==E.tagName&&"OL"!==E.tagName||(v=E.outerHTML+v,E.remove()),!C||"UL"!==C.tagName&&"OL"!==C.tagName||(v+=C.outerHTML,C.remove()),v=v.replace("<div><wbr><br></div>","<li><p><wbr><br></p></li>")}else o.previousElementSibling&&""!==o.previousElementSibling.textContent.replace(i.g.ZWSP,"")&&r&&"insertParagraph"===r.inputType&&(v=o.previousElementSibling.outerHTML+v,o.previousElementSibling.remove());o.innerText.startsWith("```")||(e.ir.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(e){e&&!o.isEqualNode(e)&&(v+=e.outerHTML,e.remove())}),e.ir.element.querySelectorAll("[data-type='footnotes-block']").forEach(function(e){e&&!o.isEqualNode(e)&&(v+=e.outerHTML,e.remove())}))}if(e.options.debugger,v=e.lute.SpinVditorIRDOM(v),e.options.debugger,h)o.innerHTML=v;else if(o.outerHTML=v,m){var w=(0,g.a1)(e.ir.element.querySelector("wbr"),"data-type","footnotes-def");if(w){var A=w.textContent,_=A.substring(1,A.indexOf("]:")),F=e.ir.element.querySelector('sup[data-type="footnotes-ref"][data-footnotes-label="'.concat(_,'"]'));F&&F.setAttribute("aria-label",A.substr(_.length+3).trim().substr(0,24))}}var k,S=e.ir.element.querySelectorAll("[data-type='link-ref-defs-block']");S.forEach(function(e,t){0===t?f=e:(f.insertAdjacentHTML("beforeend",e.innerHTML),e.remove())}),S.length>0&&e.ir.element.insertAdjacentElement("beforeend",S[0]);var T=e.ir.element.querySelectorAll("[data-type='footnotes-block']");T.forEach(function(e,t){0===t?k=e:(k.insertAdjacentHTML("beforeend",e.innerHTML),e.remove())}),T.length>0&&e.ir.element.insertAdjacentElement("beforeend",T[0]),(0,N.ib)(e.ir.element,t),e.ir.element.querySelectorAll(".vditor-ir__preview[data-render='2']").forEach(function(t){M(t,e)}),O(e),en(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})},j=function(e,t){if(""===e)return!1;if(-1===e.indexOf("⇧")&&-1===e.indexOf("⌘")&&-1===e.indexOf("⌥"))return!((0,s.yl)(t)||t.altKey||t.shiftKey||t.code!==e);if("⇧Tab"===e)return!((0,s.yl)(t)||t.altKey||!t.shiftKey||"Tab"!==t.code);var n=e.split("");if(e.startsWith("⌥")){var r=3===n.length?n[2]:n[1];return!((3===n.length?!(0,s.yl)(t):(0,s.yl)(t))||!t.altKey||t.shiftKey||t.code!==(/^[0-9]$/.test(r)?"Digit":"Key")+r)}"⌘Enter"===e&&(n=["⌘","Enter"]);var i=n.length>2&&"⇧"===n[0],o=i?n[2]:n[1];return!i||!(0,s.vU)()&&/Mac/.test(navigator.platform)||("-"===o?o="_":"="===o&&(o="+")),!(!(0,s.yl)(t)||t.key.toLowerCase()!==o.toLowerCase()||t.altKey||!(!i&&!t.shiftKey||i&&t.shiftKey))},R=function(e,t){t.ir.element.querySelectorAll(".vditor-ir__node--expand").forEach(function(e){e.classList.remove("vditor-ir__node--expand")});var n=(0,g.JQ)(e.startContainer,"vditor-ir__node"),r=!e.collapsed&&(0,g.JQ)(e.endContainer,"vditor-ir__node");if(e.collapsed||n&&n===r){n&&(n.classList.add("vditor-ir__node--expand"),n.classList.remove("vditor-ir__node--hidden"),(0,N.Hc)(e));var i=function(e){var t=e.startContainer;if(3===t.nodeType&&t.nodeValue.length!==e.startOffset)return!1;for(var n=t.nextSibling;n&&""===n.textContent;)n=n.nextSibling;if(!n){var r=(0,g.fb)(t,"vditor-ir__marker");if(r&&!r.nextSibling){var i=t.parentElement.parentElement.nextSibling;if(i&&3!==i.nodeType&&i.classList.contains("vditor-ir__node"))return i}return!1}return!(!n||3===n.nodeType||!n.classList.contains("vditor-ir__node")||n.getAttribute("data-block"))&&n}(e);if(i)return i.classList.add("vditor-ir__node--expand"),void i.classList.remove("vditor-ir__node--hidden");var o=function(e){var t=e.startContainer,n=t.previousSibling;return!(3!==t.nodeType||0!==e.startOffset||!n||3===n.nodeType||!n.classList.contains("vditor-ir__node")||n.getAttribute("data-block"))&&n}(e);return o?(o.classList.add("vditor-ir__node--expand"),void o.classList.remove("vditor-ir__node--hidden")):void 0}},U=n(190),q=function(e,t){e.querySelectorAll("[data-type=footnotes-link]").forEach(function(e){for(var n=e.parentElement,r=n.nextSibling;r&&r.textContent.startsWith(" ");){var i=r;i.childNodes.forEach(function(e){n.append(e.cloneNode(!0))}),r=r.nextSibling,i.remove()}t&&t(n)})},V=function(e,t){var n,r=getSelection().getRangeAt(0).cloneRange(),i=r.startContainer;3!==r.startContainer.nodeType&&"DIV"===r.startContainer.tagName&&(i=r.startContainer.childNodes[r.startOffset-1]);var o=(0,g.a1)(i,"data-block","0");if(o&&t&&("deleteContentBackward"===t.inputType||" "===t.data)){for(var u=(0,N.im)(o,e.sv.element,r).start,a=!0,l=u-1;l>o.textContent.substr(0,u).lastIndexOf("\n");l--)if(" "!==o.textContent.charAt(l)&&"\t"!==o.textContent.charAt(l)){a=!1;break}if(0===u&&(a=!1),a)return void at(e);if("deleteContentBackward"===t.inputType){var s=(0,g.a1)(i,"data-type","code-block-open-marker")||(0,g.a1)(i,"data-type","code-block-close-marker");if(s){var c;if("code-block-close-marker"===s.getAttribute("data-type")&&(c=it(i,"code-block-open-marker")))return c.textContent=s.textContent,void at(e);if("code-block-open-marker"===s.getAttribute("data-type")&&(c=it(i,"code-block-close-marker",!1)))return c.textContent=s.textContent,void at(e)}var d=(0,g.a1)(i,"data-type","math-block-open-marker");if(d){var p=d.nextElementSibling.nextElementSibling;return void(p&&"math-block-close-marker"===p.getAttribute("data-type")&&(p.remove(),at(e)))}o.querySelectorAll('[data-type="code-block-open-marker"]').forEach(function(e){1===e.textContent.length&&e.remove()}),o.querySelectorAll('[data-type="code-block-close-marker"]').forEach(function(e){1===e.textContent.length&&e.remove()});var f=(0,g.a1)(i,"data-type","heading-marker");if(f&&-1===f.textContent.indexOf("#"))return void at(e)}if((" "===t.data||"deleteContentBackward"===t.inputType)&&((0,g.a1)(i,"data-type","padding")||(0,g.a1)(i,"data-type","li-marker")||(0,g.a1)(i,"data-type","task-marker")||(0,g.a1)(i,"data-type","blockquote-marker")))return void at(e)}if(o&&"$$"===o.textContent.trimRight())at(e);else{o||(o=e.sv.element),"link-ref-defs-block"===(null===(n=o.firstElementChild)||void 0===n?void 0:n.getAttribute("data-type"))&&(o=e.sv.element),(0,g.a1)(i,"data-type","footnotes-link")&&(o=e.sv.element),-1===o.textContent.indexOf(Lute.Caret)&&r.insertNode(document.createTextNode(Lute.Caret)),o.querySelectorAll("[style]").forEach(function(e){e.removeAttribute("style")}),o.querySelectorAll("font").forEach(function(e){e.outerHTML=e.innerHTML});var h=o.textContent,m=o.isEqualNode(e.sv.element);if(m)h=o.textContent;else{o.previousElementSibling&&(h=o.previousElementSibling.textContent+h,o.previousElementSibling.remove()),o.previousElementSibling&&0===h.indexOf("---\n")&&(h=o.previousElementSibling.textContent+h,o.previousElementSibling.remove());var v="";e.sv.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(e,t){e&&!o.isEqualNode(e.parentElement)&&(v+=e.parentElement.textContent+"\n",e.parentElement.remove())}),e.sv.element.querySelectorAll("[data-type='footnotes-link']").forEach(function(e,t){e&&!o.isEqualNode(e.parentElement)&&(v+=e.parentElement.textContent+"\n",e.parentElement.remove())}),h=v+h}h=ot(h,e),m?o.innerHTML=h:o.outerHTML=h,e.sv.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(t){e.sv.element.insertAdjacentElement("beforeend",t.parentElement)}),q(e.sv.element,function(t){e.sv.element.insertAdjacentElement("beforeend",t)}),(0,N.ib)(e.sv.element,r),et(e),at(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})}},z=n(538),W=function(e){"dark"===e.options.theme?e.element.classList.add("vditor--dark"):e.element.classList.remove("vditor--dark")},G=function(e){var t=window.innerWidth<=i.g.MOBILE_WIDTH?10:35;if("none"!==e.wysiwyg.element.parentElement.style.display){var n=(e.wysiwyg.element.parentElement.clientWidth-e.options.preview.maxWidth)/2;e.wysiwyg.element.style.padding="10px ".concat(Math.max(t,n),"px")}"none"!==e.ir.element.parentElement.style.display&&(n=(e.ir.element.parentElement.clientWidth-e.options.preview.maxWidth)/2,e.ir.element.style.padding="10px ".concat(Math.max(t,n),"px")),"block"!==e.preview.element.style.display?e.toolbar.element.style.paddingLeft=Math.max(5,parseInt(e[e.currentMode].element.style.paddingLeft||"0",10)+("left"===e.options.outline.position?e.outline.element.offsetWidth:0))+"px":e.toolbar.element.style.paddingLeft=5+("left"===e.options.outline.position?e.outline.element.offsetWidth:0)+"px"},K=function(e){if(e.options.typewriterMode){var t=window.innerHeight;"number"==typeof e.options.height?(t=e.options.height,"number"==typeof e.options.minHeight&&(t=Math.max(t,e.options.minHeight)),t=Math.min(window.innerHeight,t)):t=e.element.clientHeight,e.element.classList.contains("vditor--fullscreen")&&(t=window.innerHeight),e[e.currentMode].element.style.setProperty("--editor-bottom",(t-e.toolbar.element.offsetHeight)/2+"px")}};function X(){window.removeEventListener("resize",e)}var Z,J,$,Y,Q,ee,te,ne,re,ie,oe,ue,ae,le,se,ce,de,pe,fe,he,me,ve,De,ge,be=function(t){K(t),X(),window.addEventListener("resize",e=function(){G(t),K(t)});var n=(0,s.pK)()&&localStorage.getItem(t.options.cache.id);return t.options.cache.enable&&n||(t.options.value?n=t.options.value:t.originalInnerHTML?n=t.lute.HTML2Md(t.originalInnerHTML):t.options.cache.enable||(n="")),n||""},ye=function(e){clearTimeout(e[e.currentMode].hlToolbarTimeoutId),e[e.currentMode].hlToolbarTimeoutId=window.setTimeout(function(){if("false"!==e[e.currentMode].element.getAttribute("contenteditable")&&(0,N.Gb)(e[e.currentMode].element)){c(e.toolbar.elements,i.g.EDIT_TOOLBARS),p(e.toolbar.elements,i.g.EDIT_TOOLBARS);var t=(0,N.zh)(e),n=t.startContainer;3===t.startContainer.nodeType&&(n=t.startContainer.parentElement),n.classList.contains("vditor-reset")&&(n=n.childNodes[t.startOffset]),("sv"===e.currentMode?(0,g.a1)(n,"data-type","heading"):(0,b.W)(n))&&d(e.toolbar.elements,["headings"]),("sv"===e.currentMode?(0,g.a1)(n,"data-type","blockquote"):(0,g.lG)(n,"BLOCKQUOTE"))&&d(e.toolbar.elements,["quote"]),(0,g.a1)(n,"data-type","strong")&&d(e.toolbar.elements,["bold"]),(0,g.a1)(n,"data-type","em")&&d(e.toolbar.elements,["italic"]),(0,g.a1)(n,"data-type","s")&&d(e.toolbar.elements,["strike"]),(0,g.a1)(n,"data-type","a")&&d(e.toolbar.elements,["link"]);var r=(0,g.lG)(n,"LI");r?(r.classList.contains("vditor-task")?d(e.toolbar.elements,["check"]):"OL"===r.parentElement.tagName?d(e.toolbar.elements,["ordered-list"]):"UL"===r.parentElement.tagName&&d(e.toolbar.elements,["list"]),p(e.toolbar.elements,["outdent","indent"])):f(e.toolbar.elements,["outdent","indent"]),(0,g.a1)(n,"data-type","code-block")&&(f(e.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","inline-code","upload","link","table","record"]),d(e.toolbar.elements,["code"])),(0,g.a1)(n,"data-type","code")&&(f(e.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","upload","link","table","record"]),d(e.toolbar.elements,["inline-code"])),(0,g.a1)(n,"data-type","table")&&f(e.toolbar.elements,["headings","list","ordered-list","check","line","quote","code","table"])}},200)},Ee=function(e,t){void 0===t&&(t={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),t.enableHint&&e.hint.render(e),clearTimeout(e.wysiwyg.afterRenderTimeoutId),e.wysiwyg.afterRenderTimeoutId=window.setTimeout(function(){if(!e.wysiwyg.composingLock){var n=u(e);"function"==typeof e.options.input&&t.enableInput&&e.options.input(n),e.options.counter.enable&&e.counter.render(e,n),e.options.cache.enable&&(0,s.pK)()&&(localStorage.setItem(e.options.cache.id,n),e.options.cache.after&&e.options.cache.after(n)),e.devtools&&e.devtools.renderEchart(e),t.enableAddUndoStack&&e.undo.addToUndoStack(e)}},e.options.undoDelay)},Ce=function(e){for(var t="",n=e.nextSibling;n;)3===n.nodeType?t+=n.textContent:t+=n.outerHTML,n=n.nextSibling;return t},we=function(e){for(var t="",n=e.previousSibling;n;)t=3===n.nodeType?n.textContent+t:n.outerHTML+t,n=n.previousSibling;return t},Ae=function(e,t){Array.from(e.wysiwyg.element.childNodes).find(function(n){if(3===n.nodeType){var r=document.createElement("p");r.setAttribute("data-block","0"),r.textContent=n.textContent;var i=3===t.startContainer.nodeType?t.startOffset:n.textContent.length;return n.parentNode.insertBefore(r,n),n.remove(),t.setStart(r.firstChild,Math.min(r.firstChild.textContent.length,i)),t.collapse(!0),(0,N.Hc)(t),!0}if(!n.getAttribute("data-block"))return"P"===n.tagName?n.remove():("DIV"===n.tagName?(t.insertNode(document.createElement("wbr")),n.outerHTML='<p data-block="0">'.concat(n.innerHTML,"</p>")):"BR"===n.tagName?n.outerHTML='<p data-block="0">'.concat(n.outerHTML,"<wbr></p>"):(t.insertNode(document.createElement("wbr")),n.outerHTML='<p data-block="0">'.concat(n.outerHTML,"</p>")),(0,N.ib)(e.wysiwyg.element,t),t=getSelection().getRangeAt(0)),!0})},_e=function(e,t){var n=(0,N.zh)(e),r=(0,g.F9)(n.startContainer);r||(r=n.startContainer.childNodes[n.startOffset]),r||0!==e.wysiwyg.element.children.length||(r=e.wysiwyg.element),r&&!r.classList.contains("vditor-wysiwyg__block")&&(n.insertNode(document.createElement("wbr")),"<wbr>"===r.innerHTML.trim()&&(r.innerHTML="<wbr><br>"),"BLOCKQUOTE"===r.tagName||r.classList.contains("vditor-reset")?r.innerHTML="<".concat(t,' data-block="0">').concat(r.innerHTML.trim(),"</").concat(t,">"):r.outerHTML="<".concat(t,' data-block="0">').concat(r.innerHTML.trim(),"</").concat(t,">"),(0,N.ib)(e.wysiwyg.element,n),O(e))},Fe=function(e){var t=getSelection().getRangeAt(0),n=(0,g.F9)(t.startContainer);n||(n=t.startContainer.childNodes[t.startOffset]),n&&(t.insertNode(document.createElement("wbr")),n.outerHTML='<p data-block="0">'.concat(n.innerHTML,"</p>"),(0,N.ib)(e.wysiwyg.element,t)),e.wysiwyg.popover.style.display="none"},ke=function(e,t,n){void 0===n&&(n=!0);var r=e.previousElementSibling,i=r.ownerDocument.createRange();"CODE"===r.tagName?(r.style.display="inline-block",n?i.setStart(r.firstChild,1):i.selectNodeContents(r)):(r.style.display="block",r.firstChild.firstChild||r.firstChild.appendChild(document.createTextNode("")),i.selectNodeContents(r.firstChild)),n?i.collapse(!0):i.collapse(!1),(0,N.Hc)(i),e.firstElementChild.classList.contains("language-mindmap")||et(t)},Se=function(e,t){if(j("⇧⌘X",t)){var n=e.wysiwyg.popover.querySelector('[data-type="remove"]');return n&&n.click(),t.preventDefault(),!0}},Te=function(e){clearTimeout(e.wysiwyg.hlToolbarTimeoutId),e.wysiwyg.hlToolbarTimeoutId=window.setTimeout(function(){if("false"!==e.wysiwyg.element.getAttribute("contenteditable")&&(0,N.Gb)(e.wysiwyg.element)){c(e.toolbar.elements,i.g.EDIT_TOOLBARS),p(e.toolbar.elements,i.g.EDIT_TOOLBARS);var t=getSelection().getRangeAt(0),n=t.startContainer;n=3===t.startContainer.nodeType?t.startContainer.parentElement:n.childNodes[t.startOffset>=n.childNodes.length?n.childNodes.length-1:t.startOffset];var r=(0,g.a1)(n,"data-type","footnotes-block");if(r)return e.wysiwyg.popover.innerHTML="",Ne(r,e),Pe(e,"footnotes-block"),void xe(e,r);var o=(0,g.lG)(n,"LI");o?(o.classList.contains("vditor-task")?d(e.toolbar.elements,["check"]):"OL"===o.parentElement.tagName?d(e.toolbar.elements,["ordered-list"]):"UL"===o.parentElement.tagName&&d(e.toolbar.elements,["list"]),p(e.toolbar.elements,["outdent","indent"])):f(e.toolbar.elements,["outdent","indent"]),(0,g.lG)(n,"BLOCKQUOTE")&&d(e.toolbar.elements,["quote"]),((0,g.lG)(n,"B")||(0,g.lG)(n,"STRONG"))&&d(e.toolbar.elements,["bold"]),((0,g.lG)(n,"I")||(0,g.lG)(n,"EM"))&&d(e.toolbar.elements,["italic"]),((0,g.lG)(n,"STRIKE")||(0,g.lG)(n,"S"))&&d(e.toolbar.elements,["strike"]),e.wysiwyg.element.querySelectorAll(".vditor-comment--focus").forEach(function(e){e.classList.remove("vditor-comment--focus")});var a=(0,g.fb)(n,"vditor-comment");if(a){var l=a.getAttribute("data-cmtids").split(" ");if(l.length>1&&a.nextSibling.isSameNode(a.nextElementSibling)){var h=a.nextElementSibling.getAttribute("data-cmtids").split(" ");l.find(function(e){if(h.includes(e))return l=[e],!0})}e.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(e){e.getAttribute("data-cmtids").indexOf(l[0])>-1&&e.classList.add("vditor-comment--focus")})}var m=(0,g.lG)(n,"A");m&&d(e.toolbar.elements,["link"]);var v=(0,g.lG)(n,"TABLE"),D=(0,b.W)(n);(0,g.lG)(n,"CODE")?(0,g.lG)(n,"PRE")?(f(e.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","inline-code","upload","link","table","record"]),d(e.toolbar.elements,["code"])):(f(e.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","upload","link","table","record"]),d(e.toolbar.elements,["inline-code"])):D?(f(e.toolbar.elements,["bold"]),d(e.toolbar.elements,["headings"])):v&&f(e.toolbar.elements,["table"]);var y=(0,g.fb)(n,"vditor-toc");if(y)return e.wysiwyg.popover.innerHTML="",Ne(y,e),Pe(e,"vditor-toc"),void xe(e,y);var E=(0,b.S)(n,"BLOCKQUOTE");if(E&&(e.wysiwyg.popover.innerHTML="",Be(t,E,e),Me(t,E,e),Ne(E,e),Pe(e,"blockquote"),xe(e,E)),o&&(e.wysiwyg.popover.innerHTML="",Be(t,o,e),Me(t,o,e),Ne(o,e),Pe(e,"li"),xe(e,o)),v){e.options.lang,e.options,e.wysiwyg.popover.innerHTML="";var C=function(){var t=v.rows.length,n=v.rows[0].cells.length,r=parseInt(P.value,10)||t,i=parseInt(R.value,10)||n;if(r!==t||n!==i){if(n!==i)for(var o=i-n,a=0;a<v.rows.length;a++)if(o>0)for(var l=0;l<o;l++)0===a?v.rows[a].lastElementChild.insertAdjacentHTML("afterend","<th> </th>"):v.rows[a].lastElementChild.insertAdjacentHTML("afterend","<td> </td>");else for(var s=n-1;s>=i;s--)v.rows[a].cells[s].remove();if(t!==r){var c=r-t;if(c>0){for(var d="<tr>",p=0;p<i;p++)d+="<td> </td>";for(var f=0;f<c;f++)v.querySelector("tbody")?v.querySelector("tbody").insertAdjacentHTML("beforeend",d):v.querySelector("thead").insertAdjacentHTML("afterend",d+"</tr>")}else for(p=t-1;p>=r;p--)v.rows[p].remove(),1===v.rows.length&&v.querySelector("tbody").remove()}"function"==typeof e.options.input&&e.options.input(u(e))}},w=function(n){Lt(v,n),"right"===n?(k.classList.remove("vditor-icon--current"),S.classList.remove("vditor-icon--current"),T.classList.add("vditor-icon--current")):"center"===n?(k.classList.remove("vditor-icon--current"),T.classList.remove("vditor-icon--current"),S.classList.add("vditor-icon--current")):(S.classList.remove("vditor-icon--current"),T.classList.remove("vditor-icon--current"),k.classList.add("vditor-icon--current")),(0,N.Hc)(t),Ee(e)},A=(0,g.lG)(n,"TD"),_=(0,g.lG)(n,"TH"),F="left";A?F=A.getAttribute("align")||"left":_&&(F=_.getAttribute("align")||"center");var k=document.createElement("button");k.setAttribute("type","button"),k.setAttribute("aria-label",window.VditorI18n.alignLeft+"<"+(0,s.ns)("⇧⌘L")+">"),k.setAttribute("data-type","left"),k.innerHTML='<svg><use xlink:href="#vditor-icon-align-left"></use></svg>',k.className="vditor-icon vditor-tooltipped vditor-tooltipped__n"+("left"===F?" vditor-icon--current":""),k.onclick=function(){w("left")};var S=document.createElement("button");S.setAttribute("type","button"),S.setAttribute("aria-label",window.VditorI18n.alignCenter+"<"+(0,s.ns)("⇧⌘C")+">"),S.setAttribute("data-type","center"),S.innerHTML='<svg><use xlink:href="#vditor-icon-align-center"></use></svg>',S.className="vditor-icon vditor-tooltipped vditor-tooltipped__n"+("center"===F?" vditor-icon--current":""),S.onclick=function(){w("center")};var T=document.createElement("button");T.setAttribute("type","button"),T.setAttribute("aria-label",window.VditorI18n.alignRight+"<"+(0,s.ns)("⇧⌘R")+">"),T.setAttribute("data-type","right"),T.innerHTML='<svg><use xlink:href="#vditor-icon-align-right"></use></svg>',T.className="vditor-icon vditor-tooltipped vditor-tooltipped__n"+("right"===F?" vditor-icon--current":""),T.onclick=function(){w("right")};var x=document.createElement("button");x.setAttribute("type","button"),x.setAttribute("aria-label",window.VditorI18n.insertRowBelow+"<"+(0,s.ns)("⌘=")+">"),x.setAttribute("data-type","insertRow"),x.innerHTML='<svg><use xlink:href="#vditor-icon-insert-row"></use></svg>',x.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",x.onclick=function(){var n=getSelection().getRangeAt(0).startContainer,r=(0,g.lG)(n,"TD")||(0,g.lG)(n,"TH");r&&Pt(e,t,r)};var L=document.createElement("button");L.setAttribute("type","button"),L.setAttribute("aria-label",window.VditorI18n.insertRowAbove+"<"+(0,s.ns)("⇧⌘F")+">"),L.setAttribute("data-type","insertRow"),L.innerHTML='<svg><use xlink:href="#vditor-icon-insert-rowb"></use></svg>',L.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",L.onclick=function(){var n=getSelection().getRangeAt(0).startContainer,r=(0,g.lG)(n,"TD")||(0,g.lG)(n,"TH");r&&jt(e,t,r)};var B=document.createElement("button");B.setAttribute("type","button"),B.setAttribute("aria-label",window.VditorI18n.insertColumnRight+"<"+(0,s.ns)("⇧⌘=")+">"),B.setAttribute("data-type","insertColumn"),B.innerHTML='<svg><use xlink:href="#vditor-icon-insert-column"></use></svg>',B.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",B.onclick=function(){var t=getSelection().getRangeAt(0).startContainer,n=(0,g.lG)(t,"TD")||(0,g.lG)(t,"TH");n&&Rt(e,v,n)};var O=document.createElement("button");O.setAttribute("type","button"),O.setAttribute("aria-label",window.VditorI18n.insertColumnLeft+"<"+(0,s.ns)("⇧⌘G")+">"),O.setAttribute("data-type","insertColumn"),O.innerHTML='<svg><use xlink:href="#vditor-icon-insert-columnb"></use></svg>',O.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",O.onclick=function(){var t=getSelection().getRangeAt(0).startContainer,n=(0,g.lG)(t,"TD")||(0,g.lG)(t,"TH");n&&Rt(e,v,n,"beforebegin")};var H=document.createElement("button");H.setAttribute("type","button"),H.setAttribute("aria-label",window.VditorI18n["delete-row"]+"<"+(0,s.ns)("⌘-")+">"),H.setAttribute("data-type","deleteRow"),H.innerHTML='<svg><use xlink:href="#vditor-icon-delete-row"></use></svg>',H.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",H.onclick=function(){var n=getSelection().getRangeAt(0).startContainer,r=(0,g.lG)(n,"TD")||(0,g.lG)(n,"TH");r&&Ut(e,t,r)};var I=document.createElement("button");I.setAttribute("type","button"),I.setAttribute("aria-label",window.VditorI18n["delete-column"]+"<"+(0,s.ns)("⇧⌘-")+">"),I.setAttribute("data-type","deleteColumn"),I.innerHTML='<svg><use xlink:href="#vditor-icon-delete-column"></use></svg>',I.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",I.onclick=function(){var n=getSelection().getRangeAt(0).startContainer,r=(0,g.lG)(n,"TD")||(0,g.lG)(n,"TH");r&&qt(e,t,v,r)},(Z=document.createElement("span")).setAttribute("aria-label",window.VditorI18n.row),Z.className="vditor-tooltipped vditor-tooltipped__n";var P=document.createElement("input");Z.appendChild(P),P.type="number",P.min="1",P.className="vditor-input",P.style.width="42px",P.style.textAlign="center",P.setAttribute("placeholder",window.VditorI18n.row),P.value=v.rows.length.toString(),P.oninput=function(){C()},P.onkeydown=function(n){if(!n.isComposing)return"Tab"===n.key?(R.focus(),R.select(),void n.preventDefault()):void(Se(e,n)||Ie(n,t))};var j=document.createElement("span");j.setAttribute("aria-label",window.VditorI18n.column),j.className="vditor-tooltipped vditor-tooltipped__n";var R=document.createElement("input");j.appendChild(R),R.type="number",R.min="1",R.className="vditor-input",R.style.width="42px",R.style.textAlign="center",R.setAttribute("placeholder",window.VditorI18n.column),R.value=v.rows[0].cells.length.toString(),R.oninput=function(){C()},R.onkeydown=function(n){if(!n.isComposing)return"Tab"===n.key?(P.focus(),P.select(),void n.preventDefault()):void(Se(e,n)||Ie(n,t))},Be(t,v,e),Me(t,v,e),Ne(v,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",k),e.wysiwyg.popover.insertAdjacentElement("beforeend",S),e.wysiwyg.popover.insertAdjacentElement("beforeend",T),e.wysiwyg.popover.insertAdjacentElement("beforeend",L),e.wysiwyg.popover.insertAdjacentElement("beforeend",x),e.wysiwyg.popover.insertAdjacentElement("beforeend",O),e.wysiwyg.popover.insertAdjacentElement("beforeend",B),e.wysiwyg.popover.insertAdjacentElement("beforeend",H),e.wysiwyg.popover.insertAdjacentElement("beforeend",I),e.wysiwyg.popover.insertAdjacentElement("beforeend",Z),e.wysiwyg.popover.insertAdjacentHTML("beforeend"," x "),e.wysiwyg.popover.insertAdjacentElement("beforeend",j),Pe(e,"table"),xe(e,v)}var U=(0,g.a1)(n,"data-type","link-ref");U&&Le(e,U,t);var q=(0,g.a1)(n,"data-type","footnotes-ref");if(q){e.options.lang,e.options,e.wysiwyg.popover.innerHTML="",(Z=document.createElement("span")).setAttribute("aria-label",window.VditorI18n.footnoteRef+"<"+(0,s.ns)("⌥Enter")+">"),Z.className="vditor-tooltipped vditor-tooltipped__n";var V=document.createElement("input");Z.appendChild(V),V.className="vditor-input",V.setAttribute("placeholder",window.VditorI18n.footnoteRef+"<"+(0,s.ns)("⌥Enter")+">"),V.style.width="120px",V.value=q.getAttribute("data-footnotes-label"),V.oninput=function(){""!==V.value.trim()&&q.setAttribute("data-footnotes-label",V.value),"function"==typeof e.options.input&&e.options.input(u(e))},V.onkeydown=function(n){n.isComposing||Se(e,n)||Ie(n,t)},Ne(q,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",Z),Pe(e,"footnotes-ref"),xe(e,q)}var z=(0,g.fb)(n,"vditor-wysiwyg__block"),W=!!z&&z.getAttribute("data-type").indexOf("block")>-1;if(e.wysiwyg.element.querySelectorAll(".vditor-wysiwyg__preview").forEach(function(e){(!z||z&&W&&!z.contains(e))&&(e.previousElementSibling.style.display="none")}),z&&W){if(e.wysiwyg.popover.innerHTML="",Be(t,z,e),Me(t,z,e),Ne(z,e),"code-block"===z.getAttribute("data-type")){var G=document.createElement("span");G.setAttribute("aria-label",window.VditorI18n.language+"<"+(0,s.ns)("⌥Enter")+">"),G.className="vditor-tooltipped vditor-tooltipped__n";var K=document.createElement("input");G.appendChild(K);var X=z.firstElementChild.firstElementChild;K.className="vditor-input",K.setAttribute("placeholder",window.VditorI18n.language+"<"+(0,s.ns)("⌥Enter")+">"),K.value=X.className.indexOf("language-")>-1?X.className.split("-")[1].split(" ")[0]:"",K.oninput=function(n){""!==K.value.trim()?X.className="language-".concat(K.value):(X.className="",e.hint.recentLanguage=""),z.lastElementChild.classList.contains("vditor-wysiwyg__preview")&&(z.lastElementChild.innerHTML=z.firstElementChild.innerHTML,M(z.lastElementChild,e)),Ee(e),1===n.detail&&(t.setStart(X.firstChild,0),t.collapse(!0),(0,N.Hc)(t))},K.onkeydown=function(n){if(!n.isComposing&&!Se(e,n)){if("Escape"===n.key&&"block"===e.hint.element.style.display)return e.hint.element.style.display="none",void n.preventDefault();e.hint.select(n,e),Ie(n,t)}},K.onkeyup=function(t){var n,r;if(!t.isComposing&&"Enter"!==t.key&&"ArrowUp"!==t.key&&"Escape"!==t.key&&"ArrowDown"!==t.key){var o=[],u=K.value.substring(0,K.selectionStart);(e.options.preview.hljs.langs||i.g.ALIAS_CODE_LANGUAGES.concat((null!==(r=null===(n=window.hljs)||void 0===n?void 0:n.listLanguages())&&void 0!==r?r:[]).sort())).forEach(function(e){e.indexOf(u.toLowerCase())>-1&&o.push({html:e,value:e})}),e.hint.genHTML(o,u,e),t.preventDefault()}},e.wysiwyg.popover.insertAdjacentElement("beforeend",G),Pe(e,"code-block")}else Pe(e,"block");xe(e,z)}else z=void 0;if(D){var Z;e.wysiwyg.popover.innerHTML="",(Z=document.createElement("span")).setAttribute("aria-label","ID<"+(0,s.ns)("⌥Enter")+">"),Z.className="vditor-tooltipped vditor-tooltipped__n";var J=document.createElement("input");Z.appendChild(J),J.className="vditor-input",J.setAttribute("placeholder","ID<"+(0,s.ns)("⌥Enter")+">"),J.style.width="120px",J.value=D.getAttribute("data-id")||"",J.oninput=function(){D.setAttribute("data-id",J.value),"function"==typeof e.options.input&&e.options.input(u(e))},J.onkeydown=function(n){n.isComposing||Se(e,n)||Ie(n,t)},Be(t,D,e),Me(t,D,e),Ne(D,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",Z),Pe(e,"heading"),xe(e,D)}if(m&&He(e,m,t),!(E||o||v||z||m||U||q||D||y)){var $=(0,g.a1)(n,"data-block","0");$&&$.parentElement.isEqualNode(e.wysiwyg.element)?(e.wysiwyg.popover.innerHTML="",Be(t,$,e),Me(t,$,e),Ne($,e),Pe(e,"block"),xe(e,$)):e.wysiwyg.popover.style.display="none"}e.wysiwyg.element.querySelectorAll('span[data-type="backslash"] > span').forEach(function(e){e.style.display="none"});var Y=(0,g.a1)(t.startContainer,"data-type","backslash");Y&&(Y.querySelector("span").style.display="inline")}},200)},xe=function(e,t){var n=t,r=(0,g.lG)(t,"TABLE");r&&(n=r),e.wysiwyg.popover.style.left="0",e.wysiwyg.popover.style.display="block",e.wysiwyg.popover.style.top=Math.max(-8,n.offsetTop-21-e.wysiwyg.element.scrollTop)+"px",e.wysiwyg.popover.style.left=Math.min(n.offsetLeft,e.wysiwyg.element.clientWidth-e.wysiwyg.popover.clientWidth)+"px",e.wysiwyg.popover.setAttribute("data-top",(n.offsetTop-21).toString())},Le=function(e,t,n){void 0===n&&(n=getSelection().getRangeAt(0)),e.wysiwyg.popover.innerHTML="";var r=function(){""!==o.value.trim()&&("IMG"===t.tagName?t.setAttribute("alt",o.value):t.textContent=o.value),""!==l.value.trim()&&t.setAttribute("data-link-label",l.value),"function"==typeof e.options.input&&e.options.input(u(e))},i=document.createElement("span");i.setAttribute("aria-label",window.VditorI18n.textIsNotEmpty),i.className="vditor-tooltipped vditor-tooltipped__n";var o=document.createElement("input");i.appendChild(o),o.className="vditor-input",o.setAttribute("placeholder",window.VditorI18n.textIsNotEmpty),o.style.width="120px",o.value=t.getAttribute("alt")||t.textContent,o.oninput=function(){r()},o.onkeydown=function(r){Se(e,r)||Ie(r,n)||Oe(e,t,r,l)};var a=document.createElement("span");a.setAttribute("aria-label",window.VditorI18n.linkRef),a.className="vditor-tooltipped vditor-tooltipped__n";var l=document.createElement("input");a.appendChild(l),l.className="vditor-input",l.setAttribute("placeholder",window.VditorI18n.linkRef),l.value=t.getAttribute("data-link-label"),l.oninput=function(){r()},l.onkeydown=function(r){Se(e,r)||Ie(r,n)||Oe(e,t,r,o)},Ne(t,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",i),e.wysiwyg.popover.insertAdjacentElement("beforeend",a),Pe(e,"link-ref"),xe(e,t)},Be=function(e,t,n){var r=t.previousElementSibling;if(r&&(t.parentElement.isEqualNode(n.wysiwyg.element)||"LI"===t.tagName)){var i=document.createElement("button");i.setAttribute("type","button"),i.setAttribute("data-type","up"),i.setAttribute("aria-label",window.VditorI18n.up+"<"+(0,s.ns)("⇧⌘U")+">"),i.innerHTML='<svg><use xlink:href="#vditor-icon-up"></use></svg>',i.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",i.onclick=function(){e.insertNode(document.createElement("wbr")),r.insertAdjacentElement("beforebegin",t),(0,N.ib)(n.wysiwyg.element,e),Ee(n),Te(n),et(n)},n.wysiwyg.popover.insertAdjacentElement("beforeend",i)}},Me=function(e,t,n){var r=t.nextElementSibling;if(r&&(t.parentElement.isEqualNode(n.wysiwyg.element)||"LI"===t.tagName)){var i=document.createElement("button");i.setAttribute("type","button"),i.setAttribute("data-type","down"),i.setAttribute("aria-label",window.VditorI18n.down+"<"+(0,s.ns)("⇧⌘D")+">"),i.innerHTML='<svg><use xlink:href="#vditor-icon-down"></use></svg>',i.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",i.onclick=function(){e.insertNode(document.createElement("wbr")),r.insertAdjacentElement("afterend",t),(0,N.ib)(n.wysiwyg.element,e),Ee(n),Te(n),et(n)},n.wysiwyg.popover.insertAdjacentElement("beforeend",i)}},Ne=function(e,t){var n=document.createElement("button");n.setAttribute("type","button"),n.setAttribute("data-type","remove"),n.setAttribute("aria-label",window.VditorI18n.remove+"<"+(0,s.ns)("⇧⌘X")+">"),n.innerHTML='<svg><use xlink:href="#vditor-icon-trashcan"></use></svg>',n.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",n.onclick=function(){var n=(0,N.zh)(t);n.setStartAfter(e),(0,N.Hc)(n),e.remove(),Ee(t),Te(t),["H1","H2","H3","H4","H5","H6"].includes(e.tagName)&&O(t)},t.wysiwyg.popover.insertAdjacentElement("beforeend",n)},Oe=function(e,t,n,r){if(!n.isComposing){if("Tab"===n.key)return r.focus(),r.select(),void n.preventDefault();if(!(0,s.yl)(n)&&!n.shiftKey&&n.altKey&&"Enter"===n.key){var o=(0,N.zh)(e);t.insertAdjacentHTML("afterend",i.g.ZWSP),o.setStartAfter(t.nextSibling),o.collapse(!0),(0,N.Hc)(o),n.preventDefault()}}},He=function(e,t,n){e.wysiwyg.popover.innerHTML="";var r=function(){""!==o.value.trim()&&(t.innerHTML=o.value),t.setAttribute("href",a.value),t.setAttribute("title",s.value),Ee(e)};t.querySelectorAll("[data-marker]").forEach(function(e){e.removeAttribute("data-marker")});var i=document.createElement("span");i.setAttribute("aria-label",window.VditorI18n.textIsNotEmpty),i.className="vditor-tooltipped vditor-tooltipped__n";var o=document.createElement("input");i.appendChild(o),o.className="vditor-input",o.setAttribute("placeholder",window.VditorI18n.textIsNotEmpty),o.style.width="120px",o.value=t.innerHTML||"",o.oninput=function(){r()},o.onkeydown=function(r){Se(e,r)||Ie(r,n)||Oe(e,t,r,a)};var u=document.createElement("span");u.setAttribute("aria-label",window.VditorI18n.link),u.className="vditor-tooltipped vditor-tooltipped__n";var a=document.createElement("input");u.appendChild(a),a.className="vditor-input",a.setAttribute("placeholder",window.VditorI18n.link),a.value=t.getAttribute("href")||"",a.oninput=function(){r()},a.onkeydown=function(r){Se(e,r)||Ie(r,n)||Oe(e,t,r,s)};var l=document.createElement("span");l.setAttribute("aria-label",window.VditorI18n.tooltipText),l.className="vditor-tooltipped vditor-tooltipped__n";var s=document.createElement("input");l.appendChild(s),s.className="vditor-input",s.setAttribute("placeholder",window.VditorI18n.tooltipText),s.style.width="60px",s.value=t.getAttribute("title")||"",s.oninput=function(){r()},s.onkeydown=function(r){Se(e,r)||Ie(r,n)||Oe(e,t,r,o)},Ne(t,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",i),e.wysiwyg.popover.insertAdjacentElement("beforeend",u),e.wysiwyg.popover.insertAdjacentElement("beforeend",l),Pe(e,"a"),xe(e,t)},Ie=function(e,t){if(!(0,s.yl)(e)&&!e.shiftKey&&"Enter"===e.key||"Escape"===e.key)return t&&(0,N.Hc)(t),e.preventDefault(),e.stopPropagation(),!0},Pe=function(e,t){e.options.customWysiwygToolbar(t,e.wysiwyg.popover)},Re=function(e){"wysiwyg"===e.currentMode?Te(e):"ir"===e.currentMode&&ye(e)},Ue=function(e,t,n){void 0===n&&(n={enableAddUndoStack:!0,enableHint:!1,enableInput:!0});var r=e.wysiwyg.element;r.innerHTML=e.lute.Md2VditorDOM(t),r.querySelectorAll(".vditor-wysiwyg__preview[data-render='2']").forEach(function(t){M(t,e),t.previousElementSibling.setAttribute("style","display:none")}),Ee(e,n)},qe=function(e,t,n){for(var r=e.startContainer.parentElement,o=!1,u="",a="",l=function(e){var t=we(e.startContainer),n=Ce(e.startContainer),r=e.startContainer.textContent,o=e.startOffset,u="",a="";return(""!==r.substr(0,o)&&r.substr(0,o)!==i.g.ZWSP||t)&&(u="".concat(t).concat(r.substr(0,o))),(""!==r.substr(o)&&r.substr(o)!==i.g.ZWSP||n)&&(a="".concat(r.substr(o)).concat(n)),{afterHTML:a,beforeHTML:u}}(e),s=l.beforeHTML,c=l.afterHTML;r&&!o;){var d=r.tagName;if("STRIKE"===d&&(d="S"),"I"===d&&(d="EM"),"B"===d&&(d="STRONG"),"S"===d||"STRONG"===d||"EM"===d){var p="",f="",h="";"0"!==r.parentElement.getAttribute("data-block")&&(f=we(r),h=Ce(r)),(s||f)&&(s=p="".concat(f,"<").concat(d,">").concat(s,"</").concat(d,">")),("bold"===n&&"STRONG"===d||"italic"===n&&"EM"===d||"strikeThrough"===n&&"S"===d)&&(p+="".concat(u).concat(i.g.ZWSP,"<wbr>").concat(a),o=!0),(c||h)&&(p+=c="<".concat(d,">").concat(c,"</").concat(d,">").concat(h)),"0"!==r.parentElement.getAttribute("data-block")?(r=r.parentElement).innerHTML=p:(r.outerHTML=p,r=r.parentElement),u="<".concat(d,">")+u,a="</".concat(d,">")+a}else o=!0}(0,N.ib)(t.wysiwyg.element,e)},Ve=function(e,t){var n,r=this;this.element=document.createElement("div"),t.className&&(n=this.element.classList).add.apply(n,t.className.split(" "));var o=t.hotkey?" <".concat((0,s.ns)(t.hotkey),">"):"";2===t.level&&(o=t.hotkey?" &lt;".concat((0,s.ns)(t.hotkey),"&gt;"):"");var u=t.tip?t.tip+o:"".concat(window.VditorI18n[t.name]).concat(o),a="upload"===t.name?"div":"button";if(2===t.level)this.element.innerHTML="<".concat(a,' data-type="').concat(t.name,'">').concat(u,"</").concat(a,">");else{this.element.classList.add("vditor-toolbar__item");var l=document.createElement(a);l.setAttribute("data-type",t.name),l.className="vditor-tooltipped vditor-tooltipped__".concat(t.tipPosition),l.setAttribute("aria-label",u),l.innerHTML=t.icon,this.element.appendChild(l)}t.prefix&&this.element.children[0].addEventListener((0,s.Le)(),function(n){n.preventDefault(),r.element.firstElementChild.classList.contains(i.g.CLASS_MENU_DISABLED)||("wysiwyg"===e.currentMode?function(e,t,n){if(!(e.wysiwyg.composingLock&&n instanceof CustomEvent)){var r=!0,o=!0;e.wysiwyg.element.querySelector("wbr")&&e.wysiwyg.element.querySelector("wbr").remove();var u=(0,N.zh)(e),a=t.getAttribute("data-type");if(t.classList.contains("vditor-menu--current"))if("strike"===a&&(a="strikeThrough"),"quote"===a){var l=(0,g.lG)(u.startContainer,"BLOCKQUOTE");l||(l=u.startContainer.childNodes[u.startOffset]),l&&(r=!1,t.classList.remove("vditor-menu--current"),u.insertNode(document.createElement("wbr")),l.outerHTML=""===l.innerHTML.trim()?'<p data-block="0">'.concat(l.innerHTML,"</p>"):l.innerHTML,(0,N.ib)(e.wysiwyg.element,u))}else if("inline-code"===a){var s=(0,g.lG)(u.startContainer,"CODE");s||(s=u.startContainer.childNodes[u.startOffset]),s&&(s.outerHTML=s.innerHTML.replace(i.g.ZWSP,"")+"<wbr>",(0,N.ib)(e.wysiwyg.element,u))}else"link"===a?u.collapsed?(u.selectNode(u.startContainer.parentElement),document.execCommand("unlink",!1,"")):document.execCommand("unlink",!1,""):"check"===a||"list"===a||"ordered-list"===a?(St(e,u,a),(0,N.ib)(e.wysiwyg.element,u),r=!1,t.classList.remove("vditor-menu--current")):(r=!1,t.classList.remove("vditor-menu--current"),""===u.toString()?qe(u,e,a):document.execCommand(a,!1,""));else{0===e.wysiwyg.element.childNodes.length&&(e.wysiwyg.element.innerHTML='<p data-block="0"><wbr></p>',(0,N.ib)(e.wysiwyg.element,u));var d=(0,g.F9)(u.startContainer);if("quote"===a){if(d||(d=u.startContainer.childNodes[u.startOffset]),d){r=!1,t.classList.add("vditor-menu--current"),u.insertNode(document.createElement("wbr"));var p=(0,g.lG)(u.startContainer,"LI");p&&d.contains(p)?p.innerHTML='<blockquote data-block="0">'.concat(p.innerHTML,"</blockquote>"):d.outerHTML='<blockquote data-block="0">'.concat(d.outerHTML,"</blockquote>"),(0,N.ib)(e.wysiwyg.element,u)}}else if("check"===a||"list"===a||"ordered-list"===a)St(e,u,a,!1),(0,N.ib)(e.wysiwyg.element,u),r=!1,c(e.toolbar.elements,["check","list","ordered-list"]),t.classList.add("vditor-menu--current");else if("inline-code"===a){if(""===u.toString())(f=document.createElement("code")).textContent=i.g.ZWSP,u.insertNode(f),u.setStart(f.firstChild,1),u.collapse(!0),(0,N.Hc)(u);else if(3===u.startContainer.nodeType){var f=document.createElement("code");u.surroundContents(f),u.insertNode(f),(0,N.Hc)(u)}t.classList.add("vditor-menu--current")}else if("code"===a)(f=document.createElement("div")).className="vditor-wysiwyg__block",f.setAttribute("data-type","code-block"),f.setAttribute("data-block","0"),f.setAttribute("data-marker","```"),""===u.toString()?f.innerHTML="<pre><code><wbr>\n</code></pre>":(f.innerHTML="<pre><code>".concat(u.toString(),"<wbr></code></pre>"),u.deleteContents()),u.insertNode(f),d&&(d.outerHTML=e.lute.SpinVditorDOM(d.outerHTML)),(0,N.ib)(e.wysiwyg.element,u),e.wysiwyg.element.querySelectorAll(".vditor-wysiwyg__preview[data-render='2']").forEach(function(t){M(t,e)}),t.classList.add("vditor-menu--disabled");else if("link"===a){if(""===u.toString()){var h=document.createElement("a");h.innerText=i.g.ZWSP,u.insertNode(h),u.setStart(h.firstChild,1),u.collapse(!0),He(e,h,u);var m=e.wysiwyg.popover.querySelector("input");m.value="",m.focus(),o=!1}else{(f=document.createElement("a")).setAttribute("href",""),f.innerHTML=u.toString(),u.surroundContents(f),u.insertNode(f),(0,N.Hc)(u),He(e,f,u);var v=e.wysiwyg.popover.querySelectorAll("input");v[0].value=f.innerText,v[1].focus()}r=!1,t.classList.add("vditor-menu--current")}else if("table"===a){var D='<table data-block="0"><thead><tr><th>col1<wbr></th><th>col2</th><th>col3</th></tr></thead><tbody><tr><td> </td><td> </td><td> </td></tr><tr><td> </td><td> </td><td> </td></tr></tbody></table>';if(""===u.toString().trim())d&&""===d.innerHTML.trim().replace(i.g.ZWSP,"")?d.outerHTML=D:document.execCommand("insertHTML",!1,D),u.selectNode(e.wysiwyg.element.querySelector("wbr").previousSibling),e.wysiwyg.element.querySelector("wbr").remove(),(0,N.Hc)(u);else{D='<table data-block="0"><thead><tr>';var b=u.toString().split("\n"),y=b[0].split(",").length>b[0].split("\t").length?",":"\t";b.forEach(function(e,t){0===t?(e.split(y).forEach(function(e,t){D+="<th>".concat(e,0===t?"<wbr></th>":"</th>")}),D+="</tr></thead>"):(D+=1===t?"<tbody><tr>":"<tr>",e.split(y).forEach(function(e){D+="<td>".concat(e,"</td>")}),D+="</tr>")}),D+="</tbody></table>",document.execCommand("insertHTML",!1,D),(0,N.ib)(e.wysiwyg.element,u)}r=!1,t.classList.add("vditor-menu--disabled")}else if("line"===a){if(d){var E='<hr data-block="0"><p data-block="0"><wbr>\n</p>';""===d.innerHTML.trim()?d.outerHTML=E:d.insertAdjacentHTML("afterend",E),(0,N.ib)(e.wysiwyg.element,u)}}else if(r=!1,t.classList.add("vditor-menu--current"),"strike"===a&&(a="strikeThrough"),""!==u.toString()||"bold"!==a&&"italic"!==a&&"strikeThrough"!==a)document.execCommand(a,!1,"");else{var C="strong";"italic"===a?C="em":"strikeThrough"===a&&(C="s"),(f=document.createElement(C)).textContent=i.g.ZWSP,u.insertNode(f),f.previousSibling&&f.previousSibling.textContent===i.g.ZWSP&&(f.previousSibling.textContent=""),u.setStart(f.firstChild,1),u.collapse(!0),(0,N.Hc)(u)}}r&&Te(e),o&&Ee(e)}}(e,r.element.children[0],n):"ir"===e.currentMode?rn(e,r.element.children[0],t.prefix||"",t.suffix||""):st(e,r.element.children[0],t.prefix||"",t.suffix||""))})},ze=(Z=function(e,t){return Z=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Z(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Z(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),We=function(e,t,n){var r;if("string"!=typeof n?(v(e,["subToolbar","hint"]),n.preventDefault(),r=u(e)):r=n,e.currentMode!==t||"string"==typeof n){if(e.devtools&&e.devtools.renderEchart(e),"both"===e.options.preview.mode&&"sv"===t?e.preview.element.style.display="block":e.preview.element.style.display="none",p(e.toolbar.elements,i.g.EDIT_TOOLBARS),c(e.toolbar.elements,i.g.EDIT_TOOLBARS),f(e.toolbar.elements,["outdent","indent"]),"ir"===t)h(e.toolbar.elements,["both"]),m(e.toolbar.elements,["outdent","indent","outline","insert-before","insert-after"]),e.sv.element.style.display="none",e.wysiwyg.element.parentElement.style.display="none",e.ir.element.parentElement.style.display="block",e.lute.SetVditorIR(!0),e.lute.SetVditorWYSIWYG(!1),e.lute.SetVditorSV(!1),e.currentMode="ir",e.ir.element.innerHTML=e.lute.Md2VditorIRDOM(r),en(e,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),G(e),e.ir.element.querySelectorAll(".vditor-ir__preview[data-render='2']").forEach(function(t){M(t,e)}),e.ir.element.querySelectorAll(".vditor-toc").forEach(function(t){(0,k.H)(t,{cdn:e.options.cdn,math:e.options.preview.math})});else if("wysiwyg"===t)h(e.toolbar.elements,["both"]),m(e.toolbar.elements,["outdent","indent","outline","insert-before","insert-after"]),e.sv.element.style.display="none",e.wysiwyg.element.parentElement.style.display="block",e.ir.element.parentElement.style.display="none",e.lute.SetVditorIR(!1),e.lute.SetVditorWYSIWYG(!0),e.lute.SetVditorSV(!1),e.currentMode="wysiwyg",G(e),Ue(e,r,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),e.wysiwyg.element.querySelectorAll(".vditor-toc").forEach(function(t){(0,k.H)(t,{cdn:e.options.cdn,math:e.options.preview.math})}),e.wysiwyg.popover.style.display="none";else if("sv"===t){m(e.toolbar.elements,["both"]),h(e.toolbar.elements,["outdent","indent","outline","insert-before","insert-after"]),e.wysiwyg.element.parentElement.style.display="none",e.ir.element.parentElement.style.display="none",("both"===e.options.preview.mode||"editor"===e.options.preview.mode)&&(e.sv.element.style.display="block"),e.lute.SetVditorIR(!1),e.lute.SetVditorWYSIWYG(!1),e.lute.SetVditorSV(!0),e.currentMode="sv";var o=ot(r,e);"<div data-block='0'></div>"===o&&(o=""),e.sv.element.innerHTML=o,q(e.sv.element),at(e,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),G(e)}e.undo.resetIcon(e),"string"!=typeof n&&(e[e.currentMode].element.focus(),Re(e)),O(e),K(e),e.toolbar.elements["edit-mode"]&&(e.toolbar.elements["edit-mode"].querySelectorAll("button").forEach(function(e){e.classList.remove("vditor-menu--current")}),e.toolbar.elements["edit-mode"].querySelector('button[data-mode="'.concat(e.currentMode,'"]')).classList.add("vditor-menu--current")),e.outline.toggle(e,"sv"!==e.currentMode&&e.options.outline.enable,"string"!=typeof n)}},Ge=function(e){function t(t,n){var r=e.call(this,t,n)||this,i=document.createElement("div");return i.className="vditor-hint".concat(2===n.level?"":" vditor-panel--arrow"),i.innerHTML='<button data-mode="wysiwyg">'.concat(window.VditorI18n.wysiwyg," &lt;").concat((0,s.ns)("⌥⌘7"),'></button>\n<button data-mode="ir">').concat(window.VditorI18n.instantRendering," &lt;").concat((0,s.ns)("⌥⌘8"),'></button>\n<button data-mode="sv">').concat(window.VditorI18n.splitView," &lt;").concat((0,s.ns)("⌥⌘9"),"></button>"),r.element.appendChild(i),r._bindEvent(t,i,n),r}return ze(t,e),t.prototype._bindEvent=function(e,t,n){var r=this.element.children[0];D(e,t,r,n.level),t.children.item(0).addEventListener((0,s.Le)(),function(t){We(e,"wysiwyg",t),t.preventDefault(),t.stopPropagation()}),t.children.item(1).addEventListener((0,s.Le)(),function(t){We(e,"ir",t),t.preventDefault(),t.stopPropagation()}),t.children.item(2).addEventListener((0,s.Le)(),function(t){We(e,"sv",t),t.preventDefault(),t.stopPropagation()})},t}(Ve),Ke=function(e,t){return(0,N.Gb)(e,t)?getSelection().toString():""},Xe=function(e,t){t.addEventListener("focus",function(){e.options.focus&&e.options.focus(u(e)),v(e,["subToolbar","hint"])})},Ze=function(e,t){t.addEventListener("dblclick",function(t){"IMG"===t.target.tagName&&(e.options.image.preview?e.options.image.preview(t.target):e.options.image.isPreview&&(0,U.E)(t.target,e.options.lang,e.options.theme))})},Je=function(e,t){t.addEventListener("blur",function(t){if("ir"===e.currentMode){var n=e.ir.element.querySelector(".vditor-ir__node--expand");n&&n.classList.remove("vditor-ir__node--expand")}else"wysiwyg"!==e.currentMode||e.wysiwyg.selectPopover.contains(t.relatedTarget)||e.wysiwyg.hideComment();e[e.currentMode].range=(0,N.zh)(e),e.options.blur&&e.options.blur(u(e))})},$e=function(e,t){t.addEventListener("dragstart",function(e){e.dataTransfer.setData(i.g.DROP_EDITOR,i.g.DROP_EDITOR)}),t.addEventListener("drop",function(t){t.dataTransfer.getData(i.g.DROP_EDITOR)?Nt(e):(t.dataTransfer.types.includes("Files")||t.dataTransfer.types.includes("text/html"))&&Jt(e,t,{pasteCode:function(e){document.execCommand("insertHTML",!1,e)}})})},Ye=function(e,t,n){t.addEventListener("copy",function(t){return n(t,e)})},Qe=function(e,t,n){t.addEventListener("cut",function(t){n(t,e),e.options.comment.enable&&"wysiwyg"===e.currentMode&&e.wysiwyg.getComments(e),document.execCommand("delete")})},et=function(e){if("wysiwyg"===e.currentMode&&e.options.comment.enable&&e.options.comment.adjustTop(e.wysiwyg.getComments(e,!0)),e.options.typewriterMode){var t=e[e.currentMode].element,n=(0,N.Ny)(t).top;"auto"!==e.options.height||e.element.classList.contains("vditor--fullscreen")||window.scrollTo(window.scrollX,n+e.element.offsetTop+e.toolbar.element.offsetHeight-window.innerHeight/2+10),("auto"!==e.options.height||e.element.classList.contains("vditor--fullscreen"))&&(t.scrollTop=n+t.scrollTop-t.clientHeight/2+10)}},tt=function(e,t){t.addEventListener("keydown",function(t){if(!t.isComposing&&e.options.keydown&&e.options.keydown(t),!(e.options.hint.extend.length>1||e.toolbar.elements.emoji)||!e.hint.select(t,e)){if(e.options.comment.enable&&"wysiwyg"===e.currentMode&&("Backspace"===t.key||j("⌘X",t))&&e.wysiwyg.getComments(e),"sv"===e.currentMode){if(function(e,t){var n,r,i,o,u;if(e.sv.composingLock=t.isComposing,t.isComposing)return!1;if(-1!==t.key.indexOf("Arrow")||"Meta"===t.key||"Control"===t.key||"Alt"===t.key||"Shift"===t.key||"CapsLock"===t.key||"Escape"===t.key||/^F\d{1,2}$/.test(t.key)||e.undo.recordFirstPosition(e,t),"Enter"!==t.key&&"Tab"!==t.key&&"Backspace"!==t.key&&-1===t.key.indexOf("Arrow")&&!(0,s.yl)(t)&&"Escape"!==t.key)return!1;var a=(0,N.zh)(e),l=a.startContainer;3!==a.startContainer.nodeType&&"DIV"===a.startContainer.tagName&&(l=a.startContainer.childNodes[a.startOffset-1]);var c=(0,g.a1)(l,"data-type","text"),d=(0,g.a1)(l,"data-type","blockquote-marker");if(!d&&0===a.startOffset&&c&&c.previousElementSibling&&"blockquote-marker"===c.previousElementSibling.getAttribute("data-type")&&(d=c.previousElementSibling),d&&"Enter"===t.key&&!(0,s.yl)(t)&&!t.altKey&&""===d.nextElementSibling.textContent.trim()&&(0,N.im)(d,e.sv.element,a).start===d.textContent.length)return"padding"===(null===(n=d.previousElementSibling)||void 0===n?void 0:n.getAttribute("data-type"))&&d.previousElementSibling.setAttribute("data-action","enter-remove"),d.remove(),at(e),t.preventDefault(),!0;var p=(0,g.a1)(l,"data-type","li-marker"),f=(0,g.a1)(l,"data-type","task-marker"),h=p;if(h||f&&"task-marker"!==f.nextElementSibling.getAttribute("data-type")&&(h=f),h||0!==a.startOffset||!c||!c.previousElementSibling||"li-marker"!==c.previousElementSibling.getAttribute("data-type")&&"task-marker"!==c.previousElementSibling.getAttribute("data-type")||(h=c.previousElementSibling),h){var m=(0,N.im)(h,e.sv.element,a).start,v="task-marker"===h.getAttribute("data-type"),D=h;if(v&&(D=h.previousElementSibling.previousElementSibling.previousElementSibling),m===h.textContent.length){if("Enter"===t.key&&!(0,s.yl)(t)&&!t.altKey&&!t.shiftKey&&""===h.nextElementSibling.textContent.trim())return"padding"===(null===(r=D.previousElementSibling)||void 0===r?void 0:r.getAttribute("data-type"))?(D.previousElementSibling.remove(),V(e)):(v&&(D.remove(),h.previousElementSibling.previousElementSibling.remove(),h.previousElementSibling.remove()),h.nextElementSibling.remove(),h.remove(),at(e)),t.preventDefault(),!0;if("Tab"===t.key)return t.shiftKey?"padding"===D.previousElementSibling.getAttribute("data-type")&&D.previousElementSibling.remove():D.insertAdjacentHTML("beforebegin",'<span data-type="padding">'.concat(D.textContent.replace(/\S/g," "),"</span>")),/^\d/.test(D.textContent)&&(D.textContent=D.textContent.replace(/^\d{1,}/,"1"),a.selectNodeContents(h.firstChild),a.collapse(!1)),V(e),t.preventDefault(),!0}}if(Ht(e,a,t))return!0;var y=(0,g.a1)(l,"data-block","0"),E=(0,b.S)(l,"SPAN");if("Enter"===t.key&&!(0,s.yl)(t)&&!t.altKey&&!t.shiftKey&&y){var C=!1,w=y.textContent.match(/^\n+/);(0,N.im)(y,e.sv.element).start<=(w?w[0].length:0)&&(C=!0);var A="\n";if(E){if("enter-remove"===(null===(i=E.previousElementSibling)||void 0===i?void 0:i.getAttribute("data-action")))return E.previousElementSibling.remove(),at(e),t.preventDefault(),!0;A+=ut(E)}return a.insertNode(document.createTextNode(A)),a.collapse(!1),y&&""!==y.textContent.trim()&&!C?V(e):at(e),t.preventDefault(),!0}if("Backspace"===t.key&&!(0,s.yl)(t)&&!t.altKey&&!t.shiftKey){if(E&&"newline"===(null===(o=E.previousElementSibling)||void 0===o?void 0:o.getAttribute("data-type"))&&1===(0,N.im)(E,e.sv.element,a).start&&-1===E.getAttribute("data-type").indexOf("code-block-"))return a.setStart(E,0),a.extractContents(),""!==E.textContent.trim()?V(e):at(e),t.preventDefault(),!0;if(y&&0===(0,N.im)(y,e.sv.element,a).start&&y.previousElementSibling){a.extractContents();var _=y.previousElementSibling.lastElementChild;return"newline"===_.getAttribute("data-type")&&(_.remove(),_=y.previousElementSibling.lastElementChild),"newline"!==_.getAttribute("data-type")&&(_.insertAdjacentHTML("afterend",y.innerHTML),y.remove()),""===y.textContent.trim()||(null===(u=y.previousElementSibling)||void 0===u?void 0:u.querySelector('[data-type="code-block-open-marker"]'))?("newline"!==_.getAttribute("data-type")&&(a.selectNodeContents(_.lastChild),a.collapse(!1)),at(e)):V(e),t.preventDefault(),!0}}return!1}(e,t))return}else if("wysiwyg"===e.currentMode){if(function(e,t){if(e.wysiwyg.composingLock=t.isComposing,t.isComposing)return!1;-1!==t.key.indexOf("Arrow")||"Meta"===t.key||"Control"===t.key||"Alt"===t.key||"Shift"===t.key||"CapsLock"===t.key||"Escape"===t.key||/^F\d{1,2}$/.test(t.key)||e.undo.recordFirstPosition(e,t);var n=(0,N.zh)(e),r=n.startContainer;if(!bt(t,e,r))return!1;if(yt(n,e,t),Xt(n),"Enter"!==t.key&&"Tab"!==t.key&&"Backspace"!==t.key&&-1===t.key.indexOf("Arrow")&&!(0,s.yl)(t)&&"Escape"!==t.key&&"Delete"!==t.key)return!1;var o=(0,g.F9)(r),u=(0,g.lG)(r,"P");if(It(t,e,u,n))return!0;if(Ot(n,e,u,t))return!0;if(Vt(e,t,n))return!0;var a=(0,g.fb)(r,"vditor-wysiwyg__block");if(a){if("Escape"===t.key&&2===a.children.length)return e.wysiwyg.popover.style.display="none",a.firstElementChild.style.display="none",e.wysiwyg.element.blur(),t.preventDefault(),!0;if(!(0,s.yl)(t)&&!t.shiftKey&&t.altKey&&"Enter"===t.key&&"code-block"===a.getAttribute("data-type")){var l=e.wysiwyg.popover.querySelector(".vditor-input");return l.focus(),l.select(),t.preventDefault(),!0}if("0"===a.getAttribute("data-block")){if(zt(e,t,a.firstElementChild,n))return!0;if(Ft(e,t,n,a.firstElementChild,a))return!0;if("yaml-front-matter"!==a.getAttribute("data-type")&&kt(e,t,n,a.firstElementChild,a))return!0}}if(Wt(e,n,t,u))return!0;var c=(0,g.E2)(r,"BLOCKQUOTE");if(c&&!t.shiftKey&&t.altKey&&"Enter"===t.key){(0,s.yl)(t)?n.setStartBefore(c):n.setStartAfter(c),(0,N.Hc)(n);var d=document.createElement("p");return d.setAttribute("data-block","0"),d.innerHTML="\n",n.insertNode(d),n.collapse(!0),(0,N.Hc)(n),Ee(e),et(e),t.preventDefault(),!0}var p,f=(0,b.W)(r);if(f){if("H6"===f.tagName&&r.textContent.length===n.startOffset&&!(0,s.yl)(t)&&!t.shiftKey&&!t.altKey&&"Enter"===t.key){var h=document.createElement("p");return h.textContent="\n",h.setAttribute("data-block","0"),r.parentElement.insertAdjacentElement("afterend",h),n.setStart(h,0),(0,N.Hc)(n),Ee(e),et(e),t.preventDefault(),!0}var m;if(j("⌘=",t))return(m=parseInt(f.tagName.substr(1),10)-1)>0&&(_e(e,"h".concat(m)),Ee(e)),t.preventDefault(),!0;if(j("⌘-",t))return(m=parseInt(f.tagName.substr(1),10)+1)<7&&(_e(e,"h".concat(m)),Ee(e)),t.preventDefault(),!0;"Backspace"!==t.key||(0,s.yl)(t)||t.shiftKey||t.altKey||1!==f.textContent.length||Fe(e)}if(Gt(e,n,t))return!0;if(t.altKey&&"Enter"===t.key&&!(0,s.yl)(t)&&!t.shiftKey){var v=(0,g.lG)(r,"A"),D=(0,g.a1)(r,"data-type","link-ref"),y=(0,g.a1)(r,"data-type","footnotes-ref");if(v||D||y||f&&2===f.tagName.length){var E=e.wysiwyg.popover.querySelector("input");E.focus(),E.select()}}if(Se(e,t))return!0;if(j("⇧⌘U",t)&&(p=e.wysiwyg.popover.querySelector('[data-type="up"]')))return p.click(),t.preventDefault(),!0;if(j("⇧⌘D",t)&&(p=e.wysiwyg.popover.querySelector('[data-type="down"]')))return p.click(),t.preventDefault(),!0;if(Ht(e,n,t))return!0;if(!(0,s.yl)(t)&&t.shiftKey&&!t.altKey&&"Enter"===t.key&&"LI"!==r.parentElement.tagName&&"P"!==r.parentElement.tagName)return["STRONG","STRIKE","S","I","EM","B"].includes(r.parentElement.tagName)?n.insertNode(document.createTextNode("\n"+i.g.ZWSP)):n.insertNode(document.createTextNode("\n")),n.collapse(!1),(0,N.Hc)(n),Ee(e),et(e),t.preventDefault(),!0;if("Backspace"===t.key&&!(0,s.yl)(t)&&!t.shiftKey&&!t.altKey&&""===n.toString()){if(Kt(e,n,t,u))return!0;if(o){if(o.previousElementSibling&&o.previousElementSibling.classList.contains("vditor-wysiwyg__block")&&"0"===o.previousElementSibling.getAttribute("data-block")&&"UL"!==o.tagName&&"OL"!==o.tagName){var C=(0,N.im)(o,e.wysiwyg.element,n).start;if(0===C&&0===n.startOffset||1===C&&o.innerText.startsWith(i.g.ZWSP))return ke(o.previousElementSibling.lastElementChild,e,!1),""===o.innerHTML.trim().replace(i.g.ZWSP,"")&&(o.remove(),Ee(e)),t.preventDefault(),!0}var w=n.startOffset;if(""===n.toString()&&3===r.nodeType&&"\n"===r.textContent.charAt(w-2)&&r.textContent.charAt(w-1)!==i.g.ZWSP&&["STRONG","STRIKE","S","I","EM","B"].includes(r.parentElement.tagName))return r.textContent=r.textContent.substring(0,w-1)+i.g.ZWSP,n.setStart(r,w),n.collapse(!0),Ee(e),t.preventDefault(),!0;r.textContent===i.g.ZWSP&&1===n.startOffset&&!r.previousSibling&&function(e){for(var t=e.startContainer.nextSibling;t&&""===t.textContent;)t=t.nextSibling;return!(!t||3===t.nodeType||"CODE"!==t.tagName&&"math-inline"!==t.getAttribute("data-type")&&"html-entity"!==t.getAttribute("data-type")&&"html-inline"!==t.getAttribute("data-type"))}(n)&&(r.textContent=""),o.querySelectorAll("span.vditor-wysiwyg__block[data-type='math-inline']").forEach(function(e){e.firstElementChild.style.display="inline",e.lastElementChild.style.display="none"}),o.querySelectorAll("span.vditor-wysiwyg__block[data-type='html-entity']").forEach(function(e){e.firstElementChild.style.display="inline",e.lastElementChild.style.display="none"})}}if((0,s.vU)()&&1===n.startOffset&&r.textContent.indexOf(i.g.ZWSP)>-1&&r.previousSibling&&3!==r.previousSibling.nodeType&&"CODE"===r.previousSibling.tagName&&("Backspace"===t.key||"ArrowLeft"===t.key))return n.selectNodeContents(r.previousSibling),n.collapse(!1),t.preventDefault(),!0;if(Zt(t,o,n))return t.preventDefault(),!0;if(Et(n,t.key),"ArrowDown"===t.key){var A=r.nextSibling;A&&3!==A.nodeType&&"math-inline"===A.getAttribute("data-type")&&n.setStartAfter(A)}return!(!o||!I(o,e,t,n)||(t.preventDefault(),0))}(e,t))return}else if("ir"===e.currentMode&&function(e,t){if(e.ir.composingLock=t.isComposing,t.isComposing)return!1;-1!==t.key.indexOf("Arrow")||"Meta"===t.key||"Control"===t.key||"Alt"===t.key||"Shift"===t.key||"CapsLock"===t.key||"Escape"===t.key||/^F\d{1,2}$/.test(t.key)||e.undo.recordFirstPosition(e,t);var n=(0,N.zh)(e),r=n.startContainer;if(!bt(t,e,r))return!1;if(yt(n,e,t),Xt(n),"Enter"!==t.key&&"Tab"!==t.key&&"Backspace"!==t.key&&-1===t.key.indexOf("Arrow")&&!(0,s.yl)(t)&&"Escape"!==t.key&&"Delete"!==t.key)return!1;var o=(0,g.a1)(r,"data-newline","1");if(!(0,s.yl)(t)&&!t.altKey&&!t.shiftKey&&"Enter"===t.key&&o&&n.startOffset<o.textContent.length){var u=o.previousElementSibling;u&&(n.insertNode(document.createTextNode(u.textContent)),n.collapse(!1));var a=o.nextSibling;a&&(n.insertNode(document.createTextNode(a.textContent)),n.collapse(!0))}var l=(0,g.lG)(r,"P");if(It(t,e,l,n))return!0;if(Ot(n,e,l,t))return!0;if(Wt(e,n,t,l))return!0;var c=(0,g.fb)(r,"vditor-ir__marker--pre");if(c&&"PRE"===c.tagName){var d=c.firstChild;if(zt(e,t,c,n))return!0;if(("math-block"===d.getAttribute("data-type")||"html-block"===d.getAttribute("data-type"))&&kt(e,t,n,d,c.parentElement))return!0;if(Ft(e,t,n,d,c.parentElement))return!0}var p=(0,g.a1)(r,"data-type","code-block-info");if(p){if("Enter"===t.key||"Tab"===t.key)return n.selectNodeContents(p.nextElementSibling.firstChild),n.collapse(!0),t.preventDefault(),v(e,["hint"]),!0;if("Backspace"===t.key){var f=(0,N.im)(p,e.ir.element).start;1===f&&n.setStart(r,0),2===f&&(e.hint.recentLanguage="")}if(kt(e,t,n,p,p.parentElement))return v(e,["hint"]),!0}var h=(0,g.lG)(r,"TD")||(0,g.lG)(r,"TH");if(t.key.indexOf("Arrow")>-1&&h){var m=wt(h);if(m&&kt(e,t,n,h,m))return!0;var D=At(h);if(D&&Ft(e,t,n,h,D))return!0}if(Vt(e,t,n))return!0;if(Gt(e,n,t))return!0;if(Ht(e,n,t))return!0;var y=(0,b.W)(r);if(y){var E;if(j("⌘=",t))return(E=y.querySelector(".vditor-ir__marker--heading"))&&E.textContent.trim().length>1&&tn(e,E.textContent.substr(1)),t.preventDefault(),!0;if(j("⌘-",t))return(E=y.querySelector(".vditor-ir__marker--heading"))&&E.textContent.trim().length<6&&tn(e,E.textContent.trim()+"# "),t.preventDefault(),!0}var C=(0,g.F9)(r);if("Backspace"===t.key&&!(0,s.yl)(t)&&!t.shiftKey&&!t.altKey&&""===n.toString()){if(Kt(e,n,t,l))return!0;if(C&&C.previousElementSibling&&"UL"!==C.tagName&&"OL"!==C.tagName&&("code-block"===C.previousElementSibling.getAttribute("data-type")||"math-block"===C.previousElementSibling.getAttribute("data-type"))){var w=(0,N.im)(C,e.ir.element,n).start;if(0===w||1===w&&C.innerText.startsWith(i.g.ZWSP))return n.selectNodeContents(C.previousElementSibling.querySelector(".vditor-ir__marker--pre code")),n.collapse(!1),R(n,e),""===C.textContent.trim().replace(i.g.ZWSP,"")&&(C.remove(),en(e)),t.preventDefault(),!0}if(y){var A=y.firstElementChild.textContent.length;(0,N.im)(y,e.ir.element).start===A&&0!==A&&(n.setStart(y.firstElementChild.firstChild,A-1),n.collapse(!0),(0,N.Hc)(n))}}return!(("ArrowUp"!==t.key&&"ArrowDown"!==t.key||!C||(C.querySelectorAll(".vditor-ir__node").forEach(function(e){e.contains(r)||e.classList.add("vditor-ir__node--hidden")}),!Zt(t,C,n)))&&(Et(n,t.key),!C||!I(C,e,t,n)||(t.preventDefault(),0)))}(e,t))return;if(e.options.ctrlEnter&&j("⌘Enter",t))return e.options.ctrlEnter(u(e)),void t.preventDefault();if(j("⌘Z",t)&&!e.toolbar.elements.undo)return e.undo.undo(e),void t.preventDefault();if(j("⌘Y",t)&&!e.toolbar.elements.redo)return e.undo.redo(e),void t.preventDefault();if("Escape"===t.key)return"block"===e.hint.element.style.display?e.hint.element.style.display="none":e.options.esc&&!t.isComposing&&e.options.esc(u(e)),void t.preventDefault();if((0,s.yl)(t)&&t.altKey&&!t.shiftKey&&/^Digit[1-6]$/.test(t.code)){if("wysiwyg"===e.currentMode){var n=t.code.replace("Digit","H");(0,g.lG)(getSelection().getRangeAt(0).startContainer,n)?Fe(e):_e(e,n),Ee(e)}else"sv"===e.currentMode?lt(e,"#".repeat(parseInt(t.code.replace("Digit",""),10))+" "):"ir"===e.currentMode&&tn(e,"#".repeat(parseInt(t.code.replace("Digit",""),10))+" ");return t.preventDefault(),!0}if((0,s.yl)(t)&&t.altKey&&!t.shiftKey&&/^Digit[7-9]$/.test(t.code))return"Digit7"===t.code?We(e,"wysiwyg",t):"Digit8"===t.code?We(e,"ir",t):"Digit9"===t.code&&We(e,"sv",t),!0;e.options.toolbar.find(function(n){return!n.hotkey||n.toolbar?!!n.toolbar&&!!n.toolbar.find(function(n){return!!n.hotkey&&(j(n.hotkey,t)?(e.toolbar.elements[n.name].children[0].dispatchEvent(new CustomEvent((0,s.Le)())),t.preventDefault(),!0):void 0)}):j(n.hotkey,t)?(e.toolbar.elements[n.name].children[0].dispatchEvent(new CustomEvent((0,s.Le)())),t.preventDefault(),!0):void 0})}})},nt=function(e,t){t.addEventListener("selectstart",function(n){t.onmouseup=function(){setTimeout(function(){var t=Ke(e[e.currentMode].element);t.trim()?("wysiwyg"===e.currentMode&&e.options.comment.enable&&((0,g.a1)(n.target,"data-type","footnotes-block")||(0,g.a1)(n.target,"data-type","link-ref-defs-block")?e.wysiwyg.hideComment():e.wysiwyg.showComment()),e.options.select&&e.options.select(t)):("wysiwyg"===e.currentMode&&e.options.comment.enable&&e.wysiwyg.hideComment(),"function"==typeof e.options.unSelect&&e.options.unSelect())})}})},rt=function(e,t){var n=(0,N.zh)(e);n.extractContents(),n.insertNode(document.createTextNode(Lute.Caret)),n.insertNode(document.createTextNode(t));var r=(0,g.a1)(n.startContainer,"data-block","0");r||(r=e.sv.element);var i=e.lute.SpinVditorSVDOM(r.textContent);i="<div data-block='0'>"+i.replace(/<span data-type="newline"><br \/><span style="display: none">\n<\/span><\/span><span data-type="newline"><br \/><span style="display: none">\n<\/span><\/span></g,'<span data-type="newline"><br /><span style="display: none">\n</span></span><span data-type="newline"><br /><span style="display: none">\n</span></span></div><div data-block="0"><')+"</div>",r.isEqualNode(e.sv.element)?r.innerHTML=i:r.outerHTML=i,q(e.sv.element),(0,N.ib)(e.sv.element,n),et(e)},it=function(e,t,n){void 0===n&&(n=!0);var r=e;for(3===r.nodeType&&(r=r.parentElement);r;){if(r.getAttribute("data-type")===t)return r;r=n?r.previousElementSibling:r.nextElementSibling}return!1},ot=function(e,t){return t.options.debugger,e="<div data-block='0'>"+t.lute.SpinVditorSVDOM(e).replace(/<span data-type="newline"><br \/><span style="display: none">\n<\/span><\/span><span data-type="newline"><br \/><span style="display: none">\n<\/span><\/span></g,'<span data-type="newline"><br /><span style="display: none">\n</span></span><span data-type="newline"><br /><span style="display: none">\n</span></span></div><div data-block="0"><')+"</div>",t.options.debugger,e},ut=function(e){var t=e.getAttribute("data-type"),n=e.previousElementSibling,r=t&&"text"!==t&&"table"!==t&&"heading-marker"!==t&&"newline"!==t&&"yaml-front-matter-open-marker"!==t&&"yaml-front-matter-close-marker"!==t&&"code-block-info"!==t&&"code-block-close-marker"!==t&&"code-block-open-marker"!==t?e.textContent:"",i=!1;for("newline"===t&&(i=!0);n&&!i;){var o=n.getAttribute("data-type");if("li-marker"===o||"blockquote-marker"===o||"task-marker"===o||"padding"===o){var u=n.textContent;if("li-marker"!==o||"code-block-open-marker"!==t&&"code-block-info"!==t)if("code-block-close-marker"===t&&n.nextElementSibling.isSameNode(e)){var a=it(e,"code-block-open-marker");a&&a.previousElementSibling&&(n=a.previousElementSibling,r=u+r)}else r=u+r;else r=u.replace(/\S/g," ")+r}else"newline"===o&&(i=!0);n=n.previousElementSibling}return r},at=function(e,t){void 0===t&&(t={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),t.enableHint&&e.hint.render(e),e.preview.render(e);var n=u(e);"function"==typeof e.options.input&&t.enableInput&&e.options.input(n),e.options.counter.enable&&e.counter.render(e,n),e.options.cache.enable&&(0,s.pK)()&&(localStorage.setItem(e.options.cache.id,n),e.options.cache.after&&e.options.cache.after(n)),e.devtools&&e.devtools.renderEchart(e),clearTimeout(e.sv.processTimeoutId),e.sv.processTimeoutId=window.setTimeout(function(){t.enableAddUndoStack&&!e.sv.composingLock&&e.undo.addToUndoStack(e)},e.options.undoDelay)},lt=function(e,t){var n=(0,N.zh)(e),r=(0,b.S)(n.startContainer,"SPAN");r&&""!==r.textContent.trim()&&(t="\n"+t),n.collapse(!0),document.execCommand("insertHTML",!1,t)},st=function(e,t,n,r){var i=(0,N.zh)(e),o=t.getAttribute("data-type");0===e.sv.element.childNodes.length&&(e.sv.element.innerHTML='<span data-type="p" data-block="0"><span data-type="text"><wbr></span></span><span data-type="newline"><br><span style="display: none">\n</span></span>',(0,N.ib)(e.sv.element,i));var u=(0,g.F9)(i.startContainer),a=(0,b.S)(i.startContainer,"SPAN");if(u){if("link"===o){var l=void 0;return l=""===i.toString()?"".concat(n).concat(Lute.Caret).concat(r):"".concat(n).concat(i.toString()).concat(r.replace(")",Lute.Caret+")")),void document.execCommand("insertHTML",!1,l)}if("italic"===o||"bold"===o||"strike"===o||"inline-code"===o||"code"===o||"table"===o||"line"===o)return l=void 0,l=""===i.toString()?"".concat(n).concat(Lute.Caret).concat("code"===o?"":r):"".concat(n).concat(i.toString()).concat(Lute.Caret).concat("code"===o?"":r),"table"===o||"code"===o&&a&&""!==a.textContent?l="\n\n"+l:"line"===o&&(l="\n\n".concat(n,"\n").concat(Lute.Caret)),void document.execCommand("insertHTML",!1,l);if(("check"===o||"list"===o||"ordered-list"===o||"quote"===o)&&a){var s="* ";"check"===o?s="* [ ] ":"ordered-list"===o?s="1. ":"quote"===o&&(s="> ");var c=it(a,"newline");return c?c.insertAdjacentText("afterend",s):u.insertAdjacentText("afterbegin",s),void V(e)}(0,N.ib)(e.sv.element,i),at(e)}},ct=function(e){switch(e.currentMode){case"ir":return e.ir.element;case"wysiwyg":return e.wysiwyg.element;case"sv":return e.sv.element}},dt=function(e,t){e.options.upload.setHeaders&&(e.options.upload.headers=e.options.upload.setHeaders()),e.options.upload.headers&&Object.keys(e.options.upload.headers).forEach(function(n){t.setRequestHeader(n,e.options.upload.headers[n])})},pt=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function u(e){try{l(r.next(e))}catch(je){o(je)}}function a(e){try{l(r.throw(e))}catch(je){o(je)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(u,a)}l((r=r.apply(e,t||[])).next())})},ft=function(e,t){var n,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(u=0)),u;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,r=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){u=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){u.label=a[1];break}if(6===a[0]&&u.label<i[1]){u.label=i[1],i=a;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(a);break}i[2]&&u.ops.pop(),u.trys.pop();continue}a=t.call(e,u)}catch(je){a=[6,je],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}},ht=function(){this.isUploading=!1,this.element=document.createElement("div"),this.element.className="vditor-upload"},mt=function(e,t,n){return pt(void 0,void 0,void 0,function(){var r,i,o,u,a,l,s,c,d,p,f,h,m,v;return ft(this,function(D){switch(D.label){case 0:for(r=[],i=!0===e.options.upload.multiple?t.length:1,h=0;h<i;h++)(o=t[h])instanceof DataTransferItem&&(o=o.getAsFile()),r.push(o);return e.options.upload.handler?[4,e.options.upload.handler(r)]:[3,2];case 1:return u=D.sent(),n&&(n.value=""),"string"==typeof u?(e.tip.show(u),[2]):[2];case 2:return e.options.upload.url&&e.upload?e.options.upload.file?[4,e.options.upload.file(r)]:[3,4]:(n&&(n.value=""),e.tip.show("please config: options.upload.url"),[2]);case 3:r=D.sent(),D.label=4;case 4:if(e.options.upload.validate&&"string"==typeof(u=e.options.upload.validate(r)))return e.tip.show(u),[2];if(a=ct(e),e.upload.range=(0,N.zh)(e),l=function(e,t){e.tip.hide();var n=[],r="",i="";e.options.lang,e.options;for(var o=function(o,u){var a=t[u],l=!0;a.name||(r+="<li>".concat(window.VditorI18n.nameEmpty,"</li>"),l=!1),a.size>e.options.upload.max&&(r+="<li>".concat(a.name," ").concat(window.VditorI18n.over," ").concat(e.options.upload.max/1024/1024,"M</li>"),l=!1);var s=a.name.lastIndexOf("."),c=a.name.substr(s),d=e.options.upload.filename(a.name.substr(0,s))+c;e.options.upload.accept&&(e.options.upload.accept.split(",").some(function(e){var t=e.trim();if(0===t.indexOf(".")){if(c.toLowerCase()===t.toLowerCase())return!0}else if(a.type.split("/")[0]===t.split("/")[0])return!0;return!1})||(r+="<li>".concat(a.name," ").concat(window.VditorI18n.fileTypeError,"</li>"),l=!1)),l&&(n.push(a),i+="<li>".concat(d," ").concat(window.VditorI18n.uploading,' <a class="vditorCancelUpload" href="javascript:void(0)">').concat(window.VditorI18n.cancelUpload,"</a></li>"))},u=t.length,a=0;a<u;a++)o(0,a);if(e.tip.show("<ul>".concat(r).concat(i,"</ul>")),e.options.upload.cancel){var l=e.tip.element.querySelector(".vditorCancelUpload");l&&l.addEventListener("click",function(){e.options.upload.cancel(n),e.tip.hide(),e.upload.isUploading=!1})}return n}(e,r),0===l.length)return n&&(n.value=""),[2];for(s=new FormData,c=e.options.upload.extraData,d=0,p=Object.keys(c);d<p.length;d++)f=p[d],s.append(f,c[f]);for(h=0,m=l.length;h<m;h++)s.append(e.options.upload.fieldName,l[h]);return v=new XMLHttpRequest,e.upload.xhr=v,v.open("POST",e.options.upload.url),e.options.upload.token&&v.setRequestHeader("X-Upload-Token",e.options.upload.token),e.options.upload.withCredentials&&(v.withCredentials=!0),dt(e,v),e.upload.isUploading=!0,a.setAttribute("contenteditable","false"),v.onreadystatechange=function(){if(v.readyState===XMLHttpRequest.DONE){if(e.upload.isUploading=!1,a.setAttribute("contenteditable","true"),v.status>=200&&v.status<300)if(e.options.upload.success)e.options.upload.success(a,v.responseText);else{var r=v.responseText;e.options.upload.format&&(r=e.options.upload.format(t,v.responseText)),function(e,t){ct(t).focus();var n=JSON.parse(e),r="";1===n.code&&(r="".concat(n.msg)),n.data.errFiles&&n.data.errFiles.length>0&&(r="<ul><li>".concat(r,"</li>"),n.data.errFiles.forEach(function(e){var n=e.lastIndexOf("."),i=t.options.upload.filename(e.substr(0,n))+e.substr(n);r+="<li>".concat(i," ").concat(window.VditorI18n.uploadError,"</li>")}),r+="</ul>"),r?t.tip.show(r):t.tip.hide();var i="";Object.keys(n.data.succMap).forEach(function(e){var r=n.data.succMap[e],o=e.lastIndexOf("."),u=e.substr(o),a=t.options.upload.filename(e.substr(0,o))+u;0===(u=u.toLowerCase()).indexOf(".wav")||0===u.indexOf(".mp3")||0===u.indexOf(".ogg")?"wysiwyg"===t.currentMode?i+='<div class="vditor-wysiwyg__block" data-type="html-block"\n data-block="0"><pre><code>&lt;audio controls="controls" src="'.concat(r,'"&gt;&lt;/audio&gt;</code></pre><pre class="vditor-wysiwyg__preview" data-render="1"><audio controls="controls" src="').concat(r,'"></audio></pre></div>\n'):"ir"===t.currentMode?i+='<audio controls="controls" src="'.concat(r,'"></audio>\n'):i+="[".concat(a,"](").concat(r,")\n"):0===u.indexOf(".apng")||0===u.indexOf(".bmp")||0===u.indexOf(".gif")||0===u.indexOf(".ico")||0===u.indexOf(".cur")||0===u.indexOf(".jpg")||0===u.indexOf(".jpeg")||0===u.indexOf(".jfif")||0===u.indexOf(".pjp")||0===u.indexOf(".pjpeg")||0===u.indexOf(".png")||0===u.indexOf(".svg")||0===u.indexOf(".webp")?"wysiwyg"===t.currentMode?i+='<img alt="'.concat(a,'" src="').concat(r,'">\n'):i+="![".concat(a,"](").concat(r,")\n"):"wysiwyg"===t.currentMode?i+='<a href="'.concat(r,'">').concat(a,"</a>\n"):i+="[".concat(a,"](").concat(r,")\n")}),(0,N.Hc)(t.upload.range),document.execCommand("insertHTML",!1,i),t.upload.range=getSelection().getRangeAt(0).cloneRange()}(r,e)}else e.options.upload.error?e.options.upload.error(v.responseText):e.tip.show(v.responseText);n&&(n.value=""),e.upload.element.style.display="none",e.upload.xhr=void 0}},v.upload.onprogress=function(t){if(t.lengthComputable){var n=t.loaded/t.total*100;e.upload.element.style.display="block",e.upload.element.style.width=n+"%"}},v.send(s),[2]}})})},vt=function(e,t,n){var r,o=(0,g.F9)(t.startContainer);if(o||(o=e.wysiwyg.element),n&&"formatItalic"!==n.inputType&&"deleteByDrag"!==n.inputType&&"insertFromDrop"!==n.inputType&&"formatBold"!==n.inputType&&"formatRemove"!==n.inputType&&"formatStrikeThrough"!==n.inputType&&"insertUnorderedList"!==n.inputType&&"insertOrderedList"!==n.inputType&&"formatOutdent"!==n.inputType&&"formatIndent"!==n.inputType&&""!==n.inputType||!n){var u=function(e){for(var t=e.previousSibling;t;){if(3!==t.nodeType&&"A"===t.tagName&&!t.previousSibling&&""===t.innerHTML.replace(i.g.ZWSP,"")&&t.nextSibling)return t;t=t.previousSibling}return!1}(t.startContainer);u&&u.remove(),e.wysiwyg.element.querySelectorAll("wbr").forEach(function(e){e.remove()}),t.insertNode(document.createElement("wbr")),o.querySelectorAll("[style]").forEach(function(e){e.removeAttribute("style")}),o.querySelectorAll(".vditor-comment").forEach(function(e){""===e.textContent.trim()&&(e.classList.remove("vditor-comment","vditor-comment--focus"),e.removeAttribute("data-cmtids"))}),null===(r=o.previousElementSibling)||void 0===r||r.querySelectorAll(".vditor-comment").forEach(function(e){""===e.textContent.trim()&&(e.classList.remove("vditor-comment","vditor-comment--focus"),e.removeAttribute("data-cmtids"))});var a="";"link-ref-defs-block"===o.getAttribute("data-type")&&(o=e.wysiwyg.element);var l,s=o.isEqualNode(e.wysiwyg.element),c=(0,g.a1)(o,"data-type","footnotes-block");if(s)a=o.innerHTML;else{var d=(0,g.O9)(t.startContainer);if(d&&!c){var p=(0,b.S)(t.startContainer,"BLOCKQUOTE");o=p?(0,g.F9)(t.startContainer)||o:d}if(c&&(o=c),a=o.outerHTML,"UL"===o.tagName||"OL"===o.tagName){var f=o.previousElementSibling,h=o.nextElementSibling;!f||"UL"!==f.tagName&&"OL"!==f.tagName||(a=f.outerHTML+a,f.remove()),!h||"UL"!==h.tagName&&"OL"!==h.tagName||(a+=h.outerHTML,h.remove()),a=a.replace("<div><wbr><br></div>","<li><p><wbr><br></p></li>")}o.innerText.startsWith("```")||(e.wysiwyg.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(e){e&&!o.isEqualNode(e)&&(a+=e.outerHTML,e.remove())}),e.wysiwyg.element.querySelectorAll("[data-type='footnotes-block']").forEach(function(e){e&&!o.isEqualNode(e)&&(a+=e.outerHTML,e.remove())}))}if('<p data-block="0">```<wbr></p>'===(a=a.replace(/<\/(strong|b)><strong data-marker="\W{2}">/g,"").replace(/<\/(em|i)><em data-marker="\W{1}">/g,"").replace(/<\/(s|strike)><s data-marker="~{1,2}">/g,""))&&e.hint.recentLanguage&&(a='<p data-block="0">```<wbr></p>'.replace("```","```"+e.hint.recentLanguage)),e.options.debugger,a=e.lute.SpinVditorDOM(a),e.options.debugger,s)o.innerHTML=a;else if(o.outerHTML=a,c){var m=(0,g.E2)(e.wysiwyg.element.querySelector("wbr"),"LI");if(m){var v=e.wysiwyg.element.querySelector('sup[data-type="footnotes-ref"][data-footnotes-label="'.concat(m.getAttribute("data-marker"),'"]'));v&&v.setAttribute("aria-label",m.textContent.trim().substr(0,24))}}var D,y=e.wysiwyg.element.querySelectorAll("[data-type='link-ref-defs-block']");y.forEach(function(e,t){0===t?l=e:(l.insertAdjacentHTML("beforeend",e.innerHTML),e.remove())}),y.length>0&&e.wysiwyg.element.insertAdjacentElement("beforeend",y[0]);var E=e.wysiwyg.element.querySelectorAll("[data-type='footnotes-block']");E.forEach(function(e,t){0===t?D=e:(D.insertAdjacentHTML("beforeend",e.innerHTML),e.remove())}),E.length>0&&e.wysiwyg.element.insertAdjacentElement("beforeend",E[0]),(0,N.ib)(e.wysiwyg.element,t),e.wysiwyg.element.querySelectorAll(".vditor-wysiwyg__preview[data-render='2']").forEach(function(t){M(t,e)}),n&&("deleteContentBackward"===n.inputType||"deleteContentForward"===n.inputType)&&e.options.comment.enable&&(e.wysiwyg.triggerRemoveComment(e),e.options.comment.adjustTop(e.wysiwyg.getComments(e,!0)))}O(e),Ee(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})},Dt=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function u(e){try{l(r.next(e))}catch(je){o(je)}}function a(e){try{l(r.throw(e))}catch(je){o(je)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(u,a)}l((r=r.apply(e,t||[])).next())})},gt=function(e,t){var n,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(u=0)),u;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,r=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){u=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){u.label=a[1];break}if(6===a[0]&&u.label<i[1]){u.label=i[1],i=a;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(a);break}i[2]&&u.ops.pop(),u.trys.pop();continue}a=t.call(e,u)}catch(je){a=[6,je],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}},bt=function(e,t,n){if(229===e.keyCode&&""===e.code&&"Unidentified"===e.key&&"sv"!==t.currentMode){var r=(0,g.F9)(n);if(r&&""===r.textContent.trim())return t[t.currentMode].composingLock=!0,!1}return!0},yt=function(e,t,n){if(!("Enter"===n.key||"Tab"===n.key||"Backspace"===n.key||n.key.indexOf("Arrow")>-1||(0,s.yl)(n)||"Escape"===n.key||n.shiftKey||n.altKey)){var r=(0,g.lG)(e.startContainer,"P")||(0,g.lG)(e.startContainer,"LI");if(r&&0===(0,N.im)(r,t[t.currentMode].element,e).start){r.nodeValue&&(r.nodeValue=r.nodeValue.replace(/\u2006/g,""));var o=document.createTextNode(i.g.ZWSP);e.insertNode(o),e.setStartAfter(o)}}},Et=function(e,t){if("ArrowDown"===t||"ArrowUp"===t){var n=(0,g.a1)(e.startContainer,"data-type","math-inline")||(0,g.a1)(e.startContainer,"data-type","html-entity")||(0,g.a1)(e.startContainer,"data-type","html-inline");n&&("ArrowDown"===t&&e.setStartAfter(n.parentElement),"ArrowUp"===t&&e.setStartBefore(n.parentElement))}},Ct=function(e,t){var n=(0,N.zh)(e),r=(0,g.F9)(n.startContainer);r&&(r.insertAdjacentHTML(t,'<p data-block="0">'.concat(i.g.ZWSP,"<wbr>\n</p>")),(0,N.ib)(e[e.currentMode].element,n),Re(e),Nt(e))},wt=function(e){var t=(0,g.lG)(e,"TABLE");return!(!t||!t.rows[0].cells[0].isSameNode(e))&&t},At=function(e){var t=(0,g.lG)(e,"TABLE");return!(!t||!t.lastElementChild.lastElementChild.lastElementChild.isSameNode(e))&&t},_t=function(e,t,n){void 0===n&&(n=!0);var r=e.previousElementSibling;return r||(r=e.parentElement.previousElementSibling?e.parentElement.previousElementSibling.lastElementChild:"TBODY"===e.parentElement.parentElement.tagName&&e.parentElement.parentElement.previousElementSibling?e.parentElement.parentElement.previousElementSibling.lastElementChild.lastElementChild:null),r&&(t.selectNodeContents(r),n||t.collapse(!1),(0,N.Hc)(t)),r},Ft=function(e,t,n,r,o){var u=(0,N.im)(r,e[e.currentMode].element,n);if("ArrowDown"===t.key&&-1===r.textContent.trimRight().substr(u.start).indexOf("\n")||"ArrowRight"===t.key&&u.start>=r.textContent.trimRight().length){var a=o.nextElementSibling;return!a||a&&("TABLE"===a.tagName||a.getAttribute("data-type"))?(o.insertAdjacentHTML("afterend",'<p data-block="0">'.concat(i.g.ZWSP,"<wbr></p>")),(0,N.ib)(e[e.currentMode].element,n)):(n.selectNodeContents(a),n.collapse(!0),(0,N.Hc)(n)),t.preventDefault(),!0}return!1},kt=function(e,t,n,r,o){var u=(0,N.im)(r,e[e.currentMode].element,n);if("ArrowUp"===t.key&&-1===r.textContent.substr(0,u.start).indexOf("\n")||("ArrowLeft"===t.key||"Backspace"===t.key&&""===n.toString())&&0===u.start){var a=o.previousElementSibling;return!a||a&&("TABLE"===a.tagName||a.getAttribute("data-type"))?(o.insertAdjacentHTML("beforebegin",'<p data-block="0">'.concat(i.g.ZWSP,"<wbr></p>")),(0,N.ib)(e[e.currentMode].element,n)):(n.selectNodeContents(a),n.collapse(!1),(0,N.Hc)(n)),t.preventDefault(),!0}return!1},St=function(e,t,n,r){void 0===r&&(r=!0);var i=(0,g.lG)(t.startContainer,"LI");if(e[e.currentMode].element.querySelectorAll("wbr").forEach(function(e){e.remove()}),t.insertNode(document.createElement("wbr")),r&&i){for(var o="",u=0;u<i.parentElement.childElementCount;u++){var a=i.parentElement.children[u].querySelector("input");a&&a.remove(),o+='<p data-block="0">'.concat(i.parentElement.children[u].innerHTML.trimLeft(),"</p>")}i.parentElement.insertAdjacentHTML("beforebegin",o),i.parentElement.remove()}else if(i)if("check"===n)i.parentElement.querySelectorAll("li").forEach(function(e){e.insertAdjacentHTML("afterbegin",'<input type="checkbox" />'.concat(0===e.textContent.indexOf(" ")?"":" ")),e.classList.add("vditor-task")});else{i.querySelector("input")&&i.parentElement.querySelectorAll("li").forEach(function(e){e.querySelector("input").remove(),e.classList.remove("vditor-task")});var l=void 0;"list"===n?(l=document.createElement("ul")).setAttribute("data-marker","*"):(l=document.createElement("ol")).setAttribute("data-marker","1."),l.setAttribute("data-block","0"),l.setAttribute("data-tight",i.parentElement.getAttribute("data-tight")),l.innerHTML=i.parentElement.innerHTML,i.parentElement.parentNode.replaceChild(l,i.parentElement)}else{var s=(0,g.a1)(t.startContainer,"data-block","0");s||(e[e.currentMode].element.querySelector("wbr").remove(),(s=e[e.currentMode].element.querySelector("p")).innerHTML="<wbr>"),"check"===n?(s.insertAdjacentHTML("beforebegin",'<ul data-block="0"><li class="vditor-task"><input type="checkbox" /> '.concat(s.innerHTML,"</li></ul>")),s.remove()):"list"===n?(s.insertAdjacentHTML("beforebegin",'<ul data-block="0"><li>'.concat(s.innerHTML,"</li></ul>")),s.remove()):"ordered-list"===n&&(s.insertAdjacentHTML("beforebegin",'<ol data-block="0"><li>'.concat(s.innerHTML,"</li></ol>")),s.remove())}},Tt=function(e,t,n){var r=t.previousElementSibling;if(t&&r){var i=[t];Array.from(n.cloneContents().children).forEach(function(e,n){3!==e.nodeType&&t&&""!==e.textContent.trim()&&t.getAttribute("data-node-id")===e.getAttribute("data-node-id")&&(0!==n&&i.push(t),t=t.nextElementSibling)}),e[e.currentMode].element.querySelectorAll("wbr").forEach(function(e){e.remove()}),n.insertNode(document.createElement("wbr"));var o=r.parentElement,u="";i.forEach(function(e){var t=e.getAttribute("data-marker");1!==t.length&&(t="1".concat(t.slice(-1))),u+='<li data-node-id="'.concat(e.getAttribute("data-node-id"),'" data-marker="').concat(t,'">').concat(e.innerHTML,"</li>"),e.remove()}),r.insertAdjacentHTML("beforeend","<".concat(o.tagName,' data-block="0">').concat(u,"</").concat(o.tagName,">")),"wysiwyg"===e.currentMode?o.outerHTML=e.lute.SpinVditorDOM(o.outerHTML):o.outerHTML=e.lute.SpinVditorIRDOM(o.outerHTML),(0,N.ib)(e[e.currentMode].element,n);var a=(0,g.O9)(n.startContainer);a&&a.querySelectorAll(".vditor-".concat(e.currentMode,"__preview[data-render='2']")).forEach(function(t){M(t,e),"wysiwyg"===e.currentMode&&t.previousElementSibling.setAttribute("style","display:none")}),Nt(e),Re(e)}else e[e.currentMode].element.focus()},xt=function(e,t,n,r){var i=(0,g.lG)(t.parentElement,"LI");if(i){e[e.currentMode].element.querySelectorAll("wbr").forEach(function(e){e.remove()}),n.insertNode(document.createElement("wbr"));var o=t.parentElement,u=o.cloneNode(),a=[t];Array.from(n.cloneContents().children).forEach(function(e,n){3!==e.nodeType&&t&&""!==e.textContent.trim()&&t.getAttribute("data-node-id")===e.getAttribute("data-node-id")&&(0!==n&&a.push(t),t=t.nextElementSibling)});var l=!1,s="";o.querySelectorAll("li").forEach(function(e){l&&(s+=e.outerHTML,e.nextElementSibling||e.previousElementSibling?e.remove():e.parentElement.remove()),e.isSameNode(a[a.length-1])&&(l=!0)}),a.reverse().forEach(function(e){i.insertAdjacentElement("afterend",e)}),s&&(u.innerHTML=s,a[0].insertAdjacentElement("beforeend",u)),"wysiwyg"===e.currentMode?r.outerHTML=e.lute.SpinVditorDOM(r.outerHTML):r.outerHTML=e.lute.SpinVditorIRDOM(r.outerHTML),(0,N.ib)(e[e.currentMode].element,n);var c=(0,g.O9)(n.startContainer);c&&c.querySelectorAll(".vditor-".concat(e.currentMode,"__preview[data-render='2']")).forEach(function(t){M(t,e),"wysiwyg"===e.currentMode&&t.previousElementSibling.setAttribute("style","display:none")}),Nt(e),Re(e)}else e[e.currentMode].element.focus()},Lt=function(e,t){for(var n=getSelection().getRangeAt(0).startContainer.parentElement,r=e.rows[0].cells.length,i=e.rows.length,o=0,u=0;u<i;u++)for(var a=0;a<r;a++)if(e.rows[u].cells[a].isSameNode(n)){o=a;break}for(var l=0;l<i;l++)e.rows[l].cells[o].setAttribute("align",t)},Bt=function(e){var t=e.trimRight().split("\n").pop();return""!==t&&(""===t.replace(/ |-/g,"")||""===t.replace(/ |_/g,"")||""===t.replace(/ |\*/g,""))&&t.replace(/ /g,"").length>2&&!(t.indexOf("-")>-1&&-1===t.trimLeft().indexOf(" ")&&e.trimRight().split("\n").length>1)&&0!==t.indexOf(" ")&&0!==t.indexOf("\t")},Mt=function(e){var t=e.trimRight().split("\n");return 0!==(e=t.pop()).indexOf(" ")&&0!==e.indexOf("\t")&&""!==(e=e.trimLeft())&&0!==t.length&&(""===e.replace(/-/g,"")||""===e.replace(/=/g,""))},Nt=function(e,t){void 0===t&&(t={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),"wysiwyg"===e.currentMode?Ee(e,t):"ir"===e.currentMode?en(e,t):"sv"===e.currentMode&&at(e,t)},Ot=function(e,t,n,r){var o,u=e.startContainer,a=(0,g.lG)(u,"LI");if(a){if(!(0,s.yl)(r)&&!r.altKey&&"Enter"===r.key&&!r.shiftKey&&n&&a.contains(n)&&n.nextElementSibling)return a&&!a.textContent.endsWith("\n")&&a.insertAdjacentText("beforeend","\n"),e.insertNode(document.createTextNode("\n\n")),e.collapse(!1),Nt(t),r.preventDefault(),!0;if(!((0,s.yl)(r)||r.shiftKey||r.altKey||"Backspace"!==r.key||a.previousElementSibling||""!==e.toString()||0!==(0,N.im)(a,t[t.currentMode].element,e).start))return a.nextElementSibling?(a.parentElement.insertAdjacentHTML("beforebegin",'<p data-block="0"><wbr>'.concat(a.innerHTML,"</p>")),a.remove()):a.parentElement.outerHTML='<p data-block="0"><wbr>'.concat(a.innerHTML,"</p>"),(0,N.ib)(t[t.currentMode].element,e),Nt(t),r.preventDefault(),!0;if(!(0,s.yl)(r)&&!r.shiftKey&&!r.altKey&&"Backspace"===r.key&&""===a.textContent.trim().replace(i.g.ZWSP,"")&&""===e.toString()&&"LI"===(null===(o=a.previousElementSibling)||void 0===o?void 0:o.tagName))return a.previousElementSibling.insertAdjacentText("beforeend","\n\n"),e.selectNodeContents(a.previousElementSibling),e.collapse(!1),a.remove(),(0,N.ib)(t[t.currentMode].element,e),Nt(t),r.preventDefault(),!0;if(!(0,s.yl)(r)&&!r.altKey&&"Tab"===r.key){var l=!1;if((0===e.startOffset&&(3===u.nodeType&&!u.previousSibling||3!==u.nodeType&&"LI"===u.nodeName)||a.classList.contains("vditor-task")&&1===e.startOffset&&3!==u.previousSibling.nodeType&&"INPUT"===u.previousSibling.tagName)&&(l=!0),l||""!==e.toString())return r.shiftKey?xt(t,a,e,a.parentElement):Tt(t,a,e),r.preventDefault(),!0}}return!1},Ht=function(e,t,n){if(e.options.tab&&"Tab"===n.key)return n.shiftKey||(""===t.toString()?(t.insertNode(document.createTextNode(e.options.tab)),t.collapse(!1)):(t.extractContents(),t.insertNode(document.createTextNode(e.options.tab)),t.collapse(!1))),(0,N.Hc)(t),Nt(e),n.preventDefault(),!0},It=function(e,t,n,r){if(n){if(!(0,s.yl)(e)&&!e.altKey&&"Enter"===e.key){var i=String.raw(J||(c=["",""],d=["",""],Object.defineProperty?Object.defineProperty(c,"raw",{value:d}):c.raw=d,J=c),n.textContent).replace(/\\\|/g,"").trim(),o=i.split("|");if(i.startsWith("|")&&i.endsWith("|")&&o.length>3){var u=o.map(function(){return"---"}).join("|");return u=n.textContent+"\n"+u.substring(3,u.length-3)+"\n|<wbr>",n.outerHTML=t.lute.SpinVditorDOM(u),(0,N.ib)(t[t.currentMode].element,r),Nt(t),et(t),e.preventDefault(),!0}if(Bt(n.innerHTML)&&n.previousElementSibling){var a="",l=n.innerHTML.trimRight().split("\n");return l.length>1&&(l.pop(),a='<p data-block="0">'.concat(l.join("\n"),"</p>")),n.insertAdjacentHTML("afterend","".concat(a,'<hr data-block="0"><p data-block="0"><wbr>\n</p>')),n.remove(),(0,N.ib)(t[t.currentMode].element,r),Nt(t),et(t),e.preventDefault(),!0}if(Mt(n.innerHTML))return"wysiwyg"===t.currentMode?n.outerHTML=t.lute.SpinVditorDOM(n.innerHTML+'<p data-block="0"><wbr>\n</p>'):n.outerHTML=t.lute.SpinVditorIRDOM(n.innerHTML+'<p data-block="0"><wbr>\n</p>'),(0,N.ib)(t[t.currentMode].element,r),Nt(t),et(t),e.preventDefault(),!0}var c,d;if(r.collapsed&&n.previousElementSibling&&"Backspace"===e.key&&!(0,s.yl)(e)&&!e.altKey&&!e.shiftKey&&n.textContent.trimRight().split("\n").length>1&&0===(0,N.im)(n,t[t.currentMode].element,r).start){var p=(0,g.DX)(n.previousElementSibling);return p.textContent.endsWith("\n")||(p.textContent=p.textContent+"\n"),p.parentElement.insertAdjacentHTML("beforeend","<wbr>".concat(n.innerHTML)),n.remove(),(0,N.ib)(t[t.currentMode].element,r),!1}return!1}},Pt=function(e,t,n){for(var r="",i=0;i<n.parentElement.childElementCount;i++)r+='<td align="'.concat(n.parentElement.children[i].getAttribute("align"),'"> </td>');"TH"===n.tagName?n.parentElement.parentElement.insertAdjacentHTML("afterend","<tbody><tr>".concat(r,"</tr></tbody>")):n.parentElement.insertAdjacentHTML("afterend","<tr>".concat(r,"</tr>")),Nt(e)},jt=function(e,t,n){for(var r="",i=0;i<n.parentElement.childElementCount;i++)"TH"===n.tagName?r+='<th align="'.concat(n.parentElement.children[i].getAttribute("align"),'"> </th>'):r+='<td align="'.concat(n.parentElement.children[i].getAttribute("align"),'"> </td>');if("TH"===n.tagName){n.parentElement.parentElement.insertAdjacentHTML("beforebegin","<thead><tr>".concat(r,"</tr></thead>")),t.insertNode(document.createElement("wbr"));var o=n.parentElement.innerHTML.replace(/<th>/g,"<td>").replace(/<\/th>/g,"</td>");n.parentElement.parentElement.nextElementSibling.insertAdjacentHTML("afterbegin",o),n.parentElement.parentElement.remove(),(0,N.ib)(e.ir.element,t)}else n.parentElement.insertAdjacentHTML("beforebegin","<tr>".concat(r,"</tr>"));Nt(e)},Rt=function(e,t,n,r){void 0===r&&(r="afterend");for(var i=0,o=n.previousElementSibling;o;)i++,o=o.previousElementSibling;for(var u=0;u<t.rows.length;u++)0===u?t.rows[u].cells[i].insertAdjacentHTML(r,"<th> </th>"):t.rows[u].cells[i].insertAdjacentHTML(r,"<td> </td>");Nt(e)},Ut=function(e,t,n){if("TD"===n.tagName){var r=n.parentElement.parentElement;n.parentElement.previousElementSibling?t.selectNodeContents(n.parentElement.previousElementSibling.lastElementChild):t.selectNodeContents(r.previousElementSibling.lastElementChild.lastElementChild),1===r.childElementCount?r.remove():n.parentElement.remove(),t.collapse(!1),(0,N.Hc)(t),Nt(e)}},qt=function(e,t,n,r){for(var i=0,o=r.previousElementSibling;o;)i++,o=o.previousElementSibling;(r.previousElementSibling||r.nextElementSibling)&&(t.selectNodeContents(r.previousElementSibling||r.nextElementSibling),t.collapse(!0));for(var u=0;u<n.rows.length;u++){var a=n.rows[u].cells;if(1===a.length){n.remove(),Re(e);break}a[i].remove()}(0,N.Hc)(t),Nt(e)},Vt=function(e,t,n){var r=n.startContainer,i=(0,g.lG)(r,"TD")||(0,g.lG)(r,"TH");if(i){if(!(0,s.yl)(t)&&!t.altKey&&"Enter"===t.key){i.lastElementChild&&(!i.lastElementChild||i.lastElementChild.isSameNode(i.lastChild)&&"BR"===i.lastElementChild.tagName)||i.insertAdjacentHTML("beforeend","<br>");var o=document.createElement("br");return n.insertNode(o),n.setStartAfter(o),Nt(e),et(e),t.preventDefault(),!0}if("Tab"===t.key)return t.shiftKey?(_t(i,n),t.preventDefault(),!0):((d=i.nextElementSibling)||(d=i.parentElement.nextElementSibling?i.parentElement.nextElementSibling.firstElementChild:"THEAD"===i.parentElement.parentElement.tagName&&i.parentElement.parentElement.nextElementSibling?i.parentElement.parentElement.nextElementSibling.firstElementChild.firstElementChild:null),d&&(n.selectNodeContents(d),(0,N.Hc)(n)),t.preventDefault(),!0);var u=i.parentElement.parentElement.parentElement;if("ArrowUp"===t.key){if(t.preventDefault(),"TH"===i.tagName)return u.previousElementSibling?(n.selectNodeContents(u.previousElementSibling),n.collapse(!1),(0,N.Hc)(n)):Ct(e,"beforebegin"),!0;for(var a=0,l=i.parentElement;a<l.cells.length&&!l.cells[a].isSameNode(i);a++);var c=l.previousElementSibling;return c||(c=l.parentElement.previousElementSibling.firstChild),n.selectNodeContents(c.cells[a]),n.collapse(!1),(0,N.Hc)(n),!0}if("ArrowDown"===t.key){var d;if(t.preventDefault(),!(l=i.parentElement).nextElementSibling&&"TD"===i.tagName)return u.nextElementSibling?(n.selectNodeContents(u.nextElementSibling),n.collapse(!0),(0,N.Hc)(n)):Ct(e,"afterend"),!0;for(a=0;a<l.cells.length&&!l.cells[a].isSameNode(i);a++);return(d=l.nextElementSibling)||(d=l.parentElement.nextElementSibling.firstChild),n.selectNodeContents(d.cells[a]),n.collapse(!0),(0,N.Hc)(n),!0}if("wysiwyg"===e.currentMode&&!(0,s.yl)(t)&&"Enter"===t.key&&!t.shiftKey&&t.altKey){var p=e.wysiwyg.popover.querySelector(".vditor-input");return p.focus(),p.select(),t.preventDefault(),!0}if(!(0,s.yl)(t)&&!t.shiftKey&&!t.altKey&&"Backspace"===t.key&&0===n.startOffset&&""===n.toString())return!_t(i,n,!1)&&u&&(""===u.textContent.trim()?(u.outerHTML='<p data-block="0"><wbr>\n</p>',(0,N.ib)(e[e.currentMode].element,n)):(n.setStartBefore(u),n.collapse(!0)),Nt(e)),t.preventDefault(),!0;if(j("⇧⌘F",t))return jt(e,n,i),t.preventDefault(),!0;if(j("⌘=",t))return Pt(e,n,i),t.preventDefault(),!0;if(j("⇧⌘G",t))return Rt(e,u,i,"beforebegin"),t.preventDefault(),!0;if(j("⇧⌘=",t))return Rt(e,u,i),t.preventDefault(),!0;if(j("⌘-",t))return Ut(e,n,i),t.preventDefault(),!0;if(j("⇧⌘-",t))return qt(e,n,u,i),t.preventDefault(),!0;if(j("⇧⌘L",t)){if("ir"===e.currentMode)return Lt(u,"left"),Nt(e),t.preventDefault(),!0;if(f=e.wysiwyg.popover.querySelector('[data-type="left"]'))return f.click(),t.preventDefault(),!0}if(j("⇧⌘C",t)){if("ir"===e.currentMode)return Lt(u,"center"),Nt(e),t.preventDefault(),!0;if(f=e.wysiwyg.popover.querySelector('[data-type="center"]'))return f.click(),t.preventDefault(),!0}if(j("⇧⌘R",t)){if("ir"===e.currentMode)return Lt(u,"right"),Nt(e),t.preventDefault(),!0;var f;if(f=e.wysiwyg.popover.querySelector('[data-type="right"]'))return f.click(),t.preventDefault(),!0}}return!1},zt=function(e,t,n,r){if("PRE"===n.tagName&&j("⌘A",t))return r.selectNodeContents(n.firstElementChild),t.preventDefault(),!0;if(e.options.tab&&"Tab"===t.key&&!t.shiftKey&&""===r.toString())return r.insertNode(document.createTextNode(e.options.tab)),r.collapse(!1),Nt(e),t.preventDefault(),!0;if("Backspace"===t.key&&!(0,s.yl)(t)&&!t.shiftKey&&!t.altKey){var i=(0,N.im)(n,e[e.currentMode].element,r);if((0===i.start||1===i.start&&"\n"===n.innerText)&&""===r.toString())return n.parentElement.outerHTML='<p data-block="0"><wbr>'.concat(n.firstElementChild.innerHTML,"</p>"),(0,N.ib)(e[e.currentMode].element,r),Nt(e),t.preventDefault(),!0}return!(0,s.yl)(t)&&!t.altKey&&"Enter"===t.key&&(n.firstElementChild.textContent.endsWith("\n")||n.firstElementChild.insertAdjacentText("beforeend","\n"),r.extractContents(),r.insertNode(document.createTextNode("\n")),r.collapse(!1),(0,N.Hc)(r),(0,s.vU)()||("wysiwyg"===e.currentMode?vt(e,r):P(e,r)),et(e),t.preventDefault(),!0)},Wt=function(e,t,n,r){var o=t.startContainer,u=(0,g.lG)(o,"BLOCKQUOTE");if(u&&""===t.toString()){if("Backspace"===n.key&&!(0,s.yl)(n)&&!n.shiftKey&&!n.altKey&&0===(0,N.im)(u,e[e.currentMode].element,t).start)return t.insertNode(document.createElement("wbr")),u.outerHTML=u.innerHTML,(0,N.ib)(e[e.currentMode].element,t),Nt(e),n.preventDefault(),!0;if(r&&"Enter"===n.key&&!(0,s.yl)(n)&&!n.shiftKey&&!n.altKey&&"BLOCKQUOTE"===r.parentElement.tagName){var a=!1;if("\n"===r.innerHTML.replace(i.g.ZWSP,"")||""===r.innerHTML.replace(i.g.ZWSP,"")?(a=!0,r.remove()):r.innerHTML.endsWith("\n\n")&&(0,N.im)(r,e[e.currentMode].element,t).start===r.textContent.length-1&&(r.innerHTML=r.innerHTML.substr(0,r.innerHTML.length-2),a=!0),a)return u.insertAdjacentHTML("afterend",'<p data-block="0">'.concat(i.g.ZWSP,"<wbr>\n</p>")),(0,N.ib)(e[e.currentMode].element,t),Nt(e),n.preventDefault(),!0}var l=(0,g.F9)(o);if("wysiwyg"===e.currentMode&&l&&j("⇧⌘;",n))return t.insertNode(document.createElement("wbr")),l.outerHTML='<blockquote data-block="0">'.concat(l.outerHTML,"</blockquote>"),(0,N.ib)(e.wysiwyg.element,t),Ee(e),n.preventDefault(),!0;if(Ft(e,n,t,u,u))return!0;if(kt(e,n,t,u,u))return!0}return!1},Gt=function(e,t,n){var r=t.startContainer,i=(0,g.lG)(r,"LI");if(i&&i.classList.contains("vditor-task")){if(j("⇧⌘J",n)){var o=i.firstElementChild;return o.checked?o.removeAttribute("checked"):o.setAttribute("checked","checked"),Nt(e),n.preventDefault(),!0}if("Backspace"===n.key&&!(0,s.yl)(n)&&!n.shiftKey&&!n.altKey&&""===t.toString()&&1===t.startOffset&&(3===r.nodeType&&r.previousSibling&&"INPUT"===r.previousSibling.tagName||3!==r.nodeType)){var u=i.previousElementSibling;return i.querySelector("input").remove(),u?((0,g.DX)(u).parentElement.insertAdjacentHTML("beforeend","<wbr>"+i.innerHTML.trim()),i.remove()):(i.parentElement.insertAdjacentHTML("beforebegin",'<p data-block="0"><wbr>'.concat(i.innerHTML.trim()||"\n","</p>")),i.nextElementSibling?i.remove():i.parentElement.remove()),(0,N.ib)(e[e.currentMode].element,t),Nt(e),n.preventDefault(),!0}if("Enter"===n.key&&!(0,s.yl)(n)&&!n.shiftKey&&!n.altKey){if(""===i.textContent.trim())if((0,g.fb)(i.parentElement,"vditor-task")){var a=(0,g.O9)(r);a&&xt(e,i,t,a)}else if(i.nextElementSibling){var l="",c="",d=!1;Array.from(i.parentElement.children).forEach(function(e){i.isSameNode(e)?d=!0:d?l+=e.outerHTML:c+=e.outerHTML});var p=i.parentElement.tagName,f="OL"===i.parentElement.tagName?"":' data-marker="'.concat(i.parentElement.getAttribute("data-marker"),'"'),h="";c&&(h="UL"===i.parentElement.tagName?"":' start="1"',c="<".concat(p,' data-tight="true"').concat(f,' data-block="0">').concat(c,"</").concat(p,">")),i.parentElement.outerHTML="".concat(c,'<p data-block="0"><wbr>\n</p><').concat(p,'\n data-tight="true"').concat(f,' data-block="0"').concat(h,">").concat(l,"</").concat(p,">")}else i.parentElement.insertAdjacentHTML("afterend",'<p data-block="0"><wbr>\n</p>'),1===i.parentElement.querySelectorAll("li").length?i.parentElement.remove():i.remove();else 3!==r.nodeType&&0===t.startOffset&&"INPUT"===r.firstChild.tagName?t.setStart(r.childNodes[1],1):(t.setEndAfter(i.lastChild),i.insertAdjacentHTML("afterend",'<li class="vditor-task" data-marker="'.concat(i.getAttribute("data-marker"),'"><input type="checkbox"> <wbr></li>')),document.querySelector("wbr").after(t.extractContents()));return(0,N.ib)(e[e.currentMode].element,t),Nt(e),et(e),n.preventDefault(),!0}}return!1},Kt=function(e,t,n,r){if(3!==t.startContainer.nodeType){var i=t.startContainer.children[t.startOffset];if(i&&"HR"===i.tagName)return t.selectNodeContents(i.previousElementSibling),t.collapse(!1),n.preventDefault(),!0}if(r){var o=r.previousElementSibling;if(o&&0===(0,N.im)(r,e[e.currentMode].element,t).start&&((0,s.vU)()&&"HR"===o.tagName||"TABLE"===o.tagName)){if("TABLE"===o.tagName){var u=o.lastElementChild.lastElementChild.lastElementChild;u.innerHTML=u.innerHTML.trimLeft()+"<wbr>"+r.textContent.trim(),r.remove()}else o.remove();return(0,N.ib)(e[e.currentMode].element,t),Nt(e),n.preventDefault(),!0}}return!1},Xt=function(e){(0,s.vU)()&&3!==e.startContainer.nodeType&&"HR"===e.startContainer.tagName&&e.setStartBefore(e.startContainer)},Zt=function(e,t,n){var r,i;if(!(0,s.vU)())return!1;if("ArrowUp"===e.key&&t&&"TABLE"===(null===(r=t.previousElementSibling)||void 0===r?void 0:r.tagName)){var o=t.previousElementSibling;return n.selectNodeContents(o.rows[o.rows.length-1].lastElementChild),n.collapse(!1),e.preventDefault(),!0}return!("ArrowDown"!==e.key||!t||"TABLE"!==(null===(i=t.nextElementSibling)||void 0===i?void 0:i.tagName)||(n.selectNodeContents(t.nextElementSibling.rows[0].cells[0]),n.collapse(!0),e.preventDefault(),0))},Jt=function(e,t,n){return Dt(void 0,void 0,void 0,function(){var r,o,u,a,l,s,c,d,p,f,h,m,v,D,b,y;return gt(this,function(E){switch(E.label){case 0:return"true"!==e[e.currentMode].element.getAttribute("contenteditable")?[2]:(t.stopPropagation(),t.preventDefault(),"clipboardData"in t?(r=t.clipboardData.getData("text/html"),o=t.clipboardData.getData("text/plain"),u=t.clipboardData.files):(r=t.dataTransfer.getData("text/html"),o=t.dataTransfer.getData("text/plain"),t.dataTransfer.types.includes("Files")&&(u=t.dataTransfer.items)),a={},l=function(t,n){if(!n)return["",Lute.WalkContinue];if(e.options.upload.renderLinkDest)return e.options.upload.renderLinkDest(e,t,n);var r=t.TokensStr();if(34===t.__internal_object__.Parent.Type&&r&&-1===r.indexOf("file://")&&e.options.upload.linkToImgUrl){var i=new XMLHttpRequest;i.open("POST",e.options.upload.linkToImgUrl),e.options.upload.token&&i.setRequestHeader("X-Upload-Token",e.options.upload.token),e.options.upload.withCredentials&&(i.withCredentials=!0),dt(e,i),i.setRequestHeader("Content-Type","application/json; charset=utf-8"),i.onreadystatechange=function(){if(i.readyState===XMLHttpRequest.DONE){if(200===i.status){var t=i.responseText;e.options.upload.linkToImgFormat&&(t=e.options.upload.linkToImgFormat(i.responseText));var n=JSON.parse(t);if(0!==n.code)return void e.tip.show(n.msg);var r=n.data.originalURL;if("sv"===e.currentMode)e.sv.element.querySelectorAll(".vditor-sv__marker--link").forEach(function(e){e.textContent===r&&(e.textContent=n.data.url)});else{var o=e[e.currentMode].element.querySelector('img[src="'.concat(r,'"]'));o.src=n.data.url,"ir"===e.currentMode&&(o.previousElementSibling.previousElementSibling.innerHTML=n.data.url)}Nt(e)}else e.tip.show(i.responseText);e.options.upload.linkToImgCallback&&e.options.upload.linkToImgCallback(i.responseText)}},i.send(JSON.stringify({url:r}))}return"ir"===e.currentMode?['<span class="vditor-ir__marker vditor-ir__marker--link">'.concat(Lute.EscapeHTMLStr(r),"</span>"),Lute.WalkContinue]:"wysiwyg"===e.currentMode?["",Lute.WalkContinue]:['<span class="vditor-sv__marker--link">'.concat(Lute.EscapeHTMLStr(r),"</span>"),Lute.WalkContinue]},r.replace(/&amp;/g,"&").replace(/<(|\/)(html|body|meta)[^>]*?>/gi,"").trim()!=='<a href="'.concat(o,'">').concat(o,"</a>")&&r.replace(/&amp;/g,"&").replace(/<(|\/)(html|body|meta)[^>]*?>/gi,"").trim()!=='\x3c!--StartFragment--\x3e<a href="'.concat(o,'">').concat(o,"</a>\x3c!--EndFragment--\x3e")||(r=""),(s=(new DOMParser).parseFromString(r,"text/html")).body&&(r=s.body.innerHTML),r=Lute.Sanitize(r),e.wysiwyg.getComments(e),c=e[e.currentMode].element.scrollHeight,d=function(e,t,n){void 0===n&&(n="sv");var r=document.createElement("div");r.innerHTML=e;var i=!1;1===r.childElementCount&&r.lastElementChild.style.fontFamily.indexOf("monospace")>-1&&(i=!0);var o=r.querySelectorAll("pre");if(1===r.childElementCount&&1===o.length&&"vditor-wysiwyg"!==o[0].className&&"vditor-sv"!==o[0].className&&(i=!0),0===e.indexOf('\n<p class="p1">')&&(i=!0),1===r.childElementCount&&"TABLE"===r.firstElementChild.tagName&&r.querySelector(".line-number")&&r.querySelector(".line-content")&&(i=!0),i){var u=t||e;return/\n/.test(u)||1===o.length?"wysiwyg"===n?'<div class="vditor-wysiwyg__block" data-block="0" data-type="code-block"><pre><code>'.concat(u.replace(/&/g,"&amp;").replace(/</g,"&lt;"),"<wbr></code></pre></div>"):"\n```\n"+u.replace(/&/g,"&amp;").replace(/</g,"&lt;")+"\n```":"wysiwyg"===n?"<code>".concat(u.replace(/&/g,"&amp;").replace(/</g,"&lt;"),"</code><wbr>"):"`".concat(u,"`")}return!1}(r,o,e.currentMode),(p="sv"===e.currentMode?(0,g.a1)(t.target,"data-type","code-block"):(0,g.lG)(t.target,"CODE"))?("sv"===e.currentMode?document.execCommand("insertHTML",!1,o.replace(/&/g,"&amp;").replace(/</g,"&lt;")):(f=(0,N.im)(t.target,e[e.currentMode].element),"PRE"!==p.parentElement.tagName&&(o+=i.g.ZWSP),p.textContent=p.textContent.substring(0,f.start)+o+p.textContent.substring(f.end),(0,N.$j)(f.start+o.length,f.start+o.length,p.parentElement),(null===(y=p.parentElement)||void 0===y?void 0:y.nextElementSibling.classList.contains("vditor-".concat(e.currentMode,"__preview")))&&(p.parentElement.nextElementSibling.innerHTML=p.outerHTML,M(p.parentElement.nextElementSibling,e))),[3,10]):[3,1]);case 1:return d?(n.pasteCode(d),[3,10]):[3,2];case 2:return""===r.trim()?[3,5]:((h=document.createElement("div")).innerHTML=r,e.options.upload.base64ToLink?[3,4]:[4,$t(e,h,("clipboardData"in t?t.clipboardData:t.dataTransfer).getData("text/rtf"))]);case 3:E.sent(),E.label=4;case 4:return h.querySelectorAll("[style]").forEach(function(e){e.removeAttribute("style")}),h.querySelectorAll(".vditor-copy").forEach(function(e){e.remove()}),"ir"===e.currentMode?(a.HTML2VditorIRDOM={renderLinkDest:l},e.lute.SetJSRenderers({renderers:a}),(0,N.oC)(e.lute.HTML2VditorIRDOM(h.innerHTML),e)):"wysiwyg"===e.currentMode?(a.HTML2VditorDOM={renderLinkDest:l},e.lute.SetJSRenderers({renderers:a}),(0,N.oC)(e.lute.HTML2VditorDOM(h.innerHTML),e)):(a.Md2VditorSVDOM={renderLinkDest:l},e.lute.SetJSRenderers({renderers:a}),rt(e,e.lute.HTML2Md(h.innerHTML).trimRight())),e.outline.render(e),[3,10];case 5:return u.length>0?e.options.upload.url||e.options.upload.handler?[4,mt(e,u)]:[3,7]:[3,9];case 6:return E.sent(),[3,8];case 7:m=new FileReader,"clipboardData"in t?(u=t.clipboardData.files,v=u[0]):t.dataTransfer.types.includes("Files")&&(u=t.dataTransfer.items,v=u[0].getAsFile()),v&&v.type.startsWith("image")&&(m.readAsDataURL(v),m.onload=function(){var t="";"wysiwyg"===e.currentMode?t+='<img alt="'.concat(v.name,'" src="').concat(m.result.toString(),'">\n'):t+="![".concat(v.name,"](").concat(m.result.toString(),")\n"),document.execCommand("insertHTML",!1,t)}),E.label=8;case 8:return[3,10];case 9:""!==o.trim()&&0===u.length&&(""!==(b=(0,N.zh)(e)).toString()&&e.lute.IsValidLinkDest(o)&&(o="[".concat(b.toString(),"](").concat(o,")")),"ir"===e.currentMode?(a.Md2VditorIRDOM={renderLinkDest:l},e.lute.SetJSRenderers({renderers:a}),(0,N.oC)(Lute.Sanitize(e.lute.Md2VditorIRDOM(o)),e)):"wysiwyg"===e.currentMode?(a.Md2VditorDOM={renderLinkDest:l},e.lute.SetJSRenderers({renderers:a}),(0,N.oC)(Lute.Sanitize(e.lute.Md2VditorDOM(o)),e)):(a.Md2VditorSVDOM={renderLinkDest:l},e.lute.SetJSRenderers({renderers:a}),rt(e,o)),e.outline.render(e)),E.label=10;case 10:return"sv"!==e.currentMode&&((D=(0,g.F9)((0,N.zh)(e).startContainer))&&(b=(0,N.zh)(e),e[e.currentMode].element.querySelectorAll("wbr").forEach(function(e){e.remove()}),b.insertNode(document.createElement("wbr")),"wysiwyg"===e.currentMode?D.outerHTML=e.lute.SpinVditorDOM(D.outerHTML):D.outerHTML=e.lute.SpinVditorIRDOM(D.outerHTML),(0,N.ib)(e[e.currentMode].element,b)),e[e.currentMode].element.querySelectorAll(".vditor-".concat(e.currentMode,"__preview[data-render='2']")).forEach(function(t){M(t,e)})),e.wysiwyg.triggerRemoveComment(e),Nt(e),e[e.currentMode].element.scrollHeight-c>Math.min(e[e.currentMode].element.clientHeight,window.innerHeight)/2&&et(e),[2]}})})},$t=function(e,t,n){return Dt(void 0,void 0,void 0,function(){var r,i,o,u,a,l,s,c,d,p,f,h,m,v,D;return gt(this,function(g){switch(g.label){case 0:if(!n)return[2];if(r=/{\\pict[\s\S]+?\\bliptag-?\d+(\\blipupi-?\d+)?({\\\*\\blipuid\s?[\da-fA-F]+)?[\s}]*?/,i=new RegExp("(?:("+r.source+"))([\\da-fA-F\\s]+)\\}","g"),o=n.match(i),u=[],o)for(a=0,l=o;a<l.length;a++)s=l[a],c=void 0,s.includes("\\pngblip")?c="image/png":s.includes("\\jpegblip")&&(c="image/jpeg"),c&&u.push({hex:s.replace(r,"").replace(/[^\da-fA-F]/g,""),type:c});for(d=[],Yt(t,function(e){if("V:SHAPE"===e.tagName)return Yt(e,function(t){"V:IMAGEDATA"===t.tagName&&d.push({shape:e,img:t})}),!1}),m=0;m<d.length;m++)p=document.createElement("img"),f="data:"+u[m].type+";base64,"+btoa((u[m].hex.match(/\w{2}/g)||[]).map(function(e){return String.fromCharCode(parseInt(e,16))}).join("")),p.src=f,p.title=d[m].img.getAttribute("title"),d[m].shape.parentNode.replaceChild(p,d[m].shape);h=t.querySelectorAll("img"),m=0,g.label=1;case 1:return m<h.length?(v=h[m].src||"")?(D=h[m],[4,e.options.upload.base64ToLink(v)]):[3,3]:[3,4];case 2:D.src=g.sent(),g.label=3;case 3:return m++,[3,1];case 4:return[2]}})})},Yt=function(e,t){if(!1!==t(e))for(var n=0;n<e.children.length;n++)Yt(e.children[n],t)},Qt=function(e){var t,n;e.hint.render(e);var r=(0,N.zh)(e).startContainer,o=(0,g.a1)(r,"data-type","code-block-info");if(o)if(""===o.textContent.replace(i.g.ZWSP,"")&&e.hint.recentLanguage)o.textContent=i.g.ZWSP+e.hint.recentLanguage,(0,N.zh)(e).selectNodeContents(o);else{var u=[],a=o.textContent.substring(0,(0,N.im)(o,e.ir.element).start).replace(i.g.ZWSP,"");(e.options.preview.hljs.langs||i.g.ALIAS_CODE_LANGUAGES.concat((null!==(n=null===(t=window.hljs)||void 0===t?void 0:t.listLanguages())&&void 0!==n?n:[]).sort())).forEach(function(e){e.indexOf(a.toLowerCase())>-1&&u.push({html:e,value:e})}),e.hint.genHTML(u,a,e)}},en=function(e,t){void 0===t&&(t={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),t.enableHint&&Qt(e),clearTimeout(e.ir.processTimeoutId),e.ir.processTimeoutId=window.setTimeout(function(){if(!e.ir.composingLock){var n=u(e);"function"==typeof e.options.input&&t.enableInput&&e.options.input(n),e.options.counter.enable&&e.counter.render(e,n),e.options.cache.enable&&(0,s.pK)()&&(localStorage.setItem(e.options.cache.id,n),e.options.cache.after&&e.options.cache.after(n)),e.devtools&&e.devtools.renderEchart(e),t.enableAddUndoStack&&e.undo.addToUndoStack(e)}},e.options.undoDelay)},tn=function(e,t){var n=(0,N.zh)(e),r=(0,g.F9)(n.startContainer)||n.startContainer;if(r){var i=r.querySelector(".vditor-ir__marker--heading");i?i.innerHTML=t:(r.insertAdjacentText("afterbegin",t),n.selectNodeContents(r),n.collapse(!1)),P(e,n.cloneRange()),ye(e)}},nn=function(e,t,n){var r=(0,g.a1)(e.startContainer,"data-type",n);if(r){r.firstElementChild.remove(),r.lastElementChild.remove(),e.insertNode(document.createElement("wbr"));var i=document.createElement("div");i.innerHTML=t.lute.SpinVditorIRDOM(r.outerHTML),r.outerHTML=i.firstElementChild.innerHTML.trim()}},rn=function(e,t,n,r){var i=(0,N.zh)(e),o=t.getAttribute("data-type"),u=i.startContainer;3===u.nodeType&&(u=u.parentElement);var a=!0;if(t.classList.contains("vditor-menu--current"))if("quote"===o){var l=(0,g.lG)(u,"BLOCKQUOTE");l&&(i.insertNode(document.createElement("wbr")),l.outerHTML=""===l.innerHTML.trim()?'<p data-block="0">'.concat(l.innerHTML,"</p>"):l.innerHTML)}else if("link"===o){var s=(0,g.a1)(i.startContainer,"data-type","a");if(s){var d=(0,g.fb)(i.startContainer,"vditor-ir__link");d?(i.insertNode(document.createElement("wbr")),s.outerHTML=d.innerHTML):s.outerHTML=s.querySelector(".vditor-ir__link").innerHTML+"<wbr>"}}else"italic"===o?nn(i,e,"em"):"bold"===o?nn(i,e,"strong"):"strike"===o?nn(i,e,"s"):"inline-code"===o?nn(i,e,"code"):"check"!==o&&"list"!==o&&"ordered-list"!==o||(St(e,i,o),a=!1,t.classList.remove("vditor-menu--current"));else{0===e.ir.element.childNodes.length&&(e.ir.element.innerHTML='<p data-block="0"><wbr></p>',(0,N.ib)(e.ir.element,i));var p=(0,g.F9)(i.startContainer);if("line"===o){if(p){var f='<hr data-block="0"><p data-block="0"><wbr>\n</p>';""===p.innerHTML.trim()?p.outerHTML=f:p.insertAdjacentHTML("afterend",f)}}else if("quote"===o)p&&(i.insertNode(document.createElement("wbr")),p.outerHTML='<blockquote data-block="0">'.concat(p.outerHTML,"</blockquote>"),a=!1,t.classList.add("vditor-menu--current"));else if("link"===o){var h=void 0;h=""===i.toString()?"".concat(n,"<wbr>").concat(r):"".concat(n).concat(i.toString()).concat(r.replace(")","<wbr>)")),document.execCommand("insertHTML",!1,h),a=!1,t.classList.add("vditor-menu--current")}else if("italic"===o||"bold"===o||"strike"===o||"inline-code"===o||"code"===o||"table"===o){h=void 0,""===i.toString()?h="".concat(n,"<wbr>").concat(r):(h="code"===o?"".concat(n,"\n").concat(i.toString(),"<wbr>").concat(r):"table"===o?"".concat(n).concat(i.toString(),"<wbr>").concat(r):"".concat(n).concat(i.toString()).concat(r,"<wbr>"),i.deleteContents()),"table"!==o&&"code"!==o||(h="\n"+h+"\n\n");var m=document.createElement("span");m.innerHTML=h,i.insertNode(m),P(e,i),"table"===o&&(i.selectNodeContents(getSelection().getRangeAt(0).startContainer.parentElement),(0,N.Hc)(i))}else"check"!==o&&"list"!==o&&"ordered-list"!==o||(St(e,i,o,!1),a=!1,c(e.toolbar.elements,["check","list","ordered-list"]),t.classList.add("vditor-menu--current"))}(0,N.ib)(e.ir.element,i),en(e),a&&ye(e)},on=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function u(e){try{l(r.next(e))}catch(je){o(je)}}function a(e){try{l(r.throw(e))}catch(je){o(je)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(u,a)}l((r=r.apply(e,t||[])).next())})},un=function(e,t){var n,r,i,o,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(u=0)),u;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,r=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!((i=(i=u.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){u=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){u.label=a[1];break}if(6===a[0]&&u.label<i[1]){u.label=i[1],i=a;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(a);break}i[2]&&u.ops.pop(),u.trys.pop();continue}a=t.call(e,u)}catch(je){a=[6,je],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}},an=function(){function e(e){var t=this;this.splitChar="",this.lastIndex=-1,this.fillEmoji=function(e,n){t.element.style.display="none";var r=decodeURIComponent(e.getAttribute("data-value")),o=window.getSelection().getRangeAt(0);if("ir"===n.currentMode){var u=(0,g.a1)(o.startContainer,"data-type","code-block-info");if(u)return u.textContent=i.g.ZWSP+r.trimRight(),o.selectNodeContents(u),o.collapse(!1),en(n),u.parentElement.querySelectorAll("code").forEach(function(e){e.className="language-"+r.trimRight()}),M(u.parentElement.querySelector(".vditor-ir__preview"),n),void(t.recentLanguage=r.trimRight())}if("wysiwyg"===n.currentMode&&3!==o.startContainer.nodeType){var a=o.startContainer,l=void 0;if((l=a.classList.contains("vditor-input")?a:a.firstElementChild)&&l.classList.contains("vditor-input"))return l.value=r.trimRight(),o.selectNodeContents(l),o.collapse(!1),l.dispatchEvent(new CustomEvent("input",{detail:1})),void(t.recentLanguage=r.trimRight())}if(o.setStart(o.startContainer,t.lastIndex),o.deleteContents(),n.options.hint.parse?"sv"===n.currentMode?(0,N.oC)(n.lute.SpinVditorSVDOM(r),n):"wysiwyg"===n.currentMode?(0,N.oC)(n.lute.SpinVditorDOM(r),n):(0,N.oC)(n.lute.SpinVditorIRDOM(r),n):(0,N.oC)(r,n),":"===t.splitChar&&r.indexOf(":")>-1&&"sv"!==n.currentMode&&o.insertNode(document.createTextNode(" ")),o.collapse(!1),(0,N.Hc)(o),"wysiwyg"===n.currentMode)(s=(0,g.fb)(o.startContainer,"vditor-wysiwyg__block"))&&s.lastElementChild.classList.contains("vditor-wysiwyg__preview")&&(s.lastElementChild.innerHTML=s.firstElementChild.innerHTML,M(s.lastElementChild,n));else if("ir"===n.currentMode){var s;(s=(0,g.fb)(o.startContainer,"vditor-ir__marker--pre"))&&s.nextElementSibling.classList.contains("vditor-ir__preview")&&(s.nextElementSibling.innerHTML=s.innerHTML,M(s.nextElementSibling,n))}Nt(n)},this.timeId=-1,this.element=document.createElement("div"),this.element.className="vditor-hint",this.recentLanguage="",e.push({key:":"})}return e.prototype.render=function(e){var t=this;if(window.getSelection().focusNode){var n,r=getSelection().getRangeAt(0);n=r.startContainer.textContent.substring(0,r.startOffset)||"";var i=this.getKey(n,e.options.hint.extend);if(void 0===i)this.element.style.display="none",clearTimeout(this.timeId);else if(":"===this.splitChar){var o=""===i?e.options.hint.emoji:e.lute.GetEmojis(),u=[];Object.keys(o).forEach(function(e){0===e.indexOf(i.toLowerCase())&&(o[e].indexOf(".")>-1?u.push({html:'<img src="'.concat(o[e],'" title=":').concat(e,':"/> :').concat(e,":"),value:":".concat(e,":")}):u.push({html:'<span class="vditor-hint__emoji">'.concat(o[e],"</span>").concat(e),value:o[e]}))}),this.genHTML(u,i,e)}else e.options.hint.extend.forEach(function(n){n.key===t.splitChar&&(clearTimeout(t.timeId),t.timeId=window.setTimeout(function(){return on(t,void 0,void 0,function(){var t;return un(this,function(r){switch(r.label){case 0:return t=this.genHTML,[4,n.hint(i)];case 1:return t.apply(this,[r.sent(),i,e]),[2]}})})},e.options.hint.delay))})}},e.prototype.genHTML=function(e,t,n){var r=this;if(0!==e.length){var i=n[n.currentMode].element,o=(0,N.Ny)(i),u=o.left+("left"===n.options.outline.position?n.outline.element.offsetWidth:0),a=o.top,l="";e.forEach(function(e,n){if(!(n>7)){var r=e.html;if(""!==t){var i=r.lastIndexOf(">")+1,o=r.substr(i),u=o.toLowerCase().indexOf(t.toLowerCase());u>-1&&(o=o.substring(0,u)+"<b>"+o.substring(u,u+t.length)+"</b>"+o.substring(u+t.length),r=r.substr(0,i)+o)}l+='<button type="button" data-value="'.concat(encodeURIComponent(e.value),' "\n').concat(0===n?"class='vditor-hint--current'":"","> ").concat(r,"</button>")}}),this.element.innerHTML=l;var s=parseInt(document.defaultView.getComputedStyle(i,null).getPropertyValue("line-height"),10);this.element.style.top="".concat(a+(s||22),"px"),this.element.style.left="".concat(u,"px"),this.element.style.display="block",this.element.style.right="auto",this.element.querySelectorAll("button").forEach(function(e){e.addEventListener("click",function(t){r.fillEmoji(e,n),t.preventDefault()})}),this.element.getBoundingClientRect().bottom>window.innerHeight&&(this.element.style.top="".concat(a-this.element.offsetHeight,"px")),this.element.getBoundingClientRect().right>window.innerWidth&&(this.element.style.left="auto",this.element.style.right="0")}else this.element.style.display="none"},e.prototype.select=function(e,t){if(0===this.element.querySelectorAll("button").length||"none"===this.element.style.display)return!1;var n=this.element.querySelector(".vditor-hint--current");if("ArrowDown"===e.key)return e.preventDefault(),e.stopPropagation(),n.removeAttribute("class"),n.nextElementSibling?n.nextElementSibling.className="vditor-hint--current":this.element.children[0].className="vditor-hint--current",!0;if("ArrowUp"===e.key){if(e.preventDefault(),e.stopPropagation(),n.removeAttribute("class"),n.previousElementSibling)n.previousElementSibling.className="vditor-hint--current";else{var r=this.element.children.length;this.element.children[r-1].className="vditor-hint--current"}return!0}return!((0,s.yl)(e)||e.shiftKey||e.altKey||"Enter"!==e.key||e.isComposing||(e.preventDefault(),e.stopPropagation(),this.fillEmoji(n,t),0))},e.prototype.getKey=function(e,t){var n,r=this;if(this.lastIndex=-1,this.splitChar="",t.forEach(function(t){var n=e.lastIndexOf(t.key);r.lastIndex<n&&(r.splitChar=t.key,r.lastIndex=n)}),-1===this.lastIndex)return n;var i=e.split(this.splitChar),u=i[i.length-1];if(i.length>1&&u.trim()===u)if(2===i.length&&""===i[0]&&i[1].length<32)n=i[1];else{var a=i[i.length-2].slice(-1);" "===(0,o.X)(a)&&u.length<32&&(n=u)}return n},e}(),ln=function(){function e(e){this.composingLock=!1;var t=document.createElement("div");t.className="vditor-ir",t.innerHTML='<pre class="vditor-reset" placeholder="'.concat(e.options.placeholder,'"\n contenteditable="true" spellcheck="false"></pre>'),this.element=t.firstElementChild,this.bindEvent(e),Xe(e,this.element),Ze(e,this.element),Je(e,this.element),tt(e,this.element),nt(e,this.element),$e(e,this.element),Ye(e,this.element,this.copy),Qe(e,this.element,this.copy)}return e.prototype.copy=function(e,t){var n=getSelection().getRangeAt(0);if(""!==n.toString()){e.stopPropagation(),e.preventDefault();var r=document.createElement("div");r.appendChild(n.cloneContents()),e.clipboardData.setData("text/plain",t.lute.VditorIRDOM2Md(r.innerHTML).trim()),e.clipboardData.setData("text/html","")}},e.prototype.bindEvent=function(e){var t=this;this.element.addEventListener("paste",function(t){Jt(e,t,{pasteCode:function(e){document.execCommand("insertHTML",!1,e)}})}),this.element.addEventListener("scroll",function(){v(e,["hint"])}),this.element.addEventListener("compositionstart",function(e){t.composingLock=!0}),this.element.addEventListener("compositionend",function(n){(0,s.vU)()||P(e,getSelection().getRangeAt(0).cloneRange()),t.composingLock=!1}),this.element.addEventListener("input",function(n){if("deleteByDrag"!==n.inputType&&"insertFromDrop"!==n.inputType)return t.preventInput?(t.preventInput=!1,void en(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})):void(t.composingLock||"‘"===n.data||"“"===n.data||"《"===n.data||P(e,getSelection().getRangeAt(0).cloneRange(),!1,n))}),this.element.addEventListener("click",function(n){if("INPUT"===n.target.tagName)return n.target.checked?n.target.setAttribute("checked","checked"):n.target.removeAttribute("checked"),t.preventInput=!0,void en(e);var r=(0,N.zh)(e),o=(0,g.fb)(n.target,"vditor-ir__preview");if(o||(o=(0,g.fb)(r.startContainer,"vditor-ir__preview")),o&&(o.previousElementSibling.firstElementChild?r.selectNodeContents(o.previousElementSibling.firstElementChild):r.selectNodeContents(o.previousElementSibling),r.collapse(!0),(0,N.Hc)(r),et(e)),"IMG"===n.target.tagName){var u=n.target.parentElement.querySelector(".vditor-ir__marker--link");u&&(r.selectNode(u),(0,N.Hc)(r))}var a=(0,g.a1)(n.target,"data-type","a");if(!a||a.classList.contains("vditor-ir__node--expand")){if(n.target.isEqualNode(t.element)&&t.element.lastElementChild&&r.collapsed){var l=t.element.lastElementChild.getBoundingClientRect();n.y>l.top+l.height&&("P"===t.element.lastElementChild.tagName&&""===t.element.lastElementChild.textContent.trim().replace(i.g.ZWSP,"")?(r.selectNodeContents(t.element.lastElementChild),r.collapse(!1)):(t.element.insertAdjacentHTML("beforeend",'<p data-block="0">'.concat(i.g.ZWSP,"<wbr></p>")),(0,N.ib)(t.element,r)))}""===r.toString()?R(r,e):setTimeout(function(){R((0,N.zh)(e),e)}),H(n,e),ye(e)}else e.options.link.click?e.options.link.click(a.querySelector(":scope > .vditor-ir__marker--link")):e.options.link.isOpen&&window.open(a.querySelector(":scope > .vditor-ir__marker--link").textContent)}),this.element.addEventListener("keyup",function(n){if(!n.isComposing&&!(0,s.yl)(n))if("Enter"===n.key&&et(e),ye(e),"Backspace"!==n.key&&"Delete"!==n.key||""===e.ir.element.innerHTML||1!==e.ir.element.childNodes.length||!e.ir.element.firstElementChild||"P"!==e.ir.element.firstElementChild.tagName||0!==e.ir.element.firstElementChild.childElementCount||""!==e.ir.element.textContent&&"\n"!==e.ir.element.textContent){var r=(0,N.zh)(e);"Backspace"===n.key?((0,s.vU)()&&"\n"===r.startContainer.textContent&&1===r.startOffset&&(r.startContainer.textContent="",R(r,e)),t.element.querySelectorAll(".language-math").forEach(function(e){var t=e.querySelector("br");t&&t.remove()})):n.key.indexOf("Arrow")>-1?("ArrowLeft"!==n.key&&"ArrowRight"!==n.key||Qt(e),R(r,e)):229===n.keyCode&&""===n.code&&"Unidentified"===n.key&&R(r,e);var o=(0,g.fb)(r.startContainer,"vditor-ir__preview");if(o){if("ArrowUp"===n.key||"ArrowLeft"===n.key)return o.previousElementSibling.firstElementChild?r.selectNodeContents(o.previousElementSibling.firstElementChild):r.selectNodeContents(o.previousElementSibling),r.collapse(!1),n.preventDefault(),!0;if("SPAN"===o.tagName&&("ArrowDown"===n.key||"ArrowRight"===n.key))return"html-entity"===o.parentElement.getAttribute("data-type")?(o.parentElement.insertAdjacentText("afterend",i.g.ZWSP),r.setStart(o.parentElement.nextSibling,1)):r.selectNodeContents(o.parentElement.lastElementChild),r.collapse(!1),n.preventDefault(),!0}}else e.ir.element.innerHTML=""})},e}(),sn=function(e){return"sv"===e.currentMode?e.lute.Md2HTML(u(e)):"wysiwyg"===e.currentMode?e.lute.VditorDOM2HTML(e.wysiwyg.element.innerHTML):"ir"===e.currentMode?e.lute.VditorIRDOM2HTML(e.ir.element.innerHTML):void 0},cn=n(214),dn=n(436),pn=function(){function e(e){this.element=document.createElement("div"),this.element.className="vditor-outline",this.element.innerHTML='<div class="vditor-outline__title">'.concat(e,'</div>\n<div class="vditor-outline__content"></div>')}return e.prototype.render=function(e){return"block"===e.preview.element.style.display?(0,dn.k)(e.preview.previewElement,this.element.lastElementChild,e):(0,dn.k)(e[e.currentMode].element,this.element.lastElementChild,e)},e.prototype.toggle=function(e,t,n){var r;void 0===t&&(t=!0),void 0===n&&(n=!0);var o=null===(r=e.toolbar.elements.outline)||void 0===r?void 0:r.firstElementChild;if(t&&window.innerWidth>=i.g.MOBILE_WIDTH?(this.element.style.display="block",this.render(e),null==o||o.classList.add("vditor-menu--current")):(this.element.style.display="none",null==o||o.classList.remove("vditor-menu--current")),n&&getSelection().rangeCount>0){var u=getSelection().getRangeAt(0);e[e.currentMode].element.contains(u.startContainer)&&(0,N.Hc)(u)}G(e)},e}(),fn=n(280),hn=function(){function e(e){var t=this;this.element=document.createElement("div"),this.element.className="vditor-preview",this.previewElement=document.createElement("div"),this.previewElement.className="vditor-reset",e.options.classes.preview&&this.previewElement.classList.add(e.options.classes.preview),this.previewElement.style.maxWidth=e.options.preview.maxWidth+"px",this.previewElement.addEventListener("copy",function(n){if("TEXTAREA"!==n.target.tagName){var r=document.createElement("div");r.className="vditor-reset",r.appendChild(getSelection().getRangeAt(0).cloneContents()),t.copyToX(e,r,"default"),n.preventDefault()}}),this.previewElement.addEventListener("click",function(n){var r=(0,g.lG)(n.target,"SPAN");if(r&&(0,g.fb)(r,"vditor-toc")){var i=t.previewElement.querySelector("#"+r.getAttribute("data-target-id"));i&&(t.element.scrollTop=i.offsetTop)}else{if("A"===n.target.tagName)return e.options.link.click?e.options.link.click(n.target):e.options.link.isOpen&&window.open(n.target.getAttribute("href")),void n.preventDefault();"IMG"===n.target.tagName&&(e.options.image.preview?e.options.image.preview(n.target):e.options.image.isPreview&&(0,U.E)(n.target,e.options.lang,e.options.theme))}}),this.element.appendChild(this.previewElement);var n=e.options.preview.actions;if(0!==n.length){var r=document.createElement("div");r.className="vditor-preview__action";for(var i=[],o=0;o<n.length;o++){var u=n[o];if("object"!==w(u))switch(u){case"desktop":i.push('<button type="button" class="vditor-preview__action--current" data-type="desktop">Desktop</button>');break;case"tablet":i.push('<button type="button" data-type="tablet">Tablet</button>');break;case"mobile":i.push('<button type="button" data-type="mobile">Mobile/Wechat</button>');break;case"mp-wechat":i.push('<button type="button" data-type="mp-wechat" class="vditor-tooltipped vditor-tooltipped__w" aria-label="复制到公众号"><svg><use xlink:href="#vditor-icon-mp-wechat"></use></svg></button>');break;case"zhihu":i.push('<button type="button" data-type="zhihu" class="vditor-tooltipped vditor-tooltipped__w" aria-label="复制到知乎"><svg><use xlink:href="#vditor-icon-zhihu"></use></svg></button>')}else i.push('<button type="button" data-type="'.concat(u.key,'" class="').concat(u.className,'"').concat(u.tooltip?' aria-label="'.concat(u.tooltip,'"'):"",'">').concat(u.text,"</button>"))}r.innerHTML=i.join(""),r.addEventListener((0,s.Le)(),function(i){var o=(0,b.S)(i.target,"BUTTON");if(o){var u=o.getAttribute("data-type"),a=n.find(function(e){return(null==e?void 0:e.key)===u});a?a.click(u):"mp-wechat"!==u&&"zhihu"!==u?(t.previewElement.style.width="desktop"===u?"auto":"tablet"===u?"780px":"360px",t.previewElement.scrollWidth>t.previewElement.parentElement.clientWidth&&(t.previewElement.style.width="auto"),t.render(e),r.querySelectorAll("button").forEach(function(e){e.classList.remove("vditor-preview__action--current")}),o.classList.add("vditor-preview__action--current")):t.copyToX(e,t.previewElement.cloneNode(!0),u)}}),this.element.insertBefore(r,this.previewElement)}}return e.prototype.render=function(e,t){var n=this;if(clearTimeout(this.mdTimeoutId),"none"!==this.element.style.display)if(t)this.previewElement.innerHTML=t;else if(""!==u(e).replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")){var r=(new Date).getTime(),i=u(e);this.mdTimeoutId=window.setTimeout(function(){if(e.options.preview.url){var t=new XMLHttpRequest;t.open("POST",e.options.preview.url),t.setRequestHeader("Content-Type","application/json;charset=UTF-8"),t.onreadystatechange=function(){if(t.readyState===XMLHttpRequest.DONE)if(200===t.status){var o=JSON.parse(t.responseText);if(0!==o.code)return void e.tip.show(o.msg);e.options.preview.transform&&(o.data=e.options.preview.transform(o.data)),n.previewElement.innerHTML=o.data,n.afterRender(e,r)}else{var u=e.lute.Md2HTML(i);e.options.preview.transform&&(u=e.options.preview.transform(u)),n.previewElement.innerHTML=u,n.afterRender(e,r)}},t.send(JSON.stringify({markdownText:i}))}else{var o=e.lute.Md2HTML(i);e.options.preview.transform&&(o=e.options.preview.transform(o)),n.previewElement.innerHTML=o,n.afterRender(e,r)}},e.options.preview.delay)}else this.previewElement.innerHTML="";else"renderPerformance"===this.element.getAttribute("data-type")&&e.tip.hide()},e.prototype.afterRender=function(e,t){e.options.preview.parse&&e.options.preview.parse(this.element);var n=(new Date).getTime()-t;(new Date).getTime()-t>2600?(e.tip.show(window.VditorI18n.performanceTip.replace("${x}",n.toString())),e.preview.element.setAttribute("data-type","renderPerformance")):"renderPerformance"===e.preview.element.getAttribute("data-type")&&(e.tip.hide(),e.preview.element.removeAttribute("data-type"));var r=e.preview.element.querySelector(".vditor-comment--focus");r&&r.classList.remove("vditor-comment--focus"),(0,C.O)(e.preview.previewElement,e.options.preview.hljs),(0,F.s)(e.options.preview.hljs,e.preview.previewElement,e.options.cdn),(0,S.i)(e.preview.previewElement,e.options.cdn,e.options.theme),(0,T.K)(e.preview.previewElement,e.options.cdn),(0,B.J)(e.preview.previewElement,e.options.cdn,e.options.theme),(0,A.P)(e.preview.previewElement,e.options.cdn),(0,_.v)(e.preview.previewElement,e.options.cdn),(0,E.p)(e.preview.previewElement,e.options.cdn,e.options.theme),(0,x.P)(e.preview.previewElement,e.options.cdn,e.options.theme),(0,L.B)(e.preview.previewElement,e.options.cdn),(0,y.Q)(e.preview.previewElement,e.options.cdn),e.options.preview.render.media.enable&&(0,fn.Y)(e.preview.previewElement),e.options.customRenders.forEach(function(t){t.render(e.preview.previewElement,e)});var i=e.preview.element,o=e.outline.render(e);""===o&&(o="[ToC]"),i.querySelectorAll('[data-type="toc-block"]').forEach(function(t){t.innerHTML=o,(0,k.H)(t,{cdn:e.options.cdn,math:e.options.preview.math})}),(0,k.H)(e.preview.previewElement,{cdn:e.options.cdn,math:e.options.preview.math})},e.prototype.copyToX=function(e,t,n){void 0===n&&(n="mp-wechat"),"zhihu"!==n?t.querySelectorAll(".katex-html .base").forEach(function(e){e.style.display="initial"}):t.querySelectorAll(".language-math").forEach(function(e){e.outerHTML='<img class="Formula-image" data-eeimg="true" src="//www.zhihu.com/equation?tex=" alt="'.concat(e.getAttribute("data-math"),'\\" style="display: block; margin: 0 auto; max-width: 100%;">')}),t.style.backgroundColor="#fff",t.querySelectorAll("code").forEach(function(e){e.style.backgroundImage="none"}),this.element.append(t);var r=t.ownerDocument.createRange();r.selectNode(t),(0,N.Hc)(r),document.execCommand("copy"),t.remove(),e.tip.show(["zhihu","mp-wechat"].includes(n)?"已复制,可到".concat("zhihu"===n?"知乎":"微信公众号平台","进行粘贴"):"已复制到剪切板")},e}(),mn=function(){function e(e){this.element=document.createElement("div"),this.element.className="vditor-resize vditor-resize--".concat(e.options.resize.position),this.element.innerHTML='<div><svg><use xlink:href="#vditor-icon-resize"></use></svg></div>',this.bindEvent(e)}return e.prototype.bindEvent=function(e){var t=this;this.element.addEventListener("mousedown",function(n){var r=document,i=n.clientY,o=e.element.offsetHeight,u=63+e.element.querySelector(".vditor-toolbar").clientHeight;r.ondragstart=function(){return!1},window.captureEvents&&window.captureEvents(),t.element.classList.add("vditor-resize--selected"),r.onmousemove=function(t){"top"===e.options.resize.position?e.element.style.height=Math.max(u,o+(i-t.clientY))+"px":e.element.style.height=Math.max(u,o+(t.clientY-i))+"px",e.options.typewriterMode&&(e.sv.element.style.paddingBottom=e.sv.element.parentElement.offsetHeight/2+"px")},r.onmouseup=function(){e.options.resize.after&&e.options.resize.after(e.element.offsetHeight-o),window.captureEvents&&window.captureEvents(),r.onmousemove=null,r.onmouseup=null,r.ondragstart=null,r.onselectstart=null,r.onselect=null,t.element.classList.remove("vditor-resize--selected")}})},e}(),vn=function(){function e(e){this.composingLock=!1,this.element=document.createElement("pre"),this.element.className="vditor-sv vditor-reset",this.element.setAttribute("placeholder",e.options.placeholder),this.element.setAttribute("contenteditable","true"),this.element.setAttribute("spellcheck","false"),this.bindEvent(e),Xe(e,this.element),Je(e,this.element),tt(e,this.element),nt(e,this.element),$e(e,this.element),Ye(e,this.element,this.copy),Qe(e,this.element,this.copy)}return e.prototype.copy=function(e,t){e.stopPropagation(),e.preventDefault(),e.clipboardData.setData("text/plain",Ke(t[t.currentMode].element))},e.prototype.bindEvent=function(e){var t=this;this.element.addEventListener("paste",function(t){Jt(e,t,{pasteCode:function(e){document.execCommand("insertHTML",!1,e)}})}),this.element.addEventListener("scroll",function(){if("block"===e.preview.element.style.display){var n=t.element.scrollTop,r=t.element.clientHeight,i=t.element.scrollHeight-parseFloat(t.element.style.paddingBottom||"0"),o=e.preview.element;o.scrollTop=n/r>.5?(n+r)*o.scrollHeight/i-r:n*o.scrollHeight/i}}),this.element.addEventListener("compositionstart",function(e){t.composingLock=!0}),this.element.addEventListener("compositionend",function(n){(0,s.vU)()||V(e,n),t.composingLock=!1}),this.element.addEventListener("input",function(n){if("deleteByDrag"!==n.inputType&&"insertFromDrop"!==n.inputType&&!t.composingLock&&"‘"!==n.data&&"“"!==n.data&&"《"!==n.data)return t.preventInput?(t.preventInput=!1,void at(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})):void V(e,n)}),this.element.addEventListener("keyup",function(t){t.isComposing||(0,s.yl)(t)||("Backspace"!==t.key&&"Delete"!==t.key||""===e.sv.element.innerHTML||1!==e.sv.element.childNodes.length||!e.sv.element.firstElementChild||"DIV"!==e.sv.element.firstElementChild.tagName||2!==e.sv.element.firstElementChild.childElementCount||""!==e.sv.element.firstElementChild.textContent&&"\n"!==e.sv.element.textContent?"Enter"===t.key&&et(e):e.sv.element.innerHTML="")})},e}(),Dn=function(){function e(){this.element=document.createElement("div"),this.element.className="vditor-tip"}return e.prototype.show=function(e,t){var n=this;void 0===t&&(t=6e3),this.element.className="vditor-tip vditor-tip--show",0===t?(this.element.innerHTML='<div class="vditor-tip__content">'.concat(e,'\n<div class="vditor-tip__close">X</div></div>'),this.element.querySelector(".vditor-tip__close").addEventListener("click",function(){n.hide()})):(this.element.innerHTML='<div class="vditor-tip__content">'.concat(e,"</div>"),setTimeout(function(){n.hide()},t)),this.element.removeAttribute("style"),setTimeout(function(){n.element.getBoundingClientRect().top<46&&(n.element.style.position="fixed",n.element.style.top="46px")},150)},e.prototype.hide=function(){this.element.className="vditor-messageElementtip",this.element.innerHTML=""},e}(),gn=function(e,t){if(t.options.preview.mode!==e){switch(t.options.preview.mode=e,e){case"both":t.sv.element.style.display="block",t.preview.element.style.display="block",t.preview.render(t),d(t.toolbar.elements,["both"]);break;case"editor":t.sv.element.style.display="block",t.preview.element.style.display="none",c(t.toolbar.elements,["both"])}t.devtools&&t.devtools.renderEchart(t)}},bn=($=function(e,t){return $=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},$(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}$(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),yn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return"both"===t.options.preview.mode&&r.element.children[0].classList.add("vditor-menu--current"),r.element.children[0].addEventListener((0,s.Le)(),function(e){r.element.firstElementChild.classList.contains(i.g.CLASS_MENU_DISABLED)||(e.preventDefault(),"sv"===t.currentMode&&("both"===t.options.preview.mode?gn("editor",t):gn("both",t)))}),r}return bn(t,e),t}(Ve),En=function(){this.element=document.createElement("div"),this.element.className="vditor-toolbar__br"},Cn=n(580),wn=(Y=function(e,t){return Y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Y(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Y(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),An=function(e){function t(t,n){var r=e.call(this,t,n)||this,o=r.element.children[0],u=document.createElement("div");u.className="vditor-hint".concat(2===n.level?"":" vditor-panel--arrow");var a="";return i.g.CODE_THEME.forEach(function(e){a+="<button>".concat(e,"</button>")}),u.innerHTML='<div style="overflow: auto;max-height:'.concat(window.innerHeight/2,'px">').concat(a,"</div>"),u.addEventListener((0,s.Le)(),function(e){"BUTTON"===e.target.tagName&&(v(t,["subToolbar"]),t.options.preview.hljs.style=e.target.textContent,(0,Cn.Y)(e.target.textContent,t.options.cdn),e.preventDefault(),e.stopPropagation())}),r.element.appendChild(u),D(t,u,o,n.level),r}return wn(t,e),t}(Ve),_n=(Q=function(e,t){return Q=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Q(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}Q(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),Fn=function(e){function t(t,n){var r=e.call(this,t,n)||this,i=r.element.children[0],o=document.createElement("div");o.className="vditor-hint".concat(2===n.level?"":" vditor-panel--arrow");var u="";return Object.keys(t.options.preview.theme.list).forEach(function(e){u+='<button data-type="'.concat(e,'">').concat(t.options.preview.theme.list[e],"</button>")}),o.innerHTML='<div style="overflow: auto;max-height:'.concat(window.innerHeight/2,'px">').concat(u,"</div>"),o.addEventListener((0,s.Le)(),function(e){"BUTTON"===e.target.tagName&&(v(t,["subToolbar"]),t.options.preview.theme.current=e.target.getAttribute("data-type"),(0,z.Z)(t.options.preview.theme.current,t.options.preview.theme.path),e.preventDefault(),e.stopPropagation())}),r.element.appendChild(o),D(t,o,i,n.level),r}return _n(t,e),t}(Ve),kn=function(){function e(e){this.element=document.createElement("span"),this.element.className="vditor-counter vditor-tooltipped vditor-tooltipped__nw",this.render(e,"")}return e.prototype.render=function(e,t){var n=t.endsWith("\n")?t.length-1:t.length;if("text"===e.options.counter.type&&e[e.currentMode]){var r=e[e.currentMode].element.cloneNode(!0);r.querySelectorAll(".vditor-wysiwyg__preview").forEach(function(e){e.remove()}),n=r.textContent.length}"number"==typeof e.options.counter.max?(n>e.options.counter.max?this.element.className="vditor-counter vditor-counter--error":this.element.className="vditor-counter",this.element.innerHTML="".concat(n,"/").concat(e.options.counter.max)):this.element.innerHTML="".concat(n),this.element.setAttribute("aria-label",e.options.counter.type),e.options.counter.after&&e.options.counter.after(n,{enable:e.options.counter.enable,max:e.options.counter.max,type:e.options.counter.type})},e}(),Sn=(ee=function(e,t){return ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},ee(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}ee(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),Tn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.children[0].innerHTML=n.icon,r.element.children[0].addEventListener((0,s.Le)(),function(e){e.preventDefault(),e.currentTarget.classList.contains(i.g.CLASS_MENU_DISABLED)||n.click(e,t)}),r}return Sn(t,e),t}(Ve),xn=(te=function(e,t){return te=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},te(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}te(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),Ln=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.firstElementChild.addEventListener((0,s.Le)(),function(e){var n=r.element.firstElementChild;n.classList.contains(i.g.CLASS_MENU_DISABLED)||(e.preventDefault(),n.classList.contains("vditor-menu--current")?(n.classList.remove("vditor-menu--current"),t.devtools.element.style.display="none",G(t)):(n.classList.add("vditor-menu--current"),t.devtools.element.style.display="block",G(t),t.devtools.renderEchart(t)))}),r}return xn(t,e),t}(Ve),Bn=function(){this.element=document.createElement("div"),this.element.className="vditor-toolbar__divider"},Mn=(ne=function(e,t){return ne=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},ne(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}ne(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),Nn=function(e){function t(t,n){var r=e.call(this,t,n)||this,i=document.createElement("div");i.className="vditor-panel vditor-panel--arrow";var o="";return Object.keys(t.options.hint.emoji).forEach(function(e){var n=t.options.hint.emoji[e];n.indexOf(".")>-1?o+='<button data-value=":'.concat(e,': " data-key=":').concat(e,':"><img\ndata-value=":').concat(e,': " data-key=":').concat(e,':" class="vditor-emojis__icon" src="').concat(n,'"/></button>'):o+='<button data-value="'.concat(n,' "\n data-key="').concat(e,'"><span class="vditor-emojis__icon">').concat(n,"</span></button>")}),i.innerHTML='<div class="vditor-emojis" style="max-height: '.concat("auto"===t.options.height?"auto":t.options.height-80,'px">').concat(o,'</div><div class="vditor-emojis__tail">\n <span class="vditor-emojis__tip"></span><span>').concat(t.options.hint.emojiTail||"","</span>\n</div>"),r.element.appendChild(i),D(t,i,r.element.firstElementChild,n.level),r.bindEvent(t),r}return Mn(t,e),t.prototype.bindEvent=function(e){var t=this;this.element.lastElementChild.addEventListener((0,s.Le)(),function(n){var r=(0,b.S)(n.target,"BUTTON");if(r){n.preventDefault();var i=r.getAttribute("data-value"),o=(0,N.zh)(e),u=i;if("wysiwyg"===e.currentMode?u=e.lute.SpinVditorDOM(i):"ir"===e.currentMode&&(u=e.lute.SpinVditorIRDOM(i)),i.indexOf(":")>-1&&"sv"!==e.currentMode){var a=document.createElement("div");a.innerHTML=u,u=a.firstElementChild.firstElementChild.outerHTML+" ",(0,N.oC)(u,e)}else o.extractContents(),o.insertNode(document.createTextNode(i)),(0,g.F9)(o.startContainer)||Ae(e,o);o.collapse(!1),(0,N.Hc)(o),t.element.lastElementChild.style.display="none",Nt(e)}}),this.element.lastElementChild.addEventListener("mouseover",function(e){var n=(0,b.S)(e.target,"BUTTON");n&&(t.element.querySelector(".vditor-emojis__tip").innerHTML=n.getAttribute("data-key"))})},t}(Ve),On=function(e,t,n){var r=document.createElement("a");"download"in r?(r.download=n,r.style.display="none",r.href=URL.createObjectURL(new Blob([t])),document.body.appendChild(r),r.click(),r.remove()):e.tip.show(window.VditorI18n.downloadTip,0)},Hn=(re=function(e,t){return re=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},re(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}re(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),In=function(e){function t(t,n){var r=e.call(this,t,n)||this,i=r.element.children[0],o=document.createElement("div");return o.className="vditor-hint".concat(2===n.level?"":" vditor-panel--arrow"),o.innerHTML='<button data-type="markdown">Markdown</button>\n<button data-type="pdf">PDF</button>\n<button data-type="html">HTML</button>',o.addEventListener((0,s.Le)(),function(e){var n=e.target;if("BUTTON"===n.tagName){switch(n.getAttribute("data-type")){case"markdown":!function(e){var t=u(e);On(e,t,t.substr(0,10)+".md")}(t);break;case"pdf":!function(e){e.tip.show(window.VditorI18n.generate,3800);var t=document.querySelector("#vditorExportIframe");t.contentDocument.open(),t.contentDocument.write('<link rel="stylesheet" href="'.concat(e.options.cdn,'/dist/index.css"/>\n<script src="').concat(e.options.cdn,'/dist/method.min.js"><\/script>\n<div id="preview" style="width: 800px"></div>\n<script>\nwindow.addEventListener("message", (e) => {\n if(!e.data) {\n return;\n }\n Vditor.preview(document.getElementById(\'preview\'), e.data, {\n cdn: "').concat(e.options.cdn,'",\n markdown: {\n theme: ').concat(JSON.stringify(e.options.preview.theme),'\n },\n hljs: {\n style: "').concat(e.options.preview.hljs.style,'"\n }\n });\n setTimeout(() => {\n window.print();\n }, 3600);\n}, false);\n<\/script>')),t.contentDocument.close(),setTimeout(function(){t.contentWindow.postMessage(u(e),"*")},200)}(t);break;case"html":!function(e){var t=sn(e),n='<html><head><link rel="stylesheet" type="text/css" href="'.concat(e.options.cdn,'/dist/index.css"/>\n<script src="').concat(e.options.cdn,"/dist/js/i18n/").concat(e.options.lang,'.js"><\/script>\n<script src="').concat(e.options.cdn,'/dist/method.min.js"><\/script></head>\n<body><div class="vditor-reset" id="preview">').concat(t,"</div>\n<script>\n const previewElement = document.getElementById('preview')\n Vditor.setContentTheme('").concat(e.options.preview.theme.current,"', '").concat(e.options.preview.theme.path,"');\n Vditor.codeRender(previewElement);\n Vditor.highlightRender(").concat(JSON.stringify(e.options.preview.hljs),", previewElement, '").concat(e.options.cdn,"');\n Vditor.mathRender(previewElement, {\n cdn: '").concat(e.options.cdn,"',\n math: ").concat(JSON.stringify(e.options.preview.math),",\n });\n Vditor.mermaidRender(previewElement, '").concat(e.options.cdn,"', '").concat(e.options.theme,"');\n Vditor.SMILESRender(previewElement, '").concat(e.options.cdn,"', '").concat(e.options.theme,"');\n Vditor.markmapRender(previewElement, '").concat(e.options.cdn,"');\n Vditor.flowchartRender(previewElement, '").concat(e.options.cdn,"');\n Vditor.graphvizRender(previewElement, '").concat(e.options.cdn,"');\n Vditor.chartRender(previewElement, '").concat(e.options.cdn,"', '").concat(e.options.theme,"');\n Vditor.mindmapRender(previewElement, '").concat(e.options.cdn,"', '").concat(e.options.theme,"');\n Vditor.abcRender(previewElement, '").concat(e.options.cdn,"');\n ").concat(e.options.preview.render.media.enable?"Vditor.mediaRender(previewElement);":"",'\n Vditor.speechRender(previewElement);\n<\/script>\n<script src="').concat(e.options.cdn,"/dist/js/icons/").concat(e.options.icon,'.js"><\/script></body></html>');On(e,n,t.substr(0,10)+".html")}(t)}v(t,["subToolbar"]),e.preventDefault(),e.stopPropagation()}}),r.element.appendChild(o),D(t,o,i,n.level),r}return Hn(t,e),t}(Ve),Pn=(ie=function(e,t){return ie=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},ie(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}ie(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),jn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r._bindEvent(t,n),r}return Pn(t,e),t.prototype._bindEvent=function(e,t){this.element.children[0].addEventListener((0,s.Le)(),function(n){n.preventDefault(),e.element.className.includes("vditor--fullscreen")?(t.level||(this.innerHTML=t.icon),e.element.style.zIndex="",document.body.style.overflow="",e.element.classList.remove("vditor--fullscreen"),Object.keys(e.toolbar.elements).forEach(function(t){var n=e.toolbar.elements[t].firstChild;n&&(n.className=n.className.replace("__s","__n"),e.options.toolbar.forEach(function(e){"string"!=typeof e&&e.tipPosition&&e.name===n.dataset.type&&(n.className="vditor-tooltipped vditor-tooltipped__".concat(e.tipPosition))}))}),e.counter&&(e.counter.element.className=e.counter.element.className.replace("__s","__n"))):(t.level||(this.innerHTML='<svg><use xlink:href="#vditor-icon-contract"></use></svg>'),e.element.style.zIndex=e.options.fullscreen.index.toString(),document.body.style.overflow="hidden",e.element.classList.add("vditor--fullscreen"),Object.keys(e.toolbar.elements).forEach(function(t){var n=e.toolbar.elements[t].firstChild;n&&(n.className=n.className.replace("__n","__s"))}),e.counter&&(e.counter.element.className=e.counter.element.className.replace("__n","__s"))),e.devtools&&e.devtools.renderEchart(e),t.click&&t.click(n,e),G(e),K(e)})},t}(Ve),Rn=(oe=function(e,t){return oe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},oe(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}oe(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),Un=function(e){function t(t,n){var r=e.call(this,t,n)||this,i=document.createElement("div");return i.className="vditor-hint vditor-panel--arrow",i.innerHTML='<button data-tag="h1" data-value="# ">'.concat(window.VditorI18n.heading1," ").concat((0,s.ns)("&lt;⌥⌘1>"),'</button>\n<button data-tag="h2" data-value="## ">').concat(window.VditorI18n.heading2," &lt;").concat((0,s.ns)("⌥⌘2"),'></button>\n<button data-tag="h3" data-value="### ">').concat(window.VditorI18n.heading3," &lt;").concat((0,s.ns)("⌥⌘3"),'></button>\n<button data-tag="h4" data-value="#### ">').concat(window.VditorI18n.heading4," &lt;").concat((0,s.ns)("⌥⌘4"),'></button>\n<button data-tag="h5" data-value="##### ">').concat(window.VditorI18n.heading5," &lt;").concat((0,s.ns)("⌥⌘5"),'></button>\n<button data-tag="h6" data-value="###### ">').concat(window.VditorI18n.heading6," &lt;").concat((0,s.ns)("⌥⌘6"),"></button>"),r.element.appendChild(i),r._bindEvent(t,i),r}return Rn(t,e),t.prototype._bindEvent=function(e,t){var n=this.element.children[0];n.addEventListener((0,s.Le)(),function(r){r.preventDefault(),clearTimeout(e.wysiwyg.afterRenderTimeoutId),clearTimeout(e.ir.processTimeoutId),clearTimeout(e.sv.processTimeoutId),n.classList.contains(i.g.CLASS_MENU_DISABLED)||(n.blur(),n.classList.contains("vditor-menu--current")?("wysiwyg"===e.currentMode?(Fe(e),Ee(e)):"ir"===e.currentMode&&tn(e,""),n.classList.remove("vditor-menu--current")):(v(e,["subToolbar"]),t.style.display="block"))});for(var r=0;r<6;r++)t.children.item(r).addEventListener((0,s.Le)(),function(r){r.preventDefault(),"wysiwyg"===e.currentMode?(_e(e,r.target.getAttribute("data-tag")),Ee(e),n.classList.add("vditor-menu--current")):"ir"===e.currentMode?(tn(e,r.target.getAttribute("data-value")),n.classList.add("vditor-menu--current")):lt(e,r.target.getAttribute("data-value")),t.style.display="none"})},t}(Ve),qn=(ue=function(e,t){return ue=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},ue(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}ue(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),Vn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.children[0].addEventListener((0,s.Le)(),function(e){e.preventDefault(),t.tip.show('<div style="margin-bottom:14px;font-size: 14px;line-height: 22px;min-width:300px;max-width: 360px;display: flex;">\n<div style="margin-top: 14px;flex: 1">\n <div>Markdown 使用指南</div>\n <ul style="list-style: none">\n <li><a href="https://ld246.com/article/1583308420519" target="_blank">语法速查手册</a></li>\n <li><a href="https://ld246.com/article/1583129520165" target="_blank">基础语法</a></li>\n <li><a href="https://ld246.com/article/1583305480675" target="_blank">扩展语法</a></li>\n <li><a href="https://ld246.com/article/1582778815353" target="_blank">键盘快捷键</a></li>\n </ul>\n</div>\n<div style="margin-top: 14px;flex: 1">\n <div>Vditor 支持</div>\n <ul style="list-style: none">\n <li><a href="https://github.com/Vanessa219/vditor/issues" target="_blank">Issues</a></li>\n <li><a href="https://ld246.com/tag/vditor" target="_blank">官方讨论区</a></li>\n <li><a href="https://ld246.com/article/1549638745630" target="_blank">开发手册</a></li>\n <li><a href="https://ld246.com/guide/markdown" target="_blank">演示地址</a></li>\n </ul>\n</div></div>',0)}),r}return qn(t,e),t}(Ve),zn=(ae=function(e,t){return ae=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},ae(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}ae(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),Wn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.children[0].addEventListener((0,s.Le)(),function(e){if(e.preventDefault(),!r.element.firstElementChild.classList.contains(i.g.CLASS_MENU_DISABLED)&&"sv"!==t.currentMode){var n=(0,N.zh)(t),o=(0,g.lG)(n.startContainer,"LI");o&&Tt(t,o,n)}}),r}return zn(t,e),t}(Ve),Gn=(le=function(e,t){return le=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},le(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}le(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),Kn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.children[0].addEventListener((0,s.Le)(),function(e){e.preventDefault(),t.tip.show('<div style="max-width: 520px; font-size: 14px;line-height: 22px;margin-bottom: 14px;">\n<p style="text-align: center;margin: 14px 0">\n <em>下一代的 Markdown 编辑器,为未来而构建</em>\n</p>\n<div style="display: flex;margin-bottom: 14px;flex-wrap: wrap;align-items: center">\n <img src="https://unpkg.com/vditor/dist/images/logo.png" style="margin: 0 auto;height: 68px"/>\n <div>&nbsp;&nbsp;</div>\n <div style="flex: 1;min-width: 250px">\n Vditor 是一款浏览器端的 Markdown 编辑器,支持所见即所得、即时渲染(类似 Typora)和分屏预览模式。\n 它使用 TypeScript 实现,支持原生 JavaScript 以及 Vue、React、Angular 和 Svelte 等框架。\n </div>\n</div>\n<div style="display: flex;flex-wrap: wrap;">\n <ul style="list-style: none;flex: 1;min-width:148px">\n <li>\n 项目地址:<a href="https://b3log.org/vditor" target="_blank">b3log.org/vditor</a>\n </li>\n <li>\n 开源协议:MIT\n </li>\n </ul>\n <ul style="list-style: none;margin-right: 18px">\n <li>\n 组件版本:Vditor v'.concat(i.H," / Lute v").concat(Lute.Version,'\n </li>\n <li>\n 赞助捐赠:<a href="https://ld246.com/sponsor" target="_blank">https://ld246.com/sponsor</a>\n </li>\n </ul>\n</div>\n</div>'),0)}),r}return Gn(t,e),t}(Ve),Xn=(se=function(e,t){return se=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},se(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}se(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),Zn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.children[0].addEventListener((0,s.Le)(),function(e){e.preventDefault(),r.element.firstElementChild.classList.contains(i.g.CLASS_MENU_DISABLED)||"sv"===t.currentMode||Ct(t,"afterend")}),r}return Xn(t,e),t}(Ve),Jn=(ce=function(e,t){return ce=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},ce(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}ce(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),$n=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.children[0].addEventListener((0,s.Le)(),function(e){e.preventDefault(),r.element.firstElementChild.classList.contains(i.g.CLASS_MENU_DISABLED)||"sv"===t.currentMode||Ct(t,"beforebegin")}),r}return Jn(t,e),t}(Ve),Yn=(de=function(e,t){return de=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},de(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}de(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),Qn=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.element.children[0].addEventListener((0,s.Le)(),function(e){if(e.preventDefault(),!r.element.firstElementChild.classList.contains(i.g.CLASS_MENU_DISABLED)&&"sv"!==t.currentMode){var n=(0,N.zh)(t),o=(0,g.lG)(n.startContainer,"LI");o&&xt(t,o,n,o.parentElement)}}),r}return Yn(t,e),t}(Ve),er=(pe=function(e,t){return pe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},pe(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}pe(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),tr=function(e){function t(t,n){var r=e.call(this,t,n)||this;return t.options.outline&&r.element.firstElementChild.classList.add("vditor-menu--current"),r.element.children[0].addEventListener((0,s.Le)(),function(e){e.preventDefault(),t.toolbar.elements.outline.firstElementChild.classList.contains(i.g.CLASS_MENU_DISABLED)||(t.options.outline.enable=!r.element.firstElementChild.classList.contains("vditor-menu--current"),t.outline.toggle(t,t.options.outline.enable))}),r}return er(t,e),t}(Ve),nr=(fe=function(e,t){return fe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},fe(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}fe(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),rr=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r._bindEvent(t),r}return nr(t,e),t.prototype._bindEvent=function(e){var t=this;this.element.children[0].addEventListener((0,s.Le)(),function(n){n.preventDefault();var r=t.element.firstElementChild;if(!r.classList.contains(i.g.CLASS_MENU_DISABLED)){var o=i.g.EDIT_TOOLBARS.concat(["both","edit-mode","devtools"]);r.classList.contains("vditor-menu--current")?(r.classList.remove("vditor-menu--current"),"sv"===e.currentMode?(e.sv.element.style.display="block","both"===e.options.preview.mode?e.preview.element.style.display="block":e.preview.element.style.display="none"):(e[e.currentMode].element.parentElement.style.display="block",e.preview.element.style.display="none"),p(e.toolbar.elements,o),e.outline.render(e)):(f(e.toolbar.elements,o),e.preview.element.style.display="block","sv"===e.currentMode?e.sv.element.style.display="none":e[e.currentMode].element.parentElement.style.display="none",e.preview.render(e),r.classList.add("vditor-menu--current"),v(e,["subToolbar","hint","popover"]),setTimeout(function(){e.outline.render(e)},e.options.preview.delay+10)),G(e)}})},t}(Ve),ir=function(){function e(e){var t;if(this.SAMPLE_RATE=5e3,this.isRecording=!1,this.readyFlag=!1,this.leftChannel=[],this.rightChannel=[],this.recordingLength=0,"undefined"!=typeof AudioContext)t=new AudioContext;else{if(!webkitAudioContext)return;t=new webkitAudioContext}this.DEFAULT_SAMPLE_RATE=t.sampleRate;var n=t.createGain();t.createMediaStreamSource(e).connect(n),this.recorder=t.createScriptProcessor(2048,2,1),this.recorder.onaudioprocess=null,n.connect(this.recorder),this.recorder.connect(t.destination),this.readyFlag=!0}return e.prototype.cloneChannelData=function(e,t){this.leftChannel.push(new Float32Array(e)),this.rightChannel.push(new Float32Array(t)),this.recordingLength+=2048},e.prototype.startRecordingNewWavFile=function(){this.readyFlag&&(this.isRecording=!0,this.leftChannel.length=this.rightChannel.length=0,this.recordingLength=0)},e.prototype.stopRecording=function(){this.isRecording=!1},e.prototype.buildWavFileBlob=function(){for(var e=this.mergeBuffers(this.leftChannel),t=this.mergeBuffers(this.rightChannel),n=new Float32Array(e.length),r=0;r<e.length;++r)n[r]=.5*(e[r]+t[r]);this.DEFAULT_SAMPLE_RATE>this.SAMPLE_RATE&&(n=this.downSampleBuffer(n,this.SAMPLE_RATE));var i=44+2*n.length,o=new ArrayBuffer(i),u=new DataView(o);this.writeUTFBytes(u,0,"RIFF"),u.setUint32(4,i,!0),this.writeUTFBytes(u,8,"WAVE"),this.writeUTFBytes(u,12,"fmt "),u.setUint32(16,16,!0),u.setUint16(20,1,!0),u.setUint16(22,1,!0),u.setUint32(24,this.SAMPLE_RATE,!0),u.setUint32(28,2*this.SAMPLE_RATE,!0),u.setUint16(32,2,!0),u.setUint16(34,16,!0);var a=2*n.length;this.writeUTFBytes(u,36,"data"),u.setUint32(40,a,!0);for(var l=n.length,s=44,c=0;c<l;c++)u.setInt16(s,32767*n[c],!0),s+=2;return new Blob([u],{type:"audio/wav"})},e.prototype.downSampleBuffer=function(e,t){if(t===this.DEFAULT_SAMPLE_RATE)return e;if(t>this.DEFAULT_SAMPLE_RATE)return e;for(var n=this.DEFAULT_SAMPLE_RATE/t,r=Math.round(e.length/n),i=new Float32Array(r),o=0,u=0;o<i.length;){for(var a=Math.round((o+1)*n),l=0,s=0,c=u;c<a&&c<e.length;c++)l+=e[c],s++;i[o]=l/s,o++,u=a}return i},e.prototype.mergeBuffers=function(e){for(var t=new Float32Array(this.recordingLength),n=0,r=e.length,i=0;i<r;++i){var o=e[i];t.set(o,n),n+=o.length}return t},e.prototype.writeUTFBytes=function(e,t,n){for(var r=n.length,i=0;i<r;i++)e.setUint8(t+i,n.charCodeAt(i))},e}(),or=(he=function(e,t){return he=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},he(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}he(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),ur=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r._bindEvent(t),r}return or(t,e),t.prototype._bindEvent=function(e){var t,n=this;this.element.children[0].addEventListener((0,s.Le)(),function(r){if(r.preventDefault(),!n.element.firstElementChild.classList.contains(i.g.CLASS_MENU_DISABLED)){var o=e[e.currentMode].element;if(t)if(t.isRecording){t.stopRecording(),e.tip.hide();var u=new File([t.buildWavFileBlob()],"record".concat((new Date).getTime(),".wav"),{type:"video/webm"});mt(e,[u]),n.element.children[0].classList.remove("vditor-menu--current")}else e.tip.show(window.VditorI18n.recording),o.setAttribute("contenteditable","false"),t.startRecordingNewWavFile(),n.element.children[0].classList.add("vditor-menu--current");else navigator.mediaDevices.getUserMedia({audio:!0}).then(function(r){(t=new ir(r)).recorder.onaudioprocess=function(e){if(t.isRecording){var n=e.inputBuffer.getChannelData(0),r=e.inputBuffer.getChannelData(1);t.cloneChannelData(n,r)}},t.startRecordingNewWavFile(),e.tip.show(window.VditorI18n.recording),o.setAttribute("contenteditable","false"),n.element.children[0].classList.add("vditor-menu--current")}).catch(function(){e.tip.show(window.VditorI18n["record-tip"])})}})},t}(Ve),ar=(me=function(e,t){return me=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},me(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}me(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),lr=function(e){function t(t,n){var r=e.call(this,t,n)||this;return f({redo:r.element},["redo"]),r.element.children[0].addEventListener((0,s.Le)(),function(e){e.preventDefault(),r.element.firstElementChild.classList.contains(i.g.CLASS_MENU_DISABLED)||t.undo.redo(t)}),r}return ar(t,e),t}(Ve),sr=(ve=function(e,t){return ve=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},ve(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}ve(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),cr=function(e){function t(t,n){var r=e.call(this,t,n)||this;return f({undo:r.element},["undo"]),r.element.children[0].addEventListener((0,s.Le)(),function(e){e.preventDefault(),r.element.firstElementChild.classList.contains(i.g.CLASS_MENU_DISABLED)||t.undo.undo(t)}),r}return sr(t,e),t}(Ve),dr=(De=function(e,t){return De=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},De(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}De(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),pr=function(e){function t(t,n){var r=e.call(this,t,n)||this,i='<input type="file"';return t.options.upload.multiple&&(i+=' multiple="multiple"'),t.options.upload.accept&&(i+=' accept="'.concat(t.options.upload.accept,'"')),r.element.children[0].innerHTML="".concat(n.icon||'<svg><use xlink:href="#vditor-icon-upload"></use></svg>').concat(i,">"),r._bindEvent(t),r}return dr(t,e),t.prototype._bindEvent=function(e){var t=this;this.element.children[0].addEventListener((0,s.Le)(),function(e){if(t.element.firstElementChild.classList.contains(i.g.CLASS_MENU_DISABLED))return e.stopPropagation(),void e.preventDefault()}),this.element.querySelector("input").addEventListener("change",function(n){if(t.element.firstElementChild.classList.contains(i.g.CLASS_MENU_DISABLED))return n.stopPropagation(),void n.preventDefault();0!==n.target.files.length&&mt(e,n.target.files,n.target)})},t}(Ve),fr=function(){function e(e){var t=this,n=e.options;this.elements={},this.element=document.createElement("div"),this.element.className="vditor-toolbar",n.toolbar.forEach(function(n,r){var i=t.genItem(e,n,r);if(t.element.appendChild(i),n.toolbar){var o=document.createElement("div");o.className="vditor-hint vditor-panel--arrow",o.addEventListener((0,s.Le)(),function(e){o.style.display="none"}),n.toolbar.forEach(function(n,i){n.level=2,o.appendChild(t.genItem(e,n,r+i))}),i.appendChild(o),D(e,o,i.children[0])}}),e.options.toolbarConfig.hide&&this.element.classList.add("vditor-toolbar--hide"),e.options.toolbarConfig.pin&&this.element.classList.add("vditor-toolbar--pin"),e.options.counter.enable&&(e.counter=new kn(e),this.element.appendChild(e.counter.element))}return e.prototype.updateConfig=function(e,t){e.options.toolbarConfig=Object.assign({hide:!1,pin:!1},t),e.options.toolbarConfig.hide?this.element.classList.add("vditor-toolbar--hide"):this.element.classList.remove("vditor-toolbar--hide"),e.options.toolbarConfig.pin?this.element.classList.add("vditor-toolbar--pin"):this.element.classList.remove("vditor-toolbar--pin")},e.prototype.genItem=function(e,t,n){var r;switch(t.name){case"bold":case"italic":case"more":case"strike":case"line":case"quote":case"list":case"ordered-list":case"check":case"code":case"inline-code":case"link":case"table":r=new Ve(e,t);break;case"emoji":r=new Nn(e,t);break;case"headings":r=new Un(e,t);break;case"|":r=new Bn;break;case"br":r=new En;break;case"undo":r=new cr(e,t);break;case"redo":r=new lr(e,t);break;case"help":r=new Vn(e,t);break;case"both":r=new yn(e,t);break;case"preview":r=new rr(e,t);break;case"fullscreen":r=new jn(e,t);break;case"upload":r=new pr(e,t);break;case"record":r=new ur(e,t);break;case"info":r=new Kn(e,t);break;case"edit-mode":r=new Ge(e,t);break;case"devtools":r=new Ln(e,t);break;case"outdent":r=new Qn(e,t);break;case"indent":r=new Wn(e,t);break;case"outline":r=new tr(e,t);break;case"insert-after":r=new Zn(e,t);break;case"insert-before":r=new $n(e,t);break;case"code-theme":r=new An(e,t);break;case"content-theme":r=new Fn(e,t);break;case"export":r=new In(e,t);break;default:r=new Tn(e,t)}if(r){var i=t.name;return"br"!==i&&"|"!==i||(i+=n),this.elements[i]=r.element,r.element}},e}(),hr=n(173),mr=function(){function e(){this.stackSize=50,this.resetStack(),this.dmp=new hr}return e.prototype.clearStack=function(e){this.resetStack(),this.resetIcon(e)},e.prototype.resetIcon=function(e){e.toolbar&&(this[e.currentMode].undoStack.length>1?p(e.toolbar.elements,["undo"]):f(e.toolbar.elements,["undo"]),0!==this[e.currentMode].redoStack.length?p(e.toolbar.elements,["redo"]):f(e.toolbar.elements,["redo"]))},e.prototype.undo=function(e){if("false"!==e[e.currentMode].element.getAttribute("contenteditable")&&!(this[e.currentMode].undoStack.length<2)){var t=this[e.currentMode].undoStack.pop();t&&(this[e.currentMode].redoStack.push(t),this.renderDiff(t,e),this[e.currentMode].hasUndo=!0,v(e,["hint"]))}},e.prototype.redo=function(e){if("false"!==e[e.currentMode].element.getAttribute("contenteditable")){var t=this[e.currentMode].redoStack.pop();t&&(this[e.currentMode].undoStack.push(t),this.renderDiff(t,e,!0))}},e.prototype.recordFirstPosition=function(e,t){if(0!==getSelection().rangeCount&&!(1!==this[e.currentMode].undoStack.length||0===this[e.currentMode].undoStack[0].length||this[e.currentMode].redoStack.length>0||(0,s.vU)()&&"Backspace"===t.key||(0,s.G6)())){var n=this.addCaret(e);n.replace("<wbr>","").replace(" vditor-ir__node--expand","")===this[e.currentMode].undoStack[0][0].diffs[0][1].replace("<wbr>","")&&(this[e.currentMode].undoStack[0][0].diffs[0][1]=n,this[e.currentMode].lastText=n)}},e.prototype.addToUndoStack=function(e){var t=this.addCaret(e,!0),n=this.dmp.diff_main(t,this[e.currentMode].lastText,!0),r=this.dmp.patch_make(t,this[e.currentMode].lastText,n);0===r.length&&this[e.currentMode].undoStack.length>0||(this[e.currentMode].lastText=t,this[e.currentMode].undoStack.push(r),this[e.currentMode].undoStack.length>this.stackSize&&this[e.currentMode].undoStack.shift(),this[e.currentMode].hasUndo&&(this[e.currentMode].redoStack=[],this[e.currentMode].hasUndo=!1,f(e.toolbar.elements,["redo"])),this[e.currentMode].undoStack.length>1&&p(e.toolbar.elements,["undo"]))},e.prototype.renderDiff=function(e,t,n){var r;if(void 0===n&&(n=!1),n){var i=this.dmp.patch_deepCopy(e).reverse();i.forEach(function(e){e.diffs.forEach(function(e){e[0]=-e[0]})}),r=this.dmp.patch_apply(i,this[t.currentMode].lastText)[0]}else r=this.dmp.patch_apply(e,this[t.currentMode].lastText)[0];if(this[t.currentMode].lastText=r,t[t.currentMode].element.innerHTML=r,"sv"!==t.currentMode&&(t[t.currentMode].element.querySelectorAll(".vditor-".concat(t.currentMode,"__preview")).forEach(function(e){e.parentElement.querySelector(".language-echarts")&&("ir"===t.currentMode?e.parentElement.outerHTML=t.lute.SpinVditorIRDOM(e.parentElement.outerHTML):e.parentElement.outerHTML=t.lute.SpinVditorDOM(e.parentElement.outerHTML))}),t[t.currentMode].element.querySelectorAll(".vditor-".concat(t.currentMode,"__preview[data-render='2']")).forEach(function(e){M(e,t)})),t[t.currentMode].element.querySelector("wbr"))(0,N.ib)(t[t.currentMode].element,t[t.currentMode].element.ownerDocument.createRange()),et(t);else{var o=getSelection().getRangeAt(0);o.setEndBefore(t[t.currentMode].element),o.collapse(!1)}O(t),Nt(t,{enableAddUndoStack:!1,enableHint:!1,enableInput:!0}),Re(t),t[t.currentMode].element.querySelectorAll(".vditor-".concat(t.currentMode,"__preview[data-render='2']")).forEach(function(e){M(e,t)}),this[t.currentMode].undoStack.length>1?p(t.toolbar.elements,["undo"]):f(t.toolbar.elements,["undo"]),0!==this[t.currentMode].redoStack.length?p(t.toolbar.elements,["redo"]):f(t.toolbar.elements,["redo"])},e.prototype.resetStack=function(){this.ir={hasUndo:!1,lastText:"",redoStack:[],undoStack:[]},this.sv={hasUndo:!1,lastText:"",redoStack:[],undoStack:[]},this.wysiwyg={hasUndo:!1,lastText:"",redoStack:[],undoStack:[]}},e.prototype.addCaret=function(e,t){var n;if(void 0===t&&(t=!1),0!==getSelection().rangeCount&&!e[e.currentMode].element.querySelector("wbr")){var r=getSelection().getRangeAt(0);if(e[e.currentMode].element.contains(r.startContainer)){n=r.cloneRange();var i=document.createElement("span");i.className="vditor-wbr",r.insertNode(i)}}var o=e[e.currentMode].element.cloneNode(!0);o.querySelectorAll(".vditor-".concat(e.currentMode,"__preview[data-render='1']")).forEach(function(e){e.firstElementChild&&(e.firstElementChild.classList.contains("language-echarts")||e.firstElementChild.classList.contains("language-plantuml")||e.firstElementChild.classList.contains("language-mindmap")?(e.firstElementChild.removeAttribute("_echarts_instance_"),e.firstElementChild.removeAttribute("data-processed"),e.firstElementChild.innerHTML=e.previousElementSibling.firstElementChild.innerHTML,e.setAttribute("data-render","2")):e.firstElementChild.classList.contains("language-math")&&(e.setAttribute("data-render","2"),e.firstElementChild.textContent=e.firstElementChild.getAttribute("data-math"),e.firstElementChild.removeAttribute("data-math")))});var u=o.innerHTML;return e[e.currentMode].element.querySelectorAll(".vditor-wbr").forEach(function(e){e.remove()}),t&&n&&(0,N.Hc)(n),u.replace('<span class="vditor-wbr"></span>',"<wbr>")},e}(),vr=n(673),Dr=function(){function e(e){this.defaultOptions={rtl:!1,after:void 0,cache:{enable:!0},cdn:i.g.CDN,classes:{preview:""},comment:{enable:!1},counter:{enable:!1,type:"markdown"},customRenders:[],debugger:!1,fullscreen:{index:90},height:"auto",hint:{delay:200,emoji:{"+1":"👍","-1":"👎",confused:"😕",eyes:"👀️",heart:"❤️",rocket:"🚀️",smile:"😄",tada:"🎉️"},emojiPath:"".concat(i.g.CDN,"/dist/images/emoji"),extend:[],parse:!0},icon:"ant",lang:"zh_CN",mode:"ir",outline:{enable:!1,position:"left"},placeholder:"",preview:{actions:["desktop","tablet","mobile","mp-wechat","zhihu"],delay:1e3,hljs:i.g.HLJS_OPTIONS,markdown:i.g.MARKDOWN_OPTIONS,math:i.g.MATH_OPTIONS,maxWidth:800,mode:"both",theme:i.g.THEME_OPTIONS,render:{media:{enable:!0}}},link:{isOpen:!0},image:{isPreview:!0},resize:{enable:!1,position:"bottom"},theme:"classic",toolbar:["emoji","headings","bold","italic","strike","link","|","list","ordered-list","check","outdent","indent","|","quote","line","code","inline-code","insert-before","insert-after","|","upload","record","table","|","undo","redo","|","fullscreen","edit-mode",{name:"more",toolbar:["both","code-theme","content-theme","export","outline","preview","devtools","info","help"]}],toolbarConfig:{hide:!1,pin:!1},typewriterMode:!1,undoDelay:800,upload:{extraData:{},fieldName:"file[]",filename:function(e){return e.replace(/\W/g,"")},linkToImgUrl:"",max:10485760,multiple:!0,url:"",withCredentials:!1},value:"",width:"auto"},this.options=e}return e.prototype.merge=function(){var e,t,n,r,i,o,u,a,l;this.options&&(this.options.toolbar?this.options.toolbar=this.mergeToolbar(this.options.toolbar):this.options.toolbar=this.mergeToolbar(this.defaultOptions.toolbar),(null===(t=null===(e=this.options.preview)||void 0===e?void 0:e.theme)||void 0===t?void 0:t.list)&&(this.defaultOptions.preview.theme.list=this.options.preview.theme.list),(null===(i=null===(r=null===(n=this.options.preview)||void 0===n?void 0:n.render)||void 0===r?void 0:r.media)||void 0===i?void 0:i.enable)&&(this.defaultOptions.preview.render.media.enable=this.options.preview.render.media.enable),(null===(o=this.options.hint)||void 0===o?void 0:o.emoji)&&(this.defaultOptions.hint.emoji=this.options.hint.emoji),this.options.comment&&(this.defaultOptions.comment=this.options.comment),this.options.cdn&&((null===(a=null===(u=this.options.preview)||void 0===u?void 0:u.theme)||void 0===a?void 0:a.path)||(this.defaultOptions.preview.theme.path="".concat(this.options.cdn,"/dist/css/content-theme")),(null===(l=this.options.hint)||void 0===l?void 0:l.emojiPath)||(this.defaultOptions.hint.emojiPath="".concat(this.options.cdn,"/dist/images/emoji"))));var s=(0,vr.T)(this.defaultOptions,this.options);if(s.cache.enable&&!s.cache.id)throw new Error("need options.cache.id, see https://ld246.com/article/1549638745630#options");return s},e.prototype.mergeToolbar=function(e){var t=this,n=[{icon:'<svg><use xlink:href="#vditor-icon-export"></use></svg>',name:"export",tipPosition:"ne"},{hotkey:"⌘E",icon:'<svg><use xlink:href="#vditor-icon-emoji"></use></svg>',name:"emoji",tipPosition:"ne"},{hotkey:"⌘H",icon:'<svg><use xlink:href="#vditor-icon-headings"></use></svg>',name:"headings",tipPosition:"ne"},{hotkey:"⌘B",icon:'<svg><use xlink:href="#vditor-icon-bold"></use></svg>',name:"bold",prefix:"**",suffix:"**",tipPosition:"ne"},{hotkey:"⌘I",icon:'<svg><use xlink:href="#vditor-icon-italic"></use></svg>',name:"italic",prefix:"*",suffix:"*",tipPosition:"ne"},{hotkey:"⌘D",icon:'<svg><use xlink:href="#vditor-icon-strike"></use></svg>',name:"strike",prefix:"~~",suffix:"~~",tipPosition:"ne"},{hotkey:"⌘K",icon:'<svg><use xlink:href="#vditor-icon-link"></use></svg>',name:"link",prefix:"[",suffix:"](https://)",tipPosition:"n"},{name:"|"},{hotkey:"⌘L",icon:'<svg><use xlink:href="#vditor-icon-list"></use></svg>',name:"list",prefix:"* ",tipPosition:"n"},{hotkey:"⌘O",icon:'<svg><use xlink:href="#vditor-icon-ordered-list"></use></svg>',name:"ordered-list",prefix:"1. ",tipPosition:"n"},{hotkey:"⌘J",icon:'<svg><use xlink:href="#vditor-icon-check"></use></svg>',name:"check",prefix:"* [ ] ",tipPosition:"n"},{hotkey:"⇧⌘I",icon:'<svg><use xlink:href="#vditor-icon-outdent"></use></svg>',name:"outdent",tipPosition:"n"},{hotkey:"⇧⌘O",icon:'<svg><use xlink:href="#vditor-icon-indent"></use></svg>',name:"indent",tipPosition:"n"},{name:"|"},{hotkey:"⌘;",icon:'<svg><use xlink:href="#vditor-icon-quote"></use></svg>',name:"quote",prefix:"> ",tipPosition:"n"},{hotkey:"⇧⌘H",icon:'<svg><use xlink:href="#vditor-icon-line"></use></svg>',name:"line",prefix:"---",tipPosition:"n"},{hotkey:"⌘U",icon:'<svg><use xlink:href="#vditor-icon-code"></use></svg>',name:"code",prefix:"```",suffix:"\n```",tipPosition:"n"},{hotkey:"⌘G",icon:'<svg><use xlink:href="#vditor-icon-inline-code"></use></svg>',name:"inline-code",prefix:"`",suffix:"`",tipPosition:"n"},{hotkey:"⇧⌘B",icon:'<svg><use xlink:href="#vditor-icon-before"></use></svg>',name:"insert-before",tipPosition:"n"},{hotkey:"⇧⌘E",icon:'<svg><use xlink:href="#vditor-icon-after"></use></svg>',name:"insert-after",tipPosition:"n"},{name:"|"},{icon:'<svg><use xlink:href="#vditor-icon-upload"></use></svg>',name:"upload",tipPosition:"n"},{icon:'<svg><use xlink:href="#vditor-icon-record"></use></svg>',name:"record",tipPosition:"n"},{hotkey:"⌘M",icon:'<svg><use xlink:href="#vditor-icon-table"></use></svg>',name:"table",prefix:"| col1",suffix:" | col2 | col3 |\n| --- | --- | --- |\n| | | |\n| | | |",tipPosition:"n"},{name:"|"},{hotkey:"⌘Z",icon:'<svg><use xlink:href="#vditor-icon-undo"></use></svg>',name:"undo",tipPosition:"nw"},{hotkey:"⌘Y",icon:'<svg><use xlink:href="#vditor-icon-redo"></use></svg>',name:"redo",tipPosition:"nw"},{name:"|"},{icon:'<svg><use xlink:href="#vditor-icon-more"></use></svg>',name:"more",tipPosition:"e"},{hotkey:"⌘'",icon:'<svg><use xlink:href="#vditor-icon-fullscreen"></use></svg>',name:"fullscreen",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-edit"></use></svg>',name:"edit-mode",tipPosition:"nw"},{hotkey:"⌘P",icon:'<svg><use xlink:href="#vditor-icon-both"></use></svg>',name:"both",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-preview"></use></svg>',name:"preview",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-align-center"></use></svg>',name:"outline",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-theme"></use></svg>',name:"content-theme",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-code-theme"></use></svg>',name:"code-theme",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-bug"></use></svg>',name:"devtools",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-info"></use></svg>',name:"info",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-help"></use></svg>',name:"help",tipPosition:"nw"},{name:"br"}],r=[];return e.forEach(function(e){var i=e;n.forEach(function(t){"string"==typeof e&&t.name===e&&(i=t),"object"===w(e)&&t.name===e.name&&(i=Object.assign({},t,e))}),e.toolbar&&(i.toolbar=t.mergeToolbar(e.toolbar)),r.push(i)}),r},e}(),gr=function(){function e(e){var t=this;this.composingLock=!1,this.commentIds=[];var n=document.createElement("div");n.className="vditor-wysiwyg",n.innerHTML='<pre class="vditor-reset" placeholder="'.concat(e.options.placeholder,'"\n contenteditable="true" spellcheck="false"></pre>\n<div class="vditor-panel vditor-panel--none"></div>\n<div class="vditor-panel vditor-panel--none">\n <button type="button" aria-label="').concat(window.VditorI18n.comment,'" class="vditor-icon vditor-tooltipped vditor-tooltipped__n">\n <svg><use xlink:href="#vditor-icon-comment"></use></svg>\n </button>\n</div>'),this.element=n.firstElementChild,this.popover=n.firstElementChild.nextElementSibling,this.selectPopover=n.lastElementChild,this.bindEvent(e),Xe(e,this.element),Ze(e,this.element),Je(e,this.element),tt(e,this.element),nt(e,this.element),$e(e,this.element),Ye(e,this.element,this.copy),Qe(e,this.element,this.copy),e.options.comment.enable&&(this.selectPopover.querySelector("button").onclick=function(){var n,r,o=Lute.NewNodeID(),u=getSelection().getRangeAt(0),a=u.cloneRange(),l=u.extractContents(),s=!1,c=!1;l.childNodes.forEach(function(e,t){var i=!1;if(3===e.nodeType?i=!0:e.classList.contains("vditor-comment")?e.classList.contains("vditor-comment")&&e.setAttribute("data-cmtids",e.getAttribute("data-cmtids")+" "+o):i=!0,i)if(3!==e.nodeType&&"0"===e.getAttribute("data-block")&&0===t&&a.startOffset>0)e.innerHTML='<span class="vditor-comment" data-cmtids="'.concat(o,'">').concat(e.innerHTML,"</span>"),n=e;else if(3!==e.nodeType&&"0"===e.getAttribute("data-block")&&t===l.childNodes.length-1&&a.endOffset<a.endContainer.textContent.length)e.innerHTML='<span class="vditor-comment" data-cmtids="'.concat(o,'">').concat(e.innerHTML,"</span>"),r=e;else if(3!==e.nodeType&&"0"===e.getAttribute("data-block"))0===t?s=!0:t===l.childNodes.length-1&&(c=!0),e.innerHTML='<span class="vditor-comment" data-cmtids="'.concat(o,'">').concat(e.innerHTML,"</span>");else{var u=document.createElement("span");u.classList.add("vditor-comment"),u.setAttribute("data-cmtids",o),e.parentNode.insertBefore(u,e),u.appendChild(e)}});var d=(0,g.F9)(a.startContainer);d&&(n?(d.insertAdjacentHTML("beforeend",n.innerHTML),n.remove()):""===d.textContent.trim().replace(i.g.ZWSP,"")&&s&&d.remove());var p=(0,g.F9)(a.endContainer);p&&(r?(p.insertAdjacentHTML("afterbegin",r.innerHTML),r.remove()):""===p.textContent.trim().replace(i.g.ZWSP,"")&&c&&p.remove()),u.insertNode(l),e.options.comment.add(o,u.toString(),t.getComments(e,!0)),Ee(e,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),t.hideComment()})}return e.prototype.getComments=function(e,t){var n=this;if(void 0===t&&(t=!1),"wysiwyg"!==e.currentMode||!e.options.comment.enable)return[];this.commentIds=[],this.element.querySelectorAll(".vditor-comment").forEach(function(e){n.commentIds=n.commentIds.concat(e.getAttribute("data-cmtids").split(" "))}),this.commentIds=Array.from(new Set(this.commentIds));var r=[];return t?(this.commentIds.forEach(function(e){r.push({id:e,top:n.element.querySelector('.vditor-comment[data-cmtids="'.concat(e,'"]')).offsetTop})}),r):void 0},e.prototype.triggerRemoveComment=function(e){if("wysiwyg"===e.currentMode&&e.options.comment.enable&&e.wysiwyg.commentIds.length>0){var t=JSON.parse(JSON.stringify(this.commentIds));this.getComments(e);var n=function(e,t){var n=new Set(t);return e.filter(function(e){return!n.has(e)})}(t,this.commentIds);n.length>0&&e.options.comment.remove(n)}},e.prototype.showComment=function(){var e=(0,N.Ny)(this.element);this.selectPopover.setAttribute("style","left:".concat(e.left,"px;display:block;top:").concat(Math.max(-8,e.top-21),"px"))},e.prototype.hideComment=function(){this.selectPopover.setAttribute("style","display:none")},e.prototype.unbindListener=function(){window.removeEventListener("scroll",this.scrollListener)},e.prototype.copy=function(e,t){var n=getSelection().getRangeAt(0);if(""!==n.toString()){e.stopPropagation(),e.preventDefault();var r=(0,g.lG)(n.startContainer,"CODE"),i=(0,g.lG)(n.endContainer,"CODE");if(r&&i&&i.isSameNode(r)){var o="";return o="PRE"===r.parentElement.tagName?n.toString():"`"+n.toString()+"`",e.clipboardData.setData("text/plain",o),void e.clipboardData.setData("text/html","")}var u=(0,g.lG)(n.startContainer,"A"),a=(0,g.lG)(n.endContainer,"A");if(u&&a&&a.isSameNode(u)){var l=u.getAttribute("title")||"";return l&&(l=' "'.concat(l,'"')),e.clipboardData.setData("text/plain","[".concat(n.toString(),"](").concat(u.getAttribute("href")).concat(l,")")),void e.clipboardData.setData("text/html","")}var s=document.createElement("div");s.appendChild(n.cloneContents()),e.clipboardData.setData("text/plain",t.lute.VditorDOM2Md(s.innerHTML).trim()),e.clipboardData.setData("text/html","")}},e.prototype.bindEvent=function(e){var t=this;this.unbindListener(),window.addEventListener("scroll",this.scrollListener=function(){if(v(e,["hint"]),"block"===t.popover.style.display&&"block"===t.selectPopover.style.display){var n=parseInt(t.popover.getAttribute("data-top"),10);if("auto"===e.options.height){if(e.options.toolbarConfig.pin){var r=Math.max(n,window.scrollY-e.element.offsetTop-8)+"px";"block"===t.popover.style.display&&(t.popover.style.top=r),"block"===t.selectPopover.style.display&&(t.selectPopover.style.top=r)}}else if(e.options.toolbarConfig.pin&&0===e.toolbar.element.getBoundingClientRect().top){var i=Math.max(window.scrollY-e.element.offsetTop-8,Math.min(n-e.wysiwyg.element.scrollTop,t.element.clientHeight-21))+"px";"block"===t.popover.style.display&&(t.popover.style.top=i),"block"===t.selectPopover.style.display&&(t.selectPopover.style.top=i)}}}),this.element.addEventListener("scroll",function(){if(v(e,["hint"]),e.options.comment&&e.options.comment.enable&&e.options.comment.scroll&&e.options.comment.scroll(e.wysiwyg.element.scrollTop),"block"===t.popover.style.display){var n=parseInt(t.popover.getAttribute("data-top"),10)-e.wysiwyg.element.scrollTop,r=-8;e.options.toolbarConfig.pin&&0===e.toolbar.element.getBoundingClientRect().top&&(r=window.scrollY-e.element.offsetTop+r);var i=Math.max(r,Math.min(n,t.element.clientHeight-21))+"px";t.popover.style.top=i,t.selectPopover.style.top=i}}),this.element.addEventListener("paste",function(t){Jt(e,t,{pasteCode:function(t){var n=(0,N.zh)(e),r=document.createElement("template");r.innerHTML=t,n.insertNode(r.content.cloneNode(!0));var i=(0,g.a1)(n.startContainer,"data-block","0");i?i.outerHTML=e.lute.SpinVditorDOM(i.outerHTML):e.wysiwyg.element.innerHTML=e.lute.SpinVditorDOM(e.wysiwyg.element.innerHTML),(0,N.ib)(e.wysiwyg.element,n)}})}),this.element.addEventListener("compositionstart",function(){t.composingLock=!0}),this.element.addEventListener("compositionend",function(n){var r=(0,b.W)(getSelection().getRangeAt(0).startContainer);r&&""===r.textContent?O(e):((0,s.vU)()||vt(e,getSelection().getRangeAt(0).cloneRange(),n),t.composingLock=!1)}),this.element.addEventListener("input",function(n){if("deleteByDrag"!==n.inputType&&"insertFromDrop"!==n.inputType){if(t.preventInput)return t.preventInput=!1,void Ee(e);if(t.composingLock||"‘"===n.data||"“"===n.data||"《"===n.data)Ee(e);else{var r=getSelection().getRangeAt(0),i=(0,g.F9)(r.startContainer);if(i||(Ae(e,r),i=(0,g.F9)(r.startContainer)),i){for(var o=(0,N.im)(i,e.wysiwyg.element,r).start,a=!0,l=o-1;l>i.textContent.substr(0,o).lastIndexOf("\n");l--)if(" "!==i.textContent.charAt(l)&&"\t"!==i.textContent.charAt(l)){a=!1;break}0===o&&(a=!1);var s=!0;for(l=o-1;l<i.textContent.length;l++)if(" "!==i.textContent.charAt(l)&&"\n"!==i.textContent.charAt(l)){s=!1;break}s&&/^#{1,6} $/.test(i.textContent)&&(s=!1);var c=(0,b.W)(getSelection().getRangeAt(0).startContainer);c&&""===c.textContent&&(O(e),c.remove()),a&&"code-block"!==i.getAttribute("data-type")||s||Mt(i.innerHTML)||Bt(i.innerHTML)&&i.previousElementSibling?"function"==typeof e.options.input&&e.options.input(u(e)):("insertParagraph"===n.inputType&&"<p><br></p><p><br></p>"===t.element.innerHTML&&i.previousElementSibling.remove(),vt(e,r,n))}}}}),this.element.addEventListener("click",function(n){if("INPUT"===n.target.tagName){var r=n.target;return r.checked?r.setAttribute("checked","checked"):r.removeAttribute("checked"),t.preventInput=!0,getSelection().rangeCount>0&&(0,N.Hc)(getSelection().getRangeAt(0)),void Ee(e)}if("IMG"!==n.target.tagName||n.target.parentElement.classList.contains("vditor-wysiwyg__preview")){var o=(0,g.lG)(n.target,"A");if(o)return e.options.link.click?e.options.link.click(o):e.options.link.isOpen&&window.open(o.getAttribute("href")),void n.preventDefault();var a=(0,N.zh)(e);if(n.target.isEqualNode(t.element)&&t.element.lastElementChild&&a.collapsed){var l=t.element.lastElementChild.getBoundingClientRect();n.y>l.top+l.height&&("P"===t.element.lastElementChild.tagName&&""===t.element.lastElementChild.textContent.trim().replace(i.g.ZWSP,"")?(a.selectNodeContents(t.element.lastElementChild),a.collapse(!1)):(t.element.insertAdjacentHTML("beforeend",'<p data-block="0">'.concat(i.g.ZWSP,"<wbr></p>")),(0,N.ib)(t.element,a)))}Te(e);var s=(0,g.fb)(n.target,"vditor-wysiwyg__preview");s||(s=(0,g.fb)((0,N.zh)(e).startContainer,"vditor-wysiwyg__preview")),s&&ke(s,e),H(n,e)}else"link-ref"===n.target.getAttribute("data-type")?Le(e,n.target):function(e,t){var n=e.target;t.wysiwyg.popover.innerHTML="";var r=function(){n.setAttribute("src",o.value),n.setAttribute("alt",l.value),n.setAttribute("title",c.value),"function"==typeof t.options.input&&t.options.input(u(t))},i=document.createElement("span");i.setAttribute("aria-label",window.VditorI18n.imageURL),i.className="vditor-tooltipped vditor-tooltipped__n";var o=document.createElement("input");i.appendChild(o),o.className="vditor-input",o.setAttribute("placeholder",window.VditorI18n.imageURL),o.value=n.getAttribute("src")||"",o.oninput=function(){r()},o.onkeydown=function(e){Se(t,e)};var a=document.createElement("span");a.setAttribute("aria-label",window.VditorI18n.alternateText),a.className="vditor-tooltipped vditor-tooltipped__n";var l=document.createElement("input");a.appendChild(l),l.className="vditor-input",l.setAttribute("placeholder",window.VditorI18n.alternateText),l.style.width="52px",l.value=n.getAttribute("alt")||"",l.oninput=function(){r()},l.onkeydown=function(e){Se(t,e)};var s=document.createElement("span");s.setAttribute("aria-label",window.VditorI18n.title),s.className="vditor-tooltipped vditor-tooltipped__n";var c=document.createElement("input");s.appendChild(c),c.className="vditor-input",c.setAttribute("placeholder",window.VditorI18n.title),c.value=n.getAttribute("title")||"",c.oninput=function(){r()},c.onkeydown=function(e){Se(t,e)},Ne(n,t),t.wysiwyg.popover.insertAdjacentElement("beforeend",i),t.wysiwyg.popover.insertAdjacentElement("beforeend",a),t.wysiwyg.popover.insertAdjacentElement("beforeend",s),Pe(t,"image"),xe(t,n)}(n,e)}),this.element.addEventListener("keyup",function(t){if(!t.isComposing&&!(0,s.yl)(t)){"Enter"===t.key&&et(e),"Backspace"!==t.key&&"Delete"!==t.key||""===e.wysiwyg.element.innerHTML||1!==e.wysiwyg.element.childNodes.length||!e.wysiwyg.element.firstElementChild||"P"!==e.wysiwyg.element.firstElementChild.tagName||0!==e.wysiwyg.element.firstElementChild.childElementCount||""!==e.wysiwyg.element.textContent&&"\n"!==e.wysiwyg.element.textContent||(e.wysiwyg.element.innerHTML="");var n=(0,N.zh)(e);if("Backspace"===t.key&&(0,s.vU)()&&"\n"===n.startContainer.textContent&&1===n.startOffset&&(n.startContainer.textContent=""),Ae(e,n),Te(e),"ArrowDown"===t.key||"ArrowRight"===t.key||"Backspace"===t.key||"ArrowLeft"===t.key||"ArrowUp"===t.key){"ArrowLeft"!==t.key&&"ArrowRight"!==t.key||e.hint.render(e);var r=(0,g.fb)(n.startContainer,"vditor-wysiwyg__preview");if(!r&&3!==n.startContainer.nodeType&&n.startOffset>0&&(o=n.startContainer).classList.contains("vditor-wysiwyg__block")&&(r=o.lastElementChild),r)if("none"!==r.previousElementSibling.style.display){var i=r.previousElementSibling;if("PRE"===i.tagName&&(i=i.firstElementChild),"ArrowDown"===t.key||"ArrowRight"===t.key){var o,u=function(e){for(var t=e;t&&!t.nextSibling;)t=t.parentElement;return t.nextSibling}(o=r.parentElement);if(u&&3!==u.nodeType){var a=u.querySelector(".vditor-wysiwyg__preview");if(a)return void ke(a,e)}if(3===u.nodeType){for(;0===u.textContent.length&&u.nextSibling;)u=u.nextSibling;n.setStart(u,1)}else n.setStart(u.firstChild,0)}else n.selectNodeContents(i),n.collapse(!1)}else"ArrowDown"===t.key||"ArrowRight"===t.key?ke(r,e):ke(r,e,!1)}}})},e}(),br=(ge=function(e,t){return ge=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},ge(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}ge(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),yr=function(e){function t(t,n){var r=e.call(this)||this;if(r.isDestroyed=!1,r.version=i.H,"string"==typeof t){if(n?n.cache?n.cache.id||(n.cache.id="vditor".concat(t)):n.cache={id:"vditor".concat(t)}:n={cache:{id:"vditor".concat(t)}},!document.getElementById(t))return r.showErrorTip("Failed to get element by id: ".concat(t)),r;t=document.getElementById(t)}var o=new Dr(n).merge();if(o.i18n)window.VditorI18n=o.i18n,r.init(t,o);else{if(!["de_DE","en_US","es_ES","fr_FR","ja_JP","ko_KR","pt_BR","ru_RU","sv_SE","vi_VN","zh_CN","zh_TW"].includes(o.lang))throw new Error("options.lang error, see https://ld246.com/article/1549638745630#options");var u="vditorI18nScript",l=u+o.lang;document.querySelectorAll('head script[id^="'.concat(u,'"]')).forEach(function(e){e.id!==l&&document.head.removeChild(e)}),(0,a.G)("".concat(o.cdn,"/dist/js/i18n/").concat(o.lang,".js"),l).then(function(){r.init(t,o)}).catch(function(e){r.showErrorTip("GET ".concat(o.cdn,"/dist/js/i18n/").concat(o.lang,".js net::ERR_ABORTED 404 (Not Found)"))})}return r}return br(t,e),t.prototype.showErrorTip=function(e){var t=new Dn;document.body.appendChild(t.element),t.show(e,0)},t.prototype.updateToolbarConfig=function(e){this.vditor.toolbar.updateConfig(this.vditor,e)},t.prototype.setTheme=function(e,t,n,r){this.vditor.options.theme=e,W(this.vditor),t&&(this.vditor.options.preview.theme.current=t,(0,z.Z)(t,r||this.vditor.options.preview.theme.path)),n&&(this.vditor.options.preview.hljs.style=n,(0,Cn.Y)(n,this.vditor.options.cdn))},t.prototype.getValue=function(){return u(this.vditor)},t.prototype.getCurrentMode=function(){return this.vditor.currentMode},t.prototype.focus=function(){"sv"===this.vditor.currentMode?this.vditor.sv.element.focus():"wysiwyg"===this.vditor.currentMode?this.vditor.wysiwyg.element.focus():"ir"===this.vditor.currentMode&&this.vditor.ir.element.focus()},t.prototype.blur=function(){"sv"===this.vditor.currentMode?this.vditor.sv.element.blur():"wysiwyg"===this.vditor.currentMode?this.vditor.wysiwyg.element.blur():"ir"===this.vditor.currentMode&&this.vditor.ir.element.blur()},t.prototype.disabled=function(){v(this.vditor,["subToolbar","hint","popover"]),f(this.vditor.toolbar.elements,i.g.EDIT_TOOLBARS.concat(["undo","redo","fullscreen","edit-mode"])),this.vditor[this.vditor.currentMode].element.setAttribute("contenteditable","false")},t.prototype.enable=function(){p(this.vditor.toolbar.elements,i.g.EDIT_TOOLBARS.concat(["undo","redo","fullscreen","edit-mode"])),this.vditor.undo.resetIcon(this.vditor),this.vditor[this.vditor.currentMode].element.setAttribute("contenteditable","true")},t.prototype.getSelection=function(){return"wysiwyg"===this.vditor.currentMode?Ke(this.vditor.wysiwyg.element):"sv"===this.vditor.currentMode?Ke(this.vditor.sv.element):"ir"===this.vditor.currentMode?Ke(this.vditor.ir.element):void 0},t.prototype.renderPreview=function(e){this.vditor.preview.render(this.vditor,e)},t.prototype.getCursorPosition=function(){return(0,N.Ny)(this.vditor[this.vditor.currentMode].element)},t.prototype.isUploading=function(){return this.vditor.upload.isUploading},t.prototype.clearCache=function(){this.vditor.options.cache.enable&&(0,s.pK)()&&localStorage.removeItem(this.vditor.options.cache.id)},t.prototype.disabledCache=function(){this.vditor.options.cache.enable=!1},t.prototype.enableCache=function(){if(!this.vditor.options.cache.id)throw new Error("need options.cache.id, see https://ld246.com/article/1549638745630#options");this.vditor.options.cache.enable=!0},t.prototype.html2md=function(e){return this.vditor.lute.HTML2Md(e)},t.prototype.exportJSON=function(e){return this.vditor.lute.RenderJSON(e)},t.prototype.getHTML=function(){return sn(this.vditor)},t.prototype.tip=function(e,t){this.vditor.tip.show(e,t)},t.prototype.setPreviewMode=function(e){gn(e,this.vditor)},t.prototype.deleteValue=function(){window.getSelection().isCollapsed||document.execCommand("delete",!1)},t.prototype.updateValue=function(e){document.execCommand("insertHTML",!1,e)},t.prototype.insertValue=function(e,t){void 0===t&&(t=!0);var n=(0,N.zh)(this.vditor);n.collapse(!0);var r=document.createElement("template");r.innerHTML=e,n.insertNode(r.content.cloneNode(!0)),n.collapse(!1),"sv"===this.vditor.currentMode?(this.vditor.sv.preventInput=!0,t&&V(this.vditor)):"wysiwyg"===this.vditor.currentMode?t&&vt(this.vditor,getSelection().getRangeAt(0)):"ir"===this.vditor.currentMode&&(this.vditor.ir.preventInput=!0,t&&P(this.vditor,getSelection().getRangeAt(0),!0))},t.prototype.insertMD=function(e){"ir"===this.vditor.currentMode?(0,N.oC)(this.vditor.lute.Md2VditorIRDOM(e),this.vditor):"wysiwyg"===this.vditor.currentMode?(0,N.oC)(this.vditor.lute.Md2VditorDOM(e),this.vditor):rt(this.vditor,e),this.vditor.outline.render(this.vditor),Nt(this.vditor)},t.prototype.setValue=function(e,t){var n=this;void 0===t&&(t=!1),"sv"===this.vditor.currentMode?(this.vditor.sv.element.innerHTML="<div data-block='0'>".concat(this.vditor.lute.SpinVditorSVDOM(e),"</div>"),at(this.vditor,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1})):"wysiwyg"===this.vditor.currentMode?Ue(this.vditor,e,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}):(this.vditor.ir.element.innerHTML=this.vditor.lute.Md2VditorIRDOM(e),this.vditor.ir.element.querySelectorAll(".vditor-ir__preview[data-render='2']").forEach(function(e){M(e,n.vditor)}),en(this.vditor,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1})),this.vditor.outline.render(this.vditor),e||(v(this.vditor,["emoji","headings","submenu","hint"]),this.vditor.wysiwyg.popover&&(this.vditor.wysiwyg.popover.style.display="none"),this.clearCache()),t&&this.clearStack()},t.prototype.insertEmptyBlock=function(e){Ct(this.vditor,e)},t.prototype.clearStack=function(){this.vditor.undo.clearStack(this.vditor),this.vditor.undo.addToUndoStack(this.vditor)},t.prototype.destroy=function(){this.vditor.element.innerHTML=this.vditor.originalInnerHTML,this.vditor.element.classList.remove("vditor"),this.vditor.element.removeAttribute("style");var e=document.getElementById("vditorIconScript");e&&e.remove(),this.clearCache(),X(),this.vditor.wysiwyg.unbindListener(),this.vditor.options.after=void 0,this.isDestroyed=!0},t.prototype.getCommentIds=function(){return"wysiwyg"!==this.vditor.currentMode?[]:this.vditor.wysiwyg.getComments(this.vditor,!0)},t.prototype.hlCommentIds=function(e){if("wysiwyg"===this.vditor.currentMode){var t=function(t){t.classList.remove("vditor-comment--hover"),e.forEach(function(e){t.getAttribute("data-cmtids").indexOf(e)>-1&&t.classList.add("vditor-comment--hover")})};this.vditor.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(e){t(e)}),"none"!==this.vditor.preview.element.style.display&&this.vditor.preview.element.querySelectorAll(".vditor-comment").forEach(function(e){t(e)})}},t.prototype.unHlCommentIds=function(e){if("wysiwyg"===this.vditor.currentMode){var t=function(t){e.forEach(function(e){t.getAttribute("data-cmtids").indexOf(e)>-1&&t.classList.remove("vditor-comment--hover")})};this.vditor.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(e){t(e)}),"none"!==this.vditor.preview.element.style.display&&this.vditor.preview.element.querySelectorAll(".vditor-comment").forEach(function(e){t(e)})}},t.prototype.removeCommentIds=function(e){var t=this;if("wysiwyg"===this.vditor.currentMode){var n=function(e,n){var r=e.getAttribute("data-cmtids").split(" ");r.find(function(e,t){if(e===n)return r.splice(t,1),!0}),0===r.length?(e.outerHTML=e.innerHTML,(0,N.zh)(t.vditor).collapse(!0)):e.setAttribute("data-cmtids",r.join(" "))};e.forEach(function(e){t.vditor.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(t){n(t,e)}),"none"!==t.vditor.preview.element.style.display&&t.vditor.preview.element.querySelectorAll(".vditor-comment").forEach(function(t){n(t,e)})}),Ee(this.vditor,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1})}},t.prototype.init=function(e,t){var n=this;this.isDestroyed||(this.vditor={currentMode:t.mode,element:e,hint:new an(t.hint.extend),lute:void 0,options:t,originalInnerHTML:e.innerHTML,outline:new pn(window.VditorI18n.outline),tip:new Dn},this.vditor.sv=new vn(this.vditor),this.vditor.undo=new mr,this.vditor.wysiwyg=new gr(this.vditor),this.vditor.ir=new ln(this.vditor),this.vditor.toolbar=new fr(this.vditor),t.resize.enable&&(this.vditor.resize=new mn(this.vditor)),this.vditor.toolbar.elements.devtools&&(this.vditor.devtools=new l),(t.upload.url||t.upload.handler)&&(this.vditor.upload=new ht),(0,a.G)(t._lutePath||"".concat(t.cdn,"/dist/js/lute/lute.min.js"),"vditorLuteScript").then(function(){n.vditor.lute=(0,cn.X)({autoSpace:n.vditor.options.preview.markdown.autoSpace,gfmAutoLink:n.vditor.options.preview.markdown.gfmAutoLink,codeBlockPreview:n.vditor.options.preview.markdown.codeBlockPreview,emojiSite:n.vditor.options.hint.emojiPath,emojis:n.vditor.options.hint.emoji,fixTermTypo:n.vditor.options.preview.markdown.fixTermTypo,footnotes:n.vditor.options.preview.markdown.footnotes,headingAnchor:!1,inlineMathDigit:n.vditor.options.preview.math.inlineDigit,linkBase:n.vditor.options.preview.markdown.linkBase,linkPrefix:n.vditor.options.preview.markdown.linkPrefix,listStyle:n.vditor.options.preview.markdown.listStyle,mark:n.vditor.options.preview.markdown.mark,mathBlockPreview:n.vditor.options.preview.markdown.mathBlockPreview,paragraphBeginningSpace:n.vditor.options.preview.markdown.paragraphBeginningSpace,sanitize:n.vditor.options.preview.markdown.sanitize,toc:n.vditor.options.preview.markdown.toc}),n.vditor.preview=new hn(n.vditor),function(e){e.element.innerHTML="",e.element.classList.add("vditor"),e.options.rtl&&e.element.setAttribute("dir","rtl"),W(e),(0,z.Z)(e.options.preview.theme.current,e.options.preview.theme.path),"number"==typeof e.options.height?e.element.style.height=e.options.height+"px":e.element.style.height=e.options.height,"number"==typeof e.options.minHeight&&(e.element.style.minHeight=e.options.minHeight+"px"),"number"==typeof e.options.width?e.element.style.width=e.options.width+"px":e.element.style.width=e.options.width,e.element.appendChild(e.toolbar.element);var t=document.createElement("div");if(t.className="vditor-content","left"===e.options.outline.position&&t.appendChild(e.outline.element),t.appendChild(e.wysiwyg.element.parentElement),t.appendChild(e.sv.element),t.appendChild(e.ir.element.parentElement),t.appendChild(e.preview.element),e.toolbar.elements.devtools&&t.appendChild(e.devtools.element),"right"===e.options.outline.position&&(e.outline.element.classList.add("vditor-outline--right"),t.appendChild(e.outline.element)),e.upload&&t.appendChild(e.upload.element),e.options.resize.enable&&t.appendChild(e.resize.element),t.appendChild(e.hint.element),t.appendChild(e.tip.element),e.element.appendChild(t),t.addEventListener("click",function(){v(e,["subToolbar"])}),e.toolbar.elements.export&&e.element.insertAdjacentHTML("beforeend",'<iframe id="vditorExportIframe" style="width: 100%;height: 0;border: 0"></iframe>'),We(e,e.options.mode,be(e)),document.execCommand("DefaultParagraphSeparator",!1,"p"),navigator.userAgent.indexOf("iPhone")>-1&&void 0!==window.visualViewport){var n=!1,r=function(t){n||(n=!0,requestAnimationFrame(function(){n=!1;var t=e.toolbar.element;t.style.transform="none",t.getBoundingClientRect().top<0&&(t.style.transform="translate(0, ".concat(-t.getBoundingClientRect().top,"px)"))}))};window.visualViewport.addEventListener("scroll",r),window.visualViewport.addEventListener("resize",r)}}(n.vditor),t.after&&t.after(),t.icon&&(0,a.J)("".concat(t.cdn,"/dist/js/icons/").concat(t.icon,".js"),"vditorIconScript")}))},t}(t.default),Er=yr}(),r=r.default}()},e.exports=t()}(cn);var dn=ht(cn.exports),pn=function(e){var t=e.controller,r=ye(),i=ye(null),o=new bt(n.meta.url),u=2e3,a=t.state.value.content,l=a.length>u,s=l?a.substring(0,u):a;return be(function(){r.current=new dn(i.current,{theme:"classic",width:"100%",height:"100%",cache:{enable:!1},preview:{delay:1e3,actions:[]},outline:{enable:!1,position:"left"},toolbarConfig:{hide:!0},value:s,after:function(){if(function(){if(r.current){var e=r.current.vditor;e.preview&&(e.preview.element.style.display="block","sv"===e.currentMode?e.sv.element.style.display="none":e[e.currentMode].element.parentElement.style.display="none",e.preview.render(e),setTimeout(function(){e.outline.render(e)},e.options.preview.delay+10))}}(),e.onInitialization(),l){for(var t=a.substring(u),n=[],i=0;i<t.length;i+=2e3)n.push(t.substring(i,i+2e3));var o=0,c=s,d=function(){if(o<n.length){c+=n[o];var e=r.current.vditor.lute.Md2HTML(c);r.current.renderPreview(e),o++,requestIdleCallback(function(){d()})}else{var t,i;null===(t=r.current)||void 0===t||t.setValue(a),null===(i=r.current)||void 0===i||i.vditor.outline.render(r.current.vditor)}};requestIdleCallback(function(){d()})}},cdn:"".concat(o.dir("./vditor"))})},[]),Et("div",{className:"file-preview-md ".concat(t.state.value.theme),children:[Et("div",{ref:i}),Et(ln,{to:"#custom-controls",children:Et("button",{title:"目录",className:"control-btn",onClick:function(){if(r.current){var e=r.current.vditor;e.options.outline.enable=!e.options.outline.enable,e.outline.toggle(e,e.options.outline.enable)}},children:Et("span",{className:"icon",children:Et(St,{})})})})]})};function fn(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(function(t){var n=e[t],r=w(n);"object"!==r&&"function"!==r||Object.isFrozen(n)||fn(n)}),e}var hn=function(){return v(function e(t){h(this,e),void 0===t.data&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1},[{key:"ignoreMatch",value:function(){this.isMatchIgnored=!0}}])}();function mn(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function vn(e){var t=Object.create(null);for(var n in e)t[n]=e[n];for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return i.forEach(function(e){for(var n in e)t[n]=e[n]}),t}var Dn=function(e){return!!e.scope},gn=function(){return v(function e(t,n){h(this,e),this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)},[{key:"addText",value:function(e){this.buffer+=mn(e)}},{key:"openNode",value:function(e){if(Dn(e)){var t=function(e,t){var n=t.prefix;if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){var r=e.split(".");return["".concat(n).concat(r.shift())].concat(d(r.map(function(e,t){return"".concat(e).concat("_".repeat(t+1))}))).join(" ")}return"".concat(n).concat(e)}(e.scope,{prefix:this.classPrefix});this.span(t)}}},{key:"closeNode",value:function(e){Dn(e)&&(this.buffer+="</span>")}},{key:"value",value:function(){return this.buffer}},{key:"span",value:function(e){this.buffer+='<span class="'.concat(e,'">')}}])}(),bn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={children:[]};return Object.assign(t,e),t},yn=function(e){function t(e){var n;return h(this,t),(n=u(this,t)).options=e,n}return s(t,e),v(t,[{key:"addText",value:function(e){""!==e&&this.add(e)}},{key:"startScope",value:function(e){this.openNode(e)}},{key:"endScope",value:function(){this.closeNode()}},{key:"__addSublanguage",value:function(e,t){var n=e.root;t&&(n.scope="language:".concat(t)),this.add(n)}},{key:"toHTML",value:function(){return new gn(this,this.options).value()}},{key:"finalize",value:function(){return this.closeAllNodes(),!0}}])}(function(){function e(){h(this,e),this.rootNode=bn(),this.stack=[this.rootNode]}return v(e,[{key:"top",get:function(){return this.stack[this.stack.length-1]}},{key:"root",get:function(){return this.rootNode}},{key:"add",value:function(e){this.top.children.push(e)}},{key:"openNode",value:function(e){var t=bn({scope:e});this.add(t),this.stack.push(t)}},{key:"closeNode",value:function(){if(this.stack.length>1)return this.stack.pop()}},{key:"closeAllNodes",value:function(){for(;this.closeNode(););}},{key:"toJSON",value:function(){return JSON.stringify(this.rootNode,null,4)}},{key:"walk",value:function(e){return this.constructor._walk(e,this.rootNode)}}],[{key:"_walk",value:function(e,t){var n=this;return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(function(t){return n._walk(e,t)}),e.closeNode(t)),e}},{key:"_collapse",value:function(t){"string"!=typeof t&&t.children&&(t.children.every(function(e){return"string"==typeof e})?t.children=[t.children.join("")]:t.children.forEach(function(t){e._collapse(t)}))}}])}());function En(e){return e?"string"==typeof e?e:e.source:null}function Cn(e){return _n("(?=",e,")")}function wn(e){return _n("(?:",e,")*")}function An(e){return _n("(?:",e,")?")}function _n(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t.map(function(e){return En(e)}).join("");return r}function Fn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=function(e){var t=e[e.length-1];return"object"===w(t)&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}(t),i="("+(r.capture?"":"?:")+t.map(function(e){return En(e)}).join("|")+")";return i}function kn(e){return new RegExp(e.toString()+"|").exec("").length-1}var Sn=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Tn(e,t){var n=t.joinWith,r=0;return e.map(function(e){for(var t=r+=1,n=En(e),i="";n.length>0;){var o=Sn.exec(n);if(!o){i+=n;break}i+=n.substring(0,o.index),n=n.substring(o.index+o[0].length),"\\"===o[0][0]&&o[1]?i+="\\"+String(Number(o[1])+t):(i+=o[0],"("===o[0]&&r++)}return i}).map(function(e){return"(".concat(e,")")}).join(n)}var xn="[a-zA-Z]\\w*",Ln="[a-zA-Z_]\\w*",Bn="\\b\\d+(\\.\\d+)?",Mn="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Nn="\\b(0b[01]+)",On={begin:"\\\\[\\s\\S]",relevance:0},Hn={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[On]},In={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[On]},Pn=function(e,t){var n=vn({scope:"comment",begin:e,end:t,contains:[]},arguments.length>2&&void 0!==arguments[2]?arguments[2]:{});n.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});var r=Fn("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return n.contains.push({begin:_n(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),n},jn=Pn("//","$"),Rn=Pn("/\\*","\\*/"),Un=Pn("#","$"),qn={scope:"number",begin:Bn,relevance:0},Vn={scope:"number",begin:Mn,relevance:0},zn={scope:"number",begin:Nn,relevance:0},Wn={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[On,{begin:/\[/,end:/\]/,relevance:0,contains:[On]}]},Gn={scope:"title",begin:xn,relevance:0},Kn={scope:"title",begin:Ln,relevance:0},Xn={begin:"\\.\\s*"+Ln,relevance:0},Zn=Object.freeze({__proto__:null,APOS_STRING_MODE:Hn,BACKSLASH_ESCAPE:On,BINARY_NUMBER_MODE:zn,BINARY_NUMBER_RE:Nn,COMMENT:Pn,C_BLOCK_COMMENT_MODE:Rn,C_LINE_COMMENT_MODE:jn,C_NUMBER_MODE:Vn,C_NUMBER_RE:Mn,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":function(e,t){t.data._beginMatch=e[1]},"on:end":function(e,t){t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:Un,IDENT_RE:xn,MATCH_NOTHING_RE:/\b\B/,METHOD_GUARD:Xn,NUMBER_MODE:qn,NUMBER_RE:Bn,PHRASAL_WORDS_MODE:{begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},QUOTE_STRING_MODE:In,REGEXP_MODE:Wn,RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=/^#![ ]*\//;return e.binary&&(e.begin=_n(t,/.*\b/,e.binary,/\b.*/)),vn({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":function(e,t){0!==e.index&&t.ignoreMatch()}},e)},TITLE_MODE:Gn,UNDERSCORE_IDENT_RE:Ln,UNDERSCORE_TITLE_MODE:Kn});function Jn(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}function $n(e,t){void 0!==e.className&&(e.scope=e.className,delete e.className)}function Yn(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=Jn,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function Qn(e,t){Array.isArray(e.illegal)&&(e.illegal=Fn.apply(void 0,d(e.illegal)))}function er(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function tr(e,t){void 0===e.relevance&&(e.relevance=1)}var nr=function(e,t){if(e.beforeMatch){if(e.starts)throw new Error("beforeMatch cannot be used with starts");var n=Object.assign({},e);Object.keys(e).forEach(function(t){delete e[t]}),e.keywords=n.keywords,e.begin=_n(n.beforeMatch,Cn(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch}},rr=["of","and","for","in","not","or","if","then","parent","list","value"];function ir(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"keyword",r=Object.create(null);return"string"==typeof e?i(n,e.split(" ")):Array.isArray(e)?i(n,e):Object.keys(e).forEach(function(n){Object.assign(r,ir(e[n],t,n))}),r;function i(e,n){t&&(n=n.map(function(e){return e.toLowerCase()})),n.forEach(function(t){var n=t.split("|");r[n[0]]=[e,or(n[0],n[1])]})}}function or(e,t){return t?Number(t):function(e){return rr.includes(e.toLowerCase())}(e)?0:1}var ur={},ar=function(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];(t=console).log.apply(t,["WARN: ".concat(e)].concat(r))},lr=function(e,t){ur["".concat(e,"/").concat(t)]||(ur["".concat(e,"/").concat(t)]=!0)},sr=new Error;function cr(e,t,n){for(var r=n.key,i=0,o=e[r],u={},a={},l=1;l<=t.length;l++)a[l+i]=o[l],u[l+i]=!0,i+=kn(t[l-1]);e[r]=a,e[r]._emit=u,e[r]._multi=!0}function dr(e){!function(e){e.scope&&"object"===w(e.scope)&&null!==e.scope&&(e.beginScope=e.scope,delete e.scope)}(e),"string"==typeof e.beginScope&&(e.beginScope={_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope}),function(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw sr;if("object"!==w(e.beginScope)||null===e.beginScope)throw sr;cr(e,e.begin,{key:"beginScope"}),e.begin=Tn(e.begin,{joinWith:""})}}(e),function(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw sr;if("object"!==w(e.endScope)||null===e.endScope)throw sr;cr(e,e.end,{key:"endScope"}),e.end=Tn(e.end,{joinWith:""})}}(e)}function pr(e){function t(t,n){return new RegExp(En(t),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(n?"g":""))}var n=function(){return v(function e(){h(this,e),this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0},[{key:"addRule",value:function(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=kn(e)+1}},{key:"compile",value:function(){0===this.regexes.length&&(this.exec=function(){return null});var e=this.regexes.map(function(e){return e[1]});this.matcherRe=t(Tn(e,{joinWith:"|"}),!0),this.lastIndex=0}},{key:"exec",value:function(e){this.matcherRe.lastIndex=this.lastIndex;var t=this.matcherRe.exec(e);if(!t)return null;var n=t.findIndex(function(e,t){return t>0&&void 0!==e}),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}])}(),r=function(){return v(function e(){h(this,e),this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0},[{key:"getMatcher",value:function(e){if(this.multiRegexes[e])return this.multiRegexes[e];var t=new n;return this.rules.slice(e).forEach(function(e){var n=o(e,2),r=n[0],i=n[1];return t.addRule(r,i)}),t.compile(),this.multiRegexes[e]=t,t}},{key:"resumingScanAtSamePosition",value:function(){return 0!==this.regexIndex}},{key:"considerAll",value:function(){this.regexIndex=0}},{key:"addRule",value:function(e,t){this.rules.push([e,t]),"begin"===t.type&&this.count++}},{key:"exec",value:function(e){var t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;var n=t.exec(e);if(this.resumingScanAtSamePosition())if(n&&n.index===this.lastIndex);else{var r=this.getMatcher(0);r.lastIndex=this.lastIndex+1,n=r.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}])}();if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=vn(e.classNameAliases||{}),function n(i,o){var u,a=i;if(i.isCompiled)return a;[$n,er,dr,nr].forEach(function(e){return e(i,o)}),e.compilerExtensions.forEach(function(e){return e(i,o)}),i.__beforeBegin=null,[Yn,Qn,tr].forEach(function(e){return e(i,o)}),i.isCompiled=!0;var l=null;return"object"===w(i.keywords)&&i.keywords.$pattern&&(i.keywords=Object.assign({},i.keywords),l=i.keywords.$pattern,delete i.keywords.$pattern),l=l||/\w+/,i.keywords&&(i.keywords=ir(i.keywords,e.case_insensitive)),a.keywordPatternRe=t(l,!0),o&&(i.begin||(i.begin=/\B|\b/),a.beginRe=t(a.begin),i.end||i.endsWithParent||(i.end=/\B|\b/),i.end&&(a.endRe=t(a.end)),a.terminatorEnd=En(a.end)||"",i.endsWithParent&&o.terminatorEnd&&(a.terminatorEnd+=(i.end?"|":"")+o.terminatorEnd)),i.illegal&&(a.illegalRe=t(i.illegal)),i.contains||(i.contains=[]),i.contains=(u=[]).concat.apply(u,d(i.contains.map(function(e){return function(e){e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return vn(e,{variants:null},t)}));if(e.cachedVariants)return e.cachedVariants;if(fr(e))return vn(e,{starts:e.starts?vn(e.starts):null});if(Object.isFrozen(e))return vn(e);return e}("self"===e?i:e)}))),i.contains.forEach(function(e){n(e,a)}),i.starts&&n(i.starts,o),a.matcher=function(e){var t=new r;return e.contains.forEach(function(e){return t.addRule(e.begin,{rule:e,type:"begin"})}),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end"}),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t}(a),a}(e)}function fr(e){return!!e&&(e.endsWithParent||fr(e.starts))}var hr=function(e){function t(e,n){var r;return h(this,t),(r=u(this,t,[e])).name="HTMLInjectionError",r.html=n,r}return s(t,e),v(t)}(i(Error)),mr=mn,vr=vn,Dr=Symbol("nomatch"),gr=function(e){var t=Object.create(null),n=Object.create(null),r=[],i=!0,u="Could not find the language '{}', did you forget to load/include a language module?",a={disableAutodetect:!0,name:"Plain text",contains:[]},l={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:yn};function s(e){return l.noHighlightRe.test(e)}function c(e,t,n){var r="",i="";"object"===w(t)?(r=e,n=t.ignoreIllegals,i=t.language):(lr("10.7.0","highlight(lang, code, ...args) has been deprecated."),lr("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),i=e,r=t),void 0===n&&(n=!0);var o={code:r,language:i};b("before:highlight",o);var u=o.result?o.result:d(o.language,o.code,n);return u.code=o.code,b("after:highlight",u),u}function d(e,n,r,a){var s=Object.create(null);function c(e,t){return e.keywords[t]}function f(){if(k.keywords){var e=0;k.keywordPatternRe.lastIndex=0;for(var t=k.keywordPatternRe.exec(x),n="";t;){n+=x.substring(e,t.index);var r=A.case_insensitive?t[0].toLowerCase():t[0],i=c(k,r);if(i){var u=o(i,2),a=u[0],l=u[1];if(T.addText(n),n="",s[r]=(s[r]||0)+1,s[r]<=7&&(L+=l),a.startsWith("_"))n+=t[0];else{var d=A.classNameAliases[a]||a;m(t[0],d)}}else n+=t[0];e=k.keywordPatternRe.lastIndex,t=k.keywordPatternRe.exec(x)}n+=x.substring(e),T.addText(n)}else T.addText(x)}function h(){null!=k.subLanguage?function(){if(""!==x){var e=null;if("string"==typeof k.subLanguage){if(!t[k.subLanguage])return void T.addText(x);e=d(k.subLanguage,x,!0,S[k.subLanguage]),S[k.subLanguage]=e._top}else e=p(x,k.subLanguage.length?k.subLanguage:null);k.relevance>0&&(L+=e.relevance),T.__addSublanguage(e._emitter,e.language)}}():f(),x=""}function m(e,t){""!==e&&(T.startScope(t),T.addText(e),T.endScope())}function D(e,t){for(var n=1,r=t.length-1;n<=r;)if(e._emit[n]){var i=A.classNameAliases[e[n]]||e[n],o=t[n];i?m(o,i):(x=o,f(),x=""),n++}else n++}function g(e,t){return e.scope&&"string"==typeof e.scope&&T.openNode(A.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(m(x,A.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),x=""):e.beginScope._multi&&(D(e.beginScope,t),x="")),k=Object.create(e,{parent:{value:k}})}function b(e,t,n){var r=function(e,t){var n=e&&e.exec(t);return n&&0===n.index}(e.endRe,n);if(r){if(e["on:end"]){var i=new hn(e);e["on:end"](t,i),i.isMatchIgnored&&(r=!1)}if(r){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return b(e.parent,t,n)}function y(e){return 0===k.matcher.regexIndex?(x+=e[0],1):(N=!0,0)}function E(e){var t=e[0],r=n.substring(e.index),i=b(k,e,r);if(!i)return Dr;var o=k;k.endScope&&k.endScope._wrap?(h(),m(t,k.endScope._wrap)):k.endScope&&k.endScope._multi?(h(),D(k.endScope,e)):o.skip?x+=t:(o.returnEnd||o.excludeEnd||(x+=t),h(),o.excludeEnd&&(x=t));do{k.scope&&T.closeNode(),k.skip||k.subLanguage||(L+=k.relevance),k=k.parent}while(k!==i.parent);return i.starts&&g(i.starts,e),o.returnEnd?0:t.length}var C={};function w(t,o){var u=o&&o[0];if(x+=t,null==u)return h(),0;if("begin"===C.type&&"end"===o.type&&C.index===o.index&&""===u){if(x+=n.slice(o.index,o.index+1),!i){var a=new Error("0 width match regex (".concat(e,")"));throw a.languageName=e,a.badRule=C.rule,a}return 1}if(C=o,"begin"===o.type)return function(e){for(var t=e[0],n=e.rule,r=new hn(n),i=0,o=[n.__beforeBegin,n["on:begin"]];i<o.length;i++){var u=o[i];if(u&&(u(e,r),r.isMatchIgnored))return y(t)}return n.skip?x+=t:(n.excludeBegin&&(x+=t),h(),n.returnBegin||n.excludeBegin||(x=t)),g(n,e),n.returnBegin?0:t.length}(o);if("illegal"===o.type&&!r){var l=new Error('Illegal lexeme "'+u+'" for mode "'+(k.scope||"<unnamed>")+'"');throw l.mode=k,l}if("end"===o.type){var s=E(o);if(s!==Dr)return s}if("illegal"===o.type&&""===u)return x+="\n",1;if(M>1e5&&M>3*o.index)throw new Error("potential infinite loop, way more iterations than matches");return x+=u,u.length}var A=v(e);if(!A)throw u.replace("{}",e),new Error('Unknown language: "'+e+'"');var _=pr(A),F="",k=a||_,S={},T=new l.__emitter(l);!function(){for(var e=[],t=k;t!==A;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach(function(e){return T.openNode(e)})}();var x="",L=0,B=0,M=0,N=!1;try{if(A.__emitTokens)A.__emitTokens(n,T);else{for(k.matcher.considerAll();;){M++,N?N=!1:k.matcher.considerAll(),k.matcher.lastIndex=B;var O=k.matcher.exec(n);if(!O)break;var H=w(n.substring(B,O.index),O);B=O.index+H}w(n.substring(B))}return T.finalize(),F=T.toHTML(),{language:e,value:F,relevance:L,illegal:!1,_emitter:T,_top:k}}catch(I){if(I.message&&I.message.includes("Illegal"))return{language:e,value:mr(n),illegal:!0,relevance:0,_illegalBy:{message:I.message,index:B,context:n.slice(B-100,B+100),mode:I.mode,resultSoFar:F},_emitter:T};if(i)return{language:e,value:mr(n),illegal:!1,relevance:0,errorRaised:I,_emitter:T,_top:k};throw I}}function p(e,n){n=n||l.languages||Object.keys(t);var r=function(e){var t={value:mr(e),illegal:!1,relevance:0,_top:a,_emitter:new l.__emitter(l)};return t._emitter.addText(e),t}(e),i=n.filter(v).filter(g).map(function(t){return d(t,e,!1)});i.unshift(r);var u=i.sort(function(e,t){if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(v(e.language).supersetOf===t.language)return 1;if(v(t.language).supersetOf===e.language)return-1}return 0}),s=o(u,2),c=s[0],p=s[1],f=c;return f.secondBest=p,f}function f(e){var t=function(e){var t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";var n=l.languageDetectRe.exec(t);if(n){var r=v(n[1]);return r||(ar(u.replace("{}",n[1])),ar("Falling back to no-highlight mode for this block.",e)),r?n[1]:"no-highlight"}return t.split(/\s+/).find(function(e){return s(e)||v(e)})}(e);if(!s(t)&&(b("before:highlightElement",{el:e,language:t}),!e.dataset.highlighted)){if(e.children.length>0)if(l.ignoreUnescapedHTML,l.throwUnescapedHTML)throw new hr("One of your code blocks includes unescaped HTML.",e.innerHTML);var r=e.textContent,i=t?c(r,{language:t,ignoreIllegals:!0}):p(r);e.innerHTML=i.value,e.dataset.highlighted="yes",function(e,t,r){var i=t&&n[t]||r;e.classList.add("hljs"),e.classList.add("language-".concat(i))}(e,t,i.language),e.result={language:i.language,re:i.relevance,relevance:i.relevance},i.secondBest&&(e.secondBest={language:i.secondBest.language,relevance:i.secondBest.relevance}),b("after:highlightElement",{el:e,result:i,text:r})}}var h=!1;function m(){if("loading"===document.readyState)return h||window.addEventListener("DOMContentLoaded",function(){m()},!1),void(h=!0);document.querySelectorAll(l.cssSelector).forEach(f)}function v(e){return e=(e||"").toLowerCase(),t[e]||t[n[e]]}function D(e,t){var r=t.languageName;"string"==typeof e&&(e=[e]),e.forEach(function(e){n[e.toLowerCase()]=r})}function g(e){var t=v(e);return t&&!t.disableAutodetect}function b(e,t){var n=e;r.forEach(function(e){e[n]&&e[n](t)})}for(var y in Object.assign(e,{highlight:c,highlightAuto:p,highlightAll:m,highlightElement:f,highlightBlock:function(e){return lr("10.7.0","highlightBlock will be removed entirely in v12.0"),lr("10.7.0","Please use highlightElement now."),f(e)},configure:function(e){l=vr(l,e)},initHighlighting:function(){m(),lr("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")},initHighlightingOnLoad:function(){m(),lr("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")},registerLanguage:function(n,r){var o=null;try{o=r(e)}catch(u){if("Language definition for '{}' could not be registered.".replace("{}",n),!i)throw u;o=a}o.name||(o.name=n),t[n]=o,o.rawDefinition=r.bind(null,e),o.aliases&&D(o.aliases,{languageName:n})},unregisterLanguage:function(e){delete t[e];for(var r=0,i=Object.keys(n);r<i.length;r++){var o=i[r];n[o]===e&&delete n[o]}},listLanguages:function(){return Object.keys(t)},getLanguage:v,registerAliases:D,autoDetection:g,inherit:vr,addPlugin:function(e){!function(e){e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=function(t){e["before:highlightBlock"](Object.assign({block:t.el},t))}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=function(t){e["after:highlightBlock"](Object.assign({block:t.el},t))})}(e),r.push(e)},removePlugin:function(e){var t=r.indexOf(e);-1!==t&&r.splice(t,1)}}),e.debugMode=function(){i=!1},e.safeMode=function(){i=!0},e.versionString="11.11.1",e.regex={concat:_n,lookahead:Cn,either:Fn,optional:An,anyNumberOfTimes:wn},Zn)"object"===w(Zn[y])&&fn(Zn[y]);return Object.assign(e,Zn),e},br=gr({});br.newInstance=function(){return gr({})};var yr=br;br.HighlightJS=br,br.default=br;var Er=ht(yr);Er.registerLanguage("xml",function(e){var t=e.regex,n=t.concat(/(?:[A-Z_a-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDDC0-\uDDF3\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD40-\uDD59\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDD4A-\uDD65\uDD6F-\uDD85\uDE80-\uDEA9\uDEB0\uDEB1\uDEC2-\uDEC7\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61\uDF80-\uDF89\uDF8B\uDF8E\uDF90-\uDFB5\uDFB7\uDFD1\uDFD3]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8\uDFC0-\uDFE0]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDB0-\uDDDB\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46\uDC60-\uDFFF]|\uD810[\uDC00-\uDFFA]|\uD811[\uDC00-\uDE46]|\uD818[\uDD00-\uDD1D]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDD40-\uDD6C\uDE40-\uDE7F\uDEA0-\uDEB8\uDEBB-\uDED3\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3\uDFF2\uDFF3]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDDD0-\uDDED\uDDF0\uDEC0-\uDEDE\uDEE0-\uDEE2\uDEE4\uDEE5\uDEE7-\uDEED\uDEF0-\uDEF4\uDEFE\uDEFF\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79])/,t.optional(/(?:[\x2D\.0-9A-Z_a-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDDC0-\uDDF3\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD40-\uDD59\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDD4A-\uDD65\uDD6F-\uDD85\uDE80-\uDEA9\uDEB0\uDEB1\uDEC2-\uDEC7\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61\uDF80-\uDF89\uDF8B\uDF8E\uDF90-\uDFB5\uDFB7\uDFD1\uDFD3]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8\uDFC0-\uDFE0]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDB0-\uDDDB\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46\uDC60-\uDFFF]|\uD810[\uDC00-\uDFFA]|\uD811[\uDC00-\uDE46]|\uD818[\uDD00-\uDD1D]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDD40-\uDD6C\uDE40-\uDE7F\uDEA0-\uDEB8\uDEBB-\uDED3\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3\uDFF2\uDFF3]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDDD0-\uDDED\uDDF0\uDEC0-\uDEDE\uDEE0-\uDEE2\uDEE4\uDEE5\uDEE7-\uDEED\uDEF0-\uDEF4\uDEFE\uDEFF\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79])*:/),/(?:[\x2D\.0-9A-Z_a-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDDC0-\uDDF3\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD40-\uDD59\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDD4A-\uDD65\uDD6F-\uDD85\uDE80-\uDEA9\uDEB0\uDEB1\uDEC2-\uDEC7\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61\uDF80-\uDF89\uDF8B\uDF8E\uDF90-\uDFB5\uDFB7\uDFD1\uDFD3]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8\uDFC0-\uDFE0]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDB0-\uDDDB\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46\uDC60-\uDFFF]|\uD810[\uDC00-\uDFFA]|\uD811[\uDC00-\uDE46]|\uD818[\uDD00-\uDD1D]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDD40-\uDD6C\uDE40-\uDE7F\uDEA0-\uDEB8\uDEBB-\uDED3\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3\uDFF2\uDFF3]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDDD0-\uDDED\uDDF0\uDEC0-\uDEDE\uDEE0-\uDEE2\uDEE4\uDEE5\uDEE7-\uDEED\uDEF0-\uDEF4\uDEFE\uDEFF\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79])*/),r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},i={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=e.inherit(i,{begin:/\(/,end:/\)/}),u=e.inherit(e.APOS_STRING_MODE,{className:"string"}),a=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:/(?:[\x2D\.0-:A-Z_a-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDDC0-\uDDF3\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD40-\uDD59\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDD4A-\uDD65\uDD6F-\uDD85\uDE80-\uDEA9\uDEB0\uDEB1\uDEC2-\uDEC7\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61\uDF80-\uDF89\uDF8B\uDF8E\uDF90-\uDFB5\uDFB7\uDFD1\uDFD3]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8\uDFC0-\uDFE0]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDB0-\uDDDB\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46\uDC60-\uDFFF]|\uD810[\uDC00-\uDFFA]|\uD811[\uDC00-\uDE46]|\uD818[\uDD00-\uDD1D]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDD40-\uDD6C\uDE40-\uDE7F\uDEA0-\uDEB8\uDEBB-\uDED3\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3\uDFF2\uDFF3]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDDD0-\uDDED\uDDF0\uDEC0-\uDEDE\uDEE0-\uDEE2\uDEE4\uDEE5\uDEE7-\uDEED\uDEF0-\uDEF4\uDEFE\uDEFF\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79])+/,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[r]},{begin:/'/,end:/'/,contains:[r]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[i,a,u,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[i,o,a,u]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},r,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[a]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:l}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}),Er.registerLanguage("json",function(e){var t=["true","false","null"],n={scope:"literal",beginKeywords:t.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:t},contains:[{className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},{match:/[{}[\],:]/,className:"punctuation",relevance:0},e.QUOTE_STRING_MODE,n,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}});var Cr=function(e){var t=e.controller,n=ye(null);return be(function(){try{n.current.textContent=t.state.value.content,Er.highlightElement(n.current)}catch(r){}finally{e.onInitialization()}},[]),Et("pre",{className:"file-preview-text ".concat(t.state.value.theme),children:Et("code",{ref:n,className:"language-".concat(t.state.value.fileType)})})},wr=function(e){var t=e.size;return Et("div",{className:"loading-mask",children:Et("div",{className:"loading-spinner",children:Et(Mt,{size:void 0===t?24:t})})})},Ar=function(e){var t=ye(null),n=o(ge({}),2),i=n[0],u=n[1],a=188,l=e.pages.length*a,s=o(ge({start:0,end:0}),2),c=s[0],d=s[1],p=o(ge(8),2),f=p[0],h=p[1],m=function(n){var r=function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"UI";if(!t.current)return{start:0,end:0};var r=t.current,i=r.scrollTop,o=r.clientHeight,u=0;u="UI"===n?Math.max(0,Math.floor(i/a)-1):Math.max(0,e.currentPage-1);var l=Math.ceil(o/a);return{start:u,end:Math.min(e.pages.length,u+l+1)}}(n);h(r.start*a+8),d(r)},v=dt(function(){m()},500),g=function(){if(t.current){var e=t.current.querySelector(".thumbnail-item.active");e&&e.scrollIntoView({behavior:"smooth",block:"start"})}};return be(function(){var e=t.current;if(e)return m(),e.addEventListener("scroll",v),function(){e.removeEventListener("scroll",v)}}),be(function(){var e;(null===(e=t.current)||void 0===e?void 0:e.querySelector(".thumbnail-item.active"))?g():(m("DATA"),setTimeout(function(){g()},0))},[e.currentPage]),Et("div",{className:"thumbnail-panel",children:[Et("div",{className:"thumbnail-panel-header",children:Et("h3",{children:"缩略图"})}),Et("div",{className:"thumbnail-panel-content",ref:t,children:[Et("div",{class:"thumbnail-panel-phantom",style:{height:"".concat(l,"px")}}),Et("div",{className:"thumbnail-item-container",style:{transform:"translate3d(0,".concat(f,"px,0)")},children:e.pages&&e.pages.length>0&&e.pages.map(function(t,n){if(!(c.start<=n&&n<=c.end))return null;var o,a=(o=t.image_url,i[o]||!1);return Et("div",{className:"thumbnail-item ".concat(t.index===e.currentPage?"active":""),onClick:function(t){!function(t){e.onPageClick(t)}(n)},children:[!a&&Et(wr,{}),Et("img",{src:"".concat("").concat(t.image_url),alt:t.description,className:"thumbnail-image",onLoad:function(){!function(e){u(function(t){return r(r({},t),{},D({},e.image_url,!0))})}(t)},onError:function(e){!function(e){u(function(t){return r(r({},t),{},D({},e.image_url,!0))})}(t)}}),Et("div",{className:"thumbnail-page-number",children:n+1})]},t.image_url)})})]})]})},_r=function(e){var t=nt(!0),n=ye(null),r=o(ge({}),2),i=r[0],u=r[1],a=nt(0);be(function(){var n={},r=e.parentDimensions,i=r.width,o=r.height;t.value?n={height:"".concat(o*e.state.value.scale,"px"),flexShrink:0}:(n={transform:"rotate(".concat(e.state.value.rotateMap[e.index]||0,"deg)"),transition:"transform .3s"},e.state.value.mode===ot.WIDTH?Object.assign(n,{width:"".concat((i-24-6)*e.state.value.scale,"px")}):e.state.value.mode===ot.PAGE?Object.assign(n,{height:"".concat(o*e.state.value.scale,"px")}):Object.assign(n,{width:"".concat(800*e.state.value.scale,"px")})),u(n)},[e.parentDimensions,e.state.value,t.value]);var l=function(t){var n;a.value=t,null===(n=e.onHeightChange)||void 0===n||n.call(e,e.index,t)};return be(function(){if(n.current){var e=new ResizeObserver(function(e){var t,n=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=p(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,u=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return u=e.done,e},e:function(e){a=!0,o=e},f:function(){try{u||null==n.return||n.return()}finally{if(a)throw o}}}}(e);try{for(n.s();!(t=n.n()).done;){var r=t.value.contentRect.height;l(r)}}catch(i){n.e(i)}finally{n.f()}});return e.observe(n.current),function(){e.disconnect()}}},[e.index]),Et("div",{ref:n,className:"image-page",style:i,"data-page-index":e.index,children:[Et("img",{className:"image-content",src:"".concat("").concat(e.page.image_url),alt:e.page.description,onLoad:function(){t.value=!1},onError:function(e){t.value=!1},loading:"lazy"}),t.value&&Et(wr,{})]})},Fr=function(e){var t=e.controller,n=t.state,r=ye(null),i=nt(!1),u=o(ge({width:0,height:0}),2),a=u[0],l=u[1],s=ye({width:0,height:0}),c=nt([]),d=nt(0),p=nt(0),f=nt(0),h=nt({startIndex:0,count:1,buffer:1}),m=rt(function(){var e=Math.max(0,h.value.startIndex),t=Math.min(n.value.items.length-1,h.value.startIndex+h.value.count+h.value.buffer);return n.value.items.slice(e,t+1)}),v=function(){var e,t=null===(e=r.current)||void 0===e?void 0:e.getBoundingClientRect();if(t){var n=Math.round(t.width),i=Math.round(t.height);s.current.width===n&&s.current.height===i||(s.current={width:n,height:i},l({width:n,height:i}))}},D=function(){var e=h.value.startIndex;return e?c.value[e].top:0},g=function(){if(r.current){var e=function(e){for(var t=0,r=n.value.items.length-1,i=null;t<=r;){var o=parseInt(String((r+t)/2)),u=c.value[o].bottom;if(u===e)return o+1;u<e?t=o+1:u>e&&((null===i||i>o)&&(i=o),r-=1)}return i}(r.current.scrollTop);return e}},b=dt(function(){if(r.current){var e=g();if(void 0===e)return;h.value.startIndex=e,f.value=D(),e!==n.value.currentPage&&t.updateState({currentPage:e})}},500),y=function(){r.current&&setTimeout(function(){var e=g();e!==n.value.currentPage&&t.updateState({currentPage:e})},0)},E=function(e){i.value=!0,h.value.startIndex=e,f.value=D(),r.current&&(r.current.scrollTop=f.value),setTimeout(function(){i.value=!1},0)},C=function(e){t.updateState({currentPage:e}),E(e)},w=function(e){var t=e.target,r=parseInt(t.value)-1;(r||0===r)&&r>=0&&r<n.value.total&&C(r)},A=function(e){if("DOWN"===e&&n.value.currentPage>0){var t=n.value.currentPage-1;C(t)}if("UP"===e&&n.value.currentPage<n.value.total-1){var r=n.value.currentPage+1;C(r)}};return be(function(){n.value.items.slice(0,2).forEach(function(e){e&&((new Image).src="".concat("").concat(e.image_url))}),e.onInitialization(),function(){var e,t=null===(e=r.current)||void 0===e?void 0:e.getBoundingClientRect();if(t){var i=Math.round(t.height);d.value=i,p.value=i*n.value.items.length}}(),c.value=n.value.items.map(function(e,t){return{index:t,top:t*d.value,bottom:(t+1)*d.value,height:d.value}}),v();var t=new ResizeObserver(function(){requestAnimationFrame(function(){v()})});return r.current&&r&&t.observe(r.current),function(){t.disconnect()}},[]),Et("div",{className:"file-preview-image-group",children:[Et("div",{className:"image-group-left-container ".concat(n.value.showThumbnailPanel?"image-group-left-container--open":""),children:Et(Ar,{pages:n.value.items,currentPage:n.value.currentPage,onPageClick:function(e){C(e)}})}),Et("div",{ref:r,className:"image-group-main-container",onScroll:function(){i.value||b()},children:[Et("div",{class:"image-group-main-phantom",style:{height:"".concat(p.value,"px")}}),Et("div",{className:"image-group-item-container",style:{transform:"translate3d(0,".concat(f.value,"px,0)")},children:m.value&&m.value.length>0&&m.value.map(function(e){return Et(_r,{page:e,index:e.index,state:n,parentDimensions:a,onHeightChange:function(e,t){!function(e,t){if(0!==t){var n=t-c.value[e].height;if(n){c.value[e].height=t,c.value[e].bottom=c.value[e].bottom+n;for(var r=e+1;r<c.value.length;r++)c.value[r].top=c.value[r].top+n,c.value[r].bottom=c.value[r].bottom+n}}}(e,t)}},e.image_url)})})]}),Et(ln,{to:"#custom-controls",children:Et("div",{className:"image-toolbar-container",children:[Et("button",{className:"control-btn",title:"缩略图",onClick:function(){t.switchThumbnailPanel()},children:Et(St,{})}),Et("button",{title:"逆时针",className:"control-btn",onClick:function(){return t.handleRotateChange(-90)},children:Et("span",{className:"icon",children:Et(kt,{})})}),Et("button",{title:"顺时针",className:"control-btn",onClick:function(){return t.handleRotateChange(90)},children:Et("span",{className:"icon",children:Et(Ft,{})})}),Et("button",{className:"control-btn",title:"上一页",onClick:function(){A("DOWN")},children:Et(Tt,{})}),Et("button",{className:"control-btn",title:"下一页",onClick:function(){A("UP")},children:Et(xt,{})}),Et("div",{className:"pagination",children:[Et("input",{type:"number",className:"page-input",value:n.value.currentPage+1,min:"1",max:n.value.total||1,onBlur:function(e){w(e)},onKeyDown:function(e){"Enter"===e.key&&w(e)}}),Et("div",{children:"/"}),Et("div",{children:n.value.total})]}),Et("select",{className:"img-mode",value:n.value.mode,onChange:function(e){var r=e.target.value;t.switchMode(r),E(n.value.currentPage)},children:st.map(function(e,t){return Et("option",{label:e.lable,value:e.value},t)})}),Et("div",{className:"zoom",children:[Et("button",{title:"缩小",className:"control-btn",onClick:function(e){t.zoomOutPreview(e),y()},children:Et("span",{className:"icon",children:Et(wt,{})})}),Et("span",{className:"zoom-level",children:[Math.round(100*n.value.scale),"%"]}),Et("button",{title:"放大",className:"control-btn",onClick:function(e){t.zoomInPreview(e),y()},children:Et("span",{className:"icon",children:Et(At,{})})})]}),Et("button",{title:"重置",className:"control-btn",onClick:function(){t.reSet(),y()},children:Et("span",{className:"icon",children:Et(Bt,{})})})]})})]})},kr=function(e){be(function(){return document.addEventListener("click",o,!0),function(){document.removeEventListener("click",o,!0)}},[]);var t=e.controller,n=t.state,r=nt(!1),i=nt(!1),o=function(){i.value=!1,r.value=!1},u=function(e,n){switch(r.value=!1,e){case it.DOWNORIGINAL:t.downloadOriginal(n);break;case it.COPYTEXTCONTENT:t.copyTextContent(n);break;case it.DOWNPDF:t.exportToPdf(n);break;case it.DOWNMD:t.exportToMd(n)}};return Et("div",{className:"file-preview-shell ".concat(n.value.theme),children:[Et("div",{className:"preview-header",children:[Et("div",{className:"file-info",children:[Et("h3",{className:"file-name",children:n.value.fileName}),Et("div",{className:"engine-container",children:[Et("div",{className:"engine-content",children:[Et("div",{className:"engine-type ".concat(n.value.engineOptions.length>1?"is-multiple":""),children:n.value.engineType}),n.value.engineOptions.length>1&&Et("div",{className:"engine-icon",onClick:function(){n.value.engineOptions&&n.value.engineOptions.length>1&&(i.value=!i.value)},children:Et(Lt,{})})]}),i.value&&n.value.engineOptions.length>1&&Et("ul",{className:"engine-options",children:n.value.engineOptions.map(function(e){return Et("li",{className:"engine-option-item ".concat(e===n.value.engineType?"is-active":""),onClick:function(){var n;n=e,t.switchEngineType(n),i.value=!1},children:e})})})]})]}),Et("div",{className:"preview-controls",children:[Et("div",{className:"custom-controls",id:"custom-controls"}),Et("button",{className:"control-btn download-btn",title:"下载选项",onClick:function(){r.value=!r.value},children:Et("span",{className:"icon",children:Et(_t,{})})})]})]}),r.value&&Et("div",{className:"download-options",children:[""===n.value.fileContent&&Et("button",{className:"download-option",onClick:function(e){u(it.DOWNORIGINAL,e)},children:"下载原文件"}),n.value.engineType!==at.PDF&&Et("button",{className:"download-option",onClick:function(e){u(it.COPYTEXTCONTENT,e)},children:"复制文本内容"})]}),Et("div",{className:"preview-content",children:[Et("div",{className:"preview-inner ".concat(t.state.value.engineType.toLowerCase(),"-engine"),children:n.value.isCreated&&t.preViewComp&&t.preViewController?N(t.preViewComp,{controller:t.preViewController,onInitialization:function(){t.updateState({isLoading:!1})}}):null}),n.value.isLoading&&Et(wr,{size:48})]})]})},Sr=function(){return v(function e(t){h(this,e),D(this,"state",Ue({})),this.filePreviewShell=t,this.initState()},[{key:"updateState",value:function(e){this.state.value=r(r({},this.state.value),e)}},{key:"initState",value:function(){var e=this.filePreviewShell.getState(),t=e.fileType,n=e.theme;this.updateState({content:"",theme:n,fileType:t})}},{key:"initialize",value:(t=C(b().m(function e(){var t;return b().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.getContent();case 1:t=e.v,this.updateState({content:t});case 2:return e.a(2)}},e,this)})),function(){return t.apply(this,arguments)})},{key:"getContent",value:(e=C(b().m(function e(){return b().w(function(e){for(;;)if(0===e.n)return e.a(2,"")},e)})),function(){return e.apply(this,arguments)})}]);var e,t}(),Tr=function(t){function n(){return h(this,n),u(this,n,arguments)}return s(n,t),v(n,[{key:"initState",value:function(){e(n,"initState",this,3)([]),this.updateState({rotate:0,offsetX:0,offsetY:0,scale:1,mode:ot.PAGE,enableTransition:!0})}},{key:"getContent",value:(r=C(b().m(function e(){var t,n,r,i,o,u;return b().w(function(e){for(;;)switch(e.p=e.n){case 0:return t=this.filePreviewShell.getOptions(),n=this.filePreviewShell.getState(),r=n.fileId,i=n.fileCat,o=n.fileType,e.p=1,e.n=2,t.getImgContent(r,o,i);case 2:return u=e.v,e.a(2,u);case 3:return e.p=3,e.v,e.a(2,"")}},e,this,[[1,3]])})),function(){return r.apply(this,arguments)})},{key:"handleRotateChange",value:function(e){var t=this.state.value.rotate;this.updateState({rotate:t+e})}},{key:"handleMouseDown",value:function(e){var t=this,n=this.state.value,r=n.offsetX,i=n.offsetY;e.preventDefault(),this.updateState({enableTransition:!1});var o=e.pageX,u=e.pageY,a=function(e){t.updateState({offsetX:r+e.pageX-o,offsetY:i+e.pageY-u})};document.addEventListener("mousemove",a);document.addEventListener("mouseup",function(){document.removeEventListener("mousemove",a),t.updateState({enableTransition:!0})},{once:!0})}},{key:"zoomOutPreview",value:function(e){var t=this.state.value.scale;this.updateState({scale:Math.max(t-.1,.5)})}},{key:"zoomInPreview",value:function(e){var t=this.state.value.scale;this.updateState({scale:Math.min(t+.1,2)})}},{key:"reSet",value:function(){this.updateState({rotate:0,offsetX:0,offsetY:0,scale:1,mode:ot.PAGE,enableTransition:!0})}},{key:"switchMode",value:function(e){this.updateState({mode:e,scale:1,rotate:0,offsetX:0,offsetY:0,enableTransition:!0})}}]);var r}(Sr),xr=function(t){function n(){return h(this,n),u(this,n,arguments)}return s(n,t),v(n,[{key:"initState",value:function(){e(n,"initState",this,3)([]),this.updateState({items:[],currentPage:0,total:0,showThumbnailPanel:!1,rotateMap:{}})}},{key:"getContent",value:(r=C(b().m(function e(){var t,n,r,i,o,u,a;return b().w(function(e){for(;;)switch(e.p=e.n){case 0:return t=this.filePreviewShell.getOptions(),n=this.filePreviewShell.getState(),r=n.fileId,i=n.fileCat,e.p=1,o=[],e.n=2,t.getContent(r,"pageindex",i);case 2:return(u=e.v)&&u.pages&&u.pages.length>0&&(o=u.pages),a=o.length,this.updateState({items:o,total:a}),e.a(2,u||{});case 3:return e.p=3,e.v,e.a(2,{})}},e,this,[[1,3]])})),function(){return r.apply(this,arguments)})},{key:"switchThumbnailPanel",value:function(){var e=this.state.value.showThumbnailPanel;this.updateState({showThumbnailPanel:!e})}},{key:"handleRotateChange",value:function(e){var t=this.state.value,n=t.currentPage,r=t.rotateMap,i=n.toString();r[i]||(r[i]=0),r[i]+=e,this.updateState({rotateMap:r})}},{key:"reSet",value:function(){e(n,"reSet",this,3)([]),this.updateState({rotateMap:{}})}}]);var r}(Tr);function Lr(e,t){return Array(t+1).join(e)}function Br(e){return e.replace(/^\n*/,"")}function Mr(e){for(var t=e.length;t>0&&"\n"===e[t-1];)t--;return e.substring(0,t)}function Nr(e){return Mr(Br(e))}var Or=["ADDRESS","ARTICLE","ASIDE","AUDIO","BLOCKQUOTE","BODY","CANVAS","CENTER","DD","DIR","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","FRAMESET","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","HTML","ISINDEX","LI","MAIN","MENU","NAV","NOFRAMES","NOSCRIPT","OL","OUTPUT","P","PRE","SECTION","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR","UL"];function Hr(e){return Rr(e,Or)}var Ir=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];function Pr(e){return Rr(e,Ir)}var jr=["A","TABLE","THEAD","TBODY","TFOOT","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"];function Rr(e,t){return t.indexOf(e.nodeName)>=0}function Ur(e,t){return e.getElementsByTagName&&t.some(function(t){return e.getElementsByTagName(t).length})}var qr={};function Vr(e){return e?e.replace(/(\n+\s*)+/g,"\n"):""}function zr(e){for(var t in this.options=e,this._keep=[],this._remove=[],this.blankRule={replacement:e.blankReplacement},this.keepReplacement=e.keepReplacement,this.defaultRule={replacement:e.defaultReplacement},this.array=[],e.rules)this.array.push(e.rules[t])}function Wr(e,t,n){for(var r=0;r<e.length;r++){var i=e[r];if(Gr(i,t,n))return i}}function Gr(e,t,n){var r=e.filter;if("string"==typeof r){if(r===t.nodeName.toLowerCase())return!0}else if(Array.isArray(r)){if(r.indexOf(t.nodeName.toLowerCase())>-1)return!0}else{if("function"!=typeof r)throw new TypeError("`filter` needs to be a string, array, or function");if(r.call(e,t,n))return!0}}function Kr(e){var t=e.nextSibling||e.parentNode;return e.parentNode.removeChild(e),t}function Xr(e,t,n){return e&&e.parentNode===t||n(t)?t.nextSibling||t.parentNode:t.firstChild||t.nextSibling||t.parentNode}qr.paragraph={filter:"p",replacement:function(e){return"\n\n"+e+"\n\n"}},qr.lineBreak={filter:"br",replacement:function(e,t,n){return n.br+"\n"}},qr.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(e,t,n){var r=Number(t.nodeName.charAt(1));return"setext"===n.headingStyle&&r<3?"\n\n"+e+"\n"+Lr(1===r?"=":"-",e.length)+"\n\n":"\n\n"+Lr("#",r)+" "+e+"\n\n"}},qr.blockquote={filter:"blockquote",replacement:function(e){return"\n\n"+(e=Nr(e).replace(/^/gm,"> "))+"\n\n"}},qr.list={filter:["ul","ol"],replacement:function(e,t){var n=t.parentNode;return"LI"===n.nodeName&&n.lastElementChild===t?"\n"+e:"\n\n"+e+"\n\n"}},qr.listItem={filter:"li",replacement:function(e,t,n){var r=n.bulletListMarker+" ",i=t.parentNode;if("OL"===i.nodeName){var o=i.getAttribute("start"),u=Array.prototype.indexOf.call(i.children,t);r=(o?Number(o)+u:u+1)+". "}var a=/\n$/.test(e);return r+(e=(e=Nr(e)+(a?"\n":"")).replace(/\n/gm,"\n"+" ".repeat(r.length)))+(t.nextSibling?"\n":"")}},qr.indentedCodeBlock={filter:function(e,t){return"indented"===t.codeBlockStyle&&"PRE"===e.nodeName&&e.firstChild&&"CODE"===e.firstChild.nodeName},replacement:function(e,t,n){return"\n\n "+t.firstChild.textContent.replace(/\n/g,"\n ")+"\n\n"}},qr.fencedCodeBlock={filter:function(e,t){return"fenced"===t.codeBlockStyle&&"PRE"===e.nodeName&&e.firstChild&&"CODE"===e.firstChild.nodeName},replacement:function(e,t,n){for(var r,i=((t.firstChild.getAttribute("class")||"").match(/language-(\S+)/)||[null,""])[1],o=t.firstChild.textContent,u=n.fence.charAt(0),a=3,l=new RegExp("^"+u+"{3,}","gm");r=l.exec(o);)r[0].length>=a&&(a=r[0].length+1);var s=Lr(u,a);return"\n\n"+s+i+"\n"+o.replace(/\n$/,"")+"\n"+s+"\n\n"}},qr.horizontalRule={filter:"hr",replacement:function(e,t,n){return"\n\n"+n.hr+"\n\n"}},qr.inlineLink={filter:function(e,t){return"inlined"===t.linkStyle&&"A"===e.nodeName&&e.getAttribute("href")},replacement:function(e,t){var n=t.getAttribute("href");n&&(n=n.replace(/([()])/g,"\\$1"));var r=Vr(t.getAttribute("title"));return r&&(r=' "'+r.replace(/"/g,'\\"')+'"'),"["+e+"]("+n+r+")"}},qr.referenceLink={filter:function(e,t){return"referenced"===t.linkStyle&&"A"===e.nodeName&&e.getAttribute("href")},replacement:function(e,t,n){var r,i,o=t.getAttribute("href"),u=Vr(t.getAttribute("title"));switch(u&&(u=' "'+u+'"'),n.linkReferenceStyle){case"collapsed":r="["+e+"][]",i="["+e+"]: "+o+u;break;case"shortcut":r="["+e+"]",i="["+e+"]: "+o+u;break;default:var a=this.references.length+1;r="["+e+"]["+a+"]",i="["+a+"]: "+o+u}return this.references.push(i),r},references:[],append:function(e){var t="";return this.references.length&&(t="\n\n"+this.references.join("\n")+"\n\n",this.references=[]),t}},qr.emphasis={filter:["em","i"],replacement:function(e,t,n){return e.trim()?n.emDelimiter+e+n.emDelimiter:""}},qr.strong={filter:["strong","b"],replacement:function(e,t,n){return e.trim()?n.strongDelimiter+e+n.strongDelimiter:""}},qr.code={filter:function(e){var t=e.previousSibling||e.nextSibling,n="PRE"===e.parentNode.nodeName&&!t;return"CODE"===e.nodeName&&!n},replacement:function(e){if(!e)return"";e=e.replace(/\r?\n|\r/g," ");for(var t=/^`|^ .*?[^ ].* $|`$/.test(e)?" ":"",n="`",r=e.match(/`+/gm)||[];-1!==r.indexOf(n);)n+="`";return n+t+e+t+n}},qr.image={filter:"img",replacement:function(e,t){var n=Vr(t.getAttribute("alt")),r=t.getAttribute("src")||"",i=Vr(t.getAttribute("title"));return r?"!["+n+"]("+r+(i?' "'+i+'"':"")+")":""}},zr.prototype={add:function(e,t){this.array.unshift(t)},keep:function(e){this._keep.unshift({filter:e,replacement:this.keepReplacement})},remove:function(e){this._remove.unshift({filter:e,replacement:function(){return""}})},forNode:function(e){return e.isBlank?this.blankRule:(t=Wr(this.array,e,this.options))||(t=Wr(this._keep,e,this.options))||(t=Wr(this._remove,e,this.options))?t:this.defaultRule;var t},forEach:function(e){for(var t=0;t<this.array.length;t++)e(this.array[t],t)}};var Zr="undefined"!=typeof window?window:{};var Jr,$r,Yr=function(){var e=Zr.DOMParser,t=!1;try{(new e).parseFromString("","text/html")&&(t=!0)}catch(je){}return t}()?Zr.DOMParser:(Jr=function(){},function(){var e=!1;try{document.implementation.createHTMLDocument("").open()}catch(je){Zr.ActiveXObject&&(e=!0)}return e}()?Jr.prototype.parseFromString=function(e){var t=new window.ActiveXObject("htmlfile");return t.designMode="on",t.open(),t.write(e),t.close(),t}:Jr.prototype.parseFromString=function(e){var t=document.implementation.createHTMLDocument("");return t.open(),t.write(e),t.close(),t},Jr);function Qr(e,t){var n;"string"==typeof e?n=($r=$r||new Yr).parseFromString('<x-turndown id="turndown-root">'+e+"</x-turndown>","text/html").getElementById("turndown-root"):n=e.cloneNode(!0);return function(e){var t=e.element,n=e.isBlock,r=e.isVoid,i=e.isPre||function(e){return"PRE"===e.nodeName};if(t.firstChild&&!i(t)){for(var o=null,u=!1,a=null,l=Xr(a,t,i);l!==t;){if(3===l.nodeType||4===l.nodeType){var s=l.data.replace(/[ \r\n\t]+/g," ");if(o&&!/ $/.test(o.data)||u||" "!==s[0]||(s=s.substr(1)),!s){l=Kr(l);continue}l.data=s,o=l}else{if(1!==l.nodeType){l=Kr(l);continue}n(l)||"BR"===l.nodeName?(o&&(o.data=o.data.replace(/ $/,"")),o=null,u=!1):r(l)||i(l)?(o=null,u=!0):o&&(u=!1)}var c=Xr(a,l,i);a=l,l=c}o&&(o.data=o.data.replace(/ $/,""),o.data||Kr(o))}}({element:n,isBlock:Hr,isVoid:Pr,isPre:t.preformattedCode?ei:null}),n}function ei(e){return"PRE"===e.nodeName||"CODE"===e.nodeName}function ti(e,t){return e.isBlock=Hr(e),e.isCode="CODE"===e.nodeName||e.parentNode.isCode,e.isBlank=function(e){return!Pr(e)&&!function(e){return Rr(e,jr)}(e)&&/^\s*$/i.test(e.textContent)&&!function(e){return Ur(e,Ir)}(e)&&!function(e){return Ur(e,jr)}(e)}(e),e.flankingWhitespace=function(e,t){if(e.isBlock||t.preformattedCode&&e.isCode)return{leading:"",trailing:""};var n=function(e){var t=e.match(/^(([ \t\r\n]*)(\s*))(?:(?=\S)[\s\S]*\S)?((\s*?)([ \t\r\n]*))$/);return{leading:t[1],leadingAscii:t[2],leadingNonAscii:t[3],trailing:t[4],trailingNonAscii:t[5],trailingAscii:t[6]}}(e.textContent);n.leadingAscii&&ni("left",e,t)&&(n.leading=n.leadingNonAscii);n.trailingAscii&&ni("right",e,t)&&(n.trailing=n.trailingNonAscii);return{leading:n.leading,trailing:n.trailing}}(e,t),e}function ni(e,t,n){var r,i,o;return"left"===e?(r=t.previousSibling,i=/ $/):(r=t.nextSibling,i=/^ /),r&&(3===r.nodeType?o=i.test(r.nodeValue):n.preformattedCode&&"CODE"===r.nodeName?o=!1:1!==r.nodeType||Hr(r)||(o=i.test(r.textContent))),o}var ri=Array.prototype.reduce,ii=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function oi(e){if(!(this instanceof oi))return new oi(e);var t={rules:qr,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",preformattedCode:!1,blankReplacement:function(e,t){return t.isBlock?"\n\n":""},keepReplacement:function(e,t){return t.isBlock?"\n\n"+t.outerHTML+"\n\n":t.outerHTML},defaultReplacement:function(e,t){return t.isBlock?"\n\n"+e+"\n\n":e}};this.options=function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}({},t,e),this.rules=new zr(this.options)}function ui(e){var t=this;return ri.call(e.childNodes,function(e,n){var r="";return 3===(n=new ti(n,t.options)).nodeType?r=n.isCode?n.nodeValue:t.escape(n.nodeValue):1===n.nodeType&&(r=li.call(t,n)),si(e,r)},"")}function ai(e){var t=this;return this.rules.forEach(function(n){"function"==typeof n.append&&(e=si(e,n.append(t.options)))}),e.replace(/^[\t\r\n]+/,"").replace(/[\t\r\n\s]+$/,"")}function li(e){var t=this.rules.forNode(e),n=ui.call(this,e),r=e.flankingWhitespace;return(r.leading||r.trailing)&&(n=n.trim()),r.leading+t.replacement(n,e,this.options)+r.trailing}function si(e,t){var n=Mr(e),r=Br(t),i=Math.max(e.length-n.length,t.length-r.length);return n+"\n\n".substring(0,i)+r}oi.prototype={turndown:function(e){if(!function(e){return null!=e&&("string"==typeof e||e.nodeType&&(1===e.nodeType||9===e.nodeType||11===e.nodeType))}(e))throw new TypeError(e+" is not a string, or an element/document/fragment node.");if(""===e)return"";var t=ui.call(this,new Qr(e,this.options));return ai.call(this,t)},use:function(e){if(Array.isArray(e))for(var t=0;t<e.length;t++)this.use(e[t]);else{if("function"!=typeof e)throw new TypeError("plugin must be a Function or an Array of Functions");e(this)}return this},addRule:function(e,t){return this.rules.add(e,t),this},keep:function(e){return this.rules.keep(e),this},remove:function(e){return this.rules.remove(e),this},escape:function(e){return ii.reduce(function(e,t){return e.replace(t[0],t[1])},e)}};var ci=function(e){function t(){return h(this,t),u(this,t,arguments)}return s(t,e),v(t,[{key:"getContent",value:(n=C(b().m(function e(){var t,n,r,i,o,u,a,l;return b().w(function(e){for(;;)switch(e.p=e.n){case 0:if(t=this.filePreviewShell.getOptions(),n=this.filePreviewShell.getState(),r=n.fileId,i=n.fileType,o=n.fileCat,u=n.fileContent,e.p=1,!u){e.n=2;break}return e.a(2,u);case 2:return e.n=3,t.getContent(r,i,o);case 3:return a=e.v,e.a(2,a||"");case 4:return e.p=4,l=e.v,e.a(2,l.message||"")}},e,this,[[1,4]])})),function(){return n.apply(this,arguments)})}]);var n}(Sr),di=function(e){function t(){return h(this,t),u(this,t,arguments)}return s(t,e),v(t,[{key:"getContent",value:(n=C(b().m(function e(){var t,n,r,i,o,u,a,l,s,c,d;return b().w(function(e){for(;;)switch(e.p=e.n){case 0:if(t=this.filePreviewShell.getOptions(),n=this.filePreviewShell.getState(),r=n.fileId,i=n.fileCat,o=n.fileContent,e.p=1,!o){e.n=2;break}return e.a(2,o);case 2:return e.n=3,t.getContent(r,"md",i);case 3:return u=e.v,this.state.value.fileType===ut.HTML&&(a=new DOMParser,(l=a.parseFromString(u,"text/html")).body.querySelectorAll("script").forEach(function(e){return e.remove()}),l.body.querySelectorAll("style").forEach(function(e){return e.remove()}),s=l.body.innerHTML,c=new oi({headingStyle:"atx",codeBlockStyle:"fenced"}),u=c.turndown(s)),e.a(2,u||"");case 4:return e.p=4,d=e.v,e.a(2,d.message||"")}},e,this,[[1,4]])})),function(){return n.apply(this,arguments)})}]);var n}(ci),pi=function(e){function t(){return h(this,t),u(this,t,arguments)}return s(t,e),v(t,[{key:"getContent",value:(n=C(b().m(function e(){var t,n,r,i,o,u,a;return b().w(function(e){for(;;)switch(e.p=e.n){case 0:if(t=this.filePreviewShell.getOptions(),n=this.filePreviewShell.getState(),r=n.fileId,i=n.fileCat,o=n.fileContent,e.p=1,!o){e.n=2;break}return e.a(2,o);case 2:return e.n=3,t.getContent(r,"html",i);case 3:return u=e.v,e.a(2,u||"");case 4:return e.p=4,a=e.v,e.a(2,a.message||"")}},e,this,[[1,4]])})),function(){return n.apply(this,arguments)})}]);var n}(ci),fi=function(){return v(function e(){h(this,e)},null,[{key:"registerItem",value:function(e,t,n){this.enginePreviewMap.set(e,{component:t,controller:n})}},{key:"initialize",value:function(){this.registerItem(at.HTML,Ct,function(e){return new pi(e)}),this.registerItem(at.MD,pn,function(e){return new di(e)}),this.registerItem(at.TXT,Cr,function(e){return new ci(e)}),this.registerItem(at.PDF,Fr,function(e){return new xr(e)}),this.registerItem(at.IMG,sn,function(e){return new Tr(e)}),this.registerItem(at.UNKNOWN,pn,function(e){return new di(e)})}},{key:"getItem",value:function(e){return this.enginePreviewMap.get(e)||null}}])}();D(fi,"enginePreviewMap",new Map);var hi=function(){return v(function e(t){h(this,e),D(this,"container",null),D(this,"preViewComp",void 0),D(this,"preViewController",void 0),D(this,"state",Ue({fileName:"",fileId:"",fileCat:"",fileContent:"",theme:"dark",isLoading:!1,isCreated:!1,fileType:ut.UNKNOWN,engineType:at.UNKNOWN,engineOptions:[]})),this.options=t,t.theme&&this.updateState({theme:t.theme}),fi.initialize(),this.getState=this.getState.bind(this)},[{key:"updateState",value:function(e){this.state.value=r(r({},this.state.value),e)}},{key:"parseParams",value:(s=C(b().m(function e(t){var n,r,i,o,u,a,l,s,c;return b().w(function(e){for(;;)switch(e.n){case 0:if(n="",r="",i="",o="",!t.content){e.n=1;break}r=t.name||"",o=t.content,e.n=4;break;case 1:if(!t.url){e.n=3;break}return e.n=2,this.options.upLoadFileToOss(t.url);case 2:(u=e.v)&&(a=u.id,l=u.name,s=u.cat,n=a,r=l,i=s),e.n=4;break;case 3:t.name&&(r=t.name),t.cat&&(i=t.cat),t.id&&(n=t.id);case 4:return c=ct(r),this.updateState({fileId:n,fileName:r,fileCat:i,fileType:c,fileContent:o}),e.n=5,this.parseEngineType();case 5:return e.a(2)}},e,this)})),function(e){return s.apply(this,arguments)})},{key:"parseEngineType",value:(l=C(b().m(function e(){var t,n,r;return b().w(function(e){for(;;)switch(e.n){case 0:t=this.state.value.fileType,(n=lt.get(t))&&n.length>0||(n=[at.UNKNOWN]),r=n[0],this.updateState({engineOptions:n,engineType:r});case 1:return e.a(2)}},e,this)})),function(){return l.apply(this,arguments)})},{key:"parsePreviewItem",value:(a=C(b().m(function e(){var t,n,r;return b().w(function(e){for(;;)switch(e.n){case 0:return t=this.state.value.engineType,(n=fi.getItem(t))||(n=fi.getItem(at.UNKNOWN)),this.preViewComp=n.component,r=n.controller(this),e.n=1,r.initialize();case 1:this.preViewController=r;case 2:return e.a(2)}},e,this)})),function(){return a.apply(this,arguments)})},{key:"mountComponent",value:function(){this.destroyComponent(),this.container=document.querySelector(this.options.selector),this.container&&re(N(kr,{key:JSON.stringify(this.state.value),controller:this}),this.container)}},{key:"destroyComponent",value:function(){if(this.options.selector)for(var e=document.querySelector(this.options.selector);e&&e.firstChild;)e.removeChild(e.firstChild);this.container&&(re(null,this.container),this.container=null)}},{key:"updateView",value:(u=C(b().m(function e(t){return b().w(function(e){for(;;)switch(e.n){case 0:return this.updateState({isCreated:!1,isLoading:!0}),e.n=1,this.parseParams(t);case 1:return e.n=2,this.parsePreviewItem();case 2:this.mountComponent(),this.updateState({isCreated:!0});case 3:return e.a(2)}},e,this)})),function(e){return u.apply(this,arguments)})},{key:"getOptions",value:function(){return this.options}},{key:"getState",value:function(){return this.state.value}},{key:"downloadOriginal",value:(o=C(b().m(function e(t){var n,r,i,o;return b().w(function(e){for(;;)switch(e.n){case 0:if(this.options.downLoadFile){e.n=1;break}return e.a(2);case 1:return n=this.state.value,r=n.fileId,i=n.fileName,o=n.fileCat,e.n=2,this.options.downLoadFile(r,i,o);case 2:if(!this.options.actionSuccessCallBack){e.n=3;break}return e.n=3,this.options.actionSuccessCallBack(it.DOWNORIGINAL);case 3:return e.a(2)}},e,this)})),function(e){return o.apply(this,arguments)})},{key:"copyTextContent",value:(i=C(b().m(function e(t){var n,r,i,o,u,a,l;return b().w(function(e){for(;;)switch(e.n){case 0:if(this.options.getContent){e.n=1;break}return e.a(2);case 1:return e.n=2,ft("");case 2:if(n=this.state.value,r=n.fileId,i=n.engineType,o=n.fileCat,u=n.fileContent,""!==(a=u)){e.n=4;break}return l="HTML"===i?"html":"md",e.n=3,this.options.getContent(r,l,o);case 3:a=e.v;case 4:if(!a){e.n=5;break}return e.n=5,ft(a);case 5:if(!this.options.actionSuccessCallBack){e.n=6;break}return e.n=6,this.options.actionSuccessCallBack(it.COPYTEXTCONTENT);case 6:return e.a(2)}},e,this)})),function(e){return i.apply(this,arguments)})},{key:"exportToPdf",value:(n=C(b().m(function e(t){return b().w(function(e){for(;;)switch(e.n){case 0:if(!this.options.actionSuccessCallBack){e.n=1;break}return e.n=1,this.options.actionSuccessCallBack(it.DOWNPDF);case 1:return e.a(2)}},e,this)})),function(e){return n.apply(this,arguments)})},{key:"exportToMd",value:(t=C(b().m(function e(t){return b().w(function(e){for(;;)switch(e.n){case 0:if(!this.options.actionSuccessCallBack){e.n=1;break}return e.n=1,this.options.actionSuccessCallBack(it.DOWNMD);case 1:return e.a(2)}},e,this)})),function(e){return t.apply(this,arguments)})},{key:"switchEngineType",value:(e=C(b().m(function e(t){return b().w(function(e){for(;;)switch(e.n){case 0:return this.updateState({isCreated:!1,engineType:t}),e.n=1,this.parsePreviewItem();case 1:this.mountComponent(),this.updateState({isCreated:!0});case 2:return e.a(2)}},e,this)})),function(t){return e.apply(this,arguments)})}]);var e,t,n,i,o,u,a,l,s}();t("FilePreviewShellController",hi)}}})}();