From 382729dd4617cf00c00e08d3a8c5221e06f3f116 Mon Sep 17 00:00:00 2001 From: flarum-bot Date: Mon, 10 May 2021 18:22:48 +0000 Subject: [PATCH] Bundled output for commit cc7e805a4bfa11637a50932cbc594285d4f0d056 [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 136eb4a5f..ff06bc9a4 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 n(r){if(e[r])return e[r].exports;var a=e[r]={i:r,l:!1,exports:{}};return t[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)n.d(r,a,function(e){return t[e]}.bind(null,a));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=52)}([function(t,e){t.exports=flarum.core.compat.Model},function(t,e){t.exports=flarum.core.compat.extend},function(t,e,n){"use strict";function r(t){return t.slice(0).sort((function(t,e){var n=t.position(),r=e.position();if(null===n&&null===r)return e.discussionCount()-t.discussionCount();if(null===r)return-1;if(null===n)return 1;var a=t.parent(),o=e.parent();return a===o?n-r:a&&o?a.position()-o.position():a?a===e?1:a.position()-r:o?o===t?-1:n-o.position():0}))}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=n(9),a=n.n(r);function o(t,e,n){void 0===e&&(e={}),void 0===n&&(n={});var r=t&&t.icon(),o=n.useColor,s=void 0===o||o;return e.className=a()([e.className,"icon",r?t.icon():"TagIcon"]),t?(e.style=e.style||{},r?e.style.color=s?t.color():"":e.style.backgroundColor=t.color()):e.className+=" untagged",r?m("i",e):m("span",e)}},function(t,e,n){"use strict";function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var r=n(14),a=n.n(r),o=n(10),s=n.n(o),i=n(3);function c(t,e){void 0===e&&(e={}),e.style=e.style||{},e.className="TagLabel "+(e.className||"");var n=a()(e,"link"),r=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"),n&&(e.title=t.description()||"",e.href=app.route("tag",{tags:t.slug()})),t.isChild()&&(e.className+=" TagLabel--child")}else e.className+=" untagged";return m(n?s.a:"span",e,m("span",{className:"TagLabel-text"},t&&t.icon()&&Object(i.a)(t,{},{useColor:!1})," ",r))}},function(t,e){t.exports=flarum.core.compat["components/IndexPage"]},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var r=n(14),a=n.n(r),o=n(5),s=n(2);function i(t,e){void 0===e&&(e={});var n=[],r=a()(e,"link");return e.className="TagsLabel "+(e.className||""),t?Object(s.a)(t).forEach((function(e){(e||1===t.length)&&n.push(Object(o.a)(e,{link:r}))})):n.push(Object(o.a)()),m("span",e,n)}},function(t,e){t.exports=flarum.core.compat["components/Button"]},function(t,e){t.exports=flarum.core.compat["utils/classList"]},function(t,e){t.exports=flarum.core.compat["components/Link"]},function(t,e){t.exports=flarum.core.compat["utils/Stream"]},function(t,e,n){"use strict";function r(){return(r=Object.assign||function(t){for(var e=1;e=this.maxPrimary&&(e=e.filter((function(e){return!e.isPrimary()||-1!==t.selected.indexOf(e)}))),a>=this.maxSecondary&&(e=e.filter((function(e){return e.isPrimary()||-1!==t.selected.indexOf(e)}))),n&&(e=e.filter((function(t){return t.name().substr(0,n.length).toLowerCase()===n}))),-1===e.indexOf(this.index)&&(this.index=e[0]);var o=Math.max(dt()(this.getInstruction(r,a)).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(_.a)(e))}))),m("input",{className:"FormControl",placeholder:dt()(this.getInstruction(r,a)),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(ot.a,{type:"submit",className:"Button Button--primary",disabled:!this.meetsRequirements(r,a),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 n||!e.parent()||-1!==t.selected.indexOf(e.parent())})).map((function(e){return m("li",{"data-index":e.id(),className:G()({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(w.a)(e),m("span",{className:"SelectTagListItem-name"},pt()(e.name(),n)),e.description()?m("span",{className:"SelectTagListItem-description"},e.description()):"")}))))]},n.meetsRequirements=function(t,e){return!!app.forum.attribute("canBypassTagCounts")||t>=this.minPrimary&&e>=this.minSecondary},n.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()},n.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"))},n.selectableItems=function(){return this.$(".TagDiscussionModal-list > li")},n.getCurrentNumericIndex=function(){return this.selectableItems().index(this.getItem(this.index))},n.getItem=function(t){return this.selectableItems().filter('[data-index="'+t.id()+'"]')},n.setIndex=function(t,e){var n=this.selectableItems(),r=n.parent();t<0?t=n.length-1:t>=n.length&&(t=0);var a=n.eq(t);if(this.index=app.store.getById("tags",a.attr("data-index")),m.redraw(),e){var o,s=r.scrollTop(),i=r.offset().top,c=i+r.outerHeight(),u=a.offset().top,l=u+a.outerHeight();uc&&(o=s-c+l+parseInt(r.css("padding-bottom"),10)),void 0!==o&&r.stop(!0).animate({scrollTop:o},100)}},n.onsubmit=function(t){t.preventDefault();var e=this.attrs.discussion,n=this.selected;e&&e.save({relationships:{tags:n}}).then((function(){app.current.matches(ut.a)&&app.current.get("stream").update(),m.redraw()})),this.attrs.onsubmit&&this.attrs.onsubmit(n),this.hide()},e}(it.a),xt=function(){Object(A.extend)(rt.a,"moderationControls",(function(t,e){e.canTag()&&t.add("tags",m(ot.a,{icon:"fas fa-tag",onclick:function(){return app.modal.show(bt,{discussion:e})}},app.translator.trans("flarum-tags.forum.discussion_controls.edit_tags_button")))}))},Tt=n(16),Ot=n.n(Tt),wt=function(){Object(A.extend)(u.a.prototype,"newDiscussionAction",(function(t){var e=this.currentTag();if(e){var n=e.parent(),r=n?[n,e]:[e];t.then((function(t){return t.fields.tags=r}))}else app.composer.fields.tags=[]})),Object(A.extend)(Ot.a.prototype,"oninit",(function(){app.tagList.load(["parent"]).then((function(){return m.redraw()}))})),Ot.a.prototype.chooseTags=function(){var t=this;yt().length&&app.modal.show(bt,{selectedTags:(this.composer.fields.tags||[]).slice(0),onsubmit:function(e){t.composer.fields.tags=e,t.$("textarea").focus()}})},Object(A.extend)(Ot.a.prototype,"headerItems",(function(t){var e=this.composer.fields.tags||[],n=yt();t.add("tags",m("a",{className:G()(["DiscussionComposer-changeTags",!n.length&&"disabled"]),onclick:this.chooseTags.bind(this)},e.length?Object(C.a)(e):m("span",{className:"TagLabel untagged"},app.translator.trans("flarum-tags.forum.composer_discussion.choose_tags_link"))),10)})),Object(A.override)(Ot.a.prototype,"onsubmit",(function(t){var e=this,n=this.composer.fields.tags||[],r=n.filter((function(t){return null!==t.position()&&!t.isChild()})),a=n.filter((function(t){return null===t.position()})),o=yt();(!n.length||r.length=0,o=a&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,t.exports=n(54),a)r.regeneratorRuntime=o;else try{delete r.regeneratorRuntime}catch(t){r.regeneratorRuntime=void 0}},function(t,e){!function(e){"use strict";var n=Object.prototype,r=n.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",i=a.toStringTag||"@@toStringTag",c="object"==typeof t,u=e.regeneratorRuntime;if(u)c&&(t.exports=u);else{(u=e.regeneratorRuntime=c?t.exports:{}).wrap=h;var l={},p={};p[o]=function(){return this};var f=Object.getPrototypeOf,d=f&&f(f(j([])));d&&d!==n&&r.call(d,o)&&(p=d);var m=b.prototype=v.prototype=Object.create(p);y.prototype=m.constructor=b,b.constructor=y,b[i]=y.displayName="GeneratorFunction",u.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},u.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,i in t||(t[i]="GeneratorFunction")),t.prototype=Object.create(m),t},u.awrap=function(t){return{__await:t}},x(T.prototype),T.prototype[s]=function(){return this},u.AsyncIterator=T,u.async=function(t,e,n,r){var a=new T(h(t,e,n,r));return u.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(m),m[i]="Generator",m[o]=function(){return this},m.toString=function(){return"[object Generator]"},u.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},u.values=j,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(_),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(n,r){return s.type="throw",s.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var i=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(i&&c){if(this.prev=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),_(n),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;_(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:j(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}}}function h(t,e,n,r){var a=e&&e.prototype instanceof v?e:v,o=Object.create(a.prototype),s=new N(r||[]);return o._invoke=function(t,e,n){var r="suspendedStart";return function(a,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===a)throw o;return L()}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var i=O(s,n);if(i){if(i===l)continue;return i}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=g(t,e,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===l)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}(t,n,s),o}function g(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}function v(){}function y(){}function b(){}function x(t){["next","throw","return"].forEach((function(e){t[e]=function(t){return this._invoke(e,t)}}))}function T(t){var e;this._invoke=function(n,a){function o(){return new Promise((function(e,o){!function e(n,a,o,s){var i=g(t[n],t,a);if("throw"!==i.type){var c=i.arg,u=c.value;return u&&"object"==typeof u&&r.call(u,"__await")?Promise.resolve(u.__await).then((function(t){e("next",t,o,s)}),(function(t){e("throw",t,o,s)})):Promise.resolve(u).then((function(t){c.value=t,o(c)}),(function(t){return e("throw",t,o,s)}))}s(i.arg)}(n,a,e,o)}))}return e=e?e.then(o,o):o()}}function O(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,O(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var r=g(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,l;var a=r.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function w(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function j(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,a=function e(){for(;++n=this.maxPrimary&&(e=e.filter((function(e){return!e.isPrimary()||-1!==t.selected.indexOf(e)}))),a>=this.maxSecondary&&(e=e.filter((function(e){return e.isPrimary()||-1!==t.selected.indexOf(e)}))),n&&(e=e.filter((function(t){return t.name().substr(0,n.length).toLowerCase()===n}))),-1===e.indexOf(this.index)&&(this.index=e[0]);var o=Math.max(dt()(this.getInstruction(r,a)).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(_.a)(e))}))),m("input",{className:"FormControl",placeholder:dt()(this.getInstruction(r,a)),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(ot.a,{type:"submit",className:"Button Button--primary",disabled:!this.meetsRequirements(r,a),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 n||!e.parent()||-1!==t.selected.indexOf(e.parent())})).map((function(e){return m("li",{"data-index":e.id(),className:G()({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(w.a)(e),m("span",{className:"SelectTagListItem-name"},pt()(e.name(),n)),e.description()?m("span",{className:"SelectTagListItem-description"},e.description()):"")}))))]},n.meetsRequirements=function(t,e){return!!app.forum.attribute("canBypassTagCounts")||t>=this.minPrimary&&e>=this.minSecondary},n.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()},n.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"))},n.selectableItems=function(){return this.$(".TagDiscussionModal-list > li")},n.getCurrentNumericIndex=function(){return this.selectableItems().index(this.getItem(this.index))},n.getItem=function(t){return this.selectableItems().filter('[data-index="'+t.id()+'"]')},n.setIndex=function(t,e){var n=this.selectableItems(),r=n.parent();t<0?t=n.length-1:t>=n.length&&(t=0);var a=n.eq(t);if(this.index=app.store.getById("tags",a.attr("data-index")),m.redraw(),e){var o,s=r.scrollTop(),i=r.offset().top,c=i+r.outerHeight(),u=a.offset().top,l=u+a.outerHeight();uc&&(o=s-c+l+parseInt(r.css("padding-bottom"),10)),void 0!==o&&r.stop(!0).animate({scrollTop:o},100)}},n.onsubmit=function(t){t.preventDefault();var e=this.attrs.discussion,n=this.selected;e&&e.save({relationships:{tags:n}}).then((function(){app.current.matches(ut.a)&&app.current.get("stream").update(),m.redraw()})),this.attrs.onsubmit&&this.attrs.onsubmit(n),this.hide()},e}(it.a),xt=function(){Object(A.extend)(rt.a,"moderationControls",(function(t,e){e.canTag()&&t.add("tags",m(ot.a,{icon:"fas fa-tag",onclick:function(){return app.modal.show(bt,{discussion:e})}},app.translator.trans("flarum-tags.forum.discussion_controls.edit_tags_button")))}))},Tt=n(16),Ot=n.n(Tt),wt=function(){Object(A.extend)(u.a.prototype,"newDiscussionAction",(function(t){var e=this.currentTag();if(e){var n=e.parent(),r=n?[n,e]:[e];t.then((function(t){return t.fields.tags=r}))}else app.composer.fields.tags=[]})),Object(A.extend)(Ot.a.prototype,"oninit",(function(){app.tagList.load(["parent"]).then((function(){return m.redraw()}))})),Ot.a.prototype.chooseTags=function(){var t=this;yt().length&&app.modal.show(bt,{selectedTags:(this.composer.fields.tags||[]).slice(0),onsubmit:function(e){t.composer.fields.tags=e,t.$("textarea").focus()}})},Object(A.extend)(Ot.a.prototype,"headerItems",(function(t){var e=this.composer.fields.tags||[],n=yt();t.add("tags",m("a",{className:G()(["DiscussionComposer-changeTags",!n.length&&"disabled"]),onclick:this.chooseTags.bind(this)},e.length?Object(C.a)(e):m("span",{className:"TagLabel untagged"},app.translator.trans("flarum-tags.forum.composer_discussion.choose_tags_link"))),10)})),Object(A.override)(Ot.a.prototype,"onsubmit",(function(t){var e=this,n=this.composer.fields.tags||[],r=n.filter((function(t){return null!==t.position()&&!t.isChild()})),a=n.filter((function(t){return null===t.position()})),o=yt();(!n.length||r.length=0,o=a&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,t.exports=n(54),a)r.regeneratorRuntime=o;else try{delete r.regeneratorRuntime}catch(t){r.regeneratorRuntime=void 0}},function(t,e){!function(e){"use strict";var n=Object.prototype,r=n.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",i=a.toStringTag||"@@toStringTag",c="object"==typeof t,u=e.regeneratorRuntime;if(u)c&&(t.exports=u);else{(u=e.regeneratorRuntime=c?t.exports:{}).wrap=h;var l={},p={};p[o]=function(){return this};var f=Object.getPrototypeOf,d=f&&f(f(j([])));d&&d!==n&&r.call(d,o)&&(p=d);var m=b.prototype=v.prototype=Object.create(p);y.prototype=m.constructor=b,b.constructor=y,b[i]=y.displayName="GeneratorFunction",u.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},u.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,i in t||(t[i]="GeneratorFunction")),t.prototype=Object.create(m),t},u.awrap=function(t){return{__await:t}},x(T.prototype),T.prototype[s]=function(){return this},u.AsyncIterator=T,u.async=function(t,e,n,r){var a=new T(h(t,e,n,r));return u.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(m),m[i]="Generator",m[o]=function(){return this},m.toString=function(){return"[object Generator]"},u.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},u.values=j,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(_),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(n,r){return s.type="throw",s.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var a=this.tryEntries.length-1;a>=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var i=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(i&&c){if(this.prev=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),_(n),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var a=r.arg;_(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:j(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}}}function h(t,e,n,r){var a=e&&e.prototype instanceof v?e:v,o=Object.create(a.prototype),s=new N(r||[]);return o._invoke=function(t,e,n){var r="suspendedStart";return function(a,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===a)throw o;return L()}for(n.method=a,n.arg=o;;){var s=n.delegate;if(s){var i=O(s,n);if(i){if(i===l)continue;return i}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=g(t,e,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===l)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}(t,n,s),o}function g(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}function v(){}function y(){}function b(){}function x(t){["next","throw","return"].forEach((function(e){t[e]=function(t){return this._invoke(e,t)}}))}function T(t){var e;this._invoke=function(n,a){function o(){return new Promise((function(e,o){!function e(n,a,o,s){var i=g(t[n],t,a);if("throw"!==i.type){var c=i.arg,u=c.value;return u&&"object"==typeof u&&r.call(u,"__await")?Promise.resolve(u.__await).then((function(t){e("next",t,o,s)}),(function(t){e("throw",t,o,s)})):Promise.resolve(u).then((function(t){c.value=t,o(c)}),(function(t){return e("throw",t,o,s)}))}s(i.arg)}(n,a,e,o)}))}return e=e?e.then(o,o):o()}}function O(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,O(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var r=g(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,l;var a=r.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function w(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function N(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(w,this),this.reset(!0)}function j(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,a=function e(){for(;++n {\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['utils/classList'];","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 children: Model.hasMany('children'),\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/extract'];","module.exports = flarum.core.compat['components/LoadingIndicator'];","module.exports = flarum.core.compat['components/DiscussionComposer'];","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['models/Discussion'];","module.exports = require(\"regenerator-runtime\");\n","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 LoadingIndicator from 'flarum/components/LoadingIndicator';\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 app.history.push('tags', app.translator.trans('flarum-tags.forum.header.back_to_tags_tooltip'));\n\n this.tags = [];\n\n const preloaded = app.preloadedApiDocument();\n\n if (preloaded) {\n this.tags = sortTags(preloaded.filter(tag => !tag.isChild()));\n return;\n } \n\n this.loading = true;\n\n app.tagList.load(['children', 'lastPostedDiscussion']).then(() => {\n this.tags = sortTags(app.store.all('tags').filter(tag => !tag.isChild()));\n\n this.loading = false;\n\n m.redraw();\n });\n }\n\n view() {\n if (this.loading) {\n return ;\n }\n\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(tag.children() || []);\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","function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\n\nexport default function _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n\n _next(undefined);\n });\n };\n}","export default class TagListState {\n constructor() {\n this.loadedIncludes = new Set();\n }\n\n async load(includes = []) {\n const unloadedIncludes = includes.filter(include => !this.loadedIncludes.has(include));\n\n if (unloadedIncludes.length === 0) {\n return Promise.resolve(app.store.all('tags'));\n }\n\n return app.store\n .find('tags', { include: 'parent,lastPostedDiscussion' })\n .then(val => {\n unloadedIncludes.forEach(include => this.loadedIncludes.add(include));\n return val;\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 if (this.currentActiveTag) {\n return this.currentActiveTag;\n }\n\n const slug = app.search.params().tags;\n let tag = null;\n\n if (slug) {\n tag = app.store.getBy('tags', 'slug', slug);\n }\n\n if (slug && !tag || (tag && !tag.isChild() && !tag.children())) {\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 app.store.find('tags', slug, { include: 'children,children.parent,parent,state'}).then(() => {\n this.currentActiveTag = app.store.getBy('tags', 'slug', slug);\n\n m.redraw();\n });\n }\n\n if (tag) {\n this.currentActiveTag = tag;\n return this.currentActiveTag;\n }\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.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","export default function getSelectableTags(discussion) {\n let tags = app.store.all('tags');\n\n if (discussion) {\n tags = tags.filter(tag => tag.canAddToDiscussion() || discussion.tags().indexOf(tag) !== -1);\n } else {\n tags = tags.filter(tag => tag.canStartDiscussion());\n }\n\n return tags;\n}\n","import Modal from 'flarum/components/Modal';\nimport DiscussionPage from 'flarum/components/DiscussionPage';\nimport Button from 'flarum/components/Button';\nimport LoadingIndicator from 'flarum/components/LoadingIndicator';\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';\nimport getSelectableTags from '../utils/getSelectableTags';\n\nexport default class TagDiscussionModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.tagsLoading = true;\n\n this.selected = [];\n this.filter = Stream('');\n this.focused = false;\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 app.tagList.load(['parent']).then(() => {\n this.tagsLoading = false;\n\n this.tags = sortTags(getSelectableTags(this.attrs.discussion));\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.index = this.tags[0].id();\n\n m.redraw();\n });\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 if (this.tagsLoading) {\n return ;\n }\n \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';\nimport classList from 'flarum/utils/classList';\n\nimport TagDiscussionModal from './components/TagDiscussionModal';\nimport tagsLabel from '../common/helpers/tagsLabel';\nimport getSelectableTags from './utils/getSelectableTags';\n\nexport default function () {\n extend(IndexPage.prototype, 'newDiscussionAction', function (promise) {\n // From `addTagFilter\n const tag = this.currentTag();\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\n extend(DiscussionComposer.prototype, 'oninit', function () {\n app.tagList.load(['parent']).then(() => m.redraw())\n });\n\n // Add tag-selection abilities to the discussion composer.\n DiscussionComposer.prototype.chooseTags = function () {\n const selectableTags = getSelectableTags();\n\n if (!selectableTags.length) return;\n\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 const selectableTags = getSelectableTags();\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 const selectableTags = getSelectableTags();\n\n if ((!chosenTags.length\n || (chosenPrimaryTags.length < app.forum.attribute('minPrimaryTags'))\n || (chosenSecondaryTags.length < app.forum.attribute('minSecondaryTags'))\n ) && selectableTags.length) {\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 TagListState from './states/TagListState';\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 app.tagList = new TagListState();\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","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n// This method of obtaining a reference to the global object needs to be\n// kept identical to the way it is obtained in runtime.js\nvar g = (function() {\n return this || (typeof self === \"object\" && self);\n})() || Function(\"return this\")();\n\n// Use `getOwnPropertyNames` because not all browsers support calling\n// `hasOwnProperty` on the global `self` object in a worker. See #183.\nvar hadRuntime = g.regeneratorRuntime &&\n Object.getOwnPropertyNames(g).indexOf(\"regeneratorRuntime\") >= 0;\n\n// Save the old regeneratorRuntime in case it needs to be restored later.\nvar oldRuntime = hadRuntime && g.regeneratorRuntime;\n\n// Force reevalutation of runtime.js.\ng.regeneratorRuntime = undefined;\n\nmodule.exports = require(\"./runtime\");\n\nif (hadRuntime) {\n // Restore the original runtime.\n g.regeneratorRuntime = oldRuntime;\n} else {\n // Remove the global property added by runtime.js.\n try {\n delete g.regeneratorRuntime;\n } catch(e) {\n g.regeneratorRuntime = undefined;\n }\n}\n","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n!(function(global) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n var inModule = typeof module === \"object\";\n var runtime = global.regeneratorRuntime;\n if (runtime) {\n if (inModule) {\n // If regeneratorRuntime is defined globally and we're in a module,\n // make the exports object identical to regeneratorRuntime.\n module.exports = runtime;\n }\n // Don't bother evaluating the rest of this file if the runtime was\n // already defined globally.\n return;\n }\n\n // Define the runtime globally (as expected by generated code) as either\n // module.exports (if we're in a module) or a new, empty object.\n runtime = global.regeneratorRuntime = inModule ? module.exports : {};\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n runtime.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n IteratorPrototype[iteratorSymbol] = function () {\n return this;\n };\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunctionPrototype[toStringTagSymbol] =\n GeneratorFunction.displayName = \"GeneratorFunction\";\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }\n\n runtime.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n runtime.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n if (!(toStringTagSymbol in genFun)) {\n genFun[toStringTagSymbol] = \"GeneratorFunction\";\n }\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n runtime.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return Promise.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return Promise.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new Promise(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n };\n runtime.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n runtime.async = function(innerFn, outerFn, self, tryLocsList) {\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList)\n );\n\n return runtime.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n if (delegate.iterator.return) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n Gp[toStringTagSymbol] = \"Generator\";\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n Gp[iteratorSymbol] = function() {\n return this;\n };\n\n Gp.toString = function() {\n return \"[object Generator]\";\n };\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n runtime.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n runtime.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n})(\n // In sloppy mode, unbound `this` refers to the global object, fallback to\n // Function constructor if we're in global strict mode. That is sadly a form\n // of indirect eval which violates Content Security Policy.\n (function() {\n return this || (typeof self === \"object\" && self);\n })() || Function(\"return this\")()\n);\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['utils/classList']\"","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/extract']\"","webpack://@flarum/tags/external \"flarum.core.compat['components/LoadingIndicator']\"","webpack://@flarum/tags/external \"flarum.core.compat['components/DiscussionComposer']\"","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['models/Discussion']\"","webpack://@flarum/tags/./node_modules/@babel/runtime/regenerator/index.js","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/./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js","webpack://@flarum/tags/./src/forum/states/TagListState.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/utils/getSelectableTags.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","webpack://@flarum/tags/./node_modules/regenerator-runtime/runtime-module.js","webpack://@flarum/tags/./node_modules/regenerator-runtime/runtime.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","hasMany","defaultSort","isHidden","lastPostedAt","transformDate","lastPostedDiscussion","isRestricted","canStartDiscussion","canAddToDiscussion","isPrimary","computed","TagsPage","oninit","vnode","history","preloaded","preloadedApiDocument","filter","loading","tagList","load","then","store","all","redraw","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","asyncGeneratorStep","gen","resolve","reject","_next","_throw","arg","info","error","done","Promise","TagListState","loadedIncludes","Set","fn","includes","unloadedIncludes","include","has","find","val","add","self","args","err","undefined","TagLinkButton","model","active","isActive","params","LinkButton","extend","items","current","matches","Separator","component","search","stickyParams","currentTag","addTag","more","splice","TagHero","Component","currentActiveTag","getBy","override","original","vdom","session","user","disabled","GlobalSearchState","param","DiscussionListState","q","DiscussionListItem","DiscussionHero","getSelectableTags","TagDiscussionModal","tagsLoading","selected","Stream","focused","minPrimary","forum","maxPrimary","minSecondary","maxSecondary","navigator","KeyboardNavigatable","onUp","setIndex","getCurrentNumericIndex","onDown","onSelect","select","onRemove","selectedTags","index","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","scrollTop","dropdownScroll","dropdownTop","offset","top","dropdownBottom","outerHeight","itemTop","itemBottom","parseInt","css","stop","animate","onsubmit","preventDefault","save","relationships","DiscussionPage","update","hide","Modal","DiscussionControls","canTag","modal","show","promise","composer","fields","DiscussionComposer","chooseTags","selectableTags","chosenTags","chosenPrimaryTags","chosenSecondaryTags","addTagFilter","addTagControl","addTagList","addTagLabels","addTagComposer","initializers","routes","path","postComponents","discussionTagged","models","Discussion","tagsCompat","g","Function","hadRuntime","regeneratorRuntime","getOwnPropertyNames","oldRuntime","global","Op","hasOwn","$Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","inModule","runtime","wrap","ContinueSentinel","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","GeneratorFunctionPrototype","Generator","GeneratorFunction","displayName","isGeneratorFunction","genFun","ctor","mark","setPrototypeOf","awrap","__await","defineIteratorMethods","AsyncIterator","async","innerFn","outerFn","tryLocsList","iter","next","result","toString","keys","reverse","pop","Context","reset","skipTempReset","prev","sent","_sent","delegate","method","tryEntries","resetTryEntry","charAt","isNaN","rootRecord","completion","rval","dispatchException","exception","context","handle","loc","caught","record","entry","tryLoc","hasCatch","hasFinally","catchLoc","finallyLoc","Error","abrupt","finallyEntry","complete","afterLoc","finish","thrown","delegateYield","iterable","resultName","nextLoc","protoGenerator","generator","_invoke","state","doneResult","delegateResult","maybeInvokeDelegate","tryCatch","makeInvokeMethod","obj","previousPromise","callInvokeWithMethodAndArg","invoke","unwrapped","return","TypeError","pushTryEntry","locs","iteratorMethod"],"mappings":"2BACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,E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HAA,EAAKtW,WAneTwK,EAoeI8L,EAAK9M,MAAO,EAEL8M,GAGT,OAAOA,EAAKA,KAAOA,GAKvB,MAAO,CAAEA,KAAMiD,GAIjB,SAASA,IACP,MAAO,CAAEvZ,WAnfPwK,EAmfyBhB,MAAM,IAxfpC,CAssBC,WACE,OAAO/E,MAAyB,iBAAT4F,MAAqBA,KAD9C,IAEQuJ,SAAS,cAATA","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 = 52);\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['utils/classList'];","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 children: Model.hasMany('children'),\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/extract'];","module.exports = flarum.core.compat['components/LoadingIndicator'];","module.exports = flarum.core.compat['components/DiscussionComposer'];","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['models/Discussion'];","module.exports = require(\"regenerator-runtime\");\n","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 LoadingIndicator from 'flarum/components/LoadingIndicator';\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 app.history.push('tags', app.translator.trans('flarum-tags.forum.header.back_to_tags_tooltip'));\n\n this.tags = [];\n\n const preloaded = app.preloadedApiDocument();\n\n if (preloaded) {\n this.tags = sortTags(preloaded.filter(tag => !tag.isChild()));\n return;\n } \n\n this.loading = true;\n\n app.tagList.load(['children', 'lastPostedDiscussion']).then(() => {\n this.tags = sortTags(app.store.all('tags').filter(tag => !tag.isChild()));\n\n this.loading = false;\n\n m.redraw();\n });\n }\n\n view() {\n if (this.loading) {\n return ;\n }\n\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(tag.children() || []);\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","function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\n\nexport default function _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n\n _next(undefined);\n });\n };\n}","export default class TagListState {\n constructor() {\n this.loadedIncludes = new Set();\n }\n\n async load(includes = []) {\n const unloadedIncludes = includes.filter(include => !this.loadedIncludes.has(include));\n\n if (unloadedIncludes.length === 0) {\n return Promise.resolve(app.store.all('tags'));\n }\n\n return app.store\n .find('tags', { include: 'parent,lastPostedDiscussion' })\n .then(val => {\n unloadedIncludes.forEach(include => this.loadedIncludes.add(include));\n return val;\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 if (this.currentActiveTag) {\n return this.currentActiveTag;\n }\n\n const slug = app.search.params().tags;\n let tag = null;\n\n if (slug) {\n tag = app.store.getBy('tags', 'slug', slug);\n }\n\n if (slug && !tag || (tag && !tag.isChild() && !tag.children())) {\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 app.store.find('tags', slug, { include: 'children,children.parent,parent,state'}).then(() => {\n this.currentActiveTag = app.store.getBy('tags', 'slug', slug);\n\n m.redraw();\n });\n }\n\n if (tag) {\n this.currentActiveTag = tag;\n return this.currentActiveTag;\n }\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.tag = this.params.tags;\n // TODO: replace this with a more robust system.\n const q = params.filter.q;\n params.filter.q = q ? `${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","export default function getSelectableTags(discussion) {\n let tags = app.store.all('tags');\n\n if (discussion) {\n tags = tags.filter(tag => tag.canAddToDiscussion() || discussion.tags().indexOf(tag) !== -1);\n } else {\n tags = tags.filter(tag => tag.canStartDiscussion());\n }\n\n return tags;\n}\n","import Modal from 'flarum/components/Modal';\nimport DiscussionPage from 'flarum/components/DiscussionPage';\nimport Button from 'flarum/components/Button';\nimport LoadingIndicator from 'flarum/components/LoadingIndicator';\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';\nimport getSelectableTags from '../utils/getSelectableTags';\n\nexport default class TagDiscussionModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.tagsLoading = true;\n\n this.selected = [];\n this.filter = Stream('');\n this.focused = false;\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 app.tagList.load(['parent']).then(() => {\n this.tagsLoading = false;\n\n this.tags = sortTags(getSelectableTags(this.attrs.discussion));\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.index = this.tags[0].id();\n\n m.redraw();\n });\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 if (this.tagsLoading) {\n return ;\n }\n \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';\nimport classList from 'flarum/utils/classList';\n\nimport TagDiscussionModal from './components/TagDiscussionModal';\nimport tagsLabel from '../common/helpers/tagsLabel';\nimport getSelectableTags from './utils/getSelectableTags';\n\nexport default function () {\n extend(IndexPage.prototype, 'newDiscussionAction', function (promise) {\n // From `addTagFilter\n const tag = this.currentTag();\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\n extend(DiscussionComposer.prototype, 'oninit', function () {\n app.tagList.load(['parent']).then(() => m.redraw())\n });\n\n // Add tag-selection abilities to the discussion composer.\n DiscussionComposer.prototype.chooseTags = function () {\n const selectableTags = getSelectableTags();\n\n if (!selectableTags.length) return;\n\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 const selectableTags = getSelectableTags();\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 const selectableTags = getSelectableTags();\n\n if ((!chosenTags.length\n || (chosenPrimaryTags.length < app.forum.attribute('minPrimaryTags'))\n || (chosenSecondaryTags.length < app.forum.attribute('minSecondaryTags'))\n ) && selectableTags.length) {\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 TagListState from './states/TagListState';\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 app.tagList = new TagListState();\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","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n// This method of obtaining a reference to the global object needs to be\n// kept identical to the way it is obtained in runtime.js\nvar g = (function() {\n return this || (typeof self === \"object\" && self);\n})() || Function(\"return this\")();\n\n// Use `getOwnPropertyNames` because not all browsers support calling\n// `hasOwnProperty` on the global `self` object in a worker. See #183.\nvar hadRuntime = g.regeneratorRuntime &&\n Object.getOwnPropertyNames(g).indexOf(\"regeneratorRuntime\") >= 0;\n\n// Save the old regeneratorRuntime in case it needs to be restored later.\nvar oldRuntime = hadRuntime && g.regeneratorRuntime;\n\n// Force reevalutation of runtime.js.\ng.regeneratorRuntime = undefined;\n\nmodule.exports = require(\"./runtime\");\n\nif (hadRuntime) {\n // Restore the original runtime.\n g.regeneratorRuntime = oldRuntime;\n} else {\n // Remove the global property added by runtime.js.\n try {\n delete g.regeneratorRuntime;\n } catch(e) {\n g.regeneratorRuntime = undefined;\n }\n}\n","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n!(function(global) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n var inModule = typeof module === \"object\";\n var runtime = global.regeneratorRuntime;\n if (runtime) {\n if (inModule) {\n // If regeneratorRuntime is defined globally and we're in a module,\n // make the exports object identical to regeneratorRuntime.\n module.exports = runtime;\n }\n // Don't bother evaluating the rest of this file if the runtime was\n // already defined globally.\n return;\n }\n\n // Define the runtime globally (as expected by generated code) as either\n // module.exports (if we're in a module) or a new, empty object.\n runtime = global.regeneratorRuntime = inModule ? module.exports : {};\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n runtime.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n IteratorPrototype[iteratorSymbol] = function () {\n return this;\n };\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunctionPrototype[toStringTagSymbol] =\n GeneratorFunction.displayName = \"GeneratorFunction\";\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }\n\n runtime.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n runtime.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n if (!(toStringTagSymbol in genFun)) {\n genFun[toStringTagSymbol] = \"GeneratorFunction\";\n }\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n runtime.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return Promise.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return Promise.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new Promise(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n };\n runtime.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n runtime.async = function(innerFn, outerFn, self, tryLocsList) {\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList)\n );\n\n return runtime.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n if (delegate.iterator.return) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n Gp[toStringTagSymbol] = \"Generator\";\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n Gp[iteratorSymbol] = function() {\n return this;\n };\n\n Gp.toString = function() {\n return \"[object Generator]\";\n };\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n runtime.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n runtime.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n})(\n // In sloppy mode, unbound `this` refers to the global object, fallback to\n // Function constructor if we're in global strict mode. That is sadly a form\n // of indirect eval which violates Content Security Policy.\n (function() {\n return this || (typeof self === \"object\" && self);\n })() || Function(\"return this\")()\n);\n"],"sourceRoot":""} \ No newline at end of file