').append(range.cloneContents());\n\n // Replace emoji images with their shortcode (found in alt attribute)\n clone.find('img.emoji').replaceWith(function () {\n return this.alt;\n });\n\n // Replace all other images with a Markdown image\n clone.find('img').replaceWith(function () {\n return \"![](\".concat(this.src, \")\");\n });\n\n // Replace all links with a Markdown link\n clone.find('a').replaceWith(function () {\n return \"[\".concat(this.innerText, \"](\").concat(this.href, \")\");\n });\n return clone.text();\n }\n }\n return '';\n}\nflarum.reg.add('flarum-mentions', 'forum/utils/selectedText', selectedText);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/TextEditorButton');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/KeyboardNavigatable');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/AutocompleteReader');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/throttleDebounce');","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}","import _typeof from \"./typeof.js\";\nexport default function _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport Fragment from 'flarum/common/Fragment';\nexport default class AutocompleteDropdown extends Fragment {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"items\", []);\n _defineProperty(this, \"active\", false);\n _defineProperty(this, \"index\", 0);\n _defineProperty(this, \"keyWasJustPressed\", false);\n }\n view() {\n return m(\"ul\", {\n className: \"Dropdown-menu MentionsDropdown\"\n }, this.items.map(item => m(\"li\", null, item)));\n }\n show(left, top) {\n this.$().show().css({\n left: left + 'px',\n top: top + 'px'\n });\n this.active = true;\n }\n hide() {\n this.$().hide();\n this.active = false;\n }\n navigate(delta) {\n this.keyWasJustPressed = true;\n this.setIndex(this.index + delta, true);\n clearTimeout(this.keyWasJustPressedTimeout);\n this.keyWasJustPressedTimeout = setTimeout(() => this.keyWasJustPressed = false, 500);\n }\n complete() {\n this.$('li').eq(this.index).find('button').click();\n }\n setIndex(index, scrollToItem) {\n if (this.keyWasJustPressed && !scrollToItem) return;\n const $dropdown = this.$();\n const $items = $dropdown.find('li');\n let rangedIndex = index;\n if (rangedIndex < 0) {\n rangedIndex = $items.length - 1;\n } else if (rangedIndex >= $items.length) {\n rangedIndex = 0;\n }\n this.index = rangedIndex;\n const $item = $items.removeClass('active').eq(rangedIndex).addClass('active');\n if (scrollToItem) {\n const dropdownScroll = $dropdown.scrollTop();\n const dropdownTop = $dropdown.offset().top;\n const dropdownBottom = dropdownTop + $dropdown.outerHeight();\n const itemTop = $item.offset().top;\n const itemBottom = itemTop + $item.outerHeight();\n let scrollTop;\n if (itemTop < dropdownTop) {\n scrollTop = dropdownScroll - dropdownTop + itemTop - parseInt($dropdown.css('padding-top'), 10);\n } else if (itemBottom > dropdownBottom) {\n scrollTop = dropdownScroll - dropdownBottom + itemBottom + parseInt($dropdown.css('padding-bottom'), 10);\n }\n if (typeof scrollTop !== 'undefined') {\n $dropdown.stop(true).animate({\n scrollTop\n }, 100);\n }\n }\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/fragments/AutocompleteDropdown', AutocompleteDropdown);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/Component');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/classList');","import Component from 'flarum/common/Component';\nimport classList from 'flarum/common/utils/classList';\nexport default class MentionsDropdownItem extends Component {\n view(vnode) {\n const {\n mentionable,\n ...attrs\n } = this.attrs;\n const className = classList('MentionsDropdownItem', 'PostPreview', \"MentionsDropdown-\".concat(mentionable.type()));\n return m(\"button\", Object.assign({\n className: className\n }, attrs), m(\"span\", {\n className: \"PostPreview-content\"\n }, vnode.children));\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/components/MentionsDropdownItem', MentionsDropdownItem);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport MentionsDropdownItem from '../components/MentionsDropdownItem';\nexport default class MentionableModels {\n constructor(dropdownItemAttrs) {\n _defineProperty(this, \"mentionables\", void 0);\n /**\n * We store models returned from an API here to preserve order in which they are returned\n * This prevents the list jumping around while models are returned.\n * We also use a hashmap for model IDs to provide O(1) lookup for the users already in the list.\n */\n _defineProperty(this, \"results\", {});\n _defineProperty(this, \"typed\", null);\n _defineProperty(this, \"searched\", []);\n _defineProperty(this, \"dropdownItemAttrs\", {});\n /**\n * Don't send API calls searching for models until at least 2 characters have been typed.\n * This focuses the mention results on models already loaded.\n */\n _defineProperty(this, \"search\", async () => {\n if (!this.typed || this.typed.length <= 1) return;\n const typedLower = this.typed.toLowerCase();\n if (this.searched.includes(typedLower)) return;\n for (const mentionable of this.mentionables) {\n for (const model of await mentionable.search(typedLower)) {\n if (!this.results[mentionable.type()].has(model.id())) {\n this.results[mentionable.type()].set(model.id(), model);\n }\n }\n }\n this.searched.push(typedLower);\n return Promise.resolve();\n });\n this.dropdownItemAttrs = dropdownItemAttrs;\n }\n init(mentionables) {\n this.typed = null;\n this.mentionables = mentionables;\n for (const mentionable of this.mentionables) {\n this.results[mentionable.type()] = new Map(mentionable.initialResults().map(result => [result.id(), result]));\n }\n }\n matches(mentionable, model) {\n var _this$typed;\n return mentionable.matches(model, ((_this$typed = this.typed) == null ? void 0 : _this$typed.toLowerCase()) || '');\n }\n makeSuggestion(mentionable, model) {\n const content = mentionable.suggestion(model, this.typed);\n const replacement = mentionable.replacement(model);\n const {\n onclick,\n ...attrs\n } = this.dropdownItemAttrs;\n return m(MentionsDropdownItem, Object.assign({\n mentionable: mentionable,\n onclick: () => onclick(replacement)\n }, attrs), content);\n }\n buildSuggestions() {\n const suggestions = [];\n for (const mentionable of this.mentionables) {\n if (!mentionable.enabled()) continue;\n let matches = Array.from(this.results[mentionable.type()].values()).filter(model => this.matches(mentionable, model));\n const max = mentionable.maxStoreMatchedResults();\n if (max) matches = matches.splice(0, max);\n for (const model of matches) {\n const dropdownItem = this.makeSuggestion(mentionable, model);\n suggestions.push(dropdownItem);\n }\n }\n return suggestions;\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/mentionables/MentionableModels', MentionableModels);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nexport default class MentionFormat {\n constructor() {\n _defineProperty(this, \"instances\", void 0);\n _defineProperty(this, \"mentionables\", void 0);\n _defineProperty(this, \"extendable\", void 0);\n }\n makeMentionables() {\n var _this$instances;\n return (_this$instances = this.instances) != null ? _this$instances : this.instances = this.mentionables.map(Mentionable => new Mentionable(this));\n }\n getMentionable(type) {\n var _this$makeMentionable;\n return (_this$makeMentionable = this.makeMentionables().find(mentionable => mentionable.type() === type)) != null ? _this$makeMentionable : null;\n }\n extend(mentionable) {\n if (!this.extendable) throw new Error('This mention format does not allow extending.');\n this.mentionables.push(mentionable);\n }\n\n /**\n * Picks the term to search in the API from the typed text.\n * @example:\n * * Full text = `Hello @\"John D`\n * * Typed text = `\"John D`\n * * Query = `John D`\n */\n}\nflarum.reg.add('flarum-mentions', 'forum/mentionables/formats/MentionFormat', MentionFormat);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Avatar');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/helpers/highlight');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nexport default class MentionableModel {\n constructor(format) {\n _defineProperty(this, \"format\", void 0);\n this.format = format;\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/mentionables/MentionableModel', MentionableModel);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/extractText');","import app from 'flarum/forum/app';\nimport extractText from 'flarum/common/utils/extractText';\n\n/**\n * Whether to use the old mentions format.\n *\n * `'@username'` or `'@\"Display name\"'`\n */\nexport const shouldUseOldFormat = () => app.forum.attribute('allowUsernameMentionFormat') || false;\nconst getDeletedUserText = () => extractText(app.translator.trans('core.lib.username.deleted_text'));\n\n/**\n * Fetches a user's username or display name.\n *\n * Chooses based on the format option set in the admin settings page.\n *\n * @param user An instance of the User model to fetch the username for\n * @param useDisplayName If `true`, uses `user.displayName()`, otherwise, uses `user.username()`\n */\nexport default function getCleanDisplayName(user, useDisplayName) {\n if (useDisplayName === void 0) {\n useDisplayName = true;\n }\n if (!user) return getDeletedUserText().replace(/\"#[a-z]{0,3}[0-9]+/, '_');\n const text = (useDisplayName ? user.displayName() : user.username()) || getDeletedUserText();\n return text.replace(/\"#[a-z]{0,3}[0-9]+/, '_');\n}\nflarum.reg.add('flarum-mentions', 'forum/utils/getCleanDisplayName', getCleanDisplayName);","import app from 'flarum/forum/app';\nimport usernameHelper from 'flarum/common/helpers/username';\nimport Avatar from 'flarum/common/components/Avatar';\nimport highlight from 'flarum/common/helpers/highlight';\nimport MentionableModel from './MentionableModel';\nimport getCleanDisplayName, { shouldUseOldFormat } from '../utils/getCleanDisplayName';\nexport default class UserMention extends MentionableModel {\n type() {\n return 'user';\n }\n initialResults() {\n return Array.from(app.store.all('users'));\n }\n\n /**\n * Automatically determines which mention syntax to be used based on the option in the\n * admin dashboard. Also performs display name clean-up automatically.\n *\n * @\"Display name\"#UserID or `@username`\n *\n * @example
New display name syntax\n * // '@\"user\"#1'\n * forUser(User) // User is ID 1, display name is 'User'\n *\n * @example
Using old syntax\n * // '@username'\n * forUser(user) // User's username is 'username'\n */\n replacement(user) {\n if (shouldUseOldFormat()) {\n const cleanText = getCleanDisplayName(user, false);\n return this.format.format(cleanText);\n }\n const cleanText = getCleanDisplayName(user);\n return this.format.format(cleanText, '', user.id());\n }\n suggestion(model, typed) {\n const username = usernameHelper(model, name => highlight(name, typed));\n return m('[', null, m(Avatar, {\n user: model\n }), username);\n }\n matches(model, typed) {\n if (!typed) return false;\n const names = [model.username(), model.displayName()];\n return names.some(name => name.toLowerCase().substr(0, typed.length) === typed);\n }\n maxStoreMatchedResults() {\n return null;\n }\n async search(typed) {\n return await app.store.find('users', {\n filter: {\n q: typed\n },\n page: {\n limit: 5\n }\n });\n }\n enabled() {\n return true;\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/mentionables/UserMention', UserMention);","import app from 'flarum/forum/app';\nimport MentionableModel from './MentionableModel';\nimport usernameHelper from 'flarum/common/helpers/username';\nimport Avatar from 'flarum/common/components/Avatar';\nimport highlight from 'flarum/common/helpers/highlight';\nimport { truncate } from 'flarum/common/utils/string';\nimport getCleanDisplayName from '../utils/getCleanDisplayName';\nexport default class PostMention extends MentionableModel {\n type() {\n return 'post';\n }\n\n /**\n * If the user is replying to a discussion, or if they are editing a\n * post, then we can suggest other posts in the discussion to mention.\n * We will add the 5 most recent comments in the discussion which\n * match any username characters that have been typed.\n */\n initialResults() {\n const EditPostComposer = flarum.reg.checkModule('core', 'forum/components/EditPostComposer');\n const ReplyComposer = flarum.reg.checkModule('core', 'forum/components/ReplyComposer');\n if ((!ReplyComposer || !app.composer.bodyMatches(ReplyComposer)) && (!EditPostComposer || !app.composer.bodyMatches(EditPostComposer))) {\n return [];\n }\n\n // @ts-ignore\n const composerAttrs = app.composer.body.attrs;\n const composerPost = composerAttrs.post;\n const discussion = composerPost && composerPost.discussion() || composerAttrs.discussion;\n return discussion.posts()\n // Filter to only comment posts, and replies before this message\n .filter(post => post && post.contentType() === 'comment' && (!composerPost || post.number() < composerPost.number()))\n // Sort by new to old\n .sort((a, b) => b.createdAt().getTime() - a.createdAt().getTime());\n }\n\n /**\n * Generates the syntax for mentioning of a post. Also cleans up the display name.\n *\n * @example
Post mention\n * // '@\"User\"#p13'\n * // @\"Display name\"#pPostID\n * forPostMention(user, 13) // User display name is 'User', post ID is 13\n */\n replacement(post) {\n const user = post.user();\n const cleanText = getCleanDisplayName(user);\n return this.format.format(cleanText, 'p', post.id());\n }\n suggestion(model, typed) {\n var _model$contentPlain;\n const user = model.user() || null;\n const username = usernameHelper(user, name => highlight(name, typed));\n return m('[', null, m(Avatar, {\n user: user\n }), username, [app.translator.trans('flarum-mentions.forum.composer.reply_to_post_text', {\n number: model.number()\n }), ' — ', truncate((_model$contentPlain = model.contentPlain()) != null ? _model$contentPlain : '', 200)]);\n }\n matches(model, typed) {\n const user = model.user();\n const userMentionable = app.mentionFormats.mentionable('user');\n return !typed || user && userMentionable.matches(user, typed);\n }\n maxStoreMatchedResults() {\n return 5;\n }\n\n /**\n * Post mention suggestions are only offered from current discussion posts.\n */\n search(typed) {\n return Promise.resolve([]);\n }\n enabled() {\n return true;\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/mentionables/PostMention', PostMention);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/models/Group');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Badge');","import app from 'flarum/forum/app';\nimport Group from 'flarum/common/models/Group';\nimport MentionableModel from './MentionableModel';\nimport Badge from 'flarum/common/components/Badge';\nimport highlight from 'flarum/common/helpers/highlight';\nexport default class GroupMention extends MentionableModel {\n type() {\n return 'group';\n }\n initialResults() {\n return Array.from(app.store.all('groups').filter(g => {\n return g.id() !== Group.GUEST_ID && g.id() !== Group.MEMBER_ID;\n }));\n }\n\n /**\n * Generates the mention syntax for a group mention.\n *\n * @\"Name Plural\"#gGroupID\n *\n * @example
Group mention\n * // '@\"Mods\"#g4'\n * forGroup(group) // Group display name is 'Mods', group ID is 4\n */\n replacement(group) {\n return this.format.format(group.namePlural(), 'g', group.id());\n }\n suggestion(model, typed) {\n let groupName = model.namePlural();\n if (typed) {\n groupName = highlight(groupName, typed);\n }\n return m('[', null, m(Badge, {\n className: \"Avatar Badge Badge--group--\".concat(model.id(), \" Badge-icon\"),\n color: model.color(),\n type: \"group\",\n icon: model.icon()\n }), m(\"span\", {\n className: \"username\"\n }, groupName));\n }\n matches(model, typed) {\n if (!typed) return false;\n const names = [model.namePlural().toLowerCase(), model.nameSingular().toLowerCase()];\n return names.some(name => name.toLowerCase().substr(0, typed.length) === typed);\n }\n maxStoreMatchedResults() {\n return null;\n }\n\n /**\n * All groups are already loaded, so we don't need to search for them.\n */\n search(typed) {\n return Promise.resolve([]);\n }\n enabled() {\n var _app$session$user$can, _app$session, _app$session$user;\n return (_app$session$user$can = (_app$session = app.session) == null ? void 0 : (_app$session$user = _app$session.user) == null ? void 0 : _app$session$user.canMentionGroups()) != null ? _app$session$user$can : false;\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/mentionables/GroupMention', GroupMention);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport MentionFormat from './MentionFormat';\nimport UserMention from '../UserMention';\nimport PostMention from '../PostMention';\nimport GroupMention from '../GroupMention';\nexport default class AtMentionFormat extends MentionFormat {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"mentionables\", [UserMention, PostMention, GroupMention]);\n _defineProperty(this, \"extendable\", true);\n }\n trigger() {\n return '@';\n }\n queryFromTyped(typed) {\n const matchTyped = typed.match(/^[\"“]?((?:(?!\"#).)+)$/);\n return matchTyped ? matchTyped[1] : null;\n }\n format(name, char, id) {\n if (char === void 0) {\n char = '';\n }\n if (id === void 0) {\n id = null;\n }\n return {\n simple: \"@\".concat(name),\n safe: \"@\\\"\".concat(name, \"\\\"#\").concat(char).concat(id)\n }[id ? 'safe' : 'simple'];\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/mentionables/formats/AtMentionFormat', AtMentionFormat);","import app from 'flarum/forum/app';\nimport Badge from 'flarum/common/components/Badge';\nimport highlight from 'flarum/common/helpers/highlight';\nimport MentionableModel from './MentionableModel';\nexport default class TagMention extends MentionableModel {\n type() {\n return 'tag';\n }\n initialResults() {\n return Array.from(app.store.all('tags'));\n }\n\n /**\n * Generates the mention syntax for a tag mention.\n *\n * ~tagSlug\n *\n * @example
Tag mention\n * // ~general\n * forTag(tag) // Tag display name is 'Tag', tag ID is 5\n */\n replacement(tag) {\n return this.format.format(tag.slug());\n }\n matches(model, typed) {\n if (!typed) return false;\n const names = [model.name().toLowerCase()];\n return names.some(name => name.toLowerCase().substr(0, typed.length) === typed);\n }\n maxStoreMatchedResults() {\n return null;\n }\n async search(typed) {\n return await app.store.find('tags', {\n filter: {\n q: typed\n },\n page: {\n limit: 5\n }\n });\n }\n suggestion(model, typed) {\n let tagName = model.name();\n if (typed) {\n tagName = highlight(tagName, typed);\n }\n return m('[', null, m(Badge, {\n className: \"Avatar\",\n icon: model.icon(),\n color: model.color(),\n type: \"tag\"\n }), m(\"span\", {\n className: \"username\"\n }, tagName));\n }\n enabled() {\n return 'flarum-tags' in flarum.extensions;\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/mentionables/TagMention', TagMention);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport MentionFormat from './MentionFormat';\nimport TagMention from '../TagMention';\nexport default class HashMentionFormat extends MentionFormat {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"mentionables\", [TagMention]);\n _defineProperty(this, \"extendable\", true);\n }\n trigger() {\n return '#';\n }\n queryFromTyped(typed) {\n const matchTyped = typed.match(/^[-_\\p{L}\\p{N}\\p{M}]+$/giu);\n return matchTyped ? matchTyped[0] : null;\n }\n format(slug) {\n return \"#\".concat(slug);\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/mentionables/formats/HashMentionFormat', HashMentionFormat);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport AtMentionFormat from './AtMentionFormat';\nimport HashMentionFormat from './HashMentionFormat';\nexport default class MentionFormats {\n constructor() {\n _defineProperty(this, \"formats\", [new AtMentionFormat(), new HashMentionFormat()]);\n }\n get(symbol) {\n var _this$formats$find;\n return (_this$formats$find = this.formats.find(f => f.trigger() === symbol)) != null ? _this$formats$find : null;\n }\n mentionable(type) {\n for (const format of this.formats) {\n const mentionable = format.getMentionable(type);\n if (mentionable) return mentionable;\n }\n return null;\n }\n extend(format) {\n this.formats.push(new format());\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/mentionables/formats/MentionFormats', MentionFormats);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/UserPage');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/LinkButton');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extenders');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/models/Post');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/models/User');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/PostsUserPage');","import app from 'flarum/forum/app';\nimport PostsUserPage from 'flarum/forum/components/PostsUserPage';\n\n/**\n * The `MentionsUserPage` component shows post which user Mentioned at\n */\nexport default class MentionsUserPage extends PostsUserPage {\n /**\n * Load a new page of the user's activity feed.\n *\n * @param {Integer} [offset] The position to start getting results from.\n * @return {Promise}\n * @protected\n */\n loadResults(offset) {\n return app.store.find('posts', {\n filter: {\n type: 'comment',\n mentioned: this.user.id()\n },\n page: {\n offset,\n limit: this.loadLimit\n },\n sort: '-createdAt'\n });\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/components/MentionsUserPage', MentionsUserPage);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/Notification');","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\nimport { truncate } from 'flarum/common/utils/string';\nexport default class PostMentionedNotification extends Notification {\n icon() {\n return 'fas fa-reply';\n }\n href() {\n const notification = this.attrs.notification;\n const post = notification.subject();\n const content = notification.content();\n return app.route.discussion(post.discussion(), content && content.replyNumber);\n }\n content() {\n const notification = this.attrs.notification;\n const user = notification.fromUser();\n return app.translator.trans('flarum-mentions.forum.notifications.post_mentioned_text', {\n user,\n count: 1\n });\n }\n excerpt() {\n return truncate(this.attrs.notification.subject().contentPlain() || '', 200);\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/components/PostMentionedNotification', PostMentionedNotification);","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\nimport { truncate } from 'flarum/common/utils/string';\nexport default class UserMentionedNotification extends Notification {\n icon() {\n return 'fas fa-at';\n }\n href() {\n const post = this.attrs.notification.subject();\n return app.route.discussion(post.discussion(), post.number());\n }\n content() {\n const user = this.attrs.notification.fromUser();\n return app.translator.trans('flarum-mentions.forum.notifications.user_mentioned_text', {\n user\n });\n }\n excerpt() {\n return truncate(this.attrs.notification.subject().contentPlain(), 200);\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/components/UserMentionedNotification', UserMentionedNotification);","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\nimport { truncate } from 'flarum/common/utils/string';\nexport default class GroupMentionedNotification extends Notification {\n icon() {\n return 'fas fa-at';\n }\n href() {\n const post = this.attrs.notification.subject();\n return app.route.discussion(post.discussion(), post.number());\n }\n content() {\n const user = this.attrs.notification.fromUser();\n return app.translator.trans('flarum-mentions.forum.notifications.group_mentioned_text', {\n user\n });\n }\n excerpt() {\n return truncate(this.attrs.notification.subject().contentPlain(), 200);\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/components/GroupMentionedNotification', GroupMentionedNotification);","import Extend from 'flarum/common/extenders';\nimport Post from 'flarum/common/models/Post';\nimport User from 'flarum/common/models/User';\nimport MentionsUserPage from './components/MentionsUserPage';\nimport PostMentionedNotification from './components/PostMentionedNotification';\nimport UserMentionedNotification from './components/UserMentionedNotification';\nimport GroupMentionedNotification from './components/GroupMentionedNotification';\nexport default [new Extend.Routes() //\n.add('user.mentions', '/u/:username/mentions', MentionsUserPage), new Extend.Model(Post) //\n.hasMany('mentionedBy').attribute('mentionedByCount'), new Extend.Notification() //\n.add('postMentioned', PostMentionedNotification).add('userMentioned', UserMentionedNotification).add('groupMentioned', GroupMentionedNotification), new Extend.Model(User) //\n.attribute('canMentionGroups')];","import app from 'flarum/forum/app';\nimport username from 'flarum/common/helpers/username';\nimport extractText from 'flarum/common/utils/extractText';\nexport function filterUserMentions(tag) {\n let user;\n if (app.forum.attribute('allowUsernameMentionFormat') && tag.hasAttribute('username')) user = app.store.getBy('users', 'username', tag.getAttribute('username'));else if (tag.hasAttribute('id')) user = app.store.getById('users', tag.getAttribute('id'));\n if (user) {\n tag.setAttribute('id', user.id());\n tag.setAttribute('slug', user.slug());\n tag.setAttribute('displayname', extractText(username(user)));\n return true;\n }\n tag.invalidate();\n}\nexport function postFilterUserMentions(tag) {\n tag.setAttribute('deleted', false);\n}\nexport function filterPostMentions(tag) {\n const post = app.store.getById('posts', tag.getAttribute('id'));\n if (post) {\n tag.setAttribute('discussionid', post.discussion().id());\n tag.setAttribute('number', post.number());\n tag.setAttribute('displayname', extractText(username(post.user())));\n return true;\n }\n}\nexport function postFilterPostMentions(tag) {\n tag.setAttribute('deleted', false);\n}\nexport function filterGroupMentions(tag) {\n var _app$session, _app$session$user;\n if ((_app$session = app.session) != null && (_app$session$user = _app$session.user) != null && _app$session$user.canMentionGroups()) {\n const group = app.store.getById('groups', tag.getAttribute('id'));\n if (group) {\n tag.setAttribute('groupname', extractText(group.namePlural()));\n return true;\n }\n }\n tag.invalidate();\n}\nexport function postFilterGroupMentions(tag) {\n var _app$session2, _app$session2$user;\n if ((_app$session2 = app.session) != null && (_app$session2$user = _app$session2.user) != null && _app$session2$user.canMentionGroups()) {\n const group = app.store.getById('groups', tag.getAttribute('id'));\n tag.setAttribute('color', group.color());\n tag.setAttribute('icon', group.icon());\n tag.setAttribute('deleted', false);\n }\n}\nexport function filterTagMentions(tag) {\n if ('flarum-tags' in flarum.extensions) {\n const model = app.store.getBy('tags', 'slug', tag.getAttribute('slug'));\n if (model) {\n tag.setAttribute('id', model.id());\n tag.setAttribute('tagname', model.name());\n return true;\n }\n }\n tag.invalidate();\n}\nexport function postFilterTagMentions(tag) {\n if ('flarum-tags' in flarum.extensions) {\n const model = app.store.getBy('tags', 'slug', tag.getAttribute('slug'));\n tag.setAttribute('icon', model.icon());\n tag.setAttribute('color', model.color());\n tag.setAttribute('deleted', false);\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/utils/textFormatter', { filterUserMentions: filterUserMentions,postFilterUserMentions: postFilterUserMentions,filterPostMentions: filterPostMentions,postFilterPostMentions: postFilterPostMentions,filterGroupMentions: filterGroupMentions,postFilterGroupMentions: postFilterGroupMentions,filterTagMentions: filterTagMentions,postFilterTagMentions: postFilterTagMentions, });","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nexport default class Mentionables {\n constructor() {\n _defineProperty(this, \"formats\", []);\n _defineProperty(this, \"mentionables\", {});\n }\n /**\n * Register a new mention format.\n * Must extend MentionFormat and have a unique unused trigger symbol.\n */\n format(format) {\n this.formats.push(format);\n return this;\n }\n\n /**\n * Register a new mentionable model to a mention format.\n * Only works if the format has already been registered,\n * and the format allows using multiple mentionables.\n *\n * @param symbol The trigger symbol of the format to extend (ex: @).\n * @param mentionable The mentionable instance to register.\n * Must extend MentionableModel.\n */\n mentionable(symbol, mentionable) {\n if (!this.mentionables[symbol]) {\n this.mentionables[symbol] = [];\n }\n this.mentionables[symbol].push(mentionable);\n return this;\n }\n extend(app) {\n for (const format of this.formats) {\n app.mentionFormats.extend(format);\n }\n for (const symbol in this.mentionables) {\n const format = app.mentionFormats.get(symbol);\n if (!format) continue;\n for (const mentionable of this.mentionables[symbol]) {\n format.extend(mentionable);\n }\n }\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/extenders/Mentionables', Mentionables);","import { extend } from 'flarum/common/extend';\nimport app from 'flarum/forum/app';\nimport { getPlainContent } from 'flarum/common/utils/string';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\nimport Post from 'flarum/forum/components/Post';\nimport addPostMentionPreviews from './addPostMentionPreviews';\nimport addMentionedByList from './addMentionedByList';\nimport addPostReplyAction from './addPostReplyAction';\nimport addPostQuoteButton from './addPostQuoteButton';\nimport addComposerAutocomplete from './addComposerAutocomplete';\nimport MentionFormats from './mentionables/formats/MentionFormats';\nimport UserPage from 'flarum/forum/components/UserPage';\nimport LinkButton from 'flarum/common/components/LinkButton';\napp.mentionFormats = new MentionFormats();\nexport { default as extend } from './extend';\napp.initializers.add('flarum-mentions', function () {\n // For every mention of a post inside a post's content, set up a hover handler\n // that shows a preview of the mentioned post.\n addPostMentionPreviews();\n\n // In the footer of each post, show information about who has replied (i.e.\n // who the post has been mentioned by).\n addMentionedByList();\n\n // Add a 'reply' control to the footer of each post. When clicked, it will\n // open up the composer and add a post mention to its contents.\n addPostReplyAction();\n\n // Show a Quote button when Post text is selected\n addPostQuoteButton();\n\n // After typing '@' in the composer, show a dropdown suggesting a bunch of\n // posts or users that the user could mention.\n addComposerAutocomplete();\n\n // Add notification preferences.\n extend('flarum/forum/components/NotificationGrid', 'notificationTypes', function (items) {\n items.add('postMentioned', {\n name: 'postMentioned',\n icon: 'fas fa-reply',\n label: app.translator.trans('flarum-mentions.forum.settings.notify_post_mentioned_label')\n });\n items.add('userMentioned', {\n name: 'userMentioned',\n icon: 'fas fa-at',\n label: app.translator.trans('flarum-mentions.forum.settings.notify_user_mentioned_label')\n });\n items.add('groupMentioned', {\n name: 'groupMentioned',\n icon: 'fas fa-at',\n label: app.translator.trans('flarum-mentions.forum.settings.notify_group_mentioned_label')\n });\n });\n\n // Add mentions tab in user profile\n extend(UserPage.prototype, 'navItems', function (items) {\n const user = this.user;\n items.add('mentions', m(LinkButton, {\n href: app.route('user.mentions', {\n username: user.slug()\n }),\n name: \"mentions\",\n icon: \"fas fa-at\"\n }, app.translator.trans('flarum-mentions.forum.user.mentions_link')), 80);\n });\n\n // Remove post mentions when rendering post previews.\n getPlainContent.removeSelectors.push('a.PostMention');\n\n // Apply color contrast fix on group mentions.\n extend(Post.prototype, 'oncreate', function () {\n this.$('.GroupMention--colored, .TagMention--colored').each(function () {\n this.classList.add(textContrastClass(getComputedStyle(this).getPropertyValue('--color')));\n });\n });\n});\nexport * from './utils/textFormatter';\nimport './forum';","import { extend } from 'flarum/common/extend';\nimport CommentPost from 'flarum/forum/components/CommentPost';\nimport PostPreview from 'flarum/forum/components/PostPreview';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nexport default function addPostMentionPreviews() {\n function addPreviews() {\n const contentHtml = this.attrs.post.contentHtml();\n if (contentHtml === this.oldPostContentHtml || this.isEditing()) return;\n this.oldPostContentHtml = contentHtml;\n const parentPost = this.attrs.post;\n const $parentPost = this.$();\n this.$().on('click', '.UserMention:not(.UserMention--deleted), .PostMention:not(.PostMention--deleted), .TagMention:not(.TagMention--deleted)', function (e) {\n m.route.set(this.getAttribute('href'));\n e.preventDefault();\n });\n this.$('.PostMention:not(.PostMention--deleted)').each(function () {\n const $this = $(this);\n const id = $this.data('id');\n let timeout;\n\n // Wrap the mention link in a wrapper element so that we can insert a\n // preview popup as its sibling and relatively position it.\n const $preview = $('');\n $parentPost.append($preview);\n const getPostElement = () => {\n return $(\".PostStream-item[data-id=\\\"\".concat(id, \"\\\"]\"));\n };\n const showPreview = () => {\n // When the user hovers their mouse over the mention, look for the\n // post that it's referring to in the stream, and determine if it's\n // in the viewport. If it is, we will \"pulsate\" it.\n const $post = getPostElement();\n let visible = false;\n if ($post.length) {\n const top = $post.offset().top;\n const scrollTop = window.pageYOffset;\n if (top > scrollTop && top + $post.height() < scrollTop + $(window).height()) {\n $post.addClass('pulsate');\n visible = true;\n }\n }\n\n // Otherwise, we will show a popup preview of the post. If the post\n // hasn't yet been loaded, we will need to do that.\n if (!visible) {\n // Position the preview so that it appears above the mention.\n // (The offsetParent should be .Post-body.)\n const positionPreview = () => {\n const previewHeight = $preview.outerHeight(true);\n let offset = 0;\n\n // If the preview goes off the top of the viewport, reposition it to\n // be below the mention.\n if ($this.offset().top - previewHeight < $(window).scrollTop() + $('#header').outerHeight()) {\n offset += $this.outerHeight(true);\n } else {\n offset -= previewHeight;\n }\n $preview.show().css('top', $this.offset().top - $parentPost.offset().top + offset).css('left', $this.offsetParent().offset().left - $parentPost.offset().left).css('max-width', $this.offsetParent().width());\n };\n const showPost = post => {\n const discussion = post.discussion();\n m.render($preview[0], [discussion !== parentPost.discussion() && m(\"li\", null, m(\"span\", {\n className: \"PostMention-preview-discussion\"\n }, discussion.title())), m(\"li\", null, m(PostPreview, {\n post: post\n }))]);\n positionPreview();\n };\n const post = app.store.getById('posts', id);\n if (post && post.discussion()) {\n showPost(post);\n } else {\n m.render($preview[0], m(LoadingIndicator, null));\n app.store.find('posts', id).then(showPost);\n positionPreview();\n }\n setTimeout(() => $preview.off('transitionend').addClass('in'));\n }\n };\n const hidePreview = () => {\n getPostElement().removeClass('pulsate');\n if ($preview.hasClass('in')) {\n $preview.removeClass('in').one('transitionend', () => $preview.hide());\n }\n };\n\n // On a touch (mobile) device we cannot hover the link to reveal the preview.\n // Instead we cancel the navigation so that a click reveals the preview.\n // Users can then click on the preview to go to the post if desired.\n $this.on('touchend', e => {\n if (e.cancelable) {\n e.preventDefault();\n }\n });\n $this.add($preview).hover(() => {\n clearTimeout(timeout);\n timeout = setTimeout(showPreview, 250);\n }, () => {\n clearTimeout(timeout);\n getPostElement().removeClass('pulsate');\n timeout = setTimeout(hidePreview, 250);\n }).on('touchend', e => {\n showPreview();\n e.stopPropagation();\n });\n $(document).on('touchend', hidePreview);\n });\n }\n extend(CommentPost.prototype, 'oncreate', addPreviews);\n extend(CommentPost.prototype, 'onupdate', addPreviews);\n}","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport CommentPost from 'flarum/forum/components/CommentPost';\nimport Link from 'flarum/common/components/Link';\nimport PostPreview from 'flarum/forum/components/PostPreview';\nimport punctuateSeries from 'flarum/common/helpers/punctuateSeries';\nimport username from 'flarum/common/helpers/username';\nimport Icon from 'flarum/common/components/Icon';\nimport Button from 'flarum/common/components/Button';\nimport MentionedByModal from './components/MentionedByModal';\nexport default function addMentionedByList() {\n function hidePreview() {\n this.$('.Post-mentionedBy-preview').removeClass('in').one('transitionend', function () {\n $(this).hide();\n });\n }\n extend(CommentPost.prototype, 'oncreate', function () {\n let timeout;\n const post = this.attrs.post;\n const replies = post.mentionedBy();\n if (replies && replies.length) {\n const $preview = $('');\n this.$().append($preview);\n const $parentPost = this.$();\n const $this = this.$('.Post-mentionedBy');\n const showPreview = () => {\n if (!$preview.hasClass('in') && $preview.is(':visible')) return;\n\n // When the user hovers their mouse over the list of people who have\n // replied to the post, render a list of reply previews into a\n // popup.\n m.render($preview[0], m('[', null, replies.map(reply => m(\"li\", {\n \"data-number\": reply.number()\n }, m(PostPreview, {\n post: reply,\n onclick: hidePreview.bind(this)\n }))), replies.length < post.mentionedByCount() && m(\"li\", {\n className: \"Post-mentionedBy-preview-more\"\n }, m(Button, {\n className: \"PostPreview Button\",\n onclick: () => {\n hidePreview.call(this);\n app.modal.show(MentionedByModal, {\n post\n });\n }\n }, m(\"span\", {\n className: \"PostPreview-content\"\n }, m(\"span\", {\n className: \"PostPreview-badge Avatar\"\n }, m(Icon, {\n name: 'fas fa-reply-all'\n })), m(\"span\", null, app.translator.trans('flarum-mentions.forum.post.mentioned_by_more_text', {\n count: post.mentionedByCount() - replies.length\n })))))));\n $preview.show().css('top', $this.offset().top - $parentPost.offset().top + $this.outerHeight(true)).css('left', $this.offsetParent().offset().left - $parentPost.offset().left).css('max-width', $parentPost.width());\n setTimeout(() => $preview.off('transitionend').addClass('in'));\n };\n $this.add($preview).hover(() => {\n clearTimeout(timeout);\n timeout = setTimeout(showPreview, 250);\n }, () => {\n clearTimeout(timeout);\n timeout = setTimeout(hidePreview, 250);\n });\n\n // Whenever the user hovers their mouse over a particular name in the\n // list of repliers, highlight the corresponding post in the preview\n // popup.\n this.$().find('.Post-mentionedBy-summary a').hover(function () {\n $preview.find('[data-number=\"' + $(this).data('number') + '\"]').addClass('active');\n }, function () {\n $preview.find('[data-number]').removeClass('active');\n });\n }\n });\n extend(CommentPost.prototype, 'footerItems', function (items) {\n const post = this.attrs.post;\n const replies = post.mentionedBy();\n if (replies && replies.length) {\n const users = [];\n const repliers = replies.sort(reply => reply.user() === app.session.user ? -1 : 0).filter(reply => {\n const user = reply.user();\n if (users.indexOf(user) === -1) {\n users.push(user);\n return true;\n }\n });\n const limit = 4;\n const overLimit = post.mentionedByCount() > limit;\n\n // Create a list of unique users who have replied. So even if a user has\n // replied twice, they will only be in this array once.\n const names = repliers.slice(0, overLimit ? limit - 1 : limit).map(reply => {\n const user = reply.user();\n return m(Link, {\n href: app.route.post(reply),\n onclick: hidePreview.bind(this),\n \"data-number\": reply.number()\n }, app.session.user === user ? app.translator.trans('flarum-mentions.forum.post.you_text') : username(user));\n });\n\n // If there are more users that we've run out of room to display, add a \"x\n // others\" name to the end of the list. Clicking on it will display a modal\n // with a full list of names.\n if (overLimit) {\n const count = post.mentionedByCount() - names.length;\n names.push(app.translator.trans('flarum-mentions.forum.post.others_text', {\n count\n }));\n }\n items.add('replies', m(\"div\", {\n className: \"Post-mentionedBy\"\n }, m(\"span\", {\n className: \"Post-mentionedBy-summary\"\n }, m(Icon, {\n name: 'fas fa-reply'\n }), app.translator.trans(\"flarum-mentions.forum.post.mentioned_by\".concat(repliers[0].user() === app.session.user ? '_self' : '', \"_text\"), {\n count: names.length,\n users: punctuateSeries(names)\n }))));\n }\n });\n}","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport Button from 'flarum/common/components/Button';\nimport CommentPost from 'flarum/forum/components/CommentPost';\nimport reply from './utils/reply';\nexport default function addPostReplyAction() {\n extend(CommentPost.prototype, 'actionItems', function (items) {\n const post = this.attrs.post;\n if (post.isHidden() || app.session.user && !post.discussion().canReply()) return;\n items.add('reply', m(Button, {\n className: \"Button Button--link\",\n onclick: () => reply(post)\n }, app.translator.trans('flarum-mentions.forum.post.reply_link')));\n });\n}","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport CommentPost from 'flarum/forum/components/CommentPost';\nimport PostQuoteButton from './fragments/PostQuoteButton';\nimport selectedText from './utils/selectedText';\nexport default function addPostQuoteButton() {\n extend(CommentPost.prototype, 'oncreate', function () {\n const post = this.attrs.post;\n if (post.isHidden() || app.session.user && !post.discussion().canReply()) return;\n const $postBody = this.$('.Post-body');\n\n // Wrap the quote button in a wrapper element so that we can render\n // button into it.\n const $container = $('
');\n const button = new PostQuoteButton(post);\n const handler = function (e) {\n setTimeout(() => {\n const content = selectedText($postBody);\n if (content) {\n button.content = content;\n m.render($container[0], button.render());\n const rects = window.getSelection().getRangeAt(0).getClientRects();\n const firstRect = rects[0];\n if (e.clientY < firstRect.bottom && e.clientX - firstRect.right < firstRect.left - e.clientX) {\n button.showStart(firstRect.left, firstRect.top);\n } else {\n const lastRect = rects[rects.length - 1];\n button.showEnd(lastRect.right, lastRect.bottom);\n }\n }\n }, 1);\n };\n this.$().after($container).on('mouseup', handler);\n if ('ontouchstart' in window) {\n document.addEventListener('selectionchange', handler, false);\n }\n });\n}","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport TextEditorButton from 'flarum/common/components/TextEditorButton';\nimport KeyboardNavigatable from 'flarum/common/utils/KeyboardNavigatable';\nimport AutocompleteReader from 'flarum/common/utils/AutocompleteReader';\nimport { throttle } from 'flarum/common/utils/throttleDebounce';\nimport AutocompleteDropdown from './fragments/AutocompleteDropdown';\nimport MentionableModels from './mentionables/MentionableModels';\nexport default function addComposerAutocomplete() {\n extend('flarum/common/components/TextEditor', 'onbuild', function () {\n this.mentionsDropdown = new AutocompleteDropdown();\n this.searchMentions = throttle(250, (mentionables, buildSuggestions) => mentionables.search().then(buildSuggestions));\n const $editor = this.$('.TextEditor-editor').wrap('
');\n this.navigator = new KeyboardNavigatable();\n this.navigator.when(() => this.mentionsDropdown.active).onUp(() => this.mentionsDropdown.navigate(-1)).onDown(() => this.mentionsDropdown.navigate(1)).onSelect(this.mentionsDropdown.complete.bind(this.mentionsDropdown)).onCancel(this.mentionsDropdown.hide.bind(this.mentionsDropdown)).bindTo($editor);\n $editor.after($('
'));\n });\n extend('flarum/common/components/TextEditor', 'buildEditorParams', function (params) {\n let matchTyped;\n const suggestionsInputListener = () => {\n const selection = this.attrs.composer.editor.getSelectionRange();\n const cursor = selection[0];\n if (selection[1] - cursor > 0) return;\n let activeFormat = null;\n const autocompleteReader = new AutocompleteReader(character => !!(activeFormat = app.mentionFormats.get(character)));\n const autocompleting = autocompleteReader.check(this.attrs.composer.editor.getLastNChars(30), cursor, /\\S+/);\n const mentionsDropdown = this.mentionsDropdown;\n let mentionables = new MentionableModels({\n onmouseenter: function () {\n mentionsDropdown.setIndex($(this).parent().index());\n },\n onclick: replacement => {\n this.attrs.composer.editor.replaceBeforeCursor(autocompleting.absoluteStart - 1, replacement + ' ');\n this.mentionsDropdown.hide();\n }\n });\n this.mentionsDropdown.hide();\n this.mentionsDropdown.active = false;\n if (autocompleting) {\n mentionables.init(activeFormat.makeMentionables());\n matchTyped = activeFormat.queryFromTyped(autocompleting.typed);\n if (!matchTyped) return;\n mentionables.typed = matchTyped;\n const buildSuggestions = () => {\n // If the user has started to type a mention,\n // then suggest models matching.\n const suggestions = mentionables.buildSuggestions();\n if (suggestions.length) {\n this.mentionsDropdown.items = suggestions;\n m.render(this.$('.ComposerBody-mentionsDropdownContainer')[0], this.mentionsDropdown.render());\n this.mentionsDropdown.show();\n const coordinates = this.attrs.composer.editor.getCaretCoordinates(autocompleting.absoluteStart);\n const width = this.mentionsDropdown.$().outerWidth();\n const height = this.mentionsDropdown.$().outerHeight();\n const parent = this.mentionsDropdown.$().offsetParent();\n let left = coordinates.left;\n let top = coordinates.top + 15;\n\n // Keep the dropdown inside the editor.\n if (top + height > parent.height()) {\n top = coordinates.top - height - 15;\n }\n if (left + width > parent.width()) {\n left = parent.width() - width;\n }\n\n // Prevent the dropdown from going off screen on mobile\n top = Math.max(-(parent.offset().top - $(document).scrollTop()), top);\n left = Math.max(-parent.offset().left, left);\n this.mentionsDropdown.show(left, top);\n } else {\n this.mentionsDropdown.active = false;\n this.mentionsDropdown.hide();\n }\n };\n this.mentionsDropdown.active = true;\n buildSuggestions();\n this.mentionsDropdown.setIndex(0);\n this.mentionsDropdown.$().scrollTop(0);\n this.searchMentions(mentionables, buildSuggestions);\n }\n };\n params.inputListeners.push(suggestionsInputListener);\n });\n extend('flarum/common/components/TextEditor', 'toolbarItems', function (items) {\n items.add('mention', m(TextEditorButton, {\n onclick: () => this.attrs.composer.editor.insertAtCursor(' @'),\n icon: \"fas fa-at\"\n }, app.translator.trans('flarum-mentions.forum.composer.mention_tooltip')));\n });\n}"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","reg","MentionedByModalState","constructor","params","page","limit","super","type","add","MentionedByModal","oninit","vnode","this","state","filter","mentionedPost","attrs","post","id","sort","refresh","className","title","content","m","isInitialLoading","getPages","map","items","reply","number","onclick","hasNext","loadNext","loading","isLoadingNext","insertMention","composer","quote","Promise","resolve","mention","replacement","fields","body","originalContent","cursorPosition","editor","getSelectionRange","preceding","slice","precedingNewlines","length","match","insertAtCursor","Array","join","trim","replace","EditPostComposer","checkModule","discussion","then","PostQuoteButton","view","name","show","left","top","$this","$","parentOffset","offsetParent","offset","css","hideHandler","hide","bind","document","on","showStart","window","scrollTop","outerHeight","showEnd","right","bottom","outerWidth","off","selectedText","selection","getSelection","isCollapsed","range","getRangeAt","parent","commonAncestorContainer","contains","clone","append","cloneContents","find","replaceWith","alt","concat","src","innerText","href","text","_typeof","iterator","_defineProperty","arg","input","hint","prim","toPrimitive","undefined","res","TypeError","String","toPropertyKey","configurable","writable","AutocompleteDropdown","arguments","item","active","navigate","delta","keyWasJustPressed","setIndex","index","clearTimeout","keyWasJustPressedTimeout","setTimeout","complete","eq","click","scrollToItem","$dropdown","$items","rangedIndex","$item","removeClass","addClass","dropdownScroll","dropdownTop","dropdownBottom","itemTop","itemBottom","parseInt","stop","animate","MentionsDropdownItem","mentionable","assign","children","MentionableModels","dropdownItemAttrs","async","typed","typedLower","toLowerCase","searched","includes","mentionables","model","search","results","has","set","push","init","Map","initialResults","result","matches","_this$typed","makeSuggestion","suggestion","buildSuggestions","suggestions","enabled","from","values","max","maxStoreMatchedResults","splice","dropdownItem","MentionFormat","makeMentionables","_this$instances","instances","Mentionable","getMentionable","_this$makeMentionable","extend","extendable","Error","MentionableModel","format","getDeletedUserText","getCleanDisplayName","user","useDisplayName","displayName","username","UserMention","cleanText","some","substr","q","PostMention","ReplyComposer","composerAttrs","composerPost","posts","contentType","b","createdAt","getTime","_model$contentPlain","truncate","contentPlain","userMentionable","GroupMention","g","group","namePlural","groupName","color","icon","nameSingular","_app$session$user$can","_app$session","_app$session$user","canMentionGroups","AtMentionFormat","trigger","queryFromTyped","matchTyped","char","simple","safe","TagMention","tag","slug","tagName","extensions","HashMentionFormat","MentionFormats","symbol","_this$formats$find","formats","f","MentionsUserPage","loadResults","mentioned","loadLimit","PostMentionedNotification","notification","subject","replyNumber","fromUser","count","excerpt","UserMentionedNotification","GroupMentionedNotification","hasMany","attribute","filterUserMentions","hasAttribute","getAttribute","setAttribute","invalidate","postFilterUserMentions","filterPostMentions","postFilterPostMentions","filterGroupMentions","postFilterGroupMentions","_app$session2","_app$session2$user","filterTagMentions","postFilterTagMentions","app","mentionFormats","addPreviews","contentHtml","oldPostContentHtml","isEditing","parentPost","$parentPost","e","route","preventDefault","each","data","timeout","$preview","getPostElement","showPreview","$post","visible","pageYOffset","height","positionPreview","previewHeight","width","showPost","render","store","getById","hidePreview","hasClass","one","cancelable","hover","stopPropagation","addPostMentionPreviews","replies","mentionedBy","is","mentionedByCount","users","repliers","indexOf","overLimit","names","addMentionedByList","isHidden","canReply","$postBody","$container","button","handler","rects","getClientRects","firstRect","clientY","clientX","lastRect","after","addEventListener","mentionsDropdown","searchMentions","throttle","$editor","wrap","navigator","when","onUp","onDown","onSelect","onCancel","bindTo","inputListeners","cursor","activeFormat","autocompleting","character","check","getLastNChars","onmouseenter","replaceBeforeCursor","absoluteStart","coordinates","getCaretCoordinates","Math","label","getPlainContent","classList","getComputedStyle","getPropertyValue"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"file":"forum.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,sRCL9D,MAAM,EAA+BC,OAAOC,IAAIV,IAAI,OAAQ,iBCAtD,EAA+BS,OAAOC,IAAIV,IAAI,OAAQ,a,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BtR,KAAKC,EAAMC,EACnC,MACExD,KAAK4U,iBAAiBzN,QAAS,EAC/BnH,KAAK4U,iBAAiB5Q,MACxB,EAEFhE,KAAK4U,iBAAiBzN,QAAS,EAC/BsD,IACAzK,KAAK4U,iBAAiBrN,SAAS,GAC/BvH,KAAK4U,iBAAiBlR,IAAIY,UAAU,GACpCtE,KAAK6U,eAAenL,EAAce,EACpC,IAGJ,KACA,IAAAgB,QAAO,sCAAuC,gBAAgB,SAAUzK,GACtEA,EAAMpB,IAAI,UAAWgB,EAAE,IAAkB,CACvCO,QAAS,IAAMnB,KAAKI,MAAMqB,SAASU,OAAOO,eAAe,MACzDkL,KAAM,aACL,qBAAqB,mDAC1B,KLrDA,IAAAnC,QAAO,2CAA4C,qBAAqB,SAAUzK,GAChFA,EAAMpB,IAAI,gBAAiB,CACzByD,KAAM,gBACNuK,KAAM,eACNyI,MAAO,qBAAqB,gEAE9BrV,EAAMpB,IAAI,gBAAiB,CACzByD,KAAM,gBACNuK,KAAM,YACNyI,MAAO,qBAAqB,gEAE9BrV,EAAMpB,IAAI,iBAAkB,CAC1ByD,KAAM,iBACNuK,KAAM,YACNyI,MAAO,qBAAqB,gEAEhC,KAGA,IAAA5K,QAAO,eAAoB,YAAY,SAAUzK,GAC/C,MAAMgL,EAAOhM,KAAKgM,KAClBhL,EAAMpB,IAAI,WAAYgB,EAAE,KAAY,CAClCmF,KAAM,UAAU,gBAAiB,CAC/BoG,SAAUH,EAAK2C,SAEjBtL,KAAM,WACNuK,KAAM,aACL,qBAAqB,6CAA8C,GACxE,IAGA,EAAA0I,gBAAA,qBAAqC,kBAGrC,IAAA7K,QAAO,cAAgB,YAAY,WACjCzL,KAAK0D,EAAE,gDAAgDkO,MAAK,WAC1D5R,KAAKuW,UAAU3W,IAAI,IAAkB4W,iBAAiBxW,MAAMyW,iBAAiB,YAC/E,GACF,GAAE,G","sources":["webpack://@flarum/mentions/webpack/bootstrap","webpack://@flarum/mentions/webpack/runtime/compat get default export","webpack://@flarum/mentions/webpack/runtime/define property getters","webpack://@flarum/mentions/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/mentions/webpack/runtime/make namespace object","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'forum/app')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/utils/string')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/helpers/textContrastClass')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'forum/components/Post')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'forum/components/CommentPost')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'forum/components/PostPreview')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/components/LoadingIndicator')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/components/Link')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/helpers/punctuateSeries')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/helpers/username')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/components/Icon')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/components/Button')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/components/Modal')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/states/PaginatedListState')\"","webpack://@flarum/mentions/./src/forum/state/MentionedByModalState.ts","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/components/Form')\"","webpack://@flarum/mentions/./src/forum/components/MentionedByModal.tsx","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'forum/utils/DiscussionControls')\"","webpack://@flarum/mentions/./src/forum/utils/reply.js","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/Fragment')\"","webpack://@flarum/mentions/./src/forum/fragments/PostQuoteButton.js","webpack://@flarum/mentions/./src/forum/utils/selectedText.js","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/components/TextEditorButton')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/utils/KeyboardNavigatable')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/utils/AutocompleteReader')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/utils/throttleDebounce')\"","webpack://@flarum/mentions/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://@flarum/mentions/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://@flarum/mentions/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://@flarum/mentions/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://@flarum/mentions/./src/forum/fragments/AutocompleteDropdown.js","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/Component')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/utils/classList')\"","webpack://@flarum/mentions/./src/forum/components/MentionsDropdownItem.tsx","webpack://@flarum/mentions/./src/forum/mentionables/MentionableModels.tsx","webpack://@flarum/mentions/./src/forum/mentionables/formats/MentionFormat.ts","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/components/Avatar')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/helpers/highlight')\"","webpack://@flarum/mentions/./src/forum/mentionables/MentionableModel.ts","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/utils/extractText')\"","webpack://@flarum/mentions/./src/forum/utils/getCleanDisplayName.js","webpack://@flarum/mentions/./src/forum/mentionables/UserMention.tsx","webpack://@flarum/mentions/./src/forum/mentionables/PostMention.tsx","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/models/Group')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/components/Badge')\"","webpack://@flarum/mentions/./src/forum/mentionables/GroupMention.tsx","webpack://@flarum/mentions/./src/forum/mentionables/formats/AtMentionFormat.ts","webpack://@flarum/mentions/./src/forum/mentionables/TagMention.tsx","webpack://@flarum/mentions/./src/forum/mentionables/formats/HashMentionFormat.ts","webpack://@flarum/mentions/./src/forum/mentionables/formats/MentionFormats.ts","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'forum/components/UserPage')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/components/LinkButton')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/extenders')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/models/Post')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'common/models/User')\"","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'forum/components/PostsUserPage')\"","webpack://@flarum/mentions/./src/forum/components/MentionsUserPage.js","webpack://@flarum/mentions/external root \"flarum.reg.get('core', 'forum/components/Notification')\"","webpack://@flarum/mentions/./src/forum/components/PostMentionedNotification.js","webpack://@flarum/mentions/./src/forum/components/UserMentionedNotification.js","webpack://@flarum/mentions/./src/forum/components/GroupMentionedNotification.js","webpack://@flarum/mentions/./src/forum/extend.ts","webpack://@flarum/mentions/./src/forum/utils/textFormatter.js","webpack://@flarum/mentions/./src/forum/extenders/Mentionables.ts","webpack://@flarum/mentions/./src/forum/index.js","webpack://@flarum/mentions/./src/forum/addPostMentionPreviews.js","webpack://@flarum/mentions/./src/forum/addMentionedByList.js","webpack://@flarum/mentions/./src/forum/addPostReplyAction.js","webpack://@flarum/mentions/./src/forum/addPostQuoteButton.js","webpack://@flarum/mentions/./src/forum/addComposerAutocomplete.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extend');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/string');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/helpers/textContrastClass');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/Post');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/CommentPost');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/PostPreview');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/LoadingIndicator');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Link');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/helpers/punctuateSeries');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/helpers/username');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Icon');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Button');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Modal');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/states/PaginatedListState');","import PaginatedListState from 'flarum/common/states/PaginatedListState';\nexport default class MentionedByModalState extends PaginatedListState {\n constructor(params, page) {\n if (page === void 0) {\n page = 1;\n }\n const limit = 10;\n params.page = {\n ...(params.page || {}),\n limit\n };\n super(params, page, limit);\n }\n get type() {\n return 'posts';\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/state/MentionedByModalState', MentionedByModalState);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Form');","import app from 'flarum/forum/app';\nimport PostPreview from 'flarum/forum/components/PostPreview';\nimport Modal from 'flarum/common/components/Modal';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport Button from 'flarum/common/components/Button';\nimport MentionedByModalState from '../state/MentionedByModalState';\nimport Form from 'flarum/common/components/Form';\nexport default class MentionedByModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n this.state = new MentionedByModalState({\n filter: {\n mentionedPost: this.attrs.post.id()\n },\n sort: 'number'\n });\n this.state.refresh();\n }\n className() {\n return 'MentionedByModal';\n }\n title() {\n return app.translator.trans('flarum-mentions.forum.mentioned_by.title');\n }\n content() {\n return m('[', null, m(\"div\", {\n className: \"Modal-body\"\n }, this.state.isInitialLoading() ? m(LoadingIndicator, null) : m('[', null, m(\"ul\", {\n className: \"MentionedByModal-list Dropdown-menu Dropdown-menu--inline Post-mentionedBy-preview\"\n }, this.state.getPages().map(page => page.items.map(reply => m(\"li\", {\n \"data-number\": reply.number()\n }, m(PostPreview, {\n post: reply,\n onclick: () => app.modal.close()\n }))))))), this.state.hasNext() && m(\"div\", {\n className: \"Modal-footer\"\n }, m(Form, {\n className: \"Form--centered\"\n }, m(\"div\", {\n className: \"Form-group\"\n }, m(Button, {\n className: \"Button Button--block\",\n onclick: () => this.state.loadNext(),\n loading: this.state.isLoadingNext()\n }, app.translator.trans('flarum-mentions.forum.mentioned_by.load_more_button'))))));\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/components/MentionedByModal', MentionedByModal);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/utils/DiscussionControls');","import app from 'flarum/forum/app';\nimport DiscussionControls from 'flarum/forum/utils/DiscussionControls';\nexport function insertMention(post, composer, quote) {\n return new Promise(resolve => {\n const mention = app.mentionFormats.mentionable('post').replacement(post) + ' ';\n\n // If the composer is empty, then assume we're starting a new reply.\n // In which case we don't want the user to have to confirm if they\n // close the composer straight away.\n if (!composer.fields.content()) {\n composer.body.attrs.originalContent = mention;\n }\n const cursorPosition = composer.editor.getSelectionRange()[0];\n const preceding = composer.fields.content().slice(0, cursorPosition);\n const precedingNewlines = preceding.length == 0 ? 0 : 3 - preceding.match(/(\\n{0,2})$/)[0].length;\n composer.editor.insertAtCursor(Array(precedingNewlines).join('\\n') + (\n // Insert up to two newlines, depending on preceding whitespace\n quote ? '> ' + mention + quote.trim().replace(/\\n/g, '\\n> ') + '\\n\\n' : mention), false);\n return resolve(composer);\n });\n}\nexport default function reply(post, quote) {\n const EditPostComposer = flarum.reg.checkModule('core', 'forum/components/EditPostComposer');\n if (EditPostComposer && app.composer.bodyMatches(EditPostComposer) && app.composer.body.attrs.post.discussion() === post.discussion()) {\n // If we're already editing a post in the discussion of post we're quoting,\n // insert the mention directly.\n return insertMention(post, app.composer, quote);\n } else {\n // The default \"Reply\" action behavior will only open a new composer if\n // necessary, but it will always be a ReplyComposer, hence the exceptional\n // case above.\n return DiscussionControls.replyAction.call(post.discussion()).then(composer => insertMention(post, composer, quote));\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/utils/reply', reply);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/Fragment');","import app from 'flarum/forum/app';\nimport Fragment from 'flarum/common/Fragment';\nimport Icon from 'flarum/common/components/Icon';\nimport reply from '../utils/reply';\nexport default class PostQuoteButton extends Fragment {\n constructor(post) {\n super();\n this.post = post;\n }\n view() {\n return m(\"button\", {\n className: \"Button PostQuoteButton\",\n onclick: () => {\n reply(this.post, this.content);\n }\n }, m(Icon, {\n name: \"fas fa-quote-left\",\n className: \"Button-icon\"\n }), app.translator.trans('flarum-mentions.forum.post.quote_button'));\n }\n show(left, top) {\n const $this = this.$().show();\n const parentOffset = $this.offsetParent().offset();\n $this.css('left', left - parentOffset.left).css('top', top - parentOffset.top);\n this.hideHandler = this.hide.bind(this);\n $(document).on('mouseup', this.hideHandler);\n }\n showStart(left, top) {\n const $this = this.$();\n this.show(left, $(window).scrollTop() + top - $this.outerHeight() - 5);\n }\n showEnd(right, bottom) {\n const $this = this.$();\n this.show(right - $this.outerWidth(), $(window).scrollTop() + bottom + 5);\n }\n hide() {\n this.$().hide();\n $(document).off('mouseup', this.hideHandler);\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/fragments/PostQuoteButton', PostQuoteButton);","/**\n * Finds the selected text in the provided composer body.\n */\nexport default function selectedText(body) {\n const selection = window.getSelection();\n if (!selection.isCollapsed) {\n const range = selection.getRangeAt(0);\n const parent = range.commonAncestorContainer;\n if (body[0] === parent || $.contains(body[0], parent)) {\n const clone = $('
').append(range.cloneContents());\n\n // Replace emoji images with their shortcode (found in alt attribute)\n clone.find('img.emoji').replaceWith(function () {\n return this.alt;\n });\n\n // Replace all other images with a Markdown image\n clone.find('img').replaceWith(function () {\n return \"![](\".concat(this.src, \")\");\n });\n\n // Replace all links with a Markdown link\n clone.find('a').replaceWith(function () {\n return \"[\".concat(this.innerText, \"](\").concat(this.href, \")\");\n });\n return clone.text();\n }\n }\n return '';\n}\nflarum.reg.add('flarum-mentions', 'forum/utils/selectedText', selectedText);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/TextEditorButton');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/KeyboardNavigatable');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/AutocompleteReader');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/throttleDebounce');","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}","import _typeof from \"./typeof.js\";\nexport default function _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport Fragment from 'flarum/common/Fragment';\nexport default class AutocompleteDropdown extends Fragment {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"items\", []);\n _defineProperty(this, \"active\", false);\n _defineProperty(this, \"index\", 0);\n _defineProperty(this, \"keyWasJustPressed\", false);\n }\n view() {\n return m(\"ul\", {\n className: \"Dropdown-menu MentionsDropdown\"\n }, this.items.map(item => m(\"li\", null, item)));\n }\n show(left, top) {\n this.$().show().css({\n left: left + 'px',\n top: top + 'px'\n });\n this.active = true;\n }\n hide() {\n this.$().hide();\n this.active = false;\n }\n navigate(delta) {\n this.keyWasJustPressed = true;\n this.setIndex(this.index + delta, true);\n clearTimeout(this.keyWasJustPressedTimeout);\n this.keyWasJustPressedTimeout = setTimeout(() => this.keyWasJustPressed = false, 500);\n }\n complete() {\n this.$('li').eq(this.index).find('button').click();\n }\n setIndex(index, scrollToItem) {\n if (this.keyWasJustPressed && !scrollToItem) return;\n const $dropdown = this.$();\n const $items = $dropdown.find('li');\n let rangedIndex = index;\n if (rangedIndex < 0) {\n rangedIndex = $items.length - 1;\n } else if (rangedIndex >= $items.length) {\n rangedIndex = 0;\n }\n this.index = rangedIndex;\n const $item = $items.removeClass('active').eq(rangedIndex).addClass('active');\n if (scrollToItem) {\n const dropdownScroll = $dropdown.scrollTop();\n const dropdownTop = $dropdown.offset().top;\n const dropdownBottom = dropdownTop + $dropdown.outerHeight();\n const itemTop = $item.offset().top;\n const itemBottom = itemTop + $item.outerHeight();\n let scrollTop;\n if (itemTop < dropdownTop) {\n scrollTop = dropdownScroll - dropdownTop + itemTop - parseInt($dropdown.css('padding-top'), 10);\n } else if (itemBottom > dropdownBottom) {\n scrollTop = dropdownScroll - dropdownBottom + itemBottom + parseInt($dropdown.css('padding-bottom'), 10);\n }\n if (typeof scrollTop !== 'undefined') {\n $dropdown.stop(true).animate({\n scrollTop\n }, 100);\n }\n }\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/fragments/AutocompleteDropdown', AutocompleteDropdown);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/Component');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/classList');","import Component from 'flarum/common/Component';\nimport classList from 'flarum/common/utils/classList';\nexport default class MentionsDropdownItem extends Component {\n view(vnode) {\n const {\n mentionable,\n ...attrs\n } = this.attrs;\n const className = classList('MentionsDropdownItem', 'PostPreview', \"MentionsDropdown-\".concat(mentionable.type()));\n return m(\"button\", Object.assign({\n className: className\n }, attrs), m(\"span\", {\n className: \"PostPreview-content\"\n }, vnode.children));\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/components/MentionsDropdownItem', MentionsDropdownItem);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport MentionsDropdownItem from '../components/MentionsDropdownItem';\nexport default class MentionableModels {\n constructor(dropdownItemAttrs) {\n _defineProperty(this, \"mentionables\", void 0);\n /**\n * We store models returned from an API here to preserve order in which they are returned\n * This prevents the list jumping around while models are returned.\n * We also use a hashmap for model IDs to provide O(1) lookup for the users already in the list.\n */\n _defineProperty(this, \"results\", {});\n _defineProperty(this, \"typed\", null);\n _defineProperty(this, \"searched\", []);\n _defineProperty(this, \"dropdownItemAttrs\", {});\n /**\n * Don't send API calls searching for models until at least 2 characters have been typed.\n * This focuses the mention results on models already loaded.\n */\n _defineProperty(this, \"search\", async () => {\n if (!this.typed || this.typed.length <= 1) return;\n const typedLower = this.typed.toLowerCase();\n if (this.searched.includes(typedLower)) return;\n for (const mentionable of this.mentionables) {\n for (const model of await mentionable.search(typedLower)) {\n if (!this.results[mentionable.type()].has(model.id())) {\n this.results[mentionable.type()].set(model.id(), model);\n }\n }\n }\n this.searched.push(typedLower);\n return Promise.resolve();\n });\n this.dropdownItemAttrs = dropdownItemAttrs;\n }\n init(mentionables) {\n this.typed = null;\n this.mentionables = mentionables;\n for (const mentionable of this.mentionables) {\n this.results[mentionable.type()] = new Map(mentionable.initialResults().map(result => [result.id(), result]));\n }\n }\n matches(mentionable, model) {\n var _this$typed;\n return mentionable.matches(model, ((_this$typed = this.typed) == null ? void 0 : _this$typed.toLowerCase()) || '');\n }\n makeSuggestion(mentionable, model) {\n const content = mentionable.suggestion(model, this.typed);\n const replacement = mentionable.replacement(model);\n const {\n onclick,\n ...attrs\n } = this.dropdownItemAttrs;\n return m(MentionsDropdownItem, Object.assign({\n mentionable: mentionable,\n onclick: () => onclick(replacement)\n }, attrs), content);\n }\n buildSuggestions() {\n const suggestions = [];\n for (const mentionable of this.mentionables) {\n if (!mentionable.enabled()) continue;\n let matches = Array.from(this.results[mentionable.type()].values()).filter(model => this.matches(mentionable, model));\n const max = mentionable.maxStoreMatchedResults();\n if (max) matches = matches.splice(0, max);\n for (const model of matches) {\n const dropdownItem = this.makeSuggestion(mentionable, model);\n suggestions.push(dropdownItem);\n }\n }\n return suggestions;\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/mentionables/MentionableModels', MentionableModels);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nexport default class MentionFormat {\n constructor() {\n _defineProperty(this, \"instances\", void 0);\n _defineProperty(this, \"mentionables\", void 0);\n _defineProperty(this, \"extendable\", void 0);\n }\n makeMentionables() {\n var _this$instances;\n return (_this$instances = this.instances) != null ? _this$instances : this.instances = this.mentionables.map(Mentionable => new Mentionable(this));\n }\n getMentionable(type) {\n var _this$makeMentionable;\n return (_this$makeMentionable = this.makeMentionables().find(mentionable => mentionable.type() === type)) != null ? _this$makeMentionable : null;\n }\n extend(mentionable) {\n if (!this.extendable) throw new Error('This mention format does not allow extending.');\n this.mentionables.push(mentionable);\n }\n\n /**\n * Picks the term to search in the API from the typed text.\n * @example:\n * * Full text = `Hello @\"John D`\n * * Typed text = `\"John D`\n * * Query = `John D`\n */\n}\nflarum.reg.add('flarum-mentions', 'forum/mentionables/formats/MentionFormat', MentionFormat);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Avatar');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/helpers/highlight');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nexport default class MentionableModel {\n constructor(format) {\n _defineProperty(this, \"format\", void 0);\n this.format = format;\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/mentionables/MentionableModel', MentionableModel);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/extractText');","import app from 'flarum/forum/app';\nimport extractText from 'flarum/common/utils/extractText';\n\n/**\n * Whether to use the old mentions format.\n *\n * `'@username'` or `'@\"Display name\"'`\n */\nexport const shouldUseOldFormat = () => app.forum.attribute('allowUsernameMentionFormat') || false;\nconst getDeletedUserText = () => extractText(app.translator.trans('core.lib.username.deleted_text'));\n\n/**\n * Fetches a user's username or display name.\n *\n * Chooses based on the format option set in the admin settings page.\n *\n * @param user An instance of the User model to fetch the username for\n * @param useDisplayName If `true`, uses `user.displayName()`, otherwise, uses `user.username()`\n */\nexport default function getCleanDisplayName(user, useDisplayName) {\n if (useDisplayName === void 0) {\n useDisplayName = true;\n }\n if (!user) return getDeletedUserText().replace(/\"#[a-z]{0,3}[0-9]+/, '_');\n const text = (useDisplayName ? user.displayName() : user.username()) || getDeletedUserText();\n return text.replace(/\"#[a-z]{0,3}[0-9]+/, '_');\n}\nflarum.reg.add('flarum-mentions', 'forum/utils/getCleanDisplayName', getCleanDisplayName);","import app from 'flarum/forum/app';\nimport usernameHelper from 'flarum/common/helpers/username';\nimport Avatar from 'flarum/common/components/Avatar';\nimport highlight from 'flarum/common/helpers/highlight';\nimport MentionableModel from './MentionableModel';\nimport getCleanDisplayName, { shouldUseOldFormat } from '../utils/getCleanDisplayName';\nexport default class UserMention extends MentionableModel {\n type() {\n return 'user';\n }\n initialResults() {\n return Array.from(app.store.all('users'));\n }\n\n /**\n * Automatically determines which mention syntax to be used based on the option in the\n * admin dashboard. Also performs display name clean-up automatically.\n *\n * @\"Display name\"#UserID or `@username`\n *\n * @example
New display name syntax\n * // '@\"user\"#1'\n * forUser(User) // User is ID 1, display name is 'User'\n *\n * @example
Using old syntax\n * // '@username'\n * forUser(user) // User's username is 'username'\n */\n replacement(user) {\n if (shouldUseOldFormat()) {\n const cleanText = getCleanDisplayName(user, false);\n return this.format.format(cleanText);\n }\n const cleanText = getCleanDisplayName(user);\n return this.format.format(cleanText, '', user.id());\n }\n suggestion(model, typed) {\n const username = usernameHelper(model, name => highlight(name, typed));\n return m('[', null, m(Avatar, {\n user: model\n }), username);\n }\n matches(model, typed) {\n if (!typed) return false;\n const names = [model.username(), model.displayName()];\n return names.some(name => name.toLowerCase().substr(0, typed.length) === typed);\n }\n maxStoreMatchedResults() {\n return null;\n }\n async search(typed) {\n return await app.store.find('users', {\n filter: {\n q: typed\n },\n page: {\n limit: 5\n }\n });\n }\n enabled() {\n return true;\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/mentionables/UserMention', UserMention);","import app from 'flarum/forum/app';\nimport MentionableModel from './MentionableModel';\nimport usernameHelper from 'flarum/common/helpers/username';\nimport Avatar from 'flarum/common/components/Avatar';\nimport highlight from 'flarum/common/helpers/highlight';\nimport { truncate } from 'flarum/common/utils/string';\nimport getCleanDisplayName from '../utils/getCleanDisplayName';\nexport default class PostMention extends MentionableModel {\n type() {\n return 'post';\n }\n\n /**\n * If the user is replying to a discussion, or if they are editing a\n * post, then we can suggest other posts in the discussion to mention.\n * We will add the 5 most recent comments in the discussion which\n * match any username characters that have been typed.\n */\n initialResults() {\n const EditPostComposer = flarum.reg.checkModule('core', 'forum/components/EditPostComposer');\n const ReplyComposer = flarum.reg.checkModule('core', 'forum/components/ReplyComposer');\n if ((!ReplyComposer || !app.composer.bodyMatches(ReplyComposer)) && (!EditPostComposer || !app.composer.bodyMatches(EditPostComposer))) {\n return [];\n }\n\n // @ts-ignore\n const composerAttrs = app.composer.body.attrs;\n const composerPost = composerAttrs.post;\n const discussion = composerPost && composerPost.discussion() || composerAttrs.discussion;\n return discussion.posts()\n // Filter to only comment posts, and replies before this message\n .filter(post => post && post.contentType() === 'comment' && (!composerPost || post.number() < composerPost.number()))\n // Sort by new to old\n .sort((a, b) => b.createdAt().getTime() - a.createdAt().getTime());\n }\n\n /**\n * Generates the syntax for mentioning of a post. Also cleans up the display name.\n *\n * @example
Post mention\n * // '@\"User\"#p13'\n * // @\"Display name\"#pPostID\n * forPostMention(user, 13) // User display name is 'User', post ID is 13\n */\n replacement(post) {\n const user = post.user();\n const cleanText = getCleanDisplayName(user);\n return this.format.format(cleanText, 'p', post.id());\n }\n suggestion(model, typed) {\n var _model$contentPlain;\n const user = model.user() || null;\n const username = usernameHelper(user, name => highlight(name, typed));\n return m('[', null, m(Avatar, {\n user: user\n }), username, [app.translator.trans('flarum-mentions.forum.composer.reply_to_post_text', {\n number: model.number()\n }), ' — ', truncate((_model$contentPlain = model.contentPlain()) != null ? _model$contentPlain : '', 200)]);\n }\n matches(model, typed) {\n const user = model.user();\n const userMentionable = app.mentionFormats.mentionable('user');\n return !typed || user && userMentionable.matches(user, typed);\n }\n maxStoreMatchedResults() {\n return 5;\n }\n\n /**\n * Post mention suggestions are only offered from current discussion posts.\n */\n search(typed) {\n return Promise.resolve([]);\n }\n enabled() {\n return true;\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/mentionables/PostMention', PostMention);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/models/Group');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Badge');","import app from 'flarum/forum/app';\nimport Group from 'flarum/common/models/Group';\nimport MentionableModel from './MentionableModel';\nimport Badge from 'flarum/common/components/Badge';\nimport highlight from 'flarum/common/helpers/highlight';\nexport default class GroupMention extends MentionableModel {\n type() {\n return 'group';\n }\n initialResults() {\n return Array.from(app.store.all('groups').filter(g => {\n return g.id() !== Group.GUEST_ID && g.id() !== Group.MEMBER_ID;\n }));\n }\n\n /**\n * Generates the mention syntax for a group mention.\n *\n * @\"Name Plural\"#gGroupID\n *\n * @example
Group mention\n * // '@\"Mods\"#g4'\n * forGroup(group) // Group display name is 'Mods', group ID is 4\n */\n replacement(group) {\n return this.format.format(group.namePlural(), 'g', group.id());\n }\n suggestion(model, typed) {\n let groupName = model.namePlural();\n if (typed) {\n groupName = highlight(groupName, typed);\n }\n return m('[', null, m(Badge, {\n className: \"Avatar Badge Badge--group--\".concat(model.id(), \" Badge-icon\"),\n color: model.color(),\n type: \"group\",\n icon: model.icon()\n }), m(\"span\", {\n className: \"username\"\n }, groupName));\n }\n matches(model, typed) {\n if (!typed) return false;\n const names = [model.namePlural().toLowerCase(), model.nameSingular().toLowerCase()];\n return names.some(name => name.toLowerCase().substr(0, typed.length) === typed);\n }\n maxStoreMatchedResults() {\n return null;\n }\n\n /**\n * All groups are already loaded, so we don't need to search for them.\n */\n search(typed) {\n return Promise.resolve([]);\n }\n enabled() {\n var _app$session$user$can, _app$session, _app$session$user;\n return (_app$session$user$can = (_app$session = app.session) == null ? void 0 : (_app$session$user = _app$session.user) == null ? void 0 : _app$session$user.canMentionGroups()) != null ? _app$session$user$can : false;\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/mentionables/GroupMention', GroupMention);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport MentionFormat from './MentionFormat';\nimport UserMention from '../UserMention';\nimport PostMention from '../PostMention';\nimport GroupMention from '../GroupMention';\nexport default class AtMentionFormat extends MentionFormat {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"mentionables\", [UserMention, PostMention, GroupMention]);\n _defineProperty(this, \"extendable\", true);\n }\n trigger() {\n return '@';\n }\n queryFromTyped(typed) {\n const matchTyped = typed.match(/^[\"“]?((?:(?!\"#).)+)$/);\n return matchTyped ? matchTyped[1] : null;\n }\n format(name, char, id) {\n if (char === void 0) {\n char = '';\n }\n if (id === void 0) {\n id = null;\n }\n return {\n simple: \"@\".concat(name),\n safe: \"@\\\"\".concat(name, \"\\\"#\").concat(char).concat(id)\n }[id ? 'safe' : 'simple'];\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/mentionables/formats/AtMentionFormat', AtMentionFormat);","import app from 'flarum/forum/app';\nimport Badge from 'flarum/common/components/Badge';\nimport highlight from 'flarum/common/helpers/highlight';\nimport MentionableModel from './MentionableModel';\nexport default class TagMention extends MentionableModel {\n type() {\n return 'tag';\n }\n initialResults() {\n return Array.from(app.store.all('tags'));\n }\n\n /**\n * Generates the mention syntax for a tag mention.\n *\n * ~tagSlug\n *\n * @example
Tag mention\n * // ~general\n * forTag(tag) // Tag display name is 'Tag', tag ID is 5\n */\n replacement(tag) {\n return this.format.format(tag.slug());\n }\n matches(model, typed) {\n if (!typed) return false;\n const names = [model.name().toLowerCase()];\n return names.some(name => name.toLowerCase().substr(0, typed.length) === typed);\n }\n maxStoreMatchedResults() {\n return null;\n }\n async search(typed) {\n return await app.store.find('tags', {\n filter: {\n q: typed\n },\n page: {\n limit: 5\n }\n });\n }\n suggestion(model, typed) {\n let tagName = model.name();\n if (typed) {\n tagName = highlight(tagName, typed);\n }\n return m('[', null, m(Badge, {\n className: \"Avatar\",\n icon: model.icon(),\n color: model.color(),\n type: \"tag\"\n }), m(\"span\", {\n className: \"username\"\n }, tagName));\n }\n enabled() {\n return 'flarum-tags' in flarum.extensions;\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/mentionables/TagMention', TagMention);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport MentionFormat from './MentionFormat';\nimport TagMention from '../TagMention';\nexport default class HashMentionFormat extends MentionFormat {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"mentionables\", [TagMention]);\n _defineProperty(this, \"extendable\", true);\n }\n trigger() {\n return '#';\n }\n queryFromTyped(typed) {\n const matchTyped = typed.match(/^[-_\\p{L}\\p{N}\\p{M}]+$/giu);\n return matchTyped ? matchTyped[0] : null;\n }\n format(slug) {\n return \"#\".concat(slug);\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/mentionables/formats/HashMentionFormat', HashMentionFormat);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport AtMentionFormat from './AtMentionFormat';\nimport HashMentionFormat from './HashMentionFormat';\nexport default class MentionFormats {\n constructor() {\n _defineProperty(this, \"formats\", [new AtMentionFormat(), new HashMentionFormat()]);\n }\n get(symbol) {\n var _this$formats$find;\n return (_this$formats$find = this.formats.find(f => f.trigger() === symbol)) != null ? _this$formats$find : null;\n }\n mentionable(type) {\n for (const format of this.formats) {\n const mentionable = format.getMentionable(type);\n if (mentionable) return mentionable;\n }\n return null;\n }\n extend(format) {\n this.formats.push(new format());\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/mentionables/formats/MentionFormats', MentionFormats);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/UserPage');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/LinkButton');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extenders');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/models/Post');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/models/User');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/PostsUserPage');","import app from 'flarum/forum/app';\nimport PostsUserPage from 'flarum/forum/components/PostsUserPage';\n\n/**\n * The `MentionsUserPage` component shows post which user Mentioned at\n */\nexport default class MentionsUserPage extends PostsUserPage {\n /**\n * Load a new page of the user's activity feed.\n *\n * @param {Integer} [offset] The position to start getting results from.\n * @return {Promise}\n * @protected\n */\n loadResults(offset) {\n return app.store.find('posts', {\n filter: {\n type: 'comment',\n mentioned: this.user.id()\n },\n page: {\n offset,\n limit: this.loadLimit\n },\n sort: '-createdAt'\n });\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/components/MentionsUserPage', MentionsUserPage);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/Notification');","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\nimport { truncate } from 'flarum/common/utils/string';\nexport default class PostMentionedNotification extends Notification {\n icon() {\n return 'fas fa-reply';\n }\n href() {\n const notification = this.attrs.notification;\n const post = notification.subject();\n const content = notification.content();\n return app.route.discussion(post.discussion(), content && content.replyNumber);\n }\n content() {\n const notification = this.attrs.notification;\n const user = notification.fromUser();\n return app.translator.trans('flarum-mentions.forum.notifications.post_mentioned_text', {\n user,\n count: 1\n });\n }\n excerpt() {\n return truncate(this.attrs.notification.subject().contentPlain() || '', 200);\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/components/PostMentionedNotification', PostMentionedNotification);","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\nimport { truncate } from 'flarum/common/utils/string';\nexport default class UserMentionedNotification extends Notification {\n icon() {\n return 'fas fa-at';\n }\n href() {\n const post = this.attrs.notification.subject();\n return app.route.discussion(post.discussion(), post.number());\n }\n content() {\n const user = this.attrs.notification.fromUser();\n return app.translator.trans('flarum-mentions.forum.notifications.user_mentioned_text', {\n user\n });\n }\n excerpt() {\n return truncate(this.attrs.notification.subject().contentPlain(), 200);\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/components/UserMentionedNotification', UserMentionedNotification);","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\nimport { truncate } from 'flarum/common/utils/string';\nexport default class GroupMentionedNotification extends Notification {\n icon() {\n return 'fas fa-at';\n }\n href() {\n const post = this.attrs.notification.subject();\n return app.route.discussion(post.discussion(), post.number());\n }\n content() {\n const user = this.attrs.notification.fromUser();\n return app.translator.trans('flarum-mentions.forum.notifications.group_mentioned_text', {\n user\n });\n }\n excerpt() {\n return truncate(this.attrs.notification.subject().contentPlain(), 200);\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/components/GroupMentionedNotification', GroupMentionedNotification);","import Extend from 'flarum/common/extenders';\nimport Post from 'flarum/common/models/Post';\nimport User from 'flarum/common/models/User';\nimport MentionsUserPage from './components/MentionsUserPage';\nimport PostMentionedNotification from './components/PostMentionedNotification';\nimport UserMentionedNotification from './components/UserMentionedNotification';\nimport GroupMentionedNotification from './components/GroupMentionedNotification';\nexport default [new Extend.Routes() //\n.add('user.mentions', '/u/:username/mentions', MentionsUserPage), new Extend.Model(Post) //\n.hasMany('mentionedBy').attribute('mentionedByCount'), new Extend.Notification() //\n.add('postMentioned', PostMentionedNotification).add('userMentioned', UserMentionedNotification).add('groupMentioned', GroupMentionedNotification), new Extend.Model(User) //\n.attribute('canMentionGroups')];","import app from 'flarum/forum/app';\nimport username from 'flarum/common/helpers/username';\nimport extractText from 'flarum/common/utils/extractText';\nexport function filterUserMentions(tag) {\n let user;\n if (app.forum.attribute('allowUsernameMentionFormat') && tag.hasAttribute('username')) user = app.store.getBy('users', 'username', tag.getAttribute('username'));else if (tag.hasAttribute('id')) user = app.store.getById('users', tag.getAttribute('id'));\n if (user) {\n tag.setAttribute('id', user.id());\n tag.setAttribute('slug', user.slug());\n tag.setAttribute('displayname', extractText(username(user)));\n return true;\n }\n tag.invalidate();\n}\nexport function postFilterUserMentions(tag) {\n tag.setAttribute('deleted', false);\n}\nexport function filterPostMentions(tag) {\n const post = app.store.getById('posts', tag.getAttribute('id'));\n if (post) {\n tag.setAttribute('discussionid', post.discussion().id());\n tag.setAttribute('number', post.number());\n tag.setAttribute('displayname', extractText(username(post.user())));\n return true;\n }\n}\nexport function postFilterPostMentions(tag) {\n tag.setAttribute('deleted', false);\n}\nexport function filterGroupMentions(tag) {\n var _app$session, _app$session$user;\n if ((_app$session = app.session) != null && (_app$session$user = _app$session.user) != null && _app$session$user.canMentionGroups()) {\n const group = app.store.getById('groups', tag.getAttribute('id'));\n if (group) {\n tag.setAttribute('groupname', extractText(group.namePlural()));\n return true;\n }\n }\n tag.invalidate();\n}\nexport function postFilterGroupMentions(tag) {\n var _app$session2, _app$session2$user;\n if ((_app$session2 = app.session) != null && (_app$session2$user = _app$session2.user) != null && _app$session2$user.canMentionGroups()) {\n const group = app.store.getById('groups', tag.getAttribute('id'));\n tag.setAttribute('color', group.color());\n tag.setAttribute('icon', group.icon());\n tag.setAttribute('deleted', false);\n }\n}\nexport function filterTagMentions(tag) {\n if ('flarum-tags' in flarum.extensions) {\n const model = app.store.getBy('tags', 'slug', tag.getAttribute('slug'));\n if (model) {\n tag.setAttribute('id', model.id());\n tag.setAttribute('tagname', model.name());\n return true;\n }\n }\n tag.invalidate();\n}\nexport function postFilterTagMentions(tag) {\n if ('flarum-tags' in flarum.extensions) {\n const model = app.store.getBy('tags', 'slug', tag.getAttribute('slug'));\n tag.setAttribute('icon', model.icon());\n tag.setAttribute('color', model.color());\n tag.setAttribute('deleted', false);\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/utils/textFormatter', { filterUserMentions: filterUserMentions,postFilterUserMentions: postFilterUserMentions,filterPostMentions: filterPostMentions,postFilterPostMentions: postFilterPostMentions,filterGroupMentions: filterGroupMentions,postFilterGroupMentions: postFilterGroupMentions,filterTagMentions: filterTagMentions,postFilterTagMentions: postFilterTagMentions, });","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nexport default class Mentionables {\n constructor() {\n _defineProperty(this, \"formats\", []);\n _defineProperty(this, \"mentionables\", {});\n }\n /**\n * Register a new mention format.\n * Must extend MentionFormat and have a unique unused trigger symbol.\n */\n format(format) {\n this.formats.push(format);\n return this;\n }\n\n /**\n * Register a new mentionable model to a mention format.\n * Only works if the format has already been registered,\n * and the format allows using multiple mentionables.\n *\n * @param symbol The trigger symbol of the format to extend (ex: @).\n * @param mentionable The mentionable instance to register.\n * Must extend MentionableModel.\n */\n mentionable(symbol, mentionable) {\n if (!this.mentionables[symbol]) {\n this.mentionables[symbol] = [];\n }\n this.mentionables[symbol].push(mentionable);\n return this;\n }\n extend(app) {\n for (const format of this.formats) {\n app.mentionFormats.extend(format);\n }\n for (const symbol in this.mentionables) {\n const format = app.mentionFormats.get(symbol);\n if (!format) continue;\n for (const mentionable of this.mentionables[symbol]) {\n format.extend(mentionable);\n }\n }\n }\n}\nflarum.reg.add('flarum-mentions', 'forum/extenders/Mentionables', Mentionables);","import { extend } from 'flarum/common/extend';\nimport app from 'flarum/forum/app';\nimport { getPlainContent } from 'flarum/common/utils/string';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\nimport Post from 'flarum/forum/components/Post';\nimport addPostMentionPreviews from './addPostMentionPreviews';\nimport addMentionedByList from './addMentionedByList';\nimport addPostReplyAction from './addPostReplyAction';\nimport addPostQuoteButton from './addPostQuoteButton';\nimport addComposerAutocomplete from './addComposerAutocomplete';\nimport MentionFormats from './mentionables/formats/MentionFormats';\nimport UserPage from 'flarum/forum/components/UserPage';\nimport LinkButton from 'flarum/common/components/LinkButton';\napp.mentionFormats = new MentionFormats();\nexport { default as extend } from './extend';\napp.initializers.add('flarum-mentions', () => {\n // For every mention of a post inside a post's content, set up a hover handler\n // that shows a preview of the mentioned post.\n addPostMentionPreviews();\n\n // In the footer of each post, show information about who has replied (i.e.\n // who the post has been mentioned by).\n addMentionedByList();\n\n // Add a 'reply' control to the footer of each post. When clicked, it will\n // open up the composer and add a post mention to its contents.\n addPostReplyAction();\n\n // Show a Quote button when Post text is selected\n addPostQuoteButton();\n\n // After typing '@' in the composer, show a dropdown suggesting a bunch of\n // posts or users that the user could mention.\n addComposerAutocomplete();\n\n // Add notification preferences.\n extend('flarum/forum/components/NotificationGrid', 'notificationTypes', function (items) {\n items.add('postMentioned', {\n name: 'postMentioned',\n icon: 'fas fa-reply',\n label: app.translator.trans('flarum-mentions.forum.settings.notify_post_mentioned_label')\n });\n items.add('userMentioned', {\n name: 'userMentioned',\n icon: 'fas fa-at',\n label: app.translator.trans('flarum-mentions.forum.settings.notify_user_mentioned_label')\n });\n items.add('groupMentioned', {\n name: 'groupMentioned',\n icon: 'fas fa-at',\n label: app.translator.trans('flarum-mentions.forum.settings.notify_group_mentioned_label')\n });\n });\n\n // Add mentions tab in user profile\n extend(UserPage.prototype, 'navItems', function (items) {\n const user = this.user;\n items.add('mentions', m(LinkButton, {\n href: app.route('user.mentions', {\n username: user.slug()\n }),\n name: \"mentions\",\n icon: \"fas fa-at\"\n }, app.translator.trans('flarum-mentions.forum.user.mentions_link')), 80);\n });\n\n // Remove post mentions when rendering post previews.\n getPlainContent.removeSelectors.push('a.PostMention');\n\n // Apply color contrast fix on group mentions.\n extend(Post.prototype, 'oncreate', function () {\n this.$('.GroupMention--colored, .TagMention--colored').each(function () {\n this.classList.add(textContrastClass(getComputedStyle(this).getPropertyValue('--color')));\n });\n });\n});\nexport * from './utils/textFormatter';\nimport './forum';","import { extend } from 'flarum/common/extend';\nimport CommentPost from 'flarum/forum/components/CommentPost';\nimport PostPreview from 'flarum/forum/components/PostPreview';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nexport default function addPostMentionPreviews() {\n function addPreviews() {\n const contentHtml = this.attrs.post.contentHtml();\n if (contentHtml === this.oldPostContentHtml || this.isEditing()) return;\n this.oldPostContentHtml = contentHtml;\n const parentPost = this.attrs.post;\n const $parentPost = this.$();\n this.$().on('click', '.UserMention:not(.UserMention--deleted), .PostMention:not(.PostMention--deleted), .TagMention:not(.TagMention--deleted)', function (e) {\n m.route.set(this.getAttribute('href'));\n e.preventDefault();\n });\n this.$('.PostMention:not(.PostMention--deleted)').each(function () {\n const $this = $(this);\n const id = $this.data('id');\n let timeout;\n\n // Wrap the mention link in a wrapper element so that we can insert a\n // preview popup as its sibling and relatively position it.\n const $preview = $('');\n $parentPost.append($preview);\n const getPostElement = () => {\n return $(\".PostStream-item[data-id=\\\"\".concat(id, \"\\\"]\"));\n };\n const showPreview = () => {\n // When the user hovers their mouse over the mention, look for the\n // post that it's referring to in the stream, and determine if it's\n // in the viewport. If it is, we will \"pulsate\" it.\n const $post = getPostElement();\n let visible = false;\n if ($post.length) {\n const top = $post.offset().top;\n const scrollTop = window.pageYOffset;\n if (top > scrollTop && top + $post.height() < scrollTop + $(window).height()) {\n $post.addClass('pulsate');\n visible = true;\n }\n }\n\n // Otherwise, we will show a popup preview of the post. If the post\n // hasn't yet been loaded, we will need to do that.\n if (!visible) {\n // Position the preview so that it appears above the mention.\n // (The offsetParent should be .Post-body.)\n const positionPreview = () => {\n const previewHeight = $preview.outerHeight(true);\n let offset = 0;\n\n // If the preview goes off the top of the viewport, reposition it to\n // be below the mention.\n if ($this.offset().top - previewHeight < $(window).scrollTop() + $('#header').outerHeight()) {\n offset += $this.outerHeight(true);\n } else {\n offset -= previewHeight;\n }\n $preview.show().css('top', $this.offset().top - $parentPost.offset().top + offset).css('left', $this.offsetParent().offset().left - $parentPost.offset().left).css('max-width', $this.offsetParent().width());\n };\n const showPost = post => {\n const discussion = post.discussion();\n m.render($preview[0], [discussion !== parentPost.discussion() && m(\"li\", null, m(\"span\", {\n className: \"PostMention-preview-discussion\"\n }, discussion.title())), m(\"li\", null, m(PostPreview, {\n post: post\n }))]);\n positionPreview();\n };\n const post = app.store.getById('posts', id);\n if (post && post.discussion()) {\n showPost(post);\n } else {\n m.render($preview[0], m(LoadingIndicator, null));\n app.store.find('posts', id).then(showPost);\n positionPreview();\n }\n setTimeout(() => $preview.off('transitionend').addClass('in'));\n }\n };\n const hidePreview = () => {\n getPostElement().removeClass('pulsate');\n if ($preview.hasClass('in')) {\n $preview.removeClass('in').one('transitionend', () => $preview.hide());\n }\n };\n\n // On a touch (mobile) device we cannot hover the link to reveal the preview.\n // Instead we cancel the navigation so that a click reveals the preview.\n // Users can then click on the preview to go to the post if desired.\n $this.on('touchend', e => {\n if (e.cancelable) {\n e.preventDefault();\n }\n });\n $this.add($preview).hover(() => {\n clearTimeout(timeout);\n timeout = setTimeout(showPreview, 250);\n }, () => {\n clearTimeout(timeout);\n getPostElement().removeClass('pulsate');\n timeout = setTimeout(hidePreview, 250);\n }).on('touchend', e => {\n showPreview();\n e.stopPropagation();\n });\n $(document).on('touchend', hidePreview);\n });\n }\n extend(CommentPost.prototype, 'oncreate', addPreviews);\n extend(CommentPost.prototype, 'onupdate', addPreviews);\n}","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport CommentPost from 'flarum/forum/components/CommentPost';\nimport Link from 'flarum/common/components/Link';\nimport PostPreview from 'flarum/forum/components/PostPreview';\nimport punctuateSeries from 'flarum/common/helpers/punctuateSeries';\nimport username from 'flarum/common/helpers/username';\nimport Icon from 'flarum/common/components/Icon';\nimport Button from 'flarum/common/components/Button';\nimport MentionedByModal from './components/MentionedByModal';\nexport default function addMentionedByList() {\n function hidePreview() {\n this.$('.Post-mentionedBy-preview').removeClass('in').one('transitionend', function () {\n $(this).hide();\n });\n }\n extend(CommentPost.prototype, 'oncreate', function () {\n let timeout;\n const post = this.attrs.post;\n const replies = post.mentionedBy();\n if (replies && replies.length) {\n const $preview = $('');\n this.$().append($preview);\n const $parentPost = this.$();\n const $this = this.$('.Post-mentionedBy');\n const showPreview = () => {\n if (!$preview.hasClass('in') && $preview.is(':visible')) return;\n\n // When the user hovers their mouse over the list of people who have\n // replied to the post, render a list of reply previews into a\n // popup.\n m.render($preview[0], m('[', null, replies.map(reply => m(\"li\", {\n \"data-number\": reply.number()\n }, m(PostPreview, {\n post: reply,\n onclick: hidePreview.bind(this)\n }))), replies.length < post.mentionedByCount() && m(\"li\", {\n className: \"Post-mentionedBy-preview-more\"\n }, m(Button, {\n className: \"PostPreview Button\",\n onclick: () => {\n hidePreview.call(this);\n app.modal.show(MentionedByModal, {\n post\n });\n }\n }, m(\"span\", {\n className: \"PostPreview-content\"\n }, m(\"span\", {\n className: \"PostPreview-badge Avatar\"\n }, m(Icon, {\n name: 'fas fa-reply-all'\n })), m(\"span\", null, app.translator.trans('flarum-mentions.forum.post.mentioned_by_more_text', {\n count: post.mentionedByCount() - replies.length\n })))))));\n $preview.show().css('top', $this.offset().top - $parentPost.offset().top + $this.outerHeight(true)).css('left', $this.offsetParent().offset().left - $parentPost.offset().left).css('max-width', $parentPost.width());\n setTimeout(() => $preview.off('transitionend').addClass('in'));\n };\n $this.add($preview).hover(() => {\n clearTimeout(timeout);\n timeout = setTimeout(showPreview, 250);\n }, () => {\n clearTimeout(timeout);\n timeout = setTimeout(hidePreview, 250);\n });\n\n // Whenever the user hovers their mouse over a particular name in the\n // list of repliers, highlight the corresponding post in the preview\n // popup.\n this.$().find('.Post-mentionedBy-summary a').hover(function () {\n $preview.find('[data-number=\"' + $(this).data('number') + '\"]').addClass('active');\n }, function () {\n $preview.find('[data-number]').removeClass('active');\n });\n }\n });\n extend(CommentPost.prototype, 'footerItems', function (items) {\n const post = this.attrs.post;\n const replies = post.mentionedBy();\n if (replies && replies.length) {\n const users = [];\n const repliers = replies.sort(reply => reply.user() === app.session.user ? -1 : 0).filter(reply => {\n const user = reply.user();\n if (users.indexOf(user) === -1) {\n users.push(user);\n return true;\n }\n });\n const limit = 4;\n const overLimit = post.mentionedByCount() > limit;\n\n // Create a list of unique users who have replied. So even if a user has\n // replied twice, they will only be in this array once.\n const names = repliers.slice(0, overLimit ? limit - 1 : limit).map(reply => {\n const user = reply.user();\n return m(Link, {\n href: app.route.post(reply),\n onclick: hidePreview.bind(this),\n \"data-number\": reply.number()\n }, app.session.user === user ? app.translator.trans('flarum-mentions.forum.post.you_text') : username(user));\n });\n\n // If there are more users that we've run out of room to display, add a \"x\n // others\" name to the end of the list. Clicking on it will display a modal\n // with a full list of names.\n if (overLimit) {\n const count = post.mentionedByCount() - names.length;\n names.push(app.translator.trans('flarum-mentions.forum.post.others_text', {\n count\n }));\n }\n items.add('replies', m(\"div\", {\n className: \"Post-mentionedBy\"\n }, m(\"span\", {\n className: \"Post-mentionedBy-summary\"\n }, m(Icon, {\n name: 'fas fa-reply'\n }), app.translator.trans(\"flarum-mentions.forum.post.mentioned_by\".concat(repliers[0].user() === app.session.user ? '_self' : '', \"_text\"), {\n count: names.length,\n users: punctuateSeries(names)\n }))));\n }\n });\n}","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport Button from 'flarum/common/components/Button';\nimport CommentPost from 'flarum/forum/components/CommentPost';\nimport reply from './utils/reply';\nexport default function addPostReplyAction() {\n extend(CommentPost.prototype, 'actionItems', function (items) {\n const post = this.attrs.post;\n if (post.isHidden() || app.session.user && !post.discussion().canReply()) return;\n items.add('reply', m(Button, {\n className: \"Button Button--link\",\n onclick: () => reply(post)\n }, app.translator.trans('flarum-mentions.forum.post.reply_link')));\n });\n}","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport CommentPost from 'flarum/forum/components/CommentPost';\nimport PostQuoteButton from './fragments/PostQuoteButton';\nimport selectedText from './utils/selectedText';\nexport default function addPostQuoteButton() {\n extend(CommentPost.prototype, 'oncreate', function () {\n const post = this.attrs.post;\n if (post.isHidden() || app.session.user && !post.discussion().canReply()) return;\n const $postBody = this.$('.Post-body');\n\n // Wrap the quote button in a wrapper element so that we can render\n // button into it.\n const $container = $('
');\n const button = new PostQuoteButton(post);\n const handler = function (e) {\n setTimeout(() => {\n const content = selectedText($postBody);\n if (content) {\n button.content = content;\n m.render($container[0], button.render());\n const rects = window.getSelection().getRangeAt(0).getClientRects();\n const firstRect = rects[0];\n if (e.clientY < firstRect.bottom && e.clientX - firstRect.right < firstRect.left - e.clientX) {\n button.showStart(firstRect.left, firstRect.top);\n } else {\n const lastRect = rects[rects.length - 1];\n button.showEnd(lastRect.right, lastRect.bottom);\n }\n }\n }, 1);\n };\n this.$().after($container).on('mouseup', handler);\n if ('ontouchstart' in window) {\n document.addEventListener('selectionchange', handler, false);\n }\n });\n}","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport TextEditorButton from 'flarum/common/components/TextEditorButton';\nimport KeyboardNavigatable from 'flarum/common/utils/KeyboardNavigatable';\nimport AutocompleteReader from 'flarum/common/utils/AutocompleteReader';\nimport { throttle } from 'flarum/common/utils/throttleDebounce';\nimport AutocompleteDropdown from './fragments/AutocompleteDropdown';\nimport MentionableModels from './mentionables/MentionableModels';\nexport default function addComposerAutocomplete() {\n extend('flarum/common/components/TextEditor', 'onbuild', function () {\n this.mentionsDropdown = new AutocompleteDropdown();\n this.searchMentions = throttle(250, (mentionables, buildSuggestions) => mentionables.search().then(buildSuggestions));\n const $editor = this.$('.TextEditor-editor').wrap('
');\n this.navigator = new KeyboardNavigatable();\n this.navigator.when(() => this.mentionsDropdown.active).onUp(() => this.mentionsDropdown.navigate(-1)).onDown(() => this.mentionsDropdown.navigate(1)).onSelect(this.mentionsDropdown.complete.bind(this.mentionsDropdown)).onCancel(this.mentionsDropdown.hide.bind(this.mentionsDropdown)).bindTo($editor);\n $editor.after($('
'));\n });\n extend('flarum/common/components/TextEditor', 'buildEditorParams', function (params) {\n let matchTyped;\n const suggestionsInputListener = () => {\n const selection = this.attrs.composer.editor.getSelectionRange();\n const cursor = selection[0];\n if (selection[1] - cursor > 0) return;\n let activeFormat = null;\n const autocompleteReader = new AutocompleteReader(character => !!(activeFormat = app.mentionFormats.get(character)));\n const autocompleting = autocompleteReader.check(this.attrs.composer.editor.getLastNChars(30), cursor, /\\S+/);\n const mentionsDropdown = this.mentionsDropdown;\n let mentionables = new MentionableModels({\n onmouseenter: function () {\n mentionsDropdown.setIndex($(this).parent().index());\n },\n onclick: replacement => {\n this.attrs.composer.editor.replaceBeforeCursor(autocompleting.absoluteStart - 1, replacement + ' ');\n this.mentionsDropdown.hide();\n }\n });\n this.mentionsDropdown.hide();\n this.mentionsDropdown.active = false;\n if (autocompleting) {\n mentionables.init(activeFormat.makeMentionables());\n matchTyped = activeFormat.queryFromTyped(autocompleting.typed);\n if (!matchTyped) return;\n mentionables.typed = matchTyped;\n const buildSuggestions = () => {\n // If the user has started to type a mention,\n // then suggest models matching.\n const suggestions = mentionables.buildSuggestions();\n if (suggestions.length) {\n this.mentionsDropdown.items = suggestions;\n m.render(this.$('.ComposerBody-mentionsDropdownContainer')[0], this.mentionsDropdown.render());\n this.mentionsDropdown.show();\n const coordinates = this.attrs.composer.editor.getCaretCoordinates(autocompleting.absoluteStart);\n const width = this.mentionsDropdown.$().outerWidth();\n const height = this.mentionsDropdown.$().outerHeight();\n const parent = this.mentionsDropdown.$().offsetParent();\n let left = coordinates.left;\n let top = coordinates.top + 15;\n\n // Keep the dropdown inside the editor.\n if (top + height > parent.height()) {\n top = coordinates.top - height - 15;\n }\n if (left + width > parent.width()) {\n left = parent.width() - width;\n }\n\n // Prevent the dropdown from going off screen on mobile\n top = Math.max(-(parent.offset().top - $(document).scrollTop()), top);\n left = Math.max(-parent.offset().left, left);\n this.mentionsDropdown.show(left, top);\n } else {\n this.mentionsDropdown.active = false;\n this.mentionsDropdown.hide();\n }\n };\n this.mentionsDropdown.active = true;\n buildSuggestions();\n this.mentionsDropdown.setIndex(0);\n this.mentionsDropdown.$().scrollTop(0);\n this.searchMentions(mentionables, buildSuggestions);\n }\n };\n params.inputListeners.push(suggestionsInputListener);\n });\n extend('flarum/common/components/TextEditor', 'toolbarItems', function (items) {\n items.add('mention', m(TextEditorButton, {\n onclick: () => this.attrs.composer.editor.insertAtCursor(' @'),\n icon: \"fas fa-at\"\n }, app.translator.trans('flarum-mentions.forum.composer.mention_tooltip')));\n });\n}"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","reg","MentionedByModalState","constructor","params","page","limit","super","type","add","MentionedByModal","oninit","vnode","this","state","filter","mentionedPost","attrs","post","id","sort","refresh","className","title","content","m","isInitialLoading","getPages","map","items","reply","number","onclick","hasNext","loadNext","loading","isLoadingNext","insertMention","composer","quote","Promise","resolve","mention","replacement","fields","body","originalContent","cursorPosition","editor","getSelectionRange","preceding","slice","precedingNewlines","length","match","insertAtCursor","Array","join","trim","replace","EditPostComposer","checkModule","discussion","then","PostQuoteButton","view","name","show","left","top","$this","$","parentOffset","offsetParent","offset","css","hideHandler","hide","bind","document","on","showStart","window","scrollTop","outerHeight","showEnd","right","bottom","outerWidth","off","selectedText","selection","getSelection","isCollapsed","range","getRangeAt","parent","commonAncestorContainer","contains","clone","append","cloneContents","find","replaceWith","alt","concat","src","innerText","href","text","_typeof","iterator","_defineProperty","arg","input","hint","prim","toPrimitive","undefined","res","TypeError","String","toPropertyKey","configurable","writable","AutocompleteDropdown","arguments","item","active","navigate","delta","keyWasJustPressed","setIndex","index","clearTimeout","keyWasJustPressedTimeout","setTimeout","complete","eq","click","scrollToItem","$dropdown","$items","rangedIndex","$item","removeClass","addClass","dropdownScroll","dropdownTop","dropdownBottom","itemTop","itemBottom","parseInt","stop","animate","MentionsDropdownItem","mentionable","assign","children","MentionableModels","dropdownItemAttrs","async","typed","typedLower","toLowerCase","searched","includes","mentionables","model","search","results","has","set","push","init","Map","initialResults","result","matches","_this$typed","makeSuggestion","suggestion","buildSuggestions","suggestions","enabled","from","values","max","maxStoreMatchedResults","splice","dropdownItem","MentionFormat","makeMentionables","_this$instances","instances","Mentionable","getMentionable","_this$makeMentionable","extend","extendable","Error","MentionableModel","format","getDeletedUserText","getCleanDisplayName","user","useDisplayName","displayName","username","UserMention","cleanText","some","substr","q","PostMention","ReplyComposer","composerAttrs","composerPost","posts","contentType","b","createdAt","getTime","_model$contentPlain","truncate","contentPlain","userMentionable","GroupMention","g","group","namePlural","groupName","color","icon","nameSingular","_app$session$user$can","_app$session","_app$session$user","canMentionGroups","AtMentionFormat","trigger","queryFromTyped","matchTyped","char","simple","safe","TagMention","tag","slug","tagName","extensions","HashMentionFormat","MentionFormats","symbol","_this$formats$find","formats","f","MentionsUserPage","loadResults","mentioned","loadLimit","PostMentionedNotification","notification","subject","replyNumber","fromUser","count","excerpt","UserMentionedNotification","GroupMentionedNotification","hasMany","attribute","filterUserMentions","hasAttribute","getAttribute","setAttribute","invalidate","postFilterUserMentions","filterPostMentions","postFilterPostMentions","filterGroupMentions","postFilterGroupMentions","_app$session2","_app$session2$user","filterTagMentions","postFilterTagMentions","app","mentionFormats","addPreviews","contentHtml","oldPostContentHtml","isEditing","parentPost","$parentPost","e","route","preventDefault","each","data","timeout","$preview","getPostElement","showPreview","$post","visible","pageYOffset","height","positionPreview","previewHeight","width","showPost","render","store","getById","hidePreview","hasClass","one","cancelable","hover","stopPropagation","addPostMentionPreviews","replies","mentionedBy","is","mentionedByCount","users","repliers","indexOf","overLimit","names","addMentionedByList","isHidden","canReply","$postBody","$container","button","handler","rects","getClientRects","firstRect","clientY","clientX","lastRect","after","addEventListener","mentionsDropdown","searchMentions","throttle","$editor","wrap","navigator","when","onUp","onDown","onSelect","onCancel","bindTo","inputListeners","cursor","activeFormat","autocompleting","character","check","getLastNChars","onmouseenter","replaceBeforeCursor","absoluteStart","coordinates","getCaretCoordinates","Math","label","getPlainContent","classList","getComputedStyle","getPropertyValue"],"sourceRoot":""}
\ No newline at end of file
diff --git a/extensions/nicknames/js/dist/admin.js b/extensions/nicknames/js/dist/admin.js
index 03bb0ab7d3..d4d530bddf 100644
--- a/extensions/nicknames/js/dist/admin.js
+++ b/extensions/nicknames/js/dist/admin.js
@@ -1,2 +1,2 @@
-(()=>{var e={n:n=>{var a=n&&n.__esModule?()=>n.default:()=>n;return e.d(a,{a}),a},d:(n,a)=>{for(var t in a)e.o(a,t)&&!e.o(n,t)&&Object.defineProperty(n,t,{enumerable:!0,get:a[t]})},o:(e,n)=>Object.prototype.hasOwnProperty.call(e,n),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},n={};(()=>{"use strict";e.r(n);const a=flarum.reg.get("core","admin/app");var t=e.n(a);const r=flarum.reg.get("core","common/components/Alert");var s=e.n(r);const i=flarum.reg.get("core","common/components/Link");var l=e.n(i);const o=flarum.reg.get("core","admin/components/BasicsPage");var c=e.n(o);const g=flarum.reg.get("core","common/utils/extractText");var u=e.n(g);const d=flarum.reg.get("core","common/extend");t().initializers.add("flarum/nicknames",(()=>{t().extensionData.for("flarum-nicknames").registerSetting((function(){if("nickname"!==t().data.settings.display_name_driver)return m("div",{className:"Form-group"},m(s(),{dismissible:!1},t().translator.trans("flarum-nicknames.admin.wrong_driver",{a:m(l(),{href:t().route("basics")})})))})).registerSetting({setting:"flarum-nicknames.set_on_registration",type:"boolean",label:t().translator.trans("flarum-nicknames.admin.settings.set_on_registration_label")}).registerSetting({setting:"flarum-nicknames.random_username",type:"boolean",label:t().translator.trans("flarum-nicknames.admin.settings.random_username_label"),help:t().translator.trans("flarum-nicknames.admin.settings.random_username_help")}).registerSetting({setting:"flarum-nicknames.unique",type:"boolean",label:t().translator.trans("flarum-nicknames.admin.settings.unique_label")}).registerSetting({setting:"flarum-nicknames.regex",type:"text",label:t().translator.trans("flarum-nicknames.admin.settings.regex_label")}).registerSetting({setting:"flarum-nicknames.min",type:"number",label:t().translator.trans("flarum-nicknames.admin.settings.min_label")}).registerSetting({setting:"flarum-nicknames.max",type:"number",label:t().translator.trans("flarum-nicknames.admin.settings.max_label")}).registerPermission({icon:"fas fa-user-tag",label:t().translator.trans("flarum-nicknames.admin.permissions.edit_own_nickname_label"),permission:"user.editOwnNickname"},"start"),(0,d.extend)(c().prototype,"driverLocale",(function(e){e.display_name.nickname=u()(t().translator.trans("flarum-nicknames.admin.basics.display_name_driver_options.nickname"))}))}))})(),module.exports=n})();
+(()=>{var e={n:n=>{var a=n&&n.__esModule?()=>n.default:()=>n;return e.d(a,{a}),a},d:(n,a)=>{for(var t in a)e.o(a,t)&&!e.o(n,t)&&Object.defineProperty(n,t,{enumerable:!0,get:a[t]})},o:(e,n)=>Object.prototype.hasOwnProperty.call(e,n),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},n={};(()=>{"use strict";e.r(n);const a=flarum.reg.get("core","admin/app");var t=e.n(a);const r=flarum.reg.get("core","common/components/Alert");var s=e.n(r);const i=flarum.reg.get("core","common/components/Link");var l=e.n(i);const o=flarum.reg.get("core","admin/components/BasicsPage");var c=e.n(o);const g=flarum.reg.get("core","common/utils/extractText");var u=e.n(g);const d=flarum.reg.get("core","common/extend");t().initializers.add("flarum-nicknames",(()=>{t().extensionData.for("flarum-nicknames").registerSetting((function(){if("nickname"!==t().data.settings.display_name_driver)return m("div",{className:"Form-group"},m(s(),{dismissible:!1},t().translator.trans("flarum-nicknames.admin.wrong_driver",{a:m(l(),{href:t().route("basics")})})))})).registerSetting({setting:"flarum-nicknames.set_on_registration",type:"boolean",label:t().translator.trans("flarum-nicknames.admin.settings.set_on_registration_label")}).registerSetting({setting:"flarum-nicknames.random_username",type:"boolean",label:t().translator.trans("flarum-nicknames.admin.settings.random_username_label"),help:t().translator.trans("flarum-nicknames.admin.settings.random_username_help")}).registerSetting({setting:"flarum-nicknames.unique",type:"boolean",label:t().translator.trans("flarum-nicknames.admin.settings.unique_label")}).registerSetting({setting:"flarum-nicknames.regex",type:"text",label:t().translator.trans("flarum-nicknames.admin.settings.regex_label")}).registerSetting({setting:"flarum-nicknames.min",type:"number",label:t().translator.trans("flarum-nicknames.admin.settings.min_label")}).registerSetting({setting:"flarum-nicknames.max",type:"number",label:t().translator.trans("flarum-nicknames.admin.settings.max_label")}).registerPermission({icon:"fas fa-user-tag",label:t().translator.trans("flarum-nicknames.admin.permissions.edit_own_nickname_label"),permission:"user.editOwnNickname"},"start"),(0,d.extend)(c().prototype,"driverLocale",(function(e){e.display_name.nickname=u()(t().translator.trans("flarum-nicknames.admin.basics.display_name_driver_options.nickname"))}))}))})(),module.exports=n})();
//# sourceMappingURL=admin.js.map
\ No newline at end of file
diff --git a/extensions/nicknames/js/dist/admin.js.map b/extensions/nicknames/js/dist/admin.js.map
index 3d92d0c0fa..bcaff5a51a 100644
--- a/extensions/nicknames/js/dist/admin.js.map
+++ b/extensions/nicknames/js/dist/admin.js.map
@@ -1 +1 @@
-{"version":3,"file":"admin.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,IACzBH,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,+BCL9D,MAAM,EAA+BC,OAAOC,IAAIV,IAAI,OAAQ,a,aCA5D,MAAM,EAA+BS,OAAOC,IAAIV,IAAI,OAAQ,2B,aCA5D,MAAM,EAA+BS,OAAOC,IAAIV,IAAI,OAAQ,0B,aCA5D,MAAM,EAA+BS,OAAOC,IAAIV,IAAI,OAAQ,+B,aCA5D,MAAM,EAA+BS,OAAOC,IAAIV,IAAI,OAAQ,4B,aCA5D,MAAM,EAA+BS,OAAOC,IAAIV,IAAI,OAAQ,iBCM5D,qBAAqB,oBAAoB,KACvC,sBAAsB,oBAAoBW,iBAAgB,WACxD,GAA8C,aAA1C,sCACJ,OAAOC,EAAE,MAAO,CACdC,UAAW,cACVD,EAAE,IAAO,CACVE,aAAa,GACZ,qBAAqB,sCAAuC,CAC7DtB,EAAGoB,EAAE,IAAM,CACTG,KAAM,UAAU,eAGtB,IAAGJ,gBAAgB,CACjBK,QAAS,uCACTC,KAAM,UACNC,MAAO,qBAAqB,+DAC3BP,gBAAgB,CACjBK,QAAS,mCACTC,KAAM,UACNC,MAAO,qBAAqB,yDAC5BC,KAAM,qBAAqB,0DAC1BR,gBAAgB,CACjBK,QAAS,0BACTC,KAAM,UACNC,MAAO,qBAAqB,kDAC3BP,gBAAgB,CACjBK,QAAS,yBACTC,KAAM,OACNC,MAAO,qBAAqB,iDAC3BP,gBAAgB,CACjBK,QAAS,uBACTC,KAAM,SACNC,MAAO,qBAAqB,+CAC3BP,gBAAgB,CACjBK,QAAS,uBACTC,KAAM,SACNC,MAAO,qBAAqB,+CAC3BE,mBAAmB,CACpBC,KAAM,kBACNH,MAAO,qBAAqB,8DAC5BI,WAAY,wBACX,UACH,IAAAC,QAAO,cAAsB,gBAAgB,SAAUC,GACrDA,EAAOC,aAAuB,SAAI,IAAY,qBAAqB,sEACrE,GAAE,G","sources":["webpack://@flarum/nicknames/webpack/bootstrap","webpack://@flarum/nicknames/webpack/runtime/compat get default export","webpack://@flarum/nicknames/webpack/runtime/define property getters","webpack://@flarum/nicknames/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/nicknames/webpack/runtime/make namespace object","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'admin/app')\"","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/components/Alert')\"","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/components/Link')\"","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'admin/components/BasicsPage')\"","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/utils/extractText')\"","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/nicknames/./src/admin/index.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Alert');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Link');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/BasicsPage');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/extractText');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extend');","import app from 'flarum/admin/app';\nimport Alert from 'flarum/common/components/Alert';\nimport Link from 'flarum/common/components/Link';\nimport BasicsPage from 'flarum/admin/components/BasicsPage';\nimport extractText from 'flarum/common/utils/extractText';\nimport { extend } from 'flarum/common/extend';\napp.initializers.add('flarum/nicknames', () => {\n app.extensionData.for('flarum-nicknames').registerSetting(function () {\n if (app.data.settings.display_name_driver === 'nickname') return;\n return m(\"div\", {\n className: \"Form-group\"\n }, m(Alert, {\n dismissible: false\n }, app.translator.trans('flarum-nicknames.admin.wrong_driver', {\n a: m(Link, {\n href: app.route('basics')\n })\n })));\n }).registerSetting({\n setting: 'flarum-nicknames.set_on_registration',\n type: 'boolean',\n label: app.translator.trans('flarum-nicknames.admin.settings.set_on_registration_label')\n }).registerSetting({\n setting: 'flarum-nicknames.random_username',\n type: 'boolean',\n label: app.translator.trans('flarum-nicknames.admin.settings.random_username_label'),\n help: app.translator.trans('flarum-nicknames.admin.settings.random_username_help')\n }).registerSetting({\n setting: 'flarum-nicknames.unique',\n type: 'boolean',\n label: app.translator.trans('flarum-nicknames.admin.settings.unique_label')\n }).registerSetting({\n setting: 'flarum-nicknames.regex',\n type: 'text',\n label: app.translator.trans('flarum-nicknames.admin.settings.regex_label')\n }).registerSetting({\n setting: 'flarum-nicknames.min',\n type: 'number',\n label: app.translator.trans('flarum-nicknames.admin.settings.min_label')\n }).registerSetting({\n setting: 'flarum-nicknames.max',\n type: 'number',\n label: app.translator.trans('flarum-nicknames.admin.settings.max_label')\n }).registerPermission({\n icon: 'fas fa-user-tag',\n label: app.translator.trans('flarum-nicknames.admin.permissions.edit_own_nickname_label'),\n permission: 'user.editOwnNickname'\n }, 'start');\n extend(BasicsPage.prototype, 'driverLocale', function (locale) {\n locale.display_name['nickname'] = extractText(app.translator.trans('flarum-nicknames.admin.basics.display_name_driver_options.nickname'));\n });\n});"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","reg","registerSetting","m","className","dismissible","href","setting","type","label","help","registerPermission","icon","permission","extend","locale","display_name"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"file":"admin.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,IACzBH,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,+BCL9D,MAAM,EAA+BC,OAAOC,IAAIV,IAAI,OAAQ,a,aCA5D,MAAM,EAA+BS,OAAOC,IAAIV,IAAI,OAAQ,2B,aCA5D,MAAM,EAA+BS,OAAOC,IAAIV,IAAI,OAAQ,0B,aCA5D,MAAM,EAA+BS,OAAOC,IAAIV,IAAI,OAAQ,+B,aCA5D,MAAM,EAA+BS,OAAOC,IAAIV,IAAI,OAAQ,4B,aCA5D,MAAM,EAA+BS,OAAOC,IAAIV,IAAI,OAAQ,iBCM5D,qBAAqB,oBAAoB,KACvC,sBAAsB,oBAAoBW,iBAAgB,WACxD,GAA8C,aAA1C,sCACJ,OAAOC,EAAE,MAAO,CACdC,UAAW,cACVD,EAAE,IAAO,CACVE,aAAa,GACZ,qBAAqB,sCAAuC,CAC7DtB,EAAGoB,EAAE,IAAM,CACTG,KAAM,UAAU,eAGtB,IAAGJ,gBAAgB,CACjBK,QAAS,uCACTC,KAAM,UACNC,MAAO,qBAAqB,+DAC3BP,gBAAgB,CACjBK,QAAS,mCACTC,KAAM,UACNC,MAAO,qBAAqB,yDAC5BC,KAAM,qBAAqB,0DAC1BR,gBAAgB,CACjBK,QAAS,0BACTC,KAAM,UACNC,MAAO,qBAAqB,kDAC3BP,gBAAgB,CACjBK,QAAS,yBACTC,KAAM,OACNC,MAAO,qBAAqB,iDAC3BP,gBAAgB,CACjBK,QAAS,uBACTC,KAAM,SACNC,MAAO,qBAAqB,+CAC3BP,gBAAgB,CACjBK,QAAS,uBACTC,KAAM,SACNC,MAAO,qBAAqB,+CAC3BE,mBAAmB,CACpBC,KAAM,kBACNH,MAAO,qBAAqB,8DAC5BI,WAAY,wBACX,UACH,IAAAC,QAAO,cAAsB,gBAAgB,SAAUC,GACrDA,EAAOC,aAAuB,SAAI,IAAY,qBAAqB,sEACrE,GAAE,G","sources":["webpack://@flarum/nicknames/webpack/bootstrap","webpack://@flarum/nicknames/webpack/runtime/compat get default export","webpack://@flarum/nicknames/webpack/runtime/define property getters","webpack://@flarum/nicknames/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/nicknames/webpack/runtime/make namespace object","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'admin/app')\"","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/components/Alert')\"","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/components/Link')\"","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'admin/components/BasicsPage')\"","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/utils/extractText')\"","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/nicknames/./src/admin/index.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Alert');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Link');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/BasicsPage');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/extractText');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extend');","import app from 'flarum/admin/app';\nimport Alert from 'flarum/common/components/Alert';\nimport Link from 'flarum/common/components/Link';\nimport BasicsPage from 'flarum/admin/components/BasicsPage';\nimport extractText from 'flarum/common/utils/extractText';\nimport { extend } from 'flarum/common/extend';\napp.initializers.add('flarum-nicknames', () => {\n app.extensionData.for('flarum-nicknames').registerSetting(function () {\n if (app.data.settings.display_name_driver === 'nickname') return;\n return m(\"div\", {\n className: \"Form-group\"\n }, m(Alert, {\n dismissible: false\n }, app.translator.trans('flarum-nicknames.admin.wrong_driver', {\n a: m(Link, {\n href: app.route('basics')\n })\n })));\n }).registerSetting({\n setting: 'flarum-nicknames.set_on_registration',\n type: 'boolean',\n label: app.translator.trans('flarum-nicknames.admin.settings.set_on_registration_label')\n }).registerSetting({\n setting: 'flarum-nicknames.random_username',\n type: 'boolean',\n label: app.translator.trans('flarum-nicknames.admin.settings.random_username_label'),\n help: app.translator.trans('flarum-nicknames.admin.settings.random_username_help')\n }).registerSetting({\n setting: 'flarum-nicknames.unique',\n type: 'boolean',\n label: app.translator.trans('flarum-nicknames.admin.settings.unique_label')\n }).registerSetting({\n setting: 'flarum-nicknames.regex',\n type: 'text',\n label: app.translator.trans('flarum-nicknames.admin.settings.regex_label')\n }).registerSetting({\n setting: 'flarum-nicknames.min',\n type: 'number',\n label: app.translator.trans('flarum-nicknames.admin.settings.min_label')\n }).registerSetting({\n setting: 'flarum-nicknames.max',\n type: 'number',\n label: app.translator.trans('flarum-nicknames.admin.settings.max_label')\n }).registerPermission({\n icon: 'fas fa-user-tag',\n label: app.translator.trans('flarum-nicknames.admin.permissions.edit_own_nickname_label'),\n permission: 'user.editOwnNickname'\n }, 'start');\n extend(BasicsPage.prototype, 'driverLocale', function (locale) {\n locale.display_name['nickname'] = extractText(app.translator.trans('flarum-nicknames.admin.basics.display_name_driver_options.nickname'));\n });\n});"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","reg","registerSetting","m","className","dismissible","href","setting","type","label","help","registerPermission","icon","permission","extend","locale","display_name"],"sourceRoot":""}
\ No newline at end of file
diff --git a/extensions/nicknames/js/dist/forum.js b/extensions/nicknames/js/dist/forum.js
index ac54f70785..d30d3e7396 100644
--- a/extensions/nicknames/js/dist/forum.js
+++ b/extensions/nicknames/js/dist/forum.js
@@ -1,2 +1,2 @@
-(()=>{var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};(()=>{"use strict";e.r(t),e.d(t,{extend:()=>_});const n=flarum.reg.get("core","forum/app");var r=e.n(n);const a=flarum.reg.get("core","common/extend"),o=flarum.reg.get("core","common/components/Button");var i=e.n(o);const s=flarum.reg.get("core","common/utils/extractText");var c=e.n(s);const u=flarum.reg.get("core","common/utils/Stream");var l=e.n(u);const d=flarum.reg.get("core","common/components/FormModal");var f=e.n(d);function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}function h(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==p(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!==p(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"===p(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class b{constructor(){h(this,"element",void 0),h(this,"attrs",void 0),h(this,"state",void 0)}oninit(e){this.setAttrs(e.attrs)}oncreate(e){this.element=e.dom}onbeforeupdate(e){this.setAttrs(e.attrs)}onupdate(e){}onbeforeremove(e){}onremove(e){}$(e){const t=$(this.element);return e?t.find(e):t}static component(e,t){void 0===e&&(e={}),void 0===t&&(t=null);const n={...e};return m(this,n,t)}setAttrs(e){if(void 0===e&&(e={}),this.constructor.initAttrs(e),e){if("children"in e)throw new Error("[".concat(this.constructor.name,'] The "children" attribute of attrs should never be used. Either pass children in as the vnode children or rename the attribute'));if("tag"in e)throw new Error("[".concat(this.constructor.name,'] You cannot use the "tag" attribute name with Mithril 2.'))}this.attrs=e}static initAttrs(e){}}function g(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t
{this.loading=!1,m.redraw()}))):this.hide()}}flarum.reg.add("flarum-nicknames","forum/components/NicknameModal",N);const x=flarum.reg.get("core","common/extenders");var S=e.n(x);const w=flarum.reg.get("core","common/models/User");var M=e.n(w);const _=[new(S().Model)(M()).attribute("canEditNickname")];r().initializers.add("flarum/nicknames",(()=>{(0,a.extend)("flarum/forum/components/SettingsPage","accountItems",(function(e){"nickname"===r().forum.attribute("displayNameDriver")&&this.user.canEditNickname()&&e.add("changeNickname",m(i(),{className:"Button",onclick:()=>r().modal.show(N)},r().translator.trans("flarum-nicknames.forum.settings.change_nickname_button")))})),(0,a.extend)("flarum/common/components/EditUserModal","oninit",(function(){this.nickname=l()(this.attrs.user.displayName())})),(0,a.extend)("flarum/common/components/EditUserModal","fields",(function(e){"nickname"===r().forum.attribute("displayNameDriver")&&this.attrs.user.canEditNickname()&&e.add("nickname",m("div",{className:"Form-group"},m("label",null,r().translator.trans("flarum-nicknames.forum.edit_user.nicknames_heading")),m("input",{className:"FormControl",placeholder:c()(r().translator.trans("flarum-nicknames.forum.edit_user.nicknames_text")),bidi:this.nickname})),100)})),(0,a.extend)("flarum/common/components/EditUserModal","data",(function(e){"nickname"===r().forum.attribute("displayNameDriver")&&this.attrs.user.canEditNickname()&&this.nickname()!==this.attrs.user.displayName()&&(e.nickname=this.nickname())})),(0,a.extend)("flarum/forum/components/SignUpModal","oninit",(function(){"nickname"===r().forum.attribute("displayNameDriver")&&(this.nickname=l()(this.attrs.username||""))})),(0,a.extend)("flarum/forum/components/SignUpModal","onready",(function(){"nickname"===r().forum.attribute("displayNameDriver")&&r().forum.attribute("setNicknameOnRegistration")&&r().forum.attribute("randomizeUsernameOnRegistration")&&this.$("[name=nickname]").select()})),(0,a.extend)("flarum/forum/components/SignUpModal","fields",(function(e){"nickname"===r().forum.attribute("displayNameDriver")&&r().forum.attribute("setNicknameOnRegistration")&&(e.add("nickname",m("div",{className:"Form-group"},m("input",{className:"FormControl",name:"nickname",type:"text",placeholder:c()(r().translator.trans("flarum-nicknames.forum.sign_up.nickname_placeholder")),bidi:this.nickname,disabled:this.loading||this.isProvided("nickname"),required:r().forum.attribute("randomizeUsernameOnRegistration")})),25),r().forum.attribute("randomizeUsernameOnRegistration")&&e.remove("username"))})),(0,a.extend)("flarum/forum/components/SignUpModal","submitData",(function(e){if("nickname"===r().forum.attribute("displayNameDriver")&&r().forum.attribute("setNicknameOnRegistration")&&(e.nickname=this.nickname(),r().forum.attribute("randomizeUsernameOnRegistration"))){const t=new Uint32Array(2);crypto.getRandomValues(t),e.username=t.join("")}}))}))})(),module.exports=t})();
+(()=>{var e={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return e.d(n,{a:n}),n},d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};(()=>{"use strict";e.r(t),e.d(t,{extend:()=>_});const n=flarum.reg.get("core","forum/app");var r=e.n(n);const a=flarum.reg.get("core","common/extend"),o=flarum.reg.get("core","common/components/Button");var i=e.n(o);const s=flarum.reg.get("core","common/utils/extractText");var c=e.n(s);const u=flarum.reg.get("core","common/utils/Stream");var l=e.n(u);const d=flarum.reg.get("core","common/components/FormModal");var f=e.n(d);function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}function h(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==p(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t);if("object"!==p(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"===p(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class b{constructor(){h(this,"element",void 0),h(this,"attrs",void 0),h(this,"state",void 0)}oninit(e){this.setAttrs(e.attrs)}oncreate(e){this.element=e.dom}onbeforeupdate(e){this.setAttrs(e.attrs)}onupdate(e){}onbeforeremove(e){}onremove(e){}$(e){const t=$(this.element);return e?t.find(e):t}static component(e,t){void 0===e&&(e={}),void 0===t&&(t=null);const n={...e};return m(this,n,t)}setAttrs(e){if(void 0===e&&(e={}),this.constructor.initAttrs(e),e){if("children"in e)throw new Error("[".concat(this.constructor.name,'] The "children" attribute of attrs should never be used. Either pass children in as the vnode children or rename the attribute'));if("tag"in e)throw new Error("[".concat(this.constructor.name,'] You cannot use the "tag" attribute name with Mithril 2.'))}this.attrs=e}static initAttrs(e){}}function g(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t{this.loading=!1,m.redraw()}))):this.hide()}}flarum.reg.add("flarum-nicknames","forum/components/NicknameModal",N);const x=flarum.reg.get("core","common/extenders");var S=e.n(x);const w=flarum.reg.get("core","common/models/User");var M=e.n(w);const _=[new(S().Model)(M()).attribute("canEditNickname")];r().initializers.add("flarum-nicknames",(()=>{(0,a.extend)("flarum/forum/components/SettingsPage","accountItems",(function(e){"nickname"===r().forum.attribute("displayNameDriver")&&this.user.canEditNickname()&&e.add("changeNickname",m(i(),{className:"Button",onclick:()=>r().modal.show(N)},r().translator.trans("flarum-nicknames.forum.settings.change_nickname_button")))})),(0,a.extend)("flarum/common/components/EditUserModal","oninit",(function(){this.nickname=l()(this.attrs.user.displayName())})),(0,a.extend)("flarum/common/components/EditUserModal","fields",(function(e){"nickname"===r().forum.attribute("displayNameDriver")&&this.attrs.user.canEditNickname()&&e.add("nickname",m("div",{className:"Form-group"},m("label",null,r().translator.trans("flarum-nicknames.forum.edit_user.nicknames_heading")),m("input",{className:"FormControl",placeholder:c()(r().translator.trans("flarum-nicknames.forum.edit_user.nicknames_text")),bidi:this.nickname})),100)})),(0,a.extend)("flarum/common/components/EditUserModal","data",(function(e){"nickname"===r().forum.attribute("displayNameDriver")&&this.attrs.user.canEditNickname()&&this.nickname()!==this.attrs.user.displayName()&&(e.nickname=this.nickname())})),(0,a.extend)("flarum/forum/components/SignUpModal","oninit",(function(){"nickname"===r().forum.attribute("displayNameDriver")&&(this.nickname=l()(this.attrs.username||""))})),(0,a.extend)("flarum/forum/components/SignUpModal","onready",(function(){"nickname"===r().forum.attribute("displayNameDriver")&&r().forum.attribute("setNicknameOnRegistration")&&r().forum.attribute("randomizeUsernameOnRegistration")&&this.$("[name=nickname]").select()})),(0,a.extend)("flarum/forum/components/SignUpModal","fields",(function(e){"nickname"===r().forum.attribute("displayNameDriver")&&r().forum.attribute("setNicknameOnRegistration")&&(e.add("nickname",m("div",{className:"Form-group"},m("input",{className:"FormControl",name:"nickname",type:"text",placeholder:c()(r().translator.trans("flarum-nicknames.forum.sign_up.nickname_placeholder")),bidi:this.nickname,disabled:this.loading||this.isProvided("nickname"),required:r().forum.attribute("randomizeUsernameOnRegistration")})),25),r().forum.attribute("randomizeUsernameOnRegistration")&&e.remove("username"))})),(0,a.extend)("flarum/forum/components/SignUpModal","submitData",(function(e){if("nickname"===r().forum.attribute("displayNameDriver")&&r().forum.attribute("setNicknameOnRegistration")&&(e.nickname=this.nickname(),r().forum.attribute("randomizeUsernameOnRegistration"))){const t=new Uint32Array(2);crypto.getRandomValues(t),e.username=t.join("")}}))}))})(),module.exports=t})();
//# sourceMappingURL=forum.js.map
\ No newline at end of file
diff --git a/extensions/nicknames/js/dist/forum.js.map b/extensions/nicknames/js/dist/forum.js.map
index f6134ab089..6b7c0958f8 100644
--- a/extensions/nicknames/js/dist/forum.js.map
+++ b/extensions/nicknames/js/dist/forum.js.map
@@ -1 +1 @@
-{"version":3,"file":"forum.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,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AAK2C,WACjB,oBAAoB,oCAAoC,CAC1D,MAAM+B,EAAM,IAAIC,YAAY,GAC5BC,OAAOC,gBAAgBH,GACvBN,EAAKC,SAAWK,EAAII,KAAK,GAC3B,CAEJ,GAAE,G","sources":["webpack://@flarum/nicknames/webpack/bootstrap","webpack://@flarum/nicknames/webpack/runtime/compat get default export","webpack://@flarum/nicknames/webpack/runtime/define property getters","webpack://@flarum/nicknames/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/nicknames/webpack/runtime/make namespace object","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'forum/app')\"","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/components/Button')\"","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/utils/extractText')\"","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/utils/Stream')\"","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/components/FormModal')\"","webpack://@flarum/nicknames/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://@flarum/nicknames/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://@flarum/nicknames/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://@flarum/nicknames/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://@flarum/nicknames/../../../framework/core/js/src/common/Component.ts","webpack://@flarum/nicknames/../../../node_modules/clsx/dist/clsx.m.js","webpack://@flarum/nicknames/../../../framework/core/js/src/common/utils/classList.ts","webpack://@flarum/nicknames/../../../framework/core/js/src/common/components/Form.tsx","webpack://@flarum/nicknames/./src/forum/components/NicknameModal.js","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/extenders')\"","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/models/User')\"","webpack://@flarum/nicknames/./src/forum/extend.ts","webpack://@flarum/nicknames/./src/forum/index.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extend');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Button');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/extractText');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/Stream');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/FormModal');","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}","import _typeof from \"./typeof.js\";\nexport default function _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\n/**\n * The `Component` class defines a user interface 'building block'. A component\n * generates a virtual DOM to be rendered on each redraw.\n *\n * Essentially, this is a wrapper for Mithril's components that adds several useful features:\n *\n * - In the `oninit` and `onbeforeupdate` lifecycle hooks, we store vnode attrs in `this.attrs.\n * This allows us to use attrs across components without having to pass the vnode to every single\n * method.\n * - The static `initAttrs` method allows a convenient way to provide defaults (or to otherwise modify)\n * the attrs that have been passed into a component.\n * - When the component is created in the DOM, we store its DOM element under `this.element`; this lets\n * us use jQuery to modify child DOM state from internal methods via the `this.$()` method.\n * - A convenience `component` method, which serves as an alternative to hyperscript and JSX.\n *\n * As with other Mithril components, components extending Component can be initialized\n * and nested using JSX, hyperscript, or a combination of both. The `component` method can also\n * be used.\n *\n * @example\n * return m('div', Hello World
);\n *\n * @example\n * return m('div', MyComponent.component({foo: 'bar'), m('p', 'Hello World!'));\n *\n * @see https://mithril.js.org/components.html\n */\nexport default class Component {\n constructor() {\n /**\n * The root DOM element for the component.\n */\n _defineProperty(this, \"element\", void 0);\n /**\n * The attributes passed into the component.\n *\n * @see https://mithril.js.org/components.html#passing-data-to-components\n */\n _defineProperty(this, \"attrs\", void 0);\n /**\n * Class component state that is persisted between redraws.\n *\n * Updating this will **not** automatically trigger a redraw, unlike\n * other frameworks.\n *\n * This is different to Vnode state, which is always an instance of your\n * class component.\n *\n * This is `undefined` by default.\n */\n _defineProperty(this, \"state\", void 0);\n }\n /**\n * @inheritdoc\n */\n /**\n * @inheritdoc\n */\n oninit(vnode) {\n this.setAttrs(vnode.attrs);\n }\n\n /**\n * @inheritdoc\n */\n oncreate(vnode) {\n this.element = vnode.dom;\n }\n\n /**\n * @inheritdoc\n */\n onbeforeupdate(vnode) {\n this.setAttrs(vnode.attrs);\n }\n\n /**\n * @inheritdoc\n */\n onupdate(vnode) {}\n\n /**\n * @inheritdoc\n */\n onbeforeremove(vnode) {}\n\n /**\n * @inheritdoc\n */\n onremove(vnode) {}\n\n /**\n * Returns a jQuery object for this component's element. If you pass in a\n * selector string, this method will return a jQuery object, using the current\n * element as its buffer.\n *\n * For example, calling `component.$('li')` will return a jQuery object\n * containing all of the `li` elements inside the DOM element of this\n * component.\n *\n * @param [selector] a jQuery-compatible selector string\n * @returns the jQuery object for the DOM node\n * @final\n */\n $(selector) {\n const $element = $(this.element);\n return selector ? $element.find(selector) : $element;\n }\n\n /**\n * Convenience method to attach a component without JSX.\n * Has the same effect as calling `m(THIS_CLASS, attrs, children)`.\n *\n * @see https://mithril.js.org/hyperscript.html#mselector,-attributes,-children\n */\n static component(attrs, children) {\n if (attrs === void 0) {\n attrs = {};\n }\n if (children === void 0) {\n children = null;\n }\n const componentAttrs = {\n ...attrs\n };\n return m(this, componentAttrs, children);\n }\n\n /**\n * Saves a reference to the vnode attrs after running them through initAttrs,\n * and checking for common issues.\n */\n setAttrs(attrs) {\n if (attrs === void 0) {\n attrs = {};\n }\n this.constructor.initAttrs(attrs);\n if (attrs) {\n if ('children' in attrs) {\n throw new Error(\"[\".concat(this.constructor.name, \"] The \\\"children\\\" attribute of attrs should never be used. Either pass children in as the vnode children or rename the attribute\"));\n }\n if ('tag' in attrs) {\n throw new Error(\"[\".concat(this.constructor.name, \"] You cannot use the \\\"tag\\\" attribute name with Mithril 2.\"));\n }\n }\n this.attrs = attrs;\n }\n\n /**\n * Initialize the component's attrs.\n *\n * This can be used to assign default values for missing, optional attrs.\n */\n static initAttrs(attrs) {}\n}\nflarum.reg.add('flarum-nicknames', '../../../../framework/core/js/src/common/Component', Component);","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e))for(t=0;t {\n this.loading = false;\n m.redraw();\n });\n }\n}\nflarum.reg.add('flarum-nicknames', 'forum/components/NicknameModal', NicknameModal);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extenders');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/models/User');","import Extend from 'flarum/common/extenders';\nimport User from 'flarum/common/models/User';\nexport default [new Extend.Model(User) //\n.attribute('canEditNickname')];","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport Button from 'flarum/common/components/Button';\nimport extractText from 'flarum/common/utils/extractText';\nimport Stream from 'flarum/common/utils/Stream';\nimport NickNameModal from './components/NicknameModal';\nexport { default as extend } from './extend';\napp.initializers.add('flarum/nicknames', () => {\n extend('flarum/forum/components/SettingsPage', 'accountItems', function (items) {\n if (app.forum.attribute('displayNameDriver') !== 'nickname') return;\n if (this.user.canEditNickname()) {\n items.add('changeNickname', m(Button, {\n className: \"Button\",\n onclick: () => app.modal.show(NickNameModal)\n }, app.translator.trans('flarum-nicknames.forum.settings.change_nickname_button')));\n }\n });\n extend('flarum/common/components/EditUserModal', 'oninit', function () {\n this.nickname = Stream(this.attrs.user.displayName());\n });\n extend('flarum/common/components/EditUserModal', 'fields', function (items) {\n if (app.forum.attribute('displayNameDriver') !== 'nickname') return;\n if (!this.attrs.user.canEditNickname()) return;\n items.add('nickname', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-nicknames.forum.edit_user.nicknames_heading')), m(\"input\", {\n className: \"FormControl\",\n placeholder: extractText(app.translator.trans('flarum-nicknames.forum.edit_user.nicknames_text')),\n bidi: this.nickname\n })), 100);\n });\n extend('flarum/common/components/EditUserModal', 'data', function (data) {\n if (app.forum.attribute('displayNameDriver') !== 'nickname') return;\n if (!this.attrs.user.canEditNickname()) return;\n if (this.nickname() !== this.attrs.user.displayName()) {\n data.nickname = this.nickname();\n }\n });\n extend('flarum/forum/components/SignUpModal', 'oninit', function () {\n if (app.forum.attribute('displayNameDriver') !== 'nickname') return;\n this.nickname = Stream(this.attrs.username || '');\n });\n extend('flarum/forum/components/SignUpModal', 'onready', function () {\n if (app.forum.attribute('displayNameDriver') !== 'nickname') return;\n if (app.forum.attribute('setNicknameOnRegistration') && app.forum.attribute('randomizeUsernameOnRegistration')) {\n this.$('[name=nickname]').select();\n }\n });\n extend('flarum/forum/components/SignUpModal', 'fields', function (items) {\n if (app.forum.attribute('displayNameDriver') !== 'nickname') return;\n if (app.forum.attribute('setNicknameOnRegistration')) {\n items.add('nickname', m(\"div\", {\n className: \"Form-group\"\n }, m(\"input\", {\n className: \"FormControl\",\n name: \"nickname\",\n type: \"text\",\n placeholder: extractText(app.translator.trans('flarum-nicknames.forum.sign_up.nickname_placeholder')),\n bidi: this.nickname,\n disabled: this.loading || this.isProvided('nickname'),\n required: app.forum.attribute('randomizeUsernameOnRegistration')\n })), 25);\n if (app.forum.attribute('randomizeUsernameOnRegistration')) {\n items.remove('username');\n }\n }\n });\n extend('flarum/forum/components/SignUpModal', 'submitData', function (data) {\n if (app.forum.attribute('displayNameDriver') !== 'nickname') return;\n if (app.forum.attribute('setNicknameOnRegistration')) {\n data.nickname = this.nickname();\n if (app.forum.attribute('randomizeUsernameOnRegistration')) {\n const arr = new Uint32Array(2);\n crypto.getRandomValues(arr);\n data.username = arr.join('');\n }\n }\n });\n});"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","reg","_typeof","iterator","constructor","_defineProperty","arg","input","hint","prim","toPrimitive","undefined","res","TypeError","String","toPropertyKey","configurable","writable","Component","this","oninit","vnode","setAttrs","attrs","oncreate","element","dom","onbeforeupdate","onupdate","onbeforeremove","onremove","$","selector","$element","find","static","children","componentAttrs","m","initAttrs","Error","concat","name","r","e","t","f","n","Array","isArray","length","add","classList","arguments","Form","view","label","description","className","assign","NicknameModal","super","nickname","title","content","type","autocomplete","bidi","disabled","loading","onsubmit","preventDefault","errorHandler","onerror","bind","then","hide","catch","redraw","attribute","extend","items","user","canEditNickname","onclick","displayName","placeholder","data","username","select","isProvided","required","remove","arr","Uint32Array","crypto","getRandomValues","join"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"file":"forum.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,qDCL9D,MAAM,EAA+BC,OAAOC,IAAIV,IAAI,OAAQ,a,aCA5D,MAAM,EAA+BS,OAAOC,IAAIV,IAAI,OAAQ,iBCAtD,EAA+BS,OAAOC,IAAIV,IAAI,OAAQ,4B,aCA5D,MAAM,EAA+BS,OAAO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AE,mBAAmB0D,QAE9B,KACA,IAAAT,QAAO,sCAAuC,UAAU,SAAUC,GACf,aAA7C,oBAAoB,sBACpB,oBAAoB,+BACtBA,EAAM9B,IAAI,WAAYb,EAAE,MAAO,CAC7BoB,UAAW,cACVpB,EAAE,QAAS,CACZoB,UAAW,cACXhB,KAAM,WACNuB,KAAM,OACNqB,YAAa,IAAY,qBAAqB,wDAC9CnB,KAAMhD,KAAK2C,SACXM,SAAUjD,KAAKkD,SAAWlD,KAAKuE,WAAW,YAC1CC,SAAU,oBAAoB,sCAC3B,IACD,oBAAoB,oCACtBV,EAAMW,OAAO,YAGnB,KACA,IAAAZ,QAAO,sCAAuC,cAAc,SAAUO,GACpE,GAAiD,aAA7C,oBAAoB,sBACpB,oBAAoB,+BACtBA,EAAKzB,SAAW3C,KAAK2C,WACjB,oBAAoB,oCAAoC,CAC1D,MAAM+B,EAAM,IAAIC,YAAY,GAC5BC,OAAOC,gBAAgBH,GACvBN,EAAKC,SAAWK,EAAII,KAAK,GAC3B,CAEJ,GAAE,G","sources":["webpack://@flarum/nicknames/webpack/bootstrap","webpack://@flarum/nicknames/webpack/runtime/compat get default export","webpack://@flarum/nicknames/webpack/runtime/define property getters","webpack://@flarum/nicknames/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/nicknames/webpack/runtime/make namespace object","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'forum/app')\"","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/components/Button')\"","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/utils/extractText')\"","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/utils/Stream')\"","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/components/FormModal')\"","webpack://@flarum/nicknames/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://@flarum/nicknames/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://@flarum/nicknames/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://@flarum/nicknames/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://@flarum/nicknames/../../../framework/core/js/src/common/Component.ts","webpack://@flarum/nicknames/../../../node_modules/clsx/dist/clsx.m.js","webpack://@flarum/nicknames/../../../framework/core/js/src/common/utils/classList.ts","webpack://@flarum/nicknames/../../../framework/core/js/src/common/components/Form.tsx","webpack://@flarum/nicknames/./src/forum/components/NicknameModal.js","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/extenders')\"","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/models/User')\"","webpack://@flarum/nicknames/./src/forum/extend.ts","webpack://@flarum/nicknames/./src/forum/index.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extend');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Button');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/extractText');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/Stream');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/FormModal');","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}","import _typeof from \"./typeof.js\";\nexport default function _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\n/**\n * The `Component` class defines a user interface 'building block'. A component\n * generates a virtual DOM to be rendered on each redraw.\n *\n * Essentially, this is a wrapper for Mithril's components that adds several useful features:\n *\n * - In the `oninit` and `onbeforeupdate` lifecycle hooks, we store vnode attrs in `this.attrs.\n * This allows us to use attrs across components without having to pass the vnode to every single\n * method.\n * - The static `initAttrs` method allows a convenient way to provide defaults (or to otherwise modify)\n * the attrs that have been passed into a component.\n * - When the component is created in the DOM, we store its DOM element under `this.element`; this lets\n * us use jQuery to modify child DOM state from internal methods via the `this.$()` method.\n * - A convenience `component` method, which serves as an alternative to hyperscript and JSX.\n *\n * As with other Mithril components, components extending Component can be initialized\n * and nested using JSX, hyperscript, or a combination of both. The `component` method can also\n * be used.\n *\n * @example\n * return m('div', Hello World
);\n *\n * @example\n * return m('div', MyComponent.component({foo: 'bar'), m('p', 'Hello World!'));\n *\n * @see https://mithril.js.org/components.html\n */\nexport default class Component {\n constructor() {\n /**\n * The root DOM element for the component.\n */\n _defineProperty(this, \"element\", void 0);\n /**\n * The attributes passed into the component.\n *\n * @see https://mithril.js.org/components.html#passing-data-to-components\n */\n _defineProperty(this, \"attrs\", void 0);\n /**\n * Class component state that is persisted between redraws.\n *\n * Updating this will **not** automatically trigger a redraw, unlike\n * other frameworks.\n *\n * This is different to Vnode state, which is always an instance of your\n * class component.\n *\n * This is `undefined` by default.\n */\n _defineProperty(this, \"state\", void 0);\n }\n /**\n * @inheritdoc\n */\n /**\n * @inheritdoc\n */\n oninit(vnode) {\n this.setAttrs(vnode.attrs);\n }\n\n /**\n * @inheritdoc\n */\n oncreate(vnode) {\n this.element = vnode.dom;\n }\n\n /**\n * @inheritdoc\n */\n onbeforeupdate(vnode) {\n this.setAttrs(vnode.attrs);\n }\n\n /**\n * @inheritdoc\n */\n onupdate(vnode) {}\n\n /**\n * @inheritdoc\n */\n onbeforeremove(vnode) {}\n\n /**\n * @inheritdoc\n */\n onremove(vnode) {}\n\n /**\n * Returns a jQuery object for this component's element. If you pass in a\n * selector string, this method will return a jQuery object, using the current\n * element as its buffer.\n *\n * For example, calling `component.$('li')` will return a jQuery object\n * containing all of the `li` elements inside the DOM element of this\n * component.\n *\n * @param [selector] a jQuery-compatible selector string\n * @returns the jQuery object for the DOM node\n * @final\n */\n $(selector) {\n const $element = $(this.element);\n return selector ? $element.find(selector) : $element;\n }\n\n /**\n * Convenience method to attach a component without JSX.\n * Has the same effect as calling `m(THIS_CLASS, attrs, children)`.\n *\n * @see https://mithril.js.org/hyperscript.html#mselector,-attributes,-children\n */\n static component(attrs, children) {\n if (attrs === void 0) {\n attrs = {};\n }\n if (children === void 0) {\n children = null;\n }\n const componentAttrs = {\n ...attrs\n };\n return m(this, componentAttrs, children);\n }\n\n /**\n * Saves a reference to the vnode attrs after running them through initAttrs,\n * and checking for common issues.\n */\n setAttrs(attrs) {\n if (attrs === void 0) {\n attrs = {};\n }\n this.constructor.initAttrs(attrs);\n if (attrs) {\n if ('children' in attrs) {\n throw new Error(\"[\".concat(this.constructor.name, \"] The \\\"children\\\" attribute of attrs should never be used. Either pass children in as the vnode children or rename the attribute\"));\n }\n if ('tag' in attrs) {\n throw new Error(\"[\".concat(this.constructor.name, \"] You cannot use the \\\"tag\\\" attribute name with Mithril 2.\"));\n }\n }\n this.attrs = attrs;\n }\n\n /**\n * Initialize the component's attrs.\n *\n * This can be used to assign default values for missing, optional attrs.\n */\n static initAttrs(attrs) {}\n}\nflarum.reg.add('flarum-nicknames', '../../../../framework/core/js/src/common/Component', Component);","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e))for(t=0;t {\n this.loading = false;\n m.redraw();\n });\n }\n}\nflarum.reg.add('flarum-nicknames', 'forum/components/NicknameModal', NicknameModal);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extenders');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/models/User');","import Extend from 'flarum/common/extenders';\nimport User from 'flarum/common/models/User';\nexport default [new Extend.Model(User) //\n.attribute('canEditNickname')];","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport Button from 'flarum/common/components/Button';\nimport extractText from 'flarum/common/utils/extractText';\nimport Stream from 'flarum/common/utils/Stream';\nimport NickNameModal from './components/NicknameModal';\nexport { default as extend } from './extend';\napp.initializers.add('flarum-nicknames', () => {\n extend('flarum/forum/components/SettingsPage', 'accountItems', function (items) {\n if (app.forum.attribute('displayNameDriver') !== 'nickname') return;\n if (this.user.canEditNickname()) {\n items.add('changeNickname', m(Button, {\n className: \"Button\",\n onclick: () => app.modal.show(NickNameModal)\n }, app.translator.trans('flarum-nicknames.forum.settings.change_nickname_button')));\n }\n });\n extend('flarum/common/components/EditUserModal', 'oninit', function () {\n this.nickname = Stream(this.attrs.user.displayName());\n });\n extend('flarum/common/components/EditUserModal', 'fields', function (items) {\n if (app.forum.attribute('displayNameDriver') !== 'nickname') return;\n if (!this.attrs.user.canEditNickname()) return;\n items.add('nickname', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-nicknames.forum.edit_user.nicknames_heading')), m(\"input\", {\n className: \"FormControl\",\n placeholder: extractText(app.translator.trans('flarum-nicknames.forum.edit_user.nicknames_text')),\n bidi: this.nickname\n })), 100);\n });\n extend('flarum/common/components/EditUserModal', 'data', function (data) {\n if (app.forum.attribute('displayNameDriver') !== 'nickname') return;\n if (!this.attrs.user.canEditNickname()) return;\n if (this.nickname() !== this.attrs.user.displayName()) {\n data.nickname = this.nickname();\n }\n });\n extend('flarum/forum/components/SignUpModal', 'oninit', function () {\n if (app.forum.attribute('displayNameDriver') !== 'nickname') return;\n this.nickname = Stream(this.attrs.username || '');\n });\n extend('flarum/forum/components/SignUpModal', 'onready', function () {\n if (app.forum.attribute('displayNameDriver') !== 'nickname') return;\n if (app.forum.attribute('setNicknameOnRegistration') && app.forum.attribute('randomizeUsernameOnRegistration')) {\n this.$('[name=nickname]').select();\n }\n });\n extend('flarum/forum/components/SignUpModal', 'fields', function (items) {\n if (app.forum.attribute('displayNameDriver') !== 'nickname') return;\n if (app.forum.attribute('setNicknameOnRegistration')) {\n items.add('nickname', m(\"div\", {\n className: \"Form-group\"\n }, m(\"input\", {\n className: \"FormControl\",\n name: \"nickname\",\n type: \"text\",\n placeholder: extractText(app.translator.trans('flarum-nicknames.forum.sign_up.nickname_placeholder')),\n bidi: this.nickname,\n disabled: this.loading || this.isProvided('nickname'),\n required: app.forum.attribute('randomizeUsernameOnRegistration')\n })), 25);\n if (app.forum.attribute('randomizeUsernameOnRegistration')) {\n items.remove('username');\n }\n }\n });\n extend('flarum/forum/components/SignUpModal', 'submitData', function (data) {\n if (app.forum.attribute('displayNameDriver') !== 'nickname') return;\n if (app.forum.attribute('setNicknameOnRegistration')) {\n data.nickname = this.nickname();\n if (app.forum.attribute('randomizeUsernameOnRegistration')) {\n const arr = new Uint32Array(2);\n crypto.getRandomValues(arr);\n data.username = arr.join('');\n }\n }\n });\n});"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","reg","_typeof","iterator","constructor","_defineProperty","arg","input","hint","prim","toPrimitive","undefined","res","TypeError","String","toPropertyKey","configurable","writable","Component","this","oninit","vnode","setAttrs","attrs","oncreate","element","dom","onbeforeupdate","onupdate","onbeforeremove","onremove","$","selector","$element","find","static","children","componentAttrs","m","initAttrs","Error","concat","name","r","e","t","f","n","Array","isArray","length","add","classList","arguments","Form","view","label","description","className","assign","NicknameModal","super","nickname","title","content","type","autocomplete","bidi","disabled","loading","onsubmit","preventDefault","errorHandler","onerror","bind","then","hide","catch","redraw","attribute","extend","items","user","canEditNickname","onclick","displayName","placeholder","data","username","select","isProvided","required","remove","arr","Uint32Array","crypto","getRandomValues","join"],"sourceRoot":""}
\ No newline at end of file
diff --git a/extensions/subscriptions/js/dist/forum.js b/extensions/subscriptions/js/dist/forum.js
index 119e1de14f..51b952dfa8 100644
--- a/extensions/subscriptions/js/dist/forum.js
+++ b/extensions/subscriptions/js/dist/forum.js
@@ -1,2 +1,2 @@
-(()=>{var o={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return o.d(n,{a:n}),n},d:(t,n)=>{for(var r in n)o.o(n,r)&&!o.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(o,t)=>Object.prototype.hasOwnProperty.call(o,t),r:o=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})}},t={};(()=>{"use strict";o.r(t),o.d(t,{extend:()=>V});const n=flarum.reg.get("core","common/extend"),r=flarum.reg.get("core","forum/app");var s=o.n(r);const e=flarum.reg.get("core","common/models/Discussion");var i=o.n(e);const a=flarum.reg.get("core","common/components/Badge");var l=o.n(a);const u=flarum.reg.get("core","common/components/Button");var c=o.n(u);const f=flarum.reg.get("core","forum/components/DiscussionPage");var p=o.n(f);const b=flarum.reg.get("core","forum/utils/DiscussionControls");var g=o.n(b);function d(o){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},d(o)}function _(o,t,n){return(t=function(o){var t=function(o,t){if("object"!==d(o)||null===o)return o;var n=o[Symbol.toPrimitive];if(void 0!==n){var r=n.call(o,t);if("object"!==d(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(o)}(o,"string");return"symbol"===d(t)?t:String(t)}(t))in o?Object.defineProperty(o,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):o[t]=n,o}const y=flarum.reg.get("core","common/components/Dropdown");var w=o.n(y);const v=flarum.reg.get("core","common/utils/extractText");var h=o.n(v);const S=flarum.reg.get("core","common/components/DetailedDropdownItem");var x=o.n(S);const P=flarum.reg.get("core","common/components/SplitDropdown");var A=o.n(P);class N extends(w()){constructor(){super(...arguments),_(this,"options",[{subscription:null,icon:"far fa-star",label:s().translator.trans("flarum-subscriptions.forum.sub_controls.not_following_button"),description:s().translator.trans("flarum-subscriptions.forum.sub_controls.not_following_text")},{subscription:"follow",icon:"fas fa-star",label:s().translator.trans("flarum-subscriptions.forum.sub_controls.following_button"),description:s().translator.trans("flarum-subscriptions.forum.sub_controls.following_text")},{subscription:"ignore",icon:"far fa-eye-slash",label:s().translator.trans("flarum-subscriptions.forum.sub_controls.ignoring_button"),description:s().translator.trans("flarum-subscriptions.forum.sub_controls.ignoring_text")}]),_(this,"possibleButtonAttrs",{null:{icon:"far fa-star",label:s().translator.trans("flarum-subscriptions.forum.sub_controls.follow_button")},follow:{icon:"fas fa-star",label:s().translator.trans("flarum-subscriptions.forum.sub_controls.following_button")},ignore:{icon:"far fa-eye-slash",label:s().translator.trans("flarum-subscriptions.forum.sub_controls.ignoring_button")}})}view(){const o=this.attrs.discussion,t=o.subscription(),n=this.possibleButtonAttrs[t],r=s().session.user.preferences(),e=r.notify_newPost_email,i=r.notify_newPost_alert,a=h()(s().translator.trans(e?"flarum-subscriptions.forum.sub_controls.notify_email_tooltip":"flarum-subscriptions.forum.sub_controls.notify_alert_tooltip")),l=(e||i)&&null===t;return m(A(),{className:"SubscriptionMenu",buttonClassName:"SubscriptionMenu-button--".concat(t),tooltip:l?a:null,mainAction:m(c(),{className:"SubscriptionMenu-button",icon:n.icon,onclick:this.saveSubscription.bind(this,o,-1!==["follow","ignore"].indexOf(t)?null:"follow")},n.label)},this.options.map((n=>m(x(),Object.assign({},n,{onclick:this.saveSubscription.bind(this,o,n.subscription),active:t===n.subscription})))))}saveSubscription(o,t){o.save({subscription:t}),this.$(".SubscriptionMenu-button").tooltip("hide")}}flarum.reg.add("flarum-subscriptions","forum/components/SubscriptionMenu",N);const k=flarum.reg.get("core","common/components/LinkButton");var j=o.n(k);const M=flarum.reg.get("core","forum/components/IndexPage");var D=o.n(M);const F=flarum.reg.get("core","forum/components/IndexSidebar");var L=o.n(F);const O=flarum.reg.get("core","forum/states/DiscussionListState");var I=o.n(O);const R=flarum.reg.get("core","forum/states/GlobalSearchState");var T=o.n(R);const B=flarum.reg.get("core","common/components/Switch");var G=o.n(B);const q=flarum.reg.get("core","common/extenders");var C=o.n(q);const K=flarum.reg.get("core","common/app");var z=o.n(K);const E=flarum.reg.get("core","common/query/IGambit");class U extends E.BooleanGambit{key(){return[z().translator.trans("flarum-subscriptions.lib.gambits.discussions.subscription.following_key",{},!0),z().translator.trans("flarum-subscriptions.lib.gambits.discussions.subscription.ignoring_key",{},!0)]}toFilter(o,t){return{[(t?"-":"")+this.filterKey()]:o[1]}}filterKey(){return"subscription"}fromFilter(o,t){return"".concat(t?"-":"","is:").concat(o)}enabled(){return!!z().session.user}}flarum.reg.add("flarum-subscriptions","common/query/discussions/SubscriptionGambit",U);const $=[(new(C().Search)).gambit("discussions",U)],H=flarum.reg.get("core","forum/components/Notification");var J=o.n(H);class Q extends(J()){icon(){return"fas fa-star"}href(){const o=this.attrs.notification,t=o.subject(),n=o.content()||{};return s().route.discussion(t,n.postNumber)}content(){return s().translator.trans("flarum-subscriptions.forum.notifications.new_post_text",{user:this.attrs.notification.fromUser()})}excerpt(){return null}}flarum.reg.add("flarum-subscriptions","forum/components/NewPostNotification",Q);const V=[...$,(new(C().Routes)).add("following","/following",D()),(new(C().Notification)).add("newPost",Q),new(C().Model)(i()).attribute("subscription")];s().initializers.add("subscriptions",(function(){(0,n.extend)(i().prototype,"badges",(function(o){let t;switch(this.subscription()){case"follow":t=m(l(),{label:s().translator.trans("flarum-subscriptions.forum.badge.following_tooltip"),icon:"fas fa-star",type:"following"});break;case"ignore":t=m(l(),{label:s().translator.trans("flarum-subscriptions.forum.badge.ignoring_tooltip"),icon:"far fa-eye-slash",type:"ignoring"})}t&&o.add("subscription",t)})),(0,n.extend)(g(),"userControls",(function(o,t,n){if(s().session.user&&!(n instanceof p())){const n={none:{label:s().translator.trans("flarum-subscriptions.forum.discussion_controls.follow_button"),icon:"fas fa-star",save:"follow"},follow:{label:s().translator.trans("flarum-subscriptions.forum.discussion_controls.unfollow_button"),icon:"far fa-star",save:null},ignore:{label:s().translator.trans("flarum-subscriptions.forum.discussion_controls.unignore_button"),icon:"fas fa-eye",save:null}},r=t.subscription()||"none";o.add("subscription",m(c(),{icon:n[r].icon,onclick:t.save.bind(t,{subscription:n[r].save})},n[r].label))}})),(0,n.extend)(p().prototype,"sidebarItems",(function(o){if(s().session.user){const t=this.discussion;o.add("subscription",m(N,{discussion:t}),80)}})),(0,n.extend)(L().prototype,"navItems",(function(o){if(s().session.user){const t=s().search.state.stickyParams();o.add("following",m(j(),{href:s().route("following",t),icon:"fas fa-star"},s().translator.trans("flarum-subscriptions.forum.index.following_link")),50)}})),(0,n.extend)(D().prototype,"setTitle",(function(){"following"===s().current.get("routeName")&&s().setTitle(s().translator.trans("flarum-subscriptions.forum.following.meta_title_text"))})),(0,n.extend)(T().prototype,"params",(function(o){o.onFollowing="following"===s().current.get("routeName")})),(0,n.extend)(I().prototype,"requestParams",(function(o){this.params.onFollowing&&(o.filter||(o.filter={}),o.filter.subscription="following")})),(0,n.extend)("flarum/forum/components/SettingsPage","notificationsItems",(function(o){var t;o.add("followAfterReply",m(G(),{state:this.user.preferences().followAfterReply,onchange:o=>{this.followAfterReplyLoading=!0,this.user.savePreferences({followAfterReply:o}).then((()=>{this.followAfterReplyLoading=!1,m.redraw()}))},loading:this.followAfterReplyLoading},s().translator.trans("flarum-subscriptions.forum.settings.follow_after_reply_label"))),o.add("notifyForAllPosts",m(G(),{id:"flarum_subscriptions__notify_for_all_posts",state:!(null==(t=this.user.preferences())||!t["flarum-subscriptions.notify_for_all_posts"]),onchange:o=>{this.notifyForAllPostsLoading=!0,this.user.savePreferences({"flarum-subscriptions.notify_for_all_posts":o}).then((()=>{this.notifyForAllPostsLoading=!1,m.redraw()}))},loading:this.notifyForAllPostsLoading},s().translator.trans("flarum-subscriptions.forum.settings.notify_for_all_posts_label")))})),(0,n.extend)("flarum/forum/components/NotificationGrid","notificationTypes",(function(o){o.add("newPost",{name:"newPost",icon:"fas fa-star",label:s().translator.trans("flarum-subscriptions.forum.settings.notify_new_post_label")})}))}))})(),module.exports=t})();
+(()=>{var o={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return o.d(n,{a:n}),n},d:(t,n)=>{for(var r in n)o.o(n,r)&&!o.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(o,t)=>Object.prototype.hasOwnProperty.call(o,t),r:o=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})}},t={};(()=>{"use strict";o.r(t),o.d(t,{extend:()=>V});const n=flarum.reg.get("core","common/extend"),r=flarum.reg.get("core","forum/app");var s=o.n(r);const e=flarum.reg.get("core","common/models/Discussion");var i=o.n(e);const a=flarum.reg.get("core","common/components/Badge");var l=o.n(a);const u=flarum.reg.get("core","common/components/Button");var c=o.n(u);const f=flarum.reg.get("core","forum/components/DiscussionPage");var p=o.n(f);const b=flarum.reg.get("core","forum/utils/DiscussionControls");var g=o.n(b);function d(o){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},d(o)}function _(o,t,n){return(t=function(o){var t=function(o,t){if("object"!==d(o)||null===o)return o;var n=o[Symbol.toPrimitive];if(void 0!==n){var r=n.call(o,t);if("object"!==d(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(o)}(o,"string");return"symbol"===d(t)?t:String(t)}(t))in o?Object.defineProperty(o,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):o[t]=n,o}const y=flarum.reg.get("core","common/components/Dropdown");var w=o.n(y);const v=flarum.reg.get("core","common/utils/extractText");var h=o.n(v);const S=flarum.reg.get("core","common/components/DetailedDropdownItem");var x=o.n(S);const P=flarum.reg.get("core","common/components/SplitDropdown");var A=o.n(P);class N extends(w()){constructor(){super(...arguments),_(this,"options",[{subscription:null,icon:"far fa-star",label:s().translator.trans("flarum-subscriptions.forum.sub_controls.not_following_button"),description:s().translator.trans("flarum-subscriptions.forum.sub_controls.not_following_text")},{subscription:"follow",icon:"fas fa-star",label:s().translator.trans("flarum-subscriptions.forum.sub_controls.following_button"),description:s().translator.trans("flarum-subscriptions.forum.sub_controls.following_text")},{subscription:"ignore",icon:"far fa-eye-slash",label:s().translator.trans("flarum-subscriptions.forum.sub_controls.ignoring_button"),description:s().translator.trans("flarum-subscriptions.forum.sub_controls.ignoring_text")}]),_(this,"possibleButtonAttrs",{null:{icon:"far fa-star",label:s().translator.trans("flarum-subscriptions.forum.sub_controls.follow_button")},follow:{icon:"fas fa-star",label:s().translator.trans("flarum-subscriptions.forum.sub_controls.following_button")},ignore:{icon:"far fa-eye-slash",label:s().translator.trans("flarum-subscriptions.forum.sub_controls.ignoring_button")}})}view(){const o=this.attrs.discussion,t=o.subscription(),n=this.possibleButtonAttrs[t],r=s().session.user.preferences(),e=r.notify_newPost_email,i=r.notify_newPost_alert,a=h()(s().translator.trans(e?"flarum-subscriptions.forum.sub_controls.notify_email_tooltip":"flarum-subscriptions.forum.sub_controls.notify_alert_tooltip")),l=(e||i)&&null===t;return m(A(),{className:"SubscriptionMenu",buttonClassName:"SubscriptionMenu-button--".concat(t),tooltip:l?a:null,mainAction:m(c(),{className:"SubscriptionMenu-button",icon:n.icon,onclick:this.saveSubscription.bind(this,o,-1!==["follow","ignore"].indexOf(t)?null:"follow")},n.label)},this.options.map((n=>m(x(),Object.assign({},n,{onclick:this.saveSubscription.bind(this,o,n.subscription),active:t===n.subscription})))))}saveSubscription(o,t){o.save({subscription:t}),this.$(".SubscriptionMenu-button").tooltip("hide")}}flarum.reg.add("flarum-subscriptions","forum/components/SubscriptionMenu",N);const k=flarum.reg.get("core","common/components/LinkButton");var j=o.n(k);const M=flarum.reg.get("core","forum/components/IndexPage");var D=o.n(M);const F=flarum.reg.get("core","forum/components/IndexSidebar");var L=o.n(F);const O=flarum.reg.get("core","forum/states/DiscussionListState");var I=o.n(O);const R=flarum.reg.get("core","forum/states/GlobalSearchState");var T=o.n(R);const B=flarum.reg.get("core","common/components/Switch");var G=o.n(B);const q=flarum.reg.get("core","common/extenders");var C=o.n(q);const K=flarum.reg.get("core","common/app");var z=o.n(K);const E=flarum.reg.get("core","common/query/IGambit");class U extends E.BooleanGambit{key(){return[z().translator.trans("flarum-subscriptions.lib.gambits.discussions.subscription.following_key",{},!0),z().translator.trans("flarum-subscriptions.lib.gambits.discussions.subscription.ignoring_key",{},!0)]}toFilter(o,t){return{[(t?"-":"")+this.filterKey()]:o[1]}}filterKey(){return"subscription"}fromFilter(o,t){return"".concat(t?"-":"","is:").concat(o)}enabled(){return!!z().session.user}}flarum.reg.add("flarum-subscriptions","common/query/discussions/SubscriptionGambit",U);const $=[(new(C().Search)).gambit("discussions",U)],H=flarum.reg.get("core","forum/components/Notification");var J=o.n(H);class Q extends(J()){icon(){return"fas fa-star"}href(){const o=this.attrs.notification,t=o.subject(),n=o.content()||{};return s().route.discussion(t,n.postNumber)}content(){return s().translator.trans("flarum-subscriptions.forum.notifications.new_post_text",{user:this.attrs.notification.fromUser()})}excerpt(){return null}}flarum.reg.add("flarum-subscriptions","forum/components/NewPostNotification",Q);const V=[...$,(new(C().Routes)).add("following","/following",D()),(new(C().Notification)).add("newPost",Q),new(C().Model)(i()).attribute("subscription")];s().initializers.add("flarum-subscriptions",(()=>{(0,n.extend)(i().prototype,"badges",(function(o){let t;switch(this.subscription()){case"follow":t=m(l(),{label:s().translator.trans("flarum-subscriptions.forum.badge.following_tooltip"),icon:"fas fa-star",type:"following"});break;case"ignore":t=m(l(),{label:s().translator.trans("flarum-subscriptions.forum.badge.ignoring_tooltip"),icon:"far fa-eye-slash",type:"ignoring"})}t&&o.add("subscription",t)})),(0,n.extend)(g(),"userControls",(function(o,t,n){if(s().session.user&&!(n instanceof p())){const n={none:{label:s().translator.trans("flarum-subscriptions.forum.discussion_controls.follow_button"),icon:"fas fa-star",save:"follow"},follow:{label:s().translator.trans("flarum-subscriptions.forum.discussion_controls.unfollow_button"),icon:"far fa-star",save:null},ignore:{label:s().translator.trans("flarum-subscriptions.forum.discussion_controls.unignore_button"),icon:"fas fa-eye",save:null}},r=t.subscription()||"none";o.add("subscription",m(c(),{icon:n[r].icon,onclick:t.save.bind(t,{subscription:n[r].save})},n[r].label))}})),(0,n.extend)(p().prototype,"sidebarItems",(function(o){if(s().session.user){const t=this.discussion;o.add("subscription",m(N,{discussion:t}),80)}})),(0,n.extend)(L().prototype,"navItems",(function(o){if(s().session.user){const t=s().search.state.stickyParams();o.add("following",m(j(),{href:s().route("following",t),icon:"fas fa-star"},s().translator.trans("flarum-subscriptions.forum.index.following_link")),50)}})),(0,n.extend)(D().prototype,"setTitle",(function(){"following"===s().current.get("routeName")&&s().setTitle(s().translator.trans("flarum-subscriptions.forum.following.meta_title_text"))})),(0,n.extend)(T().prototype,"params",(function(o){o.onFollowing="following"===s().current.get("routeName")})),(0,n.extend)(I().prototype,"requestParams",(function(o){this.params.onFollowing&&(o.filter||(o.filter={}),o.filter.subscription="following")})),(0,n.extend)("flarum/forum/components/SettingsPage","notificationsItems",(function(o){var t;o.add("followAfterReply",m(G(),{state:this.user.preferences().followAfterReply,onchange:o=>{this.followAfterReplyLoading=!0,this.user.savePreferences({followAfterReply:o}).then((()=>{this.followAfterReplyLoading=!1,m.redraw()}))},loading:this.followAfterReplyLoading},s().translator.trans("flarum-subscriptions.forum.settings.follow_after_reply_label"))),o.add("notifyForAllPosts",m(G(),{id:"flarum_subscriptions__notify_for_all_posts",state:!(null==(t=this.user.preferences())||!t["flarum-subscriptions.notify_for_all_posts"]),onchange:o=>{this.notifyForAllPostsLoading=!0,this.user.savePreferences({"flarum-subscriptions.notify_for_all_posts":o}).then((()=>{this.notifyForAllPostsLoading=!1,m.redraw()}))},loading:this.notifyForAllPostsLoading},s().translator.trans("flarum-subscriptions.forum.settings.notify_for_all_posts_label")))})),(0,n.extend)("flarum/forum/components/NotificationGrid","notificationTypes",(function(o){o.add("newPost",{name:"newPost",icon:"fas fa-star",label:s().translator.trans("flarum-subscriptions.forum.settings.notify_new_post_label")})}))}))})(),module.exports=t})();
//# sourceMappingURL=forum.js.map
\ No newline at end of file
diff --git a/extensions/subscriptions/js/dist/forum.js.map b/extensions/subscriptions/js/dist/forum.js.map
index 402612f9c1..543ed52111 100644
--- a/extensions/subscriptions/js/dist/forum.js.map
+++ b/extensions/subscriptions/js/dist/forum.js.map
@@ -1 +1 @@
-{"version":3,"file":"forum.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,qDCL9D,MAAM,EAA+BC,OAAOC,IAAIV,IAAI,OAAQ,iBCAtD,EAA+BS,OAAOC,IAAIV,IAAI,OAAQ,a,aCA5D,MAAM,EAA+BS,OAAOC,IAAIV,IAAI,OAAQ,4B,aCA5D,MAAM,EAA+BS,OAAOC,IAAIV,IAAI,OAAQ,2B,aCA5D,MAAM,EAA+BS,OAAOC,IAAIV,IAAI,OAAQ,4B,aCA5D,MAAM,EAA+BS,OAAOC,IAAIV,IAAI,OAAQ,mC,aCA5D,MAAM,EAA+BS,OAAOC,IAAIV,IAAI,OAAQ,kC,aCA7C,SAASW,EAAQV,GAG9B,OAAOU,EAAU,mBAAqBL,QAAU,iBAAmBA,OAAOM,SAAW,SAA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ootstrap","webpack://@flarum/subscriptions/webpack/runtime/compat get default export","webpack://@flarum/subscriptions/webpack/runtime/define property getters","webpack://@flarum/subscriptions/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/subscriptions/webpack/runtime/make namespace object","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'forum/app')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'common/models/Discussion')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'common/components/Badge')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'common/components/Button')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'forum/components/DiscussionPage')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'forum/utils/DiscussionControls')\"","webpack://@flarum/subscriptions/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://@flarum/subscriptions/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://@flarum/subscriptions/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://@flarum/subscriptions/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'common/components/Dropdown')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'common/utils/extractText')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'common/components/DetailedDropdownItem')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'common/components/SplitDropdown')\"","webpack://@flarum/subscriptions/./src/forum/components/SubscriptionMenu.tsx","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'common/components/LinkButton')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'forum/components/IndexPage')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'forum/components/IndexSidebar')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'forum/states/DiscussionListState')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'forum/states/GlobalSearchState')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'common/components/Switch')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'common/extenders')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'common/app')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'common/query/IGambit')\"","webpack://@flarum/subscriptions/./src/common/query/discussions/SubscriptionGambit.ts","webpack://@flarum/subscriptions/./src/common/extend.ts","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'forum/components/Notification')\"","webpack://@flarum/subscriptions/./src/forum/components/NewPostNotification.js","webpack://@flarum/subscriptions/./src/forum/extend.ts","webpack://@flarum/subscriptions/./src/forum/index.js","webpack://@flarum/subscriptions/./src/forum/addSubscriptionBadge.js","webpack://@flarum/subscriptions/./src/forum/addSubscriptionControls.js","webpack://@flarum/subscriptions/./src/forum/addSubscriptionFilter.js","webpack://@flarum/subscriptions/./src/forum/addSubscriptionSettings.tsx"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extend');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/models/Discussion');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Badge');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Button');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/DiscussionPage');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/utils/DiscussionControls');","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}","import _typeof from \"./typeof.js\";\nexport default function _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Dropdown');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/extractText');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/DetailedDropdownItem');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/SplitDropdown');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/forum/app';\nimport Dropdown from 'flarum/common/components/Dropdown';\nimport Button from 'flarum/common/components/Button';\nimport extractText from 'flarum/common/utils/extractText';\nimport DetailedDropdownItem from 'flarum/common/components/DetailedDropdownItem';\nimport SplitDropdown from 'flarum/common/components/SplitDropdown';\nexport default class SubscriptionMenu extends Dropdown {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"options\", [{\n subscription: null,\n icon: 'far fa-star',\n label: app.translator.trans('flarum-subscriptions.forum.sub_controls.not_following_button'),\n description: app.translator.trans('flarum-subscriptions.forum.sub_controls.not_following_text')\n }, {\n subscription: 'follow',\n icon: 'fas fa-star',\n label: app.translator.trans('flarum-subscriptions.forum.sub_controls.following_button'),\n description: app.translator.trans('flarum-subscriptions.forum.sub_controls.following_text')\n }, {\n subscription: 'ignore',\n icon: 'far fa-eye-slash',\n label: app.translator.trans('flarum-subscriptions.forum.sub_controls.ignoring_button'),\n description: app.translator.trans('flarum-subscriptions.forum.sub_controls.ignoring_text')\n }]);\n _defineProperty(this, \"possibleButtonAttrs\", {\n null: {\n icon: 'far fa-star',\n label: app.translator.trans('flarum-subscriptions.forum.sub_controls.follow_button')\n },\n follow: {\n icon: 'fas fa-star',\n label: app.translator.trans('flarum-subscriptions.forum.sub_controls.following_button')\n },\n ignore: {\n icon: 'far fa-eye-slash',\n label: app.translator.trans('flarum-subscriptions.forum.sub_controls.ignoring_button')\n }\n });\n }\n view() {\n const discussion = this.attrs.discussion;\n const subscription = discussion.subscription();\n const buttonAttrs = this.possibleButtonAttrs[subscription];\n const preferences = app.session.user.preferences();\n const notifyEmail = preferences['notify_newPost_email'];\n const notifyAlert = preferences['notify_newPost_alert'];\n const tooltipText = extractText(app.translator.trans(notifyEmail ? 'flarum-subscriptions.forum.sub_controls.notify_email_tooltip' : 'flarum-subscriptions.forum.sub_controls.notify_alert_tooltip'));\n const shouldShowTooltip = (notifyEmail || notifyAlert) && subscription === null;\n return m(SplitDropdown, {\n className: \"SubscriptionMenu\",\n buttonClassName: \"SubscriptionMenu-button--\".concat(subscription),\n tooltip: shouldShowTooltip ? tooltipText : null,\n mainAction: m(Button, {\n className: 'SubscriptionMenu-button',\n icon: buttonAttrs.icon,\n onclick: this.saveSubscription.bind(this, discussion, ['follow', 'ignore'].indexOf(subscription) !== -1 ? null : 'follow')\n }, buttonAttrs.label)\n }, this.options.map(attrs => m(DetailedDropdownItem, Object.assign({}, attrs, {\n onclick: this.saveSubscription.bind(this, discussion, attrs.subscription),\n active: subscription === attrs.subscription\n }))));\n }\n saveSubscription(discussion, subscription) {\n discussion.save({\n subscription\n });\n\n // @ts-ignore\n this.$('.SubscriptionMenu-button').tooltip('hide');\n }\n}\nflarum.reg.add('flarum-subscriptions', 'forum/components/SubscriptionMenu', SubscriptionMenu);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/LinkButton');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/IndexPage');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/IndexSidebar');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/states/DiscussionListState');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/states/GlobalSearchState');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Switch');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extenders');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/query/IGambit');","import app from 'flarum/common/app';\nimport { BooleanGambit } from 'flarum/common/query/IGambit';\nexport default class SubscriptionGambit extends BooleanGambit {\n key() {\n return [app.translator.trans('flarum-subscriptions.lib.gambits.discussions.subscription.following_key', {}, true), app.translator.trans('flarum-subscriptions.lib.gambits.discussions.subscription.ignoring_key', {}, true)];\n }\n toFilter(matches, negate) {\n const key = (negate ? '-' : '') + this.filterKey();\n return {\n [key]: matches[1]\n };\n }\n filterKey() {\n return 'subscription';\n }\n fromFilter(value, negate) {\n return \"\".concat(negate ? '-' : '', \"is:\").concat(value);\n }\n enabled() {\n return !!app.session.user;\n }\n}\nflarum.reg.add('flarum-subscriptions', 'common/query/discussions/SubscriptionGambit', SubscriptionGambit);","import Extend from 'flarum/common/extenders';\nimport SubscriptionGambit from './query/discussions/SubscriptionGambit';\nexport default [new Extend.Search() //\n.gambit('discussions', SubscriptionGambit)];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/Notification');","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\nexport default class NewPostNotification extends Notification {\n icon() {\n return 'fas fa-star';\n }\n href() {\n const notification = this.attrs.notification;\n const discussion = notification.subject();\n const content = notification.content() || {};\n return app.route.discussion(discussion, content.postNumber);\n }\n content() {\n return app.translator.trans('flarum-subscriptions.forum.notifications.new_post_text', {\n user: this.attrs.notification.fromUser()\n });\n }\n excerpt() {\n return null;\n }\n}\nflarum.reg.add('flarum-subscriptions', 'forum/components/NewPostNotification', NewPostNotification);","import Extend from 'flarum/common/extenders';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport Discussion from 'flarum/common/models/Discussion';\nimport commonExtend from '../common/extend';\nimport NewPostNotification from './components/NewPostNotification';\nexport default [...commonExtend, new Extend.Routes() //\n.add('following', '/following', IndexPage), new Extend.Notification() //\n.add('newPost', NewPostNotification), new Extend.Model(Discussion) //\n.attribute('subscription')];","import { extend } from 'flarum/common/extend';\nimport app from 'flarum/forum/app';\nimport addSubscriptionBadge from './addSubscriptionBadge';\nimport addSubscriptionControls from './addSubscriptionControls';\nimport addSubscriptionFilter from './addSubscriptionFilter';\nimport addSubscriptionSettings from './addSubscriptionSettings';\nexport { default as extend } from './extend';\napp.initializers.add('subscriptions', function () {\n addSubscriptionBadge();\n addSubscriptionControls();\n addSubscriptionFilter();\n addSubscriptionSettings();\n extend('flarum/forum/components/NotificationGrid', 'notificationTypes', function (items) {\n items.add('newPost', {\n name: 'newPost',\n icon: 'fas fa-star',\n label: app.translator.trans('flarum-subscriptions.forum.settings.notify_new_post_label')\n });\n });\n});","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport Discussion from 'flarum/common/models/Discussion';\nimport Badge from 'flarum/common/components/Badge';\nexport default function addSubscriptionBadge() {\n extend(Discussion.prototype, 'badges', function (badges) {\n let badge;\n switch (this.subscription()) {\n case 'follow':\n badge = m(Badge, {\n label: app.translator.trans('flarum-subscriptions.forum.badge.following_tooltip'),\n icon: \"fas fa-star\",\n type: \"following\"\n });\n break;\n case 'ignore':\n badge = m(Badge, {\n label: app.translator.trans('flarum-subscriptions.forum.badge.ignoring_tooltip'),\n icon: \"far fa-eye-slash\",\n type: \"ignoring\"\n });\n break;\n }\n if (badge) {\n badges.add('subscription', badge);\n }\n });\n}","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport Button from 'flarum/common/components/Button';\nimport DiscussionPage from 'flarum/forum/components/DiscussionPage';\nimport DiscussionControls from 'flarum/forum/utils/DiscussionControls';\nimport SubscriptionMenu from './components/SubscriptionMenu';\nexport default function addSubscriptionControls() {\n extend(DiscussionControls, 'userControls', function (items, discussion, context) {\n if (app.session.user && !(context instanceof DiscussionPage)) {\n const states = {\n none: {\n label: app.translator.trans('flarum-subscriptions.forum.discussion_controls.follow_button'),\n icon: 'fas fa-star',\n save: 'follow'\n },\n follow: {\n label: app.translator.trans('flarum-subscriptions.forum.discussion_controls.unfollow_button'),\n icon: 'far fa-star',\n save: null\n },\n ignore: {\n label: app.translator.trans('flarum-subscriptions.forum.discussion_controls.unignore_button'),\n icon: 'fas fa-eye',\n save: null\n }\n };\n const subscription = discussion.subscription() || 'none';\n items.add('subscription', m(Button, {\n icon: states[subscription].icon,\n onclick: discussion.save.bind(discussion, {\n subscription: states[subscription].save\n })\n }, states[subscription].label));\n }\n });\n extend(DiscussionPage.prototype, 'sidebarItems', function (items) {\n if (app.session.user) {\n const discussion = this.discussion;\n items.add('subscription', m(SubscriptionMenu, {\n discussion: discussion\n }), 80);\n }\n });\n}","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport IndexSidebar from 'flarum/forum/components/IndexSidebar';\nimport DiscussionListState from 'flarum/forum/states/DiscussionListState';\nimport GlobalSearchState from 'flarum/forum/states/GlobalSearchState';\nexport default function addSubscriptionFilter() {\n extend(IndexSidebar.prototype, 'navItems', function (items) {\n if (app.session.user) {\n const params = app.search.state.stickyParams();\n items.add('following', m(LinkButton, {\n href: app.route('following', params),\n icon: \"fas fa-star\"\n }, app.translator.trans('flarum-subscriptions.forum.index.following_link')), 50);\n }\n });\n extend(IndexPage.prototype, 'setTitle', function () {\n if (app.current.get('routeName') === 'following') {\n app.setTitle(app.translator.trans('flarum-subscriptions.forum.following.meta_title_text'));\n }\n });\n extend(GlobalSearchState.prototype, 'params', function (params) {\n // We can't set `q` here directly, as that would make the search bar\n // think that text has been entered, and display the \"clear\" button.\n params.onFollowing = app.current.get('routeName') === 'following';\n });\n extend(DiscussionListState.prototype, 'requestParams', function (params) {\n if (this.params.onFollowing) {\n params.filter || (params.filter = {});\n params.filter.subscription = 'following';\n }\n });\n}","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport Switch from 'flarum/common/components/Switch';\nexport default function () {\n extend('flarum/forum/components/SettingsPage', 'notificationsItems', function (items) {\n var _preferences;\n items.add('followAfterReply', m(Switch, {\n state: this.user.preferences().followAfterReply,\n onchange: value => {\n this.followAfterReplyLoading = true;\n this.user.savePreferences({\n followAfterReply: value\n }).then(() => {\n this.followAfterReplyLoading = false;\n m.redraw();\n });\n },\n loading: this.followAfterReplyLoading\n }, app.translator.trans('flarum-subscriptions.forum.settings.follow_after_reply_label')));\n items.add('notifyForAllPosts', m(Switch, {\n id: \"flarum_subscriptions__notify_for_all_posts\",\n state: !!((_preferences = this.user.preferences()) != null && _preferences['flarum-subscriptions.notify_for_all_posts']),\n onchange: val => {\n this.notifyForAllPostsLoading = true;\n this.user.savePreferences({\n 'flarum-subscriptions.notify_for_all_posts': val\n }).then(() => {\n this.notifyForAllPostsLoading = false;\n m.redraw();\n });\n },\n loading: this.notifyForAllPostsLoading\n }, app.translator.trans('flarum-subscriptions.forum.settings.notify_for_all_posts_label')));\n });\n}"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","reg","_typeof","iterator","constructor","_defineProperty","arg","input","hint","prim","toPrimitive","undefined","res","TypeError","String","toPropertyKey","configurable","writable","SubscriptionMenu","super","arguments","this","subscription","icon","label","description","null","follow","ignore","view","discussion","attrs","buttonAttrs","possibleButtonAttrs","preferences","notifyEmail","notifyAlert","tooltipText","shouldShowTooltip","m","className","buttonClassName","concat","tooltip","mainAction","onclick","saveSubscription","bind","indexOf","options","map","assign","active","save","$","add","SubscriptionGambit","BooleanGambit","toFilter","matches","negate","filterKey","fromFilter","enabled","gambit","NewPostNotification","href","notification","subject","content","postNumber","user","fromUser","excerpt","attribute","extend","badges","badge","type","items","context","states","none","params","onFollowing","filter","_preferences","state","followAfterReply","onchange","followAfterReplyLoading","savePreferences","then","redraw","loading","id","val","notifyForAllPostsLoading","name"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"file":"forum.js","mappings":"MACA,IAAIA,EAAsB,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cAAjC,gBAAgB,YACvC,KACA,IAAAT,QAAO,cAA+B,iBAAiB,SAAUQ,GAC3D9D,KAAK8D,OAAOC,cACdD,EAAOE,SAAWF,EAAOE,OAAS,CAAC,GACnCF,EAAOE,OAAO/D,aAAe,YAEjC,KC5BA,IAAAqD,QAAO,uCAAwC,sBAAsB,SAAUI,GAC7E,IAAIO,EACJP,EAAMxB,IAAI,mBAAoBhB,EAAE,IAAQ,CACtCgD,MAAOlE,KAAKkD,KAAKrC,cAAcsD,iBAC/BC,SAAU1F,IACRsB,KAAKqE,yBAA0B,EAC/BrE,KAAKkD,KAAKoB,gBAAgB,CACxBH,iBAAkBzF,IACjB6F,MAAK,KACNvE,KAAKqE,yBAA0B,EAC/BnD,EAAEsD,QAAQ,GACV,EAEJC,QAASzE,KAAKqE,yBACb,qBAAqB,kEACxBX,EAAMxB,IAAI,oBAAqBhB,EAAE,IAAQ,CACvCwD,GAAI,6CACJR,QAAsD,OAA3CD,EAAejE,KAAKkD,KAAKrC,iBAA0BoD,EAAa,8CAC3EG,SAAUO,IACR3E,KAAK4E,0BAA2B,EAChC5E,KAAKkD,KAAKoB,gBAAgB,CACxB,4CAA6CK,IAC5CJ,MAAK,KACNvE,KAAK4E,0BAA2B,EAChC1D,EAAEsD,QAAQ,GACV,EAEJC,QAASzE,KAAK4E,0BACb,qBAAqB,mEAC1B,KJrBA,IAAAtB,QAAO,2CAA4C,qBAAqB,SAAUI,GAChFA,EAAMxB,IAAI,UAAW,CACnB2C,KAAM,UACN3E,KAAM,cACNC,MAAO,qBAAqB,8DAEhC,GAAE,G","sources":["webpack://@flarum/subscriptions/webpack/bootstrap","webpack://@flarum/subscriptions/webpack/runtime/compat get default export","webpack://@flarum/subscriptions/webpack/runtime/define property getters","webpack://@flarum/subscriptions/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/subscriptions/webpack/runtime/make namespace object","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'forum/app')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'common/models/Discussion')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'common/components/Badge')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'common/components/Button')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'forum/components/DiscussionPage')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'forum/utils/DiscussionControls')\"","webpack://@flarum/subscriptions/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://@flarum/subscriptions/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://@flarum/subscriptions/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://@flarum/subscriptions/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'common/components/Dropdown')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'common/utils/extractText')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'common/components/DetailedDropdownItem')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'common/components/SplitDropdown')\"","webpack://@flarum/subscriptions/./src/forum/components/SubscriptionMenu.tsx","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'common/components/LinkButton')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'forum/components/IndexPage')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'forum/components/IndexSidebar')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'forum/states/DiscussionListState')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'forum/states/GlobalSearchState')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'common/components/Switch')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'common/extenders')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'common/app')\"","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'common/query/IGambit')\"","webpack://@flarum/subscriptions/./src/common/query/discussions/SubscriptionGambit.ts","webpack://@flarum/subscriptions/./src/common/extend.ts","webpack://@flarum/subscriptions/external root \"flarum.reg.get('core', 'forum/components/Notification')\"","webpack://@flarum/subscriptions/./src/forum/components/NewPostNotification.js","webpack://@flarum/subscriptions/./src/forum/extend.ts","webpack://@flarum/subscriptions/./src/forum/index.js","webpack://@flarum/subscriptions/./src/forum/addSubscriptionBadge.js","webpack://@flarum/subscriptions/./src/forum/addSubscriptionControls.js","webpack://@flarum/subscriptions/./src/forum/addSubscriptionFilter.js","webpack://@flarum/subscriptions/./src/forum/addSubscriptionSettings.tsx"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extend');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/models/Discussion');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Badge');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Button');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/DiscussionPage');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/utils/DiscussionControls');","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}","import _typeof from \"./typeof.js\";\nexport default function _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Dropdown');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/extractText');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/DetailedDropdownItem');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/SplitDropdown');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/forum/app';\nimport Dropdown from 'flarum/common/components/Dropdown';\nimport Button from 'flarum/common/components/Button';\nimport extractText from 'flarum/common/utils/extractText';\nimport DetailedDropdownItem from 'flarum/common/components/DetailedDropdownItem';\nimport SplitDropdown from 'flarum/common/components/SplitDropdown';\nexport default class SubscriptionMenu extends Dropdown {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"options\", [{\n subscription: null,\n icon: 'far fa-star',\n label: app.translator.trans('flarum-subscriptions.forum.sub_controls.not_following_button'),\n description: app.translator.trans('flarum-subscriptions.forum.sub_controls.not_following_text')\n }, {\n subscription: 'follow',\n icon: 'fas fa-star',\n label: app.translator.trans('flarum-subscriptions.forum.sub_controls.following_button'),\n description: app.translator.trans('flarum-subscriptions.forum.sub_controls.following_text')\n }, {\n subscription: 'ignore',\n icon: 'far fa-eye-slash',\n label: app.translator.trans('flarum-subscriptions.forum.sub_controls.ignoring_button'),\n description: app.translator.trans('flarum-subscriptions.forum.sub_controls.ignoring_text')\n }]);\n _defineProperty(this, \"possibleButtonAttrs\", {\n null: {\n icon: 'far fa-star',\n label: app.translator.trans('flarum-subscriptions.forum.sub_controls.follow_button')\n },\n follow: {\n icon: 'fas fa-star',\n label: app.translator.trans('flarum-subscriptions.forum.sub_controls.following_button')\n },\n ignore: {\n icon: 'far fa-eye-slash',\n label: app.translator.trans('flarum-subscriptions.forum.sub_controls.ignoring_button')\n }\n });\n }\n view() {\n const discussion = this.attrs.discussion;\n const subscription = discussion.subscription();\n const buttonAttrs = this.possibleButtonAttrs[subscription];\n const preferences = app.session.user.preferences();\n const notifyEmail = preferences['notify_newPost_email'];\n const notifyAlert = preferences['notify_newPost_alert'];\n const tooltipText = extractText(app.translator.trans(notifyEmail ? 'flarum-subscriptions.forum.sub_controls.notify_email_tooltip' : 'flarum-subscriptions.forum.sub_controls.notify_alert_tooltip'));\n const shouldShowTooltip = (notifyEmail || notifyAlert) && subscription === null;\n return m(SplitDropdown, {\n className: \"SubscriptionMenu\",\n buttonClassName: \"SubscriptionMenu-button--\".concat(subscription),\n tooltip: shouldShowTooltip ? tooltipText : null,\n mainAction: m(Button, {\n className: 'SubscriptionMenu-button',\n icon: buttonAttrs.icon,\n onclick: this.saveSubscription.bind(this, discussion, ['follow', 'ignore'].indexOf(subscription) !== -1 ? null : 'follow')\n }, buttonAttrs.label)\n }, this.options.map(attrs => m(DetailedDropdownItem, Object.assign({}, attrs, {\n onclick: this.saveSubscription.bind(this, discussion, attrs.subscription),\n active: subscription === attrs.subscription\n }))));\n }\n saveSubscription(discussion, subscription) {\n discussion.save({\n subscription\n });\n\n // @ts-ignore\n this.$('.SubscriptionMenu-button').tooltip('hide');\n }\n}\nflarum.reg.add('flarum-subscriptions', 'forum/components/SubscriptionMenu', SubscriptionMenu);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/LinkButton');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/IndexPage');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/IndexSidebar');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/states/DiscussionListState');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/states/GlobalSearchState');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Switch');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extenders');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/query/IGambit');","import app from 'flarum/common/app';\nimport { BooleanGambit } from 'flarum/common/query/IGambit';\nexport default class SubscriptionGambit extends BooleanGambit {\n key() {\n return [app.translator.trans('flarum-subscriptions.lib.gambits.discussions.subscription.following_key', {}, true), app.translator.trans('flarum-subscriptions.lib.gambits.discussions.subscription.ignoring_key', {}, true)];\n }\n toFilter(matches, negate) {\n const key = (negate ? '-' : '') + this.filterKey();\n return {\n [key]: matches[1]\n };\n }\n filterKey() {\n return 'subscription';\n }\n fromFilter(value, negate) {\n return \"\".concat(negate ? '-' : '', \"is:\").concat(value);\n }\n enabled() {\n return !!app.session.user;\n }\n}\nflarum.reg.add('flarum-subscriptions', 'common/query/discussions/SubscriptionGambit', SubscriptionGambit);","import Extend from 'flarum/common/extenders';\nimport SubscriptionGambit from './query/discussions/SubscriptionGambit';\nexport default [new Extend.Search() //\n.gambit('discussions', SubscriptionGambit)];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/Notification');","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\nexport default class NewPostNotification extends Notification {\n icon() {\n return 'fas fa-star';\n }\n href() {\n const notification = this.attrs.notification;\n const discussion = notification.subject();\n const content = notification.content() || {};\n return app.route.discussion(discussion, content.postNumber);\n }\n content() {\n return app.translator.trans('flarum-subscriptions.forum.notifications.new_post_text', {\n user: this.attrs.notification.fromUser()\n });\n }\n excerpt() {\n return null;\n }\n}\nflarum.reg.add('flarum-subscriptions', 'forum/components/NewPostNotification', NewPostNotification);","import Extend from 'flarum/common/extenders';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport Discussion from 'flarum/common/models/Discussion';\nimport commonExtend from '../common/extend';\nimport NewPostNotification from './components/NewPostNotification';\nexport default [...commonExtend, new Extend.Routes() //\n.add('following', '/following', IndexPage), new Extend.Notification() //\n.add('newPost', NewPostNotification), new Extend.Model(Discussion) //\n.attribute('subscription')];","import { extend } from 'flarum/common/extend';\nimport app from 'flarum/forum/app';\nimport addSubscriptionBadge from './addSubscriptionBadge';\nimport addSubscriptionControls from './addSubscriptionControls';\nimport addSubscriptionFilter from './addSubscriptionFilter';\nimport addSubscriptionSettings from './addSubscriptionSettings';\nexport { default as extend } from './extend';\napp.initializers.add('flarum-subscriptions', () => {\n addSubscriptionBadge();\n addSubscriptionControls();\n addSubscriptionFilter();\n addSubscriptionSettings();\n extend('flarum/forum/components/NotificationGrid', 'notificationTypes', function (items) {\n items.add('newPost', {\n name: 'newPost',\n icon: 'fas fa-star',\n label: app.translator.trans('flarum-subscriptions.forum.settings.notify_new_post_label')\n });\n });\n});","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport Discussion from 'flarum/common/models/Discussion';\nimport Badge from 'flarum/common/components/Badge';\nexport default function addSubscriptionBadge() {\n extend(Discussion.prototype, 'badges', function (badges) {\n let badge;\n switch (this.subscription()) {\n case 'follow':\n badge = m(Badge, {\n label: app.translator.trans('flarum-subscriptions.forum.badge.following_tooltip'),\n icon: \"fas fa-star\",\n type: \"following\"\n });\n break;\n case 'ignore':\n badge = m(Badge, {\n label: app.translator.trans('flarum-subscriptions.forum.badge.ignoring_tooltip'),\n icon: \"far fa-eye-slash\",\n type: \"ignoring\"\n });\n break;\n }\n if (badge) {\n badges.add('subscription', badge);\n }\n });\n}","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport Button from 'flarum/common/components/Button';\nimport DiscussionPage from 'flarum/forum/components/DiscussionPage';\nimport DiscussionControls from 'flarum/forum/utils/DiscussionControls';\nimport SubscriptionMenu from './components/SubscriptionMenu';\nexport default function addSubscriptionControls() {\n extend(DiscussionControls, 'userControls', function (items, discussion, context) {\n if (app.session.user && !(context instanceof DiscussionPage)) {\n const states = {\n none: {\n label: app.translator.trans('flarum-subscriptions.forum.discussion_controls.follow_button'),\n icon: 'fas fa-star',\n save: 'follow'\n },\n follow: {\n label: app.translator.trans('flarum-subscriptions.forum.discussion_controls.unfollow_button'),\n icon: 'far fa-star',\n save: null\n },\n ignore: {\n label: app.translator.trans('flarum-subscriptions.forum.discussion_controls.unignore_button'),\n icon: 'fas fa-eye',\n save: null\n }\n };\n const subscription = discussion.subscription() || 'none';\n items.add('subscription', m(Button, {\n icon: states[subscription].icon,\n onclick: discussion.save.bind(discussion, {\n subscription: states[subscription].save\n })\n }, states[subscription].label));\n }\n });\n extend(DiscussionPage.prototype, 'sidebarItems', function (items) {\n if (app.session.user) {\n const discussion = this.discussion;\n items.add('subscription', m(SubscriptionMenu, {\n discussion: discussion\n }), 80);\n }\n });\n}","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport IndexSidebar from 'flarum/forum/components/IndexSidebar';\nimport DiscussionListState from 'flarum/forum/states/DiscussionListState';\nimport GlobalSearchState from 'flarum/forum/states/GlobalSearchState';\nexport default function addSubscriptionFilter() {\n extend(IndexSidebar.prototype, 'navItems', function (items) {\n if (app.session.user) {\n const params = app.search.state.stickyParams();\n items.add('following', m(LinkButton, {\n href: app.route('following', params),\n icon: \"fas fa-star\"\n }, app.translator.trans('flarum-subscriptions.forum.index.following_link')), 50);\n }\n });\n extend(IndexPage.prototype, 'setTitle', function () {\n if (app.current.get('routeName') === 'following') {\n app.setTitle(app.translator.trans('flarum-subscriptions.forum.following.meta_title_text'));\n }\n });\n extend(GlobalSearchState.prototype, 'params', function (params) {\n // We can't set `q` here directly, as that would make the search bar\n // think that text has been entered, and display the \"clear\" button.\n params.onFollowing = app.current.get('routeName') === 'following';\n });\n extend(DiscussionListState.prototype, 'requestParams', function (params) {\n if (this.params.onFollowing) {\n params.filter || (params.filter = {});\n params.filter.subscription = 'following';\n }\n });\n}","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport Switch from 'flarum/common/components/Switch';\nexport default function () {\n extend('flarum/forum/components/SettingsPage', 'notificationsItems', function (items) {\n var _preferences;\n items.add('followAfterReply', m(Switch, {\n state: this.user.preferences().followAfterReply,\n onchange: value => {\n this.followAfterReplyLoading = true;\n this.user.savePreferences({\n followAfterReply: value\n }).then(() => {\n this.followAfterReplyLoading = false;\n m.redraw();\n });\n },\n loading: this.followAfterReplyLoading\n }, app.translator.trans('flarum-subscriptions.forum.settings.follow_after_reply_label')));\n items.add('notifyForAllPosts', m(Switch, {\n id: \"flarum_subscriptions__notify_for_all_posts\",\n state: !!((_preferences = this.user.preferences()) != null && _preferences['flarum-subscriptions.notify_for_all_posts']),\n onchange: val => {\n this.notifyForAllPostsLoading = true;\n this.user.savePreferences({\n 'flarum-subscriptions.notify_for_all_posts': val\n }).then(() => {\n this.notifyForAllPostsLoading = false;\n m.redraw();\n });\n },\n loading: this.notifyForAllPostsLoading\n }, app.translator.trans('flarum-subscriptions.forum.settings.notify_for_all_posts_label')));\n });\n}"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","reg","_typeof","iterator","constructor","_defineProperty","arg","input","hint","prim","toPrimitive","undefined","res","TypeError","String","toPropertyKey","configurable","writable","SubscriptionMenu","super","arguments","this","subscription","icon","label","description","null","follow","ignore","view","discussion","attrs","buttonAttrs","possibleButtonAttrs","preferences","notifyEmail","notifyAlert","tooltipText","shouldShowTooltip","m","className","buttonClassName","concat","tooltip","mainAction","onclick","saveSubscription","bind","indexOf","options","map","assign","active","save","$","add","SubscriptionGambit","BooleanGambit","toFilter","matches","negate","filterKey","fromFilter","enabled","gambit","NewPostNotification","href","notification","subject","content","postNumber","user","fromUser","excerpt","attribute","extend","badges","badge","type","items","context","states","none","params","onFollowing","filter","_preferences","state","followAfterReply","onchange","followAfterReplyLoading","savePreferences","then","redraw","loading","id","val","notifyForAllPostsLoading","name"],"sourceRoot":""}
\ No newline at end of file
diff --git a/extensions/tags/js/dist/forum.js b/extensions/tags/js/dist/forum.js
index f1eec812e6..b7b0736d09 100644
--- a/extensions/tags/js/dist/forum.js
+++ b/extensions/tags/js/dist/forum.js
@@ -1,2 +1,2 @@
-(()=>{var t,e,s={974:(t,e,s)=>{"use strict";s.d(e,{Z:()=>o});var r=s(836),a=s.n(r);function o(t,e,s){void 0===e&&(e={}),void 0===s&&(s={});const r=t&&t.icon(),{useColor:o=!0}=s;return e.className=a()([e.className,"icon text-colored",r?t.icon():"TagIcon"]),t&&o?(e.style=e.style||{},e.style["--color"]=t.color()):t||(e.className+=" untagged"),r?m("i",e):m("span",e)}flarum.reg.add("flarum-tags","common/helpers/tagIcon",o)},924:(t,e,s)=>{"use strict";s.d(e,{Z:()=>g});var r=s(780),a=s.n(r),o=s(678),n=s.n(o),i=s(836),l=s.n(i),c=s(679),u=s.n(c),d=s(974);function g(t,e){void 0===e&&(e={}),e.style=e.style||{},e.className="TagLabel "+(e.className||"");const s=a()(e,"link"),r=t?t.name():app.translator.trans("flarum-tags.lib.deleted_tag_text");if(t){const r=t.color();r&&(e.style["--tag-bg"]=r,e.className=l()(e.className,"colored",u()(r))),s&&(e.title=t.description()||"",e.href=app.route("tag",{tags:t.slug()})),t.isChild()&&(e.className+=" TagLabel--child")}else e.className+=" untagged";return m(s?n():"span",e,m("span",{className:"TagLabel-text"},t&&t.icon()&&(0,d.Z)(t,{className:"TagLabel-icon"},{useColor:!1}),m("span",{className:"TagLabel-name"},r)))}flarum.reg.add("flarum-tags","common/helpers/tagLabel",g)},270:()=>{},648:(t,e,s)=>{"use strict";function r(t){return t.slice(0).sort(((t,e)=>{const s=t.position(),r=e.position();if(null===s&&null===r)return e.discussionCount()-t.discussionCount();if(null===r)return-1;if(null===s)return 1;const a=t.parent(),o=e.parent();return a===o?s-r:a&&o?a.position()-o.position():a?a===e?1:a.position()-r:o?o===t?-1:s-o.position():0}))}s.d(e,{Z:()=>r}),flarum.reg.add("flarum-tags","common/utils/sortTags",r)},664:(t,e,s)=>{"use strict";s.d(e,{l:()=>wt});var r=s(892),a=s.n(r),o=s(905),n=s(351),i=s.n(n);class l{constructor(){(0,o.Z)(this,"loadedIncludes",void 0)}async load(t){if(void 0===t&&(t=[]),!this.loadedIncludes)return this.query(t);const e=t.filter((t=>!this.loadedIncludes.has(t)));return 0===e.length?Promise.resolve(i().store.all("tags")):this.query(e)}async query(t){return void 0===t&&(t=[]),null!=this.loadedIncludes||(this.loadedIncludes=new Set),i().store.find("tags",{include:t.join(",")}).then((e=>{const s=Array.isArray(e)?e:[e];return t.forEach((t=>this.loadedIncludes.add(t))),s}))}}flarum.reg.add("flarum-tags","common/states/TagListState",l);const c=flarum.reg.get("core","common/extend"),u=flarum.reg.get("core","forum/components/IndexSidebar");var d=s.n(u);const g=flarum.reg.get("core","common/components/Separator");var f=s.n(g);const p=flarum.reg.get("core","common/components/LinkButton");var h=s.n(p),b=s(678),v=s.n(b),T=s(836),y=s.n(T),x=s(974);class w extends(h()){view(t){const e=this.attrs.model,s=e&&e.description(),r=y()("TagLinkButton hasIcon",{child:e.isChild()},this.attrs.className);return m(v(),{className:r,href:this.attrs.route,style:e?{"--color":e.color()}:void 0,title:s||void 0},(0,x.Z)(e,{className:"Button-icon"}),m("span",{className:"Button-label"},e?e.name():app.translator.trans("flarum-tags.forum.index.untagged_link")))}static initAttrs(t){super.initAttrs(t);const e=t.model;t.params.tags=e?e.slug():"untagged",t.route=app.route("tag",t.params)}}flarum.reg.add("flarum-tags","forum/components/TagLinkButton",w);const k=flarum.reg.get("core","common/components/Page");var N=s.n(k);const C=flarum.reg.get("core","forum/components/PageStructure");var _=s.n(C);const P=flarum.reg.get("core","forum/components/WelcomeHero");var S=s.n(P),D=s(149),A=s.n(D);const L=flarum.reg.get("core","common/utils/ItemList");var I=s.n(L);const Z=flarum.reg.get("core","common/helpers/humanTime");var j=s.n(Z),M=s(679),E=s.n(M),V=s(596),B=s.n(V),H=s(924),O=s(648);class R extends(N()){constructor(){super(...arguments),(0,o.Z)(this,"tags",void 0),(0,o.Z)(this,"loading",void 0)}oninit(t){super.oninit(t),a().history.push("tags",B()(a().translator.trans("flarum-tags.forum.header.back_to_tags_tooltip"))),this.tags=[];const e=a().preloadedApiDocument();e?this.tags=(0,O.Z)(e.filter((t=>!t.isChild()))):(this.loading=!0,a().tagList.load(["children","lastPostedDiscussion","parent"]).then((()=>{this.tags=(0,O.Z)(a().store.all("tags").filter((t=>!t.isChild()))),this.loading=!1,m.redraw()})))}oncreate(t){super.oncreate(t),a().setTitle(B()(a().translator.trans("flarum-tags.forum.all_tags.meta_title_text"))),a().setTitleCount(0)}view(){return m(_(),{className:"TagsPage",hero:this.hero.bind(this),sidebar:this.sidebar.bind(this)},this.contentItems().toArray())}contentItems(){const t=new(I());if(this.loading)t.add("loading",m(A(),null));else{const e=this.tags.filter((t=>null!==t.position())),s=this.tags.filter((t=>null===t.position()));t.add("tagTiles",this.tagTileListView(e),100),s.length&&t.add("cloud",this.cloudView(s),10)}return t}hero(){return m(S(),null)}sidebar(){return m(d(),null)}tagTileListView(t){return m("ul",{className:"TagTiles"},t.map(this.tagTileView.bind(this)))}tagTileView(t){const e=t.lastPostedDiscussion(),s=(0,O.Z)(t.children()||[]);return m("li",{className:y()("TagTile",{colored:t.color()},E()(t.color())),style:{"--tag-bg":t.color()}},m(v(),{className:"TagTile-info",href:a().route.tag(t)},m("div",{className:"TagTile-heading"},t.icon()&&(0,x.Z)(t,{},{useColor:!1}),m("h3",{className:"TagTile-name"},t.name())),m("p",{className:"TagTile-description"},t.description()),!!s&&m("div",{className:"TagTile-children"},s.map((t=>[m(v(),{href:a().route.tag(t)},t.name())," "])))),e?m(v(),{className:"TagTile-lastPostedDiscussion",href:a().route.discussion(e,e.lastPostNumber())},m("span",{className:"TagTile-lastPostedDiscussion-title"},e.title()),j()(e.lastPostedAt())):m("span",{className:"TagTile-lastPostedDiscussion"}))}cloudView(t){return m("div",{className:"TagCloud"},t.map((t=>[(0,H.Z)(t,{link:!0})," "])))}}flarum.reg.add("flarum-tags","forum/components/TagsPage",R);const q=flarum.reg.get("core","forum/components/IndexPage");var G=s.n(q);const F=flarum.reg.get("core","forum/states/DiscussionListState");var K=s.n(F);const $=flarum.reg.get("core","forum/states/GlobalSearchState");var U=s.n($),z=s(433),W=s.n(z);class J extends(W()){view(){const t=this.attrs.model,e=t.color();return m("header",{className:y()("Hero","TagHero",{"TagHero--colored":e,[E()(e)]:e}),style:e?{"--hero-bg":e}:void 0},m("div",{className:"container"},m("div",{className:"containerNarrow"},m("h1",{className:"Hero-title"},t.icon()&&(0,x.Z)(t,{},{useColor:!1})," ",t.name()),m("div",{className:"Hero-subtitle"},t.description()))))}}flarum.reg.add("flarum-tags","forum/components/TagHero",J);const Q=t=>a().store.all("tags").find((e=>0===e.slug().localeCompare(t,void 0,{sensitivity:"base"}))),X=flarum.reg.get("core","forum/components/DiscussionListItem");var Y=s.n(X);const tt=flarum.reg.get("core","forum/components/DiscussionHero");var et=s.n(tt);function st(t,e){void 0===e&&(e={});const s=[],{link:r,...a}=e;return a.className=y()("TagsLabel",a.className),t?(0,O.Z)(t).forEach((e=>{(e||1===t.length)&&s.push((0,H.Z)(e,{link:r}))})):s.push((0,H.Z)()),m("span",a,s)}s(780),flarum.reg.add("flarum-tags","common/helpers/tagsLabel",st);const rt=flarum.reg.get("core","forum/utils/DiscussionControls");var at=s.n(rt),ot=s(645),nt=s.n(ot);flarum.reg.addChunkModule("642","884","flarum-tags","forum/components/TagDiscussionModal"),flarum.reg.addChunkModule("642","884","flarum-tags","/home/runner/work/framework/framework/extensions/tags/js/src/forum/components/TagDiscussionModal.tsx"),flarum.reg.addChunkModule("642","884","flarum-tags","/home/runner/work/framework/framework/extensions/tags/js/src/common/components/TagSelectionModal.tsx"),flarum.reg.addChunkModule("642","884","flarum-tags","/home/runner/work/framework/framework/extensions/tags/js/src/forum/components/ToggleButton.js");var it=s(490);const lt=flarum.reg.get("core","common/extenders");var ct=s.n(lt);const ut=flarum.reg.get("core","common/models/Discussion");var mt=s.n(ut);const dt=flarum.reg.get("core","forum/components/EventPost");var gt=s.n(dt);class ft extends(gt()){static initAttrs(t){super.initAttrs(t);const e=t.post.content()[0],s=t.post.content()[1];function r(t,e){return t.filter((t=>-1===e.indexOf(t))).map((t=>app.store.getById("tags",t)))}t.tagsAdded=r(s,e),t.tagsRemoved=r(e,s)}icon(){return"fas fa-tag"}descriptionKey(){return this.attrs.tagsAdded.length?this.attrs.tagsRemoved.length?"flarum-tags.forum.post_stream.added_and_removed_tags_text":"flarum-tags.forum.post_stream.added_tags_text":"flarum-tags.forum.post_stream.removed_tags_text"}descriptionData(){const t={};return this.attrs.tagsAdded.length&&(t.tagsAdded=app.translator.trans("flarum-tags.forum.post_stream.tags_text",{tags:st(this.attrs.tagsAdded,{link:!0}),count:this.attrs.tagsAdded.length})),this.attrs.tagsRemoved.length&&(t.tagsRemoved=app.translator.trans("flarum-tags.forum.post_stream.tags_text",{tags:st(this.attrs.tagsRemoved,{link:!0}),count:this.attrs.tagsRemoved.length})),t}}flarum.reg.add("flarum-tags","forum/components/DiscussionTaggedPost",ft);const pt=flarum.reg.get("core","common/utils/computed");var ht=s.n(pt);const bt=flarum.reg.get("core","common/Model");var vt=s.n(bt);class Tt extends(vt()){name(){return vt().attribute("name").call(this)}slug(){return vt().attribute("slug").call(this)}description(){return vt().attribute("description").call(this)}color(){return vt().attribute("color").call(this)}backgroundUrl(){return vt().attribute("backgroundUrl").call(this)}backgroundMode(){return vt().attribute("backgroundMode").call(this)}icon(){return vt().attribute("icon").call(this)}position(){return vt().attribute("position").call(this)}parent(){return vt().hasOne("parent").call(this)}children(){return vt().hasMany("children").call(this)}defaultSort(){return vt().attribute("defaultSort").call(this)}isChild(){return vt().attribute("isChild").call(this)}isHidden(){return vt().attribute("isHidden").call(this)}isPrimary(){return vt().attribute("isPrimary").call(this)}discussionCount(){return vt().attribute("discussionCount").call(this)}lastPostedAt(){return vt().attribute("lastPostedAt",vt().transformDate).call(this)}lastPostedDiscussion(){return vt().hasOne("lastPostedDiscussion").call(this)}isRestricted(){return vt().attribute("isRestricted").call(this)}canStartDiscussion(){return vt().attribute("canStartDiscussion").call(this)}canAddToDiscussion(){return vt().attribute("canAddToDiscussion").call(this)}isPrimaryParent(){return ht()("position","parent",((t,e)=>null!==t&&!1===e)).call(this)}}flarum.reg.add("flarum-tags","common/models/Tag",Tt);const yt=flarum.reg.get("core","common/query/IGambit");class xt extends yt.KeyValueGambit{constructor(){super(...arguments),(0,o.Z)(this,"predicates",!0)}key(){return i().translator.trans("flarum-tags.lib.gambits.discussions.tag.key",{},!0)}hint(){return i().translator.trans("flarum-tags.lib.gambits.discussions.tag.hint",{},!0)}filterKey(){return"tag"}gambitValueToFilterValue(t){return[t]}fromFilter(t,e){let s=[];return Array.isArray(t)?(s=t.map((t=>this.fromFilter(t.toString(),e))),s.join(" ")):"".concat(e?"-":"").concat(this.key(),":").concat(this.filterValueToGambitValue(t))}filterValueToGambitValue(t){return t}}flarum.reg.add("flarum-tags","common/query/discussions/TagGambit",xt);const wt=[(new(ct().Store)).add("tags",Tt),(new(ct().Search)).gambit("discussions",xt),(new(ct().Routes)).add("tags","/tags",R).add("tag","/t/:tags",G()).helper("tag",(t=>a().route("tag",{tags:t.slug()}))),(new(ct().PostTypes)).add("discussionTagged",ft),new(ct().Model)(mt()).hasMany("tags").attribute("canTag")];a().initializers.add("flarum-tags",(function(){a().tagList=new l,(0,c.extend)(d().prototype,"navItems",(function(t){if(t.add("tags",m(h(),{icon:"fas fa-th-large",href:a().route("tags")},a().translator.trans("flarum-tags.forum.index.tags_link")),-10),a().current.matches(R))return;t.add("separator",m(f(),null),-12);const e=a().search.state.stickyParams(),s=a().store.all("tags"),r=a().currentTag(),o=s=>{let a=r===s;!a&&r&&(a=r.parent()===s),t.add("tag"+s.id(),m(w,{model:s,params:e,active:a},null==s?void 0:s.name()),-14)};(0,O.Z)(s).filter((t=>null!==t.position()&&(!t.isChild()||r&&(t.parent()===r||t.parent()===r.parent())))).forEach(o);const n=s.filter((t=>null===t.position())).sort(((t,e)=>e.discussionCount()-t.discussionCount()));n.splice(0,3).forEach(o),n.length&&t.add("moreTags",m(h(),{href:a().route("tags")},a().translator.trans("flarum-tags.forum.index.more_link")),-16)})),a().currentTag=function(t){if(this.currentActiveTag&&!t)return this.currentActiveTag;const e=this.search.state.params().tags;let s=null;if(e&&(s=Q(e)),e&&!s||s&&!s.isChild()&&!s.children()){if(this.currentTagLoading)return;this.currentTagLoading=!0,this.store.find("tags",e,{include:"children,children.parent,parent"}).then((()=>{this.currentActiveTag=Q(e),m.redraw()})).finally((()=>{this.currentTagLoading=!1}))}if(s)return this.currentActiveTag=s,this.currentActiveTag;this.currentActiveTag=void 0},(0,c.extend)(G().prototype,"view",(function(t){a().currentTag(!0)})),(0,c.override)(G().prototype,"hero",(function(t){const e=a().currentTag();return e?m(J,{model:e}):t()})),(0,c.extend)(G().prototype,"view",(function(t){const e=a().currentTag();e&&(t.attrs.className+=" IndexPage--tag"+e.id())})),(0,c.extend)(G().prototype,"setTitle",(function(){const t=a().currentTag();t&&a().setTitle(t.name())})),(0,c.extend)(d().prototype,"items",(function(t){const e=a().currentTag();if(e){const s=e.color(),r=e.canStartDiscussion()||!a().session.user,o=t.get("newDiscussion");s&&(o.attrs.className=y()([o.attrs.className,"Button--tagColored",E()(s)]),o.attrs.style={"--color":s}),o.attrs.disabled=!r,o.children=a().translator.trans(r?"core.forum.index.start_discussion_button":"core.forum.index.cannot_start_discussion_button")}})),(0,c.extend)(U().prototype,"params",(function(t){t.tags=m.route.param("tags")})),(0,c.extend)(K().prototype,"requestParams",(function(t){var e;"string"==typeof t.include?t.include=[t.include]:null==(e=t.include)||e.push("tags","tags.parent"),this.params.tags&&(t.filter||(t.filter={}),t.filter.tag=this.params.tags)})),(0,c.extend)(Y().prototype,"infoItems",(function(t){const e=this.attrs.discussion.tags();e&&e.length&&t.add("tags",st(e),10)})),(0,c.extend)(et().prototype,"view",(function(t){const e=(0,O.Z)(this.attrs.discussion.tags());if(e&&e.length){const s=e[0].color();s&&(t.attrs.style={"--hero-bg":s},t.attrs.className=y()(t.attrs.className,"DiscussionHero--colored",E()(s)))}})),(0,c.extend)(et().prototype,"items",(function(t){const e=this.attrs.discussion.tags();e&&e.length&&t.add("tags",st(e,{link:!0}),5)})),(0,c.extend)(at(),"moderationControls",(function(t,e){e.canTag()&&t.add("tags",m(nt(),{icon:"fas fa-tag",onclick:()=>app.modal.show((()=>s.e(642).then(s.bind(s,884))),{discussion:e})},app.translator.trans("flarum-tags.forum.discussion_controls.edit_tags_button")))})),(0,c.extend)(d().prototype,"newDiscussionAction",(function(t){const e=a().currentTag();if(e){const s=e.parent(),r=s?[s,e]:[e];t.then((t=>t.fields.tags=r))}else a().composer.fields.tags=[]})),(0,c.extend)("flarum/forum/components/DiscussionComposer","oninit",(function(){a().tagList.load(["parent"]).then((()=>m.redraw())),this.constructor.prototype.chooseTags=function(){(0,it.Z)().length&&a().modal.show((()=>s.e(642).then(s.bind(s,884))),{selectedTags:(this.composer.fields.tags||[]).slice(0),onsubmit:t=>{this.composer.fields.tags=t,this.$("textarea").focus()}})}})),(0,c.extend)("flarum/forum/components/DiscussionComposer","headerItems",(function(t){const e=this.composer.fields.tags||[],s=(0,it.Z)();t.add("tags",m("a",{className:y()(["DiscussionComposer-changeTags",!s.length&&"disabled"]),onclick:this.chooseTags.bind(this)},e.length?st(e):m("span",{className:"TagLabel untagged"},a().translator.trans("flarum-tags.forum.composer_discussion.choose_tags_link"))),10)})),(0,c.override)("flarum/forum/components/DiscussionComposer","onsubmit",(function(t){const e=this.composer.fields.tags||[],r=e.filter((t=>null!==t.position()&&!t.isChild())),o=e.filter((t=>null===t.position())),n=(0,it.Z)(),i=parseInt(a().forum.attribute("minPrimaryTags")),l=parseInt(a().forum.attribute("minSecondaryTags")),c=parseInt(a().forum.attribute("maxPrimaryTags")),u=parseInt(a().forum.attribute("maxSecondaryTags"));(!e.length&&0!==c&&0!==u||r.lengths.e(642).then(s.bind(s,884))),{selectedTags:e,onsubmit:e=>{this.composer.fields.tags=e,t()}}):t()})),(0,c.extend)("flarum/forum/components/DiscussionComposer","data",(function(t){t.relationships=t.relationships||{},t.relationships.tags=this.composer.fields.tags}))}))},490:(t,e,s)=>{"use strict";function r(t){let e=app.store.all("tags");if(t){const s=t.tags()||[];e=e.filter((t=>t.canAddToDiscussion()||s.includes(t)))}else e=e.filter((t=>t.canStartDiscussion()));return e}s.d(e,{Z:()=>r}),flarum.reg.add("flarum-tags","forum/utils/getSelectableTags",r)},433:t=>{"use strict";t.exports=flarum.reg.get("core","common/Component")},351:t=>{"use strict";t.exports=flarum.reg.get("core","common/app")},645:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/Button")},44:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/FormModal")},678:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/Link")},149:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/LoadingIndicator")},291:t=>{"use strict";t.exports=flarum.reg.get("core","common/helpers/highlight")},679:t=>{"use strict";t.exports=flarum.reg.get("core","common/helpers/textContrastClass")},657:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/KeyboardNavigatable")},636:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/Stream")},836:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/classList")},780:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/extract")},596:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/extractText")},892:t=>{"use strict";t.exports=flarum.reg.get("core","forum/app")},232:t=>{"use strict";t.exports=flarum.reg.get("core","forum/components/DiscussionPage")},905:(t,e,s)=>{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function a(t,e,s){return(e=function(t){var e=function(t,e){if("object"!==r(t)||null===t)return t;var s=t[Symbol.toPrimitive];if(void 0!==s){var a=s.call(t,e);if("object"!==r(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"===r(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}s.d(e,{Z:()=>a})}},r={};function a(t){var e=r[t];if(void 0!==e)return e.exports;var o=r[t]={exports:{}};return s[t](o,o.exports,a),o.exports}a.m=s,a.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return a.d(e,{a:e}),e},a.d=(t,e)=>{for(var s in e)a.o(e,s)&&!a.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},a.f={},a.e=t=>Promise.all(Object.keys(a.f).reduce(((e,s)=>(a.f[s](t,e),e)),[])),a.u=t=>"forum/components/TagDiscussionModal.js",a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t={},e="module.exports:",a.l=(s,r,o,n)=>{if(t[s])t[s].push(r);else{var i,l;if(void 0!==o)for(var c=document.getElementsByTagName("script"),u=0;u{i.onerror=i.onload=null,clearTimeout(g);var a=t[s];if(delete t[s],i.parentNode&&i.parentNode.removeChild(i),a&&a.forEach((t=>t(r))),e)return e(r)},g=setTimeout(d.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.bind(null,i.onload),l&&document.head.appendChild(i)}},a.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t;a.g.importScripts&&(t=a.g.location+"");var e=a.g.document;if(!t&&e&&(e.currentScript&&(t=e.currentScript.src),!t)){var s=e.getElementsByTagName("script");s.length&&(t=s[s.length-1].src)}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=t})(),a.f.compat=(t,e)=>{const s=a.l;a.l=flarum.reg.loadChunk.bind(flarum.reg,s)},(()=>{var t={315:0};a.f.j=(e,s)=>{var r=a.o(t,e)?t[e]:void 0;if(0!==r)if(r)s.push(r[2]);else{var o=new Promise(((s,a)=>r=t[e]=[s,a]));s.push(r[2]=o);var n=a.p+a.u(e),i=new Error;a.l(n,(s=>{if(a.o(t,e)&&(0!==(r=t[e])&&(t[e]=void 0),r)){var o=s&&("load"===s.type?"missing":s.type),n=s&&s.target&&s.target.src;i.message="Loading chunk "+e+" failed.\n("+o+": "+n+")",i.name="ChunkLoadError",i.type=o,i.request=n,r[1](i)}}),"chunk-"+e,e)}};var e=(e,s)=>{var r,o,[n,i,l]=s,c=0;if(n.some((e=>0!==t[e]))){for(r in i)a.o(i,r)&&(a.m[r]=i[r]);l&&l(a)}for(e&&e(s);c{"use strict";a.r(o),a.d(o,{extend:()=>s.l});var t=a(270),e={};for(const s in t)"default"!==s&&(e[s]=()=>t[s]);a.d(o,e);var s=a(664)})(),module.exports=o})();
+(()=>{var t,e,s={974:(t,e,s)=>{"use strict";s.d(e,{Z:()=>o});var r=s(836),a=s.n(r);function o(t,e,s){void 0===e&&(e={}),void 0===s&&(s={});const r=t&&t.icon(),{useColor:o=!0}=s;return e.className=a()([e.className,"icon text-colored",r?t.icon():"TagIcon"]),t&&o?(e.style=e.style||{},e.style["--color"]=t.color()):t||(e.className+=" untagged"),r?m("i",e):m("span",e)}flarum.reg.add("flarum-tags","common/helpers/tagIcon",o)},924:(t,e,s)=>{"use strict";s.d(e,{Z:()=>g});var r=s(780),a=s.n(r),o=s(678),n=s.n(o),i=s(836),l=s.n(i),c=s(679),u=s.n(c),d=s(974);function g(t,e){void 0===e&&(e={}),e.style=e.style||{},e.className="TagLabel "+(e.className||"");const s=a()(e,"link"),r=t?t.name():app.translator.trans("flarum-tags.lib.deleted_tag_text");if(t){const r=t.color();r&&(e.style["--tag-bg"]=r,e.className=l()(e.className,"colored",u()(r))),s&&(e.title=t.description()||"",e.href=app.route("tag",{tags:t.slug()})),t.isChild()&&(e.className+=" TagLabel--child")}else e.className+=" untagged";return m(s?n():"span",e,m("span",{className:"TagLabel-text"},t&&t.icon()&&(0,d.Z)(t,{className:"TagLabel-icon"},{useColor:!1}),m("span",{className:"TagLabel-name"},r)))}flarum.reg.add("flarum-tags","common/helpers/tagLabel",g)},270:()=>{},648:(t,e,s)=>{"use strict";function r(t){return t.slice(0).sort(((t,e)=>{const s=t.position(),r=e.position();if(null===s&&null===r)return e.discussionCount()-t.discussionCount();if(null===r)return-1;if(null===s)return 1;const a=t.parent(),o=e.parent();return a===o?s-r:a&&o?a.position()-o.position():a?a===e?1:a.position()-r:o?o===t?-1:s-o.position():0}))}s.d(e,{Z:()=>r}),flarum.reg.add("flarum-tags","common/utils/sortTags",r)},664:(t,e,s)=>{"use strict";s.d(e,{l:()=>wt});var r=s(892),a=s.n(r),o=s(905),n=s(351),i=s.n(n);class l{constructor(){(0,o.Z)(this,"loadedIncludes",void 0)}async load(t){if(void 0===t&&(t=[]),!this.loadedIncludes)return this.query(t);const e=t.filter((t=>!this.loadedIncludes.has(t)));return 0===e.length?Promise.resolve(i().store.all("tags")):this.query(e)}async query(t){return void 0===t&&(t=[]),null!=this.loadedIncludes||(this.loadedIncludes=new Set),i().store.find("tags",{include:t.join(",")}).then((e=>{const s=Array.isArray(e)?e:[e];return t.forEach((t=>this.loadedIncludes.add(t))),s}))}}flarum.reg.add("flarum-tags","common/states/TagListState",l);const c=flarum.reg.get("core","common/extend"),u=flarum.reg.get("core","forum/components/IndexSidebar");var d=s.n(u);const g=flarum.reg.get("core","common/components/Separator");var f=s.n(g);const p=flarum.reg.get("core","common/components/LinkButton");var h=s.n(p),b=s(678),v=s.n(b),T=s(836),y=s.n(T),x=s(974);class w extends(h()){view(t){const e=this.attrs.model,s=e&&e.description(),r=y()("TagLinkButton hasIcon",{child:e.isChild()},this.attrs.className);return m(v(),{className:r,href:this.attrs.route,style:e?{"--color":e.color()}:void 0,title:s||void 0},(0,x.Z)(e,{className:"Button-icon"}),m("span",{className:"Button-label"},e?e.name():app.translator.trans("flarum-tags.forum.index.untagged_link")))}static initAttrs(t){super.initAttrs(t);const e=t.model;t.params.tags=e?e.slug():"untagged",t.route=app.route("tag",t.params)}}flarum.reg.add("flarum-tags","forum/components/TagLinkButton",w);const k=flarum.reg.get("core","common/components/Page");var N=s.n(k);const C=flarum.reg.get("core","forum/components/PageStructure");var _=s.n(C);const P=flarum.reg.get("core","forum/components/WelcomeHero");var S=s.n(P),D=s(149),A=s.n(D);const L=flarum.reg.get("core","common/utils/ItemList");var I=s.n(L);const Z=flarum.reg.get("core","common/helpers/humanTime");var j=s.n(Z),M=s(679),E=s.n(M),V=s(596),B=s.n(V),H=s(924),O=s(648);class R extends(N()){constructor(){super(...arguments),(0,o.Z)(this,"tags",void 0),(0,o.Z)(this,"loading",void 0)}oninit(t){super.oninit(t),a().history.push("tags",B()(a().translator.trans("flarum-tags.forum.header.back_to_tags_tooltip"))),this.tags=[];const e=a().preloadedApiDocument();e?this.tags=(0,O.Z)(e.filter((t=>!t.isChild()))):(this.loading=!0,a().tagList.load(["children","lastPostedDiscussion","parent"]).then((()=>{this.tags=(0,O.Z)(a().store.all("tags").filter((t=>!t.isChild()))),this.loading=!1,m.redraw()})))}oncreate(t){super.oncreate(t),a().setTitle(B()(a().translator.trans("flarum-tags.forum.all_tags.meta_title_text"))),a().setTitleCount(0)}view(){return m(_(),{className:"TagsPage",hero:this.hero.bind(this),sidebar:this.sidebar.bind(this)},this.contentItems().toArray())}contentItems(){const t=new(I());if(this.loading)t.add("loading",m(A(),null));else{const e=this.tags.filter((t=>null!==t.position())),s=this.tags.filter((t=>null===t.position()));t.add("tagTiles",this.tagTileListView(e),100),s.length&&t.add("cloud",this.cloudView(s),10)}return t}hero(){return m(S(),null)}sidebar(){return m(d(),null)}tagTileListView(t){return m("ul",{className:"TagTiles"},t.map(this.tagTileView.bind(this)))}tagTileView(t){const e=t.lastPostedDiscussion(),s=(0,O.Z)(t.children()||[]);return m("li",{className:y()("TagTile",{colored:t.color()},E()(t.color())),style:{"--tag-bg":t.color()}},m(v(),{className:"TagTile-info",href:a().route.tag(t)},m("div",{className:"TagTile-heading"},t.icon()&&(0,x.Z)(t,{},{useColor:!1}),m("h3",{className:"TagTile-name"},t.name())),m("p",{className:"TagTile-description"},t.description()),!!s&&m("div",{className:"TagTile-children"},s.map((t=>[m(v(),{href:a().route.tag(t)},t.name())," "])))),e?m(v(),{className:"TagTile-lastPostedDiscussion",href:a().route.discussion(e,e.lastPostNumber())},m("span",{className:"TagTile-lastPostedDiscussion-title"},e.title()),j()(e.lastPostedAt())):m("span",{className:"TagTile-lastPostedDiscussion"}))}cloudView(t){return m("div",{className:"TagCloud"},t.map((t=>[(0,H.Z)(t,{link:!0})," "])))}}flarum.reg.add("flarum-tags","forum/components/TagsPage",R);const q=flarum.reg.get("core","forum/components/IndexPage");var G=s.n(q);const F=flarum.reg.get("core","forum/states/DiscussionListState");var K=s.n(F);const $=flarum.reg.get("core","forum/states/GlobalSearchState");var U=s.n($),z=s(433),W=s.n(z);class J extends(W()){view(){const t=this.attrs.model,e=t.color();return m("header",{className:y()("Hero","TagHero",{"TagHero--colored":e,[E()(e)]:e}),style:e?{"--hero-bg":e}:void 0},m("div",{className:"container"},m("div",{className:"containerNarrow"},m("h1",{className:"Hero-title"},t.icon()&&(0,x.Z)(t,{},{useColor:!1})," ",t.name()),m("div",{className:"Hero-subtitle"},t.description()))))}}flarum.reg.add("flarum-tags","forum/components/TagHero",J);const Q=t=>a().store.all("tags").find((e=>0===e.slug().localeCompare(t,void 0,{sensitivity:"base"}))),X=flarum.reg.get("core","forum/components/DiscussionListItem");var Y=s.n(X);const tt=flarum.reg.get("core","forum/components/DiscussionHero");var et=s.n(tt);function st(t,e){void 0===e&&(e={});const s=[],{link:r,...a}=e;return a.className=y()("TagsLabel",a.className),t?(0,O.Z)(t).forEach((e=>{(e||1===t.length)&&s.push((0,H.Z)(e,{link:r}))})):s.push((0,H.Z)()),m("span",a,s)}s(780),flarum.reg.add("flarum-tags","common/helpers/tagsLabel",st);const rt=flarum.reg.get("core","forum/utils/DiscussionControls");var at=s.n(rt),ot=s(645),nt=s.n(ot);flarum.reg.addChunkModule("642","884","flarum-tags","forum/components/TagDiscussionModal"),flarum.reg.addChunkModule("642","884","flarum-tags","/home/runner/work/framework/framework/extensions/tags/js/src/forum/components/TagDiscussionModal.tsx"),flarum.reg.addChunkModule("642","884","flarum-tags","/home/runner/work/framework/framework/extensions/tags/js/src/common/components/TagSelectionModal.tsx"),flarum.reg.addChunkModule("642","884","flarum-tags","/home/runner/work/framework/framework/extensions/tags/js/src/forum/components/ToggleButton.js");var it=s(490);const lt=flarum.reg.get("core","common/extenders");var ct=s.n(lt);const ut=flarum.reg.get("core","common/models/Discussion");var mt=s.n(ut);const dt=flarum.reg.get("core","forum/components/EventPost");var gt=s.n(dt);class ft extends(gt()){static initAttrs(t){super.initAttrs(t);const e=t.post.content()[0],s=t.post.content()[1];function r(t,e){return t.filter((t=>-1===e.indexOf(t))).map((t=>app.store.getById("tags",t)))}t.tagsAdded=r(s,e),t.tagsRemoved=r(e,s)}icon(){return"fas fa-tag"}descriptionKey(){return this.attrs.tagsAdded.length?this.attrs.tagsRemoved.length?"flarum-tags.forum.post_stream.added_and_removed_tags_text":"flarum-tags.forum.post_stream.added_tags_text":"flarum-tags.forum.post_stream.removed_tags_text"}descriptionData(){const t={};return this.attrs.tagsAdded.length&&(t.tagsAdded=app.translator.trans("flarum-tags.forum.post_stream.tags_text",{tags:st(this.attrs.tagsAdded,{link:!0}),count:this.attrs.tagsAdded.length})),this.attrs.tagsRemoved.length&&(t.tagsRemoved=app.translator.trans("flarum-tags.forum.post_stream.tags_text",{tags:st(this.attrs.tagsRemoved,{link:!0}),count:this.attrs.tagsRemoved.length})),t}}flarum.reg.add("flarum-tags","forum/components/DiscussionTaggedPost",ft);const pt=flarum.reg.get("core","common/utils/computed");var ht=s.n(pt);const bt=flarum.reg.get("core","common/Model");var vt=s.n(bt);class Tt extends(vt()){name(){return vt().attribute("name").call(this)}slug(){return vt().attribute("slug").call(this)}description(){return vt().attribute("description").call(this)}color(){return vt().attribute("color").call(this)}backgroundUrl(){return vt().attribute("backgroundUrl").call(this)}backgroundMode(){return vt().attribute("backgroundMode").call(this)}icon(){return vt().attribute("icon").call(this)}position(){return vt().attribute("position").call(this)}parent(){return vt().hasOne("parent").call(this)}children(){return vt().hasMany("children").call(this)}defaultSort(){return vt().attribute("defaultSort").call(this)}isChild(){return vt().attribute("isChild").call(this)}isHidden(){return vt().attribute("isHidden").call(this)}isPrimary(){return vt().attribute("isPrimary").call(this)}discussionCount(){return vt().attribute("discussionCount").call(this)}lastPostedAt(){return vt().attribute("lastPostedAt",vt().transformDate).call(this)}lastPostedDiscussion(){return vt().hasOne("lastPostedDiscussion").call(this)}isRestricted(){return vt().attribute("isRestricted").call(this)}canStartDiscussion(){return vt().attribute("canStartDiscussion").call(this)}canAddToDiscussion(){return vt().attribute("canAddToDiscussion").call(this)}isPrimaryParent(){return ht()("position","parent",((t,e)=>null!==t&&!1===e)).call(this)}}flarum.reg.add("flarum-tags","common/models/Tag",Tt);const yt=flarum.reg.get("core","common/query/IGambit");class xt extends yt.KeyValueGambit{constructor(){super(...arguments),(0,o.Z)(this,"predicates",!0)}key(){return i().translator.trans("flarum-tags.lib.gambits.discussions.tag.key",{},!0)}hint(){return i().translator.trans("flarum-tags.lib.gambits.discussions.tag.hint",{},!0)}filterKey(){return"tag"}gambitValueToFilterValue(t){return[t]}fromFilter(t,e){let s=[];return Array.isArray(t)?(s=t.map((t=>this.fromFilter(t.toString(),e))),s.join(" ")):"".concat(e?"-":"").concat(this.key(),":").concat(this.filterValueToGambitValue(t))}filterValueToGambitValue(t){return t}}flarum.reg.add("flarum-tags","common/query/discussions/TagGambit",xt);const wt=[(new(ct().Store)).add("tags",Tt),(new(ct().Search)).gambit("discussions",xt),(new(ct().Routes)).add("tags","/tags",R).add("tag","/t/:tags",G()).helper("tag",(t=>a().route("tag",{tags:t.slug()}))),(new(ct().PostTypes)).add("discussionTagged",ft),new(ct().Model)(mt()).hasMany("tags").attribute("canTag")];a().initializers.add("flarum-tags",(()=>{a().tagList=new l,(0,c.extend)(d().prototype,"navItems",(function(t){if(t.add("tags",m(h(),{icon:"fas fa-th-large",href:a().route("tags")},a().translator.trans("flarum-tags.forum.index.tags_link")),-10),a().current.matches(R))return;t.add("separator",m(f(),null),-12);const e=a().search.state.stickyParams(),s=a().store.all("tags"),r=a().currentTag(),o=s=>{let a=r===s;!a&&r&&(a=r.parent()===s),t.add("tag"+s.id(),m(w,{model:s,params:e,active:a},null==s?void 0:s.name()),-14)};(0,O.Z)(s).filter((t=>null!==t.position()&&(!t.isChild()||r&&(t.parent()===r||t.parent()===r.parent())))).forEach(o);const n=s.filter((t=>null===t.position())).sort(((t,e)=>e.discussionCount()-t.discussionCount()));n.splice(0,3).forEach(o),n.length&&t.add("moreTags",m(h(),{href:a().route("tags")},a().translator.trans("flarum-tags.forum.index.more_link")),-16)})),a().currentTag=function(t){if(this.currentActiveTag&&!t)return this.currentActiveTag;const e=this.search.state.params().tags;let s=null;if(e&&(s=Q(e)),e&&!s||s&&!s.isChild()&&!s.children()){if(this.currentTagLoading)return;this.currentTagLoading=!0,this.store.find("tags",e,{include:"children,children.parent,parent"}).then((()=>{this.currentActiveTag=Q(e),m.redraw()})).finally((()=>{this.currentTagLoading=!1}))}if(s)return this.currentActiveTag=s,this.currentActiveTag;this.currentActiveTag=void 0},(0,c.extend)(G().prototype,"view",(function(t){a().currentTag(!0)})),(0,c.override)(G().prototype,"hero",(function(t){const e=a().currentTag();return e?m(J,{model:e}):t()})),(0,c.extend)(G().prototype,"view",(function(t){const e=a().currentTag();e&&(t.attrs.className+=" IndexPage--tag"+e.id())})),(0,c.extend)(G().prototype,"setTitle",(function(){const t=a().currentTag();t&&a().setTitle(t.name())})),(0,c.extend)(d().prototype,"items",(function(t){const e=a().currentTag();if(e){const s=e.color(),r=e.canStartDiscussion()||!a().session.user,o=t.get("newDiscussion");s&&(o.attrs.className=y()([o.attrs.className,"Button--tagColored",E()(s)]),o.attrs.style={"--color":s}),o.attrs.disabled=!r,o.children=a().translator.trans(r?"core.forum.index.start_discussion_button":"core.forum.index.cannot_start_discussion_button")}})),(0,c.extend)(U().prototype,"params",(function(t){t.tags=m.route.param("tags")})),(0,c.extend)(K().prototype,"requestParams",(function(t){var e;"string"==typeof t.include?t.include=[t.include]:null==(e=t.include)||e.push("tags","tags.parent"),this.params.tags&&(t.filter||(t.filter={}),t.filter.tag=this.params.tags)})),(0,c.extend)(Y().prototype,"infoItems",(function(t){const e=this.attrs.discussion.tags();e&&e.length&&t.add("tags",st(e),10)})),(0,c.extend)(et().prototype,"view",(function(t){const e=(0,O.Z)(this.attrs.discussion.tags());if(e&&e.length){const s=e[0].color();s&&(t.attrs.style={"--hero-bg":s},t.attrs.className=y()(t.attrs.className,"DiscussionHero--colored",E()(s)))}})),(0,c.extend)(et().prototype,"items",(function(t){const e=this.attrs.discussion.tags();e&&e.length&&t.add("tags",st(e,{link:!0}),5)})),(0,c.extend)(at(),"moderationControls",(function(t,e){e.canTag()&&t.add("tags",m(nt(),{icon:"fas fa-tag",onclick:()=>app.modal.show((()=>s.e(642).then(s.bind(s,884))),{discussion:e})},app.translator.trans("flarum-tags.forum.discussion_controls.edit_tags_button")))})),(0,c.extend)(d().prototype,"newDiscussionAction",(function(t){const e=a().currentTag();if(e){const s=e.parent(),r=s?[s,e]:[e];t.then((t=>t.fields.tags=r))}else a().composer.fields.tags=[]})),(0,c.extend)("flarum/forum/components/DiscussionComposer","oninit",(function(){a().tagList.load(["parent"]).then((()=>m.redraw())),this.constructor.prototype.chooseTags=function(){(0,it.Z)().length&&a().modal.show((()=>s.e(642).then(s.bind(s,884))),{selectedTags:(this.composer.fields.tags||[]).slice(0),onsubmit:t=>{this.composer.fields.tags=t,this.$("textarea").focus()}})}})),(0,c.extend)("flarum/forum/components/DiscussionComposer","headerItems",(function(t){const e=this.composer.fields.tags||[],s=(0,it.Z)();t.add("tags",m("a",{className:y()(["DiscussionComposer-changeTags",!s.length&&"disabled"]),onclick:this.chooseTags.bind(this)},e.length?st(e):m("span",{className:"TagLabel untagged"},a().translator.trans("flarum-tags.forum.composer_discussion.choose_tags_link"))),10)})),(0,c.override)("flarum/forum/components/DiscussionComposer","onsubmit",(function(t){const e=this.composer.fields.tags||[],r=e.filter((t=>null!==t.position()&&!t.isChild())),o=e.filter((t=>null===t.position())),n=(0,it.Z)(),i=parseInt(a().forum.attribute("minPrimaryTags")),l=parseInt(a().forum.attribute("minSecondaryTags")),c=parseInt(a().forum.attribute("maxPrimaryTags")),u=parseInt(a().forum.attribute("maxSecondaryTags"));(!e.length&&0!==c&&0!==u||r.lengths.e(642).then(s.bind(s,884))),{selectedTags:e,onsubmit:e=>{this.composer.fields.tags=e,t()}}):t()})),(0,c.extend)("flarum/forum/components/DiscussionComposer","data",(function(t){t.relationships=t.relationships||{},t.relationships.tags=this.composer.fields.tags}))}))},490:(t,e,s)=>{"use strict";function r(t){let e=app.store.all("tags");if(t){const s=t.tags()||[];e=e.filter((t=>t.canAddToDiscussion()||s.includes(t)))}else e=e.filter((t=>t.canStartDiscussion()));return e}s.d(e,{Z:()=>r}),flarum.reg.add("flarum-tags","forum/utils/getSelectableTags",r)},433:t=>{"use strict";t.exports=flarum.reg.get("core","common/Component")},351:t=>{"use strict";t.exports=flarum.reg.get("core","common/app")},645:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/Button")},44:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/FormModal")},678:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/Link")},149:t=>{"use strict";t.exports=flarum.reg.get("core","common/components/LoadingIndicator")},291:t=>{"use strict";t.exports=flarum.reg.get("core","common/helpers/highlight")},679:t=>{"use strict";t.exports=flarum.reg.get("core","common/helpers/textContrastClass")},657:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/KeyboardNavigatable")},636:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/Stream")},836:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/classList")},780:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/extract")},596:t=>{"use strict";t.exports=flarum.reg.get("core","common/utils/extractText")},892:t=>{"use strict";t.exports=flarum.reg.get("core","forum/app")},232:t=>{"use strict";t.exports=flarum.reg.get("core","forum/components/DiscussionPage")},905:(t,e,s)=>{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function a(t,e,s){return(e=function(t){var e=function(t,e){if("object"!==r(t)||null===t)return t;var s=t[Symbol.toPrimitive];if(void 0!==s){var a=s.call(t,e);if("object"!==r(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"===r(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}s.d(e,{Z:()=>a})}},r={};function a(t){var e=r[t];if(void 0!==e)return e.exports;var o=r[t]={exports:{}};return s[t](o,o.exports,a),o.exports}a.m=s,a.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return a.d(e,{a:e}),e},a.d=(t,e)=>{for(var s in e)a.o(e,s)&&!a.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},a.f={},a.e=t=>Promise.all(Object.keys(a.f).reduce(((e,s)=>(a.f[s](t,e),e)),[])),a.u=t=>"forum/components/TagDiscussionModal.js",a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t={},e="module.exports:",a.l=(s,r,o,n)=>{if(t[s])t[s].push(r);else{var i,l;if(void 0!==o)for(var c=document.getElementsByTagName("script"),u=0;u{i.onerror=i.onload=null,clearTimeout(g);var a=t[s];if(delete t[s],i.parentNode&&i.parentNode.removeChild(i),a&&a.forEach((t=>t(r))),e)return e(r)},g=setTimeout(d.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=d.bind(null,i.onerror),i.onload=d.bind(null,i.onload),l&&document.head.appendChild(i)}},a.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},(()=>{var t;a.g.importScripts&&(t=a.g.location+"");var e=a.g.document;if(!t&&e&&(e.currentScript&&(t=e.currentScript.src),!t)){var s=e.getElementsByTagName("script");s.length&&(t=s[s.length-1].src)}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=t})(),a.f.compat=(t,e)=>{const s=a.l;a.l=flarum.reg.loadChunk.bind(flarum.reg,s)},(()=>{var t={315:0};a.f.j=(e,s)=>{var r=a.o(t,e)?t[e]:void 0;if(0!==r)if(r)s.push(r[2]);else{var o=new Promise(((s,a)=>r=t[e]=[s,a]));s.push(r[2]=o);var n=a.p+a.u(e),i=new Error;a.l(n,(s=>{if(a.o(t,e)&&(0!==(r=t[e])&&(t[e]=void 0),r)){var o=s&&("load"===s.type?"missing":s.type),n=s&&s.target&&s.target.src;i.message="Loading chunk "+e+" failed.\n("+o+": "+n+")",i.name="ChunkLoadError",i.type=o,i.request=n,r[1](i)}}),"chunk-"+e,e)}};var e=(e,s)=>{var r,o,[n,i,l]=s,c=0;if(n.some((e=>0!==t[e]))){for(r in i)a.o(i,r)&&(a.m[r]=i[r]);l&&l(a)}for(e&&e(s);c{"use strict";a.r(o),a.d(o,{extend:()=>s.l});var t=a(270),e={};for(const s in t)"default"!==s&&(e[s]=()=>t[s]);a.d(o,e);var s=a(664)})(),module.exports=o})();
//# sourceMappingURL=forum.js.map
\ No newline at end of file
diff --git a/extensions/tags/js/dist/forum.js.map b/extensions/tags/js/dist/forum.js.map
index cd35ca5145..6fb97a0c15 100644
--- a/extensions/tags/js/dist/forum.js.map
+++ b/extensions/tags/js/dist/forum.js.map
@@ -1 +1 @@
-{"version":3,"file":"forum.js","mappings":"UAAIA,EACAC,E,qECAW,SAASC,EAAQC,EAAKC,EAAOC,QAC5B,IAAV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yB,SAAfA,EAAMS,KAAkB,UAAYT,EAAMS,MAChEsB,EAAU/B,GAASA,EAAMU,QAAUV,EAAMU,OAAOb,IACpDgC,EAAMG,QAAU,iBAAmB9D,EAAU,cAAgB4D,EAAY,KAAOC,EAAU,IAC1FF,EAAMhR,KAAO,iBACbgR,EAAMpB,KAAOqB,EACbD,EAAMI,QAAUF,EAChBJ,EAAmB,GAAGE,EACvB,CACD,GAEwC,SAAW3D,EAASA,EAE/D,CACD,EAcF,IAAIgE,EAAuB,CAACC,EAA4B9K,KACvD,IAGIkG,EAAUW,GAHTkE,EAAUC,EAAaC,GAAWjL,EAGhBgI,EAAI,EAC3B,GAAG+C,EAASG,MAAMzL,GAAgC,IAAxB2K,EAAgB3K,KAAa,CACtD,IAAIyG,KAAY8E,EACZ/E,EAAoBS,EAAEsE,EAAa9E,KACrCD,EAAoBhN,EAAEiN,GAAY8E,EAAY9E,IAG7C+E,GAAsBA,EAAQhF,EAClC,CAEA,IADG6E,GAA4BA,EAA2B9K,GACrDgI,EAAI+C,EAASrP,OAAQsM,IACzBnB,EAAUkE,EAAS/C,GAChB/B,EAAoBS,EAAE0D,EAAiBvD,IAAYuD,EAAgBvD,IACrEuD,EAAgBvD,GAAS,KAE1BuD,EAAgBvD,GAAW,CAC5B,EAIGsE,EAAqBC,KAAiC,2BAAIA,KAAiC,4BAAK,GACpGD,EAAmBhP,QAAQ0O,EAAqBtN,KAAK,KAAM,IAC3D4N,EAAmBrM,KAAO+L,EAAqBtN,KAAK,KAAM4N,EAAmBrM,KAAKvB,KAAK4N,G","sources":["webpack://@flarum/tags/webpack/runtime/load script","webpack://@flarum/tags/./src/common/helpers/tagIcon.js","webpack://@flarum/tags/./src/common/helpers/tagLabel.js","webpack://@flarum/tags/./src/common/utils/sortTags.tsx","webpack://@flarum/tags/./src/common/states/TagListState.ts","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/components/IndexSidebar')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Separator')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/LinkButton')\"","webpack://@flarum/tags/./src/forum/components/TagLinkButton.js","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Page')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/components/PageStructure')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/components/WelcomeHero')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/ItemList')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/helpers/humanTime')\"","webpack://@flarum/tags/./src/forum/components/TagsPage.tsx","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/components/IndexPage')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/states/DiscussionListState')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/states/GlobalSearchState')\"","webpack://@flarum/tags/./src/forum/components/TagHero.js","webpack://@flarum/tags/./src/forum/addTagFilter.tsx","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/components/DiscussionListItem')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/components/DiscussionHero')\"","webpack://@flarum/tags/./src/common/helpers/tagsLabel.js","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/utils/DiscussionControls')\"","webpack://@flarum/tags/./src/forum/addTagControl.js","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/extenders')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/models/Discussion')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/components/EventPost')\"","webpack://@flarum/tags/./src/forum/components/DiscussionTaggedPost.js","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/computed')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/Model')\"","webpack://@flarum/tags/./src/common/models/Tag.ts","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/query/IGambit')\"","webpack://@flarum/tags/./src/common/query/discussions/TagGambit.ts","webpack://@flarum/tags/./src/common/extend.ts","webpack://@flarum/tags/./src/forum/extend.ts","webpack://@flarum/tags/./src/forum/index.ts","webpack://@flarum/tags/./src/forum/addTagList.js","webpack://@flarum/tags/./src/forum/addTagLabels.js","webpack://@flarum/tags/./src/forum/addTagComposer.js","webpack://@flarum/tags/./src/forum/utils/getSelectableTags.ts","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/Component')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/app')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Button')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/FormModal')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Link')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/LoadingIndicator')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/helpers/highlight')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/helpers/textContrastClass')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/KeyboardNavigatable')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/Stream')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/classList')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/extract')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/extractText')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/app')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/components/DiscussionPage')\"","webpack://@flarum/tags/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://@flarum/tags/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://@flarum/tags/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://@flarum/tags/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://@flarum/tags/webpack/bootstrap","webpack://@flarum/tags/webpack/runtime/compat get default export","webpack://@flarum/tags/webpack/runtime/define property getters","webpack://@flarum/tags/webpack/runtime/ensure chunk","webpack://@flarum/tags/webpack/runtime/get javascript chunk filename","webpack://@flarum/tags/webpack/runtime/global","webpack://@flarum/tags/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/tags/webpack/runtime/make namespace object","webpack://@flarum/tags/webpack/runtime/publicPath","webpack://@flarum/tags/webpack/runtime/compat","webpack://@flarum/tags/webpack/runtime/jsonp chunk loading"],"sourcesContent":["var inProgress = {};\nvar dataWebpackPrefix = \"module.exports:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t};\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","import classList from 'flarum/common/utils/classList';\nexport default function tagIcon(tag, attrs, settings) {\n if (attrs === void 0) {\n attrs = {};\n }\n if (settings === void 0) {\n settings = {};\n }\n const hasIcon = tag && tag.icon();\n const {\n useColor = true\n } = settings;\n attrs.className = classList([attrs.className, 'icon text-colored', hasIcon ? tag.icon() : 'TagIcon']);\n if (tag && useColor) {\n attrs.style = attrs.style || {};\n attrs.style['--color'] = tag.color();\n } else if (!tag) {\n attrs.className += ' untagged';\n }\n return hasIcon ? m(\"i\", attrs) : m(\"span\", attrs);\n}\nflarum.reg.add('flarum-tags', 'common/helpers/tagIcon', tagIcon);","import extract from 'flarum/common/utils/extract';\nimport Link from 'flarum/common/components/Link';\nimport classList from 'flarum/common/utils/classList';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\nimport tagIcon from './tagIcon';\nexport default function tagLabel(tag, attrs) {\n if (attrs === void 0) {\n attrs = {};\n }\n attrs.style = attrs.style || {};\n attrs.className = 'TagLabel ' + (attrs.className || '');\n const link = extract(attrs, 'link');\n const tagText = tag ? tag.name() : app.translator.trans('flarum-tags.lib.deleted_tag_text');\n if (tag) {\n const color = tag.color();\n if (color) {\n attrs.style['--tag-bg'] = color;\n attrs.className = classList(attrs.className, 'colored', textContrastClass(color));\n }\n if (link) {\n attrs.title = tag.description() || '';\n attrs.href = app.route('tag', {\n tags: tag.slug()\n });\n }\n if (tag.isChild()) {\n attrs.className += ' TagLabel--child';\n }\n } else {\n attrs.className += ' untagged';\n }\n return m(link ? Link : 'span', attrs, m(\"span\", {\n className: \"TagLabel-text\"\n }, tag && tag.icon() && tagIcon(tag, {\n className: 'TagLabel-icon'\n }, {\n useColor: false\n }), m(\"span\", {\n className: \"TagLabel-name\"\n }, tagText)));\n}\nflarum.reg.add('flarum-tags', 'common/helpers/tagLabel', tagLabel);","export default function sortTags(tags) {\n return tags.slice(0).sort((a, b) => {\n const aPos = a.position();\n const bPos = b.position();\n\n // If they're both secondary tags, sort them by their discussions count,\n // descending.\n if (aPos === null && bPos === null) return b.discussionCount() - a.discussionCount();\n\n // If just one is a secondary tag, then the primary tag should\n // come first.\n if (bPos === null) return -1;\n if (aPos === null) return 1;\n\n // If we've made it this far, we know they're both primary tags. So we'll\n // need to see if they have parents.\n const aParent = a.parent();\n const bParent = b.parent();\n\n // If they both have the same parent, then their positions are local,\n // so we can compare them directly.\n if (aParent === bParent) return aPos - bPos;\n // If they are both child tags, then we will compare the positions of their\n // parents.\n else if (aParent && bParent) return aParent.position() - bParent.position();\n // If we are comparing a child tag with its parent, then we let the parent\n // come first. If we are comparing an unrelated parent/child, then we\n // compare both of the parents.\n else if (aParent) return aParent === b ? 1 : aParent.position() - bPos;else if (bParent) return bParent === a ? -1 : aPos - bParent.position();\n return 0;\n });\n}\nflarum.reg.add('flarum-tags', 'common/utils/sortTags', sortTags);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/common/app';\nexport default class TagListState {\n constructor() {\n _defineProperty(this, \"loadedIncludes\", void 0);\n }\n async load(includes) {\n if (includes === void 0) {\n includes = [];\n }\n if (!this.loadedIncludes) {\n return this.query(includes);\n }\n const unloadedIncludes = includes.filter(include => !this.loadedIncludes.has(include));\n if (unloadedIncludes.length === 0) {\n return Promise.resolve(app.store.all('tags'));\n }\n return this.query(unloadedIncludes);\n }\n async query(includes) {\n var _this$loadedIncludes;\n if (includes === void 0) {\n includes = [];\n }\n (_this$loadedIncludes = this.loadedIncludes) != null ? _this$loadedIncludes : this.loadedIncludes = new Set();\n return app.store.find('tags', {\n include: includes.join(',')\n }).then(val => {\n const tags = Array.isArray(val) ? val : [val];\n includes.forEach(include => this.loadedIncludes.add(include));\n return tags;\n });\n }\n}\nflarum.reg.add('flarum-tags', 'common/states/TagListState', TagListState);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extend');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/IndexSidebar');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Separator');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/LinkButton');","import Link from 'flarum/common/components/Link';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport classList from 'flarum/common/utils/classList';\nimport tagIcon from '../../common/helpers/tagIcon';\nexport default class TagLinkButton extends LinkButton {\n view(vnode) {\n const tag = this.attrs.model;\n const description = tag && tag.description();\n const className = classList('TagLinkButton hasIcon', {\n child: tag.isChild()\n }, this.attrs.className);\n return m(Link, {\n className: className,\n href: this.attrs.route,\n style: tag ? {\n '--color': tag.color()\n } : undefined,\n title: description || undefined\n }, tagIcon(tag, {\n className: 'Button-icon'\n }), m(\"span\", {\n className: \"Button-label\"\n }, tag ? tag.name() : app.translator.trans('flarum-tags.forum.index.untagged_link')));\n }\n static initAttrs(attrs) {\n super.initAttrs(attrs);\n const tag = attrs.model;\n attrs.params.tags = tag ? tag.slug() : 'untagged';\n attrs.route = app.route('tag', attrs.params);\n }\n}\nflarum.reg.add('flarum-tags', 'forum/components/TagLinkButton', TagLinkButton);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Page');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/PageStructure');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/WelcomeHero');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/ItemList');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/helpers/humanTime');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/forum/app';\nimport Page from 'flarum/common/components/Page';\nimport PageStructure from 'flarum/forum/components/PageStructure';\nimport WelcomeHero from 'flarum/forum/components/WelcomeHero';\nimport IndexSidebar from 'flarum/forum/components/IndexSidebar';\nimport Link from 'flarum/common/components/Link';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport humanTime from 'flarum/common/helpers/humanTime';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\nimport classList from 'flarum/common/utils/classList';\nimport extractText from 'flarum/common/utils/extractText';\nimport tagIcon from '../../common/helpers/tagIcon';\nimport tagLabel from '../../common/helpers/tagLabel';\nimport sortTags from '../../common/utils/sortTags';\nexport default class TagsPage extends Page {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"tags\", void 0);\n _defineProperty(this, \"loading\", void 0);\n }\n oninit(vnode) {\n super.oninit(vnode);\n app.history.push('tags', extractText(app.translator.trans('flarum-tags.forum.header.back_to_tags_tooltip')));\n this.tags = [];\n const preloaded = app.preloadedApiDocument();\n if (preloaded) {\n this.tags = sortTags(preloaded.filter(tag => !tag.isChild()));\n return;\n }\n this.loading = true;\n app.tagList.load(['children', 'lastPostedDiscussion', 'parent']).then(() => {\n this.tags = sortTags(app.store.all('tags').filter(tag => !tag.isChild()));\n this.loading = false;\n m.redraw();\n });\n }\n oncreate(vnode) {\n super.oncreate(vnode);\n app.setTitle(extractText(app.translator.trans('flarum-tags.forum.all_tags.meta_title_text')));\n app.setTitleCount(0);\n }\n view() {\n return m(PageStructure, {\n className: \"TagsPage\",\n hero: this.hero.bind(this),\n sidebar: this.sidebar.bind(this)\n }, this.contentItems().toArray());\n }\n contentItems() {\n const items = new ItemList();\n if (this.loading) {\n items.add('loading', m(LoadingIndicator, null));\n } else {\n const pinned = this.tags.filter(tag => tag.position() !== null);\n const cloud = this.tags.filter(tag => tag.position() === null);\n items.add('tagTiles', this.tagTileListView(pinned), 100);\n if (cloud.length) {\n items.add('cloud', this.cloudView(cloud), 10);\n }\n }\n return items;\n }\n hero() {\n return m(WelcomeHero, null);\n }\n sidebar() {\n return m(IndexSidebar, null);\n }\n tagTileListView(pinned) {\n return m(\"ul\", {\n className: \"TagTiles\"\n }, pinned.map(this.tagTileView.bind(this)));\n }\n tagTileView(tag) {\n const lastPostedDiscussion = tag.lastPostedDiscussion();\n const children = sortTags(tag.children() || []);\n return m(\"li\", {\n className: classList('TagTile', {\n colored: tag.color()\n }, textContrastClass(tag.color())),\n style: {\n '--tag-bg': tag.color()\n }\n }, m(Link, {\n className: \"TagTile-info\",\n href: app.route.tag(tag)\n }, m(\"div\", {\n className: \"TagTile-heading\"\n }, tag.icon() && tagIcon(tag, {}, {\n useColor: false\n }), m(\"h3\", {\n className: \"TagTile-name\"\n }, tag.name())), m(\"p\", {\n className: \"TagTile-description\"\n }, tag.description()), !!children && m(\"div\", {\n className: \"TagTile-children\"\n }, children.map(child => [m(Link, {\n href: app.route.tag(child)\n }, child.name()), ' ']))), lastPostedDiscussion ? m(Link, {\n className: \"TagTile-lastPostedDiscussion\",\n href: app.route.discussion(lastPostedDiscussion, lastPostedDiscussion.lastPostNumber())\n }, m(\"span\", {\n className: \"TagTile-lastPostedDiscussion-title\"\n }, lastPostedDiscussion.title()), humanTime(lastPostedDiscussion.lastPostedAt())) : m(\"span\", {\n className: \"TagTile-lastPostedDiscussion\"\n }));\n }\n cloudView(cloud) {\n return m(\"div\", {\n className: \"TagCloud\"\n }, cloud.map(tag => [tagLabel(tag, {\n link: true\n }), ' ']));\n }\n}\nflarum.reg.add('flarum-tags', 'forum/components/TagsPage', TagsPage);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/IndexPage');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/states/DiscussionListState');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/states/GlobalSearchState');","import Component from 'flarum/common/Component';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\nimport tagIcon from '../../common/helpers/tagIcon';\nimport classList from 'flarum/common/utils/classList';\nexport default class TagHero extends Component {\n view() {\n const tag = this.attrs.model;\n const color = tag.color();\n return m(\"header\", {\n className: classList('Hero', 'TagHero', {\n 'TagHero--colored': color,\n [textContrastClass(color)]: color\n }),\n style: color ? {\n '--hero-bg': color\n } : undefined\n }, m(\"div\", {\n className: \"container\"\n }, m(\"div\", {\n className: \"containerNarrow\"\n }, m(\"h1\", {\n className: \"Hero-title\"\n }, tag.icon() && tagIcon(tag, {}, {\n useColor: false\n }), \" \", tag.name()), m(\"div\", {\n className: \"Hero-subtitle\"\n }, tag.description()))));\n }\n}\nflarum.reg.add('flarum-tags', 'forum/components/TagHero', TagHero);","import app from 'flarum/forum/app';\nimport { extend, override } from 'flarum/common/extend';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport IndexSidebar from 'flarum/forum/components/IndexSidebar';\nimport DiscussionListState from 'flarum/forum/states/DiscussionListState';\nimport GlobalSearchState from 'flarum/forum/states/GlobalSearchState';\nimport classList from 'flarum/common/utils/classList';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\nimport TagHero from './components/TagHero';\nconst findTag = slug => app.store.all('tags').find(tag => tag.slug().localeCompare(slug, undefined, {\n sensitivity: 'base'\n}) === 0);\nexport default function addTagFilter() {\n app.currentTag = function (reload) {\n if (this.currentActiveTag && !reload) {\n return this.currentActiveTag;\n }\n const slug = this.search.state.params().tags;\n let tag = null;\n if (slug) {\n tag = findTag(slug);\n }\n if (slug && !tag || tag && !tag.isChild() && !tag.children()) {\n if (this.currentTagLoading) {\n return;\n }\n this.currentTagLoading = true;\n\n // Unlike the backend, no need to fetch parent.children because if we're on\n // a child tag page, then either:\n // - We loaded in that child tag (and its siblings) in the API document\n // - We first navigated to the current tag's parent, which would have loaded in the current tag's siblings.\n this.store.find('tags', slug, {\n include: 'children,children.parent,parent'\n }).then(() => {\n this.currentActiveTag = findTag(slug);\n m.redraw();\n }).finally(() => {\n this.currentTagLoading = false;\n });\n }\n if (tag) {\n this.currentActiveTag = tag;\n return this.currentActiveTag;\n }\n this.currentActiveTag = undefined;\n return;\n };\n extend(IndexPage.prototype, 'view', function (vdom) {\n app.currentTag(true);\n });\n\n // If currently viewing a tag, insert a tag hero at the top of the view.\n override(IndexPage.prototype, 'hero', function (original) {\n const tag = app.currentTag();\n if (tag) return m(TagHero, {\n model: tag\n });\n return original();\n });\n extend(IndexPage.prototype, 'view', function (vdom) {\n const tag = app.currentTag();\n if (tag) vdom.attrs.className += ' IndexPage--tag' + tag.id();\n });\n extend(IndexPage.prototype, 'setTitle', function () {\n const tag = app.currentTag();\n if (tag) {\n app.setTitle(tag.name());\n }\n });\n\n // If currently viewing a tag, restyle the 'new discussion' button to use\n // the tag's color, and disable if the user isn't allowed to edit.\n extend(IndexSidebar.prototype, 'items', function (items) {\n const tag = app.currentTag();\n if (tag) {\n const color = tag.color();\n const canStartDiscussion = tag.canStartDiscussion() || !app.session.user;\n const newDiscussion = items.get('newDiscussion');\n if (color) {\n newDiscussion.attrs.className = classList([newDiscussion.attrs.className, 'Button--tagColored', textContrastClass(color)]);\n newDiscussion.attrs.style = {\n '--color': color\n };\n }\n newDiscussion.attrs.disabled = !canStartDiscussion;\n newDiscussion.children = app.translator.trans(canStartDiscussion ? 'core.forum.index.start_discussion_button' : 'core.forum.index.cannot_start_discussion_button');\n }\n });\n\n // Add a parameter for the global search state to pass on to the\n // DiscussionListState that will let us filter discussions by tag.\n extend(GlobalSearchState.prototype, 'params', function (params) {\n params.tags = m.route.param('tags');\n });\n\n // Translate that parameter into a gambit appended to the search query.\n extend(DiscussionListState.prototype, 'requestParams', function (params) {\n if (typeof params.include === 'string') {\n params.include = [params.include];\n } else {\n var _params$include;\n (_params$include = params.include) == null ? void 0 : _params$include.push('tags', 'tags.parent');\n }\n if (this.params.tags) {\n params.filter || (params.filter = {});\n params.filter.tag = this.params.tags;\n }\n });\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/DiscussionListItem');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/DiscussionHero');","import extract from 'flarum/common/utils/extract';\nimport tagLabel from './tagLabel';\nimport sortTags from '../utils/sortTags';\nimport classList from 'flarum/common/utils/classList';\nexport default function tagsLabel(tags, attrs) {\n if (attrs === void 0) {\n attrs = {};\n }\n const children = [];\n const {\n link,\n ...otherAttrs\n } = attrs;\n otherAttrs.className = classList('TagsLabel', otherAttrs.className);\n if (tags) {\n sortTags(tags).forEach(tag => {\n if (tag || tags.length === 1) {\n children.push(tagLabel(tag, {\n link\n }));\n }\n });\n } else {\n children.push(tagLabel());\n }\n return m(\"span\", otherAttrs, children);\n}\nflarum.reg.add('flarum-tags', 'common/helpers/tagsLabel', tagsLabel);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/utils/DiscussionControls');","import { extend } from 'flarum/common/extend';\nimport DiscussionControls from 'flarum/forum/utils/DiscussionControls';\nimport Button from 'flarum/common/components/Button';\nexport default function addTagControl() {\n // Add a control allowing the discussion to be moved to another category.\n extend(DiscussionControls, 'moderationControls', function (items, discussion) {\n if (discussion.canTag()) {\n items.add('tags', m(Button, {\n icon: \"fas fa-tag\",\n onclick: () => app.modal.show(() => import(/* webpackChunkName: 'forum/components/TagDiscussionModal', webpackMode: 'lazy-once' */ './components/TagDiscussionModal'), {\n discussion\n })\n }, app.translator.trans('flarum-tags.forum.discussion_controls.edit_tags_button')));\n }\n });\n}flarum.reg.addChunkModule('642', '884', 'flarum-tags', 'forum/components/TagDiscussionModal');\nflarum.reg.addChunkModule('642', '884', 'flarum-tags', '/home/runner/work/framework/framework/extensions/tags/js/src/forum/components/TagDiscussionModal.tsx');\nflarum.reg.addChunkModule('642', '884', 'flarum-tags', '/home/runner/work/framework/framework/extensions/tags/js/src/common/components/TagSelectionModal.tsx');\nflarum.reg.addChunkModule('642', '884', 'flarum-tags', '/home/runner/work/framework/framework/extensions/tags/js/src/forum/components/ToggleButton.js');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extenders');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/models/Discussion');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/EventPost');","import EventPost from 'flarum/forum/components/EventPost';\nimport tagsLabel from '../../common/helpers/tagsLabel';\nexport default class DiscussionTaggedPost extends EventPost {\n static initAttrs(attrs) {\n super.initAttrs(attrs);\n const oldTags = attrs.post.content()[0];\n const newTags = attrs.post.content()[1];\n function diffTags(tags1, tags2) {\n return tags1.filter(tag => tags2.indexOf(tag) === -1).map(id => app.store.getById('tags', id));\n }\n attrs.tagsAdded = diffTags(newTags, oldTags);\n attrs.tagsRemoved = diffTags(oldTags, newTags);\n }\n icon() {\n return 'fas fa-tag';\n }\n descriptionKey() {\n if (this.attrs.tagsAdded.length) {\n if (this.attrs.tagsRemoved.length) {\n return 'flarum-tags.forum.post_stream.added_and_removed_tags_text';\n }\n return 'flarum-tags.forum.post_stream.added_tags_text';\n }\n return 'flarum-tags.forum.post_stream.removed_tags_text';\n }\n descriptionData() {\n const data = {};\n if (this.attrs.tagsAdded.length) {\n data.tagsAdded = app.translator.trans('flarum-tags.forum.post_stream.tags_text', {\n tags: tagsLabel(this.attrs.tagsAdded, {\n link: true\n }),\n count: this.attrs.tagsAdded.length\n });\n }\n if (this.attrs.tagsRemoved.length) {\n data.tagsRemoved = app.translator.trans('flarum-tags.forum.post_stream.tags_text', {\n tags: tagsLabel(this.attrs.tagsRemoved, {\n link: true\n }),\n count: this.attrs.tagsRemoved.length\n });\n }\n return data;\n }\n}\nflarum.reg.add('flarum-tags', 'forum/components/DiscussionTaggedPost', DiscussionTaggedPost);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/computed');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/Model');","import computed from 'flarum/common/utils/computed';\nimport Model from 'flarum/common/Model';\nexport default class Tag extends Model {\n name() {\n return Model.attribute('name').call(this);\n }\n slug() {\n return Model.attribute('slug').call(this);\n }\n description() {\n return Model.attribute('description').call(this);\n }\n color() {\n return Model.attribute('color').call(this);\n }\n backgroundUrl() {\n return Model.attribute('backgroundUrl').call(this);\n }\n backgroundMode() {\n return Model.attribute('backgroundMode').call(this);\n }\n icon() {\n return Model.attribute('icon').call(this);\n }\n position() {\n return Model.attribute('position').call(this);\n }\n parent() {\n return Model.hasOne('parent').call(this);\n }\n children() {\n return Model.hasMany('children').call(this);\n }\n defaultSort() {\n return Model.attribute('defaultSort').call(this);\n }\n isChild() {\n return Model.attribute('isChild').call(this);\n }\n isHidden() {\n return Model.attribute('isHidden').call(this);\n }\n isPrimary() {\n return Model.attribute('isPrimary').call(this);\n }\n discussionCount() {\n return Model.attribute('discussionCount').call(this);\n }\n lastPostedAt() {\n return Model.attribute('lastPostedAt', Model.transformDate).call(this);\n }\n lastPostedDiscussion() {\n return Model.hasOne('lastPostedDiscussion').call(this);\n }\n isRestricted() {\n return Model.attribute('isRestricted').call(this);\n }\n canStartDiscussion() {\n return Model.attribute('canStartDiscussion').call(this);\n }\n canAddToDiscussion() {\n return Model.attribute('canAddToDiscussion').call(this);\n }\n isPrimaryParent() {\n return computed('position', 'parent', (position, parent) => position !== null && parent === false).call(this);\n }\n}\nflarum.reg.add('flarum-tags', 'common/models/Tag', Tag);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/query/IGambit');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/common/app';\nimport { KeyValueGambit } from 'flarum/common/query/IGambit';\nexport default class TagGambit extends KeyValueGambit {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"predicates\", true);\n }\n key() {\n return app.translator.trans('flarum-tags.lib.gambits.discussions.tag.key', {}, true);\n }\n hint() {\n return app.translator.trans('flarum-tags.lib.gambits.discussions.tag.hint', {}, true);\n }\n filterKey() {\n return 'tag';\n }\n gambitValueToFilterValue(value) {\n return [value];\n }\n fromFilter(value, negate) {\n let gambits = [];\n if (Array.isArray(value)) {\n gambits = value.map(value => this.fromFilter(value.toString(), negate));\n } else {\n return \"\".concat(negate ? '-' : '').concat(this.key(), \":\").concat(this.filterValueToGambitValue(value));\n }\n return gambits.join(' ');\n }\n filterValueToGambitValue(value) {\n return value;\n }\n}\nflarum.reg.add('flarum-tags', 'common/query/discussions/TagGambit', TagGambit);","import Extend from 'flarum/common/extenders';\nimport Tag from './models/Tag';\nimport TagGambit from './query/discussions/TagGambit';\nexport default [new Extend.Store() //\n.add('tags', Tag), new Extend.Search() //\n.gambit('discussions', TagGambit)];","import app from 'flarum/forum/app';\nimport Extend from 'flarum/common/extenders';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport Discussion from 'flarum/common/models/Discussion';\nimport DiscussionTaggedPost from './components/DiscussionTaggedPost';\nimport TagsPage from './components/TagsPage';\nimport commonExtend from '../common/extend';\nexport default [...commonExtend, new Extend.Routes() //\n.add('tags', '/tags', TagsPage) //\n.add('tag', '/t/:tags', IndexPage) //\n.helper('tag', tag => app.route('tag', {\n tags: tag.slug()\n})), new Extend.PostTypes() //\n.add('discussionTagged', DiscussionTaggedPost), new Extend.Model(Discussion) //\n.hasMany('tags') //\n.attribute('canTag')];","import app from 'flarum/forum/app';\nimport TagListState from '../common/states/TagListState';\nimport addTagList from './addTagList';\nimport addTagFilter from './addTagFilter';\nimport addTagLabels from './addTagLabels';\nimport addTagControl from './addTagControl';\nimport addTagComposer from './addTagComposer';\nexport { default as extend } from './extend';\napp.initializers.add('flarum-tags', function () {\n app.tagList = new TagListState();\n addTagList();\n addTagFilter();\n addTagLabels();\n addTagControl();\n addTagComposer();\n});\nimport './forum';","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport IndexSidebar from 'flarum/forum/components/IndexSidebar';\nimport Separator from 'flarum/common/components/Separator';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport TagLinkButton from './components/TagLinkButton';\nimport TagsPage from './components/TagsPage';\nimport sortTags from '../common/utils/sortTags';\nexport default function addTagList() {\n // Add a link to the tags page, as well as a list of all the tags,\n // to the index page's sidebar.\n extend(IndexSidebar.prototype, 'navItems', function (items) {\n items.add('tags', m(LinkButton, {\n icon: \"fas fa-th-large\",\n href: app.route('tags')\n }, app.translator.trans('flarum-tags.forum.index.tags_link')), -10);\n if (app.current.matches(TagsPage)) return;\n items.add('separator', m(Separator, null), -12);\n const params = app.search.state.stickyParams();\n const tags = app.store.all('tags');\n const currentTag = app.currentTag();\n const addTag = tag => {\n let active = currentTag === tag;\n if (!active && currentTag) {\n active = currentTag.parent() === tag;\n }\n\n // tag.name() is passed here as children even though it isn't used directly\n // because when we need to get the active child in SelectDropdown, we need to\n // use its children to populate the dropdown. The problem here is that `view`\n // on TagLinkButton is only called AFTER SelectDropdown, so no children are available\n // for SelectDropdown to use at the time.\n items.add('tag' + tag.id(), m(TagLinkButton, {\n model: tag,\n params: params,\n active: active\n }, tag == null ? void 0 : tag.name()), -14);\n };\n sortTags(tags).filter(tag => tag.position() !== null && (!tag.isChild() || currentTag && (tag.parent() === currentTag || tag.parent() === currentTag.parent()))).forEach(addTag);\n const more = tags.filter(tag => tag.position() === null).sort((a, b) => b.discussionCount() - a.discussionCount());\n more.splice(0, 3).forEach(addTag);\n if (more.length) {\n items.add('moreTags', m(LinkButton, {\n href: app.route('tags')\n }, app.translator.trans('flarum-tags.forum.index.more_link')), -16);\n }\n });\n}","import { extend } from 'flarum/common/extend';\nimport DiscussionListItem from 'flarum/forum/components/DiscussionListItem';\nimport DiscussionHero from 'flarum/forum/components/DiscussionHero';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\nimport classList from 'flarum/common/utils/classList';\nimport tagsLabel from '../common/helpers/tagsLabel';\nimport sortTags from '../common/utils/sortTags';\nexport default function addTagLabels() {\n // Add tag labels to each discussion in the discussion list.\n extend(DiscussionListItem.prototype, 'infoItems', function (items) {\n const tags = this.attrs.discussion.tags();\n if (tags && tags.length) {\n items.add('tags', tagsLabel(tags), 10);\n }\n });\n\n // Restyle a discussion's hero to use its first tag's color.\n extend(DiscussionHero.prototype, 'view', function (view) {\n const tags = sortTags(this.attrs.discussion.tags());\n if (tags && tags.length) {\n const color = tags[0].color();\n if (color) {\n view.attrs.style = {\n '--hero-bg': color\n };\n view.attrs.className = classList(view.attrs.className, 'DiscussionHero--colored', textContrastClass(color));\n }\n }\n });\n\n // Add a list of a discussion's tags to the discussion hero, displayed\n // before the title. Put the title on its own line.\n extend(DiscussionHero.prototype, 'items', function (items) {\n const tags = this.attrs.discussion.tags();\n if (tags && tags.length) {\n items.add('tags', tagsLabel(tags, {\n link: true\n }), 5);\n }\n });\n}","import app from 'flarum/forum/app';\nimport { extend, override } from 'flarum/common/extend';\nimport IndexSidebar from 'flarum/forum/components/IndexSidebar';\nimport classList from 'flarum/common/utils/classList';\nimport tagsLabel from '../common/helpers/tagsLabel';\nimport getSelectableTags from './utils/getSelectableTags';\nexport default function addTagComposer() {\n extend(IndexSidebar.prototype, 'newDiscussionAction', function (promise) {\n // From `addTagFilter\n const tag = app.currentTag();\n if (tag) {\n const parent = tag.parent();\n const tags = parent ? [parent, tag] : [tag];\n promise.then(composer => composer.fields.tags = tags);\n } else {\n app.composer.fields.tags = [];\n }\n });\n extend('flarum/forum/components/DiscussionComposer', 'oninit', function () {\n app.tagList.load(['parent']).then(() => m.redraw());\n\n // Add tag-selection abilities to the discussion composer.\n this.constructor.prototype.chooseTags = function () {\n const selectableTags = getSelectableTags();\n if (!selectableTags.length) return;\n app.modal.show(() => import(/* webpackChunkName: 'forum/components/TagDiscussionModal', webpackMode: 'lazy-once' */ './components/TagDiscussionModal'), {\n selectedTags: (this.composer.fields.tags || []).slice(0),\n onsubmit: tags => {\n this.composer.fields.tags = tags;\n this.$('textarea').focus();\n }\n });\n };\n });\n\n // Add a tag-selection menu to the discussion composer's header, after the\n // title.\n extend('flarum/forum/components/DiscussionComposer', 'headerItems', function (items) {\n const tags = this.composer.fields.tags || [];\n const selectableTags = getSelectableTags();\n items.add('tags', m(\"a\", {\n className: classList(['DiscussionComposer-changeTags', !selectableTags.length && 'disabled']),\n onclick: this.chooseTags.bind(this)\n }, tags.length ? tagsLabel(tags) : m(\"span\", {\n className: \"TagLabel untagged\"\n }, app.translator.trans('flarum-tags.forum.composer_discussion.choose_tags_link'))), 10);\n });\n override('flarum/forum/components/DiscussionComposer', 'onsubmit', function (original) {\n const chosenTags = this.composer.fields.tags || [];\n const chosenPrimaryTags = chosenTags.filter(tag => tag.position() !== null && !tag.isChild());\n const chosenSecondaryTags = chosenTags.filter(tag => tag.position() === null);\n const selectableTags = getSelectableTags();\n const minPrimaryTags = parseInt(app.forum.attribute('minPrimaryTags'));\n const minSecondaryTags = parseInt(app.forum.attribute('minSecondaryTags'));\n const maxPrimaryTags = parseInt(app.forum.attribute('maxPrimaryTags'));\n const maxSecondaryTags = parseInt(app.forum.attribute('maxSecondaryTags'));\n if ((!chosenTags.length && maxPrimaryTags !== 0 && maxSecondaryTags !== 0 || chosenPrimaryTags.length < minPrimaryTags || chosenSecondaryTags.length < minSecondaryTags) && selectableTags.length) {\n app.modal.show(() => import(/* webpackChunkName: 'forum/components/TagDiscussionModal', webpackMode: 'lazy-once' */ './components/TagDiscussionModal'), {\n selectedTags: chosenTags,\n onsubmit: tags => {\n this.composer.fields.tags = tags;\n original();\n }\n });\n } else {\n original();\n }\n });\n\n // Add the selected tags as data to submit to the server.\n extend('flarum/forum/components/DiscussionComposer', 'data', function (data) {\n data.relationships = data.relationships || {};\n data.relationships.tags = this.composer.fields.tags;\n });\n}","export default function getSelectableTags(discussion) {\n let tags = app.store.all('tags');\n if (discussion) {\n const discussionTags = discussion.tags() || [];\n tags = tags.filter(tag => tag.canAddToDiscussion() || discussionTags.includes(tag));\n } else {\n tags = tags.filter(tag => tag.canStartDiscussion());\n }\n return tags;\n}\nflarum.reg.add('flarum-tags', 'forum/utils/getSelectableTags', getSelectableTags);","module.exports = flarum.reg.get('core', 'common/Component');","module.exports = flarum.reg.get('core', 'common/app');","module.exports = flarum.reg.get('core', 'common/components/Button');","module.exports = flarum.reg.get('core', 'common/components/FormModal');","module.exports = flarum.reg.get('core', 'common/components/Link');","module.exports = flarum.reg.get('core', 'common/components/LoadingIndicator');","module.exports = flarum.reg.get('core', 'common/helpers/highlight');","module.exports = flarum.reg.get('core', 'common/helpers/textContrastClass');","module.exports = flarum.reg.get('core', 'common/utils/KeyboardNavigatable');","module.exports = flarum.reg.get('core', 'common/utils/Stream');","module.exports = flarum.reg.get('core', 'common/utils/classList');","module.exports = flarum.reg.get('core', 'common/utils/extract');","module.exports = flarum.reg.get('core', 'common/utils/extractText');","module.exports = flarum.reg.get('core', 'forum/app');","module.exports = flarum.reg.get('core', 'forum/components/DiscussionPage');","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}","import _typeof from \"./typeof.js\";\nexport default function _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + \"forum/components/TagDiscussionModal\" + \".js\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) scriptUrl = scripts[scripts.length - 1].src\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","__webpack_require__.f.compat = (chunkId, promises) => {\n\n\tconst originalLoadChunk = __webpack_require__.l;\n\t__webpack_require__.l = flarum.reg.loadChunk.bind(flarum.reg, originalLoadChunk);\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t315: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t} else installedChunks[chunkId] = 0;\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkmodule_exports\"] = self[\"webpackChunkmodule_exports\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));"],"names":["inProgress","dataWebpackPrefix","tagIcon","tag","attrs","settings","hasIcon","icon","useColor","className","style","color","m","flarum","reg","add","tagLabel","link","tagText","name","app","translator","trans","title","description","href","route","tags","slug","isChild","sortTags","slice","sort","a","b","aPos","position","bPos","discussionCount","aParent","parent","bParent","TagListState","constructor","this","async","includes","loadedIncludes","query","unloadedIncludes","filter","include","has","length","Promise","resolve","Set","join","then","val","Array","isArray","forEach","get","TagLinkButton","view","vnode","model","child","undefined","static","super","initAttrs","params","TagsPage","arguments","oninit","preloaded","loading","redraw","oncreate","hero","bind","sidebar","contentItems","toArray","items","pinned","cloud","tagTileListView","cloudView","map","tagTileView","lastPostedDiscussion","children","colored","lastPostNumber","lastPostedAt","TagHero","findTag","find","localeCompare","sensitivity","tagsLabel","otherAttrs","push","addChunkModule","DiscussionTaggedPost","oldTags","post","content","newTags","diffTags","tags1","tags2","indexOf","id","store","getById","tagsAdded","tagsRemoved","descriptionKey","descriptionData","data","count","Tag","call","backgroundUrl","backgroundMode","defaultSort","isHidden","isPrimary","isRestricted","canStartDiscussion","canAddToDiscussion","isPrimaryParent","TagGambit","KeyValueGambit","key","hint","filterKey","gambitValueToFilterValue","value","fromFilter","negate","gambits","toString","concat","filterValueToGambitValue","gambit","helper","hasMany","attribute","extend","currentTag","addTag","active","more","splice","reload","currentActiveTag","search","state","currentTagLoading","finally","vdom","override","original","newDiscussion","disabled","param","_params$include","discussion","canTag","onclick","modal","show","promise","composer","fields","prototype","chooseTags","getSelectableTags","selectedTags","onsubmit","$","focus","selectableTags","chosenTags","chosenPrimaryTags","chosenSecondaryTags","minPrimaryTags","parseInt","minSecondaryTags","maxPrimaryTags","maxSecondaryTags","relationships","all","discussionTags","module","exports","_typeof","obj","Symbol","iterator","_defineProperty","arg","input","prim","toPrimitive","res","TypeError","String","toPropertyKey","Object","defineProperty","enumerable","configurable","writable","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","n","getter","__esModule","d","definition","o","f","e","chunkId","keys","reduce","promises","u","g","globalThis","Function","window","prop","hasOwnProperty","l","url","done","script","needAttach","scripts","document","getElementsByTagName","i","s","getAttribute","createElement","charset","timeout","nc","setAttribute","src","onScriptComplete","prev","event","onerror","onload","clearTimeout","doneFns","parentNode","removeChild","fn","setTimeout","type","target","head","appendChild","r","toStringTag","scriptUrl","importScripts","location","currentScript","Error","replace","p","compat","originalLoadChunk","loadChunk","installedChunks","j","installedChunkData","reject","error","errorType","realSrc","message","request","webpackJsonpCallback","parentChunkLoadingFunction","chunkIds","moreModules","runtime","some","chunkLoadingGlobal","self"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"file":"forum.js","mappings":"UAAIA,EACAC,E,qECAW,SAASC,EAAQC,EAAKC,EAAOC,QAC5B,IAAVD,IACFA,EAAQ,CAAC,QAEM,IAAbC,IACFA,EAAW,CAAC,GAEd,MAAMC,EAAUH,GAAOA,EAAII,QACrB,SACJC,GAAW,GACTH,EAQJ,OAPAD,EAAMK,UAAY,IAAU,CAACL,EAAMK,UAAW,oBAAqBH,EAAUH,EAAII,OAAS,YACtFJ,GAAOK,GACTJ,EAAMM,MAAQN,EAAMM,OAAS,CAAC,EAC9BN,EAAMM,MAAM,WA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W3D,EAASA,EAE/D,CACD,EAcF,IAAIgE,EAAuB,CAACC,EAA4B9K,KACvD,IAGIkG,EAAUW,GAHTkE,EAAUC,EAAaC,GAAWjL,EAGhBgI,EAAI,EAC3B,GAAG+C,EAASG,MAAMzL,GAAgC,IAAxB2K,EAAgB3K,KAAa,CACtD,IAAIyG,KAAY8E,EACZ/E,EAAoBS,EAAEsE,EAAa9E,KACrCD,EAAoBhN,EAAEiN,GAAY8E,EAAY9E,IAG7C+E,GAAsBA,EAAQhF,EAClC,CAEA,IADG6E,GAA4BA,EAA2B9K,GACrDgI,EAAI+C,EAASrP,OAAQsM,IACzBnB,EAAUkE,EAAS/C,GAChB/B,EAAoBS,EAAE0D,EAAiBvD,IAAYuD,EAAgBvD,IACrEuD,EAAgBvD,GAAS,KAE1BuD,EAAgBvD,GAAW,CAC5B,EAIGsE,EAAqBC,KAAiC,2BAAIA,KAAiC,4BAAK,GACpGD,EAAmBhP,QAAQ0O,EAAqBtN,KAAK,KAAM,IAC3D4N,EAAmBrM,KAAO+L,EAAqBtN,KAAK,KAAM4N,EAAmBrM,KAAKvB,KAAK4N,G","sources":["webpack://@flarum/tags/webpack/runtime/load script","webpack://@flarum/tags/./src/common/helpers/tagIcon.js","webpack://@flarum/tags/./src/common/helpers/tagLabel.js","webpack://@flarum/tags/./src/common/utils/sortTags.tsx","webpack://@flarum/tags/./src/common/states/TagListState.ts","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/components/IndexSidebar')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Separator')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/LinkButton')\"","webpack://@flarum/tags/./src/forum/components/TagLinkButton.js","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Page')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/components/PageStructure')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/components/WelcomeHero')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/ItemList')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/helpers/humanTime')\"","webpack://@flarum/tags/./src/forum/components/TagsPage.tsx","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/components/IndexPage')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/states/DiscussionListState')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/states/GlobalSearchState')\"","webpack://@flarum/tags/./src/forum/components/TagHero.js","webpack://@flarum/tags/./src/forum/addTagFilter.tsx","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/components/DiscussionListItem')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/components/DiscussionHero')\"","webpack://@flarum/tags/./src/common/helpers/tagsLabel.js","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/utils/DiscussionControls')\"","webpack://@flarum/tags/./src/forum/addTagControl.js","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/extenders')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/models/Discussion')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/components/EventPost')\"","webpack://@flarum/tags/./src/forum/components/DiscussionTaggedPost.js","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/computed')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/Model')\"","webpack://@flarum/tags/./src/common/models/Tag.ts","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/query/IGambit')\"","webpack://@flarum/tags/./src/common/query/discussions/TagGambit.ts","webpack://@flarum/tags/./src/common/extend.ts","webpack://@flarum/tags/./src/forum/extend.ts","webpack://@flarum/tags/./src/forum/index.ts","webpack://@flarum/tags/./src/forum/addTagList.js","webpack://@flarum/tags/./src/forum/addTagLabels.js","webpack://@flarum/tags/./src/forum/addTagComposer.js","webpack://@flarum/tags/./src/forum/utils/getSelectableTags.ts","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/Component')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/app')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Button')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/FormModal')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/Link')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/components/LoadingIndicator')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/helpers/highlight')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/helpers/textContrastClass')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/KeyboardNavigatable')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/Stream')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/classList')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/extract')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'common/utils/extractText')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/app')\"","webpack://@flarum/tags/external root \"flarum.reg.get('core', 'forum/components/DiscussionPage')\"","webpack://@flarum/tags/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://@flarum/tags/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://@flarum/tags/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://@flarum/tags/../../../js-packages/webpack-config/node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://@flarum/tags/webpack/bootstrap","webpack://@flarum/tags/webpack/runtime/compat get default export","webpack://@flarum/tags/webpack/runtime/define property getters","webpack://@flarum/tags/webpack/runtime/ensure chunk","webpack://@flarum/tags/webpack/runtime/get javascript chunk filename","webpack://@flarum/tags/webpack/runtime/global","webpack://@flarum/tags/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/tags/webpack/runtime/make namespace object","webpack://@flarum/tags/webpack/runtime/publicPath","webpack://@flarum/tags/webpack/runtime/compat","webpack://@flarum/tags/webpack/runtime/jsonp chunk loading"],"sourcesContent":["var inProgress = {};\nvar dataWebpackPrefix = \"module.exports:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t};\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","import classList from 'flarum/common/utils/classList';\nexport default function tagIcon(tag, attrs, settings) {\n if (attrs === void 0) {\n attrs = {};\n }\n if (settings === void 0) {\n settings = {};\n }\n const hasIcon = tag && tag.icon();\n const {\n useColor = true\n } = settings;\n attrs.className = classList([attrs.className, 'icon text-colored', hasIcon ? tag.icon() : 'TagIcon']);\n if (tag && useColor) {\n attrs.style = attrs.style || {};\n attrs.style['--color'] = tag.color();\n } else if (!tag) {\n attrs.className += ' untagged';\n }\n return hasIcon ? m(\"i\", attrs) : m(\"span\", attrs);\n}\nflarum.reg.add('flarum-tags', 'common/helpers/tagIcon', tagIcon);","import extract from 'flarum/common/utils/extract';\nimport Link from 'flarum/common/components/Link';\nimport classList from 'flarum/common/utils/classList';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\nimport tagIcon from './tagIcon';\nexport default function tagLabel(tag, attrs) {\n if (attrs === void 0) {\n attrs = {};\n }\n attrs.style = attrs.style || {};\n attrs.className = 'TagLabel ' + (attrs.className || '');\n const link = extract(attrs, 'link');\n const tagText = tag ? tag.name() : app.translator.trans('flarum-tags.lib.deleted_tag_text');\n if (tag) {\n const color = tag.color();\n if (color) {\n attrs.style['--tag-bg'] = color;\n attrs.className = classList(attrs.className, 'colored', textContrastClass(color));\n }\n if (link) {\n attrs.title = tag.description() || '';\n attrs.href = app.route('tag', {\n tags: tag.slug()\n });\n }\n if (tag.isChild()) {\n attrs.className += ' TagLabel--child';\n }\n } else {\n attrs.className += ' untagged';\n }\n return m(link ? Link : 'span', attrs, m(\"span\", {\n className: \"TagLabel-text\"\n }, tag && tag.icon() && tagIcon(tag, {\n className: 'TagLabel-icon'\n }, {\n useColor: false\n }), m(\"span\", {\n className: \"TagLabel-name\"\n }, tagText)));\n}\nflarum.reg.add('flarum-tags', 'common/helpers/tagLabel', tagLabel);","export default function sortTags(tags) {\n return tags.slice(0).sort((a, b) => {\n const aPos = a.position();\n const bPos = b.position();\n\n // If they're both secondary tags, sort them by their discussions count,\n // descending.\n if (aPos === null && bPos === null) return b.discussionCount() - a.discussionCount();\n\n // If just one is a secondary tag, then the primary tag should\n // come first.\n if (bPos === null) return -1;\n if (aPos === null) return 1;\n\n // If we've made it this far, we know they're both primary tags. So we'll\n // need to see if they have parents.\n const aParent = a.parent();\n const bParent = b.parent();\n\n // If they both have the same parent, then their positions are local,\n // so we can compare them directly.\n if (aParent === bParent) return aPos - bPos;\n // If they are both child tags, then we will compare the positions of their\n // parents.\n else if (aParent && bParent) return aParent.position() - bParent.position();\n // If we are comparing a child tag with its parent, then we let the parent\n // come first. If we are comparing an unrelated parent/child, then we\n // compare both of the parents.\n else if (aParent) return aParent === b ? 1 : aParent.position() - bPos;else if (bParent) return bParent === a ? -1 : aPos - bParent.position();\n return 0;\n });\n}\nflarum.reg.add('flarum-tags', 'common/utils/sortTags', sortTags);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/common/app';\nexport default class TagListState {\n constructor() {\n _defineProperty(this, \"loadedIncludes\", void 0);\n }\n async load(includes) {\n if (includes === void 0) {\n includes = [];\n }\n if (!this.loadedIncludes) {\n return this.query(includes);\n }\n const unloadedIncludes = includes.filter(include => !this.loadedIncludes.has(include));\n if (unloadedIncludes.length === 0) {\n return Promise.resolve(app.store.all('tags'));\n }\n return this.query(unloadedIncludes);\n }\n async query(includes) {\n var _this$loadedIncludes;\n if (includes === void 0) {\n includes = [];\n }\n (_this$loadedIncludes = this.loadedIncludes) != null ? _this$loadedIncludes : this.loadedIncludes = new Set();\n return app.store.find('tags', {\n include: includes.join(',')\n }).then(val => {\n const tags = Array.isArray(val) ? val : [val];\n includes.forEach(include => this.loadedIncludes.add(include));\n return tags;\n });\n }\n}\nflarum.reg.add('flarum-tags', 'common/states/TagListState', TagListState);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extend');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/IndexSidebar');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Separator');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/LinkButton');","import Link from 'flarum/common/components/Link';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport classList from 'flarum/common/utils/classList';\nimport tagIcon from '../../common/helpers/tagIcon';\nexport default class TagLinkButton extends LinkButton {\n view(vnode) {\n const tag = this.attrs.model;\n const description = tag && tag.description();\n const className = classList('TagLinkButton hasIcon', {\n child: tag.isChild()\n }, this.attrs.className);\n return m(Link, {\n className: className,\n href: this.attrs.route,\n style: tag ? {\n '--color': tag.color()\n } : undefined,\n title: description || undefined\n }, tagIcon(tag, {\n className: 'Button-icon'\n }), m(\"span\", {\n className: \"Button-label\"\n }, tag ? tag.name() : app.translator.trans('flarum-tags.forum.index.untagged_link')));\n }\n static initAttrs(attrs) {\n super.initAttrs(attrs);\n const tag = attrs.model;\n attrs.params.tags = tag ? tag.slug() : 'untagged';\n attrs.route = app.route('tag', attrs.params);\n }\n}\nflarum.reg.add('flarum-tags', 'forum/components/TagLinkButton', TagLinkButton);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Page');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/PageStructure');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/WelcomeHero');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/ItemList');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/helpers/humanTime');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/forum/app';\nimport Page from 'flarum/common/components/Page';\nimport PageStructure from 'flarum/forum/components/PageStructure';\nimport WelcomeHero from 'flarum/forum/components/WelcomeHero';\nimport IndexSidebar from 'flarum/forum/components/IndexSidebar';\nimport Link from 'flarum/common/components/Link';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport humanTime from 'flarum/common/helpers/humanTime';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\nimport classList from 'flarum/common/utils/classList';\nimport extractText from 'flarum/common/utils/extractText';\nimport tagIcon from '../../common/helpers/tagIcon';\nimport tagLabel from '../../common/helpers/tagLabel';\nimport sortTags from '../../common/utils/sortTags';\nexport default class TagsPage extends Page {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"tags\", void 0);\n _defineProperty(this, \"loading\", void 0);\n }\n oninit(vnode) {\n super.oninit(vnode);\n app.history.push('tags', extractText(app.translator.trans('flarum-tags.forum.header.back_to_tags_tooltip')));\n this.tags = [];\n const preloaded = app.preloadedApiDocument();\n if (preloaded) {\n this.tags = sortTags(preloaded.filter(tag => !tag.isChild()));\n return;\n }\n this.loading = true;\n app.tagList.load(['children', 'lastPostedDiscussion', 'parent']).then(() => {\n this.tags = sortTags(app.store.all('tags').filter(tag => !tag.isChild()));\n this.loading = false;\n m.redraw();\n });\n }\n oncreate(vnode) {\n super.oncreate(vnode);\n app.setTitle(extractText(app.translator.trans('flarum-tags.forum.all_tags.meta_title_text')));\n app.setTitleCount(0);\n }\n view() {\n return m(PageStructure, {\n className: \"TagsPage\",\n hero: this.hero.bind(this),\n sidebar: this.sidebar.bind(this)\n }, this.contentItems().toArray());\n }\n contentItems() {\n const items = new ItemList();\n if (this.loading) {\n items.add('loading', m(LoadingIndicator, null));\n } else {\n const pinned = this.tags.filter(tag => tag.position() !== null);\n const cloud = this.tags.filter(tag => tag.position() === null);\n items.add('tagTiles', this.tagTileListView(pinned), 100);\n if (cloud.length) {\n items.add('cloud', this.cloudView(cloud), 10);\n }\n }\n return items;\n }\n hero() {\n return m(WelcomeHero, null);\n }\n sidebar() {\n return m(IndexSidebar, null);\n }\n tagTileListView(pinned) {\n return m(\"ul\", {\n className: \"TagTiles\"\n }, pinned.map(this.tagTileView.bind(this)));\n }\n tagTileView(tag) {\n const lastPostedDiscussion = tag.lastPostedDiscussion();\n const children = sortTags(tag.children() || []);\n return m(\"li\", {\n className: classList('TagTile', {\n colored: tag.color()\n }, textContrastClass(tag.color())),\n style: {\n '--tag-bg': tag.color()\n }\n }, m(Link, {\n className: \"TagTile-info\",\n href: app.route.tag(tag)\n }, m(\"div\", {\n className: \"TagTile-heading\"\n }, tag.icon() && tagIcon(tag, {}, {\n useColor: false\n }), m(\"h3\", {\n className: \"TagTile-name\"\n }, tag.name())), m(\"p\", {\n className: \"TagTile-description\"\n }, tag.description()), !!children && m(\"div\", {\n className: \"TagTile-children\"\n }, children.map(child => [m(Link, {\n href: app.route.tag(child)\n }, child.name()), ' ']))), lastPostedDiscussion ? m(Link, {\n className: \"TagTile-lastPostedDiscussion\",\n href: app.route.discussion(lastPostedDiscussion, lastPostedDiscussion.lastPostNumber())\n }, m(\"span\", {\n className: \"TagTile-lastPostedDiscussion-title\"\n }, lastPostedDiscussion.title()), humanTime(lastPostedDiscussion.lastPostedAt())) : m(\"span\", {\n className: \"TagTile-lastPostedDiscussion\"\n }));\n }\n cloudView(cloud) {\n return m(\"div\", {\n className: \"TagCloud\"\n }, cloud.map(tag => [tagLabel(tag, {\n link: true\n }), ' ']));\n }\n}\nflarum.reg.add('flarum-tags', 'forum/components/TagsPage', TagsPage);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/IndexPage');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/states/DiscussionListState');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/states/GlobalSearchState');","import Component from 'flarum/common/Component';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\nimport tagIcon from '../../common/helpers/tagIcon';\nimport classList from 'flarum/common/utils/classList';\nexport default class TagHero extends Component {\n view() {\n const tag = this.attrs.model;\n const color = tag.color();\n return m(\"header\", {\n className: classList('Hero', 'TagHero', {\n 'TagHero--colored': color,\n [textContrastClass(color)]: color\n }),\n style: color ? {\n '--hero-bg': color\n } : undefined\n }, m(\"div\", {\n className: \"container\"\n }, m(\"div\", {\n className: \"containerNarrow\"\n }, m(\"h1\", {\n className: \"Hero-title\"\n }, tag.icon() && tagIcon(tag, {}, {\n useColor: false\n }), \" \", tag.name()), m(\"div\", {\n className: \"Hero-subtitle\"\n }, tag.description()))));\n }\n}\nflarum.reg.add('flarum-tags', 'forum/components/TagHero', TagHero);","import app from 'flarum/forum/app';\nimport { extend, override } from 'flarum/common/extend';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport IndexSidebar from 'flarum/forum/components/IndexSidebar';\nimport DiscussionListState from 'flarum/forum/states/DiscussionListState';\nimport GlobalSearchState from 'flarum/forum/states/GlobalSearchState';\nimport classList from 'flarum/common/utils/classList';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\nimport TagHero from './components/TagHero';\nconst findTag = slug => app.store.all('tags').find(tag => tag.slug().localeCompare(slug, undefined, {\n sensitivity: 'base'\n}) === 0);\nexport default function addTagFilter() {\n app.currentTag = function (reload) {\n if (this.currentActiveTag && !reload) {\n return this.currentActiveTag;\n }\n const slug = this.search.state.params().tags;\n let tag = null;\n if (slug) {\n tag = findTag(slug);\n }\n if (slug && !tag || tag && !tag.isChild() && !tag.children()) {\n if (this.currentTagLoading) {\n return;\n }\n this.currentTagLoading = true;\n\n // Unlike the backend, no need to fetch parent.children because if we're on\n // a child tag page, then either:\n // - We loaded in that child tag (and its siblings) in the API document\n // - We first navigated to the current tag's parent, which would have loaded in the current tag's siblings.\n this.store.find('tags', slug, {\n include: 'children,children.parent,parent'\n }).then(() => {\n this.currentActiveTag = findTag(slug);\n m.redraw();\n }).finally(() => {\n this.currentTagLoading = false;\n });\n }\n if (tag) {\n this.currentActiveTag = tag;\n return this.currentActiveTag;\n }\n this.currentActiveTag = undefined;\n return;\n };\n extend(IndexPage.prototype, 'view', function (vdom) {\n app.currentTag(true);\n });\n\n // If currently viewing a tag, insert a tag hero at the top of the view.\n override(IndexPage.prototype, 'hero', function (original) {\n const tag = app.currentTag();\n if (tag) return m(TagHero, {\n model: tag\n });\n return original();\n });\n extend(IndexPage.prototype, 'view', function (vdom) {\n const tag = app.currentTag();\n if (tag) vdom.attrs.className += ' IndexPage--tag' + tag.id();\n });\n extend(IndexPage.prototype, 'setTitle', function () {\n const tag = app.currentTag();\n if (tag) {\n app.setTitle(tag.name());\n }\n });\n\n // If currently viewing a tag, restyle the 'new discussion' button to use\n // the tag's color, and disable if the user isn't allowed to edit.\n extend(IndexSidebar.prototype, 'items', function (items) {\n const tag = app.currentTag();\n if (tag) {\n const color = tag.color();\n const canStartDiscussion = tag.canStartDiscussion() || !app.session.user;\n const newDiscussion = items.get('newDiscussion');\n if (color) {\n newDiscussion.attrs.className = classList([newDiscussion.attrs.className, 'Button--tagColored', textContrastClass(color)]);\n newDiscussion.attrs.style = {\n '--color': color\n };\n }\n newDiscussion.attrs.disabled = !canStartDiscussion;\n newDiscussion.children = app.translator.trans(canStartDiscussion ? 'core.forum.index.start_discussion_button' : 'core.forum.index.cannot_start_discussion_button');\n }\n });\n\n // Add a parameter for the global search state to pass on to the\n // DiscussionListState that will let us filter discussions by tag.\n extend(GlobalSearchState.prototype, 'params', function (params) {\n params.tags = m.route.param('tags');\n });\n\n // Translate that parameter into a gambit appended to the search query.\n extend(DiscussionListState.prototype, 'requestParams', function (params) {\n if (typeof params.include === 'string') {\n params.include = [params.include];\n } else {\n var _params$include;\n (_params$include = params.include) == null ? void 0 : _params$include.push('tags', 'tags.parent');\n }\n if (this.params.tags) {\n params.filter || (params.filter = {});\n params.filter.tag = this.params.tags;\n }\n });\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/DiscussionListItem');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/DiscussionHero');","import extract from 'flarum/common/utils/extract';\nimport tagLabel from './tagLabel';\nimport sortTags from '../utils/sortTags';\nimport classList from 'flarum/common/utils/classList';\nexport default function tagsLabel(tags, attrs) {\n if (attrs === void 0) {\n attrs = {};\n }\n const children = [];\n const {\n link,\n ...otherAttrs\n } = attrs;\n otherAttrs.className = classList('TagsLabel', otherAttrs.className);\n if (tags) {\n sortTags(tags).forEach(tag => {\n if (tag || tags.length === 1) {\n children.push(tagLabel(tag, {\n link\n }));\n }\n });\n } else {\n children.push(tagLabel());\n }\n return m(\"span\", otherAttrs, children);\n}\nflarum.reg.add('flarum-tags', 'common/helpers/tagsLabel', tagsLabel);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/utils/DiscussionControls');","import { extend } from 'flarum/common/extend';\nimport DiscussionControls from 'flarum/forum/utils/DiscussionControls';\nimport Button from 'flarum/common/components/Button';\nexport default function addTagControl() {\n // Add a control allowing the discussion to be moved to another category.\n extend(DiscussionControls, 'moderationControls', function (items, discussion) {\n if (discussion.canTag()) {\n items.add('tags', m(Button, {\n icon: \"fas fa-tag\",\n onclick: () => app.modal.show(() => import(/* webpackChunkName: 'forum/components/TagDiscussionModal', webpackMode: 'lazy-once' */ './components/TagDiscussionModal'), {\n discussion\n })\n }, app.translator.trans('flarum-tags.forum.discussion_controls.edit_tags_button')));\n }\n });\n}flarum.reg.addChunkModule('642', '884', 'flarum-tags', 'forum/components/TagDiscussionModal');\nflarum.reg.addChunkModule('642', '884', 'flarum-tags', '/home/runner/work/framework/framework/extensions/tags/js/src/forum/components/TagDiscussionModal.tsx');\nflarum.reg.addChunkModule('642', '884', 'flarum-tags', '/home/runner/work/framework/framework/extensions/tags/js/src/common/components/TagSelectionModal.tsx');\nflarum.reg.addChunkModule('642', '884', 'flarum-tags', '/home/runner/work/framework/framework/extensions/tags/js/src/forum/components/ToggleButton.js');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extenders');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/models/Discussion');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'forum/components/EventPost');","import EventPost from 'flarum/forum/components/EventPost';\nimport tagsLabel from '../../common/helpers/tagsLabel';\nexport default class DiscussionTaggedPost extends EventPost {\n static initAttrs(attrs) {\n super.initAttrs(attrs);\n const oldTags = attrs.post.content()[0];\n const newTags = attrs.post.content()[1];\n function diffTags(tags1, tags2) {\n return tags1.filter(tag => tags2.indexOf(tag) === -1).map(id => app.store.getById('tags', id));\n }\n attrs.tagsAdded = diffTags(newTags, oldTags);\n attrs.tagsRemoved = diffTags(oldTags, newTags);\n }\n icon() {\n return 'fas fa-tag';\n }\n descriptionKey() {\n if (this.attrs.tagsAdded.length) {\n if (this.attrs.tagsRemoved.length) {\n return 'flarum-tags.forum.post_stream.added_and_removed_tags_text';\n }\n return 'flarum-tags.forum.post_stream.added_tags_text';\n }\n return 'flarum-tags.forum.post_stream.removed_tags_text';\n }\n descriptionData() {\n const data = {};\n if (this.attrs.tagsAdded.length) {\n data.tagsAdded = app.translator.trans('flarum-tags.forum.post_stream.tags_text', {\n tags: tagsLabel(this.attrs.tagsAdded, {\n link: true\n }),\n count: this.attrs.tagsAdded.length\n });\n }\n if (this.attrs.tagsRemoved.length) {\n data.tagsRemoved = app.translator.trans('flarum-tags.forum.post_stream.tags_text', {\n tags: tagsLabel(this.attrs.tagsRemoved, {\n link: true\n }),\n count: this.attrs.tagsRemoved.length\n });\n }\n return data;\n }\n}\nflarum.reg.add('flarum-tags', 'forum/components/DiscussionTaggedPost', DiscussionTaggedPost);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/computed');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/Model');","import computed from 'flarum/common/utils/computed';\nimport Model from 'flarum/common/Model';\nexport default class Tag extends Model {\n name() {\n return Model.attribute('name').call(this);\n }\n slug() {\n return Model.attribute('slug').call(this);\n }\n description() {\n return Model.attribute('description').call(this);\n }\n color() {\n return Model.attribute('color').call(this);\n }\n backgroundUrl() {\n return Model.attribute('backgroundUrl').call(this);\n }\n backgroundMode() {\n return Model.attribute('backgroundMode').call(this);\n }\n icon() {\n return Model.attribute('icon').call(this);\n }\n position() {\n return Model.attribute('position').call(this);\n }\n parent() {\n return Model.hasOne('parent').call(this);\n }\n children() {\n return Model.hasMany('children').call(this);\n }\n defaultSort() {\n return Model.attribute('defaultSort').call(this);\n }\n isChild() {\n return Model.attribute('isChild').call(this);\n }\n isHidden() {\n return Model.attribute('isHidden').call(this);\n }\n isPrimary() {\n return Model.attribute('isPrimary').call(this);\n }\n discussionCount() {\n return Model.attribute('discussionCount').call(this);\n }\n lastPostedAt() {\n return Model.attribute('lastPostedAt', Model.transformDate).call(this);\n }\n lastPostedDiscussion() {\n return Model.hasOne('lastPostedDiscussion').call(this);\n }\n isRestricted() {\n return Model.attribute('isRestricted').call(this);\n }\n canStartDiscussion() {\n return Model.attribute('canStartDiscussion').call(this);\n }\n canAddToDiscussion() {\n return Model.attribute('canAddToDiscussion').call(this);\n }\n isPrimaryParent() {\n return computed('position', 'parent', (position, parent) => position !== null && parent === false).call(this);\n }\n}\nflarum.reg.add('flarum-tags', 'common/models/Tag', Tag);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/query/IGambit');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/common/app';\nimport { KeyValueGambit } from 'flarum/common/query/IGambit';\nexport default class TagGambit extends KeyValueGambit {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"predicates\", true);\n }\n key() {\n return app.translator.trans('flarum-tags.lib.gambits.discussions.tag.key', {}, true);\n }\n hint() {\n return app.translator.trans('flarum-tags.lib.gambits.discussions.tag.hint', {}, true);\n }\n filterKey() {\n return 'tag';\n }\n gambitValueToFilterValue(value) {\n return [value];\n }\n fromFilter(value, negate) {\n let gambits = [];\n if (Array.isArray(value)) {\n gambits = value.map(value => this.fromFilter(value.toString(), negate));\n } else {\n return \"\".concat(negate ? '-' : '').concat(this.key(), \":\").concat(this.filterValueToGambitValue(value));\n }\n return gambits.join(' ');\n }\n filterValueToGambitValue(value) {\n return value;\n }\n}\nflarum.reg.add('flarum-tags', 'common/query/discussions/TagGambit', TagGambit);","import Extend from 'flarum/common/extenders';\nimport Tag from './models/Tag';\nimport TagGambit from './query/discussions/TagGambit';\nexport default [new Extend.Store() //\n.add('tags', Tag), new Extend.Search() //\n.gambit('discussions', TagGambit)];","import app from 'flarum/forum/app';\nimport Extend from 'flarum/common/extenders';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport Discussion from 'flarum/common/models/Discussion';\nimport DiscussionTaggedPost from './components/DiscussionTaggedPost';\nimport TagsPage from './components/TagsPage';\nimport commonExtend from '../common/extend';\nexport default [...commonExtend, new Extend.Routes() //\n.add('tags', '/tags', TagsPage) //\n.add('tag', '/t/:tags', IndexPage) //\n.helper('tag', tag => app.route('tag', {\n tags: tag.slug()\n})), new Extend.PostTypes() //\n.add('discussionTagged', DiscussionTaggedPost), new Extend.Model(Discussion) //\n.hasMany('tags') //\n.attribute('canTag')];","import app from 'flarum/forum/app';\nimport TagListState from '../common/states/TagListState';\nimport addTagList from './addTagList';\nimport addTagFilter from './addTagFilter';\nimport addTagLabels from './addTagLabels';\nimport addTagControl from './addTagControl';\nimport addTagComposer from './addTagComposer';\nexport { default as extend } from './extend';\napp.initializers.add('flarum-tags', () => {\n app.tagList = new TagListState();\n addTagList();\n addTagFilter();\n addTagLabels();\n addTagControl();\n addTagComposer();\n});\nimport './forum';","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport IndexSidebar from 'flarum/forum/components/IndexSidebar';\nimport Separator from 'flarum/common/components/Separator';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport TagLinkButton from './components/TagLinkButton';\nimport TagsPage from './components/TagsPage';\nimport sortTags from '../common/utils/sortTags';\nexport default function addTagList() {\n // Add a link to the tags page, as well as a list of all the tags,\n // to the index page's sidebar.\n extend(IndexSidebar.prototype, 'navItems', function (items) {\n items.add('tags', m(LinkButton, {\n icon: \"fas fa-th-large\",\n href: app.route('tags')\n }, app.translator.trans('flarum-tags.forum.index.tags_link')), -10);\n if (app.current.matches(TagsPage)) return;\n items.add('separator', m(Separator, null), -12);\n const params = app.search.state.stickyParams();\n const tags = app.store.all('tags');\n const currentTag = app.currentTag();\n const addTag = tag => {\n let active = currentTag === tag;\n if (!active && currentTag) {\n active = currentTag.parent() === tag;\n }\n\n // tag.name() is passed here as children even though it isn't used directly\n // because when we need to get the active child in SelectDropdown, we need to\n // use its children to populate the dropdown. The problem here is that `view`\n // on TagLinkButton is only called AFTER SelectDropdown, so no children are available\n // for SelectDropdown to use at the time.\n items.add('tag' + tag.id(), m(TagLinkButton, {\n model: tag,\n params: params,\n active: active\n }, tag == null ? void 0 : tag.name()), -14);\n };\n sortTags(tags).filter(tag => tag.position() !== null && (!tag.isChild() || currentTag && (tag.parent() === currentTag || tag.parent() === currentTag.parent()))).forEach(addTag);\n const more = tags.filter(tag => tag.position() === null).sort((a, b) => b.discussionCount() - a.discussionCount());\n more.splice(0, 3).forEach(addTag);\n if (more.length) {\n items.add('moreTags', m(LinkButton, {\n href: app.route('tags')\n }, app.translator.trans('flarum-tags.forum.index.more_link')), -16);\n }\n });\n}","import { extend } from 'flarum/common/extend';\nimport DiscussionListItem from 'flarum/forum/components/DiscussionListItem';\nimport DiscussionHero from 'flarum/forum/components/DiscussionHero';\nimport textContrastClass from 'flarum/common/helpers/textContrastClass';\nimport classList from 'flarum/common/utils/classList';\nimport tagsLabel from '../common/helpers/tagsLabel';\nimport sortTags from '../common/utils/sortTags';\nexport default function addTagLabels() {\n // Add tag labels to each discussion in the discussion list.\n extend(DiscussionListItem.prototype, 'infoItems', function (items) {\n const tags = this.attrs.discussion.tags();\n if (tags && tags.length) {\n items.add('tags', tagsLabel(tags), 10);\n }\n });\n\n // Restyle a discussion's hero to use its first tag's color.\n extend(DiscussionHero.prototype, 'view', function (view) {\n const tags = sortTags(this.attrs.discussion.tags());\n if (tags && tags.length) {\n const color = tags[0].color();\n if (color) {\n view.attrs.style = {\n '--hero-bg': color\n };\n view.attrs.className = classList(view.attrs.className, 'DiscussionHero--colored', textContrastClass(color));\n }\n }\n });\n\n // Add a list of a discussion's tags to the discussion hero, displayed\n // before the title. Put the title on its own line.\n extend(DiscussionHero.prototype, 'items', function (items) {\n const tags = this.attrs.discussion.tags();\n if (tags && tags.length) {\n items.add('tags', tagsLabel(tags, {\n link: true\n }), 5);\n }\n });\n}","import app from 'flarum/forum/app';\nimport { extend, override } from 'flarum/common/extend';\nimport IndexSidebar from 'flarum/forum/components/IndexSidebar';\nimport classList from 'flarum/common/utils/classList';\nimport tagsLabel from '../common/helpers/tagsLabel';\nimport getSelectableTags from './utils/getSelectableTags';\nexport default function addTagComposer() {\n extend(IndexSidebar.prototype, 'newDiscussionAction', function (promise) {\n // From `addTagFilter\n const tag = app.currentTag();\n if (tag) {\n const parent = tag.parent();\n const tags = parent ? [parent, tag] : [tag];\n promise.then(composer => composer.fields.tags = tags);\n } else {\n app.composer.fields.tags = [];\n }\n });\n extend('flarum/forum/components/DiscussionComposer', 'oninit', function () {\n app.tagList.load(['parent']).then(() => m.redraw());\n\n // Add tag-selection abilities to the discussion composer.\n this.constructor.prototype.chooseTags = function () {\n const selectableTags = getSelectableTags();\n if (!selectableTags.length) return;\n app.modal.show(() => import(/* webpackChunkName: 'forum/components/TagDiscussionModal', webpackMode: 'lazy-once' */ './components/TagDiscussionModal'), {\n selectedTags: (this.composer.fields.tags || []).slice(0),\n onsubmit: tags => {\n this.composer.fields.tags = tags;\n this.$('textarea').focus();\n }\n });\n };\n });\n\n // Add a tag-selection menu to the discussion composer's header, after the\n // title.\n extend('flarum/forum/components/DiscussionComposer', 'headerItems', function (items) {\n const tags = this.composer.fields.tags || [];\n const selectableTags = getSelectableTags();\n items.add('tags', m(\"a\", {\n className: classList(['DiscussionComposer-changeTags', !selectableTags.length && 'disabled']),\n onclick: this.chooseTags.bind(this)\n }, tags.length ? tagsLabel(tags) : m(\"span\", {\n className: \"TagLabel untagged\"\n }, app.translator.trans('flarum-tags.forum.composer_discussion.choose_tags_link'))), 10);\n });\n override('flarum/forum/components/DiscussionComposer', 'onsubmit', function (original) {\n const chosenTags = this.composer.fields.tags || [];\n const chosenPrimaryTags = chosenTags.filter(tag => tag.position() !== null && !tag.isChild());\n const chosenSecondaryTags = chosenTags.filter(tag => tag.position() === null);\n const selectableTags = getSelectableTags();\n const minPrimaryTags = parseInt(app.forum.attribute('minPrimaryTags'));\n const minSecondaryTags = parseInt(app.forum.attribute('minSecondaryTags'));\n const maxPrimaryTags = parseInt(app.forum.attribute('maxPrimaryTags'));\n const maxSecondaryTags = parseInt(app.forum.attribute('maxSecondaryTags'));\n if ((!chosenTags.length && maxPrimaryTags !== 0 && maxSecondaryTags !== 0 || chosenPrimaryTags.length < minPrimaryTags || chosenSecondaryTags.length < minSecondaryTags) && selectableTags.length) {\n app.modal.show(() => import(/* webpackChunkName: 'forum/components/TagDiscussionModal', webpackMode: 'lazy-once' */ './components/TagDiscussionModal'), {\n selectedTags: chosenTags,\n onsubmit: tags => {\n this.composer.fields.tags = tags;\n original();\n }\n });\n } else {\n original();\n }\n });\n\n // Add the selected tags as data to submit to the server.\n extend('flarum/forum/components/DiscussionComposer', 'data', function (data) {\n data.relationships = data.relationships || {};\n data.relationships.tags = this.composer.fields.tags;\n });\n}","export default function getSelectableTags(discussion) {\n let tags = app.store.all('tags');\n if (discussion) {\n const discussionTags = discussion.tags() || [];\n tags = tags.filter(tag => tag.canAddToDiscussion() || discussionTags.includes(tag));\n } else {\n tags = tags.filter(tag => tag.canStartDiscussion());\n }\n return tags;\n}\nflarum.reg.add('flarum-tags', 'forum/utils/getSelectableTags', getSelectableTags);","module.exports = flarum.reg.get('core', 'common/Component');","module.exports = flarum.reg.get('core', 'common/app');","module.exports = flarum.reg.get('core', 'common/components/Button');","module.exports = flarum.reg.get('core', 'common/components/FormModal');","module.exports = flarum.reg.get('core', 'common/components/Link');","module.exports = flarum.reg.get('core', 'common/components/LoadingIndicator');","module.exports = flarum.reg.get('core', 'common/helpers/highlight');","module.exports = flarum.reg.get('core', 'common/helpers/textContrastClass');","module.exports = flarum.reg.get('core', 'common/utils/KeyboardNavigatable');","module.exports = flarum.reg.get('core', 'common/utils/Stream');","module.exports = flarum.reg.get('core', 'common/utils/classList');","module.exports = flarum.reg.get('core', 'common/utils/extract');","module.exports = flarum.reg.get('core', 'common/utils/extractText');","module.exports = flarum.reg.get('core', 'forum/app');","module.exports = flarum.reg.get('core', 'forum/components/DiscussionPage');","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}","import _typeof from \"./typeof.js\";\nexport default function _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + \"forum/components/TagDiscussionModal\" + \".js\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript)\n\t\tscriptUrl = document.currentScript.src\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) scriptUrl = scripts[scripts.length - 1].src\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","__webpack_require__.f.compat = (chunkId, promises) => {\n\n\tconst originalLoadChunk = __webpack_require__.l;\n\t__webpack_require__.l = flarum.reg.loadChunk.bind(flarum.reg, originalLoadChunk);\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t315: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t} else installedChunks[chunkId] = 0;\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n// no on chunks loaded\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkmodule_exports\"] = self[\"webpackChunkmodule_exports\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));"],"names":["inProgress","dataWebpackPrefix","tagIcon","tag","attrs","settings","hasIcon","icon","useColor","className","style","color","m","flarum","reg","add","tagLabel","link","tagText","name","app","translator","trans","title","description","href","route","tags","slug","isChild","sortTags","slice","sort","a","b","aPos","position","bPos","discussionCount","aParent","parent","bParent","TagListState","constructor","this","async","includes","loadedIncludes","query","unloadedIncludes","filter","include","has","length","Promise","resolve","Set","join","then","val","Array","isArray","forEach","get","TagLinkButton","view","vnode","model","child","undefined","static","super","initAttrs","params","TagsPage","arguments","oninit","preloaded","loading","redraw","oncreate","hero","bind","sidebar","contentItems","toArray","items","pinned","cloud","tagTileListView","cloudView","map","tagTileView","lastPostedDiscussion","children","colored","lastPostNumber","lastPostedAt","TagHero","findTag","find","localeCompare","sensitivity","tagsLabel","otherAttrs","push","addChunkModule","DiscussionTaggedPost","oldTags","post","content","newTags","diffTags","tags1","tags2","indexOf","id","store","getById","tagsAdded","tagsRemoved","descriptionKey","descriptionData","data","count","Tag","call","backgroundUrl","backgroundMode","defaultSort","isHidden","isPrimary","isRestricted","canStartDiscussion","canAddToDiscussion","isPrimaryParent","TagGambit","KeyValueGambit","key","hint","filterKey","gambitValueToFilterValue","value","fromFilter","negate","gambits","toString","concat","filterValueToGambitValue","gambit","helper","hasMany","attribute","extend","currentTag","addTag","active","more","splice","reload","currentActiveTag","search","state","currentTagLoading","finally","vdom","override","original","newDiscussion","disabled","param","_params$include","discussion","canTag","onclick","modal","show","promise","composer","fields","prototype","chooseTags","getSelectableTags","selectedTags","onsubmit","$","focus","selectableTags","chosenTags","chosenPrimaryTags","chosenSecondaryTags","minPrimaryTags","parseInt","minSecondaryTags","maxPrimaryTags","maxSecondaryTags","relationships","all","discussionTags","module","exports","_typeof","obj","Symbol","iterator","_defineProperty","arg","input","prim","toPrimitive","res","TypeError","String","toPropertyKey","Object","defineProperty","enumerable","configurable","writable","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","n","getter","__esModule","d","definition","o","f","e","chunkId","keys","reduce","promises","u","g","globalThis","Function","window","prop","hasOwnProperty","l","url","done","script","needAttach","scripts","document","getElementsByTagName","i","s","getAttribute","createElement","charset","timeout","nc","setAttribute","src","onScriptComplete","prev","event","onerror","onload","clearTimeout","doneFns","parentNode","removeChild","fn","setTimeout","type","target","head","appendChild","r","toStringTag","scriptUrl","importScripts","location","currentScript","Error","replace","p","compat","originalLoadChunk","loadChunk","installedChunks","j","installedChunkData","reject","error","errorType","realSrc","message","request","webpackJsonpCallback","parentChunkLoadingFunction","chunkIds","moreModules","runtime","some","chunkLoadingGlobal","self"],"sourceRoot":""}
\ No newline at end of file