{"version":3,"file":"action-bar-BR6McDgU.js","sources":["../../src/feature/Article/services/articleLikeService.ts","../../node_modules/autosize/dist/autosize.js","../../node_modules/timeago.js/esm/lang/en_US.js","../../node_modules/timeago.js/esm/lang/zh_CN.js","../../node_modules/timeago.js/esm/register.js","../../node_modules/timeago.js/esm/utils/date.js","../../node_modules/timeago.js/esm/format.js","../../node_modules/timeago.js/esm/index.js","../../node_modules/timeago.js/esm/lang/ar.js","../../src/feature/Article/constants.ts","../../src/feature/Article/action-bar/comments/api-helpers.js","../../src/feature/Article/action-bar/comments/comments.js","../../src/feature/Article/action-bar/action-bar.ts"],"sourcesContent":["/* eslint-disable */\r\n//------------------------------------------------------------------------------\r\n// <auto-generated>\r\n// This code was generated by a tool.\r\n//\r\n//\r\n// Changes to this file may cause incorrect behavior and will be lost if\r\n// the code is regenerated.\r\n// </auto-generated>\r\n//------------------------------------------------------------------------------\r\n\r\nimport { http, type Meta } from \"~/foundation/Api\";\r\nimport { ArticleRequestModel } from \"~/feature/Article/generated-types\";\r\n\r\nexport const articleLikeServiceMeta: Meta<typeof articleLikeService> = {\r\n\tlikeCountForArticle: [\"GET\", \"/api/v1/article/like/count\"],\r\n\tlikeSaveForArticle: [\"POST\", \"/api/v1/article/like/save\"],\r\n\tlikeRemoveForArticle: [\"POST\", \"/api/v1/article/like/remove\"],\r\n};\r\n\r\n// Feature.Article.Controllers.Api.ApiV1ArticleLikeController\r\nexport const articleLikeService = {\r\n\tasync likeCountForArticle(queryStrings: ArticleRequestModel) {\r\n\t\treturn await http.fetch<undefined, undefined>(articleLikeServiceMeta.likeCountForArticle, { queryStrings });\r\n\t},\r\n\tasync likeSaveForArticle(body: ArticleRequestModel) {\r\n\t\treturn await http.fetch<undefined, ArticleRequestModel>(articleLikeServiceMeta.likeSaveForArticle, { body });\r\n\t},\r\n\tasync likeRemoveForArticle(body: ArticleRequestModel) {\r\n\t\treturn await http.fetch<undefined, ArticleRequestModel>(articleLikeServiceMeta.likeRemoveForArticle, { body });\r\n\t},\r\n};\r\n","/*!\n\tautosize 4.0.2\n\tlicense: MIT\n\thttp://www.jacklmoore.com/autosize\n*/\n(function (global, factory) {\n\tif (typeof define === \"function\" && define.amd) {\n\t\tdefine(['module', 'exports'], factory);\n\t} else if (typeof exports !== \"undefined\") {\n\t\tfactory(module, exports);\n\t} else {\n\t\tvar mod = {\n\t\t\texports: {}\n\t\t};\n\t\tfactory(mod, mod.exports);\n\t\tglobal.autosize = mod.exports;\n\t}\n})(this, function (module, exports) {\n\t'use strict';\n\n\tvar map = typeof Map === \"function\" ? new Map() : function () {\n\t\tvar keys = [];\n\t\tvar values = [];\n\n\t\treturn {\n\t\t\thas: function has(key) {\n\t\t\t\treturn keys.indexOf(key) > -1;\n\t\t\t},\n\t\t\tget: function get(key) {\n\t\t\t\treturn values[keys.indexOf(key)];\n\t\t\t},\n\t\t\tset: function set(key, value) {\n\t\t\t\tif (keys.indexOf(key) === -1) {\n\t\t\t\t\tkeys.push(key);\n\t\t\t\t\tvalues.push(value);\n\t\t\t\t}\n\t\t\t},\n\t\t\tdelete: function _delete(key) {\n\t\t\t\tvar index = keys.indexOf(key);\n\t\t\t\tif (index > -1) {\n\t\t\t\t\tkeys.splice(index, 1);\n\t\t\t\t\tvalues.splice(index, 1);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}();\n\n\tvar createEvent = function createEvent(name) {\n\t\treturn new Event(name, { bubbles: true });\n\t};\n\ttry {\n\t\tnew Event('test');\n\t} catch (e) {\n\t\t// IE does not support `new Event()`\n\t\tcreateEvent = function createEvent(name) {\n\t\t\tvar evt = document.createEvent('Event');\n\t\t\tevt.initEvent(name, true, false);\n\t\t\treturn evt;\n\t\t};\n\t}\n\n\tfunction assign(ta) {\n\t\tif (!ta || !ta.nodeName || ta.nodeName !== 'TEXTAREA' || map.has(ta)) return;\n\n\t\tvar heightOffset = null;\n\t\tvar clientWidth = null;\n\t\tvar cachedHeight = null;\n\n\t\tfunction init() {\n\t\t\tvar style = window.getComputedStyle(ta, null);\n\n\t\t\tif (style.resize === 'vertical') {\n\t\t\t\tta.style.resize = 'none';\n\t\t\t} else if (style.resize === 'both') {\n\t\t\t\tta.style.resize = 'horizontal';\n\t\t\t}\n\n\t\t\tif (style.boxSizing === 'content-box') {\n\t\t\t\theightOffset = -(parseFloat(style.paddingTop) + parseFloat(style.paddingBottom));\n\t\t\t} else {\n\t\t\t\theightOffset = parseFloat(style.borderTopWidth) + parseFloat(style.borderBottomWidth);\n\t\t\t}\n\t\t\t// Fix when a textarea is not on document body and heightOffset is Not a Number\n\t\t\tif (isNaN(heightOffset)) {\n\t\t\t\theightOffset = 0;\n\t\t\t}\n\n\t\t\tupdate();\n\t\t}\n\n\t\tfunction changeOverflow(value) {\n\t\t\t{\n\t\t\t\t// Chrome/Safari-specific fix:\n\t\t\t\t// When the textarea y-overflow is hidden, Chrome/Safari do not reflow the text to account for the space\n\t\t\t\t// made available by removing the scrollbar. The following forces the necessary text reflow.\n\t\t\t\tvar width = ta.style.width;\n\t\t\t\tta.style.width = '0px';\n\t\t\t\t// Force reflow:\n\t\t\t\t/* jshint ignore:start */\n\t\t\t\tta.offsetWidth;\n\t\t\t\t/* jshint ignore:end */\n\t\t\t\tta.style.width = width;\n\t\t\t}\n\n\t\t\tta.style.overflowY = value;\n\t\t}\n\n\t\tfunction getParentOverflows(el) {\n\t\t\tvar arr = [];\n\n\t\t\twhile (el && el.parentNode && el.parentNode instanceof Element) {\n\t\t\t\tif (el.parentNode.scrollTop) {\n\t\t\t\t\tarr.push({\n\t\t\t\t\t\tnode: el.parentNode,\n\t\t\t\t\t\tscrollTop: el.parentNode.scrollTop\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tel = el.parentNode;\n\t\t\t}\n\n\t\t\treturn arr;\n\t\t}\n\n\t\tfunction resize() {\n\t\t\tif (ta.scrollHeight === 0) {\n\t\t\t\t// If the scrollHeight is 0, then the element probably has display:none or is detached from the DOM.\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar overflows = getParentOverflows(ta);\n\t\t\tvar docTop = document.documentElement && document.documentElement.scrollTop; // Needed for Mobile IE (ticket #240)\n\n\t\t\tta.style.height = '';\n\t\t\tta.style.height = ta.scrollHeight + heightOffset + 'px';\n\n\t\t\t// used to check if an update is actually necessary on window.resize\n\t\t\tclientWidth = ta.clientWidth;\n\n\t\t\t// prevents scroll-position jumping\n\t\t\toverflows.forEach(function (el) {\n\t\t\t\tel.node.scrollTop = el.scrollTop;\n\t\t\t});\n\n\t\t\tif (docTop) {\n\t\t\t\tdocument.documentElement.scrollTop = docTop;\n\t\t\t}\n\t\t}\n\n\t\tfunction update() {\n\t\t\tresize();\n\n\t\t\tvar styleHeight = Math.round(parseFloat(ta.style.height));\n\t\t\tvar computed = window.getComputedStyle(ta, null);\n\n\t\t\t// Using offsetHeight as a replacement for computed.height in IE, because IE does not account use of border-box\n\t\t\tvar actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(computed.height)) : ta.offsetHeight;\n\n\t\t\t// The actual height not matching the style height (set via the resize method) indicates that \n\t\t\t// the max-height has been exceeded, in which case the overflow should be allowed.\n\t\t\tif (actualHeight < styleHeight) {\n\t\t\t\tif (computed.overflowY === 'hidden') {\n\t\t\t\t\tchangeOverflow('scroll');\n\t\t\t\t\tresize();\n\t\t\t\t\tactualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(window.getComputedStyle(ta, null).height)) : ta.offsetHeight;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// Normally keep overflow set to hidden, to avoid flash of scrollbar as the textarea expands.\n\t\t\t\tif (computed.overflowY !== 'hidden') {\n\t\t\t\t\tchangeOverflow('hidden');\n\t\t\t\t\tresize();\n\t\t\t\t\tactualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(window.getComputedStyle(ta, null).height)) : ta.offsetHeight;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (cachedHeight !== actualHeight) {\n\t\t\t\tcachedHeight = actualHeight;\n\t\t\t\tvar evt = createEvent('autosize:resized');\n\t\t\t\ttry {\n\t\t\t\t\tta.dispatchEvent(evt);\n\t\t\t\t} catch (err) {\n\t\t\t\t\t// Firefox will throw an error on dispatchEvent for a detached element\n\t\t\t\t\t// https://bugzilla.mozilla.org/show_bug.cgi?id=889376\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tvar pageResize = function pageResize() {\n\t\t\tif (ta.clientWidth !== clientWidth) {\n\t\t\t\tupdate();\n\t\t\t}\n\t\t};\n\n\t\tvar destroy = function (style) {\n\t\t\twindow.removeEventListener('resize', pageResize, false);\n\t\t\tta.removeEventListener('input', update, false);\n\t\t\tta.removeEventListener('keyup', update, false);\n\t\t\tta.removeEventListener('autosize:destroy', destroy, false);\n\t\t\tta.removeEventListener('autosize:update', update, false);\n\n\t\t\tObject.keys(style).forEach(function (key) {\n\t\t\t\tta.style[key] = style[key];\n\t\t\t});\n\n\t\t\tmap.delete(ta);\n\t\t}.bind(ta, {\n\t\t\theight: ta.style.height,\n\t\t\tresize: ta.style.resize,\n\t\t\toverflowY: ta.style.overflowY,\n\t\t\toverflowX: ta.style.overflowX,\n\t\t\twordWrap: ta.style.wordWrap\n\t\t});\n\n\t\tta.addEventListener('autosize:destroy', destroy, false);\n\n\t\t// IE9 does not fire onpropertychange or oninput for deletions,\n\t\t// so binding to onkeyup to catch most of those events.\n\t\t// There is no way that I know of to detect something like 'cut' in IE9.\n\t\tif ('onpropertychange' in ta && 'oninput' in ta) {\n\t\t\tta.addEventListener('keyup', update, false);\n\t\t}\n\n\t\twindow.addEventListener('resize', pageResize, false);\n\t\tta.addEventListener('input', update, false);\n\t\tta.addEventListener('autosize:update', update, false);\n\t\tta.style.overflowX = 'hidden';\n\t\tta.style.wordWrap = 'break-word';\n\n\t\tmap.set(ta, {\n\t\t\tdestroy: destroy,\n\t\t\tupdate: update\n\t\t});\n\n\t\tinit();\n\t}\n\n\tfunction destroy(ta) {\n\t\tvar methods = map.get(ta);\n\t\tif (methods) {\n\t\t\tmethods.destroy();\n\t\t}\n\t}\n\n\tfunction update(ta) {\n\t\tvar methods = map.get(ta);\n\t\tif (methods) {\n\t\t\tmethods.update();\n\t\t}\n\t}\n\n\tvar autosize = null;\n\n\t// Do nothing in Node.js environment and IE8 (or lower)\n\tif (typeof window === 'undefined' || typeof window.getComputedStyle !== 'function') {\n\t\tautosize = function autosize(el) {\n\t\t\treturn el;\n\t\t};\n\t\tautosize.destroy = function (el) {\n\t\t\treturn el;\n\t\t};\n\t\tautosize.update = function (el) {\n\t\t\treturn el;\n\t\t};\n\t} else {\n\t\tautosize = function autosize(el, options) {\n\t\t\tif (el) {\n\t\t\t\tArray.prototype.forEach.call(el.length ? el : [el], function (x) {\n\t\t\t\t\treturn assign(x, options);\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn el;\n\t\t};\n\t\tautosize.destroy = function (el) {\n\t\t\tif (el) {\n\t\t\t\tArray.prototype.forEach.call(el.length ? el : [el], destroy);\n\t\t\t}\n\t\t\treturn el;\n\t\t};\n\t\tautosize.update = function (el) {\n\t\t\tif (el) {\n\t\t\t\tArray.prototype.forEach.call(el.length ? el : [el], update);\n\t\t\t}\n\t\t\treturn el;\n\t\t};\n\t}\n\n\texports.default = autosize;\n\tmodule.exports = exports['default'];\n});","var EN_US = ['second', 'minute', 'hour', 'day', 'week', 'month', 'year'];\nexport default function (diff, idx) {\n if (idx === 0)\n return ['just now', 'right now'];\n var unit = EN_US[Math.floor(idx / 2)];\n if (diff > 1)\n unit += 's';\n return [diff + \" \" + unit + \" ago\", \"in \" + diff + \" \" + unit];\n}\n//# sourceMappingURL=en_US.js.map","var ZH_CN = ['秒', '分钟', 'å°æ—¶', '天', '周', '个月', 'å¹´'];\nexport default function (diff, idx) {\n if (idx === 0)\n return ['刚刚', '片刻åŽ'];\n var unit = ZH_CN[~~(idx / 2)];\n return [diff + \" \" + unit + \"\\u524D\", diff + \" \" + unit + \"\\u540E\"];\n}\n//# sourceMappingURL=zh_CN.js.map","/**\n * Created by hustcc on 18/5/20.\n * Contract: i@hust.cc\n */\n/**\n * All supported locales\n */\nvar Locales = {};\n/**\n * register a locale\n * @param locale\n * @param func\n */\nexport var register = function (locale, func) {\n Locales[locale] = func;\n};\n/**\n * get a locale, default is en_US\n * @param locale\n * @returns {*}\n */\nexport var getLocale = function (locale) {\n return Locales[locale] || Locales['en_US'];\n};\n//# sourceMappingURL=register.js.map","/**\n * Created by hustcc on 18/5/20.\n * Contract: i@hust.cc\n */\nvar SEC_ARRAY = [\n 60,\n 60,\n 24,\n 7,\n 365 / 7 / 12,\n 12,\n];\n/**\n * format Date / string / timestamp to timestamp\n * @param input\n * @returns {*}\n */\nexport function toDate(input) {\n if (input instanceof Date)\n return input;\n // @ts-ignore\n if (!isNaN(input) || /^\\d+$/.test(input))\n return new Date(parseInt(input));\n input = (input || '')\n // @ts-ignore\n .trim()\n .replace(/\\.\\d+/, '') // remove milliseconds\n .replace(/-/, '/')\n .replace(/-/, '/')\n .replace(/(\\d)T(\\d)/, '$1 $2')\n .replace(/Z/, ' UTC') // 2017-2-5T3:57:52Z -> 2017-2-5 3:57:52UTC\n .replace(/([+-]\\d\\d):?(\\d\\d)/, ' $1$2'); // -04:00 -> -0400\n return new Date(input);\n}\n/**\n * format the diff second to *** time ago, with setting locale\n * @param diff\n * @param localeFunc\n * @returns\n */\nexport function formatDiff(diff, localeFunc) {\n /**\n * if locale is not exist, use defaultLocale.\n * if defaultLocale is not exist, use build-in `en`.\n * be sure of no error when locale is not exist.\n *\n * If `time in`, then 1\n * If `time ago`, then 0\n */\n var agoIn = diff < 0 ? 1 : 0;\n /**\n * Get absolute value of number (|diff| is non-negative) value of x\n * |diff| = diff if diff is positive\n * |diff| = -diff if diff is negative\n * |0| = 0\n */\n diff = Math.abs(diff);\n /**\n * Time in seconds\n */\n var totalSec = diff;\n /**\n * Unit of time\n */\n var idx = 0;\n for (; diff >= SEC_ARRAY[idx] && idx < SEC_ARRAY.length; idx++) {\n diff /= SEC_ARRAY[idx];\n }\n /**\n * Math.floor() is alternative of ~~\n *\n * The differences and bugs:\n * Math.floor(3.7) -> 4 but ~~3.7 -> 3\n * Math.floor(1559125440000.6) -> 1559125440000 but ~~1559125440000.6 -> 52311552\n *\n * More information about the performance of algebraic:\n * https://www.youtube.com/watch?v=65-RbBwZQdU\n */\n diff = Math.floor(diff);\n idx *= 2;\n if (diff > (idx === 0 ? 9 : 1))\n idx += 1;\n return localeFunc(diff, idx, totalSec)[agoIn].replace('%s', diff.toString());\n}\n/**\n * calculate the diff second between date to be formatted an now date.\n * @param date\n * @param relativeDate\n * @returns {number}\n */\nexport function diffSec(date, relativeDate) {\n var relDate = relativeDate ? toDate(relativeDate) : new Date();\n return (+relDate - +toDate(date)) / 1000;\n}\n/**\n * nextInterval: calculate the next interval time.\n * - diff: the diff sec between now and date to be formatted.\n *\n * What's the meaning?\n * diff = 61 then return 59\n * diff = 3601 (an hour + 1 second), then return 3599\n * make the interval with high performance.\n **/\nexport function nextInterval(diff) {\n var rst = 1, i = 0, d = Math.abs(diff);\n for (; diff >= SEC_ARRAY[i] && i < SEC_ARRAY.length; i++) {\n diff /= SEC_ARRAY[i];\n rst *= SEC_ARRAY[i];\n }\n d = d % rst;\n d = d ? rst - d : rst;\n return Math.ceil(d);\n}\n//# sourceMappingURL=date.js.map","import { formatDiff, diffSec } from './utils/date';\nimport { getLocale } from './register';\n/**\n * format a TDate into string\n * @param date\n * @param locale\n * @param opts\n */\nexport var format = function (date, locale, opts) {\n // diff seconds\n var sec = diffSec(date, opts && opts.relativeDate);\n // format it with locale\n return formatDiff(sec, getLocale(locale));\n};\n//# sourceMappingURL=format.js.map","/**\n * Created by hustcc on 18/5/20.\n * Contract: i@hust.cc\n */\nimport en_US from './lang/en_US';\nimport zh_CN from './lang/zh_CN';\nimport { register } from './register';\nregister('en_US', en_US);\nregister('zh_CN', zh_CN);\nexport { format } from './format';\nexport { render, cancel } from './realtime';\nexport { register };\n//# sourceMappingURL=index.js.map","var timeTypes = [\n ['ثانية', 'ثانيتين', '%s ثوان', '%s ثانية'],\n ['دقيقة', 'دقيقتين', '%s دقائق', '%s دقيقة'],\n ['ساعة', 'ساعتين', '%s ساعات', '%s ساعة'],\n ['يوم', 'يومين', '%s أيام', '%s يوماً'],\n ['أسبوع', 'أسبوعين', '%s أسابيع', '%s أسبوعاً'],\n ['شهر', 'شهرين', '%s أشهر', '%s شهراً'],\n ['عام', 'عامين', '%s أعوام', '%s عاماً'],\n];\nfunction formatTime(type, n) {\n if (n < 3)\n return timeTypes[type][n - 1];\n if (n >= 3 && n <= 10)\n return timeTypes[type][2];\n return timeTypes[type][3];\n}\nexport default function (number, index) {\n if (index === 0) {\n return ['منذ Ù„Øظات', 'بعد Ù„Øظات'];\n }\n var timeStr = formatTime(Math.floor(index / 2), number);\n return ['منذ' + ' ' + timeStr, 'بعد' + ' ' + timeStr];\n}\n//# sourceMappingURL=ar.js.map","const API_VERSION = \"/api/v1\";\r\n\r\nconst COMMENTS_SAVE = `${API_VERSION}/article/comment/save`;\r\nconst COMMENTS_COUNT = `${API_VERSION}/article/comment/count`;\r\nconst LIKE_SAVE = `${API_VERSION}/article/like/save`;\r\nconst LIKE_REMOVE = `${API_VERSION}/article/like/remove`;\r\nconst LIKE_COUNT = `${API_VERSION}/article/like/count`;\r\nconst ARTICLE_SHARE = `${API_VERSION}/article/share`;\r\n\r\nexport {\r\n\tCOMMENTS_SAVE,\r\n\tCOMMENTS_COUNT,\r\n\tLIKE_SAVE,\r\n\tLIKE_REMOVE,\r\n\tLIKE_COUNT,\r\n\tARTICLE_SHARE,\r\n};\r\n","import { fetcher } from \"~/foundation/Api\";\r\nimport { isRtl } from \"~/foundation/Helpers/isRtl\";\r\nimport { COMMENTS_SAVE } from \"../../constants\";\r\n\r\n/**\r\n *\r\n * @param {*} commentConfig\r\n * @returns promise with posted comment\r\n * @memberof Comments\r\n */\r\nexport function postComment(commentConfig) {\r\n\t// Send event to Analytics dataLayer when comment or reply is posted from an article\r\n\twindow.dataLayer = window.dataLayer || [];\r\n\twindow.dataLayer.push({\r\n\t\tevent: \"commentSent\"\r\n\t});\r\n\r\n\treturn fetcher(\r\n\t\t`/${isRtl ? \"ar\" : \"en\"}${COMMENTS_SAVE}`,\r\n\t\t\"POST\",\r\n\t\tcommentConfig\r\n\t);\r\n}\r\n\r\n/**\r\n *\r\n * @returns promise with comments\r\n * @memberof Comments\r\n */\r\nexport function getComments(articleId, listLength, index) {\r\n\tconst listCommentsUrl = `/api/v1/article/comment/${articleId}/list?listRequestModel.startIndex=${index}&listRequestModel.length=${listLength}`;\r\n\r\n\treturn fetcher(`/${isRtl ? \"ar\" : \"en\"}${listCommentsUrl}`, \"POST\");\r\n}\r\n\r\n/**\r\n *\r\n *\r\n * @param {*} commentId\r\n * @returns promise with deleted comment\r\n * @memberof Comments\r\n */\r\nexport function deleteComment(commentId) {\r\n\tconst deleteCommentUrl = `/api/v1/article/comment/${commentId}/delete`;\r\n\r\n\treturn fetcher(`/${isRtl ? \"ar\" : \"en\"}${deleteCommentUrl}`, \"POST\");\r\n}\r\n","import anime from \"animejs\";\r\nimport autosize from \"autosize\";\r\nimport { format, register } from \"timeago.js\";\r\nimport ar from \"timeago.js/esm/lang/ar\";\r\nimport { Snackbar } from \"~/foundation/Components/snackbar/snackbar\";\r\nimport { toggleClass } from \"~/foundation/Dom/classList\";\r\nimport { createElement } from \"~/foundation/Dom/createElement\";\r\nimport { appendElement, deleteElement, insertElementAfter, prependElement } from \"~/foundation/Dom/elementManipulation\";\r\nimport { addEvent, removeAllEvents } from \"~/foundation/Events/events\";\r\nimport { forEach } from \"~/foundation/Helpers/forEach\";\r\nimport { isRtl } from \"~/foundation/Helpers/isRtl\";\r\nimport { LIFE } from \"~/foundation/Styles/durations\";\r\nimport { STANDARDCUBICBEZIER } from \"~/foundation/Styles/easings\";\r\nimport { deleteComment, getComments, postComment } from \"./api-helpers\";\r\n\r\nexport class Comments {\r\n\t/**\r\n\t\t * Internal placeholder for cached DOM-objects.\r\n\t\t *\r\n\t\t * @type {object}\r\n\t\t * @ignore\r\n\t\t */\r\n\tdom = {\r\n\t\tcontainer: undefined\r\n\t};\r\n\r\n\t/**\r\n\t\t *\r\n\t\t * @param {Element} domReference - The element to work from.\r\n\t\t */\r\n\tconstructor(config) {\r\n\t\tconst {\r\n\t\t\tdomReference,\r\n\t\t\tarticleId,\r\n\t\t\tonClose,\r\n\t\t\tshowSnackMessage,\r\n\t\t\tsnackMessage\r\n\t\t} = config;\r\n\r\n\t\tthis.dom.container = domReference;\r\n\t\tthis.articleId = articleId;\r\n\t\tthis.onClose = onClose;\r\n\t\tthis.showSnackMessage = showSnackMessage;\r\n\t\tthis.snackMessage = snackMessage;\r\n\t\tthis.comments = [];\r\n\t\tthis.snackbarInstance = undefined;\r\n\t\tthis.replyMessageShown = false;\r\n\t\tthis.texts = {\r\n\t\t\tdeletedText: this.dom.container.getAttribute(\"data-deleted-text\"),\r\n\t\t\tdeleteButtonLabel: this.dom.container.getAttribute(\r\n\t\t\t\t\"data-delete-button-label\"\r\n\t\t\t),\r\n\t\t\treplyPlaceholder: this.dom.container.getAttribute(\r\n\t\t\t\t\"data-reply-placeholder\"\r\n\t\t\t),\r\n\t\t\tinputEmpty: this.dom.container.getAttribute(\"data-input-empty\"),\r\n\t\t\tdeleteConfirmText: this.dom.container.getAttribute(\r\n\t\t\t\t\"data-delete-confirm-text\"\r\n\t\t\t),\r\n\t\t\treplyLabel: this.dom.container.getAttribute(\"data-replyLabel\"),\r\n\t\t\tcancelLabel: this.dom.container.getAttribute(\"data-cancelLabel\"),\r\n\t\t\tconfirmLabel: this.dom.container.getAttribute(\"data-confirmLabel\")\r\n\t\t};\r\n\r\n\t\tthis.loadMoreCommentsAmount = 10;\r\n\t\tthis.loadedCommentsAmount = this.loadMoreCommentsAmount;\r\n\t\tthis.currentCommentCountIndex = 0;\r\n\t\tthis.totalComments = undefined;\r\n\r\n\t\tif (isRtl) {\r\n\t\t\tregister(\"ar\", ar);\r\n\t\t}\r\n\r\n\t\tthis.initialize();\r\n\t}\r\n\r\n\t//Remove all events for all buttons and textareas\r\n\tkill() {\r\n\t\tremoveAllEvents(this.dom.submitCommentButton);\r\n\t\tremoveAllEvents(this.dom.loadMoreButton);\r\n\t\tconst buttons = this.dom.container.querySelectorAll(\"button\");\r\n\r\n\t\tforEach(buttons, button => {\r\n\t\t\tremoveAllEvents(button);\r\n\t\t});\r\n\r\n\t\t// Remove all listerners from textareas\r\n\t\tconst textareas = this.dom.container.querySelectorAll(\"textarea\");\r\n\t\tforEach(textareas, textarea => {\r\n\t\t\tautosize.destroy(textarea);\r\n\t\t});\r\n\r\n\t\t// Remove all comments - will be appended on load\r\n\t\tconst commentItems = this.dom.container.querySelectorAll(\r\n\t\t\t\".comments-dialog__item\"\r\n\t\t);\r\n\r\n\t\tdeleteElement(commentItems);\r\n\t}\r\n\r\n\t/**\r\n\t\t * Animate in comment element\r\n\t\t *\r\n\t\t * @param {*} element\r\n\t\t * @param shouldStagger\r\n\t\t * @memberof Comments\r\n\t\t */\r\n\tanimateInComment(element, shouldStagger = false) {\r\n\t\tconst config = {\r\n\t\t\ttargets: element,\r\n\t\t\teasing: STANDARDCUBICBEZIER,\r\n\t\t\tduration: LIFE,\r\n\t\t\ttranslateX: isRtl ? [5, 0] : [-5, 0],\r\n\t\t\topacity: [0, 1]\r\n\t\t};\r\n\t\tif (shouldStagger) {\r\n\t\t\tconfig.delay = anime.stagger(100);\r\n\t\t}\r\n\r\n\t\tconst animation = anime(config);\r\n\r\n\t\treturn animation.finished;\r\n\t}\r\n\r\n\tanimateOutComment(element, shouldStagger = false) {\r\n\t\tconst config = {\r\n\t\t\ttargets: element,\r\n\t\t\teasing: STANDARDCUBICBEZIER,\r\n\t\t\tduration: LIFE,\r\n\t\t\ttranslateX: isRtl ? [-5, 0] : [5, 0],\r\n\t\t\topacity: [1, 0]\r\n\t\t};\r\n\t\tif (shouldStagger) {\r\n\t\t\tconfig.delay = anime.stagger(100);\r\n\t\t}\r\n\r\n\t\tconst animation = anime(config);\r\n\r\n\t\treturn animation.finished;\r\n\t}\r\n\r\n\t/**\r\n\t\t * Create comment element\r\n\t\t *\r\n\t\t * @param {*} commentData\r\n\t\t * @returns comment element\r\n\t\t * @memberof Comments\r\n\t\t */\r\n\tcreateComment(commentData) {\r\n\t\tconst {\r\n\t\t\ttimestamp,\r\n\t\t\tid,\r\n\t\t\tauthor,\r\n\t\t\temail,\r\n\t\t\tcomment,\r\n\t\t\tshowDelete,\r\n\t\t\tisDeleted,\r\n\t\t\tisReply\r\n\t\t} = commentData;\r\n\r\n\t\tconst timeAgo = format(timestamp, isRtl ? \"ar\" : \"en_US\");\r\n\r\n\t\tconst commentTextElement = createElement(\"div\", {\r\n\t\t\tclassName: \"comment__text\",\r\n\t\t\thtml: isDeleted ? this.texts.deletedText : comment\r\n\t\t});\r\n\r\n\t\tconst html = [commentTextElement];\r\n\r\n\t\tif (!isDeleted) {\r\n\t\t\tconst buttonContainer = createElement(\"div\", {\r\n\t\t\t\tclassName: \"comment__buttons\"\r\n\t\t\t});\r\n\r\n\t\t\tconst actionButtonsContainer = createElement(\"div\", {\r\n\t\t\t\tclassName: \"comment__buttons-actions\",\r\n\t\t\t});\r\n\r\n\t\t\tconst replyButtonElement = createElement(\"button\", {\r\n\t\t\t\ttype: \"button\",\r\n\t\t\t\tclassName: `button-link reply reply-comment-${id} isReply`,\r\n\t\t\t\tid,\r\n\t\t\t\thtml: `\r\n\t\t\t\t\t\t\t\t<svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n\t\t\t\t\t\t\t\t\t<path d=\"M1.08073 12.9827L3.90753 10.0028C3.91296 9.99728 3.91944 9.99288 3.92658 9.98986C3.93373 9.98684 3.9414 9.98526 3.94916 9.98523H11.5049C11.8955 9.98523 12.2702 9.83005 12.5464 9.55383C12.8226 9.2776 12.9778 8.90296 12.9778 8.51232V2.44301C12.9779 2.25354 12.9406 2.06591 12.8682 1.89084C12.7957 1.71577 12.6895 1.55669 12.5555 1.42268C12.4216 1.28868 12.2625 1.18238 12.0875 1.10985C11.9124 1.03733 11.7248 1 11.5354 1H2.43579C2.04981 1 1.67965 1.15333 1.40672 1.42625C1.1338 1.69918 0.980469 2.06935 0.980469 2.45532V12.9416C0.980517 12.9532 0.984003 12.9645 0.990486 12.9741C0.996969 12.9838 1.00616 12.9912 1.01689 12.9956C1.02762 13 1.03942 13.0011 1.05078 12.9988C1.06214 12.9965 1.07257 12.9909 1.08073 12.9827Z\" stroke-width=\"1.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n\t\t\t\t\t\t\t\t\t<path d=\"M4.03125 4.03003H9.99912\" stroke-width=\"1.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n\t\t\t\t\t\t\t\t\t<path d=\"M4.03125 7.04248H9.99912\" stroke-width=\"1.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n\t\t\t\t\t\t\t\t</svg>\r\n\t\t\t\t\t\t\t\t${this.texts.replyLabel === \"\" ? \"Reply\" : this.texts.replyLabel}\r\n\t\t\t\t\t\t\t`\r\n\t\t\t});\r\n\r\n\t\t\tconst cancelButtonElement = createElement(\"button\", {\r\n\t\t\t\ttype: \"button\",\r\n\t\t\t\tclassName: `button-link cancel cancel-reply-comment-${id} isReply`,\r\n\t\t\t\tid,\r\n\t\t\t\thtml: `\r\n\t\t\t\t\t\t\t\t<svg width=\"30\" height=\"30\" viewBox=\"0 0 30 30\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n\t\t\t\t\t\t\t\t\t<rect x=\"6.75\" y=\"8.09961\" width=\"1.90909\" height=\"21\" transform=\"rotate(-45 6.75 8.09961)\" />\r\n\t\t\t\t\t\t\t\t\t<rect x=\"21.5977\" y=\"6.74963\" width=\"1.90909\" height=\"21\" transform=\"rotate(45 21.5977 6.74963)\" />\r\n\t\t\t\t\t\t\t\t</svg>\r\n\t\t\t\t\t\t\t\t${this.texts.cancelLabel === \"\" ? \"Cancel\" : this.texts.cancelLabel}\r\n\t\t\t\t\t\t\t`,\r\n\t\t\t\tstyle: \"opacity:0\"\r\n\t\t\t});\r\n\r\n\t\t\tif (showDelete) {\r\n\t\t\t\tconst deleteButtonElement = createElement(\"button\", {\r\n\t\t\t\t\ttype: \"button\",\r\n\t\t\t\t\tclassName: `button-link delete-comment ${isReply ? \"isReply\" : \"isComment\"}`,\r\n\t\t\t\t\tid,\r\n\t\t\t\t\thtml: `\r\n\t\t\t\t\t\t\t\t\t<svg width=\"16\" height=\"19\" viewBox=\"0 0 16 19\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n\t\t\t\t\t\t\t\t\t\t<path d=\"M2.41406 3.40894V15.942C2.4147 16.1589 2.45805 16.3735 2.54163 16.5736C2.62521 16.7737 2.74738 16.9554 2.90117 17.1082C3.05496 17.2611 3.23736 17.3822 3.43795 17.4646C3.63854 17.547 3.85339 17.5891 4.07024 17.5884H11.8404C12.0573 17.5891 12.2721 17.547 12.4727 17.4646C12.6733 17.3822 12.8557 17.2611 13.0095 17.1082C13.1633 16.9554 13.2854 16.7737 13.369 16.5736C13.4526 16.3735 13.4959 16.1589 13.4966 15.942V3.40894\" stroke-width=\"1.2\" stroke-miterlimit=\"10\"/>\r\n\t\t\t\t\t\t\t\t\t\t<path d=\"M1 3.76074H15\" stroke-width=\"1.2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\"/>\r\n\t\t\t\t\t\t\t\t\t\t<path d=\"M5.07031 3.70781L5.59817 1.06935C5.59654 1.05296 5.60132 1.03658 5.61151 1.02365C5.62171 1.01072 5.63652 1.00224 5.65283 1H10.2363C10.2524 1.00243 10.2671 1.01099 10.2771 1.0239C10.2871 1.03681 10.2918 1.05308 10.2901 1.06935L10.8612 3.70781\" stroke-width=\"1.2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\"/>\r\n\t\t\t\t\t\t\t\t\t\t<path d=\"M7.96875 7.87598V14.7944\" stroke-width=\"1.2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\"/>\r\n\t\t\t\t\t\t\t\t\t\t<path d=\"M10.793 7.87598V14.7944\" stroke-width=\"1.2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\"/>\r\n\t\t\t\t\t\t\t\t\t\t<path d=\"M5.23047 7.87598V14.7944\" stroke-width=\"1.2\" stroke-miterlimit=\"10\" stroke-linecap=\"round\"/>\r\n\t\t\t\t\t\t\t\t\t</svg>\r\n\t\t\t\t\t\t\t\t\t${this.texts.deleteButtonLabel === \"\" ? \"Delete\" : this.texts.deleteButtonLabel}\r\n\t\t\t\t\t\t\t\t`\r\n\t\t\t\t});\r\n\r\n\t\t\t\taddEvent(deleteButtonElement, \"click\", this.removeComment);\r\n\t\t\t\tactionButtonsContainer.appendChild(deleteButtonElement);\r\n\t\t\t}\r\n\r\n\t\t\taddEvent(replyButtonElement, \"click\", this.showReplyInput);\r\n\t\t\taddEvent(cancelButtonElement, \"click\", this.hideReplyInput);\r\n\t\t\tactionButtonsContainer.appendChild(replyButtonElement);\r\n\t\t\tbuttonContainer.appendChild(actionButtonsContainer);\r\n\t\t\tbuttonContainer.appendChild(cancelButtonElement);\r\n\t\t\thtml.push(buttonContainer);\r\n\r\n\t\t\tconst authorElement = createElement(\"span\", {\r\n\t\t\t\tclassName: \"comment__author\",\r\n\t\t\t\thtml: `<strong data-toggle-author><span>${author}</span><span class=\"visuallyhidden\">${email}</span></strong><span class=\"post-time\">${timeAgo}</span>`\r\n\t\t\t});\r\n\t\t\thtml.unshift(authorElement);\r\n\t\t\taddEvent(authorElement, \"click\", this.toggleAuthorLabel);\r\n\t\t}\r\n\r\n\t\treturn createElement(\"div\", {\r\n\t\t\tclassName: isDeleted\r\n\t\t\t\t? `comment-deleted comment ${isReply ? \"isReply\" : \"isComment\"}`\r\n\t\t\t\t: `comment comment-${id} ${isReply ? \"isReply\" : \"isComment\"}`,\r\n\t\t\thtml\r\n\t\t});\r\n\t}\r\n\r\n\t/**\r\n\t\t * Create comment element\r\n\t\t *\r\n\t\t * @param {*} commentContainerData\r\n\t\t * @returns comments-dialog__item element\r\n\t\t * @memberof Comments\r\n\t\t */\r\n\tcreateCommentContainer(commentContainerData) {\r\n\t\tconst { id, replies, isDeleted, showDelete } = commentContainerData;\r\n\t\tconst repliesElements = [];\r\n\t\tconst hasReplies = replies && replies.length > 0;\r\n\r\n\t\t// If any replies - replylist contains all replies\r\n\t\tif (hasReplies) {\r\n\t\t\tforEach(replies, reply => {\r\n\t\t\t\tconst { id, createdDate, name, email, text, isDeleted } = reply;\r\n\t\t\t\tconst replyElement = this.createComment({\r\n\t\t\t\t\tid,\r\n\t\t\t\t\tauthor: name,\r\n\t\t\t\t\temail: email,\r\n\t\t\t\t\tcomment: text,\r\n\t\t\t\t\ttimestamp: createdDate,\r\n\t\t\t\t\tisDeleted,\r\n\t\t\t\t\tshowDelete,\r\n\t\t\t\t\tisReply: true\r\n\t\t\t\t});\r\n\r\n\t\t\t\trepliesElements.push(replyElement);\r\n\t\t\t});\r\n\t\t}\r\n\t\tconst replyList = createElement(\"div\", {\r\n\t\t\tclassName: \"comments-dialog_reply-list\",\r\n\t\t\thtml: repliesElements\r\n\t\t});\r\n\r\n\t\tlet replyContainer;\r\n\r\n\t\t// If the comment is not deleted, show reply textarea\r\n\t\tif (!isDeleted) {\r\n\t\t\tconst replyTextarea = createElement(\"textarea\", {\r\n\t\t\t\tclassName: `reply-${id}`,\r\n\t\t\t\tid,\r\n\t\t\t\trequired: true\r\n\t\t\t});\r\n\r\n\t\t\tconst labelElement = createElement(\"label\", {\r\n\t\t\t\ttext: this.texts.replyPlaceholder\r\n\t\t\t});\r\n\r\n\t\t\tconst replySubmitButton = createElement(\"button\", {\r\n\t\t\t\tclassName: \"submit-reply\",\r\n\t\t\t\tid,\r\n\t\t\t\ttype: \"button\",\r\n\t\t\t\thtml: `<svg width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n\t\t\t\t\t\t\t<path d=\"M0.721154 10L19.1758 10\" stroke=\"#222222\" stroke-width=\"1.3\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n\t\t\t\t\t\t\t<path d=\"M11.314 19.25L19.1131 10.4617C19.2187 10.3422 19.2773 10.1859 19.2773 10.0238C19.2773 9.86157 19.2187 9.7053 19.1131 9.58584L11.3124 0.752502\" stroke=\"#222222\" stroke-width=\"1.3\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\r\n\t\t\t\t\t\t\t</svg>`\r\n\t\t\t});\r\n\r\n\t\t\tconst replyInput = createElement(\"div\", {\r\n\t\t\t\tclassName: ` input input--grey reply-input-${id}`,\r\n\t\t\t\thtml: [replyTextarea, labelElement, replySubmitButton],\r\n\t\t\t\tstyle: \"display:none\"\r\n\t\t\t});\r\n\r\n\t\t\treplyContainer = createElement(\"div\", {\r\n\t\t\t\tclassName: `comments-dialog__reply reply-to-${id}`,\r\n\t\t\t\thtml: [replyInput, replyList]\r\n\t\t\t});\r\n\r\n\t\t\taddEvent(replySubmitButton, \"click\", this.submitReply);\r\n\t\t\tautosize(replyTextarea);\r\n\t\t} else {\r\n\t\t\t// If deleted, check if any replies and only add them if any\r\n\t\t\tconst replyContainerConfig = {\r\n\t\t\t\tclassName: \"comments-dialog__reply\"\r\n\t\t\t};\r\n\r\n\t\t\tif (hasReplies) {\r\n\t\t\t\treplyContainerConfig.html = replyList;\r\n\t\t\t}\r\n\r\n\t\t\treplyContainer = createElement(\"div\", replyContainerConfig);\r\n\t\t}\r\n\r\n\t\t// If comment is deleted and doesnt have any replies show nothing, if it has replies show text for deleted\r\n\t\tif (isDeleted && !hasReplies) {\r\n\t\t\treturn createElement(\"div\", {\r\n\t\t\t\thtml: this.createComment(commentContainerData),\r\n\t\t\t\tclassName: \"comments-dialog__item-deleted\",\r\n\t\t\t\tstyle: \"display:none\"\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\treturn createElement(\"div\", {\r\n\t\t\t\thtml: [\r\n\t\t\t\t\tthis.createComment(commentContainerData),\r\n\t\t\t\t\treplyContainer\r\n\t\t\t\t],\r\n\t\t\t\tclassName: \"comments-dialog__item\"\r\n\t\t\t});\r\n\t\t}\r\n\t}\r\n\r\n\t/**\r\n\t\t * Toggle between name and email visibility when clicking element\r\n\t\t */\r\n\ttoggleAuthorLabel = e => {\r\n\t\ttoggleClass(\r\n\t\t\te.currentTarget.querySelectorAll(\"[data-toggle-author] span\"),\r\n\t\t\t\"visuallyhidden\"\r\n\t\t);\r\n\t};\r\n\r\n\t/**\r\n\t\t * Post comment and animate in\r\n\t\t *\r\n\t\t * @memberof Comments\r\n\t\t */\r\n\tsubmitComment = () => {\r\n\t\tif (this.dom.commentInput.value !== \"\") {\r\n\t\t\tthis.dom.submitCommentButton.disabled = true;\r\n\t\t\tpostComment({\r\n\t\t\t\tText: this.dom.commentInput.value,\r\n\t\t\t\tArticleId: this.articleId\r\n\t\t\t}).then(result => {\r\n\t\t\t\tconst { success, data } = result;\r\n\t\t\t\tthis.dom.submitCommentButton.disabled = false;\r\n\t\t\t\tthis.dom.commentInput.style.height = \"62px\";\r\n\t\t\t\tif (success) {\r\n\t\t\t\t\tconst commentElement = this.createCommentContainer({\r\n\t\t\t\t\t\tid: data.id,\r\n\t\t\t\t\t\tauthor: data.name,\r\n\t\t\t\t\t\temail: data.email,\r\n\t\t\t\t\t\tcomment: this.dom.commentInput.value,\r\n\t\t\t\t\t\ttimestamp: data.createdDate,\r\n\t\t\t\t\t\tisDeleted: data.isDeleted,\r\n\t\t\t\t\t\tshowDelete: data.showDelete\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tthis.incrementCount();\r\n\r\n\t\t\t\t\tcommentElement.style.opacity = 0;\r\n\t\t\t\t\tprependElement(commentElement, this.dom.commentSection);\r\n\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\tthis.animateInComment(commentElement);\r\n\t\t\t\t\t}, 50);\r\n\t\t\t\t\tthis.dom.commentInput.value = \"\";\r\n\t\t\t\t\tgetComments(this.articleId);\r\n\t\t\t\t} else {\r\n\t\t\t\t\talert(\"Submit error - please try again\");\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\talert(this.texts.inputEmpty);\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t\t * Post reply and animate in\r\n\t\t *\r\n\t\t * @memberof Comments\r\n\t\t */\r\n\tsubmitReply = e => {\r\n\t\tconst id = e.target.id;\r\n\t\tconst textarea = this.dom.container.querySelector(`.reply-${id}`);\r\n\t\tconst parentCommentId = textarea.id;\r\n\r\n\t\tif (textarea.value !== \"\") {\r\n\t\t\te.target.disabled = true;\r\n\t\t\tconst parent = e.target.parentNode.parentNode;\r\n\t\t\tconst replyContainer = parent.querySelector(\r\n\t\t\t\t\".comments-dialog_reply-list\"\r\n\t\t\t);\r\n\t\t\tpostComment({\r\n\t\t\t\tText: textarea.value,\r\n\t\t\t\tArticleId: this.articleId,\r\n\t\t\t\tReplyToComment: parentCommentId\r\n\t\t\t}).then(result => {\r\n\t\t\t\tconst { success, data } = result;\r\n\t\t\t\te.target.disabled = false;\r\n\t\t\t\ttextarea.style.height = \"62px\";\r\n\t\t\t\tif (success) {\r\n\t\t\t\t\tconst commentElement = this.createComment({\r\n\t\t\t\t\t\tid: data.id,\r\n\t\t\t\t\t\tauthor: data.name,\r\n\t\t\t\t\t\temail: data.email,\r\n\t\t\t\t\t\tcomment: textarea.value,\r\n\t\t\t\t\t\ttimestamp: data.createdDate,\r\n\t\t\t\t\t\tisDeleted: data.isDeleted,\r\n\t\t\t\t\t\tshowDelete: data.showDelete,\r\n\t\t\t\t\t\tisReply: true\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\tthis.incrementCount();\r\n\t\t\t\t\tprependElement(commentElement, replyContainer);\r\n\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\tthis.animateInComment(commentElement);\r\n\t\t\t\t\t}, 50);\r\n\t\t\t\t\ttextarea.value = \"\";\r\n\t\t\t\t\tthis.hideReplyInput(e);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\talert(this.texts.inputEmpty);\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t\t * Hide reply comment input field\r\n\t\t *\r\n\t\t * @memberof Comments\r\n\t\t */\r\n\thideReplyInput = (e) => {\r\n\t\t// Find the button element containing the SVG, in case the click is on a child element\r\n\t\tconst targetButton = e.target.closest(\".cancel\");\r\n\r\n\t\tif (!targetButton) return; // Exit if the click wasn't on a relevant button\r\n\r\n\t\tconst id = targetButton.id;\r\n\t\tconst inputToHide = this.dom.container.querySelector(`.reply-input-${id}`);\r\n\r\n\t\t// Animate and hide the input field\r\n\t\tthis.animateOutComment(inputToHide);\r\n\t\tsetTimeout(() => {\r\n\t\t\tinputToHide.style.display = \"none\";\r\n\t\t}, 100);\r\n\r\n\t\t// Hide the cancel button\r\n\t\tconst cancelButtonElement = this.dom.container.querySelector(`.cancel-reply-comment-${id}`);\r\n\t\tcancelButtonElement.style.opacity = \"0%\";\r\n\t};\r\n\r\n\t/**\r\n\t\t * Show reply comment input field\r\n\t\t *\r\n\t\t * @memberof Comments\r\n\t\t */\r\n\tshowReplyInput = (e) => {\r\n\t\t// Find the closest button element containing the SVG, in case the click is on a child element\r\n\t\tconst targetButton = e.target.closest(\".reply\");\r\n\t\tif (!targetButton) return;\r\n\r\n\t\tconst id = targetButton.id;\r\n\t\tconst cancelButtonElement = this.dom.container.querySelector(\r\n `.cancel-reply-comment-${id}`\r\n\t\t);\r\n\t\tcancelButtonElement.style.opacity = \"1\";\r\n\r\n\t\tconst inputToShow = this.dom.container.querySelector(\r\n `.reply-input-${id}`\r\n\t\t);\r\n\t\tif (inputToShow.style.display !== \"block\") {\r\n\t\t\tinputToShow.style.display = \"flex\";\r\n\t\t\tthis.animateInComment(inputToShow);\r\n\t\t\tinputToShow.querySelector(\"textarea\").focus();\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t\t * Remove comment from dom and db\r\n\t\t *\r\n\t\t * @memberof Comments\r\n\t\t */\r\n\tremoveComment = e => {\r\n\t\tconst target = e.target.closest(\".delete-comment\");\r\n\t\tif (!target) return;\r\n\r\n\t\tconst id = target.id;\r\n\t\tconst elementToRemove = this.dom.container.querySelector(\r\n\t\t\t`.comment-${id}`\r\n\t\t);\r\n\r\n\t\telementToRemove.style.zIndex = 2;\r\n\t\tconst elementToRemoveParent = elementToRemove.parentNode;\r\n\r\n\t\tconst deleteConfirm = new Snackbar({\r\n\t\t\telement: target,\r\n\t\t\ttext: this.texts.deleteConfirmText,\r\n\t\t\tautoClose: false,\r\n\t\t\tconfirm: true,\r\n\t\t\tcancelLabel: this.texts.cancelLabel,\r\n\t\t\tconfirmLabel: this.texts.confirmLabel,\r\n\t\t\tposition: isRtl ? \"left\" : \"right\",\r\n\t\t\tonCancel: () => {\r\n\t\t\t\tdeleteConfirm.close();\r\n\t\t\t\telementToRemove.style.zIndex = 1;\r\n\t\t\t},\r\n\t\t\tonConfirm: () => {\r\n\t\t\t\tdeleteComment(id).then(({ success }) => {\r\n\t\t\t\t\tif (success) {\r\n\t\t\t\t\t\tdeleteConfirm.close().finished.then(() => {\r\n\t\t\t\t\t\t\tconst isReply =\r\n\t\t\t\t\t\t\t\ttarget.classList.contains(\"isReply\");\r\n\t\t\t\t\t\t\tconst replyListElement =\r\n\t\t\t\t\t\t\t\telementToRemoveParent.querySelector(\r\n\t\t\t\t\t\t\t\t\t\".comments-dialog_reply-list\"\r\n\t\t\t\t\t\t\t\t);\r\n\r\n\t\t\t\t\t\t\tconst isCommentAndHasReplies =\r\n\t\t\t\t\t\t\t\t!isReply &&\r\n\t\t\t\t\t\t\t\treplyListElement &&\r\n\t\t\t\t\t\t\t\treplyListElement.children.length > 0;\r\n\r\n\t\t\t\t\t\t\tconst isCommentWithoutReplies =\r\n\t\t\t\t\t\t\t\t!isReply &&\r\n\t\t\t\t\t\t\t\treplyListElement &&\r\n\t\t\t\t\t\t\t\treplyListElement.children.length === 0;\r\n\r\n\t\t\t\t\t\t\tconst replyContainer =\r\n\t\t\t\t\t\t\t\telementToRemoveParent.querySelector(\r\n\t\t\t\t\t\t\t\t\t\".comments-dialog__reply\"\r\n\t\t\t\t\t\t\t\t);\r\n\r\n\t\t\t\t\t\t\tlet targets;\r\n\r\n\t\t\t\t\t\t\tif (isReply || isCommentAndHasReplies) {\r\n\t\t\t\t\t\t\t\ttargets = elementToRemove;\r\n\t\t\t\t\t\t\t} else if (isCommentWithoutReplies) {\r\n\t\t\t\t\t\t\t\ttargets = [elementToRemove, replyContainer];\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tthis.decrementCount();\r\n\r\n\t\t\t\t\t\t\t// animate out element - also replycontainer if doesnt have any replies\r\n\t\t\t\t\t\t\tanime({\r\n\t\t\t\t\t\t\t\ttargets,\r\n\t\t\t\t\t\t\t\teasing: STANDARDCUBICBEZIER,\r\n\t\t\t\t\t\t\t\tduration: LIFE,\r\n\t\t\t\t\t\t\t\topacity: [1, 0],\r\n\t\t\t\t\t\t\t\tcomplete: () => {\r\n\t\t\t\t\t\t\t\t\tif (isCommentWithoutReplies) {\r\n\t\t\t\t\t\t\t\t\t\tconst textarea =\r\n\t\t\t\t\t\t\t\t\t\t\treplyContainer.querySelector(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\"textarea\"\r\n\t\t\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\t\t\tconst replyButton =\r\n\t\t\t\t\t\t\t\t\t\t\treplyContainer.querySelector(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\"button\"\r\n\t\t\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\t\t\tautosize.destroy(textarea);\r\n\t\t\t\t\t\t\t\t\t\tremoveAllEvents(replyButton);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tremoveAllEvents(e.target);\r\n\t\t\t\t\t\t\t\t\tanime.remove(targets);\r\n\r\n\t\t\t\t\t\t\t\t\tif (isCommentWithoutReplies) {\r\n\t\t\t\t\t\t\t\t\t\tdeleteElement(replyContainer);\r\n\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t// Animate in new deletedComment\r\n\t\t\t\t\t\t\t\t\tconst deletedCommentElement =\r\n\t\t\t\t\t\t\t\t\t\tthis.createComment({\r\n\t\t\t\t\t\t\t\t\t\t\tid: \"null\",\r\n\t\t\t\t\t\t\t\t\t\t\tcomment: this.texts.deletedText,\r\n\t\t\t\t\t\t\t\t\t\t\tisDeleted: true,\r\n\t\t\t\t\t\t\t\t\t\t\tshowDelete: false\r\n\t\t\t\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\t\t\tdeletedCommentElement.style.opacity = 0;\r\n\t\t\t\t\t\t\t\t\tinsertElementAfter(\r\n\t\t\t\t\t\t\t\t\t\tdeletedCommentElement,\r\n\t\t\t\t\t\t\t\t\t\telementToRemove\r\n\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\t\tdeleteElement(elementToRemove);\r\n\t\t\t\t\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\t\t\t\t\tthis.animateInComment(\r\n\t\t\t\t\t\t\t\t\t\t\tdeletedCommentElement\r\n\t\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\t\t}, 50);\r\n\r\n\t\t\t\t\t\t\t\t\t//if the deleted element is a reply animate out the deleted text and remove it from the dom\r\n\t\t\t\t\t\t\t\t\tif (\r\n\t\t\t\t\t\t\t\t\t\tdeletedCommentElement.parentNode.classList.contains(\r\n\t\t\t\t\t\t\t\t\t\t\t\"comments-dialog_reply-list\"\r\n\t\t\t\t\t\t\t\t\t\t)\r\n\t\t\t\t\t\t\t\t\t) {\r\n\t\t\t\t\t\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\t\t\t\t\t\tthis.animateOutComment(\r\n\t\t\t\t\t\t\t\t\t\t\t\tdeletedCommentElement\r\n\t\t\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\t\t\t}, 5000);\r\n\t\t\t\t\t\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\t\t\t\t\t\tdeletedCommentElement.style.display =\r\n\t\t\t\t\t\t\t\t\t\t\t\t\"none\";\r\n\t\t\t\t\t\t\t\t\t\t}, 6000);\r\n\t\t\t\t\t\t\t\t\t} else if (\r\n\t\t\t\t\t\t\t\t\t\tdeletedCommentElement.parentNode.querySelectorAll(\r\n\t\t\t\t\t\t\t\t\t\t\t\".isReply\"\r\n\t\t\t\t\t\t\t\t\t\t).length === 0\r\n\t\t\t\t\t\t\t\t\t) {\r\n\t\t\t\t\t\t\t\t\t\t//else if the deleted element is a comment and it has no replies animate out the deleted text\r\n\t\t\t\t\t\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\t\t\t\t\t\tthis.animateOutComment(\r\n\t\t\t\t\t\t\t\t\t\t\t\tdeletedCommentElement\r\n\t\t\t\t\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t\t\t\t}, 5000);\r\n\t\t\t\t\t\t\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\t\t\t\t\t\t\t//and remove the parent element from the dom\r\n\t\t\t\t\t\t\t\t\t\t\tdeletedCommentElement.parentNode.style.display =\r\n\t\t\t\t\t\t\t\t\t\t\t\t\"none\";\r\n\t\t\t\t\t\t\t\t\t\t}, 6000);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t// recieve comments and display in the social bar\r\n\t\t\t\t\t\tgetComments(this.articleId);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\talert(\"delete error\");\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t});\r\n\t};\r\n\r\n\tloadMore = () => {\r\n\t\tif (\r\n\t\t\tthis.loadedCommentsAmount < this.totalComments ||\r\n\t\t\tthis.loadedCommentsAmount + 1 === this.totalComments\r\n\t\t) {\r\n\t\t\t// Disable button while getting more comments\r\n\t\t\tthis.dom.loadMoreButton.disabled = true;\r\n\t\t\tthis.currentCommentCountIndex =\r\n\t\t\t\tthis.currentCommentCountIndex + this.loadMoreCommentsAmount;\r\n\t\t\tgetComments(\r\n\t\t\t\tthis.articleId,\r\n\t\t\t\tthis.loadMoreCommentsAmount,\r\n\t\t\t\tthis.currentCommentCountIndex\r\n\t\t\t).then(result => {\r\n\t\t\t\tconst { data, success } = result;\r\n\t\t\t\tthis.loadedCommentsAmount =\r\n\t\t\t\t\tthis.currentCommentCountIndex + this.loadMoreCommentsAmount;\r\n\r\n\t\t\t\tif (success) {\r\n\t\t\t\t\tthis.addComments(data.results);\r\n\r\n\t\t\t\t\t// If no more comments remove listeners and remove from DOM\r\n\t\t\t\t\tif (this.loadedCommentsAmount >= this.totalComments) {\r\n\t\t\t\t\t\tremoveAllEvents(this.dom.loadMoreButton);\r\n\t\t\t\t\t\tthis.dom.loadMoreButton.style.display = \"none\";\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.dom.loadMoreButton.disabled = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t};\r\n\r\n\t/**\r\n\t\t * Animate in/out comments dialog\r\n\t\t *\r\n\t\t * @param {boolean} [close=false]\r\n\t\t * @returns\r\n\t\t * @memberof Comments\r\n\t\t */\r\n\ttoggleCommentsDialogAnimation(close = false) {\r\n\t\tanime.remove(this.dom.commentDialog);\r\n\t\tthis.dom.commentSection.scrollTop = 0;\r\n\r\n\t\tif (this.totalComments !== 0) {\r\n\t\t\tanime.remove(\r\n\t\t\t\tthis.dom.container.querySelector(\r\n\t\t\t\t\t\".comments-dialog__comments-list\"\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tif (!close) {\r\n\t\t\tthis.dom.container.style.pointerEvents = \"auto\";\r\n\t\t}\r\n\r\n\t\tconst timeline = anime\r\n\t\t\t.timeline({\r\n\t\t\t\teasing: STANDARDCUBICBEZIER,\r\n\t\t\t\tcomplete: () => {\r\n\t\t\t\t\tif (!close) {\r\n\t\t\t\t\t\tif (this.dom.firstReplyInput && this.showSnackMessage) {\r\n\t\t\t\t\t\t\tthis.snackbarInstance = new Snackbar({\r\n\t\t\t\t\t\t\t\telement: this.dom.firstReplyInput,\r\n\t\t\t\t\t\t\t\ttext: this.snackMessage,\r\n\t\t\t\t\t\t\t\tautoClose: true,\r\n\t\t\t\t\t\t\t\tonClose: () => {\r\n\t\t\t\t\t\t\t\t\tthis.snackbarInstance = undefined;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\tthis.replyMessageShown = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.dom.container.style.display = \"none\";\r\n\t\t\t\t\t\tthis.dom.container.style.pointerEvents = \"auto\";\r\n\t\t\t\t\t\tthis.onClose();\r\n\t\t\t\t\t}\r\n\t\t\t\t},\r\n\t\t\t\tbegin: () => {\r\n\t\t\t\t\tif (this.snackbarInstance) {\r\n\t\t\t\t\t\tthis.snackbarInstance.close();\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (!close) {\r\n\t\t\t\t\t\tthis.dom.container.style.display = \"block\";\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.dom.container.style.pointerEvents = \"none\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t\t.add({\r\n\t\t\t\ttargets: this.dom.container,\r\n\t\t\t\topacity: [0, 1],\r\n\t\t\t\ttranslateY: !close ? [\"20%\", \"0%\"] : [\"0%\", \"20%\"],\r\n\t\t\t\tduration: LIFE\r\n\t\t\t});\r\n\r\n\t\tif (!close && this.totalComments !== 0) {\r\n\t\t\tconst targets = this.dom.commentDialogSection.children[1]\r\n\t\t\t\t? [\r\n\t\t\t\t\tthis.dom.commentDialogSection.children[0].children,\r\n\t\t\t\t\tthis.dom.commentDialogSection.children[1].children\r\n\t\t\t\t]\r\n\t\t\t\t: this.dom.commentDialogSection.children[0].children;\r\n\r\n\t\t\ttimeline.add({\r\n\t\t\t\ttargets,\r\n\t\t\t\topacity: [0, 1],\r\n\t\t\t\ttranslateY: [20, 0],\r\n\t\t\t\tduration: LIFE,\r\n\t\t\t\tdelay: anime.stagger(100)\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\treturn timeline;\r\n\t}\r\n\r\n\taddComments(data, animateIn = true) {\r\n\t\tconst comments = [];\r\n\r\n\t\tforEach(data, comment => {\r\n\t\t\tconst { name, email, createdDate, text } = comment;\r\n\t\t\tcomments.push(\r\n\t\t\t\tthis.createCommentContainer({\r\n\t\t\t\t\t...comment,\r\n\t\t\t\t\tauthor: name,\r\n\t\t\t\t\temail: email,\r\n\t\t\t\t\ttimestamp: createdDate,\r\n\t\t\t\t\tcomment: text\r\n\t\t\t\t})\r\n\t\t\t);\r\n\t\t});\r\n\r\n\t\tappendElement(comments, this.commentList);\r\n\r\n\t\tif (animateIn) {\r\n\t\t\tsetTimeout(() => {\r\n\t\t\t\tthis.animateInComment(comments, true);\r\n\t\t\t}, 50);\r\n\t\t}\r\n\t}\r\n\r\n\tincrementCount() {\r\n\t\tconst count = parseInt(this.dom.commentsCount.textContent);\r\n\t\tconst newCount = count + 1;\r\n\t\tthis.dom.commentsCount.textContent = newCount;\r\n\t\tif (newCount > 0) {\r\n\t\t\tthis.dom.commentsButton.classList.add(\"hasComments\");\r\n\t\t}\r\n\t}\r\n\r\n\tdecrementCount() {\r\n\t\tconst count = parseInt(this.dom.commentsCount.textContent);\r\n\t\tconst newCount = count - 1;\r\n\t\tthis.dom.commentsCount.textContent = newCount;\r\n\t\tif (newCount === 0) {\r\n\t\t\tthis.dom.commentsButton.classList.remove(\"hasComments\");\r\n\t\t}\r\n\t}\r\n\r\n\tinitialize() {\r\n\t\tthis.dom.commentInput =\r\n\t\t\tthis.dom.container.querySelector(\".comment-input\");\r\n\t\tthis.dom.submitCommentButton =\r\n\t\t\tthis.dom.container.querySelector(\".submit-comment\");\r\n\t\tthis.dom.loadMoreButton = this.dom.container.querySelector(\r\n\t\t\t\".load-more-comments\"\r\n\t\t);\r\n\t\tthis.dom.commentSection = this.dom.container.querySelector(\r\n\t\t\t\".comments-dialog__section\"\r\n\t\t);\r\n\t\tthis.commentList = this.dom.container.querySelector(\r\n\t\t\t\".comments-dialog__comments-list\"\r\n\t\t);\r\n\r\n\t\tthis.dom.commentsCount = document.querySelector(\r\n\t\t\t\".comment-dialog-button__count\"\r\n\t\t);\r\n\r\n\t\tthis.dom.commentsButton = document.querySelector(\r\n\t\t\t\".comment-dialog-button\"\r\n\t\t);\r\n\r\n\t\taddEvent(this.dom.submitCommentButton, \"click\", this.submitComment);\r\n\t\tautosize(this.dom.commentInput);\r\n\r\n\t\tgetComments(\r\n\t\t\tthis.articleId,\r\n\t\t\tthis.loadedCommentsAmount,\r\n\t\t\tthis.currentCommentCountIndex\r\n\t\t).then(result => {\r\n\t\t\tconst { data, success } = result;\r\n\t\t\tthis.totalComments = data.totalNumber;\r\n\r\n\t\t\tif (this.loadedCommentsAmount >= this.totalComments) {\r\n\t\t\t\tthis.dom.loadMoreButton.style.display = \"none\";\r\n\t\t\t\tthis.dom.loadMoreButton.disabled = true;\r\n\t\t\t} else if (this.loadedCommentsAmount < this.totalComments) {\r\n\t\t\t\tthis.dom.loadMoreButton.style.display = \"block\";\r\n\t\t\t\tthis.dom.loadMoreButton.disabled = false;\r\n\t\t\t\taddEvent(this.dom.loadMoreButton, \"click\", this.loadMore);\r\n\t\t\t}\r\n\r\n\t\t\tif (success) {\r\n\t\t\t\tconst comments = data.results;\r\n\t\t\t\tthis.totalComments = data.totalNumber;\r\n\t\t\t\tthis.addComments(comments, false);\r\n\r\n\t\t\t\tsetTimeout(() => {\r\n\t\t\t\t\tthis.dom.commentDialogSection =\r\n\t\t\t\t\t\tthis.dom.container.querySelector(\r\n\t\t\t\t\t\t\t\".comments-dialog__section\"\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\tthis.dom.firstReplyInput = this.dom.container.querySelector(\r\n\t\t\t\t\t\t\".comments-dialog__reply textarea\"\r\n\t\t\t\t\t);\r\n\r\n\t\t\t\t\tthis.toggleCommentsDialogAnimation();\r\n\t\t\t\t}, 50);\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n}","import { type Module } from \"~/foundation/Bootstrapper/types\";\r\nimport { useDialog } from \"~/foundation/Components/dialog/useDialog\";\r\nimport { articleLikeService } from \"../services/articleLikeService\";\r\nimport { Comments } from \"./comments/comments\";\r\n\r\nconst activeClasses = {\r\n\tcomments: \"comments-active\",\r\n\tshare: \"share-active\",\r\n\tliked: \"filled\",\r\n\thasCount: \"hasCount\"\r\n};\r\n\r\nconst actionBar: Module = (container: HTMLElement) => {\r\n\tconst dialog = useDialog();\r\n\tconst articleId = container.getAttribute(\"data-article-id\");\r\n\tconst commentsButton = container.querySelector<HTMLButtonElement>(\".comment-dialog-button\");\r\n\tconst commentsDialog = container.querySelector(\"#comments-dialog\");\r\n\tconst commentsDialogHTML = commentsDialog?.innerHTML;\r\n\tconst likeElements = container.querySelectorAll<HTMLElement>(\".like\");\r\n\tconst likeButton = container.querySelector<HTMLButtonElement>(\".like-button\");\r\n\tconst socialBarWrapper = container.querySelector<HTMLElement>(\".social-bar\");\r\n\r\n\t// Like or comment actions\r\n\tconst handleMenuToggle = async (action: \"like\" | \"comments\") => {\r\n\t\tif (action === \"like\") {\r\n\t\t\tawait executeLike();\r\n\t\t} else if (action === \"comments\") {\r\n\t\t\tawait executeComments();\r\n\t\t}\r\n\t};\r\n\r\n\t//Like action\r\n\tconst executeLike = async () => {\r\n\t\tif (!likeButton || !(likeButton)) return;\r\n\t\tconst isLiked = likeButton.classList.contains(activeClasses.liked);\r\n\t\tconst service = isLiked ? articleLikeService.likeRemoveForArticle : articleLikeService.likeSaveForArticle;\r\n\r\n\t\tif (articleId) {\r\n\t\t\ttry {\r\n\t\t\t\tconst response = await service({ articleId });\r\n\t\t\t\tif (response.success) {\r\n\r\n\t\t\t\t\tif (isLiked) {\r\n\t\t\t\t\t\tlikeButton.classList.remove(activeClasses.liked);\r\n\t\t\t\t\t\t// loop to ensure both open and closed menu icons update\r\n\t\t\t\t\t\tlikeElements.forEach((likeDiv) => {\r\n\t\t\t\t\t\t\tif (likeDiv) {\r\n\t\t\t\t\t\t\t\tlikeDiv.classList.remove(activeClasses.liked);\r\n\t\t\t\t\t\t\t\tconst likeCount = likeDiv.querySelector<HTMLElement>(\".like__count\");\r\n\t\t\t\t\t\t\t\tif (likeCount) {\r\n\t\t\t\t\t\t\t\t\tlikeCount.classList.remove(activeClasses.liked);\r\n\t\t\t\t\t\t\t\t\tlikeCount.textContent = (parseInt(likeCount.textContent || \"0\", 10) - 1).toString();\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (likeCount?.textContent === \"0\") {\r\n\t\t\t\t\t\t\t\t\tlikeCount.classList.remove(activeClasses.hasCount);\r\n\t\t\t\t\t\t\t\t\tlikeDiv.classList.remove(activeClasses.hasCount);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tlikeButton.classList.add(activeClasses.liked);\r\n\t\t\t\t\t\tlikeElements.forEach((likeDiv) => {\r\n\t\t\t\t\t\t\tif (likeDiv) {\r\n\t\t\t\t\t\t\t\tlikeDiv.classList.add(activeClasses.liked);\r\n\t\t\t\t\t\t\t\tconst likeCount = likeDiv.querySelector<HTMLElement>(\".like__count\");\r\n\t\t\t\t\t\t\t\tif (likeCount) {\r\n\t\t\t\t\t\t\t\t\tlikeCount.classList.add(activeClasses.liked);\r\n\t\t\t\t\t\t\t\t\tlikeCount.textContent = (parseInt(likeCount.textContent || \"0\", 10) + 1).toString();\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (likeCount?.textContent === \"1\") {\r\n\t\t\t\t\t\t\t\t\tlikeCount.classList.add(activeClasses.hasCount);\r\n\t\t\t\t\t\t\t\t\tlikeDiv.classList.add(activeClasses.hasCount);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t} catch (error) {\r\n\t\t\t\tconsole.error(\"Error updating like status:\", error);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tconsole.error(\"Article ID not found.\");\r\n\t\t}\r\n\t};\r\n\r\n\t//Comments action\r\n\tconst executeComments = async () => {\r\n\t\tawait dialog.open(commentsDialogHTML, undefined, socialBarWrapper);\r\n\r\n\t\tvoid new Comments({\r\n\t\t\tdomReference: dialog?.element?.querySelector(\".comments-dialog\"),\r\n\t\t\tarticleId: articleId,\r\n\t\t\tshowSnackMessage: true,\r\n\t\t\tsnackMessage: \"Please use a friendly tone\",\r\n\t\t\tonClose: () => {\r\n\t\t\t\tcontainer.classList.remove(activeClasses.comments);\r\n\t\t\t}\r\n\t\t});\r\n\t};\r\n\r\n\t// Attach event listeners for like and comments buttons\r\n\tif (likeButton) {\r\n\t\tlikeButton.addEventListener(\"click\", async (e) => {\r\n\t\t\te.preventDefault();\r\n\t\t\tawait handleMenuToggle(\"like\");\r\n\t\t});\r\n\t}\r\n\r\n\tif (commentsButton) {\r\n\t\tcommentsButton.addEventListener(\"click\", async () => {\r\n\t\t\tawait handleMenuToggle(\"comments\");\r\n\t\t});\r\n\t}\r\n};\r\n\r\nexport default actionBar;\r\n"],"names":["articleLikeServiceMeta","articleLikeService","queryStrings","http","body","global","factory","module","exports","this","map","keys","values","key","value","index","createEvent","name","evt","assign","ta","heightOffset","clientWidth","cachedHeight","init","style","update","changeOverflow","width","getParentOverflows","el","arr","resize","overflows","docTop","styleHeight","computed","actualHeight","pageResize","destroy","methods","autosize","options","x","EN_US","en_US","diff","idx","unit","ZH_CN","zh_CN","Locales","register","locale","func","getLocale","SEC_ARRAY","toDate","input","formatDiff","localeFunc","agoIn","totalSec","diffSec","date","relativeDate","relDate","format","opts","sec","timeTypes","formatTime","type","n","ar","number","timeStr","API_VERSION","COMMENTS_SAVE","postComment","commentConfig","fetcher","isRtl","getComments","articleId","listLength","listCommentsUrl","deleteComment","commentId","deleteCommentUrl","Comments","config","__publicField","e","toggleClass","result","success","data","commentElement","prependElement","id","textarea","parentCommentId","replyContainer","targetButton","inputToHide","cancelButtonElement","inputToShow","target","elementToRemove","elementToRemoveParent","deleteConfirm","Snackbar","isReply","replyListElement","isCommentAndHasReplies","isCommentWithoutReplies","targets","anime","STANDARDCUBICBEZIER","LIFE","replyButton","removeAllEvents","deleteElement","deletedCommentElement","insertElementAfter","domReference","onClose","showSnackMessage","snackMessage","buttons","forEach","button","textareas","commentItems","element","shouldStagger","commentData","timestamp","author","email","comment","showDelete","isDeleted","timeAgo","html","createElement","buttonContainer","actionButtonsContainer","replyButtonElement","deleteButtonElement","addEvent","authorElement","commentContainerData","replies","repliesElements","hasReplies","reply","createdDate","text","replyElement","replyList","replyContainerConfig","replyTextarea","labelElement","replySubmitButton","replyInput","close","timeline","animateIn","comments","appendElement","newCount","activeClasses","actionBar","container","dialog","useDialog","commentsButton","commentsDialog","commentsDialogHTML","likeElements","likeButton","socialBarWrapper","handleMenuToggle","action","executeLike","executeComments","isLiked","service","likeDiv","likeCount","error","_a"],"mappings":"wUAcO,MAAMA,EAA0D,CACtE,oBAAqB,CAAC,MAAO,4BAA4B,EACzD,mBAAoB,CAAC,OAAQ,2BAA2B,EACxD,qBAAsB,CAAC,OAAQ,6BAA6B,CAC7D,EAGaC,EAAqB,CACjC,MAAM,oBAAoBC,EAAmC,CAC5D,OAAO,MAAMC,EAAK,MAA4BH,EAAuB,oBAAqB,CAAE,aA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