From ad9eaa38b2865152edc19a367fc9904d0a584b19 Mon Sep 17 00:00:00 2001 From: flarum-bot Date: Wed, 17 Feb 2021 13:51:41 +0000 Subject: [PATCH] Bundled output for commit 42158112bf6dc0a0291cd79613d171b4f082efe4 [skip ci] --- extensions/tags/js/dist/forum.js | 2 +- extensions/tags/js/dist/forum.js.map | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/tags/js/dist/forum.js b/extensions/tags/js/dist/forum.js index 766c2b55b..3de9afdb4 100644 --- a/extensions/tags/js/dist/forum.js +++ b/extensions/tags/js/dist/forum.js @@ -1,2 +1,2 @@ -module.exports=function(t){var e={};function a(s){if(e[s])return e[s].exports;var n=e[s]={i:s,l:!1,exports:{}};return t[s].call(n.exports,n,n.exports,a),n.l=!0,n.exports}return a.m=t,a.c=e,a.d=function(t,e,s){a.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:s})},a.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a.t=function(t,e){if(1&e&&(t=a(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var s=Object.create(null);if(a.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)a.d(s,n,function(e){return t[e]}.bind(null,n));return s},a.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return a.d(e,"a",e),e},a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},a.p="",a(a.s=50)}([function(t,e){t.exports=flarum.core.compat.Model},function(t,e){t.exports=flarum.core.compat.extend},function(t,e,a){"use strict";function s(t){return t.slice(0).sort((function(t,e){var a=t.position(),s=e.position();if(null===a&&null===s)return e.discussionCount()-t.discussionCount();if(null===s)return-1;if(null===a)return 1;var n=t.parent(),o=e.parent();return n===o?a-s:n&&o?n.position()-o.position():n?n===e?1:n.position()-s:o?o===t?-1:a-o.position():0}))}a.d(e,"a",(function(){return s}))},function(t,e,a){"use strict";a.d(e,"a",(function(){return o}));var s=a(13),n=a.n(s);function o(t,e,a){void 0===e&&(e={}),void 0===a&&(a={});var s=t&&t.icon(),o=a.useColor,r=void 0===o||o;return e.className=n()([e.className,"icon",s?t.icon():"TagIcon"]),t?(e.style=e.style||{},s?e.style.color=r?t.color():"":e.style.backgroundColor=t.color()):e.className+=" untagged",s?m("i",e):m("span",e)}},function(t,e,a){"use strict";function s(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}a.d(e,"a",(function(){return s}))},function(t,e,a){"use strict";a.d(e,"a",(function(){return c}));var s=a(14),n=a.n(s),o=a(9),r=a.n(o),i=a(3);function c(t,e){void 0===e&&(e={}),e.style=e.style||{},e.className="TagLabel "+(e.className||"");var a=n()(e,"link"),s=t?t.name():app.translator.trans("flarum-tags.lib.deleted_tag_text");if(t){var o=t.color();o&&(e.style.backgroundColor=e.style.color=o,e.className+=" colored"),a&&(e.title=t.description()||"",e.href=app.route("tag",{tags:t.slug()})),t.isChild()&&(e.className+=" TagLabel--child")}else e.className+=" untagged";return m(a?r.a:"span",e,m("span",{className:"TagLabel-text"},t&&t.icon()&&Object(i.a)(t,{},{useColor:!1})," ",s))}},function(t,e){t.exports=flarum.core.compat["components/IndexPage"]},function(t,e,a){"use strict";a.d(e,"a",(function(){return i}));var s=a(14),n=a.n(s),o=a(5),r=a(2);function i(t,e){void 0===e&&(e={});var a=[],s=n()(e,"link");return e.className="TagsLabel "+(e.className||""),t?Object(r.a)(t).forEach((function(e){(e||1===t.length)&&a.push(Object(o.a)(e,{link:s}))})):a.push(Object(o.a)()),m("span",e,a)}},function(t,e){t.exports=flarum.core.compat["components/Button"]},function(t,e){t.exports=flarum.core.compat["components/Link"]},function(t,e){t.exports=flarum.core.compat["utils/Stream"]},function(t,e,a){"use strict";function s(){return(s=Object.assign||function(t){for(var e=1;e=this.maxPrimary&&(e=e.filter((function(e){return!e.isPrimary()||-1!==t.selected.indexOf(e)}))),n>=this.maxSecondary&&(e=e.filter((function(e){return e.isPrimary()||-1!==t.selected.indexOf(e)}))),a&&(e=e.filter((function(t){return t.name().substr(0,a.length).toLowerCase()===a}))),-1===e.indexOf(this.index)&&(this.index=e[0]);var o=Math.max(it()(this.getInstruction(s,n)).length,this.filter().length);return[m("div",{className:"Modal-body"},m("div",{className:"TagDiscussionModal-form"},m("div",{className:"TagDiscussionModal-form-input"},m("div",{className:"TagsInput FormControl "+(this.focused?"focus":""),onclick:function(){return t.$(".TagsInput input").focus()}},m("span",{className:"TagsInput-selected"},this.selected.map((function(e){return m("span",{className:"TagsInput-tag",onclick:function(){t.removeTag(e),t.onready()}},Object(O.a)(e))}))),m("input",{className:"FormControl",placeholder:it()(this.getInstruction(s,n)),bidi:this.filter,style:{width:o+"ch"},onkeydown:this.navigator.navigate.bind(this.navigator),onfocus:function(){return t.focused=!0},onblur:function(){return t.focused=!1}}))),m("div",{className:"TagDiscussionModal-form-submit App-primaryControl"},m(Z.a,{type:"submit",className:"Button Button--primary",disabled:!this.meetsRequirements(s,n),icon:"fas fa-check"},app.translator.trans("flarum-tags.forum.choose_tags.submit_button"))))),m("div",{className:"Modal-footer"},m("ul",{className:"TagDiscussionModal-list SelectTagList"},e.filter((function(e){return a||!e.parent()||-1!==t.selected.indexOf(e.parent())})).map((function(e){return m("li",{"data-index":e.id(),className:M()({pinned:null!==e.position(),child:!!e.parent(),colored:!!e.color(),selected:-1!==t.selected.indexOf(e),active:t.index===e}),style:{color:e.color()},onmouseover:function(){return t.index=e},onclick:t.toggleTag.bind(t,e)},Object(T.a)(e),m("span",{className:"SelectTagListItem-name"},ot()(e.name(),a)),e.description()?m("span",{className:"SelectTagListItem-description"},e.description()):"")}))))]},a.meetsRequirements=function(t,e){return!!app.forum.attribute("canBypassTagCounts")||t>=this.minPrimary&&e>=this.minSecondary},a.toggleTag=function(t){-1!==this.selected.indexOf(t)?this.removeTag(t):this.addTag(t),this.filter()&&(this.filter(""),this.index=this.tags[0]),this.onready()},a.select=function(t){t.metaKey||t.ctrlKey||-1!==this.selected.indexOf(this.index)?this.selected.length&&this.$('button[type="submit"]').click():this.getItem(this.index)[0].dispatchEvent(new Event("click"))},a.selectableItems=function(){return this.$(".TagDiscussionModal-list > li")},a.getCurrentNumericIndex=function(){return this.selectableItems().index(this.getItem(this.index))},a.getItem=function(t){return this.selectableItems().filter('[data-index="'+t.id()+'"]')},a.setIndex=function(t,e){var a=this.selectableItems(),s=a.parent();t<0?t=a.length-1:t>=a.length&&(t=0);var n=a.eq(t);if(this.index=app.store.getById("tags",n.attr("data-index")),m.redraw(),e){var o,r=s.scrollTop(),i=s.offset().top,c=i+s.outerHeight(),u=n.offset().top,l=u+n.outerHeight();uc&&(o=r-c+l+parseInt(s.css("padding-bottom"),10)),void 0!==o&&s.stop(!0).animate({scrollTop:o},100)}},a.onsubmit=function(t){t.preventDefault();var e=this.attrs.discussion,a=this.selected;e&&e.save({relationships:{tags:a}}).then((function(){app.current.matches(st.a)&&app.current.get("stream").update(),m.redraw()})),this.attrs.onsubmit&&this.attrs.onsubmit(a),this.hide()},e}(et.a),dt=function(){Object(I.extend)(X.a,"moderationControls",(function(t,e){e.canTag()&&t.add("tags",m(Z.a,{icon:"fas fa-tag",onclick:function(){return app.modal.show(mt,{discussion:e})}},app.translator.trans("flarum-tags.forum.discussion_controls.edit_tags_button")))}))},ft=a(23),gt=a.n(ft),ht=function(){Object(I.extend)(u.a.prototype,"newDiscussionAction",(function(t){var e=app.store.getBy("tags","slug",app.search.params().tags);if(e){var a=e.parent(),s=a?[a,e]:[e];t.then((function(t){return t.fields.tags=s}))}else app.composer.fields.tags=[]})),gt.a.prototype.chooseTags=function(){var t=this;app.modal.show(mt,{selectedTags:(this.composer.fields.tags||[]).slice(0),onsubmit:function(e){t.composer.fields.tags=e,t.$("textarea").focus()}})},Object(I.extend)(gt.a.prototype,"headerItems",(function(t){var e=this.composer.fields.tags||[];t.add("tags",m("a",{className:"DiscussionComposer-changeTags",onclick:this.chooseTags.bind(this)},e.length?Object(P.a)(e):m("span",{className:"TagLabel untagged"},app.translator.trans("flarum-tags.forum.composer_discussion.choose_tags_link"))),10)})),Object(I.override)(gt.a.prototype,"onsubmit",(function(t){var e=this,a=this.composer.fields.tags||[],s=a.filter((function(t){return null!==t.position()&&!t.isChild()})),n=a.filter((function(t){return null===t.position()}));!a.length||s.length=this.maxPrimary&&(e=e.filter((function(e){return!e.isPrimary()||-1!==t.selected.indexOf(e)}))),n>=this.maxSecondary&&(e=e.filter((function(e){return e.isPrimary()||-1!==t.selected.indexOf(e)}))),a&&(e=e.filter((function(t){return t.name().substr(0,a.length).toLowerCase()===a}))),-1===e.indexOf(this.index)&&(this.index=e[0]);var o=Math.max(it()(this.getInstruction(s,n)).length,this.filter().length);return[m("div",{className:"Modal-body"},m("div",{className:"TagDiscussionModal-form"},m("div",{className:"TagDiscussionModal-form-input"},m("div",{className:"TagsInput FormControl "+(this.focused?"focus":""),onclick:function(){return t.$(".TagsInput input").focus()}},m("span",{className:"TagsInput-selected"},this.selected.map((function(e){return m("span",{className:"TagsInput-tag",onclick:function(){t.removeTag(e),t.onready()}},Object(O.a)(e))}))),m("input",{className:"FormControl",placeholder:it()(this.getInstruction(s,n)),bidi:this.filter,style:{width:o+"ch"},onkeydown:this.navigator.navigate.bind(this.navigator),onfocus:function(){return t.focused=!0},onblur:function(){return t.focused=!1}}))),m("div",{className:"TagDiscussionModal-form-submit App-primaryControl"},m(Z.a,{type:"submit",className:"Button Button--primary",disabled:!this.meetsRequirements(s,n),icon:"fas fa-check"},app.translator.trans("flarum-tags.forum.choose_tags.submit_button"))))),m("div",{className:"Modal-footer"},m("ul",{className:"TagDiscussionModal-list SelectTagList"},e.filter((function(e){return a||!e.parent()||-1!==t.selected.indexOf(e.parent())})).map((function(e){return m("li",{"data-index":e.id(),className:M()({pinned:null!==e.position(),child:!!e.parent(),colored:!!e.color(),selected:-1!==t.selected.indexOf(e),active:t.index===e}),style:{color:e.color()},onmouseover:function(){return t.index=e},onclick:t.toggleTag.bind(t,e)},Object(T.a)(e),m("span",{className:"SelectTagListItem-name"},ot()(e.name(),a)),e.description()?m("span",{className:"SelectTagListItem-description"},e.description()):"")}))))]},a.meetsRequirements=function(t,e){return!!app.forum.attribute("canBypassTagCounts")||t>=this.minPrimary&&e>=this.minSecondary},a.toggleTag=function(t){-1!==this.selected.indexOf(t)?this.removeTag(t):this.addTag(t),this.filter()&&(this.filter(""),this.index=this.tags[0]),this.onready()},a.select=function(t){t.metaKey||t.ctrlKey||-1!==this.selected.indexOf(this.index)?this.selected.length&&this.$('button[type="submit"]').click():this.getItem(this.index)[0].dispatchEvent(new Event("click"))},a.selectableItems=function(){return this.$(".TagDiscussionModal-list > li")},a.getCurrentNumericIndex=function(){return this.selectableItems().index(this.getItem(this.index))},a.getItem=function(t){return this.selectableItems().filter('[data-index="'+t.id()+'"]')},a.setIndex=function(t,e){var a=this.selectableItems(),s=a.parent();t<0?t=a.length-1:t>=a.length&&(t=0);var n=a.eq(t);if(this.index=app.store.getById("tags",n.attr("data-index")),m.redraw(),e){var o,r=s.scrollTop(),i=s.offset().top,c=i+s.outerHeight(),u=n.offset().top,l=u+n.outerHeight();uc&&(o=r-c+l+parseInt(s.css("padding-bottom"),10)),void 0!==o&&s.stop(!0).animate({scrollTop:o},100)}},a.onsubmit=function(t){t.preventDefault();var e=this.attrs.discussion,a=this.selected;e&&e.save({relationships:{tags:a}}).then((function(){app.current.matches(st.a)&&app.current.get("stream").update(),m.redraw()})),this.attrs.onsubmit&&this.attrs.onsubmit(a),this.hide()},e}(et.a),dt=function(){Object(I.extend)(X.a,"moderationControls",(function(t,e){e.canTag()&&t.add("tags",m(Z.a,{icon:"fas fa-tag",onclick:function(){return app.modal.show(mt,{discussion:e})}},app.translator.trans("flarum-tags.forum.discussion_controls.edit_tags_button")))}))},ft=a(23),gt=a.n(ft),ht=function(){Object(I.extend)(u.a.prototype,"newDiscussionAction",(function(t){var e=app.store.getBy("tags","slug",app.search.params().tags);if(e){var a=e.parent(),s=a?[a,e]:[e];t.then((function(t){return t.fields.tags=s}))}else app.composer.fields.tags=[]})),gt.a.prototype.chooseTags=function(){var t=this;app.modal.show(mt,{selectedTags:(this.composer.fields.tags||[]).slice(0),onsubmit:function(e){t.composer.fields.tags=e,t.$("textarea").focus()}})},Object(I.extend)(gt.a.prototype,"headerItems",(function(t){var e=this.composer.fields.tags||[];t.add("tags",m("a",{className:"DiscussionComposer-changeTags",onclick:this.chooseTags.bind(this)},e.length?Object(P.a)(e):m("span",{className:"TagLabel untagged"},app.translator.trans("flarum-tags.forum.composer_discussion.choose_tags_link"))),10)})),Object(I.override)(gt.a.prototype,"onsubmit",(function(t){var e=this,a=this.composer.fields.tags||[],s=a.filter((function(t){return null!==t.position()&&!t.isChild()})),n=a.filter((function(t){return null===t.position()}));!a.length||s.length {\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)\n 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\n // If they are both child tags, then we will compare the positions of their\n // parents.\n else if (aParent && bParent)\n return aParent.position() - bParent.position();\n\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)\n return aParent === b ? 1 : aParent.position() - bPos;\n\n else if (bParent)\n return bParent === a ? -1 : aPos - bParent.position();\n\n return 0;\n });\n}\n","import classList from 'flarum/utils/classList';\n\nexport default function tagIcon(tag, attrs = {}, settings = {}) {\n const hasIcon = tag && tag.icon();\n const { useColor = true } = settings;\n\n attrs.className = classList([\n attrs.className,\n 'icon',\n hasIcon ? tag.icon() : 'TagIcon'\n ]);\n\n if (tag) {\n attrs.style = attrs.style || {};\n\n if (hasIcon) {\n attrs.style.color = useColor ? tag.color() : '';\n } else {\n attrs.style.backgroundColor = tag.color();\n }\n\n } else {\n attrs.className += ' untagged';\n }\n\n return hasIcon ? : ;\n}\n","export default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}","import extract from 'flarum/utils/extract';\nimport Link from 'flarum/components/Link';\nimport tagIcon from './tagIcon';\n\nexport default function tagLabel(tag, attrs = {}) {\n attrs.style = attrs.style || {};\n attrs.className = 'TagLabel ' + (attrs.className || '');\n\n const link = extract(attrs, 'link');\n const tagText = tag ? tag.name() : app.translator.trans('flarum-tags.lib.deleted_tag_text');\n\n if (tag) {\n const color = tag.color();\n if (color) {\n attrs.style.backgroundColor = attrs.style.color = color;\n attrs.className += ' colored';\n }\n\n if (link) {\n attrs.title = tag.description() || '';\n attrs.href = app.route('tag', {tags: tag.slug()});\n }\n\n if (tag.isChild()) {\n attrs.className += ' TagLabel--child';\n }\n } else {\n attrs.className += ' untagged';\n }\n\n return (\n m((link ? Link : 'span'), attrs,\n \n {tag && tag.icon() && tagIcon(tag, {}, {useColor: false})} {tagText}\n \n )\n );\n}\n","module.exports = flarum.core.compat['components/IndexPage'];","import extract from 'flarum/utils/extract';\nimport tagLabel from './tagLabel';\nimport sortTags from '../utils/sortTags';\n\nexport default function tagsLabel(tags, attrs = {}) {\n const children = [];\n const link = extract(attrs, 'link');\n\n attrs.className = 'TagsLabel ' + (attrs.className || '');\n\n if (tags) {\n sortTags(tags).forEach(tag => {\n if (tag || tags.length === 1) {\n children.push(tagLabel(tag, {link}));\n }\n });\n } else {\n children.push(tagLabel());\n }\n\n return {children};\n}\n","module.exports = flarum.core.compat['components/Button'];","module.exports = flarum.core.compat['components/Link'];","module.exports = flarum.core.compat['utils/Stream'];","export default function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}","import Model from 'flarum/Model';\nimport mixin from 'flarum/utils/mixin';\nimport computed from 'flarum/utils/computed';\n\nexport default class Tag extends mixin(Model, {\n name: Model.attribute('name'),\n slug: Model.attribute('slug'),\n description: Model.attribute('description'),\n\n color: Model.attribute('color'),\n backgroundUrl: Model.attribute('backgroundUrl'),\n backgroundMode: Model.attribute('backgroundMode'),\n icon: Model.attribute('icon'),\n\n position: Model.attribute('position'),\n parent: Model.hasOne('parent'),\n defaultSort: Model.attribute('defaultSort'),\n isChild: Model.attribute('isChild'),\n isHidden: Model.attribute('isHidden'),\n\n discussionCount: Model.attribute('discussionCount'),\n lastPostedAt: Model.attribute('lastPostedAt', Model.transformDate),\n lastPostedDiscussion: Model.hasOne('lastPostedDiscussion'),\n\n isRestricted: Model.attribute('isRestricted'),\n canStartDiscussion: Model.attribute('canStartDiscussion'),\n canAddToDiscussion: Model.attribute('canAddToDiscussion'),\n\n isPrimary: computed('position', 'parent', (position, parent) => position !== null && parent === false)\n}) {}\n","module.exports = flarum.core.compat['utils/classList'];","module.exports = flarum.core.compat['utils/extract'];","module.exports = flarum.core.compat['utils/mixin'];","module.exports = flarum.core.compat['utils/computed'];","module.exports = flarum.core.compat['components/Modal'];","import sortTags from './utils/sortTags';\nimport Tag from './models/Tag';\nimport tagsLabel from './helpers/tagsLabel';\nimport tagIcon from './helpers/tagIcon';\nimport tagLabel from './helpers/tagLabel';\n\nexport default {\n 'tags/utils/sortTags': sortTags,\n 'tags/models/Tag': Tag,\n 'tags/helpers/tagsLabel': tagsLabel,\n 'tags/helpers/tagIcon': tagIcon,\n 'tags/helpers/tagLabel': tagLabel\n};\n","module.exports = flarum.core;","module.exports = flarum.core.compat['components/LinkButton'];","module.exports = flarum.core.compat['components/DiscussionComposer'];","module.exports = flarum.core.compat['models/Discussion'];","module.exports = flarum.core.compat['components/DiscussionHero'];","module.exports = flarum.core.compat['utils/extractText'];","import Page from 'flarum/components/Page';\nimport IndexPage from 'flarum/components/IndexPage';\nimport Link from 'flarum/components/Link';\nimport listItems from 'flarum/helpers/listItems';\nimport humanTime from 'flarum/helpers/humanTime';\n\nimport tagIcon from '../../common/helpers/tagIcon';\nimport tagLabel from '../../common/helpers/tagLabel';\nimport sortTags from '../../common/utils/sortTags';\n\nexport default class TagsPage extends Page {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.tags = sortTags(app.store.all('tags').filter(tag => !tag.parent()));\n\n app.history.push('tags', app.translator.trans('flarum-tags.forum.header.back_to_tags_tooltip'));\n }\n\n view() {\n const pinned = this.tags.filter(tag => tag.position() !== null);\n const cloud = this.tags.filter(tag => tag.position() === null);\n\n return (\n
\n {IndexPage.prototype.hero()}\n
\n \n\n
\n
    \n {pinned.map(tag => {\n const lastPostedDiscussion = tag.lastPostedDiscussion();\n const children = sortTags(app.store.all('tags').filter(child => child.parent() === tag));\n\n return (\n
  • \n \n {tag.icon() && tagIcon(tag, {}, { useColor: false })}\n

    {tag.name()}

    \n

    {tag.description()}

    \n {children\n ? (\n
    \n {children.map(child => [\n \n {child.name()}\n ,\n ' '\n ])}\n
    \n ) : ''}\n \n {lastPostedDiscussion\n ? (\n \n {lastPostedDiscussion.title()}\n {humanTime(lastPostedDiscussion.lastPostedAt())}\n \n ) : (\n \n )}\n
  • \n );\n })}\n
\n\n {cloud.length ? (\n
\n {cloud.map(tag => [\n tagLabel(tag, {link: true}),\n ' ',\n ])}\n
\n ) : ''}\n
\n
\n
\n );\n }\n\n oncreate(vnode) {\n super.oncreate(vnode);\n\n app.setTitle(app.translator.trans('flarum-tags.forum.all_tags.meta_title_text'));\n app.setTitleCount(0);\n }\n}\n","import EventPost from 'flarum/components/EventPost';\nimport tagsLabel from '../../common/helpers/tagsLabel';\n\nexport default class DiscussionTaggedPost extends EventPost {\n static initAttrs(attrs) {\n super.initAttrs(attrs);\n\n const oldTags = attrs.post.content()[0];\n const newTags = attrs.post.content()[1];\n\n function diffTags(tags1, tags2) {\n return tags1\n .filter(tag => tags2.indexOf(tag) === -1)\n .map(id => app.store.getById('tags', id));\n }\n\n attrs.tagsAdded = diffTags(newTags, oldTags);\n attrs.tagsRemoved = diffTags(oldTags, newTags);\n }\n\n icon() {\n return 'fas fa-tag';\n }\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\n return 'flarum-tags.forum.post_stream.added_tags_text';\n }\n\n return 'flarum-tags.forum.post_stream.removed_tags_text';\n }\n\n descriptionData() {\n const data = {};\n\n if (this.attrs.tagsAdded.length) {\n data.tagsAdded = app.translator.transChoice('flarum-tags.forum.post_stream.tags_text', this.attrs.tagsAdded.length, {\n tags: tagsLabel(this.attrs.tagsAdded, {link: true}),\n count: this.attrs.tagsAdded.length\n });\n }\n\n if (this.attrs.tagsRemoved.length) {\n data.tagsRemoved = app.translator.transChoice('flarum-tags.forum.post_stream.tags_text', this.attrs.tagsRemoved.length, {\n tags: tagsLabel(this.attrs.tagsRemoved, {link: true}),\n count: this.attrs.tagsRemoved.length\n });\n }\n\n return data;\n }\n}\n","import Link from 'flarum/components/Link';\nimport LinkButton from 'flarum/components/LinkButton';\nimport classList from 'flarum/utils/classList';\nimport tagIcon from '../../common/helpers/tagIcon';\n\nexport default class TagLinkButton extends LinkButton {\n view(vnode) {\n const tag = this.attrs.model;\n const active = this.constructor.isActive(this.attrs);\n const description = tag && tag.description();\n const className = classList([\n 'TagLinkButton',\n 'hasIcon',\n this.attrs.className,\n tag.isChild() && 'child',\n ]);\n\n return (\n \n {tagIcon(tag, {className: 'Button-icon'})}\n {tag ? tag.name() : app.translator.trans('flarum-tags.forum.index.untagged_link')}\n \n );\n }\n\n static initAttrs(attrs) {\n super.initAttrs(attrs);\n\n const tag = attrs.model;\n\n attrs.params.tags = tag ? tag.slug() : 'untagged';\n attrs.route = app.route('tag', attrs.params);\n }\n}\n","import { extend } from 'flarum/extend';\nimport IndexPage from 'flarum/components/IndexPage';\nimport Separator from 'flarum/components/Separator';\nimport LinkButton from 'flarum/components/LinkButton';\n\nimport TagLinkButton from './components/TagLinkButton';\nimport TagsPage from './components/TagsPage';\nimport sortTags from '../common/utils/sortTags';\n\nexport default function() {\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(IndexPage.prototype, 'navItems', function (items) {\n items.add('tags', \n {app.translator.trans('flarum-tags.forum.index.tags_link')}\n \n , -10);\n\n if (app.current.matches(TagsPage)) return;\n\n items.add('separator', Separator.component(), -12);\n\n const params = app.search.stickyParams();\n const tags = app.store.all('tags');\n const currentTag = this.currentTag();\n\n const addTag = tag => {\n let active = currentTag === tag;\n\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(), TagLinkButton.component({model: tag, params, active}, tag?.name()), -14);\n };\n\n sortTags(tags)\n .filter(tag => tag.position() !== null && (!tag.isChild() || (currentTag && (tag.parent() === currentTag || tag.parent() === currentTag.parent()))))\n .forEach(addTag);\n\n const more = tags\n .filter(tag => tag.position() === null)\n .sort((a, b) => b.discussionCount() - a.discussionCount());\n\n more.splice(0, 3).forEach(addTag);\n\n if (more.length) {\n items.add('moreTags', \n {app.translator.trans('flarum-tags.forum.index.more_link')}\n , -16)\n }\n });\n}\n","import Component from 'flarum/Component';\nimport tagIcon from '../../common/helpers/tagIcon';\n\nexport default class TagHero extends Component {\n view() {\n const tag = this.attrs.model;\n const color = tag.color();\n\n return (\n
\n
\n
\n

{tag.icon() && tagIcon(tag, {}, { useColor: false })} {tag.name()}

\n
{tag.description()}
\n
\n
\n
\n );\n }\n}\n","import { extend, override } from 'flarum/extend';\nimport IndexPage from 'flarum/components/IndexPage';\nimport DiscussionListState from 'flarum/states/DiscussionListState';\nimport GlobalSearchState from 'flarum/states/GlobalSearchState';\n\nimport TagHero from './components/TagHero';\n\nexport default function() {\n IndexPage.prototype.currentTag = function() {\n const slug = app.search.params().tags;\n\n if (slug) return app.store.getBy('tags', 'slug', slug);\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 = this.currentTag();\n\n if (tag) return ;\n\n return original();\n });\n\n extend(IndexPage.prototype, 'view', function(vdom) {\n const tag = this.currentTag();\n\n if (tag) vdom.attrs.className += ' IndexPage--tag'+tag.id();\n });\n\n extend(IndexPage.prototype, 'setTitle', function() {\n const tag = this.currentTag();\n\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(IndexPage.prototype, 'sidebarItems', function(items) {\n const tag = this.currentTag();\n\n if (tag) {\n const color = tag.color();\n const canStartDiscussion = tag.canStartDiscussion() || !app.session.user;\n\n if (color) {\n items.get('newDiscussion').attrs.style = {backgroundColor: color};\n }\n\n items.get('newDiscussion').attrs.disabled = !canStartDiscussion;\n items.get('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 params.include.push('tags');\n\n if (this.params.tags) {\n params.filter.q = (params.filter.q || '') + ' tag:' + this.params.tags;\n }\n });\n}\n","import { extend } from 'flarum/extend';\nimport DiscussionListItem from 'flarum/components/DiscussionListItem';\nimport DiscussionHero from 'flarum/components/DiscussionHero';\n\nimport tagsLabel from '../common/helpers/tagsLabel';\nimport sortTags from '../common/utils/sortTags';\n\nexport default function() {\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\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\n if (tags && tags.length) {\n const color = tags[0].color();\n if (color) {\n view.attrs.style = {backgroundColor: color};\n view.attrs.className += ' DiscussionHero--colored';\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\n if (tags && tags.length) {\n items.add('tags', tagsLabel(tags, {link: true}), 5);\n }\n });\n}\n","import Modal from 'flarum/components/Modal';\nimport DiscussionPage from 'flarum/components/DiscussionPage';\nimport Button from 'flarum/components/Button';\nimport highlight from 'flarum/helpers/highlight';\nimport classList from 'flarum/utils/classList';\nimport extractText from 'flarum/utils/extractText';\nimport KeyboardNavigatable from 'flarum/utils/KeyboardNavigatable';\nimport Stream from 'flarum/utils/Stream';\n\nimport tagLabel from '../../common/helpers/tagLabel';\nimport tagIcon from '../../common/helpers/tagIcon';\nimport sortTags from '../../common/utils/sortTags';\n\nexport default class TagDiscussionModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.tags = app.store.all('tags');\n\n if (this.attrs.discussion) {\n this.tags = this.tags.filter(tag => tag.canAddToDiscussion() || this.attrs.discussion.tags().indexOf(tag) !== -1);\n } else {\n this.tags = this.tags.filter(tag => tag.canStartDiscussion());\n }\n\n this.tags = sortTags(this.tags);\n\n this.selected = [];\n this.filter = Stream('');\n this.index = this.tags[0].id();\n this.focused = false;\n\n if (this.attrs.selectedTags) {\n this.attrs.selectedTags.map(this.addTag.bind(this));\n } else if (this.attrs.discussion) {\n this.attrs.discussion.tags().map(this.addTag.bind(this));\n }\n\n this.minPrimary = app.forum.attribute('minPrimaryTags');\n this.maxPrimary = app.forum.attribute('maxPrimaryTags');\n this.minSecondary = app.forum.attribute('minSecondaryTags');\n this.maxSecondary = app.forum.attribute('maxSecondaryTags');\n\n this.navigator = new KeyboardNavigatable();\n this.navigator\n .onUp(() => this.setIndex(this.getCurrentNumericIndex() - 1, true))\n .onDown(() => this.setIndex(this.getCurrentNumericIndex() + 1, true))\n .onSelect(this.select.bind(this))\n .onRemove(() => this.selected.splice(this.selected.length - 1, 1));\n }\n\n primaryCount() {\n return this.selected.filter(tag => tag.isPrimary()).length;\n }\n\n secondaryCount() {\n return this.selected.filter(tag => !tag.isPrimary()).length;\n }\n\n /**\n * Add the given tag to the list of selected tags.\n *\n * @param {Tag} tag\n */\n addTag(tag) {\n if (!tag.canStartDiscussion()) return;\n\n // If this tag has a parent, we'll also need to add the parent tag to the\n // selected list if it's not already in there.\n const parent = tag.parent();\n if (parent && this.selected.indexOf(parent) === -1) {\n this.selected.push(parent);\n }\n\n if (this.selected.indexOf(tag) === -1) {\n this.selected.push(tag);\n }\n }\n\n /**\n * Remove the given tag from the list of selected tags.\n *\n * @param {Tag} tag\n */\n removeTag(tag) {\n const index = this.selected.indexOf(tag);\n if (index !== -1) {\n this.selected.splice(index, 1);\n\n // Look through the list of selected tags for any tags which have the tag\n // we just removed as their parent. We'll need to remove them too.\n this.selected\n .filter(selected => selected.parent() === tag)\n .forEach(this.removeTag.bind(this));\n }\n }\n\n className() {\n return 'TagDiscussionModal';\n }\n\n title() {\n return this.attrs.discussion\n ? app.translator.trans('flarum-tags.forum.choose_tags.edit_title', {title: {this.attrs.discussion.title()}})\n : app.translator.trans('flarum-tags.forum.choose_tags.title');\n }\n\n getInstruction(primaryCount, secondaryCount) {\n if (primaryCount < this.minPrimary) {\n const remaining = this.minPrimary - primaryCount;\n return app.translator.transChoice('flarum-tags.forum.choose_tags.choose_primary_placeholder', remaining, {count: remaining});\n } else if (secondaryCount < this.minSecondary) {\n const remaining = this.minSecondary - secondaryCount;\n return app.translator.transChoice('flarum-tags.forum.choose_tags.choose_secondary_placeholder', remaining, {count: remaining});\n }\n\n return '';\n }\n\n content() {\n let tags = this.tags;\n const filter = this.filter().toLowerCase();\n const primaryCount = this.primaryCount();\n const secondaryCount = this.secondaryCount();\n\n // Filter out all child tags whose parents have not been selected. This\n // makes it impossible to select a child if its parent hasn't been selected.\n tags = tags.filter(tag => {\n const parent = tag.parent();\n return parent === false || this.selected.indexOf(parent) !== -1;\n });\n\n // If the number of selected primary/secondary tags is at the maximum, then\n // we'll filter out all other tags of that type.\n if (primaryCount >= this.maxPrimary) {\n tags = tags.filter(tag => !tag.isPrimary() || this.selected.indexOf(tag) !== -1);\n }\n\n if (secondaryCount >= this.maxSecondary) {\n tags = tags.filter(tag => tag.isPrimary() || this.selected.indexOf(tag) !== -1);\n }\n\n // If the user has entered text in the filter input, then filter by tags\n // whose name matches what they've entered.\n if (filter) {\n tags = tags.filter(tag => tag.name().substr(0, filter.length).toLowerCase() === filter);\n }\n\n if (tags.indexOf(this.index) === -1) this.index = tags[0];\n\n const inputWidth = Math.max(extractText(this.getInstruction(primaryCount, secondaryCount)).length, this.filter().length);\n\n return [\n
\n
\n
\n
this.$('.TagsInput input').focus()}\n >\n \n {this.selected.map(tag =>\n {\n this.removeTag(tag);\n this.onready();\n }}>\n {tagLabel(tag)}\n \n )}\n \n this.focused = true}\n onblur={() => this.focused = false}/>\n
\n
\n
\n \n
\n
\n
,\n\n
\n
    \n {tags\n .filter(tag => filter || !tag.parent() || this.selected.indexOf(tag.parent()) !== -1)\n .map(tag => (\n
  • this.index = tag}\n onclick={this.toggleTag.bind(this, tag)}\n >\n {tagIcon(tag)}\n \n {highlight(tag.name(), filter)}\n \n {tag.description()\n ? (\n \n {tag.description()}\n \n ) : ''}\n
  • \n ))}\n
\n
\n ];\n }\n\n meetsRequirements(primaryCount, secondaryCount) {\n if (app.forum.attribute('canBypassTagCounts')) {\n return true;\n }\n\n return primaryCount >= this.minPrimary && secondaryCount >= this.minSecondary;\n }\n\n toggleTag(tag) {\n const index = this.selected.indexOf(tag);\n\n if (index !== -1) {\n this.removeTag(tag);\n } else {\n this.addTag(tag);\n }\n\n if (this.filter()) {\n this.filter('');\n this.index = this.tags[0];\n }\n\n this.onready();\n }\n\n select(e) {\n // Ctrl + Enter submits the selection, just Enter completes the current entry\n if (e.metaKey || e.ctrlKey || this.selected.indexOf(this.index) !== -1) {\n if (this.selected.length) {\n // The DOM submit method doesn't emit a `submit event, so we\n // simulate a manual submission so our `onsubmit` logic is run.\n this.$('button[type=\"submit\"]').click();\n }\n } else {\n this.getItem(this.index)[0].dispatchEvent(new Event('click'));\n }\n }\n\n selectableItems() {\n return this.$('.TagDiscussionModal-list > li');\n }\n\n getCurrentNumericIndex() {\n return this.selectableItems().index(\n this.getItem(this.index)\n );\n }\n\n getItem(index) {\n return this.selectableItems().filter(`[data-index=\"${index.id()}\"]`);\n }\n\n setIndex(index, scrollToItem) {\n const $items = this.selectableItems();\n const $dropdown = $items.parent();\n\n if (index < 0) {\n index = $items.length - 1;\n } else if (index >= $items.length) {\n index = 0;\n }\n\n const $item = $items.eq(index);\n\n this.index = app.store.getById('tags', $item.attr('data-index'));\n\n m.redraw();\n\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\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\n if (typeof scrollTop !== 'undefined') {\n $dropdown.stop(true).animate({scrollTop}, 100);\n }\n }\n }\n\n onsubmit(e) {\n e.preventDefault();\n\n const discussion = this.attrs.discussion;\n const tags = this.selected;\n\n if (discussion) {\n discussion.save({relationships: {tags}})\n .then(() => {\n if (app.current.matches(DiscussionPage)) {\n app.current.get('stream').update();\n }\n m.redraw();\n });\n }\n\n if (this.attrs.onsubmit) this.attrs.onsubmit(tags);\n\n this.hide();\n }\n}\n","import { extend } from 'flarum/extend';\nimport DiscussionControls from 'flarum/utils/DiscussionControls';\nimport Button from 'flarum/components/Button';\n\nimport TagDiscussionModal from './components/TagDiscussionModal';\n\nexport default function() {\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', );\n }\n });\n}\n","import { extend, override } from 'flarum/extend';\nimport IndexPage from 'flarum/components/IndexPage';\nimport DiscussionComposer from 'flarum/components/DiscussionComposer';\n\nimport TagDiscussionModal from './components/TagDiscussionModal';\nimport tagsLabel from '../common/helpers/tagsLabel';\n\nexport default function () {\n extend(IndexPage.prototype, 'newDiscussionAction', function (promise) {\n const tag = app.store.getBy('tags', 'slug', app.search.params().tags);\n\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\n // Add tag-selection abilities to the discussion composer.\n DiscussionComposer.prototype.chooseTags = function () {\n app.modal.show(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 // Add a tag-selection menu to the discussion composer's header, after the\n // title.\n extend(DiscussionComposer.prototype, 'headerItems', function (items) {\n const tags = this.composer.fields.tags || [];\n\n items.add('tags', (\n \n {tags.length\n ? tagsLabel(tags)\n : {app.translator.trans('flarum-tags.forum.composer_discussion.choose_tags_link')}}\n \n ), 10);\n });\n\n override(DiscussionComposer.prototype, '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 if (!chosenTags.length\n || (chosenPrimaryTags.length < app.forum.attribute('minPrimaryTags'))\n || (chosenSecondaryTags.length < app.forum.attribute('minSecondaryTags'))) {\n app.modal.show(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(DiscussionComposer.prototype, 'data', function (data) {\n data.relationships = data.relationships || {};\n data.relationships.tags = this.composer.fields.tags;\n });\n}\n","import compat from '../common/compat';\n\nimport addTagFilter from './addTagFilter';\nimport addTagControl from './addTagControl';\nimport TagHero from './components/TagHero';\nimport TagDiscussionModal from './components/TagDiscussionModal';\nimport TagsPage from './components/TagsPage';\nimport DiscussionTaggedPost from './components/DiscussionTaggedPost';\nimport TagLinkButton from './components/TagLinkButton';\nimport addTagList from './addTagList';\nimport addTagLabels from './addTagLabels';\nimport addTagComposer from './addTagComposer';\n\nexport default Object.assign(compat, {\n 'tags/addTagFilter': addTagFilter,\n 'tags/addTagControl': addTagControl,\n 'tags/components/TagHero': TagHero,\n 'tags/components/TagDiscussionModal': TagDiscussionModal,\n 'tags/components/TagsPage': TagsPage,\n 'tags/components/DiscussionTaggedPost': DiscussionTaggedPost,\n 'tags/components/TagLinkButton': TagLinkButton,\n 'tags/addTagList': addTagList,\n 'tags/addTagLabels': addTagLabels,\n 'tags/addTagComposer': addTagComposer,\n});\n","import Model from 'flarum/Model';\nimport Discussion from 'flarum/models/Discussion';\nimport IndexPage from 'flarum/components/IndexPage';\n\nimport Tag from '../common/models/Tag';\nimport TagsPage from './components/TagsPage';\nimport DiscussionTaggedPost from './components/DiscussionTaggedPost';\n\nimport addTagList from './addTagList';\nimport addTagFilter from './addTagFilter';\nimport addTagLabels from './addTagLabels';\nimport addTagControl from './addTagControl';\nimport addTagComposer from './addTagComposer';\n\napp.initializers.add('flarum-tags', function(app) {\n app.routes.tags = {path: '/tags', component: TagsPage };\n app.routes.tag = {path: '/t/:tags', component: IndexPage };\n\n app.route.tag = tag => app.route('tag', {tags: tag.slug()});\n\n app.postComponents.discussionTagged = DiscussionTaggedPost;\n\n app.store.models.tags = Tag;\n\n Discussion.prototype.tags = Model.hasMany('tags');\n Discussion.prototype.canTag = Model.attribute('canTag');\n\n addTagList();\n addTagFilter();\n addTagLabels();\n addTagControl();\n addTagComposer();\n});\n\n\n// Expose compat API\nimport tagsCompat from './compat';\nimport { compat } from '@flarum/core/forum';\n\nObject.assign(compat, tagsCompat);\n","module.exports = flarum.core.compat['components/Page'];","module.exports = flarum.core.compat['helpers/listItems'];","module.exports = flarum.core.compat['helpers/humanTime'];","module.exports = flarum.core.compat['components/EventPost'];","module.exports = flarum.core.compat['components/Separator'];","module.exports = flarum.core.compat['states/DiscussionListState'];","module.exports = flarum.core.compat['states/GlobalSearchState'];","module.exports = flarum.core.compat['Component'];","module.exports = flarum.core.compat['components/DiscussionListItem'];","module.exports = flarum.core.compat['utils/DiscussionControls'];","module.exports = flarum.core.compat['components/DiscussionPage'];","module.exports = flarum.core.compat['helpers/highlight'];","module.exports = flarum.core.compat['utils/KeyboardNavigatable'];","/*\n * This file is part of Flarum.\n *\n * (c) Toby Zerner \n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nexport * from './src/common';\nexport * from './src/forum';\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://@flarum/tags/webpack/bootstrap","webpack://@flarum/tags/external \"flarum.core.compat['Model']\"","webpack://@flarum/tags/external \"flarum.core.compat['extend']\"","webpack://@flarum/tags/./src/common/utils/sortTags.js","webpack://@flarum/tags/./src/common/helpers/tagIcon.js","webpack://@flarum/tags/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@flarum/tags/./src/common/helpers/tagLabel.js","webpack://@flarum/tags/external \"flarum.core.compat['components/IndexPage']\"","webpack://@flarum/tags/./src/common/helpers/tagsLabel.js","webpack://@flarum/tags/external \"flarum.core.compat['components/Button']\"","webpack://@flarum/tags/external \"flarum.core.compat['components/Link']\"","webpack://@flarum/tags/external \"flarum.core.compat['utils/Stream']\"","webpack://@flarum/tags/./node_modules/@babel/runtime/helpers/esm/extends.js","webpack://@flarum/tags/./src/common/models/Tag.js","webpack://@flarum/tags/external \"flarum.core.compat['utils/classList']\"","webpack://@flarum/tags/external \"flarum.core.compat['utils/extract']\"","webpack://@flarum/tags/external \"flarum.core.compat['utils/mixin']\"","webpack://@flarum/tags/external \"flarum.core.compat['utils/computed']\"","webpack://@flarum/tags/external \"flarum.core.compat['components/Modal']\"","webpack://@flarum/tags/./src/common/compat.js","webpack://@flarum/tags/external \"flarum.core\"","webpack://@flarum/tags/external \"flarum.core.compat['components/LinkButton']\"","webpack://@flarum/tags/external \"flarum.core.compat['components/DiscussionComposer']\"","webpack://@flarum/tags/external \"flarum.core.compat['models/Discussion']\"","webpack://@flarum/tags/external \"flarum.core.compat['components/DiscussionHero']\"","webpack://@flarum/tags/external \"flarum.core.compat['utils/extractText']\"","webpack://@flarum/tags/./src/forum/components/TagsPage.js","webpack://@flarum/tags/./src/forum/components/DiscussionTaggedPost.js","webpack://@flarum/tags/./src/forum/components/TagLinkButton.js","webpack://@flarum/tags/./src/forum/addTagList.js","webpack://@flarum/tags/./src/forum/components/TagHero.js","webpack://@flarum/tags/./src/forum/addTagFilter.js","webpack://@flarum/tags/./src/forum/addTagLabels.js","webpack://@flarum/tags/./src/forum/components/TagDiscussionModal.js","webpack://@flarum/tags/./src/forum/addTagControl.js","webpack://@flarum/tags/./src/forum/addTagComposer.js","webpack://@flarum/tags/./src/forum/compat.js","webpack://@flarum/tags/./src/forum/index.js","webpack://@flarum/tags/external \"flarum.core.compat['components/Page']\"","webpack://@flarum/tags/external \"flarum.core.compat['helpers/listItems']\"","webpack://@flarum/tags/external \"flarum.core.compat['helpers/humanTime']\"","webpack://@flarum/tags/external \"flarum.core.compat['components/EventPost']\"","webpack://@flarum/tags/external \"flarum.core.compat['components/Separator']\"","webpack://@flarum/tags/external \"flarum.core.compat['states/DiscussionListState']\"","webpack://@flarum/tags/external \"flarum.core.compat['states/GlobalSearchState']\"","webpack://@flarum/tags/external \"flarum.core.compat['Component']\"","webpack://@flarum/tags/external \"flarum.core.compat['components/DiscussionListItem']\"","webpack://@flarum/tags/external \"flarum.core.compat['utils/DiscussionControls']\"","webpack://@flarum/tags/external \"flarum.core.compat['components/DiscussionPage']\"","webpack://@flarum/tags/external \"flarum.core.compat['helpers/highlight']\"","webpack://@flarum/tags/external \"flarum.core.compat['utils/KeyboardNavigatable']\"","webpack://@flarum/tags/./forum.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","flarum","core","compat","sortTags","tags","slice","sort","a","b","aPos","position","bPos","discussionCount","aParent","parent","bParent","tagIcon","tag","attrs","settings","hasIcon","icon","useColor","className","classList","style","color","backgroundColor","_inheritsLoose","subClass","superClass","constructor","__proto__","tagLabel","link","extract","tagText","app","translator","trans","title","description","href","route","slug","isChild","Link","tagsLabel","children","forEach","length","push","_extends","assign","target","arguments","source","apply","this","Tag","mixin","Model","attribute","backgroundUrl","backgroundMode","hasOne","defaultSort","isHidden","lastPostedAt","transformDate","lastPostedDiscussion","isRestricted","canStartDiscussion","canAddToDiscussion","isPrimary","computed","TagsPage","oninit","vnode","store","all","filter","history","view","pinned","cloud","IndexPage","hero","listItems","sidebarItems","toArray","map","child","discussion","lastPostNumber","humanTime","oncreate","setTitle","setTitleCount","Page","DiscussionTaggedPost","initAttrs","oldTags","post","content","newTags","diffTags","tags1","tags2","indexOf","id","getById","tagsAdded","tagsRemoved","descriptionKey","descriptionData","data","transChoice","count","EventPost","TagLinkButton","model","active","isActive","params","LinkButton","extend","items","add","current","matches","Separator","component","search","stickyParams","currentTag","addTag","more","splice","TagHero","Component","getBy","override","original","vdom","session","user","disabled","GlobalSearchState","param","DiscussionListState","include","q","DiscussionListItem","DiscussionHero","TagDiscussionModal","selected","Stream","index","focused","selectedTags","minPrimary","forum","maxPrimary","minSecondary","maxSecondary","navigator","KeyboardNavigatable","onUp","setIndex","getCurrentNumericIndex","onDown","onSelect","select","onRemove","primaryCount","secondaryCount","removeTag","getInstruction","remaining","toLowerCase","substr","inputWidth","Math","max","extractText","onclick","$","focus","onready","placeholder","bidi","width","onkeydown","navigate","onfocus","onblur","type","meetsRequirements","data-index","colored","onmouseover","toggleTag","highlight","e","metaKey","ctrlKey","click","getItem","dispatchEvent","Event","selectableItems","scrollToItem","$items","$dropdown","$item","eq","attr","redraw","scrollTop","dropdownScroll","dropdownTop","offset","top","dropdownBottom","outerHeight","itemTop","itemBottom","parseInt","css","stop","animate","onsubmit","preventDefault","save","relationships","then","DiscussionPage","update","hide","Modal","DiscussionControls","canTag","modal","show","promise","composer","fields","DiscussionComposer","chooseTags","chosenTags","chosenPrimaryTags","chosenSecondaryTags","addTagFilter","addTagControl","addTagList","addTagLabels","addTagComposer","initializers","routes","path","postComponents","discussionTagged","models","Discussion","hasMany","tagsCompat"],"mappings":"2BACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QA0Df,OArDAF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ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,EAAOD,QAAUkC,OAAOC,KAAKC,OAAO,6B,cCApCnC,EAAOD,QAAUkC,OAAOC,KAAKC,OAAO,8B,cCApCnC,EAAOD,QAAUkC,OAAOC,KAAKC,OAAO,sB,cCApCnC,EAAOD,QAAUkC,OAAOC,KAAKC,OAAO,8B,oCCApC","file":"forum.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 50);\n","module.exports = flarum.core.compat['Model'];","module.exports = flarum.core.compat['extend'];","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)\n 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\n // If they are both child tags, then we will compare the positions of their\n // parents.\n else if (aParent && bParent)\n return aParent.position() - bParent.position();\n\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)\n return aParent === b ? 1 : aParent.position() - bPos;\n\n else if (bParent)\n return bParent === a ? -1 : aPos - bParent.position();\n\n return 0;\n });\n}\n","import classList from 'flarum/utils/classList';\n\nexport default function tagIcon(tag, attrs = {}, settings = {}) {\n const hasIcon = tag && tag.icon();\n const { useColor = true } = settings;\n\n attrs.className = classList([\n attrs.className,\n 'icon',\n hasIcon ? tag.icon() : 'TagIcon'\n ]);\n\n if (tag) {\n attrs.style = attrs.style || {};\n\n if (hasIcon) {\n attrs.style.color = useColor ? tag.color() : '';\n } else {\n attrs.style.backgroundColor = tag.color();\n }\n\n } else {\n attrs.className += ' untagged';\n }\n\n return hasIcon ? : ;\n}\n","export default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}","import extract from 'flarum/utils/extract';\nimport Link from 'flarum/components/Link';\nimport tagIcon from './tagIcon';\n\nexport default function tagLabel(tag, attrs = {}) {\n attrs.style = attrs.style || {};\n attrs.className = 'TagLabel ' + (attrs.className || '');\n\n const link = extract(attrs, 'link');\n const tagText = tag ? tag.name() : app.translator.trans('flarum-tags.lib.deleted_tag_text');\n\n if (tag) {\n const color = tag.color();\n if (color) {\n attrs.style.backgroundColor = attrs.style.color = color;\n attrs.className += ' colored';\n }\n\n if (link) {\n attrs.title = tag.description() || '';\n attrs.href = app.route('tag', {tags: tag.slug()});\n }\n\n if (tag.isChild()) {\n attrs.className += ' TagLabel--child';\n }\n } else {\n attrs.className += ' untagged';\n }\n\n return (\n m((link ? Link : 'span'), attrs,\n \n {tag && tag.icon() && tagIcon(tag, {}, {useColor: false})} {tagText}\n \n )\n );\n}\n","module.exports = flarum.core.compat['components/IndexPage'];","import extract from 'flarum/utils/extract';\nimport tagLabel from './tagLabel';\nimport sortTags from '../utils/sortTags';\n\nexport default function tagsLabel(tags, attrs = {}) {\n const children = [];\n const link = extract(attrs, 'link');\n\n attrs.className = 'TagsLabel ' + (attrs.className || '');\n\n if (tags) {\n sortTags(tags).forEach(tag => {\n if (tag || tags.length === 1) {\n children.push(tagLabel(tag, {link}));\n }\n });\n } else {\n children.push(tagLabel());\n }\n\n return {children};\n}\n","module.exports = flarum.core.compat['components/Button'];","module.exports = flarum.core.compat['components/Link'];","module.exports = flarum.core.compat['utils/Stream'];","export default function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}","import Model from 'flarum/Model';\nimport mixin from 'flarum/utils/mixin';\nimport computed from 'flarum/utils/computed';\n\nexport default class Tag extends mixin(Model, {\n name: Model.attribute('name'),\n slug: Model.attribute('slug'),\n description: Model.attribute('description'),\n\n color: Model.attribute('color'),\n backgroundUrl: Model.attribute('backgroundUrl'),\n backgroundMode: Model.attribute('backgroundMode'),\n icon: Model.attribute('icon'),\n\n position: Model.attribute('position'),\n parent: Model.hasOne('parent'),\n defaultSort: Model.attribute('defaultSort'),\n isChild: Model.attribute('isChild'),\n isHidden: Model.attribute('isHidden'),\n\n discussionCount: Model.attribute('discussionCount'),\n lastPostedAt: Model.attribute('lastPostedAt', Model.transformDate),\n lastPostedDiscussion: Model.hasOne('lastPostedDiscussion'),\n\n isRestricted: Model.attribute('isRestricted'),\n canStartDiscussion: Model.attribute('canStartDiscussion'),\n canAddToDiscussion: Model.attribute('canAddToDiscussion'),\n\n isPrimary: computed('position', 'parent', (position, parent) => position !== null && parent === false)\n}) {}\n","module.exports = flarum.core.compat['utils/classList'];","module.exports = flarum.core.compat['utils/extract'];","module.exports = flarum.core.compat['utils/mixin'];","module.exports = flarum.core.compat['utils/computed'];","module.exports = flarum.core.compat['components/Modal'];","import sortTags from './utils/sortTags';\nimport Tag from './models/Tag';\nimport tagsLabel from './helpers/tagsLabel';\nimport tagIcon from './helpers/tagIcon';\nimport tagLabel from './helpers/tagLabel';\n\nexport default {\n 'tags/utils/sortTags': sortTags,\n 'tags/models/Tag': Tag,\n 'tags/helpers/tagsLabel': tagsLabel,\n 'tags/helpers/tagIcon': tagIcon,\n 'tags/helpers/tagLabel': tagLabel\n};\n","module.exports = flarum.core;","module.exports = flarum.core.compat['components/LinkButton'];","module.exports = flarum.core.compat['components/DiscussionComposer'];","module.exports = flarum.core.compat['models/Discussion'];","module.exports = flarum.core.compat['components/DiscussionHero'];","module.exports = flarum.core.compat['utils/extractText'];","import Page from 'flarum/components/Page';\nimport IndexPage from 'flarum/components/IndexPage';\nimport Link from 'flarum/components/Link';\nimport listItems from 'flarum/helpers/listItems';\nimport humanTime from 'flarum/helpers/humanTime';\n\nimport tagIcon from '../../common/helpers/tagIcon';\nimport tagLabel from '../../common/helpers/tagLabel';\nimport sortTags from '../../common/utils/sortTags';\n\nexport default class TagsPage extends Page {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.tags = sortTags(app.store.all('tags').filter(tag => !tag.parent()));\n\n app.history.push('tags', app.translator.trans('flarum-tags.forum.header.back_to_tags_tooltip'));\n }\n\n view() {\n const pinned = this.tags.filter(tag => tag.position() !== null);\n const cloud = this.tags.filter(tag => tag.position() === null);\n\n return (\n
\n {IndexPage.prototype.hero()}\n
\n \n\n
\n
    \n {pinned.map(tag => {\n const lastPostedDiscussion = tag.lastPostedDiscussion();\n const children = sortTags(app.store.all('tags').filter(child => child.parent() === tag));\n\n return (\n
  • \n \n {tag.icon() && tagIcon(tag, {}, { useColor: false })}\n

    {tag.name()}

    \n

    {tag.description()}

    \n {children\n ? (\n
    \n {children.map(child => [\n \n {child.name()}\n ,\n ' '\n ])}\n
    \n ) : ''}\n \n {lastPostedDiscussion\n ? (\n \n {lastPostedDiscussion.title()}\n {humanTime(lastPostedDiscussion.lastPostedAt())}\n \n ) : (\n \n )}\n
  • \n );\n })}\n
\n\n {cloud.length ? (\n
\n {cloud.map(tag => [\n tagLabel(tag, {link: true}),\n ' ',\n ])}\n
\n ) : ''}\n
\n
\n
\n );\n }\n\n oncreate(vnode) {\n super.oncreate(vnode);\n\n app.setTitle(app.translator.trans('flarum-tags.forum.all_tags.meta_title_text'));\n app.setTitleCount(0);\n }\n}\n","import EventPost from 'flarum/components/EventPost';\nimport tagsLabel from '../../common/helpers/tagsLabel';\n\nexport default class DiscussionTaggedPost extends EventPost {\n static initAttrs(attrs) {\n super.initAttrs(attrs);\n\n const oldTags = attrs.post.content()[0];\n const newTags = attrs.post.content()[1];\n\n function diffTags(tags1, tags2) {\n return tags1\n .filter(tag => tags2.indexOf(tag) === -1)\n .map(id => app.store.getById('tags', id));\n }\n\n attrs.tagsAdded = diffTags(newTags, oldTags);\n attrs.tagsRemoved = diffTags(oldTags, newTags);\n }\n\n icon() {\n return 'fas fa-tag';\n }\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\n return 'flarum-tags.forum.post_stream.added_tags_text';\n }\n\n return 'flarum-tags.forum.post_stream.removed_tags_text';\n }\n\n descriptionData() {\n const data = {};\n\n if (this.attrs.tagsAdded.length) {\n data.tagsAdded = app.translator.transChoice('flarum-tags.forum.post_stream.tags_text', this.attrs.tagsAdded.length, {\n tags: tagsLabel(this.attrs.tagsAdded, {link: true}),\n count: this.attrs.tagsAdded.length\n });\n }\n\n if (this.attrs.tagsRemoved.length) {\n data.tagsRemoved = app.translator.transChoice('flarum-tags.forum.post_stream.tags_text', this.attrs.tagsRemoved.length, {\n tags: tagsLabel(this.attrs.tagsRemoved, {link: true}),\n count: this.attrs.tagsRemoved.length\n });\n }\n\n return data;\n }\n}\n","import Link from 'flarum/components/Link';\nimport LinkButton from 'flarum/components/LinkButton';\nimport classList from 'flarum/utils/classList';\nimport tagIcon from '../../common/helpers/tagIcon';\n\nexport default class TagLinkButton extends LinkButton {\n view(vnode) {\n const tag = this.attrs.model;\n const active = this.constructor.isActive(this.attrs);\n const description = tag && tag.description();\n const className = classList([\n 'TagLinkButton',\n 'hasIcon',\n this.attrs.className,\n tag.isChild() && 'child',\n ]);\n\n return (\n \n {tagIcon(tag, {className: 'Button-icon'})}\n \n {tag ? tag.name() : app.translator.trans('flarum-tags.forum.index.untagged_link')}\n \n \n );\n }\n\n static initAttrs(attrs) {\n super.initAttrs(attrs);\n\n const tag = attrs.model;\n\n attrs.params.tags = tag ? tag.slug() : 'untagged';\n attrs.route = app.route('tag', attrs.params);\n }\n}\n","import { extend } from 'flarum/extend';\nimport IndexPage from 'flarum/components/IndexPage';\nimport Separator from 'flarum/components/Separator';\nimport LinkButton from 'flarum/components/LinkButton';\n\nimport TagLinkButton from './components/TagLinkButton';\nimport TagsPage from './components/TagsPage';\nimport sortTags from '../common/utils/sortTags';\n\nexport default function() {\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(IndexPage.prototype, 'navItems', function (items) {\n items.add('tags', \n {app.translator.trans('flarum-tags.forum.index.tags_link')}\n \n , -10);\n\n if (app.current.matches(TagsPage)) return;\n\n items.add('separator', Separator.component(), -12);\n\n const params = app.search.stickyParams();\n const tags = app.store.all('tags');\n const currentTag = this.currentTag();\n\n const addTag = tag => {\n let active = currentTag === tag;\n\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(), TagLinkButton.component({model: tag, params, active}, tag?.name()), -14);\n };\n\n sortTags(tags)\n .filter(tag => tag.position() !== null && (!tag.isChild() || (currentTag && (tag.parent() === currentTag || tag.parent() === currentTag.parent()))))\n .forEach(addTag);\n\n const more = tags\n .filter(tag => tag.position() === null)\n .sort((a, b) => b.discussionCount() - a.discussionCount());\n\n more.splice(0, 3).forEach(addTag);\n\n if (more.length) {\n items.add('moreTags', \n {app.translator.trans('flarum-tags.forum.index.more_link')}\n , -16)\n }\n });\n}\n","import Component from 'flarum/Component';\nimport tagIcon from '../../common/helpers/tagIcon';\n\nexport default class TagHero extends Component {\n view() {\n const tag = this.attrs.model;\n const color = tag.color();\n\n return (\n
\n
\n
\n

{tag.icon() && tagIcon(tag, {}, { useColor: false })} {tag.name()}

\n
{tag.description()}
\n
\n
\n
\n );\n }\n}\n","import { extend, override } from 'flarum/extend';\nimport IndexPage from 'flarum/components/IndexPage';\nimport DiscussionListState from 'flarum/states/DiscussionListState';\nimport GlobalSearchState from 'flarum/states/GlobalSearchState';\n\nimport TagHero from './components/TagHero';\n\nexport default function() {\n IndexPage.prototype.currentTag = function() {\n const slug = app.search.params().tags;\n\n if (slug) return app.store.getBy('tags', 'slug', slug);\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 = this.currentTag();\n\n if (tag) return ;\n\n return original();\n });\n\n extend(IndexPage.prototype, 'view', function(vdom) {\n const tag = this.currentTag();\n\n if (tag) vdom.attrs.className += ' IndexPage--tag'+tag.id();\n });\n\n extend(IndexPage.prototype, 'setTitle', function() {\n const tag = this.currentTag();\n\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(IndexPage.prototype, 'sidebarItems', function(items) {\n const tag = this.currentTag();\n\n if (tag) {\n const color = tag.color();\n const canStartDiscussion = tag.canStartDiscussion() || !app.session.user;\n\n if (color) {\n items.get('newDiscussion').attrs.style = {backgroundColor: color};\n }\n\n items.get('newDiscussion').attrs.disabled = !canStartDiscussion;\n items.get('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 params.include.push('tags');\n\n if (this.params.tags) {\n params.filter.q = (params.filter.q || '') + ' tag:' + this.params.tags;\n }\n });\n}\n","import { extend } from 'flarum/extend';\nimport DiscussionListItem from 'flarum/components/DiscussionListItem';\nimport DiscussionHero from 'flarum/components/DiscussionHero';\n\nimport tagsLabel from '../common/helpers/tagsLabel';\nimport sortTags from '../common/utils/sortTags';\n\nexport default function() {\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\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\n if (tags && tags.length) {\n const color = tags[0].color();\n if (color) {\n view.attrs.style = {backgroundColor: color};\n view.attrs.className += ' DiscussionHero--colored';\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\n if (tags && tags.length) {\n items.add('tags', tagsLabel(tags, {link: true}), 5);\n }\n });\n}\n","import Modal from 'flarum/components/Modal';\nimport DiscussionPage from 'flarum/components/DiscussionPage';\nimport Button from 'flarum/components/Button';\nimport highlight from 'flarum/helpers/highlight';\nimport classList from 'flarum/utils/classList';\nimport extractText from 'flarum/utils/extractText';\nimport KeyboardNavigatable from 'flarum/utils/KeyboardNavigatable';\nimport Stream from 'flarum/utils/Stream';\n\nimport tagLabel from '../../common/helpers/tagLabel';\nimport tagIcon from '../../common/helpers/tagIcon';\nimport sortTags from '../../common/utils/sortTags';\n\nexport default class TagDiscussionModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.tags = app.store.all('tags');\n\n if (this.attrs.discussion) {\n this.tags = this.tags.filter(tag => tag.canAddToDiscussion() || this.attrs.discussion.tags().indexOf(tag) !== -1);\n } else {\n this.tags = this.tags.filter(tag => tag.canStartDiscussion());\n }\n\n this.tags = sortTags(this.tags);\n\n this.selected = [];\n this.filter = Stream('');\n this.index = this.tags[0].id();\n this.focused = false;\n\n if (this.attrs.selectedTags) {\n this.attrs.selectedTags.map(this.addTag.bind(this));\n } else if (this.attrs.discussion) {\n this.attrs.discussion.tags().map(this.addTag.bind(this));\n }\n\n this.minPrimary = app.forum.attribute('minPrimaryTags');\n this.maxPrimary = app.forum.attribute('maxPrimaryTags');\n this.minSecondary = app.forum.attribute('minSecondaryTags');\n this.maxSecondary = app.forum.attribute('maxSecondaryTags');\n\n this.navigator = new KeyboardNavigatable();\n this.navigator\n .onUp(() => this.setIndex(this.getCurrentNumericIndex() - 1, true))\n .onDown(() => this.setIndex(this.getCurrentNumericIndex() + 1, true))\n .onSelect(this.select.bind(this))\n .onRemove(() => this.selected.splice(this.selected.length - 1, 1));\n }\n\n primaryCount() {\n return this.selected.filter(tag => tag.isPrimary()).length;\n }\n\n secondaryCount() {\n return this.selected.filter(tag => !tag.isPrimary()).length;\n }\n\n /**\n * Add the given tag to the list of selected tags.\n *\n * @param {Tag} tag\n */\n addTag(tag) {\n if (!tag.canStartDiscussion()) return;\n\n // If this tag has a parent, we'll also need to add the parent tag to the\n // selected list if it's not already in there.\n const parent = tag.parent();\n if (parent && this.selected.indexOf(parent) === -1) {\n this.selected.push(parent);\n }\n\n if (this.selected.indexOf(tag) === -1) {\n this.selected.push(tag);\n }\n }\n\n /**\n * Remove the given tag from the list of selected tags.\n *\n * @param {Tag} tag\n */\n removeTag(tag) {\n const index = this.selected.indexOf(tag);\n if (index !== -1) {\n this.selected.splice(index, 1);\n\n // Look through the list of selected tags for any tags which have the tag\n // we just removed as their parent. We'll need to remove them too.\n this.selected\n .filter(selected => selected.parent() === tag)\n .forEach(this.removeTag.bind(this));\n }\n }\n\n className() {\n return 'TagDiscussionModal';\n }\n\n title() {\n return this.attrs.discussion\n ? app.translator.trans('flarum-tags.forum.choose_tags.edit_title', {title: {this.attrs.discussion.title()}})\n : app.translator.trans('flarum-tags.forum.choose_tags.title');\n }\n\n getInstruction(primaryCount, secondaryCount) {\n if (primaryCount < this.minPrimary) {\n const remaining = this.minPrimary - primaryCount;\n return app.translator.transChoice('flarum-tags.forum.choose_tags.choose_primary_placeholder', remaining, {count: remaining});\n } else if (secondaryCount < this.minSecondary) {\n const remaining = this.minSecondary - secondaryCount;\n return app.translator.transChoice('flarum-tags.forum.choose_tags.choose_secondary_placeholder', remaining, {count: remaining});\n }\n\n return '';\n }\n\n content() {\n let tags = this.tags;\n const filter = this.filter().toLowerCase();\n const primaryCount = this.primaryCount();\n const secondaryCount = this.secondaryCount();\n\n // Filter out all child tags whose parents have not been selected. This\n // makes it impossible to select a child if its parent hasn't been selected.\n tags = tags.filter(tag => {\n const parent = tag.parent();\n return parent === false || this.selected.indexOf(parent) !== -1;\n });\n\n // If the number of selected primary/secondary tags is at the maximum, then\n // we'll filter out all other tags of that type.\n if (primaryCount >= this.maxPrimary) {\n tags = tags.filter(tag => !tag.isPrimary() || this.selected.indexOf(tag) !== -1);\n }\n\n if (secondaryCount >= this.maxSecondary) {\n tags = tags.filter(tag => tag.isPrimary() || this.selected.indexOf(tag) !== -1);\n }\n\n // If the user has entered text in the filter input, then filter by tags\n // whose name matches what they've entered.\n if (filter) {\n tags = tags.filter(tag => tag.name().substr(0, filter.length).toLowerCase() === filter);\n }\n\n if (tags.indexOf(this.index) === -1) this.index = tags[0];\n\n const inputWidth = Math.max(extractText(this.getInstruction(primaryCount, secondaryCount)).length, this.filter().length);\n\n return [\n
\n
\n
\n
this.$('.TagsInput input').focus()}\n >\n \n {this.selected.map(tag =>\n {\n this.removeTag(tag);\n this.onready();\n }}>\n {tagLabel(tag)}\n \n )}\n \n this.focused = true}\n onblur={() => this.focused = false}/>\n
\n
\n
\n \n
\n
\n
,\n\n
\n
    \n {tags\n .filter(tag => filter || !tag.parent() || this.selected.indexOf(tag.parent()) !== -1)\n .map(tag => (\n
  • this.index = tag}\n onclick={this.toggleTag.bind(this, tag)}\n >\n {tagIcon(tag)}\n \n {highlight(tag.name(), filter)}\n \n {tag.description()\n ? (\n \n {tag.description()}\n \n ) : ''}\n
  • \n ))}\n
\n
\n ];\n }\n\n meetsRequirements(primaryCount, secondaryCount) {\n if (app.forum.attribute('canBypassTagCounts')) {\n return true;\n }\n\n return primaryCount >= this.minPrimary && secondaryCount >= this.minSecondary;\n }\n\n toggleTag(tag) {\n const index = this.selected.indexOf(tag);\n\n if (index !== -1) {\n this.removeTag(tag);\n } else {\n this.addTag(tag);\n }\n\n if (this.filter()) {\n this.filter('');\n this.index = this.tags[0];\n }\n\n this.onready();\n }\n\n select(e) {\n // Ctrl + Enter submits the selection, just Enter completes the current entry\n if (e.metaKey || e.ctrlKey || this.selected.indexOf(this.index) !== -1) {\n if (this.selected.length) {\n // The DOM submit method doesn't emit a `submit event, so we\n // simulate a manual submission so our `onsubmit` logic is run.\n this.$('button[type=\"submit\"]').click();\n }\n } else {\n this.getItem(this.index)[0].dispatchEvent(new Event('click'));\n }\n }\n\n selectableItems() {\n return this.$('.TagDiscussionModal-list > li');\n }\n\n getCurrentNumericIndex() {\n return this.selectableItems().index(\n this.getItem(this.index)\n );\n }\n\n getItem(index) {\n return this.selectableItems().filter(`[data-index=\"${index.id()}\"]`);\n }\n\n setIndex(index, scrollToItem) {\n const $items = this.selectableItems();\n const $dropdown = $items.parent();\n\n if (index < 0) {\n index = $items.length - 1;\n } else if (index >= $items.length) {\n index = 0;\n }\n\n const $item = $items.eq(index);\n\n this.index = app.store.getById('tags', $item.attr('data-index'));\n\n m.redraw();\n\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\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\n if (typeof scrollTop !== 'undefined') {\n $dropdown.stop(true).animate({scrollTop}, 100);\n }\n }\n }\n\n onsubmit(e) {\n e.preventDefault();\n\n const discussion = this.attrs.discussion;\n const tags = this.selected;\n\n if (discussion) {\n discussion.save({relationships: {tags}})\n .then(() => {\n if (app.current.matches(DiscussionPage)) {\n app.current.get('stream').update();\n }\n m.redraw();\n });\n }\n\n if (this.attrs.onsubmit) this.attrs.onsubmit(tags);\n\n this.hide();\n }\n}\n","import { extend } from 'flarum/extend';\nimport DiscussionControls from 'flarum/utils/DiscussionControls';\nimport Button from 'flarum/components/Button';\n\nimport TagDiscussionModal from './components/TagDiscussionModal';\n\nexport default function() {\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', );\n }\n });\n}\n","import { extend, override } from 'flarum/extend';\nimport IndexPage from 'flarum/components/IndexPage';\nimport DiscussionComposer from 'flarum/components/DiscussionComposer';\n\nimport TagDiscussionModal from './components/TagDiscussionModal';\nimport tagsLabel from '../common/helpers/tagsLabel';\n\nexport default function () {\n extend(IndexPage.prototype, 'newDiscussionAction', function (promise) {\n const tag = app.store.getBy('tags', 'slug', app.search.params().tags);\n\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\n // Add tag-selection abilities to the discussion composer.\n DiscussionComposer.prototype.chooseTags = function () {\n app.modal.show(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 // Add a tag-selection menu to the discussion composer's header, after the\n // title.\n extend(DiscussionComposer.prototype, 'headerItems', function (items) {\n const tags = this.composer.fields.tags || [];\n\n items.add('tags', (\n \n {tags.length\n ? tagsLabel(tags)\n : {app.translator.trans('flarum-tags.forum.composer_discussion.choose_tags_link')}}\n \n ), 10);\n });\n\n override(DiscussionComposer.prototype, '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 if (!chosenTags.length\n || (chosenPrimaryTags.length < app.forum.attribute('minPrimaryTags'))\n || (chosenSecondaryTags.length < app.forum.attribute('minSecondaryTags'))) {\n app.modal.show(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(DiscussionComposer.prototype, 'data', function (data) {\n data.relationships = data.relationships || {};\n data.relationships.tags = this.composer.fields.tags;\n });\n}\n","import compat from '../common/compat';\n\nimport addTagFilter from './addTagFilter';\nimport addTagControl from './addTagControl';\nimport TagHero from './components/TagHero';\nimport TagDiscussionModal from './components/TagDiscussionModal';\nimport TagsPage from './components/TagsPage';\nimport DiscussionTaggedPost from './components/DiscussionTaggedPost';\nimport TagLinkButton from './components/TagLinkButton';\nimport addTagList from './addTagList';\nimport addTagLabels from './addTagLabels';\nimport addTagComposer from './addTagComposer';\n\nexport default Object.assign(compat, {\n 'tags/addTagFilter': addTagFilter,\n 'tags/addTagControl': addTagControl,\n 'tags/components/TagHero': TagHero,\n 'tags/components/TagDiscussionModal': TagDiscussionModal,\n 'tags/components/TagsPage': TagsPage,\n 'tags/components/DiscussionTaggedPost': DiscussionTaggedPost,\n 'tags/components/TagLinkButton': TagLinkButton,\n 'tags/addTagList': addTagList,\n 'tags/addTagLabels': addTagLabels,\n 'tags/addTagComposer': addTagComposer,\n});\n","import Model from 'flarum/Model';\nimport Discussion from 'flarum/models/Discussion';\nimport IndexPage from 'flarum/components/IndexPage';\n\nimport Tag from '../common/models/Tag';\nimport TagsPage from './components/TagsPage';\nimport DiscussionTaggedPost from './components/DiscussionTaggedPost';\n\nimport addTagList from './addTagList';\nimport addTagFilter from './addTagFilter';\nimport addTagLabels from './addTagLabels';\nimport addTagControl from './addTagControl';\nimport addTagComposer from './addTagComposer';\n\napp.initializers.add('flarum-tags', function(app) {\n app.routes.tags = {path: '/tags', component: TagsPage };\n app.routes.tag = {path: '/t/:tags', component: IndexPage };\n\n app.route.tag = tag => app.route('tag', {tags: tag.slug()});\n\n app.postComponents.discussionTagged = DiscussionTaggedPost;\n\n app.store.models.tags = Tag;\n\n Discussion.prototype.tags = Model.hasMany('tags');\n Discussion.prototype.canTag = Model.attribute('canTag');\n\n addTagList();\n addTagFilter();\n addTagLabels();\n addTagControl();\n addTagComposer();\n});\n\n\n// Expose compat API\nimport tagsCompat from './compat';\nimport { compat } from '@flarum/core/forum';\n\nObject.assign(compat, tagsCompat);\n","module.exports = flarum.core.compat['components/Page'];","module.exports = flarum.core.compat['helpers/listItems'];","module.exports = flarum.core.compat['helpers/humanTime'];","module.exports = flarum.core.compat['components/EventPost'];","module.exports = flarum.core.compat['components/Separator'];","module.exports = flarum.core.compat['states/DiscussionListState'];","module.exports = flarum.core.compat['states/GlobalSearchState'];","module.exports = flarum.core.compat['Component'];","module.exports = flarum.core.compat['components/DiscussionListItem'];","module.exports = flarum.core.compat['utils/DiscussionControls'];","module.exports = flarum.core.compat['components/DiscussionPage'];","module.exports = flarum.core.compat['helpers/highlight'];","module.exports = flarum.core.compat['utils/KeyboardNavigatable'];","/*\n * This file is part of Flarum.\n *\n * (c) Toby Zerner \n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nexport * from './src/common';\nexport * from './src/forum';\n"],"sourceRoot":""} \ No newline at end of file