Flow Youtube Chat

Youtubeのチャットをニコニコ風に画面上へ流すスクリプトです(再アップ,絵文字バグ修正済み)

目前为 2021-02-18 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Flow Youtube Chat
  3. // @version 1.14.7
  4. // @description Youtubeのチャットをニコニコ風に画面上へ流すスクリプトです(再アップ,絵文字バグ修正済み)
  5. // @match https://www.youtube.com/*
  6. // @namespace FlowYoutubeChatScript
  7. // @run-at document-end
  8. // @grant GM.setValue
  9. // @grant GM.getValue
  10. // @grant GM.deleteValue
  11. // @grant GM.listValues
  12. // @noframes
  13. // @license AGPL-3.0-or-later
  14. // @require https://cdn.jsdelivr.net/npm/sweetalert2@10.10.1/dist/sweetalert2.all.min.js#sha384-OCBhaEdUu7BFgaeRVey2PDeHof2MSQRFe/e6S8Q3XrmSV7wrKpLmhPj8FOldGiaF
  15. // @require https://unpkg.com/loglevel@1.7.0/dist/loglevel.min.js#sha384-7gGuWfek8Ql6j/uNDFrS0BCe4x2ZihD4B68w9Eu580OVHJBV+bl3rZmEWC7q5/Gj
  16. // @require https://unpkg.com/rxjs@7.0.0-beta.10/dist/bundles/rxjs.umd.min.js#sha384-+BwV2u+ZJFwj586/3PlpsZdYS1U/+hT/zpjYSznHH4XzUJqgshDzZITJ+zGeWl//
  17. // @require https://unpkg.com/mithril@2.0.4/mithril.min.js#sha384-vo9crXih40MlEv6JWHqS7SsPiFp+76csaWQFOF2UU0/xI58Jm/ZvK/1UtpaicJT9
  18. // @require https://cdn.jsdelivr.net/npm/check-types@11.1.2/src/check-types.min.js#sha384-KGnImnhVjA5llfqKEbjBiY+1Mp6oa+NvW/TEY1XTPAKWNgrAwa3Qvn//MXL07wBM
  19. // ==/UserScript==
  20.  
  21. /* jshint esversion: 6 */
  22.  
  23. ;(() => {
  24. var __webpack_modules__ = {
  25. 228: module => {
  26. "use strict"
  27. const createAbortError = () => {
  28. const error = new Error("Delay aborted")
  29. return (error.name = "AbortError"), error
  30. },
  31. createDelay = ({
  32. clearTimeout: defaultClear,
  33. setTimeout: set,
  34. willResolve,
  35. }) => (ms, { value, signal } = {}) => {
  36. if (signal && signal.aborted)
  37. return Promise.reject(createAbortError())
  38. let timeoutId, settle, rejectFn
  39. const clear = defaultClear || clearTimeout,
  40. signalListener = () => {
  41. clear(timeoutId), rejectFn(createAbortError())
  42. },
  43. delayPromise = new Promise((resolve, reject) => {
  44. ;(settle = () => {
  45. signal && signal.removeEventListener("abort", signalListener),
  46. willResolve ? resolve(value) : reject(value)
  47. }),
  48. (rejectFn = reject),
  49. (timeoutId = (set || setTimeout)(settle, ms))
  50. })
  51. return (
  52. signal &&
  53. signal.addEventListener("abort", signalListener, { once: !0 }),
  54. (delayPromise.clear = () => {
  55. clear(timeoutId), (timeoutId = null), settle()
  56. }),
  57. delayPromise
  58. )
  59. },
  60. delay = createDelay({ willResolve: !0 })
  61. ;(delay.reject = createDelay({ willResolve: !1 })),
  62. (delay.range = (minimum, maximum, options) =>
  63. delay(
  64. ((minimum, maximum) =>
  65. Math.floor(Math.random() * (maximum - minimum + 1) + minimum))(
  66. minimum,
  67. maximum
  68. ),
  69. options
  70. )),
  71. (delay.createWithTimers = ({ clearTimeout, setTimeout }) => {
  72. const delay = createDelay({
  73. clearTimeout,
  74. setTimeout,
  75. willResolve: !0,
  76. })
  77. return (
  78. (delay.reject = createDelay({
  79. clearTimeout,
  80. setTimeout,
  81. willResolve: !1,
  82. })),
  83. delay
  84. )
  85. }),
  86. (module.exports = delay),
  87. (module.exports.default = delay)
  88. },
  89. 238: module => {
  90. function monadic(fn, cache, serializer, arg) {
  91. var value,
  92. cacheKey =
  93. null == (value = arg) ||
  94. "number" == typeof value ||
  95. "boolean" == typeof value
  96. ? arg
  97. : serializer(arg),
  98. computedValue = cache.get(cacheKey)
  99. return (
  100. void 0 === computedValue &&
  101. ((computedValue = fn.call(this, arg)),
  102. cache.set(cacheKey, computedValue)),
  103. computedValue
  104. )
  105. }
  106. function variadic(fn, cache, serializer) {
  107. var args = Array.prototype.slice.call(arguments, 3),
  108. cacheKey = serializer(args),
  109. computedValue = cache.get(cacheKey)
  110. return (
  111. void 0 === computedValue &&
  112. ((computedValue = fn.apply(this, args)),
  113. cache.set(cacheKey, computedValue)),
  114. computedValue
  115. )
  116. }
  117. function assemble(fn, context, strategy, cache, serialize) {
  118. return strategy.bind(context, fn, cache, serialize)
  119. }
  120. function strategyDefault(fn, options) {
  121. return assemble(
  122. fn,
  123. this,
  124. 1 === fn.length ? monadic : variadic,
  125. options.cache.create(),
  126. options.serializer
  127. )
  128. }
  129. function serializerDefault() {
  130. return JSON.stringify(arguments)
  131. }
  132. function ObjectWithoutPrototypeCache() {
  133. this.cache = Object.create(null)
  134. }
  135. ;(ObjectWithoutPrototypeCache.prototype.has = function (key) {
  136. return key in this.cache
  137. }),
  138. (ObjectWithoutPrototypeCache.prototype.get = function (key) {
  139. return this.cache[key]
  140. }),
  141. (ObjectWithoutPrototypeCache.prototype.set = function (key, value) {
  142. this.cache[key] = value
  143. })
  144. var cacheDefault = {
  145. create: function () {
  146. return new ObjectWithoutPrototypeCache()
  147. },
  148. }
  149. ;(module.exports = function (fn, options) {
  150. var cache = options && options.cache ? options.cache : cacheDefault,
  151. serializer =
  152. options && options.serializer
  153. ? options.serializer
  154. : serializerDefault
  155. return (options && options.strategy
  156. ? options.strategy
  157. : strategyDefault)(fn, { cache, serializer })
  158. }),
  159. (module.exports.strategies = {
  160. variadic: function (fn, options) {
  161. return assemble(
  162. fn,
  163. this,
  164. variadic,
  165. options.cache.create(),
  166. options.serializer
  167. )
  168. },
  169. monadic: function (fn, options) {
  170. return assemble(
  171. fn,
  172. this,
  173. monadic,
  174. options.cache.create(),
  175. options.serializer
  176. )
  177. },
  178. })
  179. },
  180. },
  181. __webpack_module_cache__ = {}
  182. function __webpack_require__(moduleId) {
  183. if (__webpack_module_cache__[moduleId])
  184. return __webpack_module_cache__[moduleId].exports
  185. var module = (__webpack_module_cache__[moduleId] = { exports: {} })
  186. return (
  187. __webpack_modules__[moduleId](
  188. module,
  189. module.exports,
  190. __webpack_require__
  191. ),
  192. module.exports
  193. )
  194. }
  195. ;(__webpack_require__.n = module => {
  196. var getter =
  197. module && module.__esModule ? () => module.default : () => module
  198. return __webpack_require__.d(getter, { a: getter }), getter
  199. }),
  200. (__webpack_require__.d = (exports, definition) => {
  201. for (var key in definition)
  202. __webpack_require__.o(definition, key) &&
  203. !__webpack_require__.o(exports, key) &&
  204. Object.defineProperty(exports, key, {
  205. enumerable: !0,
  206. get: definition[key],
  207. })
  208. }),
  209. (__webpack_require__.o = (obj, prop) =>
  210. Object.prototype.hasOwnProperty.call(obj, prop)),
  211. (() => {
  212. "use strict"
  213. const external_log_namespaceObject = log
  214. var external_log_default = __webpack_require__.n(
  215. external_log_namespaceObject
  216. )
  217. const lib = observer => value => {
  218. observer.next(value)
  219. },
  220. external_rxjs_namespaceObject = rxjs,
  221. external_rxjs_operators_namespaceObject = rxjs.operators,
  222. addMainCss = () => {
  223. let styleHtml = ""
  224. ;(styleHtml +=
  225. ".fyc_chat {\n line-height: 1;\n z-index: 30;\n position: absolute;\n user-select: none;\n white-space: nowrap;\n will-change: transform;\n }"),
  226. (styleHtml +=
  227. ".fyc_chat > img {\n vertical-align: text-top;\n }"),
  228. (styleHtml +=
  229. ".fyc_button {\n display: inline-block;\n border-style: none;\n z-index: 4;\n font-weight: 500;\n color: var(--yt-spec-text-secondary);\n }"),
  230. external_log_default().debug("AppendCss")
  231. const existedElement = document.querySelector(".fyc_style"),
  232. styleElement =
  233. null != existedElement
  234. ? existedElement
  235. : document.createElement("style")
  236. existedElement ||
  237. (document.head.append(styleElement),
  238. styleElement.classList.add(".fyc_style")),
  239. (styleElement.innerHTML =
  240. ".fyc_chat {\n line-height: 1;\n z-index: 30;\n position: absolute;\n user-select: none;\n white-space: nowrap;\n will-change: transform;\n }.fyc_chat > img {\n vertical-align: text-top;\n }.fyc_button {\n display: inline-block;\n border-style: none;\n z-index: 4;\n font-weight: 500;\n color: var(--yt-spec-text-secondary);\n }")
  241. },
  242. external_m_namespaceObject = m
  243. var external_m_default = __webpack_require__.n(external_m_namespaceObject)
  244. const external_Swal_namespaceObject = Swal
  245. var external_Swal_default = __webpack_require__.n(
  246. external_Swal_namespaceObject
  247. )
  248. const logFyc = (...x) =>
  249. external_log_default().info(`【FYC ${x.toString()}`),
  250. createBanButton = (chat, id, userConfig) => {
  251. var _a, _b
  252. if (chat.children.namedItem("card")) return
  253. const button = document.createElement("button")
  254. button.classList.add(
  255. "style-scope",
  256. "yt-icon-button",
  257. "fyc_button",
  258. "fyc_ngbutton"
  259. ),
  260. (button.style.padding = "0px"),
  261. (button.style.width = "20px"),
  262. (button.style.height = "20px"),
  263. (button.style.fill = "#fff"),
  264. button.setAttribute("aria-label", "NGに入れる"),
  265. (button.innerHTML =
  266. '<div style="width: 100%; height: 75%;fill: var(--yt-spec-text-secondary);"><svg class="style-scope yt-icon" width="100%" height="100%" version="1.1" viewBox="0 0 512 512" x="0px" y="0px"><path d="m437.02 74.977c-99.984-99.969-262.06-99.969-362.05 0-99.969 99.984-99.969 262.06 0 362.05 99.969 99.969 262.08 99.969 362.05 0s99.969-262.08 0-362.05zm-299.81 62.234c54.391-54.391 137.02-63.453 201.02-27.531l-228.55 228.55c-35.922-64-26.86-146.62 27.531-201.02zm237.59 237.58c-54.391 54.391-137.03 63.469-201.03 27.547l228.56-228.56c35.921 64 26.843 146.64-27.532 201.02z" fill-rule="evenodd"></path></svg></div>'),
  267. (button.onclick = () => {
  268. logFyc(`Added to Banned Users: ${id}`),
  269. userConfig.bannedUsers.set([
  270. ...userConfig.bannedUsers.get().slice(),
  271. id,
  272. ]),
  273. external_m_default().redraw(),
  274. (chat.style.display = "none"),
  275. external_Swal_default()
  276. .mixin({
  277. toast: !0,
  278. position: "bottom-left",
  279. timer: 2500,
  280. timerProgressBar: !0,
  281. showConfirmButton: !1,
  282. didOpen: toast => {
  283. toast.addEventListener(
  284. "mouseenter",
  285. external_Swal_default().stopTimer
  286. ),
  287. toast.addEventListener(
  288. "mouseleave",
  289. external_Swal_default().resumeTimer
  290. )
  291. },
  292. })
  293. .fire({ title: `Added Banned User: ${id}`, icon: "success" })
  294. }),
  295. external_log_default().debug("AppendNgButton"),
  296. null ===
  297. (_b =
  298. null === (_a = chat.querySelector("#content")) || void 0 === _a
  299. ? void 0
  300. : _a.querySelector("#message")) ||
  301. void 0 === _b ||
  302. _b.append(button)
  303. }
  304. var src = __webpack_require__(238),
  305. src_default = __webpack_require__.n(src)
  306. function function_pipe(
  307. a,
  308. ab,
  309. bc,
  310. cd,
  311. de,
  312. ef,
  313. fg,
  314. gh,
  315. hi,
  316. ij,
  317. jk,
  318. kl,
  319. lm,
  320. mn,
  321. no,
  322. op,
  323. pq,
  324. qr,
  325. rs,
  326. st
  327. ) {
  328. switch (arguments.length) {
  329. case 1:
  330. return a
  331. case 2:
  332. return ab(a)
  333. case 3:
  334. return bc(ab(a))
  335. case 4:
  336. return cd(bc(ab(a)))
  337. case 5:
  338. return de(cd(bc(ab(a))))
  339. case 6:
  340. return ef(de(cd(bc(ab(a)))))
  341. case 7:
  342. return fg(ef(de(cd(bc(ab(a))))))
  343. case 8:
  344. return gh(fg(ef(de(cd(bc(ab(a)))))))
  345. case 9:
  346. return hi(gh(fg(ef(de(cd(bc(ab(a))))))))
  347. case 10:
  348. return ij(hi(gh(fg(ef(de(cd(bc(ab(a)))))))))
  349. case 11:
  350. return jk(ij(hi(gh(fg(ef(de(cd(bc(ab(a))))))))))
  351. case 12:
  352. return kl(jk(ij(hi(gh(fg(ef(de(cd(bc(ab(a)))))))))))
  353. case 13:
  354. return lm(kl(jk(ij(hi(gh(fg(ef(de(cd(bc(ab(a))))))))))))
  355. case 14:
  356. return mn(lm(kl(jk(ij(hi(gh(fg(ef(de(cd(bc(ab(a)))))))))))))
  357. case 15:
  358. return no(mn(lm(kl(jk(ij(hi(gh(fg(ef(de(cd(bc(ab(a))))))))))))))
  359. case 16:
  360. return op(no(mn(lm(kl(jk(ij(hi(gh(fg(ef(de(cd(bc(ab(a)))))))))))))))
  361. case 17:
  362. return pq(
  363. op(no(mn(lm(kl(jk(ij(hi(gh(fg(ef(de(cd(bc(ab(a)))))))))))))))
  364. )
  365. case 18:
  366. return qr(
  367. pq(op(no(mn(lm(kl(jk(ij(hi(gh(fg(ef(de(cd(bc(ab(a))))))))))))))))
  368. )
  369. case 19:
  370. return rs(
  371. qr(
  372. pq(
  373. op(no(mn(lm(kl(jk(ij(hi(gh(fg(ef(de(cd(bc(ab(a)))))))))))))))
  374. )
  375. )
  376. )
  377. case 20:
  378. return st(
  379. rs(
  380. qr(
  381. pq(
  382. op(
  383. no(mn(lm(kl(jk(ij(hi(gh(fg(ef(de(cd(bc(ab(a))))))))))))))
  384. )
  385. )
  386. )
  387. )
  388. )
  389. }
  390. }
  391. var isNone = function (fa) {
  392. return "None" === fa._tag
  393. },
  394. none = { _tag: "None" },
  395. some = function (a) {
  396. return { _tag: "Some", value: a }
  397. }
  398. var getOrElse = function (onNone) {
  399. return function (ma) {
  400. return isNone(ma) ? onNone() : ma.value
  401. }
  402. }
  403. var empty = []
  404. const getChatLane = (
  405. flowChat,
  406. progress,
  407. flowChats,
  408. mainState,
  409. userConfig
  410. ) => {
  411. const chatIndex = flowChats.indexOf(flowChat),
  412. playerWidth = mainState.playerRect.width,
  413. playerX = mainState.playerRect.x,
  414. chatRect = flowChat.element.getBoundingClientRect(),
  415. chatWidth = chatRect.width,
  416. chatX = progress ? chatRect.x - playerX : playerWidth,
  417. movingChats = (function (as) {
  418. var l = as.length
  419. if (0 === l) return empty
  420. for (var ras = Array(l), i = 0; i < l; i++) ras[i] = as[i]
  421. return ras
  422. })(
  423. flowChats
  424. .slice(0, chatIndex >= 0 ? chatIndex : void 0)
  425. .filter(chat => !chat.animationEnded)
  426. .sort((a, b) => a.lane - b.lane)
  427. ),
  428. tooCloseTo = src_default()(i => {
  429. const otherRect = movingChats[i].element.getBoundingClientRect(),
  430. otherWidth = otherRect.width,
  431. otherX = otherRect.x - playerX,
  432. gap = (otherWidth * chatWidth) ** 0.5 / 3.5
  433. return (
  434. (playerWidth - otherX) / (playerWidth + otherWidth) - progress <
  435. (chatWidth + gap) / (playerWidth + chatWidth) ||
  436. otherX + otherWidth + gap > chatX
  437. )
  438. }),
  439. occupyInfo = [
  440. ...movingChats.map((x, i) => ({
  441. tooClose: () => tooCloseTo(i),
  442. lane: x.lane,
  443. })),
  444. { tooClose: () => !0, lane: userConfig.laneCount.get() },
  445. ],
  446. index = occupyInfo.findIndex(x => x.lane >= flowChat.lane),
  447. rightFreeLane = occupyInfo
  448. .slice(index)
  449. .findIndex(x => x.tooClose()),
  450. leftFreeLane = function_pipe(
  451. occupyInfo.slice(0, index),
  452. ((predicate = x => x.tooClose()),
  453. function (as) {
  454. for (var i = as.length - 1; i >= 0; i--)
  455. if (predicate(as[i])) return some(i)
  456. return none
  457. }),
  458. getOrElse(() => -1)
  459. )
  460. var predicate
  461. let formerLaneInterval = 0
  462. leftFreeLane < flowChat.lane &&
  463. flowChat.lane < rightFreeLane &&
  464. (formerLaneInterval = Math.min(
  465. Math.max(
  466. formerLaneInterval,
  467. Math.min(
  468. flowChat.lane - leftFreeLane,
  469. rightFreeLane - flowChat.lane
  470. )
  471. ),
  472. 1
  473. ))
  474. let maxInterval = 0,
  475. maxIntervalLane = 0,
  476. lastLane = -1
  477. for (let i = 0; i < occupyInfo.length; i += 1)
  478. if (occupyInfo[i].tooClose()) {
  479. const nextLane = occupyInfo[i].lane,
  480. interLane = Math.min(
  481. Math.max((lastLane + nextLane) / 2, 0),
  482. userConfig.laneCount.get() - 1
  483. ),
  484. newInterval = Math.min(
  485. interLane - lastLane,
  486. nextLane - interLane,
  487. 1
  488. )
  489. if (
  490. newInterval - maxInterval > 0.001 &&
  491. ((maxIntervalLane = Math.max(lastLane + newInterval, 0)),
  492. (maxInterval = newInterval),
  493. maxInterval > 0.999)
  494. )
  495. break
  496. lastLane = nextLane
  497. }
  498. return {
  499. lane:
  500. Math.abs(formerLaneInterval - maxInterval) < 0.001
  501. ? flowChat.lane
  502. : maxIntervalLane,
  503. interval: maxInterval,
  504. }
  505. },
  506. setChatPlayState = (flowChat, mainState, userConfig) => {
  507. !flowChat.animationEnded &&
  508. flowChat.animation &&
  509. (mainState.chatPlaying
  510. ? flowChat.animation.play()
  511. : flowChat.animation.pause(),
  512. (flowChat.animation.playbackRate = userConfig.flowSpeed.get() / 15))
  513. },
  514. setChatAnimation = (flowChat, flowChats, mainState, userConfig) => {
  515. var _a, _b, _c
  516. if (flowChat.animationEnded) return !1
  517. const time =
  518. null !==
  519. (_b =
  520. null === (_a = flowChat.animation) || void 0 === _a
  521. ? void 0
  522. : _a.currentTime) && void 0 !== _b
  523. ? _b
  524. : void 0,
  525. progress = void 0 !== time ? time / flowChat.animationDuration : 0,
  526. { lane, interval } = getChatLane(
  527. flowChat,
  528. progress,
  529. flowChats,
  530. mainState,
  531. userConfig
  532. )
  533. if (userConfig.noOverlap.get() && interval < 0.999)
  534. return (
  535. null === (_c = flowChat.animation) ||
  536. void 0 === _c ||
  537. _c.finish(),
  538. (flowChat.animation = void 0),
  539. !1
  540. )
  541. flowChat.lane = lane
  542. const laneY = ((lane, mainState, userConfig) => {
  543. const laneCount = userConfig.laneCount.get(),
  544. laneR = lane % (2 * laneCount - 1),
  545. playerHeight = mainState.playerRect.height
  546. return (
  547. Math.round(
  548. 100 *
  549. (laneR < laneCount
  550. ? (playerHeight * (laneR % laneCount)) / laneCount + 4
  551. : playerHeight *
  552. ((laneR % laneCount) / laneCount + 1 / (2 * laneCount)))
  553. ) / 100
  554. )
  555. })(flowChat.lane, mainState, userConfig)
  556. flowChat.animation && flowChat.animation.cancel(),
  557. (flowChat.animationDuration = 6400),
  558. (flowChat.animation = flowChat.element.animate(
  559. [
  560. {
  561. transform: `translate(${mainState.playerRect.width}px, ${laneY}px)`,
  562. },
  563. {
  564. transform: `translate(${-flowChat.element.getBoundingClientRect()
  565. .width}px, ${laneY}px)`,
  566. },
  567. ],
  568. { duration: 6400, easing: userConfig.timingFunction.get() }
  569. )),
  570. (flowChat.animation.onfinish = () => {
  571. flowChat.animationEnded = !0
  572. })
  573. const newTime = void 0 !== time ? 6400 * progress : 0
  574. return (
  575. (flowChat.animation.currentTime = newTime),
  576. setChatPlayState(flowChat, mainState, userConfig),
  577. !0
  578. )
  579. },
  580. setChatStyle = (flowChat, mainState, userConfig) => {
  581. const fontSize = ((mainState, userConfig) =>
  582. Math.round(
  583. Math.max(userConfig.fontSize.get() - 0.2, 0.01) *
  584. (mainState.playerRect.height / userConfig.laneCount.get()) *
  585. 100
  586. ) / 100)(mainState, userConfig),
  587. { style } = flowChat.element
  588. ;(style.visibility = userConfig.displayChats.get()
  589. ? "visible"
  590. : "hidden"),
  591. (style.color =
  592. "owner" === flowChat.authorType
  593. ? userConfig.ownerColor.get()
  594. : "moderator" === flowChat.authorType
  595. ? userConfig.moderatorColor.get()
  596. : "member" === flowChat.authorType
  597. ? userConfig.memberColor.get()
  598. : userConfig.color.get()),
  599. (style.fontSize = `${fontSize}px`),
  600. (style.fontWeight = userConfig.fontWeight.get().toString()),
  601. (style.fontFamily = userConfig.font.get()),
  602. (style.opacity = userConfig.chatOpacity.get().toString())
  603. const offset = userConfig.shadowFontWeight.get()
  604. ;(style.textShadow = `-${offset}px -${offset}px #0009, ${offset}px -${offset}px #0009, -${offset}px ${offset}px #0009, ${offset}px ${offset}px #0009`),
  605. (style.transform = `translate(${mainState.playerRect.width}px)`)
  606. },
  607. assert_lib = check.assert,
  608. tapNonNull = x => (assert_lib(null != x), x),
  609. parseMessage = (lengthBefore, message, userConfig) => {
  610. const maxChatLength = userConfig.maxChatLength.get(),
  611. vnodes = []
  612. let semantic = "",
  613. length = lengthBefore
  614. return (
  615. message.innerHTML.split(/(?=<img )|">/g).some(part => {
  616. if (part.match(/^<img /)) {
  617. if (!userConfig.textOnly.get()) {
  618. const srcMatch = part.match(
  619. /<img\s.*?src=(?:'|")([^'">]+)(?:'|")/
  620. ),
  621. altMatch = part.match(
  622. /<img\s.*?alt=(?:'|")([^'">]+)(?:'|")/
  623. ),
  624. src =
  625. null == srcMatch ? void 0 : srcMatch[srcMatch.length - 1],
  626. alt =
  627. null == altMatch ? void 0 : altMatch[altMatch.length - 1]
  628. vnodes.push(
  629. external_m_default()("img", {
  630. style: { height: "1em", width: "1em" },
  631. src,
  632. alt,
  633. })
  634. ),
  635. (semantic += `<img alt="${null != alt ? alt : ""}">`),
  636. (length += 1)
  637. }
  638. } else {
  639. const text =
  640. part.length >= maxChatLength
  641. ? part.substr(0, maxChatLength)
  642. : part
  643. vnodes.push(external_m_default().fragment({}, text)),
  644. (semantic += text),
  645. (length += text.length)
  646. }
  647. return length >= maxChatLength
  648. }),
  649. { vnodes, semantic, length }
  650. )
  651. },
  652. chatFieldObserver = (chatScrn, flowChats, mainState, userConfig) =>
  653. new MutationObserver(mutations => {
  654. mutations.forEach(e => {
  655. Array.from(e.addedNodes)
  656. .filter(x => x.children.length > 0)
  657. .forEach(chat => {
  658. var _a
  659. const chatData = ((chat, userConfig) => {
  660. let semantic = "",
  661. length = 0
  662. const vnodes = []
  663. let authorID
  664. const authorType = chat.querySelector(".owner")
  665. ? "owner"
  666. : chat.querySelector(".moderator")
  667. ? "moderator"
  668. : chat.querySelector(".member")
  669. ? "member"
  670. : "normal"
  671. return (
  672. Array.from(chat.children).forEach(child => {
  673. var _a, _b, _c, _d
  674. const childID = child.id,
  675. message = child.querySelector("#message"),
  676. authorName = child.querySelector("#author-name")
  677. if ("content" === childID) {
  678. if (
  679. (chat.querySelector(".moderator") &&
  680. userConfig.displayModName.get() &&
  681. vnodes.push(
  682. external_m_default()(
  683. "span",
  684. { style: { fontSize: "smaller" } },
  685. `${
  686. null !==
  687. (_a =
  688. null == authorName
  689. ? void 0
  690. : authorName.innerText) &&
  691. void 0 !== _a
  692. ? _a
  693. : ""
  694. }: `
  695. )
  696. ),
  697. message)
  698. ) {
  699. const result = parseMessage(
  700. length,
  701. message,
  702. userConfig
  703. )
  704. vnodes.push(...result.vnodes),
  705. (semantic += result.semantic),
  706. (length += result.length)
  707. }
  708. } else if ("author-photo" === childID) {
  709. const matches = (null !==
  710. (_c =
  711. null === (_b = child.lastElementChild) ||
  712. void 0 === _b
  713. ? void 0
  714. : _b.getAttribute("src")) && void 0 !== _c
  715. ? _c
  716. : ""
  717. ).match(/ytc\/(.*)=/)
  718. authorID =
  719. null == matches
  720. ? void 0
  721. : matches[matches.length - 1]
  722. } else if ("card" === childID) {
  723. const normalChat = child.matches(
  724. [
  725. ".style-scope",
  726. ".yt-live-chat-paid-message-renderer",
  727. ].join("")
  728. ),
  729. stickerChat = child.matches(
  730. [
  731. ".style-scope",
  732. ".yt-live-chat-paid-sticker-renderer",
  733. ].join("")
  734. )
  735. if (normalChat || stickerChat) {
  736. const paidAmount = tapNonNull(
  737. child.querySelector("#purchase-amount") ||
  738. child.querySelector("#purchase-amount-chip")
  739. )
  740. authorID = void 0
  741. const headerColor = normalChat
  742. ? window
  743. .getComputedStyle(
  744. tapNonNull(
  745. child.querySelector("#header")
  746. )
  747. )
  748. .getPropertyValue("background-color")
  749. : window
  750. .getComputedStyle(chat)
  751. .getPropertyValue(
  752. "--yt-live-chat-paid-sticker-chip-background-color"
  753. ),
  754. paidColor = normalChat
  755. ? window
  756. .getComputedStyle(
  757. tapNonNull(
  758. child.querySelector("#content")
  759. )
  760. )
  761. .getPropertyValue("background-color")
  762. : window
  763. .getComputedStyle(chat)
  764. .getPropertyValue(
  765. "--yt-live-chat-paid-sticker-background-color"
  766. )
  767. if (
  768. (userConfig.displaySuperChatAuthor.get() &&
  769. vnodes.push(
  770. external_m_default()(
  771. "span",
  772. {
  773. style: {
  774. color: headerColor,
  775. fontSize: "smaller",
  776. fontFamily: "inherit",
  777. },
  778. },
  779. `${
  780. null !==
  781. (_d =
  782. null == authorName
  783. ? void 0
  784. : authorName.innerText) &&
  785. void 0 !== _d
  786. ? _d
  787. : ""
  788. }: `
  789. )
  790. ),
  791. normalChat && message)
  792. ) {
  793. const result = parseMessage(
  794. length,
  795. message,
  796. userConfig
  797. )
  798. vnodes.push(
  799. external_m_default()(
  800. "span",
  801. {
  802. style: {
  803. color: headerColor,
  804. fontFamily: "inherit",
  805. },
  806. },
  807. result.vnodes
  808. )
  809. ),
  810. (semantic += result.semantic),
  811. (length += result.length)
  812. }
  813. ;(length += paidAmount.innerText.length),
  814. vnodes.push(
  815. external_m_default()(
  816. "span",
  817. {
  818. style: {
  819. color: paidColor,
  820. fontSize: "smaller",
  821. fontFamily: "inherit",
  822. },
  823. },
  824. external_m_default()(
  825. "strong",
  826. { style: { fontFamily: "inherit" } },
  827. paidAmount.innerText
  828. )
  829. )
  830. )
  831. }
  832. }
  833. }),
  834. { vnodes, semantic, authorType, authorID }
  835. )
  836. })(chat, userConfig),
  837. semanticTextContent =
  838. null !==
  839. (_a = new DOMParser().parseFromString(
  840. `<span>${chatData.semantic}<span>`,
  841. "text/html"
  842. ).body.textContent) && void 0 !== _a
  843. ? _a
  844. : ""
  845. ;((content, userConfig) =>
  846. userConfig.bannedWords
  847. .get()
  848. .some(
  849. word =>
  850. !!content.includes(word) &&
  851. (external_log_default().debug(
  852. `Banned Word: "${word}" in "${content}"`
  853. ),
  854. !0)
  855. ))(semanticTextContent, userConfig) ||
  856. ((content, userConfig) =>
  857. userConfig.bannedWordRegexs.get().some(word => {
  858. const result = content.match(RegExp(word, "u"))
  859. return (
  860. !!result &&
  861. (external_log_default().debug(
  862. `Banned Word: "${result.toString()}" in "${content}"`
  863. ),
  864. !0)
  865. )
  866. }))(semanticTextContent, userConfig) ||
  867. (void 0 !== chatData.authorID &&
  868. ((authorID, userConfig) =>
  869. userConfig.bannedUsers
  870. .get()
  871. .some(
  872. user =>
  873. !!authorID.includes(user) &&
  874. (external_log_default().debug(
  875. `Banned User: "${user}" in "${authorID}"`
  876. ),
  877. !0)
  878. ))(chatData.authorID, userConfig))
  879. ? (chat.style.display = "none")
  880. : (userConfig.createChats.get() &&
  881. ((
  882. chatData,
  883. flowChats,
  884. chatScrn,
  885. mainState,
  886. userConfig
  887. ) => {
  888. var _a
  889. let element
  890. const offScreenChatIndex = flowChats.findIndex(
  891. chat =>
  892. chat.animationEnded ||
  893. flowChats.length >= userConfig.maxChatCount.get()
  894. )
  895. if (-1 !== offScreenChatIndex) {
  896. element = flowChats[offScreenChatIndex].element
  897. const [oldChat] = flowChats.splice(
  898. offScreenChatIndex,
  899. 1
  900. )
  901. null === (_a = oldChat.animation) ||
  902. void 0 === _a ||
  903. _a.cancel()
  904. } else
  905. external_log_default().debug("CreateFlowChat"),
  906. (element = document.createElement("span")),
  907. chatScrn.append(element)
  908. element.classList.add("fyc_chat")
  909. const flowChat = {
  910. element,
  911. lane: -1,
  912. animation: void 0,
  913. animationDuration: 0,
  914. animationEnded: !1,
  915. authorType: chatData.authorType,
  916. }
  917. external_m_default().render(element, chatData.vnodes),
  918. setChatStyle(flowChat, mainState, userConfig),
  919. setChatAnimation(
  920. flowChat,
  921. flowChats,
  922. mainState,
  923. userConfig
  924. )
  925. ? flowChats.push(flowChat)
  926. : flowChat.element.remove()
  927. })(
  928. chatData,
  929. flowChats,
  930. chatScrn,
  931. mainState,
  932. userConfig
  933. ),
  934. userConfig.createBanButton.get() &&
  935. void 0 !== chatData.authorID &&
  936. !chat.querySelector(".owner") &&
  937. createBanButton(chat, chatData.authorID, userConfig),
  938. userConfig.simplifyChatField.get() &&
  939. (chat => {
  940. if (
  941. chat.querySelector(
  942. ".style-scope.yt-live-chat-paid-message-renderer"
  943. ) ||
  944. chat.querySelector(".owner")
  945. )
  946. return
  947. chat.style.borderBottom =
  948. "1px solid var(--yt-spec-text-secondary)"
  949. const authorPhoto = chat.querySelector(
  950. "#author-photo"
  951. )
  952. authorPhoto && (authorPhoto.style.display = "none")
  953. const authorChip = chat.querySelector(
  954. "yt-live-chat-author-chip.style-scope.yt-live-chat-text-message-renderer"
  955. )
  956. authorChip && (authorChip.style.display = "none")
  957. })(chat))
  958. })
  959. })
  960. }),
  961. componentMounter = (root, placeRoot) => component => {
  962. root.style.display = "contents"
  963. const success = placeRoot(root)
  964. return success && external_m_default().mount(root, component), success
  965. }
  966. class IndirectConfigItem {
  967. constructor(x) {
  968. ;(this.gmKey = x.gmKey),
  969. (this.defaultVal = x.defaultVal),
  970. (this.val = x.val),
  971. (this.toGm = x.toGm)
  972. }
  973. get() {
  974. return this.val
  975. }
  976. async set(val) {
  977. return (this.val = val), GM.setValue(this.gmKey, this.toGm(val))
  978. }
  979. }
  980. const makeConfigItem = async (gmKey, defaultVal, toItem, toGm) => {
  981. const val = await GM.getValue(gmKey)
  982. return new IndirectConfigItem({
  983. gmKey,
  984. val: void 0 !== val ? toItem(val) : defaultVal,
  985. defaultVal,
  986. toGm,
  987. })
  988. },
  989. simpleConfigItem = async (gmKey, defaultVal) => {
  990. var _a
  991. return new IndirectConfigItem({
  992. gmKey,
  993. val:
  994. null !== (_a = await GM.getValue(gmKey)) && void 0 !== _a
  995. ? _a
  996. : defaultVal,
  997. defaultVal,
  998. toGm: x => x,
  999. })
  1000. },
  1001. lineConfigArgs = [[], x => x.split(/\r\n|\n/), x => x.join("\n")],
  1002. livePage_getPlayer = () => {
  1003. var _a
  1004. return null !== (_a = document.querySelector("#movie_player")) &&
  1005. void 0 !== _a
  1006. ? _a
  1007. : void 0
  1008. },
  1009. livePage_getMainVideo = () => {
  1010. var _a
  1011. return null !==
  1012. (_a = document.querySelector(
  1013. "video.video-stream.html5-main-video"
  1014. )) && void 0 !== _a
  1015. ? _a
  1016. : void 0
  1017. },
  1018. livePage_getChatFrame = () => {
  1019. var _a
  1020. return null !== (_a = document.querySelector("#chatframe")) &&
  1021. void 0 !== _a
  1022. ? _a
  1023. : void 0
  1024. },
  1025. livePage_getChatField = () => {
  1026. var _a, _b, _c
  1027. return null !==
  1028. (_c = (null !==
  1029. (_b =
  1030. null === (_a = document.querySelector("#chatframe")) ||
  1031. void 0 === _a
  1032. ? void 0
  1033. : _a.contentDocument) && void 0 !== _b
  1034. ? _b
  1035. : document
  1036. ).querySelector(
  1037. "#items.style-scope.yt-live-chat-item-list-renderer"
  1038. )) && void 0 !== _c
  1039. ? _c
  1040. : void 0
  1041. },
  1042. livePage_getOfflineSlate = () => {
  1043. var _a
  1044. return null !== (_a = document.querySelector(".ytp-offline-slate")) &&
  1045. void 0 !== _a
  1046. ? _a
  1047. : void 0
  1048. },
  1049. removeOldChats = (flowChats, maxChatCount) => {
  1050. flowChats.sort((a, b) =>
  1051. a.animationEnded === b.animationEnded
  1052. ? 0
  1053. : a.animationEnded
  1054. ? -1
  1055. : 1
  1056. ),
  1057. flowChats
  1058. .splice(0, Math.max(0, flowChats.length - maxChatCount))
  1059. .forEach(x => {
  1060. external_log_default().debug("RemoveChat"), x.element.remove()
  1061. })
  1062. }
  1063. var delay = __webpack_require__(228),
  1064. delay_default = __webpack_require__.n(delay)
  1065. const setChatFrameCss = async () => (
  1066. await delay_default()(700),
  1067. (async (func, count, interval) => {
  1068. let exception,
  1069. succeed = !1
  1070. for (let i = 0; i < count; i += 1) {
  1071. try {
  1072. await func(i), (succeed = !0)
  1073. break
  1074. } catch (e) {
  1075. exception = e
  1076. }
  1077. external_log_default().debug("Retry"),
  1078. await delay_default()(interval)
  1079. }
  1080. if (!succeed) throw exception
  1081. })(
  1082. () => {
  1083. var _a, _b
  1084. const element =
  1085. null ===
  1086. (_b =
  1087. null === (_a = document.querySelector("#chatframe")) ||
  1088. void 0 === _a
  1089. ? void 0
  1090. : _a.contentDocument) || void 0 === _b
  1091. ? void 0
  1092. : _b.querySelector(
  1093. "#item-scroller.animated.yt-live-chat-item-list-renderer #item-offset.yt-live-chat-item-list-renderer"
  1094. )
  1095. element && (element.style.overflow = "unset")
  1096. },
  1097. 5,
  1098. 1e3
  1099. )
  1100. ),
  1101. settingPanel_option = (value, label) =>
  1102. external_m_default()("option", { value }, label),
  1103. settingRow = (label, content) =>
  1104. external_m_default()("div", [
  1105. external_m_default()("span", label),
  1106. external_m_default()("div", content),
  1107. ]),
  1108. rangeRow = (min, max, step, value, oninput) =>
  1109. external_m_default()("div", [
  1110. external_m_default()("input", {
  1111. style: { width: "150px", verticalAlign: "middle" },
  1112. type: "range",
  1113. min,
  1114. max,
  1115. step,
  1116. value,
  1117. oninput,
  1118. }),
  1119. external_m_default()("input", {
  1120. style: {
  1121. width: "30px",
  1122. backgroundColor: "transparent",
  1123. color: "inherit",
  1124. borderWidth: "1px",
  1125. verticalAlign: "middle",
  1126. },
  1127. inputmode: "decimal",
  1128. value,
  1129. onchange: oninput,
  1130. }),
  1131. ]),
  1132. checkboxRow = (label, checked, onchange) =>
  1133. external_m_default()(
  1134. "div",
  1135. external_m_default()("label", [
  1136. label,
  1137. external_m_default()("input", {
  1138. type: "checkbox",
  1139. checked,
  1140. onchange,
  1141. }),
  1142. ])
  1143. ),
  1144. getInputValue = e => {
  1145. const target = e.currentTarget
  1146. if (
  1147. target instanceof HTMLSelectElement ||
  1148. target instanceof HTMLTextAreaElement ||
  1149. target instanceof HTMLInputElement
  1150. )
  1151. return target.value
  1152. throw Error(
  1153. "Event target isn't an Input or TextArea or Input element"
  1154. )
  1155. },
  1156. getInputChecked = e => {
  1157. return ((constructor = HTMLInputElement),
  1158. (x = e.currentTarget),
  1159. assert_lib(x instanceof constructor),
  1160. x).checked
  1161. var constructor, x
  1162. },
  1163. langOptions = [
  1164. ["FYC_EN", "English"],
  1165. ["FYC_JA", "日本語"],
  1166. ],
  1167. fontOptions = [
  1168. ["", "Default", "デフォルト"],
  1169. ["arial", "Arial", "Arial"],
  1170. ["arial black", "Arial Black", "Arial Black"],
  1171. ["arial narrow", "Arial Narrow", "Arial Narrow"],
  1172. ["Century", "Century", "Century"],
  1173. ["Comic Sans MS", "Comic Sans MS", "Comic Sans MS"],
  1174. ["Courier", "Courier", "Courier"],
  1175. ["cursive", "cursive", "cursive"],
  1176. ["fantasy", "fantasy", "fantasy"],
  1177. ["Impact", "Impact", "Impact"],
  1178. ["Meiryo", "Meiryo", "メイリオ"],
  1179. ["Meiryo UI", "Meiryo UI", "メイリオ UI"],
  1180. ["monospace", "monospace", "monospace"],
  1181. ["Monotype Corsiva", "Monotype Corsiva", "Monotype Corsiva"],
  1182. ["MS PGothic", "MS PGothic", "MS Pゴシック"],
  1183. ["MS Gothic", "MS Gothic", "MS ゴシック"],
  1184. ["MS Sans Serif", "MS Sans Serif", "MS Sans Serif"],
  1185. ["MS Serif", "MS Serif", "MS Serif"],
  1186. ["MS UI Gothic", "MS UI Gothic", "MS UI Gothic"],
  1187. ["sans-serif", "Sans-serif", "Sans-serif"],
  1188. ["serif", "Serif", "Serif"],
  1189. ["Times New Roman", "Times New Roman", "Times New Roman"],
  1190. ["Yu Gothic", "Yu Gothic", "遊ゴシック"],
  1191. ["YuGothic", "YuGothic", "游ゴシック体"],
  1192. ],
  1193. settingPanel = (flowChats, mainState, state, userConfig) => {
  1194. var _a, _b
  1195. const panelState = {
  1196. bannedWordRegexs: userConfig.bannedWordRegexs.get(),
  1197. bannedWordRegexsValid: !0,
  1198. bannedWordRegexsError: "",
  1199. currentTab: 0,
  1200. timingStepCount: parseInt(
  1201. null !==
  1202. (_b =
  1203. null ===
  1204. (_a = userConfig.timingFunction
  1205. .get()
  1206. .match(/^steps\((\d+),.+/)) || void 0 === _a
  1207. ? void 0
  1208. : _a[1]) && void 0 !== _b
  1209. ? _b
  1210. : "150",
  1211. 10
  1212. ),
  1213. },
  1214. stepTiming = stepCount => `steps(${stepCount}, jump-end)`,
  1215. useStepTiming = () =>
  1216. Boolean(userConfig.timingFunction.get().match(/^steps\(.+/)),
  1217. panelBoxStyle = width => ({
  1218. flex: `0 0 ${width}px`,
  1219. margin: "2px",
  1220. }),
  1221. textAreaStyle = {
  1222. resize: "horizontal",
  1223. boxSizing: "border-box",
  1224. width: "100%",
  1225. },
  1226. textRecord = {
  1227. FYC_EN: {
  1228. font: "Font",
  1229. color: "Color(Normal)",
  1230. ownerColor: "Color(Owner)",
  1231. moderatorColor: "Color(Moderator)",
  1232. memberColor: "Color(Member)",
  1233. feedback: "Give your feedbacks here",
  1234. chatOpacity: "Opacity",
  1235. fontSize: "Size",
  1236. fontWeight: "Weight",
  1237. shadowFontWeight: "Weight(Shadow)",
  1238. flowSpeed: "Speed",
  1239. maxChatCount: "Max number of chats",
  1240. maxChatLength: "Max number of characters",
  1241. laneCount: "Number of rows",
  1242. bannedWords: "Banned Words",
  1243. bannedWordRegexs: "Banned Words(Regex)",
  1244. bannedUsers: "Banned Users",
  1245. simplifyChatField: "Simplify",
  1246. createBanButton: "Show ban button",
  1247. displayModName: "Show moderator's name",
  1248. displaySuperChatAuthor: "Show super chat author",
  1249. createChats: "Display flowing chats",
  1250. textOnly: "Text only(ignore emojis)",
  1251. error: "Error",
  1252. video: "Video",
  1253. chatField: "Chat Window",
  1254. useStepTiming: "Move chat in steps",
  1255. timingStepCount: "└Step Count",
  1256. chatFilter: "Chat Filter",
  1257. flowChat: "Flow Chat",
  1258. clearFlowChats: "Clear Flowing Chats",
  1259. flowNewChatIf:
  1260. "A new chat will appear if all of the followings are met:",
  1261. noOverlap: "└Chats won't overlap",
  1262. },
  1263. FYC_JA: {
  1264. font: "フォント",
  1265. color: "色(通常)",
  1266. ownerColor: "色(オーナー)",
  1267. moderatorColor: "色(モデレーター)",
  1268. memberColor: "色(メンバー)",
  1269. feedback: "バグ報告、要望はこちら",
  1270. chatOpacity: "不透明度",
  1271. fontSize: "サイズ",
  1272. fontWeight: "太さ",
  1273. shadowFontWeight: "太さ(影)",
  1274. flowSpeed: "速度",
  1275. maxChatCount: "最大表示数",
  1276. maxChatLength: "最大文字数",
  1277. laneCount: "行数",
  1278. bannedWords: "NGワード",
  1279. bannedWordRegexs: "NGワード(正規表現)",
  1280. bannedUsers: "NGユーザー",
  1281. simplifyChatField: "簡略化する",
  1282. createBanButton: "NGボタンを表示する",
  1283. displayModName: "モデレータの名前を表示する",
  1284. displaySuperChatAuthor: "スパチャの作成者を表示する",
  1285. createChats: "チャットを流す",
  1286. textOnly: "文字のみ(絵文字を無視する)",
  1287. error: "エラー",
  1288. video: "画面",
  1289. chatField: "チャット欄",
  1290. useStepTiming: "チャットを段階的に動かす",
  1291. timingStepCount: "└段階数",
  1292. chatFilter: "チャットフィルター",
  1293. flowChat: "チャット流れ",
  1294. clearFlowChats: "流れるチャットをクリアする",
  1295. flowNewChatIf:
  1296. "新しいチャットは以下のすべてを満たす場合に流れます:",
  1297. noOverlap: "└他のチャットと重ならない",
  1298. },
  1299. },
  1300. getLang = () => textRecord[userConfig.lang.get()],
  1301. ss = {
  1302. str: {
  1303. lang: new external_rxjs_namespaceObject.Subject(),
  1304. font: new external_rxjs_namespaceObject.Subject(),
  1305. color: new external_rxjs_namespaceObject.Subject(),
  1306. ownerColor: new external_rxjs_namespaceObject.Subject(),
  1307. moderatorColor: new external_rxjs_namespaceObject.Subject(),
  1308. memberColor: new external_rxjs_namespaceObject.Subject(),
  1309. },
  1310. num: {
  1311. chatOpacity: new external_rxjs_namespaceObject.Subject(),
  1312. fontSize: new external_rxjs_namespaceObject.Subject(),
  1313. fontWeight: new external_rxjs_namespaceObject.Subject(),
  1314. shadowFontWeight: new external_rxjs_namespaceObject.Subject(),
  1315. flowSpeed: new external_rxjs_namespaceObject.Subject(),
  1316. },
  1317. int: {
  1318. maxChatCount: new external_rxjs_namespaceObject.Subject(),
  1319. maxChatLength: new external_rxjs_namespaceObject.Subject(),
  1320. laneCount: new external_rxjs_namespaceObject.Subject(),
  1321. },
  1322. tabChange: new external_rxjs_namespaceObject.Subject(),
  1323. bannedWords: new external_rxjs_namespaceObject.Subject(),
  1324. bannedWordRegexs: new external_rxjs_namespaceObject.Subject(),
  1325. bannedUsers: new external_rxjs_namespaceObject.Subject(),
  1326. bl: {
  1327. createChats: new external_rxjs_namespaceObject.Subject(),
  1328. textOnly: new external_rxjs_namespaceObject.Subject(),
  1329. displayModName: new external_rxjs_namespaceObject.Subject(),
  1330. displaySuperChatAuthor: new external_rxjs_namespaceObject.Subject(),
  1331. noOverlap: new external_rxjs_namespaceObject.Subject(),
  1332. simplifyChatField: new external_rxjs_namespaceObject.Subject(),
  1333. createBanButton: new external_rxjs_namespaceObject.Subject(),
  1334. },
  1335. useStepTiming: new external_rxjs_namespaceObject.Subject(),
  1336. timingStepCount: new external_rxjs_namespaceObject.Subject(),
  1337. clearFlowChats: new external_rxjs_namespaceObject.Subject(),
  1338. },
  1339. checkboxNode = label =>
  1340. checkboxRow(
  1341. getLang()[label],
  1342. userConfig[label].get(),
  1343. lib(ss.bl[label])
  1344. ),
  1345. textColorNode = label => {
  1346. return settingRow(getLang()[label], [
  1347. ((color = userConfig[label].get()),
  1348. (textStyle = {
  1349. fontFamily: userConfig.font.get(),
  1350. fontWeight: userConfig.fontWeight.get().toString(),
  1351. }),
  1352. (oninput = lib(ss.str[label])),
  1353. external_m_default()("div", [
  1354. external_m_default()("input", {
  1355. style: { width: "36px", verticalAlign: "middle" },
  1356. type: "color",
  1357. value: color,
  1358. oninput,
  1359. }),
  1360. external_m_default()("input", {
  1361. style: { verticalAlign: "middle" },
  1362. type: "text",
  1363. size: 8,
  1364. maxlength: 20,
  1365. value: color,
  1366. oninput,
  1367. }),
  1368. external_m_default()(
  1369. "span",
  1370. { style: { ...textStyle, color } },
  1371. "Aa1あア亜"
  1372. ),
  1373. ])),
  1374. ])
  1375. var color, textStyle, oninput
  1376. },
  1377. rangeNode = (label, streams, min, max, step) =>
  1378. settingRow(getLang()[label], [
  1379. rangeRow(
  1380. min,
  1381. max,
  1382. step,
  1383. userConfig[label].get(),
  1384. lib(streams[label])
  1385. ),
  1386. ]),
  1387. updateStringMacro = key => {
  1388. return (
  1389. (stream = ss.str[key]),
  1390. (configKey = key),
  1391. stream.pipe(
  1392. (0, external_rxjs_operators_namespaceObject.map)(
  1393. getInputValue
  1394. ),
  1395. (0, external_rxjs_operators_namespaceObject.tap)(x => {
  1396. userConfig[configKey].set(x)
  1397. })
  1398. )
  1399. )
  1400. var stream, configKey
  1401. },
  1402. updateNumberMacro = key => {
  1403. return (
  1404. (stream = ss.num[key]),
  1405. (configKey = key),
  1406. stream.pipe(
  1407. (0, external_rxjs_operators_namespaceObject.map)(
  1408. getInputValue
  1409. ),
  1410. (0, external_rxjs_operators_namespaceObject.map)(parseFloat),
  1411. (0, external_rxjs_operators_namespaceObject.tap)(x => {
  1412. userConfig[configKey].set(x)
  1413. })
  1414. )
  1415. )
  1416. var stream, configKey
  1417. },
  1418. updateIntMacro = key => {
  1419. return (
  1420. (stream = ss.int[key]),
  1421. (configKey = key),
  1422. stream.pipe(
  1423. (0, external_rxjs_operators_namespaceObject.map)(
  1424. getInputValue
  1425. ),
  1426. (0, external_rxjs_operators_namespaceObject.map)(x =>
  1427. parseInt(x, 10)
  1428. ),
  1429. (0, external_rxjs_operators_namespaceObject.tap)(x => {
  1430. userConfig[configKey].set(x)
  1431. })
  1432. )
  1433. )
  1434. var stream, configKey
  1435. },
  1436. updateBoolMacro = key => {
  1437. return (
  1438. (stream = ss.bl[key]),
  1439. (configKey = key),
  1440. stream.pipe(
  1441. (0, external_rxjs_operators_namespaceObject.map)(
  1442. getInputChecked
  1443. ),
  1444. (0, external_rxjs_operators_namespaceObject.tap)(x => {
  1445. userConfig[configKey].set(x)
  1446. })
  1447. )
  1448. )
  1449. var stream, configKey
  1450. }
  1451. return (
  1452. (0, external_rxjs_namespaceObject.merge)(
  1453. (0, external_rxjs_namespaceObject.merge)(
  1454. (0, external_rxjs_namespaceObject.merge)(
  1455. updateStringMacro("font"),
  1456. updateNumberMacro("fontSize"),
  1457. updateNumberMacro("fontWeight"),
  1458. updateIntMacro("laneCount")
  1459. ).pipe(
  1460. (0, external_rxjs_operators_namespaceObject.mapTo)({
  1461. setStyle: !0,
  1462. setAnimation: !0,
  1463. })
  1464. ),
  1465. (0, external_rxjs_namespaceObject.merge)(
  1466. updateStringMacro("color"),
  1467. updateStringMacro("ownerColor"),
  1468. updateStringMacro("moderatorColor"),
  1469. updateStringMacro("memberColor"),
  1470. updateNumberMacro("chatOpacity"),
  1471. updateNumberMacro("shadowFontWeight")
  1472. ).pipe(
  1473. (0, external_rxjs_operators_namespaceObject.mapTo)({
  1474. setStyle: !0,
  1475. })
  1476. ),
  1477. (0, external_rxjs_namespaceObject.merge)(
  1478. updateNumberMacro("flowSpeed")
  1479. ).pipe(
  1480. (0, external_rxjs_operators_namespaceObject.mapTo)({
  1481. setPlayState: !0,
  1482. })
  1483. ),
  1484. (0, external_rxjs_namespaceObject.merge)(
  1485. updateIntMacro("maxChatCount").pipe(
  1486. (0, external_rxjs_operators_namespaceObject.tap)(x =>
  1487. removeOldChats(flowChats, x)
  1488. )
  1489. ),
  1490. updateBoolMacro("noOverlap"),
  1491. ss.useStepTiming.pipe(
  1492. (0, external_rxjs_operators_namespaceObject.map)(
  1493. getInputChecked
  1494. ),
  1495. (0, external_rxjs_operators_namespaceObject.tap)(x => {
  1496. userConfig.timingFunction.set(
  1497. x ? stepTiming(panelState.timingStepCount) : "linear"
  1498. )
  1499. })
  1500. ),
  1501. ss.timingStepCount.pipe(
  1502. (0, external_rxjs_operators_namespaceObject.map)(
  1503. getInputValue
  1504. ),
  1505. (0, external_rxjs_operators_namespaceObject.map)(x =>
  1506. parseInt(x, 10)
  1507. ),
  1508. (0, external_rxjs_operators_namespaceObject.tap)(x => {
  1509. ;(panelState.timingStepCount = x),
  1510. userConfig.timingFunction.set(stepTiming(x))
  1511. })
  1512. )
  1513. ).pipe(
  1514. (0, external_rxjs_operators_namespaceObject.mapTo)({
  1515. setAnimation: !0,
  1516. })
  1517. )
  1518. ).pipe(
  1519. (0, external_rxjs_operators_namespaceObject.throttleTime)(
  1520. 180,
  1521. void 0,
  1522. { leading: !0, trailing: !0 }
  1523. ),
  1524. (0, external_rxjs_operators_namespaceObject.tap)(x => {
  1525. flowChats
  1526. .filter(chat => !chat.animationEnded)
  1527. .forEach(chat => {
  1528. const config = {
  1529. setStyle: !1,
  1530. setAnimation: !1,
  1531. setPlayState: !1,
  1532. ...x,
  1533. }
  1534. config.setStyle &&
  1535. setChatStyle(chat, mainState, userConfig),
  1536. config.setAnimation
  1537. ? setChatAnimation(
  1538. chat,
  1539. flowChats,
  1540. mainState,
  1541. userConfig
  1542. )
  1543. : config.setPlayState &&
  1544. setChatPlayState(chat, mainState, userConfig)
  1545. })
  1546. })
  1547. ),
  1548. updateStringMacro("lang"),
  1549. ss.tabChange.pipe(
  1550. (0, external_rxjs_operators_namespaceObject.tap)(x => {
  1551. panelState.currentTab = x
  1552. })
  1553. ),
  1554. updateIntMacro("maxChatLength"),
  1555. updateBoolMacro("simplifyChatField"),
  1556. updateBoolMacro("createBanButton"),
  1557. updateBoolMacro("createChats"),
  1558. updateBoolMacro("displayModName"),
  1559. updateBoolMacro("displaySuperChatAuthor"),
  1560. updateBoolMacro("textOnly"),
  1561. ss.bannedWords.pipe(
  1562. (0, external_rxjs_operators_namespaceObject.map)(getInputValue),
  1563. (0, external_rxjs_operators_namespaceObject.map)(x =>
  1564. x.split(/\r\n|\n/).filter(word => "" !== word)
  1565. ),
  1566. (0, external_rxjs_operators_namespaceObject.tap)(x => {
  1567. userConfig.bannedWords.set(x)
  1568. })
  1569. ),
  1570. ss.bannedWordRegexs.pipe(
  1571. (0, external_rxjs_operators_namespaceObject.map)(getInputValue),
  1572. (0, external_rxjs_operators_namespaceObject.map)(x =>
  1573. x.split(/\r\n|\n/).filter(regex => "" !== regex)
  1574. ),
  1575. (0, external_rxjs_operators_namespaceObject.tap)(x => {
  1576. panelState.bannedWordRegexs = x
  1577. let valid = !0
  1578. ;(panelState.bannedWordRegexsError = ""),
  1579. panelState.bannedWordRegexs.forEach(regex => {
  1580. try {
  1581. RegExp(regex, "u")
  1582. } catch (error) {
  1583. logFyc(`Invalid Regex: ${regex}`),
  1584. external_log_default().warn(error),
  1585. (panelState.bannedWordRegexsError += `${error} in ${regex};`),
  1586. (valid = !1)
  1587. }
  1588. }),
  1589. valid && userConfig.bannedWordRegexs.set(x),
  1590. (panelState.bannedWordRegexsValid = valid)
  1591. })
  1592. ),
  1593. ss.bannedUsers.pipe(
  1594. (0, external_rxjs_operators_namespaceObject.map)(getInputValue),
  1595. (0, external_rxjs_operators_namespaceObject.map)(x =>
  1596. x.split(/\r\n|\n/).filter(user => "" !== user)
  1597. ),
  1598. (0, external_rxjs_operators_namespaceObject.tap)(x => {
  1599. userConfig.bannedUsers.set(x)
  1600. })
  1601. ),
  1602. ss.clearFlowChats.pipe(
  1603. (0, external_rxjs_operators_namespaceObject.tap)(() =>
  1604. removeOldChats(flowChats, 0)
  1605. )
  1606. )
  1607. ).subscribe(),
  1608. {
  1609. view: () => {
  1610. return external_m_default()(
  1611. "div",
  1612. {
  1613. className: "fyc_panel",
  1614. style: {
  1615. visibility: state.showPanel ? "visible" : "hidden",
  1616. backgroundColor: "rgba(30,30,30,0.9)",
  1617. zIndex: 5,
  1618. position: "absolute",
  1619. bottom: "40px",
  1620. right: "0px",
  1621. color: "#fff",
  1622. fontSize: "14px",
  1623. width: "660px",
  1624. border: "solid 1px #666",
  1625. },
  1626. },
  1627. [
  1628. external_m_default()(
  1629. "div",
  1630. { style: { float: "right", margin: "6px 6px 0 0" } },
  1631. [
  1632. "🌐",
  1633. external_m_default()(
  1634. "select",
  1635. {
  1636. selectedIndex: langOptions.findIndex(
  1637. x => x[0] === userConfig.lang.get()
  1638. ),
  1639. onchange: lib(ss.str.lang),
  1640. },
  1641. langOptions.map(x => settingPanel_option(...x))
  1642. ),
  1643. ]
  1644. ),
  1645. ((style = {
  1646. container: { height: "364px" },
  1647. label: { padding: "6px" },
  1648. labelFocus: { background: "#666" },
  1649. tab: { display: "flex", padding: "6px" },
  1650. }),
  1651. (labels = [
  1652. getLang().flowChat,
  1653. getLang().chatFilter,
  1654. getLang().chatField,
  1655. ]),
  1656. (tabs = [
  1657. [
  1658. external_m_default()(
  1659. "div",
  1660. { style: panelBoxStyle(212) },
  1661. [
  1662. settingRow(getLang().font, [
  1663. external_m_default()(
  1664. "select",
  1665. {
  1666. style: { width: "60%" },
  1667. selectedIndex: fontOptions.findIndex(
  1668. x => x[0] === userConfig.font.get()
  1669. ),
  1670. onchange: lib(ss.str.font),
  1671. },
  1672. fontOptions.map(x =>
  1673. settingPanel_option(
  1674. x[0],
  1675. "FYC_JA" === userConfig.lang.get()
  1676. ? x[2]
  1677. : x[1]
  1678. )
  1679. )
  1680. ),
  1681. ]),
  1682. textColorNode("color"),
  1683. textColorNode("ownerColor"),
  1684. textColorNode("moderatorColor"),
  1685. textColorNode("memberColor"),
  1686. external_m_default()(
  1687. "div",
  1688. {
  1689. style: {
  1690. textAlign: "right",
  1691. margin: "3px 6px",
  1692. },
  1693. },
  1694. external_m_default()(
  1695. "a",
  1696. {
  1697. style: { color: "#fff" },
  1698. href:
  1699. "https://greasyfork.org/en/scripts/411442-flow-youtube-chat/feedback",
  1700. target: "_blank",
  1701. },
  1702. getLang().feedback
  1703. )
  1704. ),
  1705. ]
  1706. ),
  1707. external_m_default()(
  1708. "div",
  1709. { style: panelBoxStyle(212) },
  1710. [
  1711. rangeNode("chatOpacity", ss.num, 0, 1, 0.05),
  1712. rangeNode("fontSize", ss.num, 0.3, 2, 0.05),
  1713. rangeNode("fontWeight", ss.num, 10, 1e3, 10),
  1714. rangeNode("shadowFontWeight", ss.num, 0, 3, 0.1),
  1715. rangeNode("flowSpeed", ss.num, 1, 50, 1),
  1716. rangeNode("maxChatCount", ss.int, 5, 200, 5),
  1717. rangeNode("maxChatLength", ss.int, 5, 200, 5),
  1718. rangeNode("laneCount", ss.int, 1, 25, 1),
  1719. ]
  1720. ),
  1721. external_m_default()(
  1722. "div",
  1723. { style: panelBoxStyle(212) },
  1724. [
  1725. checkboxNode("createChats"),
  1726. checkboxNode("displayModName"),
  1727. checkboxNode("displaySuperChatAuthor"),
  1728. checkboxNode("textOnly"),
  1729. checkboxRow(
  1730. getLang().useStepTiming,
  1731. useStepTiming(),
  1732. lib(ss.useStepTiming)
  1733. ),
  1734. external_m_default()(
  1735. "div",
  1736. {
  1737. style: {
  1738. ...(useStepTiming()
  1739. ? {}
  1740. : { opacity: "0.5" }),
  1741. },
  1742. },
  1743. settingRow(getLang().timingStepCount, [
  1744. rangeRow(
  1745. 1,
  1746. 400,
  1747. 1,
  1748. panelState.timingStepCount,
  1749. lib(ss.timingStepCount)
  1750. ),
  1751. ])
  1752. ),
  1753. external_m_default()(
  1754. "span",
  1755. getLang().flowNewChatIf
  1756. ),
  1757. checkboxNode("noOverlap"),
  1758. external_m_default()(
  1759. "button",
  1760. {
  1761. type: "button",
  1762. onclick: lib(ss.clearFlowChats),
  1763. },
  1764. getLang().clearFlowChats
  1765. ),
  1766. ]
  1767. ),
  1768. ],
  1769. [
  1770. external_m_default()(
  1771. "div",
  1772. { style: panelBoxStyle(212) },
  1773. [
  1774. settingRow(getLang().bannedWords, [
  1775. external_m_default()(
  1776. "textarea",
  1777. {
  1778. rows: 18,
  1779. style: textAreaStyle,
  1780. onchange: lib(ss.bannedWords),
  1781. },
  1782. userConfig.bannedWords.get().join("\n")
  1783. ),
  1784. ]),
  1785. ]
  1786. ),
  1787. external_m_default()(
  1788. "div",
  1789. { style: panelBoxStyle(212) },
  1790. [
  1791. settingRow(getLang().bannedWordRegexs, [
  1792. external_m_default()(
  1793. "span",
  1794. panelState.bannedWordRegexsValid
  1795. ? ""
  1796. : `${getLang().error}: ${
  1797. panelState.bannedWordRegexsError
  1798. }`
  1799. ),
  1800. external_m_default()(
  1801. "textarea",
  1802. {
  1803. rows: 18,
  1804. style: textAreaStyle,
  1805. onchange: lib(ss.bannedWordRegexs),
  1806. },
  1807. panelState.bannedWordRegexs.join("\n")
  1808. ),
  1809. ]),
  1810. ]
  1811. ),
  1812. external_m_default()(
  1813. "div",
  1814. { style: panelBoxStyle(212) },
  1815. [
  1816. settingRow(getLang().bannedUsers, [
  1817. external_m_default()(
  1818. "textarea",
  1819. {
  1820. rows: 18,
  1821. style: textAreaStyle,
  1822. onchange: lib(ss.bannedUsers),
  1823. },
  1824. userConfig.bannedUsers.get().join("\n")
  1825. ),
  1826. ]),
  1827. ]
  1828. ),
  1829. ],
  1830. [
  1831. external_m_default()(
  1832. "div",
  1833. { style: panelBoxStyle(644) },
  1834. [
  1835. checkboxNode("simplifyChatField"),
  1836. checkboxNode("createBanButton"),
  1837. ]
  1838. ),
  1839. ],
  1840. ]),
  1841. (currentTab = panelState.currentTab),
  1842. (ontabSelect = lib(ss.tabChange)),
  1843. external_m_default()("div", [
  1844. external_m_default()(
  1845. "div",
  1846. ...labels.map((x, i) =>
  1847. external_m_default()(
  1848. "span",
  1849. {
  1850. style: {
  1851. ...style.label,
  1852. ...(currentTab === i ? style.labelFocus : {}),
  1853. display: "inline-block",
  1854. },
  1855. onclick: () => ontabSelect(i),
  1856. },
  1857. x
  1858. )
  1859. )
  1860. ),
  1861. external_m_default()(
  1862. "div",
  1863. {
  1864. style: {
  1865. ...style.container,
  1866. overflow: "hidden auto",
  1867. },
  1868. },
  1869. ...tabs.map((x, i) => {
  1870. var _a
  1871. return external_m_default()(
  1872. "div",
  1873. {
  1874. style: {
  1875. ...style.tab,
  1876. display:
  1877. i === currentTab
  1878. ? null !== (_a = style.tab.display) &&
  1879. void 0 !== _a
  1880. ? _a
  1881. : "block"
  1882. : "none",
  1883. },
  1884. },
  1885. x
  1886. )
  1887. })
  1888. ),
  1889. ])),
  1890. ]
  1891. )
  1892. var style, labels, tabs, currentTab, ontabSelect
  1893. },
  1894. }
  1895. )
  1896. },
  1897. settingComponent = (flowChats, mainState, userConfig) => {
  1898. const state = { showPanel: !1 },
  1899. panel = settingPanel(flowChats, mainState, state, userConfig),
  1900. toggleButton = ((state, userConfig) => {
  1901. const click$ = new external_rxjs_namespaceObject.Subject()
  1902. return (
  1903. click$
  1904. .pipe(
  1905. (0, external_rxjs_operators_namespaceObject.tap)(() => {
  1906. state.showPanel = !state.showPanel
  1907. })
  1908. )
  1909. .subscribe(),
  1910. {
  1911. view: () =>
  1912. external_m_default()(
  1913. "button",
  1914. {
  1915. className: "fyc_button",
  1916. style: {
  1917. background: "rgba(0,0,0,0)",
  1918. marginLeft: "10px",
  1919. whiteSpace: "nowrap",
  1920. },
  1921. onclick: lib(click$),
  1922. },
  1923. [
  1924. external_m_default()(
  1925. "svg",
  1926. {
  1927. preserveAspectRatio: "xMidYMid meet",
  1928. viewBox: "0 0 640 640",
  1929. width: "15",
  1930. height: "15",
  1931. style: { position: "relative", top: "1px" },
  1932. },
  1933. [
  1934. external_m_default()(
  1935. "defs",
  1936. external_m_default()("path", {
  1937. id: "d1TbzTC1zI",
  1938. d:
  1939. "m135.38 58.17 0.64 0.05 0.63 0.07 0.65 0.1 0.65 0.13 0.66 0.14 0.66 0.17 0.67 0.18 0.67 0.21 0.68 0.23 0.69 0.25 0.68 0.26 0.69 0.29 0.7 0.3 0.69 0.32 0.7 0.33 0.71 0.35 0.7 0.37 0.71 0.38 0.71 0.39 0.7 0.41 0.72 0.42 0.71 0.43 0.71 0.45 45.87 26.91 0.9-0.5 8.92-4.47 9.12-4.12 0.92-0.38v142.27l-2.42 2.55-3.53 4.01-3.38 4.15-3.22 4.28-3.06 4.41-2.9 4.53-2.73 4.65-2.55 4.76-2.37 4.87-2.19 4.97-2 5.07-1.82 5.17-1.61 5.26-1.41 5.35-1.21 5.43-1 5.51-0.78 5.57-0.57 5.65-0.34 5.71-0.12 5.77 0.12 5.78 0.34 5.71 0.57 5.64 0.78 5.58 1 5.51 1.21 5.43 1.41 5.34 1.61 5.27 1.82 5.16 2 5.08 2.19 4.97 2.37 4.87 2.55 4.76 2.73 4.65 2.9 4.53 3.06 4.41 3.22 4.28 3.38 4.14 3.53 4.02 3.68 3.87 3.82 3.73 3.96 3.57 4.09 3.43 4.23 3.26 4.34 3.1 4.47 2.94 4.59 2.76 4.7 2.59 4.8 2.4 4.91 2.22 5.01 2.03 5.1 1.84 5.19 1.63 5.28 1.44 5.36 1.22 5.43 1.01 5.51 0.8 5.57 0.57 5.63 0.35 5.7 0.11 5.69-0.11 5.64-0.35 5.57-0.57 5.51-0.8 5.43-1.01 5.36-1.22 5.28-1.44 5.19-1.63 5.1-1.84 5.01-2.03 4.91-2.22 4.8-2.4 4.7-2.59 4.59-2.76 4.46-2.94 4.35-3.1 4.23-3.26 4.09-3.43 3.96-3.57 3.82-3.73 3.68-3.87 3.53-4.02 3.38-4.14 3.22-4.28 3.06-4.41 2.9-4.53 2.72-4.65 2.56-4.76 2.37-4.87 2.19-4.97 2-5.08 1.81-5.16 1.62-5.27 1.41-5.34 1.21-5.43 1-5.51 0.78-5.58 0.57-5.64 0.34-5.71 0.12-5.78-0.12-5.77-0.06-1.06h33.29l140.27 63.64-0.02 0.01-0.48 0.4-0.51 0.38-0.52 0.37-0.55 0.36-0.57 0.36-0.58 0.34-0.6 0.34-0.63 0.33-0.63 0.32-0.66 0.31-0.67 0.31-0.69 0.3-0.7 0.29-0.71 0.3-0.73 0.28-0.74 0.28-1.52 0.56-0.78 0.27-0.78 0.28-1.6 0.54-0.82 0.26-51.23 13.84-1.32 4.34-3.37 9.6-3.71 9.43-4.07 9.24-4.41 9.04-0.5 0.91 26.56 46.48 0.44 0.72 0.84 1.44 0.4 0.72 0.39 0.72 0.38 0.72 0.36 0.71 0.34 0.71 0.33 0.71 0.32 0.71 0.3 0.7 0.28 0.7 0.26 0.7 0.24 0.69 0.23 0.69 0.2 0.68 0.19 0.67 0.16 0.68 0.14 0.66 0.12 0.66 0.1 0.66 0.08 0.65 0.05 0.64 0.02 0.63 0.01 0.62-0.03 0.62-0.05 0.61-0.08 0.6-0.1 0.59-0.13 0.59-0.16 0.57-0.2 0.57-0.22 0.55-0.25 0.54-0.28 0.54-0.31 0.52-0.35 0.51-0.37 0.5-0.41 0.48-0.45 0.48-66.99 67.88-0.47 0.45-0.47 0.41-0.49 0.38-0.49 0.34-0.51 0.31-0.51 0.27-0.53 0.24-0.53 0.21-0.54 0.18-0.55 0.14-0.56 0.12-0.56 0.09-0.58 0.06-0.58 0.03-0.59 0.01-0.6-0.02-0.61-0.04-0.62-0.07-0.62-0.09-0.63-0.12-0.64-0.13-0.65-0.16-0.65-0.17-0.66-0.2-0.67-0.21-0.68-0.23-0.68-0.25-0.69-0.26-0.69-0.28-0.71-0.3-0.7-0.3-0.72-0.32-0.72-0.33-0.73-0.34-0.73-0.36-0.74-0.36-0.75-0.37-0.75-0.38-1.52-0.78-45.87-26.91-0.9 0.5-8.92 4.47-9.12 4.12-9.3 3.77-9.47 3.41-4.29 1.34-13.65 51.91-0.27 0.83-0.26 0.81-0.27 0.81-0.27 0.8-0.54 1.56-0.28 0.76-0.28 0.75-0.28 0.74-0.29 0.73-0.29 0.71-0.3 0.69-0.3 0.68-0.31 0.67-0.32 0.64-0.32 0.63-0.33 0.61-0.34 0.6-0.35 0.57-0.36 0.55-0.36 0.54-0.38 0.51-0.39 0.49-0.4 0.46-0.41 0.45-0.42 0.42-0.44 0.39-0.45 0.37-0.46 0.34-0.48 0.32-0.49 0.29-0.5 0.26-0.52 0.24-0.54 0.2-0.56 0.18-0.57 0.14-0.59 0.12-0.6 0.08-0.63 0.05-0.64 0.01h-94.74l-0.64-0.01-0.64-0.05-0.61-0.08-0.6-0.12-0.59-0.14-0.57-0.18-0.55-0.2-0.54-0.24-0.53-0.26-0.52-0.29-0.5-0.32-0.49-0.34-0.47-0.37-0.46-0.39-0.45-0.42-0.43-0.45-0.43-0.46-0.41-0.49-0.4-0.51-0.38-0.54-0.38-0.55-0.36-0.57-0.36-0.6-0.34-0.61-0.33-0.63-0.32-0.64-0.31-0.67-0.3-0.68-0.29-0.69-0.28-0.71-0.27-0.73-0.26-0.74-0.25-0.75-0.25-0.76-0.46-1.56-0.21-0.8-0.42-1.62-0.19-0.83-13.65-51.91-4.29-1.34-9.47-3.41-9.3-3.77-9.12-4.12-8.92-4.47-1.08-0.59-45.69 26.81-1.42 0.88-0.72 0.42-0.7 0.4-0.71 0.4-0.71 0.38-0.7 0.37-0.71 0.35-0.7 0.33-0.69 0.32-0.7 0.3-0.69 0.29-0.68 0.26-0.69 0.25-0.68 0.23-0.67 0.2-0.67 0.19-0.66 0.17-0.66 0.14-0.65 0.12-0.65 0.1-0.63 0.08-0.64 0.05-0.62 0.03h-0.62l-0.61-0.03-0.6-0.05-0.59-0.08-0.59-0.1-0.57-0.14-0.57-0.16-0.56-0.19-0.54-0.23-0.54-0.25-0.52-0.28-0.52-0.32-0.5-0.35-0.49-0.38-0.48-0.42-0.47-0.45-66.99-67.88-0.45-0.48-0.4-0.48-0.37-0.49-0.34-0.5-0.3-0.52-0.27-0.52-0.24-0.53-0.21-0.54-0.17-0.54-0.15-0.56-0.11-0.57-0.09-0.57-0.06-0.58-0.03-0.6-0.01-0.6 0.02-0.6 0.04-0.62 0.07-0.62 0.09-0.64 0.11-0.64 0.14-0.64 0.15-0.66 0.17-0.66 0.19-0.67 0.44-1.36 0.25-0.69 0.26-0.7 0.27-0.71 0.29-0.71 0.3-0.72 0.32-0.72 0.33-0.73 0.33-0.74 0.35-0.74 0.36-0.75 0.74-1.52 0.38-0.77 0.39-0.77 26.5-46.38-0.44-0.82-4.41-9.04-4.07-9.24-3.72-9.43-3.36-9.6-1.33-4.34-51.22-13.84-0.82-0.26-1.6-0.54-0.78-0.28-0.78-0.27-1.52-0.56-0.74-0.28-0.73-0.28-0.71-0.3-0.7-0.29-0.69-0.3-0.67-0.31-0.66-0.31-0.64-0.32-0.62-0.33-0.6-0.34-0.58-0.34-0.57-0.36-0.55-0.36-0.52-0.37-0.51-0.38-0.48-0.4-0.46-0.4-0.44-0.42-0.41-0.43-0.39-0.44-0.37-0.45-0.33-0.47-0.32-0.48-0.28-0.5-0.26-0.51-0.23-0.53-0.21-0.55-0.17-0.56-0.14-0.58-0.11-0.6-0.08-0.61-0.05-0.63-0.02-0.66v-96l0.02-0.65 0.05-0.64 0.08-0.62 0.11-0.61 0.14-0.59 0.17-0.58 0.21-0.57 0.23-0.54 0.26-0.54 0.28-0.52 0.32-0.51 0.33-0.49 0.37-0.48 0.39-0.47 0.41-0.45 0.44-0.45 0.46-0.42 0.48-0.42 0.51-0.4 0.52-0.4 0.55-0.38 0.57-0.37 0.58-0.35 0.6-0.35 0.62-0.34 0.64-0.32 0.66-0.32 0.67-0.3 0.69-0.29 0.7-0.29 0.71-0.27 0.73-0.27 0.74-0.25 0.76-0.25 0.76-0.24 1.56-0.44 0.8-0.22 0.8-0.2 0.82-0.2 51.22-13.83 1.33-4.35 3.36-9.6 3.72-9.42 4.07-9.24 4.41-9.04 0.5-0.91-26.56-46.48-0.77-1.54-0.74-1.52-0.36-0.75-0.35-0.74-0.33-0.74-0.33-0.73-0.32-0.73-0.3-0.71-0.29-0.72-0.27-0.7-0.26-0.7-0.25-0.69-0.44-1.36-0.19-0.67-0.17-0.66-0.15-0.66-0.14-0.65-0.11-0.64-0.09-0.63-0.07-0.62-0.04-0.62-0.02-0.61 0.01-0.6 0.03-0.59 0.06-0.58 0.09-0.58 0.11-0.56 0.15-0.56 0.17-0.55 0.21-0.54 0.24-0.53 0.27-0.52 0.3-0.51 0.34-0.5 0.37-0.49 0.4-0.49 0.45-0.47 66.99-67.88 0.47-0.45 0.48-0.42 0.49-0.38 0.5-0.35 0.52-0.32 0.52-0.28 0.54-0.26 0.54-0.22 0.56-0.19 0.57-0.17 0.57-0.13 0.59-0.11 0.59-0.08 0.6-0.05 0.61-0.02h0.62l0.62 0.03zm441.37-56.16 2.78 0.28 2.75 0.4 2.71 0.49 2.67 0.61 2.63 0.7 2.59 0.81 2.54 0.9 2.5 1 2.45 1.09 2.39 1.18 2.35 1.28 2.28 1.36 2.23 1.44 2.17 1.53 2.11 1.6 2.04 1.69 1.97 1.76 1.91 1.83 1.83 1.91 1.76 1.97 1.69 2.05 1.61 2.1 1.52 2.17 1.45 2.23 1.36 2.29 1.27 2.34 1.18 2.4 1.1 2.44 0.99 2.5 0.91 2.55 0.8 2.58 0.71 2.64 0.6 2.67 0.5 2.71 0.39 2.74 0.28 2.78 0.17 2.81 0.06 2.84v137.8l-0.06 2.84-0.17 2.81-0.28 2.78-0.39 2.75-0.5 2.71-0.6 2.67-0.71 2.63-0.8 2.59-0.91 2.54-0.99 2.5-1.1 2.45-1.18 2.39-1.27 2.35-1.36 2.28-1.45 2.23-1.52 2.17-1.61 2.11-1.69 2.04-1.76 1.97-1.83 1.91-1.91 1.83-1.97 1.76-2.04 1.69-2.11 1.61-2.17 1.52-2.23 1.45-2.28 1.36-2.35 1.27-0.98 0.49 21.81 70.8-141.75-63.6h-155.05l-2.84-0.06-2.81-0.17-2.78-0.28-2.74-0.39-2.71-0.5-2.67-0.6-2.64-0.71-2.58-0.8-2.55-0.91-2.5-1-2.44-1.09-2.4-1.18-2.34-1.27-2.29-1.36-2.23-1.45-2.17-1.52-2.1-1.61-2.05-1.69-1.97-1.76-1.91-1.83-1.83-1.91-1.76-1.97-1.68-2.04-1.61-2.11-1.53-2.17-1.44-2.23-1.36-2.28-1.27-2.35-1.19-2.39-1.09-2.45-1-2.5-0.9-2.54-0.81-2.59-0.7-2.63-0.61-2.67-0.49-2.71-0.39-2.75-0.29-2.78-0.17-2.81-0.06-2.84v-137.8l0.06-2.84 0.17-2.81 0.29-2.78 0.39-2.74 0.49-2.71 0.61-2.67 0.7-2.64 0.81-2.58 0.9-2.55 1-2.5 1.09-2.44 1.19-2.4 1.27-2.34 1.36-2.29 1.44-2.23 1.53-2.17 1.61-2.1 1.68-2.05 1.76-1.97 1.83-1.91 1.91-1.83 1.97-1.76 2.05-1.69 2.1-1.6 2.17-1.53 2.23-1.44 2.29-1.36 2.34-1.28 2.4-1.18 2.44-1.09 2.5-1 2.55-0.9 2.58-0.81 2.64-0.7 2.67-0.61 2.71-0.49 2.74-0.4 2.78-0.28 2.81-0.17 2.84-0.06h244.31l2.84 0.06 2.81 0.17z",
  1940. })
  1941. ),
  1942. external_m_default()("use", {
  1943. "xlink:href": "#d1TbzTC1zI",
  1944. opacity: "1",
  1945. fill: "var(--iron-icon-fill-color, currentcolor)",
  1946. "fill-opacity": "1",
  1947. }),
  1948. ]
  1949. ),
  1950. external_m_default()(
  1951. "span",
  1952. {
  1953. style: {
  1954. position: "relative",
  1955. top: "-2px",
  1956. marginLeft: "8px,",
  1957. },
  1958. },
  1959. "FYC_JA" === userConfig.lang.get()
  1960. ? "設定"
  1961. : "Settings"
  1962. ),
  1963. ]
  1964. ),
  1965. }
  1966. )
  1967. })(state, userConfig)
  1968. return {
  1969. view: () => [
  1970. external_m_default()(panel),
  1971. external_m_default()(toggleButton),
  1972. ],
  1973. }
  1974. },
  1975. videoToggleStream = video =>
  1976. (0, external_rxjs_namespaceObject.merge)(
  1977. (0, external_rxjs_namespaceObject.fromEvent)(video, "playing").pipe(
  1978. (0, external_rxjs_operators_namespaceObject.mapTo)(!0)
  1979. ),
  1980. (0, external_rxjs_namespaceObject.fromEvent)(video, "waiting").pipe(
  1981. (0, external_rxjs_operators_namespaceObject.mapTo)(!1)
  1982. ),
  1983. (0, external_rxjs_namespaceObject.fromEvent)(video, "pause").pipe(
  1984. (0, external_rxjs_operators_namespaceObject.mapTo)(!1)
  1985. )
  1986. ),
  1987. requirementMet = () =>
  1988. Boolean(
  1989. livePage_getChatFrame() &&
  1990. livePage_getChatField() &&
  1991. livePage_getPlayer()
  1992. ),
  1993. initialize = async () => {
  1994. logFyc("Script started")
  1995. const userConfig = await (async () => ({
  1996. lang: await simpleConfigItem("FYC_LANG", "FYC_EN"),
  1997. font: await simpleConfigItem("FYC_FONT", "MS PGothic"),
  1998. chatOpacity: await simpleConfigItem("FYC_OPACITY", 0.8),
  1999. color: await simpleConfigItem("FYC_COLOR", "#ffffff"),
  2000. ownerColor: await simpleConfigItem("FYC_COLOR_OWNER", "#ffd600"),
  2001. moderatorColor: await simpleConfigItem(
  2002. "FYC_COLOR_MODERATOR",
  2003. "#a36aff"
  2004. ),
  2005. memberColor: await simpleConfigItem(
  2006. "FYC_COLOR_MEMBER",
  2007. "#9fffff"
  2008. ),
  2009. fontSize: await simpleConfigItem("FYC_SIZE", 1),
  2010. fontWeight: await simpleConfigItem("FYC_WEIGHT", 730),
  2011. shadowFontWeight: await simpleConfigItem("FYC_WEIGHT_SHADOW", 1),
  2012. maxChatCount: await simpleConfigItem("FYC_LIMIT", 40),
  2013. flowSpeed: await simpleConfigItem("FYC_SPEED", 18),
  2014. maxChatLength: await simpleConfigItem("FYC_MAX", 100),
  2015. laneCount: await simpleConfigItem("FYC_LANE_DIV", 12),
  2016. bannedWords: await makeConfigItem(
  2017. "FYC_NG_WORDS",
  2018. ...lineConfigArgs
  2019. ),
  2020. bannedWordRegexs: await makeConfigItem(
  2021. "FYC_NG_REG_WORDS",
  2022. ...lineConfigArgs
  2023. ),
  2024. bannedUsers: await makeConfigItem(
  2025. "FYC_NG_USERS",
  2026. ...lineConfigArgs
  2027. ),
  2028. createChats: await simpleConfigItem(
  2029. "FYC_TOGGLE_CREATE_COMMENTS",
  2030. !0
  2031. ),
  2032. noOverlap: await simpleConfigItem("FYC_NO_OVERLAP", !0),
  2033. createBanButton: await simpleConfigItem("FYC_NG_BUTTON", !0),
  2034. simplifyChatField: await simpleConfigItem(
  2035. "FYC_SIMPLE_CHAT_FIELD",
  2036. !1
  2037. ),
  2038. displayModName: await simpleConfigItem(
  2039. "FYC_DISPLAY_MODERATOR_NAME",
  2040. !0
  2041. ),
  2042. displaySuperChatAuthor: await simpleConfigItem(
  2043. "FYC_DISPLAY_SUPER_CHAT_AUTHOR",
  2044. !0
  2045. ),
  2046. textOnly: await simpleConfigItem("FYC_TEXT_ONLY", !1),
  2047. timingFunction: await simpleConfigItem(
  2048. "FYC_TIMING_FUNCTION",
  2049. "linear"
  2050. ),
  2051. displayChats: await simpleConfigItem("FYC_DISPLAY_COMMENTS", !0),
  2052. }))(),
  2053. reinitSubject = new external_rxjs_namespaceObject.Subject(),
  2054. reinitialize = lib(reinitSubject),
  2055. chatScrn = (() => {
  2056. const element = document.createElement("div")
  2057. return (
  2058. (element.style.pointerEvents = "none"),
  2059. (element.style.zIndex = "30"),
  2060. element
  2061. )
  2062. })(),
  2063. flowChats = []
  2064. let chatField, video, player
  2065. const mainState = {
  2066. chatPlaying: !0,
  2067. playerRect: new DOMRect(24, 80, 839, 472),
  2068. }
  2069. let storedHref = window.location.href
  2070. new MutationObserver(async () => {
  2071. storedHref !== window.location.href &&
  2072. ((storedHref = window.location.href),
  2073. logFyc("URL Changed", storedHref),
  2074. await reinitialize())
  2075. }).observe(document, { childList: !0, subtree: !0 })
  2076. const chatObserver = chatFieldObserver(
  2077. chatScrn,
  2078. flowChats,
  2079. mainState,
  2080. userConfig
  2081. ),
  2082. playerResizeSubject = new external_rxjs_namespaceObject.Subject(),
  2083. playerResizeObserver = new ResizeObserver(lib(playerResizeSubject)),
  2084. toggleChatBtn = ((flowChats, userConfig) => {
  2085. const click$ = new external_rxjs_namespaceObject.Subject()
  2086. click$
  2087. .pipe(
  2088. (0, external_rxjs_operators_namespaceObject.tap)(() => {
  2089. const newDisplay = !userConfig.displayChats.get()
  2090. flowChats.forEach(x => {
  2091. x.element.style.visibility = newDisplay
  2092. ? "visible"
  2093. : "hidden"
  2094. }),
  2095. userConfig.displayChats.set(newDisplay),
  2096. GM.setValue("FYC_DISPLAY_COMMENTS", newDisplay)
  2097. })
  2098. )
  2099. .subscribe()
  2100. const label = () =>
  2101. "チャット" + (userConfig.displayChats.get() ? "非表示" : "表示")
  2102. return {
  2103. view: () =>
  2104. external_m_default()(
  2105. "button",
  2106. {
  2107. className: ["ytp-button"].join(" "),
  2108. style: {
  2109. background: "none",
  2110. border: "none",
  2111. cursor: "pointer",
  2112. float: "left",
  2113. fontSize: "1em",
  2114. height: "4em",
  2115. outline: "none",
  2116. overflow: "visible",
  2117. padding: "0 0 0em",
  2118. position: "relative",
  2119. width: "3em",
  2120. },
  2121. type: "button",
  2122. "aria-label": label(),
  2123. title: label(),
  2124. onclick: lib(click$),
  2125. },
  2126. [
  2127. external_m_default()(
  2128. "svg",
  2129. { style: { width: "100%" }, viewBox: "0 0 36 36" },
  2130. [
  2131. external_m_default()("path", {
  2132. className: ["chat-button-path"].join(" "),
  2133. d:
  2134. "m11 12h17q1 0 1 1v9q0 1-1 1h-1v2l-4-2h-12q-1 0-1-1v-9q0-1 1-1z",
  2135. fill: "#fff",
  2136. "fill-opacity": userConfig.displayChats.get()
  2137. ? "1"
  2138. : "0",
  2139. stroke: "#fff",
  2140. "stroke-width": "2",
  2141. }),
  2142. ]
  2143. ),
  2144. ]
  2145. ),
  2146. }
  2147. })(flowChats, userConfig),
  2148. mountToggleChatBtn = componentMounter(
  2149. document.createElement("span"),
  2150. x => {
  2151. const parent = document.querySelector(".ytp-right-controls")
  2152. return parent && parent.append(x), Boolean(parent)
  2153. }
  2154. ),
  2155. settingComp = settingComponent(flowChats, mainState, userConfig),
  2156. mountSettingComp = componentMounter(
  2157. document.createElement("span"),
  2158. x => {
  2159. const parent = document.querySelector(
  2160. "#menu-container .dropdown-trigger.style-scope.ytd-menu-renderer"
  2161. )
  2162. return (
  2163. parent && parent.insertAdjacentElement("beforebegin", x),
  2164. Boolean(parent)
  2165. )
  2166. }
  2167. )
  2168. external_log_default().debug("Append ToggleChatDisplayButton")
  2169. reinitSubject
  2170. .pipe(
  2171. (0, external_rxjs_operators_namespaceObject.observeOn)(
  2172. external_rxjs_namespaceObject.asyncScheduler
  2173. ),
  2174. (0, external_rxjs_operators_namespaceObject.switchMap)(() =>
  2175. (0, external_rxjs_namespaceObject.interval)(800).pipe(
  2176. (0, external_rxjs_operators_namespaceObject.startWith)(0),
  2177. (0, external_rxjs_operators_namespaceObject.map)(
  2178. requirementMet
  2179. ),
  2180. (0, external_rxjs_operators_namespaceObject.filter)(() => {
  2181. var _a, _b, _c, _d, _e, _f
  2182. const chatFieldDetached =
  2183. null !==
  2184. (_d =
  2185. chatField &&
  2186. !(
  2187. null !==
  2188. (_c =
  2189. null ===
  2190. (_b =
  2191. null === (_a = livePage_getChatFrame()) ||
  2192. void 0 === _a
  2193. ? void 0
  2194. : _a.contentDocument) || void 0 === _b
  2195. ? void 0
  2196. : _b.contains(chatField)) &&
  2197. void 0 !== _c &&
  2198. _c
  2199. ) &&
  2200. !document.contains(chatField)) &&
  2201. void 0 !== _d &&
  2202. _d,
  2203. logDetached = x => `${x} detached, will reload...`
  2204. chatFieldDetached &&
  2205. (logDetached("Chat field"), (chatField = void 0))
  2206. const videoDetached =
  2207. null !== (_e = video && !document.contains(video)) &&
  2208. void 0 !== _e &&
  2209. _e
  2210. videoDetached &&
  2211. (logDetached("Video"),
  2212. (video = void 0),
  2213. (mainState.chatPlaying = Boolean(
  2214. livePage_getOfflineSlate()
  2215. )))
  2216. const playerDetached =
  2217. null !== (_f = player && !document.contains(player)) &&
  2218. void 0 !== _f &&
  2219. _f
  2220. playerDetached && (logDetached("Player"), (player = void 0))
  2221. const detached =
  2222. chatFieldDetached || videoDetached || playerDetached
  2223. return detached && reinitialize(), !detached
  2224. }),
  2225. (0, external_rxjs_operators_namespaceObject.startWith)(!1),
  2226. (0,
  2227. external_rxjs_operators_namespaceObject.distinctUntilChanged)(),
  2228. (0, external_rxjs_operators_namespaceObject.tap)(x =>
  2229. logFyc(
  2230. x
  2231. ? "Found the chat container and the player"
  2232. : "Waiting to load..."
  2233. )
  2234. ),
  2235. (0, external_rxjs_operators_namespaceObject.filter)(Boolean)
  2236. )
  2237. ),
  2238. (0, external_rxjs_operators_namespaceObject.tap)(addMainCss),
  2239. (0, external_rxjs_operators_namespaceObject.tap)(() =>
  2240. mountSettingComp(settingComp)
  2241. ),
  2242. (0, external_rxjs_operators_namespaceObject.tap)(() =>
  2243. logFyc("Wait for 2300ms...")
  2244. ),
  2245. (0, external_rxjs_operators_namespaceObject.delay)(2300),
  2246. (0, external_rxjs_operators_namespaceObject.tap)(() =>
  2247. logFyc("Initializing...")
  2248. ),
  2249. (0, external_rxjs_operators_namespaceObject.tap)(() => {
  2250. removeOldChats(flowChats, 0),
  2251. chatObserver.disconnect(),
  2252. (chatField = livePage_getChatField()),
  2253. chatField &&
  2254. chatObserver.observe(chatField, { childList: !0 }),
  2255. (video = livePage_getMainVideo()),
  2256. video &&
  2257. (mainState.chatPlaying =
  2258. !video.paused || Boolean(livePage_getOfflineSlate())),
  2259. playerResizeObserver.disconnect(),
  2260. (player = livePage_getPlayer()),
  2261. player &&
  2262. (external_log_default().debug("AppendChatScreen"),
  2263. playerResizeObserver.observe(player),
  2264. player.insertAdjacentElement("afterbegin", chatScrn)),
  2265. mountToggleChatBtn(toggleChatBtn),
  2266. (chatField && video && player) || reinitialize()
  2267. }),
  2268. (0, external_rxjs_operators_namespaceObject.switchMap)(
  2269. setChatFrameCss
  2270. ),
  2271. (0, external_rxjs_operators_namespaceObject.switchMap)(() =>
  2272. (0, external_rxjs_namespaceObject.merge)(
  2273. ...(video
  2274. ? [
  2275. videoToggleStream(video).pipe(
  2276. (0, external_rxjs_operators_namespaceObject.map)(
  2277. playing =>
  2278. playing || Boolean(livePage_getOfflineSlate())
  2279. ),
  2280. (0, external_rxjs_operators_namespaceObject.tap)(
  2281. chatPlaying => {
  2282. ;(mainState.chatPlaying = chatPlaying),
  2283. flowChats.forEach(chat => {
  2284. setChatPlayState(chat, mainState, userConfig)
  2285. })
  2286. }
  2287. )
  2288. ),
  2289. ]
  2290. : []),
  2291. playerResizeSubject.pipe(
  2292. (0,
  2293. external_rxjs_operators_namespaceObject.throttleTime)(
  2294. 500,
  2295. void 0,
  2296. { leading: !0, trailing: !0 }
  2297. ),
  2298. (0, external_rxjs_operators_namespaceObject.startWith)([]),
  2299. (0, external_rxjs_operators_namespaceObject.tap)(() => {
  2300. var _a
  2301. logFyc("Resize detected"),
  2302. (mainState.playerRect =
  2303. null !==
  2304. (_a =
  2305. null == player
  2306. ? void 0
  2307. : player.getBoundingClientRect()) &&
  2308. void 0 !== _a
  2309. ? _a
  2310. : new DOMRect()),
  2311. flowChats.forEach(chat => {
  2312. setChatStyle(chat, mainState, userConfig),
  2313. setChatAnimation(
  2314. chat,
  2315. flowChats,
  2316. mainState,
  2317. userConfig
  2318. )
  2319. })
  2320. })
  2321. )
  2322. )
  2323. ),
  2324. (0, external_rxjs_operators_namespaceObject.retryWhen)(x =>
  2325. x.pipe(
  2326. (0, external_rxjs_operators_namespaceObject.tap)(() =>
  2327. logFyc("Errored:")
  2328. ),
  2329. (0, external_rxjs_operators_namespaceObject.tap)(
  2330. external_log_default().warn
  2331. )
  2332. )
  2333. )
  2334. )
  2335. .subscribe(),
  2336. await reinitialize()
  2337. }
  2338. ;(async () => {
  2339. external_log_namespaceObject.setLevel("info")
  2340. try {
  2341. await initialize()
  2342. } catch (error) {
  2343. external_log_namespaceObject.error(error)
  2344. }
  2345. })()
  2346. })()
  2347. })()