Reddit++

A lot of enhancements for new design of reddit.com like unwrapped feed buttons, bigger fonts, view images without redirect and many more...

  1. // ==UserScript==
  2. // @name Reddit++
  3. // @name:ru Reddit++
  4. // @description A lot of enhancements for new design of reddit.com like unwrapped feed buttons, bigger fonts, view images without redirect and many more...
  5. // @description:ru Множество улучшений для нового интерфейса reddit.com, таких как развернутые кнопки лент, увеличенный шрифт, увеличение изображений без редиректа и много другое...
  6. // @namespace RedditPlusPlus
  7. // @version 1.0.26
  8. // @author lnm95
  9. // @icon data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAQRklEQVR4nN2bCZAc1XnHf6+75569L0lI6DJCAmIQESBBEnFIwhyKwmHsshMnBRhSwQZifCSOKxw+iEPABldMUmCb4KtiCDKXicRhCZAAQSQkJJCwVtrVXtpzdmfnnu5+qdczOzuzO7M7e2BC/lVTuz3b773v+7/vescKpgi5fooNBB9HcgNwMbAE0Eq8B2nABurnw6KPQUUlhIbg6P4hQv0/wc0PEByhhNTi+alqA8bUm0yCrQguYS02m5Bcg2ReWe0sRY0LTloOl16PPHM9VDZAfwe89Isq8dwjX6C3x4ebuxB0zpa4s0dAgGqi3MwGrgcWTKmtADsG6flNcPkNuDZ+YXSSq+qhaRHS5TXEQ9+6AezTgFuB3Vl7mRGKm+NU4KYGwTeJ0grcOWXltQwBvzPh5wMeftGSpDs0iJQyR4L0V2KfeSGyqV6Q5jxsdiB4CDHFsUoMn4MadLJPDuehIfkyKY4g+QZQOeXRdehI6dzWVsXGnhP48hGNn728m6PNR5DWyORKTCFIBWqwfX71iEO75Foku4BbcvKvn6IO03YBm2Xs5FEE50yrvVCCQldS5+bOWvaKOv44GGb1Qh91G9ZQdfIKYrbElUiS9nqIKkE7WvGEex3S8oLgHOD7CP4ajUuwaGGDgK1ywuHzMXUXEPwNgv9BTkN5kf1oEEbnxwMVbLcbuKrO5JtN/dwY7OFq2UJgqIeuJLTZHjpjEN+zC9eWR9DC0cyUjc0CkuVYHEBws/O8ofzkVvDmWPMowJ1CYwf3AF+astI2GdO1GDFh9iXg8rY5nN/o4V+qO2gUJiQgVemn/9xPMnzmxViVDRih49TsfIyat55Gt6Uy/lwfJcb7J7by9YmUEULkvV4OAecKH0F+DlxR9O8y7yPy7Epmlc/FagNcbmzNxbNhnU+1VfPTZXE2eeMYZgrSKUiZzvtWdQArWI0R6UMbTmb6dOVJPfEkbybCZ9kp45MRMHkMyCj/G+D8ksqbI7MrQJMZQUX2+7QAL1DbCE0LYeFyrIaF+PvSXLDrGEsvWI4RMKHrCLT/Do63QH8Pen8UXZm8K6u4IjEpQMhMHCjmCqO4wpH5XHFpKRJyZBToMs4ChGAD/1Vy5hNZxZuqkQtOAa8f0d0CrYdhWH3vRa66BM68AJafA/UngMuL1A1StiScMKnxuTEUaaYJ6QT0dcDBN2DPdsSup6E7BRU4laGcuwSiw4i2d6F7KEOEf0KX2Mx5XM3tsqBeKN8FLhZ3I/m7ol3HgOpKWPcZ5NqroaYRNB0SUdizDXraYcUqWLEaaprAX5gl8wceJ38sDIM9cOBVeG83NC2AleeDL5gharAb8dtfwYu/hMGIKsImwn1slbdNnYAN4hYnxRRDCvBWwhXXIa+4BRoXFr6kSIgOQV15VXBJKHkGuiBQBd4xWnYfRTxxP/z6R5CMZIJjKQhuYov8YfkEXCIWYXMA6RhYIZQxhYGNn0TeeM945fMw4SxPKG+Z7RQJ/3YbbNmcsYLSMSGCziqek4cYQ0DxOsDiuaLKk/X5gIG95nLsMpQfyYDlZmaRlzyYpJ1sWoy1eiPSq0+2Kghi8aiTysdgPAEZ019esisb7Npq0v5qh4ucMKrMzFfCtokPhRk4dIhweztmMjEpCU7iSCUZ7uwkdPAQiaGw00+xdiI7F2ZFLbIqWI6Jnc2r42uYQgIuFmpx8bXJpJS2RTptkhzJgLaNrdwnL4YMtLbxznfv4sh1Gzl682fofWU7ZsosSYKjfNqk9+VtHL3pUxz9/Cb23/sdBtrac+84liEltm07WwcqCaWTKbBkeSYm+AcuFzWlCYCvAHMn7EQHbSBM4vgxwilJTGYEl7bMreAi0SR9W57B/9SPWWE287F5En33VpIqPRYx65HnRPNB7McfZOHh11i+WKeydRf9r7zIcH8oY1VKeSkxLctZH4QTFqmuFrRwpFwfqyZZaAU5AuQGZ2n5V5N2oYOwLTw7niC69zW6bEhIkRUu80q0sx1z306akiEqmiRBsx3/20+jtR/KFY35GPlO62omePhlqmstgr4Q9R17sN7aTux4d0bGrJXFpcZxCfG9O3DvfBJMu/xVjeBm+WdUjyMA4ezeVJTViRcCB16jcvN9iD2vk7Sk44/KFRTslImbKEGV+v0S2lrwDrbikokJXdWNScCTyBQ+4S58/YO44v1ImZlex9WU2ZsW2ls7qdh8H/79b4CnTOUzqCTKF8cTYHNT2V2oitc2aXjlCeY99T30vg5SQiMtbdK2xD1nLr6VZ2EuqEd63OD3Y/zhRRgLThrZ/yj60RcsxTj7IqgIIF0urAX1+FaejWfunIzp25K00ND725n71L3U73gSzTKns6j//EjUUMWk2khYC/ztlLpQsSAORjKKtew0UotOBdPCtixclQH0+nmYbjcuXzXi5LMQm26Fk1Y51fVIxhh1B6G+RtTMgXlLsawkdtWJxM+6FM+6P8c9b54TdE0JaUPHtfclgs89it43mNmGmUqRkUEVS9h25xFaMtxJPlt2os6HxwnDyK6jpNO2s4sjpYUel7jmL4HP3U4qFkVXawS3QSKRJB6JkE6lMJW7ZLOGYRi4XW58wQCeZefA4lXY8SiegB8pNMxEEsuysDRdcYzR1YpMJUdXh9OBxiZgm5GdgLXT6sQFeqwH14GXSa67DsvrxZa2s27XbInhcmMEK4nGE9x793d48/XXnZkcSWUyGzV1w0DXBYams+qcc/jq1/4eT7ASy7IxzRS2aWVyvrSxYiEqD2xDj3ZPvjcwESRXKqs35CUsxWTZNFmEtIX74B70Xc8wvPoqPJqGx0qg64bjDpbLjcdtEBse5pVtvyWZSIDbB5qGUK7gbJjYkErg9rhZceoK3G6DVCrtKK9SniIg5faSMgXB15/GdWA3pKypBr+xOFFlPv2OJVwEXDPtblRAjMfQBzoYPPF0YlXznGgtkwlMKbFsC03XaWxqIhwe4v3mZuxEHKSW3SWywEzi8vq48qqruO6GG6mtrycej5NMp0klU8SEm6h0oTfvpeFX38Lb9j5Cl7Oxp71bEfCXzh7vDAhQM+np7oDEMJG6E4lWzSVlK72SpNNpkqk0CxcvYeGixbh9AdISjGAF3qoqauobWLRkKZuuzCj/8ZVn0jcwQFzFi5TtKB+XBq7mPTQ++32q39qSUV6fsfJqApqF3OAsfD4xw46yuz/QvfYajq+7lvj8P0AIDYGFZtvomqC2tppELMq+vXt55713icbj+D0+Tj11OStPPwNfoILQ4KDj+xY6ttCcvB9o3cecFx6i8ZXHM4Fv9o5zHlcEvIlk1ax0l84QET3pdHrW30DojE9guoOOidu26bzichn4vT48Hje6pjnukkymiSfipNKZd9TGitDd6MkwNe88T9PzDxM8tCcT9GbxMM+UvCtS6+hxCRpmrVeV3Uwdq7KW2ClrGF51GfFla0hWNWIZXqTQnUwhle+rNCgEQjdAEwjLQk8ncA/34Du4g6pdTxE4uAs9MogwrNnw+UIIjisLSCIn3E8pD0vWwvzsKlq5xN4XkeF2rMp6rMZ5pBecgqk+DYuxKuqQhgep6wiVAdIxtEgIV08LxrH9GO3vYXR3YoR7Eenk6Cbrn9w4Kkq4H95+fKZSJ4RcP+1MOoozroZ/fqzgq95D79Jw46mZ2KACls+LDNQj/dVIvx+8rsweorQgnoZYDC02hIj2QjyRIdHFaLC760VYfWGu/1QqRfJH91Cx+RszEn12PKqyruBxcHCQ5sFhGjxk/FZFsngCMdSOsNpHzw5Gqs+RAxM9W126i6yZ6+cUPLa2HsObSJS5eisNI7uv4J1hPwXo6+t3Pjnb0rIjjIwixxxs55NRhj0ODAzQ199HfTQ6U1FT6oR3cKa95EPV7Cr3KxMtQOHqJ6O0NuYUqUxnVOW0GsO2ZnY9wJQMaSkIzaiXDxUzC1+GoFVz6+yfbRXUtrOmzXbOGj+GGL/JO8VO6NOcM/VZhBJMLW/9/uK76rMBXdfwer24vb6Z9SbZp2rVfbMpnJr5QCDAnDlNs9ltATweDzXVNQSra6bQqghs3jQQbC/Lla79IQRKJJ2GwiOwioogbrcL+6b/KO0Ke1+Fl/999FkVUpddX3r8usbcr4qAhoZ6PGsugLk/Ld3mZ3dAqLn0393scZKPXO9ccDqx5IvX3A3XFz8jLQaVCSaLA11dx2n64mq0cGvmi5+0wAmlT5ryIbMbKrpeekmYTCYZ+s1jND74F6VeeV88z8kZCQVPTDhi0/yyBBuBUjz//G0s+vv7aT3WSuSE00f/Uqby+WOUgpqAY8fa6ExYpTtQlp+rBG2eRDh37yZFKBTCNM3cDLtcLsck1U+R3fBUOTqRSDi1wNgjd7XTc7z7OB0dnSxLJsYNF4lEnLbOIUs2oKr+3W53bsaVgk4pnMzsFeaPYat7B+Ewbe3t6AP9pdWRzo2XLAEvsJ0NtCFL3LvrbicWizmsDg4N5ghQSldVVjn+WFVV5QioTDMajdLd3UNocJSsEagiRpE4NDSEL3RsdIyOVtql4ZCjFFNKKYJVNqmvq6eurhafz+d8r5QfGAg51aAaS405Mob6PRaLO9Xi4lB3qdlvEVvzLEBk3Orh7EXH8Xj+YVK6B/9AP3o8njmwVLPjdhOorMJ38mnoF27MECslw8MROjo7mfvSYwhNQ9ONnIBS2jSZJoHhPnyhg6PEPPiPGHOXUTscxkqnMwToOl6/n8raejyXfxp8PqcfRVBvXy/xt3ZQ0/oumqaj6VrubFlViAsskwXHdhcnwOZfR34dXQyleQAXtxW98BhqpvqXXxo9TxoLtUzNEqCgTFiZ4UW7HizVYhxcux5lzkQvnLculwmUFamZr205wClTGMOBYBjBf4485iKJ2MYgkgem1ltxKL+07Rlf4y0JZR1OpplOtWnziNhK28hjYQ8e7lOr2ZkIN2LqE2WB2YAThCdIgyXQhebcdcyhkIBnZAjJtz9QyT9cfJctsi1fgvE29EeOFbzx/1D5g2yV94/9cjwB6k6d7pwVRKYziqoB0mb6A40BKrWappU7WisDMQSXFnuteBRRt6nEJFdlikAFp97ePifPq5OdDwJqu03l/+HhYWzLLHeEryM5Wj4BCupeneR7ZXUf7neKk8OHm2k+coTOzi5kJDy76sci9PT0Ov2rgkyR7ErGJm+nLk/D/aWu0E98U1TtOKzn8ZJXZfOQXn4ZPUtXEQuHYXiAE1pewz/4fpnaTQ5ZvYTwyj9lQPeSjEao7D3KvMPPTtxOsJmtXDVWsandFs9cln4bpnmC/OFhGxGKXpae/KJkPir46kdQ+c2O8kEmDUQTE3CxuB3JHbMp2e8B9zk3xNXMl/GvM6UPRj56ykeczJV3KbocFK1X5QY+WsoLdqHxOfHfHJpq03Eu8BFTXi3gvsK5rJmO8gqFWWAdtyLKzP0fLsIIfoCLe8WzMzvYKYwBGp+ehbPiDxJqIfMwAR4Qv56dI71CAgTd/wcJOOZs2qp9yxfYLmZ6HjYGYwm4Bcki51/ef79Ql4gHEY4570fS4hzYpNkmtjF6X362AfwvvG5Pojz6v/sAAAAASUVORK5CYII=
  10. // @source https://github.com/lnm95/redditPlusPlus
  11. // @license MIT
  12. // @match *://*.reddit.com/*
  13. // @grant unsafeWindow
  14. // @grant GM_getValue
  15. // @grant GM_setValue
  16. // @run-at document-start
  17. // ==/UserScript==
  18.  
  19. /******/ (() => { // webpackBootstrap
  20. /******/ var __webpack_modules__ = ({
  21.  
  22. /***/ "./src/modules/app.less":
  23. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  24.  
  25. "use strict";
  26. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  27. /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
  28. /* harmony export */ });
  29. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/css-loader/dist/runtime/noSourceMaps.js");
  30. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
  31. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/css-loader/dist/runtime/api.js");
  32. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  33. // Imports
  34.  
  35.  
  36. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
  37. // Module
  38. ___CSS_LOADER_EXPORT___.push([module.id, `faceplate-banner {
  39. max-width: 1000px !important;
  40. }
  41. .pp_hidden {
  42. display: none;
  43. }
  44. `, ""]);
  45. // Exports
  46. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  47.  
  48.  
  49. /***/ }),
  50.  
  51. /***/ "./src/modules/biggerFonts.less":
  52. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  53.  
  54. "use strict";
  55. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  56. /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
  57. /* harmony export */ });
  58. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/css-loader/dist/runtime/noSourceMaps.js");
  59. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
  60. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/css-loader/dist/runtime/api.js");
  61. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  62. // Imports
  63.  
  64.  
  65. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
  66. // Module
  67. ___CSS_LOADER_EXPORT___.push([module.id, `:is(.text-14):not(.pp_defaultText .text-14) {
  68. font-size: 1rem !important;
  69. line-height: 1.4rem !important;
  70. }
  71. faceplate-hovercard .text-12 {
  72. font-size: 0.9rem !important;
  73. }
  74. shreddit-composer > div[role='textbox'] {
  75. font-size: 1rem !important;
  76. line-height: 1.4rem !important;
  77. }
  78. shreddit-comment-action-row {
  79. margin-bottom: 15px !important;
  80. }
  81. `, ""]);
  82. // Exports
  83. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  84.  
  85.  
  86. /***/ }),
  87.  
  88. /***/ "./src/modules/bookmark.less":
  89. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  90.  
  91. "use strict";
  92. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  93. /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
  94. /* harmony export */ });
  95. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/css-loader/dist/runtime/noSourceMaps.js");
  96. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
  97. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/css-loader/dist/runtime/api.js");
  98. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  99. // Imports
  100.  
  101.  
  102. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
  103. // Module
  104. ___CSS_LOADER_EXPORT___.push([module.id, `.pp_bookmark_hiddenButton {
  105. width: 32px;
  106. height: 32px;
  107. position: absolute;
  108. opacity: 0 !important;
  109. overflow: hidden;
  110. }
  111. .pp_bookmark_hiddenButton > div {
  112. padding: 0px !important;
  113. }
  114. .pp_bookmark_post {
  115. margin-right: 5px !important;
  116. }
  117. `, ""]);
  118. // Exports
  119. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  120.  
  121.  
  122. /***/ }),
  123.  
  124. /***/ "./src/modules/collapseAwards.less":
  125. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  126.  
  127. "use strict";
  128. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  129. /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
  130. /* harmony export */ });
  131. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/css-loader/dist/runtime/noSourceMaps.js");
  132. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
  133. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/css-loader/dist/runtime/api.js");
  134. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  135. // Imports
  136.  
  137.  
  138. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
  139. // Module
  140. ___CSS_LOADER_EXPORT___.push([module.id, `.pp_awardButton {
  141. max-width: 100px;
  142. opacity: 1;
  143. transition: all 0.5s !important;
  144. }
  145. .pp_awardButton_hidden {
  146. display: none;
  147. }
  148. .pp_awardButton_collapsed {
  149. max-width: 0px !important;
  150. opacity: 0 !important;
  151. visibility: hidden !important;
  152. }
  153. `, ""]);
  154. // Exports
  155. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  156.  
  157.  
  158. /***/ }),
  159.  
  160. /***/ "./src/modules/comments/comments.less":
  161. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  162.  
  163. "use strict";
  164. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  165. /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
  166. /* harmony export */ });
  167. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/css-loader/dist/runtime/noSourceMaps.js");
  168. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
  169. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/css-loader/dist/runtime/api.js");
  170. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  171. // Imports
  172.  
  173.  
  174. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
  175. // Module
  176. ___CSS_LOADER_EXPORT___.push([module.id, `.pp_muted_avatar {
  177. opacity: 0.5;
  178. }
  179. .pp_muted_content {
  180. color: var(--pp-color-muted-conent);
  181. transition: color 0.2s;
  182. }
  183. .pp_muted_content:hover {
  184. color: var(--pp-color-muted-conent-hover);
  185. }
  186. :root.theme-light {
  187. --pp-color-muted-conent: #a5a5a5 !important;
  188. --pp-color-muted-conent-hover: #636363 !important;
  189. }
  190. :root {
  191. --pp-color-muted-conent: #595959;
  192. --pp-color-muted-conent-hover: #adadad;
  193. }
  194. `, ""]);
  195. // Exports
  196. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  197.  
  198.  
  199. /***/ }),
  200.  
  201. /***/ "./src/modules/comments/hideShare.less":
  202. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  203.  
  204. "use strict";
  205. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  206. /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
  207. /* harmony export */ });
  208. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/css-loader/dist/runtime/noSourceMaps.js");
  209. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
  210. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/css-loader/dist/runtime/api.js");
  211. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  212. // Imports
  213.  
  214.  
  215. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
  216. // Module
  217. ___CSS_LOADER_EXPORT___.push([module.id, `shreddit-comment-share-button {
  218. display: none !important;
  219. }
  220. `, ""]);
  221. // Exports
  222. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  223.  
  224.  
  225. /***/ }),
  226.  
  227. /***/ "./src/modules/comments/sortButtons.less":
  228. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  229.  
  230. "use strict";
  231. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  232. /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
  233. /* harmony export */ });
  234. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/css-loader/dist/runtime/noSourceMaps.js");
  235. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
  236. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/css-loader/dist/runtime/api.js");
  237. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  238. // Imports
  239.  
  240.  
  241. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
  242. // Module
  243. ___CSS_LOADER_EXPORT___.push([module.id, `.pp_sortDropdown_hidden {
  244. display: none;
  245. }
  246. .pp_sortButton {
  247. color: var(--color-neutral-content-weak);
  248. font: var(--font-button-sm);
  249. text-wrap: nowrap;
  250. border-radius: 32px;
  251. height: 32px;
  252. padding-left: 10px;
  253. padding-right: 14px;
  254. gap: 4px;
  255. display: flex;
  256. justify-content: center;
  257. align-items: center;
  258. cursor: pointer;
  259. margin-left: 5px;
  260. }
  261. .pp_sortButton > span {
  262. display: flex;
  263. justify-content: center;
  264. align-items: center;
  265. }
  266. .pp_sortButton:hover {
  267. background-color: var(--color-button-plain-background-hover) !important;
  268. }
  269. .pp_sortButton_active {
  270. color: var(--color-neutral-content-strong) !important;
  271. background-color: var(--color-secondary-background-selected);
  272. }
  273. `, ""]);
  274. // Exports
  275. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  276.  
  277.  
  278. /***/ }),
  279.  
  280. /***/ "./src/modules/comments/userTags.less":
  281. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  282.  
  283. "use strict";
  284. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  285. /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
  286. /* harmony export */ });
  287. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/css-loader/dist/runtime/noSourceMaps.js");
  288. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
  289. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/css-loader/dist/runtime/api.js");
  290. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  291. // Imports
  292.  
  293.  
  294. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
  295. // Module
  296. ___CSS_LOADER_EXPORT___.push([module.id, `.pp_tagsPanel {
  297. display: flex;
  298. justify-content: space-around;
  299. width: auto;
  300. border-bottom: solid 1px var(--color-neutral-border-weak);
  301. padding: 4px;
  302. gap: 8px;
  303. margin-bottom: 4px;
  304. }
  305. .pp_tagButton {
  306. cursor: pointer;
  307. display: flex;
  308. align-content: center;
  309. flex-wrap: wrap;
  310. height: 45px;
  311. padding: 4px 20px;
  312. margin: 0px 0px;
  313. color: var(--color-neutral-border-weak);
  314. border-radius: 5px;
  315. }
  316. .pp_tagButton svg {
  317. width: 20px;
  318. transition: transform 0.15s;
  319. }
  320. .pp_tagButton:hover svg {
  321. transform: scale(1.2, 1.2);
  322. transition: transform 0.3s;
  323. }
  324. .pp_tagButton:hover {
  325. background-color: var(--color-neutral-background-hover);
  326. }
  327. .pp_tagButtonActive:hover {
  328. opacity: 0.8;
  329. }
  330. .pp_tagHint_offset {
  331. left: 50%;
  332. position: absolute;
  333. }
  334. .pp_tagHintContainer {
  335. display: flex;
  336. justify-content: center;
  337. position: fixed;
  338. }
  339. .pp_tagHint {
  340. display: flex;
  341. align-items: center;
  342. position: absolute;
  343. top: -35px;
  344. height: 25px;
  345. padding: 0px 12px;
  346. color: var(--color-neutral-background-weak);
  347. font: var(--font-small);
  348. background-color: var(--color-neutral-content-strong);
  349. border-radius: 5px;
  350. }
  351. `, ""]);
  352. // Exports
  353. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  354.  
  355.  
  356. /***/ }),
  357.  
  358. /***/ "./src/modules/feed/feedButtons.less":
  359. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  360.  
  361. "use strict";
  362. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  363. /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
  364. /* harmony export */ });
  365. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/css-loader/dist/runtime/noSourceMaps.js");
  366. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
  367. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/css-loader/dist/runtime/api.js");
  368. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  369. // Imports
  370.  
  371.  
  372. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
  373. // Module
  374. ___CSS_LOADER_EXPORT___.push([module.id, `.pp_feedPanel {
  375. flex-direction: row;
  376. }
  377. .pp_feedPanel_space {
  378. width: 100%;
  379. }
  380. .pp_defaultFeed_mark {
  381. color: var(--color-neutral-content-weak);
  382. border-radius: 18px;
  383. display: flex;
  384. align-items: center;
  385. margin: 0px 5px 9px 5px;
  386. padding: 0px 8px;
  387. position: relative;
  388. cursor: pointer;
  389. }
  390. .pp_defaultFeed_mark:hover {
  391. background-color: var(--button-color-background-hover);
  392. }
  393. .pp_defaultFeed_mark:active {
  394. background-color: var(--button-color-background-activated);
  395. }
  396. .pp_defaultFeed_mark_hint {
  397. display: none;
  398. position: absolute;
  399. top: -32px;
  400. left: 16px;
  401. }
  402. .pp_defaultFeed_mark:hover > .pp_defaultFeed_mark_hint {
  403. display: block !important;
  404. }
  405. .pp_defaultFeed_mark_hint > span {
  406. color: #c7c7c7;
  407. background-color: rgba(0, 0, 0, 0.712);
  408. text-wrap-mode: nowrap;
  409. border-radius: 18px;
  410. padding: 4px 8px;
  411. position: relative;
  412. left: -50%;
  413. }
  414. .pp_feedButtonsContainer {
  415. justify-content: space-between;
  416. height: 40px !important;
  417. }
  418. .pp_feedButton {
  419. gap: 0.25rem !important;
  420. }
  421. .pp_feedContainer {
  422. gap: 0.25rem;
  423. height: 40px;
  424. }
  425. `, ""]);
  426. // Exports
  427. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  428.  
  429.  
  430. /***/ }),
  431.  
  432. /***/ "./src/modules/header.less":
  433. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  434.  
  435. "use strict";
  436. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  437. /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
  438. /* harmony export */ });
  439. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/css-loader/dist/runtime/noSourceMaps.js");
  440. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
  441. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/css-loader/dist/runtime/api.js");
  442. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  443. // Imports
  444.  
  445.  
  446. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
  447. // Module
  448. ___CSS_LOADER_EXPORT___.push([module.id, `#reddit-logo {
  449. text-decoration: none;
  450. }
  451. .pp_logo {
  452. width: max-content;
  453. color: var(--shreddit-color-wordmark);
  454. font-size: 22px;
  455. font-weight: 1000;
  456. letter-spacing: -2px;
  457. }
  458. `, ""]);
  459. // Exports
  460. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  461.  
  462.  
  463. /***/ }),
  464.  
  465. /***/ "./src/modules/notifications.less":
  466. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  467.  
  468. "use strict";
  469. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  470. /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
  471. /* harmony export */ });
  472. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/css-loader/dist/runtime/noSourceMaps.js");
  473. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
  474. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/css-loader/dist/runtime/api.js");
  475. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  476. // Imports
  477.  
  478.  
  479. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
  480. // Module
  481. ___CSS_LOADER_EXPORT___.push([module.id, `click-card > div[slot='content'] {
  482. width: 410px !important;
  483. max-width: 410px !important;
  484. }
  485. click-card > div[slot='content'] > div {
  486. max-height: 550px !important;
  487. }
  488. notification-item > a {
  489. width: 100% !important;
  490. }
  491. div[data-testid='notification-item'] > .flex {
  492. padding: 0rem 0rem 0.5rem 0.5rem !important;
  493. width: 100%;
  494. }
  495. div[data-testid='notification-item'] > div > div > button {
  496. display: none !important;
  497. }
  498. div[data-testid='body'] {
  499. font-size: 1rem !important;
  500. line-height: 1.1rem !important;
  501. padding-top: 0.5rem;
  502. }
  503. `, ""]);
  504. // Exports
  505. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  506.  
  507.  
  508. /***/ }),
  509.  
  510. /***/ "./src/modules/posts/posts.less":
  511. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  512.  
  513. "use strict";
  514. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  515. /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
  516. /* harmony export */ });
  517. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/css-loader/dist/runtime/noSourceMaps.js");
  518. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
  519. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/css-loader/dist/runtime/api.js");
  520. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  521. // Imports
  522.  
  523.  
  524. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
  525. // Module
  526. ___CSS_LOADER_EXPORT___.push([module.id, `.pp_post_shareButton :is(span):not(.flex) {
  527. visibility: hidden !important;
  528. max-width: 0px;
  529. }
  530. .pp_post_shareButton .text-16 {
  531. margin-right: 0px !important;
  532. }
  533. .pp_post_tittle {
  534. text-decoration: none !important;
  535. }
  536. .pp_post_noWrap {
  537. line-clamp: 999;
  538. -webkit-line-clamp: 999;
  539. }
  540. .pp_post_unwrapContainer {
  541. position: relative;
  542. height: 0px;
  543. bottom: 0px;
  544. display: flex;
  545. justify-content: flex-end;
  546. z-index: 10;
  547. }
  548. .pp_post_unwrapButton {
  549. position: relative;
  550. background-color: var(--color-button-secondary-background);
  551. width: 46px;
  552. height: 46px;
  553. bottom: 50px;
  554. display: flex;
  555. justify-content: center;
  556. align-items: center;
  557. border-radius: 50px;
  558. color: var(--color-button-secondary-text);
  559. margin-right: 15px;
  560. pointer-events: fill !important;
  561. z-index: 10;
  562. }
  563. `, ""]);
  564. // Exports
  565. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  566.  
  567.  
  568. /***/ }),
  569.  
  570. /***/ "./src/modules/posts/postsBackplates.less":
  571. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  572.  
  573. "use strict";
  574. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  575. /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
  576. /* harmony export */ });
  577. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/css-loader/dist/runtime/noSourceMaps.js");
  578. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
  579. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/css-loader/dist/runtime/api.js");
  580. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  581. // Imports
  582.  
  583.  
  584. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
  585. // Module
  586. ___CSS_LOADER_EXPORT___.push([module.id, `article > shreddit-post {
  587. background-color: #00000000 !important;
  588. padding-top: 10px !important;
  589. margin-top: 10px !important;
  590. margin-bottom: 10px !important;
  591. }
  592. article > shreddit-post::before {
  593. border-radius: 15px !important;
  594. position: absolute;
  595. content: '';
  596. top: 0;
  597. right: 0;
  598. bottom: 0;
  599. left: 0;
  600. opacity: 0;
  601. z-index: -1;
  602. background: linear-gradient(var(--color-neutral-background-hover), var(--color-neutral-background));
  603. transition: opacity 0.2s;
  604. }
  605. article > shreddit-post:hover::before {
  606. opacity: 1;
  607. }
  608. shreddit-post[gold-count]:not(shreddit-post[gold-count='']) {
  609. background-image: linear-gradient(rgba(255, 214, 53, 0.2), rgba(255, 214, 53, 0)) !important;
  610. }
  611. shreddit-post[gold-count]:not(shreddit-post[gold-count=''])::before {
  612. background: linear-gradient(#fbed2966, var(--color-neutral-background)) !important;
  613. }
  614. .stickied::after {
  615. border-radius: 15px !important;
  616. position: absolute;
  617. content: '';
  618. top: 0;
  619. right: 0;
  620. bottom: 0;
  621. left: 0;
  622. opacity: 1;
  623. z-index: -2;
  624. background: linear-gradient(var(--stickiedColor), var(--color-neutral-background)) !important;
  625. }
  626. .stickied::before {
  627. background: linear-gradient(var(--stickiedHoverColor), var(--color-neutral-background)) !important;
  628. }
  629. :root.theme-light {
  630. --stickiedColor: #0e8a001c !important;
  631. --stickiedHoverColor: #18900b3d !important;
  632. }
  633. :root {
  634. --stickiedColor: #0e8a001c;
  635. --stickiedHoverColor: #18900b3d;
  636. }
  637. `, ""]);
  638. // Exports
  639. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  640.  
  641.  
  642. /***/ }),
  643.  
  644. /***/ "./src/modules/redirect.less":
  645. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  646.  
  647. "use strict";
  648. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  649. /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
  650. /* harmony export */ });
  651. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/css-loader/dist/runtime/noSourceMaps.js");
  652. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
  653. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/css-loader/dist/runtime/api.js");
  654. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  655. // Imports
  656.  
  657.  
  658. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
  659. // Module
  660. ___CSS_LOADER_EXPORT___.push([module.id, `.pp_redirectContainer {
  661. position: fixed;
  662. bottom: 70px;
  663. width: 100%;
  664. display: flex;
  665. align-items: flex-end;
  666. justify-content: center;
  667. z-index: 100;
  668. }
  669. .pp_redirectBox {
  670. background: #000000bf;
  671. width: 600px;
  672. height: 70px;
  673. border-radius: 20px;
  674. color: white;
  675. font-weight: 700;
  676. display: flex;
  677. justify-content: center;
  678. align-items: center;
  679. cursor: pointer;
  680. }
  681. `, ""]);
  682. // Exports
  683. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  684.  
  685.  
  686. /***/ }),
  687.  
  688. /***/ "./src/modules/scrollToTop.less":
  689. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  690.  
  691. "use strict";
  692. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  693. /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
  694. /* harmony export */ });
  695. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/css-loader/dist/runtime/noSourceMaps.js");
  696. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
  697. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/css-loader/dist/runtime/api.js");
  698. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  699. // Imports
  700.  
  701.  
  702. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
  703. // Module
  704. ___CSS_LOADER_EXPORT___.push([module.id, `.pp_scrollToTop {
  705. position: fixed;
  706. width: 100px;
  707. height: 100%;
  708. bottom: 0px;
  709. background: linear-gradient(0deg, var(--scrollLineColor) 1%, var(--scrollLineTransparentColor) 30%);
  710. display: flex;
  711. justify-content: center;
  712. align-items: flex-end;
  713. padding-bottom: 20px;
  714. cursor: pointer;
  715. color: var(--scrollLineTransparentColor);
  716. transition: all 0.2s ease-in;
  717. }
  718. .pp_scrollToTop_inverted {
  719. transform: scale(1, -1);
  720. }
  721. .pp_scrollToTop_hidden {
  722. visibility: hidden;
  723. }
  724. .pp_scrollToTop_hidden::before {
  725. visibility: hidden;
  726. }
  727. .pp_scrollToTop:hover {
  728. padding-bottom: 50px !important;
  729. color: var(--scrollButtonColor);
  730. transition: all 0.2s ease-out;
  731. }
  732. .pp_scrollToTop::before {
  733. position: absolute;
  734. content: '';
  735. top: 0;
  736. right: 0;
  737. bottom: 0;
  738. left: 0;
  739. opacity: 0;
  740. z-index: -1;
  741. background: linear-gradient(0deg, var(--scrollLineColor) 5%, var(--scrollLineTransparentColor) 50%);
  742. transition: opacity 0.2s ease-in;
  743. }
  744. .pp_scrollToTop:hover::before {
  745. opacity: 1;
  746. transition: opacity 0.2s ease-out;
  747. }
  748. :root.theme-light {
  749. --scrollLineColor: #e5ebee6e !important;
  750. --scrollLineTransparentColor: #e5ebee00 !important;
  751. --scrollButtonColor: #c9d1d4c2 !important;
  752. }
  753. :root {
  754. --scrollLineColor: #3f484d33;
  755. --scrollLineTransparentColor: #30343600;
  756. --scrollButtonColor: #969a9c;
  757. }
  758. `, ""]);
  759. // Exports
  760. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  761.  
  762.  
  763. /***/ }),
  764.  
  765. /***/ "./src/modules/settings/settingsWindow.less":
  766. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  767.  
  768. "use strict";
  769. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  770. /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
  771. /* harmony export */ });
  772. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/css-loader/dist/runtime/noSourceMaps.js");
  773. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
  774. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/css-loader/dist/runtime/api.js");
  775. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  776. // Imports
  777.  
  778.  
  779. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
  780. // Module
  781. ___CSS_LOADER_EXPORT___.push([module.id, `.pp_settings_subtittle {
  782. font-size: 10px;
  783. font-weight: 700;
  784. letter-spacing: 0.5px;
  785. line-height: 12px;
  786. min-height: 20px;
  787. color: #7c7c7c;
  788. text-transform: uppercase;
  789. border-bottom: 1px solid #edeff1;
  790. margin-top: 1rem;
  791. padding: 0rem 3rem;
  792. }
  793. .pp_settings_property_oneLine {
  794. height: 2.25rem !important;
  795. }
  796. .pp_settings_propertyHeader {
  797. display: flex;
  798. flex-direction: column;
  799. margin-left: 3rem;
  800. justify-content: center;
  801. }
  802. .pp_settings_propertyHeader_tittle {
  803. font-size: 16px;
  804. font-weight: 500;
  805. line-height: 20px;
  806. margin-bottom: 4px;
  807. }
  808. .pp_settings_propertyHeader_description {
  809. font-size: 12px;
  810. font-weight: 400;
  811. line-height: 16px;
  812. color: #7c7c7c;
  813. }
  814. .pp_settings_propertyButtonContainer {
  815. display: flex;
  816. align-items: center;
  817. justify-content: flex-end;
  818. flex-grow: 1;
  819. }
  820. .pp_settings_changesBannerContainer {
  821. position: absolute;
  822. top: 0px;
  823. width: 900px;
  824. overflow-y: hidden;
  825. opacity: 0;
  826. transition: opacity 0.15s ease-in-out;
  827. }
  828. .pp_settings_changesBanner {
  829. display: flex;
  830. justify-content: center;
  831. margin: 2rem 15%;
  832. padding: 1rem;
  833. border-radius: 15px;
  834. background-color: #ffd40017;
  835. border: solid 1px #ffd400;
  836. color: #d7b300;
  837. font-weight: 500;
  838. }
  839. .pp_settings_changesBanner_active {
  840. opacity: 1 !important;
  841. }
  842. .pp_settings_arrowArea {
  843. width: 200px;
  844. min-width: 200px;
  845. display: flex;
  846. justify-content: center;
  847. align-items: center;
  848. gap: 10px;
  849. }
  850. .pp_settings_arrow {
  851. display: flex;
  852. justify-content: center;
  853. align-items: center;
  854. }
  855. .pp_settings_arrowLeft {
  856. transform: scale(-1, 1);
  857. }
  858. `, ""]);
  859. // Exports
  860. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  861.  
  862.  
  863. /***/ }),
  864.  
  865. /***/ "./src/modules/sidebar/sidebar.less":
  866. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  867.  
  868. "use strict";
  869. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  870. /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
  871. /* harmony export */ });
  872. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/css-loader/dist/runtime/noSourceMaps.js");
  873. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
  874. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/css-loader/dist/runtime/api.js");
  875. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  876. // Imports
  877.  
  878.  
  879. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
  880. // Module
  881. ___CSS_LOADER_EXPORT___.push([module.id, `.pp_sidebar_loadingSection {
  882. max-height: 0px !important;
  883. visibility: hidden !important;
  884. }
  885. .pp_sidebar_loadingSection > details {
  886. max-height: 0px !important;
  887. }
  888. .pp_sidebar_collapsedSection {
  889. max-height: 43px !important;
  890. overflow-y: hidden !important;
  891. }
  892. `, ""]);
  893. // Exports
  894. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  895.  
  896.  
  897. /***/ }),
  898.  
  899. /***/ "./src/modules/sidebar/subFilter.less":
  900. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  901.  
  902. "use strict";
  903. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  904. /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
  905. /* harmony export */ });
  906. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/css-loader/dist/runtime/noSourceMaps.js");
  907. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
  908. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/css-loader/dist/runtime/api.js");
  909. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  910. // Imports
  911.  
  912.  
  913. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
  914. // Module
  915. ___CSS_LOADER_EXPORT___.push([module.id, `.pp_subFilter_container {
  916. display: flex;
  917. flex-direction: row;
  918. justify-content: space-between;
  919. margin-bottom: 4px;
  920. }
  921. .pp_subFilter {
  922. border-color: var(--color-neutral-border-weak);
  923. color: var(--color-secondary-weak);
  924. font-weight: 400;
  925. display: flex;
  926. justify-content: center;
  927. width: 100%;
  928. height: 40px;
  929. color: var(--color-secondary-plain);
  930. }
  931. .pp_subFilter:hover {
  932. background: var(--color-input-secondary-hover) !important;
  933. }
  934. .pp_subFilter:focus {
  935. border-color: var(--color-neutral-content-weak) !important;
  936. }
  937. .pp_subFilter_span {
  938. width: 100%;
  939. margin: 0px 16px;
  940. display: flex;
  941. justify-content: flex-start;
  942. align-items: center;
  943. gap: 6px;
  944. }
  945. .pp_subFilter_span > span {
  946. display: flex;
  947. justify-content: center;
  948. align-items: center;
  949. }
  950. .pp_subFilter_input {
  951. width: 100%;
  952. background: 0 0;
  953. border: none;
  954. outline: 0;
  955. text-overflow: ellipsis;
  956. color: var(--color-neutral-content-strong);
  957. font: inherit;
  958. padding: 0px;
  959. margin: 0px;
  960. }
  961. .pp_pp_subFilter_clearContainer {
  962. position: relative;
  963. width: 0px;
  964. }
  965. .pp_subFilter_clear {
  966. position: relative;
  967. right: 40px;
  968. top: 4px;
  969. border-radius: 32px;
  970. width: 32px;
  971. height: 32px;
  972. display: flex;
  973. justify-content: center;
  974. align-items: center;
  975. }
  976. `, ""]);
  977. // Exports
  978. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  979.  
  980.  
  981. /***/ }),
  982.  
  983. /***/ "./src/modules/subs/flairBar.less":
  984. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  985.  
  986. "use strict";
  987. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  988. /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
  989. /* harmony export */ });
  990. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/css-loader/dist/runtime/noSourceMaps.js");
  991. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
  992. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/css-loader/dist/runtime/api.js");
  993. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  994. // Imports
  995.  
  996.  
  997. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
  998. // Module
  999. ___CSS_LOADER_EXPORT___.push([module.id, `.pp_flairBar {
  1000. display: flex;
  1001. flex-direction: row;
  1002. overflow: hidden;
  1003. }
  1004. .pp_flairBar_highlights {
  1005. padding-bottom: 10px;
  1006. }
  1007. .pp_flairBar_list {
  1008. margin-top: 5px !important;
  1009. flex-wrap: nowrap !important;
  1010. position: relative;
  1011. }
  1012. .pp_flairBar_listSmoothed {
  1013. transition: left 0.1s ease-out;
  1014. }
  1015. .pp_flairBar_bordersContainer {
  1016. width: 100%;
  1017. display: flex;
  1018. justify-content: space-between;
  1019. }
  1020. .pp_flairBar_preBorder {
  1021. width: 20px;
  1022. }
  1023. .pp_flairBar_border {
  1024. z-index: 1;
  1025. position: absolute;
  1026. height: 40px;
  1027. width: 20px;
  1028. margin-top: 5px;
  1029. background: linear-gradient(var(--flair-border-orientation), var(--color-neutral-background), 60%, var(--color-neutral-background-transparent));
  1030. }
  1031. .pp_flairBar_border_left {
  1032. --flair-border-orientation: 90deg;
  1033. }
  1034. .pp_flairBar_border_right {
  1035. --flair-border-orientation: 270deg;
  1036. }
  1037. :root.theme-light {
  1038. --color-neutral-background-transparent: #fff0 !important;
  1039. }
  1040. :root {
  1041. --color-neutral-background-transparent: #0b141600;
  1042. }
  1043. `, ""]);
  1044. // Exports
  1045. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1046.  
  1047.  
  1048. /***/ }),
  1049.  
  1050. /***/ "./src/modules/subs/flairWindow.less":
  1051. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1052.  
  1053. "use strict";
  1054. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1055. /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
  1056. /* harmony export */ });
  1057. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/css-loader/dist/runtime/noSourceMaps.js");
  1058. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
  1059. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/css-loader/dist/runtime/api.js");
  1060. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  1061. // Imports
  1062.  
  1063.  
  1064. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
  1065. // Module
  1066. ___CSS_LOADER_EXPORT___.push([module.id, `.pp_flairWindow_flairContainer {
  1067. width: 100%;
  1068. display: flex;
  1069. align-items: center;
  1070. margin-left: 3rem;
  1071. }
  1072. .pp_flairWindow_columnTittle {
  1073. margin: 20px 57px 10px 40px;
  1074. }
  1075. `, ""]);
  1076. // Exports
  1077. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1078.  
  1079.  
  1080. /***/ }),
  1081.  
  1082. /***/ "./src/modules/subs/subs.less":
  1083. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1084.  
  1085. "use strict";
  1086. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1087. /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
  1088. /* harmony export */ });
  1089. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/css-loader/dist/runtime/noSourceMaps.js");
  1090. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
  1091. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/css-loader/dist/runtime/api.js");
  1092. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  1093. // Imports
  1094.  
  1095.  
  1096. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
  1097. // Module
  1098. ___CSS_LOADER_EXPORT___.push([module.id, `.masthead > section > div {
  1099. display: flex;
  1100. flex-direction: column;
  1101. align-items: flex-start;
  1102. }
  1103. .masthead > section > div > div:last-child {
  1104. align-self: flex-end;
  1105. }
  1106. .pp_mastheadSection {
  1107. top: -3rem;
  1108. }
  1109. .pp_mastheadSection > div {
  1110. gap: 1rem;
  1111. }
  1112. `, ""]);
  1113. // Exports
  1114. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1115.  
  1116.  
  1117. /***/ }),
  1118.  
  1119. /***/ "./src/modules/wideMode.less":
  1120. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1121.  
  1122. "use strict";
  1123. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1124. /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
  1125. /* harmony export */ });
  1126. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/css-loader/dist/runtime/noSourceMaps.js");
  1127. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
  1128. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/css-loader/dist/runtime/api.js");
  1129. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  1130. // Imports
  1131.  
  1132.  
  1133. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
  1134. // Module
  1135. ___CSS_LOADER_EXPORT___.push([module.id, `@media (min-width: 1392px) {
  1136. .pp_pageContainer {
  1137. margin-right: 300px;
  1138. }
  1139. .pp_mainFeed {
  1140. width: var(--pp-content-width) !important;
  1141. position: relative;
  1142. left: var(--pp-content-offset);
  1143. }
  1144. .pp_mainFeed > div > main {
  1145. max-width: var(--pp-content-width) !important;
  1146. }
  1147. .pp_rightSidebar {
  1148. grid-column-start: 3;
  1149. order: 10;
  1150. }
  1151. #right-sidebar-container {
  1152. position: fixed;
  1153. right: 0px;
  1154. margin: 15px 10px 0px 0px;
  1155. }
  1156. .pp_rightSidebar_contextLookup {
  1157. grid-column-start: 3;
  1158. order: 10;
  1159. position: fixed;
  1160. right: 0px;
  1161. margin: 15px 10px 0px 0px;
  1162. }
  1163. }
  1164. `, ""]);
  1165. // Exports
  1166. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1167.  
  1168.  
  1169. /***/ }),
  1170.  
  1171. /***/ "./src/utils/checkbox.less":
  1172. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1173.  
  1174. "use strict";
  1175. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1176. /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
  1177. /* harmony export */ });
  1178. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/css-loader/dist/runtime/noSourceMaps.js");
  1179. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
  1180. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/css-loader/dist/runtime/api.js");
  1181. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  1182. // Imports
  1183.  
  1184.  
  1185. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
  1186. // Module
  1187. ___CSS_LOADER_EXPORT___.push([module.id, `.pp_checkBox_container {
  1188. float: right;
  1189. position: relative;
  1190. }
  1191. .pp_checkBox_buttonActive {
  1192. justify-content: flex-end !important;
  1193. background-color: #0079d3 !important;
  1194. }
  1195. .pp_checkBox_button {
  1196. position: relative;
  1197. cursor: pointer;
  1198. overflow: visible;
  1199. display: flex;
  1200. justify-content: start;
  1201. background: transparent;
  1202. background-color: var(--checkBox-background);
  1203. padding: initial;
  1204. height: 24px;
  1205. width: 37.5px;
  1206. border-radius: 100px;
  1207. border: 2px solid transparent;
  1208. transition: background-color 0.2s linear;
  1209. }
  1210. .pp_checkBox_knob {
  1211. height: 19.5px;
  1212. width: 19.5px;
  1213. background-color: #fff;
  1214. box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1), 0 2px 3px 0 rgba(0, 0, 0, 0.2);
  1215. transition: 0.5s linear;
  1216. border-radius: 57%;
  1217. }
  1218. .pp_checkBox_panelArea {
  1219. width: 200px;
  1220. min-width: 200px;
  1221. display: flex;
  1222. justify-content: center;
  1223. align-items: center;
  1224. }
  1225. :root.theme-light {
  1226. --checkBox-background: #1a1a1b1a !important;
  1227. }
  1228. :root {
  1229. --checkBox-background: #81818152;
  1230. }
  1231. `, ""]);
  1232. // Exports
  1233. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1234.  
  1235.  
  1236. /***/ }),
  1237.  
  1238. /***/ "./src/utils/imageViewer.less":
  1239. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1240.  
  1241. "use strict";
  1242. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1243. /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
  1244. /* harmony export */ });
  1245. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/css-loader/dist/runtime/noSourceMaps.js");
  1246. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
  1247. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/css-loader/dist/runtime/api.js");
  1248. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  1249. // Imports
  1250.  
  1251.  
  1252. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
  1253. // Module
  1254. ___CSS_LOADER_EXPORT___.push([module.id, `.pp_imageViewable {
  1255. cursor: pointer;
  1256. }
  1257. .pp_imageViewer {
  1258. display: flex;
  1259. justify-content: center;
  1260. align-items: center;
  1261. position: fixed;
  1262. top: 0px;
  1263. z-index: 10;
  1264. cursor: pointer;
  1265. width: 100%;
  1266. height: 100%;
  1267. background-color: #000000b3;
  1268. }
  1269. .pp_imageViewer_closeButton {
  1270. display: flex;
  1271. align-items: center;
  1272. justify-content: center;
  1273. position: fixed;
  1274. top: 50px;
  1275. z-index: 11;
  1276. right: 50px;
  1277. cursor: pointer;
  1278. width: 50px;
  1279. height: 50px;
  1280. color: #ffffff9c;
  1281. background-color: #00000069;
  1282. border-radius: 30px;
  1283. }
  1284. .pp_imageViewer_closeButton:hover {
  1285. color: #ffffffc7;
  1286. }
  1287. .pp_imageViewer_imageContainer {
  1288. display: flex;
  1289. justify-content: center;
  1290. align-items: center;
  1291. width: 80%;
  1292. height: 90%;
  1293. }
  1294. .pp_imageViewer_imageContainer:not(.pp_imageViewer_drag) {
  1295. transition: transform 0.5s;
  1296. }
  1297. .pp_imageViewer_image {
  1298. cursor: grab;
  1299. object-fit: scale-down;
  1300. max-width: 100%;
  1301. max-height: 100%;
  1302. box-shadow: 0px 0px 20px 3px #14141485;
  1303. }
  1304. .pp_imageViewer_image:active {
  1305. cursor: grabbing;
  1306. }
  1307. `, ""]);
  1308. // Exports
  1309. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1310.  
  1311.  
  1312. /***/ }),
  1313.  
  1314. /***/ "./src/utils/window.less":
  1315. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1316.  
  1317. "use strict";
  1318. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1319. /* harmony export */ A: () => (__WEBPACK_DEFAULT_EXPORT__)
  1320. /* harmony export */ });
  1321. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("./node_modules/css-loader/dist/runtime/noSourceMaps.js");
  1322. /* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);
  1323. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./node_modules/css-loader/dist/runtime/api.js");
  1324. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);
  1325. // Imports
  1326.  
  1327.  
  1328. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
  1329. // Module
  1330. ___CSS_LOADER_EXPORT___.push([module.id, `.pp_window_container {
  1331. cursor: pointer;
  1332. position: fixed;
  1333. top: 0px;
  1334. z-index: 10;
  1335. width: 100%;
  1336. height: 100%;
  1337. display: flex;
  1338. justify-content: center;
  1339. align-items: center;
  1340. background-color: #000000b3;
  1341. }
  1342. .pp_window {
  1343. cursor: auto;
  1344. display: flex;
  1345. flex-direction: column;
  1346. width: 900px;
  1347. height: fit-content;
  1348. min-height: 200px;
  1349. max-height: 75%;
  1350. border-radius: 15px;
  1351. background-color: var(--color-neutral-background);
  1352. box-shadow: 0px 0px 50px 0px #00000070;
  1353. }
  1354. .pp_window_tittleContainer {
  1355. height: 48px;
  1356. margin: 1rem;
  1357. display: flex;
  1358. flex-direction: row;
  1359. justify-content: space-between;
  1360. align-items: center;
  1361. }
  1362. .pp_window_tittle {
  1363. margin-left: 1rem;
  1364. }
  1365. .pp_window_closeButton {
  1366. margin: 1rem;
  1367. }
  1368. .pp_window_content {
  1369. display: flex;
  1370. flex-direction: column;
  1371. overflow-y: overlay;
  1372. }
  1373. .pp_window_footer {
  1374. height: 2rem;
  1375. min-height: 2rem;
  1376. }
  1377. .pp_window_elementsContainer {
  1378. display: flex;
  1379. flex-direction: column;
  1380. padding: 0px;
  1381. margin: 20px 40px;
  1382. gap: 0.5rem;
  1383. }
  1384. .pp_window_element {
  1385. display: flex;
  1386. flex-direction: row;
  1387. justify-content: flex-end;
  1388. height: 3rem;
  1389. }
  1390. .pp_window_elementsContainer > .pp_window_element:hover {
  1391. background-color: var(--color-neutral-background-hover);
  1392. border-radius: 15px;
  1393. }
  1394. .pp_window_scrollContent {
  1395. overflow-y: scroll;
  1396. }
  1397. `, ""]);
  1398. // Exports
  1399. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1400.  
  1401.  
  1402. /***/ }),
  1403.  
  1404. /***/ "./node_modules/css-loader/dist/runtime/api.js":
  1405. /***/ ((module) => {
  1406.  
  1407. "use strict";
  1408.  
  1409.  
  1410. /*
  1411. MIT License http://www.opensource.org/licenses/mit-license.php
  1412. Author Tobias Koppers @sokra
  1413. */
  1414. module.exports = function (cssWithMappingToString) {
  1415. var list = [];
  1416.  
  1417. // return the list of modules as css string
  1418. list.toString = function toString() {
  1419. return this.map(function (item) {
  1420. var content = "";
  1421. var needLayer = typeof item[5] !== "undefined";
  1422. if (item[4]) {
  1423. content += "@supports (".concat(item[4], ") {");
  1424. }
  1425. if (item[2]) {
  1426. content += "@media ".concat(item[2], " {");
  1427. }
  1428. if (needLayer) {
  1429. content += "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {");
  1430. }
  1431. content += cssWithMappingToString(item);
  1432. if (needLayer) {
  1433. content += "}";
  1434. }
  1435. if (item[2]) {
  1436. content += "}";
  1437. }
  1438. if (item[4]) {
  1439. content += "}";
  1440. }
  1441. return content;
  1442. }).join("");
  1443. };
  1444.  
  1445. // import a list of modules into the list
  1446. list.i = function i(modules, media, dedupe, supports, layer) {
  1447. if (typeof modules === "string") {
  1448. modules = [[null, modules, undefined]];
  1449. }
  1450. var alreadyImportedModules = {};
  1451. if (dedupe) {
  1452. for (var k = 0; k < this.length; k++) {
  1453. var id = this[k][0];
  1454. if (id != null) {
  1455. alreadyImportedModules[id] = true;
  1456. }
  1457. }
  1458. }
  1459. for (var _k = 0; _k < modules.length; _k++) {
  1460. var item = [].concat(modules[_k]);
  1461. if (dedupe && alreadyImportedModules[item[0]]) {
  1462. continue;
  1463. }
  1464. if (typeof layer !== "undefined") {
  1465. if (typeof item[5] === "undefined") {
  1466. item[5] = layer;
  1467. } else {
  1468. item[1] = "@layer".concat(item[5].length > 0 ? " ".concat(item[5]) : "", " {").concat(item[1], "}");
  1469. item[5] = layer;
  1470. }
  1471. }
  1472. if (media) {
  1473. if (!item[2]) {
  1474. item[2] = media;
  1475. } else {
  1476. item[1] = "@media ".concat(item[2], " {").concat(item[1], "}");
  1477. item[2] = media;
  1478. }
  1479. }
  1480. if (supports) {
  1481. if (!item[4]) {
  1482. item[4] = "".concat(supports);
  1483. } else {
  1484. item[1] = "@supports (".concat(item[4], ") {").concat(item[1], "}");
  1485. item[4] = supports;
  1486. }
  1487. }
  1488. list.push(item);
  1489. }
  1490. };
  1491. return list;
  1492. };
  1493.  
  1494. /***/ }),
  1495.  
  1496. /***/ "./node_modules/css-loader/dist/runtime/noSourceMaps.js":
  1497. /***/ ((module) => {
  1498.  
  1499. "use strict";
  1500.  
  1501.  
  1502. module.exports = function (i) {
  1503. return i[1];
  1504. };
  1505.  
  1506. /***/ }),
  1507.  
  1508. /***/ "./resources/bookmarkSaved.svg":
  1509. /***/ ((module) => {
  1510.  
  1511. module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path d=\"M15.372 1H4.628A1.629 1.629 0 0 0 3 2.628v16.256a1.113 1.113 0 0 0 1.709.941L10 16.479l5.282 3.34A1.12 1.12 0 0 0 17 18.873V2.628A1.63 1.63 0 0 0 15.372 1Z\" style=\"fill:currentColor;stroke:none;stroke-width:0px\"></path></svg>"
  1512.  
  1513. /***/ }),
  1514.  
  1515. /***/ "./resources/bookmarkUnsaved.svg":
  1516. /***/ ((module) => {
  1517.  
  1518. module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path d=\"M4.114 20A1.117 1.117 0 0 1 3 18.884V2.628A1.629 1.629 0 0 1 4.628 1h10.744A1.63 1.63 0 0 1 17 2.628v16.245a1.12 1.12 0 0 1-1.718.946L10 16.479l-5.291 3.346a1.11 1.11 0 0 1-.595.175Zm.514-17.75a.378.378 0 0 0-.378.378v16.009L10 15l5.75 3.636V2.628a.378.378 0 0 0-.378-.378H4.628Z\" style=\"fill:currentColor;stroke:none;stroke-width:0px\"></path></svg>"
  1519.  
  1520. /***/ }),
  1521.  
  1522. /***/ "./resources/comments/bannedUser.svg":
  1523. /***/ ((module) => {
  1524.  
  1525. module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path d=\"M2,7.15,7.08,1.84A2.66,2.66,0,0,1,10,2.3a2.72,2.72,0,0,1,.7,2.91L5.37,10.66s-1,1.11-2.74-.73C1,8.24,2,7.15,2,7.15Z\" style=\"fill: none;stroke: #8a3685;stroke-width: 1.5px\"></path><path d=\"M7.33,8.85l6,6.16a1,1,0,0,0,1.28-.07,1.16,1.16,0,0,0,.15-1.28L8.9,7.37\" style=\"fill: #8a3685; stroke:none\"></path></svg>"
  1526.  
  1527. /***/ }),
  1528.  
  1529. /***/ "./resources/comments/newUser.svg":
  1530. /***/ ((module) => {
  1531.  
  1532. module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"-2 -2 20 20\"><path d=\"M1.46,1.5S3.49,4.89,7,5.07c1.49.07,3.35.25,4.06.79,1.41,1.09,2.3,2.08,1.74,4.37a4.91,4.91,0,0,1-4.36,3.49C5.08,14,2.89,10.29,2.33,9.35.41,6.12,1.46,1.5,1.46,1.5Z\" style=\"fill:#69b508;stroke:none;stroke-width:0px\"></path><path d=\"M12.5,11.5a3.39,3.39,0,0,1,2,2,3.16,3.16,0,0,1,0,2\" style=\"fill:none;stroke:#69b508;stroke-width:2px\"></path></svg>"
  1533.  
  1534. /***/ }),
  1535.  
  1536. /***/ "./resources/comments/shareButton.svg":
  1537. /***/ ((module) => {
  1538.  
  1539. module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path d=\"M14.111 12.5a3.701 3.701 0 0 1-1.09 2.41c-.479.47-.928.922-1.378 1.373-.45.45-.894.9-1.368 1.366a3.852 3.852 0 0 1-2.698 1.099 3.852 3.852 0 0 1-2.698-1.099 3.738 3.738 0 0 1-1.116-2.659c0-.997.402-1.953 1.116-2.658.479-.472.928-.923 1.378-1.375.45-.45.893-.9 1.368-1.365A3.936 3.936 0 0 1 9.638 8.59a3.968 3.968 0 0 1 2.24.258c.27-.269.546-.54.812-.806l.131-.13a5.086 5.086 0 0 0-3.182-.624A5.052 5.052 0 0 0 6.732 8.71c-.48.471-.929.922-1.377 1.373-.449.451-.894.9-1.37 1.366A4.982 4.982 0 0 0 2.5 14.992c0 1.328.534 2.602 1.486 3.543A5.13 5.13 0 0 0 7.58 20a5.13 5.13 0 0 0 3.595-1.465c.478-.471.927-.923 1.377-1.374.451-.451.894-.9 1.368-1.366a4.993 4.993 0 0 0 1.263-2.071c.243-.781.288-1.61.132-2.412L14.11 12.5Z\" style=\"fill:currentColor;stroke:none;stroke-width:1px\"></path><path d=\"M16.017 1.467A5.123 5.123 0 0 0 12.422 0a5.123 5.123 0 0 0-3.595 1.467c-.478.471-.926.923-1.377 1.374-.45.451-.894.9-1.367 1.366a4.966 4.966 0 0 0-1.106 1.624 4.907 4.907 0 0 0-.291 2.86l1.2-1.19a3.699 3.699 0 0 1 1.092-2.41c.478-.472.928-.923 1.377-1.374.45-.45.894-.9 1.368-1.366a3.844 3.844 0 0 1 2.698-1.101c1.012 0 1.982.396 2.698 1.101a3.736 3.736 0 0 1 1.116 2.66c0 .996-.401 1.953-1.116 2.658-.478.471-.927.922-1.377 1.373-.45.451-.893.9-1.368 1.367a3.933 3.933 0 0 1-2.014 1.003 3.966 3.966 0 0 1-2.24-.26c-.273.274-.551.549-.818.818l-.123.12a5.087 5.087 0 0 0 3.183.624 5.053 5.053 0 0 0 2.906-1.423c.477-.472.926-.923 1.376-1.375.45-.452.894-.9 1.368-1.365A4.977 4.977 0 0 0 17.5 5.008a4.977 4.977 0 0 0-1.488-3.543l.005.002Z\" style=\"fill:currentColor;stroke:none;stroke-width:1px\"></path></svg>"
  1540.  
  1541. /***/ }),
  1542.  
  1543. /***/ "./resources/comments/sortButtons/controversial.svg":
  1544. /***/ ((module) => {
  1545.  
  1546. module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><polygon points=\"6.34 13.21 3.33 9.37 2.46 10.07 5.35 13.73 6.34 13.21\" style=\"fill:currentColor;stroke:none;stroke-miterlimit:10\"></polygon><polygon points=\"4.11 13.02 3.11 11.75 0.76 13.47 1.7 14.55 4.11 13.02\" style=\"fill:currentColor;stroke:none;stroke-miterlimit:10\"></polygon><path d=\"M5.67,9.62l-.8.66,1,1.32s.54-.31,1.31-.8A12,12,0,0,1,5.67,9.62Z\" style=\"fill:currentColor;stroke:none;stroke-miterlimit:10\"></path><path d=\"M10.93,3.83A19.94,19.94,0,0,1,8.52,7.08c.57.52,1.29,1.08,1.8,1.46a11.2,11.2,0,0,0,1-1C14.21,4.3,14.7,2.11,14.7,2.11Z\" style=\"fill:currentColor;stroke:none;stroke-miterlimit:10\"></path><polygon points=\"9.23 13.59 12.52 9.01 13.53 9.81 10.36 14.19 9.23 13.59\" style=\"fill:currentColor;stroke:none;stroke-miterlimit:10\"></polygon><polygon points=\"11.61 12.82 12.66 11.36 15.26 13.26 14.28 14.52 11.61 12.82\" style=\"fill:currentColor;stroke:none;stroke-miterlimit:10\"></polygon><path d=\"M11.09,9.83A43.49,43.49,0,0,1,7.38,6.71,20.23,20.23,0,0,1,4.52,2.83,37,37,0,0,0,.73,1.33S.79,3.41,4.11,7.09A23.67,23.67,0,0,0,9.88,11.4C10.28,10.87,10.69,10.34,11.09,9.83Z\" style=\"fill:currentColor\"></path><path d=\"M11.09,9.83A43.49,43.49,0,0,1,7.38,6.71,20.23,20.23,0,0,1,4.52,2.83,37,37,0,0,0,.73,1.33S.79,3.41,4.11,7.09A23.67,23.67,0,0,0,9.88,11.4C10.28,10.87,10.69,10.34,11.09,9.83Z\" style=\"fill:none;stroke:none;stroke-miterlimit:10\"></path></svg>"
  1547.  
  1548. /***/ }),
  1549.  
  1550. /***/ "./resources/comments/sortButtons/old.svg":
  1551. /***/ ((module) => {
  1552.  
  1553. module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><circle cx=\"5.28\" cy=\"8.67\" r=\"1\" style=\"fill: currentColor\"></circle><circle cx=\"9.28\" cy=\"8.67\" r=\"1\" style=\"fill: currentColor\"></circle><circle cx=\"12.26\" cy=\"2.08\" r=\"1.32\" style=\"fill: currentColor\"></circle><path d=\"M7.55,5.08c.09-2.83,3-3.59,4-3\" style=\"fill: none;stroke: currentColor;stroke-miterlimit: 10\"></path><path d=\"M4.92,11.7s3,1,5,0\" style=\"fill: blue;stroke: currentColor;stroke-miterlimit: 10\"></path><path d=\"M7.72,5c3.31,0,6,2,6,4.5S11,14,7.72,14s-6-2-6-4.5S4.41,5,7.72,5m0-.5c-3.59,0-6.5,2.24-6.5,5s2.91,5,6.5,5,6.5-2.24,6.5-5-2.91-5-6.5-5Z\" style=\"fill: currentColor\"></path><path d=\"M10.85,5.5A1.56,1.56,0,0,1,13,5.31a1.34,1.34,0,0,1,.24,1.89\" style=\"fill: none;stroke: currentColor;stroke-miterlimit: 10;stroke-width: 0.5px\"></path><path d=\"M2.18,7a1.55,1.55,0,0,1,.53-2,1.33,1.33,0,0,1,1.86.4\" style=\"fill: none;stroke: currentColor;stroke-miterlimit: 10;stroke-width: 0.5px\"></path></svg>"
  1554.  
  1555. /***/ }),
  1556.  
  1557. /***/ "./resources/comments/sortButtons/qa.svg":
  1558. /***/ ((module) => {
  1559.  
  1560. module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><circle cx=\"10.77\" cy=\"4.4\" r=\"3\" style=\"fill: currentColor\"></circle><path d=\"M3.54,13.87l0,0a1.07,1.07,0,0,1-.46-1.35L6.4,7.44a1.05,1.05,0,0,1,1.48,0l.58.43c.54.41.74,1,.43,1.42L5,13.93A1.08,1.08,0,0,1,3.54,13.87Z\" style=\"fill: currentColor\"></path></svg>"
  1561.  
  1562. /***/ }),
  1563.  
  1564. /***/ "./resources/comments/userTags/blockedButton.svg":
  1565. /***/ ((module) => {
  1566.  
  1567. module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path d=\"m9.78126,18.09375c-4.41989,0 -8,-3.58011 -8,-8c0,-4.41989 3.58011,-8 8,-8c4.41989,0 8,3.58011 8,8c0,4.41989 -3.58011,8 -8,8z\" style=\"fill:none;stroke:currentColor;stroke-width:2px\"></path><path d=\"m4.43767,4.59392l10.81217,10.93716\" style=\"fill:none;stroke:currentColor;stroke-width:2px\"></path></svg>"
  1568.  
  1569. /***/ }),
  1570.  
  1571. /***/ "./resources/comments/userTags/blockedIcon.svg":
  1572. /***/ ((module) => {
  1573.  
  1574. module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"-4 -4 20 20\"><path d=\"M3.11,3l7.94,8\" style=\"fill:none;stroke:currentColor;stroke-width:1.5px\"></path><path d=\"M7,12.88A5.88,5.88,0,1,1,12.91,7,5.88,5.88,0,0,1,7,12.88Z\" style=\"fill:none;stroke:currentColor;stroke-width:1.5px\"></path></svg>"
  1575.  
  1576. /***/ }),
  1577.  
  1578. /***/ "./resources/comments/userTags/followedButton.svg":
  1579. /***/ ((module) => {
  1580.  
  1581. module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path d=\"m1.56177,7.99265l5.62517,-1.11153l2.68713,-4.92101l3.02542,4.77603l5.28687,1.25651l-4.60571,3.96991l1.43072,5.79091l-5.28229,-2.56852l-4.99233,2.56852l1.09243,-6.03254l-4.26742,-3.72827l0,-0.00001z\" style=\"fill:none;stroke:currentColor;stroke-width:2px\"></path></svg>"
  1582.  
  1583. /***/ }),
  1584.  
  1585. /***/ "./resources/comments/userTags/followedIcon.svg":
  1586. /***/ ((module) => {
  1587.  
  1588. module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"-4 -4 20 20\"><path d=\"m0.43678,5.49532l4.46205,-0.8817l2.13151,-3.90349l2.39985,3.78849l4.1937,0.9967l-3.65339,3.14905l1.13489,4.59352l-4.19007,-2.03743l-3.96007,2.03743l0.86655,-4.78519l-3.38505,-2.95738l0,-0.00001l0.00001,0z\" style=\"fill:none;stroke:currentColor;stroke-width:1.5px\"></path></svg>"
  1589.  
  1590. /***/ }),
  1591.  
  1592. /***/ "./resources/comments/userTags/likedButton.svg":
  1593. /***/ ((module) => {
  1594.  
  1595. module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path d=\"m7.28935,15.93702c-4.80908,-3.55432 -6.52852,-5.80272 -6.54246,-8.55516c-0.0127,-2.50919 2.10985,-4.93093 4.30951,-4.91697c1.09841,0.00698 3.45457,0.93051 4.2889,1.6811c0.42039,0.37819 0.6195,0.3409 1.55543,-0.29133c2.54723,-1.72064 5.03461,-1.75676 6.64556,-0.09648c2.57463,2.65349 2.10589,5.82222 -1.34747,9.10906c-1.836,1.74747 -5.84543,4.84759 -6.26946,4.84759c-0.12903,0 -1.31703,-0.80001 -2.64001,-1.7778l0,0l0,-0.00001z\" style=\"fill:none;stroke:currentColor;stroke-width:2px\"></path></svg>"
  1596.  
  1597. /***/ }),
  1598.  
  1599. /***/ "./resources/comments/userTags/likedIcon.svg":
  1600. /***/ ((module) => {
  1601.  
  1602. module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"-4 -4 20 20\"><path d=\"m5.10986,11.44595c-3.39081,-2.55084 -4.60316,-4.16445 -4.61299,-6.1398c-0.00896,-1.80077 1.48763,-3.53879 3.03857,-3.52877c0.77447,0.00501 2.43577,0.6678 3.02404,1.20648c0.29641,0.27142 0.4368,0.24465 1.09671,-0.20908c1.79601,-1.23486 3.54983,-1.26078 4.68568,-0.06924c1.81534,1.90433 1.48483,4.17844 -0.95008,6.53732c-1.29454,1.25411 -4.12153,3.47898 -4.4205,3.47898c-0.09098,0 -0.92862,-0.57415 -1.86143,-1.27588l0,0l0,-0.00001z\" style=\"fill:none;stroke:currentColor;stroke-width:1.5px\"></path></svg>"
  1603.  
  1604. /***/ }),
  1605.  
  1606. /***/ "./resources/comments/userTags/warningButton.svg":
  1607. /***/ ((module) => {
  1608.  
  1609. module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path d=\"m1.24313,16.49297l8.78125,-13.75l8.78125,13.75l-17.5625,0z\" style=\"fill:none;stroke:currentColor;stroke-width:2px\"></path><path d=\"m9.875,7.5l0,4.5\" style=\"fill:none;stroke:currentColor;stroke-width:2px\"></path><path d=\"m9.875,14.09375l0,1\" style=\"fill:none;stroke:currentColor;stroke-width:2px\"></path></svg>"
  1610.  
  1611. /***/ }),
  1612.  
  1613. /***/ "./resources/comments/userTags/warningIcon.svg":
  1614. /***/ ((module) => {
  1615.  
  1616. module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"-4 -4 20 20\"><path d=\"m6.91754,10.29973l0,0.7153\" style=\"fill:none;stroke:currentColor;stroke-width:1.5px\"></path><path d=\"m6.91754,5.38201l0,4.06927\" style=\"fill:none;stroke:currentColor;stroke-width:1.5px\"></path><path d=\"m0.74313,12.0159l6.28126,-9.83543l6.28126,9.83543l-12.56252,0z\" style=\"fill:none;stroke:currentColor;stroke-width:1.5px\"></path></svg>"
  1617.  
  1618. /***/ }),
  1619.  
  1620. /***/ "./resources/feedButtons/feedButtonBest.svg":
  1621. /***/ ((module) => {
  1622.  
  1623. module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path d=\"M8.82,1.51l1.43,3.4a.86.86,0,0,0,.66.47l3.62.28A.91.91,0,0,1,15,7.22L12.3,9.62a.84.84,0,0,0-.25.76l.81,3.55a.92.92,0,0,1-1.33,1L8.41,13a.91.91,0,0,0-.82,0L4.47,14.89a.92.92,0,0,1-1.33-1L4,10.38a.84.84,0,0,0-.25-.76L1,7.22a.91.91,0,0,1,.5-1.56l3.62-.28a.86.86,0,0,0,.66-.47l1.43-3.4A.91.91,0,0,1,8.82,1.51Z\" style=\"fill:currentColor; stroke:none\"></path></svg>"
  1624.  
  1625. /***/ }),
  1626.  
  1627. /***/ "./resources/feedButtons/feedButtonBest_empty.svg":
  1628. /***/ ((module) => {
  1629.  
  1630. module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path d=\"M8.82,1.51l1.43,3.4a.86.86,0,0,0,.66.47l3.62.28A.91.91,0,0,1,15,7.22L12.3,9.62a.84.84,0,0,0-.25.76l.81,3.55a.92.92,0,0,1-1.33,1L8.41,13a.91.91,0,0,0-.82,0L4.47,14.89a.92.92,0,0,1-1.33-1L4,10.38a.84.84,0,0,0-.25-.76L1,7.22a.91.91,0,0,1,.5-1.56l3.62-.28a.86.86,0,0,0,.66-.47l1.43-3.4A.91.91,0,0,1,8.82,1.51Z\" style=\"fill:none; stroke:currentColor\"></path></svg>"
  1631.  
  1632. /***/ }),
  1633.  
  1634. /***/ "./resources/feedButtons/feedButtonHot.svg":
  1635. /***/ ((module) => {
  1636.  
  1637. module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path d=\"M8.49,2.93c.7,1.56,3,2.81,3.69,3.52a5.14,5.14,0,0,1,1.36,5.45c-1.09,3.37-4.49,3.38-6.21,3.38s-4.18-.28-5-3,.8-4.41,1-5,1.06,2.52,2,3.12c1.19.79,2.85,0,2.85-1.18S6.72,7.65,6.44,5.37a10.62,10.62,0,0,1,1-4.9S7.83,1.46,8.49,2.93Z\" style=\"stroke:currentColor;fill:currentColor;stroke-width:0.5px\"></path></svg>"
  1638.  
  1639. /***/ }),
  1640.  
  1641. /***/ "./resources/feedButtons/feedButtonNew.svg":
  1642. /***/ ((module) => {
  1643.  
  1644. module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path d=\"M8,15.5A7.5,7.5,0,1,1,15.5,8,7.5,7.5,0,0,1,8,15.5Zm0-14A6.5,6.5,0,1,0,14.5,8,6.51,6.51,0,0,0,8,1.5Z\" style=\"fill:currentColor;stroke:currentColor;stroke-width:0.5px\"></path><path d=\"M8,2V8l4-2\" style=\"fill:none;stroke:currentColor;stroke-width:1.5px\"></path></svg>"
  1645.  
  1646. /***/ }),
  1647.  
  1648. /***/ "./resources/feedButtons/feedButtonRising.svg":
  1649. /***/ ((module) => {
  1650.  
  1651. module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path d=\"M1.1,14.67c1.4-2.8,3.62-6.84,3.62-6.84L9,12.18l4.13-9.94\" style=\"fill:none;stroke:currentColor;stroke-width:2px\"></path><path d=\"M8.5,4.5l4.68-2.45S14,5.31,14.5,7.5\" style=\"fill:none;stroke:currentColor;stroke-width:2px\"></path></svg>"
  1652.  
  1653. /***/ }),
  1654.  
  1655. /***/ "./resources/feedButtons/feedButtonTop.svg":
  1656. /***/ ((module) => {
  1657.  
  1658. module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path d=\"M14.51,6.56,9.13,1.17a1.61,1.61,0,0,0-2.26,0L1.49,6.56a1,1,0,0,0,.72,1.73H5.52V14A1.28,1.28,0,0,0,6.8,15.3H9.23A1.29,1.29,0,0,0,10.52,14V8.29h3.27A1,1,0,0,0,14.51,6.56Z\" style=\"fill:none;stroke:currentColor;stroke-width:1.5px\"></path></svg>"
  1659.  
  1660. /***/ }),
  1661.  
  1662. /***/ "./resources/imageCloseButton.svg":
  1663. /***/ ((module) => {
  1664.  
  1665. module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 40 40\"><path d=\"m33.16001,9.52439l-2.37671,-2.37671l-10.691,10.691l-10.691,-10.691l-2.37671,2.37671l10.691,10.691l-10.691,10.691l2.37671,2.37671l10.691,-10.691l10.691,10.691l2.37671,-2.37671l-10.691,-10.691l10.691,-10.691z\" style=\"fill:currentColor;stroke:none;stroke-width:0px\"></path></svg>"
  1666.  
  1667. /***/ }),
  1668.  
  1669. /***/ "./resources/postUnwrapButton.svg":
  1670. /***/ ((module) => {
  1671.  
  1672. module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 25 25\"><path d=\"M12.5,18.75A2.36,2.36,0,0,1,10.83,18L2.47,9.53,3.53,8.47,11.9,17a.79.79,0,0,0,1.2,0l8.37-8.5,1.06,1.06L14.17,18A2.36,2.36,0,0,1,12.5,18.75Z\" style=\"fill:currentColor;stroke:none;stroke-miterlimit:10;stroke-width:0px\"></path></svg>"
  1673.  
  1674. /***/ }),
  1675.  
  1676. /***/ "./resources/scrollButton.svg":
  1677. /***/ ((module) => {
  1678.  
  1679. module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 40 40\"><path d=\"M27.58,27.12,21,20.53a1.42,1.42,0,0,0-2,0l-6.58,6.59a1.41,1.41,0,0,0,1,2.41H26.58A1.41,1.41,0,0,0,27.58,27.12Z\" style=\"fill:currentColor\"></path><rect x=\"5\" y=\"11.75\" width=\"30\" height=\"2.5\" style=\"fill:currentColor\"></rect></svg>"
  1680.  
  1681. /***/ }),
  1682.  
  1683. /***/ "./resources/settingsArrow.svg":
  1684. /***/ ((module) => {
  1685.  
  1686. module.exports = "<svg fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"m7.942 15.442-.884-.884L11.616 10 7.058 5.442l.884-.884 5 5a.624.624 0 0 1 0 .884l-5 5Z\" style=\"fill:currentColor;stroke:none;stroke-width:0px\"></path></svg>"
  1687.  
  1688. /***/ }),
  1689.  
  1690. /***/ "./resources/settingsButton.svg":
  1691. /***/ ((module) => {
  1692.  
  1693. module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\"><path d=\"M15.07,2.25a.33.33,0,0,1,.33.33V6.72h1.25a2.11,2.11,0,0,1,0,4.21H15.4v4.14a.33.33,0,0,1-.33.33H10.93v1.25a2.11,2.11,0,0,1-4.21,0V15.4H2.58a.33.33,0,0,1-.33-.33v-3A3.51,3.51,0,0,0,4.49,8.82,3.48,3.48,0,0,0,2.25,5.57v-3a.33.33,0,0,1,.33-.33H5.34a3.49,3.49,0,0,0,7,0h2.76m0-1.25H10.75A2.24,2.24,0,1,1,6.9,1H2.58A1.58,1.58,0,0,0,1,2.58v4a2.24,2.24,0,1,1,0,4.47v4a1.58,1.58,0,0,0,1.58,1.58H5.47a3.36,3.36,0,0,0,6.71,0h2.89a1.58,1.58,0,0,0,1.58-1.58V12.18a3.36,3.36,0,0,0,0-6.71V2.58A1.58,1.58,0,0,0,15.07,1Z\"></path></svg>"
  1694.  
  1695. /***/ }),
  1696.  
  1697. /***/ "./resources/subFilter.svg":
  1698. /***/ ((module) => {
  1699.  
  1700. module.exports = "<svg fill=\"currentColor\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M19.5 18.616 14.985 14.1a8.528 8.528 0 1 0-.884.884l4.515 4.515.884-.884ZM1.301 8.553a7.253 7.253 0 1 1 7.252 7.253 7.261 7.261 0 0 1-7.252-7.253Z\" style=\"stroke:none;stroke-width:0px\"></path></svg>"
  1701.  
  1702. /***/ }),
  1703.  
  1704. /***/ "./resources/subFilterClear.svg":
  1705. /***/ ((module) => {
  1706.  
  1707. module.exports = "<svg fill=\"currentColor\" icon-name=\"clear-outline\" viewBox=\"0 0 20 20\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M10 0a10 10 0 1 0 10 10A10.011 10.011 0 0 0 10 0Zm0 18.75A8.75 8.75 0 1 1 18.75 10 8.76 8.76 0 0 1 10 18.75Zm3.567-11.433L10.884 10l2.683 2.683-.884.884L10 10.884l-2.683 2.683-.884-.884L9.116 10 6.433 7.317l.884-.884L10 9.116l2.683-2.683.884.884Z\" style=\"fill:currentColor;stroke:none;stroke-width:0px\"></path></svg>"
  1708.  
  1709. /***/ }),
  1710.  
  1711. /***/ "./resources/windowCloseButton.svg":
  1712. /***/ ((module) => {
  1713.  
  1714. module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><path d=\"M14,2h0a.75.75,0,0,0-1.06,0L8.15,6.78a.2.2,0,0,1-.3,0L3.06,2A.75.75,0,0,0,2,2H2A.75.75,0,0,0,2,3.06L6.78,7.85a.2.2,0,0,1,0,.3L2,12.94A.75.75,0,0,0,2,14H2a.75.75,0,0,0,1.06,0L7.85,9.22a.2.2,0,0,1,.3,0L12.94,14A.75.75,0,0,0,14,14h0a.75.75,0,0,0,0-1.06L9.22,8.15a.2.2,0,0,1,0-.3L14,3.06A.75.75,0,0,0,14,2Z\"></path></svg>"
  1715.  
  1716. /***/ })
  1717.  
  1718. /******/ });
  1719. /************************************************************************/
  1720. /******/ // The module cache
  1721. /******/ var __webpack_module_cache__ = {};
  1722. /******/
  1723. /******/ // The require function
  1724. /******/ function __webpack_require__(moduleId) {
  1725. /******/ // Check if module is in cache
  1726. /******/ var cachedModule = __webpack_module_cache__[moduleId];
  1727. /******/ if (cachedModule !== undefined) {
  1728. /******/ return cachedModule.exports;
  1729. /******/ }
  1730. /******/ // Create a new module (and put it into the cache)
  1731. /******/ var module = __webpack_module_cache__[moduleId] = {
  1732. /******/ id: moduleId,
  1733. /******/ // no module.loaded needed
  1734. /******/ exports: {}
  1735. /******/ };
  1736. /******/
  1737. /******/ // Execute the module function
  1738. /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
  1739. /******/
  1740. /******/ // Return the exports of the module
  1741. /******/ return module.exports;
  1742. /******/ }
  1743. /******/
  1744. /************************************************************************/
  1745. /******/ /* webpack/runtime/compat get default export */
  1746. /******/ (() => {
  1747. /******/ // getDefaultExport function for compatibility with non-harmony modules
  1748. /******/ __webpack_require__.n = (module) => {
  1749. /******/ var getter = module && module.__esModule ?
  1750. /******/ () => (module['default']) :
  1751. /******/ () => (module);
  1752. /******/ __webpack_require__.d(getter, { a: getter });
  1753. /******/ return getter;
  1754. /******/ };
  1755. /******/ })();
  1756. /******/
  1757. /******/ /* webpack/runtime/define property getters */
  1758. /******/ (() => {
  1759. /******/ // define getter functions for harmony exports
  1760. /******/ __webpack_require__.d = (exports, definition) => {
  1761. /******/ for(var key in definition) {
  1762. /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
  1763. /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
  1764. /******/ }
  1765. /******/ }
  1766. /******/ };
  1767. /******/ })();
  1768. /******/
  1769. /******/ /* webpack/runtime/hasOwnProperty shorthand */
  1770. /******/ (() => {
  1771. /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
  1772. /******/ })();
  1773. /******/
  1774. /************************************************************************/
  1775. var __webpack_exports__ = {};
  1776. // This entry need to be wrapped in an IIFE because it need to be in strict mode.
  1777. (() => {
  1778. "use strict";
  1779.  
  1780. ;// CONCATENATED MODULE: ./src/utils/tools.ts
  1781.  
  1782. const DYNAMIC_ELEMENT_FREQUENCY = 10;
  1783. async function dynamicElement(elementRequest, maxLifetime = 0) {
  1784. return new Promise(resolve => {
  1785. let element = elementRequest();
  1786. if (element != null) {
  1787. return resolve(element);
  1788. }
  1789. let time = maxLifetime / DYNAMIC_ELEMENT_FREQUENCY;
  1790. const intervalId = setInterval(() => {
  1791. element = elementRequest();
  1792. let forced = false;
  1793. if (maxLifetime > 0) {
  1794. time--;
  1795. if (time < 0)
  1796. forced = true;
  1797. }
  1798. if (element != null || forced) {
  1799. clearInterval(intervalId);
  1800. return resolve(element);
  1801. }
  1802. }, DYNAMIC_ELEMENT_FREQUENCY);
  1803. });
  1804. }
  1805. function observeFor(root, action, includeChilds = true) {
  1806. const result = action(root);
  1807. if (result != undefined && result == true) {
  1808. return;
  1809. }
  1810. let observer = new MutationObserver(mutations => {
  1811. for (const mutation of mutations) {
  1812. for (const node of mutation.addedNodes) {
  1813. if (observer && node instanceof HTMLElement) {
  1814. const result = action(node);
  1815. if (result != undefined && result == true) {
  1816. observer.disconnect();
  1817. observer = null;
  1818. }
  1819. }
  1820. }
  1821. }
  1822. });
  1823. observer.observe(root, { childList: true, subtree: includeChilds });
  1824. }
  1825. function checkIsRendered(node, key = `pp-rendered`) {
  1826. if (node == null || node.getAttribute(key) != null) {
  1827. return true;
  1828. }
  1829. else {
  1830. node.setAttribute(key, ``);
  1831. return false;
  1832. }
  1833. }
  1834. function appendNew(prev, name, classes = null) {
  1835. const el = document.createElement(name);
  1836. if (classes != null) {
  1837. if (typeof classes === `string` && classes) {
  1838. el.classList.add(classes);
  1839. }
  1840. else {
  1841. for (const c of classes) {
  1842. el.classList.add(c);
  1843. }
  1844. }
  1845. }
  1846. prev.append(el);
  1847. return el;
  1848. }
  1849. function getCookie(key) {
  1850. return document.cookie
  1851. .split(`; `)
  1852. .find(row => row.startsWith(key))
  1853. ?.split(`=`)[1];
  1854. }
  1855. function isLowerVersion(a, b) {
  1856. if (a == b)
  1857. return false;
  1858. const a_array = a.split(`.`);
  1859. const b_array = b.split(`.`);
  1860. for (const i of [0, 1, 2]) {
  1861. const a_i = parseInt(a_array[i]);
  1862. const b_i = parseInt(b_array[i]);
  1863. if (a_i != b_i)
  1864. return a_i < b_i;
  1865. }
  1866. return false;
  1867. }
  1868.  
  1869. ;// CONCATENATED MODULE: ./src/modules/toaster.ts
  1870.  
  1871. class NotifyConfig {
  1872. }
  1873. const DEFAULT_NOTIFY_TIME = 3000;
  1874. async function notify(message, config = {}) {
  1875. let toaster = await dynamicElement(() => document.body?.querySelector(`alert-controller`)?.shadowRoot?.querySelector(`toaster-lite`));
  1876. let toast = document.createElement(`faceplate-toast`);
  1877. toast.classList.add(`theme-rpl`);
  1878. if (config.color != undefined) {
  1879. toast.style.backgroundColor = config.color;
  1880. }
  1881. toast.textContent = message;
  1882. toaster.appendChild(toast);
  1883. setTimeout(() => {
  1884. toast.setAttribute(`_fading`, ``);
  1885. }, config?.time ?? DEFAULT_NOTIFY_TIME);
  1886. }
  1887. function pp_log(message) {
  1888. console.log(`Reddit++: ${message}`);
  1889. }
  1890.  
  1891. ;// CONCATENATED MODULE: ./src/_compatibility/migrations.ts
  1892.  
  1893.  
  1894. const DATABASE_VERSION = `DATABASE_VERSION`;
  1895. class Migration {
  1896. constructor(version, action, previous = null) {
  1897. this.version = version;
  1898. this.action = action;
  1899. this.previous = previous;
  1900. }
  1901. check() {
  1902. const currentVersion = GM_getValue(DATABASE_VERSION, null);
  1903. if (currentVersion == null || isLowerVersion(currentVersion, this.version)) {
  1904. this.previous?.check();
  1905. this.action();
  1906. GM_setValue(DATABASE_VERSION, this.version);
  1907. notify(`Reddit++ was upgraded to ${this.version}`);
  1908. }
  1909. }
  1910. }
  1911.  
  1912. ;// CONCATENATED MODULE: ./src/_compatibility/migration_1_0_0.ts
  1913.  
  1914. // from 0.2.x
  1915. const migration_1_0_0 = new Migration(`1.0.0`, () => {
  1916. const settingsDatabase = GM_getValue(`SETTINGS_DATABASE`, null);
  1917. if (settingsDatabase == null)
  1918. return;
  1919. const bookmarks = settingsDatabase[`savedBookmark`];
  1920. if (bookmarks != undefined) {
  1921. settingsDatabase[`savedBookmarkPosts`] = bookmarks;
  1922. settingsDatabase[`savedBookmarkComments`] = bookmarks;
  1923. delete settingsDatabase[`savedBookmark`];
  1924. }
  1925. const hideUnsaved = settingsDatabase[`savedBookmarkHideUnsaved`];
  1926. if (hideUnsaved != undefined) {
  1927. settingsDatabase[`savedBookmarkPostsShowAlways`] = !hideUnsaved;
  1928. settingsDatabase[`savedBookmarkCommentsShowAlways`] = !hideUnsaved;
  1929. delete settingsDatabase[`savedBookmarkHideUnsaved`];
  1930. }
  1931. GM_setValue(`SETTINGS_DATABASE`, settingsDatabase);
  1932. });
  1933.  
  1934. // EXTERNAL MODULE: ./src/modules/wideMode.less
  1935. var wideMode = __webpack_require__("./src/modules/wideMode.less");
  1936. ;// CONCATENATED MODULE: ./src/modules/customCSS.ts
  1937. class CustomCSS {
  1938. constructor() {
  1939. this.rootStylesheet = new CSSStyleSheet();
  1940. this.styleSheets = [this.rootStylesheet];
  1941. this.styleKeys = new Set();
  1942. this.sources = [];
  1943. this.registry(document);
  1944. }
  1945. registry(source) {
  1946. this.sources.push(source);
  1947. for (const styleSheet of this.styleSheets) {
  1948. source.adoptedStyleSheets.push(styleSheet);
  1949. }
  1950. }
  1951. addStyle(style, key = null) {
  1952. if (key != null) {
  1953. if (this.styleKeys.has(key))
  1954. return;
  1955. this.styleKeys.add(key);
  1956. }
  1957. const styleSheet = new CSSStyleSheet();
  1958. styleSheet.replaceSync(style);
  1959. this.styleSheets.push(styleSheet);
  1960. for (const source of this.sources) {
  1961. source.adoptedStyleSheets.push(styleSheet);
  1962. }
  1963. }
  1964. addRule(rule) {
  1965. this.rootStylesheet.insertRule(rule, 0);
  1966. }
  1967. addVar(name, lightValue, darkValue = null) {
  1968. this.addRule(`:root.theme-light { ${name}: ${lightValue} !important;}`);
  1969. this.addRule(`:root { ${name}: ${darkValue ?? lightValue};}`);
  1970. }
  1971. }
  1972. const css = new CustomCSS();
  1973.  
  1974. ;// CONCATENATED MODULE: ./src/defines.ts
  1975. class ModuleTaget {
  1976. }
  1977. const IS_COMMENT = { isComment: true };
  1978. const IS_POST = { isComment: false };
  1979. const MAX_LOAD_LAG = 2000;
  1980. const HOUR_SECONDS = 60 * 60;
  1981. const DAY_SECONDS = HOUR_SECONDS * 24;
  1982.  
  1983. ;// CONCATENATED MODULE: ./src/utils/database.ts
  1984.  
  1985. class DatabaseConfig {
  1986. }
  1987. class Database {
  1988. constructor(name, config = new DatabaseConfig()) {
  1989. this.databaseKey = name + `_DATABASE`;
  1990. this.refreshKey = name + `_REFRESHED`;
  1991. this.cleanupKey = name + `_CLEANUP`;
  1992. this.isCleanupable = config?.isCleanupable ?? false;
  1993. this.validator = config?.validator ?? null;
  1994. this.loader = config?.loader ?? null;
  1995. this.refresh();
  1996. // cleanup database
  1997. if (this.isCleanupable && GM_getValue(this.cleanupKey, 0) < Date.now()) {
  1998. const timestampLimit = Date.now() - 1000 * 2 * DAY_SECONDS;
  1999. this.data = Object.fromEntries(Object.entries(this.data).filter(([key, value]) => value.timestamp > timestampLimit));
  2000. this.refreshed = Date.now();
  2001. GM_setValue(this.databaseKey, this.data);
  2002. GM_setValue(this.refreshKey, this.refreshed);
  2003. GM_setValue(this.cleanupKey, Date.now() + 1000 * HOUR_SECONDS);
  2004. }
  2005. }
  2006. refresh() {
  2007. const lastRefreshed = GM_getValue(this.refreshKey, 0);
  2008. if (this.data == undefined || this.refreshed < lastRefreshed) {
  2009. this.refreshed = lastRefreshed;
  2010. this.data = GM_getValue(this.databaseKey, {});
  2011. }
  2012. }
  2013. get(id) {
  2014. this.refresh();
  2015. const raw = this.data[id];
  2016. return (raw == undefined ? {} : raw);
  2017. }
  2018. async getWithLoader(id, onLoaded = null) {
  2019. this.refresh();
  2020. const raw = this.data[id];
  2021. let data = (raw == undefined ? {} : raw);
  2022. let isLoaded = false;
  2023. if (this.validator(data)) {
  2024. data = await this.loader(id);
  2025. this.set(id, data);
  2026. isLoaded = true;
  2027. }
  2028. if (onLoaded != null) {
  2029. onLoaded(isLoaded);
  2030. }
  2031. return data;
  2032. }
  2033. set(id, value) {
  2034. this.refresh();
  2035. if (this.isCleanupable) {
  2036. value.timestamp = Date.now();
  2037. }
  2038. this.data[id] = value;
  2039. this.refreshed = Date.now();
  2040. GM_setValue(this.databaseKey, this.data);
  2041. GM_setValue(this.refreshKey, this.refreshed);
  2042. }
  2043. }
  2044.  
  2045. ;// CONCATENATED MODULE: ./src/modules/feed/feedLocation.ts
  2046. var FeedLocation;
  2047. (function (FeedLocation) {
  2048. FeedLocation[FeedLocation["Sub"] = 0] = "Sub";
  2049. FeedLocation[FeedLocation["Home"] = 1] = "Home";
  2050. FeedLocation[FeedLocation["Popular"] = 2] = "Popular";
  2051. FeedLocation[FeedLocation["All"] = 3] = "All";
  2052. })(FeedLocation || (FeedLocation = {}));
  2053. function GetFeedLocation() {
  2054. if (window.location.href.includes(`?feed=home`) || window.location.href == `https://www.reddit.com/`)
  2055. return FeedLocation.Home;
  2056. if (window.location.href.includes(`reddit.com/r/popular/`))
  2057. return FeedLocation.Popular;
  2058. if (window.location.href.includes(`reddit.com/r/all/`))
  2059. return FeedLocation.All;
  2060. return FeedLocation.Sub;
  2061. }
  2062.  
  2063. ;// CONCATENATED MODULE: ./src/modules/feed/feedType.ts
  2064.  
  2065. function GetFeeds(location) {
  2066. const defaultFeeds = [`Hot`, `New`, `Top`, `Rising`];
  2067. if (location == FeedLocation.Home || location == FeedLocation.Popular) {
  2068. return [`Best`].concat(defaultFeeds);
  2069. }
  2070. else {
  2071. return defaultFeeds;
  2072. }
  2073. }
  2074.  
  2075. ;// CONCATENATED MODULE: ./src/modules/settings/settings.ts
  2076.  
  2077.  
  2078.  
  2079. class SettingBoolProperty {
  2080. constructor(name, defailtValue = true) {
  2081. this.name = name;
  2082. this.defailtValue = defailtValue;
  2083. }
  2084. isEnabled() {
  2085. const rawValue = settingsDatabase.get(this.name);
  2086. const isDefault = rawValue instanceof Object;
  2087. return isDefault ? this.defailtValue : rawValue;
  2088. }
  2089. isDisabled() {
  2090. return !this.isEnabled();
  2091. }
  2092. switch(overridedValue = null) {
  2093. settingsDatabase.set(this.name, overridedValue == null ? this.isDisabled() : overridedValue);
  2094. }
  2095. getChild(postfix, defaultValue = true) {
  2096. return new SettingBoolProperty(this.name + postfix, defaultValue);
  2097. }
  2098. }
  2099. class SettingDropdownProperty {
  2100. constructor(name, values, defaultIndex = 0) {
  2101. this.name = name;
  2102. this.values = values;
  2103. this.defaultIndex = defaultIndex;
  2104. }
  2105. get() {
  2106. const rawValue = settingsDatabase.get(this.name);
  2107. const isDefault = rawValue instanceof Object;
  2108. return isDefault ? this.values[this.defaultIndex] : rawValue;
  2109. }
  2110. isDefault() {
  2111. return this.get() == this.values[this.defaultIndex];
  2112. }
  2113. switch(shift) {
  2114. let index = this.values.indexOf(this.get()) + shift;
  2115. if (index < 0) {
  2116. index = this.values.length - 1;
  2117. }
  2118. if (index >= this.values.length) {
  2119. index = 0;
  2120. }
  2121. settingsDatabase.set(this.name, this.values[index]);
  2122. }
  2123. }
  2124. class SettingsManager {
  2125. constructor() {
  2126. this.revision = this.getRevision();
  2127. this.WIDE_MODE = new SettingBoolProperty(`wideMode`);
  2128. this.CONTENT_WIDTH = new SettingDropdownProperty(`contentWidth`, [`650px`, `700px`, `750px`, `800px`, `900px`, `1000px`], 1);
  2129. this.CONTENT_OFFSET = new SettingDropdownProperty(`contentOffset`, [`-1000px`, `-900px`, `-800px`, `-700px`, `-600px`, `-500px`, `-400px`, `-300px`, `-200px`, `-100px`, `0px`, `100px`, `200px`, `300px`, `400px`, `500px`, `600px`, `700px`, `800px`, `900px`, `1000px`], 10);
  2130. this.BIGGER_FONTS = new SettingBoolProperty(`biggerFonts`);
  2131. this.NOTIFY_POPUP = new SettingBoolProperty(`notifyPopup`);
  2132. this.REDIRECT_SUGGESTION = new SettingBoolProperty(`redirectSuggestion`);
  2133. this.REDIRECT_FORCED = new SettingBoolProperty(`redirectForced`, false);
  2134. // left sidebar
  2135. this.SUB_FILTER = new SettingBoolProperty(`sidebarSubFilter`);
  2136. this.SIDEBAR_CUSTOMS = new SettingBoolProperty(`sidebarCustoms`);
  2137. this.SIDEBAR_RECENT = new SettingBoolProperty(`sidebarRecent`);
  2138. this.SIDEBAR_SUBS = new SettingBoolProperty(`sidebarSubs`);
  2139. this.SIDEBAR_RESOURCES = new SettingBoolProperty(`sidebarResources`);
  2140. // common
  2141. this.SCROLL_TO_TOP = new SettingBoolProperty(`scrollToTop`);
  2142. this.COLLAPSE_AWARDS = new SettingBoolProperty(`collapseAwards`);
  2143. this.COLLAPSE_AWARDS_COMPLETELY = new SettingBoolProperty(`collapseAwardsCompletely`, false);
  2144. this.IMAGE_VIEWER = new SettingBoolProperty(`imageViewer`);
  2145. // feed sorts
  2146. this.DEFAULT_FEED_HOME = new SettingDropdownProperty(`defaultFeedHome`, GetFeeds(FeedLocation.Home), 0);
  2147. this.DEFAULT_FEED_POPULAR = new SettingDropdownProperty(`defaultFeedPopular`, GetFeeds(FeedLocation.Popular), 1);
  2148. this.DEFAULT_FEED_ALL = new SettingDropdownProperty(`defaultFeedAll`, GetFeeds(FeedLocation.All), 0);
  2149. this.DEFAULT_FEED_SUB = new SettingDropdownProperty(`defaultFeedSub`, GetFeeds(FeedLocation.Sub), 0);
  2150. // feed
  2151. this.FEED_BUTTONS = new SettingBoolProperty(`feedButtons`);
  2152. this.FLAIR_BAR = new SettingBoolProperty(`flairbar`);
  2153. this.COLLAPSE_HIGHLIGHTS = new SettingBoolProperty(`collapseHighlights`, false);
  2154. this.BACKPLATES = new SettingBoolProperty(`backplates`);
  2155. this.SELECTABLE_POSTS = new SettingBoolProperty(`selectablePosts`);
  2156. this.UNWRAP_POST = new SettingBoolProperty(`unwrapPost`);
  2157. this.SHOW_POST_AUTHOR = new SettingBoolProperty(`showPostAuthor`);
  2158. this.SAVED_BOOKMARK_POSTS = new SettingBoolProperty(`savedBookmarkPosts`);
  2159. this.SAVED_BOOKMARK_POSTS_SHOW_ALWAYAS = new SettingBoolProperty(`savedBookmarkPostsShowAlways`, false);
  2160. // comments
  2161. this.COMMENTS_SORT_BUTTONS = new SettingBoolProperty(`commentSortButtons`);
  2162. this.COMMENTS_REMEMBER_SORT = new SettingBoolProperty(`commentRememberSort`);
  2163. this.UNWRAP_MORE_REPLIES = new SettingBoolProperty(`unwrapMoreReplies`, false);
  2164. this.USER_INFO = new SettingBoolProperty(`userInfo`);
  2165. this.USER_TAGS = new SettingBoolProperty(`userTags`);
  2166. this.SHOW_NAMES = new SettingBoolProperty(`showNames`);
  2167. this.HIDE_SHARE = new SettingBoolProperty(`hideShare`);
  2168. this.GHOSTED_COMMENTS = new SettingBoolProperty(`ghostedComments`);
  2169. this.COLLAPSE_AUTOMODERATOR = new SettingBoolProperty(`collapseAutomoderator`);
  2170. this.SAVED_BOOKMARK_COMMENTS = new SettingBoolProperty(`savedBookmarkComments`);
  2171. this.SAVED_BOOKMARK_COMMENTS_SHOW_ALWAYAS = new SettingBoolProperty(`savedBookmarkCommentsShowAlways`, false);
  2172. this.HIDE_RELATED_POSTS = new SettingBoolProperty(`hideRelatedPosts`, false);
  2173. // Reload all pages with dirted settings
  2174. window.addEventListener('storage', event => {
  2175. if (this.isDirt()) {
  2176. document.addEventListener('visibilitychange', () => {
  2177. window.location.reload();
  2178. }, { once: true });
  2179. }
  2180. });
  2181. }
  2182. getRevision() {
  2183. return parseInt(localStorage.getItem(`pp_settings_s_revision`) ?? `0`);
  2184. }
  2185. nextRevision() {
  2186. this.revision++;
  2187. localStorage.setItem(`pp_settings_s_revision`, String(this.revision));
  2188. }
  2189. isDirt() {
  2190. const currentRevision = this.getRevision();
  2191. return currentRevision != this.revision;
  2192. }
  2193. }
  2194. const settingsDatabase = new Database(`SETTINGS`);
  2195. const settings = new SettingsManager();
  2196.  
  2197. ;// CONCATENATED MODULE: ./src/modules/wideMode.ts
  2198.  
  2199.  
  2200.  
  2201.  
  2202. function renderWideMode(pageContainer, rightSidebar) {
  2203. if (settings.WIDE_MODE.isDisabled())
  2204. return;
  2205. css.addStyle(wideMode/* default */.A, `wideMode`);
  2206. css.addVar(`--pp-content-width`, settings.CONTENT_WIDTH.get());
  2207. css.addVar(`--pp-content-offset`, settings.CONTENT_OFFSET.get());
  2208. // prevent additional render when rightbar already moved
  2209. if (rightSidebar.parentNode == pageContainer) {
  2210. return;
  2211. }
  2212. const originContainer = rightSidebar.parentElement;
  2213. let isWideMode = !(window.innerWidth >= 1392);
  2214. const mainContainer = pageContainer.querySelector(`.main-container`);
  2215. mainContainer.className = `main-container gap-lg w-full`;
  2216. // fix for context lookup
  2217. observeFor(pageContainer, renderContextPopup, false);
  2218. observeFor(originContainer, renderContextPopup, false);
  2219. function renderContextPopup(element) {
  2220. if (element.classList.contains(`rounded-[16px]`)) {
  2221. element.classList.add(`pp_rightSidebar_contextLookup`);
  2222. if (window.innerWidth < 1392 && element.parentNode != rightSidebar.parentNode) {
  2223. rightSidebar.after(element);
  2224. }
  2225. }
  2226. return false;
  2227. }
  2228. refreshAppRender();
  2229. window.addEventListener('resize', event => {
  2230. refreshAppRender();
  2231. });
  2232. function refreshAppRender() {
  2233. if (window.innerWidth >= 1392 && !isWideMode) {
  2234. pageContainer.prepend(rightSidebar);
  2235. isWideMode = true;
  2236. }
  2237. if (window.innerWidth < 1392 && isWideMode) {
  2238. originContainer.append(rightSidebar);
  2239. isWideMode = false;
  2240. }
  2241. }
  2242. }
  2243.  
  2244. // EXTERNAL MODULE: ./src/modules/app.less
  2245. var modules_app = __webpack_require__("./src/modules/app.less");
  2246. // EXTERNAL MODULE: ./src/modules/sidebar/sidebar.less
  2247. var sidebar = __webpack_require__("./src/modules/sidebar/sidebar.less");
  2248. // EXTERNAL MODULE: ./src/modules/sidebar/subFilter.less
  2249. var subFilter = __webpack_require__("./src/modules/sidebar/subFilter.less");
  2250. ;// CONCATENATED MODULE: ./src/utils/svg.ts
  2251. const NONE_COLOR = 'none';
  2252. const CURRENT_COLOR = 'currentColor';
  2253. class SVGViewBox {
  2254. }
  2255. class SVGConfig {
  2256. constructor() {
  2257. this.strokeColor = CURRENT_COLOR;
  2258. this.fillColor = NONE_COLOR;
  2259. }
  2260. }
  2261. function buildSvg(graphic, w, h, config = {}) {
  2262. const handle = document.createElement('div');
  2263. handle.innerHTML = graphic;
  2264. const svg = handle.firstChild;
  2265. svg.setAttribute(`width`, `${w}px`);
  2266. svg.setAttribute(`height`, `${h}px`);
  2267. if (config.viewBox != undefined) {
  2268. svg.setAttribute(`viewBox`, `0 0 ${config.viewBox.w} ${config.viewBox.h}`);
  2269. }
  2270. svg.setAttribute(`fill`, config?.fillColor ?? CURRENT_COLOR);
  2271. svg.setAttribute(`stroke`, config?.strokeColor ?? CURRENT_COLOR);
  2272. return svg;
  2273. }
  2274.  
  2275. ;// CONCATENATED MODULE: ./src/modules/settings/prefs.ts
  2276.  
  2277. class PrefsKey {
  2278. }
  2279. PrefsKey.COMMENTS_CURRENT_SORT = `COMMENTS_CURRENT_SORT`;
  2280. PrefsKey.SUB_FILTER = `SUB_FILTER`;
  2281. const prefs = new Database(`PREFS`);
  2282.  
  2283. // EXTERNAL MODULE: ./resources/subFilter.svg
  2284. var resources_subFilter = __webpack_require__("./resources/subFilter.svg");
  2285. var subFilter_default = /*#__PURE__*/__webpack_require__.n(resources_subFilter);
  2286. // EXTERNAL MODULE: ./resources/subFilterClear.svg
  2287. var subFilterClear = __webpack_require__("./resources/subFilterClear.svg");
  2288. var subFilterClear_default = /*#__PURE__*/__webpack_require__.n(subFilterClear);
  2289. ;// CONCATENATED MODULE: ./src/modules/sidebar/subFilter.ts
  2290.  
  2291.  
  2292.  
  2293.  
  2294.  
  2295.  
  2296.  
  2297. css.addStyle(subFilter/* default */.A);
  2298. let filter;
  2299. async function renderSubFilter(container) {
  2300. if (checkIsRendered(container, `pp-sub-filter`))
  2301. return;
  2302. const filterContainer = appendNew(container, `div`, `pp_subFilter_container`);
  2303. const createSubButton = (await dynamicElement(() => container.querySelector(`.left-nav-create-community-button`)));
  2304. createSubButton.style.width = `65px`;
  2305. const createSubText = await dynamicElement(() => createSubButton.querySelector(`.text-14`));
  2306. createSubText.remove();
  2307. createSubButton.replaceWith(filterContainer);
  2308. filterContainer.append(createSubButton);
  2309. const filterButton = appendNew(filterContainer, `div`, [`pp_subFilter`, `button`, `button-bordered`]);
  2310. filterButton.setAttribute(`tabindex`, `0`);
  2311. const sr = filterButton.attachShadow({ mode: 'open' });
  2312. css.registry(sr);
  2313. const span = appendNew(filterButton, `span`, [`flex`, `items-center`, `justify-center`, `pp_subFilter_span`]);
  2314. sr.appendChild(span);
  2315. const iconSpan = appendNew(span, `span`, [`flex`, `items-center`, `justify-center`]);
  2316. const icon = buildSvg((subFilter_default()), 16, 16);
  2317. iconSpan.append(icon);
  2318. const inputContainer = appendNew(span, `div`, [`label-container`, `without-label`]);
  2319. const inputSpan = appendNew(inputContainer, `span`, [`input-container`, `activated`]);
  2320. const input = appendNew(inputSpan, `input`, `pp_subFilter_input`);
  2321. input.type = `text`;
  2322. input.placeholder = `Filter`;
  2323. const clearContainer = appendNew(filterContainer, `div`, `pp_pp_subFilter_clearContainer`);
  2324. const clearButton = appendNew(clearContainer, `button`, [`pp_subFilter_clear`, `button-plain`, `pp_hidden`]);
  2325. const clearIcon = buildSvg((subFilterClear_default()), 16, 16);
  2326. clearButton.append(clearIcon);
  2327. filterButton.addEventListener(`focus`, () => {
  2328. createSubButton.style.display = `none`;
  2329. });
  2330. filterButton.addEventListener(`focusout`, () => {
  2331. createSubButton.style.display = `block`;
  2332. });
  2333. input.addEventListener(`input`, () => {
  2334. const pattern = input.value.trim().toLowerCase();
  2335. onChangeFilter(pattern);
  2336. clearButton.classList.toggle(`pp_hidden`, pattern.length == 0);
  2337. });
  2338. clearButton.addEventListener(`click`, () => {
  2339. input.value = ``;
  2340. onChangeFilter(``);
  2341. clearButton.classList.toggle(`pp_hidden`, true);
  2342. });
  2343. // init filter database
  2344. if (filter != null) {
  2345. filter.clear();
  2346. }
  2347. filter = new Map();
  2348. const itemContainer = container.querySelector(`left-nav-communities-controller`).shadowRoot;
  2349. itemContainer.querySelectorAll(`left-nav-community-item`).forEach(item => {
  2350. filter.set(item.getAttribute(`prefixedname`).replace(`r/`, ``).toLowerCase(), item);
  2351. });
  2352. // init value
  2353. const initPattern = prefs.get(PrefsKey.SUB_FILTER);
  2354. if (!(initPattern instanceof Object)) {
  2355. input.value = initPattern;
  2356. onChangeFilter(initPattern);
  2357. clearButton.classList.toggle(`pp_hidden`, initPattern.length == 0);
  2358. }
  2359. }
  2360. function onChangeFilter(pattern) {
  2361. prefs.set(PrefsKey.SUB_FILTER, pattern);
  2362. filter.forEach((item, sub) => {
  2363. if (sub.includes(pattern)) {
  2364. item.style.removeProperty(`display`);
  2365. }
  2366. else {
  2367. item.style.display = `none`;
  2368. }
  2369. });
  2370. }
  2371.  
  2372. ;// CONCATENATED MODULE: ./src/modules/sidebar/sidebar.ts
  2373.  
  2374.  
  2375.  
  2376.  
  2377.  
  2378.  
  2379. css.addStyle(sidebar/* default */.A);
  2380. let resourcesInitialized = false;
  2381. function renderSidebar(sidebar) {
  2382. sidebar.classList.add(`pp_defaultText`);
  2383. observeFor(sidebar, (element) => {
  2384. const customFeedsSection = element.matches(`faceplate-expandable-section-helper`) ? element : sidebar.querySelector(`faceplate-expandable-section-helper`);
  2385. if (customFeedsSection == null)
  2386. return;
  2387. const customFeedsButton = sidebar.querySelector(`summary[aria-controls="multireddits_section"]`);
  2388. if (customFeedsButton != null) {
  2389. renderSidebarSection(customFeedsSection, settings.SIDEBAR_CUSTOMS, async () => {
  2390. const openState = await dynamicElement(() => customFeedsSection.getAttribute(`open`));
  2391. if (openState) {
  2392. }
  2393. return {
  2394. container: customFeedsSection,
  2395. button: customFeedsButton,
  2396. hr: customFeedsSection.nextElementSibling
  2397. };
  2398. });
  2399. return true;
  2400. }
  2401. });
  2402. observeFor(sidebar, (element) => {
  2403. const subsSection = element.matches(`faceplate-expandable-section-helper`) ? element : sidebar.querySelector(`faceplate-expandable-section-helper`);
  2404. if (subsSection == null)
  2405. return;
  2406. const customFeedsButton = sidebar.querySelector(`summary[aria-controls="communities_section"]`);
  2407. if (customFeedsButton != null) {
  2408. renderSubFilter(subsSection);
  2409. renderSidebarSection(subsSection, settings.SIDEBAR_SUBS, async () => {
  2410. const openState = await dynamicElement(() => subsSection.getAttribute(`open`));
  2411. if (openState) {
  2412. }
  2413. let hrElement = subsSection.nextElementSibling;
  2414. while (hrElement != null && !hrElement.matches(`hr`)) {
  2415. hrElement = hrElement.nextElementSibling;
  2416. }
  2417. return {
  2418. container: subsSection,
  2419. button: customFeedsButton,
  2420. hr: hrElement
  2421. };
  2422. });
  2423. return true;
  2424. }
  2425. });
  2426. observeFor(sidebar, (element) => {
  2427. let recentSection = sidebar.querySelector(`reddit-recent-pages`);
  2428. if (recentSection == null && element.matches(`reddit-recent-pages`)) {
  2429. recentSection = element;
  2430. }
  2431. if (recentSection != null) {
  2432. renderSidebarSection(recentSection, settings.SIDEBAR_RECENT, async () => {
  2433. const helper = await dynamicElement(() => {
  2434. const _helper = recentSection.shadowRoot?.querySelector(`faceplate-expandable-section-helper`);
  2435. return _helper?.getAttribute(`open`) != null ? _helper : null;
  2436. });
  2437. const button = await dynamicElement(() => helper?.querySelector(`summary`));
  2438. css.registry(recentSection.shadowRoot);
  2439. helper.classList.add(`pp_defaultText`);
  2440. return {
  2441. container: helper,
  2442. button: button,
  2443. hr: recentSection.querySelector(`hr`)
  2444. };
  2445. });
  2446. return true;
  2447. }
  2448. });
  2449. if (!resourcesInitialized) {
  2450. resourcesInitialized = true;
  2451. observeFor(sidebar, (element) => {
  2452. const resources = sidebar.querySelector(`summary[aria-controls="RESOURCES"]`);
  2453. if (resources != null) {
  2454. const resourcesContainer = resources.parentElement.parentElement;
  2455. const resourceSection = {
  2456. container: resourcesContainer,
  2457. button: resources,
  2458. hr: null
  2459. };
  2460. renderSidebarSection(resourcesContainer, settings.SIDEBAR_RESOURCES, () => resourceSection);
  2461. return true;
  2462. }
  2463. });
  2464. }
  2465. }
  2466. class SidebarSection {
  2467. }
  2468. async function renderSidebarSection(preloadContainer, setting, sectionLoader) {
  2469. if (checkIsRendered(preloadContainer))
  2470. return;
  2471. preloadContainer.classList.add(`pp_sidebar_loadingSection`);
  2472. const section = await sectionLoader();
  2473. preloadContainer.classList.remove(`pp_sidebar_loadingSection`);
  2474. if (setting.isEnabled()) {
  2475. const settingCollapsed = setting.getChild(`Collapsed`, false);
  2476. const details = section.container.querySelector(`details`);
  2477. if (settingCollapsed.isEnabled()) {
  2478. section.container.toggleAttribute(`open`, false);
  2479. details.classList.add(`pp_sidebar_collapsedSection`);
  2480. }
  2481. section.button.addEventListener(`click`, (e) => {
  2482. const button = e.currentTarget;
  2483. // hack because event may be called before aria-expanded was changed
  2484. setTimeout(() => {
  2485. const isCollapsed = button.getAttribute(`aria-expanded`) === 'false';
  2486. settingCollapsed.switch(isCollapsed);
  2487. }, 10);
  2488. details.classList.toggle(`pp_sidebar_collapsedSection`, false);
  2489. });
  2490. }
  2491. else {
  2492. section.container.remove();
  2493. section.hr?.remove();
  2494. }
  2495. }
  2496.  
  2497. // EXTERNAL MODULE: ./src/modules/biggerFonts.less
  2498. var biggerFonts = __webpack_require__("./src/modules/biggerFonts.less");
  2499. ;// CONCATENATED MODULE: ./src/modules/biggerFonts.ts
  2500.  
  2501.  
  2502.  
  2503. if (settings.BIGGER_FONTS.isEnabled()) {
  2504. css.addStyle(biggerFonts/* default */.A);
  2505. }
  2506. function renderBiggerFonts() { }
  2507.  
  2508. // EXTERNAL MODULE: ./resources/imageCloseButton.svg
  2509. var imageCloseButton = __webpack_require__("./resources/imageCloseButton.svg");
  2510. var imageCloseButton_default = /*#__PURE__*/__webpack_require__.n(imageCloseButton);
  2511. // EXTERNAL MODULE: ./src/utils/imageViewer.less
  2512. var imageViewer = __webpack_require__("./src/utils/imageViewer.less");
  2513. ;// CONCATENATED MODULE: ./src/utils/imageViewer.ts
  2514.  
  2515.  
  2516.  
  2517.  
  2518.  
  2519. css.addStyle(imageViewer/* default */.A);
  2520. class Mouse {
  2521. }
  2522. class Drag {
  2523. }
  2524. class ImageViewer {
  2525. constructor() {
  2526. this.openned = false;
  2527. this.viewer = null;
  2528. this.container = null;
  2529. this.image = null;
  2530. this.mouse = { x: 0, y: 0 };
  2531. this.drag = {
  2532. enabled: false,
  2533. start: { x: 0, y: 0 },
  2534. current: { x: 0, y: 0 },
  2535. scale: 1
  2536. };
  2537. this.scrollImage = this.scrollImage.bind(this);
  2538. this.startDrag = this.startDrag.bind(this);
  2539. this.mouseMove = this.mouseMove.bind(this);
  2540. this.endDrag = this.endDrag.bind(this);
  2541. }
  2542. open(src) {
  2543. if (this.openned)
  2544. return;
  2545. this.openned = true;
  2546. if (this.viewer == null) {
  2547. this.build();
  2548. }
  2549. this.image.src = src;
  2550. window.addEventListener('wheel', this.scrollImage, { passive: false });
  2551. this.image.addEventListener('mousedown', this.startDrag);
  2552. document.addEventListener('mousemove', this.mouseMove);
  2553. this.image.addEventListener('mouseup', this.endDrag);
  2554. this.image.addEventListener('mouseleave', this.endDrag);
  2555. // reset pos
  2556. this.drag.current = { x: 0, y: 0 };
  2557. this.drag.scale = 1;
  2558. this.updateTransform();
  2559. document.body.appendChild(this.viewer);
  2560. }
  2561. close() {
  2562. this.viewer.remove();
  2563. this.drag.enabled = false;
  2564. this.container.classList.toggle(`pp_imageViewer_drag`, false);
  2565. window.removeEventListener('wheel', this.scrollImage);
  2566. this.image.removeEventListener('mousedown', this.startDrag);
  2567. document.removeEventListener('mousemove', this.mouseMove);
  2568. this.image.removeEventListener('mouseup', this.endDrag);
  2569. this.image.removeEventListener('mouseleave', this.endDrag);
  2570. this.openned = false;
  2571. }
  2572. build() {
  2573. this.viewer = document.createElement(`div`);
  2574. this.viewer.classList.add(`pp_imageViewer`);
  2575. this.viewer.dataset.open = String(false);
  2576. const closeButton = appendNew(this.viewer, `div`, `pp_imageViewer_closeButton`);
  2577. const closeSvg = buildSvg((imageCloseButton_default()), 40, 40);
  2578. closeButton.appendChild(closeSvg);
  2579. this.container = appendNew(this.viewer, `div`, `pp_imageViewer_imageContainer`);
  2580. this.image = appendNew(this.container, `img`, `pp_imageViewer_image`);
  2581. this.image.alt = `Comment image`;
  2582. this.image.ondragstart = function () {
  2583. return false;
  2584. };
  2585. // close
  2586. this.viewer.addEventListener('click', e => {
  2587. if (e.target != this.image) {
  2588. this.close();
  2589. }
  2590. });
  2591. closeButton.addEventListener('click', () => {
  2592. this.close();
  2593. });
  2594. }
  2595. updateTransform() {
  2596. this.container.style.transform = `translate(${this.drag.current.x}px, ${this.drag.current.y}px) scale(${this.drag.scale}, ${this.drag.scale})`;
  2597. }
  2598. startDrag(event) {
  2599. this.drag.start.x = event.screenX - this.drag.current.x;
  2600. this.drag.start.y = event.screenY - this.drag.current.y;
  2601. this.drag.enabled = true;
  2602. this.container.classList.toggle(`pp_imageViewer_drag`, true);
  2603. }
  2604. mouseMove(event) {
  2605. this.mouse.x = event.clientX;
  2606. this.mouse.y = event.clientY;
  2607. if (this.drag.enabled) {
  2608. this.drag.current.x = event.screenX - this.drag.start.x;
  2609. this.drag.current.y = event.screenY - this.drag.start.y;
  2610. this.updateTransform();
  2611. }
  2612. }
  2613. endDrag() {
  2614. this.fit(1);
  2615. this.drag.enabled = false;
  2616. this.container.classList.toggle(`pp_imageViewer_drag`, false);
  2617. }
  2618. scrollImage(e) {
  2619. const m = Math.max(1.0, 1.0 + Math.log2(this.drag.scale * this.drag.scale));
  2620. const prevScale = this.drag.scale;
  2621. this.drag.scale = Math.max(0.5, this.drag.scale + (-e.deltaY / 1000) * m);
  2622. const rect = this.image.getBoundingClientRect();
  2623. const hh = rect.height / 2;
  2624. const hw = rect.width / 2;
  2625. const dy = rect.y + hh;
  2626. const dx = rect.x + hw;
  2627. const os = this.drag.scale / prevScale - 1;
  2628. this.drag.current.y -= Math.min(Math.max(this.mouse.y - dy, -hh), hh) * os;
  2629. this.drag.current.x -= Math.min(Math.max(this.mouse.x - dx, -hw), hw) * os;
  2630. if (e.deltaY > 0) {
  2631. this.drag.current.y /= 1.1;
  2632. this.drag.current.x /= 1.1;
  2633. }
  2634. this.fit(0.33);
  2635. e.preventDefault();
  2636. }
  2637. fit(force) {
  2638. const offset = 0;
  2639. const rect = this.image.getBoundingClientRect();
  2640. const left = offset - rect.left;
  2641. const right = rect.right - window.innerWidth + offset;
  2642. if (left > 0 && right < 0) {
  2643. this.drag.current.x += (rect.width > window.innerWidth ? -right : left) * force;
  2644. }
  2645. else if (left < 0 && right > 0) {
  2646. this.drag.current.x += (rect.width > window.innerWidth ? left : -right) * force;
  2647. }
  2648. const top = offset - rect.top;
  2649. const bottom = rect.bottom - window.innerHeight + offset;
  2650. if (top > 0 && bottom < 0) {
  2651. this.drag.current.y += (rect.height > window.innerHeight ? -bottom : top) * force;
  2652. }
  2653. else if (top < 0 && bottom > 0) {
  2654. this.drag.current.y += (rect.height > window.innerHeight ? top : -bottom) * force;
  2655. }
  2656. this.updateTransform();
  2657. }
  2658. }
  2659. const imageViewer_imageViewer = new ImageViewer();
  2660.  
  2661. // EXTERNAL MODULE: ./src/modules/bookmark.less
  2662. var bookmark = __webpack_require__("./src/modules/bookmark.less");
  2663. // EXTERNAL MODULE: ./resources/bookmarkSaved.svg
  2664. var bookmarkSaved = __webpack_require__("./resources/bookmarkSaved.svg");
  2665. var bookmarkSaved_default = /*#__PURE__*/__webpack_require__.n(bookmarkSaved);
  2666. // EXTERNAL MODULE: ./resources/bookmarkUnsaved.svg
  2667. var bookmarkUnsaved = __webpack_require__("./resources/bookmarkUnsaved.svg");
  2668. var bookmarkUnsaved_default = /*#__PURE__*/__webpack_require__.n(bookmarkUnsaved);
  2669. ;// CONCATENATED MODULE: ./src/modules/bookmark.ts
  2670.  
  2671.  
  2672.  
  2673.  
  2674.  
  2675.  
  2676.  
  2677. css.addStyle(bookmark/* default */.A);
  2678. function renderCommentBookmark(comment, forced = false) {
  2679. if (settings.SAVED_BOOKMARK_COMMENTS.isDisabled())
  2680. return;
  2681. const contextMenuButton = comment.querySelector(`shreddit-overflow-menu`)?.shadowRoot?.querySelector(`faceplate-dropdown-menu`);
  2682. const saveButton = contextMenuButton.querySelector(`.save-comment-menu-button`);
  2683. const saveButtonContent = saveButton.querySelector(`.text-14`);
  2684. saveButton.addEventListener(`click`, () => {
  2685. renderCommentBookmark(comment, true);
  2686. });
  2687. let isSaved = saveButtonContent.textContent == `Remove from saved`;
  2688. if (forced) {
  2689. isSaved = true;
  2690. }
  2691. if (isSaved || forced || settings.SAVED_BOOKMARK_COMMENTS_SHOW_ALWAYAS.isEnabled()) {
  2692. const downVoteButton = comment.querySelector(`shreddit-comment-action-row`)?.shadowRoot?.querySelector(`button[downvote]`);
  2693. css.registry(comment.querySelector(`shreddit-comment-action-row`)?.shadowRoot);
  2694. const bookmarkButton = downVoteButton.cloneNode(true);
  2695. downVoteButton.after(bookmarkButton);
  2696. let bookmarkSvg = bookmarkButton.querySelector(`svg`);
  2697. bookmarkSvg = replaceBookmarkIcon(bookmarkSvg, isSaved);
  2698. bookmarkButton.addEventListener(`click`, () => {
  2699. isSaved = !isSaved;
  2700. bookmarkSvg = replaceBookmarkIcon(bookmarkSvg, isSaved);
  2701. });
  2702. bookmarkButton.append(saveButton);
  2703. saveButton.classList.add(`pp_bookmark_hiddenButton`);
  2704. }
  2705. }
  2706. async function renderBookmarkPost(post, forced = false, forcedValue = undefined) {
  2707. if (settings.SAVED_BOOKMARK_POSTS.isDisabled())
  2708. return;
  2709. const contextMenu = await dynamicElement(() => post.querySelector(`shreddit-post-overflow-menu`)?.shadowRoot?.querySelector(`faceplate-dropdown-menu`)?.querySelector(`faceplate-menu`), 3000);
  2710. if (contextMenu == undefined) {
  2711. return;
  2712. }
  2713. let isSaved = true;
  2714. let saveButton = null;
  2715. contextMenu.querySelectorAll(`li`).forEach(element => {
  2716. const buttonSpan = element.querySelector(`.text-14`);
  2717. if (buttonSpan.textContent == `Save`) {
  2718. isSaved = false;
  2719. }
  2720. if (buttonSpan.textContent == `Save` || buttonSpan.textContent == `Remove from saved`) {
  2721. saveButton = element;
  2722. }
  2723. });
  2724. // just refresh bookmark button
  2725. if (saveButton == null) {
  2726. const upVoteButton = post.shadowRoot?.querySelector(`button[upvote]`);
  2727. const bookmarkButton = post.shadowRoot?.querySelector(`button[bookmark]`);
  2728. bookmarkButton.className = upVoteButton.className;
  2729. bookmarkButton.classList.add(`pp_bookmark_post`);
  2730. return;
  2731. }
  2732. saveButton.addEventListener(`click`, () => {
  2733. renderBookmarkPost(post, true, true);
  2734. });
  2735. const upVoteButton = post.shadowRoot?.querySelector(`button[upvote]`);
  2736. upVoteButton.addEventListener(`click`, () => {
  2737. renderBookmarkPost(post, true);
  2738. });
  2739. if (forcedValue != undefined) {
  2740. isSaved = forcedValue;
  2741. }
  2742. if (isSaved || forced || settings.SAVED_BOOKMARK_POSTS_SHOW_ALWAYAS.isEnabled()) {
  2743. const downVoteButton = post.shadowRoot?.querySelector(`button[downvote]`);
  2744. const bookmarkButton = downVoteButton.cloneNode(true);
  2745. bookmarkButton.classList.add(`pp_bookmark_post`);
  2746. bookmarkButton.removeAttribute(`disabled`);
  2747. bookmarkButton.removeAttribute(`downvote`);
  2748. bookmarkButton.setAttribute(`bookmark`, ``);
  2749. downVoteButton.after(bookmarkButton);
  2750. let bookmarkSvg = bookmarkButton.querySelector(`svg`);
  2751. bookmarkSvg = replaceBookmarkIcon(bookmarkSvg, isSaved);
  2752. bookmarkButton.addEventListener(`click`, () => {
  2753. isSaved = !isSaved;
  2754. bookmarkSvg = replaceBookmarkIcon(bookmarkSvg, isSaved);
  2755. });
  2756. bookmarkButton.append(saveButton);
  2757. saveButton.classList.add(`pp_bookmark_hiddenButton`);
  2758. }
  2759. }
  2760. function replaceBookmarkIcon(originSvg, isSaved) {
  2761. const newSvg = buildSvg(isSaved ? (bookmarkSaved_default()) : (bookmarkUnsaved_default()), 20, 20);
  2762. newSvg.setAttribute(`width`, `16px`);
  2763. newSvg.setAttribute(`height`, `16px`);
  2764. originSvg.replaceWith(newSvg);
  2765. return newSvg;
  2766. }
  2767.  
  2768. // EXTERNAL MODULE: ./src/modules/collapseAwards.less
  2769. var collapseAwards = __webpack_require__("./src/modules/collapseAwards.less");
  2770. ;// CONCATENATED MODULE: ./src/modules/collapseAwards.ts
  2771.  
  2772.  
  2773.  
  2774.  
  2775.  
  2776. css.addStyle(collapseAwards/* default */.A);
  2777. async function renderCollapseAward(target, targetType) {
  2778. if (settings.COLLAPSE_AWARDS.isDisabled())
  2779. return;
  2780. css.addStyle(collapseAwards/* default */.A, `collapseAwards`);
  2781. const awardButton = targetType.isComment ? target.querySelector(`award-button`) : target.shadowRoot.querySelector(`award-button`);
  2782. if (awardButton == null)
  2783. return;
  2784. if (settings.COLLAPSE_AWARDS_COMPLETELY.isEnabled()) {
  2785. awardButton.remove();
  2786. return;
  2787. }
  2788. if (awardButton.getAttribute(`count`) == `0`) {
  2789. if (!targetType.isComment) {
  2790. css.registry(target.shadowRoot);
  2791. }
  2792. const targetContainer = targetType.isComment ? target.querySelector(`shreddit-comment-action-row`)?.shadowRoot : target?.shadowRoot;
  2793. const upVoteButton = await dynamicElement(() => targetContainer?.querySelector(`button[upvote]`), MAX_LOAD_LAG);
  2794. if (upVoteButton == null)
  2795. return;
  2796. awardButton.classList.toggle(`pp_awardButton_hidden`, isCollapsed(upVoteButton));
  2797. awardButton.classList.toggle(`pp_awardButton_collapsed`, isCollapsed(upVoteButton));
  2798. setTimeout(() => {
  2799. awardButton.classList.add(`pp_awardButton`);
  2800. }, 500);
  2801. upVoteButton.addEventListener(`click`, () => {
  2802. awardButton.classList.toggle(`pp_awardButton_hidden`, isCollapsed(upVoteButton));
  2803. setTimeout(() => {
  2804. awardButton.classList.toggle(`pp_awardButton_collapsed`, isCollapsed(upVoteButton));
  2805. }, 10);
  2806. });
  2807. }
  2808. }
  2809. function isCollapsed(upVoteButton) {
  2810. return upVoteButton.getAttribute(`aria-pressed`) != `true`;
  2811. }
  2812.  
  2813. ;// CONCATENATED MODULE: ./src/modules/subs/flair.ts
  2814.  
  2815. class FlairData {
  2816. }
  2817. class RichElement {
  2818. }
  2819. function renderFlair(conatiner, sub, flair) {
  2820. const a = appendNew(conatiner, `a`, `no-decoration`);
  2821. a.href = `/r/` + sub + `/?f=flair_name%3A%22` + flair.text + `%22`;
  2822. const span = appendNew(a, `span`, [
  2823. `bg-tone-4`,
  2824. `inline-block`,
  2825. `truncate`,
  2826. `max-w-full`,
  2827. `text-12`,
  2828. `font-normal`,
  2829. `box-border`,
  2830. `px-[6px]`,
  2831. `rounded-[20px]`,
  2832. `leading-4`,
  2833. `max-w-full`,
  2834. `py-xs`,
  2835. `!px-sm`,
  2836. `leading-4`,
  2837. `h-xl`,
  2838. `inline-flex`
  2839. ]);
  2840. span.classList.add(flair.color == `light` ? `text-global-white` : `text-global-black`);
  2841. span.style.backgroundColor = flair.background;
  2842. for (const richElement of flair.richtext) {
  2843. if (richElement.e == `text`) {
  2844. const content = document.createTextNode(richElement.t);
  2845. span.appendChild(content);
  2846. }
  2847. if (richElement.e == `emoji`) {
  2848. const fimg = document.createElement(`faceplate-img`);
  2849. fimg.classList.add(`flair-image`);
  2850. fimg.setAttribute(`loading`, `lazy`);
  2851. fimg.setAttribute(`width`, `16`);
  2852. fimg.setAttribute(`height`, `16`);
  2853. fimg.setAttribute(`src`, richElement.u);
  2854. fimg.setAttribute(`alt`, richElement.a);
  2855. span.appendChild(fimg);
  2856. }
  2857. }
  2858. if (flair.richtext.length == 0) {
  2859. const content = document.createTextNode(flair.text);
  2860. span.appendChild(content);
  2861. }
  2862. }
  2863.  
  2864. // EXTERNAL MODULE: ./src/modules/subs/flairBar.less
  2865. var flairBar = __webpack_require__("./src/modules/subs/flairBar.less");
  2866. ;// CONCATENATED MODULE: ./src/modules/subs/flairBar.ts
  2867.  
  2868.  
  2869.  
  2870.  
  2871.  
  2872.  
  2873.  
  2874. css.addStyle(flairBar/* default */.A);
  2875. async function renderFlairBar(main) {
  2876. if (settings.FLAIR_BAR.isDisabled())
  2877. return;
  2878. let feedContent = await dynamicElement(() => main?.querySelector(`shreddit-title`)?.parentElement, MAX_LOAD_LAG);
  2879. // skip render for non feed page
  2880. if (feedContent == null)
  2881. return;
  2882. const subHighlights = main?.querySelector(`community-highlight-carousel`);
  2883. if (subHighlights != null) {
  2884. feedContent = subHighlights;
  2885. }
  2886. const prevFlairMenu = feedContent.parentElement?.querySelector(`.pp_flairBar`)?.parentElement;
  2887. if (prevFlairMenu != null) {
  2888. prevFlairMenu.remove();
  2889. }
  2890. const sub = getCurrentSub();
  2891. // load data
  2892. const subData = await subs_subs.getWithLoader(sub);
  2893. const flairsData = flairs.get(sub);
  2894. // skip render when sub haven't flairs
  2895. if (subData.flairs == undefined || subData.flairs.length == 0)
  2896. return;
  2897. const flairMenuContainer = document.createElement(`div`);
  2898. feedContent.before(flairMenuContainer);
  2899. const flairMenu = appendNew(flairMenuContainer, `div`, `pp_flairBar`);
  2900. if (subHighlights != null) {
  2901. flairMenu.classList.add(`pp_flairBar_highlights`);
  2902. }
  2903. const ul = appendNew(flairMenu, `ul`, [`p-0`, `m-0`, `list-none`, `gap-xs`, `flex`, `flex-row`, `pp_flairBar_list`]);
  2904. let flairsRendered = 0;
  2905. for (const flair of subData.flairs) {
  2906. if (flairsData.hidden != undefined && flairsData.hidden.includes(flair.text))
  2907. continue;
  2908. const li = appendNew(ul, `li`, `max-w-full`);
  2909. renderFlair(li, sub, flair);
  2910. flairsRendered++;
  2911. }
  2912. // prevent render empty menu
  2913. if (flairsRendered == 0) {
  2914. flairMenuContainer.remove();
  2915. return;
  2916. }
  2917. // borders
  2918. const borderContainer = document.createElement(`div`);
  2919. borderContainer.classList.add(`pp_flairBar_bordersContainer`);
  2920. flairMenuContainer.prepend(borderContainer);
  2921. const borderLeftC = appendNew(borderContainer, `div`, `pp_flairBar_preBorder`);
  2922. const borderLeft = appendNew(borderLeftC, `div`, [`pp_flairBar_border`, `pp_flairBar_border_left`]);
  2923. borderLeft.textContent = ` `;
  2924. const borderRightC = appendNew(borderContainer, `div`, `pp_flairBar_preBorder`);
  2925. const borderRight = appendNew(borderRightC, `div`, [`pp_flairBar_border`, `pp_flairBar_border_right`]);
  2926. borderRight.textContent = ` `;
  2927. const hr = document.createElement(`hr`);
  2928. hr.classList.add(`border-0`, `border-b-sm`, `border-solid`, `border-b-neutral-border-weak`);
  2929. flairMenuContainer.prepend(hr);
  2930. const mymx = document.createElement(`div`);
  2931. mymx.classList.add(`my-xs`, `mx-2xs0`);
  2932. flairMenuContainer.prepend(mymx);
  2933. // navigation
  2934. ul.style.left = `25px`;
  2935. const ulRect = ul.getBoundingClientRect();
  2936. const menuRect = flairMenu.getBoundingClientRect();
  2937. flairMenu.addEventListener(`mousemove`, e => {
  2938. onMoveOverFlairs(e, ul, flairMenu);
  2939. });
  2940. if (ulRect.width > menuRect.width * 1.72) {
  2941. ul.classList.add(`pp_flairBar_listSmoothed`);
  2942. }
  2943. }
  2944. function onMoveOverFlairs(e, ul, flairMenu) {
  2945. const ulRect = ul.getBoundingClientRect();
  2946. const menuRect = flairMenu.getBoundingClientRect();
  2947. if (ulRect.width < menuRect.width) {
  2948. ul.style.left = `25px`;
  2949. return;
  2950. }
  2951. let scale = (e.clientX - (menuRect.x + 25)) / (menuRect.right - 25 - (menuRect.x + 25));
  2952. scale = Math.max(0, Math.min(scale, 1));
  2953. ul.style.left = `${Math.round(25 - (ulRect.width - menuRect.width + 50) * scale)}px`;
  2954. }
  2955.  
  2956. // EXTERNAL MODULE: ./src/modules/subs/subs.less
  2957. var subs = __webpack_require__("./src/modules/subs/subs.less");
  2958. // EXTERNAL MODULE: ./src/utils/window.less
  2959. var utils_window = __webpack_require__("./src/utils/window.less");
  2960. // EXTERNAL MODULE: ./src/utils/checkbox.less
  2961. var utils_checkbox = __webpack_require__("./src/utils/checkbox.less");
  2962. // EXTERNAL MODULE: ./resources/windowCloseButton.svg
  2963. var windowCloseButton = __webpack_require__("./resources/windowCloseButton.svg");
  2964. var windowCloseButton_default = /*#__PURE__*/__webpack_require__.n(windowCloseButton);
  2965. ;// CONCATENATED MODULE: ./src/utils/window.ts
  2966.  
  2967.  
  2968.  
  2969.  
  2970.  
  2971.  
  2972. css.addStyle(utils_window/* default */.A);
  2973. css.addStyle(utils_checkbox/* default */.A);
  2974. class Window {
  2975. constructor(tittle, render, onClose = null) {
  2976. this.tittle = tittle;
  2977. this.render = render;
  2978. this.onClose = onClose;
  2979. this.container = null;
  2980. this.content = null;
  2981. this.closeButton = null;
  2982. }
  2983. build() {
  2984. this.container = document.createElement(`div`);
  2985. this.container.classList.add(`pp_window_container`);
  2986. this.container.addEventListener('click', e => {
  2987. if (e.target == this.container) {
  2988. this.close();
  2989. }
  2990. });
  2991. const win = appendNew(this.container, `div`, `pp_window`);
  2992. const tittleContainer = appendNew(win, `div`, `pp_window_tittleContainer`);
  2993. let tittle = appendNew(tittleContainer, `div`, [`pp_window_tittle`, `flex`, `flex-row`]);
  2994. tittle = appendNew(tittle, `span`, [`text-24`, `font-semibold`]);
  2995. tittle.textContent = this.tittle;
  2996. this.closeButton = appendNew(tittleContainer, `div`, [`pp_window_closeButton`, `flex`, `items-center`]);
  2997. this.closeButton = appendNew(this.closeButton, `button`, [`button`, `icon`, `inline-flex`, `items-center`, `justify-center`, `button-small`, `button-secondary`, `px-[var(--rem6)]`]);
  2998. this.closeButton.setAttribute(`tittle`, `Close ${this.tittle}`);
  2999. this.closeButton.addEventListener('click', e => {
  3000. this.close();
  3001. });
  3002. this.closeButton = appendNew(this.closeButton, `span`, [`flex`, `items-center`, `justify-center`]);
  3003. this.closeButton = appendNew(this.closeButton, `span`, [`flex`]);
  3004. const svg = buildSvg((windowCloseButton_default()), 16, 16, { strokeColor: NONE_COLOR });
  3005. this.closeButton.append(svg);
  3006. appendNew(win, `hr`, `border-b-neutral-border-weak`);
  3007. this.content = appendNew(win, `div`, `pp_window_content`);
  3008. appendNew(win, `div`, `pp_window_footer`).textContent = ` `;
  3009. }
  3010. open(context = null) {
  3011. if (this.container == null) {
  3012. this.build();
  3013. }
  3014. while (this.content.firstChild) {
  3015. this.content.removeChild(this.content.lastChild);
  3016. }
  3017. this.render(this, context);
  3018. document.body.appendChild(this.container);
  3019. document.body.style.overflow = 'hidden';
  3020. }
  3021. close() {
  3022. this.container.remove();
  3023. document.body.style.overflow = 'visible';
  3024. if (this.onClose != null) {
  3025. this.onClose();
  3026. }
  3027. }
  3028. }
  3029.  
  3030. // EXTERNAL MODULE: ./src/modules/subs/flairWindow.less
  3031. var flairWindow = __webpack_require__("./src/modules/subs/flairWindow.less");
  3032. ;// CONCATENATED MODULE: ./src/modules/subs/flairWindow.ts
  3033.  
  3034.  
  3035.  
  3036.  
  3037.  
  3038.  
  3039.  
  3040. css.addStyle(flairWindow/* default */.A);
  3041. const flairsWindow = new Window('Flairs settings', renderFlairsWindow, closeFlairsWindow);
  3042. class FlairWindowContext {
  3043. }
  3044. function renderFlairsWindow(win, context) {
  3045. const titlePanel = appendNew(win.content, `div`, [`pp_window_element`, `pp_flairWindow_columnTittle`]);
  3046. const tittleBarArea = appendNew(titlePanel, `div`, `pp_checkBox_panelArea`);
  3047. const tittleBar = appendNew(tittleBarArea, `div`, [`text-14`, `font-semibold`, `mb-xs`]);
  3048. tittleBar.textContent = `Flairs bar:`;
  3049. const tittleFeedArea = appendNew(titlePanel, `div`, `pp_checkBox_panelArea`);
  3050. const tittleFeed = appendNew(tittleFeedArea, `div`, [`text-14`, `font-semibold`, `mb-xs`]);
  3051. tittleFeed.textContent = `Feed:`;
  3052. const scroll = appendNew(win.content, `div`, [`pp_window_scrollContent`, `styled-scrollbars`]);
  3053. const elements = appendNew(scroll, `div`, `pp_window_elementsContainer`);
  3054. const subData = subs_subs.get(context.sub);
  3055. for (const flair of subData.flairs) {
  3056. const panel = appendNew(elements, `div`, `pp_window_element`);
  3057. const flairContainer = appendNew(panel, `div`, `pp_flairWindow_flairContainer`);
  3058. const flairsDataInit = flairs.get(context.sub);
  3059. addFlairToggle(FLAIR_HIDDEN);
  3060. addFlairToggle(FLAIR_BANNED);
  3061. function addFlairToggle(category) {
  3062. const checkboxArea = appendNew(panel, `div`, `pp_checkBox_panelArea`);
  3063. const checkBoxContainer = appendNew(checkboxArea, `div`, `pp_checkBox_container`);
  3064. const checkBoxBack = appendNew(checkBoxContainer, `button`, `pp_checkBox_button`);
  3065. const initState = !(flairsDataInit[category]?.includes(flair.text) ?? false);
  3066. checkBoxBack.classList.toggle(`pp_checkBox_buttonActive`, initState);
  3067. const knob = appendNew(checkBoxBack, `div`, `pp_checkBox_knob`);
  3068. checkBoxBack.addEventListener(`click`, e => {
  3069. const flairData = flairs.get(context.sub);
  3070. let state = flairData[category]?.includes(flair.text) ?? false;
  3071. checkBoxBack.classList.toggle(`pp_checkBox_buttonActive`, state);
  3072. if (state) {
  3073. flairData[category] = flairData[category].filter(f => f != flair.text);
  3074. }
  3075. else {
  3076. const categoryFlairs = flairData[category] ?? [];
  3077. categoryFlairs.push(flair.text);
  3078. flairData[category] = categoryFlairs;
  3079. }
  3080. flairs.set(context.sub, flairData);
  3081. });
  3082. }
  3083. // flair
  3084. renderFlair(flairContainer, context.sub, flair);
  3085. }
  3086. }
  3087. function closeFlairsWindow() {
  3088. const main = document.body.querySelector(`#main-content`);
  3089. renderFlairBar(main);
  3090. }
  3091.  
  3092. ;// CONCATENATED MODULE: ./src/modules/subs/subs.ts
  3093.  
  3094.  
  3095.  
  3096.  
  3097.  
  3098.  
  3099.  
  3100.  
  3101.  
  3102. css.addStyle(subs/* default */.A);
  3103. const FLAIR_HIDDEN = `hidden`;
  3104. const FLAIR_BANNED = `banned`;
  3105. class SubSettings {
  3106. }
  3107. class SubFlairsData {
  3108. }
  3109. class SubData {
  3110. }
  3111. const subSettings = new Database(`SUBS_SETTINGS`);
  3112. const flairs = new Database(`FLAIRS`);
  3113. const subs_subs = new Database(`SUBS`, { isCleanupable: true, validator: subDataValidator, loader: subDataLoader });
  3114. function subDataValidator(subData) {
  3115. return subData.flairs == undefined;
  3116. }
  3117. async function subDataLoader(sub) {
  3118. let subData = {};
  3119. const response = await fetch(`https://www.reddit.com/r/${sub}/api/link_flair_v2.json?raw_json=1`, { cache: `no-cache`, method: `get` });
  3120. const json = await response.json();
  3121. const loadedFlairs = [];
  3122. if (json != null && json.message == null) {
  3123. for (const loadedFlair of json) {
  3124. const flair = { text: loadedFlair.text, color: loadedFlair.text_color, background: loadedFlair.background_color, richtext: loadedFlair.richtext };
  3125. loadedFlairs.push(flair);
  3126. }
  3127. subData.flairs = loadedFlairs;
  3128. return subData;
  3129. }
  3130. else {
  3131. subData.flairs = loadedFlairs;
  3132. pp_log(`Unable to load r/${sub} flairs data`);
  3133. return subData;
  3134. }
  3135. }
  3136. function getCurrentSub() {
  3137. const raw = window.location.href.split(`reddit.com/r/`);
  3138. return raw.length > 1 ? raw[1].split(`/`)[0] : null;
  3139. }
  3140. async function renderSub(main) {
  3141. // skip page without feed
  3142. const checkIsFeed = main.querySelector(`shreddit-feed-error-banner`);
  3143. if (checkIsFeed == null)
  3144. return;
  3145. renderMasthead(main);
  3146. renderFlairBar(main);
  3147. renderHighlights(main);
  3148. }
  3149. async function renderMasthead(main) {
  3150. const masthead = await dynamicElement(() => main.parentElement.parentElement.querySelector(`.masthead`));
  3151. if (checkIsRendered(masthead))
  3152. return;
  3153. masthead.querySelector(`section`).classList.add(`pp_mastheadSection`);
  3154. document.body.addEventListener(`click`, renderContextMenu);
  3155. }
  3156. async function renderHighlights(main) {
  3157. if (settings.COLLAPSE_HIGHLIGHTS.isDisabled())
  3158. return;
  3159. const highlightButton = await dynamicElement(() => main?.querySelector(`community-highlight-carousel`)?.shadowRoot?.querySelector(`button`), MAX_LOAD_LAG);
  3160. if (highlightButton != null) {
  3161. highlightButton.click();
  3162. }
  3163. }
  3164. function renderContextMenu(e) {
  3165. const targetElement = e.target;
  3166. if (targetElement.matches(`shreddit-subreddit-header-buttons`) != true)
  3167. return;
  3168. if (checkIsRendered(targetElement))
  3169. return;
  3170. const controlMenu = targetElement.shadowRoot.querySelector(`shreddit-subreddit-overflow-control`).shadowRoot.querySelector(`faceplate-menu`);
  3171. const originButton = controlMenu.querySelector(`li`);
  3172. // flairs settings
  3173. const menuFlairsButton = originButton.cloneNode(true);
  3174. menuFlairsButton.querySelector(`.text-14`).textContent = `Flairs settings`;
  3175. controlMenu.prepend(menuFlairsButton);
  3176. const sub = getCurrentSub();
  3177. menuFlairsButton.addEventListener(`click`, () => {
  3178. flairsWindow.open({ sub: sub });
  3179. });
  3180. // about
  3181. const link = document.createElement(`a`);
  3182. link.href = `https://www.reddit.com/` + targetElement.getAttribute(`prefixed-name`) + `/about/`;
  3183. link.classList.add(`no-underline`);
  3184. controlMenu.prepend(link);
  3185. const menuAboutButton = originButton.cloneNode(true);
  3186. menuAboutButton.querySelector(`.text-14`).textContent = `About`;
  3187. link.prepend(menuAboutButton);
  3188. }
  3189.  
  3190. ;// CONCATENATED MODULE: ./src/modules/users/users.ts
  3191.  
  3192.  
  3193.  
  3194. class UserData {
  3195. }
  3196. const users = new Database(`USERS`, { isCleanupable: true, validator: userDataValidator, loader: userDataLoader });
  3197. function userDataValidator(userData) {
  3198. return userData.accountId == undefined;
  3199. }
  3200. async function userDataLoader(userId) {
  3201. let userData = {};
  3202. try {
  3203. const response = await fetch(`https://oauth.reddit.com/user/${userId}/about.json`, { cache: `no-cache`, method: `get` });
  3204. if (!response.ok) {
  3205. pp_log(`Failed to load user (${userId}) data with code ${response.status} : ${response.statusText}`);
  3206. return userData;
  3207. }
  3208. const json = await response.json();
  3209. if (json.data?.is_suspended == true || json.data?.is_blocked == true) {
  3210. userData.banned = true;
  3211. return userData;
  3212. }
  3213. userData.rating = (json.data?.link_karma ?? 0) + (json.data?.comment_karma ?? 0) / 2;
  3214. if (json.data?.subreddit?.title) {
  3215. userData.nick = json.data.subreddit.title;
  3216. }
  3217. userData.created = json.data?.created ?? 0;
  3218. userData.accountId = json.kind + `_` + json.data?.id;
  3219. return userData;
  3220. }
  3221. catch (e) {
  3222. pp_log(`Failed to load user (${userId}) data with error ${e}`);
  3223. return userData;
  3224. }
  3225. }
  3226.  
  3227. // EXTERNAL MODULE: ./resources/comments/newUser.svg
  3228. var newUser = __webpack_require__("./resources/comments/newUser.svg");
  3229. var newUser_default = /*#__PURE__*/__webpack_require__.n(newUser);
  3230. // EXTERNAL MODULE: ./resources/comments/bannedUser.svg
  3231. var bannedUser = __webpack_require__("./resources/comments/bannedUser.svg");
  3232. var bannedUser_default = /*#__PURE__*/__webpack_require__.n(bannedUser);
  3233. ;// CONCATENATED MODULE: ./src/modules/users/userInfo.ts
  3234.  
  3235.  
  3236.  
  3237.  
  3238.  
  3239.  
  3240.  
  3241.  
  3242. const NEWUSER_SECONDS_SHIFT = DAY_SECONDS * 64;
  3243. let loadQueueLock = false;
  3244. async function renderUserInfo(userId, nickName, tagsAnchor, infoAnchor, target) {
  3245. if (settings.USER_INFO.isDisabled())
  3246. return;
  3247. await dynamicElement(() => (loadQueueLock ? null : true));
  3248. loadQueueLock = true;
  3249. const userData = await users.getWithLoader(userId, isLoaded => {
  3250. if (isLoaded) {
  3251. setTimeout(() => {
  3252. loadQueueLock = false;
  3253. }, 150 + Math.random() * 100);
  3254. }
  3255. else {
  3256. loadQueueLock = false;
  3257. }
  3258. });
  3259. if (settings.SHOW_NAMES.isEnabled() && userData.nick != undefined && userData.nick) {
  3260. nickName.textContent = userData.nick;
  3261. }
  3262. const rating = document.createElement(`div`);
  3263. rating.classList.add(`text-neutral-content-weak`, `text-12`);
  3264. if (userData.rating != undefined) {
  3265. rating.textContent = userData.rating < 10000 ? `${Math.round(userData.rating / 100) / 10}K` : `${Math.round(userData.rating / 1000)}K`;
  3266. infoAnchor.after(rating);
  3267. const point = document.createElement(`span`);
  3268. if (target.isComment) {
  3269. point.classList.add(`inline-block`, `my-0`, `mx-2xs`, `text-12`, `text-neutral-content-weak`);
  3270. }
  3271. else {
  3272. point.classList.add(`inline-block`, `my-0`, `created-separator`, `text-neutral-content-weak`);
  3273. }
  3274. point.textContent = `•`;
  3275. rating.after(point);
  3276. }
  3277. if (userData.created != undefined && userData.created > Date.now() / 1000 - NEWUSER_SECONDS_SHIFT) {
  3278. const newSvg = buildSvg((newUser_default()), 20, 20);
  3279. newSvg.setAttribute(`viewBox`, `-2 -2 20 20`);
  3280. tagsAnchor.before(newSvg);
  3281. }
  3282. if (userData.banned != undefined && userData.banned) {
  3283. const newSvg = buildSvg((bannedUser_default()), 20, 20);
  3284. newSvg.setAttribute(`viewBox`, `-2 -2 20 20`);
  3285. tagsAnchor.before(newSvg);
  3286. }
  3287. }
  3288.  
  3289. // EXTERNAL MODULE: ./src/modules/posts/posts.less
  3290. var posts = __webpack_require__("./src/modules/posts/posts.less");
  3291. // EXTERNAL MODULE: ./src/modules/posts/postsBackplates.less
  3292. var postsBackplates = __webpack_require__("./src/modules/posts/postsBackplates.less");
  3293. // EXTERNAL MODULE: ./resources/postUnwrapButton.svg
  3294. var postUnwrapButton = __webpack_require__("./resources/postUnwrapButton.svg");
  3295. var postUnwrapButton_default = /*#__PURE__*/__webpack_require__.n(postUnwrapButton);
  3296. ;// CONCATENATED MODULE: ./src/modules/posts/posts.ts
  3297.  
  3298.  
  3299.  
  3300.  
  3301.  
  3302.  
  3303.  
  3304.  
  3305.  
  3306.  
  3307.  
  3308.  
  3309.  
  3310.  
  3311. css.addStyle(posts/* default */.A);
  3312. if (settings.BACKPLATES.isEnabled()) {
  3313. css.addStyle(postsBackplates/* default */.A);
  3314. }
  3315. async function renderPost(post) {
  3316. if (checkIsRendered(post))
  3317. return;
  3318. checkVisability(post);
  3319. applyShadowRoot(post);
  3320. renderHeader(post);
  3321. renderContent(post);
  3322. renderShareButtonPost(post);
  3323. renderBookmarkPost(post);
  3324. const award = await dynamicElement(() => post.shadowRoot?.querySelector(`award-button`), MAX_LOAD_LAG);
  3325. if (award != null) {
  3326. renderCollapseAward(post, IS_POST);
  3327. }
  3328. if (settings.SELECTABLE_POSTS.isEnabled()) {
  3329. post.querySelector(`a[slot="full-post-link"]`)?.remove();
  3330. const tittle = await dynamicElement(() => post.querySelector(`a[slot="title"]`), MAX_LOAD_LAG);
  3331. tittle?.classList?.add(`pp_post_tittle`);
  3332. }
  3333. }
  3334. async function checkVisability(post) {
  3335. if (window.location.href.includes(`/comments/`)) {
  3336. return;
  3337. }
  3338. const sub = post.getAttribute(`subreddit-prefixed-name`).replace(`r/`, ``);
  3339. const flairData = flairs.get(sub);
  3340. const postFlair = await dynamicElement(() => post.querySelector(`shreddit-post-flair`)?.querySelector(`a`), MAX_LOAD_LAG);
  3341. if (postFlair != null) {
  3342. const postFlairText = decodeURIComponent(postFlair.href.split(`%22`)[1]);
  3343. if (flairData.banned != undefined && flairData.banned.includes(postFlairText)) {
  3344. const next = await dynamicElement(() => post.parentElement.nextElementSibling, MAX_LOAD_LAG);
  3345. post.remove();
  3346. next?.remove();
  3347. }
  3348. }
  3349. }
  3350. async function applyShadowRoot(post) {
  3351. const shadowRootLock = await dynamicElement(() => post.shadowRoot);
  3352. css.registry(post.shadowRoot);
  3353. }
  3354. async function renderShareButtonPost(post) {
  3355. const shareButton = await dynamicElement(() => post.shadowRoot?.querySelector(`shreddit-post-share-button`)?.shadowRoot?.querySelector(`button`));
  3356. css.registry(shareButton.parentNode.parentNode);
  3357. shareButton.classList.add(`pp_post_shareButton`);
  3358. }
  3359. async function renderHeader(post) {
  3360. const author = post.getAttribute(`author`);
  3361. if (post.getAttribute(`view-context`) == `AggregateFeed`) {
  3362. if (settings.SHOW_POST_AUTHOR.isDisabled())
  3363. return;
  3364. const anchor = await dynamicElement(() => post.querySelector(`span[slot="credit-bar"]`)?.querySelector(`.created-separator`), MAX_LOAD_LAG);
  3365. const userNameLink = document.createElement(`a`);
  3366. userNameLink.classList.add(`flex`, `items-center`, `text-neutral-content`, `visited:text-neutral-content-weak`, `a`, `cursor-pointer`, `no-visited`, `no-underline`, `hover:no-underline`);
  3367. userNameLink.setAttribute(`href`, `/user/${author}/`);
  3368. anchor.before(userNameLink);
  3369. const userName = appendNew(userNameLink, `div`, [`text-neutral-content-weak`, `text-12`]);
  3370. userName.textContent = author;
  3371. const point = document.createElement(`span`);
  3372. point.classList.add(`inline-block`, `my-0`, `created-separator`, `text-neutral-content-weak`);
  3373. point.textContent = `•`;
  3374. userNameLink.before(point);
  3375. // userInfo
  3376. renderUserInfo(author, userName, anchor, anchor, IS_POST);
  3377. }
  3378. else {
  3379. // userInfo
  3380. const creditBar = await dynamicElement(() => post.querySelector(`[slot="credit-bar"]`), MAX_LOAD_LAG); // usually it's span, but sometimes div
  3381. const userName = await dynamicElement(() => creditBar.querySelector(`span[slot="authorName"]`)?.querySelector(`a`)?.querySelector(`.whitespace-nowrap`), MAX_LOAD_LAG);
  3382. const anchor = creditBar.querySelector(`.created-separator`);
  3383. if (anchor == null)
  3384. return; // post view
  3385. renderUserInfo(author, userName, anchor, anchor, IS_POST);
  3386. }
  3387. }
  3388. async function renderContent(post) {
  3389. // comments view
  3390. if (window.location.href.includes(`/comments/`)) {
  3391. registerImages(post, false);
  3392. return;
  3393. }
  3394. // feed view
  3395. const postContent = await dynamicElement(() => post.querySelector(`.feed-card-text-preview`), MAX_LOAD_LAG);
  3396. if (postContent == null)
  3397. return;
  3398. if (settings.SELECTABLE_POSTS.isEnabled()) {
  3399. postContent.parentElement.parentElement.removeAttribute(`href`);
  3400. }
  3401. // fix bad formated text
  3402. postContent.classList.remove(`feed-card-text-preview`);
  3403. // fix click events
  3404. const postAnchor = post.querySelector(`a[slot="text-body"]`);
  3405. postAnchor.classList.toggle(`pointer-events-none`, false);
  3406. // forced load preview images
  3407. for (const content of postContent.childNodes) {
  3408. if (content instanceof Element && content.matches(`object`)) {
  3409. const previewHref = content.querySelector(`a`)?.href;
  3410. if (previewHref != null) {
  3411. const image = document.createElement(`faceplate-img`);
  3412. image.setAttribute(`src`, previewHref);
  3413. image.setAttribute(`loading`, `eager`);
  3414. image.setAttribute(`sizes`, `(min-width: 1415px) 750px, (min-width: 768px) 50vw, 100vw`);
  3415. image.className = `block w-fit my-0 mx-auto max-w-[100%]`;
  3416. content.replaceWith(image);
  3417. }
  3418. }
  3419. }
  3420. registerImages(post, true);
  3421. renderUnwrapPostButton(post, postContent);
  3422. }
  3423. async function registerImages(post, isFeed) {
  3424. if (settings.IMAGE_VIEWER.isDisabled())
  3425. return;
  3426. if (isFeed) {
  3427. const anyImage = await dynamicElement(() => post.querySelector(`faceplate-img`), MAX_LOAD_LAG);
  3428. if (anyImage != null) {
  3429. post.querySelectorAll(`faceplate-img`).forEach(imageContainer => {
  3430. const href = imageContainer.getAttribute(`src`);
  3431. console.log('post img => ' + href);
  3432. let image = imageContainer.shadowRoot?.querySelector(`img`);
  3433. if (image != null) {
  3434. image.classList.add(`pp_imageViewable`);
  3435. }
  3436. imageContainer.addEventListener(`click`, () => {
  3437. imageViewer_imageViewer.open(href);
  3438. });
  3439. });
  3440. }
  3441. }
  3442. else {
  3443. post.querySelectorAll(`figure[class="rte-media"]`).forEach(imageContainer => {
  3444. const imageAnchor = imageContainer.querySelector(`a`);
  3445. const href = imageAnchor.getAttribute(`href`);
  3446. imageAnchor.removeAttribute(`href`);
  3447. let image = imageContainer.querySelector(`img`);
  3448. if (image == null) {
  3449. image = imageContainer.querySelector(`shreddit-player-2`);
  3450. }
  3451. image.classList.add(`pp_imageViewable`);
  3452. imageAnchor.addEventListener(`click`, () => {
  3453. imageViewer_imageViewer.open(href);
  3454. });
  3455. });
  3456. }
  3457. }
  3458. async function renderUnwrapPostButton(post, postContent) {
  3459. // hack to await when post loaded properly
  3460. const postShadowRoot = await dynamicElement(() => post.shadowRoot, MAX_LOAD_LAG);
  3461. const renderedHeight = postContent.getBoundingClientRect().height;
  3462. postContent.classList.add(`pp_post_noWrap`);
  3463. const actualHeight = postContent.getBoundingClientRect().height;
  3464. postContent.classList.remove(`pp_post_noWrap`);
  3465. if (actualHeight > renderedHeight + 5) {
  3466. const unwrapContainer = appendNew(post, `div`, `pp_post_unwrapContainer`);
  3467. post.shadowRoot.append(unwrapContainer);
  3468. const unwrapButton = appendNew(unwrapContainer, `div`, `pp_post_unwrapButton`);
  3469. const unwrapIcon = buildSvg((postUnwrapButton_default()), 25, 25);
  3470. unwrapButton.append(unwrapIcon);
  3471. unwrapButton.addEventListener(`click`, () => {
  3472. postContent.classList.add(`pp_post_noWrap`);
  3473. unwrapContainer.remove();
  3474. }, { once: true });
  3475. }
  3476. }
  3477.  
  3478. // EXTERNAL MODULE: ./src/modules/feed/feedButtons.less
  3479. var feedButtons = __webpack_require__("./src/modules/feed/feedButtons.less");
  3480. // EXTERNAL MODULE: ./resources/feedButtons/feedButtonBest_empty.svg
  3481. var feedButtonBest_empty = __webpack_require__("./resources/feedButtons/feedButtonBest_empty.svg");
  3482. var feedButtonBest_empty_default = /*#__PURE__*/__webpack_require__.n(feedButtonBest_empty);
  3483. // EXTERNAL MODULE: ./resources/feedButtons/feedButtonBest.svg
  3484. var feedButtonBest = __webpack_require__("./resources/feedButtons/feedButtonBest.svg");
  3485. var feedButtonBest_default = /*#__PURE__*/__webpack_require__.n(feedButtonBest);
  3486. // EXTERNAL MODULE: ./resources/feedButtons/feedButtonHot.svg
  3487. var feedButtonHot = __webpack_require__("./resources/feedButtons/feedButtonHot.svg");
  3488. var feedButtonHot_default = /*#__PURE__*/__webpack_require__.n(feedButtonHot);
  3489. // EXTERNAL MODULE: ./resources/feedButtons/feedButtonNew.svg
  3490. var feedButtonNew = __webpack_require__("./resources/feedButtons/feedButtonNew.svg");
  3491. var feedButtonNew_default = /*#__PURE__*/__webpack_require__.n(feedButtonNew);
  3492. // EXTERNAL MODULE: ./resources/feedButtons/feedButtonRising.svg
  3493. var feedButtonRising = __webpack_require__("./resources/feedButtons/feedButtonRising.svg");
  3494. var feedButtonRising_default = /*#__PURE__*/__webpack_require__.n(feedButtonRising);
  3495. // EXTERNAL MODULE: ./resources/feedButtons/feedButtonTop.svg
  3496. var feedButtonTop = __webpack_require__("./resources/feedButtons/feedButtonTop.svg");
  3497. var feedButtonTop_default = /*#__PURE__*/__webpack_require__.n(feedButtonTop);
  3498. ;// CONCATENATED MODULE: ./src/modules/feed/feedRedirect.ts
  3499.  
  3500.  
  3501.  
  3502. function GetDefaultFeedProperty(location) {
  3503. switch (location) {
  3504. case FeedLocation.Home:
  3505. return settings.DEFAULT_FEED_HOME;
  3506. case FeedLocation.Popular:
  3507. return settings.DEFAULT_FEED_POPULAR;
  3508. case FeedLocation.All:
  3509. return settings.DEFAULT_FEED_ALL;
  3510. default:
  3511. return settings.DEFAULT_FEED_SUB;
  3512. }
  3513. }
  3514. function IsUnsetedFeed() {
  3515. if (window.location.href == `https://www.reddit.com/`)
  3516. return true;
  3517. if (window.location.href.includes(`/?f=flair_name`))
  3518. return false;
  3519. if (window.location.href.includes(`?feed=home`)) {
  3520. return window.location.href.includes(`reddit.com/?feed=home`);
  3521. }
  3522. else {
  3523. return window.location.href.split(`/r/`)[1].split(`/`).length < 3;
  3524. }
  3525. }
  3526. function CheckFeedRedirect(location, sort) {
  3527. if (location == FeedLocation.Sub) {
  3528. const currentSubSettings = subSettings.get(getCurrentSub());
  3529. if (currentSubSettings.defaultFeed != undefined) {
  3530. return currentSubSettings.defaultFeed == sort;
  3531. }
  3532. }
  3533. const defaultFeedProperty = GetDefaultFeedProperty(location);
  3534. return (!defaultFeedProperty.isDefault() && defaultFeedProperty.get() == sort);
  3535. }
  3536.  
  3537. ;// CONCATENATED MODULE: ./src/modules/feed/feedButtons.ts
  3538.  
  3539.  
  3540.  
  3541.  
  3542.  
  3543.  
  3544.  
  3545.  
  3546.  
  3547.  
  3548.  
  3549.  
  3550.  
  3551.  
  3552.  
  3553. css.addStyle(feedButtons/* default */.A);
  3554. const BUTTONS_SVG = {
  3555. Best: (feedButtonBest_default()),
  3556. Hot: (feedButtonHot_default()),
  3557. New: (feedButtonNew_default()),
  3558. Top: (feedButtonTop_default()),
  3559. Rising: (feedButtonRising_default())
  3560. };
  3561. const BUTTON_CLASSES = [
  3562. `inline-flex`,
  3563. `flex-col`,
  3564. `text-neutral-content-weak`,
  3565. `font-semibold`,
  3566. `rounded-full`,
  3567. `hover:no-underline`,
  3568. `hover:bg-secondary-background-hover`,
  3569. `hover:text-secondary-content`,
  3570. `active:bg-secondary-background`,
  3571. `pl-[var(--rem16)]`,
  3572. `pr-[var(--rem16)]`
  3573. ];
  3574. async function renderFeedButtons(main, feedDropdown) {
  3575. if (settings.FEED_BUTTONS.isDisabled())
  3576. return;
  3577. if (checkIsRendered(main))
  3578. return;
  3579. // get current feed
  3580. const currentFeed = feedDropdown?.querySelector(`div[slot="selected-item"]`)?.textContent;
  3581. feedDropdown?.remove();
  3582. const location = GetFeedLocation();
  3583. // get container
  3584. let buttonsContainer = null;
  3585. let hrefGenerator = null;
  3586. if (location != FeedLocation.Sub) {
  3587. const originContainer = await dynamicElement(() => main.querySelector(`shreddit-layout-event-setter`)?.parentElement);
  3588. originContainer.classList.add(`pp_feedButtonsContainer`);
  3589. buttonsContainer = document.createElement(`div`);
  3590. buttonsContainer.classList.add(`flex`, `mx-md`, `shrink-0`, `pp_feedContainer`);
  3591. originContainer.prepend(buttonsContainer);
  3592. if (location == FeedLocation.Home) {
  3593. hrefGenerator = feed => {
  3594. return `/${feed.toLowerCase()}/?feed=home`;
  3595. };
  3596. }
  3597. else {
  3598. hrefGenerator = feed => {
  3599. return `/r/${(location == FeedLocation.Popular) ? `popular` : `all`}/${feed.toLowerCase()}/`;
  3600. };
  3601. }
  3602. }
  3603. else {
  3604. const aboutContainer = await dynamicElement(() => main.querySelector(`a[slot="page-3"]`)?.parentElement?.parentElement);
  3605. buttonsContainer = document.createElement(`div`);
  3606. buttonsContainer.classList.add(`flex`, `mx-md`, `shrink-0`, `pp_feedContainer`);
  3607. aboutContainer.before(buttonsContainer);
  3608. aboutContainer.remove();
  3609. const subName = getCurrentSub();
  3610. hrefGenerator = feed => {
  3611. return `/r/${subName}/${feed.toLowerCase()}/`;
  3612. };
  3613. // render default feed dropdown
  3614. const feedpanel = buttonsContainer.parentElement;
  3615. feedpanel.classList.toggle(`justify-between`, false);
  3616. feedpanel.classList.toggle(`flex-wrap`, false);
  3617. feedpanel.classList.toggle(`pp_feedPanel`, true);
  3618. const space = document.createElement(`div`);
  3619. space.classList.add(`pp_feedPanel_space`);
  3620. buttonsContainer.after(space);
  3621. let currentSubSettings = subSettings.get(subName);
  3622. const isDefault = (currentSubSettings.defaultFeed == undefined) ? (currentFeed == settings.DEFAULT_FEED_SUB.get()) : (currentFeed == currentSubSettings.defaultFeed);
  3623. const defaultFeedMark = document.createElement(`div`);
  3624. defaultFeedMark.classList.add(`pp_defaultFeed_mark`);
  3625. let svg = buildSvg(isDefault ? (feedButtonBest_default()) : (feedButtonBest_empty_default()), 16, 16);
  3626. defaultFeedMark.append(svg);
  3627. space.after(defaultFeedMark);
  3628. const defaultFeedMarkHint = appendNew(defaultFeedMark, `div`, `pp_defaultFeed_mark_hint`);
  3629. const defaultFeedMarkHintSpan = appendNew(defaultFeedMarkHint, `span`);
  3630. defaultFeedMarkHintSpan.textContent = isDefault ? `${currentFeed} is default feed for r/${subName}` : `Set ${currentFeed} as default feed for r/${subName}`;
  3631. if (!isDefault) {
  3632. defaultFeedMark.addEventListener(`click`, () => {
  3633. const updatedSvg = buildSvg((feedButtonBest_default()), 16, 16);
  3634. svg.replaceWith(updatedSvg);
  3635. defaultFeedMarkHintSpan.textContent = `${currentFeed} is default feed for r/${subName}`;
  3636. currentSubSettings.defaultFeed = currentFeed;
  3637. subSettings.set(subName, currentSubSettings);
  3638. }, { once: true });
  3639. }
  3640. }
  3641. // render buttons
  3642. const feeds = GetFeeds(location);
  3643. const isUnseted = IsUnsetedFeed();
  3644. for (const feed of feeds) {
  3645. const button = appendNew(buttonsContainer, `a`, BUTTON_CLASSES);
  3646. button.href = hrefGenerator(feed);
  3647. const isCurrent = feed == currentFeed;
  3648. button.classList.toggle(`bg-secondary-background-selected`, isCurrent);
  3649. button.classList.toggle(`!text-neutral-content-strong`, isCurrent);
  3650. const spanContainer = appendNew(button, `span`, [`inline-flex`, `flex-row`, `items-center`, `gap-xs`, `py-[var(--rem10)]`, `leading-5`, `font-14`, `pp_feedButton`]);
  3651. let graphic = BUTTONS_SVG[feed];
  3652. if (graphic != null) {
  3653. let svg = buildSvg(graphic, 16, 16);
  3654. spanContainer.append(svg);
  3655. }
  3656. const spanText = appendNew(spanContainer, `span`);
  3657. spanText.textContent = feed;
  3658. if (isUnseted && CheckFeedRedirect(location, feed)) {
  3659. button.click();
  3660. }
  3661. }
  3662. }
  3663.  
  3664. ;// CONCATENATED MODULE: ./src/modules/feed/feed.ts
  3665.  
  3666.  
  3667.  
  3668.  
  3669.  
  3670. let postObserver = null;
  3671. async function renderFeed(container) {
  3672. const main = await dynamicElement(() => container.querySelector(`#subgrid-container`));
  3673. // render embedded posts
  3674. main.querySelectorAll(`shreddit-post`).forEach(post => {
  3675. renderPost(post);
  3676. });
  3677. const initialPostsObserver = new MutationObserver(mutations => {
  3678. for (const mutation of mutations) {
  3679. for (const node of mutation.addedNodes) {
  3680. if (node instanceof HTMLElement && node.matches(`shreddit-post`)) {
  3681. renderPost(node);
  3682. }
  3683. }
  3684. }
  3685. });
  3686. initialPostsObserver.observe(main, { childList: true, subtree: true });
  3687. setTimeout(() => {
  3688. initialPostsObserver.disconnect();
  3689. }, MAX_LOAD_LAG);
  3690. // render loaded posts
  3691. initializePostObserver(main);
  3692. renderSub(main);
  3693. const feedDropdown = await dynamicElement(() => main.querySelector(`shreddit-sort-dropdown`), MAX_LOAD_LAG);
  3694. // skip non feed page
  3695. const isInvalidDropdown = (feedDropdown == null || feedDropdown.getAttribute(`trigger-id`) == `comment-sort-button`) && !window.location.href.includes(`/about/`);
  3696. if (isInvalidDropdown)
  3697. return;
  3698. renderFeedButtons(main, feedDropdown);
  3699. }
  3700. function initializePostObserver(target) {
  3701. if (postObserver != null) {
  3702. postObserver.disconnect();
  3703. }
  3704. postObserver = new MutationObserver(mutations => {
  3705. for (const mutation of mutations) {
  3706. for (const node of mutation.addedNodes) {
  3707. if (node instanceof HTMLElement) {
  3708. if (node.matches(`faceplate-batch`)) {
  3709. node.querySelectorAll(`shreddit-post`).forEach(post => {
  3710. renderPost(post);
  3711. });
  3712. }
  3713. // load r/all posts
  3714. if (node.matches(`article`)) {
  3715. renderPost(node.querySelector(`shreddit-post`));
  3716. }
  3717. }
  3718. }
  3719. }
  3720. });
  3721. postObserver.observe(target, { childList: true, subtree: true });
  3722. }
  3723.  
  3724. // EXTERNAL MODULE: ./src/modules/comments/hideShare.less
  3725. var hideShare = __webpack_require__("./src/modules/comments/hideShare.less");
  3726. // EXTERNAL MODULE: ./src/modules/comments/comments.less
  3727. var comments = __webpack_require__("./src/modules/comments/comments.less");
  3728. ;// CONCATENATED MODULE: ./src/modules/users/userOperations.ts
  3729.  
  3730.  
  3731.  
  3732. class UserOperation {
  3733. getInput(state, accountId) { }
  3734. run(state, userId) {
  3735. let userData = users.get(userId);
  3736. const body = {
  3737. csrf_token: getCookie(`csrf_token`),
  3738. operation: this.key,
  3739. variables: {
  3740. input: this.getInput(state, userData.accountId)
  3741. }
  3742. };
  3743. fetch(`https://www.reddit.com/svc/shreddit/graphql`, {
  3744. method: `post`,
  3745. headers: new Headers({
  3746. Accept: `application/json`,
  3747. 'Content-Type': `application/json`
  3748. }),
  3749. body: JSON.stringify(body)
  3750. })
  3751. .then(r => r.json())
  3752. .then(result => {
  3753. if (result != null && result.errors?.message) {
  3754. notify(result.errors.message);
  3755. }
  3756. });
  3757. }
  3758. }
  3759. class FollowOperation extends UserOperation {
  3760. constructor() {
  3761. super(...arguments);
  3762. this.key = `UpdateProfileFollowState`;
  3763. this.enable = `FOLLOWED`;
  3764. this.disable = `NONE`;
  3765. }
  3766. getInput(state, accountId) {
  3767. return {
  3768. accountId: accountId,
  3769. state: state ? this.enable : this.disable
  3770. };
  3771. }
  3772. }
  3773. class BlockOperation extends UserOperation {
  3774. constructor() {
  3775. super(...arguments);
  3776. this.key = `UpdateRedditorBlockState`;
  3777. this.enable = `BLOCKED`;
  3778. this.disable = `NONE`;
  3779. }
  3780. getInput(state, accountId) {
  3781. return {
  3782. redditorId: accountId,
  3783. blockState: state ? this.enable : this.disable
  3784. };
  3785. }
  3786. }
  3787. const FOLLOW_OPERATION = new FollowOperation();
  3788. const BLOCK_OPERATION = new BlockOperation();
  3789.  
  3790. // EXTERNAL MODULE: ./resources/comments/userTags/followedIcon.svg
  3791. var followedIcon = __webpack_require__("./resources/comments/userTags/followedIcon.svg");
  3792. var followedIcon_default = /*#__PURE__*/__webpack_require__.n(followedIcon);
  3793. // EXTERNAL MODULE: ./resources/comments/userTags/likedIcon.svg
  3794. var likedIcon = __webpack_require__("./resources/comments/userTags/likedIcon.svg");
  3795. var likedIcon_default = /*#__PURE__*/__webpack_require__.n(likedIcon);
  3796. // EXTERNAL MODULE: ./resources/comments/userTags/warningIcon.svg
  3797. var warningIcon = __webpack_require__("./resources/comments/userTags/warningIcon.svg");
  3798. var warningIcon_default = /*#__PURE__*/__webpack_require__.n(warningIcon);
  3799. // EXTERNAL MODULE: ./resources/comments/userTags/blockedIcon.svg
  3800. var blockedIcon = __webpack_require__("./resources/comments/userTags/blockedIcon.svg");
  3801. var blockedIcon_default = /*#__PURE__*/__webpack_require__.n(blockedIcon);
  3802. // EXTERNAL MODULE: ./resources/comments/userTags/followedButton.svg
  3803. var followedButton = __webpack_require__("./resources/comments/userTags/followedButton.svg");
  3804. var followedButton_default = /*#__PURE__*/__webpack_require__.n(followedButton);
  3805. // EXTERNAL MODULE: ./resources/comments/userTags/likedButton.svg
  3806. var likedButton = __webpack_require__("./resources/comments/userTags/likedButton.svg");
  3807. var likedButton_default = /*#__PURE__*/__webpack_require__.n(likedButton);
  3808. // EXTERNAL MODULE: ./resources/comments/userTags/warningButton.svg
  3809. var warningButton = __webpack_require__("./resources/comments/userTags/warningButton.svg");
  3810. var warningButton_default = /*#__PURE__*/__webpack_require__.n(warningButton);
  3811. // EXTERNAL MODULE: ./resources/comments/userTags/blockedButton.svg
  3812. var blockedButton = __webpack_require__("./resources/comments/userTags/blockedButton.svg");
  3813. var blockedButton_default = /*#__PURE__*/__webpack_require__.n(blockedButton);
  3814. // EXTERNAL MODULE: ./src/modules/comments/userTags.less
  3815. var userTags = __webpack_require__("./src/modules/comments/userTags.less");
  3816. ;// CONCATENATED MODULE: ./src/modules/comments/userTags.ts
  3817.  
  3818.  
  3819.  
  3820.  
  3821.  
  3822.  
  3823.  
  3824.  
  3825.  
  3826.  
  3827.  
  3828.  
  3829.  
  3830.  
  3831.  
  3832.  
  3833. class UserTag {
  3834. }
  3835. UserTag.FOLLOWED = `Followed`;
  3836. UserTag.LIKED = `Liked`;
  3837. UserTag.WARNING = `Warning`;
  3838. UserTag.BLOCKED = `Blocked`;
  3839. //
  3840. class UserTagConfig {
  3841. }
  3842. const USERTAG_CONFIGS = new Map([
  3843. [UserTag.FOLLOWED, { priority: 100, addHint: `Follow`, removeHint: `Unfollow`, color: `#0b7ed3`, icon: (followedIcon_default()), button: (followedButton_default()) }],
  3844. [UserTag.LIKED, { priority: 2, addHint: `Tag as liked`, removeHint: `Remove liked tag`, color: `#C95A54`, icon: (likedIcon_default()), button: (likedButton_default()) }],
  3845. [UserTag.WARNING, { priority: 1, addHint: `Tag as warned`, removeHint: `Remove warned tag`, color: `#D4A343`, icon: (warningIcon_default()), button: (warningButton_default()) }],
  3846. [UserTag.BLOCKED, { priority: 0, addHint: `Block`, removeHint: `Unblock`, color: `#663988`, icon: (blockedIcon_default()), button: (blockedButton_default()) }]
  3847. ]);
  3848. class UserTagsData {
  3849. }
  3850. const tags = new Database(`TAGS`);
  3851. async function renderUserTags(comment) {
  3852. if (settings.USER_TAGS.isDisabled())
  3853. return;
  3854. css.addStyle(userTags/* default */.A, `userTags`);
  3855. const userId = comment.getAttribute(`author`);
  3856. if (userId == null)
  3857. return;
  3858. const tagsData = tags.get(userId);
  3859. const tagsContainer = await dynamicElement(() => comment.querySelector(`div[pp-anchor="tags"]`), MAX_LOAD_LAG);
  3860. if (tagsContainer == null) {
  3861. pp_log(`Unable to render userTags`);
  3862. return;
  3863. }
  3864. // clear old tags
  3865. tagsContainer.parentNode.querySelectorAll(`svg[userTag="true"]`).forEach(tag => {
  3866. tag.remove();
  3867. });
  3868. if (tagsData.tags != undefined) {
  3869. for (const tag of tagsData.tags) {
  3870. renderNextTag(tag);
  3871. }
  3872. }
  3873. function renderNextTag(tag) {
  3874. const config = USERTAG_CONFIGS.get(tag);
  3875. const tagSvg = buildSvg(config.icon, 20, 20);
  3876. tagSvg.setAttribute(`userTag`, `true`);
  3877. tagSvg.setAttribute(`viewBox`, `-4 -4 20 20`);
  3878. tagSvg.style.color = config.color;
  3879. tagsContainer.after(tagSvg);
  3880. }
  3881. }
  3882.  
  3883. ;// CONCATENATED MODULE: ./src/modules/comments/userTagsPanel.ts
  3884.  
  3885.  
  3886.  
  3887.  
  3888.  
  3889.  
  3890.  
  3891. class UserTagButtonContext {
  3892. }
  3893. const BLOCK_COOLDOWN_SECONDS = DAY_SECONDS + 42;
  3894. const INACTIVE_COLOR = `#adadad`;
  3895. function renderUserTagsPanel(contextMenu, userId) {
  3896. if (settings.USER_TAGS.isDisabled())
  3897. return;
  3898. const tagHintOffset = document.createElement(`div`);
  3899. tagHintOffset.classList.add(`pp_tagHint_offset`);
  3900. contextMenu.prepend(tagHintOffset);
  3901. const tagHintContainer = document.createElement(`div`);
  3902. tagHintContainer.classList.add(`pp_tagHintContainer`);
  3903. tagHintOffset.prepend(tagHintContainer);
  3904. const tagHint = appendNew(tagHintContainer, `div`, `pp_tagHint`);
  3905. tagHint.style.display = `none`;
  3906. const tagsPanel = document.createElement(`div`);
  3907. tagsPanel.classList.add(`pp_tagsPanel`);
  3908. tagHintOffset.after(tagsPanel);
  3909. USERTAG_CONFIGS.forEach((config, userTag) => {
  3910. renderTagButton(config, userTag);
  3911. });
  3912. function renderTagButton(config, userTag) {
  3913. const tagButton = appendNew(tagsPanel, `span`, `pp_tagButton`);
  3914. tagButton.setAttribute(`userTag`, userTag);
  3915. const subscribeIcon = buildSvg(config.button, 20, 20);
  3916. tagButton.appendChild(subscribeIcon);
  3917. const context = { userTag: userTag, userId: userId, button: tagButton, hint: tagHint };
  3918. tagButton.addEventListener(`click`, () => {
  3919. userTagButtonClick(context);
  3920. });
  3921. tagButton.addEventListener(`mouseenter`, () => {
  3922. userTagButtonEnter(context);
  3923. });
  3924. tagButton.addEventListener(`mouseleave`, () => {
  3925. userTagButtonOut(context);
  3926. });
  3927. }
  3928. refreshUserTagsPanel(tagsPanel, userId);
  3929. }
  3930. function refreshUserTagsPanel(tagsPanel, userId) {
  3931. const tagsData = tags.get(userId);
  3932. const tagsList = tagsData?.tags ?? [];
  3933. tagsPanel.querySelectorAll(`.pp_tagButton`).forEach((button) => {
  3934. const tag = button.getAttribute(`userTag`);
  3935. const config = USERTAG_CONFIGS.get(tag);
  3936. button.removeAttribute(`has-cooldown`);
  3937. button.removeAttribute(`has-blocked`);
  3938. if (tagsList.includes(tag)) {
  3939. button.classList.toggle(`pp_tagButtonActive`, true);
  3940. button.style.backgroundColor = config.color;
  3941. button.style.color = `white`;
  3942. }
  3943. else {
  3944. button.classList.toggle(`pp_tagButtonActive`, false);
  3945. button.style.color = config.color;
  3946. button.style.removeProperty(`background-color`);
  3947. if (tag == UserTag.BLOCKED && tagsData.blockCooldown != undefined && Date.now() / 1000 < tagsData.blockCooldown) {
  3948. button.setAttribute(`has-cooldown`, ``);
  3949. button.style.color = INACTIVE_COLOR;
  3950. }
  3951. if (tag == UserTag.FOLLOWED && tagsList.includes(UserTag.BLOCKED)) {
  3952. button.setAttribute(`has-blocked`, ``);
  3953. button.style.color = INACTIVE_COLOR;
  3954. }
  3955. }
  3956. });
  3957. }
  3958. function userTagButtonClick(context) {
  3959. if (context.button.getAttribute(`has-cooldown`) != null || context.button.getAttribute(`has-blocked`) != null) {
  3960. notify(`Unable to do this`);
  3961. return;
  3962. }
  3963. let tagsData = tags.get(context.userId);
  3964. if (tagsData.tags == undefined) {
  3965. tagsData.tags = [];
  3966. }
  3967. let isAdded = false;
  3968. if (tagsData.tags.includes(context.userTag)) {
  3969. tagsData.tags = tagsData.tags.filter(t => t != context.userTag);
  3970. }
  3971. else {
  3972. tagsData.tags.push(context.userTag);
  3973. isAdded = true;
  3974. // auto clear follow state
  3975. if (context.userTag == UserTag.BLOCKED) {
  3976. tagsData.tags = tagsData.tags.filter(t => t != UserTag.FOLLOWED);
  3977. }
  3978. }
  3979. if (tagsData.tags.length > 1) {
  3980. tagsData.tags.sort((firstItem, secondItem) => USERTAG_CONFIGS.get(firstItem).priority - USERTAG_CONFIGS.get(secondItem).priority);
  3981. }
  3982. tags.set(context.userId, tagsData);
  3983. // refresh comments tags
  3984. document.body.querySelectorAll(`shreddit-comment[author="${context.userId}"]`).forEach(comment => {
  3985. renderUserTags(comment);
  3986. if (isAdded && context.userTag == UserTag.BLOCKED) {
  3987. comment.setAttribute(`collapsed`, ``);
  3988. }
  3989. });
  3990. // execute specific operations
  3991. if (context.userTag == UserTag.FOLLOWED) {
  3992. FOLLOW_OPERATION.run(isAdded, context.userId);
  3993. }
  3994. if (context.userTag == UserTag.BLOCKED) {
  3995. if (!isAdded) {
  3996. tagsData.blockCooldown = Date.now() / 1000 + BLOCK_COOLDOWN_SECONDS;
  3997. tags.set(context.userId, tagsData);
  3998. }
  3999. BLOCK_OPERATION.run(isAdded, context.userId);
  4000. }
  4001. // refresh context menu
  4002. refreshUserTagsPanel(context.button.parentElement, context.userId);
  4003. }
  4004. function userTagButtonEnter(context) {
  4005. context.hint.style.display = null;
  4006. context.hint.dataset.target = context.userTag;
  4007. const tagsData = tags.get(context.userId);
  4008. const config = USERTAG_CONFIGS.get(context.userTag);
  4009. const isActivated = (tagsData?.tags ?? []).includes(context.userTag);
  4010. context.hint.innerText = isActivated ? config.removeHint : config.addHint;
  4011. if (context.button.getAttribute(`has-cooldown`) != null) {
  4012. const cooldownHours = Math.round((tagsData.blockCooldown - Date.now() / 1000) / HOUR_SECONDS);
  4013. context.hint.innerText = `Unable to block for ${cooldownHours}h after unblocking`;
  4014. }
  4015. if (context.button.getAttribute(`has-blocked`) != null) {
  4016. context.hint.innerText = `Unable to follow on blocked user`;
  4017. }
  4018. }
  4019. function userTagButtonOut(context) {
  4020. if (context.hint.dataset?.target == context.userTag) {
  4021. context.hint.style.display = `none`;
  4022. }
  4023. }
  4024.  
  4025. // EXTERNAL MODULE: ./resources/comments/shareButton.svg
  4026. var shareButton = __webpack_require__("./resources/comments/shareButton.svg");
  4027. var shareButton_default = /*#__PURE__*/__webpack_require__.n(shareButton);
  4028. ;// CONCATENATED MODULE: ./src/modules/comments/contextMenu.ts
  4029.  
  4030.  
  4031.  
  4032.  
  4033.  
  4034.  
  4035. function contextMenu_renderContextMenu(comment) {
  4036. // hack to close other context menu
  4037. document.body.click();
  4038. let contextMenuButton = comment.querySelector(`shreddit-overflow-menu`).shadowRoot;
  4039. css.registry(contextMenuButton);
  4040. const contextMenu = contextMenuButton.querySelector(`faceplate-menu`);
  4041. const originButton = contextMenu.querySelector(`faceplate-tracker[noun="report"]`);
  4042. if (settings.HIDE_SHARE.isEnabled()) {
  4043. let linkButton = originButton.cloneNode(true);
  4044. linkButton.querySelector(`span .text-14`).textContent = `Copy link`;
  4045. originButton.before(linkButton);
  4046. /*
  4047. let linkPath = linkButton.querySelector(`path`);
  4048. linkPath.setAttribute(`d`, linkGraphics[0].d);
  4049. let linkPathB = linkPath.cloneNode(true) as Element;
  4050. linkPathB.setAttribute(`d`, linkGraphics[1].d);
  4051. linkPath.after(linkPathB);*/
  4052. const originIcon = linkButton.querySelector(`svg`);
  4053. const shareIcon = buildSvg((shareButton_default()), 20, 20);
  4054. originIcon.replaceWith(shareIcon);
  4055. const permalink = comment.getAttribute(`permalink`);
  4056. linkButton.addEventListener(`click`, () => {
  4057. navigator.clipboard.writeText(`https://www.reddit.com${permalink}`);
  4058. notify(`Link copied`);
  4059. });
  4060. }
  4061. // close context menu
  4062. let openButton = contextMenuButton.querySelector(`button`);
  4063. openButton.addEventListener(`click`, () => {
  4064. document.body.click();
  4065. });
  4066. // userTags
  4067. renderUserTagsPanel(contextMenu, comment.getAttribute(`author`));
  4068. }
  4069.  
  4070. // EXTERNAL MODULE: ./src/modules/comments/sortButtons.less
  4071. var sortButtons = __webpack_require__("./src/modules/comments/sortButtons.less");
  4072. // EXTERNAL MODULE: ./resources/comments/sortButtons/controversial.svg
  4073. var controversial = __webpack_require__("./resources/comments/sortButtons/controversial.svg");
  4074. var controversial_default = /*#__PURE__*/__webpack_require__.n(controversial);
  4075. // EXTERNAL MODULE: ./resources/comments/sortButtons/old.svg
  4076. var old = __webpack_require__("./resources/comments/sortButtons/old.svg");
  4077. var old_default = /*#__PURE__*/__webpack_require__.n(old);
  4078. // EXTERNAL MODULE: ./resources/comments/sortButtons/qa.svg
  4079. var qa = __webpack_require__("./resources/comments/sortButtons/qa.svg");
  4080. var qa_default = /*#__PURE__*/__webpack_require__.n(qa);
  4081. ;// CONCATENATED MODULE: ./src/modules/comments/sortButtons.ts
  4082.  
  4083.  
  4084.  
  4085.  
  4086.  
  4087.  
  4088.  
  4089.  
  4090.  
  4091.  
  4092.  
  4093.  
  4094.  
  4095.  
  4096. class CommentSort {
  4097. }
  4098. CommentSort.BEST = `Best`;
  4099. CommentSort.TOP = `Top`;
  4100. CommentSort.NEW = `New`;
  4101. CommentSort.CONTROVERSIAL = `Controversial`;
  4102. CommentSort.OLD = `Old`;
  4103. CommentSort.QA = `QA`;
  4104. class CommentSortConfig {
  4105. }
  4106. const SORT_SEPARATOR = `sort=`;
  4107. function isCurrentSort(href, sort) {
  4108. // if there is no sort query param, then it is the default sort (confidence)
  4109. if (sort === 'confidence' && !href.includes('?')) {
  4110. return true;
  4111. }
  4112. return href.includes(`${SORT_SEPARATOR}${sort}`);
  4113. }
  4114. const COMMENTS_SORT_CONFIGS = new Map([
  4115. [
  4116. CommentSort.BEST,
  4117. {
  4118. icon: (feedButtonBest_default()),
  4119. href: `confidence`,
  4120. isCurrent: href => isCurrentSort(href, 'confidence')
  4121. }
  4122. ],
  4123. [
  4124. CommentSort.TOP,
  4125. {
  4126. icon: (feedButtonTop_default()),
  4127. href: `top`,
  4128. isCurrent: href => isCurrentSort(href, 'top')
  4129. }
  4130. ],
  4131. [
  4132. CommentSort.NEW,
  4133. {
  4134. icon: (feedButtonNew_default()),
  4135. href: `new`,
  4136. isCurrent: href => isCurrentSort(href, 'new')
  4137. }
  4138. ],
  4139. [
  4140. CommentSort.CONTROVERSIAL,
  4141. {
  4142. icon: (controversial_default()),
  4143. href: `controversial`,
  4144. isCurrent: href => isCurrentSort(href, 'controversial')
  4145. }
  4146. ],
  4147. [
  4148. CommentSort.OLD,
  4149. {
  4150. icon: (old_default()),
  4151. href: `old`,
  4152. isCurrent: href => isCurrentSort(href, 'old')
  4153. }
  4154. ],
  4155. [
  4156. CommentSort.QA,
  4157. {
  4158. icon: (qa_default()),
  4159. href: `qa`,
  4160. isCurrent: href => isCurrentSort(href, 'qa'),
  4161. overrideName: `Q&A`
  4162. }
  4163. ]
  4164. ]);
  4165. let sortButtonsRendered = false;
  4166. function getCurrentSort() {
  4167. let currentSort = prefs.get(PrefsKey.COMMENTS_CURRENT_SORT);
  4168. if (currentSort instanceof Object) {
  4169. currentSort = CommentSort.BEST;
  4170. }
  4171. return currentSort;
  4172. }
  4173. function checkSortCommentsRedirect() {
  4174. if (settings.COMMENTS_REMEMBER_SORT.isEnabled() && window.location.href.includes(`/comments/`)) {
  4175. const config = COMMENTS_SORT_CONFIGS.get(getCurrentSort());
  4176. if (config.isCurrent(window.location.href)) {
  4177. return false;
  4178. }
  4179. let postHref = window.location.href;
  4180. const hasQueryThatIsNotSort = postHref.includes('?') && !postHref.includes(SORT_SEPARATOR);
  4181. if (postHref.includes(SORT_SEPARATOR)) {
  4182. const separatorIndex = postHref.indexOf(SORT_SEPARATOR);
  4183. const newString = postHref.slice(0, separatorIndex - 1);
  4184. postHref = newString;
  4185. }
  4186. window.location.replace(postHref + (hasQueryThatIsNotSort ? '&' : '?') + SORT_SEPARATOR + config.href);
  4187. return true;
  4188. }
  4189. return false;
  4190. }
  4191. async function renderCommentsSortButtons(container) {
  4192. if (settings.COMMENTS_SORT_BUTTONS.isDisabled())
  4193. return;
  4194. css.addStyle(sortButtons/* default */.A, `sortButtons`);
  4195. sortButtonsRendered = false;
  4196. const sortContainer = await dynamicElement(() => container.querySelector(`comment-body-header`)?.querySelector(`.pdp-comments-tree-sort-container`), MAX_LOAD_LAG);
  4197. if (sortContainer == null)
  4198. return;
  4199. if (checkIsRendered(sortContainer)) {
  4200. return;
  4201. }
  4202. renderSearchComments(container);
  4203. sortContainer.querySelector(`shreddit-sort-dropdown`).classList.add(`pp_sortDropdown_hidden`);
  4204. let currentSort = undefined;
  4205. if (settings.COMMENTS_REMEMBER_SORT.isEnabled()) {
  4206. currentSort = getCurrentSort();
  4207. }
  4208. else {
  4209. COMMENTS_SORT_CONFIGS.forEach((config, sort) => {
  4210. if (config.isCurrent(window.location.href)) {
  4211. currentSort = sort;
  4212. }
  4213. });
  4214. }
  4215. COMMENTS_SORT_CONFIGS.forEach((config, sort) => {
  4216. renderButton(sort, config);
  4217. });
  4218. function renderButton(sort, config) {
  4219. const button = appendNew(sortContainer, `div`, `pp_sortButton`);
  4220. button.classList.toggle(`pp_sortButton_active`, sort == currentSort);
  4221. button.setAttribute(`commentSort`, sort);
  4222. button.addEventListener(`click`, () => {
  4223. switchSort(sort);
  4224. });
  4225. const iconSpan = appendNew(button, `span`);
  4226. const iconSvg = buildSvg(config.icon, 16, 16);
  4227. iconSpan.append(iconSvg);
  4228. const labelSpan = appendNew(button, `span`);
  4229. labelSpan.textContent = config.overrideName != undefined ? config.overrideName : sort;
  4230. }
  4231. sortButtonsRendered = true;
  4232. }
  4233. async function renderSearchComments(container) {
  4234. const searchSpan = await dynamicElement(() => container.querySelector(`comment-body-header`)?.querySelector(`pdp-comment-search-input`)?.shadowRoot?.querySelector(`.pr-xs`), MAX_LOAD_LAG);
  4235. if (searchSpan == null)
  4236. return;
  4237. searchSpan.textContent = `Search`;
  4238. }
  4239. let isCommentsSortLocked = false;
  4240. function OnCommentsTreeLoaded() {
  4241. isCommentsSortLocked = false;
  4242. if (!sortButtonsRendered) {
  4243. renderCommentsSortButtons(document.body);
  4244. }
  4245. }
  4246. async function switchSort(sort) {
  4247. if (isCommentsSortLocked) {
  4248. notify(`Unable to switch sort while loading comments`);
  4249. return;
  4250. }
  4251. const sortContainer = await dynamicElement(() => document.body.querySelector(`comment-body-header`)?.querySelector(`.pdp-comments-tree-sort-container`), MAX_LOAD_LAG);
  4252. const config = COMMENTS_SORT_CONFIGS.get(sort);
  4253. const newButton = sortContainer.querySelector(`data[value="${config.href.toUpperCase()}"]`);
  4254. newButton.click();
  4255. prefs.set(PrefsKey.COMMENTS_CURRENT_SORT, sort);
  4256. isCommentsSortLocked = true;
  4257. const awaitRefreshId = setInterval(() => {
  4258. if (config.isCurrent(window.location.href)) {
  4259. clearInterval(awaitRefreshId);
  4260. // refresh buttons
  4261. COMMENTS_SORT_CONFIGS.forEach((refreshConfig, refreshSort) => {
  4262. const button = sortContainer.querySelector(`div[commentSort="${refreshSort}"]`);
  4263. button.classList.toggle(`pp_sortButton_active`, refreshSort == sort);
  4264. });
  4265. }
  4266. }, 20);
  4267. }
  4268.  
  4269. ;// CONCATENATED MODULE: ./src/modules/comments/moreReplies.ts
  4270.  
  4271.  
  4272.  
  4273.  
  4274. function renderMoreReplies(comment) {
  4275. if (settings.UNWRAP_MORE_REPLIES.isDisabled())
  4276. return;
  4277. if (comment.getAttribute(`collapsed`) != null)
  4278. return;
  4279. for (const moreReplies of comment.childNodes) {
  4280. if (moreReplies instanceof HTMLElement) {
  4281. // loadable replies
  4282. if (moreReplies.matches(`faceplate-partial`) && moreReplies.getAttribute(`src`)?.includes(`/more-comments/`) && !checkIsRendered(moreReplies)) {
  4283. moreReplies.click();
  4284. let refreshTicks = 0;
  4285. const refreshAwaiter = setInterval(() => {
  4286. refreshTicks++;
  4287. if (moreReplies.parentNode == null) {
  4288. clearInterval(refreshAwaiter);
  4289. setTimeout(() => {
  4290. renderMoreReplies(comment);
  4291. }, 50);
  4292. return;
  4293. }
  4294. if (refreshTicks > 60) {
  4295. clearInterval(refreshAwaiter);
  4296. pp_log(`Unable load more replies`);
  4297. }
  4298. }, 100);
  4299. }
  4300. // redirectable replies
  4301. if (moreReplies.matches(`a`) && moreReplies.getAttribute(`slot`) == `more-comments-permalink`) {
  4302. moreReplies.querySelector(`.text-secondary-weak`).textContent = `More replies in single thread`;
  4303. }
  4304. }
  4305. }
  4306. }
  4307.  
  4308. ;// CONCATENATED MODULE: ./src/modules/comments/comments.ts
  4309.  
  4310.  
  4311.  
  4312.  
  4313.  
  4314.  
  4315.  
  4316.  
  4317.  
  4318.  
  4319.  
  4320.  
  4321.  
  4322.  
  4323.  
  4324. let rootIntersector = null;
  4325. let commentsIntersector = null;
  4326. let commentsMutations = null;
  4327. async function renderComments(container) {
  4328. css.addStyle(comments/* default */.A, `comments`);
  4329. if (settings.HIDE_SHARE.isEnabled()) {
  4330. css.addStyle(hideShare/* default */.A, `hideShare`);
  4331. }
  4332. // intersections
  4333. if (rootIntersector != null) {
  4334. rootIntersector.disconnect();
  4335. }
  4336. else {
  4337. rootIntersector = new IntersectionObserver(entries => {
  4338. for (const entry of entries) {
  4339. if (entry.isIntersecting) {
  4340. renderComment(entry.target.parentElement);
  4341. // registry childs when root becomes visible
  4342. registryAllComments(entry.target.parentElement);
  4343. rootIntersector.unobserve(entry.target);
  4344. }
  4345. }
  4346. }, { threshold: 0.05 });
  4347. }
  4348. if (commentsIntersector != null) {
  4349. commentsIntersector.disconnect();
  4350. }
  4351. else {
  4352. commentsIntersector = new IntersectionObserver(entries => {
  4353. for (const entry of entries) {
  4354. if (entry.isIntersecting) {
  4355. renderComment(entry.target.parentElement);
  4356. commentsIntersector.unobserve(entry.target);
  4357. }
  4358. }
  4359. }, { threshold: 0.05 });
  4360. }
  4361. // mutations
  4362. if (commentsMutations != null) {
  4363. commentsMutations.disconnect();
  4364. }
  4365. else {
  4366. commentsMutations = new MutationObserver(mutations => {
  4367. for (const mutation of mutations) {
  4368. for (const node of mutation.addedNodes) {
  4369. if (node instanceof HTMLElement) {
  4370. // static comments
  4371. const commentTree = node.parentElement?.querySelector(`shreddit-comment-tree`);
  4372. if (commentTree != null) {
  4373. registryAllRoots(commentTree);
  4374. // singal to commentsSort buttons that comments refreshed
  4375. OnCommentsTreeLoaded();
  4376. }
  4377. // dynamic comments
  4378. if (node.matches(`shreddit-comment`)) {
  4379. if (node.getAttribute(`depth`) == `0`) {
  4380. registryRoot(node);
  4381. }
  4382. else {
  4383. registryComment(node);
  4384. registryAllComments(node);
  4385. }
  4386. }
  4387. if (settings.HIDE_RELATED_POSTS.isEnabled() && node.matches(`h2`) && node.textContent.includes(`Related posts`)) {
  4388. const relatedHeader = node;
  4389. const relatedPosts = relatedHeader.nextSibling;
  4390. relatedHeader.remove();
  4391. relatedPosts.remove();
  4392. }
  4393. }
  4394. }
  4395. }
  4396. });
  4397. }
  4398. commentsMutations.observe(container, { childList: true, subtree: true });
  4399. // sort buttons
  4400. renderCommentsSortButtons(container);
  4401. }
  4402. function registryAllRoots(container) {
  4403. container.querySelectorAll(`shreddit-comment[depth="0"]`).forEach(comment => {
  4404. registryRoot(comment);
  4405. });
  4406. }
  4407. function registryRoot(comment) {
  4408. if (checkIsRendered(comment))
  4409. return;
  4410. rootIntersector.observe(comment.querySelector(`div[slot="commentMeta"]`));
  4411. }
  4412. function registryAllComments(container) {
  4413. container.querySelectorAll(`shreddit-comment`).forEach(comment => {
  4414. registryComment(comment);
  4415. });
  4416. }
  4417. function registryComment(comment) {
  4418. if (checkIsRendered(comment))
  4419. return;
  4420. commentsIntersector.observe(comment.querySelector(`div[slot="commentMeta"]`));
  4421. }
  4422. async function renderComment(comment) {
  4423. const commentBody = comment.querySelector(`div[slot="comment"]`);
  4424. // collapse automoderator and pinned mods
  4425. if (settings.COLLAPSE_AUTOMODERATOR.isEnabled()) {
  4426. const author = comment.getAttribute(`author`);
  4427. if (author != null && author == `AutoModerator`) {
  4428. comment.setAttribute(`collapsed`, ``);
  4429. return;
  4430. }
  4431. const isMod = comment.querySelector(`div[slot="commentMeta"]`)?.querySelector(`shreddit-comment-author-modifier-icon[distinguished-as="MODERATOR"]`) != null;
  4432. const isPinned = comment.querySelector(`shreddit-comment-badges`)?.shadowRoot?.querySelector(`svg[icon-name="pin-fill"]`) != null;
  4433. if (isMod && isPinned) {
  4434. comment.setAttribute(`collapsed`, ``);
  4435. return;
  4436. }
  4437. }
  4438. // unwrap moreComments
  4439. setTimeout(() => {
  4440. renderMoreReplies(comment);
  4441. }, 150);
  4442. // add anchors
  4443. const nickname = comment.querySelector(`div[slot="commentMeta"]`).querySelector(`faceplate-hovercard[data-id="user-hover-card"]`);
  4444. // skip [deleted]
  4445. if (nickname == null)
  4446. return;
  4447. const tagsAnchor = document.createElement(`div`);
  4448. tagsAnchor.setAttribute(`pp-anchor`, `tags`);
  4449. const OPTag = nickname.parentElement.querySelector(`.ml-2xs`);
  4450. if (OPTag != null) {
  4451. OPTag.after(tagsAnchor);
  4452. }
  4453. else {
  4454. nickname.after(tagsAnchor);
  4455. }
  4456. const time = await dynamicElement(() => nickname.parentElement.querySelector(`time`)?.parentElement?.parentElement, MAX_LOAD_LAG);
  4457. const infoAnchor = document.createElement(`div`);
  4458. infoAnchor.setAttribute(`pp-anchor`, `info`);
  4459. time?.before(infoAnchor);
  4460. // make ghosted when karma below zero
  4461. if (settings.GHOSTED_COMMENTS.isEnabled() && parseInt(comment.getAttribute(`score`)) < 0) {
  4462. comment.querySelector(`div[slot="commentAvatar"]`).classList.add(`pp_muted_avatar`);
  4463. comment.querySelector(`faceplate-tracker[noun="comment_author"]`).querySelector(`a`).style.color = `#a5a5a5`;
  4464. commentBody.classList.add(`pp_muted_content`);
  4465. }
  4466. // registry image
  4467. const imageContainer = commentBody.querySelector(`figure[class="rte-media"]`);
  4468. if (imageContainer != null && settings.IMAGE_VIEWER.isEnabled()) {
  4469. const imageAnchor = imageContainer.querySelector(`a`);
  4470. const href = imageAnchor.getAttribute(`href`);
  4471. imageAnchor.removeAttribute(`href`);
  4472. let image = imageContainer.querySelector(`img`);
  4473. if (image == null) {
  4474. image = imageContainer.querySelector(`shreddit-player-2`);
  4475. }
  4476. image.classList.add(`pp_imageViewable`);
  4477. imageAnchor.addEventListener(`click`, () => {
  4478. imageViewer_imageViewer.open(href);
  4479. });
  4480. }
  4481. renderCollapseAward(comment, IS_COMMENT);
  4482. renderUserTags(comment);
  4483. const userId = comment.getAttribute(`author`);
  4484. const userName = comment.querySelector(`faceplate-tracker[noun="comment_author"]`).querySelector(`a`);
  4485. renderUserInfo(userId, userName, tagsAnchor, infoAnchor, IS_COMMENT);
  4486. const contextMenuButton = await dynamicElement(() => comment.querySelector(`shreddit-overflow-menu`)?.shadowRoot?.querySelector(`faceplate-dropdown-menu`));
  4487. renderCommentBookmark(comment);
  4488. contextMenuButton.addEventListener(`click`, () => {
  4489. contextMenu_renderContextMenu(comment);
  4490. }, { once: true });
  4491. }
  4492.  
  4493. // EXTERNAL MODULE: ./src/modules/scrollToTop.less
  4494. var scrollToTop = __webpack_require__("./src/modules/scrollToTop.less");
  4495. // EXTERNAL MODULE: ./resources/scrollButton.svg
  4496. var scrollButton = __webpack_require__("./resources/scrollButton.svg");
  4497. var scrollButton_default = /*#__PURE__*/__webpack_require__.n(scrollButton);
  4498. ;// CONCATENATED MODULE: ./src/modules/scrollToTop.ts
  4499.  
  4500.  
  4501.  
  4502.  
  4503.  
  4504.  
  4505. const START_Y = 1000;
  4506. let scrollToTop_scrollToTop = null;
  4507. let scrollToTop_scrollButton = null;
  4508. let prevScrollHeight = 0;
  4509. let isWide = false;
  4510. let isBottom = false;
  4511. let contentBlock = null;
  4512. function renderScrollToTop() {
  4513. if (settings.SCROLL_TO_TOP.isDisabled())
  4514. return;
  4515. css.addStyle(scrollToTop/* default */.A, `scrollToTop`);
  4516. const main = document.body.querySelector(`.main-container`).parentElement;
  4517. contentBlock = document.body.querySelector(`.main-container`);
  4518. scrollToTop_scrollToTop = appendNew(main.parentElement, `div`, `pp_scrollToTop`);
  4519. scrollToTop_scrollButton = buildSvg((scrollButton_default()), 40, 40);
  4520. scrollToTop_scrollToTop.append(scrollToTop_scrollButton);
  4521. scrollToTop_scrollToTop.addEventListener(`click`, () => {
  4522. if (isBottom) {
  4523. prevScrollHeight = window.scrollY;
  4524. window.scrollTo({ top: 0, behavior: 'smooth' });
  4525. isBottom = false;
  4526. }
  4527. else if (prevScrollHeight > 0) {
  4528. window.scrollTo({ top: prevScrollHeight, behavior: 'smooth' });
  4529. prevScrollHeight = 0;
  4530. isBottom = true;
  4531. }
  4532. refreshScrollToTop();
  4533. });
  4534. window.addEventListener('resize', event => {
  4535. checkScreenWidth();
  4536. });
  4537. let prevIsBottom = false;
  4538. setInterval(() => {
  4539. isBottom = window.scrollY > START_Y;
  4540. if (isBottom != prevIsBottom) {
  4541. prevIsBottom = isBottom;
  4542. refreshScrollToTop();
  4543. }
  4544. }, 330);
  4545. checkScreenWidth();
  4546. }
  4547. function checkScreenWidth() {
  4548. isWide = window.innerWidth > 1490;
  4549. const rect = contentBlock.getBoundingClientRect();
  4550. scrollToTop_scrollToTop.style.left = `${(300 + rect.left) / 2 - 50}px`;
  4551. refreshScrollToTop();
  4552. }
  4553. function refreshScrollToTop() {
  4554. const hidden = !(isWide && (isBottom || prevScrollHeight > 0));
  4555. const inverted = !isBottom && prevScrollHeight > 0;
  4556. scrollToTop_scrollToTop.classList.toggle(`pp_scrollToTop_hidden`, hidden);
  4557. scrollToTop_scrollButton.classList.toggle(`pp_scrollToTop_inverted`, inverted);
  4558. }
  4559.  
  4560. ;// CONCATENATED MODULE: ./src/modules/users/userPage.ts
  4561.  
  4562.  
  4563.  
  4564. async function renderUserPage(container) {
  4565. const feed = await dynamicElement(() => container.querySelector(`#subgrid-container`)?.querySelector(`shreddit-feed`));
  4566. // render embedded posts
  4567. feed.querySelectorAll(`shreddit-post`).forEach(post => {
  4568. renderPost(post);
  4569. });
  4570. // render loaded posts
  4571. initializePostObserver(feed);
  4572. }
  4573.  
  4574. ;// CONCATENATED MODULE: ./src/modules/app.ts
  4575.  
  4576.  
  4577.  
  4578.  
  4579.  
  4580.  
  4581.  
  4582.  
  4583.  
  4584.  
  4585. async function renderApp() {
  4586. css.addStyle(modules_app/* default */.A, `app`);
  4587. const app = await dynamicElement(() => document.body.querySelector(`shreddit-app`)?.querySelector(`.grid-container`));
  4588. if (checkIsRendered(app))
  4589. return;
  4590. if (window.location.href.includes(`/user/`)) {
  4591. renderUserPage(document.body);
  4592. }
  4593. else {
  4594. renderFeed(document.body);
  4595. }
  4596. renderComments(document.body);
  4597. const leftSidebar = await dynamicElement(() => document.body.querySelector(`#left-sidebar-container`), 3000);
  4598. renderSidebar(leftSidebar);
  4599. const pageContainer = leftSidebar.parentElement;
  4600. pageContainer.classList.add(`pp_pageContainer`);
  4601. const mainFeed = pageContainer.querySelector(`.subgrid-container`);
  4602. mainFeed.classList.add(`pp_mainFeed`);
  4603. const rightSidebar = await dynamicElement(() => document.body.querySelector(`#right-sidebar-container`));
  4604. rightSidebar.classList.add(`pp_rightSidebar`);
  4605. rightSidebar.classList.toggle(`styled-scrollbars`, true);
  4606. renderWideMode(pageContainer, rightSidebar);
  4607. renderBiggerFonts();
  4608. renderScrollToTop();
  4609. }
  4610.  
  4611. // EXTERNAL MODULE: ./src/modules/header.less
  4612. var header = __webpack_require__("./src/modules/header.less");
  4613. // EXTERNAL MODULE: ./src/modules/notifications.less
  4614. var notifications = __webpack_require__("./src/modules/notifications.less");
  4615. ;// CONCATENATED MODULE: ./src/modules/notifications.ts
  4616.  
  4617.  
  4618.  
  4619.  
  4620. if (settings.NOTIFY_POPUP.isEnabled()) {
  4621. css.addStyle(notifications/* default */.A);
  4622. }
  4623. function renderNotifications(container) {
  4624. container.querySelectorAll(`div[data-testid="notification-item"]`).forEach(item => {
  4625. const tittle = item.querySelector(`div[data-testid="title"]`);
  4626. const author = item.querySelector(`.text-secondary-plain`);
  4627. if (author.textContent.includes(`replied`)) {
  4628. author.textContent = author.textContent.split(`replied`)[0];
  4629. const subTittle = document.createElement(`div`);
  4630. tittle.after(subTittle);
  4631. const subTittleContent = appendNew(subTittle, `span`, [`text-secondary-weak`, `font-normal`]);
  4632. let sub = item.parentElement.getAttribute(`href`);
  4633. sub = sub.replace(`https://reddit.com/r/`, ``);
  4634. sub = sub.split(`/`)[0];
  4635. subTittleContent.textContent = `replied in r/${sub}`;
  4636. }
  4637. const time = item.querySelector(`faceplate-number`);
  4638. if (time != null) {
  4639. const spanAgo = document.createElement(`span`);
  4640. spanAgo.textContent = ` ago`;
  4641. time.after(spanAgo);
  4642. }
  4643. });
  4644. }
  4645.  
  4646. // EXTERNAL MODULE: ./src/modules/settings/settingsWindow.less
  4647. var settingsWindow = __webpack_require__("./src/modules/settings/settingsWindow.less");
  4648. // EXTERNAL MODULE: ./resources/settingsArrow.svg
  4649. var settingsArrow = __webpack_require__("./resources/settingsArrow.svg");
  4650. var settingsArrow_default = /*#__PURE__*/__webpack_require__.n(settingsArrow);
  4651. ;// CONCATENATED MODULE: ./src/modules/settings/settingsWindow.ts
  4652.  
  4653.  
  4654.  
  4655.  
  4656.  
  4657.  
  4658.  
  4659. css.addStyle(settingsWindow/* default */.A);
  4660. const settingsWindow_settingsWindow = new Window('Reddit++ Settings', renderSettingsWindow, closeSettingsWindow);
  4661. let changes = 0;
  4662. function renderSettingsWindow(win, context) {
  4663. // hack to close user menu
  4664. document.body.click();
  4665. changes = 0;
  4666. const changesBannerContainer = appendNew(win.content, `div`, `pp_settings_changesBannerContainer`);
  4667. const changesBanner = appendNew(changesBannerContainer, `div`, `pp_settings_changesBanner`);
  4668. changesBanner.textContent = `Page will be reloaded to apply new settings`;
  4669. const scroll = appendNew(win.content, `div`, [`pp_window_scrollContent`, `styled-scrollbars`]);
  4670. const elements = appendNew(scroll, `div`, `pp_window_elementsContainer`);
  4671. addSettingToggle(`Wide mode`, `Make focus on the content by replacing right sidebar to screen border`, settings.WIDE_MODE);
  4672. addSettingDropdown(`Content width`, null, settings.CONTENT_WIDTH);
  4673. addSettingDropdown(`Content offset`, null, settings.CONTENT_OFFSET);
  4674. addSettingToggle(`Bigger fonts`, `Make fonts bigger for better reading`, settings.BIGGER_FONTS);
  4675. addSettingToggle(`Better notify popup`, `Make notify popup a bit larger and remove useless button`, settings.NOTIFY_POPUP);
  4676. addSettingToggle(`Redirect suggestion`, `Show suggestion to redirect from old.reddit and new.reddit to compatible pages`, settings.REDIRECT_SUGGESTION);
  4677. addSettingToggle(`Redirect forced`, `Automatically redirect to compatible pages`, settings.REDIRECT_FORCED);
  4678. addSubtittle(`Left sidebar`);
  4679. addSettingToggle(`Sub filter`, `Tool for find subs on sidebar by name`, settings.SUB_FILTER);
  4680. addSettingToggle(`Show Custom feeds`, null, settings.SIDEBAR_CUSTOMS);
  4681. addSettingToggle(`Show Recent`, null, settings.SIDEBAR_RECENT);
  4682. addSettingToggle(`Show Communities`, null, settings.SIDEBAR_SUBS);
  4683. addSettingToggle(`Show Resources`, null, settings.SIDEBAR_RESOURCES);
  4684. addSubtittle(`Common`);
  4685. addSettingToggle(`Scroll to top button`, null, settings.SCROLL_TO_TOP);
  4686. addSettingToggle(`Collapse Awards`, `Automatic collapse the award's button for none upvoted posts and comments`, settings.COLLAPSE_AWARDS);
  4687. addSettingToggle(`Remove Awards`, `Remove the award's buttons completely`, settings.COLLAPSE_AWARDS_COMPLETELY);
  4688. addSettingToggle(`Image viewer`, `Open (zoom) images instead default redirect behaviour`, settings.IMAGE_VIEWER);
  4689. addSubtittle(`Default feeds`);
  4690. addSettingDropdown(`Home`, null, settings.DEFAULT_FEED_HOME);
  4691. addSettingDropdown(`Popular`, null, settings.DEFAULT_FEED_POPULAR);
  4692. addSettingDropdown(`All`, null, settings.DEFAULT_FEED_ALL);
  4693. addSettingDropdown(`Subreddit's`, null, settings.DEFAULT_FEED_SUB);
  4694. addSubtittle(`Feed`);
  4695. addSettingToggle(`Feed buttons`, `Unwrap feed sorting buttons`, settings.FEED_BUTTONS);
  4696. addSettingToggle(`Flairs bar`, `Display available flairs to faster navigation. Specific flairs may be hidden via subreddit's flairs settings`, settings.FLAIR_BAR);
  4697. addSettingToggle(`Collapse community highlights`, null, settings.COLLAPSE_HIGHLIGHTS);
  4698. addSettingToggle(`Selectable text`, `Make a text selectable when posts viewed in feed`, settings.SELECTABLE_POSTS);
  4699. addSettingToggle(`Unwrap button`, `Show the unwrap button for long-text posts in feed`, settings.UNWRAP_POST);
  4700. addSettingToggle(`Soft background`, `Make the background of posts with soft gradient color`, settings.BACKPLATES);
  4701. addSettingToggle(`Show post's author`, `Relates to Home, Popular and All feeds`, settings.SHOW_POST_AUTHOR);
  4702. addSettingToggle(`Show bookmark`, `Show the bookmark button for saved and upvoted posts`, settings.SAVED_BOOKMARK_POSTS);
  4703. addSettingToggle(`Show bookmark always`, `Show the bookmark button for all posts`, settings.SAVED_BOOKMARK_POSTS_SHOW_ALWAYAS);
  4704. addSubtittle(`Comments`);
  4705. addSettingToggle(`Sort buttons`, `Unwrap the comment's sort buttons`, settings.COMMENTS_SORT_BUTTONS);
  4706. addSettingToggle(`Remember sort`, `Remember latest used comment's sort`, settings.COMMENTS_REMEMBER_SORT);
  4707. addSettingToggle(`Unwrap "more replies"`, `Automatically unwrap more replies when it becomes visible`, settings.UNWRAP_MORE_REPLIES);
  4708. addSettingToggle(`User info`, `Show user's karma and "new user" mark`, settings.USER_INFO);
  4709. addSettingToggle(`User tags`, `Enable custom tags (sets via comment's context menu)`, settings.USER_TAGS);
  4710. addSettingToggle(`Show nicknames`, `Use user's nicknames instead profile names`, settings.SHOW_NAMES);
  4711. addSettingToggle(`Hide share button`, `Replace the share button to comment's context menu`, settings.HIDE_SHARE);
  4712. addSettingToggle(`Ghosted comments`, `Make comments ghosted when comment's rating below zero`, settings.GHOSTED_COMMENTS);
  4713. addSettingToggle(`Collapse unwanted`, `Automatic collapse all automoderator and mod's pinned comments`, settings.COLLAPSE_AUTOMODERATOR);
  4714. addSettingToggle(`Show bookmark`, `Show the bookmark button for saved comments`, settings.SAVED_BOOKMARK_COMMENTS);
  4715. addSettingToggle(`Show bookmark always`, `Show the bookmark button for all comments`, settings.SAVED_BOOKMARK_COMMENTS_SHOW_ALWAYAS);
  4716. addSettingToggle(`Hide related posts`, null, settings.HIDE_RELATED_POSTS);
  4717. function addSubtittle(text) {
  4718. const subtittle = appendNew(elements, `h3`, `pp_settings_subtittle`);
  4719. subtittle.textContent = text;
  4720. }
  4721. function addSettingToggle(tittleText, descriptionText, setting) {
  4722. const propertyArea = appendNew(elements, `div`, `pp_window_element`);
  4723. const header = appendNew(propertyArea, `div`, `pp_settings_propertyHeader`);
  4724. const tittle = appendNew(header, `div`, `pp_settings_propertyHeader_tittle`);
  4725. tittle.textContent = tittleText;
  4726. if (descriptionText != null) {
  4727. const description = appendNew(header, `div`, `pp_settings_propertyHeader_description`);
  4728. description.textContent = descriptionText;
  4729. }
  4730. else {
  4731. propertyArea.classList.add(`pp_settings_property_oneLine`);
  4732. }
  4733. const buttonContainer = appendNew(propertyArea, `div`, `pp_settings_propertyButtonContainer`);
  4734. const toggleArea = appendNew(buttonContainer, `div`, `pp_checkBox_panelArea`);
  4735. const toggleContainer = appendNew(toggleArea, `div`, `pp_checkBox_container`);
  4736. const toggleBack = appendNew(toggleContainer, `button`, `pp_checkBox_button`);
  4737. toggleBack.classList.toggle(`pp_checkBox_buttonActive`, setting.isEnabled());
  4738. const knob = appendNew(toggleBack, `div`, `pp_checkBox_knob`);
  4739. let changed = false;
  4740. toggleBack.addEventListener(`click`, e => {
  4741. const state = setting.isEnabled();
  4742. toggleBack.classList.toggle(`pp_checkBox_buttonActive`, !state);
  4743. setting.switch();
  4744. changes += changed ? -1 : 1;
  4745. changed = !changed;
  4746. changesBannerContainer.classList.toggle(`pp_settings_changesBanner_active`, changes > 0);
  4747. });
  4748. }
  4749. function addSettingDropdown(tittleText, descriptionText, setting) {
  4750. const propertyArea = appendNew(elements, `div`, `pp_window_element`);
  4751. const header = appendNew(propertyArea, `div`, `pp_settings_propertyHeader`);
  4752. const tittle = appendNew(header, `div`, `pp_settings_propertyHeader_tittle`);
  4753. tittle.textContent = tittleText;
  4754. if (descriptionText != null) {
  4755. const description = appendNew(header, `div`, `pp_settings_propertyHeader_description`);
  4756. description.textContent = descriptionText;
  4757. }
  4758. else {
  4759. propertyArea.classList.add(`pp_settings_property_oneLine`);
  4760. }
  4761. const buttonContainer = appendNew(propertyArea, `div`, `pp_settings_propertyButtonContainer`);
  4762. const toggleArea = appendNew(buttonContainer, `div`, `pp_settings_arrowArea`);
  4763. const leftButton = appendNew(toggleArea, `div`, [`pp_settings_arrow`, `pp_settings_arrowLeft`, `button`, `button-plain`, `button-medium`, `px-[var(--rem8)]`]);
  4764. const leftButtonSvg = buildSvg((settingsArrow_default()), 20, 20);
  4765. leftButton.append(leftButtonSvg);
  4766. const dropdownCurrent = appendNew(toggleArea, `div`, [`text-secondary`, `font-normal`]);
  4767. dropdownCurrent.textContent = setting.get();
  4768. const rightButton = appendNew(toggleArea, `div`, [`pp_settings_arrow`, `button`, `button-plain`, `button-medium`, `px-[var(--rem8)]`]);
  4769. const rightButtonSvg = buildSvg((settingsArrow_default()), 20, 20);
  4770. rightButton.append(rightButtonSvg);
  4771. const originValue = setting.get();
  4772. let changed = false;
  4773. leftButton.addEventListener(`click`, e => {
  4774. switchList(-1);
  4775. });
  4776. rightButton.addEventListener(`click`, e => {
  4777. switchList(1);
  4778. });
  4779. function switchList(shift) {
  4780. setting.switch(shift);
  4781. const currentValue = setting.get();
  4782. dropdownCurrent.textContent = currentValue;
  4783. if (currentValue != originValue && !changed) {
  4784. changed = true;
  4785. changes++;
  4786. }
  4787. if (currentValue == originValue && changed) {
  4788. changed = false;
  4789. changes--;
  4790. }
  4791. changesBannerContainer.classList.toggle(`pp_settings_changesBanner_active`, changes > 0);
  4792. }
  4793. }
  4794. }
  4795. function closeSettingsWindow() {
  4796. if (changes > 0) {
  4797. settings.nextRevision();
  4798. window.location.reload();
  4799. }
  4800. }
  4801.  
  4802. // EXTERNAL MODULE: ./resources/settingsButton.svg
  4803. var settingsButton = __webpack_require__("./resources/settingsButton.svg");
  4804. var settingsButton_default = /*#__PURE__*/__webpack_require__.n(settingsButton);
  4805. ;// CONCATENATED MODULE: ./src/modules/header.ts
  4806.  
  4807.  
  4808.  
  4809.  
  4810.  
  4811.  
  4812.  
  4813.  
  4814.  
  4815. css.addStyle(header/* default */.A);
  4816. let notificationsInitialized = false;
  4817. async function header_renderHeader(container) {
  4818. const nav = await dynamicElement(() => container.querySelector(`reddit-header-large`)?.querySelector(`nav`));
  4819. if (checkIsRendered(nav))
  4820. return;
  4821. const userPanel = await dynamicElement(() => nav.childNodes.item(4));
  4822. userPanel.classList.add(`pp_userPanel`);
  4823. userPanel.addEventListener(`click`, () => {
  4824. renderSettingsButton();
  4825. }, { once: true });
  4826. if (settings.NOTIFY_POPUP.isEnabled() && !notificationsInitialized) {
  4827. notificationsInitialized = true;
  4828. observeFor(document.body, (element) => {
  4829. if (element.getAttribute(`data-id`) == `notification-container-element` && !checkIsRendered(element)) {
  4830. renderNotifications(element);
  4831. }
  4832. });
  4833. }
  4834. const logo = container.querySelector(`#reddit-logo`);
  4835. const logoPP = appendNew(logo, `div`, `pp_logo`);
  4836. logoPP.textContent = `++`;
  4837. }
  4838. function renderSettingsButton() {
  4839. let userMenu = document.getElementById(`user-drawer-content`);
  4840. if (userMenu.querySelector(`faceplate-tracker[noun="pp-settings"]`) != null) {
  4841. return;
  4842. }
  4843. let originSettingsButton = userMenu.querySelector(`faceplate-tracker[noun="settings"]`);
  4844. if (originSettingsButton == null) {
  4845. originSettingsButton = userMenu.querySelector(`faceplate-tracker[noun="login"]`);
  4846. }
  4847. let ppSettingsButton = originSettingsButton.cloneNode(true);
  4848. ppSettingsButton.setAttribute(`noun`, `pp-settings`);
  4849. originSettingsButton.parentNode.appendChild(ppSettingsButton);
  4850. ppSettingsButton.querySelector(`a`).removeAttribute(`href`);
  4851. const originSvg = ppSettingsButton.querySelector(`svg`);
  4852. const svg = buildSvg((settingsButton_default()), 20, 20, { strokeColor: NONE_COLOR });
  4853. originSvg.replaceWith(svg);
  4854. let text = ppSettingsButton.querySelector(`.text-14`);
  4855. text.textContent = `Reddit++`;
  4856. ppSettingsButton.addEventListener(`click`, () => {
  4857. settingsWindow_settingsWindow.open();
  4858. });
  4859. }
  4860.  
  4861. // EXTERNAL MODULE: ./src/modules/redirect.less
  4862. var modules_redirect = __webpack_require__("./src/modules/redirect.less");
  4863. ;// CONCATENATED MODULE: ./src/modules/redirect.ts
  4864.  
  4865.  
  4866.  
  4867.  
  4868.  
  4869. function checkRedirect() {
  4870. const isOld = window.location.href.includes(`old.reddit.com`);
  4871. const isPrev = window.location.href.includes(`new.reddit.com`);
  4872. let redirect = null;
  4873. if (isOld) {
  4874. redirect = window.location.href.replace(`old.reddit.com`, `reddit.com`);
  4875. }
  4876. if (isPrev) {
  4877. redirect = window.location.href.replace(`new.reddit.com`, `reddit.com`);
  4878. }
  4879. if (settings.REDIRECT_FORCED.isEnabled() && redirect != null) {
  4880. window.location.assign(redirect);
  4881. }
  4882. if (settings.REDIRECT_SUGGESTION.isEnabled() && redirect != null) {
  4883. renderSuggestion(redirect);
  4884. }
  4885. const commentsSortRedirect = checkSortCommentsRedirect();
  4886. return redirect != null || commentsSortRedirect;
  4887. }
  4888. function renderSuggestion(redirect) {
  4889. css.addStyle(modules_redirect/* default */.A);
  4890. let secondsToRedirect = 19;
  4891. const container = appendNew(document.body, `div`, `pp_redirectContainer`);
  4892. const box = appendNew(container, `div`, `pp_redirectBox`);
  4893. box.textContent = `Click here to redirect on compatible page (${secondsToRedirect})`;
  4894. box.addEventListener(`click`, () => {
  4895. window.location.assign(redirect);
  4896. });
  4897. const suggestionId = setInterval(() => {
  4898. secondsToRedirect--;
  4899. box.textContent = `Click here to redirect on compatible page (${secondsToRedirect})`;
  4900. if (secondsToRedirect <= 0) {
  4901. clearInterval(suggestionId);
  4902. container.remove();
  4903. }
  4904. }, 750);
  4905. }
  4906.  
  4907. ;// CONCATENATED MODULE: ./src/core.ts
  4908.  
  4909.  
  4910.  
  4911.  
  4912.  
  4913.  
  4914.  
  4915.  
  4916.  
  4917. // ***********************************************************************************************************************
  4918. // ********************************************** ENTRY POINT ************************************************************
  4919. // ***********************************************************************************************************************
  4920. startRedditPlusPlus();
  4921. async function startRedditPlusPlus() {
  4922. const documentBody = await dynamicElement(() => (document.head != null && document.body != null ? document.body : null));
  4923. // check dublicates
  4924. let pp_meta = document.head.querySelector(`meta[name="reddit-plus-plus"]`);
  4925. if (pp_meta != null) {
  4926. notify(`Reddit++ runned more that one times. Check out userscript manager to disable dublicates.`, { time: 10000 });
  4927. return;
  4928. }
  4929. pp_meta = document.createElement(`meta`);
  4930. pp_meta.setAttribute(`name`, `reddit-plus-plus`);
  4931. pp_meta.setAttribute(`version`, "1.0.26");
  4932. document.head.append(pp_meta);
  4933. // call latest migration
  4934. migration_1_0_0.check();
  4935. if (checkRedirect()) {
  4936. return;
  4937. }
  4938. const pp_app = await dynamicElement(() => documentBody.querySelector(`shreddit-app`), MAX_LOAD_LAG);
  4939. if (pp_app == null || pp_app.getAttribute(`devicetype`) != `desktop`) {
  4940. pp_log(`Reddit++ was stopped for a non compatible page`);
  4941. return;
  4942. }
  4943. header_renderHeader(documentBody);
  4944. renderApp();
  4945. observeFor(documentBody, element => {
  4946. // header
  4947. if (element.matches(`reddit-header-large`) == true) {
  4948. header_renderHeader(element.parentElement);
  4949. }
  4950. // content
  4951. const isSubPage = element.matches(`shreddit-app`) == true;
  4952. const isMainPage = element.classList.contains(`grid-container`) && element.parentElement.matches(`shreddit-app`) == true;
  4953. if (isSubPage || isMainPage) {
  4954. renderApp();
  4955. checkSortCommentsRedirect();
  4956. }
  4957. });
  4958. }
  4959.  
  4960. })();
  4961.  
  4962. /******/ })()
  4963. ;

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址