Sailing timer

Simple modification of sailing speed

目前为 2024-09-28 提交的版本,查看 最新版本

此脚本不应直接安装,它是供其他脚本使用的外部库。如果你需要使用该库,请在脚本元属性加入:// @require https://update.cn-greasyfork.org/scripts/509211/1455628/Sailing%20timer.js

  1. if (window.performance) window.performance.now = Date.now;
  2.  
  3. (function () {
  4. 'use strict';
  5.  
  6. // 延迟执行的函数
  7. function delayedFunction() {
  8. !function (t, e) {
  9. "object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : (t = "undefined" != typeof globalThis ? globalThis : t || self).$hookTimer = e()
  10. }(this, (function () {
  11. "use strict";
  12.  
  13. function t(t, e) {
  14. if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function")
  15. }
  16.  
  17. function e(t, e) {
  18. for (var n = 0; n < e.length; n++) {
  19. var r = e[n];
  20. r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(t, r.key, r)
  21. }
  22. }
  23.  
  24. function n(t, n, r) {
  25. return n && e(t.prototype, n), r && e(t, r), t
  26. }
  27.  
  28. function r(t) {
  29. if (void 0 === t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  30. return t
  31. }
  32.  
  33. function o(t, e) {
  34. return (o = Object.setPrototypeOf || function (t, e) {
  35. return t.__proto__ = e, t
  36. })(t, e)
  37. }
  38.  
  39. function i(t, e) {
  40. if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
  41. t.prototype = Object.create(e && e.prototype, {
  42. constructor: {
  43. value: t,
  44. writable: !0,
  45. configurable: !0
  46. }
  47. }), e && o(t, e)
  48. }
  49.  
  50. function a(t) {
  51. return (a = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) {
  52. return typeof t
  53. } : function (t) {
  54. return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t
  55. })(t)
  56. }
  57.  
  58. function u(t, e) {
  59. return !e || "object" !== a(e) && "function" != typeof e ? r(t) : e
  60. }
  61.  
  62. function c(t) {
  63. return (c = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) {
  64. return t.__proto__ || Object.getPrototypeOf(t)
  65. })(t)
  66. }
  67.  
  68. function l(t, e, n) {
  69. return e in t ? Object.defineProperty(t, e, {
  70. value: n,
  71. enumerable: !0,
  72. configurable: !0,
  73. writable: !0
  74. }) : t[e] = n, t
  75. }
  76.  
  77. var s, f, h, d = 1e3;
  78.  
  79. function y() {
  80. return d++
  81. }
  82.  
  83. function p() {
  84. return null == s && (s = "undefined" == typeof unsafeWindow ? window : unsafeWindow), s
  85. }
  86.  
  87. function v() {
  88. var t = p().parent !== p();
  89. try {
  90. t = t && "FRAMESET" !== p().parent.document.body.tagName
  91. } catch (t) {
  92. }
  93. return t
  94. }
  95.  
  96. function g(t) {
  97. var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 1 / 0,
  98. n = Array.prototype.flat || function () {
  99. var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 1 / 0;
  100. if (t < 1) return this;
  101. var e = [], r = t - 1;
  102. return this.forEach((function (t) {
  103. t instanceof Array ? e = e.concat(n.call(t, r)) : e.push(t)
  104. })), e
  105. };
  106. return n.call(t, e)
  107. }
  108.  
  109. function m(t, e) {
  110. (null == e || e > t.length) && (e = t.length);
  111. for (var n = 0, r = new Array(e); n < e; n++) r[n] = t[n];
  112. return r
  113. }
  114.  
  115. function b(t, e) {
  116. if (t) {
  117. if ("string" == typeof t) return m(t, e);
  118. var n = Object.prototype.toString.call(t).slice(8, -1);
  119. return "Object" === n && t.constructor && (n = t.constructor.name), "Map" === n || "Set" === n ? Array.from(t) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? m(t, e) : void 0
  120. }
  121. }
  122.  
  123. function w(t, e) {
  124. return function (t) {
  125. if (Array.isArray(t)) return t
  126. }(t) || function (t, e) {
  127. var n = t && ("undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"]);
  128. if (null != n) {
  129. var r, o, i = [], a = !0, u = !1;
  130. try {
  131. for (n = n.call(t); !(a = (r = n.next()).done) && (i.push(r.value), !e || i.length !== e); a = !0) ;
  132. } catch (t) {
  133. u = !0, o = t
  134. } finally {
  135. try {
  136. a || null == n.return || n.return()
  137. } finally {
  138. if (u) throw o
  139. }
  140. }
  141. return i
  142. }
  143. }(t, e) || b(t, e) || function () {
  144. throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")
  145. }()
  146. }
  147.  
  148. function k(t, e) {
  149. var n = "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"];
  150. if (!n) {
  151. if (Array.isArray(t) || (n = function (t, e) {
  152. if (!t) return;
  153. if ("string" == typeof t) return x(t, e);
  154. var n = Object.prototype.toString.call(t).slice(8, -1);
  155. "Object" === n && t.constructor && (n = t.constructor.name);
  156. if ("Map" === n || "Set" === n) return Array.from(t);
  157. if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return x(t, e)
  158. }(t)) || e && t && "number" == typeof t.length) {
  159. n && (t = n);
  160. var r = 0, o = function () {
  161. };
  162. return {
  163. s: o, n: function () {
  164. return r >= t.length ? {done: !0} : {done: !1, value: t[r++]}
  165. }, e: function (t) {
  166. throw t
  167. }, f: o
  168. }
  169. }
  170. throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")
  171. }
  172. var i, a = !0, u = !1;
  173. return {
  174. s: function () {
  175. n = n.call(t)
  176. }, n: function () {
  177. var t = n.next();
  178. return a = t.done, t
  179. }, e: function (t) {
  180. u = !0, i = t
  181. }, f: function () {
  182. try {
  183. a || null == n.return || n.return()
  184. } finally {
  185. if (u) throw i
  186. }
  187. }
  188. }
  189. }
  190.  
  191. function x(t, e) {
  192. (null == e || e > t.length) && (e = t.length);
  193. for (var n = 0, r = new Array(e); n < e; n++) r[n] = t[n];
  194. return r
  195. }
  196.  
  197. function O() {
  198. return null == h && (h = "undefined" == typeof unsafeWindow ? window : unsafeWindow), h
  199. }
  200.  
  201. function R() {
  202. var t = O().parent !== O();
  203. try {
  204. t = t && "FRAMESET" !== O().parent.document.body.tagName
  205. } catch (t) {
  206. }
  207. return t
  208. }
  209.  
  210. !function (t) {
  211. t.BOOLEAN = "boolean", t.STRING = "string", t.NUMBER = "number", t.SHORTCUT = "shortcut", t.LONG_STRING = "long_string", t.DATE = "date", t.COLOR = "color", t.ARRAY = "array", t.PICKLIST = "picklist", t.DUELING_PICKLIST = "dueling_picklist"
  212. }(f || (f = {}));
  213. var M = "__hooks_load_module", _ = Object.getOwnPropertyNames.bind(Object),
  214. A = Object.getPrototypeOf.bind(Object);
  215.  
  216. function S(t) {
  217. var e, n = {}, r = k(_(t));
  218. try {
  219. for (r.s(); !(e = r.n()).done;) {
  220. var o = e.value;
  221. n[o] = t[o]
  222. }
  223. } catch (t) {
  224. r.e(t)
  225. } finally {
  226. r.f()
  227. }
  228. return n
  229. }
  230.  
  231. var C = [[Array.prototype], [Object, !1]].map((function (t) {
  232. var e = w(t, 1)[0];
  233. return [e, S(e)]
  234. }));
  235.  
  236. function T(t) {
  237. var e, n = k(C);
  238. try {
  239. for (n.s(); !(e = n.n()).done;) {
  240. var r = w(e.value, 2), o = r[0], i = r[1];
  241. if (t === o) return i
  242. }
  243. } catch (t) {
  244. n.e(t)
  245. } finally {
  246. n.f()
  247. }
  248. return t
  249. }
  250.  
  251. function I(t, e) {
  252. return function (t, e) {
  253. var n = T(arguments.length > 2 && void 0 !== arguments[2] && !arguments[2] ? t : A(t)), r = n[e];
  254. return "function" == typeof r ? r.bind(t) : n[e]
  255. }(e.conditions || [], "reduce")((function (e, n) {
  256. return e || Object.entries(n).every((function (e) {
  257. var n = w(e, 2), r = n[0], o = n[1];
  258. return t[r] === o
  259. }))
  260. }), !1)
  261. }
  262.  
  263. var E = {};
  264. try {
  265. E.addStyle = GM_addStyle
  266. } catch (t) {
  267. }
  268. try {
  269. E.addElement = GM_addElement
  270. } catch (t) {
  271. }
  272. try {
  273. E.deleteValue = GM_deleteValue
  274. } catch (t) {
  275. }
  276. try {
  277. E.listValues = GM_listValues
  278. } catch (t) {
  279. }
  280. try {
  281. E.getValue = GM_getValue
  282. } catch (t) {
  283. }
  284. try {
  285. E.setValue = GM_setValue
  286. } catch (t) {
  287. }
  288. try {
  289. E.addValueChangeListener = GM_addValueChangeListener
  290. } catch (t) {
  291. }
  292. try {
  293. E.removeValueChangeListener = GM_removeValueChangeListener
  294. } catch (t) {
  295. }
  296. try {
  297. E.xmlhttpRequest = GM_xmlhttpRequest
  298. } catch (t) {
  299. }
  300. try {
  301. E.registerMenuCommand = GM_registerMenuCommand
  302. } catch (t) {
  303. }
  304. try {
  305. E.unregisterMenuCommand = GM_unregisterMenuCommand
  306. } catch (t) {
  307. }
  308. try {
  309. E.download = GM_download
  310. } catch (t) {
  311. }
  312. try {
  313. E.log = GM_log
  314. } catch (t) {
  315. }
  316. try {
  317. E.openInTab = GM_openInTab
  318. } catch (t) {
  319. }
  320. try {
  321. E.setClipboard = GM_setClipboard
  322. } catch (t) {
  323. }
  324. try {
  325. E.info = GM_info
  326. } catch (t) {
  327. }
  328. try {
  329. E.getResourceText = GM_getResourceText
  330. } catch (t) {
  331. }
  332. try {
  333. E.getResourceURL = GM_getResourceURL
  334. } catch (t) {
  335. }
  336. try {
  337. E.getTab = GM_getTab
  338. } catch (t) {
  339. }
  340. try {
  341. E.getTabs = GM_getTabs
  342. } catch (t) {
  343. }
  344. try {
  345. E.saveTab = GM_saveTab
  346. } catch (t) {
  347. }
  348. try {
  349. E.notification = GM_notification
  350. } catch (t) {
  351. }
  352. var j = window, D = new Proxy({}, {
  353. get: function (t, e) {
  354. var n = ["GM", e].join("_");
  355. return j[n] ? j[n] : E[e] ? E[e] : j.GM && j.GM[e] ? j.GM[e] : void 0
  356. }
  357. }), P = function () {
  358. if (!R()) {
  359. for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++) e[n] = arguments[n];
  360. var r;
  361. if (e.unshift("[TimerHook]"), "function" == typeof D.log) D.log(e.join(" ")); else (r = console).log.apply(r, e)
  362. }
  363. }, N = function () {
  364. if (!R()) {
  365. for (var t, e = arguments.length, n = new Array(e), r = 0; r < e; r++) n[r] = arguments[r];
  366. n.unshift("[TimerHook]"), (t = console).warn.apply(t, n)
  367. }
  368. }, L = function () {
  369. function e() {
  370. t(this, e), l(this, "host", void 0), l(this, "isActive", !1), l(this, "isMountHost", !1)
  371. }
  372.  
  373. return n(e, [{
  374. key: "mountHost", value: function (t) {
  375. this.host = t, this.isMountHost = !0, this.onMounted()
  376. }
  377. }, {
  378. key: "activate", value: function () {
  379. this.isActive = !0, this.init()
  380. }
  381. }, {
  382. key: "deactivate", value: function () {
  383. this.isActive = !1, this.onDestroy()
  384. }
  385. }, {
  386. key: "moduleName", get: function () {
  387. }
  388. }, {
  389. key: "priority", get: function () {
  390. return 50
  391. }
  392. }, {
  393. key: "autoActivate", get: function () {
  394. return !0
  395. }
  396. }, {
  397. key: "isCoreModule", get: function () {
  398. return !1
  399. }
  400. }, {
  401. key: "isOnlyOuterIframe", get: function () {
  402. return !1
  403. }
  404. }, {
  405. key: "getDependencyModule", value: function (t) {
  406. if (null != this.host) {
  407. var e = this.host.getModule(t);
  408. return e && e.moduleIdentityName ? e : void 0
  409. }
  410. }
  411. }, {
  412. key: "init", value: function () {
  413. }
  414. }, {
  415. key: "onMounted", value: function () {
  416. }
  417. }, {
  418. key: "onDestroy", value: function () {
  419. }
  420. }, {
  421. key: "declareConfigs", value: function () {
  422. return []
  423. }
  424. }, {
  425. key: "setConfig", value: function (t, e) {
  426. var n = this.getDependencyModule("configs");
  427. n && n.available() || N("Config module not found, can't set configs values."), n.setValue(this.moduleIdentityName, t, e)
  428. }
  429. }, {
  430. key: "getConfig", value: function (t) {
  431. var e, n = this.getDependencyModule("configs"), r = (this.declareConfigs().find((function (e) {
  432. return e.key === t
  433. })) || {}).default;
  434. return n && n.available() && null !== (e = n.getValue(this.moduleIdentityName, t)) && void 0 !== e ? e : r
  435. }
  436. }, {
  437. key: "window", get: function () {
  438. return this.host ? this.host.getWindow() : O()
  439. }
  440. }, {
  441. key: "document", get: function () {
  442. return this.window.document
  443. }
  444. }]), e
  445. }();
  446.  
  447. function B(t, e, n) {
  448. return (B = "undefined" != typeof Reflect && Reflect.get ? Reflect.get : function (t, e, n) {
  449. var r = function (t, e) {
  450. for (; !Object.prototype.hasOwnProperty.call(t, e) && null !== (t = c(t));) ;
  451. return t
  452. }(t, e);
  453. if (r) {
  454. var o = Object.getOwnPropertyDescriptor(r, e);
  455. return o.get ? o.get.call(n) : o.value
  456. }
  457. })(t, e, n || t)
  458. }
  459.  
  460. function V(t) {
  461. var e = function () {
  462. if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
  463. if (Reflect.construct.sham) return !1;
  464. if ("function" == typeof Proxy) return !0;
  465. try {
  466. return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function () {
  467. }))), !0
  468. } catch (t) {
  469. return !1
  470. }
  471. }();
  472. return function () {
  473. var n, r = c(t);
  474. if (e) {
  475. var o = c(this).constructor;
  476. n = Reflect.construct(r, arguments, o)
  477. } else n = r.apply(this, arguments);
  478. return u(this, n)
  479. }
  480. }
  481.  
  482. var U = function (e) {
  483. i(a, e);
  484. var o = V(a);
  485.  
  486. function a() {
  487. var e;
  488. t(this, a);
  489. for (var n = arguments.length, i = new Array(n), u = 0; u < n; u++) i[u] = arguments[u];
  490. return l(r(e = o.call.apply(o, [this].concat(i))), "rate", 1), l(r(e), "host", void 0), e
  491. }
  492.  
  493. return n(a, [{
  494. key: "onRateChange", value: function (t) {
  495. this.rate = t
  496. }
  497. }, {
  498. key: "mountHost", value: function (t) {
  499. B(c(a.prototype), "mountHost", this).call(this, t), this.rate = t.rate
  500. }
  501. }]), a
  502. }(L);
  503.  
  504. function G(t) {
  505. var e = function () {
  506. if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
  507. if (Reflect.construct.sham) return !1;
  508. if ("function" == typeof Proxy) return !0;
  509. try {
  510. return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function () {
  511. }))), !0
  512. } catch (t) {
  513. return !1
  514. }
  515. }();
  516. return function () {
  517. var n, r = c(t);
  518. if (e) {
  519. var o = c(this).constructor;
  520. n = Reflect.construct(r, arguments, o)
  521. } else n = r.apply(this, arguments);
  522. return u(this, n)
  523. }
  524. }
  525.  
  526. var H = function (e) {
  527. i(a, e);
  528. var o = G(a);
  529.  
  530. function a() {
  531. var e;
  532. t(this, a);
  533. for (var n = arguments.length, i = new Array(n), u = 0; u < n; u++) i[u] = arguments[u];
  534. return l(r(e = o.call.apply(o, [this].concat(i))), "isDOMLoaded", !1), l(r(e), "waitDomLoadedCallback", void 0), e
  535. }
  536.  
  537. return n(a, [{
  538. key: "onMounted", value: function () {
  539. var t = this;
  540. B(c(a.prototype), "onMounted", this).call(this), this.document.addEventListener("readystatechange", (function () {
  541. "interactive" !== t.document.readyState && "complete" !== t.document.readyState || (t.isDOMLoaded = !0, "function" == typeof t.waitDomLoadedCallback && t.waitDomLoadedCallback(void 0))
  542. }))
  543. }
  544. }, {
  545. key: "waitDomLoaded", value: function () {
  546. var t, e, n, r = this;
  547. return this.isDOMLoaded || null !== (t = this.document) && void 0 !== t && null !== (e = t.body) && void 0 !== e && null !== (n = e.childNodes) && void 0 !== n && n.length ? Promise.resolve() : new Promise((function (t) {
  548. r.waitDomLoadedCallback = t
  549. }))
  550. }
  551. }, {
  552. key: "applyStyle", value: function (t) {
  553. var e = this.style(), n = this.document.createElement("style");
  554. if (n.setAttribute("type", "text/css"), n.styleSheet) n.styleSheet.cssText = e; else {
  555. var r = this.document.createTextNode(e);
  556. n.appendChild(r)
  557. }
  558. t.appendChild(n)
  559. }
  560. }, {
  561. key: "applyElement", value: function () {
  562. var t = this.element();
  563. return this.document.body.appendChild(t), t
  564. }
  565. }, {
  566. key: "onUiRateChange", value: function (t) {
  567. }
  568. }, {
  569. key: "onRateChange", value: function (t) {
  570. var e = this.rate !== t;
  571. B(c(a.prototype), "onRateChange", this).call(this, t), e && this.onUiRateChange(t)
  572. }
  573. }, {
  574. key: "init", value: function () {
  575. var t = this;
  576. P("Started to loading '".concat(this.moduleIdentityName, "' component...")), this.waitDomLoaded().then((function () {
  577. t.applyStyle(t.applyElement()), P("UI component '".concat(t.moduleIdentityName, "' loaded."))
  578. }))
  579. }
  580. }]), a
  581. }(U);
  582.  
  583. function W(t) {
  584. var e = function () {
  585. if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
  586. if (Reflect.construct.sham) return !1;
  587. if ("function" == typeof Proxy) return !0;
  588. try {
  589. return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function () {
  590. }))), !0
  591. } catch (t) {
  592. return !1
  593. }
  594. }();
  595. return function () {
  596. var n, r = c(t);
  597. if (e) {
  598. var o = c(this).constructor;
  599. n = Reflect.construct(r, arguments, o)
  600. } else n = r.apply(this, arguments);
  601. return u(this, n)
  602. }
  603. }
  604.  
  605. var q = "hook_timer__change_rate", F = function (e) {
  606. i(a, e);
  607. var o = W(a);
  608.  
  609. function a() {
  610. var e;
  611. t(this, a);
  612. for (var n = arguments.length, i = new Array(n), u = 0; u < n; u++) i[u] = arguments[u];
  613. return l(r(e = o.call.apply(o, [this].concat(i))), "rate", 1), l(r(e), "state", "preparing"), l(r(e), "setIntervalOrigin", void 0), l(r(e), "clearIntervalOrigin", void 0), l(r(e), "inTimeCheckId", void 0), e
  614. }
  615.  
  616. return n(a, [{
  617. key: "setSpeed", value: function (t) {
  618. var e = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
  619. if (0 === t && (t = this.defaultRate), t && (t !== this.rate || e) && t > 0 && (this.rate = t, this.onRateChanged(t)), null == t) {
  620. var n = prompt("输入欲改变计时器变化倍率(当前:" + this.rate + ")");
  621. n && this.setSpeed(parseFloat(n))
  622. }
  623. }
  624. }, {
  625. key: "speedDown", value: function (t) {
  626. null == t && (t = this.getConfig("decrementRate")), this.setSpeed(this.rate - t)
  627. }
  628. }, {
  629. key: "speedUp", value: function (t) {
  630. null == t && (t = this.getConfig("incrementRate")), this.setSpeed(this.rate + t)
  631. }
  632. }, {
  633. key: "speedDivide", value: function (t) {
  634. null == t && (t = this.getConfig("divideRate")), this.setSpeed(this.rate / (t || 1))
  635. }
  636. }, {
  637. key: "speedMultiply", value: function (t) {
  638. null == t && (t = this.getConfig("multiplyRate")), this.setSpeed(this.rate * (t || 1))
  639. }
  640. }, {
  641. key: "onRateChanged", value: function (t) {
  642. P("Timer speed rate changed to:", t), this.sentChangesToIframe(), this.getAllActivateModules().filter((function (t) {
  643. return t.onRateChange
  644. })).forEach((function (e) {
  645. e.onRateChange(t)
  646. }))
  647. }
  648. }, {
  649. key: "beginInTimeCheck", value: function () {
  650. var t = this;
  651. this.keptInTime && (this.inTimeCheckId = this.setIntervalOrigin.call(this.getWindow(), (function () {
  652. t.rate && 1 !== t.rate && t.setSpeed(t.rate, !0)
  653. }), this.keptInterval))
  654. }
  655. }, {
  656. key: "catchOriginMethod", value: function () {
  657. this.setIntervalOrigin = this.getWindow().setInterval, this.clearIntervalOrigin = this.getWindow().clearInterval
  658. }
  659. }, {
  660. key: "keptInTime", get: function () {
  661. return this.getConfig("keptInTime")
  662. }
  663. }, {
  664. key: "keptInterval", get: function () {
  665. return this.getConfig("keptInterval")
  666. }
  667. }, {
  668. key: "defaultRate", get: function () {
  669. return this.getConfig("defaultRate")
  670. }
  671. }, {
  672. key: "bootstrap", value: function () {
  673. "preparing" === this.state && (this.catchOriginMethod(), this.listenParentEvent(), this.launchModules(this.getAllModules()), this.setSpeed(this.defaultRate), this.beginInTimeCheck(), this.waitForModulesLoad(), this.state = "started")
  674. }
  675. }, {
  676. key: "launchModules", value: function (t) {
  677. var e = this;
  678. t.filter((function (t) {
  679. return t.autoActivate
  680. })).forEach((function (t) {
  681. var n = t.moduleIdentityName;
  682. e.deactivateModules.includes(n) && !t.isCoreModule || e.activateModule(n)
  683. }))
  684. }
  685. }, {
  686. key: "registerModules", value: function (t) {
  687. var e = this;
  688. return t.filter((function (t) {
  689. var n = t.moduleIdentityName;
  690. return n && e.registerModule(t, t.isOnlyOuterIframe), n
  691. }))
  692. }
  693. }, {
  694. key: "waitForModulesLoad", value: function () {
  695. var t = this, e = this.getWindow().___hooks_preModules || [];
  696. e.length > 0 && this.launchModules(this.registerModules(e)), this.getWindow()[M] = 1, this.getWindow().addEventListener(M, (function (e) {
  697. e.detail && e.detail.moduleIdentityName && t.launchModules(t.registerModules([e.detail]))
  698. }))
  699. }
  700. }, {
  701. key: "exportOuter", value: function () {
  702. var t = this;
  703. this.getWindow()._OxA ? (this.getWindow().$hookTimer = this, this.getWindow()._OxA = this) : Object.defineProperty(this.getWindow(), "_OxA", {
  704. get: function () {
  705. return 1
  706. }, set: function (e) {
  707. "_OxA" === e && (t.getWindow().$hookTimer = t)
  708. }
  709. })
  710. }
  711. }, {
  712. key: "listenParentEvent", value: function () {
  713. var t = this;
  714. v() && this.getWindow().addEventListener("message", (function (e) {
  715. var n = e.data;
  716. (n.type || "") === q && t.setSpeed(n.rate || 0)
  717. }))
  718. }
  719. }, {
  720. key: "deactivateModules", get: function () {
  721. return this.getConfig("deactivateModules")
  722. }
  723. }, {
  724. key: "sentChangesToIframe", value: function () {
  725. var t = this.getWindow().document, e = t.querySelectorAll("iframe") || [],
  726. n = t.querySelectorAll("frame");
  727. if (e.length) for (var r = 0; r < e.length; r++) e[r].contentWindow.postMessage({
  728. type: q,
  729. rate: this.rate
  730. }, "*");
  731. if (n.length) for (var o = 0; o < n.length; o++) n[o].contentWindow.postMessage({
  732. type: q,
  733. rate: this.rate
  734. }, "*")
  735. }
  736. }, {
  737. key: "declareConfigs", value: function () {
  738. return [{key: "multiplyRate", type: f.NUMBER, default: 2}, {
  739. key: "divideRate",
  740. type: f.NUMBER,
  741. default: 2
  742. }, {key: "decrementRate", type: f.NUMBER, default: 2}, {
  743. key: "incrementRate",
  744. type: f.NUMBER,
  745. default: 2
  746. }, {key: "defaultRate", type: f.NUMBER, default: 2}, {
  747. key: "keptInTime",
  748. type: f.BOOLEAN,
  749. default: !0
  750. }, {key: "keptInterval", type: f.NUMBER, default: 4e3}, {
  751. key: "deactivateModules",
  752. type: f.ARRAY,
  753. values: this.getAllModules().map((function (t) {
  754. return {key: t.moduleIdentityName}
  755. })),
  756. default: []
  757. }]
  758. }
  759. }, {
  760. key: "setConfig", value: function (t, e) {
  761. var n = this.getModule("configs");
  762. n && n.available() || N("Config module not found, can't set configs values."), n.setValue("host", t, e)
  763. }
  764. }, {
  765. key: "getConfig", value: function (t) {
  766. var e, n = this.getModule("configs"), r = (this.declareConfigs().find((function (e) {
  767. return e.key === t
  768. })) || {}).default;
  769. return n && n.available() && null !== (e = n.getValue("host", t)) && void 0 !== e ? e : r
  770. }
  771. }]), a
  772. }(function () {
  773. function e() {
  774. t(this, e), l(this, "modules", {})
  775. }
  776.  
  777. return n(e, [{
  778. key: "activateModule", value: function (t) {
  779. var e = this.getModule(t);
  780. e ? (e.activate(), P("Module - '".concat(t, "' activated"))) : N("Activate module failed, ".concat(t, " is not found"))
  781. }
  782. }, {
  783. key: "deactivateModule", value: function (t) {
  784. var e = this.getModule(t);
  785. e || N("Deactivate module failed, '".concat(t, "' is not found")), e.deactivate()
  786. }
  787. }, {
  788. key: "getModule", value: function (t) {
  789. return this.modules[t]
  790. }
  791. }, {
  792. key: "registerModule", value: function (t) {
  793. var e = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
  794. e && v() || (this.modules[t.moduleIdentityName] = t, t.mountHost(this))
  795. }
  796. }, {
  797. key: "getAllActivateModules", value: function () {
  798. return Object.values(this.modules).filter((function (t) {
  799. return t.isActive
  800. }))
  801. }
  802. }, {
  803. key: "getAllModules", value: function () {
  804. return Object.values(this.modules)
  805. }
  806. }, {
  807. key: "getWindow", value: function () {
  808. return p()
  809. }
  810. }]), e
  811. }());
  812. var z = function (t, e) {
  813. if (!(t instanceof e)) throw new TypeError("Cannot call a class as a function")
  814. };
  815.  
  816. function Y(t, e) {
  817. return t(e = {exports: {}}, e.exports), e.exports
  818. }
  819.  
  820. var $ = Y((function (t) {
  821. function e(n, r) {
  822. return t.exports = e = Object.setPrototypeOf || function (t, e) {
  823. return t.__proto__ = e, t
  824. }, e(n, r)
  825. }
  826.  
  827. t.exports = e
  828. }));
  829. var K = function (t, e) {
  830. if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
  831. t.prototype = Object.create(e && e.prototype, {
  832. constructor: {
  833. value: t,
  834. writable: !0,
  835. configurable: !0
  836. }
  837. }), e && $(t, e)
  838. }, J = Y((function (t) {
  839. function e(n) {
  840. return "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? t.exports = e = function (t) {
  841. return typeof t
  842. } : t.exports = e = function (t) {
  843. return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t
  844. }, e(n)
  845. }
  846.  
  847. t.exports = e
  848. }));
  849. var Q = function (t) {
  850. if (void 0 === t) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  851. return t
  852. };
  853. var X = function (t, e) {
  854. return !e || "object" !== J(e) && "function" != typeof e ? Q(t) : e
  855. }, Z = Y((function (t) {
  856. function e(n) {
  857. return t.exports = e = Object.setPrototypeOf ? Object.getPrototypeOf : function (t) {
  858. return t.__proto__ || Object.getPrototypeOf(t)
  859. }, e(n)
  860. }
  861.  
  862. t.exports = e
  863. }));
  864. var tt = function (t, e) {
  865. (null == e || e > t.length) && (e = t.length);
  866. for (var n = 0, r = new Array(e); n < e; n++) r[n] = t[n];
  867. return r
  868. };
  869. var et = function (t) {
  870. if (Array.isArray(t)) return tt(t)
  871. };
  872. var nt = function (t) {
  873. if ("undefined" != typeof Symbol && Symbol.iterator in Object(t)) return Array.from(t)
  874. };
  875. var rt = function (t, e) {
  876. if (t) {
  877. if ("string" == typeof t) return tt(t, e);
  878. var n = Object.prototype.toString.call(t).slice(8, -1);
  879. return "Object" === n && t.constructor && (n = t.constructor.name), "Map" === n || "Set" === n ? Array.from(t) : "Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? tt(t, e) : void 0
  880. }
  881. };
  882. var ot = function () {
  883. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")
  884. };
  885. var it = function (t) {
  886. return et(t) || nt(t) || rt(t) || ot()
  887. };
  888.  
  889. function at(t, e) {
  890. for (var n = 0; n < e.length; n++) {
  891. var r = e[n];
  892. r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(t, r.key, r)
  893. }
  894. }
  895.  
  896. var ut = function (t, e, n) {
  897. return e && at(t.prototype, e), n && at(t, n), t
  898. };
  899. var ct = function (t, e) {
  900. for (; !Object.prototype.hasOwnProperty.call(t, e) && null !== (t = Z(t));) ;
  901. return t
  902. }, lt = Y((function (t) {
  903. function e(n, r, o) {
  904. return "undefined" != typeof Reflect && Reflect.get ? t.exports = e = Reflect.get : t.exports = e = function (t, e, n) {
  905. var r = ct(t, e);
  906. if (r) {
  907. var o = Object.getOwnPropertyDescriptor(r, e);
  908. return o.get ? o.get.call(n) : o.value
  909. }
  910. }, e(n, r, o || n)
  911. }
  912.  
  913. t.exports = e
  914. }));
  915. var st = function (t) {
  916. return -1 !== Function.toString.call(t).indexOf("[native code]")
  917. };
  918. var ft = function () {
  919. if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
  920. if (Reflect.construct.sham) return !1;
  921. if ("function" == typeof Proxy) return !0;
  922. try {
  923. return Date.prototype.toString.call(Reflect.construct(Date, [], (function () {
  924. }))), !0
  925. } catch (t) {
  926. return !1
  927. }
  928. }, ht = Y((function (t) {
  929. function e(n, r, o) {
  930. return ft() ? t.exports = e = Reflect.construct : t.exports = e = function (t, e, n) {
  931. var r = [null];
  932. r.push.apply(r, e);
  933. var o = new (Function.bind.apply(t, r));
  934. return n && $(o, n.prototype), o
  935. }, e.apply(null, arguments)
  936. }
  937.  
  938. t.exports = e
  939. })), dt = Y((function (t) {
  940. function e(n) {
  941. var r = "function" == typeof Map ? new Map : void 0;
  942. return t.exports = e = function (t) {
  943. if (null === t || !st(t)) return t;
  944. if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function");
  945. if (void 0 !== r) {
  946. if (r.has(t)) return r.get(t);
  947. r.set(t, e)
  948. }
  949.  
  950. function e() {
  951. return ht(t, arguments, Z(this).constructor)
  952. }
  953.  
  954. return e.prototype = Object.create(t.prototype, {
  955. constructor: {
  956. value: e,
  957. enumerable: !1,
  958. writable: !0,
  959. configurable: !0
  960. }
  961. }), $(e, t)
  962. }, e(n)
  963. }
  964.  
  965. t.exports = e
  966. }));
  967.  
  968. function yt(t, e) {
  969. var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "initAssign",
  970. r = Object.getPrototypeOf(e);
  971. return Object.setPrototypeOf(t, r), "function" == typeof r[n] && r[n].call(t, e), t
  972. }
  973.  
  974. function pt(t) {
  975. return Number(Math.random().toString().substr(3, t) + Date.now()).toString(36)
  976. }
  977.  
  978. function vt(t) {
  979. var e = function () {
  980. if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
  981. if (Reflect.construct.sham) return !1;
  982. if ("function" == typeof Proxy) return !0;
  983. try {
  984. return Date.prototype.toString.call(Reflect.construct(Date, [], (function () {
  985. }))), !0
  986. } catch (t) {
  987. return !1
  988. }
  989. }();
  990. return function () {
  991. var n, r = Z(t);
  992. if (e) {
  993. var o = Z(this).constructor;
  994. n = Reflect.construct(r, arguments, o)
  995. } else n = r.apply(this, arguments);
  996. return X(this, n)
  997. }
  998. }
  999.  
  1000. !function (t, e) {
  1001. t(e = {exports: {}}, e.exports)
  1002. }((function (t) {
  1003. function e(n) {
  1004. return "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? t.exports = e = function (t) {
  1005. return typeof t
  1006. } : t.exports = e = function (t) {
  1007. return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t
  1008. }, e(n)
  1009. }
  1010.  
  1011. t.exports = e
  1012. }));
  1013. var gt = {
  1014. instanceType: function (t) {
  1015. K(n, t);
  1016. var e = vt(n);
  1017.  
  1018. function n() {
  1019. return z(this, n), e.apply(this, arguments)
  1020. }
  1021.  
  1022. return ut(n, [{
  1023. key: "initAssign", value: function (t) {
  1024. this.id = pt(7), function (t, e, n, r) {
  1025. e && void 0 !== e[n] ? t[n] = e[n] : "function" == typeof r && (t[n] = r())
  1026. }(this, t, "uniqueId", (function () {
  1027. return pt(7)
  1028. }))
  1029. }
  1030. }, {
  1031. key: "bind", value: function (t) {
  1032. var e, r = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : [];
  1033. return yt((e = lt(Z(n.prototype), "bind", this)).call.apply(e, [this, t].concat(it(r))), this)
  1034. }
  1035. }, {
  1036. key: "before", value: function (t) {
  1037. var e = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
  1038. return this.surround({before: t, adaptAsync: e})
  1039. }
  1040. }, {
  1041. key: "after", value: function (t) {
  1042. var e = arguments.length > 1 && void 0 !== arguments[1] && arguments[1];
  1043. return this.surround({after: t, adaptAsync: e})
  1044. }
  1045. }, {
  1046. key: "surround", value: function (t) {
  1047. var e = t.before, n = void 0 === e ? void 0 : e, r = t.after, o = void 0 === r ? void 0 : r,
  1048. i = t.onError, a = void 0 === i ? void 0 : i, u = t.adaptAsync, c = void 0 !== u && u,
  1049. l = this;
  1050. return "function" != typeof l ? l : yt((function () {
  1051. for (var t = this, e = arguments.length, r = new Array(e), i = 0; i < e; i++) r[i] = arguments[i];
  1052. var u = {}, s = {origin: l, args: r, trans: u}, f = "function" == typeof a;
  1053. try {
  1054. var h, d, y = !1;
  1055. return "function" == typeof n && (h = n.call(this, Object.assign({}, s, {
  1056. preventDefault: function () {
  1057. y = !0
  1058. }
  1059. })), y) ? h : (d = h instanceof Promise && c ? h.then((function () {
  1060. return l.apply(t, r)
  1061. })) : l.apply(this, r), "function" == typeof o && (d = d instanceof Promise && c ? d.then((function (e) {
  1062. return o.call(t, Object.assign({}, s, {lastValue: e}))
  1063. })) : o.call(this, Object.assign({}, s, {lastValue: d}))), d instanceof Promise && c && f ? d.catch((function (e) {
  1064. var n = !1, r = "";
  1065. return Promise.resolve(a.call(t, Object.assign({}, s, {
  1066. error: e,
  1067. resolve: function (t) {
  1068. r = t, n = !0
  1069. }
  1070. }))).then((function (t) {
  1071. if (!n) throw e;
  1072. return r || t
  1073. }))
  1074. })) : d)
  1075. } catch (t) {
  1076. if (!f) throw t;
  1077. var p = !1, v = "", g = function (t) {
  1078. v = t, p = !0
  1079. }, m = a.call(this, Object.assign({}, s, {error: t, resolve: g}));
  1080. if (!p) throw t;
  1081. return v || m
  1082. }
  1083. }), this)
  1084. }
  1085. }, {
  1086. key: "then", value: function (t) {
  1087. var e = this;
  1088. return yt((function () {
  1089. for (var n = arguments.length, r = new Array(n), o = 0; o < n; o++) r[o] = arguments[o];
  1090. var i = e.apply(this, r);
  1091. return Promise.resolve(i).then(t)
  1092. }), this)
  1093. }
  1094. }, {
  1095. key: "catch", value: function (t) {
  1096. var e = this;
  1097. return yt((function () {
  1098. var n;
  1099. try {
  1100. for (var r = arguments.length, o = new Array(r), i = 0; i < r; i++) o[i] = arguments[i];
  1101. if ((n = e.apply(this, o)) instanceof Promise) return n.catch(t)
  1102. } catch (e) {
  1103. n = t.call(this, e)
  1104. }
  1105. return n
  1106. }), this)
  1107. }
  1108. }, {
  1109. key: "finally", value: function (t) {
  1110. var e = this;
  1111. return yt((function () {
  1112. var n = function () {
  1113. try {
  1114. t.call(this)
  1115. } catch (t) {
  1116. }
  1117. };
  1118. try {
  1119. for (var r = arguments.length, o = new Array(r), i = 0; i < r; i++) o[i] = arguments[i];
  1120. var a = e.apply(this, o);
  1121. return a instanceof Promise ? "function" == typeof a.finally ? a.finally((function () {
  1122. return n()
  1123. })) : a.catch((function (t) {
  1124. return t
  1125. })).then((function (t) {
  1126. if (n(), t instanceof Error) throw t
  1127. })) : (n(), a)
  1128. } catch (t) {
  1129. throw n(), t
  1130. }
  1131. }), this)
  1132. }
  1133. }, {
  1134. key: "register", value: function () {
  1135. var t = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
  1136. return this.registerClass((function (e) {
  1137. var n = function (t) {
  1138. K(n, t);
  1139. var e = vt(n);
  1140.  
  1141. function n() {
  1142. return z(this, n), e.apply(this, arguments)
  1143. }
  1144.  
  1145. return n
  1146. }(e);
  1147. return Object.assign(n.prototype, t), n
  1148. }))
  1149. }
  1150. }, {
  1151. key: "registerClass", value: function (t) {
  1152. var e = t(this.constructor), n = this.bind(this);
  1153. if (Object.setPrototypeOf(n, e.prototype), "function" != typeof e || !(n instanceof this.constructor)) throw new Error("Registered class must extend FunctionInstance");
  1154. return n
  1155. }
  1156. }]), n
  1157. }(dt(Function))
  1158. };
  1159.  
  1160. function mt(t, e) {
  1161. var n = function () {
  1162. for (var e = arguments.length, n = new Array(e), r = 0; r < e; r++) n[r] = arguments[r];
  1163. return (t || function () {
  1164. }).apply(this, n)
  1165. };
  1166. return function (t, e) {
  1167. var n = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : "initAssign",
  1168. r = e.prototype;
  1169. Object.setPrototypeOf(t, r), "function" == typeof r[n] && r[n].call(t)
  1170. }(n, (e = Object.assign({}, gt, e)).instanceType), n
  1171. }
  1172.  
  1173. var bt, wt = {protect: !1, syncDesc: !0, native: !1}, kt = Object.defineProperty,
  1174. xt = Object.defineProperties;
  1175.  
  1176. function Ot(t, e, n) {
  1177. var r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {}, o = t[e];
  1178. if ("function" == typeof o) {
  1179. var i = Object.assign({}, wt, r), a = i.native, u = n(a ? o : mt(o));
  1180. t[e] = a ? u : function () {
  1181. for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++) e[n] = arguments[n];
  1182. try {
  1183. return u.apply(this, e)
  1184. } catch (t) {
  1185. return console.warn("[Hook JS]", "Hooks running lost once."), o.apply(this, e)
  1186. }
  1187. };
  1188. var c = i.protect, l = i.syncDesc;
  1189. c && At(t, e), l && St(o, t[e])
  1190. }
  1191. }
  1192.  
  1193. function Rt(t, e, n, r) {
  1194. var o = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : {};
  1195. return Ot(t, e, (function (t) {
  1196. return t[n](r)
  1197. }), o)
  1198. }
  1199.  
  1200. function Mt(t, e, n) {
  1201. var r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {};
  1202. return Rt(t, e, "before", n, r)
  1203. }
  1204.  
  1205. function _t(t, e, n) {
  1206. var r = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {};
  1207. return Ot(t, e, n, Object.assign({}, r, {native: !0}))
  1208. }
  1209.  
  1210. function At(t, e) {
  1211. kt.call(Object, t, e, {writable: !1})
  1212. }
  1213.  
  1214. function St(t, e) {
  1215. xt.call(Object, e, {
  1216. toString: {
  1217. enumerable: !1, writable: !0, value: function () {
  1218. return t.toString()
  1219. }
  1220. }, toLocaleString: {
  1221. enumerable: !1, writable: !0, value: function () {
  1222. return t.toLocaleString()
  1223. }
  1224. }
  1225. })
  1226. }
  1227.  
  1228. function Ct(t) {
  1229. var e = function () {
  1230. if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
  1231. if (Reflect.construct.sham) return !1;
  1232. if ("function" == typeof Proxy) return !0;
  1233. try {
  1234. return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function () {
  1235. }))), !0
  1236. } catch (t) {
  1237. return !1
  1238. }
  1239. }();
  1240. return function () {
  1241. var n, r = c(t);
  1242. if (e) {
  1243. var o = c(this).constructor;
  1244. n = Reflect.construct(r, arguments, o)
  1245. } else n = r.apply(this, arguments);
  1246. return u(this, n)
  1247. }
  1248. }
  1249.  
  1250. !function (t) {
  1251. t.TIMEOUT = "timeout", t.INTERVAL = "interval"
  1252. }(bt || (bt = {}));
  1253. var Tt = function (e) {
  1254. i(a, e);
  1255. var o = Ct(a);
  1256.  
  1257. function a() {
  1258. var e;
  1259. t(this, a);
  1260. for (var n = arguments.length, i = new Array(n), u = 0; u < n; u++) i[u] = arguments[u];
  1261. return l(r(e = o.call.apply(o, [this].concat(i))), "percentage", void 0), l(r(e), "interval", {}), l(r(e), "timeout", {}), l(r(e), "setIntervalOrigin", void 0), l(r(e), "setTimeoutOrigin", void 0), l(r(e), "clearIntervalOrigin", void 0), l(r(e), "clearTimeoutOrigin", void 0), e
  1262. }
  1263.  
  1264. return n(a, [{
  1265. key: "onMounted", value: function () {
  1266. B(c(a.prototype), "onMounted", this).call(this), this.setIntervalOrigin = this.window.setInterval, this.setTimeoutOrigin = this.window.setTimeout, this.clearIntervalOrigin = this.window.clearInterval, this.clearTimeoutOrigin = this.window.clearTimeout
  1267. }
  1268. }, {
  1269. key: "init", value: function () {
  1270. var t = this;
  1271. this.percentage = 1 / this.rate, _t(this.window, "setInterval", (function (e) {
  1272. return t.getHookedTimerFunction(bt.INTERVAL, e)
  1273. })), _t(this.window, "setTimeout", (function (e) {
  1274. return t.getHookedTimerFunction(bt.TIMEOUT, e)
  1275. })), Mt(this.window, "clearInterval", (function (e) {
  1276. var n = e.args;
  1277. t.redirectNewestId(n)
  1278. })), Mt(this.window, "clearTimeout", (function (e) {
  1279. var n = e.args;
  1280. t.redirectNewestId(n)
  1281. }))
  1282. }
  1283. }, {
  1284. key: "onRateChange", value: function (t) {
  1285. var e = this;
  1286. B(c(a.prototype), "onRateChange", this).call(this, t), this.percentage = 1 / t, Object.values(this.interval).forEach((function (t) {
  1287. t.args[1] = Math.floor((t.originMS || 1) * e.percentage), e.clearIntervalOrigin.call(e.window, t.nowId), t.nowId = e.setIntervalOrigin.apply(e.window, t.args)
  1288. })), Object.values(this.timeout).forEach((function (t) {
  1289. var n = Date.now(), r = t.exceptNextFireTime, o = t.oldPercentage, i = r - n;
  1290. i < 0 && (i = 0);
  1291. var a = Math.floor(e.percentage / o * i);
  1292. t.args[1] = a, t.exceptNextFireTime = n + a, t.oldPercentage = e.percentage, e.clearTimeoutOrigin.call(e.window, t.nowId), t.nowId = e.setTimeoutOrigin.apply(e.window, t.args)
  1293. }))
  1294. }
  1295. }, {
  1296. key: "notifyExec", value: function (t) {
  1297. var e = this;
  1298. t && Object.values(this.timeout).filter((function (e) {
  1299. return e.uniqueId === t
  1300. })).forEach((function (t) {
  1301. e.clearTimeoutOrigin.call(e.window, t.nowId), delete e.timeout[t.originId]
  1302. }))
  1303. }
  1304. }, {
  1305. key: "redirectNewestId", value: function (t) {
  1306. var e = t[0];
  1307. this.interval[e] && (t[0] = this.interval[e].nowId, delete this.interval[e]), this.timeout[e] && (t[0] = this.timeout[e].nowId, delete this.timeout[e])
  1308. }
  1309. }, {
  1310. key: "getHookedTimerFunction", value: function (t, e) {
  1311. var n = t, r = this;
  1312. return function () {
  1313. for (var t = arguments.length, o = new Array(t), i = 0; i < t; i++) o[i] = arguments[i];
  1314. var a = y(), u = o[0];
  1315. "string" == typeof u && (r.window.__timer = {notifyExec: r.notifyExec.bind(r)}, u += ";__timer.notifyExec(" + a + ")", o[0] = u), "function" == typeof u && (o[0] = function () {
  1316. var t = u.apply(this, arguments);
  1317. return r.notifyExec(a), t
  1318. });
  1319. var c = o[1];
  1320. o[1] *= r.percentage;
  1321. var l = e.apply(r.window, o);
  1322. return r[n][l] = {
  1323. args: o,
  1324. originMS: c,
  1325. originId: l,
  1326. nowId: l,
  1327. uniqueId: a,
  1328. oldPercentage: r.percentage,
  1329. exceptNextFireTime: Date.now() + c
  1330. }, l
  1331. }
  1332. }
  1333. }, {
  1334. key: "moduleIdentityName", get: function () {
  1335. return "timer"
  1336. }
  1337. }]), a
  1338. }(U);
  1339.  
  1340. function It(t) {
  1341. var e = function () {
  1342. if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
  1343. if (Reflect.construct.sham) return !1;
  1344. if ("function" == typeof Proxy) return !0;
  1345. try {
  1346. return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function () {
  1347. }))), !0
  1348. } catch (t) {
  1349. return !1
  1350. }
  1351. }();
  1352. return function () {
  1353. var n, r = c(t);
  1354. if (e) {
  1355. var o = c(this).constructor;
  1356. n = Reflect.construct(r, arguments, o)
  1357. } else n = r.apply(this, arguments);
  1358. return u(this, n)
  1359. }
  1360. }
  1361.  
  1362. var Et, jt = function (e) {
  1363. i(a, e);
  1364. var o = It(a);
  1365.  
  1366. function a() {
  1367. var e;
  1368. t(this, a);
  1369. for (var n = arguments.length, i = new Array(n), u = 0; u < n; u++) i[u] = arguments[u];
  1370. return l(r(e = o.call.apply(o, [this].concat(i))), "DateOrigin", void 0), l(r(e), "DateModified", void 0), l(r(e), "rate", 1), l(r(e), "lastDatetime", void 0), l(r(e), "lastMDatetime", void 0), e
  1371. }
  1372.  
  1373. return n(a, [{
  1374. key: "onMounted", value: function () {
  1375. B(c(a.prototype), "onMounted", this).call(this), this.lastDatetime = Date.now(), this.lastMDatetime = Date.now(), this.DateOrigin = this.window.Date, this.DateModified = this.window.Date
  1376. }
  1377. }, {
  1378. key: "init", value: function () {
  1379. this.hookedDate()
  1380. }
  1381. }, {
  1382. key: "onRateChange", value: function (t) {
  1383. this.DateModified && (this.lastMDatetime = this.DateModified.now(), this.lastDatetime = this.DateOrigin.now()), B(c(a.prototype), "onRateChange", this).call(this, t)
  1384. }
  1385. }, {
  1386. key: "hookedDate", value: function () {
  1387. var e = this, n = this;
  1388. _t(this.window, "Date", (function (e) {
  1389. var r = function (e) {
  1390. i(o, e);
  1391. var r = It(o);
  1392.  
  1393. function o() {
  1394. t(this, o);
  1395. for (var e = arguments.length, i = new Array(e), a = 0; a < e; a++) i[a] = arguments[a];
  1396. if (0 === i.length) {
  1397. var u = n.DateOrigin.now(), c = u - n.lastDatetime, l = c * n.rate;
  1398. i.push(n.lastMDatetime + l)
  1399. }
  1400. return r.call.apply(r, [this].concat(i))
  1401. }
  1402.  
  1403. return o
  1404. }(e);
  1405. return r = r.bind(new r)
  1406. })), this.DateModified = this.window.Date, _t(this.DateModified, "now", (function () {
  1407. return function () {
  1408. return (new e.DateModified).getTime()
  1409. }
  1410. }))
  1411. }
  1412. }, {
  1413. key: "moduleIdentityName", get: function () {
  1414. return "dateTimer"
  1415. }
  1416. }]), a
  1417. }(U);
  1418.  
  1419. function Dt(t, e) {
  1420. var n = "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"];
  1421. if (!n) {
  1422. if (Array.isArray(t) || (n = function (t, e) {
  1423. if (!t) return;
  1424. if ("string" == typeof t) return Pt(t, e);
  1425. var n = Object.prototype.toString.call(t).slice(8, -1);
  1426. "Object" === n && t.constructor && (n = t.constructor.name);
  1427. if ("Map" === n || "Set" === n) return Array.from(t);
  1428. if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Pt(t, e)
  1429. }(t)) || e && t && "number" == typeof t.length) {
  1430. n && (t = n);
  1431. var r = 0, o = function () {
  1432. };
  1433. return {
  1434. s: o, n: function () {
  1435. return r >= t.length ? {done: !0} : {done: !1, value: t[r++]}
  1436. }, e: function (t) {
  1437. throw t
  1438. }, f: o
  1439. }
  1440. }
  1441. throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")
  1442. }
  1443. var i, a = !0, u = !1;
  1444. return {
  1445. s: function () {
  1446. n = n.call(t)
  1447. }, n: function () {
  1448. var t = n.next();
  1449. return a = t.done, t
  1450. }, e: function (t) {
  1451. u = !0, i = t
  1452. }, f: function () {
  1453. try {
  1454. a || null == n.return || n.return()
  1455. } finally {
  1456. if (u) throw i
  1457. }
  1458. }
  1459. }
  1460. }
  1461.  
  1462. function Pt(t, e) {
  1463. (null == e || e > t.length) && (e = t.length);
  1464. for (var n = 0, r = new Array(e); n < e; n++) r[n] = t[n];
  1465. return r
  1466. }
  1467.  
  1468. function Nt(t) {
  1469. var e = function () {
  1470. if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
  1471. if (Reflect.construct.sham) return !1;
  1472. if ("function" == typeof Proxy) return !0;
  1473. try {
  1474. return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function () {
  1475. }))), !0
  1476. } catch (t) {
  1477. return !1
  1478. }
  1479. }();
  1480. return function () {
  1481. var n, r = c(t);
  1482. if (e) {
  1483. var o = c(this).constructor;
  1484. n = Reflect.construct(r, arguments, o)
  1485. } else n = r.apply(this, arguments);
  1486. return u(this, n)
  1487. }
  1488. }
  1489.  
  1490. !function (t) {
  1491. t.CTRL = "ctrl", t.META = "meta", t.CMD = "meta", t.SHIFT = "shift", t.ALT = "alt"
  1492. }(Et || (Et = {}));
  1493. var Lt = function (e) {
  1494. i(o, e);
  1495. var r = Nt(o);
  1496.  
  1497. function o() {
  1498. return t(this, o), r.apply(this, arguments)
  1499. }
  1500.  
  1501. return n(o, [{
  1502. key: "init", value: function () {
  1503. var t = this, e = this.shortcutList;
  1504. this.window.addEventListener("keydown", (function (n) {
  1505. var r, o = Dt(e);
  1506. try {
  1507. for (o.s(); !(r = o.n()).done;) {
  1508. var i = r.value;
  1509. I(n, i) && (n.preventDefault(), n.stopPropagation(), i.operator(t.host))
  1510. }
  1511. } catch (t) {
  1512. o.e(t)
  1513. } finally {
  1514. o.f()
  1515. }
  1516. }))
  1517. }
  1518. }, {
  1519. key: "shortcutList", get: function () {
  1520. var t = this;
  1521. return [["shortcutExpressions.+", function (t) {
  1522. return t.speedUp()
  1523. }], ["shortcutExpressions.-", function (t) {
  1524. return t.speedDown()
  1525. }], ["shortcutExpressions.*", function (t) {
  1526. return t.speedMultiply()
  1527. }], ["shortcutExpressions./", function (t) {
  1528. return t.speedDivide()
  1529. }], ["shortcutExpressions.reset", function (t) {
  1530. return t.setSpeed(1)
  1531. }], ["shortcutExpressions.custom", function (t) {
  1532. return t.setSpeed()
  1533. }]].map((function (e) {
  1534. var n = w(e, 2), r = n[0], o = n[1];
  1535. return {expressions: t.getConfig(r), operator: o}
  1536. })).map((function (t) {
  1537. return e = t, "string" == typeof (n = Object.assign({}, e, {conditions: []})).expressions && (n.expressions = n.expressions.split(";")), n.expressions && n.expressions instanceof Array && (n.conditions = n.expressions.map((function (t) {
  1538. return function (t) {
  1539. var e = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "+",
  1540. n = t.split(e).map((function (t) {
  1541. return t.trim()
  1542. })).filter((function (t) {
  1543. return t
  1544. })), r = {code: n.pop() || "UNKNOWN_KEY"};
  1545. return n.forEach((function (t) {
  1546. r[t + "Key"] = !0
  1547. })), r
  1548. }(t)
  1549. }))), n;
  1550. var e, n
  1551. }))
  1552. }
  1553. }, {
  1554. key: "moduleIdentityName", get: function () {
  1555. return "shortcutKey"
  1556. }
  1557. }, {
  1558. key: "declareConfigs", value: function () {
  1559. return [{
  1560. type: f.ARRAY,
  1561. itemType: f.SHORTCUT,
  1562. key: "shortcutExpressions.+",
  1563. default: ["ctrl + Equal", "meta + Equal", "ctrl + Period", "meta + Period"]
  1564. }, {
  1565. type: f.ARRAY,
  1566. itemType: f.SHORTCUT,
  1567. key: "shortcutExpressions.-",
  1568. default: ["ctrl + Minus", "meta + Minus", "ctrl + Comma", "meta + Comma"]
  1569. }, {
  1570. type: f.ARRAY,
  1571. itemType: f.SHORTCUT,
  1572. key: "shortcutExpressions.*",
  1573. default: ["alt + Equal", "alt + Period"]
  1574. }, {
  1575. type: f.ARRAY,
  1576. itemType: f.SHORTCUT,
  1577. key: "shortcutExpressions./",
  1578. default: ["alt + Minus", "alt + Comma"]
  1579. }, {
  1580. type: f.ARRAY,
  1581. itemType: f.SHORTCUT,
  1582. key: "shortcutExpressions.reset",
  1583. default: ["ctrl + Digit0", "meta + Digit0", "alt + Digit0"]
  1584. }, {
  1585. type: f.ARRAY,
  1586. itemType: f.SHORTCUT,
  1587. key: "shortcutExpressions.custom",
  1588. default: ["ctrl + Digit9", "meta + Digit9"]
  1589. }]
  1590. }
  1591. }]), o
  1592. }(U);
  1593.  
  1594. function Bt(t) {
  1595. var e = function () {
  1596. if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
  1597. if (Reflect.construct.sham) return !1;
  1598. if ("function" == typeof Proxy) return !0;
  1599. try {
  1600. return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function () {
  1601. }))), !0
  1602. } catch (t) {
  1603. return !1
  1604. }
  1605. }();
  1606. return function () {
  1607. var n, r = c(t);
  1608. if (e) {
  1609. var o = c(this).constructor;
  1610. n = Reflect.construct(r, arguments, o)
  1611. } else n = r.apply(this, arguments);
  1612. return u(this, n)
  1613. }
  1614. }
  1615.  
  1616. function Vt(t, e) {
  1617. var n = "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"];
  1618. if (!n) {
  1619. if (Array.isArray(t) || (n = function (t, e) {
  1620. if (!t) return;
  1621. if ("string" == typeof t) return Ut(t, e);
  1622. var n = Object.prototype.toString.call(t).slice(8, -1);
  1623. "Object" === n && t.constructor && (n = t.constructor.name);
  1624. if ("Map" === n || "Set" === n) return Array.from(t);
  1625. if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Ut(t, e)
  1626. }(t)) || e && t && "number" == typeof t.length) {
  1627. n && (t = n);
  1628. var r = 0, o = function () {
  1629. };
  1630. return {
  1631. s: o, n: function () {
  1632. return r >= t.length ? {done: !0} : {done: !1, value: t[r++]}
  1633. }, e: function (t) {
  1634. throw t
  1635. }, f: o
  1636. }
  1637. }
  1638. throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")
  1639. }
  1640. var i, a = !0, u = !1;
  1641. return {
  1642. s: function () {
  1643. n = n.call(t)
  1644. }, n: function () {
  1645. var t = n.next();
  1646. return a = t.done, t
  1647. }, e: function (t) {
  1648. u = !0, i = t
  1649. }, f: function () {
  1650. try {
  1651. a || null == n.return || n.return()
  1652. } finally {
  1653. if (u) throw i
  1654. }
  1655. }
  1656. }
  1657. }
  1658.  
  1659. function Ut(t, e) {
  1660. (null == e || e > t.length) && (e = t.length);
  1661. for (var n = 0, r = new Array(e); n < e; n++) r[n] = t[n];
  1662. return r
  1663. }
  1664.  
  1665. function Gt(t) {
  1666. var e, n = {}, r = Vt(Object.entries(t).filter((function (t) {
  1667. var e = w(t, 1)[0];
  1668. return !["target", "key"].includes(e)
  1669. })));
  1670. try {
  1671. for (r.s(); !(e = r.n()).done;) {
  1672. var o = w(e.value, 2), i = o[0], a = o[1];
  1673. n[i] = a
  1674. }
  1675. } catch (t) {
  1676. r.e(t)
  1677. } finally {
  1678. r.f()
  1679. }
  1680. return n
  1681. }
  1682.  
  1683. var Ht = function (e) {
  1684. i(a, e);
  1685. var o = Bt(a);
  1686.  
  1687. function a() {
  1688. var e;
  1689. t(this, a);
  1690. for (var n = arguments.length, i = new Array(n), u = 0; u < n; u++) i[u] = arguments[u];
  1691. return l(r(e = o.call.apply(o, [this].concat(i))), "defines", []), l(r(e), "definePropertiesOrigin", void 0), l(r(e), "definePropertyOrigin", void 0), e
  1692. }
  1693.  
  1694. return n(a, [{
  1695. key: "onMounted", value: function () {
  1696. B(c(a.prototype), "onMounted", this).call(this), this.definePropertiesOrigin = this.window.Object.defineProperties, this.definePropertyOrigin = this.window.Object.defineProperty
  1697. }
  1698. }, {
  1699. key: "isCoreModule", get: function () {
  1700. return !0
  1701. }
  1702. }, {
  1703. key: "init", value: function () {
  1704. var t = this;
  1705. Mt(this.window.Object, "defineProperties", (function (e) {
  1706. var n, r = e.args, o = w(r, 2), i = o[0], a = o[1],
  1707. u = Object.entries(a).map((function (e) {
  1708. var n = w(e, 2), o = n[0], a = n[1], u = Object.assign({target: i, key: o}, a);
  1709. return t.hookDefine(u) ? (r[0] = u.target, [u.key, Gt(u)]) : [!1]
  1710. })).filter((function (t) {
  1711. return w(t, 1)[0]
  1712. }));
  1713. r[1] = (n = {}, u.forEach((function (t) {
  1714. n[null == t[0] ? "" : t[0]] = t[1]
  1715. })), n)
  1716. })), Mt(this.window.Object, "defineProperty", (function (e) {
  1717. var n = e.args, r = e.preventDefault, o = w(n, 3), i = o[0], a = o[1], u = o[2],
  1718. c = Object.assign({target: i, key: a}, u);
  1719. t.hookDefine(c) ? (n[0] = c.target, n[1] = c.key, n[2] = Gt(c)) : r()
  1720. }))
  1721. }
  1722. }, {
  1723. key: "hookDefine", value: function (t) {
  1724. var e, n = Vt(this.defines);
  1725. try {
  1726. for (n.s(); !(e = n.n()).done;) {
  1727. if ((0, e.value)(t)) return !1
  1728. }
  1729. } catch (t) {
  1730. n.e(t)
  1731. } finally {
  1732. n.f()
  1733. }
  1734. return !0
  1735. }
  1736. }, {
  1737. key: "applyDefineRole", value: function (t) {
  1738. this.defines.push(t)
  1739. }
  1740. }, {
  1741. key: "moduleIdentityName", get: function () {
  1742. return "definition"
  1743. }
  1744. }]), a
  1745. }(L);
  1746.  
  1747. function Wt(t) {
  1748. return function (t) {
  1749. if (Array.isArray(t)) return m(t)
  1750. }(t) || function (t) {
  1751. if ("undefined" != typeof Symbol && null != t[Symbol.iterator] || null != t["@@iterator"]) return Array.from(t)
  1752. }(t) || b(t) || function () {
  1753. throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")
  1754. }()
  1755. }
  1756.  
  1757. function qt(t) {
  1758. var e = function () {
  1759. if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
  1760. if (Reflect.construct.sham) return !1;
  1761. if ("function" == typeof Proxy) return !0;
  1762. try {
  1763. return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function () {
  1764. }))), !0
  1765. } catch (t) {
  1766. return !1
  1767. }
  1768. }();
  1769. return function () {
  1770. var n, r = c(t);
  1771. if (e) {
  1772. var o = c(this).constructor;
  1773. n = Reflect.construct(r, arguments, o)
  1774. } else n = r.apply(this, arguments);
  1775. return u(this, n)
  1776. }
  1777. }
  1778.  
  1779. var Ft = function (e) {
  1780. i(a, e);
  1781. var o = qt(a);
  1782.  
  1783. function a() {
  1784. var e;
  1785. t(this, a);
  1786. for (var n = arguments.length, i = new Array(n), u = 0; u < n; u++) i[u] = arguments[u];
  1787. return l(r(e = o.call.apply(o, [this].concat(i))), "extraElements", []), e
  1788. }
  1789.  
  1790. return n(a, [{
  1791. key: "init", value: function () {
  1792. var t = this;
  1793. !function (t, e, n) {
  1794. Rt(t, e, "after", n, arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : {})
  1795. }(this.window.Element.prototype, "attachShadow", (function (e) {
  1796. var n = e.lastValue;
  1797. return t.extraElements.push(n), n
  1798. }))
  1799. }
  1800. }, {
  1801. key: "querySelectorAll", value: function (t) {
  1802. return g(this.extraElements.map((function (e) {
  1803. return Wt(e.querySelectorAll(t))
  1804. })))
  1805. }
  1806. }, {
  1807. key: "moduleIdentityName", get: function () {
  1808. return "shadowDOM"
  1809. }
  1810. }, {
  1811. key: "isCoreModule", get: function () {
  1812. return !0
  1813. }
  1814. }]), a
  1815. }(L);
  1816.  
  1817. function zt(t, e) {
  1818. var n = "undefined" != typeof Symbol && t[Symbol.iterator] || t["@@iterator"];
  1819. if (!n) {
  1820. if (Array.isArray(t) || (n = function (t, e) {
  1821. if (!t) return;
  1822. if ("string" == typeof t) return Yt(t, e);
  1823. var n = Object.prototype.toString.call(t).slice(8, -1);
  1824. "Object" === n && t.constructor && (n = t.constructor.name);
  1825. if ("Map" === n || "Set" === n) return Array.from(t);
  1826. if ("Arguments" === n || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Yt(t, e)
  1827. }(t)) || e && t && "number" == typeof t.length) {
  1828. n && (t = n);
  1829. var r = 0, o = function () {
  1830. };
  1831. return {
  1832. s: o, n: function () {
  1833. return r >= t.length ? {done: !0} : {done: !1, value: t[r++]}
  1834. }, e: function (t) {
  1835. throw t
  1836. }, f: o
  1837. }
  1838. }
  1839. throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")
  1840. }
  1841. var i, a = !0, u = !1;
  1842. return {
  1843. s: function () {
  1844. n = n.call(t)
  1845. }, n: function () {
  1846. var t = n.next();
  1847. return a = t.done, t
  1848. }, e: function (t) {
  1849. u = !0, i = t
  1850. }, f: function () {
  1851. try {
  1852. a || null == n.return || n.return()
  1853. } finally {
  1854. if (u) throw i
  1855. }
  1856. }
  1857. }
  1858. }
  1859.  
  1860. function Yt(t, e) {
  1861. (null == e || e > t.length) && (e = t.length);
  1862. for (var n = 0, r = new Array(e); n < e; n++) r[n] = t[n];
  1863. return r
  1864. }
  1865.  
  1866. function $t(t) {
  1867. var e = function () {
  1868. if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
  1869. if (Reflect.construct.sham) return !1;
  1870. if ("function" == typeof Proxy) return !0;
  1871. try {
  1872. return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function () {
  1873. }))), !0
  1874. } catch (t) {
  1875. return !1
  1876. }
  1877. }();
  1878. return function () {
  1879. var n, r = c(t);
  1880. if (e) {
  1881. var o = c(this).constructor;
  1882. n = Reflect.construct(r, arguments, o)
  1883. } else n = r.apply(this, arguments);
  1884. return u(this, n)
  1885. }
  1886. }
  1887.  
  1888. var Kt = function (e) {
  1889. i(o, e);
  1890. var r = $t(o);
  1891.  
  1892. function o() {
  1893. return t(this, o), r.apply(this, arguments)
  1894. }
  1895.  
  1896. return n(o, [{
  1897. key: "onRateChange", value: function (t) {
  1898. B(c(o.prototype), "onRateChange", this).call(this, t);
  1899. var e, n = zt(this.allVideoElements);
  1900. try {
  1901. for (n.s(); !(e = n.n()).done;) {
  1902. var r = e.value;
  1903. this.changePlaybackRate(r, t)
  1904. }
  1905. } catch (t) {
  1906. n.e(t)
  1907. } finally {
  1908. n.f()
  1909. }
  1910. }
  1911. }, {
  1912. key: "init", value: function () {
  1913. this.preventPlaybackRateLock()
  1914. }
  1915. }, {
  1916. key: "changePlaybackRate", value: function (t, e) {
  1917. e = e >= 16 ? 16 : e <= .065 ? .065 : e, this.unlockPlaybackRate(t), t.playbackRate = e, 1 !== e && this.lockPlaybackRate(t)
  1918. }
  1919. }, {
  1920. key: "lockPlaybackRate", value: function (t) {
  1921. var e = (this.definitionModule || {}).definePropertyOrigin;
  1922. (void 0 === e ? Object.defineProperty : e).call(Object, t, "playbackRate", {
  1923. configurable: !0,
  1924. get: function () {
  1925. return 1
  1926. },
  1927. set: function () {
  1928. }
  1929. })
  1930. }
  1931. }, {
  1932. key: "unlockPlaybackRate", value: function (t) {
  1933. delete t.playbackRate, delete t.playbackRate, delete t.playbackRate
  1934. }
  1935. }, {
  1936. key: "definitionModule", get: function () {
  1937. return this.getDependencyModule("definition")
  1938. }
  1939. }, {
  1940. key: "preventPlaybackRateLock", value: function () {
  1941. var t = this.definitionModule;
  1942. t ? t.applyDefineRole((function (t) {
  1943. if (t.target instanceof HTMLVideoElement && "playbackRate" === t.key) return N("已阻止对该网站视频视频倍率的锁定"), !0
  1944. })) : N("`Video Speed Module`, dependency: `definition` module is required.")
  1945. }
  1946. }, {
  1947. key: "allVideoElements", get: function () {
  1948. var t = this.getDependencyModule("shadowDOM");
  1949. return t || N("`Video Speed Module`, dependency: `shadowDOM` module is required."), [].concat(Wt(t ? t.querySelectorAll("video") : []), Wt(this.document.querySelectorAll("video")))
  1950. }
  1951. }, {
  1952. key: "moduleIdentityName", get: function () {
  1953. return "videoSpeed"
  1954. }
  1955. }]), o
  1956. }(U);
  1957.  
  1958. function Jt(t) {
  1959. var e = function () {
  1960. if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
  1961. if (Reflect.construct.sham) return !1;
  1962. if ("function" == typeof Proxy) return !0;
  1963. try {
  1964. return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function () {
  1965. }))), !0
  1966. } catch (t) {
  1967. return !1
  1968. }
  1969. }();
  1970. return function () {
  1971. var n, r = c(t);
  1972. if (e) {
  1973. var o = c(this).constructor;
  1974. n = Reflect.construct(r, arguments, o)
  1975. } else n = r.apply(this, arguments);
  1976. return u(this, n)
  1977. }
  1978. }
  1979.  
  1980. var Qt = function (e) {
  1981. i(o, e);
  1982. var r = Jt(o);
  1983.  
  1984. function o(e) {
  1985. var n, i = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : "__CM";
  1986. return t(this, o), (n = r.call(this)).storage = e, n.prefix = i, n
  1987. }
  1988.  
  1989. return n(o, [{
  1990. key: "isCoreModule", get: function () {
  1991. return !0
  1992. }
  1993. }, {
  1994. key: "openPage", value: function (t) {
  1995. "function" == typeof D.openInTab ? D.openInTab(t, {active: !0}) : this.window.open(t)
  1996. }
  1997. }, {
  1998. key: "init", value: function () {
  1999. var t = this;
  2000. B(c(o.prototype), "init", this).call(this), "function" == typeof D.registerMenuCommand && (D.registerMenuCommand("主页", (function () {
  2001. t.openPage("https://timer.palerock.cn")
  2002. })), D.registerMenuCommand("打开配置页面", (function () {
  2003. t.openPage("https://timer.palerock.cn/configuration")
  2004. })))
  2005. }
  2006. }, {
  2007. key: "getAllConfigs", value: function () {
  2008. var t = this;
  2009. return this.getDeclaredConfigurations().map((function (e) {
  2010. var n = t.getValue(e.namespace, e.key);
  2011. return Object.assign({}, e, {value: null != n ? n : e.default})
  2012. }))
  2013. }
  2014. }, {
  2015. key: "getDeclaredConfigurations", value: function () {
  2016. return g([this.host.declareConfigs().map((function (t) {
  2017. return Object.assign({}, t, {namespace: "host"})
  2018. }))].concat(Wt(this.host.getAllActivateModules().map((function (t) {
  2019. return t.declareConfigs().map((function (e) {
  2020. return Object.assign({}, e, {namespace: t.moduleIdentityName, modelName: t.moduleName})
  2021. }))
  2022. })))))
  2023. }
  2024. }, {
  2025. key: "moduleIdentityName", get: function () {
  2026. return "configs"
  2027. }
  2028. }, {
  2029. key: "saveAllConfigs", value: function (t) {
  2030. var e = this;
  2031. t.forEach((function (t) {
  2032. var n;
  2033. e.setValue(t.namespace, t.key, null !== (n = t.value) && void 0 !== n ? n : t.default)
  2034. }))
  2035. }
  2036. }, {
  2037. key: "getValue", value: function (t, e) {
  2038. if (this.available()) return this.storage.get([this.prefix, t, e].join("_"))
  2039. }
  2040. }, {
  2041. key: "setValue", value: function (t, e, n) {
  2042. this.available() && this.storage.set([this.prefix, t, e].join("_"), n)
  2043. }
  2044. }, {
  2045. key: "available", value: function () {
  2046. return !!this.storage && this.storage.available()
  2047. }
  2048. }, {
  2049. key: "resetAll", value: function () {
  2050. var t = this;
  2051. this.storage.list().filter((function (e) {
  2052. return e.startsWith(t.prefix)
  2053. })).forEach((function (e) {
  2054. t.storage.remove(e)
  2055. }))
  2056. }
  2057. }]), o
  2058. }(L), Xt = function () {
  2059. function e() {
  2060. t(this, e), l(this, "isAvailable", void 0)
  2061. }
  2062.  
  2063. return n(e, [{
  2064. key: "get", value: function (t) {
  2065. return D.getValue(t)
  2066. }
  2067. }, {
  2068. key: "list", value: function () {
  2069. return D.listValues()
  2070. }
  2071. }, {
  2072. key: "remove", value: function (t) {
  2073. D.deleteValue(t)
  2074. }
  2075. }, {
  2076. key: "set", value: function (t, e) {
  2077. D.setValue(t, e)
  2078. }
  2079. }, {
  2080. key: "available", value: function () {
  2081. return null == this.isAvailable && (this.isAvailable = [a(D.setValue), a(D.getValue), a(D.listValues), a(D.deleteValue)].every((function (t) {
  2082. return "function" === t
  2083. }))), this.isAvailable
  2084. }
  2085. }]), e
  2086. }();
  2087.  
  2088. function Zt(t) {
  2089. var e = function () {
  2090. if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
  2091. if (Reflect.construct.sham) return !1;
  2092. if ("function" == typeof Proxy) return !0;
  2093. try {
  2094. return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function () {
  2095. }))), !0
  2096. } catch (t) {
  2097. return !1
  2098. }
  2099. }();
  2100. return function () {
  2101. var n, r = c(t);
  2102. if (e) {
  2103. var o = c(this).constructor;
  2104. n = Reflect.construct(r, arguments, o)
  2105. } else n = r.apply(this, arguments);
  2106. return u(this, n)
  2107. }
  2108. }
  2109.  
  2110. var te = function (e) {
  2111. i(a, e);
  2112. var o = Zt(a);
  2113.  
  2114. function a() {
  2115. var e;
  2116. t(this, a);
  2117. for (var n = arguments.length, i = new Array(n), u = 0; u < n; u++) i[u] = arguments[u];
  2118. return l(r(e = o.call.apply(o, [this].concat(i))), "nodeElement", void 0), l(r(e), "clickMapper", {
  2119. "_item-input": function (t) {
  2120. t.setSpeed()
  2121. }, "_item-x2": function (t) {
  2122. t.speedUp()
  2123. }, "_item-x-2": function (t) {
  2124. t.speedDown()
  2125. }, "_item-xx2": function (t) {
  2126. t.speedMultiply()
  2127. }, "_item-xx-2": function (t) {
  2128. t.speedDivide()
  2129. }, "_item-reset": function (t) {
  2130. t.setSpeed(0)
  2131. }
  2132. }), l(r(e), "setTimeoutOrigin", setTimeout), e
  2133. }
  2134.  
  2135. return n(a, [{
  2136. key: "moduleIdentityName", get: function () {
  2137. return "legacyUi"
  2138. }
  2139. }, {
  2140. key: "displayNum", get: function () {
  2141. return (this.rate.toString().split(".")[1] || "").length > 2 ? this.rate.toFixed(2) : this.rate.toString()
  2142. }
  2143. }, {
  2144. key: "showSuspendedBall", get: function () {
  2145. return this.getConfig("showSuspendedBall")
  2146. }
  2147. }, {
  2148. key: "deeplyColor", get: function () {
  2149. return this.getConfig("deeplyColor")
  2150. }
  2151. }, {
  2152. key: "genElement", value: function () {
  2153. var t = this.document.createElement("div");
  2154. t.innerHTML = (this.showSuspendedBall ? '<div class="_th-container" >\n <div class="_th-click-hover _item-input">\n x' + this.displayNum + '\n </div>\n <div class="_th-item _item-x2">&gt;</div>\n <div class="_th-item _item-x-2">&lt;</div>\n <div class="_th-item _item-xx2">&gt;&gt;</div>\n <div class="_th-item _item-xx-2">&lt;&lt;</div>\n <div class="_th-item _item-reset">O</div>\n</div>\n' : "") + '<div class="_th_cover-all-show-times _th_hidden">\n <div class="_th_times">x' + this.displayNum + "</div>\n</div>";
  2155. var e = this;
  2156. return Object.keys(this.clickMapper).forEach((function (n) {
  2157. var r = e.clickMapper[n], o = t.getElementsByClassName(n)[0];
  2158. o && (o.onclick = function () {
  2159. r(e.host, e.rate)
  2160. })
  2161. })), t
  2162. }
  2163. }, {
  2164. key: "element", value: function () {
  2165. return this.nodeElement || (this.nodeElement = this.genElement()), this.nodeElement
  2166. }
  2167. }, {
  2168. key: "style", value: function () {
  2169. var t = this.position, e = this.positionOffset, n = "right" === t ? "left" : "right",
  2170. r = "left" === t;
  2171. return "\n ._th-container ._th-item {\n margin-bottom: 3px;\n position: relative;\n width: 0;\n height: 0;\n cursor: pointer;\n opacity: .3;\n background-color: #525288;\n border-radius: 100%;\n text-align: center;\n line-height: 30px;\n -webkit-transition: all .35s;\n -o-transition: all .35s;\n transition: all .35s;\n ".concat(n, ": 30px;\n }\n\n ._th-container ._th-item, ._th-container ._th-click-hover, ._th_cover-all-show-times ._th_times {\n -webkit-box-shadow: ").concat(this.deeplyColor ? "4px 5px 10px 6px #b2b2b2" : "-3px 4px 12px -5px black", ";\n box-shadow: ").concat(this.deeplyColor ? "4px 5px 10px 6px #b2b2b2" : "-3px 4px 12px -5px black", ";\n }\n\n ._th-container:hover ._th-item._item-x2 {\n margin-").concat(t, ": 18px;\n width: 40px;\n height: 40px;\n line-height: 40px\n }\n\n ._th-container:hover ._th-item._item-x-2 {\n margin-").concat(t, ": 17px;\n width: 38px;\n height: 38px;\n line-height: 38px\n }\n\n ._th-container:hover ._th-item._item-xx2 {\n width: 36px;\n height: 36px;\n margin-").concat(t, ": 16px;\n line-height: 36px\n }\n\n ._th-container:hover ._th-item._item-xx-2 {\n width: 32px;\n height: 32px;\n line-height: 32px;\n margin-").concat(t, ": 14px\n }\n\n ._th-container:hover ._th-item._item-reset {\n width: 30px;\n line-height: 30px;\n height: 30px;\n margin-").concat(t, ": 10px\n }\n\n ._th-click-hover {\n position: relative;\n -webkit-transition: all .5s;\n -o-transition: all .5s;\n transition: all .5s;\n height: 45px;\n width: 45px;\n cursor: pointer;\n opacity: .6;\n border-radius: 100%;\n background-color: rgba(255, 255, 255, 0);\n text-align: center;\n line-height: 45px;\n ").concat(n, ": 0\n }\n\n ._th-container:hover {\n ").concat(t, ": -5px\n }\n\n ._th-container {\n font-size: 12px;\n -webkit-transition: all .5s;\n -o-transition: all .5s;\n transition: all .5s;\n ").concat(t, ": -30px;\n top: ").concat(e, ";\n position: fixed;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n z-index: 999996;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n display: flex;\n width: 58px;\n -ms-flex-wrap: wrap;\n flex-wrap: wrap;\n -webkit-box-orient: horizontal;\n -webkit-box-direction: ").concat(r ? "normal" : "reverse", ";\n -ms-flex-direction: ").concat(r ? "row" : "row-reverse", ";\n flex-direction: ").concat(r ? "row" : "row-reverse", ";\n }\n\n ._th-container ._th-item:hover {\n opacity: .8;\n background-color: #5fb492;\n color: aliceblue\n }\n\n ._th-container ._th-item:active {\n opacity: .9;\n background-color: #1b3a26;\n color: aliceblue\n }\n\n ._th-container:hover ._th-click-hover {\n opacity: .8\n }\n\n ._th-container:hover ._th-item {\n opacity: .6;\n ").concat(n, ": 0\n }\n\n ._th-container ._th-click-hover:hover {\n opacity: .8;\n background-color: #5fb492;\n color: aliceblue\n }\n\n ._th_cover-all-show-times {\n position: fixed;\n top: 0;\n ").concat(n, ": 0;\n width: 100%;\n height: 100%;\n z-index: 999996;\n opacity: 1;\n font-weight: 900;\n font-size: 30px;\n color: #4f4f4f;\n background-color: rgba(0, 0, 0, 0.1)\n }\n\n ._th_cover-all-show-times._th_hidden {\n z-index: -99999;\n opacity: 0;\n -webkit-transition: 1s all;\n -o-transition: 1s all;\n transition: 1s all\n }\n\n ._th_cover-all-show-times ._th_times {\n width: 300px;\n height: 300px;\n border-radius: 50%;\n background-color: rgba(84, 92, 100, 0.5);\n text-align: center;\n line-height: 300px;\n position: absolute;\n top: 50%;\n ").concat(n, ": 50%;\n margin-top: -150px;\n margin-").concat(n, ": -150px\n }\n ")
  2172. }
  2173. }, {
  2174. key: "onUiRateChange", value: function (t) {
  2175. if (B(c(a.prototype), "onUiRateChange", this).call(this, t), this.nodeElement) {
  2176. var e = this.nodeElement.querySelector("._th-click-hover") || {},
  2177. n = this.nodeElement.querySelector("._th_times") || {}, r = this.displayNum;
  2178. e.innerHTML = "x" + r, n.innerHTML = "x" + r;
  2179. var o = this.nodeElement.querySelector("._th_cover-all-show-times") || {};
  2180. o.className = "_th_cover-all-show-times", this.setTimeoutOrigin.bind(this.window)((function () {
  2181. o.className = "_th_cover-all-show-times _th_hidden"
  2182. }), 100)
  2183. }
  2184. }
  2185. }, {
  2186. key: "position", get: function () {
  2187. return this.getConfig("position")
  2188. }
  2189. }, {
  2190. key: "positionOffset", get: function () {
  2191. return this.getConfig("positionOffset")
  2192. }
  2193. }, {
  2194. key: "declareConfigs", value: function () {
  2195. return [{key: "position", type: f.STRING, default: "left"}, {
  2196. key: "positionOffset",
  2197. type: f.STRING,
  2198. default: "20%"
  2199. }, {
  2200. key: "showSuspendedBall",
  2201. type: f.BOOLEAN,
  2202. default: !0,
  2203. title: "Show Suspended Ball"
  2204. }, {key: "deeplyColor", type: f.BOOLEAN, default: !0, title: "Deeply Color"}]
  2205. }
  2206. }]), a
  2207. }(H), ee = new F;
  2208. return ee.exportOuter(), ee.registerModule(new Qt(new Xt)), ee.registerModule(new Ht), ee.registerModule(new Ft), ee.registerModule(new Tt), ee.registerModule(new jt), ee.registerModule(new Kt), ee.registerModule(new Lt, !0), ee.registerModule(new te, !0), ee.bootstrap(), ee
  2209. }));
  2210. if (window.performance) window.performance.now = Date.now;
  2211. }
  2212.  
  2213. // 使用setTimeout来延迟执行函数
  2214. setTimeout(delayedFunction, 3000);
  2215. })();