xgplayer 3.0.0-codec.110 → 3.0.0-codec.110-0

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 (383) hide show
  1. package/dist/index.min.js +1 -0
  2. package/dist/xgplayer.css +1922 -0
  3. package/dist/xgplayer.live.css +1839 -0
  4. package/dist/xgplayer.live.min.css +1 -0
  5. package/dist/xgplayer.min.css +1 -0
  6. package/dist/xgplayer.mobile.css +1585 -0
  7. package/dist/xgplayer.mobile.min.css +1 -0
  8. package/dist/xgplayer.vod.css +1922 -0
  9. package/dist/xgplayer.vod.min.css +1 -0
  10. package/es/constant.d.ts +4 -0
  11. package/es/constant.js +4 -0
  12. package/es/defaultConfig.d.ts +221 -0
  13. package/es/defaultConfig.js +232 -0
  14. package/es/error.d.ts +114 -0
  15. package/es/error.js +160 -0
  16. package/es/events.d.ts +57 -0
  17. package/es/events.js +65 -0
  18. package/es/index-umd.d.ts +58 -0
  19. package/es/index-umd.js +64 -0
  20. package/es/index.d.ts +17 -0
  21. package/es/index.js +35 -0
  22. package/es/lang/en.d.ts +91 -0
  23. package/es/lang/en.js +76 -0
  24. package/es/lang/i18n.d.ts +36 -0
  25. package/es/lang/i18n.js +222 -0
  26. package/es/lang/index.d.ts +2 -0
  27. package/es/lang/index.js +2 -0
  28. package/es/lang/jp.d.ts +91 -0
  29. package/es/lang/jp.js +76 -0
  30. package/es/lang/zh-cn.d.ts +91 -0
  31. package/es/lang/zh-cn.js +76 -0
  32. package/es/lang/zh-hk.d.ts +91 -0
  33. package/es/lang/zh-hk.js +76 -0
  34. package/es/player.d.ts +747 -0
  35. package/es/player.js +2677 -0
  36. package/es/plugin/basePlugin.d.ts +179 -0
  37. package/es/plugin/basePlugin.js +460 -0
  38. package/es/plugin/hooksDescriptor.d.ts +60 -0
  39. package/es/plugin/hooksDescriptor.js +232 -0
  40. package/es/plugin/index.d.ts +12 -0
  41. package/es/plugin/index.js +10 -0
  42. package/es/plugin/plugin.d.ts +207 -0
  43. package/es/plugin/plugin.js +843 -0
  44. package/es/plugin/pluginsManager.d.ts +162 -0
  45. package/es/plugin/pluginsManager.js +513 -0
  46. package/es/plugin/preset.d.ts +1 -0
  47. package/es/plugin/preset.js +57 -0
  48. package/es/plugin/resizeObserver.d.ts +3 -0
  49. package/es/plugin/resizeObserver.js +146 -0
  50. package/es/plugins/assets/back.svg +5 -0
  51. package/es/plugins/assets/download.svg +14 -0
  52. package/es/plugins/assets/exitCssFull.svg +3 -0
  53. package/es/plugins/assets/exitFull.svg +3 -0
  54. package/es/plugins/assets/loading.svg +3 -0
  55. package/es/plugins/assets/mobile/mPause.svg +17 -0
  56. package/es/plugins/assets/mobile/mPlay.svg +19 -0
  57. package/es/plugins/assets/mobile/mPlayNext.svg +17 -0
  58. package/es/plugins/assets/panel.svg +4 -0
  59. package/es/plugins/assets/pause.svg +3 -0
  60. package/es/plugins/assets/pipIcon.svg +5 -0
  61. package/es/plugins/assets/pipIconExit.svg +8 -0
  62. package/es/plugins/assets/play.svg +3 -0
  63. package/es/plugins/assets/playNext.svg +3 -0
  64. package/es/plugins/assets/replay.svg +3 -0
  65. package/es/plugins/assets/requestCssFull.svg +3 -0
  66. package/es/plugins/assets/requestFull.svg +3 -0
  67. package/es/plugins/assets/rotate.svg +11 -0
  68. package/es/plugins/assets/seekicon.svg +7 -0
  69. package/es/plugins/assets/volumeLarge.svg +4 -0
  70. package/es/plugins/assets/volumeMuted.svg +4 -0
  71. package/es/plugins/assets/volumeSmall.svg +4 -0
  72. package/es/plugins/common/iconPlugin.d.ts +5 -0
  73. package/es/plugins/common/iconPlugin.js +75 -0
  74. package/es/plugins/common/index.css +128 -0
  75. package/es/plugins/common/optionList.d.ts +14 -0
  76. package/es/plugins/common/optionList.js +128 -0
  77. package/es/plugins/common/optionsIcon.css +125 -0
  78. package/es/plugins/common/optionsIcon.d.ts +35 -0
  79. package/es/plugins/common/optionsIcon.js +321 -0
  80. package/es/plugins/common/thumbnail.css +2 -0
  81. package/es/plugins/common/thumbnail.d.ts +61 -0
  82. package/es/plugins/common/thumbnail.js +275 -0
  83. package/es/plugins/controls/index.css +151 -0
  84. package/es/plugins/controls/index.d.ts +73 -0
  85. package/es/plugins/controls/index.js +310 -0
  86. package/es/plugins/cssFullScreen/index.css +11 -0
  87. package/es/plugins/cssFullScreen/index.d.ts +40 -0
  88. package/es/plugins/cssFullScreen/index.js +181 -0
  89. package/es/plugins/danmu/danmuIcon.d.ts +24 -0
  90. package/es/plugins/danmu/danmuIcon.js +122 -0
  91. package/es/plugins/danmu/danmuPanel.d.ts +39 -0
  92. package/es/plugins/danmu/danmuPanel.js +127 -0
  93. package/es/plugins/danmu/index.css +553 -0
  94. package/es/plugins/danmu/index.d.ts +95 -0
  95. package/es/plugins/danmu/index.js +426 -0
  96. package/es/plugins/definition/index.css +3 -0
  97. package/es/plugins/definition/index.d.ts +55 -0
  98. package/es/plugins/definition/index.js +271 -0
  99. package/es/plugins/download/index.css +10 -0
  100. package/es/plugins/download/index.d.ts +31 -0
  101. package/es/plugins/download/index.js +156 -0
  102. package/es/plugins/dynamicBg/index.css +15 -0
  103. package/es/plugins/dynamicBg/index.d.ts +78 -0
  104. package/es/plugins/dynamicBg/index.js +472 -0
  105. package/es/plugins/enter/index.css +130 -0
  106. package/es/plugins/enter/index.d.ts +19 -0
  107. package/es/plugins/enter/index.js +86 -0
  108. package/es/plugins/error/index.css +32 -0
  109. package/es/plugins/error/index.d.ts +9 -0
  110. package/es/plugins/error/index.js +113 -0
  111. package/es/plugins/fullscreen/backicon.d.ts +17 -0
  112. package/es/plugins/fullscreen/backicon.js +102 -0
  113. package/es/plugins/fullscreen/index.css +21 -0
  114. package/es/plugins/fullscreen/index.d.ts +73 -0
  115. package/es/plugins/fullscreen/index.js +369 -0
  116. package/es/plugins/gapJump/index.d.ts +21 -0
  117. package/es/plugins/gapJump/index.js +202 -0
  118. package/es/plugins/keyboard/index.d.ts +69 -0
  119. package/es/plugins/keyboard/index.js +426 -0
  120. package/es/plugins/loading/index.css +82 -0
  121. package/es/plugins/loading/index.d.ts +11 -0
  122. package/es/plugins/loading/index.js +71 -0
  123. package/es/plugins/logger/index.d.ts +51 -0
  124. package/es/plugins/logger/index.js +402 -0
  125. package/es/plugins/miniScreen/index.css +164 -0
  126. package/es/plugins/miniScreen/index.d.ts +68 -0
  127. package/es/plugins/miniScreen/index.js +298 -0
  128. package/es/plugins/miniScreen/miniScreenIcon.d.ts +11 -0
  129. package/es/plugins/miniScreen/miniScreenIcon.js +82 -0
  130. package/es/plugins/mobile/index.css +134 -0
  131. package/es/plugins/mobile/index.d.ts +127 -0
  132. package/es/plugins/mobile/index.js +902 -0
  133. package/es/plugins/mobile/touch.d.ts +43 -0
  134. package/es/plugins/mobile/touch.js +276 -0
  135. package/es/plugins/netAdaption/index.d.ts +5 -0
  136. package/es/plugins/netAdaption/index.js +76 -0
  137. package/es/plugins/pc/index.css +2 -0
  138. package/es/plugins/pc/index.d.ts +14 -0
  139. package/es/plugins/pc/index.js +269 -0
  140. package/es/plugins/pip/index.css +11 -0
  141. package/es/plugins/pip/index.d.ts +37 -0
  142. package/es/plugins/pip/index.js +306 -0
  143. package/es/plugins/play/index.css +11 -0
  144. package/es/plugins/play/index.d.ts +23 -0
  145. package/es/plugins/play/index.js +157 -0
  146. package/es/plugins/playNext/index.css +16 -0
  147. package/es/plugins/playNext/index.d.ts +19 -0
  148. package/es/plugins/playNext/index.js +139 -0
  149. package/es/plugins/playbackRate/index.css +3 -0
  150. package/es/plugins/playbackRate/index.d.ts +31 -0
  151. package/es/plugins/playbackRate/index.js +180 -0
  152. package/es/plugins/poster/index.css +33 -0
  153. package/es/plugins/poster/index.d.ts +27 -0
  154. package/es/plugins/poster/index.js +155 -0
  155. package/es/plugins/progress/index.css +213 -0
  156. package/es/plugins/progress/index.d.ts +165 -0
  157. package/es/plugins/progress/index.js +899 -0
  158. package/es/plugins/progress/innerList.d.ts +37 -0
  159. package/es/plugins/progress/innerList.js +232 -0
  160. package/es/plugins/progress/miniProgress.d.ts +9 -0
  161. package/es/plugins/progress/miniProgress.js +84 -0
  162. package/es/plugins/progressPreview/dotsApi.d.ts +1 -0
  163. package/es/plugins/progressPreview/dotsApi.js +282 -0
  164. package/es/plugins/progressPreview/index.css +153 -0
  165. package/es/plugins/progressPreview/index.d.ts +79 -0
  166. package/es/plugins/progressPreview/index.js +608 -0
  167. package/es/plugins/prompt/index.css +47 -0
  168. package/es/plugins/prompt/index.d.ts +24 -0
  169. package/es/plugins/prompt/index.js +148 -0
  170. package/es/plugins/replay/index.css +39 -0
  171. package/es/plugins/replay/index.d.ts +16 -0
  172. package/es/plugins/replay/index.js +143 -0
  173. package/es/plugins/rotate/index.css +0 -0
  174. package/es/plugins/rotate/index.d.ts +21 -0
  175. package/es/plugins/rotate/index.js +199 -0
  176. package/es/plugins/screenShot/index.css +2 -0
  177. package/es/plugins/screenShot/index.d.ts +30 -0
  178. package/es/plugins/screenShot/index.js +186 -0
  179. package/es/plugins/start/index.css +94 -0
  180. package/es/plugins/start/index.d.ts +38 -0
  181. package/es/plugins/start/index.js +316 -0
  182. package/es/plugins/stats/index.d.ts +38 -0
  183. package/es/plugins/stats/index.js +247 -0
  184. package/es/plugins/testspeed/index.d.ts +22 -0
  185. package/es/plugins/testspeed/index.js +228 -0
  186. package/es/plugins/time/index.css +24 -0
  187. package/es/plugins/time/index.d.ts +26 -0
  188. package/es/plugins/time/index.js +252 -0
  189. package/es/plugins/track/index.css +22 -0
  190. package/es/plugins/track/index.d.ts +108 -0
  191. package/es/plugins/track/index.js +579 -0
  192. package/es/plugins/volume/index.css +92 -0
  193. package/es/plugins/volume/index.d.ts +88 -0
  194. package/es/plugins/volume/index.js +454 -0
  195. package/es/plugins/waitingTimeoutJump/index.d.ts +15 -0
  196. package/es/plugins/waitingTimeoutJump/index.js +141 -0
  197. package/es/presets/default-en.d.ts +33 -0
  198. package/es/presets/default-en.js +88 -0
  199. package/es/presets/default.css +1922 -0
  200. package/es/presets/default.d.ts +33 -0
  201. package/es/presets/default.js +95 -0
  202. package/es/presets/live.css +1839 -0
  203. package/es/presets/live.d.ts +94 -0
  204. package/es/presets/live.js +52 -0
  205. package/es/presets/mobile.css +1585 -0
  206. package/es/presets/mobile.d.ts +103 -0
  207. package/es/presets/mobile.js +41 -0
  208. package/es/proxy.d.ts +327 -0
  209. package/es/proxy.js +1061 -0
  210. package/es/stateClassMap.d.ts +30 -0
  211. package/es/stateClassMap.js +30 -0
  212. package/es/style/common/animation.css +27 -0
  213. package/es/style/common/svg-url.css +0 -0
  214. package/es/style/common.css +276 -0
  215. package/es/style/index.css +405 -0
  216. package/es/style/variable.css +0 -0
  217. package/es/utils/database.d.ts +31 -0
  218. package/es/utils/database.js +147 -0
  219. package/es/utils/debug.d.ts +10 -0
  220. package/es/utils/debug.js +53 -0
  221. package/es/utils/draggabilly.d.ts +54 -0
  222. package/es/utils/draggabilly.js +547 -0
  223. package/es/utils/sniffer.d.ts +28 -0
  224. package/es/utils/sniffer.js +213 -0
  225. package/es/utils/url.d.ts +1 -0
  226. package/es/utils/url.js +10 -0
  227. package/es/utils/util.d.ts +270 -0
  228. package/es/utils/util.js +1137 -0
  229. package/es/utils/xgplayerTimeRange.d.ts +7 -0
  230. package/es/utils/xgplayerTimeRange.js +34 -0
  231. package/es/version.d.ts +5 -0
  232. package/es/version.js +5 -0
  233. package/es/xgplayer.d.ts +16 -0
  234. package/es/xgplayer.js +34 -0
  235. package/lib/constant.js +14 -0
  236. package/lib/defaultConfig.js +239 -0
  237. package/lib/error.js +172 -0
  238. package/lib/events.js +124 -0
  239. package/lib/index-umd.js +87 -0
  240. package/lib/index.js +90 -0
  241. package/lib/lang/en.js +83 -0
  242. package/lib/lang/i18n.js +233 -0
  243. package/lib/lang/index.js +13 -0
  244. package/lib/lang/jp.js +83 -0
  245. package/lib/lang/zh-cn.js +83 -0
  246. package/lib/lang/zh-hk.js +83 -0
  247. package/lib/player.js +2787 -0
  248. package/lib/plugin/basePlugin.js +507 -0
  249. package/lib/plugin/hooksDescriptor.js +244 -0
  250. package/lib/plugin/index.js +94 -0
  251. package/lib/plugin/plugin.js +861 -0
  252. package/lib/plugin/pluginsManager.js +524 -0
  253. package/lib/plugin/preset.js +66 -0
  254. package/lib/plugin/resizeObserver.js +154 -0
  255. package/lib/plugins/assets/back.svg +5 -0
  256. package/lib/plugins/assets/download.svg +14 -0
  257. package/lib/plugins/assets/exitCssFull.svg +3 -0
  258. package/lib/plugins/assets/exitFull.svg +3 -0
  259. package/lib/plugins/assets/loading.svg +3 -0
  260. package/lib/plugins/assets/mobile/mPause.svg +17 -0
  261. package/lib/plugins/assets/mobile/mPlay.svg +19 -0
  262. package/lib/plugins/assets/mobile/mPlayNext.svg +17 -0
  263. package/lib/plugins/assets/panel.svg +4 -0
  264. package/lib/plugins/assets/pause.svg +3 -0
  265. package/lib/plugins/assets/pipIcon.svg +5 -0
  266. package/lib/plugins/assets/pipIconExit.svg +8 -0
  267. package/lib/plugins/assets/play.svg +3 -0
  268. package/lib/plugins/assets/playNext.svg +3 -0
  269. package/lib/plugins/assets/replay.svg +3 -0
  270. package/lib/plugins/assets/requestCssFull.svg +3 -0
  271. package/lib/plugins/assets/requestFull.svg +3 -0
  272. package/lib/plugins/assets/rotate.svg +11 -0
  273. package/lib/plugins/assets/seekicon.svg +7 -0
  274. package/lib/plugins/assets/volumeLarge.svg +4 -0
  275. package/lib/plugins/assets/volumeMuted.svg +4 -0
  276. package/lib/plugins/assets/volumeSmall.svg +4 -0
  277. package/lib/plugins/common/iconPlugin.js +84 -0
  278. package/lib/plugins/common/index.css +128 -0
  279. package/lib/plugins/common/optionList.js +145 -0
  280. package/lib/plugins/common/optionsIcon.css +125 -0
  281. package/lib/plugins/common/optionsIcon.js +336 -0
  282. package/lib/plugins/common/thumbnail.css +2 -0
  283. package/lib/plugins/common/thumbnail.js +287 -0
  284. package/lib/plugins/controls/index.css +151 -0
  285. package/lib/plugins/controls/index.js +323 -0
  286. package/lib/plugins/cssFullScreen/index.css +11 -0
  287. package/lib/plugins/cssFullScreen/index.js +192 -0
  288. package/lib/plugins/danmu/danmuIcon.js +135 -0
  289. package/lib/plugins/danmu/danmuPanel.js +140 -0
  290. package/lib/plugins/danmu/index.css +553 -0
  291. package/lib/plugins/danmu/index.js +456 -0
  292. package/lib/plugins/definition/index.css +3 -0
  293. package/lib/plugins/definition/index.js +281 -0
  294. package/lib/plugins/download/index.css +10 -0
  295. package/lib/plugins/download/index.js +168 -0
  296. package/lib/plugins/dynamicBg/index.css +15 -0
  297. package/lib/plugins/dynamicBg/index.js +489 -0
  298. package/lib/plugins/enter/index.css +130 -0
  299. package/lib/plugins/enter/index.js +99 -0
  300. package/lib/plugins/error/index.css +32 -0
  301. package/lib/plugins/error/index.js +124 -0
  302. package/lib/plugins/fullscreen/backicon.js +114 -0
  303. package/lib/plugins/fullscreen/index.css +21 -0
  304. package/lib/plugins/fullscreen/index.js +381 -0
  305. package/lib/plugins/gapJump/index.js +213 -0
  306. package/lib/plugins/keyboard/index.js +434 -0
  307. package/lib/plugins/loading/index.css +82 -0
  308. package/lib/plugins/loading/index.js +84 -0
  309. package/lib/plugins/logger/index.js +428 -0
  310. package/lib/plugins/miniScreen/index.css +164 -0
  311. package/lib/plugins/miniScreen/index.js +323 -0
  312. package/lib/plugins/miniScreen/miniScreenIcon.js +94 -0
  313. package/lib/plugins/mobile/index.css +134 -0
  314. package/lib/plugins/mobile/index.js +919 -0
  315. package/lib/plugins/mobile/touch.js +284 -0
  316. package/lib/plugins/netAdaption/index.js +84 -0
  317. package/lib/plugins/pc/index.css +2 -0
  318. package/lib/plugins/pc/index.js +278 -0
  319. package/lib/plugins/pip/index.css +11 -0
  320. package/lib/plugins/pip/index.js +320 -0
  321. package/lib/plugins/play/index.css +11 -0
  322. package/lib/plugins/play/index.js +169 -0
  323. package/lib/plugins/playNext/index.css +16 -0
  324. package/lib/plugins/playNext/index.js +148 -0
  325. package/lib/plugins/playbackRate/index.css +3 -0
  326. package/lib/plugins/playbackRate/index.js +190 -0
  327. package/lib/plugins/poster/index.css +33 -0
  328. package/lib/plugins/poster/index.js +168 -0
  329. package/lib/plugins/progress/index.css +213 -0
  330. package/lib/plugins/progress/index.js +922 -0
  331. package/lib/plugins/progress/innerList.js +241 -0
  332. package/lib/plugins/progress/miniProgress.js +94 -0
  333. package/lib/plugins/progressPreview/dotsApi.js +293 -0
  334. package/lib/plugins/progressPreview/index.css +153 -0
  335. package/lib/plugins/progressPreview/index.js +634 -0
  336. package/lib/plugins/prompt/index.css +47 -0
  337. package/lib/plugins/prompt/index.js +163 -0
  338. package/lib/plugins/replay/index.css +39 -0
  339. package/lib/plugins/replay/index.js +158 -0
  340. package/lib/plugins/rotate/index.css +0 -0
  341. package/lib/plugins/rotate/index.js +211 -0
  342. package/lib/plugins/screenShot/index.css +2 -0
  343. package/lib/plugins/screenShot/index.js +196 -0
  344. package/lib/plugins/start/index.css +94 -0
  345. package/lib/plugins/start/index.js +332 -0
  346. package/lib/plugins/stats/index.js +255 -0
  347. package/lib/plugins/testspeed/index.js +239 -0
  348. package/lib/plugins/time/index.css +24 -0
  349. package/lib/plugins/time/index.js +273 -0
  350. package/lib/plugins/track/index.css +22 -0
  351. package/lib/plugins/track/index.js +591 -0
  352. package/lib/plugins/volume/index.css +92 -0
  353. package/lib/plugins/volume/index.js +477 -0
  354. package/lib/plugins/waitingTimeoutJump/index.js +152 -0
  355. package/lib/presets/default-en.js +129 -0
  356. package/lib/presets/default.css +1922 -0
  357. package/lib/presets/default.js +139 -0
  358. package/lib/presets/live.css +1839 -0
  359. package/lib/presets/live.js +77 -0
  360. package/lib/presets/mobile.css +1585 -0
  361. package/lib/presets/mobile.js +73 -0
  362. package/lib/proxy.js +1079 -0
  363. package/lib/stateClassMap.js +37 -0
  364. package/lib/style/common/animation.css +27 -0
  365. package/lib/style/common/svg-url.css +0 -0
  366. package/lib/style/common.css +276 -0
  367. package/lib/style/index.css +405 -0
  368. package/lib/style/variable.css +0 -0
  369. package/lib/utils/database.js +155 -0
  370. package/lib/utils/debug.js +59 -0
  371. package/lib/utils/draggabilly.js +556 -0
  372. package/lib/utils/sniffer.js +221 -0
  373. package/lib/utils/url.js +19 -0
  374. package/lib/utils/util.js +1153 -0
  375. package/lib/utils/xgplayerTimeRange.js +41 -0
  376. package/lib/version.js +13 -0
  377. package/lib/xgplayer.js +90 -0
  378. package/package.json +6 -1
  379. package/.eslintrc.js +0 -32
  380. package/CHANGELOG.md +0 -273
  381. package/bin/eject.js +0 -44
  382. package/tsconfig.umd.json +0 -19
  383. package/types/index.d.ts +0 -2966
@@ -0,0 +1 @@
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Player=t()}(this,(function(){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=function(e){return e&&e.Math==Math&&e},n=t("object"==typeof globalThis&&globalThis)||t("object"==typeof window&&window)||t("object"==typeof self&&self)||t("object"==typeof e&&e)||function(){return this}()||Function("return this")(),i={},r=function(e){try{return!!e()}catch(e){return!0}},o=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),s={},a={}.propertyIsEnumerable,c=Object.getOwnPropertyDescriptor,u=c&&!a.call({1:2},1);s.f=u?function(e){var t=c(this,e);return!!t&&t.enumerable}:a;var l=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},f={}.toString,h=function(e){return f.call(e).slice(8,-1)},d=h,p="".split,g=r((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==d(e)?p.call(e,""):Object(e)}:Object,v=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},y=g,m=v,k=function(e){return y(m(e))},b=function(e){return"object"==typeof e?null!==e:"function"==typeof e},w=b,C=function(e,t){if(!w(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!w(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!w(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!w(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")},x=v,_=function(e){return Object(x(e))},S=_,T={}.hasOwnProperty,E=Object.hasOwn||function(e,t){return T.call(S(e),t)},P=b,R=n.document,O=P(R)&&P(R.createElement),A=function(e){return O?R.createElement(e):{}},L=A,I=!o&&!r((function(){return 7!=Object.defineProperty(L("div"),"a",{get:function(){return 7}}).a})),D=o,M=s,N=l,F=k,B=C,j=E,U=I,H=Object.getOwnPropertyDescriptor;i.f=D?H:function(e,t){if(e=F(e),t=B(t,!0),U)try{return H(e,t)}catch(e){}if(j(e,t))return N(!M.f.call(e,t),e[t])};var G={},V=b,W=function(e){if(!V(e))throw TypeError(String(e)+" is not an object");return e},K=o,z=I,Y=W,X=C,q=Object.defineProperty;G.f=K?q:function(e,t,n){if(Y(e),t=X(t,!0),Y(n),z)try{return q(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var $=G,Z=l,J=o?function(e,t,n){return $.f(e,t,Z(1,n))}:function(e,t,n){return e[t]=n,e},Q={exports:{}},ee=n,te=J,ne=function(e,t){try{te(ee,e,t)}catch(n){ee[e]=t}return t},ie=ne,re="__core-js_shared__",oe=n[re]||ie(re,{}),se=oe,ae=Function.toString;"function"!=typeof se.inspectSource&&(se.inspectSource=function(e){return ae.call(e)});var ce=se.inspectSource,ue=ce,le=n.WeakMap,fe="function"==typeof le&&/native code/.test(ue(le)),he={exports:{}},de=oe;(he.exports=function(e,t){return de[e]||(de[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.15.2",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"});var pe,ge,ve,ye=0,me=Math.random(),ke=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++ye+me).toString(36)},be=he.exports,we=ke,Ce=be("keys"),xe=function(e){return Ce[e]||(Ce[e]=we(e))},_e={},Se=fe,Te=b,Ee=J,Pe=E,Re=oe,Oe=xe,Ae=_e,Le="Object already initialized",Ie=n.WeakMap;if(Se||Re.state){var De=Re.state||(Re.state=new Ie),Me=De.get,Ne=De.has,Fe=De.set;pe=function(e,t){if(Ne.call(De,e))throw new TypeError(Le);return t.facade=e,Fe.call(De,e,t),t},ge=function(e){return Me.call(De,e)||{}},ve=function(e){return Ne.call(De,e)}}else{var Be=Oe("state");Ae[Be]=!0,pe=function(e,t){if(Pe(e,Be))throw new TypeError(Le);return t.facade=e,Ee(e,Be,t),t},ge=function(e){return Pe(e,Be)?e[Be]:{}},ve=function(e){return Pe(e,Be)}}var je={set:pe,get:ge,has:ve,enforce:function(e){return ve(e)?ge(e):pe(e,{})},getterFor:function(e){return function(t){var n;if(!Te(t)||(n=ge(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}},Ue=n,He=J,Ge=E,Ve=ne,We=ce,Ke=je.get,ze=je.enforce,Ye=String(String).split("String");(Q.exports=function(e,t,n,i){var r,o=!!i&&!!i.unsafe,s=!!i&&!!i.enumerable,a=!!i&&!!i.noTargetGet;"function"==typeof n&&("string"!=typeof t||Ge(n,"name")||He(n,"name",t),(r=ze(n)).source||(r.source=Ye.join("string"==typeof t?t:""))),e!==Ue?(o?!a&&e[t]&&(s=!0):delete e[t],s?e[t]=n:He(e,t,n)):s?e[t]=n:Ve(t,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&Ke(this).source||We(this)}));var Xe=n,qe=Xe,$e=n,Ze=function(e){return"function"==typeof e?e:void 0},Je=function(e,t){return arguments.length<2?Ze(qe[e])||Ze($e[e]):qe[e]&&qe[e][t]||$e[e]&&$e[e][t]},Qe={},et=Math.ceil,tt=Math.floor,nt=function(e){return isNaN(e=+e)?0:(e>0?tt:et)(e)},it=nt,rt=Math.min,ot=function(e){return e>0?rt(it(e),9007199254740991):0},st=nt,at=Math.max,ct=Math.min,ut=function(e,t){var n=st(e);return n<0?at(n+t,0):ct(n,t)},lt=k,ft=ot,ht=ut,dt=function(e){return function(t,n,i){var r,o=lt(t),s=ft(o.length),a=ht(i,s);if(e&&n!=n){for(;s>a;)if((r=o[a++])!=r)return!0}else for(;s>a;a++)if((e||a in o)&&o[a]===n)return e||a||0;return!e&&-1}},pt={includes:dt(!0),indexOf:dt(!1)},gt=E,vt=k,yt=pt.indexOf,mt=_e,kt=function(e,t){var n,i=vt(e),r=0,o=[];for(n in i)!gt(mt,n)&&gt(i,n)&&o.push(n);for(;t.length>r;)gt(i,n=t[r++])&&(~yt(o,n)||o.push(n));return o},bt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],wt=kt,Ct=bt.concat("length","prototype");Qe.f=Object.getOwnPropertyNames||function(e){return wt(e,Ct)};var xt={};xt.f=Object.getOwnPropertySymbols;var _t,St=Qe,Tt=xt,Et=W,Pt=Je("Reflect","ownKeys")||function(e){var t=St.f(Et(e)),n=Tt.f;return n?t.concat(n(e)):t},Rt=E,Ot=Pt,At=i,Lt=G,It=r,Dt=/#|\.prototype\./,Mt=function(e,t){var n=Ft[Nt(e)];return n==jt||n!=Bt&&("function"==typeof t?It(t):!!t)},Nt=Mt.normalize=function(e){return String(e).replace(Dt,".").toLowerCase()},Ft=Mt.data={},Bt=Mt.NATIVE="N",jt=Mt.POLYFILL="P",Ut=Mt,Ht=n,Gt=i.f,Vt=J,Wt=Q.exports,Kt=ne,zt=function(e,t){for(var n=Ot(t),i=Lt.f,r=At.f,o=0;o<n.length;o++){var s=n[o];Rt(e,s)||i(e,s,r(t,s))}},Yt=Ut,Xt=function(e,t){var n,i,r,o,s,a=e.target,c=e.global,u=e.stat;if(n=c?Ht:u?Ht[a]||Kt(a,{}):(Ht[a]||{}).prototype)for(i in t){if(o=t[i],r=e.noTargetGet?(s=Gt(n,i))&&s.value:n[i],!Yt(c?i:a+(u?".":"#")+i,e.forced)&&void 0!==r){if(typeof o==typeof r)continue;zt(o,r)}(e.sham||r&&r.sham)&&Vt(o,"sham",!0),Wt(n,i,o,e)}},qt=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e},$t=kt,Zt=bt,Jt=Object.keys||function(e){return $t(e,Zt)},Qt=G,en=W,tn=Jt,nn=o?Object.defineProperties:function(e,t){en(e);for(var n,i=tn(t),r=i.length,o=0;r>o;)Qt.f(e,n=i[o++],t[n]);return e},rn=Je("document","documentElement"),on=W,sn=nn,an=bt,cn=_e,un=rn,ln=A,fn=xe("IE_PROTO"),hn=function(){},dn=function(e){return"<script>"+e+"</"+"script>"},pn=function(){try{_t=document.domain&&new ActiveXObject("htmlfile")}catch(e){}var e,t;pn=_t?function(e){e.write(dn("")),e.close();var t=e.parentWindow.Object;return e=null,t}(_t):((t=ln("iframe")).style.display="none",un.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(dn("document.F=Object")),e.close(),e.F);for(var n=an.length;n--;)delete pn.prototype[an[n]];return pn()};cn[fn]=!0;var gn=Object.create||function(e,t){var n;return null!==e?(hn.prototype=on(e),n=new hn,hn.prototype=null,n[fn]=e):n=pn(),void 0===t?n:sn(n,t)},vn=qt,yn=b,mn=[].slice,kn={},bn=function(e,t,n){if(!(t in kn)){for(var i=[],r=0;r<t;r++)i[r]="a["+r+"]";kn[t]=Function("C,a","return new C("+i.join(",")+")")}return kn[t](e,n)},wn=Function.bind||function(e){var t=vn(this),n=mn.call(arguments,1),i=function(){var r=n.concat(mn.call(arguments));return this instanceof i?bn(t,r.length,r):t.apply(e,r)};return yn(t.prototype)&&(i.prototype=t.prototype),i},Cn=Xt,xn=qt,_n=W,Sn=b,Tn=gn,En=wn,Pn=r,Rn=Je("Reflect","construct"),On=Pn((function(){function e(){}return!(Rn((function(){}),[],e)instanceof e)})),An=!Pn((function(){Rn((function(){}))})),Ln=On||An;function In(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Dn(e,t){return(Dn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Mn(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}}),t&&Dn(e,t)}function Nn(e){return(Nn="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})(e)}function Fn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Bn(e,t){return!t||"object"!==Nn(t)&&"function"!=typeof t?Fn(e):t}function jn(e){return(jn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Un(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Cn({target:"Reflect",stat:!0,forced:Ln,sham:Ln},{construct:function(e,t){xn(e),_n(t);var n=arguments.length<3?e:xn(arguments[2]);if(An&&!On)return Rn(e,t,n);if(e==n){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var i=[null];return i.push.apply(i,t),new(En.apply(e,i))}var r=n.prototype,o=Tn(Sn(r)?r:Object.prototype),s=Function.apply.call(e,o,t);return Sn(s)?s:o}});var Hn,Gn,Vn=Je("navigator","userAgent")||"",Wn=Vn,Kn=n.process,zn=Kn&&Kn.versions,Yn=zn&&zn.v8;Yn?Gn=(Hn=Yn.split("."))[0]<4?1:Hn[0]+Hn[1]:Wn&&(!(Hn=Wn.match(/Edge\/(\d+)/))||Hn[1]>=74)&&(Hn=Wn.match(/Chrome\/(\d+)/))&&(Gn=Hn[1]);var Xn=Gn&&+Gn,qn=Xn,$n=r,Zn=!!Object.getOwnPropertySymbols&&!$n((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&qn&&qn<41})),Jn=Zn&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Qn=h,ei=Array.isArray||function(e){return"Array"==Qn(e)},ti={},ni=k,ii=Qe.f,ri={}.toString,oi="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];ti.f=function(e){return oi&&"[object Window]"==ri.call(e)?function(e){try{return ii(e)}catch(e){return oi.slice()}}(e):ii(ni(e))};var si=n,ai=he.exports,ci=E,ui=ke,li=Zn,fi=Jn,hi=ai("wks"),di=si.Symbol,pi=fi?di:di&&di.withoutSetter||ui,gi=function(e){return ci(hi,e)&&(li||"string"==typeof hi[e])||(li&&ci(di,e)?hi[e]=di[e]:hi[e]=pi("Symbol."+e)),hi[e]},vi={},yi=gi;vi.f=yi;var mi=Xe,ki=E,bi=vi,wi=G.f,Ci=G.f,xi=E,_i=gi("toStringTag"),Si=function(e,t,n){e&&!xi(e=n?e:e.prototype,_i)&&Ci(e,_i,{configurable:!0,value:t})},Ti=qt,Ei=function(e,t,n){if(Ti(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,i){return e.call(t,n,i)};case 3:return function(n,i,r){return e.call(t,n,i,r)}}return function(){return e.apply(t,arguments)}},Pi=b,Ri=ei,Oi=gi("species"),Ai=function(e,t){var n;return Ri(e)&&("function"!=typeof(n=e.constructor)||n!==Array&&!Ri(n.prototype)?Pi(n)&&null===(n=n[Oi])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===t?0:t)},Li=Ei,Ii=g,Di=_,Mi=ot,Ni=Ai,Fi=[].push,Bi=function(e){var t=1==e,n=2==e,i=3==e,r=4==e,o=6==e,s=7==e,a=5==e||o;return function(c,u,l,f){for(var h,d,p=Di(c),g=Ii(p),v=Li(u,l,3),y=Mi(g.length),m=0,k=f||Ni,b=t?k(c,y):n||s?k(c,0):void 0;y>m;m++)if((a||m in g)&&(d=v(h=g[m],m,p),e))if(t)b[m]=d;else if(d)switch(e){case 3:return!0;case 5:return h;case 6:return m;case 2:Fi.call(b,h)}else switch(e){case 4:return!1;case 7:Fi.call(b,h)}return o?-1:i||r?r:b}},ji={forEach:Bi(0),map:Bi(1),filter:Bi(2),some:Bi(3),every:Bi(4),find:Bi(5),findIndex:Bi(6),filterOut:Bi(7)},Ui=Xt,Hi=n,Gi=Je,Vi=o,Wi=Zn,Ki=Jn,zi=r,Yi=E,Xi=ei,qi=b,$i=W,Zi=_,Ji=k,Qi=C,er=l,tr=gn,nr=Jt,ir=Qe,rr=ti,or=xt,sr=i,ar=G,cr=s,ur=J,lr=Q.exports,fr=he.exports,hr=_e,dr=ke,pr=gi,gr=vi,vr=function(e){var t=mi.Symbol||(mi.Symbol={});ki(t,e)||wi(t,e,{value:bi.f(e)})},yr=Si,mr=je,kr=ji.forEach,br=xe("hidden"),wr="Symbol",Cr=pr("toPrimitive"),xr=mr.set,_r=mr.getterFor(wr),Sr=Object.prototype,Tr=Hi.Symbol,Er=Gi("JSON","stringify"),Pr=sr.f,Rr=ar.f,Or=rr.f,Ar=cr.f,Lr=fr("symbols"),Ir=fr("op-symbols"),Dr=fr("string-to-symbol-registry"),Mr=fr("symbol-to-string-registry"),Nr=fr("wks"),Fr=Hi.QObject,Br=!Fr||!Fr.prototype||!Fr.prototype.findChild,jr=Vi&&zi((function(){return 7!=tr(Rr({},"a",{get:function(){return Rr(this,"a",{value:7}).a}})).a}))?function(e,t,n){var i=Pr(Sr,t);i&&delete Sr[t],Rr(e,t,n),i&&e!==Sr&&Rr(Sr,t,i)}:Rr,Ur=function(e,t){var n=Lr[e]=tr(Tr.prototype);return xr(n,{type:wr,tag:e,description:t}),Vi||(n.description=t),n},Hr=Ki?function(e){return"symbol"==typeof e}:function(e){return Object(e)instanceof Tr},Gr=function(e,t,n){e===Sr&&Gr(Ir,t,n),$i(e);var i=Qi(t,!0);return $i(n),Yi(Lr,i)?(n.enumerable?(Yi(e,br)&&e[br][i]&&(e[br][i]=!1),n=tr(n,{enumerable:er(0,!1)})):(Yi(e,br)||Rr(e,br,er(1,{})),e[br][i]=!0),jr(e,i,n)):Rr(e,i,n)},Vr=function(e,t){$i(e);var n=Ji(t),i=nr(n).concat(Yr(n));return kr(i,(function(t){Vi&&!Wr.call(n,t)||Gr(e,t,n[t])})),e},Wr=function(e){var t=Qi(e,!0),n=Ar.call(this,t);return!(this===Sr&&Yi(Lr,t)&&!Yi(Ir,t))&&(!(n||!Yi(this,t)||!Yi(Lr,t)||Yi(this,br)&&this[br][t])||n)},Kr=function(e,t){var n=Ji(e),i=Qi(t,!0);if(n!==Sr||!Yi(Lr,i)||Yi(Ir,i)){var r=Pr(n,i);return!r||!Yi(Lr,i)||Yi(n,br)&&n[br][i]||(r.enumerable=!0),r}},zr=function(e){var t=Or(Ji(e)),n=[];return kr(t,(function(e){Yi(Lr,e)||Yi(hr,e)||n.push(e)})),n},Yr=function(e){var t=e===Sr,n=Or(t?Ir:Ji(e)),i=[];return kr(n,(function(e){!Yi(Lr,e)||t&&!Yi(Sr,e)||i.push(Lr[e])})),i};(Wi||(lr((Tr=function(){if(this instanceof Tr)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,t=dr(e),n=function(e){this===Sr&&n.call(Ir,e),Yi(this,br)&&Yi(this[br],t)&&(this[br][t]=!1),jr(this,t,er(1,e))};return Vi&&Br&&jr(Sr,t,{configurable:!0,set:n}),Ur(t,e)}).prototype,"toString",(function(){return _r(this).tag})),lr(Tr,"withoutSetter",(function(e){return Ur(dr(e),e)})),cr.f=Wr,ar.f=Gr,sr.f=Kr,ir.f=rr.f=zr,or.f=Yr,gr.f=function(e){return Ur(pr(e),e)},Vi&&(Rr(Tr.prototype,"description",{configurable:!0,get:function(){return _r(this).description}}),lr(Sr,"propertyIsEnumerable",Wr,{unsafe:!0}))),Ui({global:!0,wrap:!0,forced:!Wi,sham:!Wi},{Symbol:Tr}),kr(nr(Nr),(function(e){vr(e)})),Ui({target:wr,stat:!0,forced:!Wi},{for:function(e){var t=String(e);if(Yi(Dr,t))return Dr[t];var n=Tr(t);return Dr[t]=n,Mr[n]=t,n},keyFor:function(e){if(!Hr(e))throw TypeError(e+" is not a symbol");if(Yi(Mr,e))return Mr[e]},useSetter:function(){Br=!0},useSimple:function(){Br=!1}}),Ui({target:"Object",stat:!0,forced:!Wi,sham:!Vi},{create:function(e,t){return void 0===t?tr(e):Vr(tr(e),t)},defineProperty:Gr,defineProperties:Vr,getOwnPropertyDescriptor:Kr}),Ui({target:"Object",stat:!0,forced:!Wi},{getOwnPropertyNames:zr,getOwnPropertySymbols:Yr}),Ui({target:"Object",stat:!0,forced:zi((function(){or.f(1)}))},{getOwnPropertySymbols:function(e){return or.f(Zi(e))}}),Er)&&Ui({target:"JSON",stat:!0,forced:!Wi||zi((function(){var e=Tr();return"[null]"!=Er([e])||"{}"!=Er({a:e})||"{}"!=Er(Object(e))}))},{stringify:function(e,t,n){for(var i,r=[e],o=1;arguments.length>o;)r.push(arguments[o++]);if(i=t,(qi(t)||void 0!==e)&&!Hr(e))return Xi(t)||(t=function(e,t){if("function"==typeof i&&(t=i.call(this,e,t)),!Hr(t))return t}),r[1]=t,Er.apply(null,r)}});Tr.prototype[Cr]||ur(Tr.prototype,Cr,Tr.prototype.valueOf),yr(Tr,wr),hr[br]=!0;var Xr=Xt,qr=r,$r=k,Zr=i.f,Jr=o,Qr=qr((function(){Zr(1)}));Xr({target:"Object",stat:!0,forced:!Jr||Qr,sham:!Jr},{getOwnPropertyDescriptor:function(e,t){return Zr($r(e),t)}});var eo=C,to=G,no=l,io=function(e,t,n){var i=eo(t);i in e?to.f(e,i,no(0,n)):e[i]=n},ro=Pt,oo=k,so=i,ao=io;function co(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function uo(e,t,n){return t&&co(e.prototype,t),n&&co(e,n),e}function lo(e,t,n){return(lo="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var i=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=jn(e)););return e}(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(n):r.value}})(e,t,n||e)}Xt({target:"Object",stat:!0,sham:!o},{getOwnPropertyDescriptors:function(e){for(var t,n,i=oo(e),r=so.f,o=ro(i),s={},a=0;o.length>a;)void 0!==(n=r(i,t=o[a++]))&&ao(s,t,n);return s}});var fo=r,ho=Xn,po=gi("species"),go=function(e){return ho>=51||!fo((function(){var t=[];return(t.constructor={})[po]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},vo=Xt,yo=r,mo=ei,ko=b,bo=_,wo=ot,Co=io,xo=Ai,_o=go,So=Xn,To=gi("isConcatSpreadable"),Eo=9007199254740991,Po="Maximum allowed index exceeded",Ro=So>=51||!yo((function(){var e=[];return e[To]=!1,e.concat()[0]!==e})),Oo=_o("concat"),Ao=function(e){if(!ko(e))return!1;var t=e[To];return void 0!==t?!!t:mo(e)};vo({target:"Array",proto:!0,forced:!Ro||!Oo},{concat:function(e){var t,n,i,r,o,s=bo(this),a=xo(s,0),c=0;for(t=-1,i=arguments.length;t<i;t++)if(Ao(o=-1===t?s:arguments[t])){if(c+(r=wo(o.length))>Eo)throw TypeError(Po);for(n=0;n<r;n++,c++)n in o&&Co(a,c,o[n])}else{if(c>=Eo)throw TypeError(Po);Co(a,c++,o)}return a.length=c,a}});var Lo=ji.map;Xt({target:"Array",proto:!0,forced:!go("map")},{map:function(e){return Lo(this,e,arguments.length>1?arguments[1]:void 0)}});var Io=_,Do=Jt;Xt({target:"Object",stat:!0,forced:r((function(){Do(1)}))},{keys:function(e){return Do(Io(e))}});var Mo=Xt,No=b,Fo=ei,Bo=ut,jo=ot,Uo=k,Ho=io,Go=gi,Vo=go("slice"),Wo=Go("species"),Ko=[].slice,zo=Math.max;Mo({target:"Array",proto:!0,forced:!Vo},{slice:function(e,t){var n,i,r,o=Uo(this),s=jo(o.length),a=Bo(e,s),c=Bo(void 0===t?s:t,s);if(Fo(o)&&("function"!=typeof(n=o.constructor)||n!==Array&&!Fo(n.prototype)?No(n)&&null===(n=n[Wo])&&(n=void 0):n=void 0,n===Array||void 0===n))return Ko.call(o,a,c);for(i=new(void 0===n?Array:n)(zo(c-a,0)),r=0;a<c;a++,r++)a in o&&Ho(i,r,o[a]);return i.length=r,i}});var Yo={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Xo=r,qo=function(e,t){var n=[][e];return!!n&&Xo((function(){n.call(null,t||function(){throw 1},1)}))},$o=ji.forEach,Zo=n,Jo=Yo,Qo=qo("forEach")?[].forEach:function(e){return $o(this,e,arguments.length>1?arguments[1]:void 0)},es=J;for(var ts in Jo){var ns=Zo[ts],is=ns&&ns.prototype;if(is&&is.forEach!==Qo)try{es(is,"forEach",Qo)}catch(e){is.forEach=Qo}}var rs=W,os=function(){var e=rs(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t},ss={},as=r,cs=function(e,t){return RegExp(e,t)};ss.UNSUPPORTED_Y=as((function(){var e=cs("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),ss.BROKEN_CARET=as((function(){var e=cs("^r","gy");return e.lastIndex=2,null!=e.exec("str")}));var us=r((function(){var e=RegExp(".","string".charAt(0));return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),ls=r((function(){var e=RegExp("(?<a>b)","string".charAt(5));return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),fs=os,hs=ss,ds=he.exports,ps=gn,gs=je.get,vs=us,ys=ls,ms=RegExp.prototype.exec,ks=ds("native-string-replace",String.prototype.replace),bs=ms,ws=function(){var e=/a/,t=/b*/g;return ms.call(e,"a"),ms.call(t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),Cs=hs.UNSUPPORTED_Y||hs.BROKEN_CARET,xs=void 0!==/()??/.exec("")[1];(ws||xs||Cs||vs||ys)&&(bs=function(e){var t,n,i,r,o,s,a,c=this,u=gs(c),l=u.raw;if(l)return l.lastIndex=c.lastIndex,t=bs.call(l,e),c.lastIndex=l.lastIndex,t;var f=u.groups,h=Cs&&c.sticky,d=fs.call(c),p=c.source,g=0,v=e;if(h&&(-1===(d=d.replace("y","")).indexOf("g")&&(d+="g"),v=String(e).slice(c.lastIndex),c.lastIndex>0&&(!c.multiline||c.multiline&&"\n"!==e[c.lastIndex-1])&&(p="(?: "+p+")",v=" "+v,g++),n=new RegExp("^(?:"+p+")",d)),xs&&(n=new RegExp("^"+p+"$(?!\\s)",d)),ws&&(i=c.lastIndex),r=ms.call(h?n:c,v),h?r?(r.input=r.input.slice(g),r[0]=r[0].slice(g),r.index=c.lastIndex,c.lastIndex+=r[0].length):c.lastIndex=0:ws&&r&&(c.lastIndex=c.global?r.index+r[0].length:i),xs&&r&&r.length>1&&ks.call(r[0],n,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(r[o]=void 0)})),r&&f)for(r.groups=s=ps(null),o=0;o<f.length;o++)s[(a=f[o])[0]]=r[a[1]];return r});var _s=bs;Xt({target:"RegExp",proto:!0,forced:/./.exec!==_s},{exec:_s});var Ss=Q.exports,Ts=_s,Es=r,Ps=gi,Rs=J,Os=Ps("species"),As=RegExp.prototype,Ls=function(e,t,n,i){var r=Ps(e),o=!Es((function(){var t={};return t[r]=function(){return 7},7!=""[e](t)})),s=o&&!Es((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[Os]=function(){return n},n.flags="",n[r]=/./[r]),n.exec=function(){return t=!0,null},n[r](""),!t}));if(!o||!s||n){var a=/./[r],c=t(r,""[e],(function(e,t,n,i,r){var s=t.exec;return s===Ts||s===As.exec?o&&!r?{done:!0,value:a.call(t,n,i)}:{done:!0,value:e.call(n,t,i)}:{done:!1}}));Ss(String.prototype,e,c[0]),Ss(As,r,c[1])}i&&Rs(As[r],"sham",!0)},Is=b,Ds=h,Ms=gi("match"),Ns=function(e){var t;return Is(e)&&(void 0!==(t=e[Ms])?!!t:"RegExp"==Ds(e))},Fs=W,Bs=qt,js=gi("species"),Us=function(e,t){var n,i=Fs(e).constructor;return void 0===i||null==(n=Fs(i)[js])?t:Bs(n)},Hs=nt,Gs=v,Vs=function(e){return function(t,n){var i,r,o=String(Gs(t)),s=Hs(n),a=o.length;return s<0||s>=a?e?"":void 0:(i=o.charCodeAt(s))<55296||i>56319||s+1===a||(r=o.charCodeAt(s+1))<56320||r>57343?e?o.charAt(s):i:e?o.slice(s,s+2):r-56320+(i-55296<<10)+65536}},Ws={codeAt:Vs(!1),charAt:Vs(!0)},Ks=Ws.charAt,zs=function(e,t,n){return t+(n?Ks(e,t).length:1)},Ys=h,Xs=_s,qs=function(e,t){var n=e.exec;if("function"==typeof n){var i=n.call(e,t);if("object"!=typeof i)throw TypeError("RegExp exec method returned something other than an Object or null");return i}if("RegExp"!==Ys(e))throw TypeError("RegExp#exec called on incompatible receiver");return Xs.call(e,t)},$s=Ls,Zs=Ns,Js=W,Qs=v,ea=Us,ta=zs,na=ot,ia=qs,ra=_s,oa=r,sa=ss.UNSUPPORTED_Y,aa=[].push,ca=Math.min,ua=4294967295;$s("split",(function(e,t,n){var i;return i="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,n){var i=String(Qs(this)),r=void 0===n?ua:n>>>0;if(0===r)return[];if(void 0===e)return[i];if(!Zs(e))return t.call(i,e,r);for(var o,s,a,c=[],u=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),l=0,f=new RegExp(e.source,u+"g");(o=ra.call(f,i))&&!((s=f.lastIndex)>l&&(c.push(i.slice(l,o.index)),o.length>1&&o.index<i.length&&aa.apply(c,o.slice(1)),a=o[0].length,l=s,c.length>=r));)f.lastIndex===o.index&&f.lastIndex++;return l===i.length?!a&&f.test("")||c.push(""):c.push(i.slice(l)),c.length>r?c.slice(0,r):c}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:t.call(this,e,n)}:t,[function(t,n){var r=Qs(this),o=null==t?void 0:t[e];return void 0!==o?o.call(t,r,n):i.call(String(r),t,n)},function(e,r){var o=n(i,this,e,r,i!==t);if(o.done)return o.value;var s=Js(this),a=String(e),c=ea(s,RegExp),u=s.unicode,l=(s.ignoreCase?"i":"")+(s.multiline?"m":"")+(s.unicode?"u":"")+(sa?"g":"y"),f=new c(sa?"^(?:"+s.source+")":s,l),h=void 0===r?ua:r>>>0;if(0===h)return[];if(0===a.length)return null===ia(f,a)?[a]:[];for(var d=0,p=0,g=[];p<a.length;){f.lastIndex=sa?0:p;var v,y=ia(f,sa?a.slice(p):a);if(null===y||(v=ca(na(f.lastIndex+(sa?p:0)),a.length))===d)p=ta(a,p,u);else{if(g.push(a.slice(d,p)),g.length===h)return g;for(var m=1;m<=y.length-1;m++)if(g.push(y[m]),g.length===h)return g;p=d=v}}return g.push(a.slice(d)),g}]}),!!oa((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]})),sa);var la=Xt,fa=k,ha=[].join,da=g!=Object,pa=qo("join",",");la({target:"Array",proto:!0,forced:da||!pa},{join:function(e){return ha.call(fa(this),void 0===e?",":e)}});var ga=Xt,va=ut,ya=nt,ma=ot,ka=_,ba=Ai,wa=io,Ca=go("splice"),xa=Math.max,_a=Math.min,Sa=9007199254740991,Ta="Maximum allowed length exceeded";ga({target:"Array",proto:!0,forced:!Ca},{splice:function(e,t){var n,i,r,o,s,a,c=ka(this),u=ma(c.length),l=va(e,u),f=arguments.length;if(0===f?n=i=0:1===f?(n=0,i=u-l):(n=f-2,i=_a(xa(ya(t),0),u-l)),u+n-i>Sa)throw TypeError(Ta);for(r=ba(c,i),o=0;o<i;o++)(s=l+o)in c&&wa(r,o,c[s]);if(r.length=i,n<i){for(o=l;o<u-i;o++)a=o+n,(s=o+i)in c?c[a]=c[s]:delete c[a];for(o=u;o>u-i+n;o--)delete c[o-1]}else if(n>i)for(o=u-i;o>l;o--)a=o+n-1,(s=o+i-1)in c?c[a]=c[s]:delete c[a];for(o=0;o<n;o++)c[o+l]=arguments[o+2];return c.length=u-i+n,r}});var Ea={};Ea[gi("toStringTag")]="z";var Pa="[object z]"===String(Ea),Ra=Pa,Oa=h,Aa=gi("toStringTag"),La="Arguments"==Oa(function(){return arguments}()),Ia=Ra?Oa:function(e){var t,n,i;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),Aa))?n:La?Oa(t):"Object"==(i=Oa(t))&&"function"==typeof t.callee?"Arguments":i},Da=Ia,Ma=Pa?{}.toString:function(){return"[object "+Da(this)+"]"},Na=Pa,Fa=Q.exports,Ba=Ma;Na||Fa(Object.prototype,"toString",Ba,{unsafe:!0});var ja=n.Promise,Ua=Q.exports,Ha=function(e,t,n){for(var i in t)Ua(e,i,t[i],n);return e},Ga=b,Va=W,Wa=function(e){if(!Ga(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e},Ka=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),t=n instanceof Array}catch(e){}return function(n,i){return Va(n),Wa(i),t?e.call(n,i):n.__proto__=i,n}}():void 0),za=Je,Ya=G,Xa=o,qa=gi("species"),$a=function(e){var t=za(e),n=Ya.f;Xa&&t&&!t[qa]&&n(t,qa,{configurable:!0,get:function(){return this}})},Za=function(e,t,n){if(!(e instanceof t))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return e},Ja={},Qa=Ja,ec=gi("iterator"),tc=Array.prototype,nc=function(e){return void 0!==e&&(Qa.Array===e||tc[ec]===e)},ic=Ia,rc=Ja,oc=gi("iterator"),sc=function(e){if(null!=e)return e[oc]||e["@@iterator"]||rc[ic(e)]},ac=W,cc=function(e){var t=e.return;if(void 0!==t)return ac(t.call(e)).value},uc=W,lc=nc,fc=ot,hc=Ei,dc=sc,pc=cc,gc=function(e,t){this.stopped=e,this.result=t},vc=gi("iterator"),yc=!1;try{var mc=0,kc={next:function(){return{done:!!mc++}},return:function(){yc=!0}};kc[vc]=function(){return this},Array.from(kc,(function(){throw 2}))}catch(e){}var bc,wc,Cc,xc=/(?:iphone|ipod|ipad).*applewebkit/i.test(Vn),_c="process"==h(n.process),Sc=n,Tc=r,Ec=Ei,Pc=rn,Rc=A,Oc=xc,Ac=_c,Lc=Sc.location,Ic=Sc.setImmediate,Dc=Sc.clearImmediate,Mc=Sc.process,Nc=Sc.MessageChannel,Fc=Sc.Dispatch,Bc=0,jc={},Uc="onreadystatechange",Hc=function(e){if(jc.hasOwnProperty(e)){var t=jc[e];delete jc[e],t()}},Gc=function(e){return function(){Hc(e)}},Vc=function(e){Hc(e.data)},Wc=function(e){Sc.postMessage(e+"",Lc.protocol+"//"+Lc.host)};Ic&&Dc||(Ic=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return jc[++Bc]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},bc(Bc),Bc},Dc=function(e){delete jc[e]},Ac?bc=function(e){Mc.nextTick(Gc(e))}:Fc&&Fc.now?bc=function(e){Fc.now(Gc(e))}:Nc&&!Oc?(Cc=(wc=new Nc).port2,wc.port1.onmessage=Vc,bc=Ec(Cc.postMessage,Cc,1)):Sc.addEventListener&&"function"==typeof postMessage&&!Sc.importScripts&&Lc&&"file:"!==Lc.protocol&&!Tc(Wc)?(bc=Wc,Sc.addEventListener("message",Vc,!1)):bc=Uc in Rc("script")?function(e){Pc.appendChild(Rc("script")).onreadystatechange=function(){Pc.removeChild(this),Hc(e)}}:function(e){setTimeout(Gc(e),0)});var Kc,zc,Yc,Xc,qc,$c,Zc,Jc,Qc={set:Ic,clear:Dc},eu=/web0s(?!.*chrome)/i.test(Vn),tu=n,nu=i.f,iu=Qc.set,ru=xc,ou=eu,su=_c,au=tu.MutationObserver||tu.WebKitMutationObserver,cu=tu.document,uu=tu.process,lu=tu.Promise,fu=nu(tu,"queueMicrotask"),hu=fu&&fu.value;hu||(Kc=function(){var e,t;for(su&&(e=uu.domain)&&e.exit();zc;){t=zc.fn,zc=zc.next;try{t()}catch(e){throw zc?Xc():Yc=void 0,e}}Yc=void 0,e&&e.enter()},ru||su||ou||!au||!cu?lu&&lu.resolve?((Zc=lu.resolve(void 0)).constructor=lu,Jc=Zc.then,Xc=function(){Jc.call(Zc,Kc)}):Xc=su?function(){uu.nextTick(Kc)}:function(){iu.call(tu,Kc)}:(qc=!0,$c=cu.createTextNode(""),new au(Kc).observe($c,{characterData:!0}),Xc=function(){$c.data=qc=!qc}));var du=hu||function(e){var t={fn:e,next:void 0};Yc&&(Yc.next=t),zc||(zc=t,Xc()),Yc=t},pu={},gu=qt,vu=function(e){var t,n;this.promise=new e((function(e,i){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=i})),this.resolve=gu(t),this.reject=gu(n)};pu.f=function(e){return new vu(e)};var yu,mu,ku,bu,wu=W,Cu=b,xu=pu,_u=n,Su="object"==typeof window,Tu=Xt,Eu=n,Pu=Je,Ru=ja,Ou=Q.exports,Au=Ha,Lu=Ka,Iu=Si,Du=$a,Mu=b,Nu=qt,Fu=Za,Bu=ce,ju=function(e,t,n){var i,r,o,s,a,c,u,l=n&&n.that,f=!(!n||!n.AS_ENTRIES),h=!(!n||!n.IS_ITERATOR),d=!(!n||!n.INTERRUPTED),p=hc(t,l,1+f+d),g=function(e){return i&&pc(i),new gc(!0,e)},v=function(e){return f?(uc(e),d?p(e[0],e[1],g):p(e[0],e[1])):d?p(e,g):p(e)};if(h)i=e;else{if("function"!=typeof(r=dc(e)))throw TypeError("Target is not iterable");if(lc(r)){for(o=0,s=fc(e.length);s>o;o++)if((a=v(e[o]))&&a instanceof gc)return a;return new gc(!1)}i=r.call(e)}for(c=i.next;!(u=c.call(i)).done;){try{a=v(u.value)}catch(e){throw pc(i),e}if("object"==typeof a&&a&&a instanceof gc)return a}return new gc(!1)},Uu=function(e,t){if(!t&&!yc)return!1;var n=!1;try{var i={};i[vc]=function(){return{next:function(){return{done:n=!0}}}},e(i)}catch(e){}return n},Hu=Us,Gu=Qc.set,Vu=du,Wu=function(e,t){if(wu(e),Cu(t)&&t.constructor===e)return t;var n=xu.f(e);return(0,n.resolve)(t),n.promise},Ku=function(e,t){var n=_u.console;n&&n.error&&(1===arguments.length?n.error(e):n.error(e,t))},zu=pu,Yu=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},Xu=je,qu=Ut,$u=Su,Zu=_c,Ju=Xn,Qu=gi("species"),el="Promise",tl=Xu.get,nl=Xu.set,il=Xu.getterFor(el),rl=Ru&&Ru.prototype,ol=Ru,sl=rl,al=Eu.TypeError,cl=Eu.document,ul=Eu.process,ll=zu.f,fl=ll,hl=!!(cl&&cl.createEvent&&Eu.dispatchEvent),dl="function"==typeof PromiseRejectionEvent,pl="unhandledrejection",gl=!1,vl=qu(el,(function(){var e=Bu(ol),t=e!==String(ol);if(!t&&66===Ju)return!0;if(Ju>=51&&/native code/.test(e))return!1;var n=new ol((function(e){e(1)})),i=function(e){e((function(){}),(function(){}))};return(n.constructor={})[Qu]=i,!(gl=n.then((function(){}))instanceof i)||!t&&$u&&!dl})),yl=vl||!Uu((function(e){ol.all(e).catch((function(){}))})),ml=function(e){var t;return!(!Mu(e)||"function"!=typeof(t=e.then))&&t},kl=function(e,t){if(!e.notified){e.notified=!0;var n=e.reactions;Vu((function(){for(var i=e.value,r=1==e.state,o=0;n.length>o;){var s,a,c,u=n[o++],l=r?u.ok:u.fail,f=u.resolve,h=u.reject,d=u.domain;try{l?(r||(2===e.rejection&&xl(e),e.rejection=1),!0===l?s=i:(d&&d.enter(),s=l(i),d&&(d.exit(),c=!0)),s===u.promise?h(al("Promise-chain cycle")):(a=ml(s))?a.call(s,f,h):f(s)):h(i)}catch(e){d&&!c&&d.exit(),h(e)}}e.reactions=[],e.notified=!1,t&&!e.rejection&&wl(e)}))}},bl=function(e,t,n){var i,r;hl?((i=cl.createEvent("Event")).promise=t,i.reason=n,i.initEvent(e,!1,!0),Eu.dispatchEvent(i)):i={promise:t,reason:n},!dl&&(r=Eu["on"+e])?r(i):e===pl&&Ku("Unhandled promise rejection",n)},wl=function(e){Gu.call(Eu,(function(){var t,n=e.facade,i=e.value;if(Cl(e)&&(t=Yu((function(){Zu?ul.emit("unhandledRejection",i,n):bl(pl,n,i)})),e.rejection=Zu||Cl(e)?2:1,t.error))throw t.value}))},Cl=function(e){return 1!==e.rejection&&!e.parent},xl=function(e){Gu.call(Eu,(function(){var t=e.facade;Zu?ul.emit("rejectionHandled",t):bl("rejectionhandled",t,e.value)}))},_l=function(e,t,n){return function(i){e(t,i,n)}},Sl=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,kl(e,!0))},Tl=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw al("Promise can't be resolved itself");var i=ml(t);i?Vu((function(){var n={done:!1};try{i.call(t,_l(Tl,n,e),_l(Sl,n,e))}catch(t){Sl(n,t,e)}})):(e.value=t,e.state=1,kl(e,!1))}catch(t){Sl({done:!1},t,e)}}};if(vl&&(sl=(ol=function(e){Fu(this,ol,el),Nu(e),yu.call(this);var t=tl(this);try{e(_l(Tl,t),_l(Sl,t))}catch(e){Sl(t,e)}}).prototype,(yu=function(e){nl(this,{type:el,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=Au(sl,{then:function(e,t){var n=il(this),i=ll(Hu(this,ol));return i.ok="function"!=typeof e||e,i.fail="function"==typeof t&&t,i.domain=Zu?ul.domain:void 0,n.parent=!0,n.reactions.push(i),0!=n.state&&kl(n,!1),i.promise},catch:function(e){return this.then(void 0,e)}}),mu=function(){var e=new yu,t=tl(e);this.promise=e,this.resolve=_l(Tl,t),this.reject=_l(Sl,t)},zu.f=ll=function(e){return e===ol||e===ku?new mu(e):fl(e)},"function"==typeof Ru&&rl!==Object.prototype)){bu=rl.then,gl||(Ou(rl,"then",(function(e,t){var n=this;return new ol((function(e,t){bu.call(n,e,t)})).then(e,t)}),{unsafe:!0}),Ou(rl,"catch",sl.catch,{unsafe:!0}));try{delete rl.constructor}catch(e){}Lu&&Lu(rl,sl)}Tu({global:!0,wrap:!0,forced:vl},{Promise:ol}),Iu(ol,el,!1),Du(el),ku=Pu(el),Tu({target:el,stat:!0,forced:vl},{reject:function(e){var t=ll(this);return t.reject.call(void 0,e),t.promise}}),Tu({target:el,stat:!0,forced:vl},{resolve:function(e){return Wu(this,e)}}),Tu({target:el,stat:!0,forced:yl},{all:function(e){var t=this,n=ll(t),i=n.resolve,r=n.reject,o=Yu((function(){var n=Nu(t.resolve),o=[],s=0,a=1;ju(e,(function(e){var c=s++,u=!1;o.push(void 0),a++,n.call(t,e).then((function(e){u||(u=!0,o[c]=e,--a||i(o))}),r)})),--a||i(o)}));return o.error&&r(o.value),n.promise},race:function(e){var t=this,n=ll(t),i=n.reject,r=Yu((function(){var r=Nu(t.resolve);ju(e,(function(e){r.call(t,e).then(n.resolve,i)}))}));return r.error&&i(r.value),n.promise}});var El=o,Pl=G.f,Rl=Function.prototype,Ol=Rl.toString,Al=/^\s*function ([^ (]*)/,Ll="name";El&&!(Ll in Rl)&&Pl(Rl,Ll,{configurable:!0,get:function(){try{return Ol.call(this).match(Al)[1]}catch(e){return""}}}),Xt({target:"Number",stat:!0},{isNaN:function(e){return e!=e}});var Il=b,Dl=Ka,Ml=function(e,t,n){var i,r;return Dl&&"function"==typeof(i=t.constructor)&&i!==n&&Il(r=i.prototype)&&r!==n.prototype&&Dl(e,r),e},Nl="\t\n\v\f\r                 \u2028\u2029\ufeff",Fl=v,Bl="[\t\n\v\f\r                 \u2028\u2029\ufeff]",jl=RegExp("^"+Bl+Bl+"*"),Ul=RegExp(Bl+Bl+"*$"),Hl=function(e){return function(t){var n=String(Fl(t));return 1&e&&(n=n.replace(jl,"")),2&e&&(n=n.replace(Ul,"")),n}},Gl={start:Hl(1),end:Hl(2),trim:Hl(3)},Vl=o,Wl=n,Kl=Ut,zl=Q.exports,Yl=E,Xl=h,ql=Ml,$l=C,Zl=r,Jl=gn,Ql=Qe.f,ef=i.f,tf=G.f,nf=Gl.trim,rf="Number",of=Wl.Number,sf=of.prototype,af=Xl(Jl(sf))==rf,cf=function(e){var t,n,i,r,o,s,a,c,u=$l(e,!1);if("string"==typeof u&&u.length>2)if(43===(t=(u=nf(u)).charCodeAt(0))||45===t){if(88===(n=u.charCodeAt(2))||120===n)return NaN}else if(48===t){switch(u.charCodeAt(1)){case 66:case 98:i=2,r=49;break;case 79:case 111:i=8,r=55;break;default:return+u}for(s=(o=u.slice(2)).length,a=0;a<s;a++)if((c=o.charCodeAt(a))<48||c>r)return NaN;return parseInt(o,i)}return+u};if(Kl(rf,!of(" 0o1")||!of("0b1")||of("+0x1"))){for(var uf,lf=function(e){var t=arguments.length<1?0:e,n=this;return n instanceof lf&&(af?Zl((function(){sf.valueOf.call(n)})):Xl(n)!=rf)?ql(new of(cf(t)),n,lf):cf(t)},ff=Vl?Ql(of):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger,fromString,range".split(","),hf=0;ff.length>hf;hf++)Yl(of,uf=ff[hf])&&!Yl(lf,uf)&&tf(lf,uf,ef(of,uf));lf.prototype=sf,sf.constructor=lf,zl(Wl,rf,lf)}var df=gn,pf=G,gf=gi("unscopables"),vf=Array.prototype;null==vf[gf]&&pf.f(vf,gf,{configurable:!0,value:df(null)});var yf,mf,kf,bf=function(e){vf[gf][e]=!0},wf=!r((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Cf=E,xf=_,_f=wf,Sf=xe("IE_PROTO"),Tf=Object.prototype,Ef=_f?Object.getPrototypeOf:function(e){return e=xf(e),Cf(e,Sf)?e[Sf]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?Tf:null},Pf=r,Rf=Ef,Of=J,Af=E,Lf=gi("iterator"),If=!1;[].keys&&("next"in(kf=[].keys())?(mf=Rf(Rf(kf)))!==Object.prototype&&(yf=mf):If=!0),(null==yf||Pf((function(){var e={};return yf[Lf].call(e)!==e})))&&(yf={}),Af(yf,Lf)||Of(yf,Lf,(function(){return this}));var Df={IteratorPrototype:yf,BUGGY_SAFARI_ITERATORS:If},Mf=Df.IteratorPrototype,Nf=gn,Ff=l,Bf=Si,jf=Ja,Uf=function(){return this},Hf=function(e,t,n){var i=t+" Iterator";return e.prototype=Nf(Mf,{next:Ff(1,n)}),Bf(e,i,!1),jf[i]=Uf,e},Gf=Xt,Vf=Hf,Wf=Ef,Kf=Ka,zf=Si,Yf=J,Xf=Q.exports,qf=Ja,$f=Df.IteratorPrototype,Zf=Df.BUGGY_SAFARI_ITERATORS,Jf=gi("iterator"),Qf="keys",eh="values",th="entries",nh=function(){return this},ih=function(e,t,n,i,r,o,s){Vf(n,t,i);var a,c,u,l=function(e){if(e===r&&g)return g;if(!Zf&&e in d)return d[e];switch(e){case Qf:case eh:case th:return function(){return new n(this,e)}}return function(){return new n(this)}},f=t+" Iterator",h=!1,d=e.prototype,p=d[Jf]||d["@@iterator"]||r&&d[r],g=!Zf&&p||l(r),v="Array"==t&&d.entries||p;if(v&&(a=Wf(v.call(new e)),$f!==Object.prototype&&a.next&&(Wf(a)!==$f&&(Kf?Kf(a,$f):"function"!=typeof a[Jf]&&Yf(a,Jf,nh)),zf(a,f,!0))),r==eh&&p&&p.name!==eh&&(h=!0,g=function(){return p.call(this)}),d[Jf]!==g&&Yf(d,Jf,g),qf[t]=g,r)if(c={values:l(eh),keys:o?g:l(Qf),entries:l(th)},s)for(u in c)(Zf||h||!(u in d))&&Xf(d,u,c[u]);else Gf({target:t,proto:!0,forced:Zf||h},c);return c},rh=k,oh=bf,sh=Ja,ah=je,ch=ih,uh="Array Iterator",lh=ah.set,fh=ah.getterFor(uh),hh=ch(Array,"Array",(function(e,t){lh(this,{type:uh,target:rh(e),index:0,kind:t})}),(function(){var e=fh(this),t=e.target,n=e.kind,i=e.index++;return!t||i>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:i,done:!1}:"values"==n?{value:t[i],done:!1}:{value:[i,t[i]],done:!1}}),"values");sh.Arguments=sh.Array,oh("keys"),oh("values"),oh("entries");var dh=n,ph=Yo,gh=hh,vh=J,yh=gi,mh=yh("iterator"),kh=yh("toStringTag"),bh=gh.values;for(var wh in ph){var Ch=dh[wh],xh=Ch&&Ch.prototype;if(xh){if(xh[mh]!==bh)try{vh(xh,mh,bh)}catch(e){xh[mh]=bh}if(xh[kh]||vh(xh,kh,wh),ph[wh])for(var _h in gh)if(xh[_h]!==gh[_h])try{vh(xh,_h,gh[_h])}catch(e){xh[_h]=gh[_h]}}}var Sh=ji.filter;Xt({target:"Array",proto:!0,forced:!go("filter")},{filter:function(e){return Sh(this,e,arguments.length>1?arguments[1]:void 0)}});var Th=o,Eh=r,Ph=Jt,Rh=xt,Oh=s,Ah=_,Lh=g,Ih=Object.assign,Dh=Object.defineProperty,Mh=!Ih||Eh((function(){if(Th&&1!==Ih({b:1},Ih(Dh({},"a",{enumerable:!0,get:function(){Dh(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol(),i="abcdefghijklmnopqrst";return e[n]=7,i.split("").forEach((function(e){t[e]=e})),7!=Ih({},e)[n]||Ph(Ih({},t)).join("")!=i}))?function(e,t){for(var n=Ah(e),i=arguments.length,r=1,o=Rh.f,s=Oh.f;i>r;)for(var a,c=Lh(arguments[r++]),u=o?Ph(c).concat(o(c)):Ph(c),l=u.length,f=0;l>f;)a=u[f++],Th&&!s.call(c,a)||(n[a]=c[a]);return n}:Ih,Nh=Mh;Xt({target:"Object",stat:!0,forced:Object.assign!==Nh},{assign:Nh});var Fh={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,n="~";function i(){}function r(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,i,o,s){if("function"!=typeof i)throw new TypeError("The listener must be a function");var a=new r(i,o||e,s),c=n?n+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],a]:e._events[c].push(a):(e._events[c]=a,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new i:delete e._events[t]}function a(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),a.prototype.eventNames=function(){var e,i,r=[];if(0===this._eventsCount)return r;for(i in e=this._events)t.call(e,i)&&r.push(n?i.slice(1):i);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},a.prototype.listeners=function(e){var t=n?n+e:e,i=this._events[t];if(!i)return[];if(i.fn)return[i.fn];for(var r=0,o=i.length,s=new Array(o);r<o;r++)s[r]=i[r].fn;return s},a.prototype.listenerCount=function(e){var t=n?n+e:e,i=this._events[t];return i?i.fn?1:i.length:0},a.prototype.emit=function(e,t,i,r,o,s){var a=n?n+e:e;if(!this._events[a])return!1;var c,u,l=this._events[a],f=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),f){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,i),!0;case 4:return l.fn.call(l.context,t,i,r),!0;case 5:return l.fn.call(l.context,t,i,r,o),!0;case 6:return l.fn.call(l.context,t,i,r,o,s),!0}for(u=1,c=new Array(f-1);u<f;u++)c[u-1]=arguments[u];l.fn.apply(l.context,c)}else{var h,d=l.length;for(u=0;u<d;u++)switch(l[u].once&&this.removeListener(e,l[u].fn,void 0,!0),f){case 1:l[u].fn.call(l[u].context);break;case 2:l[u].fn.call(l[u].context,t);break;case 3:l[u].fn.call(l[u].context,t,i);break;case 4:l[u].fn.call(l[u].context,t,i,r);break;default:if(!c)for(h=1,c=new Array(f-1);h<f;h++)c[h-1]=arguments[h];l[u].fn.apply(l[u].context,c)}}return!0},a.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},a.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},a.prototype.removeListener=function(e,t,i,r){var o=n?n+e:e;if(!this._events[o])return this;if(!t)return s(this,o),this;var a=this._events[o];if(a.fn)a.fn!==t||r&&!a.once||i&&a.context!==i||s(this,o);else{for(var c=0,u=[],l=a.length;c<l;c++)(a[c].fn!==t||r&&!a[c].once||i&&a[c].context!==i)&&u.push(a[c]);u.length?this._events[o]=1===u.length?u[0]:u:s(this,o)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,e.exports=a}(Fh);var Bh=Fh.exports;function jh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function Uh(e){return function(e){if(Array.isArray(e))return jh(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return jh(e,t);var n=Object.prototype.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)?jh(e,t):void 0}}(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.")}()}var Hh=W,Gh=ot,Vh=v,Wh=zs,Kh=qs;Ls("match",(function(e,t,n){return[function(t){var n=Vh(this),i=null==t?void 0:t[e];return void 0!==i?i.call(t,n):new RegExp(t)[e](String(n))},function(e){var i=n(t,this,e);if(i.done)return i.value;var r=Hh(this),o=String(e);if(!r.global)return Kh(r,o);var s=r.unicode;r.lastIndex=0;for(var a,c=[],u=0;null!==(a=Kh(r,o));){var l=String(a[0]);c[u]=l,""===l&&(r.lastIndex=Wh(o,Gh(r.lastIndex),s)),u++}return 0===u?null:c}]}));var zh=o,Yh=n,Xh=Ut,qh=Ml,$h=J,Zh=G.f,Jh=Qe.f,Qh=Ns,ed=os,td=ss,nd=Q.exports,id=r,rd=E,od=je.enforce,sd=$a,ad=us,cd=ls,ud=gi("match"),ld=Yh.RegExp,fd=ld.prototype,hd=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,dd=/a/g,pd=/a/g,gd=new ld(dd)!==dd,vd=td.UNSUPPORTED_Y,yd=zh&&(!gd||vd||ad||cd||id((function(){return pd[ud]=!1,ld(dd)!=dd||ld(pd)==pd||"/a/i"!=ld(dd,"i")})));if(Xh("RegExp",yd)){for(var md=function(e,t){var n,i,r,o,s,a,c=this instanceof md,u=Qh(e),l=void 0===t,f=[],h=e;if(!c&&u&&l&&e.constructor===md)return e;if((u||e instanceof md)&&(e=e.source,l&&(t="flags"in h?h.flags:ed.call(h))),e=void 0===e?"":String(e),t=void 0===t?"":String(t),h=e,ad&&"dotAll"in dd&&(i=!!t&&t.indexOf("s")>-1)&&(t=t.replace(/s/g,"")),n=t,vd&&"sticky"in dd&&(r=!!t&&t.indexOf("y")>-1)&&(t=t.replace(/y/g,"")),cd&&(e=(o=function(e){for(var t,n=e.length,i=0,r="",o=[],s={},a=!1,c=!1,u=0,l="";i<=n;i++){if("\\"===(t=e.charAt(i)))t+=e.charAt(++i);else if("]"===t)a=!1;else if(!a)switch(!0){case"["===t:a=!0;break;case"("===t:hd.test(e.slice(i+1))&&(i+=2,c=!0),r+=t,u++;continue;case">"===t&&c:if(""===l||rd(s,l))throw new SyntaxError("Invalid capture group name");s[l]=!0,o.push([l,u]),c=!1,l="";continue}c?l+=t:r+=t}return[r,o]}(e))[0],f=o[1]),s=qh(ld(e,t),c?this:fd,md),(i||r||f.length)&&(a=od(s),i&&(a.dotAll=!0,a.raw=md(function(e){for(var t,n=e.length,i=0,r="",o=!1;i<=n;i++)"\\"!==(t=e.charAt(i))?o||"."!==t?("["===t?o=!0:"]"===t&&(o=!1),r+=t):r+="[\\s\\S]":r+=t+e.charAt(++i);return r}(e),n)),r&&(a.sticky=!0),f.length&&(a.groups=f)),e!==h)try{$h(s,"source",""===h?"(?:)":h)}catch(e){}return s},kd=function(e){e in md||Zh(md,e,{configurable:!0,get:function(){return ld[e]},set:function(t){ld[e]=t}})},bd=Jh(ld),wd=0;bd.length>wd;)kd(bd[wd++]);fd.constructor=md,md.prototype=fd,nd(Yh,"RegExp",md)}sd("RegExp");var Cd=Q.exports,xd=W,_d=r,Sd=os,Td="toString",Ed=RegExp.prototype,Pd=Ed.toString,Rd=_d((function(){return"/a/b"!=Pd.call({source:"a",flags:"b"})})),Od=Pd.name!=Td;(Rd||Od)&&Cd(RegExp.prototype,Td,(function(){var e=xd(this),t=String(e.source),n=e.flags;return"/"+t+"/"+String(void 0===n&&e instanceof RegExp&&!("flags"in Ed)?Sd.call(e):n)}),{unsafe:!0});var Ad=_,Ld=Math.floor,Id="".replace,Dd=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,Md=/\$([$&'`]|\d{1,2})/g,Nd=Ls,Fd=r,Bd=W,jd=ot,Ud=nt,Hd=v,Gd=zs,Vd=function(e,t,n,i,r,o){var s=n+e.length,a=i.length,c=Md;return void 0!==r&&(r=Ad(r),c=Dd),Id.call(o,c,(function(o,c){var u;switch(c.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,n);case"'":return t.slice(s);case"<":u=r[c.slice(1,-1)];break;default:var l=+c;if(0===l)return o;if(l>a){var f=Ld(l/10);return 0===f?o:f<=a?void 0===i[f-1]?c.charAt(1):i[f-1]+c.charAt(1):o}u=i[l-1]}return void 0===u?"":u}))},Wd=qs,Kd=gi("replace"),zd=Math.max,Yd=Math.min,Xd="$0"==="a".replace(/./,"$0"),qd=!!/./[Kd]&&""===/./[Kd]("a","$0");Nd("replace",(function(e,t,n){var i=qd?"$":"$0";return[function(e,n){var i=Hd(this),r=null==e?void 0:e[Kd];return void 0!==r?r.call(e,i,n):t.call(String(i),e,n)},function(e,r){if("string"==typeof r&&-1===r.indexOf(i)&&-1===r.indexOf("$<")){var o=n(t,this,e,r);if(o.done)return o.value}var s=Bd(this),a=String(e),c="function"==typeof r;c||(r=String(r));var u=s.global;if(u){var l=s.unicode;s.lastIndex=0}for(var f=[];;){var h=Wd(s,a);if(null===h)break;if(f.push(h),!u)break;""===String(h[0])&&(s.lastIndex=Gd(a,jd(s.lastIndex),l))}for(var d,p="",g=0,v=0;v<f.length;v++){h=f[v];for(var y=String(h[0]),m=zd(Yd(Ud(h.index),a.length),0),k=[],b=1;b<h.length;b++)k.push(void 0===(d=h[b])?d:String(d));var w=h.groups;if(c){var C=[y].concat(k,m,a);void 0!==w&&C.push(w);var x=String(r.apply(void 0,C))}else x=Vd(y,a,m,k,w,r);m>=g&&(p+=a.slice(g,m)+x,g=m+y.length)}return p+a.slice(g)}]}),!!Fd((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!Xd||qd);var $d=r,Zd=Nl,Jd=Gl.trim;Xt({target:"String",proto:!0,forced:function(e){return $d((function(){return!!Zd[e]()||"​…᠎"!="​…᠎"[e]()||Zd[e].name!==e}))}("trim")},{trim:function(){return Jd(this)}});var Qd=Math.floor,ep=function(e,t){var n=e.length,i=Qd(n/2);return n<8?tp(e,t):np(ep(e.slice(0,i),t),ep(e.slice(i),t),t)},tp=function(e,t){for(var n,i,r=e.length,o=1;o<r;){for(i=o,n=e[o];i&&t(e[i-1],n)>0;)e[i]=e[--i];i!==o++&&(e[i]=n)}return e},np=function(e,t,n){for(var i=e.length,r=t.length,o=0,s=0,a=[];o<i||s<r;)o<i&&s<r?a.push(n(e[o],t[s])<=0?e[o++]:t[s++]):a.push(o<i?e[o++]:t[s++]);return a},ip=ep,rp=Vn.match(/firefox\/(\d+)/i),op=!!rp&&+rp[1],sp=/MSIE|Trident/.test(Vn),ap=Vn.match(/AppleWebKit\/(\d+)\./),cp=!!ap&&+ap[1],up=Xt,lp=qt,fp=_,hp=ot,dp=r,pp=ip,gp=qo,vp=op,yp=sp,mp=Xn,kp=cp,bp=[],wp=bp.sort,Cp=dp((function(){bp.sort(void 0)})),xp=dp((function(){bp.sort(null)})),_p=gp("sort"),Sp=!dp((function(){if(mp)return mp<70;if(!(vp&&vp>3)){if(yp)return!0;if(kp)return kp<603;var e,t,n,i,r="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:n=3;break;case 68:case 71:n=4;break;default:n=2}for(i=0;i<47;i++)bp.push({k:t+i,v:n})}for(bp.sort((function(e,t){return t.v-e.v})),i=0;i<bp.length;i++)t=bp[i].k.charAt(0),r.charAt(r.length-1)!==t&&(r+=t);return"DGBEFHACIJK"!==r}}));up({target:"Array",proto:!0,forced:Cp||!xp||!_p||!Sp},{sort:function(e){void 0!==e&&lp(e);var t=fp(this);if(Sp)return void 0===e?wp.call(t):wp.call(t,e);var n,i,r=[],o=hp(t.length);for(i=0;i<o;i++)i in t&&r.push(t[i]);for(n=(r=pp(r,function(e){return function(t,n){return void 0===n?-1:void 0===t?1:void 0!==e?+e(t,n)||0:String(t)>String(n)?1:-1}}(e))).length,i=0;i<n;)t[i]=r[i++];for(;i<o;)delete t[i++];return t}});var Tp="undefined"!=typeof window&&window.location&&window.location.href.indexOf("xgplayerdebugger=1")>-1,Ep={info:"color: #525252; background-color: #90ee90;",error:"color: #525252; background-color: red;",warn:"color: #525252; background-color: yellow; "},Pp="%c[xgplayer]",Rp={config:{debug:Tp?3:1},logInfo:function(e){for(var t,n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];this.config.debug>=3&&(t=console).log.apply(t,[Pp,Ep.info,e].concat(i))},logWarn:function(e){for(var t,n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];this.config.debug>=1&&(t=console).warn.apply(t,[Pp,Ep.warn,e].concat(i))},logError:function(e){var t;if(!(this.config.debug<1)){for(var n=this.config.debug>=2?"trace":"error",i=arguments.length,r=new Array(i>1?i-1:0),o=1;o<i;o++)r[o-1]=arguments[o];(t=console)[n].apply(t,[Pp,Ep.error,e].concat(r))}}};var Op=function(){function e(t){In(this,e),this.bufferedList=t}return uo(e,[{key:"start",value:function(e){return this.bufferedList[e].start}},{key:"end",value:function(e){return this.bufferedList[e].end}},{key:"length",get:function(){return this.bufferedList.length}}]),e}(),Ap={};function Lp(e,t){for(var n=0,i=t.length;n<i;n++)if(e.indexOf(t[n])>-1)return!0;return!1}function Ip(e){var t=Nn(e);return null!==e&&("object"===t||"function"===t)}function Dp(e,t,n){var i,r,o,s,a,c,u=0,l=!1,f=!1,h=!0,d=!t&&0!==t&&"function"==typeof window.requestAnimationFrame;if("function"!=typeof e)throw new TypeError("Expected a function");function p(t){var n=i,o=r;return i=r=void 0,u=t,s=e.apply(o,n)}function g(e,t){return d?(window.cancelAnimationFrame(a),window.requestAnimationFrame(e)):setTimeout(e,t)}function v(e){return u=e,a=g(m,t),l?p(e):s}function y(e){var n=e-c;return void 0===c||n>=t||n<0||f&&e-u>=o}function m(){var e=Date.now();if(y(e))return k(e);a=g(m,function(e){var n=e-u,i=t-(e-c);return f?Math.min(i,o-n):i}(e))}function k(e){return a=void 0,h&&i?p(e):(i=r=void 0,s)}function b(){for(var e=Date.now(),n=y(e),o=arguments.length,u=new Array(o),l=0;l<o;l++)u[l]=arguments[l];if(i=u,r=this,c=e,n){if(void 0===a)return v(c);if(f)return a=g(m,t),p(c)}return void 0===a&&(a=g(m,t)),s}return t=+t||0,Ip(n)&&(l=!!n.leading,o=(f="maxWait"in n)?Math.max(+n.maxWait||0,t):o,h="trailing"in n?!!n.trailing:h),b.cancel=function(){void 0!==a&&function(e){if(d)return window.cancelAnimationFrame(e);clearTimeout(e)}(a),u=0,i=c=r=a=void 0},b.flush=function(){return void 0===a?s:k(Date.now())},b.pending=function(){return void 0!==a},b}Ap.createDom=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"div",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=document.createElement(e);return r.className=i,r.innerHTML=t,Object.keys(n).forEach((function(t){var i=t,o=n[t];"video"===e||"audio"===e||"live-video"===e?o&&r.setAttribute(i,o):r.setAttribute(i,o)})),r},Ap.createDomFromHtml=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";try{var i=document.createElement("div");i.innerHTML=e;var r=i.children;return i=null,r.length>0?(r=r[0],n&&Ap.addClass(r,n),t&&Object.keys(t).forEach((function(e){r.setAttribute(e,t[e])})),r):null}catch(e){return Rp.logError("util.createDomFromHtml",e),null}},Ap.hasClass=function(e,t){if(!e||!t)return!1;try{return Array.prototype.some.call(e.classList,(function(e){return e===t}))}catch(i){var n=e.className&&"object"===Nn(e.className)?e.getAttribute("class"):e.className;return n&&!!n.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}},Ap.addClass=function(e,t){if(e&&t)try{t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach((function(t){t&&e.classList.add(t)}))}catch(n){Ap.hasClass(e,t)||(e.className&&"object"===Nn(e.className)?e.setAttribute("class",e.getAttribute("class")+" "+t):e.className+=" "+t)}},Ap.removeClass=function(e,t){if(e&&t)try{t.replace(/(^\s+|\s+$)/g,"").split(/\s+/g).forEach((function(t){t&&e.classList.remove(t)}))}catch(n){Ap.hasClass(e,t)&&t.split(/\s+/g).forEach((function(t){var n=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className&&"object"===Nn(e.className)?e.setAttribute("class",e.getAttribute("class").replace(n," ")):e.className=e.className.replace(n," ")}))}},Ap.toggleClass=function(e,t){e&&t.split(/\s+/g).forEach((function(t){Ap.hasClass(e,t)?Ap.removeClass(e,t):Ap.addClass(e,t)}))},Ap.classNames=function(){for(var e=arguments,t=[],n=function(n){"String"===Ap.typeOf(e[n])?t.push(e[n]):"Object"===Ap.typeOf(e[n])&&Object.keys(e[n]).map((function(i){e[n][i]&&t.push(i)}))},i=0;i<arguments.length;i++)n(i);return t.join(" ")},Ap.findDom=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,n=arguments.length>1?arguments[1]:void 0;try{e=t.querySelector(n)}catch(i){Rp.logError("util.findDom",i),0===n.indexOf("#")&&(e=t.getElementById(n.slice(1)))}return e},Ap.getCss=function(e,t){return e.currentStyle?e.currentStyle[t]:document.defaultView.getComputedStyle(e,!1)[t]},Ap.padStart=function(e,t,n){for(var i=String(n),r=t>>0,o=Math.ceil(r/i.length),s=[],a=String(e);o--;)s.push(i);return s.join("").substring(0,r-a.length)+a},Ap.format=function(e){if(window.isNaN(e))return"";e=Math.round(e);var t=Ap.padStart(Math.floor(e/3600),2,0),n=Ap.padStart(Math.floor((e-3600*t)/60),2,0),i=Ap.padStart(Math.floor(e-3600*t-60*n),2,0);return("00"===t?[n,i]:[t,n,i]).join(":")},Ap.event=function(e){if(e.touches){var t=e.touches[0]||e.changedTouches[0];e.clientX=t.clientX||0,e.clientY=t.clientY||0,e.offsetX=t.pageX-t.target.offsetLeft,e.offsetY=t.pageY-t.target.offsetTop}e._target=e.target||e.srcElement},Ap.typeOf=function(e){return Object.prototype.toString.call(e).match(/([^\s.*]+)(?=]$)/g)[0]},Ap.deepCopy=function(e,t){if("Object"===Ap.typeOf(t)&&"Object"===Ap.typeOf(e))return Object.keys(t).forEach((function(n){"Object"!==Ap.typeOf(t[n])||t[n]instanceof Node?"Array"===Ap.typeOf(t[n])?e[n]="Array"===Ap.typeOf(e[n])?e[n].concat(t[n]):t[n]:e[n]=t[n]:void 0===e[n]||void 0===e[n]?e[n]=t[n]:Ap.deepCopy(e[n],t[n])})),e},Ap.deepMerge=function(e,t){return Object.keys(t).map((function(n){var i;"Array"===Ap.typeOf(t[n])&&"Array"===Ap.typeOf(e[n])?"Array"===Ap.typeOf(e[n])&&(i=e[n]).push.apply(i,Uh(t[n])):Ap.typeOf(e[n])!==Ap.typeOf(t[n])||null===e[n]||"Object"!==Ap.typeOf(e[n])||t[n]instanceof window.Node?null!==t[n]&&(e[n]=t[n]):Ap.deepMerge(e[n],t[n])})),e},Ap.getBgImage=function(e){var t=(e.currentStyle||window.getComputedStyle(e,null)).backgroundImage;if(!t||"none"===t)return"";var n=document.createElement("a");return n.href=t.replace(/url\("|"\)/g,""),n.href},Ap.copyDom=function(e){if(e&&1===e.nodeType){var t=document.createElement(e.tagName);return Array.prototype.forEach.call(e.attributes,(function(e){t.setAttribute(e.name,e.value)})),e.innerHTML&&(t.innerHTML=e.innerHTML),t}return""},Ap.setInterval=function(e,t,n,i){e._interval[t]||(e._interval[t]=window.setInterval(n.bind(e),i))},Ap.clearInterval=function(e,t){clearInterval(e._interval[t]),e._interval[t]=null},Ap.setTimeout=function(e,t,n){e._timers||(e._timers=[]);var i=setTimeout((function(){t(),Ap.clearTimeout(e,i)}),n);return e._timers.push(i),i},Ap.clearTimeout=function(e,t){var n=e._timers;if("Array"===Ap.typeOf(n)){for(var i=0;i<n.length;i++)if(n[i]===t){n.splice(i,1),clearTimeout(t);break}}else clearTimeout(t)},Ap.clearAllTimers=function(e){var t=e._timers;"Array"===Ap.typeOf(t)&&(t.map((function(e){clearTimeout(e)})),e._timerIds=[])},Ap.createImgBtn=function(e,t,n,i){var r,o,s,a=Ap.createDom("xg-".concat(e),"",{},"xgplayer-".concat(e,"-img"));(a.style.backgroundImage='url("'.concat(t,'")'),n&&i)&&(["px","rem","em","pt","dp","vw","vh","vm","%"].every((function(e){return!(n.indexOf(e)>-1&&i.indexOf(e)>-1)||(r=parseFloat(n.slice(0,n.indexOf(e)).trim()),o=parseFloat(i.slice(0,i.indexOf(e)).trim()),s=e,!1)})),a.style.width="".concat(r).concat(s),a.style.height="".concat(o).concat(s),a.style.backgroundSize="".concat(r).concat(s," ").concat(o).concat(s),a.style.margin="start"===e?"-".concat(o/2).concat(s," auto auto -").concat(r/2).concat(s):"auto 5px auto 5px");return a},Ap.Hex2RGBA=function(e,t){var n=[];if(/^\#[0-9A-F]{3}$/i.test(e)){var i="#";e.replace(/[0-9A-F]/gi,(function(e){i+=e+e})),e=i}return/^#[0-9A-F]{6}$/i.test(e)?(e.replace(/[0-9A-F]{2}/gi,(function(e){n.push(parseInt(e,16))})),"rgba(".concat(n.join(","),", ").concat(t,")")):"rgba(255, 255, 255, 0.1)"},Ap.getFullScreenEl=function(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement},Ap.checkIsFunction=function(e){return e&&"function"==typeof e},Ap.checkIsObject=function(e){return null!==e&&"object"===Nn(e)},Ap.hide=function(e){e.style.display="none"},Ap.show=function(e,t){e.style.display=t||"block"},Ap.isUndefined=function(e){if(null==e)return!0},Ap.setStyleFromCsstext=function(e,t){t&&("String"===Ap.typeOf(t)?t.replace(/\s+/g,"").split(";").map((function(t){if(t){var n=t.split(":");n.length>1&&(e.style[n[0]]=n[1])}})):Object.keys(t).map((function(n){e.style[n]=t[n]})))},Ap.filterStyleFromText=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["width","height","top","left","bottom","right","position","z-index","padding","margin","transform"],n=e.style.cssText;if(!n)return{};var i=n.replace(/\s+/g,"").split(";"),r={},o={};return i.map((function(e){if(e){var n=e.split(":");n.length>1&&(Lp(n[0],t)?r[n[0]]=n[1]:o[n[0]]=n[1])}})),e.setAttribute("style",""),Object.keys(o).map((function(t){e.style[t]=o[t]})),r},Ap.getStyleFromCsstext=function(e){var t=e.style.cssText;if(!t)return{};var n=t.replace(/\s+/g,"").split(";"),i={};return n.map((function(e){if(e){var t=e.split(":");t.length>1&&(i[t[0]]=t[1])}})),i},Ap.preloadImg=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(e){var i=new window.Image;i.onload=function(e){i=null,t&&t(e)},i.onerror=function(e){i=null,n&&n(e)},i.src=e}},Ap.stopPropagation=function(e){e&&(e.stopPropagation(),e.cancelable&&e.preventDefault())},Ap.scrollTop=function(){return window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},Ap.scrollLeft=function(){return window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0},Ap.checkTouchSupport=function(){return"ontouchstart"in window},Ap.getBuffered2=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.5,n=[],i=0;i<e.length;i++)n.push({start:e.start(i)<.5?0:e.start(i),end:e.end(i)});n.sort((function(e,t){var n=e.start-t.start;return n||t.end-e.end}));var r=[];if(t)for(var o=0;o<n.length;o++){var s=r.length;if(s){var a=r[s-1].end;n[o].start-a<t?n[o].end>a&&(r[s-1].end=n[o].end):r.push(n[o])}else r.push(n[o])}else r=n;return new Op(r)},Ap.getEventPos=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return{x:e.x/t,y:e.y/t,clientX:e.clientX/t,clientY:e.clientY/t,offsetX:e.offsetX/t,offsetY:e.offsetY/t,pageX:e.pageX/t,pageY:e.pageY/t}},Ap.requestAnimationFrame=function(e){var t=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame;if(t)return t(e)},Ap.getHostFromUrl=function(e){if("String"!==Ap.typeOf(e))return"";var t=e.split("/"),n="";return t.length>3&&t[2]&&(n=t[2]),n},Ap.cancelAnimationFrame=function(e){var t=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.cancelRequestAnimationFrame;t&&t(e)},Ap.isMSE=function(e){return!!(e&&e instanceof HTMLMediaElement)&&(/^blob/.test(e.currentSrc)||/^blob/.test(e.src))},Ap.generateSessionId=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=(new Date).getTime();try{e=parseInt(e)}catch(t){e=0}t+=e,window.performance&&"function"==typeof window.performance.now&&(t+=parseInt(window.performance.now()));var n="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?n:3&n|8).toString(16)}));return n};var Mp=/(Android)\s([\d.]+)/,Np=/(Version)\/([\d.]+)/,Fp=["avc1.42E01E, mp4a.40.2","avc1.58A01E, mp4a.40.2","avc1.4D401E, mp4a.40.2","avc1.64001E, mp4a.40.2","avc1.42E01E","mp4v.20.8","avc1.42E01E, mp4a.40.2","avc1.58A01E, mp4a.40.2","avc1.4D401E, mp4a.40.2","avc1.64001E, mp4a.40.2","mp4v.20.8, mp4a.40.2","mp4v.20.240, mp4a.40.2"],Bp={get device(){return Bp.os.isPc?"pc":"mobile"},get browser(){if("undefined"==typeof navigator)return"";var e=navigator.userAgent.toLowerCase(),t={ie:/rv:([\d.]+)\) like gecko/,firefox:/firefox\/([\d.]+)/,chrome:/chrome\/([\d.]+)/,opera:/opera.([\d.]+)/,safari:/version\/([\d.]+).*safari/};return[].concat(Object.keys(t).filter((function(n){return t[n].test(e)})))[0]},get os(){if("undefined"==typeof navigator)return{};var e=navigator.userAgent,t=/(?:Windows Phone)/.test(e),n=/(?:SymbianOS)/.test(e)||t,i=/(?:Android)/.test(e),r=/(?:Firefox)/.test(e),o=/(?:iPad|PlayBook)/.test(e)||i&&!/(?:Mobile)/.test(e)||r&&/(?:Tablet)/.test(e),s=/(?:iPhone)/.test(e)&&!o,a=!(s||i||n||o),c=/(?:iPad|PlayBook)/.test(e);return{isTablet:o,isPhone:s,isIpad:c,isIos:s||c,isAndroid:i,isPc:a,isSymbian:n,isWindowsPhone:t,isFireFox:r}},get osVersion(){if("undefined"==typeof navigator)return 0;var e=navigator.userAgent,t="",n=(t=/(?:iPhone)|(?:iPad|PlayBook)/.test(e)?Np:Mp)?t.exec(e):[];if(n&&n.length>=3){var i=n[2].split(".");return i.length>0?parseInt(i[0]):0}return 0},get isWeixin(){if("undefined"==typeof navigator)return!1;return!!/(micromessenger)\/([\d.]+)/.exec(navigator.userAgent.toLocaleLowerCase())},isSupportMP4:function(){var e={isSupport:!1,mime:""};if("undefined"==typeof document)return e;if(this.supportResult)return this.supportResult;var t=document.createElement("video");return"function"==typeof t.canPlayType&&Fp.map((function(n){"probably"===t.canPlayType('video/mp4; codecs="'.concat(n,'"'))&&(e.isSupport=!0,e.mime+="||".concat(n))})),this.supportResult=e,t=null,e},isHevcSupported:function(){return!("undefined"==typeof MediaSource||!MediaSource.isTypeSupported)&&(MediaSource.isTypeSupported('video/mp4;codecs="hev1.1.6.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.2.4.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.3.E.L120.90"')||MediaSource.isTypeSupported('video/mp4;codecs="hev1.4.10.L120.90"'))},probeConfigSupported:function(e){var t={supported:!1,smooth:!1,powerEfficient:!1};if(!e||"undefined"==typeof navigator)return Promise.resolve(t);if(navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo)return navigator.mediaCapabilities.decodingInfo(e);var n=e.video||{},i=e.audio||{};try{var r=MediaSource.isTypeSupported(n.contentType),o=MediaSource.isTypeSupported(i.contentType);return Promise.resolve({supported:r&&o,smooth:!1,powerEfficient:!1})}catch(e){return Promise.resolve(t)}}},jp=JSON.parse('"3.0.0-codec.110-0"'),Up={1:"network",2:"network",3:"decoder",4:"format"},Hp=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{errorType:"",errorCode:0,errorMessage:"",originError:"",ext:{},mediaError:null,src:null};In(this,e);var i=t&&t.i18n?t.i18n.ERROR_TYPES:null;if(t.video){var r=n.mediaError?n.mediaError:t.video.error||{},o=t.duration,s=t.currentTime,a=t.ended,c=t.src,u=t.currentSrc,l=t.video,f=l.readyState,h=l.networkState,d={playerVersion:jp,domain:document.domain,currentTime:s,duration:o,ended:a,readyState:f,networkState:h,src:n.src||c||u,errorType:n.errorType,errorCode:n.errorCode||r.code,message:n.errorMessage||r.message,mediaError:r,originError:n.originError?n.originError.stack:"",host:Ap.getHostFromUrl(c||u)};return n.ext&&Object.keys(n.ext).map((function(e){d[e]=n.ext[e]})),d}if(arguments.length>1){for(var p={playerVersion:jp,domain:document.domain},g=["errorType","currentTime","duration","networkState","readyState","src","currentSrc","ended","errd","errorCode","mediaError"],v=0;v<arguments.length;v++)p[g[v]]=arguments[v];return p.ex=i?(i[arguments[0]]||{}).msg:"",p}},Gp="play",Vp="playing",Wp="ended",Kp="pause",zp="error",Yp="seeking",Xp="seeked",qp="timeupdate",$p="waiting",Zp="canplay",Jp="durationchange",Qp="volumechange",eg="loadeddata",tg="ratechange",ng="progress",ig="loadstart",rg="emptied",og="focus",sg="blur",ag="ready",cg="urlNull",ug="autoplay_started",lg="autoplay_was_prevented",fg="complete",hg="replay",dg="destroy",pg="urlchange",gg="download_speed_change",vg="fullscreen_change",yg="cssFullscreen_change",mg="mini_state_change",kg="definition_change",bg="after_definition_change",wg="video_resize",Cg="pip_change",xg="rotate",_g="screenShot",Sg="playnext",Tg="shortcut",Eg="xglog",Pg="user_action",Rg="reset",Og={STATS_INFO:"stats_info",STATS_DOWNLOAD:"stats_download",STATS_RESET:"stats_reset"},Ag=Object.freeze({__proto__:null,PLAY:Gp,PLAYING:Vp,ENDED:Wp,PAUSE:Kp,ERROR:zp,SEEKING:Yp,SEEKED:Xp,TIME_UPDATE:qp,WAITING:$p,CANPLAY:Zp,CANPLAY_THROUGH:"canplaythrough",DURATION_CHANGE:Jp,VOLUME_CHANGE:Qp,LOADED_DATA:eg,RATE_CHANGE:tg,PROGRESS:ng,LOAD_START:ig,EMPTIED:rg,STALLED:"stalled",SUSPEND:"suspend",ABORT:"abort",BUFFER_CHANGE:"bufferedChange",PLAYER_FOCUS:og,PLAYER_BLUR:sg,READY:ag,URL_NULL:cg,AUTOPLAY_STARTED:ug,AUTOPLAY_PREVENTED:lg,COMPLETE:fg,REPLAY:hg,DESTROY:dg,URL_CHANGE:pg,DOWNLOAD_SPEED_CHANGE:gg,FULLSCREEN_CHANGE:vg,CSS_FULLSCREEN_CHANGE:yg,MINI_STATE_CHANGE:mg,DEFINITION_CHANGE:kg,BEFORE_DEFINITION_CHANGE:"before_definition_change",AFTER_DEFINITION_CHANGE:bg,SEI_PARSED:"SEI_PARSED",RETRY:"retry",VIDEO_RESIZE:wg,PIP_CHANGE:Cg,ROTATE:xg,SCREEN_SHOT:_g,PLAYNEXT:Sg,SHORTCUT:Tg,XGLOG:Eg,USER_ACTION:Pg,RESET:Rg,SOURCE_ERROR:"source_error",SOURCE_SUCCESS:"source_success",STATS_EVENTS:Og});function Lg(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=jn(e);if(t){var r=jn(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Bn(this,n)}}var Ig=["play","playing","pause","ended","error","seeking","seeked","timeupdate","waiting","canplay","canplaythrough","durationchange","volumechange","loadeddata","loadstart","emptied","ratechange","progress","stalled","suspend","abort","lowdecode"];function Dg(e,t){this&&this.emit&&("error"===e?this.errorHandler(e,t.error):this.emit(e,t))}var Mg=function(e){Mn(n,e);var t=Lg(n);function n(e){var i;In(this,n),(i=t.call(this,e))._hasStart=!1,i._currentTime=0,i._duration=0,i._internalOp={},i._lastMuted=!1,i.vtype=e.vtype||"MP4",i._rate=-1,i.videoConfig=Object.assign({},{controls:!1,autoplay:e.autoplay,playsinline:e.playsinline,"x5-playsinline":e.playsinline,"webkit-playsinline":e.playsinline,"x5-video-player-fullscreen":e["x5-video-player-fullscreen"]||e.x5VideoPlayerFullscreen,"x5-video-orientation":e["x5-video-orientation"]||e.x5VideoOrientation,airplay:e.airplay,"webkit-airplay":e.airplay,tabindex:0|e.tabindex,mediaType:e.mediaType||"video"},e.videoConfig,e.videoAttributes);var r=e["x5-video-player-type"]||e.x5VideoPlayerType;return Bp.isWeixin&&Bp.os.isAndroid&&r&&(i.videoConfig["x5-video-player-type"]=r,delete i.videoConfig.playsinline,delete i.videoConfig["webkit-playsinline"],delete i.videoConfig["x5-playsinline"]),e.loop&&(i.videoConfig.loop="loop"),i.video=Ap.createDom(i.videoConfig.mediaType,"",i.videoConfig,""),e.defaultPlaybackRate&&(i.video.defaultPlaybackRate=i.video.playbackRate=e.defaultPlaybackRate),"Number"===Ap.typeOf(e.volume)&&(i.volume=e.volume),e.autoplayMuted&&(i.video.muted=!0,i._lastMuted=!0),e.autoplay&&(i.video.autoplay=!0),i._interval={},i.videoEventMiddleware={},i.attachVideoEvents(),i}return uo(n,[{key:"setEventsMiddleware",value:function(e){var t=this;Object.keys(e).map((function(n){t.videoEventMiddleware[n]=e[n]}))}},{key:"removeEventsMiddleware",value:function(e){var t=this;Object.keys(e).map((function(e){delete t.videoEventMiddleware[e]}))}},{key:"attachVideoEvents",value:function(e){var t=this;this.evHandlers||(this._evHandlers=Ig.map((function(e){return Un({},e,(i=t,r="on".concat((n=e).charAt(0).toUpperCase()).concat(n.slice(1)),i[r]&&"function"==typeof i[r]&&i.on(n,i[r]),function(e,t){var r=n,o={player:i,eventName:r,originalEvent:e,detail:e.detail||{},timeStamp:e.timeStamp,currentTime:i.currentTime,duration:i.duration,paused:i.paused,ended:i.ended,isInternalOp:!!i._internalOp[e.type],muted:i.muted,volume:i.volume,host:Ap.getHostFromUrl(i.currentSrc),vtype:i.vtype};if(i.removeInnerOP(e.type),"timeupdate"===r&&(i._currentTime=i.video&&i.video.currentTime),"ratechange"===r){var s=i.video?i.video.playbackRate:0;if(s&&i._rate===s)return;i._rate=i.video&&i.video.playbackRate}if("durationchange"===r&&(i._duration=i.video.duration),"volumechange"===r&&(o.isMutedChange=i._lastMuted!==i.muted,i._lastMuted=i.muted),"error"===r&&(o.error=t||i.video.error),i.videoEventMiddleware[n]){var a=Dg.bind(i,n,o);try{i.videoEventMiddleware[n].call(i,o,a)}catch(e){throw Dg.call(i,r,o),e}}else Dg.call(i,r,o)}));var n,i,r}))),e||(e=this.video),this._evHandlers.forEach((function(t){var n=Object.keys(t)[0];e.addEventListener(n,t[n],!1)}))}},{key:"detachVideoEvents",value:function(e){e||(e=this.video),this._evHandlers.map((function(t){var n=Object.keys(t)[0];e.removeEventListener(Object.keys(t)[0],t[n],!1)}))}},{key:"_attachSourceEvents",value:function(e,t){var n=this;e.removeAttribute("src"),e.removeEventListener("loadeddata",this._vLoadeddata),t.forEach((function(e){n.video.appendChild(Ap.createDom("source","",{src:"".concat(e.src),type:"".concat(e.type||"")}))}));var i=e.children;if(i){this._videoSourceCount=i.length,this._vLoadeddata=function(e){n.emit("source_success",{src:e.target.src,host:Ap.getHostFromUrl(e.target.src)})};for(var r=null,o=0;o<this._evHandlers.length;o++)if("error"===Object.keys(this._evHandlers[o])[0]){r=this._evHandlers[o];break}!this._sourceError&&(this._sourceError=function(e){if(n._videoSourceCount--,0===n._videoSourceCount){var t={code:4,message:"sources_load_error"};r?r.error(e,t):n.errorHandler("error",t)}var i=Up[4];n.emit("source_error",new Hp(n,{errorType:i,errorCode:4,errorMessage:"sources_load_error",mediaError:{code:4,message:"sources_load_error"},src:e.target.src}))});for(var s=0;s<i.length;s++)i[s].addEventListener("error",this._sourceError);e.addEventListener("loadeddata",this._vLoadeddata)}}},{key:"_detachSourceEvents",value:function(e){var t=e.children;if(t&&0!==t.length&&this._sourceError){for(var n=0;n<t.length;n++)t[n].removeEventListener("error",this._sourceError);for(;t.length>0;)e.removeChild(t[0])}}},{key:"errorHandler",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(this.video&&(this.video.error||t)){var n=this.video.error||t,i=n.code?Up[n.code]:"other";n.message;this.video.currentSrc||(n={code:6,message:"empty_src_".concat(n.message)}),this.emit(e,new Hp(this,{errorType:i,errorCode:n.code,errorMessage:n.message||"",mediaError:n}))}}},{key:"hasStart",get:function(){return this._hasStart},set:function(e){"boolean"==typeof e&&(this._hasStart=e,this.emit("hasstart"))}},{key:"destroy",value:function(){var e=this;for(var t in this.video&&(this.video.pause&&(this.video.pause(),this.video.muted=!0),this.video.removeAttribute("src"),this.video.load()),this._currentTime=0,this._duration=0,this._hasStart=!1,this.videoConfig=null,this._interval)Object.prototype.hasOwnProperty.call(this._interval,t)&&(clearInterval(this._interval[t]),this._interval[t]=null);this.detachVideoEvents(),this._evHandlers.map((function(t){var n=Object.keys(t)[0],i="on".concat(n.charAt(0).toUpperCase()).concat(n.slice(1));"function"==typeof e[i]&&e.off(n,e[i])})),this._evHandlers=null,this.video=null,this.videoEventMiddleware={},this.removeAllListeners()}},{key:"play",value:function(){return this.video?this.video.play():null}},{key:"pause",value:function(){this.video&&this.video.pause()}},{key:"load",value:function(){this.video&&this.video.load()}},{key:"canPlayType",value:function(e){return!!this.video&&this.video.canPlayType(e)}},{key:"getBufferedRange",value:function(e){var t=[0,0];if(!this.video)return t;e||(e=this.video.buffered);var n=this.video.currentTime;if(e)for(var i=0,r=e.length;i<r&&(t[0]=e.start(i),t[1]=e.end(i),!(t[0]<=n&&n<=t[1]));i++);return t[0]-n<=0&&n-t[1]<=0?t:[0,0]}},{key:"autoplay",get:function(){return!!this.video&&this.video.autoplay},set:function(e){this.video&&(this.video.autoplay=e)}},{key:"buffered",get:function(){return this.video?this.video.buffered:null}},{key:"buffered2",get:function(){return this.video?Ap.getBuffered2(this.video.buffered):null}},{key:"bufferedPoint",get:function(){var e={start:0,end:0};if(!this.video)return e;var t=this.video.buffered;if(!t||0===t.length)return e;for(var n=0;n<t.length;n++)if((t.start(n)<=this.currentTime||t.start(n)<.1)&&t.end(n)>=this.currentTime)return{start:t.start(n),end:t.end(n)};return e}},{key:"crossOrigin",get:function(){return this.video?this.video.crossOrigin:""},set:function(e){this.video&&(this.video.crossOrigin=e)}},{key:"currentSrc",get:function(){return this.video?this.video.currentSrc:""},set:function(e){this.video&&(this.video.currentSrc=e)}},{key:"currentTime",get:function(){return this.video?void 0!==this.video.currentTime?this.video.currentTime:this._currentTime:0},set:function(e){this.video&&(this.video.currentTime=e)}},{key:"defaultMuted",get:function(){return!!this.video&&this.video.defaultMuted},set:function(e){this.video&&(this.video.defaultMuted=e)}},{key:"duration",get:function(){return this._duration}},{key:"ended",get:function(){return!!this.video&&this.video.ended}},{key:"error",get:function(){if(!this.video||!this.video.error)return null;return["MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED"][this.video.error.code-1]}},{key:"loop",get:function(){return!!this.video&&this.video.loop},set:function(e){this.video&&(this.video.loop=e)}},{key:"muted",get:function(){return!!this.video&&this.video.muted},set:function(e){if(this.video&&this.video.muted!==e){this._lastMuted=this.video.muted;try{this.video.muted=e}catch(e){}}}},{key:"networkState",get:function(){return this.video?this.video.networkState:0}},{key:"paused",get:function(){return!this.video||this.video.paused}},{key:"playbackRate",get:function(){return this.video?this.video.playbackRate:0},set:function(e){this.video&&e!==1/0&&(this.video.defaultPlaybackRate=e,this.video.playbackRate=e)}},{key:"played",get:function(){return this.video?this.video.played:null}},{key:"preload",get:function(){return!!this.video&&this.video.preload},set:function(e){this.video&&(this.video.preload=e)}},{key:"readyState",get:function(){return this.video?this.video.readyState:0}},{key:"seekable",get:function(){return!!this.video&&this.video.seekable}},{key:"seeking",get:function(){return!!this.video&&this.video.seeking}},{key:"src",get:function(){return this.video?this.video.src:""},set:function(e){this.video&&(this.emit(pg,e),this.emit($p),this._currentTime=0,this._duration=0,/^blob/.test(this.video.currentSrc)||/^blob/.test(this.video.src)?this.onWaiting():(this._detachSourceEvents(this.video),"Array"===Ap.typeOf(e)?this._attachSourceEvents(this.video,e):e?this.video.src=e:this.video.removeAttribute("src"),this.load()))}},{key:"volume",get:function(){return this.video?this.video.volume:0},set:function(e){e!==1/0&&this.video&&(this.video.volume=e)}},{key:"addInnerOP",value:function(e){this._internalOp[e]=!0}},{key:"removeInnerOP",value:function(e){delete this._internalOp[e]}},{key:"emit",value:function(e,t){for(var i,r=arguments.length,o=new Array(r>2?r-2:0),s=2;s<r;s++)o[s-2]=arguments[s];(i=lo(jn(n.prototype),"emit",this)).call.apply(i,[this,e,t].concat(o))}},{key:"on",value:function(e,t){for(var i,r=arguments.length,o=new Array(r>2?r-2:0),s=2;s<r;s++)o[s-2]=arguments[s];(i=lo(jn(n.prototype),"on",this)).call.apply(i,[this,e,t].concat(o))}},{key:"once",value:function(e,t){for(var i,r=arguments.length,o=new Array(r>2?r-2:0),s=2;s<r;s++)o[s-2]=arguments[s];(i=lo(jn(n.prototype),"once",this)).call.apply(i,[this,e,t].concat(o))}},{key:"off",value:function(e,t){for(var i,r=arguments.length,o=new Array(r>2?r-2:0),s=2;s<r;s++)o[s-2]=arguments[s];(i=lo(jn(n.prototype),"off",this)).call.apply(i,[this,e,t].concat(o))}},{key:"offAll",value:function(){lo(jn(n.prototype),"removeAllListeners",this).call(this)}}]),n}(Bh),Ng=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{name:"xgplayer",version:1,db:null,ojstore:{name:"xg-m4a",keypath:"vid"}};In(this,e),this.indexedDB=window.indexedDB||window.webkitindexedDB,this.IDBKeyRange=window.IDBKeyRange||window.webkitIDBKeyRange,this.myDB=t}return uo(e,[{key:"openDB",value:function(e){var t=this,n=this,i=this.myDB.version||1,r=n.indexedDB.open(n.myDB.name,i);r.onerror=function(e){},r.onsuccess=function(i){t.myDB.db=i.target.result,e.call(n)},r.onupgradeneeded=function(e){var t=e.target.result;e.target.transaction,t.objectStoreNames.contains(n.myDB.ojstore.name)||t.createObjectStore(n.myDB.ojstore.name,{keyPath:n.myDB.ojstore.keypath})}}},{key:"deletedb",value:function(){this.indexedDB.deleteDatabase(this.myDB.name)}},{key:"closeDB",value:function(){this.myDB.db.close()}},{key:"addData",value:function(e,t){for(var n,i=this.myDB.db.transaction(e,"readwrite").objectStore(e),r=0;r<t.length;r++)(n=i.add(t[r])).onerror=function(){},n.onsuccess=function(){}}},{key:"putData",value:function(e,t){for(var n,i=this.myDB.db.transaction(e,"readwrite").objectStore(e),r=0;r<t.length;r++)(n=i.put(t[r])).onerror=function(){},n.onsuccess=function(){}}},{key:"getDataByKey",value:function(e,t,n){var i=this,r=this.myDB.db.transaction(e,"readwrite").objectStore(e).get(t);r.onerror=function(){n.call(i,null)},r.onsuccess=function(e){var t=e.target.result;n.call(i,t)}}},{key:"deleteData",value:function(e,t){this.myDB.db.transaction(e,"readwrite").objectStore(e).delete(t)}},{key:"clearData",value:function(e){this.myDB.db.transaction(e,"readwrite").objectStore(e).clear()}}]),e}(),Fg=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],Bg=["requestFullscreen","webkitRequestFullscreen","mozRequestFullScreen","msRequestFullscreen"],jg=["exitFullscreen","webkitExitFullscreen","mozCancelFullScreen","msExitFullscreen"],Ug="data-xgplayerid",Hg=Xt,Gg=ji.find,Vg=bf,Wg="find",Kg=!0;function zg(e,t,n){for(var i=arguments.length,r=new Array(i>3?i-3:0),o=3;o<i;o++)r[o-3]=arguments[o];var s=t.call.apply(t,[e].concat(r));n&&"function"==typeof n&&(s&&s.then?s.then((function(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];n.call.apply(n,[e].concat(i))})):n.call.apply(n,[e].concat(r)))}function Yg(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{pre:null,next:null};return this.__hooks||(this.__hooks={}),!this.__hooks[e]&&(this.__hooks[e]=null),function(){var i=arguments,r=this;if(n.pre)try{var o;(o=n.pre).call.apply(o,[this].concat(Array.prototype.slice.call(arguments)))}catch(t){throw t.message="[pluginName: ".concat(this.pluginName,":").concat(e,":pre error] >> ").concat(t.message),t}if(this.__hooks&&this.__hooks[e])try{var s,a=(s=this.__hooks[e]).call.apply(s,[this,this].concat(Array.prototype.slice.call(arguments)));a?a.then?a.then((function(e){!1!==e&&zg.apply(void 0,[r,t,n.next].concat(Uh(i)))})).catch((function(e){throw e})):zg.apply(void 0,[this,t,n.next].concat(Array.prototype.slice.call(arguments))):void 0===a&&zg.apply(void 0,[this,t,n.next].concat(Array.prototype.slice.call(arguments)))}catch(t){throw t.message="[pluginName: ".concat(this.pluginName,":").concat(e,"] >> ").concat(t.message),t}else zg.apply(void 0,[this,t,n.next].concat(Array.prototype.slice.call(arguments)))}.bind(this)}function Xg(e,t){var n=this.__hooks;if(n)return n.hasOwnProperty(e)?(n&&(n[e]=t),!0):(console.warn("has no supported hook which name [".concat(e,"]")),!1)}function qg(e,t){var n=this.__hooks;n&&delete n[e]}function $g(e){if(this.plugins&&this.plugins[e.toLowerCase()]){for(var t=this.plugins[e.toLowerCase()],n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return t.useHooks&&t.useHooks.apply(t,i)}}function Zg(e){if(this.plugins&&this.plugins[e.toLowerCase()]){var t=this.plugins[e.toLowerCase()];if(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return t.removeHooks&&t.removeHooks.apply(t,i)}}}function Jg(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];e.__hooks={},t&&t.map((function(t){e.__hooks[t]=null})),Object.defineProperty(e,"hooks",{get:function(){return e.__hooks&&Object.keys(e.__hooks).map((function(t){if(e.__hooks[t])return t}))}})}function Qg(e){e.__hooks=null}function ev(e,t,n){for(var i=arguments.length,r=new Array(i>3?i-3:0),o=3;o<i;o++)r[o-3]=arguments[o];if(!e.__hooks||!e.__hooks[t])return n.call.apply(n,[e,e].concat(r));var s,a=(s=e.__hooks[t]).call.apply(s,[e,e].concat(r));if(a&&a.then)a.then((function(t){return!1===t?null:n.call.apply(n,[e,e].concat(r))})).catch((function(e){console.warn("[runHooks]".concat(t," reject"),e.message)}));else if(!1!==a)return n.call.apply(n,[e,e].concat(r))}function tv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function nv(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?tv(Object(n),!0).forEach((function(t){Un(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tv(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function iv(e,t){Rp.logError("[".concat(e,"] event or callback cant be undefined or null when call ").concat(t))}Wg in[]&&Array(1).find((function(){Kg=!1})),Hg({target:"Array",proto:!0,forced:Kg},{find:function(e){return Gg(this,e,arguments.length>1?arguments[1]:void 0)}}),Vg(Wg);var rv=function(){function e(t){In(this,e),Ap.checkIsFunction(this.beforeCreate)&&this.beforeCreate(t),Jg(this),this.__args=t,this.__events={},this.config=t.config||{},this.player=null,this.playerConfig={},this.pluginName="",this.__init(t)}return uo(e,[{key:"beforeCreate",value:function(e){}},{key:"afterCreate",value:function(){}},{key:"beforePlayerInit",value:function(){}},{key:"onPluginsReady",value:function(){}},{key:"afterPlayerInit",value:function(){}},{key:"destroy",value:function(){}},{key:"__init",value:function(e){this.player=e.player,this.playerConfig=e.player&&e.player.config,this.pluginName=e.pluginName?e.pluginName.toLowerCase():this.constructor.pluginName.toLowerCase(),this.logger=e.player&&e.player.logger}},{key:"updateLang",value:function(e){}},{key:"lang",get:function(){return this.player.lang}},{key:"i18n",get:function(){return this.player.i18n}},{key:"i18nKeys",get:function(){return this.player.i18nKeys}},{key:"domEventType",get:function(){var e=Ap.checkTouchSupport()?"touch":"mouse",t=this.playerConfig?this.playerConfig.domEventType:"";return"touch"!==t&&"mouse"!==t&&"compatible"!==t||(e=t),e}},{key:"on",value:function(e,t){var n=this;e&&t&&this.player?"string"==typeof e?(this.__events[e]=t,this.player.on(e,t)):Array.isArray(e)&&e.forEach((function(e){n.__events[e]=t,n.player.on(e,t)})):iv(this.pluginName,"plugin.on(event, callback)")}},{key:"once",value:function(e,t){e&&t&&this.player?this.player.once(e,t):iv(this.pluginName,"plugin.once(event, callback)")}},{key:"off",value:function(e,t){var n=this;e&&t&&this.player?"string"==typeof e?(delete this.__events[e],this.player.off(e,t)):Array.isArray(e)&&e.forEach((function(i){delete n.__events[e],n.player.off(i,t)})):iv(this.pluginName,"plugin.off(event, callback)")}},{key:"offAll",value:function(){var e=this;Object.keys(this.__events).map((function(t){e.__events[t]&&e.off(t,e.__events[t]),t&&delete e.__events[t]})),this.__events={}}},{key:"emit",value:function(e){var t;if(this.player){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];(t=this.player).emit.apply(t,[e].concat(i))}}},{key:"emitUserAction",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this.player){var i=nv(nv({},n),{},{pluginName:this.pluginName});this.player.emitUserAction(e,t,i)}}},{key:"hook",value:function(e,t){return Yg.call.apply(Yg,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"useHooks",value:function(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];return Xg.call.apply(Xg,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removeHooks",value:function(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];return qg.call.apply(qg,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"registerPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(this.player)return n&&(t.pluginName=n),this.player.registerPlugin({plugin:e,options:t})}},{key:"getPlugin",value:function(e){return this.player?this.player.getPlugin(e):null}},{key:"__destroy",value:function(){var e=this,t=this.player,n=this.pluginName;this.offAll(),Ap.clearAllTimers(this),Ap.checkIsFunction(this.destroy)&&this.destroy(),["player","playerConfig","pluginName","logger","__args","__hooks"].map((function(t){e[t]=null})),t.unRegisterPlugin(n),Qg(this)}}],[{key:"defineGetterOrSetter",value:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&Object.defineProperty(e,n,t[n])}},{key:"defaultConfig",get:function(){return{}}},{key:"pluginName",get:function(){return"pluginName"}}]),e}();if("undefined"!=typeof Element&&!Element.prototype.matches){var ov=Element.prototype;ov.matches=ov.matchesSelector||ov.mozMatchesSelector||ov.msMatchesSelector||ov.oMatchesSelector||ov.webkitMatchesSelector}var sv=function(e,t){for(;e&&9!==e.nodeType;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}};function av(e,t,n,i,r){var o=cv.apply(this,arguments);return e.addEventListener(n,o,r),{destroy:function(){e.removeEventListener(n,o,r)}}}function cv(e,t,n,i){return function(n){n.delegateTarget=sv(n.target,t),n.delegateTarget&&i.call(e,n)}}var uv=function(e,t,n,i,r){return"function"==typeof e.addEventListener?av.apply(null,arguments):"function"==typeof n?av.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,(function(e){return av(e,t,n,i,r)})))};function lv(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=jn(e);if(t){var r=jn(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Bn(this,n)}}var fv={CONTROLS:"controls",ROOT:"root"},hv={ROOT:"root",ROOT_LEFT:"rootLeft",ROOT_RIGHT:"rootRight",ROOT_TOP:"rootTop",CONTROLS_LEFT:"controlsLeft",CONTROLS_RIGTH:"controlsRight",CONTROLS_RIGHT:"controlsRight",CONTROLS_CENTER:"controlsCenter",CONTROLS:"controls"};function dv(e){return!!e&&(e.indexOf&&/^(?:http|data:|\/)/.test(e))}function pv(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",o=null;if(e instanceof window.Element)return Ap.addClass(e,n),Object.keys(i).map((function(t){e.setAttribute(t,i[t])})),e;if(dv(e)||dv(e.url))return i.src=dv(e)?e:e.url||"",o=Ap.createDom(e.tag||"img","",i,"xg-img ".concat(n));if("function"==typeof e)try{return(o=e())instanceof window.Element?(Ap.addClass(o,n),Object.keys(i).map((function(e){o.setAttribute(e,i[e])})),o):(Rp.logWarn("warn>>icons.".concat(t," in config of plugin named [").concat(r,"] is a function mast return an Element Object")),null)}catch(e){return Rp.logError("Plugin named [".concat(r,"]:createIcon"),e),null}return"string"==typeof e?Ap.createDomFromHtml(e,i,n):(Rp.logWarn("warn>>icons.".concat(t," in config of plugin named [").concat(r,"] is invalid")),null)}function gv(e,t){var n=t.config.icons||t.playerConfig.icons;Object.keys(e).map((function(i){var r=e[i],o=r&&r.class?r.class:"",s=r&&r.attr?r.attr:{},a=null;n&&n[i]&&(o=function(e,t){return"object"===Nn(e)&&e.class&&"string"==typeof e.class?"".concat(t," ").concat(e.class):t}(n[i],o),s=function(e,t){return"object"===Nn(e)&&e.attr&&"object"===Nn(e.attr)&&Object.keys(e.attr).map((function(n){t[n]=e.attr[n]})),t}(n[i],s),a=pv(n[i],i,o,s,t.pluginName)),!a&&r&&(a=pv(r.icon?r.icon:r,s,o,{},t.pluginName)),t.icons[i]=a}))}var vv=function(e){Mn(n,e);var t=lv(n);function n(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return In(this,n),(e=t.call(this,i)).__delegates=[],e}return uo(n,[{key:"__init",value:function(e){if(lo(jn(n.prototype),"__init",this).call(this,e),e.root){var t=e.root,i=null;this.icons={},this.root=null,this.parent=null,gv(this.registerIcons()||{},this),this.langText={};var r,o,s=this.registerLanguageTexts()||{};r=s,o=this,Object.keys(r).map((function(e){Object.defineProperty(o.langText,e,{get:function(){var t=o.lang,n=o.i18n;return n[e]?n[e]:r[e]&&r[e][t]||""}})}));var a="";try{a=this.render()}catch(e){throw Rp.logError("Plugin:".concat(this.pluginName,":render"),e),new Error("Plugin:".concat(this.pluginName,":render:").concat(e.message))}if(a)(i=n.insert(a,t,e.index)).setAttribute("data-index",e.index);else{if(!e.tag)return;(i=Ap.createDom(e.tag,"",e.attr,e.name)).setAttribute("data-index",e.index),t.appendChild(i)}this.root=i,this.parent=t;var c=this.config.attr||{},u=this.config.style||{};this.setAttr(c),this.setStyle(u),this.config.index&&this.root.setAttribute("data-index",this.config.index),this.__registerChildren()}}},{key:"__registerChildren",value:function(){var e=this;if(this.root){this._children=[];var t=this.children();t&&"object"===Nn(t)&&Object.keys(t).length>0&&Object.keys(t).map((function(n){var i,r,o=n,s=t[o],a={root:e.root};"function"==typeof s?(i=e.config[o]||{},r=s):"object"===Nn(s)&&"function"==typeof s.plugin&&(i=s.options?Ap.deepCopy(e.config[o]||{},s.options):e.config[o]||{},r=s.plugin),a.config=i,void 0!==i.index&&(a.index=i.index),i.root&&(a.root=i.root),e.registerPlugin(r,a,o)}))}}},{key:"updateLang",value:function(e){e||(e=this.lang);var t=this.root,n=this.i18n,i=this.langText;t&&function e(t,n){for(var i=0;i<t.children.length;i++)t.children[i].children.length>0?e(t.children[i],n):n(t.children[i])}(t,(function(t){var r=t.getAttribute&&t.getAttribute("lang-key");if(r){var o=n[r.toUpperCase()]||i[r];o&&(t.innerHTML="function"==typeof o?o(e):o)}}))}},{key:"lang",get:function(){return this.player.lang}},{key:"changeLangTextKey",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=this.i18n||{},i=this.langText;e.setAttribute&&e.setAttribute("lang-key",t);var r=n[t]||i[t]||"";r&&(e.innerHTML=r)}},{key:"plugins",value:function(){return this._children}},{key:"children",value:function(){return{}}},{key:"registerPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";t.root=t.root||this.root;var r=lo(jn(n.prototype),"registerPlugin",this).call(this,e,t,i);return this._children.push(r),r}},{key:"registerIcons",value:function(){return{}}},{key:"registerLanguageTexts",value:function(){return{}}},{key:"find",value:function(e){if(this.root)return this.root.querySelector(e)}},{key:"bind",value:function(e,t,i){var r=this;if(arguments.length<3&&"function"==typeof t)Array.isArray(e)?e.forEach((function(e){r.bindEL(e,t)})):this.bindEL(e,t);else{var o=n.delegate.call(this,this.root,e,t,i);this.__delegates=this.__delegates.concat(o)}}},{key:"unbind",value:function(e,t){var n=this;if(arguments.length<3&&"function"==typeof t)Array.isArray(e)?e.forEach((function(e){n.unbindEL(e,t)})):this.unbindEL(e,t);else for(var i="".concat(e,"_").concat(t),r=0;r<this.__delegates.length;r++)if(this.__delegates[r].key===i){this.__delegates[r].destroy(),this.__delegates.splice(r,1);break}}},{key:"setStyle",value:function(e,t){var n=this;if(this.root)return"String"===Ap.typeOf(e)?this.root.style[e]=t:void("Object"===Ap.typeOf(e)&&Object.keys(e).map((function(t){n.root.style[t]=e[t]})))}},{key:"setAttr",value:function(e,t){var n=this;if(this.root)return"String"===Ap.typeOf(e)?this.root.setAttribute(e,t):void("Object"===Ap.typeOf(e)&&Object.keys(e).map((function(t){n.root.setAttribute(t,e[t])})))}},{key:"setHtml",value:function(e,t){this.root&&(this.root.innerHTML=e,"function"==typeof t&&t())}},{key:"bindEL",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.root&&"on".concat(e)in this.root&&"function"==typeof t&&this.root.addEventListener(e,t,n)}},{key:"unbindEL",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.root&&"on".concat(e)in this.root&&"function"==typeof t&&this.root.removeEventListener(e,t,n)}},{key:"show",value:function(e){if(this.root)return this.root.style.display=void 0!==e?e:"block","none"===window.getComputedStyle(this.root,null).getPropertyValue("display")?this.root.style.display="block":void 0}},{key:"hide",value:function(){this.root&&(this.root.style.display="none")}},{key:"appendChild",value:function(e,t){if(!this.root)return null;if(arguments.length<2&&arguments[0]instanceof window.Element)return this.root.appendChild(arguments[0]);if(!(t&&t instanceof window.Element))return null;try{return"string"==typeof e?this.find(e).appendChild(t):e.appendChild(t)}catch(e){return Rp.logError("Plugin:appendChild",e),null}}},{key:"render",value:function(){return""}},{key:"destroy",value:function(){}},{key:"__destroy",value:function(){var e=this,t=this.player;this.__delegates.map((function(e){e.destroy()})),this.__delegates=[],this._children instanceof Array&&(this._children.map((function(e){t.unRegisterPlugin(e.pluginName)})),this._children=null),this.root&&(this.root.hasOwnProperty("remove")?this.root.remove():this.root.parentNode&&this.root.parentNode.removeChild(this.root)),lo(jn(n.prototype),"__destroy",this).call(this),this.icons={},["root","parent"].map((function(t){e[t]=null}))}}],[{key:"insert",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=t.children.length,r=Number(n),o=e instanceof window.Node;if(i){for(var s=0,a=null,c="";s<i;s++){a=t.children[s];var u=Number(a.getAttribute("data-index"));if(u>=r){c="beforebegin";break}u<r&&(c="afterend")}return o?"afterend"===c?t.appendChild(e):t.insertBefore(e,a):a.insertAdjacentHTML(c,e),"afterend"===c?t.children[t.children.length-1]:t.children[s]}return o?t.appendChild(e):t.insertAdjacentHTML("beforeend",e),t.children[t.children.length-1]}},{key:"defaultConfig",get:function(){return{}}},{key:"delegate",value:function(e,t,n,i){var r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o=[];if(e instanceof window.Node&&"function"==typeof i)if(Array.isArray(n))n.forEach((function(n){var s=uv(e,t,n,i,r);s.key="".concat(t,"_").concat(n),o.push(s)}));else{var s=uv(e,t,n,i,r);s.key="".concat(t,"_").concat(n),o.push(s)}return o}},{key:"ROOT_TYPES",get:function(){return fv}},{key:"POSITIONS",get:function(){return hv}}]),n}(rv),yv=Ws.charAt,mv=je,kv=ih,bv="String Iterator",wv=mv.set,Cv=mv.getterFor(bv);kv(String,"String",(function(e){wv(this,{type:bv,string:String(e),index:0})}),(function(){var e,t=Cv(this),n=t.string,i=t.index;return i>=n.length?{value:void 0,done:!0}:(e=yv(n,i),t.index+=e.length,{value:e,done:!1})}));var xv=function(){function e(){var t=this;if(In(this,e),Un(this,"__trigger",(function(e){var n=(new Date).getTime();t.timeStamp=n;for(var i=0;i<e.length;i++)t.__runHandler(e[i].target)})),this.__handlers=[],this.timeStamp=0,this.observer=null,window.ResizeObserver)try{this.observer=new window.ResizeObserver(function(e,t,n){var i=!0,r=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return Ip(n)&&(i="leading"in n?!!n.leading:i,r="trailing"in n?!!n.trailing:r),Dp(e,t,{leading:i,trailing:r,maxWait:t})}(this.__trigger,100,{trailing:!0})),this.timeStamp=(new Date).getTime()}catch(e){console.error(e)}}return uo(e,[{key:"addObserver",value:function(e,t){if(this.observer){this.observer&&this.observer.observe(e);for(var n=e.getAttribute(Ug),i=this.__handlers,r=-1,o=0;o<i.length;o++)i[o]&&e===i[o].target&&(r=o);r>-1?this.__handlers[r].handler=t:this.__handlers.push({target:e,handler:t,playerId:n})}}},{key:"unObserver",value:function(e){var t=-1;this.__handlers.map((function(n,i){e===n.target&&(t=i)}));try{this.observer&&this.observer.unobserve(e)}catch(e){}this.observer&&this.observer.unobserve(e),t>-1&&this.__handlers.splice(t,1)}},{key:"destroyObserver",value:function(){this.observer&&this.observer.disconnect(),this.observer=null,this.__handlers=null}},{key:"__runHandler",value:function(e){for(var t=this.__handlers,n=0;n<t.length;n++)if(t[n]&&e===t[n].target){try{t[n].handler(e)}catch(e){console.error(e)}return!0}return!1}}]),e}(),_v=null;var Sv={pluginGroup:{},init:function(e){var t,n,i=e._pluginInfoId;i||(i=(new Date).getTime(),e._pluginInfoId=i),!e.config.closeResizeObserver&&(t=e.root,n=function(){e.getVideoSize()},_v||(_v=new xv),_v.addObserver(t,n)),0===Object.keys(this.pluginGroup).length&&(e.isUserActive=!0),this.pluginGroup[i]={_player:e,_originalOptions:e.config||{},_plugins:{}}},checkPlayerRoot:function(e){if(this.pluginGroup){for(var t=Object.keys(this.pluginGroup),n=0;n<t.length;n++){var i=this.pluginGroup[t[n]]._player;if(i.root===e)return i}return null}return null},formatPluginInfo:function(e,t){var n=null,i=null;return e.plugin&&"function"==typeof e.plugin?(n=e.plugin,i=e.options):(n=e,i={}),t&&(i.config=t||{}),{PLUFGIN:n,options:i}},checkPluginIfExits:function(e,t){for(var n=0;n<t.length;n++)if(e.toLowerCase()===t[n].pluginName.toLowerCase())return!0;return!1},getRootByConfig:function(e,t){for(var n=Object.keys(t),i=null,r=0;r<n.length;r++)if(e.toLowerCase()===n[r].toLowerCase()){i=t[n[r]];break}return"Object"===Ap.typeOf(i)?{root:i.root,position:i.position}:{}},lazyRegister:function(e,t){var n=this,i=t.timeout||1500;return Promise.race([t.loader().then((function(t){var i;i=t&&t.__esModule?t.default:t,n.register(e,i,t.options)})),new Promise((function(e,t){setTimeout((function(){t(new Error("timeout"))}),i)}))])},register:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e&&t&&"function"==typeof t&&void 0!==t.prototype){var i=e._pluginInfoId;if(i&&this.pluginGroup[i]){this.pluginGroup[i]._plugins||(this.pluginGroup[i]._plugins={});var r=this.pluginGroup[i]._plugins,o=this.pluginGroup[i]._originalOptions;n.player=this.pluginGroup[i]._player;var s=n.pluginName||t.pluginName;if(!s)throw new Error("The property pluginName is necessary");if(!t.isSupported||t.isSupported()){n.config||(n.config={});for(var a=Object.keys(o),c=0;c<a.length;c++)if(s.toLowerCase()===a[c].toLowerCase()){var u=o[a[c]];"Object"===Ap.typeOf(u)?n.config=Object.assign({},n.config,o[a[c]]):"Boolean"===Ap.typeOf(u)&&(n.config.disable=!u);break}t.defaultConfig&&Object.keys(t.defaultConfig).forEach((function(e){void 0===n.config[e]&&(n.config[e]=t.defaultConfig[e])})),n.root?"string"==typeof n.root&&(n.root=e[n.root]):n.root=e.root,n.index=n.config.index||0;try{r[s.toLowerCase()]&&(this.unRegister(i,s.toLowerCase()),console.warn("the is one plugin with same pluginName [".concat(s,"] exist, destroy the old instance")));var l=new t(n);return r[s.toLowerCase()]=l,r[s.toLowerCase()].func=t,l&&"function"==typeof l.afterCreate&&l.afterCreate(),l}catch(e){throw console.error(e),e}}else console.warn("not supported plugin [".concat(s,"]"))}}},unRegister:function(e,t){e._pluginInfoId&&(e=e._pluginInfoId),t=t.toLowerCase();try{var n=this.pluginGroup[e]._plugins[t];n&&(n.pluginName&&n.__destroy(),delete this.pluginGroup[e]._plugins[t])}catch(n){console.error("[unRegister:".concat(t,"] cgid:[").concat(e,"] error"),n)}},deletePlugin:function(e,t){var n=e._pluginInfoId;n&&this.pluginGroup[n]&&this.pluginGroup[n]._plugins&&delete this.pluginGroup[n]._plugins[t]},getPlugins:function(e){var t=e._pluginInfoId;return t&&this.pluginGroup[t]?this.pluginGroup[t]._plugins:{}},findPlugin:function(e,t){var n=e._pluginInfoId;if(!n||!this.pluginGroup[n])return null;var i=t.toLowerCase();return this.pluginGroup[n]._plugins[i]},beforeInit:function(e){var t=this;function n(e){return e&&e.then?e:new Promise((function(e){e()}))}return new Promise((function(i){if(t.pluginGroup)return(e._loadingPlugins&&e._loadingPlugins.length?Promise.all(e._loadingPlugins):Promise.resolve()).then((function(){var r=e._pluginInfoId;if(t.pluginGroup[r]){var o=t.pluginGroup[r]._plugins,s=[];Object.keys(o).forEach((function(e){if(o[e]&&o[e].beforePlayerInit)try{var t=o[e].beforePlayerInit();s.push(n(t))}catch(e){throw s.push(n(null)),e}})),Promise.all([].concat(s)).then((function(){i()})).catch((function(e){console.error(e),i()}))}else i()}))}))},afterInit:function(e){var t=e._pluginInfoId;if(t&&this.pluginGroup[t]){var n=this.pluginGroup[t]._plugins;Object.keys(n).forEach((function(e){n[e]&&n[e].afterPlayerInit&&n[e].afterPlayerInit()}))}},setLang:function(e,t){var n=t._pluginInfoId;if(n&&this.pluginGroup[n]){var i=this.pluginGroup[n]._plugins;Object.keys(i).forEach((function(t){if(i[t].updateLang)i[t].updateLang(e);else try{i[t].lang=e}catch(e){console.warn("".concat(t," setLang"))}}))}},reRender:function(e){var t=this,n=e._pluginInfoId;if(n&&this.pluginGroup[n]){var i=[],r=this.pluginGroup[n]._plugins;Object.keys(r).forEach((function(e){"controls"!==e&&r[e]&&(i.push({plugin:r[e].func,options:r[e].__args}),t.unRegister(n,e))})),i.forEach((function(n){t.register(e,n.plugin,n.options)}))}},onPluginsReady:function(e){var t=e._pluginInfoId;if(t&&this.pluginGroup[t]){var n=this.pluginGroup[t]._plugins||{};Object.keys(n).forEach((function(e){n[e].onPluginsReady&&"function"==typeof n[e].onPluginsReady&&n[e].onPluginsReady()}))}},setCurrentUserActive:function(e,t){if(this.pluginGroup[e]){if(!t)return this.pluginGroup[e]._player.isUserActive=t,e;for(var n=Object.keys(this.pluginGroup),i=0;i<n.length;i++){var r=this.pluginGroup[n[i]];r&&r._player&&(this.pluginGroup[n[i]]._player.isUserActive=!1)}return this.pluginGroup[e]._player.isUserActive=t,e}},getCurrentUseActiveId:function(){if(this.pluginGroup){for(var e=Object.keys(this.pluginGroup),t=0;t<e.length;t++){var n=this.pluginGroup[e[t]];if(n&&n._player&&n._player.isUserActive)return e[t]}return null}},destroy:function(e){var t=e._pluginInfoId;if(this.pluginGroup[t]){var n,i;n=e.root,_v.unObserver(n,i);for(var r=this.pluginGroup[t]._plugins,o=0,s=Object.keys(r);o<s.length;o++){var a=s[o];this.unRegister(t,a)}var c=e.isUseActive;if(delete this.pluginGroup[t],delete e._pluginInfoId,c){var u=Object.keys(this.pluginGroup);u.length>0&&this.setCurrentUserActive(u[u.length-1],!0)}}}},Tv={DEFAULT:"xgplayer",DEFAULT_SKIN:"xgplayer-skin-default",ENTER:"xgplayer-is-enter",PAUSED:"xgplayer-pause",PLAYING:"xgplayer-playing",ENDED:"xgplayer-ended",CANPLAY:"xgplayer-canplay",LOADING:"xgplayer-isloading",ERROR:"xgplayer-is-error",REPLAY:"xgplayer-replay",NO_START:"xgplayer-nostart",ACTIVE:"xgplayer-inactive",FULLSCREEN:"xgplayer-is-fullscreen",CSS_FULLSCREEN:"xgplayer-is-cssfullscreen",PARENT_FULLSCREEN:"xgplayer-fullscreen-parent",ROTATE_FULLSCREEN:"xgplayer-rotate-fullscreen",PARENT_ROTATE_FULLSCREEN:"xgplayer-rotate-parent",INNER_FULLSCREEN:"xgplayer-inner-fullscreen",NO_CONTROLS:"no-controls",FLEX_CONTROLS:"flex-controls",CONTROLS_FOLLOW:"controls-follow",AUTOHIDE:"xgplayer_autohide",NOT_ALLOW_AUTOPLAY:"not-allow-autoplay",SEEKING:"seeking",PC:"xgplayer-pc",MOBILE:"xgplayer-mobile",MINI:"xgplayer-mini"};function Ev(){return{id:"",el:null,url:"",domEventType:"default",nullUrlStart:!1,width:600,height:337.5,fluid:!1,fitVideoSize:"fixed",videoFillMode:"auto",volume:.6,autoplay:!1,autoplayMuted:!1,loop:!1,isLive:!1,zoom:1,videoInit:!0,poster:"",isMobileSimulateMode:!1,defaultPlaybackRate:1,execBeforePluginsCall:null,allowSeekAfterEnded:!0,enableContextmenu:!0,closeVideoClick:!1,closeVideoDblclick:!1,closePlayerBlur:!1,closeDelayBlur:!1,leavePlayerTime:3e3,closePlayVideoFocus:!1,closePauseVideoFocus:!1,closeFocusVideoFocus:!0,closeControlsBlur:!0,topBarAutoHide:!0,videoAttributes:{},startTime:0,seekedStatus:"play",miniprogress:!1,disableSwipeHandler:function(){},enableSwipeHandler:function(){},ignores:[],whitelist:[],inactive:3e3,lang:(e=(document.documentElement.getAttribute("lang")||navigator.language||"zh-cn").toLocaleLowerCase(),"zh-cn"===e&&(e="zh"),e),controls:!0,marginControls:!1,fullscreenTarget:null,screenShot:!1,rotate:!1,pip:!1,download:!1,mini:!1,cssFullscreen:!0,keyShortcut:!0,presets:[],plugins:[],playbackRate:1,definition:{list:[]},playsinline:!0,customDuration:0,timeOffset:0,icons:{},i18n:[],tabindex:0,thumbnail:null,videoConfig:{},commonStyle:{progressColor:"",playedColor:"",cachedColor:"",sliderBtnStyle:{},volumeColor:""}};var e}function Pv(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=jn(e);if(t){var r=jn(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Bn(this,n)}}var Rv=function(e){Mn(n,e);var t=Pv(n);function n(){var e;In(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Un(Fn(e=t.call.apply(t,[this].concat(r))),"onMouseEnter",(function(t){var n=Fn(e),i=n.player;n.playerConfig.closeControlsBlur&&i.focus({autoHide:!1})})),Un(Fn(e),"onMouseLeave",(function(){Fn(e).player.focus()})),e}return uo(n,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.controls&&(e.config.disable=!e.player.config.controls),e.config.mode||"mobile"!==Bp.device||(e.config.mode="flex"),e.player.config.marginControls&&(e.config.autoHide=!1)}},{key:"afterCreate",value:function(){var e=this,t=this.config,n=t.disable,i=t.height,r=t.mode,o=t.autoHide;if(!n){"flex"===r&&this.player.addClass(Tv.FLEX_CONTROLS),o&&this.player.addClass(Tv.AUTOHIDE);var s={height:"".concat(i,"px")};Object.keys(s).map((function(t){e.root.style[t]=s[t]})),this.left=this.find("xg-left-grid"),this.center=this.find("xg-center-grid"),this.right=this.find("xg-right-grid"),this.innerRoot=this.find("xg-inner-controls"),this.on(mg,(function(t){t?Ap.addClass(e.root,"mini-controls"):Ap.removeClass(e.root,"mini-controls")}));var a=this.playerConfig.isMobileSimulateMode;"mobile"!==Bp.device&&"mobile"!==a&&(this.bind("mouseenter",this.onMouseEnter),this.bind("mouseleave",this.onMouseLeave))}}},{key:"focus",value:function(){this.player.focus({autoHide:!1})}},{key:"unFocus",value:function(){this.player.focus({autoHide:!0})}},{key:"blur",value:function(){this.player.blur({ignorePaused:!0})}},{key:"recoverAutoHide",value:function(){this.config.autoHide&&Ap.addClass(this.root,"control_autohide")}},{key:"pauseAutoHide",value:function(){Ap.removeClass(this.root,"control_autohide")}},{key:"show",value:function(){Ap.addClass(this.root,"show")}},{key:"hide",value:function(){Ap.removeClass(this.root,"show")}},{key:"mode",get:function(){return this.config.mode}},{key:"registerPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;if(this.root){var r=e.defaultConfig||{};if(!t.root){var o=t.position?t.position:t.config&&t.config.position?t.config.position:r.position;switch(o){case hv.CONTROLS_LEFT:t.root=this.left;break;case hv.CONTROLS_RIGHT:t.root=this.right;break;case hv.CONTROLS_CENTER:t.root=this.center;break;case hv.CONTROLS:t.root=this.root;break;default:t.root=this.left}return lo(jn(n.prototype),"registerPlugin",this).call(this,e,t,i)}}}},{key:"destroy",value:function(){"mobile"!==Bp.device&&(this.unbind("mouseenter",this.onMouseEnter),this.unbind("mouseleave",this.onMouseLeave))}},{key:"render",value:function(){var e=this.config,t=e.mode,n=e.autoHide,i=e.initShow;if(!e.disable){var r=Ap.classNames({"xgplayer-controls":!0},{"flex-controls":"flex"===t},{"bottom-controls":"bottom"===t},{control_autohide:n},{controls_permanent:!n},{"xgplayer-controls-initshow":i||!n});return'<xg-controls class="'.concat(r,'" unselectable="on" onselectstart="return false">\n <xg-inner-controls class="xg-inner-controls xg-pos">\n <xg-left-grid class="xg-left-grid">\n </xg-left-grid>\n <xg-center-grid class="xg-center-grid"></xg-center-grid>\n <xg-right-grid class="xg-right-grid">\n </xg-right-grid>\n </xg-inner-controls>\n </xg-controls>')}}}],[{key:"pluginName",get:function(){return"controls"}},{key:"defaultConfig",get:function(){return{disable:!1,autoHide:!0,mode:"",initShow:!1}}}]),n}(vv),Ov={lang:{},langKeys:[],textKeys:[]};function Av(e,t){return Object.keys(t).forEach((function(n){var i,r=Ap.typeOf(t[n]),o=Ap.typeOf(e[n]);"Array"===r?("Array"!==o&&(e[n]=[]),(i=e[n]).push.apply(i,Uh(t[n]))):"Object"===r?("Object"!==o&&(e[n]={}),Av(e[n],t[n])):e[n]=t[n]})),e}function Lv(){Object.keys(Ov.lang.en).map((function(e){Ov.textKeys[e]=e}))}function Iv(e,t){var n=e.LANG;if(t||(t=Ov),t.lang){var i=e.TEXT||{};"zh"===n&&(n="zh-cn"),t.lang[n]?Av(t.lang[n],i):(t.langKeys.push(n),t.lang[n]=i),Lv()}}Iv({LANG:"en",TEXT:{ERROR_TYPES:{network:{code:1,msg:"video download error"},mse:{code:2,msg:"stream append error"},parse:{code:3,msg:"parsing error"},format:{code:4,msg:"wrong format"},decoder:{code:5,msg:"decoding error"},runtime:{code:6,msg:"grammatical errors"},timeout:{code:7,msg:"play timeout"},other:{code:8,msg:"other errors"}},HAVE_NOTHING:"There is no information on whether audio/video is ready",HAVE_METADATA:"Audio/video metadata is ready ",HAVE_CURRENT_DATA:"Data about the current play location is available, but there is not enough data to play the next frame/millisecond",HAVE_FUTURE_DATA:"Current and at least one frame of data is available",HAVE_ENOUGH_DATA:"The available data is sufficient to start playing",NETWORK_EMPTY:"Audio/video has not been initialized",NETWORK_IDLE:"Audio/video is active and has been selected for resources, but no network is used",NETWORK_LOADING:"The browser is downloading the data",NETWORK_NO_SOURCE:"No audio/video source was found",MEDIA_ERR_ABORTED:"The fetch process is aborted by the user",MEDIA_ERR_NETWORK:"An error occurred while downloading",MEDIA_ERR_DECODE:"An error occurred while decoding",MEDIA_ERR_SRC_NOT_SUPPORTED:"Audio/video is not supported",REPLAY:"Replay",ERROR:"Network is offline",PLAY_TIPS:"Play",PAUSE_TIPS:"Pause",PLAYNEXT_TIPS:"Play next",DOWNLOAD_TIPS:"Download",ROTATE_TIPS:"Rotate",RELOAD_TIPS:"Reload",FULLSCREEN_TIPS:"Fullscreen",EXITFULLSCREEN_TIPS:"Exit fullscreen",CSSFULLSCREEN_TIPS:"Cssfullscreen",EXITCSSFULLSCREEN_TIPS:"Exit cssfullscreen",TEXTTRACK:"Caption",PIP:"PIP",SCREENSHOT:"Screenshot",LIVE:"LIVE",OFF:"Off",OPEN:"Open",MINI_DRAG:"Click and hold to drag",MINISCREEN:"Miniscreen",REFRESH_TIPS:"Please Try",REFRESH:"Refresh",FORWARD:"forward",LIVE_TIP:"Live"}});var Dv={get textKeys(){return Ov.textKeys},get langKeys(){return Ov.langKeys},get lang(){var e={};return Ov.langKeys.map((function(t){e[t]=Ov.lang[t]})),Ov.lang["zh-cn"]&&(e.zh=Ov.lang["zh-cn"]||{}),e},extend:function(e,t){var n=[];if(t||(t=Ov),t.lang){n="Array"!==Ap.typeOf(e)?Object.keys(e).map((function(t){return{LANG:"zh"===t?"zh-cn":t,TEXT:e[t]}})):e;var i=t.lang;n.map((function(e){"zh"===e.LANG&&(e.LANG="zh-cn"),i[e.LANG]?Av(i[e.LANG]||{},e.TEXT||{}):Iv(e,t)})),Lv()}},use:Iv,init:function(e){var t,n={lang:{},langKeys:[],textKeys:{},pId:e};return Av(n.lang,Ov.lang),(t=n.langKeys).push.apply(t,Uh(Ov.langKeys)),Av(n.textKeys,Ov.textKeys),n}};function Mv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Nv(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Mv(Object(n),!0).forEach((function(t){Un(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Mv(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Fv(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=jn(e);if(t){var r=jn(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Bn(this,n)}}var Bv=["play","pause","replay","retry","playnext"],jv=0,Uv=0,Hv=function(e){Mn(n,e);var t=Fv(n);function n(e){var i;In(this,n);var r,o=Ap.deepMerge(Ev(),e);Un(Fn(i=t.call(this,o)),"canPlayFunc",(function(){if(i.config){var e=i.config,t=e.autoplay,n=e.startTime,r=e.defaultPlaybackRate;Rp.logInfo("player","canPlayFunc, startTime",n),n&&(i.currentTime=n>i.duration?i.duration:n,i.config.startTime=0),i.playbackRate=r,t&&i.videoPlay(),i.off(Zp,i.canPlayFunc),i.removeClass(Tv.ENTER)}})),Un(Fn(i),"onFullscreenChange",(function(e,t){var n=function(){Ap.setTimeout(Fn(i),(function(){i.getVideoSize()}),100)},r=Ap.getFullScreenEl();i._fullActionFrom?i._fullActionFrom="":i.emit(Pg,{eventType:"system",action:"switch_fullscreen",pluginName:"player",currentTime:i.currentTime,duration:i.duration,props:[{prop:"fullscreen",from:!0,to:!1}]});var o=function(e,t,n){if(e){var i=e.getAttribute(n);return!(!i||i!==t||"VIDEO"!==e.tagName&&"AUDIO"!==e.tagName)}}(r,i.playerId,Ug);if(t||r&&(r===i._fullscreenEl||o))n(),!i.config.closeFocusVideoFocus&&i.video.focus(),i.fullscreen=!0,i.changeFullStyle(i.root,r,Tv.FULLSCREEN),i.emit(vg,!0,i._fullScreenOffset),i.cssfullscreen&&i.exitCssFullscreen();else if(i.fullscreen){n();var s=Fn(i),a=s._fullScreenOffset;s.config.needFullscreenScroll?(window.scrollTo(a.left,a.top),Ap.setTimeout(Fn(i),(function(){i.fullscreen=!1,i._fullScreenOffset=null}),100)):(!i.config.closeFocusVideoFocus&&i.video.focus(),i.fullscreen=!1,i._fullScreenOffset=null),i.cssfullscreen?i.removeClass(Tv.FULLSCREEN):i.recoverFullStyle(i.root,i._fullscreenEl,Tv.FULLSCREEN),i._fullscreenEl=null,i.emit(vg,!1)}})),Un(Fn(i),"_onWebkitbeginfullscreen",(function(e){i._fullscreenEl=i.video,i.onFullscreenChange(e,!0)})),Un(Fn(i),"_onWebkitendfullscreen",(function(e){i.onFullscreenChange(e,!1)})),Jg(Fn(i),Bv),i.config=o,i._pluginInfoId=Ap.generateSessionId(),(r=Fn(i)).logInfo=Rp.logInfo.bind(r),r.logWarn=Rp.logWarn.bind(r),r.logError=Rp.logError.bind(r);var s=i.constructor.defaultPreset;if(i.config.presets.length){var a=i.config.presets.indexOf("default");a>=0&&s&&(i.config.presets[a]=s)}else s&&i.config.presets.push(s);return i.userTimer=null,i.waitTimer=null,i.isReady=!1,i.isPlaying=!1,i.isError=!1,i.isSeeking=!1,i.isCanplay=!1,i._runPending=!1,i.rotateDeg=0,i.isActive=!1,i.isCssfullScreen=!1,i.fullscreen=!1,i._fullscreenEl=null,i._cssfullscreenEl=null,i.curDefinition=null,i._orgCss="",i._fullScreenOffset=null,i._videoHeight=0,i._videoWidth=0,i._accPlayed={t:0,acc:0,loopAcc:0},i.innerContainer=null,i.controls=null,i.topBar=null,i.topBar=null,i.root=null,i.__i18n=Dv.init(),Bp.os.isAndroid&&Bp.osVersion>0&&Bp.osVersion<6&&(i.config.autoplay=!1),i.database=new Ng,i.isUserActive=!1,i._initDOM()?(i._bindEvents(),i._registerPresets(),i._registerPlugins(),Sv.onPluginsReady(Fn(i)),Ap.setTimeout(Fn(i),(function(){i.emit(ag),i.onReady&&i.onReady(),i.isReady=!0}),0),i.getInitDefinition(),(i.config.videoInit||i.config.autoplay)&&(i.hasStart||i.start()),i):(console.error(new Error("can't find the dom which id is ".concat(i.config.id," or this.config.el does not exist"))),Bn(i))}return uo(n,[{key:"_initDOM",value:function(){var e=this;if(this.root=this.config.id?document.getElementById(this.config.id):null,!this.root){var t=this.config.el;if(!t||1!==t.nodeType)return this.emit(zp,new Hp("use",this.config.vid,{line:32,handle:"Constructor",msg:"container id can't be empty"})),console.error("this.confg.id or this.config.el can't be empty"),!1;this.root=t}var n=Sv.checkPlayerRoot(this.root);n&&(Rp.logWarn("The is an Player instance already exists in this.root, destroy it and reinitialize"),n.destroy()),this.root.setAttribute(Ug,this.playerId),Sv.init(this),this._initBaseDoms();var i=this.constructor.XgVideoProxy;if(i&&this.videoConfig.mediaType===i.mediaType){var r=this.innerContainer||this.root;this.detachVideoEvents(this.video);var o=new i(r,this.config,this.videoConfig);this.attachVideoEvents(o),this.video=o}if(this.video.setAttribute(Ug,this.playerId),this.config.controls){var s=Sv.register(this,Rv);this.controls=s}var a="mobile"===this.config.isMobileSimulateMode?"mobile":Bp.device;if(this.addClass("".concat(Tv.DEFAULT," ").concat(Tv.ACTIVE," xgplayer-").concat(a," ").concat(this.config.controls?"":Tv.NO_CONTROLS)),this.config.autoplay?this.addClass(Tv.ENTER):this.addClass(Tv.NO_START),this.config.fluid){var c={"max-width":"100%",width:"100%",height:"0","padding-top":"".concat(100*this.config.height/this.config.width,"%"),position:"position",top:"0",left:"0"};Object.keys(c).map((function(t){e.root.style[t]=c[t]}))}else["width","height"].map((function(t){e.config[t]&&("number"!=typeof e.config[t]?e.root.style[t]=e.config[t]:e.root.style[t]="".concat(e.config[t],"px"))}));return!0}},{key:"_initBaseDoms",value:function(){this.topBar=Ap.createDom("xg-bar","",{"data-index":-1},"xg-top-bar"),this.leftBar=Ap.createDom("xg-bar","",{"data-index":-1},"xg-left-bar"),this.rightBar=Ap.createDom("xg-bar","",{"data-index":-1},"xg-right-bar"),this.config.marginControls&&(this.innerContainer=Ap.createDom("xg-video-container","",{"data-index":-1},"xg-video-container"),this.root.appendChild(this.innerContainer)),this.root.appendChild(this.topBar),this.root.appendChild(this.leftBar),this.root.appendChild(this.rightBar)}},{key:"_bindEvents",value:function(){var e=this;["focus","blur"].forEach((function(t){e.on(t,e["on"+t.charAt(0).toUpperCase()+t.slice(1)])})),Fg.forEach((function(t){document&&document.addEventListener(t,e.onFullscreenChange)})),Bp.os.isIos&&(this.video.addEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.video.addEventListener("webkitendfullscreen",this._onWebkitendfullscreen)),this.once("loadeddata",this.getVideoSize),this.playFunc=function(){e.config.closeFocusVideoFocus||e.video.focus()},this.once("play",this.playFunc)}},{key:"_unbindEvents",value:function(){var e=this;this.root.removeEventListener("mousemove",this.mousemoveFunc),Fg.forEach((function(t){document.removeEventListener(t,e.onFullscreenChange)})),this.playFunc&&this.off("play",this.playFunc),this.off("canplay",this.canPlayFunc),this.video.removeEventListener("webkitbeginfullscreen",this._onWebkitbeginfullscreen),this.video.removeEventListener("webkitendfullscreen",this._onWebkitendfullscreen)}},{key:"_startInit",value:function(e){var t=this;if(this.video&&(e&&""!==e&&("Array"!==Ap.typeOf(e)||0!==e.length)||(e="",this.emit(cg),Rp.logWarn("config.url is null, please get url and run player._startInit(url)"),!this.config.nullUrlStart))){this._detachSourceEvents(this.video),"Array"===Ap.typeOf(e)&&e.length>0?this._attachSourceEvents(this.video,e):this.video.src&&this.video.src===e?e||this.video.removeAttribute("src"):this.video.src=e,"Number"===Ap.typeOf(this.config.volume)&&(this.volume=this.config.volume);var n=this.innerContainer?this.innerContainer:this.root;this.video instanceof window.Element&&!n.contains(this.video.media||this.video)&&n.insertBefore(this.video.media||this.video,n.firstChild);var i=this.video.readyState;Rp.logInfo("_startInit readyState",i),this.config.autoplay&&(!/^blob/.test(this.video.currentSrc)&&!/^blob/.test(this.video.src)&&this.load(),(Bp.os.isIpad||Bp.os.isPhone)&&this.videoPlay()),i>=2?this.canPlayFunc():this.once(Zp,this.canPlayFunc),Ap.setTimeout(this,(function(){t.emit(fg)}),1),this.hasStart||Sv.afterInit(this),this.hasStart=!0}}},{key:"_registerPlugins",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this._loadingPlugins=[];var n=this.config.ignores||[],i=this.config.plugins||[],r=this.config.i18n||[];t&&Dv.extend(r,this.__i18n);var o=n.join("||").toLowerCase().split("||"),s=this.plugins;i.map((function(n){try{var i=n.plugin?n.plugin.pluginName:n.pluginName;if(i&&o.indexOf(i.toLowerCase())>-1)return null;if(!t&&s[i.toLowerCase()])return;if(n.lazy&&n.loader){var r=Sv.lazyRegister(e,n);return void(n.forceBeforeInit&&(r.then((function(){e._loadingPlugins.splice(e._loadingPlugins.indexOf(r),1)})).catch((function(t){Rp.logError("_registerPlugins:loadingPlugin",t),e._loadingPlugins.splice(e._loadingPlugins.indexOf(r),1)})),e._loadingPlugins.push(r)))}return e.registerPlugin(n)}catch(e){return Rp.logError("_registerPlugins:",e),null}}))}},{key:"_registerPresets",value:function(){var e=this;this.config.presets.forEach((function(t){!function(e,t){var n,i,r=t.preset&&t.options?new t.preset(t.options,e.config):new t({},e.config),o=r.plugins,s=void 0===o?[]:o,a=r.ignores,c=void 0===a?[]:a,u=r.icons,l=void 0===u?{}:u,f=r.i18n,h=void 0===f?[]:f;e.config.plugins||(e.config.plugins=[]),e.config.ignores||(e.config.ignores=[]),(n=e.config.plugins).push.apply(n,Uh(s)),(i=e.config.ignores).push.apply(i,Uh(c)),Object.keys(l).map((function(t){e.config.icons[t]||(e.config.icons[t]=l[t])}));var d=e.config.i18n||[];h.push.apply(h,Uh(d)),e.config.i18n=h}(e,t)}))}},{key:"_getRootByPosition",value:function(e){var t=null;switch(e){case hv.ROOT_RIGHT:t=this.rightBar;break;case hv.ROOT_LEFT:t=this.leftBar;break;case hv.ROOT_TOP:t=this.topBar;break;default:t=this.innerContainer||this.root}return t}},{key:"registerPlugin",value:function(e,t){var n=Sv.formatPluginInfo(e,t),i=n.PLUFGIN,r=n.options,o=this.config.plugins;!Sv.checkPluginIfExits(i.pluginName,o)&&o.push(i);var s=Sv.getRootByConfig(i.pluginName,this.config);s.root&&(r.root=s.root),s.position&&(r.position=s.position);var a=r.position?r.position:r.config&&r.config.position||i.defaultConfig&&i.defaultConfig.position;return!r.root&&"string"==typeof a&&a.indexOf("controls")>-1?this.controls&&this.controls.registerPlugin(i,r,i.pluginName):(r.root||(r.root=this._getRootByPosition(a)),Sv.register(this,i,r))}},{key:"deregister",value:function(e){"string"==typeof e?Sv.unRegister(this,e):e instanceof rv&&Sv.unRegister(this,e.pluginName)}},{key:"unRegisterPlugin",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.deregister(e),t&&this.removePluginFromConfig(e)}},{key:"removePluginFromConfig",value:function(e){var t;if("string"==typeof e?t=e:e instanceof rv&&(t=e.pluginName),t)for(var n=this.config.plugins.length-1;n>-1;n--){if(this.config.plugins[n].pluginName.toLowerCase()===t.toLowerCase()){this.config.plugins.splice(n,1);break}}}},{key:"plugins",get:function(){return Sv.getPlugins(this)}},{key:"getPlugin",value:function(e){var t=Sv.findPlugin(this,e);return t&&t.pluginName?t:null}},{key:"addClass",value:function(e){this.root&&(Ap.hasClass(this.root,e)||Ap.addClass(this.root,e))}},{key:"removeClass",value:function(e){this.root&&Ap.removeClass(this.root,e)}},{key:"hasClass",value:function(e){if(this.root)return Ap.hasClass(this.root,e)}},{key:"setAttribute",value:function(e,t){this.root&&this.root.setAttribute(e,t)}},{key:"removeAttribute",value:function(e,t){this.root&&this.root.removeAttribute(e,t)}},{key:"start",value:function(e){var t=this;if(!this.hasStart)return e||this.config.url||this.getInitDefinition(),this.hasStart=!0,this._registerPlugins(!1),Sv.beforeInit(this).then((function(){if(t.config)return e||(e=t.url||t.config.url),t._startInit(e)})).catch((function(e){throw e.fileName="player",e.lineNumber="236",Rp.logError("start:beforeInit:",e),e}))}},{key:"switchURL",value:function(e){var t=this,n=e;"Object"===Ap.typeOf(e)&&(n=e.url);var i=this.currentTime,r=this.paused&&!this.isError;return this.src=n,new Promise((function(e){var n=function(){t.currentTime=i,r&&t.once("canplay",(function(){t.pause()})),e()};Bp.os.isAndroid?t.once("timeupdate",(function(){n()})):t.once("canplay",(function(){n()})),t.play()}))}},{key:"videoPlay",value:function(){var e=this;if(this.hasStart){this.isPlaying||(this.removeClass(Tv.NO_START),!this.isCanplay&&this.addClass(Tv.ENTER));var t=lo(jn(n.prototype),"play",this).call(this);return void 0!==t&&t&&t.then?t.then((function(){e.removeClass(Tv.NOT_ALLOW_AUTOPLAY),e.addClass(Tv.PLAYING),e.isPlaying||(Rp.logInfo(">>>>playPromise.then"),e.isPlaying=!0,e.emit(ug))})).catch((function(t){if(Rp.logWarn(">>>>playPromise.catch",t.name),e.video&&e.video.error)return e.onError(),void e.removeClass(Tv.ENTER);"NotAllowedError"===t.name&&(e._errorTimer=Ap.setTimeout(e,(function(){e._errorTimer=null,e.emit(lg),e.addClass(Tv.NOT_ALLOW_AUTOPLAY),e.removeClass(Tv.ENTER),e.pause()}),0))})):(Rp.logWarn("video.play not return promise"),this.isPlaying||(this.isPlaying=!0,this.removeClass(Tv.NOT_ALLOW_AUTOPLAY),this.removeClass(Tv.NO_START),this.removeClass(Tv.ENTER),this.addClass(Tv.PLAYING),this.emit(ug))),t}this.removeClass(Tv.NO_START),this.addClass(Tv.ENTER);var i=this.start();i&&i.then((function(t){!e.config.autoplay&&e.videoPlay()}))}},{key:"videoPause",value:function(){lo(jn(n.prototype),"pause",this).call(this)}},{key:"play",value:function(){var e=this;this.removeClass(Tv.PAUSED),ev(this,"play",(function(){e.videoPlay()}))}},{key:"pause",value:function(){var e=this;ev(this,"pause",(function(){lo(jn(n.prototype),"pause",e).call(e)}))}},{key:"seek",value:function(e,t){var n=this;if(this.video&&!Number.isNaN(Number(e))&&this.hasStart){var i=this.config,r=i.isSeekedPlay,o=i.seekedStatus,s=t||(r?"play":o);e=e<0?0:e>this.duration?parseInt(this.duration,10):e,this.once(Zp,(function(){switch(n.removeClass(Tv.ENTER),n.isSeeking=!1,s){case"play":n.play();break;case"pause":n.pause();break;default:!n.paused&&n.play()}})),this.isPlaying?this.currentTime=e:(this.removeClass(Tv.NO_START),this.addClass(Tv.ENTER),this.currentTime=e,"play"===s&&this.play())}}},{key:"getInitDefinition",value:function(){var e=this,t=this.config,n=t.definition;!t.url&&n&&n.list&&n.list.length>0&&n.defaultDefinition&&n.list.map((function(t){t.definition===n.defaultDefinition&&(e.config.url=t.url,e.curDefinition=t.definition)}))}},{key:"changeDefinition",value:function(e,t){var n=this;if(this.emit(kg,{from:t,to:e}),this.curDefinition=e.definition,this.hasStart){var i=this.switchURL(e.url);i&&i.then?i.then((function(){n.emit(bg,{from:t,to:e})})):this.emit(bg,{from:t,to:e})}else this.config.url=e.url}},{key:"reload",value:function(){this.load(),this.reloadFunc=function(){this.play()},this.once("loadeddata",this.reloadFunc)}},{key:"resetState",value:function(){var e=this,t=[Tv.NOT_ALLOW_AUTOPLAY,Tv.PLAYING,Tv.NO_START,Tv.PAUSED,Tv.REPLAY,Tv.ENTER,Tv.ENDED,Tv.ERROR,Tv.LOADING];this.hasStart=!1,this.isError=!1,this.isPlaying=!1,this.videoPause(),this._accPlayed.acc=0,this._accPlayed.t=0,this._accPlayed.loopAcc=0,t.forEach((function(t){e.removeClass(t)})),this.addClass(Tv.ENTER),this.emit(Rg)}},{key:"reset",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;this.resetState();var i=this.plugins;if(i&&(t.map((function(t){e.deregister(t)})),n)){var r=Ev();Object.keys(this.config).keys((function(t){"undefined"===e.config[t]||"plugins"!==t&&"presets"!==t&&"el"!==t&&"id"!==t||(e.config[t]=r[t])}))}}},{key:"destroy",value:function(){var e=this,t=this.innerContainer,i=this.root;if(i&&this.video){var r=this.video.media||this.video;if(i.removeAttribute(Ug),this.updateAcc("destroy"),this._unbindEvents(),this._detachSourceEvents(this.video),Ap.clearAllTimers(this),this.emit(dg),Sv.destroy(this),Qg(this),lo(jn(n.prototype),"destroy",this).call(this),this.fullscreen&&this._fullscreenEl===this.root)try{this.exitFullscreen()}catch(e){}if(t)for(var o=t.children,s=0;s<o.length;s++)t.removeChild(o[s]);!t&&r instanceof window.Node&&i.contains(r)&&i.removeChild(r),["topBar","leftBar","rightBar","innerContainer"].map((function(t){e[t]&&i.removeChild(e[t]),e[t]=null}));var a=i.className.split(" ");a.length>0?i.className=a.filter((function(e){return e.indexOf("xgplayer")<0})).join(" "):i.className="",this.removeAttribute("data-xgfill"),["isReady","isPlaying","isSeeking","isCanplay","isActive","isCssfullScreen","fullscreen"].map((function(t){e[t]=!1}))}}},{key:"replay",value:function(){var e=this;this.removeClass(Tv.ENDED),this.currentTime=0,this.isSeeking=!1,ev(this,"replay",(function(){e.once(Zp,(function(){var t=e.videoPlay();t&&t.catch&&t.catch((function(e){console.log(e)}))})),e.play(),e.emit(hg),e.onPlay()}))}},{key:"retry",value:function(){var e=this;this.removeClass(Tv.ERROR),this.addClass(Tv.LOADING),ev(this,"retry",(function(){var t=e.currentTime;e.src=e.config.url,!e.config.isLive&&(e.currentTime=t),e.once(Zp,(function(){e.videoPlay()}))}))}},{key:"changeFullStyle",value:function(e,t,n,i){e&&(i||(i=Tv.PARENT_FULLSCREEN),this._orgCss||(this._orgCss=Ap.filterStyleFromText(e)),Ap.addClass(e,n),t&&t!==e&&!this._orgPCss&&(this._orgPCss=Ap.filterStyleFromText(t),Ap.addClass(t,i),t.setAttribute(Ug,this.playerId)))}},{key:"recoverFullStyle",value:function(e,t,n,i){i||(i=Tv.PARENT_FULLSCREEN),this._orgCss&&(Ap.setStyleFromCsstext(e,this._orgCss),this._orgCss=""),Ap.removeClass(e,n),t&&t!==e&&this._orgPCss&&(Ap.setStyleFromCsstext(t,this._orgPCss),this._orgPCss="",Ap.removeClass(t,i),t.removeAttribute(Ug))}},{key:"getFullscreen",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.fullscreenTarget,t=this.root,n=this.video;e||(e=t),this._fullScreenOffset={top:Ap.scrollTop(),left:Ap.scrollLeft()},this._fullscreenEl=e,this._fullActionFrom="get";var i=Ap.getFullScreenEl();if(i!==this._fullscreenEl)try{for(var r=0;r<Bg.length;r++){var o=Bg[r];if(e[o]){console.log(">>>>key",o,window.Element.ALLOW_KEYBOARD_INPUT);var s="webkitRequestFullscreen"===o?e.webkitRequestFullscreen(window.Element.ALLOW_KEYBOARD_INPUT):e[o]();return s&&s.then?s:Promise.resolve()}}return n.fullscreenEnabled||n.webkitSupportsFullscreen?(n.webkitEnterFullscreen(),Promise.resolve()):Promise.reject(new Error("call getFullscreen fail"))}catch(e){return Promise.reject(e)}else this.onFullscreenChange()}},{key:"exitFullscreen",value:function(e){if(this._fullscreenEl||Ap.getFullScreenEl()){this.root;var t=this.video;this._fullActionFrom="exit";for(var n=0;n<jg.length;n++){var i=jg[n];if(document[i]){var r=document[i]();return r&&r.then?r:Promise.resolve()}}return t&&t.webkitSupportsFullscreen?(t.webkitExitFullScreen(),Promise.resolve()):Promise.reject(new Error("call exitFullscreen fail"))}}},{key:"getCssFullscreen",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.fullscreenTarget;this.fullscreen&&this.exitFullscreen(),this._cssfullscreenEl=e,this.changeFullStyle(this.root,e,e?Tv.INNER_FULLSCREEN:Tv.CSS_FULLSCREEN),this.isCssfullScreen=!0,this.emit(yg,!0)}},{key:"exitCssFullscreen",value:function(){var e=this._cssfullscreenEl?Tv.INNER_FULLSCREEN:Tv.CSS_FULLSCREEN;this.fullscreen?this.removeClass(e):this.recoverFullStyle(this.root,this._cssfullscreenEl,e),this._cssfullscreenEl=null,this.isCssfullScreen=!1,this.emit(yg,!1)}},{key:"focus",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{autoHide:!this.config.closeDelayBlur,delay:this.config.inactive};this.isActive?this.onFocus(e):this.emit(og,Nv({paused:this.paused,ended:this.ended},e))}},{key:"blur",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{ignorePaused:!1};this.isActive?this.emit(sg,Nv({paused:this.paused,ended:this.ended},e)):this.onBlur(e)}},{key:"onFocus",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{autoHide:!0,delay:3e3};if(this.isActive=!0,this.removeClass(Tv.ACTIVE),this.userTimer&&(Ap.clearTimeout(this,this.userTimer),this.userTimer=null),!1!==t.autoHide){var n=t&&t.delay?t.delay:this.config.inactive;this.userTimer=Ap.setTimeout(this,(function(){e.userTimer=null,e.blur()}),n)}else this.userTimer&&(Ap.clearTimeout(this,this.userTimer),this.userTimer=null)}},{key:"onBlur",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{ignorePaused:!1};if(this.isActive){var t=this.config.closePauseVideoFocus;this.isActive=!1,(e.ignorePaused||t||!this.paused&&!this.ended)&&this.addClass(Tv.ACTIVE)}}},{key:"onEmptied",value:function(){this.updateAcc("emptied")}},{key:"onCanplay",value:function(){this.hasStart&&this.removeClass(Tv.ENTER),this.removeClass(Tv.LOADING),this.isCanplay=!0,this.waitTimer&&Ap.clearTimeout(this,this.waitTimer)}},{key:"onLoadeddata",value:function(){this.isError=!1}},{key:"onPlay",value:function(){this.removeClass(Tv.PAUSED),this.ended&&this.removeClass(Tv.ENDED),!this.config.closePlayVideoFocus&&this.focus()}},{key:"onPause",value:function(){this.addClass(Tv.PAUSED),this.updateAcc("pause"),this.config.closePauseVideoFocus||(this.userTimer&&(Ap.clearTimeout(this,this.userTimer),this.userTimer=null),this.focus())}},{key:"onEnded",value:function(){this.updateAcc("ended"),this.addClass(Tv.ENDED)}},{key:"onError",value:function(){this.isError=!0,this.updateAcc("error"),this.removeClass(Tv.NOT_ALLOW_AUTOPLAY),this.removeClass(Tv.NO_START),this.removeClass(Tv.ENTER),this.removeClass(Tv.LOADING),this.addClass(Tv.ERROR)}},{key:"onSeeking",value:function(){this.isSeeking||this.updateAcc("seeking"),this.isSeeking=!0,this.addClass(Tv.SEEKING)}},{key:"onSeeked",value:function(){this.isSeeking=!1,this.waitTimer&&Ap.clearTimeout(this,this.waitTimer),this.removeClass(Tv.LOADING),this.removeClass(Tv.SEEKING)}},{key:"onWaiting",value:function(){var e=this;this.waitTimer&&Ap.clearTimeout(this,this.waitTimer),this.updateAcc("waiting"),this.waitTimer=Ap.setTimeout(this,(function(){e.addClass(Tv.LOADING),Ap.clearTimeout(e,e.waitTimer),e.waitTimer=null}),200)}},{key:"onPlaying",value:function(){var e=this;this.isError=!1,[Tv.NO_START,Tv.PAUSED,Tv.ENDED,Tv.ERROR,Tv.REPLAY,Tv.LOADING].forEach((function(t){e.removeClass(t)}))}},{key:"onTimeupdate",value:function(){!this._videoHeight&&this.getVideoSize(),(this.waitTimer||this.hasClass(Tv.LOADING))&&this.video.readyState>2&&(this.removeClass(Tv.LOADING),Ap.clearTimeout(this,this.waitTimer),this.waitTimer=null),this.paused||this.isPlaying||!this.duration||(this.isPlaying=!0,this.emit(ug)),this._accPlayed.t||this.paused||this.ended||(this._accPlayed.t=(new Date).getTime())}},{key:"onVolumechange",value:function(){"Number"===Ap.typeOf(this.config.volume)&&(this.config.volume=this.volume)}},{key:"onRatechange",value:function(){this.config.defaultPlaybackRate=this.playbackRate}},{key:"emitUserAction",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(this.video&&t&&e){var i="String"===Ap.typeOf(e)?e:e.type||"";"switch_play_pause"===t&&("Undefined"===Ap.typeOf(n.paused)&&(n.paused=this.paused),n.isFirstStart=!this.playing),this.emit(Pg,Nv({eventType:i,action:t,currentTime:this.currentTime,duration:this.duration,ended:this.ended,event:e},n))}}},{key:"updateAcc",value:function(e){if(this._accPlayed.t){var t=(new Date).getTime()-this._accPlayed.t;this._accPlayed.acc+=t,this._accPlayed.t=0,("ended"===e||this.ended)&&(this._accPlayed.loopAcc=this._accPlayed.acc)}}},{key:"checkBuffer",value:function(e){var t=this.video.buffered;if(!t||0===t.length||!this.duration)return!0;for(var n=parseInt(1e3*(e||this.video.currentTime||0),10),i=t.length,r=0;r<i;r++)if(parseInt(1e3*t.start(r),10)+200<=n&&parseInt(1e3*t.end(r),10)-200>n)return!0;return!1}},{key:"position",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{h:0,y:0,x:0,w:0};if(this.video&&e&&e.h){var t=1/e.h,n=1!==t?"scale(".concat(t,")"):"",i=0,r=0;e.y&&(r=(100-100*e.h)/2-100*e.y),e.w&&e.x&&(i=(100-100*e.w)/2-100*e.x),n+=" translate(".concat(i,"%, ").concat(r,"%)"),this.video.style.transform=n,this.video.style.webkitTransform=n}}},{key:"setConfig",value:function(e){var t=this;e&&Object.keys(e).map((function(n){if("plugins"!==n){t.config[n]=e[n];var i=t.plugins[n.toLowerCase()];i&&"Function"===Ap.typeOf(i.setConfig)&&i.setConfig(e[n])}}))}},{key:"playNext",value:function(e){var t=this;this.resetState(),this._currentTime=0,this._duration=0,this.isPlaying=!1,this.setConfig(e),ev(this,"playnext",(function(){t.play(),t.emit(Sg,e)}))}},{key:"getVideoSize",value:function(){var e=this;if(this.video){var t=this.video,n=t.videoWidth,i=t.videoHeight,r=this.config,o=r.fitVideoSize,s=r.videoFillMode;if("fill"!==s&&"cover"!==s||this.setAttribute("data-xgfill",s),i&&n){this._videoHeight=i,this._videoWidth=n;var a=this.root.getBoundingClientRect(),c=this.controls&&this.innerContainer?this.controls.root.getBoundingClientRect().height:0,u=a.width,l=a.height-c,f=parseInt(n/i*1e3,10),h=parseInt(u/l*1e3,10),d=u,p=l,g={};"auto"===o&&h>f||"fixWidth"===o?(p=u/f*1e3,this.config.fluid?g.paddingTop="".concat(100*p/d,"%"):g.height="".concat(p+c,"px")):("auto"===o&&h<f||"fixHeight"===o)&&(d=f*l/1e3,g.width="".concat(d,"px")),this.fullscreen||this.isCssfullScreen||Object.keys(g).map((function(t){e.root.style[t]=g[t]})),("fillHeight"===s&&h<f||"fillWidth"===s&&h>f)&&this.setAttribute("data-xgfill","cover");var v={videoScale:f,vWidth:d,vHeight:p,cWidth:d,cHeight:p+c};this.emit(wg,v)}}}},{key:"updateObjectPosition",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.video.updateObjectPosition?this.video.updateObjectPosition(e,t):this.video.style.objectPosition="".concat(100*e,"% ").concat(100*t,"%")}},{key:"definitionList",get:function(){return this.config&&this.config.definition&&this.config.definition.list||[]},set:function(e){var t=this,n=this.config.definition;n.list=e,this.emit("resourceReady",e);var i=null,r=null;e.map((function(e){t.curDefinition===e.definition&&(i=e),n.defaultDefinition===e.definition&&(r=e)})),!r&&e.length>0&&(r=e[0]),i?this.changeDefinition(i):r&&this.changeDefinition(r)}},{key:"videoFrameInfo",get:function(){var e={total:0,dropped:0,corrupted:0,droppedRate:0,droppedDuration:0};if(!this.video||!this.video.getVideoPlaybackQuality)return e;var t=this.video.getVideoPlaybackQuality();return e.dropped=t.droppedVideoFrames||0,e.total=t.totalVideoFrames||0,e.corrupted=t.corruptedVideoFrames||0,e.total>0&&(e.droppedRate=e.dropped/e.total*100,e.droppedDuration=parseInt(this.cumulateTime/e.total*e.dropped,0)),e}},{key:"lang",get:function(){return this.config.lang},set:function(e){0!==Dv.langKeys.filter((function(t){return t===e})).length||"zh"===e?(this.config.lang=e,Sv.setLang(e,this)):console.error("Sorry, set lang fail, because the language [".concat(e,"] is not supported now, list of all supported languages is [").concat(Dv.langKeys.join(),"] "))}},{key:"i18n",get:function(){var e=this.config.lang;return"zh"===e&&(e="zh-cn"),this.__i18n.lang[e]||this.__i18n.lang.en}},{key:"i18nKeys",get:function(){return this.__i18n.textKeys||{}}},{key:"version",get:function(){return jp}},{key:"playerId",get:function(){return this._pluginInfoId}},{key:"url",get:function(){return this.__url||this.config.url},set:function(e){this.__url=e}},{key:"poster",get:function(){return this.plugins.poster?this.plugins.poster.config.poster:this.config.poster},set:function(e){this.plugins.poster&&this.plugins.poster.update(e)}},{key:"readyState",get:function(){var e=lo(jn(n.prototype),"readyState",this);return this.i18n[e]||e}},{key:"error",get:function(){var e=lo(jn(n.prototype),"error",this);return this.i18n[e]||e}},{key:"networkState",get:function(){var e=lo(jn(n.prototype),"networkState",this);return this.i18n[e]||e}},{key:"fullscreenChanging",get:function(){return!(null===this._fullScreenOffset)}},{key:"cumulateTime",get:function(){var e=this._accPlayed;return this.updateAcc("get"),e.acc}},{key:"zoom",get:function(){return this.config.zoom},set:function(e){this.config.zoom=e}},{key:"avgSpeed",get:function(){return Uv},set:function(e){Uv=e}},{key:"realTimeSpeed",get:function(){return jv},set:function(e){jv=e}},{key:"hook",value:function(e,t){return Yg.call.apply(Yg,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"useHooks",value:function(e,t){return Xg.call.apply(Xg,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removeHooks",value:function(e,t){return qg.call.apply(qg,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"usePluginHooks",value:function(e,t,n){for(var i=arguments.length,r=new Array(i>3?i-3:0),o=3;o<i;o++)r[o-3]=arguments[o];return $g.call.apply($g,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"removePluginHooks",value:function(e,t,n){for(var i=arguments.length,r=new Array(i>3?i-3:0),o=3;o<i;o++)r[o-3]=arguments[o];return Zg.call.apply(Zg,[this].concat(Array.prototype.slice.call(arguments)))}},{key:"setUserActive",value:function(e,t){"boolean"==typeof t&&t!==this.muted&&(this.addInnerOP("volumechange"),this.muted=t),Sv.setCurrentUserActive(this.playerId,e)}}],[{key:"debugger",get:function(){return Rp.config.debug},set:function(e){Rp.config.debug=e}},{key:"pluginsManager",get:function(){return Sv}},{key:"getCurrentUserActivePlayerId",value:function(){return Sv.getCurrentUseActiveId()}},{key:"setCurrentUserActive",value:function(e,t){Sv.setCurrentUserActive(e,t)}},{key:"isHevcSupported",value:function(){return Bp.isHevcSupported()}},{key:"probeConfigSupported",value:function(e){return Bp.probeConfigSupported(e)}},{key:"install",value:function(e,t){n.plugins||(n.plugins={}),n.plugins[e]||(n.plugins[e]=t)}},{key:"use",value:function(e,t){n.plugins||(n.plugins={}),n.plugins[e]=t}}]),n}(Mg);function Gv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function Vv(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=jn(e);if(t){var r=jn(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Bn(this,n)}}function Wv(){return(new Date).getTime()}Un(Hv,"defaultPreset",null),Un(Hv,"XgVideoProxy",null);var Kv="loadstart",zv="loadeddata",Yv="firstFrame",Xv="waitingStart",qv="waitingEnd",$v="seekStart",Zv="seekEnd",Jv=function(e){Mn(n,e);var t=Vv(n);function n(){var e;In(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Un(Fn(e=t.call.apply(t,[this].concat(r))),"_onTimeupdate",(function(){e._state.isTimeUpdate=!0,e._state.autoplayStart&&(Rp.logInfo("[xgLogger]".concat(e.player.playerId," _onTimeupdate")),e._sendFF("onTimeupdate"))})),Un(Fn(e),"_onAutoplayStart",(function(){Rp.logInfo("[xgLogger]".concat(e.player.playerId," _onAutoplayStart")),e._state.autoplayStart=!0,e.vt&&e._sendFF("onAutoplayStart")})),Un(Fn(e),"_onReset",(function(){e._state={autoplayStart:!1,isFFLoading:!1,isTimeUpdate:!1,isFFSend:!1,isLs:!1},e.vt=0,e.pt=0,e.fvt=0,e._isSeeking=!1,e.seekingStart=0,e.waitingStart=0,e.fixedWaitingStart=0,e._isWaiting=!1,e._waitTimer&&Ap.clearTimeout(Fn(e),e._waitTimer),e._waittTimer&&Ap.clearTimeout(Fn(e),e._waittTimer),e._waitTimer=null,e._waittTimer=null,e._waitType=0})),Un(Fn(e),"_onSeeking",(function(){e.seekingStart||(e.suspendWaitingStatus("seek"),e.seekingStart=Wv(),e.emitLog($v,{start:Wv()}))})),Un(Fn(e),"_onSeeked",(function(){e.suspendSeekingStatus("seeked")})),Un(Fn(e),"_onWaitingLoadStart",(function(){e._isWaiting||e.vt||(e._isWaiting=!0,e.waitingStart=Wv(),e.fixedWaitingStart=Wv(),e._waitType=1,e.emitLog(Xv,{fixedStart:e.fixedWaitingStart,start:e.waitingStart,type:1,endType:"loadstart"}))})),Un(Fn(e),"_onWaiting",(function(){!e._isWaiting&&e.vt&&(e._isWaiting=!0,e.vt?e.seekingStart?e._waitType=2:e._waitType=0:e._waitType=1,e.fixedWaitingStart=Wv(),e._waitTimer=Ap.setTimeout(Fn(e),(function(){e._isWaiting&&(e.waitingStart=Wv(),Ap.clearTimeout(Fn(e),e._waitTimer),e._waitTimer=null,e._startWaitTimeout(),e.emitLog(Xv,{fixedStart:e.fixedWaitingStart,start:e.waitingStart,type:e._waitType,endType:2===e._waitType?"seek":"playing"}))}),200))})),Un(Fn(e),"_onError",(function(){e.suspendSeekingStatus("error"),e.suspendWaitingStatus("error")})),Un(Fn(e),"_onPlaying",(function(){e._isWaiting&&e.suspendWaitingStatus("playing")})),e}return uo(n,[{key:"afterCreate",value:function(){var e=this;this._onReset(),this._waitType="firstFrame",this._initOnceEvents(),this.on(ig,(function(){var t=e._state,n=t.autoplayStart,i=t.isFFSend;Rp.logInfo("[xgLogger]".concat(e.player.playerId," LOAD_START"),"autoplayStart:".concat(n," isFFSend:").concat(i)),i||(!t.isLs&&e.emitLog(Kv,{}),t.isLs=!0,t.isTimeUpdate=!1,t.isFFLoading=!0,e.pt=Wv(),e.vt=0,e.fvt=0,e._initOnceEvents(),e._onWaitingLoadStart())})),this.on(eg,(function(){e.vt=Wv(),e.fvt=e.vt-e.pt;var t=e._state,n=t.isTimeUpdate,i=t.isFFSend,r=t.autoplayStart;Rp.logInfo("[xgLogger]".concat(e.player.playerId," LOADED_DATA"),"fvt:".concat(e.fvt," isTimeUpdate:").concat(e._state.isTimeUpdate)),n&&r&&e._sendFF("loadedData"),i||e.emitLog(zv,{}),e.suspendWaitingStatus("loadeddata")})),this.on(Yp,this._onSeeking),this.on(Xp,this._onSeeked),this.on(dg,(function(){e.endState("destroy")})),this.on(pg,(function(){e.endState("urlChange"),Rp.logInfo("[xgLogger]".concat(e.player.playerId," URL_CHANGE")),e._state.isFFSend&&e._onReset()})),this.on([Vp,Zp],this._onPlaying),this.on($p,this._onWaiting),this.on(zp,this._onError),this.on(Rg,(function(){Rp.logInfo("[xgLogger]".concat(e.player.playerId," RESET")),e.endState("reset"),e._initOnceEvents(),e._onReset()}))}},{key:"_initOnceEvents",value:function(){this.off(ug,this._onAutoplayStart),this.off(qp,this._onTimeupdate),this.once(ug,this._onAutoplayStart),this.once(qp,this._onTimeupdate)}},{key:"_sendFF",value:function(e){this.s=Wv();var t=this._state,n=t.isFFLoading,i=t.isFFSend;Rp.logInfo("[xgLogger]".concat(this.player.playerId," _sendFF"),"".concat(e," fvt:").concat(this.fvt," isFFLoading:").concat(n," !isFFSend:").concat(!i)),this.vt>0&&n&&!i&&(Rp.logInfo("[xgLogger]".concat(this.player.playerId," emitLog_firstFrame"),e),this._state.isFFLoading=!1,this._state.isFFSend=!0,this.emitLog(Yv,{fvt:this.fvt,costTime:this.fvt,vt:this.vt}))}},{key:"_startWaitTimeout",value:function(){var e=this;this._waittTimer&&Ap.clearTimeout(this,this._waittTimer),this._waittTimer=Ap.setTimeout(this,(function(){e.suspendWaitingStatus("timeout"),Ap.clearTimeout(e,e._waittTimer),e._waittTimer=null}),this.config.waitTimeout)}},{key:"endState",value:function(e){this.suspendWaitingStatus(e),this.suspendSeekingStatus(e)}},{key:"suspendSeekingStatus",value:function(e){if(this.seekingStart){var t=Wv(),n=t-this.seekingStart;this.seekingStart=0,this.emitLog(Zv,{end:t,costTime:n,endType:e})}}},{key:"suspendWaitingStatus",value:function(e){if(this._waitTimer&&(Ap.clearTimeout(this,this._waitTimer),this._waitTimer=null),this._waittTimer&&(Ap.clearTimeout(this,this._waittTimer),this._waittTimer=null),this._isWaiting=!1,this.waitingStart){var t=Wv(),n=t-this.waitingStart,i=t-this.fixedWaitingStart;this._isWaiting=!1,this.waitingStart=0,this.fixedWaitingStart=0,this.emitLog(qv,{fixedCostTime:i,costTime:n,type:this._waitType,endType:2===this._waitType?"seek":e})}}},{key:"emitLog",value:function(e,t){var n=this.player;this.emit(Eg,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Gv(Object(n),!0).forEach((function(t){Un(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gv(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({t:Wv(),host:Ap.getHostFromUrl(n.currentSrc),vtype:n.vtype,eventType:e,currentTime:this.player.currentTime,readyState:n.video.readyState,networkState:n.video.networkState},t))}}],[{key:"pluginName",get:function(){return"xgLogger"}},{key:"defaultConfig",get:function(){return{waitTimeout:15e3}}}]),n}(vv);function Qv(){return(new DOMParser).parseFromString('<svg class="xgplayer-replay-svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 78 78" width="78" height="78">\n <path fill="#fff" transform="translate(20, 20)" d="M8.22708362,13.8757234 L11.2677371,12.6472196 C11.7798067,12.4403301 12.3626381,12.6877273 12.5695276,13.1997969 L12.9441342,14.1269807 C13.1510237,14.6390502 12.9036264,15.2218816 12.3915569,15.4287712 L6.8284538,17.6764107 L5.90126995,18.0510173 C5.38920044,18.2579068 4.80636901,18.0105096 4.5994795,17.49844 L1.97723335,11.0081531 C1.77034384,10.4960836 2.0177411,9.91325213 2.52981061,9.70636262 L3.45699446,9.33175602 C3.96906396,9.12486652 4.5518954,9.37226378 4.75878491,9.88433329 L5.67885163,12.1615783 C7.99551726,6.6766934 13.3983951,3 19.5,3 C27.7842712,3 34.5,9.71572875 34.5,18 C34.5,26.2842712 27.7842712,33 19.5,33 C15.4573596,33 11.6658607,31.3912946 8.87004692,28.5831991 C8.28554571,27.9961303 8.28762719,27.0463851 8.87469603,26.4618839 C9.46176488,25.8773827 10.4115101,25.8794641 10.9960113,26.466533 C13.2344327,28.7147875 16.263503,30 19.5,30 C26.127417,30 31.5,24.627417 31.5,18 C31.5,11.372583 26.127417,6 19.5,6 C14.4183772,6 9.94214483,9.18783811 8.22708362,13.8757234 Z"></path>\n</svg>\n',"image/svg+xml").firstChild}function ey(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=jn(e);if(t){var r=jn(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Bn(this,n)}}var ty=function(e){Mn(n,e);var t=ey(n);function n(){return In(this,n),t.apply(this,arguments)}return uo(n,[{key:"registerIcons",value:function(){return{replay:Qv}}},{key:"afterCreate",value:function(){var e=this;vv.insert(this.icons.replay,this.root,0),this.__handleReplay=this.hook("replayHandler",(function(){e.player.replay()}),{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this.bind(".xgplayer-replay",["click","touchend"],this.__handleReplay),this.on(Wp,(function(){if(e.playerConfig.loop||Ap.addClass(e.player.root,"replay"),!e.config.disable){e.show();var t=e.root.querySelector("path");if(t){var n=window.getComputedStyle(t).getPropertyValue("transform");if("string"==typeof n&&n.indexOf("none")>-1)return null;t.setAttribute("transform",n)}}})),this.on(Gp,(function(){e.hide()}))}},{key:"handleReplay",value:function(e){e.preventDefault(),e.stopPropagation(),this.player.replay(),Ap.removeClass(this.player.root,"replay")}},{key:"show",value:function(){this.config.disable||(this.root.style.display="flex")}},{key:"enable",value:function(){this.config.disable=!1}},{key:"disable",value:function(){this.config.disable=!0,this.hide()}},{key:"destroy",value:function(){this.unbind(".xgplayer-replay",["click","touchend"],this.__handleReplay)}},{key:"render",value:function(){return'<xg-replay class="xgplayer-replay">\n <xg-replay-txt class="xgplayer-replay-txt" lang-key="'.concat(this.i18nKeys.REPLAY,'">').concat(this.i18n.REPLAY,"</xg-replay-txt>\n </xg-replay>")}}],[{key:"pluginName",get:function(){return"replay"}},{key:"defaultConfig",get:function(){return{disable:!1}}}]),n}(vv);function ny(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=jn(e);if(t){var r=jn(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Bn(this,n)}}var iy=function(e){Mn(n,e);var t=ny(n);function n(){return In(this,n),t.apply(this,arguments)}return uo(n,[{key:"isEndedShow",get:function(){return this.config.isEndedShow},set:function(e){this.config.isEndedShow=e}},{key:"hide",value:function(){Ap.addClass(this.root,"hide")}},{key:"show",value:function(){Ap.removeClass(this.root,"hide")}},{key:"beforeCreate",value:function(e){"string"==typeof e.player.config.poster&&(e.config.poster=e.player.config.poster)}},{key:"afterCreate",value:function(){var e=this;this.on(Wp,(function(){e.isEndedShow&&Ap.removeClass(e.root,"hide")})),this.config.hideCanplay?(this.once(qp,(function(){e.onTimeUpdate()})),this.on(pg,(function(){Ap.removeClass(e.root,"hide"),Ap.addClass(e.root,"xg-showplay"),e.once(qp,(function(){e.onTimeUpdate()}))}))):this.on(Gp,(function(){Ap.addClass(e.root,"hide")}))}},{key:"onTimeUpdate",value:function(){var e=this;this.player.currentTime?Ap.removeClass(this.root,"xg-showplay"):this.once(qp,(function(){e.onTimeUpdate()}))}},{key:"update",value:function(e){e&&(this.config.poster=e,this.root.style.backgroundImage="url(".concat(e,")"))}},{key:"render",value:function(){var e=this.config,t=e.poster,n=e.hideCanplay,i=t?"background-image:url(".concat(t,");"):"";return'<xg-poster class="xgplayer-poster '.concat(n?"xg-showplay":"",'" style="').concat(i,'">\n </xg-poster>')}}],[{key:"pluginName",get:function(){return"poster"}},{key:"defaultConfig",get:function(){return{isEndedShow:!0,hideCanplay:!1,poster:""}}}]),n}(vv);function ry(){return(new DOMParser).parseFromString('<svg class="play" xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="3 -4 28 40">\n <path fill="#fff" transform="scale(0.0320625 0.0320625)" d="M576,363L810,512L576,661zM342,214L576,363L576,661L342,810z"></path>\n</svg>\n',"image/svg+xml").firstChild}function oy(){return(new DOMParser).parseFromString('<svg class="pause" xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="3 -4 28 40">\n <path fill="#fff" transform="scale(0.0320625 0.0320625)" d="M598,214h170v596h-170v-596zM256 810v-596h170v596h-170z"></path>\n</svg>\n',"image/svg+xml").firstChild}function sy(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=jn(e);if(t){var r=jn(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Bn(this,n)}}var ay={};var cy=function(e){Mn(n,e);var t=sy(n);function n(e){var i;return In(this,n),Un(Fn(i=t.call(this,e)),"onAutoplayStart",(function(){if(!i.autoPlayStart){var e="auto"===i.config.mode?"auto-hide":"hide";Ap.addClass(i.root,e),i.autoPlayStart=!0,i.onPlayPause("play")}})),i.autoPlayStart=!1,i}return uo(n,[{key:"afterCreate",value:function(){var e=this,t=this.player,n=this.playerConfig;this.initIcons(),this.once(ag,(function(){n&&(n.lang&&"en"===n.lang?Ap.addClass(t.root,"lang-is-en"):"jp"===n.lang&&Ap.addClass(t.root,"lang-is-jp"))})),this.on(ug,this.onAutoplayStart),n.autoplay||this.show(),this.on(lg,(function(){var t="auto"===e.config.mode?"auto-hide":"hide";e.setAttr("data-state","play"),Ap.removeClass(e.root,t),e.show()})),this.on(Gp,(function(){e.onPlayPause("play")})),this.on(Kp,(function(){e.onPlayPause("pause")})),this.clickHandler=this.hook("click",this.switchPausePlay,{pre:function(t){t.cancelable&&t.preventDefault(),t.stopPropagation(),e.emitUserAction(t,"switch_play_pause")}}),this.bind(["click","touchend"],this.clickHandler)}},{key:"registerIcons",value:function(){return{startPlay:{icon:ry,class:"xg-icon-play"},startPause:{icon:oy,class:"xg-icon-pause"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild("xg-start-inner",e.startPlay),this.appendChild("xg-start-inner",e.startPause)}},{key:"hide",value:function(){Ap.addClass(this.root,"hide")}},{key:"show",value:function(){Ap.removeClass(this.root,"hide")}},{key:"focusHide",value:function(){Ap.addClass(this.root,"focus-hide")}},{key:"recover",value:function(){Ap.removeClass(this.root,"focus-hide")}},{key:"switchStatus",value:function(e){e?this.setAttr("data-state",this.player.paused?"pause":"play"):this.setAttr("data-state",this.player.paused?"play":"pause")}},{key:"animate",value:function(e){var t=this;!function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{start:null,end:null};ay[e]&&window.clearTimeout(ay[e].id),ay[e]={},n.start&&n.start(),ay[e].id=window.setTimeout((function(){n.end&&n.end(),window.clearTimeout(ay[e].id),delete ay[e]}),t)}("pauseplay",400,{start:function(){Ap.addClass(t.root,"interact"),t.show(),t.switchStatus(!0)},end:function(){Ap.removeClass(t.root,"interact"),!e&&t.hide()}})}},{key:"switchPausePlay",value:function(e){var t=this.player;(e.cancelable&&e.preventDefault(),e.stopPropagation(),t.isReady)&&(!this.player.paused&&t.isPlaying?t.pause():t.play())}},{key:"onPlayPause",value:function(e){var t=this.config,n=this.player;if(n.isPlaying&&this.autoPlayStart){if("show"===t.mode)return this.switchStatus(),void this.show();if("auto"!==t.mode){if(t.isShowPause&&n.paused&&!n.ended||t.isShowEnd&&n.ended)return this.switchStatus(),void this.show();if(t.disableAnimate)return this.switchStatus(),void this.hide();if("play"===e)this.autoPlayStart?this.animate():this.hide();else{if(!this.autoPlayStart||n.ended)return;this.animate()}}else this.switchStatus()}}},{key:"destroy",value:function(){this.unbind(["click","touchend"],this.clickHandler),Object.keys(ay).map((function(e){window.clearTimeout(ay[e].id),delete ay[e]}))}},{key:"render",value:function(){var e=this.playerConfig.autoplay?"auto"===this.config.mode?"auto-hide":"hide":"";return'\n <xg-start class="xgplayer-start '.concat(e,'">\n <xg-start-inner></xg-start-inner>\n </xg-start>')}}],[{key:"pluginName",get:function(){return"start"}},{key:"defaultConfig",get:function(){return{isShowPause:!1,isShowEnd:!1,disableAnimate:!1,mode:"hide"}}}]),n}(vv);function uy(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=jn(e);if(t){var r=jn(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Bn(this,n)}}var ly=function(e){Mn(n,e);var t=uy(n);function n(){return In(this,n),t.apply(this,arguments)}return uo(n,[{key:"render",value:function(){var e=this.config.innerHtml,t=Ap.createDom("xg-enter","",{},"xgplayer-enter");if(e&&e instanceof window.HTMLElement)t.appendChild(e);else if(e&&"string"==typeof e)t.innerHTML=e;else{for(var n="",i=1;i<=12;i++)n+='<div class="xgplayer-enter-bar'.concat(i,'"></div>');t.innerHTML='<div class="xgplayer-enter-spinner">'.concat(n,"</div>")}return t}}],[{key:"pluginName",get:function(){return"enter"}},{key:"defaultConfig",get:function(){return{innerHtml:"",logo:""}}}]),n}(vv);function fy(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=jn(e);if(t){var r=jn(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Bn(this,n)}}var hy=function(e){Mn(n,e);var t=fy(n);function n(){return In(this,n),t.apply(this,arguments)}return uo(n,[{key:"afterCreate",value:function(){this.getMini=this.getMini.bind(this),this.exitMini=this.exitMini.bind(this),this.bind("click",this.getMini)}},{key:"getMini",value:function(){this.config.onClick&&this.config.onClick()}},{key:"exitMini",value:function(){this.config.onClick&&this.config.onClick()}},{key:"destroy",value:function(){this.unbind(["click","touchend"],this.getMini)}},{key:"render",value:function(){var e="MINISCREEN";return'\n <xg-icon class="xgplayer-miniicon">\n <div class="xgplayer-icon btn-text"><span class="icon-text" lang-key="'.concat(this.i18nKeys[e],'">').concat(this.i18n[e],"</span></div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"miniscreenIcon"}},{key:"defaultConfig",get:function(){return{position:hv.CONTROLS_RIGHT,index:10}}}]),n}(vv);function dy(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=jn(e);if(t){var r=jn(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Bn(this,n)}}function py(e){var t=parseFloat(e);return-1===e.indexOf("%")&&!Number.isNaN(t)&&t}var gy=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],vy=gy.length;function yy(e){if("string"==typeof e&&(e=document.querySelector(e)),e&&"object"===Nn(e)&&e.nodeType){var t=function(e){return window.getComputedStyle(e)}(e);if("none"===t.display)return function(){for(var e={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},t=0;t<vy;t++)e[gy[t]]=0;return e}();var n={};n.width=e.offsetWidth,n.height=e.offsetHeight;for(var i=n.isBorderBox="border-box"===t.boxSizing,r=0;r<vy;r++){var o=gy[r],s=t[o],a=parseFloat(s);n[o]=Number.isNaN(a)?0:a}var c=n.paddingLeft+n.paddingRight,u=n.paddingTop+n.paddingBottom,l=n.marginLeft+n.marginRight,f=n.marginTop+n.marginBottom,h=n.borderLeftWidth+n.borderRightWidth,d=n.borderTopWidth+n.borderBottomWidth,p=i,g=py(t.width);!1!==g&&(n.width=g+(p?0:c+h));var v=py(t.height);return!1!==v&&(n.height=v+(p?0:u+d)),n.innerWidth=n.width-(c+h),n.innerHeight=n.height-(u+d),n.outerWidth=n.width+l,n.outerHeight=n.height+f,n}}function my(e,t){for(var n=0;n<e.length;n++){var i=e[n];if(i.identifier===t)return i}}var ky="dragStart",by="dragMove",wy="dragEnded",Cy={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"]},xy=function(e){Mn(n,e);var t=dy(n);function n(e){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return In(this,n),(i=t.call(this)).isEnabled=!0,i.isDragging=!1,i.isDown=!1,i.position={},i.downPoint={},i.dragPoint={x:0,y:0},i.startPos={x:0,y:0},i._root=e instanceof Element?e:document.querySelector(e),i._handlerDom=r.handle instanceof Element?r.handle:document.querySelector(r.handle),i._root&&i._handlerDom?(i._bindStartEvent(),i):Bn(i)}return uo(n,[{key:"_bindStartEvent",value:function(){var e=this;"ontouchstart"in window?this._startKey="touchstart":this._startKey="mousedown",this["on".concat(this._startKey)]=this["on".concat(this._startKey)].bind(this),this._handlerDom.addEventListener(this._startKey,this["on".concat(this._startKey)]),Cy[this._startKey].map((function(t){e["on".concat(t)]=e["on".concat(t)].bind(e)}))}},{key:"_unbindStartEvent",value:function(){this._handlerDom.removeEventListener(this._startKey,this["on".concat(this._startKey)])}},{key:"_bindPostStartEvents",value:function(e){var t=this;if(e){var n=Cy[this._startKey];n.map((function(e){window.addEventListener(e,t["on".concat(e)])})),this._boundPointerEvents=n}}},{key:"_unbindPostStartEvents",value:function(){var e=this;this._boundPointerEvents&&(this._boundPointerEvents.map((function(t){window.removeEventListener(t,e["on".concat(t)])})),delete this._boundPointerEvents)}},{key:"enable",value:function(){this.isEnabled=!0}},{key:"disable",value:function(){this.isEnabled=!1,this.isDragging&&this.onUp()}},{key:"onDocUp",value:function(e){this.onUp()}},{key:"animate",value:function(){var e=this;this.isDragging&&(this.positionDrag(),window.requestAnimationFrame((function(){e.animate()})))}},{key:"positionDrag",value:function(){var e="translate3d(".concat(this.dragPoint.x,"px, ").concat(this.dragPoint.y,"px, 0)");this._root.style.transform=e,this._root.style.webKitTransform=e}},{key:"setLeftTop",value:function(){this._root.style.left=this.position.x+"px",this._root.style.top=this.position.y+"px"}},{key:"onmousedown",value:function(e){this.dragStart(e,e)}},{key:"onmousemove",value:function(e){this.dragMove(e,e)}},{key:"onmouseup",value:function(e){this.dragEnd(e,e)}},{key:"ontouchstart",value:function(e){var t=e.changedTouches[0];this.dragStart(e,t),this.touchIdentifier=void 0!==t.pointerId?t.pointerId:t.identifier,e.preventDefault()}},{key:"ontouchmove",value:function(e){var t=my(e.changedTouches,this.touchIdentifier);t&&this.dragMove(e,t)}},{key:"ontouchend",value:function(e){var t=my(e.changedTouches,this.touchIdentifier);t&&this.dragEnd(e,t),e.preventDefault()}},{key:"ontouchcancel",value:function(e){var t=my(e.changedTouches,this.touchIdentifier);t&&this.dragCancel(e,t)}},{key:"dragStart",value:function(e,t){if(this._root&&!this.isDown&&this.isEnabled){this.downPoint=t,this.dragPoint.x=0,this.dragPoint.y=0,this._getPosition();var n=yy(this._root);this.startPos.x=this.position.x,this.startPos.y=this.position.y,this.startPos.maxY=window.innerHeight-n.height,this.startPos.maxX=window.innerWidth-n.width,this.setLeftTop(),this.isDown=!0,this._bindPostStartEvents(e)}}},{key:"dragRealStart",value:function(e,t){this.isDragging=!0,this.animate(),this.emit(ky,this.startPos)}},{key:"dragEnd",value:function(e,t){this._root&&(this._unbindPostStartEvents(),this.isDragging&&(this._root.style.transform="",this.setLeftTop(),this.emit(wy)),this.presetInfo())}},{key:"_dragPointerMove",value:function(e,t){var n={x:t.pageX-this.downPoint.pageX,y:t.pageY-this.downPoint.pageY};return!this.isDragging&&this.hasDragStarted(n)&&this.dragRealStart(e,t),n}},{key:"dragMove",value:function(e,t){if(e=e||window.event,this.isDown){var n=this.startPos,i=n.x,r=n.y,o=this._dragPointerMove(e,t),s=o.x,a=o.y;s=this.checkContain("x",s,i),a=this.checkContain("y",a,r),this.position.x=i+s,this.position.y=r+a,this.dragPoint.x=s,this.dragPoint.y=a,this.emit(by,this.position)}}},{key:"dragCancel",value:function(e,t){this.dragEnd(e,t)}},{key:"presetInfo",value:function(){this.isDragging=!1,this.startPos={x:0,y:0},this.dragPoint={x:0,y:0},this.isDown=!1}},{key:"destroy",value:function(){this._unbindStartEvent(),this._unbindPostStartEvents(),this.isDragging&&this.dragEnd(),this.removeAllListeners(),this._handlerDom=null}},{key:"hasDragStarted",value:function(e){return Math.abs(e.x)>3||Math.abs(e.y)>3}},{key:"checkContain",value:function(e,t,n){return t+n<0?0-n:"x"===e&&t+n>this.startPos.maxX?this.startPos.maxX-n:"y"===e&&t+n>this.startPos.maxY?this.startPos.maxY-n:t}},{key:"_getPosition",value:function(){var e=window.getComputedStyle(this._root),t=this._getPositionCoord(e.left,"width"),n=this._getPositionCoord(e.top,"height");this.position.x=Number.isNaN(t)?0:t,this.position.y=Number.isNaN(n)?0:n,this._addTransformPosition(e)}},{key:"_addTransformPosition",value:function(e){var t=e.transform;if(0===t.indexOf("matrix")){var n=t.split(","),i=0===t.indexOf("matrix3d")?12:4,r=parseInt(n[i],10),o=parseInt(n[i+1],10);this.position.x+=r,this.position.y+=o}}},{key:"_getPositionCoord",value:function(e,t){if(-1!==e.indexOf("%")){var n=yy(this._root.parentNode);return n?parseFloat(e)/100*n[t]:0}return parseInt(e,10)}}]),n}(Bh);function _y(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=jn(e);if(t){var r=jn(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Bn(this,n)}}var Sy=function(e){Mn(n,e);var t=_y(n);function n(e){var i;In(this,n),Un(Fn(i=t.call(this,e)),"onCancelClick",(function(e){i.exitMini(),i.isClose=!0})),Un(Fn(i),"onCenterClick",(function(e){var t=Fn(i).player;t.paused?t.play():t.pause()})),Un(Fn(i),"onScroll",(function(e){if(!(!window.scrollY&&0!==window.scrollY||Math.abs(window.scrollY-i.pos.scrollY)<50)){var t=parseInt(Ap.getCss(i.player.root,"height"));t+=i.config.scrollTop,i.pos.scrollY=window.scrollY,window.scrollY>t+5?!i.isMini&&!i.isClose&&i.getMini():window.scrollY<=t&&(i.isMini&&i.exitMini(),i.isClose=!1)}})),i.isMini=!1,i.isClose=!1;var r=Fn(i).config;return i.pos={left:r.left<0?window.innerWidth-r.width-20:r.left,top:r.top<0?window.innerHeight-r.height-20:r.top,height:i.config.height,width:i.config.width,scrollY:window.scrollY||0},i.lastStyle=null,i}return uo(n,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.mini&&(e.config.isShowIcon=e.player.config.mini)}},{key:"afterCreate",value:function(){var e=this;this.initIcons(),this.on(Kp,(function(){e.setAttr("data-state","pause")})),this.on(Gp,(function(){e.setAttr("data-state","play")}))}},{key:"onPluginsReady",value:function(){var e=this,t=this.player;if(!this.config.disable){if(this.config.isShowIcon){var n={config:{onClick:function(){e.getMini()}}};t.controls.registerPlugin(hy,n,hy.pluginName)}var i=Ap.checkTouchSupport()?"touchend":"click";this.bind(".mini-cancel-btn",i,this.onCancelClick),this.bind(".play-icon",i,this.onCenterClick),this.config.disableDrag||(this._draggabilly=new xy(this.player.root,{handle:this.root})),this.config.isScrollSwitch&&window.addEventListener("scroll",this.onScroll)}}},{key:"registerIcons",value:function(){return{play:{icon:ry,class:"xg-icon-play"},pause:{icon:oy,class:"xg-icon-pause"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".play-icon",e.play),this.appendChild(".play-icon",e.pause)}},{key:"getMini",value:function(){var e=this;if(!this.isMini){var t=this.player,n=this.playerConfig,i=this.config.target||this.player.root;this.lastStyle={},Ap.addClass(t.root,"xgplayer-mini"),["width","height","top","left"].map((function(t){e.lastStyle[t]=i.style[t],i.style[t]="".concat(e.pos[t],"px")})),n.fluid&&(i.style["padding-top"]=""),this.emit(mg,!0),t.isMini=this.isMini=!0}}},{key:"exitMini",value:function(){var e=this;if(!this.isMini)return!1;var t=this.player,n=this.playerConfig,i=this.config.target||this.player.root;Ap.removeClass(t.root,"xgplayer-mini"),this.lastStyle&&Object.keys(this.lastStyle).map((function(t){i.style[t]=e.lastStyle[t]})),this.lastStyle=null,n.fluid&&(t.root.style.width="100%",t.root.style.height="0",t.root.style["padding-top"]="".concat(100*n.height/n.width,"%")),this.emit(mg,!1),this.isMini=t.isMini=!1}},{key:"destroy",value:function(){window.removeEventListener("scroll",this.onScroll);var e=Ap.checkTouchSupport()?"touchend":"click";this.unbind(".mini-cancel-btn",e,this.onCancelClick),this.unbind(".play-icon",e,this.onCenterClick),this._draggabilly&&this._draggabilly.destroy(),this._draggabilly=null,this.exitMini()}},{key:"render",value:function(){if(!this.config.disable)return'\n <xg-mini-layer class="xg-mini-layer">\n <xg-mini-header class="xgplayer-mini-header">\n <div lang-key="'.concat(this.i18nKeys.MINI_DRAG,'">').concat(this.i18n.MINI_DRAG,'</div>\n </xg-mini-header>\n <div class="mini-cancel-btn">\n <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20">\n <path fill="#fff" fill-rule="evenodd" d="M3.99 3.49a1 1 0 0 1 1.414 0L10 8.085l4.596-4.595a1 1 0 1 1 1.414 1.414L11.414 9.5l4.596 4.596a1 1 0 0 1 .084 1.32l-.084.094a1 1 0 0 1-1.414 0L10 10.914 5.404 15.51a1 1 0 0 1-1.414-1.414L8.585 9.5 3.99 4.904a1 1 0 0 1-.084-1.32z"></path>\n </svg>\n </div>\n <div class="play-icon">\n </div>\n </xg-mini-layer>')}}],[{key:"pluginName",get:function(){return"miniscreen"}},{key:"defaultConfig",get:function(){return{index:10,disable:!1,width:320,height:180,left:-1,top:-1,isShowIcon:!1,isScrollSwitch:!1,scrollTop:0,disableDrag:!1}}}]),n}(vv);function Ty(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=jn(e);if(t){var r=jn(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Bn(this,n)}}var Ey={mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mousemove:"onMouseMove"},Py=["videoClick","videoDbClick"],Ry=function(e){Mn(n,e);var t=Ty(n);function n(){var e;In(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Un(Fn(e=t.call.apply(t,[this].concat(r))),"onMouseMove",(function(t){var n=Fn(e),i=n.player,r=n.playerConfig;i.isActive||(i.focus({autoHide:!r.closeDelayBlur}),!r.closeFocusVideoFocus&&i.video.focus())})),Un(Fn(e),"onMouseEnter",(function(t){var n=Fn(e),i=n.playerConfig,r=n.player;!i.closeFocusVideoFocus&&r.video.focus(),i.closeDelayBlur?r.focus({autoHide:!1}):r.focus()})),Un(Fn(e),"onMouseLeave",(function(t){var n=e.playerConfig,i=n.closePlayerBlur,r=n.leavePlayerTime,o=n.closeDelayBlur;i||o||(r?e.player.focus({autoHide:!0,delay:r}):e.player.blur())})),Un(Fn(e),"onVideoClick",(function(t){var n=Fn(e),i=n.player,r=n.playerConfig;t.target&&r.closeVideoClick||t.target!==i.video&&t.target!==i.innerContainer&&t.target!==i.video.__canvas&&t.target!==i.video.media||(t.preventDefault(),r.closeVideoStopPropagation||t.stopPropagation(),e._clickCount++,e.clickTimer&&(clearTimeout(e.clickTimer),e.clickTimer=null),e.clickTimer=setTimeout((function(){e._clickCount&&(e._clickCount--,ev(Fn(e),Py[0],(function(t,n){e.switchPlayPause(n.e)}),{e:t,paused:i.paused}),clearTimeout(e.clickTimer),e.clickTimer=null)}),300))})),Un(Fn(e),"onVideoDblClick",(function(t){var n=Fn(e),i=n.player;n.playerConfig.closeVideoDblclick||!t.target||t.target!==i.video&&t.target!==i.video.__canvas||(e._clickCount<2?e._clickCount=0:(e._clickCount=0,e.clickTimer&&(clearTimeout(e.clickTimer),e.clickTimer=null),t.preventDefault(),t.stopPropagation(),ev(Fn(e),Py[1],(function(t,n){e.emitUserAction(n.e,"switch_fullscreen",{fullscreen:i.fullscreen}),i.fullscreen?i.exitFullscreen():i.getFullscreen()}),{e:t,fullscreen:i.fullscreen})))})),e}return uo(n,[{key:"afterCreate",value:function(){var e=this;this._clickCount=0,Py.map((function(t){e.__hooks[t]=null})),"mobile"===this.playerConfig.isMobileSimulateMode||"mobile"===Bp.device&&!Bp.os.isIpad||this.initEvents()}},{key:"initEvents",value:function(){var e=this,t=this.player,n=t.video,i=t.root,r=this.playerConfig.enableContextmenu;n&&n.addEventListener("click",this.onVideoClick,!1),n&&n.addEventListener("dblclick",this.onVideoDblClick,!1),Object.keys(Ey).map((function(t){i.addEventListener(t,e[Ey[t]],!1)})),r&&n&&n.addEventListener("contextmenu",this.onContextmenu,!1)}},{key:"switchPlayPause",value:function(e){var t=this.player;this.emitUserAction(e,"switch_play_pause"),t.ended?t.duration!==1/0&&t.duration>0&&t.replay():t.paused?t.play():t.pause()}},{key:"onContextmenu",value:function(e){(e=e||window.event).preventDefault&&e.preventDefault(),e.stopPropagation?e.stopPropagation():(e.returnValue=!1,e.cancelBubble=!0)}},{key:"destroy",value:function(){var e=this,t=this.player,n=t.video,i=t.root;this.clickTimer&&clearTimeout(this.clickTimer),n.removeEventListener("click",this.onVideoClick,!1),n.removeEventListener("dblclick",this.onVideoDblClick,!1),n.removeEventListener("contextmenu",this.onContextmenu,!1),Object.keys(Ey).map((function(t){i.removeEventListener(t,e[Ey[t]],!1)}))}}],[{key:"pluginName",get:function(){return"pc"}},{key:"defaultConfig",get:function(){return{}}}]),n}(rv),Oy=h,Ay=nt,Ly=v,Iy=Xt,Dy=nt,My=function(e){if("number"!=typeof e&&"Number"!=Oy(e))throw TypeError("Incorrect invocation");return+e},Ny=function(e){var t=String(Ly(this)),n="",i=Ay(e);if(i<0||i==1/0)throw RangeError("Wrong number of repetitions");for(;i>0;(i>>>=1)&&(t+=t))1&i&&(n+=t);return n},Fy=r,By=1..toFixed,jy=Math.floor,Uy=function(e,t,n){return 0===t?n:t%2==1?Uy(e,t-1,n*e):Uy(e*e,t/2,n)},Hy=function(e,t,n){for(var i=-1,r=n;++i<6;)r+=t*e[i],e[i]=r%1e7,r=jy(r/1e7)},Gy=function(e,t){for(var n=6,i=0;--n>=0;)i+=e[n],e[n]=jy(i/t),i=i%t*1e7},Vy=function(e){for(var t=6,n="";--t>=0;)if(""!==n||0===t||0!==e[t]){var i=String(e[t]);n=""===n?i:n+Ny.call("0",7-i.length)+i}return n};Iy({target:"Number",proto:!0,forced:By&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!Fy((function(){By.call({})}))},{toFixed:function(e){var t,n,i,r,o=My(this),s=Dy(e),a=[0,0,0,0,0,0],c="",u="0";if(s<0||s>20)throw RangeError("Incorrect fraction digits");if(o!=o)return"NaN";if(o<=-1e21||o>=1e21)return String(o);if(o<0&&(c="-",o=-o),o>1e-21)if(n=(t=function(e){for(var t=0,n=e;n>=4096;)t+=12,n/=4096;for(;n>=2;)t+=1,n/=2;return t}(o*Uy(2,69,1))-69)<0?o*Uy(2,-t,1):o/Uy(2,t,1),n*=4503599627370496,(t=52-t)>0){for(Hy(a,0,n),i=s;i>=7;)Hy(a,1e7,0),i-=7;for(Hy(a,Uy(10,i,1),0),i=t-1;i>=23;)Gy(a,1<<23),i-=23;Gy(a,1<<i),Hy(a,1,1),Gy(a,2),u=Vy(a)}else Hy(a,0,n),Hy(a,1<<-t,0),u=Vy(a)+Ny.call("0",s);return u=s>0?c+((r=u.length)<=s?"0."+Ny.call("0",s-r)+u:u.slice(0,r-s)+"."+u.slice(r-s)):c+u}});var Wy="press",Ky="pressend",zy="doubleclick",Yy="click",Xy="touchmove",qy="touchstart",$y="touchend",Zy={start:"touchstart",end:"touchend",move:"touchmove",cancel:"touchcancel"},Jy={start:"mousedown",end:"mouseup",move:"mousemove",cancel:"mouseleave"};function Qy(e){return e&&e.length>0?e[e.length-1]:null}function em(e){var t=navigator.userAgent;/(?:iPhone|iPad)/.test(t)&&e.cancelable&&e.preventDefault()}var tm=function(){function e(t){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{eventType:"touch"};In(this,e),this._pos={moving:!1,start:!1,x:0,y:0},this.config={pressDelay:600,dbClickDelay:200,disablePress:!1,disableDbClick:!1,miniStep:2,needPreventDefault:!0},Object.keys(i).map((function(e){n.config[e]=i[e]})),this.root=t,this.events="mouse"===i.eventType?Jy:Zy,this.pressIntrvalId=null,this.dbIntrvalId=null,this.__handlers={},this._initEvent()}return uo(e,[{key:"_initEvent",value:function(){this.onTouchStart=this.onTouchStart.bind(this),this.onTouchMove=this.onTouchMove.bind(this),this.onTouchEnd=this.onTouchEnd.bind(this),this.onTouchCancel=this.onTouchCancel.bind(this),this.root.addEventListener(this.events.start,this.onTouchStart)}},{key:"__setPress",value:function(e){var t=this,n=this.config;this.pressIntrvalId&&this.__clearPress(),this.pressIntrvalId=setTimeout((function(){t.trigger(Wy,e),t._pos.press=!0,t.__clearPress()}),n.pressDelay)}},{key:"__clearPress",value:function(){window.clearTimeout(this.pressIntrvalId),this.pressIntrvalId=null}},{key:"__setDb",value:function(e){var t=this,n=this.config;if(this.dbIntrvalId)return this.__clearDb(),void this.trigger(zy,e);this.dbIntrvalId=setTimeout((function(){t.__clearDb(),t._pos.start||t._pos.press||t._pos.moving||t.trigger(Yy,e)}),n.dbClickDelay)}},{key:"__clearDb",value:function(){clearTimeout(this.dbIntrvalId),this.dbIntrvalId=null}},{key:"on",value:function(e,t){this.__handlers[e]||(this.__handlers[e]=[]),this.__handlers[e].push(t)}},{key:"off",value:function(e,t){if(this.__handlers[e]){for(var n=this.__handlers[e],i=-1,r=0;r<n.length;r++)if(n[r]===t){i=r;break}i>=0&&this.__handlers[e].splice(i,1)}}},{key:"trigger",value:function(e,t){this.__handlers[e]&&this.__handlers[e].map((function(n){try{n(t)}catch(t){console.error("trigger>>:".concat(e),t)}}))}},{key:"onTouchStart",value:function(e){var t=this._pos,n=this.root;this.config.needPreventDefault&&em(e);var i=Qy(e.touches);t.x=i?parseInt(i.pageX,10):e.pageX,t.y=i?parseInt(i.pageX,10):e.pageX,t.start=!0,this.__setPress(e),n.addEventListener(this.events.end,this.onTouchEnd),n.addEventListener(this.events.cancel,this.onTouchCancel),n.addEventListener(this.events.move,this.onTouchMove),this.trigger(qy,e)}},{key:"onTouchCancel",value:function(e){this.onTouchEnd(e)}},{key:"onTouchEnd",value:function(e){var t=this._pos,n=this.root;this.config.needPreventDefault&&em(e),this.__clearPress(),n.removeEventListener(this.events.cancel,this.onTouchCancel),n.removeEventListener(this.events.end,this.onTouchEnd),n.removeEventListener(this.events.move,this.onTouchMove),e.moving=t.moving,e.press=t.press,t.press&&this.trigger(Ky,e),this.trigger($y,e),!t.press&&!t.moving&&this.__setDb(e),t.press=!1,t.start=!1,t.moving=!1}},{key:"onTouchMove",value:function(e){var t=this._pos,n=this.config,i=Qy(e.touches),r=i?parseInt(i.pageX,10):e.pageX,o=i?parseInt(i.pageY,10):e.pageX,s=r-t.x,a=o-t.y;Math.abs(a)<n.miniStep&&Math.abs(s)<n.miniStep||(this.__clearPress(),t.press&&this.trigger(Ky,e),t.press=!1,t.moving=!0,this.trigger(Xy,e))}},{key:"destroy",value:function(){var e=this,t={touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"};Object.keys(t).map((function(n){e.root.removeEventListener("touchend",e[t[n]])}))}}]),e}();function nm(){return(new DOMParser).parseFromString('<svg width="20" height="9" viewBox="0 0 8 9" fill="none" xmlns="http://www.w3.org/2000/svg"\n xmlns:xlink="http://www.w3.org/1999/xlink">\n <path opacity="0.54"\n d="M7.5 3.63397C8.16667 4.01887 8.16667 4.98113 7.5 5.36603L1.5 8.83013C0.833334 9.21503 0 8.7339 0 7.9641L0 1.0359C0 0.266098 0.833333 -0.215027 1.5 0.169873L7.5 3.63397Z"\n fill="white" />\n <path transform="translate(5 0)" d="M7.5 3.63397C8.16667 4.01887 8.16667 4.98113 7.5 5.36603L1.5 8.83013C0.833334 9.21503 0 8.7339 0 7.9641L0 1.0359C0 0.266098 0.833333 -0.215027 1.5 0.169873L7.5 3.63397Z" fill="white"/>\n</svg>',"image/svg+xml").firstChild}function im(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=jn(e);if(t){var r=jn(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Bn(this,n)}}var rm="auto",om="seeking",sm="playbackrate",am=["videoClick","videoDbClick"],cm=function(e){Mn(n,e);var t=im(n);function n(e){var i;return In(this,n),Un(Fn(i=t.call(this,e)),"onTouchStart",(function(e){var t=Fn(i),n=t.player,r=t.config,o=t.pos,s=t.playerConfig,a=i.getTouche(e);if(a&&!r.disableGesture&&i.duration>0&&!n.ended){o.isStart=!0,Ap.checkIsFunction(s.disableSwipeHandler)&&s.disableSwipeHandler(),i.find(".xg-dur").innerHTML=Ap.format(i.duration);var c=i.root.getBoundingClientRect();90===n.rotateDeg?(o.top=c.left,o.left=c.top,o.width=c.height,o.height=c.width):(o.top=c.top,o.left=c.left,o.width=c.width,o.height=c.height);var u=parseInt(a.pageX-o.left,10),l=parseInt(a.pageY-o.top,10);o.x=90===n.rotateDeg?l:u,o.y=90===n.rotateDeg?u:l,o.scopeL=r.scopeL*o.width,o.scopeR=(1-r.scopeR)*o.width,o.scopeM1=o.width*(1-r.scopeM)/2,o.scopeM2=o.width-o.scopeM1}})),Un(Fn(i),"onTouchMove",(function(e){var t=i.getTouche(e),n=Fn(i),r=n.pos,o=n.config,s=n.player;if(t&&!o.disableGesture&&i.duration&&r.isStart){var a=o.miniMoveStep,c=o.hideControlsActive,u=parseInt(t.pageX-r.left,10),l=parseInt(t.pageY-r.top,10),f=90===s.rotateDeg?l:u,h=90===s.rotateDeg?u:l;if(Math.abs(f-r.x)>a||Math.abs(h-r.y)>a){var d=f-r.x,p=h-r.y,g=r.scope;if(-1===g&&(0===(g=i.checkScope(f,h,d,p,r))&&(c?s.blur():s.focus({autoHide:!1}),!r.time&&(r.time=parseInt(1e3*s.currentTime,10)+1e3*i.timeOffset)),r.scope=g),-1===g||g>0&&!o.gestureY||0===g&&!o.gestureX)return;e.cancelable&&e.preventDefault(),i.executeMove(d,p,g,r.width,r.height),r.x=f,r.y=h}}})),Un(Fn(i),"onTouchEnd",(function(e){var t=Fn(i),n=t.player,r=t.pos,o=t.playerConfig;r.isStart&&(r.scope>-1&&e.cancelable&&e.preventDefault(),i.endLastMove(r.scope),setTimeout((function(){n.getPlugin("progress")&&n.getPlugin("progress").resetSeekState()}),10),r.scope=-1,i.resetPos(),Ap.checkIsFunction(o.enableSwipeHandler)&&o.enableSwipeHandler(),i.changeAction(rm))})),Un(Fn(i),"onRootTouchMove",(function(e){!i.config.disableGesture&&i.config.gestureX&&i.checkIsRootTarget(e)&&(e.stopPropagation(),i.pos.isStart?i.onTouchMove(e):i.onTouchStart(e))})),Un(Fn(i),"onRootTouchEnd",(function(e){if(i.pos.isStart&&i.checkIsRootTarget(e)){e.stopPropagation(),i.onTouchEnd(e);var t=i.player.controls;t&&t.recoverAutoHide()}})),i.pos={isStart:!1,x:0,y:0,time:0,volume:0,rate:1,light:0,width:0,height:0,scopeL:0,scopeR:0,scopeM1:0,scopeM2:0,scope:-1},i.timer=null,i}return uo(n,[{key:"duration",get:function(){return this.playerConfig.customDuration||this.player.duration}},{key:"timeOffset",get:function(){return this.playerConfig.timeOffset||0}},{key:"registerIcons",value:function(){return{seekTipIcon:{icon:nm,class:"xg-seek-pre"}}}},{key:"afterCreate",value:function(){var e=this;am.map((function(t){e.__hooks[t]=null}));var t=this.playerConfig,n=this.config,i=this.player;!0===t.closeVideoDblclick&&(n.closedbClick=!0),this.resetPos(),Ap.isUndefined(t.disableGesture)||(n.disableGesture=!!t.disableGesture),this.appendChild(".xg-seek-icon",this.icons.seekTipIcon),this.xgMask=Ap.createDom("xg-mask","",{},"xgmask"),i.root.appendChild(this.xgMask),this.initCustomStyle(),this.registerThumbnail();var r="mouse"===this.domEventType?"mouse":"touch";this.touch=new tm(this.root,{eventType:r,needPreventDefault:!this.config.disableGesture}),this.root.addEventListener("contextmenu",(function(e){e.preventDefault()})),i.root.addEventListener("touchmove",this.onRootTouchMove,!0),i.root.addEventListener("touchend",this.onRootTouchEnd,!0),this.on(Jp,(function(){var t=e.player,n=e.config;1e3*t.duration<n.moveDuration&&(n.moveDuration=1e3*t.duration)})),this.on([Zp,Wp],(function(){var t=e.pos,n=t.time;!t.isStart&&n>0&&(e.pos.time=0)}));var o={touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd",press:"onPress",pressend:"onPressEnd",click:"onClick",doubleclick:"onDbClick"};if(Object.keys(o).map((function(t){e.touch.on(t,(function(n){e[o[t]](n)}))})),!n.disableActive){var s=i.plugins.progress;s&&(s.addCallBack("dragmove",(function(t){e.activeSeekNote(t.currentTime,t.forward)})),s.addCallBack("dragend",(function(){e.changeAction(rm)})))}}},{key:"registerThumbnail",value:function(){var e=this.player.plugins.thumbnail;if(e&&e.usable){this.thumbnail=e.createThumbnail(null,"mobile-thumbnail");var t=this.find(".time-preview");t.insertBefore(this.thumbnail,t.children[0])}}},{key:"initCustomStyle",value:function(){var e=(this.playerConfig||{}).commonStyle,t=e.playedColor,n=e.progressColor;t&&(this.find(".xg-curbar").style.backgroundColor=t,this.find(".xg-cur").style.color=t),n&&(this.find(".xg-bar").style.backgroundColor=n,this.find(".time-preview").style.color=n),this.config.disableTimeProgress&&Ap.addClass(this.find(".xg-timebar"),"hide")}},{key:"resetPos",value:function(){var e=this;this.pos?(this.pos.isStart=!1,this.pos.scope=-1,["x","y","width","height","scopeL","scopeR","scopeM1","scopeM2"].map((function(t){e.pos[t]=0}))):this.pos={isStart:!1,x:0,y:0,volume:0,rate:1,light:0,width:0,height:0,scopeL:0,scopeR:0,scopeM1:0,scopeM2:0,scope:-1,time:0}}},{key:"changeAction",value:function(e){var t=this.player;this.root.setAttribute("data-xg-action",e);var n=t.plugins.start;n&&n.recover()}},{key:"getTouche",value:function(e){this.player.rotateDeg;var t=e.touches&&e.touches.length>0?e.touches[e.touches.length-1]:e;return{pageX:t.pageX,pageY:t.pageY}}},{key:"checkScope",value:function(e,t,n,i,r){var o=r.width,s=-1;if(e<0||e>o)return s;var a=0===i?Math.abs(n):Math.abs(n/i);return Math.abs(n)>0&&a>=1.73&&e>r.scopeM1&&e<r.scopeM2?s=0:(0===Math.abs(n)||a<=.57)&&(s=e<r.scopeL?1:e>r.scopeR?2:3),s}},{key:"executeMove",value:function(e,t,n,i,r){switch(n){case 0:this.updateTime(e/i*this.config.scopeM);break;case 1:this.updateBrightness(t/r);break;case 2:Bp.os.isIos||this.updateVolume(t/r)}}},{key:"endLastMove",value:function(e){var t=this,n=this.pos,i=this.player,r=this.config,o=(n.time-this.timeOffset)/1e3;switch(e){case 0:i.seek(Number(o).toFixed(1)),r.hideControlsEnd?i.blur():i.focus(),this.timer=setTimeout((function(){t.pos.time=0}),500)}this.changeAction(rm)}},{key:"checkIsRootTarget",value:function(e){var t=this.player.plugins||{};return(!t.progress||!t.progress.root.contains(e.target))&&(t.start&&t.start.root.contains(e.target)||t.controls&&t.controls.root.contains(e.target))}},{key:"clickHandler",value:function(e){var t=this.player,n=this.config,i=this.playerConfig;t.isPlaying?!n.closedbClick||i.closeVideoClick?t.isActive?t.blur():t.focus():i.closeVideoClick||((t.isActive||n.focusVideoClick)&&(this.emitUserAction("click","switch_play_pause"),this.switchPlayPause()),t.focus()):i.closeVideoClick||(this.emitUserAction("click","switch_play_pause"),t.play())}},{key:"dbClickHandler",value:function(e){var t=this.config,n=this.player;!t.closedbClick&&n.isPlaying&&(this.emitUserAction("dblclick","switch_play_pause"),this.switchPlayPause())}},{key:"onClick",value:function(e){var t=this,n=this.player;ev(this,am[0],(function(e,n){t.clickHandler(n.e)}),{e:e,paused:n.paused})}},{key:"onDbClick",value:function(e){var t=this,n=this.player;ev(this,am[1],(function(e,n){t.dbClickHandler(n.e)}),{e:e,paused:n.paused})}},{key:"onPress",value:function(e){var t=this.pos,n=this.config,i=this.player;n.disablePress||(t.rate=this.player.playbackRate,this.emitUserAction("press","change_rate",{from:i.playbackRate,to:n.pressRate}),i.playbackRate=n.pressRate,this.changeAction(sm))}},{key:"onPressEnd",value:function(e){var t=this.pos,n=this.config,i=this.player;n.disablePress||(this.emitUserAction("pressend","change_rate",{from:i.playbackRate,to:t.rate}),i.playbackRate=t.rate,t.rate=1,this.changeAction(rm))}},{key:"updateTime",value:function(e){var t=this.player,n=this.config,i=this.player.duration;e=Number(e.toFixed(4));var r=parseInt(e*n.moveDuration,10)+this.timeOffset;r=(r+=this.pos.time)<0?0:r>1e3*i?1e3*i-200:r,t.getPlugin("time")&&t.getPlugin("time").updateTime(r/1e3),t.getPlugin("progress")&&t.getPlugin("progress").updatePercent(r/1e3/this.duration,!0),this.activeSeekNote(r/1e3,e>0),n.isTouchingSeek&&t.seek(Number((r-this.timeOffset)/1e3).toFixed(1)),this.pos.time=r}},{key:"updateVolume",value:function(e){this.player.rotateDeg&&(e=-e);var t=this.player,n=this.pos;if(e=parseInt(100*e,10),n.volume+=e,!(Math.abs(n.volume)<10)){var i=parseInt(10*t.volume,10)-parseInt(n.volume/10,10);i=i>10?10:i<1?0:i,t.volume=i/10,n.volume=0}}},{key:"updateBrightness",value:function(e){this.player.rotateDeg&&(e=-e);var t=this.pos,n=this.config,i=this.xgMask,r=t.light+.8*e;r=r>n.maxDarkness?n.maxDarkness:r<0?0:r,i&&(i.style.backgroundColor="rgba(0,0,0,".concat(r,")")),t.light=r}},{key:"activeSeekNote",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.player,i=this.config,r=!(this.duration!==1/0&&this.duration>0);if(e&&"number"==typeof e&&!r&&!i.disableActive){e<0?e=0:e>n.duration&&(e=n.duration-.2),this.changeAction(om);var o=n.plugins.start;o&&o.focusHide(),this.find(".xg-dur").innerHTML=Ap.format(this.duration),this.find(".xg-cur").innerHTML=Ap.format(e),this.find(".xg-curbar").style.width="".concat(e/this.duration*100,"%"),t?Ap.removeClass(this.find(".xg-seek-show"),"xg-back"):Ap.addClass(this.find(".xg-seek-show"),"xg-back"),this.updateThumbnails(e)}}},{key:"updateThumbnails",value:function(e){var t=this.player.plugins.thumbnail;t&&t.usable&&this.thumbnail&&t.update(this.thumbnail,e,160,90)}},{key:"switchPlayPause",value:function(){var e=this.player;if(!e.hasStart)return!1;e.ended||(e.paused?e.play():e.pause())}},{key:"disableGesture",value:function(){this.config.disableGesture=!1}},{key:"enableGesture",value:function(){this.config.disableGesture=!0}},{key:"destroy",value:function(){var e=this.player;this.timer&&clearTimeout(this.timer),this.thumbnail=null,e.root.removeChild(this.xgMask),this.xgMask=null,this.touch&&this.touch.destroy(),this.touch=null,e.root.removeEventListener("touchmove",this.onRootTouchMove,!0),e.root.removeEventListener("touchend",this.onRootTouchEnd,!0)}},{key:"render",value:function(){var e="normal"!==this.config.gradient?"gradient ".concat(this.config.gradient):"gradient";return'\n <xg-trigger class="trigger">\n <div class="'.concat(e,'"></div>\n <div class="time-preview">\n <div class="xg-seek-show ').concat(this.config.disableSeekIcon?" hide-seek-icon":"",'">\n <i class="xg-seek-icon"></i>\n <span class="xg-cur">00:00</span>\n <span>/</span>\n <span class="xg-dur">00:00</span>\n </div>\n <div class="xg-bar xg-timebar">\n <div class="xg-curbar"></div>\n </div>\n </div>\n <div class="xg-playbackrate xg-top-note">\n <span><i>').concat(this.config.pressRate,"X</i>").concat(this.i18n.FORWARD,"</span>\n </div>\n </xg-trigger>\n ")}}],[{key:"pluginName",get:function(){return"mobile"}},{key:"defaultConfig",get:function(){return{stopPropagation:!0,index:0,disableGesture:!1,gestureX:!0,gestureY:!0,updateGesture:function(){},onTouchStart:function(){},onTouchEnd:function(){},gradient:"normal",isTouchingSeek:!1,miniMoveStep:5,miniYPer:5,scopeL:.25,scopeR:.25,scopeM:.9,pressRate:2,darkness:!0,maxDarkness:.8,disableActive:!1,disableTimeProgress:!1,hideControlsActive:!1,hideControlsEnd:!1,moveDuration:36e4,closedbClick:!1,disablePress:!0,disableSeekIcon:!1,focusVideoClick:!1}}}]),n}(vv);function um(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function lm(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=jn(e);if(t){var r=jn(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Bn(this,n)}}function fm(e){e.preventDefault(),e.returnValue=!1}function hm(e){var t=e.tagName;return!("INPUT"!==t&&"TEXTAREA"!==t&&!e.isContentEditable)}var dm=function(e){Mn(n,e);var t=lm(n);function n(){var e;In(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Un(Fn(e=t.call.apply(t,[this].concat(r))),"onBodyKeyDown",(function(t){var n=t||window.event;if(e.player&&(e.player.isUserActive||e.config.isIgnoreUserActive)&&!(e.config.disable||e.config.disableBodyTrigger||!e.checkIsVisible()||n.metaKey||n.altKey||n.ctrlKey)){var i=n.keyCode;return!(n.target!==document.body&&(!e.config.isGlobalTrigger||hm(n.target))||!e.checkCode(i,!0))&&(fm(n),e.handleKeyCode(i,t),!1)}})),Un(Fn(e),"onKeydown",(function(t){var n=t||window.event;if(!(e.config.disable||e.config.disableRootTrigger||n.metaKey||n.altKey||n.ctrlKey)&&(e.player.isUserActive||e.config.isIgnoreUserActive)){if(!n||37!==n.keyCode&&!e.checkCode(n.keyCode)||n.target!==e.player.root&&n.target!==e.player.video&&n.target!==e.player.controls.el)return!0;fm(n),e.handleKeyCode(n.keyCode,t)}})),e}return uo(n,[{key:"mergekeyCodeMap",value:function(){var e=this,t=this.config.keyCodeMap;t&&Object.keys(t).map((function(n){e.keyCodeMap[n]?["keyCode","action","disable","isBodyTarget"].map((function(i){t[n][i]&&(e.keyCodeMap[n][i]=t[n][i])})):e.keyCodeMap[n]=t[n]}))}},{key:"afterCreate",value:function(){this.config.disable=!this.playerConfig.keyShortcut;var e="function"==typeof this.config.seekStep?this.config.seekStep(this.player):this.config.seekStep;e&&"number"==typeof e&&(this.seekStep=e),this.keyCodeMap={space:{keyCode:32,action:"playPause",disable:!1,noBodyTarget:!1},up:{keyCode:38,action:"upVolume",disable:!1,noBodyTarget:!0},down:{keyCode:40,action:"downVolume",disable:!1,noBodyTarget:!0},left:{keyCode:37,action:"seekBack",disable:!1},right:{keyCode:39,action:"seek",disable:!1},esc:{keyCode:27,action:"exitFullscreen",disable:!1}},this.mergekeyCodeMap(),this.player.root.addEventListener("keydown",this.onKeydown),document.addEventListener("keydown",this.onBodyKeyDown)}},{key:"checkIsVisible",value:function(){if(!this.config.checkVisible)return!0;var e=this.player.root.getBoundingClientRect(),t=e.height,n=e.top,i=e.bottom,r=window.innerHeight;return!(n<0&&n<0-.9*t||i>0&&i-r>.9*t)}},{key:"checkCode",value:function(e,t){var n=this,i=!1;return Object.keys(this.keyCodeMap).map((function(r){n.keyCodeMap[r]&&e===n.keyCodeMap[r].keyCode&&!n.keyCodeMap[r].disable&&(i=!t||t&&!n.keyCodeMap[r].noBodyTarget)})),i}},{key:"downVolume",value:function(e){var t=this.player,n=parseFloat((t.volume-.1).toFixed(1)),i={volume:{from:t.volume,to:n}};this.emitUserAction(e,"change_volume",{props:i}),t.volume=n>=0?n:0}},{key:"upVolume",value:function(e){var t=this.player,n=parseFloat((t.volume+.1).toFixed(1)),i={volume:{from:t.volume,to:n}};this.emitUserAction(e,"change_volume",{props:i}),t.volume=n<=1?n:1}},{key:"seek",value:function(e){var t=this.player,n=t.currentTime,i=t.duration,r=n,o={currentTime:{from:n,to:r=n+this.seekStep<=i?n+this.seekStep:i-1}};this.emitUserAction(e,"seek",{props:o}),this.player.currentTime=r}},{key:"seekBack",value:function(e){var t=this.player.currentTime,n=0;t-this.seekStep>=0&&(n=t-this.seekStep);var i={currentTime:{from:t,to:n}};this.emitUserAction(e,"seek",{props:i}),this.player.currentTime=n}},{key:"playPause",value:function(e){var t=this.player;t&&(this.emitUserAction(e,"switch_play_pause"),t.paused?t.play():t.pause())}},{key:"exitFullscreen",value:function(e){var t=this.player,n=t.isCssfullScreen,i=t.fullscreen;i&&(t.exitFullscreen(),this.emitUserAction("keyup","switch_fullscreen",{fullscreen:i})),n&&(t.exitCssFullscreen(),this.emitUserAction("keyup","switch_css_fullscreen",{cssfullscreen:n}))}},{key:"handleKeyCode",value:function(e,t){var n=this;Object.keys(this.keyCodeMap).map((function(i){var r=n.keyCodeMap[i],o=r.action,s=r.keyCode,a=r.disable;s!==e||a||("function"==typeof o?o(t,n.player):"string"==typeof o&&"function"==typeof n[o]&&n[o](t,n.player),n.emit(Tg,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?um(Object(n),!0).forEach((function(t){Un(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):um(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({key:i,target:t.target},n.keyCodeMap[i])))}))}},{key:"destroy",value:function(){this.player.root.removeEventListener("keydown",this.onKeydown),document.removeEventListener("keydown",this.onBodyKeyDown)}},{key:"disable",value:function(){this.config.disable=!0}},{key:"enable",value:function(){this.config.disable=!1}}],[{key:"pluginName",get:function(){return"keyboard"}},{key:"defaultConfig",get:function(){return{seekStep:10,checkVisible:!0,disableBodyTrigger:!1,disableRootTrigger:!1,isGlobalTrigger:!1,keyCodeMap:{},disable:!1,isIgnoreUserActive:!1}}}]),n}(rv);function pm(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="-5 -5 110 110">\n <path d="M100,50A50,50,0,1,1,50,0" stroke-width="5" stroke="#ddd" stroke-dasharray="236" fill="none"></path>\n</svg>\n',"image/svg+xml").firstChild}function gm(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=jn(e);if(t){var r=jn(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Bn(this,n)}}var vm=function(e){Mn(n,e);var t=gm(n);function n(){return In(this,n),t.apply(this,arguments)}return uo(n,[{key:"registerIcons",value:function(){return{loadingIcon:pm}}},{key:"afterCreate",value:function(){this.appendChild("xg-loading-inner",this.icons.loadingIcon)}},{key:"render",value:function(){return'\n <xg-loading class="xgplayer-loading">\n <xg-loading-inner></xg-loading-inner>\n </xg-loading>'}}],[{key:"pluginName",get:function(){return"loading"}},{key:"defaultConfig",get:function(){return{position:hv.ROOT}}}]),n}(vv),ym=Xt,mm=ji.findIndex,km=bf,bm="findIndex",wm=!0;bm in[]&&Array(1).findIndex((function(){wm=!1})),ym({target:"Array",proto:!0,forced:wm},{findIndex:function(e){return mm(this,e,arguments.length>1?arguments[1]:void 0)}}),km(bm);var Cm=[{tag:"xg-cache",className:"xgplayer-progress-cache",styleKey:"cachedColor"},{tag:"xg-played",className:"xgplayer-progress-played",styleKey:"playedColor"}],xm=function(){function e(t){In(this,e),this.fragments=t.fragments||[],this.focusClass="inner-focus",this.style=t.style||{playedColor:"",cachedColor:"",progressColor:""},this.duration=0,this.cachedIndex=0,this.playedIndex=0}return uo(e,[{key:"updateDuration",value:function(e){var t=this;this.duration=parseInt(1e3*e);var n=0,i=this.fragments;this.fragments=i.map((function(e){return e.start=n,e.end=n+e.percent*t.duration,e.duration=e.percent*t.duration,n+=e.percent*t.duration,e}))}},{key:"updateProgress",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"played",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{newIndex:0,curIndex:0,millisecond:0},n=this.progressList,i=this.fragments,r=t.newIndex,o=t.curIndex,s=t.millisecond;r!==o&&n.map((function(t,n){n<r?t[e].style.width="100%":n>r&&(t[e].style.width=0)}));var a=i[r],c=0===s?0:(s-a.start)/a.duration;n[r][e].style.width=c<0?0:"".concat(100*c,"%")}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{cached:0,played:0},t=arguments.length>1?arguments[1]:void 0;if(!this.duration||parseInt(1e3*t,10)!==this.duration){if(!t&&0!==t)return;this.updateDuration(t)}var n=this.playedIndex,i=this.cachedIndex;if("Undefined"!==Ap.typeOf(e.played)){var r=this.findIndex(1e3*e.played,n);this.updateProgress("played",{newIndex:r,curIndex:n,millisecond:parseInt(1e3*e.played,10)}),this.playedIndex=r}if("Undefined"!==Ap.typeOf(e.cached)){var o=this.findIndex(1e3*e.cached,i);this.updateProgress("cached",{newIndex:o,curIndex:i,millisecond:parseInt(1e3*e.cached,10)}),this.cachedIndex=o}}},{key:"findIndex",value:function(e,t){var n=this.fragments;return 1===n.length?0:(e>n[t].start&&e<n[t].end||this.fragments.map((function(n,i){e>n.start&&e<=n.end&&(t=i)})),t)}},{key:"findHightLight",value:function(){for(var e=this.root.children,t=0;t<e.length;t++)if(Ap.hasClass(e[t],this.focusClass))return{dom:e[t],pos:e[t].getBoundingClientRect()}}},{key:"findFragment",value:function(e){var t=this.root.children;return e<0||e>=t.length?null:{dom:t[e],pos:t[e].getBoundingClientRect()}}},{key:"unHightLight",value:function(){for(var e=this.root.children,t=0;t<e.length;t++)Ap.removeClass(e[t],this.focusClass)}},{key:"setHightLight",value:function(e){var t=this.root.children;if(e<t.length)return Ap.addClass(t[e],this.focusClass),{dom:t[e],pos:t[e].getBoundingClientRect()}}},{key:"destroy",value:function(){this.progressList=null,this.fragments=null,this.root.innerHTML=""}},{key:"render",value:function(){var e=this,t=this.style.progressColor;return this.root=Ap.createDom("xg-inners","",{},"progress-list"),this.fragments&&(this.progressList=this.fragments.map((function(n){var i=Ap.createDom("xg-inner","",{style:t?"background:".concat(t,"; flex: ").concat(n.percent):"flex: ".concat(n.percent)},"".concat(n.isFocus?"inner-focus":""," xgplayer-progress-inner"));return e.root.appendChild(i),Cm.map((function(t){i.appendChild(Ap.createDom(t.tag,"",{style:t.styleKey?"background: ".concat(e.style[t.styleKey],"; width:0;"):"width:0;"},t.className))})),{cached:i.children[0],played:i.children[1]}}))),this.root}}]),e}();function _m(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=jn(e);if(t){var r=jn(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Bn(this,n)}}var Sm=function(e){Mn(n,e);var t=_m(n);function n(e){var i;return In(this,n),Un(Fn(i=t.call(this,e)),"onMoveOnly",(function(e,t){var n=Fn(i),r=n.pos,o=n.config,s=n.player,a=t;if(e){Ap.event(e);var c=Ap.getEventPos(e,s.zoom),u=90===s.rotateDeg?c.clientY:c.clientX;if(r.moving&&Math.abs(r.x-u)<o.miniMoveStep)return;r.moving=!0,r.x=u,a=i.computeTime(e,u)}i.triggerCallbacks("dragmove",a,e)})),Un(Fn(i),"onBodyClick",(function(e){e.preventDefault(),e.stopPropagation()})),Un(Fn(i),"_mouseDownHandler",(function(e,t){i._state.time=t.currentTime,i.updateWidth(t.currentTime,t.percent,0)})),Un(Fn(i),"_mouseUpHandler",(function(e,t){Fn(i).pos.moving&&i.updateWidth(t.currentTime,t.percent,2)})),Un(Fn(i),"_mouseMoveHandler",(function(e,t){var n=Fn(i),r=n._state,o=n.pos,s=n.config,a=n.player;r.time<t.currentTime?t.forward=!0:t.forward=!1,r.time=t.currentTime,o.isDown&&!o.moving&&(o.moving=!0,s.isPauseMoving&&a.pause(),i.triggerCallbacks("dragstart",t,e),i.emitUserAction("drag","dragstart",t)),i.updateWidth(t.currentTime,t.percent,1),i.triggerCallbacks("dragmove",t,e)})),Un(Fn(i),"onMouseDown",(function(e){var t=Fn(i),n=t._state,r=t.player,o=t.pos,s=t.config,a=t.playerConfig,c=Ap.getEventPos(e,r.zoom),u=90===r.rotateDeg?c.clientY:c.clientX;if(!(r.isMini||s.closeMoveSeek||!a.allowSeekAfterEnded&&r.ended)){e.stopPropagation(),i.focus(),Ap.checkIsFunction(a.disableSwipeHandler)&&a.disableSwipeHandler(),Ap.checkIsFunction(s.onMoveStart)&&s.onMoveStart(),Ap.event(e),o.x=u,o.isDown=!0,o.moving=!1,n.prePlayTime=r.currentTime,r.focus({autoHide:!1}),i.isProgressMoving=!0,Ap.addClass(i.progressBtn,"active");var l=i.computeTime(e,u);return l.prePlayTime=n.prePlayTime,i._mouseDownHandlerHook(e,l),"touchstart"===e.type?(i.root.addEventListener("touchmove",i.onMouseMove),i.root.addEventListener("touchend",i.onMouseUp)):(i.unbind("mousemove",i.onMoveOnly),document.addEventListener("mousemove",i.onMouseMove,!1),document.addEventListener("mouseup",i.onMouseUp,!1),r.root.addEventListener("click",i.onBodyClick,!1)),!0}})),Un(Fn(i),"onMouseUp",(function(e){var t=Fn(i),n=t.player,r=t.config,o=t.pos,s=t.playerConfig,a=t._state;e.stopPropagation(),e.preventDefault(),Ap.checkIsFunction(s.enableSwipeHandler)&&s.enableSwipeHandler(),Ap.checkIsFunction(r.onMoveEnd)&&r.onMoveEnd(),Ap.event(e),Ap.removeClass(i.progressBtn,"active");var c=i.computeTime(e,o.x);c.prePlayTime=a.prePlayTime,o.moving?(i.triggerCallbacks("dragend",c,e),i.emitUserAction("drag","dragend",c)):(i.triggerCallbacks("click",c,e),i.emitUserAction("click","click",c)),i._mouseUpHandlerHook(e,c),o.moving=!1,o.isDown=!1,o.x=0,o.y=0,a.prePlayTime=0,a.time=0,"touchend"===e.type?(i.root.removeEventListener("touchmove",i.onMouseMove),i.root.removeEventListener("touchend",i.onMouseUp),i.blur()):(document.removeEventListener("mousemove",i.onMouseMove,!1),document.removeEventListener("mouseup",i.onMouseUp,!1),n.root.removeEventListener("click",i.onBodyClick,!1),o.isEnter?"mobile"!==s.isMobileSimulateMode&&i.bind("mousemove",i.onMoveOnly):i.onMouseLeave(e)),Ap.setTimeout(Fn(i),(function(){i.resetSeekState()}),10),n.focus()})),Un(Fn(i),"onMouseMove",(function(e){var t=Fn(i),n=t._state,r=t.pos,o=t.player,s=t.config;Ap.checkTouchSupport()&&e.preventDefault(),Ap.event(e);var a=Ap.getEventPos(e,o.zoom),c=90===o.rotateDeg?a.clientY:a.clientX,u=Math.abs(r.x-c);if(!(r.moving&&u<s.miniMoveStep||!r.moving&&u<s.miniStartStep)){r.x=c;var l=i.computeTime(e,c);l.prePlayTime=n.prePlayTime,i._mouseMoveHandlerHook(e,l)}})),Un(Fn(i),"onMouseOut",(function(e){i.triggerCallbacks("mouseout",null,e)})),Un(Fn(i),"onMouseOver",(function(e){i.triggerCallbacks("mouseover",null,e)})),Un(Fn(i),"onMouseEnter",(function(e){var t=Fn(i),n=t.player,r=t.pos;if(!(r.isDown||r.isEnter||n.isMini||!n.config.allowSeekAfterEnded&&n.ended)){r.isEnter=!0,i.bind("mousemove",i.onMoveOnly),i.bind("mouseleave",i.onMouseLeave),Ap.event(e);var o=Ap.getEventPos(e,n.zoom),s=90===n.rotateDeg?o.clientY:o.clientX,a=i.computeTime(e,s);i.triggerCallbacks("mouseenter",a,e),i.focus()}})),Un(Fn(i),"onMouseLeave",(function(e){i.triggerCallbacks("mouseleave",null,e);var t=Fn(i),n=t.player,r=t.pos;r.isEnter=!1,n.isMini||(i.unbind("mousemove",i.onMoveOnly),r.isDown?i.unbind("mouseleave",i.onMouseLeave):i.blur())})),Un(Fn(i),"onVideoResize",(function(){var e=i.pos,t=e.x,n=e.isDown;if(e.isEnter&&!n){var r=i.computeTime(null,t);i.onMoveOnly(null,r)}})),i.useable=!1,i.isProgressMoving=!1,i.__dragCallBacks=[],i._state={now:-1,direc:0,time:0,prePlayTime:-1},i._disableBlur=!1,i}return uo(n,[{key:"duration",get:function(){return this.playerConfig.customDuration||this.player.duration}},{key:"timeOffset",get:function(){return this.playerConfig.timeOffset||0}},{key:"changeState",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.useable=e}},{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.progress&&(e.config.disable=!e.player.config.progress)}},{key:"createInner",value:function(){var e=this;this.innerList=new xm({fragments:this.config.fragments,style:this.playerConfig.commonStyle||{}}),this.outer.insertBefore(this.innerList.render(),this.outer.children[0]),["findHightLight","unHightLight","setHightLight","findFragment"].map((function(t){e[t]=e.innerList[t].bind(e.innerList)}))}},{key:"afterCreate",value:function(){var e=this;this.config.disable||this.playerConfig.isLive||(this.pos={x:0,y:0,moving:!1,isDown:!1,isEnter:!1},this.outer=this.find("xg-outer"),this.createInner(),"mobile"===Bp.device&&(this.config.isDragingSeek=!1,this.isMobile=!0),this.progressBtn=this.find(".xgplayer-progress-btn"),this.on(Jp,(function(){e.onMouseLeave()})),this.on(qp,(function(){e.onTimeupdate()})),this.on(Xp,(function(){e.onTimeupdate(),e.onCacheUpdate()})),this.on(ng,(function(){e.onCacheUpdate()})),this.on(Wp,(function(){e.onCacheUpdate(),e._state.now=0})),this.on(rg,(function(){e.onReset()})),this.on(wg,(function(){e.onVideoResize()})),this.bindDomEvents(),this.initCustomStyle())}},{key:"initCustomStyle",value:function(){var e=(this.playerConfig||{}).commonStyle.sliderBtnStyle,t=this.progressBtn;e&&("string"==typeof e?t.style.boxShadow=e:"object"===Nn(e)&&Object.keys(e).map((function(n){t.style[n]=e[n]})))}},{key:"triggerCallbacks",value:function(e,t,n){this.__dragCallBacks.length>0&&this.__dragCallBacks.map((function(i){if(i&&i.handler&&i.type===e)try{i.handler(t,n)}catch(e){console.error("[XGPLAYER][triggerCallbacks] ".concat(i," error"),e)}}))}},{key:"addCallBack",value:function(e,t){t&&"function"==typeof t&&this.__dragCallBacks.push({type:e,handler:t})}},{key:"removeCallBack",value:function(e,t){var n=this.__dragCallBacks,i=-1;n.map((function(n,r){n&&n.type===e&&n.handler===t&&(i=r)})),i>-1&&n.splice(i,1)}},{key:"bindDomEvents",value:function(){var e=this.player,t=e.controls,n=e.config;this._mouseDownHandlerHook=this.hook("dragstart",this._mouseDownHandler),this._mouseUpHandlerHook=this.hook("dragend",this._mouseUpHandler),this._mouseMoveHandlerHook=this.hook("drag",this._mouseMoveHandler),"touch"!==this.domEventType&&"compatible"!==this.domEventType||(this.root.addEventListener("touchstart",this.onMouseDown),t&&(t.root&&t.root.addEventListener("touchmove",Ap.stopPropagation),t.center&&t.center.addEventListener("touchend",Ap.stopPropagation))),"mouse"!==this.domEventType&&"compatible"!==this.domEventType||(this.bind("mousedown",this.onMouseDown),"mobile"!==n.isMobileSimulateMode&&this.bind("mouseenter",this.onMouseEnter),this.bind("mouseover",this.onMouseOver),this.bind("mouseout",this.onMouseOut))}},{key:"focus",value:function(){this.player.controls.pauseAutoHide(),Ap.addClass(this.root,"active")}},{key:"blur",value:function(){this._disableBlur||(this.player.controls.recoverAutoHide(),Ap.removeClass(this.root,"active"))}},{key:"disableBlur",value:function(){this._disableBlur=!0}},{key:"enableBlur",value:function(){this._disableBlur=!1}},{key:"updateWidth",value:function(e,t,n){var i=this.config,r=this.player;if(!i.isCloseClickSeek||0!==n){var o=e>=r.duration?r.duration-i.endedDiff:Number(e).toFixed(1);this.updatePercent(t),this.updateTime(e),(1!==n||i.isDragingSeek&&"audio"!==r.videoConfig.mediaType)&&(this._state.now=o,this._state.direc=o>r.currentTime?0:1,r.seek(o))}}},{key:"computeTime",value:function(e,t){var n,i,r=this.player,o=this.root.getBoundingClientRect(),s=o.width,a=o.height,c=o.top,u=o.left,l=t;90===r.rotateDeg?(n=a,i=c):(n=s,i=u);var f=l-i,h=(f=f>n?n:f<0?0:f)/n;return{percent:h=h<0?0:h>1?1:h,currentTime:parseInt(h*this.duration*1e3,10)/1e3,offset:f,width:n,left:i,e:e}}},{key:"updateTime",value:function(e){var t=this.player,n=this.duration;e>n?e=n:e<0&&(e=0);var i=t.plugins.time;i&&i.updateTime(e)}},{key:"resetSeekState",value:function(){this.isProgressMoving=!1;var e=this.player.plugins.time;e&&e.resetActive()}},{key:"updatePercent",value:function(e,t){if(this.isProgressMoving=!0,!this.config.disable){e=e>1?1:e<0?0:e,this.progressBtn.style.left="".concat(100*e,"%"),this.innerList.update({played:e*this.duration},this.duration);var n=this.player.plugins.miniprogress;n&&n.update({played:e*this.duration},this.duration)}}},{key:"onTimeupdate",value:function(){var e=this.player,t=this._state,n=this.duration;if(!e.isSeeking&&!this.isProgressMoving&&e.hasStart){if(t.now>-1){var i=parseInt(1e3*t.now,10)-parseInt(1e3*e.currentTime,10);if(0===t.direc&&i>300||1===t.direc&&i>-300)return void(t.now=-1);t.now=-1}var r=this.timeOffset+e.currentTime;this.innerList.update({played:r},n),this.progressBtn.style.left="".concat(r/n*100,"%");var o=this.player.plugins.miniprogress;o&&o.update({played:r},n)}}},{key:"onCacheUpdate",value:function(){var e=this.player,t=this.duration,n=e.bufferedPoint;this.innerList.update({cached:n.end},t);var i=this.player.plugins.miniprogress;i&&i.update({cached:n.end},t)}},{key:"onReset",value:function(){this.innerList.update({played:0,cached:0},0);var e=this.player.plugins.miniprogress;e&&e.update({cached:0,played:0},0)}},{key:"destroy",value:function(){var e=this.player,t=e.controls;this.thumbnailPlugin=null,this.innerList.destroy(),this.innerList=null;var n=this.domEventType;"touch"!==n&&"compatible"!==n||(this.root.removeEventListener("touchstart",this.onMouseDown),this.root.removeEventListener("touchmove",this.onMouseMove),this.root.removeEventListener("touchend",this.onMouseUp),t&&(t.root&&t.root.removeEventListener("touchmove",Ap.stopPropagation),t.center&&t.center.removeEventListener("touchend",Ap.stopPropagation))),"mouse"!==n&&"compatible"!==n||(this.unbind("mousedown",this.onMouseDown),this.unbind("mouseenter",this.onMouseEnter),this.unbind("mousemove",this.onMoveOnly),this.unbind("mouseleave",this.onMouseLeave),document.removeEventListener("mousemove",this.onMouseMove,!1),document.removeEventListener("mouseup",this.onMouseUp,!1),e.root.removeEventListener("click",this.onBodyClick,!1))}},{key:"render",value:function(){if(!this.config.disable&&!this.playerConfig.isLive){var e=this.player.controls?this.player.controls.config.mode:"";return'\n <xg-progress class="xgplayer-progress '.concat("bottom"===e?"xgplayer-progress-bottom":"",'">\n <xg-outer class="xgplayer-progress-outer">\n <xg-progress-btn class="xgplayer-progress-btn"></xg-progress-btn>\n </xg-outer>\n </xg-progress>\n ')}}}],[{key:"pluginName",get:function(){return"progress"}},{key:"defaultConfig",get:function(){return{position:hv.CONTROLS_CENTER,index:0,disable:!1,isDragingSeek:!0,closeMoveSeek:!1,isPauseMoving:!1,isCloseClickSeek:!1,fragments:[{percent:1}],miniMoveStep:5,miniStartStep:2,onMoveStart:function(){},onMoveEnd:function(){},endedDiff:.2}}}]),n}(vv);function Tm(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=jn(e);if(t){var r=jn(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Bn(this,n)}}var Em=function(e){Mn(n,e);var t=Tm(n);function n(){var e;In(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Un(Fn(e=t.call.apply(t,[this].concat(r))),"_onMouseenter",(function(t){e.emit("icon_mouseenter",{pluginName:e.pluginName})})),Un(Fn(e),"_onMouseLeave",(function(t){e.emit("icon_mouseleave",{pluginName:e.pluginName})})),e}return uo(n,[{key:"afterCreate",value:function(){this.bind("mouseenter",this._onMouseenter),this.bind("mouseleave",this._onMouseLeave)}},{key:"destroy",value:function(){this.unbind("mouseenter",this._onMouseenter),this.unbind("mouseleave",this._onMouseLeave)}}]),n}(vv);function Pm(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=jn(e);if(t){var r=jn(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Bn(this,n)}}var Rm=function(e){Mn(n,e);var t=Pm(n);function n(){return In(this,n),t.apply(this,arguments)}return uo(n,[{key:"afterCreate",value:function(){var e=this;lo(jn(n.prototype),"afterCreate",this).call(this);var t=this.player;this.config.disable||(this.initIcons(),this.btnClick=this.btnClick.bind(this),this.bind(["touchend","click"],this.btnClick),this.on(Kp,(function(){e.animate(t.paused)})),this.on(Gp,(function(){e.animate(t.paused)})),this.animate(!0))}},{key:"registerIcons",value:function(){return{play:{icon:ry,class:"xg-icon-play"},pause:{icon:oy,class:"xg-icon-pause"}}}},{key:"btnClick",value:function(e){e.preventDefault(),e.stopPropagation();var t=this.player;return this.emitUserAction(e,"switch_play_pause"),t.ended?t.replay():t.paused?(t.play(),this.animate(!1)):(t.pause(),this.animate(!0)),!1}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.play),this.appendChild(".xgplayer-icon",e.pause)}},{key:"animate",value:function(e){var t=this.i18nKeys;e?(this.setAttr("data-state","pause"),this.changeLangTextKey(this.find(".xg-tips"),t.PLAY_TIPS)):(this.setAttr("data-state","play"),this.changeLangTextKey(this.find(".xg-tips"),t.PAUSE_TIPS))}},{key:"destroy",value:function(){lo(jn(n.prototype),"destroy",this).call(this),this.unbind(["touchend","click"],this.btnClick)}},{key:"render",value:function(){if(!this.config.disable)return'<xg-icon class="xgplayer-play">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="'.concat(this.i18nKeys.PLAY_TIPS,'">').concat(this.i18n.PLAY_TIPS,"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"play"}},{key:"defaultConfig",get:function(){return{position:hv.CONTROLS_LEFT,index:0,disable:!1}}}]),n}(Em);function Om(){return(new DOMParser).parseFromString('<svg width="32px" height="40px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <path d="M11.2374369,14 L17.6187184,7.61871843 C17.9604272,7.27700968 17.9604272,6.72299032 17.6187184,6.38128157 C17.2770097,6.03957281 16.7229903,6.03957281 16.3812816,6.38128157 L9.38128157,13.3812816 C9.03957281,13.7229903 9.03957281,14.2770097 9.38128157,14.6187184 L16.3812816,21.6187184 C16.7229903,21.9604272 17.2770097,21.9604272 17.6187184,21.6187184 C17.9604272,21.2770097 17.9604272,20.7229903 17.6187184,20.3812816 L11.2374369,14 L11.2374369,14 Z" fill="#FFFFFF"></path>\n </g>\n</svg>',"image/svg+xml").firstChild}function Am(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=jn(e);if(t){var r=jn(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Bn(this,n)}}var Lm=function(e){Mn(n,e);var t=Am(n);function n(){return In(this,n),t.apply(this,arguments)}return uo(n,[{key:"afterCreate",value:function(){var e=this;this.initIcons(),this.onClick=function(t){t.preventDefault(),t.stopPropagation(),e.config.onClick(t)},this.bind(["click","touchend"],this.onClick)}},{key:"registerIcons",value:function(){return{screenBack:{icon:Om,class:"xg-fullscreen-back"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(this.root,e.screenBack)}},{key:"show",value:function(){Ap.addClass(this.root,"show")}},{key:"hide",value:function(){Ap.removeClass(this.root,"show")}},{key:"render",value:function(){return'<xg-icon class="xgplayer-back">\n </xg-icon>'}}],[{key:"pluginName",get:function(){return"topbackicon"}},{key:"defaultConfig",get:function(){return{position:hv.ROOT_TOP,index:0}}}]),n}(vv);function Im(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="2 -4 28 40">\n <path fill="#fff" transform="scale(0.0320625 0.0320625)" d="M598 214h212v212h-84v-128h-128v-84zM726 726v-128h84v212h-212v-84h128zM214 426v-212h212v84h-128v128h-84zM298 598v128h128v84h-212v-212h84z"></path>\n</svg>\n',"image/svg+xml").firstChild}function Dm(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="2 -4 28 40">\n <path fill="#fff" transform="scale(0.0320625 0.0320625)" d="M682 342h128v84h-212v-212h84v128zM598 810v-212h212v84h-128v128h-84zM342 342v-128h84v212h-212v-84h128zM214 682v-84h212v212h-84v-128h-128z"></path>\n</svg>\n',"image/svg+xml").firstChild}function Mm(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=jn(e);if(t){var r=jn(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Bn(this,n)}}var Nm=function(e){Mn(n,e);var t=Mm(n);function n(){var e;In(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Un(Fn(e=t.call.apply(t,[this].concat(r))),"_onOrientationChange",(function(t){e.player.fullscreen&&e.config.rotateFullscreen&&(90===window.orientation||-90===window.orientation?e.setRotateDeg(0):e.setRotateDeg(90))})),e}return uo(n,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.fullscreen&&(e.config.disable=!e.player.config.fullscreen)}},{key:"afterCreate",value:function(){var e=this;lo(jn(n.prototype),"afterCreate",this).call(this);var t=this.config,i=this.playerConfig;if(!t.disable){t.target&&(this.playerConfig.fullscreenTarget=this.config.target);var r=Ap.getFullScreenEl();i.fullscreenTarget===r&&this.player.getFullscreen().catch((function(){})),this.initIcons(),this.handleFullscreen=this.hook("fullscreen_change",this.changeFullScreen,{pre:function(t){e.emitUserAction(t,"switch_fullscreen",{fullscreen:e.player.fullscreen})}}),this.bind(".xgplayer-fullscreen",["touchend","click"],this.handleFullscreen),this.on(vg,(function(t){e.changeLangTextKey(e.find(".xg-tips"),t?e.i18nKeys.EXITFULLSCREEN_TIPS:e.i18nKeys.FULLSCREEN_TIPS),e.animate(t),e.config.needBackIcon&&e.show()})),this.config.needBackIcon&&(this.topBackIcon=this.player.registerPlugin({plugin:Lm,options:{config:{onClick:function(t){e.handleFullscreen(t)}}}})),"mobile"===Bp.device&&window.addEventListener("orientationchange",this._onOrientationChange)}}},{key:"registerIcons",value:function(){return{fullscreen:{icon:Im,class:"xg-get-fullscreen"},exitFullscreen:{icon:Dm,class:"xg-exit-fullscreen"}}}},{key:"destroy",value:function(){lo(jn(n.prototype),"destroy",this).call(this),this.unbind(".xgplayer-icon","mobile"===Bp.device?"touchend":"click",this.handleFullscreen),"mobile"===Bp.device&&window.removeEventListener("orientationchange",this._onOrientationChange)}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.fullscreen),this.appendChild(".xgplayer-icon",e.exitFullscreen)}},{key:"setRotateDeg",value:function(e){var t=this.player;90===window.orientation||-90===window.orientation?t.rotateDeg=0:t.rotateDeg=e}},{key:"getRotateFullscreen",value:function(e){var t=this.player;t.isCssfullScreen&&t.exitCssFullscreen(e);var n=e?Tv.INNER_FULLSCREEN:Tv.ROTATE_FULLSCREEN;t._fullscreenEl=e||t.root,t.changeFullStyle(t.root,e,n,Tv.PARENT_ROTATE_FULLSCREEN),t.fullscreen=!0,this.setRotateDeg(90),this.emit(vg,!0)}},{key:"exitRotateFullscreen",value:function(e){var t=this.player;t.fullscreen=!1;var n=t._fullscreenEl!==t.root?Tv.INNER_FULLSCREEN:Tv.ROTATE_FULLSCREEN;t.recoverFullStyle(t.root,t._fullscreenEl,n,Tv.PARENT_ROTATE_FULLSCREEN),this.setRotateDeg(0),this.emit(vg,!1)}},{key:"changeFullScreen",value:function(e){e&&(e.preventDefault(),e.stopPropagation());var t=this.player,n=this.config,i=!1;if((!0===n.useCssFullscreen||"function"==typeof n.useCssFullscreen&&n.useCssFullscreen())&&(i=!0),i)t.fullscreen?(t.fullscreen=!1,t.exitCssFullscreen(),this.emit(vg,!1)):(t.fullscreen=!0,t.getCssFullscreen(),this.emit(vg,!0)),this.animate(t.fullscreen);else if(n.rotateFullscreen)t.fullscreen?this.exitRotateFullscreen():this.getRotateFullscreen(),this.animate(t.fullscreen);else{if(n.switchCallback&&"function"==typeof n.switchCallback)return void n.switchCallback(t.fullscreen);t.fullscreen?t.exitFullscreen():t.getFullscreen()}}},{key:"animate",value:function(e){e?this.setAttr("data-state","full"):this.setAttr("data-state","normal"),this.topBackIcon&&(e?(this.topBackIcon.show(),this.hide()):(this.topBackIcon.hide(),this.show()))}},{key:"show",value:function(){lo(jn(n.prototype),"show",this).call(this)}},{key:"hide",value:function(){lo(jn(n.prototype),"hide",this).call(this)}},{key:"render",value:function(){if(!this.config.disable){var e="FULLSCREEN_TIPS";return'<xg-icon class="xgplayer-fullscreen">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="'.concat(this.i18nKeys[e],'">').concat(this.i18n[e],"</div>\n </xg-icon>")}}}],[{key:"pluginName",get:function(){return"fullscreen"}},{key:"defaultConfig",get:function(){return{position:hv.CONTROLS_RIGHT,index:0,useCssFullscreen:!1,rotateFullscreen:!1,switchCallback:null,target:null,disable:!1,needBackIcon:!1}}}]),n}(Em);function Fm(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=jn(e);if(t){var r=jn(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Bn(this,n)}}var Bm=function(e){Mn(n,e);var t=Fm(n);function n(e){var i;return In(this,n),(i=t.call(this,e)).isActiving=!1,i}return uo(n,[{key:"duration",get:function(){return this.playerConfig.customDuration||this.player.duration}},{key:"timeOffset",get:function(){return this.playerConfig.timeOffset||0}},{key:"afterCreate",value:function(){var e=this,t=this.player.controls.config.mode;this.mode="flex"===t?"flex":"normal",this.config.disable||("flex"===this.mode&&(this.createCenterTime(),this.hide()),this.durationDom=this.find(".time-duration"),this.timeDom=this.find(".time-current"),this.on(Jp,(function(){e.onTimeUpdate()})),this.on(qp,(function(){e.onTimeUpdate()})),this.on(rg,(function(){e.onReset()})))}},{key:"show",value:function(){"flex"!==this.mode&&lo(jn(n.prototype),"show",this).call(this)}},{key:"onTimeUpdate",value:function(){var e=this.player;if(!this.config.disable&&!this.isActiving&&e.hasStart){var t=e.currentTime+this.timeOffset;"flex"===this.mode?(this.centerCurDom.innerHTML=Ap.format(t),this.duration!==1/0&&this.duration>0&&(this.centerDurDom.innerHTML=Ap.format(this.duration))):(this.timeDom.innerHTML=Ap.format(t),this.duration!==1/0&&this.duration>0&&(this.durationDom.innerHTML=Ap.format(this.duration)))}}},{key:"onReset",value:function(){"flex"===this.mode?(this.centerCurDom.innerHTML=Ap.format(0),this.centerDurDom.innerHTML=Ap.format(0)):(this.timeDom.innerHTML=Ap.format(0),this.durationDom.innerHTML=Ap.format(0))}},{key:"createCenterTime",value:function(){var e=this.player;if(e.controls&&e.controls.center){var t=e.controls.center;this.centerCurDom=Ap.createDom("xg-icon","00:00",{},"xgplayer-time left"),this.centerDurDom=Ap.createDom("xg-icon","00:00",{},"xgplayer-time right"),t.children.length>0?t.insertBefore(this.centerCurDom,t.children[0]):t.appendChild(this.centerCurDom),t.appendChild(this.centerDurDom)}}},{key:"afterPlayerInit",value:function(){var e=this.config;this.duration===1/0||this.playerConfig.isLive?(Ap.hide(this.durationDom),Ap.hide(this.timeDom),Ap.hide(this.find(".time-separator")),Ap.show(this.find(".time-live-tag"))):Ap.hide(this.find(".time-live-tag")),e.hide?this.hide():this.show()}},{key:"changeLiveState",value:function(e){e?(Ap.hide(this.durationDom),Ap.hide(this.timeDom),Ap.hide(this.find(".time-separator")),Ap.show(this.find(".time-live-tag"))):(Ap.hide(this.find(".time-live-tag")),Ap.show(this.find(".time-separator")),Ap.show(this.durationDom),Ap.show(this.timeDom))}},{key:"updateTime",value:function(e){this.isActiving=!0,!e&&0!==e||e>this.duration||("flex"!==this.mode?this.timeDom.innerHTML=Ap.format(e):this.centerCurDom.innerHTML=Ap.format(e))}},{key:"resetActive",value:function(){var e=this,t=this.player,n=function(){e.isActiving=!1};this.off(Xp,n),t.isSeeking?this.once(Xp,n):this.isActiving=!1}},{key:"destroy",value:function(){var e=this.player.controls.center;this.centerCurDom&&e.removeChild(this.centerCurDom),this.centerCurDom=null,this.centerDurDom&&e.removeChild(this.centerDurDom),this.centerDurDom=null}},{key:"render",value:function(){if(!this.config.disable)return'<xg-icon class="xgplayer-time">\n <span class="time-current">00:00</span>\n <span class="time-separator">/</span>\n <span class="time-duration">00:00</span>\n <span class="time-live-tag">'.concat(this.i18n.LIVE_TIP,"</span>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"time"}},{key:"defaultConfig",get:function(){return{position:hv.CONTROLS_LEFT,index:2,disable:!1}}}]),n}(vv);function jm(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="0 -10 28 40">\n <path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M358.4 358.4h-204.8v307.2h204.8l256 256v-819.2l-256 256z"></path>\n <path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M940.632 837.632l-72.192-72.192c65.114-64.745 105.412-154.386 105.412-253.44s-40.299-188.695-105.396-253.424l-0.016-0.016 72.192-72.192c83.639 83.197 135.401 198.37 135.401 325.632s-51.762 242.434-135.381 325.612l-0.020 0.020zM795.648 693.248l-72.704-72.704c27.756-27.789 44.921-66.162 44.921-108.544s-17.165-80.755-44.922-108.546l0.002 0.002 72.704-72.704c46.713 46.235 75.639 110.363 75.639 181.248s-28.926 135.013-75.617 181.227l-0.021 0.021z"></path>\n</svg>\n',"image/svg+xml").firstChild}function Um(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="0 -10 28 40">\n <path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M358.4 358.4h-204.8v307.2h204.8l256 256v-819.2l-256 256z"></path>\n <path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M795.648 693.248l-72.704-72.704c27.756-27.789 44.921-66.162 44.921-108.544s-17.165-80.755-44.922-108.546l0.002 0.002 72.704-72.704c46.713 46.235 75.639 110.363 75.639 181.248s-28.926 135.013-75.617 181.227l-0.021 0.021zM795.648 693.248l-72.704-72.704c27.756-27.789 44.921-66.162 44.921-108.544s-17.165-80.755-44.922-108.546l0.002 0.002 72.704-72.704c46.713 46.235 75.639 110.363 75.639 181.248s-28.926 135.013-75.617 181.227l-0.021 0.021z"></path>\n</svg>\n',"image/svg+xml").firstChild}function Hm(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="0 -10 28 40">\n <path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M358.4 358.4h-204.8v307.2h204.8l256 256v-819.2l-256 256z"></path>\n <path fill="#fff" transform="scale(0.0220625 0.0220625)" d="M920.4 439.808l-108.544-109.056-72.704 72.704 109.568 108.544-109.056 108.544 72.704 72.704 108.032-109.568 108.544 109.056 72.704-72.704-109.568-108.032 109.056-108.544-72.704-72.704-108.032 109.568z"></path>\n</svg>\n',"image/svg+xml").firstChild}function Gm(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=jn(e);if(t){var r=jn(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Bn(this,n)}}var Vm=function(e){Mn(n,e);var t=Gm(n);function n(){var e;In(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Un(Fn(e=t.call.apply(t,[this].concat(r))),"onBarMousedown",(function(t){var n=Fn(e).player,i=e.find(".xgplayer-bar");Ap.event(t);var r=i.getBoundingClientRect(),o=Ap.getEventPos(t,n.zoom),s=r.height-(o.clientY-r.top);if(o.h=s,o.barH=r.height,e.pos=o,!(s<-2))return e.updateVolumePos(s,t),document.addEventListener("mouseup",e.onBarMouseUp),e._d.isStart=!0,!1})),Un(Fn(e),"onBarMouseMove",(function(t){var n=Fn(e)._d;if(n.isStart){var i=Fn(e),r=i.pos,o=i.player;t.preventDefault(),t.stopPropagation(),Ap.event(t);var s=Ap.getEventPos(t,o.zoom);n.isMoving=!0;var a=r.h-s.clientY+r.clientY;a>r.barH||e.updateVolumePos(a,t)}})),Un(Fn(e),"onBarMouseUp",(function(t){Ap.event(t),document.removeEventListener("mouseup",e.onBarMouseUp);var n=Fn(e)._d;n.isStart=!1,n.isMoving=!1})),Un(Fn(e),"onMouseenter",(function(t){e._d.isActive=!0,e.focus(),e.emit("icon_mouseenter",{pluginName:e.pluginName})})),Un(Fn(e),"onMouseleave",(function(t){e._d.isActive=!1,e.unFocus(100,!1,t),e.emit("icon_mouseleave",{pluginName:e.pluginName})})),Un(Fn(e),"onVolumeChange",(function(t){if(e.player){var n=e.player,i=n.muted,r=n.volume;e._d.isMoving||(e.find(".xgplayer-drag").style.height=i||0===r?"4px":"".concat(100*r,"%"),e.config.showValueLabel&&e.updateVolumeValue()),e.animate(i,r)}})),e}return uo(n,[{key:"registerIcons",value:function(){return{volumeSmall:{icon:Um,class:"xg-volume-small"},volumeLarge:{icon:jm,class:"xg-volume"},volumeMuted:{icon:Hm,class:"xg-volume-mute"}}}},{key:"afterCreate",value:function(){var e=this;if(this._timerId=null,this._d={isStart:!1,isMoving:!1,isActive:!1},!this.config.disable){this.initIcons();var t=this.playerConfig,n=t.commonStyle,i=t.volume;n.volumeColor&&(this.find(".xgplayer-drag").style.backgroundColor=n.volumeColor),this.changeMutedHandler=this.hook("muted_change",(function(t){e.changeMuted(t)}),{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this._onMouseenterHandler=this.hook("mouseenter",this.onMouseenter),this._onMouseleaveHandler=this.hook("mouseleave",this.onMouseleave),"mobile"!==Bp.device&&"mobile"!==this.playerConfig.isMobileSimulateMode&&(this.bind("mouseenter",this._onMouseenterHandler),this.bind(["blur","mouseleave"],this._onMouseleaveHandler),this.bind(".xgplayer-slider","mousedown",this.onBarMousedown),this.bind(".xgplayer-slider","mousemove",this.onBarMouseMove),this.bind(".xgplayer-slider","mouseup",this.onBarMouseUp)),this.bind(".xgplayer-icon",["touchend","click"],this.changeMutedHandler),this.on(Qp,this.onVolumeChange),this.once(eg,this.onVolumeChange),"Number"!==Ap.typeOf(i)&&(this.player.volume=this.config.default),this.onVolumeChange()}}},{key:"updateVolumePos",value:function(e,t){var n=this.player,i=this.find(".xgplayer-drag"),r=this.find(".xgplayer-bar");if(r&&i){var o=parseInt(e/r.getBoundingClientRect().height*1e3,10);i.style.height="".concat(e,"px");var s=Math.max(Math.min(o/1e3,1),0),a={volume:{from:n.volume,to:s}};n.muted&&(a.muted={from:!0,to:!1}),this.emitUserAction(t,"change_volume",{muted:n.muted,volume:n.volume,props:a}),n.volume=Math.max(Math.min(o/1e3,1),0),n.muted&&(n.muted=!1),this.config.showValueLabel&&this.updateVolumeValue()}}},{key:"updateVolumeValue",value:function(){var e=this.player,t=e.volume,n=e.muted,i=this.find(".xgplayer-value-label"),r=Math.max(Math.min(t,1),0);i.innerText=n?0:Math.ceil(100*r)}},{key:"focus",value:function(){this.player.focus({autoHide:!1}),this._timerId&&(Ap.clearTimeout(this,this._timerId),this._timerId=null),Ap.addClass(this.root,"slide-show")}},{key:"unFocus",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2?arguments[2]:void 0,r=this._d,o=this.player;r.isActive||(this._timerId&&(Ap.clearTimeout(this,this._timerId),this._timerId=null),this._timerId=Ap.setTimeout(this,(function(){r.isActive||(n?o.blur():o.focus(),Ap.removeClass(e.root,"slide-show"),r.isStart&&e.onBarMouseUp(i)),e._timerId=null}),t))}},{key:"changeMuted",value:function(e){e&&e.stopPropagation();var t=this.player;this._d.isStart&&this.onBarMouseUp(e),this.emitUserAction(e,"change_muted",{muted:t.muted,volume:t.volume,props:{muted:{from:t.muted,to:!t.muted}}}),t.volume>0&&(t.muted=!t.muted),t.volume<.01&&(t.volume=this.config.miniVolume)}},{key:"animate",value:function(e,t){e||0===t?this.setAttr("data-state","mute"):t<.5&&this.icons.volumeSmall?this.setAttr("data-state","small"):this.setAttr("data-state","normal")}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.volumeSmall),this.appendChild(".xgplayer-icon",e.volumeLarge),this.appendChild(".xgplayer-icon",e.volumeMuted)}},{key:"destroy",value:function(){this._timerId&&(Ap.clearTimeout(this,this._timerId),this._timerId=null),this.unbind("mouseenter",this.onMouseenter),this.unbind(["blur","mouseleave"],this.onMouseleave),this.unbind(".xgplayer-slider","mousedown",this.onBarMousedown),this.unbind(".xgplayer-slider","mousemove",this.onBarMouseMove),this.unbind(".xgplayer-slider","mouseup",this.onBarMouseUp),document.removeEventListener("mouseup",this.onBarMouseUp),this.unbind(".xgplayer-icon","mobile"===Bp.device?"touchend":"click",this.changeMutedHandler)}},{key:"render",value:function(){if(!this.config.disable){var e=this.config.default||this.player.volume,t=this.config.showValueLabel;return'\n <xg-icon class="xgplayer-volume" data-state="normal">\n <div class="xgplayer-icon">\n </div>\n <xg-slider class="xgplayer-slider">\n '.concat(t?'<div class="xgplayer-value-label">'.concat(100*e,"</div>"):"",'\n <div class="xgplayer-bar">\n <xg-drag class="xgplayer-drag" style="height: ').concat(100*e,'%"></xg-drag>\n </div>\n </xg-slider>\n </xg-icon>')}}}],[{key:"pluginName",get:function(){return"volume"}},{key:"defaultConfig",get:function(){return{position:hv.CONTROLS_RIGHT,index:1,disable:!1,showValueLabel:!1,default:.6,miniVolume:.2}}}]),n}(vv);function Wm(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="-4 -6 40 40" fill="none">\n <g clip-path="url(#clip0)">\n <path transform="scale(1.5 1.5)" d="M11.6665 9.16663H4.1665C2.78579 9.16663 1.6665 10.2859 1.6665 11.6666V15.8333C1.6665 17.214 2.78579 18.3333 4.1665 18.3333H11.6665C13.0472 18.3333 14.1665 17.214 14.1665 15.8333V11.6666C14.1665 10.2859 13.0472 9.16663 11.6665 9.16663Z" fill="white"/>\n <path transform="scale(1.5 1.5)" fill-rule="evenodd" clip-rule="evenodd" d="M3.88148 4.06298C3.75371 4.21005 3.67667 4.40231 3.67749 4.61242C3.67847 4.87253 3.79852 5.10435 3.98581 5.25646L6.99111 8.05895C7.32771 8.37283 7.85502 8.35443 8.16891 8.01782C8.48279 7.68122 8.46437 7.15391 8.12778 6.84003L6.62061 5.43457L9.8198 5.4224C9.82848 5.42239 9.8372 5.42221 9.84591 5.4219C10.9714 5.38233 12.0885 5.6285 13.0931 6.13744C14.0976 6.64635 14.957 7.40148 15.5908 8.33234C16.2246 9.2632 16.6122 10.3394 16.7177 11.4606C16.823 12.5819 16.6427 13.7115 16.1934 14.7442C16.0098 15.1661 16.203 15.6571 16.6251 15.8408C17.0471 16.0243 17.5381 15.8311 17.7216 15.4091C18.2833 14.1183 18.5087 12.7063 18.3771 11.3047C18.2453 9.90318 17.7607 8.55792 16.9684 7.39433C16.1761 6.23073 15.1021 5.28683 13.8463 4.65065C12.5946 4.01651 11.203 3.70872 9.80072 3.75583L6.43415 3.76862L7.96326 2.12885C8.27715 1.79225 8.25872 1.26494 7.92213 0.951061C7.58553 0.63718 7.05822 0.655585 6.74433 0.99219L3.90268 4.0395C3.89545 4.04724 3.88841 4.05509 3.88154 4.06303L3.88148 4.06298Z" fill="white"/>\n </g>\n <defs>\n <clipPath id="clip0">\n <rect width="40" height="40" fill="white"/>\n </clipPath>\n </defs>\n</svg>\n',"image/svg+xml").firstChild}function Km(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=jn(e);if(t){var r=jn(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Bn(this,n)}}var zm=function(e){Mn(n,e);var t=Km(n);function n(e){var i;return In(this,n),(i=t.call(this,e)).rotateDeg=i.config.rotateDeg||0,i}return uo(n,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.rotate&&(e.config.disable=!e.player.config.rotate)}},{key:"afterCreate",value:function(){var e=this;this.config.disable||(lo(jn(n.prototype),"afterCreate",this).call(this),this.appendChild(".xgplayer-icon",this.icons.rotate),this.onBtnClick=this.onBtnClick.bind(this),this.bind(".xgplayer-icon",["click","touchend"],this.onBtnClick),this.on(wg,(function(){e.rotateDeg&&Ap.setTimeout(e,(function(){e.updateRotateDeg(e.rotateDeg,e.config.innerRotate)}),100)})),this.rotateDeg&&this.updateRotateDeg(this.rotateDeg,this.config.innerRotate))}},{key:"destroy",value:function(){lo(jn(n.prototype),"destroy",this).call(this),this.unbind(".xgplayer-icon",["click","touchend"],this.onBtnClick)}},{key:"onBtnClick",value:function(e){e.preventDefault(),e.stopPropagation(),this.emitUserAction(e,"rotate"),this.rotate(this.config.clockwise,this.config.innerRotate,1)}},{key:"updateRotateDeg",value:function(e,t){var n=this.player;e||(e=0);var i=this.player,r=i.root,o=i.innerContainer,s=i.video,a=r.offsetWidth,c=o&&t?o.offsetHeight:r.offsetHeight,u="100%",l="100%",f=0,h=0;.75!==e&&.25!==e||(u="".concat(c,"px"),l="".concat(a,"px"),f=-(c-a)/2,h=-(a-c)/2);var d="translate(".concat(f,"px,").concat(h,"px) rotate(").concat(e,"turn)"),p={transformOrigin:"center center",transform:d,webKitTransform:d,height:l,width:u},g=t?s:r,v=t?n.getPlugin("poster"):null;Object.keys(p).map((function(e){g.style[e]=p[e],v&&v.root&&(v.root.style[e]=p[e])}))}},{key:"rotate",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=this.player;this.rotateDeg||(this.rotateDeg=0);var r=e?1:-1;this.rotateDeg=(this.rotateDeg+1+.25*r*n)%1,this.updateRotateDeg(this.rotateDeg,t),i.emit(xg,360*this.rotateDeg)}},{key:"registerIcons",value:function(){return{rotate:Wm}}},{key:"render",value:function(){if(!this.config.disable)return'\n <xg-icon class="xgplayer-rotate">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="'.concat(this.i18nKeys.ROTATE_TIPS,'">\n ').concat(this.i18n.ROTATE_TIPS,"\n </div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"rotate"}},{key:"defaultConfig",get:function(){return{position:hv.CONTROLS_RIGHT,index:6,innerRotate:!0,clockwise:!1,rotateDeg:0,disable:!1}}}]),n}(Em);function Ym(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd"\n d="M16.5 4.3H3.5C3.38954 4.3 3.3 4.38954 3.3 4.5V15.5C3.3 15.6105 3.38954 15.7 3.5 15.7H8.50005L8.50006 17.5H3.5C2.39543 17.5 1.5 16.6046 1.5 15.5V4.5C1.5 3.39543 2.39543 2.5 3.5 2.5H16.5C17.6046 2.5 18.5 3.39543 18.5 4.5V8.5H16.7V4.5C16.7 4.38954 16.6105 4.3 16.5 4.3ZM12 11.5C11.4477 11.5 11 11.9477 11 12.5L11 16.5C11 17.0523 11.4478 17.5 12 17.5H17.5C18.0523 17.5 18.5 17.0523 18.5 16.5L18.5 12.5C18.5 11.9477 18.0523 11.5 17.5 11.5H12Z"\n fill="white" />\n</svg>',"image/svg+xml").firstChild}function Xm(){return(new DOMParser).parseFromString('<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd"\n d="M16.5 4.3H3.5C3.38954 4.3 3.3 4.38954 3.3 4.5V15.5C3.3 15.6105 3.38954 15.7 3.5 15.7H8.50005L8.50006 17.5H3.5C2.39543 17.5 1.5 16.6046 1.5 15.5V4.5C1.5 3.39543 2.39543 2.5 3.5 2.5H16.5C17.6046 2.5 18.5 3.39543 18.5 4.5V8.5H16.7V4.5C16.7 4.38954 16.6105 4.3 16.5 4.3ZM12 11.5C11.4477 11.5 11 11.9477 11 12.5L11 16.5C11 17.0523 11.4478 17.5 12 17.5H17.5C18.0523 17.5 18.5 17.0523 18.5 16.5L18.5 12.5C18.5 11.9477 18.0523 11.5 17.5 11.5H12Z"\n fill="white" />\n <path fill-rule="evenodd" clip-rule="evenodd"\n d="M9.4998 7.7C9.77595 7.7 9.9998 7.47614 9.9998 7.2V6.5C9.9998 6.22386 9.77595 6 9.4998 6H5.5402L5.52754 6.00016H5.5C5.22386 6.00016 5 6.22401 5 6.50016V10.4598C5 10.7359 5.22386 10.9598 5.5 10.9598H6.2C6.47614 10.9598 6.7 10.7359 6.7 10.4598V8.83005L8.76983 10.9386C8.96327 11.1357 9.27984 11.1386 9.47691 10.9451L9.97645 10.4548C10.1735 10.2613 10.1764 9.94476 9.983 9.7477L7.97289 7.7H9.4998Z"\n fill="white" />\n</svg>',"image/svg+xml").firstChild}function qm(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=jn(e);if(t){var r=jn(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Bn(this,n)}}var $m="picture-in-picture",Zm="inline",Jm="fullscreen",Qm=function(e){Mn(n,e);var t=qm(n);function n(){var e;In(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Un(Fn(e=t.call.apply(t,[this].concat(r))),"switchPIP",(function(t){if(!e.isPIPAvailable())return!1;t.stopPropagation(),e.isPip?(e.exitPIP(),e.emitUserAction(t,"change_pip",{from:"pip",to:"normal"}),e.setAttr("data-state","normal")):4===e.player.video.readyState&&(e.requestPIP(),e.emitUserAction(t,"change_pip",{from:"normal",to:"pip"}),e.setAttr("data-state","pip"))})),e}return uo(n,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.pip&&(e.config.showIcon=e.player.config.pip)}},{key:"afterCreate",value:function(){var e=this;this.isPIPAvailable()&&(lo(jn(n.prototype),"afterCreate",this).call(this),this.pMode=Zm,this.initPipEvents(),this.config.showIcon&&this.initIcons(),this.once(fg,(function(){e.config.showIcon&&(Ap.removeClass(e.find(".xgplayer-icon"),"xg-icon-disable"),e.bind("click",e.switchPIP))})))}},{key:"registerIcons",value:function(){return{pipIcon:{icon:Ym,class:"xg-get-pip"},pipIconExit:{icon:Xm,class:"xg-exit-pip"}}}},{key:"initIcons",value:function(){var e=this.icons;this.appendChild(".xgplayer-icon",e.pipIcon),this.appendChild(".xgplayer-icon",e.pipIconExit)}},{key:"initPipEvents",value:function(){var e=this,t=this.player;this.leavePIPCallback=function(){var n=t.paused;Ap.setTimeout(e,(function(){!n&&t.videoPlay()}),0),!n&&t.videoPlay(),e.setAttr("data-state","normal"),t.emit(Cg,!1)},this.enterPIPCallback=function(n){t.emit(Cg,!0),e.pipWindow=n.pictureInPictureWindow,e.setAttr("data-state","pip")},this.onWebkitpresentationmodechanged=function(n){var i=t.video.webkitPresentationMode;e.pMode===Jm&&i!==Jm&&t.onFullscreenChange(null,!1),e.pMode=i,i===$m?e.enterPIPCallback(n):i===Zm&&e.leavePIPCallback(n)},t.video&&(t.video.addEventListener("enterpictureinpicture",this.enterPIPCallback),t.video.addEventListener("leavepictureinpicture",this.leavePIPCallback),n.checkWebkitSetPresentationMode(t.video)&&t.video.addEventListener("webkitpresentationmodechanged",this.onWebkitpresentationmodechanged))}},{key:"requestPIP",value:function(){var e=this.player,t=this.playerConfig;if(this.isPIPAvailable()&&!this.isPip)try{var i=t.poster;return i&&(e.video.poster="String"===Ap.typeOf(i)?i:i.poster),n.checkWebkitSetPresentationMode(e.video)?e.video.webkitSetPresentationMode("picture-in-picture"):e.video.requestPictureInPicture(),!0}catch(e){return console.error("requestPiP",e),!1}}},{key:"exitPIP",value:function(){var e=this.player;try{return this.isPIPAvailable()&&this.isPip&&(n.checkWebkitSetPresentationMode(e.video)?e.video.webkitSetPresentationMode("inline"):document.exitPictureInPicture()),!0}catch(e){return console.error("exitPIP",e),!1}}},{key:"isPip",get:function(){var e=this.player;return document.pictureInPictureElement&&document.pictureInPictureElement===e.video||e.video.webkitPresentationMode===$m}},{key:"isPIPAvailable",value:function(){var e=this.player.video;return("Boolean"!==Ap.typeOf(document.pictureInPictureEnabled)||document.pictureInPictureEnabled)&&("Boolean"===Ap.typeOf(e.disablePictureInPicture)&&!e.disablePictureInPicture||e.webkitSupportsPresentationMode&&"Function"===Ap.typeOf(e.webkitSetPresentationMode))}},{key:"destroy",value:function(){lo(jn(n.prototype),"destroy",this).call(this);var e=this.player;e.video.removeEventListener("enterpictureinpicture",this.enterPIPCallback),e.video.removeEventListener("leavepictureinpicture",this.leavePIPCallback),n.checkWebkitSetPresentationMode(e.video)&&e.video.removeEventListener("webkitpresentationmodechanged",this.onWebkitpresentationmodechanged),this.exitPIP(),this.unbind("click",this.btnClick)}},{key:"render",value:function(){if(this.config.showIcon&&this.isPIPAvailable())return'<xg-icon class="xgplayer-pip">\n <div class="xgplayer-icon xg-icon-disable">\n </div>\n <div class="xg-tips" lang-key="'.concat(this.i18nKeys.PIP,'">').concat(this.i18n.PIP,"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"pip"}},{key:"defaultConfig",get:function(){return{position:hv.CONTROLS_RIGHT,index:6,showIcon:!1}}},{key:"checkWebkitSetPresentationMode",value:function(e){return"function"==typeof e.webkitSetPresentationMode}}]),n}(Em);function ek(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="40" viewBox="10 0 24 40">\n <path transform="scale(0.038 0.028)" d="M800 380v768h-128v-352l-320 320v-704l320 320v-352z"></path>\n</svg>\n',"image/svg+xml").firstChild}function tk(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=jn(e);if(t){var r=jn(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Bn(this,n)}}var nk=function(e){Mn(n,e);var t=tk(n);function n(e){var i;return In(this,n),Un(Fn(i=t.call(this,e)),"playNext",(function(e){var t=Fn(i).player;e.preventDefault(),e.stopPropagation(),i.idx+1<i.config.urlList.length?(i.idx++,t.emit(Sg,i.idx+1),i.nextHandler(i.config.urlList[i.idx],i.idx)):(i.nextHandler(),t.emit(Sg))})),i.idx=-1,i}return uo(n,[{key:"afterCreate",value:function(){this.config.urlList&&0!==this.config.urlList.length&&(this.appendChild(".xgplayer-icon",this.icons.playNext),this.initEvents())}},{key:"registerIcons",value:function(){return{playNext:ek}}},{key:"initEvents",value:function(){this.nextHandler=this.hook("playNext",this.changeSrc);var e="mobile"===Bp.device?"touchend":"click";this.bind(e,this.playNext),this.show()}},{key:"changeSrc",value:function(e){var t=this.player;e&&(t.pause(),t.currentTime=0,t.autoplay=!0,t.src=e)}},{key:"destroy",value:function(){this.unbind(["touchend","click"],this.playNext)}},{key:"render",value:function(){if(this.config.urlList&&0!==this.config.urlList.length)return'\n <xg-icon class="xgplayer-playnext">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="PLAYNEXT_TIPS">'.concat(this.i18n.PLAYNEXT_TIPS,"</div>\n </xg-icon>\n ")}}],[{key:"pluginName",get:function(){return"playNext"}},{key:"defaultConfig",get:function(){return{position:hv.CONTROLS_LEFT,index:1,url:null,urlList:[]}}}]),n}(vv),ik={exports:{}};!function(e,t){e.exports=function e(t,n,i){var r,o,s=window,a="application/octet-stream",c=i||a,u=t,l=!n&&!i&&u,f=document.createElement("a"),h=function(e){return String(e)},d=s.Blob||s.MozBlob||s.WebKitBlob||h,p=n||"download";if(d=d.call?d.bind(s):Blob,"true"===String(this)&&(c=(u=[u,c])[0],u=u[1]),l&&l.length<2048&&(p=l.split("/").pop().split("?")[0],f.href=l,-1!==f.href.indexOf(l))){var g=new XMLHttpRequest;return g.open("GET",l,!0),g.responseType="blob",g.onload=function(t){e(t.target.response,p,a)},setTimeout((function(){g.send()}),0),g}if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(u)){if(!(u.length>2096103.424&&d!==h))return navigator.msSaveBlob?navigator.msSaveBlob(k(u),p):b(u);c=(u=k(u)).type||a}else if(/([\x80-\xff])/.test(u)){for(var v=0,y=new Uint8Array(u.length),m=y.length;v<m;++v)y[v]=u.charCodeAt(v);u=new d([y],{type:c})}function k(e){for(var t=e.split(/[:;,]/),n=t[1],i=("base64"==t[2]?atob:decodeURIComponent)(t.pop()),r=i.length,o=0,s=new Uint8Array(r);o<r;++o)s[o]=i.charCodeAt(o);return new d([s],{type:n})}function b(e,t){if("download"in f)return f.href=e,f.setAttribute("download",p),f.className="download-js-link",f.innerHTML="downloading...",f.style.display="none",document.body.appendChild(f),setTimeout((function(){f.click(),document.body.removeChild(f),!0===t&&setTimeout((function(){s.URL.revokeObjectURL(f.href)}),250)}),66),!0;if(/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent))return/^data:/.test(e)&&(e="data:"+e.replace(/^data:([\w\/\-\+]+)/,a)),window.open(e)||confirm("Displaying New Document\n\nUse Save As... to download, then click back to return to this page.")&&(location.href=e),!0;var n=document.createElement("iframe");document.body.appendChild(n),!t&&/^data:/.test(e)&&(e="data:"+e.replace(/^data:([\w\/\-\+]+)/,a)),n.src=e,setTimeout((function(){document.body.removeChild(n)}),333)}if(r=u instanceof d?u:new d([u],{type:c}),navigator.msSaveBlob)return navigator.msSaveBlob(r,p);if(s.URL)b(s.URL.createObjectURL(r),!0);else{if("string"==typeof r||r.constructor===h)try{return b("data:"+c+";base64,"+s.btoa(r))}catch(e){return b("data:"+c+","+encodeURIComponent(r))}(o=new FileReader).onload=function(e){b(this.result)},o.readAsDataURL(r)}return!0}}(ik);var rk=ik.exports;function ok(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="24px" height="24px" viewBox="0 0 24 24">\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g transform="translate(-488.000000, -340.000000)" fill="#FFFFFF">\n <g id="Group-2">\n <g id="volme_big-copy" transform="translate(488.000000, 340.000000)">\n <rect id="Rectangle-18" x="11" y="4" width="2" height="12" rx="1"></rect>\n <rect id="Rectangle-2" x="3" y="18" width="18" height="2" rx="1"></rect>\n <rect id="Rectangle-2" transform="translate(4.000000, 17.500000) rotate(90.000000) translate(-4.000000, -17.500000) " x="1.5" y="16.5" width="5" height="2" rx="1"></rect><rect id="Rectangle-2-Copy-3" transform="translate(20.000000, 17.500000) rotate(90.000000) translate(-20.000000, -17.500000) " x="17.5" y="16.5" width="5" height="2" rx="1"></rect>\n <path d="M9.48791171,8.26502656 L9.48791171,14.2650266 C9.48791171,14.8173113 9.04019646,15.2650266 8.48791171,15.2650266 C7.93562696,15.2650266 7.48791171,14.8173113 7.48791171,14.2650266 L7.48791171,7.26502656 C7.48791171,6.71274181 7.93562696,6.26502656 8.48791171,6.26502656 L15.4879117,6.26502656 C16.0401965,6.26502656 16.4879117,6.71274181 16.4879117,7.26502656 C16.4879117,7.81731131 16.0401965,8.26502656 15.4879117,8.26502656 L9.48791171,8.26502656 Z" id="Combined-Shape" transform="translate(11.987912, 10.765027) scale(1, -1) rotate(45.000000) translate(-11.987912, -10.765027) "></path>\n </g>\n </g>\n </g>\n </g>\n</svg>\n',"image/svg+xml").firstChild}function sk(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=jn(e);if(t){var r=jn(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Bn(this,n)}}var ak=function(e){Mn(n,e);var t=sk(n);function n(e){var i;return In(this,n),Un(Fn(i=t.call(this,e)),"download",(function(e){if(!i.isLock){i.emitUserAction(e,"download");var t=i.getAbsoluteURL(i.player.src);rk(t),i.isLock=!0,i.timer=window.setTimeout((function(){i.isLock=!1,window.clearTimeout(i.timer),i.timer=null}),300)}})),i.timer=null,i.isLock=!1,i}return uo(n,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.download&&(e.config.disable=!e.player.config.download)}},{key:"afterCreate",value:function(){lo(jn(n.prototype),"afterCreate",this).call(this),this.config.disable||(this.appendChild(".xgplayer-icon",this.icons.download),this.bind(["click","touchend"],this.download))}},{key:"registerIcons",value:function(){return{download:ok}}},{key:"getAbsoluteURL",value:function(e){if(!e.match(/^https?:\/\//)){var t=document.createElement("div");t.innerHTML='<a href="'.concat(e,'">x</a>'),e=t.firstChild.href}return e}},{key:"destroy",value:function(){lo(jn(n.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.download),window.clearTimeout(this.timer),this.timer=null}},{key:"render",value:function(){if(!this.config.disable)return'<xg-icon class="xgplayer-download">\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="'.concat(this.i18nKeys.DOWNLOAD_TIPS,'">').concat(this.i18n.DOWNLOAD_TIPS,"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"download"}},{key:"defaultConfig",get:function(){return{position:hv.CONTROLS_RIGHT,index:3,disable:!0}}}]),n}(Em);function ck(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=jn(e);if(t){var r=jn(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Bn(this,n)}}var uk=function(e){Mn(n,e);var t=ck(n);function n(){return In(this,n),t.apply(this,arguments)}return uo(n,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.screenShot&&(e.config.disable=!e.player.config.screenShot)}},{key:"afterCreate",value:function(){lo(jn(n.prototype),"afterCreate",this).call(this),this.appendChild(".xgplayer-icon",this.icons.screenshotIcon);var e=this.config;this.initSize=function(t){e.fitVideo&&(e.width=t.vWidth,e.height=t.vHeight)},this.once(wg,this.initSize)}},{key:"onPluginsReady",value:function(){this.show(),this.onClickBtn=this.onClickBtn.bind(this),this.bind(["click","touchend"],this.onClickBtn)}},{key:"saveScreenShot",value:function(e,t){var n=document.createElement("a");n.href=e,n.download=t;var i=document.createEvent("MouseEvents");i.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),n.dispatchEvent(i)}},{key:"createCanvans",value:function(e,t){var n=document.createElement("canvas");this.canvasCtx=n.getContext("2d"),this.canvas=n,n.width=e||this.config.width,n.height=t||this.config.height}},{key:"onClickBtn",value:function(e){var t=this;e.preventDefault(),e.stopPropagation(),this.emitUserAction(e,"shot"),this.shot().then((function(e){t.emit(_g,e),t.saveScreenShot(e,t.config.name+t.config.format)}))}},{key:"shot",value:function(e,t){var n=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{quality:.92,type:"image/png"},r=this.config,o=this.player,s=i.quality||r.quality,a=i.type||r.type;return new Promise((function(i,c){n.canvas?(n.canvas.width=e||r.width,n.canvas.height=t||r.height):n.createCanvans(e,t),n.canvasCtx.drawImage(o.video,0,0,e||r.width,t||r.height);var u=n.canvas.toDataURL(a,s).replace(a,"image/octet-stream");i(u=u.replace(/^data:image\/[^;]+/,"data:application/octet-stream"))}))}},{key:"registerIcons",value:function(){return{screenshotIcon:null}}},{key:"destroy",value:function(){lo(jn(n.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.onClickBtn),this.off(wg,this.initSize)}},{key:"render",value:function(){if(!this.config.disable){var e=this.icons.screenshotIcon?"xgplayer-icon":"xgplayer-icon btn-text",t="SCREENSHOT";return'\n <xg-icon class="xgplayer-shot">\n <div class="'.concat(e,'">\n ').concat(this.icons.screenshotIcon?"":'<span lang-key="'.concat(this.i18nKeys[t],'">').concat(this.i18n[t],"</span>")," \n </div>\n </xg-icon>")}}}],[{key:"pluginName",get:function(){return"screenShot"}},{key:"defaultConfig",get:function(){return{position:hv.CONTROLS_RIGHT,index:5,quality:.92,type:"image/png",format:".png",width:600,height:337,fitVideo:!0,disable:!1,name:"screenshot"}}}]),n}(Em),lk=function(){function e(t){In(this,e),this.config=t.config,this.parent=t.root,this.root=Ap.createDom("ul","",{},"xg-options-list ".concat(this.config.className)),t.root.appendChild(this.root),this.onItemClick=this.onItemClick.bind(this),this.renderItemList();var n="mobile"===Bp.device?"touchend":"click";this._delegates=vv.delegate.call(this,this.root,"li",n,this.onItemClick)}return uo(e,[{key:"renderItemList",value:function(e){var t=this,n=this.config,i=this.root;e?n.data=e:e=n.data,n.style&&Object.keys(n.style).map((function(e){i.style[e]=n[e]})),e.length>0&&(this.attrKeys=Object.keys(e[0])),this.root.innerHTML="",e.map((function(e,n){var i=e.selected?"option-item selected":"option-item";e["data-index"]=n,t.root.appendChild(Ap.createDom("li","<span>".concat(e.showText,"</span>"),e,i))}))}},{key:"onItemClick",value:function(e){e.delegateTarget||(e.delegateTarget=e.target);var t=e.delegateTarget;if(t&&Ap.hasClass(t,"selected"))return!1;var n="function"==typeof this.config.onItemClick?this.config.onItemClick:null,i=this.root.querySelector(".selected");Ap.addClass(t,"selected"),i&&Ap.removeClass(i,"selected"),n(e,{from:i?this.getAttrObj(i,this.attrKeys):null,to:this.getAttrObj(t,this.attrKeys)})}},{key:"getAttrObj",value:function(e,t){if(!e||!t)return{};var n={};t.map((function(t){n[t]=e.getAttribute(t)}));var i=e.getAttribute("data-index");return i&&(n.index=Number(i)),n}},{key:"show",value:function(){Ap.removeClass(this.root,"hide"),Ap.addClass(this.root,"active")}},{key:"hide",value:function(){Ap.removeClass(this.root,"active"),Ap.addClass(this.root,"hide")}},{key:"destroy",value:function(){this._delegates&&(this._delegates.map((function(e){e.destroy&&e.destroy()})),this._delegates=null),this.root.innerHTML=null,this.parent.removeChild(this.root),this.root=null}}]),e}();function fk(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=jn(e);if(t){var r=jn(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Bn(this,n)}}var hk="mobile"===Bp.device,dk=function(e){Mn(n,e);var t=fk(n);function n(e){var i;return In(this,n),Un(Fn(i=t.call(this,e)),"onEnter",(function(e){e.preventDefault(),e.stopPropagation(),i.emit("icon_mouseenter",{pluginName:i.pluginName}),i.onToggle(!0)})),Un(Fn(i),"onLeave",(function(e){e.preventDefault(),e.stopPropagation(),i.emit("icon_mouseleave",{pluginName:i.pluginName}),i.isActive&&i.onToggle(!1)})),i.isIcons=!1,i.isActive=!1,i.curValue=null,i.curIndex=0,i}return uo(n,[{key:"updateLang",value:function(e){this.renderItemList(this.config.list,this.curIndex)}},{key:"afterCreate",value:function(){var e=this,t=this.config;this.initIcons(),hk&&"middle"!==t.listType&&(t.listType="rightSide"),t.hidePortrait&&Ap.addClass(this.root,"portrait"),this.once(Zp,(function(){t.list&&t.list.length>0&&(e.renderItemList(t.list),e.show())})),hk&&this.on(og,(function(){e.isActive&&(e.optionsList&&e.optionsList.hide(),e.isActive=!1)})),this.activeEvent=hk?"touchend":"mouseenter",this.bind(this.activeEvent,this.onEnter),this.bind("mouseleave",this.onLeave),this.isIcons&&this.bind("click",this.onIconClick)}},{key:"initIcons",value:function(){var e=this,t=this.icons,n=Object.keys(t),i=!1;n.length>0&&(n.forEach((function(n){e.appendChild(".xgplayer-icon",t[n]),!i&&(i=t[n])})),this.isIcons=i),i||(this.appendChild(".xgplayer-icon",Ap.createDom("span","",{},"icon-text")),Ap.addClass(this.find(".xgplayer-icon"),"btn-text"))}},{key:"show",value:function(){!this.config.list||this.config.list.length<1||Ap.addClass(this.root,"show")}},{key:"hide",value:function(){Ap.removeClass(this.root,"show")}},{key:"getTextByLang",value:function(e,t,n){if(void 0===e)return"";var i=this.config.list;!n&&(n=this.player.lang),t=!t||Ap.isUndefined(e[t])?"text":t,"number"==typeof e&&(e=i[e]);try{return"object"===Nn(e[t])?e[t][n]||e[t].zh:e[t]}catch(e){return console.warn(e),""}}},{key:"onToggle",value:function(e){if(e!==this.isActive){var t=this.player.controls,n=this.config.listType;e?("rightSide"===n?t.blur():t.focus(),this.optionsList&&this.optionsList.show()):("rightSide"===n?t.focus():t.unFocus(),this.optionsList&&this.optionsList.hide()),this.isActive=e}}},{key:"onItemClick",value:function(e,t){e.preventDefault(),e.stopPropagation();var n=this.config,i=n.listType,r=n.list;(hk||"rightSide"===i)&&this.onToggle(!1),this.curIndex=t.to.index,this.curItem=r[this.curIndex],this.changeCurrentText(),this.onToggle(!1)}},{key:"onIconClick",value:function(e){}},{key:"changeCurrentText",value:function(){if(!this.isIcons){var e=this.config.list,t=e[this.curIndex<e.length?this.curIndex:0];t&&(this.find(".icon-text").innerHTML=this.getTextByLang(t,"iconText"))}}},{key:"renderItemList",value:function(e,t){var n=this,i=this.config,r=this.optionsList,o=this.player;if("number"==typeof t&&(this.curIndex=t,this.curItem=i.list[t]),r)return r.renderItemList(e),void this.changeCurrentText();var s={config:{data:e||[],className:"rightSide"===i.listType?"right-side":"",onItemClick:function(e,t){n.onItemClick(e,t)}},root:"rightSide"===i.listType?o.root:this.root};this.config.isShowIcon&&(this.optionsList=new lk(s),this.changeCurrentText(),this.show())}},{key:"destroy",value:function(){this.unbind(this.activeEvent,this.onToggle),this.unbind("mouseleave",this.onToggle),this.optionsList&&(this.optionsList.destroy(),this.optionsList=null)}},{key:"render",value:function(){if(this.config.isShowIcon)return'<xg-icon class="xg-options-icon '.concat(this.config.className||"",'">\n <div class="xgplayer-icon">\n </div>\n </xg-icon>')}}],[{key:"pluginName",get:function(){return"optionsIcon"}},{key:"defaultConfig",get:function(){return{position:hv.CONTROLS_RIGHT,index:100,list:[],listType:"middle",listStyle:{},hidePortrait:!0,isShowIcon:!1}}}]),n}(vv);function pk(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=jn(e);if(t){var r=jn(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Bn(this,n)}}var gk=function(e){Mn(n,e);var t=pk(n);function n(e){var i;return In(this,n),(i=t.call(this,e)).curTime=0,i.isPaused=!0,i}return uo(n,[{key:"beforeCreate",value:function(e){var t=e.config.list;Array.isArray(t)&&t.length>0&&(e.config.list=t.map((function(e){return!e.text&&e.name&&(e.text=e.name),e.text||(e.text=e.definition),e})))}},{key:"afterCreate",value:function(){var e=this;lo(jn(n.prototype),"afterCreate",this).call(this);var t=this.config,i=t.list,r=t.defaultDefinition,o=this.playerConfig.defaultConfig;i.forEach((function(e){e.definition!==r&&e.definition!==o||(e.selected=!0)})),this.on("resourceReady",(function(t){e.changeDefinitionList(t)})),this.on(kg,(function(t){e.renderItemList(e.config.list,t.to)})),this.player.definitionList.length<2&&this.hide()}},{key:"initDefinition",value:function(){var e=this.config,t=e.list,n=e.defaultDefinition,i=this.playerConfig.defaultConfig;if(t.length>0){var r=null;t.map((function(e){e.definition!==n&&e.definition!==i||(r=e,e.selected=!0)})),r||(r=t[0]),this.changeDefinition(r)}}},{key:"renderItemList",value:function(e,t){var i=this,r=t&&t.definition?t.definition:"";t&&!Array.isArray(t)&&e.forEach((function(e){e.selected=!1}));var o=0,s=e.map((function(e,t){var n={url:e.url,definition:e.definition||"",showText:i.getTextByLang(e)||e.definition,selected:!1};return(e.selected||!Ap.isUndefined(e.definition)&&e.definition===r)&&(n.selected=!0,o=t),n}));lo(jn(n.prototype),"renderItemList",this).call(this,s,o)}},{key:"changeDefinitionList",value:function(e){if(Array.isArray(e)){var t=this.playerConfig,n=t.definition,i=t.defaultDefinition,r=n||this.config.defaultDefinition||"";this.config.list=e.map((function(e){return!e.text&&e.name&&(e.text=e.name),e.text||(e.text=e.definition),e.definition!==r&&e.definition!==i||(e.selected=!0),e})),n.list=e,this.renderItemList(e),this.config.list.length<2?this.hide():this.show()}}},{key:"changeDefinition",value:function(e,t){var n=this.player;n.switchURL?n.switchUrl(e.url):n.changeDefinition(e,t)}},{key:"onItemClick",value:function(e,t){var i=this.player.definitionList;lo(jn(n.prototype),"onItemClick",this).apply(this,arguments),this.emitUserAction(e,"change_definition",{from:t.from,to:t.to});for(var r=0;r<i.length;r++)t.to&&i[r].definition===t.to.definition&&(t.to.url=i[r].url),t.from&&i[r].definition===t.from.definition&&(t.from.url=i[r].url);this.player.changeDefinition(t.to,t.from)}}],[{key:"pluginName",get:function(){return"definition"}},{key:"defaultConfig",get:function(){return{position:hv.CONTROLS_RIGHT,index:3,list:[],defaultDefinition:"",disable:!1,hidePortrait:!1,className:"xgplayer-definition",isShowIcon:!0}}}]),n}(dk);function vk(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=jn(e);if(t){var r=jn(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Bn(this,n)}}var yk=function(e){Mn(n,e);var t=vk(n);function n(e){var i;return In(this,n),(i=t.call(this,e)).curRate=1,i}return uo(n,[{key:"beforeCreate",value:function(e){var t=e.player.config.playbackRate,n=t?Array.isArray(t)?t:e.config.list:[];Array.isArray(n)&&(e.config.list=n.map((function(e){return"number"==typeof e?e={rate:e,text:"".concat(e,"x")}:!e.text&&e.rate&&(e.text="".concat(e.rate,"x")),e})))}},{key:"afterCreate",value:function(){var e=this;lo(jn(n.prototype),"afterCreate",this).call(this),this.on(tg,(function(){e.curValue!==e.player.playbackRate&&e.renderItemList()})),this.renderItemList()}},{key:"show",value:function(){this.config.list&&0!==this.config.list.length&&lo(jn(n.prototype),"show",this).call(this)}},{key:"onItemClick",value:function(e,t){lo(jn(n.prototype),"onItemClick",this).apply(this,arguments);var i=e.delegateTarget,r=Number(i.getAttribute("rate"));if(!r||r===this.curValue)return!1;var o={playbackRate:{from:this.player.playbackRate,to:r}};this.emitUserAction(e,"change_rate",{props:o}),this.curValue=r,this.player.playbackRate=r}},{key:"renderItemList",value:function(){var e=this,t=this.player.playbackRate||1;this.curValue=t;var i=0,r=this.config.list.map((function(n,r){var o={rate:n.rate};return o.rate===t&&(o.selected=!0,i=r),o.showText=e.getTextByLang(n),o}));lo(jn(n.prototype),"renderItemList",this).call(this,r,i)}},{key:"destroy",value:function(){lo(jn(n.prototype),"destroy",this).call(this)}}],[{key:"pluginName",get:function(){return"playbackRate"}},{key:"defaultConfig",get:function(){return{position:hv.CONTROLS_RIGHT,index:4,list:[2,1.5,1,.75,.5],className:"xgplayer-playbackrate",isShowIcon:!0,hidePortrait:!1}}}]),n}(dk);function mk(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="31" height="40" viewBox="0 -5 31 40">\n <path fill="#fff" transform="scale(1.3, 1.3)" class=\'path_full\' d="M9,10v1a.9.9,0,0,1-1,1,.9.9,0,0,1-1-1V9A.9.9,0,0,1,8,8h2a.9.9,0,0,1,1,1,.9.9,0,0,1-1,1Zm6,4V13a1,1,0,0,1,2,0v2a.9.9,0,0,1-1,1H14a1,1,0,0,1,0-2Zm3-7H6V17H18Zm2,0V17a2,2,0,0,1-2,2H6a2,2,0,0,1-2-2V7A2,2,0,0,1,6,5H18A2,2,0,0,1,20,7Z"></path>\n</svg>\n',"image/svg+xml").firstChild}function kk(){return(new DOMParser).parseFromString('<svg xmlns="http://www.w3.org/2000/svg" width="31" height="40" viewBox="0 -5 31 40">\n <path fill="#fff" transform="scale(1.3, 1.3)" d="M9,10V9a.9.9,0,0,1,1-1,.9.9,0,0,1,1,1v2a.9.9,0,0,1-1,1H8a.9.9,0,0,1-1-1,.9.9,0,0,1,1-1Zm6,4v1a1,1,0,0,1-2,0V13a.9.9,0,0,1,1-1h2a1,1,0,0,1,0,2Zm3-7H6V17H18Zm2,0V17a2,2,0,0,1-2,2H6a2,2,0,0,1-2-2V7A2,2,0,0,1,6,5H18A2,2,0,0,1,20,7Z"></path>\n</svg>\n',"image/svg+xml").firstChild}function bk(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=jn(e);if(t){var r=jn(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Bn(this,n)}}var wk=function(e){Mn(n,e);var t=bk(n);function n(){return In(this,n),t.apply(this,arguments)}return uo(n,[{key:"beforeCreate",value:function(e){"boolean"==typeof e.player.config.cssFullscreen&&(e.config.disable=!e.player.config.cssFullscreen)}},{key:"afterCreate",value:function(){var e=this;lo(jn(n.prototype),"afterCreate",this).call(this),this.config.disable||(this.config.target&&(this.playerConfig.fullscreenTarget=this.config.target),this.initIcons(),this.on(yg,(function(t){e.animate(t)})),this.btnClick=this.btnClick.bind(this),this.handleCssFullscreen=this.hook("cssFullscreen_change",this.btnClick,{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this.bind(["click","touchend"],this.handleCssFullscreen))}},{key:"initIcons",value:function(){var e=this.icons,t=this.find(".xgplayer-icon");t.appendChild(e.cssFullscreen),t.appendChild(e.exitCssFullscreen)}},{key:"btnClick",value:function(e){e.preventDefault(),e.stopPropagation();var t=this.player.isCssfullScreen;this.emitUserAction(e,"switch_cssfullscreen",{cssfullscreen:t}),t?this.player.exitCssFullscreen():this.player.getCssFullscreen()}},{key:"animate",value:function(e){this.root&&(e?this.setAttr("data-state","full"):this.setAttr("data-state","normal"),this.switchTips(e))}},{key:"switchTips",value:function(e){var t=this.i18nKeys;this.changeLangTextKey(this.find(".xg-tips"),e?t.EXITCSSFULLSCREEN_TIPS:t.CSSFULLSCREEN_TIPS)}},{key:"registerIcons",value:function(){return{cssFullscreen:{icon:mk,class:"xg-get-cssfull"},exitCssFullscreen:{icon:kk,class:"xg-exit-cssfull"}}}},{key:"destroy",value:function(){lo(jn(n.prototype),"destroy",this).call(this),this.unbind(["click","touchend"],this.btnClick)}},{key:"render",value:function(){if(!this.config.disable)return'<xg-icon class=\'xgplayer-cssfullscreen\'>\n <div class="xgplayer-icon">\n </div>\n <div class="xg-tips" lang-key="'.concat(this.i18nKeys.CSSFULLSCREEN_TIPS,'">').concat(this.i18n.CSSFULLSCREEN_TIPS,"</div>\n </xg-icon>")}}],[{key:"pluginName",get:function(){return"cssFullscreen"}},{key:"defaultConfig",get:function(){return{position:hv.CONTROLS_RIGHT,index:1,disable:!1,target:null}}}]),n}(Em);function Ck(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=jn(e);if(t){var r=jn(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Bn(this,n)}}var xk=function(e){Mn(n,e);var t=Ck(n);function n(){return In(this,n),t.apply(this,arguments)}return uo(n,[{key:"afterCreate",value:function(){var e=this;this.clickHandler=this.hook("errorRetry",this.errorRetry,{pre:function(e){e.preventDefault(),e.stopPropagation()}}),this.onError=this.hook("errorHandler",this.handleError),this.bind(".xgplayer-error-refresh","click",this.clickHandler),this.on(Zp,(function(){e.handleCanPlay()})),this.on(zp,(function(t){e.onError(t)}))}},{key:"errorRetry",value:function(e){this.emitUserAction(e,"error_retry",{}),this.player.retry()}},{key:"handleCanPlay",value:function(){Ap.removeClass(this.player.root,"xgplayer-is-error")}},{key:"handleError",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=this.player,n=e.errorType,i=t.error;if(!i)switch(n){case"decoder":i=this.i18n.MEDIA_ERR_DECODE;break;case"network":i=this.i18n.MEDIA_ERR_NETWORK;break;default:i=this.i18n.MEDIA_ERR_SRC_NOT_SUPPORTED}this.find(".xgplayer-error-text").innerHTML=i,this.find(".xgplayer-error-tips").innerHTML="".concat(this.i18n.REFRESH_TIPS,'<span class="xgplayer-error-refresh">').concat(this.i18n.REFRESH,"</span>")}},{key:"destroy",value:function(){this.unbind(".xgplayer-error-refresh","click",this.clickHandler)}},{key:"render",value:function(){return'<xg-error class="xgplayer-error">\n <div class="xgplayer-errornote">\n <span class="xgplayer-error-text"></span>\n <span class="xgplayer-error-tips"><em class="xgplayer-error-refresh"></em></span>\n </div>\n </xg-error>'}}],[{key:"pluginName",get:function(){return"error"}}]),n}(vv);function _k(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=jn(e);if(t){var r=jn(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Bn(this,n)}}var Sk=function(e){Mn(n,e);var t=_k(n);function n(){return In(this,n),t.apply(this,arguments)}return uo(n,[{key:"afterCreate",value:function(){var e=this;this.intervalId=0,this.customConfig=null,this.bind(".highlight",["click","touchend"],(function(t){(e.config.onClick||e.customOnClick)&&(t.preventDefault(),t.stopPropagation(),e.customOnClick?e.customOnClick(t):e.config.onClick(t))})),this.player.showPrompt=function(){e.show.apply(e,arguments)},this.player.hidePrompt=function(){e.hide()}}},{key:"setStyle",value:function(e){var t=this;Object.keys(e).map((function(n){t.root.style[n]=e[n]}))}},{key:"show",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if(e){this.customOnClick=i;var r=this.config.interval;this.intervalId&&(clearTimeout(this.intervalId),this.intervalId=null),Ap.addClass(this.root,"show"),"arrow"===n.mode&&Ap.addClass(this.root,"arrow"),this.find(".xgplayer-prompt-detail").innerHTML="string"==typeof e?e:"".concat(e.text||"")+"".concat(e.highlight?'<i class="highlight">'.concat(e.highlight,"</i>"):""),n.style&&this.setStyle(n.style);var o="boolean"==typeof n.autoHide?n.autoHide:this.config.autoHide;if(o){var s=n.interval||r;this.intervalId=setTimeout((function(){t.hide()}),s)}}}},{key:"hide",value:function(){Ap.removeClass(this.root,"show"),Ap.removeClass(this.root,"arrow"),this.root.removeAttribute("style"),this.customOnClick=null}},{key:"render",value:function(){return'<xg-prompt class="xgplayer-prompt '.concat(Tv.CONTROLS_FOLLOW,'">\n <span class="xgplayer-prompt-detail"></span>\n </xg-prompt>')}}],[{key:"pluginName",get:function(){return"prompt"}},{key:"defaultConfig",get:function(){return{interval:3e3,style:{},mode:"arrow",autoHide:!0,detail:{text:"",highlight:""},onClick:function(){}}}}]),n}(vv),Tk={time:0,text:"",id:1,duration:1,color:"#fff",style:{},width:6,height:6};function Ek(e){Object.keys(Tk).map((function(t){void 0===e[t]&&(e[t]=Tk[t])}))}var Pk={initDots:function(){var e=this;this._ispots.map((function(t){e.createDot(t,!1)})),this._ispotsInit=!0},createDot:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.player.plugins.progress;if(n&&(t&&(Ek(e),this._ispots.push(e)),this._ispotsInit||!t)){var i=this.calcuPosition(e.time,e.duration),r=e.style||{};r.left="".concat(i.left,"%"),r.width="".concat(i.width,"%");var o="xgspot_".concat(e.id," xgplayer-spot");i.isMini&&(o+=" mini");var s=Ap.createDom("xg-spot",e.template||"",{"data-text":e.text,"data-time":e.time,"data-id":e.id},o);Object.keys(r).map((function(e){s.style[e]=r[e]})),n.outer&&n.outer.appendChild(s)}},findDot:function(e){if(this.player.plugins.progress){var t=this._ispots.filter((function(t,n){return t.id===e}));return t.length>0?t[0]:null}},updateDot:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.player.plugins.progress;if(n){var i=this.findDot(e.id);if(i&&Object.keys(e).map((function(t){i[t]=e[t]})),this._ispotsInit){var r=n.find('xg-spot[data-id="'.concat(e.id,'"]'));if(r){var o=this.calcuPosition(e.time,e.duration),s=e.style||{};s.left="".concat(o.left,"%"),s.width="".concat(o.width,"%"),r.setAttribute("data-text",e.text),r.setAttribute("data-time",e.time),o.isMini?Ap.addClass(r,"mini"):Ap.removeClass(r,"mini"),Object.keys(s).map((function(e){r.style[e]=s[e]})),t&&this.showDot(e.id)}}}},deleteDot:function(e){var t=this._ispots,n=this.player.plugins.progress;if(n){for(var i=[],r=0;r<t.length;r++)t[r].id===e&&i.push(r);for(var o=i.length-1;o>=0;o--)if(t.splice(i[o],1),this._ispotsInit){var s=n.find('xg-spot[data-id="'.concat(e,'"]'));s&&s.parentElement.removeChild(s)}}},deleteAllDots:function(){var e=this.player.plugins.progress;if(e)if(this._ispotsInit){for(var t=e.root.getElementsByTagName("xg-spot"),n=t.length-1;n>=0;n--)e.outer.removeChild(t[n]);this._ispots=[]}else this._ispots=[]},updateAllDots:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=this.player.plugins.progress;if(n)if(this._ispotsInit){this._ispots=[];var i=n.root.getElementsByTagName("xg-spot"),r=i.length;if(r>t.length)for(var o=r-1;o>t.length-1;o--)n.outer.removeChild(i[o]);t.map((function(t,n){n<r?(i[n].setAttribute("data-id","".concat(t.id)),e._ispots.push(t),e.updateDot(t)):e.createDot(t)}))}else this._ispots=t},getAllDotsDom:function(){var e=this.player.plugins.progress;return e?e.root.getElementsByTagName("xg-spot"):[]},getDotDom:function(e){var t=this.player.plugins.progress;if(t)return t.find('xg-spot[data-id="'.concat(e,'"]'))}};function Rk(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=jn(e);if(t){var r=jn(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Bn(this,n)}}var Ok={dragmove:"onProgressMove",dragstart:"onProgressDragStart",dragend:"onProgressDragEnd",click:"onProgressClick",mouseover:"onProgressMouseOver",mouseenter:"onProgressMove"},Ak=function(e){Mn(n,e);var t=Rk(n);function n(e){var i;return In(this,n),Un(Fn(i=t.call(this,e)),"onMousemove",(function(e){i.config.disable||(Ap.hasClass(e.target,"xg-spot-content")&&i.config.isHideThumbnailHover?i.player.plugins.progress.onMouseLeave(e):(i._state.f||Ap.hasClass(e.target,"xg-spot-content"))&&(Ap.event(e),e.stopPropagation()))})),Un(Fn(i),"onMousedown",(function(e){i.config.disable||(i._state.f||Ap.hasClass(e.target,"xg-spot-content"))&&(Ap.event(e),e.stopPropagation())})),Un(Fn(i),"onMouseup",(function(e){if(i.isDrag){var t=i.player.plugins.progress;t&&t.pos&&(t.onMouseUp(e),!t.pos.isEnter&&t.onMouseLeave(e))}})),Un(Fn(i),"onDotMouseLeave",(function(e){if(!i.config.disable){i._curDot.removeEventListener("mouseleave",i.onDotMouseLeave),i.blurDot(e.target),i._curDot=null;var t=i.player.plugins.progress;t&&t.enableBlur(),i.show()}})),Un(Fn(i),"onProgressMouseOver",(function(e,t){if(!i.config.disable&&Ap.hasClass(t.target,"xgplayer-spot")&&!i._curDot){i._curDot=t.target,i.focusDot(t.target),i._curDot.children.length>0&&i.hide();var n=i.player.plugins.progress;n&&n.disableBlur(),i._curDot.addEventListener("mouseleave",i.onDotMouseLeave)}})),i._ispots=[],i.videoPreview=null,i.videothumbnail=null,i.thumbnail=null,i._state={now:0,f:!1},i}return uo(n,[{key:"beforeCreate",value:function(e){var t=e.player.plugins.progress;t&&(e.root=t.root)}},{key:"afterCreate",value:function(){var e=this;this._curDot=null,this.handlerSpotClick=this.hook("spotClick",(function(t,n){n.time&&e.player.seek(n.time)})),function(e){var t=e.config,n=e.player;Object.keys(Pk).map((function(t){e[t]=Pk[t].bind(e)}));var i=n.config.progressDot||t.ispots||[];e._ispots=i.map((function(e){return Ek(e),e})),e._ispotsInit=!1,n.once(Jp,(function(){e.initDots()}))}(this),this.config.disable&&this.disable()}},{key:"setConfig",value:function(e){var t=this;e&&Object.keys(e).map((function(n){t.config[n]=e[n]}))}},{key:"onPluginsReady",value:function(){this.player.plugins.progress&&(this.previewLine=this.find(".xg-spot-line"),this.timePoint=this.find(".xgplayer-progress-point"),this.timeText=this.find(".xg-spot-time"),this.tipText=this.find(".spot-inner-text"),this._hasThumnail=!1,this.registerThumbnail(),this.bindEvents())}},{key:"bindEvents",value:function(){var e=this,t=this.player.plugins.progress;if(t&&(Object.keys(Ok).map((function(n){e[Ok[n]]=e[Ok[n]].bind(e),t.addCallBack(n,e[Ok[n]])})),"mobile"!==Bp.device)){this.bind(".xg-spot-info","mousemove",this.onMousemove),this.bind(".xg-spot-info","mousedown",this.onMousedown),this.bind(".xg-spot-info","mouseup",this.onMouseup);var n=this.hook("previewClick",(function(){}));this.handlerPreviewClick=function(t){t.stopPropagation(),n(parseInt(1e3*e._state.now,10)/1e3,t)},this.bind(".xg-spot-content","mouseup",this.handlerPreviewClick)}}},{key:"onProgressMove",value:function(e,t){!this.config.disable&&this.player.duration&&this.updatePosition(e.offset,e.width,e.currentTime,e.e)}},{key:"onProgressDragStart",value:function(e){!this.config.disable&&this.player.duration&&(this.isDrag=!0,this.videoPreview&&Ap.addClass(this.videoPreview,"show"))}},{key:"onProgressDragEnd",value:function(e){!this.config.disable&&this.player.duration&&(this.isDrag=!1,this.videoPreview&&Ap.removeClass(this.videoPreview,"show"))}},{key:"onProgressClick",value:function(e,t){if(!this.config.disable&&Ap.hasClass(t.target,"xgplayer-spot")){t.stopPropagation(),t.preventDefault();var n={};["time","id","text"].map((function(e){n[e]=t.target.getAttribute("data-".concat(e))})),n.time&&(n.time=Number(n.time)),this.handlerSpotClick(t,n)}}},{key:"updateLinePos",value:function(e,t){var n,i,r=this.root,o=this.previewLine,s=this.timePoint,a=this.player,c=this.config,u="flex"===a.controls.mode,l=r.getBoundingClientRect().width,f=s.getBoundingClientRect().width,h=e-(l=this._hasThumnail&&l<c.width?c.width:l)/2;h<0&&!u?(h=0,n=e-l/2,!this.thumbnail&&(i=e-l/2-f/2)):h>t-l&&!u?(n=h-(t-l),!this.thumbnail&&(i=h-(t-l)-f/2),h=t-l):(n=0,!this.thumbnail&&(i=-f/2)),void 0!==n&&(o.style.transform="translateX(".concat(n.toFixed(2),"px)")),void 0!==i&&(s.style.transform="translateX(".concat(i.toFixed(2),"px)")),r.style.transform="translateX(".concat(h.toFixed(2),"px) translateZ(0)")}},{key:"updateTimeText",value:function(e){var t=this.timeText,n=this.timePoint;t.textContent=e,!this.thumbnail&&(n.textContent=e)}},{key:"updatePosition",value:function(e,t,n,i){var r=this.root,o=this.config,s=this._state;if(r){this.updateLinePos(e,t),s.now=n;var a=Ap.format(n);i&&i.target&&Ap.hasClass(i.target,"xgplayer-spot")?(this.showTips(i.target.getAttribute("data-text"),!1,a),this.focusDot(i.target),s.f=!0,o.isFocusDots&&s.f&&(s.now=parseInt(i.target.getAttribute("data-time"),10))):o.defaultText?(s.f=!1,this.showTips(o.defaultText,!0,a)):(s.f=!1,this.hideTips("")),this.updateTimeText(a),this.updateThumbnails(s.now)}}},{key:"updateThumbnails",value:function(e){var t=this.player,n=this.videoPreview,i=this.config,r=t.plugins.thumbnail;if(r&&r.usable){this.thumbnail&&r.update(this.thumbnail,e,i.width,i.height);var o=n&&n.getBoundingClientRect();this.videothumbnail&&r.update(this.videothumbnail,e,o.width,o.height)}}},{key:"registerThumbnail",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("mobile"!==Bp.device){var t=this.player,n=this.config,i=t.getPlugin("thumbnail");if(i&&i.setConfig(e),i&&i.usable&&n.isShowThumbnail){Ap.removeClass(this.root,"short-line no-thumbnail"),"short"===n.mode&&Ap.addClass(this.root,"short-line"),this._hasThumnail=!0;var r=this.find(".xg-spot-thumbnail");this.thumbnail=i.createThumbnail(r,"progress-thumbnail"),n.isShowCoverPreview&&(this.videoPreview=Ap.createDom("xg-video-preview","",{},"xgvideo-preview"),t.root.appendChild(this.videoPreview),this.videothumbnail=i.createThumbnail(this.videoPreview,"xgvideo-thumbnail")),this.updateThumbnails(0)}else Ap.addClass(this.root,"short-line no-thumbnail")}}},{key:"calcuPosition",value:function(e,t){var n=this.player.plugins.progress,i=this.player,r=n.root.getBoundingClientRect().width,o=i.duration/r*6;return e+t>i.duration&&(t=i.duration-e),i.duration,i.duration,{left:e/i.duration*100,width:t/i.duration*100,isMini:t<o}}},{key:"showDot",value:function(e){var t=this.findDot(e);if(t){var n=this.root.getBoundingClientRect().width,i=t.time/this.player.duration*n;this.updatePosition(i,n,t.time)}}},{key:"focusDot",value:function(e,t){e&&(t||(t=e.getAttribute("data-id")),Ap.addClass(e,"active"),this._activeDotId=t)}},{key:"blurDot",value:function(e){if(!e){var t=this._activeDotId;e=this.getDotDom(t)}e&&(Ap.removeClass(e,"active"),this._activeDotId=null)}},{key:"showTips",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";Ap.addClass(this.root,"no-timepoint"),e&&(Ap.addClass(this.find(".xg-spot-content"),"show-text"),t&&"production"===this.config.mode?(Ap.addClass(this.root,"product"),this.tipText.textContent=e):(Ap.removeClass(this.root,"product"),this.tipText.textContent=this._hasThumnail?e:"".concat(n," ").concat(e)))}},{key:"hideTips",value:function(){Ap.removeClass(this.root,"no-timepoint"),this.tipText.textContent="",Ap.removeClass(this.find(".xg-spot-content"),"show-text"),Ap.removeClass(this.root,"product")}},{key:"hide",value:function(){Ap.addClass(this.root,"hide")}},{key:"show",value:function(){Ap.removeClass(this.root,"hide")}},{key:"enable",value:function(){var e=this.config,t=this.playerConfig;this.config.disable=!1,this.show(),!this.thumbnail&&e.isShowThumbnail&&this.registerThumbnail(t.thumbnail||{})}},{key:"disable",value:function(){this.config.disable=!0,this.hide()}},{key:"destroy",value:function(){var e=this,t=this.player.plugins.progress;t&&Object.keys(Ok).map((function(n){t.removeCallBack(n,e[Ok[n]])})),this.videothumbnail=null,this.thumbnail=null,this.videoPreview&&this.player.root.removeChild(this.videoPreview),this.unbind(".xg-spot-info","mousemove",this.onMousemove),this.unbind(".xg-spot-info","mousedown",this.onMousedown),this.unbind(".xg-spot-info","mouseup",this.onMouseup),this.unbind(".xg-spot-content","mouseup",this.handlerPreviewClick)}},{key:"render",value:function(){return"mobile"===Bp.device||"mobile"===this.playerConfig.isMobileSimulateMode?"":'<div class="xg-spot-info '.concat("short"===this.config.mode?"short-line":"",'">\n <div class="xg-spot-content">\n <div class="xg-spot-thumbnail">\n <span class="xg-spot-time"></span>\n </div>\n <div class="xg-spot-text"><span class="spot-inner-text"></span></div>\n </div>\n <div class="xgplayer-progress-point">00:00</div>\n <div class="xg-spot-line"></div>\n </div>')}}],[{key:"pluginName",get:function(){return"progresspreview"}},{key:"defaultConfig",get:function(){return{index:1,miniWidth:6,ispots:[],defaultText:"",isFocusDots:!0,isHideThumbnailHover:!0,isShowThumbnail:!0,isShowCoverPreview:!1,mode:"",disable:!1,width:160,height:90}}}]),n}(vv);function Lk(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=jn(e);if(t){var r=jn(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Bn(this,n)}}var Ik=function(e){Mn(n,e);var t=Lk(n);function n(e){var i;return In(this,n),(i=t.call(this,e)).ratio=1,i.interval=null,i._preloadMark={},i}return uo(n,[{key:"afterCreate",value:function(){this.usable&&this.initThumbnail()}},{key:"setConfig",value:function(e){var t=this;e&&(Object.keys(e).length<1||(Object.keys(e).map((function(n){t.config[n]=e[n]})),this.usable&&this.initThumbnail()))}},{key:"usable",get:function(){var e=this.config,t=e.urls,n=e.pic_num;return t&&t.length>0&&n>0}},{key:"initThumbnail",value:function(){var e=this.config,t=e.width,n=e.height,i=e.pic_num,r=e.interval;this.ratio=t/n*100,this.interval=r||Math.round(this.player.duration/i),this._preloadMark={}}},{key:"getUrlByIndex",value:function(e){return e>=0&&e<this.config.urls.length?this.config.urls[e]:""}},{key:"preload",value:function(e){var t=this;if(!this._preloadMark[e]){var n=this.config.urls,i=n.length,r=[];e>0&&r.push(e-1),r.push(e),e>0&&e<i-1&&r.push(e+1),r.map((function(e){!t._preloadMark[e]&&e>=0&&e<i&&(t._preloadMark[e]=1,Ap.preloadImg(n[e],(function(){t._preloadMark[e]=2})))}))}}},{key:"getPosition",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=this.config,r=i.pic_num,o=i.row,s=i.col,a=i.width,c=i.height;this.interval=Math.round(this.player.duration/r);var u=Math.ceil(e/this.interval),l=(u=u>r?r:u)<o*s?0:Math.ceil(u/(o*s))-1,f=u-l*(s*o),h=f>0?Math.ceil(f/s)-1:0,d=f>0?f-h*s-1:0,p=0,g=0;if(t&&n){var v=t/n;v<a/c?p=(g=n)*(a/c):g=(p=t)/(a/c)}else n?t||(p=(g=n||c)*(a/c)):g=(p=t||a)/(a/c);var y=this.getUrlByIndex(l);return{urlIndex:l,rowIndex:h,colIndex:d,url:y,height:g,width:p,style:{backgroundImage:"url(".concat(y,")"),backgroundSize:"".concat(p*s,"px auto"),backgroundPosition:"-".concat(d*p,"px -").concat(h*g,"px"),width:"".concat(p,"px"),height:"".concat(g,"px")}}}},{key:"update",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",o=this.config,s=o.pic_num,a=o.urls;if(!(s<=0)&&a&&0!==a.length){var c=this.getPosition(t,n,i);this.preload(c.urlIndex),Object.keys(c.style).map((function(t){e.style[t]=c.style[t]})),Object.keys(r).map((function(t){e.style[t]=r[t]}))}}},{key:"createThumbnail",value:function(e,t){var n=Ap.createDom("xg-thumbnail","",{},"thumbnail ".concat(t));return e&&e.appendChild(n),n}}],[{key:"pluginName",get:function(){return"thumbnail"}},{key:"defaultConfig",get:function(){return{isShow:!1,urls:[],pic_num:0,col:0,row:0,height:90,width:160,scale:1,className:"",hidePortrait:!1}}}]),n}(vv);function Dk(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=jn(e);if(t){var r=jn(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Bn(this,n)}}var Mk=function(e){Mn(n,e);var t=Dk(n);function n(){return In(this,n),t.apply(this,arguments)}return uo(n,[{key:"afterCreate",value:function(){}},{key:"update",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{cached:0,played:0},t=arguments.length>1?arguments[1]:void 0;t&&this.root&&(e.cached&&(this.find("xg-mini-progress-cache").style.width="".concat(e.cached/t*100,"%")),e.played&&(this.find("xg-mini-progress-played").style.width="".concat(e.played/t*100,"%")))}},{key:"render",value:function(){if(this.playerConfig.progress&&this.playerConfig.miniprogress)return'<xg-mini-progress class="xg-mini-progress">\n <xg-mini-progress-cache class="xg-mini-progress-cache"></xg-mini-progress-cache>\n <xg-mini-progress-played class="xg-mini-progress-played"></xg-mini-progress-played>\n </xg-mini-progress>'}}],[{key:"pluginName",get:function(){return"MiniProgress"}},{key:"defaultConfig",get:function(){return{}}}]),n}(vv);function Nk(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=jn(e);if(t){var r=jn(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Bn(this,n)}}var Fk="realtime",Bk="firstframe",jk="poster";function Uk(){try{return window.performance.now()}catch(e){return(new Date).getTime()}}var Hk=null,Gk=function(e){Mn(n,e);var t=Nk(n);function n(){var e;In(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Un(Fn(e=t.call.apply(t,[this].concat(r))),"start",(function(){var t=e.player.video,n=Uk(),i=e.checkVideoIsSupport(t);i&&e.canvasCtx&&(e.stop(),t.videoWidth&&t.videoHeight&&(e.videoPI=t.videoHeight>0?parseInt(t.videoWidth/t.videoHeight*100,10):0,(e.config.mode===Fk||n-e.preTime>=e.interval)&&(t&&t.videoWidth&&e.update(i,e.videoPI),e.preTime=n)),e.frameId=Ap.requestAnimationFrame(e.start))})),Un(Fn(e),"stop",(function(){e.frameId&&(Ap.cancelAnimationFrame(e.frameId),e.frameId=null)})),e}return uo(n,[{key:"afterCreate",value:function(){var e=this;!0===this.playerConfig.dynamicBg&&(this.config.disable=!1),n.isSupport||(this.config.disable=!0);var t=this.config,i=t.disable,r=t.mode;i||(this._pos={width:0,height:0,rwidth:0,rheight:0,x:0,y:0,pi:0},this.isStart=!1,this.videoPI=0,this.preTime=0,this.interval=parseInt(1e3/this.config.frameRate,10),this.canvas=null,this.canvasCtx=null,this.once(fg,(function(){e.player&&(e.init(),e.player.paused||e.start())})),r!==jk&&(r!==Bk&&(this.on(rg,(function(){e.stop()})),this.on(Gp,(function(){e.start()})),this.on(Kp,(function(){e.stop()}))),r===Bk&&this.once(qp,(function(){e.renderOnce()}))))}},{key:"init",value:function(){var e=this.player,t=this.config;this.canvasFilter=n.supportCanvasFilter();try{var i=this.config.isInnerRender&&e.innerContainer||e.root;i.insertAdjacentHTML("afterbegin",'<div class="xgplayer-dynamic-bg"><canvas>\n </canvas><xgmask></xgmask></div>'),this.root=i.children[0],this.canvas=this.find("canvas"),this.canvasFilter||(this.canvas.style.filter=t.filter,this.canvas.style.webkitFilter=t.filter),this.mask=this.find("xgmask"),t.addMask&&(this.mask.style.background=t.maskBg),this.canvasCtx=this.canvas.getContext("2d"),this.renderByPoster()}catch(e){Rp.logError("plugin:DynamicBg",e)}}},{key:"checkVideoIsSupport",value:function(e){if(!e)return null;var t=e&&e instanceof window.HTMLVideoElement?e:e.canvas?e.canvas:e.flyVideo?e.flyVideo:null;if(t&&("safari"!==Bp.browser||!/^blob/.test(t.currentSrc)&&!/^blob/.test(t.src)))return t;var n=t?t.tagName.toLowerCase():"";return"canvas"===n||"img"===n?t:null}},{key:"renderByPoster",value:function(){var e=this.playerConfig.poster;if(e){var t="String"===Ap.typeOf(e)?e:"String"===Ap.typeOf(e.poster)?e.poster:null;this.updateImg(t)}}},{key:"renderOnce",value:function(){var e=this.player.video;if(e.videoWidth&&e.videoHeight){this.videoPI=parseInt(e.videoWidth/e.videoHeight*100,10);var t=this.checkVideoIsSupport(e);t&&e.videoWidth&&this.update(t,this.videoPI)}}},{key:"updateImg",value:function(e){var t=this;if(e){var n=this.canvas.getBoundingClientRect(),i=n.width,r=n.height,o=new window.Image;o.onload=function(){if(t.canvas&&!t.frameId&&!t.isStart){t.canvas.height=r,t.canvas.width=i;var e=parseInt(i/r*100,10);t.update(o,e),o=null}},o.src=e}}},{key:"update",value:function(e,t){if(this.canvas&&this.canvasCtx&&t)try{var n=this._pos,i=this.config,r=this.canvas.getBoundingClientRect(),o=r.width,s=r.height;if(o!==n.width||s!==n.height||n.pi!==t){var a=parseInt(o/s*100,10);n.pi=t,n.width=this.canvas.width=o,n.height=this.canvas.height=s;var c=s,u=o;a<t?u=parseInt(s*t/100,10):a>t&&(c=parseInt(100*o/t,10)),n.rwidth=u*i.multiple,n.rheight=c*i.multiple,n.x=(o-n.rwidth)/2,n.y=(s-n.rheight)/2}this.canvasFilter&&(this.canvasCtx.filter=i.filter),this.canvasCtx.drawImage(e,n.x,n.y,n.rwidth,n.rheight)}catch(e){Rp.logError("plugin:DynamicBg",e)}}},{key:"destroy",value:function(){this.stop(),this.canvasCtx=null,this.canvas=null}},{key:"render",value:function(){return""}}],[{key:"pluginName",get:function(){return"dynamicBg"}},{key:"defaultConfig",get:function(){return{isInnerRender:!1,disable:!0,mode:"framerate",frameRate:10,filter:"blur(50px)",addMask:!0,multiple:1.2,maskBg:"rgba(0,0,0,0.7)"}}},{key:"isSupport",get:function(){return"boolean"==typeof Hk?Hk:Hk=function(){try{return!!document.createElement("canvas").getContext}catch(e){return!1}}()}},{key:"supportCanvasFilter",value:function(){return!("safari"===Bp.browser||"firefox"===Bp.browser)}}]),n}(vv),Vk=r,Wk=gi("iterator"),Kk=!Vk((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,n="";return e.pathname="c%20d",t.forEach((function(e,i){t.delete("b"),n+=i+e})),!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[Wk]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==n||"x"!==new URL("http://x",void 0).host})),zk=W,Yk=cc,Xk=Ei,qk=_,$k=function(e,t,n,i){try{return i?t(zk(n)[0],n[1]):t(n)}catch(t){throw Yk(e),t}},Zk=nc,Jk=ot,Qk=io,eb=sc,tb=2147483647,nb=/[^\0-\u007E]/,ib=/[.\u3002\uFF0E\uFF61]/g,rb="Overflow: input needs wider integers to process",ob=Math.floor,sb=String.fromCharCode,ab=function(e){return e+22+75*(e<26)},cb=function(e,t,n){var i=0;for(e=n?ob(e/700):e>>1,e+=ob(e/t);e>455;i+=36)e=ob(e/35);return ob(i+36*e/(e+38))},ub=function(e){var t,n,i=[],r=(e=function(e){for(var t=[],n=0,i=e.length;n<i;){var r=e.charCodeAt(n++);if(r>=55296&&r<=56319&&n<i){var o=e.charCodeAt(n++);56320==(64512&o)?t.push(((1023&r)<<10)+(1023&o)+65536):(t.push(r),n--)}else t.push(r)}return t}(e)).length,o=128,s=0,a=72;for(t=0;t<e.length;t++)(n=e[t])<128&&i.push(sb(n));var c=i.length,u=c;for(c&&i.push("-");u<r;){var l=tb;for(t=0;t<e.length;t++)(n=e[t])>=o&&n<l&&(l=n);var f=u+1;if(l-o>ob((tb-s)/f))throw RangeError(rb);for(s+=(l-o)*f,o=l,t=0;t<e.length;t++){if((n=e[t])<o&&++s>tb)throw RangeError(rb);if(n==o){for(var h=s,d=36;;d+=36){var p=d<=a?1:d>=a+26?26:d-a;if(h<p)break;var g=h-p,v=36-p;i.push(sb(ab(p+g%v))),h=ob(g/v)}i.push(sb(ab(h))),a=cb(s,f,u==c),s=0,++u}}++s,++o}return i.join("")},lb=W,fb=sc,hb=Xt,db=Je,pb=Kk,gb=Q.exports,vb=Ha,yb=Si,mb=Hf,kb=je,bb=Za,wb=E,Cb=Ei,xb=Ia,_b=W,Sb=b,Tb=gn,Eb=l,Pb=function(e){var t=fb(e);if("function"!=typeof t)throw TypeError(String(e)+" is not iterable");return lb(t.call(e))},Rb=sc,Ob=gi,Ab=db("fetch"),Lb=db("Headers"),Ib=Ob("iterator"),Db="URLSearchParams",Mb="URLSearchParamsIterator",Nb=kb.set,Fb=kb.getterFor(Db),Bb=kb.getterFor(Mb),jb=/\+/g,Ub=Array(4),Hb=function(e){return Ub[e-1]||(Ub[e-1]=RegExp("((?:%[\\da-f]{2}){"+e+"})","gi"))},Gb=function(e){try{return decodeURIComponent(e)}catch(t){return e}},Vb=function(e){var t=e.replace(jb," "),n=4;try{return decodeURIComponent(t)}catch(e){for(;n;)t=t.replace(Hb(n--),Gb);return t}},Wb=/[!'()~]|%20/g,Kb={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},zb=function(e){return Kb[e]},Yb=function(e){return encodeURIComponent(e).replace(Wb,zb)},Xb=function(e,t){if(t)for(var n,i,r=t.split("&"),o=0;o<r.length;)(n=r[o++]).length&&(i=n.split("="),e.push({key:Vb(i.shift()),value:Vb(i.join("="))}))},qb=function(e){this.entries.length=0,Xb(this.entries,e)},$b=function(e,t){if(e<t)throw TypeError("Not enough arguments")},Zb=mb((function(e,t){Nb(this,{type:Mb,iterator:Pb(Fb(e).entries),kind:t})}),"Iterator",(function(){var e=Bb(this),t=e.kind,n=e.iterator.next(),i=n.value;return n.done||(n.value="keys"===t?i.key:"values"===t?i.value:[i.key,i.value]),n})),Jb=function(){bb(this,Jb,Db);var e,t,n,i,r,o,s,a,c,u=arguments.length>0?arguments[0]:void 0,l=this,f=[];if(Nb(l,{type:Db,entries:f,updateURL:function(){},updateSearchParams:qb}),void 0!==u)if(Sb(u))if("function"==typeof(e=Rb(u)))for(n=(t=e.call(u)).next;!(i=n.call(t)).done;){if((s=(o=(r=Pb(_b(i.value))).next).call(r)).done||(a=o.call(r)).done||!o.call(r).done)throw TypeError("Expected sequence with length 2");f.push({key:s.value+"",value:a.value+""})}else for(c in u)wb(u,c)&&f.push({key:c,value:u[c]+""});else Xb(f,"string"==typeof u?"?"===u.charAt(0)?u.slice(1):u:u+"")},Qb=Jb.prototype;vb(Qb,{append:function(e,t){$b(arguments.length,2);var n=Fb(this);n.entries.push({key:e+"",value:t+""}),n.updateURL()},delete:function(e){$b(arguments.length,1);for(var t=Fb(this),n=t.entries,i=e+"",r=0;r<n.length;)n[r].key===i?n.splice(r,1):r++;t.updateURL()},get:function(e){$b(arguments.length,1);for(var t=Fb(this).entries,n=e+"",i=0;i<t.length;i++)if(t[i].key===n)return t[i].value;return null},getAll:function(e){$b(arguments.length,1);for(var t=Fb(this).entries,n=e+"",i=[],r=0;r<t.length;r++)t[r].key===n&&i.push(t[r].value);return i},has:function(e){$b(arguments.length,1);for(var t=Fb(this).entries,n=e+"",i=0;i<t.length;)if(t[i++].key===n)return!0;return!1},set:function(e,t){$b(arguments.length,1);for(var n,i=Fb(this),r=i.entries,o=!1,s=e+"",a=t+"",c=0;c<r.length;c++)(n=r[c]).key===s&&(o?r.splice(c--,1):(o=!0,n.value=a));o||r.push({key:s,value:a}),i.updateURL()},sort:function(){var e,t,n,i=Fb(this),r=i.entries,o=r.slice();for(r.length=0,n=0;n<o.length;n++){for(e=o[n],t=0;t<n;t++)if(r[t].key>e.key){r.splice(t,0,e);break}t===n&&r.push(e)}i.updateURL()},forEach:function(e){for(var t,n=Fb(this).entries,i=Cb(e,arguments.length>1?arguments[1]:void 0,3),r=0;r<n.length;)i((t=n[r++]).value,t.key,this)},keys:function(){return new Zb(this,"keys")},values:function(){return new Zb(this,"values")},entries:function(){return new Zb(this,"entries")}},{enumerable:!0}),gb(Qb,Ib,Qb.entries),gb(Qb,"toString",(function(){for(var e,t=Fb(this).entries,n=[],i=0;i<t.length;)e=t[i++],n.push(Yb(e.key)+"="+Yb(e.value));return n.join("&")}),{enumerable:!0}),yb(Jb,Db),hb({global:!0,forced:!pb},{URLSearchParams:Jb}),pb||"function"!=typeof Ab||"function"!=typeof Lb||hb({global:!0,enumerable:!0,forced:!0},{fetch:function(e){var t,n,i,r=[e];return arguments.length>1&&(Sb(t=arguments[1])&&(n=t.body,xb(n)===Db&&((i=t.headers?new Lb(t.headers):new Lb).has("content-type")||i.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"),t=Tb(t,{body:Eb(0,String(n)),headers:Eb(0,i)}))),r.push(t)),Ab.apply(this,r)}});var ew,tw={URLSearchParams:Jb,getState:Fb},nw=Xt,iw=o,rw=Kk,ow=n,sw=nn,aw=Q.exports,cw=Za,uw=E,lw=Mh,fw=function(e){var t,n,i,r,o,s,a=qk(e),c="function"==typeof this?this:Array,u=arguments.length,l=u>1?arguments[1]:void 0,f=void 0!==l,h=eb(a),d=0;if(f&&(l=Xk(l,u>2?arguments[2]:void 0,2)),null==h||c==Array&&Zk(h))for(n=new c(t=Jk(a.length));t>d;d++)s=f?l(a[d],d):a[d],Qk(n,d,s);else for(o=(r=h.call(a)).next,n=new c;!(i=o.call(r)).done;d++)s=f?$k(r,l,[i.value,d],!0):i.value,Qk(n,d,s);return n.length=d,n},hw=Ws.codeAt,dw=function(e){var t,n,i=[],r=e.toLowerCase().replace(ib,".").split(".");for(t=0;t<r.length;t++)n=r[t],i.push(nb.test(n)?"xn--"+ub(n):n);return i.join(".")},pw=Si,gw=tw,vw=je,yw=ow.URL,mw=gw.URLSearchParams,kw=gw.getState,bw=vw.set,ww=vw.getterFor("URL"),Cw=Math.floor,xw=Math.pow,_w="Invalid scheme",Sw="Invalid host",Tw="Invalid port",Ew=/[A-Za-z]/,Pw=/[\d+-.A-Za-z]/,Rw=/\d/,Ow=/^0x/i,Aw=/^[0-7]+$/,Lw=/^\d+$/,Iw=/^[\dA-Fa-f]+$/,Dw=/[\0\t\n\r #%/:<>?@[\\\]^|]/,Mw=/[\0\t\n\r #/:<>?@[\\\]^|]/,Nw=/^[\u0000-\u001F ]+|[\u0000-\u001F ]+$/g,Fw=/[\t\n\r]/g,Bw=function(e,t){var n,i,r;if("["==t.charAt(0)){if("]"!=t.charAt(t.length-1))return Sw;if(!(n=Uw(t.slice(1,-1))))return Sw;e.host=n}else if(Xw(e)){if(t=dw(t),Dw.test(t))return Sw;if(null===(n=jw(t)))return Sw;e.host=n}else{if(Mw.test(t))return Sw;for(n="",i=fw(t),r=0;r<i.length;r++)n+=zw(i[r],Gw);e.host=n}},jw=function(e){var t,n,i,r,o,s,a,c=e.split(".");if(c.length&&""==c[c.length-1]&&c.pop(),(t=c.length)>4)return e;for(n=[],i=0;i<t;i++){if(""==(r=c[i]))return e;if(o=10,r.length>1&&"0"==r.charAt(0)&&(o=Ow.test(r)?16:8,r=r.slice(8==o?1:2)),""===r)s=0;else{if(!(10==o?Lw:8==o?Aw:Iw).test(r))return e;s=parseInt(r,o)}n.push(s)}for(i=0;i<t;i++)if(s=n[i],i==t-1){if(s>=xw(256,5-t))return null}else if(s>255)return null;for(a=n.pop(),i=0;i<n.length;i++)a+=n[i]*xw(256,3-i);return a},Uw=function(e){var t,n,i,r,o,s,a,c=[0,0,0,0,0,0,0,0],u=0,l=null,f=0,h=function(){return e.charAt(f)};if(":"==h()){if(":"!=e.charAt(1))return;f+=2,l=++u}for(;h();){if(8==u)return;if(":"!=h()){for(t=n=0;n<4&&Iw.test(h());)t=16*t+parseInt(h(),16),f++,n++;if("."==h()){if(0==n)return;if(f-=n,u>6)return;for(i=0;h();){if(r=null,i>0){if(!("."==h()&&i<4))return;f++}if(!Rw.test(h()))return;for(;Rw.test(h());){if(o=parseInt(h(),10),null===r)r=o;else{if(0==r)return;r=10*r+o}if(r>255)return;f++}c[u]=256*c[u]+r,2!=++i&&4!=i||u++}if(4!=i)return;break}if(":"==h()){if(f++,!h())return}else if(h())return;c[u++]=t}else{if(null!==l)return;f++,l=++u}}if(null!==l)for(s=u-l,u=7;0!=u&&s>0;)a=c[u],c[u--]=c[l+s-1],c[l+--s]=a;else if(8!=u)return;return c},Hw=function(e){var t,n,i,r;if("number"==typeof e){for(t=[],n=0;n<4;n++)t.unshift(e%256),e=Cw(e/256);return t.join(".")}if("object"==typeof e){for(t="",i=function(e){for(var t=null,n=1,i=null,r=0,o=0;o<8;o++)0!==e[o]?(r>n&&(t=i,n=r),i=null,r=0):(null===i&&(i=o),++r);return r>n&&(t=i,n=r),t}(e),n=0;n<8;n++)r&&0===e[n]||(r&&(r=!1),i===n?(t+=n?":":"::",r=!0):(t+=e[n].toString(16),n<7&&(t+=":")));return"["+t+"]"}return e},Gw={},Vw=lw({},Gw,{" ":1,'"':1,"<":1,">":1,"`":1}),Ww=lw({},Vw,{"#":1,"?":1,"{":1,"}":1}),Kw=lw({},Ww,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),zw=function(e,t){var n=hw(e,0);return n>32&&n<127&&!uw(t,e)?e:encodeURIComponent(e)},Yw={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Xw=function(e){return uw(Yw,e.scheme)},qw=function(e){return""!=e.username||""!=e.password},$w=function(e){return!e.host||e.cannotBeABaseURL||"file"==e.scheme},Zw=function(e,t){var n;return 2==e.length&&Ew.test(e.charAt(0))&&(":"==(n=e.charAt(1))||!t&&"|"==n)},Jw=function(e){var t;return e.length>1&&Zw(e.slice(0,2))&&(2==e.length||"/"===(t=e.charAt(2))||"\\"===t||"?"===t||"#"===t)},Qw=function(e){var t=e.path,n=t.length;!n||"file"==e.scheme&&1==n&&Zw(t[0],!0)||t.pop()},eC=function(e){return"."===e||"%2e"===e.toLowerCase()},tC={},nC={},iC={},rC={},oC={},sC={},aC={},cC={},uC={},lC={},fC={},hC={},dC={},pC={},gC={},vC={},yC={},mC={},kC={},bC={},wC={},CC=function(e,t,n,i){var r,o,s,a,c,u=n||tC,l=0,f="",h=!1,d=!1,p=!1;for(n||(e.scheme="",e.username="",e.password="",e.host=null,e.port=null,e.path=[],e.query=null,e.fragment=null,e.cannotBeABaseURL=!1,t=t.replace(Nw,"")),t=t.replace(Fw,""),r=fw(t);l<=r.length;){switch(o=r[l],u){case tC:if(!o||!Ew.test(o)){if(n)return _w;u=iC;continue}f+=o.toLowerCase(),u=nC;break;case nC:if(o&&(Pw.test(o)||"+"==o||"-"==o||"."==o))f+=o.toLowerCase();else{if(":"!=o){if(n)return _w;f="",u=iC,l=0;continue}if(n&&(Xw(e)!=uw(Yw,f)||"file"==f&&(qw(e)||null!==e.port)||"file"==e.scheme&&!e.host))return;if(e.scheme=f,n)return void(Xw(e)&&Yw[e.scheme]==e.port&&(e.port=null));f="","file"==e.scheme?u=pC:Xw(e)&&i&&i.scheme==e.scheme?u=rC:Xw(e)?u=cC:"/"==r[l+1]?(u=oC,l++):(e.cannotBeABaseURL=!0,e.path.push(""),u=kC)}break;case iC:if(!i||i.cannotBeABaseURL&&"#"!=o)return _w;if(i.cannotBeABaseURL&&"#"==o){e.scheme=i.scheme,e.path=i.path.slice(),e.query=i.query,e.fragment="",e.cannotBeABaseURL=!0,u=wC;break}u="file"==i.scheme?pC:sC;continue;case rC:if("/"!=o||"/"!=r[l+1]){u=sC;continue}u=uC,l++;break;case oC:if("/"==o){u=lC;break}u=mC;continue;case sC:if(e.scheme=i.scheme,o==ew)e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.query=i.query;else if("/"==o||"\\"==o&&Xw(e))u=aC;else if("?"==o)e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.query="",u=bC;else{if("#"!=o){e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.path.pop(),u=mC;continue}e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,e.path=i.path.slice(),e.query=i.query,e.fragment="",u=wC}break;case aC:if(!Xw(e)||"/"!=o&&"\\"!=o){if("/"!=o){e.username=i.username,e.password=i.password,e.host=i.host,e.port=i.port,u=mC;continue}u=lC}else u=uC;break;case cC:if(u=uC,"/"!=o||"/"!=f.charAt(l+1))continue;l++;break;case uC:if("/"!=o&&"\\"!=o){u=lC;continue}break;case lC:if("@"==o){h&&(f="%40"+f),h=!0,s=fw(f);for(var g=0;g<s.length;g++){var v=s[g];if(":"!=v||p){var y=zw(v,Kw);p?e.password+=y:e.username+=y}else p=!0}f=""}else if(o==ew||"/"==o||"?"==o||"#"==o||"\\"==o&&Xw(e)){if(h&&""==f)return"Invalid authority";l-=fw(f).length+1,f="",u=fC}else f+=o;break;case fC:case hC:if(n&&"file"==e.scheme){u=vC;continue}if(":"!=o||d){if(o==ew||"/"==o||"?"==o||"#"==o||"\\"==o&&Xw(e)){if(Xw(e)&&""==f)return Sw;if(n&&""==f&&(qw(e)||null!==e.port))return;if(a=Bw(e,f))return a;if(f="",u=yC,n)return;continue}"["==o?d=!0:"]"==o&&(d=!1),f+=o}else{if(""==f)return Sw;if(a=Bw(e,f))return a;if(f="",u=dC,n==hC)return}break;case dC:if(!Rw.test(o)){if(o==ew||"/"==o||"?"==o||"#"==o||"\\"==o&&Xw(e)||n){if(""!=f){var m=parseInt(f,10);if(m>65535)return Tw;e.port=Xw(e)&&m===Yw[e.scheme]?null:m,f=""}if(n)return;u=yC;continue}return Tw}f+=o;break;case pC:if(e.scheme="file","/"==o||"\\"==o)u=gC;else{if(!i||"file"!=i.scheme){u=mC;continue}if(o==ew)e.host=i.host,e.path=i.path.slice(),e.query=i.query;else if("?"==o)e.host=i.host,e.path=i.path.slice(),e.query="",u=bC;else{if("#"!=o){Jw(r.slice(l).join(""))||(e.host=i.host,e.path=i.path.slice(),Qw(e)),u=mC;continue}e.host=i.host,e.path=i.path.slice(),e.query=i.query,e.fragment="",u=wC}}break;case gC:if("/"==o||"\\"==o){u=vC;break}i&&"file"==i.scheme&&!Jw(r.slice(l).join(""))&&(Zw(i.path[0],!0)?e.path.push(i.path[0]):e.host=i.host),u=mC;continue;case vC:if(o==ew||"/"==o||"\\"==o||"?"==o||"#"==o){if(!n&&Zw(f))u=mC;else if(""==f){if(e.host="",n)return;u=yC}else{if(a=Bw(e,f))return a;if("localhost"==e.host&&(e.host=""),n)return;f="",u=yC}continue}f+=o;break;case yC:if(Xw(e)){if(u=mC,"/"!=o&&"\\"!=o)continue}else if(n||"?"!=o)if(n||"#"!=o){if(o!=ew&&(u=mC,"/"!=o))continue}else e.fragment="",u=wC;else e.query="",u=bC;break;case mC:if(o==ew||"/"==o||"\\"==o&&Xw(e)||!n&&("?"==o||"#"==o)){if(".."===(c=(c=f).toLowerCase())||"%2e."===c||".%2e"===c||"%2e%2e"===c?(Qw(e),"/"==o||"\\"==o&&Xw(e)||e.path.push("")):eC(f)?"/"==o||"\\"==o&&Xw(e)||e.path.push(""):("file"==e.scheme&&!e.path.length&&Zw(f)&&(e.host&&(e.host=""),f=f.charAt(0)+":"),e.path.push(f)),f="","file"==e.scheme&&(o==ew||"?"==o||"#"==o))for(;e.path.length>1&&""===e.path[0];)e.path.shift();"?"==o?(e.query="",u=bC):"#"==o&&(e.fragment="",u=wC)}else f+=zw(o,Ww);break;case kC:"?"==o?(e.query="",u=bC):"#"==o?(e.fragment="",u=wC):o!=ew&&(e.path[0]+=zw(o,Gw));break;case bC:n||"#"!=o?o!=ew&&("'"==o&&Xw(e)?e.query+="%27":e.query+="#"==o?"%23":zw(o,Gw)):(e.fragment="",u=wC);break;case wC:o!=ew&&(e.fragment+=zw(o,Vw))}l++}},xC=function(e){var t,n,i=cw(this,xC,"URL"),r=arguments.length>1?arguments[1]:void 0,o=String(e),s=bw(i,{type:"URL"});if(void 0!==r)if(r instanceof xC)t=ww(r);else if(n=CC(t={},String(r)))throw TypeError(n);if(n=CC(s,o,null,t))throw TypeError(n);var a=s.searchParams=new mw,c=kw(a);c.updateSearchParams(s.query),c.updateURL=function(){s.query=String(a)||null},iw||(i.href=SC.call(i),i.origin=TC.call(i),i.protocol=EC.call(i),i.username=PC.call(i),i.password=RC.call(i),i.host=OC.call(i),i.hostname=AC.call(i),i.port=LC.call(i),i.pathname=IC.call(i),i.search=DC.call(i),i.searchParams=MC.call(i),i.hash=NC.call(i))},_C=xC.prototype,SC=function(){var e=ww(this),t=e.scheme,n=e.username,i=e.password,r=e.host,o=e.port,s=e.path,a=e.query,c=e.fragment,u=t+":";return null!==r?(u+="//",qw(e)&&(u+=n+(i?":"+i:"")+"@"),u+=Hw(r),null!==o&&(u+=":"+o)):"file"==t&&(u+="//"),u+=e.cannotBeABaseURL?s[0]:s.length?"/"+s.join("/"):"",null!==a&&(u+="?"+a),null!==c&&(u+="#"+c),u},TC=function(){var e=ww(this),t=e.scheme,n=e.port;if("blob"==t)try{return new xC(t.path[0]).origin}catch(e){return"null"}return"file"!=t&&Xw(e)?t+"://"+Hw(e.host)+(null!==n?":"+n:""):"null"},EC=function(){return ww(this).scheme+":"},PC=function(){return ww(this).username},RC=function(){return ww(this).password},OC=function(){var e=ww(this),t=e.host,n=e.port;return null===t?"":null===n?Hw(t):Hw(t)+":"+n},AC=function(){var e=ww(this).host;return null===e?"":Hw(e)},LC=function(){var e=ww(this).port;return null===e?"":String(e)},IC=function(){var e=ww(this),t=e.path;return e.cannotBeABaseURL?t[0]:t.length?"/"+t.join("/"):""},DC=function(){var e=ww(this).query;return e?"?"+e:""},MC=function(){return ww(this).searchParams},NC=function(){var e=ww(this).fragment;return e?"#"+e:""},FC=function(e,t){return{get:e,set:t,configurable:!0,enumerable:!0}};if(iw&&sw(_C,{href:FC(SC,(function(e){var t=ww(this),n=String(e),i=CC(t,n);if(i)throw TypeError(i);kw(t.searchParams).updateSearchParams(t.query)})),origin:FC(TC),protocol:FC(EC,(function(e){var t=ww(this);CC(t,String(e)+":",tC)})),username:FC(PC,(function(e){var t=ww(this),n=fw(String(e));if(!$w(t)){t.username="";for(var i=0;i<n.length;i++)t.username+=zw(n[i],Kw)}})),password:FC(RC,(function(e){var t=ww(this),n=fw(String(e));if(!$w(t)){t.password="";for(var i=0;i<n.length;i++)t.password+=zw(n[i],Kw)}})),host:FC(OC,(function(e){var t=ww(this);t.cannotBeABaseURL||CC(t,String(e),fC)})),hostname:FC(AC,(function(e){var t=ww(this);t.cannotBeABaseURL||CC(t,String(e),hC)})),port:FC(LC,(function(e){var t=ww(this);$w(t)||(""==(e=String(e))?t.port=null:CC(t,e,dC))})),pathname:FC(IC,(function(e){var t=ww(this);t.cannotBeABaseURL||(t.path=[],CC(t,e+"",yC))})),search:FC(DC,(function(e){var t=ww(this);""==(e=String(e))?t.query=null:("?"==e.charAt(0)&&(e=e.slice(1)),t.query="",CC(t,e,bC)),kw(t.searchParams).updateSearchParams(t.query)})),searchParams:FC(MC),hash:FC(NC,(function(e){var t=ww(this);""!=(e=String(e))?("#"==e.charAt(0)&&(e=e.slice(1)),t.fragment="",CC(t,e,wC)):t.fragment=null}))}),aw(_C,"toJSON",(function(){return SC.call(this)}),{enumerable:!0}),aw(_C,"toString",(function(){return SC.call(this)}),{enumerable:!0}),yw){var BC=yw.createObjectURL,jC=yw.revokeObjectURL;BC&&aw(xC,"createObjectURL",(function(e){return BC.apply(yw,arguments)})),jC&&aw(xC,"revokeObjectURL",(function(e){return jC.apply(yw,arguments)}))}function UC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function HC(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?UC(Object(n),!0).forEach((function(t){Un(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):UC(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function GC(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=jn(e);if(t){var r=jn(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Bn(this,n)}}pw(xC,"URL"),nw({global:!0,forced:!rw,sham:!iw},{URL:xC});var VC="info",WC=Og,KC=function(e){Mn(n,e);var t=GC(n);function n(){var e;In(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Un(Fn(e=t.call.apply(t,[this].concat(r))),"_recordUserActions",(function(t){var n=e._getTime(),i=Object.assign({},t,{msg:t.msg||t.action});e._stats.info.push(HC(HC({type:"userAction"},n),{},{payload:i}))})),Un(Fn(e),"_onReset",(function(){e.reset()})),Un(Fn(e),"_recordInfo",(function(t){e.info(t)})),Un(Fn(e),"_downloadStats",(function(){var t=e.getStats(),n=new Blob([JSON.stringify(t)],{type:"application/json"}),i=window.URL.createObjectURL(n),r=document.createElement("a");r.style.display="none",r.href=i,r.download="player.txt",r.disabled=!1,r.click()})),e}return uo(n,[{key:"_getTime",value:function(){return{timestamp:Date.now(),timeFormat:(new Date).toISOString()}}},{key:"afterCreate",value:function(){this.reset(),this.on(Pg,this._recordUserActions),this.on(WC.STATS_INFO,this._recordInfo),this.on(WC.STATS_DOWNLOAD,this._downloadStats),this.on(WC.STATS_RESET,this._onReset)}},{key:"destroy",value:function(){this.offAll()}},{key:"downloadStats",value:function(){this._downloadStats()}},{key:"info",value:function(e){e.profile?this._infoProfile(e):this._info(e)}},{key:"_info",value:function(e){var t=this._getTime();this._stats.info.push(HC(HC({},t),{},{payload:e}))}},{key:"_infoProfile",value:function(e){if(e&&e.startMs){var t=HC({cat:"function",dur:Date.now()-e.startMs,name:e.name||e.msg,ph:"X",pid:0,tid:0,ts:e.startMs,profile:!0},e);this._info(t)}else console.warn("infoProfile need object data, include startMs")}},{key:"reset",value:function(){var e;this._stats=(Un(e={},VC,[]),Un(e,"media",{}),e)}},{key:"getStats",value:function(){for(var e=this.player.video,t=[],n=0;n<e.buffered.length;n++)t.push({start:e.buffered.start(n),end:e.buffered.end(n)});var i={currentTime:e.currentTime,readyState:e.readyState,buffered:t,paused:e.paused,ended:e.ended};return this._stats.media=i,{raw:this._stats,timestat:this._getTimeStats(),profile:this._getProfile()}}},{key:"_getTimeStats",value:function(){return this._stats.info.map((function(e){var t=e.payload.data,n="";try{t instanceof Error?n=t.msg:void 0!==t&&(n=JSON.stringify(t))}catch(e){console.log("err",e)}return"[".concat(e.timeFormat,"] : ").concat(e.payload.msg," ").concat(n," ")}))}},{key:"_getProfile",value:function(){var e={traceEvents:[]};return this._stats.info.forEach((function(t){t.payload.profile&&e.traceEvents.push(t.payload)})),e}}],[{key:"pluginName",get:function(){return"stats"}},{key:"defaultConfig",get:function(){return{}}}]),n}(rv);function zC(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=jn(e);if(t){var r=jn(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Bn(this,n)}}var YC=function(e){Mn(n,e);var t=zC(n);function n(){var e;In(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Un(Fn(e=t.call.apply(t,[this].concat(r))),"onGapJump",(function(){var t=Fn(e),i=t.player,r=t.config;if(i.video.readyState!==HTMLMediaElement.HAVE_NOTHING){if(i.video.seeking){if(!e.seekingEventReceived)return}else e.seekingEventReceived=!1;if(!i.video.paused||0===i.video.currentTime||!e.hasPlayed){var o=i.video.buffered,s=r.smallGapLimit||.5,a=r.gapDetectionThreshold||.3,c=i.video.currentTime,u=e._getIndex(o,c,a);if(null!==u&&0!==u){console.log("GapJump bufferRange ",o.start(u),o.end(u));var l=o.start(u)+.1;if(!(l>i.video.duration)){var f=l-c,h=f<=s;f<n.BROWSER_GAP_TOLERANCE||h&&(!1!==r.useGapJump&&(i.video.currentTime=e.isSafari?l+.1:l),e.player&&e.player.emit("detectGap"),console.log("gapJump gapIndex",u," isGapSamll:",h," currentTime:",i.video.currentTime," jumpSize:",c-i.video.currentTime),.08!==l&&i&&i.emit("log",{type:"oneevent",end_type:"gap",vid:i.config.vid,ext:{video_postion:Math.floor(1e3*l)}}))}}}}})),e}return uo(n,[{key:"afterCreate",value:function(){var e=this;!1!==this.config.useGapJump&&(this.hasPlayed=!1,this.seekingEventReceived=!1,this.isSafari=/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),this.on($p,this.onGapJump),this.on(Gp,(function(){e.hasPlayed=!0})),this.on(Yp,(function(){e.seekingEventReceived=!0})))}},{key:"_getIndex",value:function(e,t,n){if(!e||!e.length)return null;if(1===e.length&&e.end(0)-e.start(0)<1e-6)return null;for(var i=this._getBuffered(e),r=null,o=0;o<i.length;o++){if(i[o].start>t&&(0===o||i[o-1].end-t<=n)){r=o;break}}return r}},{key:"_getBuffered",value:function(e){if(!e)return[];for(var t=[],n=0;n<e.length;n++)t.push({start:e.start(n),end:e.end(n)});return t}}],[{key:"pluginName",get:function(){return"gapJump"}},{key:"defaultConfig",get:function(){return{useGapJump:!1,smallGapLimit:.5,gapDetectionThreshold:.3}}}]),n}(vv);function XC(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=jn(e);if(t){var r=jn(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Bn(this,n)}}YC.BROWSER_GAP_TOLERANCE=.001;var qC=function(e){Mn(n,e);var t=XC(n);function n(){var e;In(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Un(Fn(e=t.call.apply(t,[this].concat(r))),"onWaiting",(function(){var t=Fn(e).config;e.jumpCnt>t.jumpCntMax||e.timer||!1===t.useWaitingTimeoutJump||(e.timer=setTimeout(e.onJump,1e3*t.waitingTime))})),Un(Fn(e),"onJump",(function(){var t=Fn(e),n=t.player,i=t.config;if(clearTimeout(e.timer),e.timer=null,!(e.jumpCnt>i.jumpCntMax||!1===i.useWaitingTimeoutJump||n.video.paused&&0!==n.video.currentTime&&e.hasPlayed)){e.jumpSize=i.jumpSize*(e.jumpCnt+1),e.jumpCnt===i.jumpSize&&e.jumpSize<6&&(e.jumpSize=6);var r=n.currentTime+e.jumpSize;r>n.video.duration||(console.log("waitintTimeout, currentTime:",n.currentTime,", jumpTo:",r),e.jumpCnt++,n.currentTime=r)}})),e}return uo(n,[{key:"afterCreate",value:function(){var e=this,t=this.config,n=t.useWaitingTimeoutJump,i=t.jumpSize;!1!==n&&(this.hasPlayed=!1,this.jumpCnt=0,this.timer=null,this.jumpSize=i,this.on($p,this.onWaiting),this.on([Vp,Zp],(function(){clearTimeout(e.timer),e.timer=null,e.jumpSize=e.config.jumpSize})),this.on(Gp,(function(){e.hasPlayed=!0})))}}],[{key:"pluginName",get:function(){return"waitingTimeoutJump"}},{key:"defaultConfig",get:function(){return{useWaitingTimeoutJump:!1,waitingTime:15,jumpSize:2,jumpCntMax:4}}}]),n}(vv);function $C(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=jn(e);if(t){var r=jn(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Bn(this,n)}}var ZC=function(e){Mn(n,e);var t=$C(n);function n(){var e;In(this,n);for(var i=arguments.length,r=new Array(i),o=0;o<i;o++)r[o]=arguments[o];return Un(Fn(e=t.call.apply(t,[this].concat(r))),"getSpeed",(function(t){if(e.speedListCache.length<=0)return 0;var n=0;return e.speedListCache.map((function(e){n+=e})),Math.floor(n/e.speedListCache.length)})),Un(Fn(e),"_onRealSpeedChange",(function(t){t.speed&&e.appendList(t.speed)})),Un(Fn(e),"testSpeed",(function(){if(clearTimeout(e.timer),e.timer=null,e.player&&e.config.openSpeed){var t=e.config,n=t.url,i=t.loadSize,r=t.testCnt,o=t.testTimeStep,s=n+(n.indexOf("?")<0?"?testst=":"&testst=")+Date.now();if(!(e.cnt>=r)){e.cnt++;try{var a=(new Date).getTime(),c=null,u=new XMLHttpRequest;e.xhr=u,u.open("GET",s);var l={},f=Math.floor(10*Math.random());l.Range="bytes="+f+"-"+(i+f),l&&Object.keys(l).forEach((function(e){u.setRequestHeader(e,l[e])})),u.onreadystatechange=function(){if(4===u.readyState){e.xhr=null,c=(new Date).getTime();var t=u.getResponseHeader("Content-Length")/1024*8,n=Math.round(1e3*t/(c-a));e.appendList(n),e.timer=setTimeout(e.testSpeed,o)}},u.send()}catch(e){console.error(e)}}}})),Un(Fn(e),"appendList",(function(t){var n=e.config.saveSpeedMax;e.speedListCache.length>=n&&e.speedListCache.shift(),e.speedListCache.push(t),e.player&&(e.player.realTimeSpeed=t),e.updateSpeed()})),Un(Fn(e),"updateSpeed",(function(){var t=e.getSpeed(),n=Fn(e).player;!n||n.avgSpeed&&t===n.avgSpeed||(n.avgSpeed=t,n.emit(gg,{speed:t,realTimeSpeed:n.realTimeSpeed}))})),e}return uo(n,[{key:"afterCreate",value:function(){var e=this;this.speedListCache=[];var t=this.config,n=t.openSpeed,i=t.testTimeStep;this.timer=null,this.cnt=0,this.xhr=null,n&&(this.on("real_time_speed",this._onRealSpeedChange),this.on([eg,hg],(function(){Ap.isMSE(e.player.video)||(e.speedListCache=[],e.cnt=0,e.timer=setTimeout(e.testSpeed,i))})))}},{key:"openSpeed",get:function(){return this.config.openSpeed},set:function(e){if(this.config.openSpeed=e,!e&&this.timer)return clearTimeout(this.timer),void(this.timer=null);if(this.config.openSpeed){if(this.timer)return;this.timer=setTimeout(this.testSpeed,this.config.testTimeStep)}}},{key:"destroy",value:function(){clearTimeout(this.timer),this.timer=null,this.xhr&&4!==this.xhr.readyState&&(this.xhr.cancel(),this.xhr=null)}}],[{key:"pluginName",get:function(){return"testspeed"}},{key:"defaultConfig",get:function(){return{openSpeed:!1,testCnt:3,loadSize:204800,testTimeStep:3e3,url:"",saveSpeedMax:5}}}]),n}(vv);Dv.use({LANG:"zh-cn",TEXT:{ERROR_TYPES:{network:{code:1,msg:"视频下载错误"},mse:{code:2,msg:"流追加错误"},parse:{code:3,msg:"解析错误"},format:{code:4,msg:"格式错误"},decoder:{code:5,msg:"解码错误"},runtime:{code:6,msg:"语法错误"},timeout:{code:7,msg:"播放超时"},other:{code:8,msg:"其他错误"}},HAVE_NOTHING:"没有关于音频/视频是否就绪的信息",HAVE_METADATA:"音频/视频的元数据已就绪",HAVE_CURRENT_DATA:"关于当前播放位置的数据是可用的,但没有足够的数据来播放下一帧/毫秒",HAVE_FUTURE_DATA:"当前及至少下一帧的数据是可用的",HAVE_ENOUGH_DATA:"可用数据足以开始播放",NETWORK_EMPTY:"音频/视频尚未初始化",NETWORK_IDLE:"音频/视频是活动的且已选取资源,但并未使用网络",NETWORK_LOADING:"浏览器正在下载数据",NETWORK_NO_SOURCE:"未找到音频/视频来源",MEDIA_ERR_ABORTED:"取回过程被用户中止",MEDIA_ERR_NETWORK:"网络错误",MEDIA_ERR_DECODE:"解码错误",MEDIA_ERR_SRC_NOT_SUPPORTED:"不支持的音频/视频格式",REPLAY:"重播",ERROR:"网络连接似乎出现了问题",PLAY_TIPS:"播放",PAUSE_TIPS:"暂停",PLAYNEXT_TIPS:"下一集",DOWNLOAD_TIPS:"下载",ROTATE_TIPS:"旋转",RELOAD_TIPS:"重新载入",FULLSCREEN_TIPS:"进入全屏",EXITFULLSCREEN_TIPS:"退出全屏",CSSFULLSCREEN_TIPS:"进入样式全屏",EXITCSSFULLSCREEN_TIPS:"退出样式全屏",TEXTTRACK:"字幕",PIP:"画中画",SCREENSHOT:"截图",LIVE:"正在直播",OFF:"关闭",OPEN:"开启",MINI_DRAG:"点击按住可拖动视频",MINISCREEN:"小屏幕",REFRESH_TIPS:"请试试",REFRESH:"刷新",FORWARD:"快进中",LIVE_TIP:"直播"}});function JC(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,i=jn(e);if(t){var r=jn(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return Bn(this,n)}}var QC=function(e){Mn(n,e);var t=JC(n);function n(){return In(this,n),t.apply(this,arguments)}return n}(Hv);return Un(QC,"defaultPreset",(function e(t,n){var i,r,o;In(this,e);var s=n&&"mobile"===n.isMobileSimulateMode,a=n.isLive,c=[].concat(a?[]:[Sm,Mk,Ak,Bm],[Rm,Nm,zm,nk,gk,yk,ak,uk,Vm,Qm]),u=[ty,iy,cy,vm,ly,xk,Sk,Ik,Sy];this.plugins=[Jv,KC,qC,YC].concat(Uh(c),u);var l=s?"mobile":Bp.device;switch(l){case"pc":(i=this.plugins).push.apply(i,[dm,Ry,wk,ZC]);break;case"mobile":(r=this.plugins).push.apply(r,[cm]);break;default:(o=this.plugins).push.apply(o,[dm,Ry,wk])}(Bp.os.isIpad||"pc"===l)&&this.plugins.push(Gk),Bp.os.isIpad&&this.plugins.push(Ry),this.ignores=[],this.i18n=[]})),Un(QC,"Util",Ap),Un(QC,"Sniffer",Bp),Un(QC,"Errors",Hp),Un(QC,"Events",Ag),Un(QC,"Plugin",vv),Un(QC,"BasePlugin",rv),Un(QC,"I18N",Dv),Un(QC,"STATE_CLASS",Tv),QC}));