From 7b803e6ed77b065dccba96ad89b7e8f7e4797df5 Mon Sep 17 00:00:00 2001 From: flarum-bot Date: Sun, 7 May 2023 16:49:15 +0000 Subject: [PATCH] Bundled output for commit e63e161be6d62d7a29998bf0cacbf5641e7a8a4f Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci] --- js/dist-typings/forum/components/FlagsDropdown.d.ts | 6 +++--- js/dist/forum.js | 2 +- js/dist/forum.js.map | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/js/dist-typings/forum/components/FlagsDropdown.d.ts b/js/dist-typings/forum/components/FlagsDropdown.d.ts index 87af955..15f614f 100644 --- a/js/dist-typings/forum/components/FlagsDropdown.d.ts +++ b/js/dist-typings/forum/components/FlagsDropdown.d.ts @@ -1,7 +1,7 @@ -export default class FlagsDropdown { +export default class FlagsDropdown extends NotificationsDropdown { static initAttrs(attrs: any): void; - getMenu(): JSX.Element; - goToRoute(): void; + constructor(); getUnreadCount(): any; getNewCount(): unknown; } +import NotificationsDropdown from "flarum/forum/components/NotificationsDropdown"; diff --git a/js/dist/forum.js b/js/dist/forum.js index bc6185f..d87dc8c 100644 --- a/js/dist/forum.js +++ b/js/dist/forum.js @@ -1,2 +1,2 @@ -(()=>{var t={n:a=>{var o=a&&a.__esModule?()=>a.default:()=>a;return t.d(o,{a:o}),o},d:(a,o)=>{for(var s in o)t.o(o,s)&&!t.o(a,s)&&Object.defineProperty(a,s,{enumerable:!0,get:o[s]})},o:(t,a)=>Object.prototype.hasOwnProperty.call(t,a),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},a={};(()=>{"use strict";t.r(a),t.d(a,{extend:()=>et});const o=flarum.core.compat["forum/app"];var s=t.n(o),e=function(){function t(t){this.app=t,this.loading=!1}return t.prototype.load=function(){var t=this;this.cache&&!this.app.session.user.attribute("newFlagCount")||(this.loading=!0,m.redraw(),this.app.store.find("flags").then((function(a){t.app.session.user.pushAttributes({newFlagCount:0}),t.cache=a.sort((function(t,a){return a.createdAt()-t.createdAt()}))})).catch((function(){})).then((function(){t.loading=!1,m.redraw()})))},t}();const n=flarum.core.compat["common/extend"],r=flarum.core.compat["forum/utils/PostControls"];var l=t.n(r);const i=flarum.core.compat["common/components/Button"];var c=t.n(i);function u(t,a){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,a){return t.__proto__=a,t},u(t,a)}function f(t,a){t.prototype=Object.create(a.prototype),t.prototype.constructor=t,u(t,a)}const p=flarum.core.compat["common/components/Modal"];var d=t.n(p);const g=flarum.core.compat["common/utils/Stream"];var h=t.n(g);const v=flarum.core.compat["common/utils/withAttr"];var _=t.n(v);const b=flarum.core.compat["common/utils/ItemList"];var y=t.n(b),N=function(t){function a(){return t.apply(this,arguments)||this}f(a,t);var o=a.prototype;return o.oninit=function(a){t.prototype.oninit.call(this,a),this.success=!1,this.reason=h()(""),this.reasonDetail=h()("")},o.className=function(){return"FlagPostModal Modal--medium"},o.title=function(){return s().translator.trans("flarum-flags.forum.flag_post.title")},o.content=function(){return this.success?m("div",{className:"Modal-body"},m("div",{className:"Form Form--centered"},m("p",{className:"helpText"},s().translator.trans("flarum-flags.forum.flag_post.confirmation_message")),m("div",{className:"Form-group"},m(c(),{className:"Button Button--primary Button--block",onclick:this.hide.bind(this)},s().translator.trans("flarum-flags.forum.flag_post.dismiss_button"))))):m("div",{className:"Modal-body"},m("div",{className:"Form Form--centered"},m("div",{className:"Form-group"},m("div",null,this.flagReasons().toArray())),m("div",{className:"Form-group"},m(c(),{className:"Button Button--primary Button--block",type:"submit",loading:this.loading,disabled:!this.reason()},s().translator.trans("flarum-flags.forum.flag_post.submit_button")))))},o.flagReasons=function(){var t=new(y()),a=s().forum.attribute("guidelinesUrl");return t.add("off-topic",m("label",{className:"checkbox"},m("input",{type:"radio",name:"reason",checked:"off_topic"===this.reason(),value:"off_topic",onclick:_()("value",this.reason)}),m("strong",null,s().translator.trans("flarum-flags.forum.flag_post.reason_off_topic_label")),s().translator.trans("flarum-flags.forum.flag_post.reason_off_topic_text"),"off_topic"===this.reason()?m("textarea",{className:"FormControl",placeholder:s().translator.trans("flarum-flags.forum.flag_post.reason_details_placeholder"),value:this.reasonDetail(),oninput:_()("value",this.reasonDetail)}):""),70),t.add("inappropriate",m("label",{className:"checkbox"},m("input",{type:"radio",name:"reason",checked:"inappropriate"===this.reason(),value:"inappropriate",onclick:_()("value",this.reason)}),m("strong",null,s().translator.trans("flarum-flags.forum.flag_post.reason_inappropriate_label")),s().translator.trans("flarum-flags.forum.flag_post.reason_inappropriate_text",{a:a?m("a",{href:a,target:"_blank"}):void 0}),"inappropriate"===this.reason()?m("textarea",{className:"FormControl",placeholder:s().translator.trans("flarum-flags.forum.flag_post.reason_details_placeholder"),value:this.reasonDetail(),oninput:_()("value",this.reasonDetail)}):""),60),t.add("spam",m("label",{className:"checkbox"},m("input",{type:"radio",name:"reason",checked:"spam"===this.reason(),value:"spam",onclick:_()("value",this.reason)}),m("strong",null,s().translator.trans("flarum-flags.forum.flag_post.reason_spam_label")),s().translator.trans("flarum-flags.forum.flag_post.reason_spam_text"),"spam"===this.reason()?m("textarea",{className:"FormControl",placeholder:s().translator.trans("flarum-flags.forum.flag_post.reason_details_placeholder"),value:this.reasonDetail(),oninput:_()("value",this.reasonDetail)}):""),50),t.add("other",m("label",{className:"checkbox"},m("input",{type:"radio",name:"reason",checked:"other"===this.reason(),value:"other",onclick:_()("value",this.reason)}),m("strong",null,s().translator.trans("flarum-flags.forum.flag_post.reason_other_label")),"other"===this.reason()?m("textarea",{className:"FormControl",value:this.reasonDetail(),oninput:_()("value",this.reasonDetail)}):""),10),t},o.onsubmit=function(t){var a=this;t.preventDefault(),this.loading=!0,s().store.createRecord("flags").save({reason:"other"===this.reason()?null:this.reason(),reasonDetail:this.reasonDetail(),relationships:{user:s().session.user,post:this.attrs.post}},{errorHandler:this.onerror.bind(this)}).then((function(){return a.success=!0})).catch((function(){})).then(this.loaded.bind(this))},a}(d());function F(){(0,n.extend)(l(),"userControls",(function(t,a){!a.isHidden()&&"comment"===a.contentType()&&a.canFlag()&&t.add("flag",m(c(),{icon:"fas fa-flag",onclick:function(){return s().modal.show(N,{post:a})}},s().translator.trans("flarum-flags.forum.post_controls.flag_button")))}))}const x=flarum.core.compat["forum/components/HeaderSecondary"];var k=t.n(x);const w=flarum.core.compat["components/NotificationsDropdown"];var P=t.n(w);const C=flarum.core.compat["common/Component"];var D=t.n(C);const A=flarum.core.compat["common/components/Link"];var O=t.n(A);const M=flarum.core.compat["common/components/LoadingIndicator"];var L=t.n(M);const B=flarum.core.compat["common/helpers/avatar"];var j=t.n(B);const T=flarum.core.compat["common/helpers/username"];var S=t.n(T);const R=flarum.core.compat["common/helpers/icon"];var E=t.n(R);const I=flarum.core.compat["common/helpers/humanTime"];var H=t.n(I),U=function(t){function a(){return t.apply(this,arguments)||this}f(a,t);var o=a.prototype;return o.oninit=function(a){t.prototype.oninit.call(this,a),this.state=this.attrs.state},o.view=function(){var t=this.state.cache||[];return m("div",{className:"NotificationList FlagList"},m("div",{className:"NotificationList-header"},m("h4",{className:"App-titleControl App-titleControl--text"},s().translator.trans("flarum-flags.forum.flagged_posts.title"))),m("div",{className:"NotificationList-content"},m("ul",{className:"NotificationGroup-content"},t.length?t.map((function(t){var a=t.post();return m("li",null,m(O(),{href:s().route.post(a),className:"Notification Flag",onclick:function(t){s().flags.index=a,t.redraw=!1}},j()(a.user()),E()("fas fa-flag",{className:"Notification-icon"}),m("span",{className:"Notification-content"},s().translator.trans("flarum-flags.forum.flagged_posts.item_text",{username:S()(a.user()),em:m("em",null),discussion:a.discussion().title()})),H()(t.createdAt()),m("div",{className:"Notification-excerpt"},a.contentPlain())))})):this.state.loading?L().component({className:"LoadingIndicator--block"}):m("div",{className:"NotificationList-empty"},s().translator.trans("flarum-flags.forum.flagged_posts.empty_text")))))},a}(D()),G=function(t){function a(){return t.apply(this,arguments)||this}f(a,t),a.initAttrs=function(a){a.label=a.label||s().translator.trans("flarum-flags.forum.flagged_posts.tooltip"),a.icon=a.icon||"fas fa-flag",t.initAttrs.call(this,a)};var o=a.prototype;return o.getMenu=function(){return m("div",{className:"Dropdown-menu "+this.attrs.menuClassName,onclick:this.menuClick.bind(this)},this.showing?U.component({state:this.attrs.state}):"")},o.goToRoute=function(){m.route.set(s().route("flags"))},o.getUnreadCount=function(){return s().flags.cache?s().flags.cache.length:s().forum.attribute("flagCount")},o.getNewCount=function(){return s().session.user.attribute("newFlagCount")},a}(P());function q(){(0,n.extend)(k().prototype,"items",(function(t){s().forum.attribute("canViewFlags")&&t.add("flags",m(G,{state:s().flags}),15)}))}const z=flarum.core.compat["forum/components/Post"];var V=t.n(z);const J=flarum.core.compat["common/utils/humanTime"];var K=t.n(J);function Q(){(0,n.extend)(V().prototype,"elementAttrs",(function(t){this.attrs.post.flags().length&&(t.className+=" Post--flagged")})),V().prototype.dismissFlag=function(t){var a=this.attrs.post;return delete a.data.relationships.flags,this.subtree.invalidate(),s().flags.cache&&s().flags.cache.some((function(t,o){if(t.post()===a){if(s().flags.cache.splice(o,1),s().flags.index===a){var e=s().flags.cache[o];if(e||(e=s().flags.cache[0]),e){var n=e.post();s().flags.index=n,m.route.set(s().route.post(n))}}return!0}})),s().request({url:s().forum.attribute("apiUrl")+a.apiEndpoint()+"/flags",method:"DELETE",body:t})},V().prototype.flagActionItems=function(){var t=this,a=new(y()),o=l().destructiveControls(this.attrs.post);return Object.keys(o.items).forEach((function(a){var s=o.get(a).attrs;s.className="Button",(0,n.extend)(s,"onclick",(function(){return t.dismissFlag()}))})),a.add("controls",m("div",{className:"ButtonGroup"},o.toArray())),a.add("dismiss",m(c(),{className:"Button",icon:"far fa-eye-slash",onclick:this.dismissFlag.bind(this)},s().translator.trans("flarum-flags.forum.post.dismiss_flag_button")),-100),a},(0,n.extend)(V().prototype,"content",(function(t){var a=this,o=this.attrs.post,s=o.flags();s.length&&(o.isHidden()&&(this.revealContent=!0),t.unshift(m("div",{className:"Post-flagged"},m("div",{className:"Post-flagged-flags"},s.map((function(t){return m("div",{className:"Post-flagged-flag"},a.flagReason(t))}))),m("div",{className:"Post-flagged-actions"},this.flagActionItems().toArray()))))})),V().prototype.flagReason=function(t){if("user"===t.type()){var a=t.user(),o=t.reason()?s().translator.trans("flarum-flags.forum.flag_post.reason_"+t.reason()+"_label"):null,e=t.reasonDetail(),n=K()(t.createdAt());return[s().translator.trans(o?"flarum-flags.forum.post.flagged_by_with_reason_text":"flarum-flags.forum.post.flagged_by_text",{time:n,user:a,reason:o}),e?m("span",{className:"Post-flagged-detail"},e):""]}}}const W=flarum.core.compat["common/extenders"];var X=t.n(W);const Y=flarum.core.compat["common/models/Post"];var Z=t.n(Y);const $=flarum.core.compat["components/Page"];var tt=function(t){function a(){return t.apply(this,arguments)||this}f(a,t);var o=a.prototype;return o.oninit=function(a){t.prototype.oninit.call(this,a),s().history.push("flags"),s().flags.load(),this.bodyClass="App--flags"},o.view=function(){return m("div",{className:"FlagsPage"},m(U,{state:s().flags}))},a}(t.n($)());const at=flarum.core.compat["common/Model"];var ot=t.n(at),st=function(t){function a(){return t.apply(this,arguments)||this}f(a,t);var o=a.prototype;return o.type=function(){return ot().attribute("type").call(this)},o.reason=function(){return ot().attribute("reason").call(this)},o.reasonDetail=function(){return ot().attribute("reasonDetail").call(this)},o.createdAt=function(){return ot().attribute("createdAt",ot().transformDate).call(this)},o.post=function(){return ot().hasOne("post").call(this)},o.user=function(){return ot().hasOne("user").call(this)},a}(ot());const et=[(new(X().Routes)).add("flags","/flags",tt),(new(X().Store)).add("flags",st),new(X().Model)(Z()).hasMany("flags").attribute("canFlag")],nt={"flags/addFlagsToPosts":Q,"flags/addFlagControl":F,"flags/addFlagsDropdown":q,"flags/models/Flag":st,"flags/components/FlagList":U,"flags/components/FlagPostModal":N,"flags/components/FlagsPage":tt,"flags/components/FlagsDropdown":G},rt=flarum.core;s().initializers.add("flarum-flags",(function(){s().flags=new e(s()),F(),q(),Q()})),Object.assign(rt.compat,nt)})(),module.exports=a})(); +(()=>{var t={n:a=>{var o=a&&a.__esModule?()=>a.default:()=>a;return t.d(o,{a:o}),o},d:(a,o)=>{for(var s in o)t.o(o,s)&&!t.o(a,s)&&Object.defineProperty(a,s,{enumerable:!0,get:o[s]})},o:(t,a)=>Object.prototype.hasOwnProperty.call(t,a),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},a={};(()=>{"use strict";t.r(a),t.d(a,{extend:()=>et});const o=flarum.core.compat["forum/app"];var s=t.n(o),e=function(){function t(t){this.app=t,this.loading=!1}return t.prototype.load=function(){var t=this;this.cache&&!this.app.session.user.attribute("newFlagCount")||(this.loading=!0,m.redraw(),this.app.store.find("flags").then((function(a){t.app.session.user.pushAttributes({newFlagCount:0}),t.cache=a.sort((function(t,a){return a.createdAt()-t.createdAt()}))})).catch((function(){})).then((function(){t.loading=!1,m.redraw()})))},t}();const n=flarum.core.compat["common/extend"],r=flarum.core.compat["forum/utils/PostControls"];var l=t.n(r);const i=flarum.core.compat["common/components/Button"];var c=t.n(i);function u(t,a){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,a){return t.__proto__=a,t},u(t,a)}function f(t,a){t.prototype=Object.create(a.prototype),t.prototype.constructor=t,u(t,a)}const p=flarum.core.compat["common/components/Modal"];var d=t.n(p);const g=flarum.core.compat["common/utils/Stream"];var h=t.n(g);const v=flarum.core.compat["common/utils/withAttr"];var _=t.n(v);const b=flarum.core.compat["common/utils/ItemList"];var y=t.n(b),N=function(t){function a(){return t.apply(this,arguments)||this}f(a,t);var o=a.prototype;return o.oninit=function(a){t.prototype.oninit.call(this,a),this.success=!1,this.reason=h()(""),this.reasonDetail=h()("")},o.className=function(){return"FlagPostModal Modal--medium"},o.title=function(){return s().translator.trans("flarum-flags.forum.flag_post.title")},o.content=function(){return this.success?m("div",{className:"Modal-body"},m("div",{className:"Form Form--centered"},m("p",{className:"helpText"},s().translator.trans("flarum-flags.forum.flag_post.confirmation_message")),m("div",{className:"Form-group"},m(c(),{className:"Button Button--primary Button--block",onclick:this.hide.bind(this)},s().translator.trans("flarum-flags.forum.flag_post.dismiss_button"))))):m("div",{className:"Modal-body"},m("div",{className:"Form Form--centered"},m("div",{className:"Form-group"},m("div",null,this.flagReasons().toArray())),m("div",{className:"Form-group"},m(c(),{className:"Button Button--primary Button--block",type:"submit",loading:this.loading,disabled:!this.reason()},s().translator.trans("flarum-flags.forum.flag_post.submit_button")))))},o.flagReasons=function(){var t=new(y()),a=s().forum.attribute("guidelinesUrl");return t.add("off-topic",m("label",{className:"checkbox"},m("input",{type:"radio",name:"reason",checked:"off_topic"===this.reason(),value:"off_topic",onclick:_()("value",this.reason)}),m("strong",null,s().translator.trans("flarum-flags.forum.flag_post.reason_off_topic_label")),s().translator.trans("flarum-flags.forum.flag_post.reason_off_topic_text"),"off_topic"===this.reason()&&m("textarea",{className:"FormControl",placeholder:s().translator.trans("flarum-flags.forum.flag_post.reason_details_placeholder"),value:this.reasonDetail(),oninput:_()("value",this.reasonDetail)})),70),t.add("inappropriate",m("label",{className:"checkbox"},m("input",{type:"radio",name:"reason",checked:"inappropriate"===this.reason(),value:"inappropriate",onclick:_()("value",this.reason)}),m("strong",null,s().translator.trans("flarum-flags.forum.flag_post.reason_inappropriate_label")),s().translator.trans("flarum-flags.forum.flag_post.reason_inappropriate_text",{a:a?m("a",{href:a,target:"_blank"}):void 0}),"inappropriate"===this.reason()&&m("textarea",{className:"FormControl",placeholder:s().translator.trans("flarum-flags.forum.flag_post.reason_details_placeholder"),value:this.reasonDetail(),oninput:_()("value",this.reasonDetail)})),60),t.add("spam",m("label",{className:"checkbox"},m("input",{type:"radio",name:"reason",checked:"spam"===this.reason(),value:"spam",onclick:_()("value",this.reason)}),m("strong",null,s().translator.trans("flarum-flags.forum.flag_post.reason_spam_label")),s().translator.trans("flarum-flags.forum.flag_post.reason_spam_text"),"spam"===this.reason()&&m("textarea",{className:"FormControl",placeholder:s().translator.trans("flarum-flags.forum.flag_post.reason_details_placeholder"),value:this.reasonDetail(),oninput:_()("value",this.reasonDetail)})),50),t.add("other",m("label",{className:"checkbox"},m("input",{type:"radio",name:"reason",checked:"other"===this.reason(),value:"other",onclick:_()("value",this.reason)}),m("strong",null,s().translator.trans("flarum-flags.forum.flag_post.reason_other_label")),"other"===this.reason()&&m("textarea",{className:"FormControl",value:this.reasonDetail(),oninput:_()("value",this.reasonDetail)})),10),t},o.onsubmit=function(t){var a=this;t.preventDefault(),this.loading=!0,s().store.createRecord("flags").save({reason:"other"===this.reason()?null:this.reason(),reasonDetail:this.reasonDetail(),relationships:{user:s().session.user,post:this.attrs.post}},{errorHandler:this.onerror.bind(this)}).then((function(){return a.success=!0})).catch((function(){})).then(this.loaded.bind(this))},a}(d());function F(){(0,n.extend)(l(),"userControls",(function(t,a){!a.isHidden()&&"comment"===a.contentType()&&a.canFlag()&&t.add("flag",m(c(),{icon:"fas fa-flag",onclick:function(){return s().modal.show(N,{post:a})}},s().translator.trans("flarum-flags.forum.post_controls.flag_button")))}))}const x=flarum.core.compat["forum/components/HeaderSecondary"];var k=t.n(x);const w=flarum.core.compat["forum/components/NotificationsDropdown"];var P=t.n(w);const C=flarum.core.compat["common/Component"];var D=t.n(C);const A=flarum.core.compat["common/components/Link"];var O=t.n(A);const M=flarum.core.compat["common/components/LoadingIndicator"];var L=t.n(M);const B=flarum.core.compat["common/helpers/avatar"];var j=t.n(B);const T=flarum.core.compat["common/helpers/username"];var S=t.n(T);const R=flarum.core.compat["common/helpers/icon"];var E=t.n(R);const I=flarum.core.compat["common/helpers/humanTime"];var H=t.n(I),U=function(t){function a(){return t.apply(this,arguments)||this}f(a,t);var o=a.prototype;return o.oninit=function(a){t.prototype.oninit.call(this,a),this.state=this.attrs.state},o.view=function(){var t=this.state.cache||[];return m("div",{className:"NotificationList FlagList"},m("div",{className:"NotificationList-header"},m("h4",{className:"App-titleControl App-titleControl--text"},s().translator.trans("flarum-flags.forum.flagged_posts.title"))),m("div",{className:"NotificationList-content"},m("ul",{className:"NotificationGroup-content"},t.length?t.map((function(t){var a=t.post();return m("li",null,m(O(),{href:s().route.post(a),className:"Notification Flag",onclick:function(t){s().flags.index=a,t.redraw=!1}},j()(a.user()),E()("fas fa-flag",{className:"Notification-icon"}),m("span",{className:"Notification-content"},s().translator.trans("flarum-flags.forum.flagged_posts.item_text",{username:S()(a.user()),em:m("em",null),discussion:a.discussion().title()})),H()(t.createdAt()),m("div",{className:"Notification-excerpt"},a.contentPlain())))})):this.state.loading?m(L(),{className:"LoadingIndicator--block"}):m("div",{className:"NotificationList-empty"},s().translator.trans("flarum-flags.forum.flagged_posts.empty_text")))))},a}(D()),G=function(t){function a(){return t.apply(this,arguments)||this}f(a,t),a.initAttrs=function(a){a.label=a.label||s().translator.trans("flarum-flags.forum.flagged_posts.tooltip"),a.icon=a.icon||"fas fa-flag",t.initAttrs.call(this,a)};var o=a.prototype;return o.getMenu=function(){return m("div",{className:"Dropdown-menu "+this.attrs.menuClassName,onclick:this.menuClick.bind(this)},this.showing&&m(U,{state:this.attrs.state}))},o.goToRoute=function(){m.route.set(s().route("flags"))},o.getUnreadCount=function(){return s().flags.cache?s().flags.cache.length:s().forum.attribute("flagCount")},o.getNewCount=function(){return s().session.user.attribute("newFlagCount")},a}(P());function q(){(0,n.extend)(k().prototype,"items",(function(t){s().forum.attribute("canViewFlags")&&t.add("flags",m(G,{state:s().flags}),15)}))}const z=flarum.core.compat["forum/components/Post"];var V=t.n(z);const J=flarum.core.compat["common/utils/humanTime"];var K=t.n(J);function Q(){(0,n.extend)(V().prototype,"elementAttrs",(function(t){this.attrs.post.flags().length&&(t.className+=" Post--flagged")})),V().prototype.dismissFlag=function(t){var a=this.attrs.post;return delete a.data.relationships.flags,this.subtree.invalidate(),s().flags.cache&&s().flags.cache.some((function(t,o){if(t.post()===a){if(s().flags.cache.splice(o,1),s().flags.index===a){var e=s().flags.cache[o];if(e||(e=s().flags.cache[0]),e){var n=e.post();s().flags.index=n,m.route.set(s().route.post(n))}}return!0}})),s().request({url:s().forum.attribute("apiUrl")+a.apiEndpoint()+"/flags",method:"DELETE",body:t})},V().prototype.flagActionItems=function(){var t=this,a=new(y()),o=l().destructiveControls(this.attrs.post);return Object.keys(o.items).forEach((function(a){var s=o.get(a).attrs;s.className="Button",(0,n.extend)(s,"onclick",(function(){return t.dismissFlag()}))})),a.add("controls",m("div",{className:"ButtonGroup"},o.toArray())),a.add("dismiss",m(c(),{className:"Button",icon:"far fa-eye-slash",onclick:this.dismissFlag.bind(this)},s().translator.trans("flarum-flags.forum.post.dismiss_flag_button")),-100),a},(0,n.extend)(V().prototype,"content",(function(t){var a=this,o=this.attrs.post,s=o.flags();s.length&&(o.isHidden()&&(this.revealContent=!0),t.unshift(m("div",{className:"Post-flagged"},m("div",{className:"Post-flagged-flags"},s.map((function(t){return m("div",{className:"Post-flagged-flag"},a.flagReason(t))}))),m("div",{className:"Post-flagged-actions"},this.flagActionItems().toArray()))))})),V().prototype.flagReason=function(t){if("user"===t.type()){var a=t.user(),o=t.reason()?s().translator.trans("flarum-flags.forum.flag_post.reason_"+t.reason()+"_label"):null,e=t.reasonDetail(),n=K()(t.createdAt());return[s().translator.trans(o?"flarum-flags.forum.post.flagged_by_with_reason_text":"flarum-flags.forum.post.flagged_by_text",{time:n,user:a,reason:o}),!!e&&m("span",{className:"Post-flagged-detail"},e)]}}}const W=flarum.core.compat["common/extenders"];var X=t.n(W);const Y=flarum.core.compat["common/models/Post"];var Z=t.n(Y);const $=flarum.core.compat["components/Page"];var tt=function(t){function a(){return t.apply(this,arguments)||this}f(a,t);var o=a.prototype;return o.oninit=function(a){t.prototype.oninit.call(this,a),s().history.push("flags"),s().flags.load(),this.bodyClass="App--flags"},o.view=function(){return m("div",{className:"FlagsPage"},m(U,{state:s().flags}))},a}(t.n($)());const at=flarum.core.compat["common/Model"];var ot=t.n(at),st=function(t){function a(){return t.apply(this,arguments)||this}f(a,t);var o=a.prototype;return o.type=function(){return ot().attribute("type").call(this)},o.reason=function(){return ot().attribute("reason").call(this)},o.reasonDetail=function(){return ot().attribute("reasonDetail").call(this)},o.createdAt=function(){return ot().attribute("createdAt",ot().transformDate).call(this)},o.post=function(){return ot().hasOne("post").call(this)},o.user=function(){return ot().hasOne("user").call(this)},a}(ot());const et=[(new(X().Routes)).add("flags","/flags",tt),(new(X().Store)).add("flags",st),new(X().Model)(Z()).hasMany("flags").attribute("canFlag")],nt={"flags/addFlagsToPosts":Q,"flags/addFlagControl":F,"flags/addFlagsDropdown":q,"flags/models/Flag":st,"flags/components/FlagList":U,"flags/components/FlagPostModal":N,"flags/components/FlagsPage":tt,"flags/components/FlagsDropdown":G},rt=flarum.core;s().initializers.add("flarum-flags",(function(){s().flags=new e(s()),F(),q(),Q()})),Object.assign(rt.compat,nt)})(),module.exports=a})(); //# sourceMappingURL=forum.js.map \ No newline at end of file diff --git a/js/dist/forum.js.map b/js/dist/forum.js.map index 6f789c4..b0b9e46 100644 --- a/js/dist/forum.js.map +++ b/js/dist/forum.js.map @@ -1 +1 @@ -{"version":3,"file":"forum.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa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,WACE,IAAIC,IAAAA,SACDnF,IAAI,QAAS,SAAU8E,KAE1B,IAAIK,IAAAA,QACDnF,IAAI,QAASiF,IAEhB,IAAIE,IAAAA,OAAa5B,KACd6B,QAAc,SACd7H,UAAmB,YCLxB,IACE,wBAAyB8H,EACzB,uBAAwBC,EACxB,yBAA0BC,EAC1B,oBAAqBN,GACrB,4BAA6BvD,EAC7B,iCAAkC7C,EAClC,6BAA8BiG,GAC9B,iCAAkCtC,GCjB9B,GAA+B5F,OAAOC,KCS5CG,IAAAA,aAAAA,IAAqB,gBAAgB,WACnCA,IAAAA,MAAY,IAAID,EAAcC,KAE9BsI,IACAC,IACAF,GACF,IAMArJ,OAAOwJ,OAAO1I,GAAAA,OAAQ2I,G","sources":["webpack://@flarum/flags/webpack/bootstrap","webpack://@flarum/flags/webpack/runtime/compat get default export","webpack://@flarum/flags/webpack/runtime/define property getters","webpack://@flarum/flags/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/flags/webpack/runtime/make namespace object","webpack://@flarum/flags/external root \"flarum.core.compat['forum/app']\"","webpack://@flarum/flags/./src/forum/states/FlagListState.js","webpack://@flarum/flags/external root \"flarum.core.compat['common/extend']\"","webpack://@flarum/flags/external root \"flarum.core.compat['forum/utils/PostControls']\"","webpack://@flarum/flags/external root \"flarum.core.compat['common/components/Button']\"","webpack://@flarum/flags/../../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@flarum/flags/../../../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@flarum/flags/external root \"flarum.core.compat['common/components/Modal']\"","webpack://@flarum/flags/external root \"flarum.core.compat['common/utils/Stream']\"","webpack://@flarum/flags/external root \"flarum.core.compat['common/utils/withAttr']\"","webpack://@flarum/flags/external root \"flarum.core.compat['common/utils/ItemList']\"","webpack://@flarum/flags/./src/forum/components/FlagPostModal.js","webpack://@flarum/flags/./src/forum/addFlagControl.js","webpack://@flarum/flags/external root \"flarum.core.compat['forum/components/HeaderSecondary']\"","webpack://@flarum/flags/external root \"flarum.core.compat['components/NotificationsDropdown']\"","webpack://@flarum/flags/external root \"flarum.core.compat['common/Component']\"","webpack://@flarum/flags/external root \"flarum.core.compat['common/components/Link']\"","webpack://@flarum/flags/external root \"flarum.core.compat['common/components/LoadingIndicator']\"","webpack://@flarum/flags/external root \"flarum.core.compat['common/helpers/avatar']\"","webpack://@flarum/flags/external root \"flarum.core.compat['common/helpers/username']\"","webpack://@flarum/flags/external root \"flarum.core.compat['common/helpers/icon']\"","webpack://@flarum/flags/external root \"flarum.core.compat['common/helpers/humanTime']\"","webpack://@flarum/flags/./src/forum/components/FlagList.js","webpack://@flarum/flags/./src/forum/components/FlagsDropdown.js","webpack://@flarum/flags/./src/forum/addFlagsDropdown.js","webpack://@flarum/flags/external root \"flarum.core.compat['forum/components/Post']\"","webpack://@flarum/flags/external root \"flarum.core.compat['common/utils/humanTime']\"","webpack://@flarum/flags/./src/forum/addFlagsToPosts.js","webpack://@flarum/flags/external root \"flarum.core.compat['common/extenders']\"","webpack://@flarum/flags/external root \"flarum.core.compat['common/models/Post']\"","webpack://@flarum/flags/external root \"flarum.core.compat['components/Page']\"","webpack://@flarum/flags/./src/forum/components/FlagsPage.js","webpack://@flarum/flags/external root \"flarum.core.compat['common/Model']\"","webpack://@flarum/flags/./src/forum/models/Flag.ts","webpack://@flarum/flags/./src/forum/extend.ts","webpack://@flarum/flags/./src/forum/compat.js","webpack://@flarum/flags/external assign \"flarum.core\"","webpack://@flarum/flags/./src/forum/index.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/app'];","export default class FlagListState {\n constructor(app) {\n this.app = app;\n\n /**\n * Whether or not the flags are loading.\n *\n * @type {Boolean}\n */\n this.loading = false;\n }\n\n /**\n * Load flags into the application's cache if they haven't already\n * been loaded.\n */\n load() {\n if (this.cache && !this.app.session.user.attribute('newFlagCount')) {\n return;\n }\n\n this.loading = true;\n m.redraw();\n\n this.app.store\n .find('flags')\n .then((flags) => {\n this.app.session.user.pushAttributes({ newFlagCount: 0 });\n this.cache = flags.sort((a, b) => b.createdAt() - a.createdAt());\n })\n .catch(() => {})\n .then(() => {\n this.loading = false;\n m.redraw();\n });\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/utils/PostControls'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Modal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/Stream'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/withAttr'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/ItemList'];","import app from 'flarum/forum/app';\nimport Modal from 'flarum/common/components/Modal';\nimport Button from 'flarum/common/components/Button';\n\nimport Stream from 'flarum/common/utils/Stream';\nimport withAttr from 'flarum/common/utils/withAttr';\nimport ItemList from 'flarum/common/utils/ItemList';\n\nexport default class FlagPostModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.success = false;\n\n this.reason = Stream('');\n this.reasonDetail = Stream('');\n }\n\n className() {\n return 'FlagPostModal Modal--medium';\n }\n\n title() {\n return app.translator.trans('flarum-flags.forum.flag_post.title');\n }\n\n content() {\n if (this.success) {\n return (\n
\n
\n

{app.translator.trans('flarum-flags.forum.flag_post.confirmation_message')}

\n
\n \n
\n
\n
\n );\n }\n\n return (\n
\n
\n
\n
{this.flagReasons().toArray()}
\n
\n\n
\n \n
\n
\n
\n );\n }\n\n flagReasons() {\n const items = new ItemList();\n const guidelinesUrl = app.forum.attribute('guidelinesUrl');\n\n items.add(\n 'off-topic',\n ,\n 70\n );\n\n items.add(\n 'inappropriate',\n ,\n 60\n );\n\n items.add(\n 'spam',\n ,\n 50\n );\n\n items.add(\n 'other',\n ,\n 10\n );\n\n return items;\n }\n\n onsubmit(e) {\n e.preventDefault();\n\n this.loading = true;\n\n app.store\n .createRecord('flags')\n .save(\n {\n reason: this.reason() === 'other' ? null : this.reason(),\n reasonDetail: this.reasonDetail(),\n relationships: {\n user: app.session.user,\n post: this.attrs.post,\n },\n },\n { errorHandler: this.onerror.bind(this) }\n )\n .then(() => (this.success = true))\n .catch(() => {})\n .then(this.loaded.bind(this));\n }\n}\n","import { extend } from 'flarum/common/extend';\nimport app from 'flarum/forum/app';\nimport PostControls from 'flarum/forum/utils/PostControls';\nimport Button from 'flarum/common/components/Button';\n\nimport FlagPostModal from './components/FlagPostModal';\n\nexport default function () {\n extend(PostControls, 'userControls', function (items, post) {\n if (post.isHidden() || post.contentType() !== 'comment' || !post.canFlag()) return;\n\n items.add(\n 'flag',\n \n );\n });\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/HeaderSecondary'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['components/NotificationsDropdown'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Link'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LoadingIndicator'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/avatar'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/username'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/icon'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/humanTime'];","import app from 'flarum/forum/app';\nimport Component from 'flarum/common/Component';\nimport Link from 'flarum/common/components/Link';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport avatar from 'flarum/common/helpers/avatar';\nimport username from 'flarum/common/helpers/username';\nimport icon from 'flarum/common/helpers/icon';\nimport humanTime from 'flarum/common/helpers/humanTime';\n\nexport default class FlagList extends Component {\n oninit(vnode) {\n super.oninit(vnode);\n this.state = this.attrs.state;\n }\n\n view() {\n const flags = this.state.cache || [];\n\n return (\n
\n
\n

{app.translator.trans('flarum-flags.forum.flagged_posts.title')}

\n
\n
\n
    \n {flags.length ? (\n flags.map((flag) => {\n const post = flag.post();\n\n return (\n
  • \n {\n app.flags.index = post;\n e.redraw = false;\n }}\n >\n {avatar(post.user())}\n {icon('fas fa-flag', { className: 'Notification-icon' })}\n \n {app.translator.trans('flarum-flags.forum.flagged_posts.item_text', {\n username: username(post.user()),\n em: ,\n discussion: post.discussion().title(),\n })}\n \n {humanTime(flag.createdAt())}\n
    {post.contentPlain()}
    \n \n
  • \n );\n })\n ) : !this.state.loading ? (\n
    {app.translator.trans('flarum-flags.forum.flagged_posts.empty_text')}
    \n ) : (\n LoadingIndicator.component({ className: 'LoadingIndicator--block' })\n )}\n
\n
\n
\n );\n }\n}\n","import app from 'flarum/forum/app';\nimport NotificationsDropdown from 'flarum/components/NotificationsDropdown';\n\nimport FlagList from './FlagList';\n\nexport default class FlagsDropdown extends NotificationsDropdown {\n static initAttrs(attrs) {\n attrs.label = attrs.label || app.translator.trans('flarum-flags.forum.flagged_posts.tooltip');\n attrs.icon = attrs.icon || 'fas fa-flag';\n\n super.initAttrs(attrs);\n }\n\n getMenu() {\n return (\n
\n {this.showing ? FlagList.component({ state: this.attrs.state }) : ''}\n
\n );\n }\n\n goToRoute() {\n m.route.set(app.route('flags'));\n }\n\n getUnreadCount() {\n return app.flags.cache ? app.flags.cache.length : app.forum.attribute('flagCount');\n }\n\n getNewCount() {\n return app.session.user.attribute('newFlagCount');\n }\n}\n","import { extend } from 'flarum/common/extend';\nimport app from 'flarum/forum/app';\nimport HeaderSecondary from 'flarum/forum/components/HeaderSecondary';\nimport FlagsDropdown from './components/FlagsDropdown';\n\nexport default function () {\n extend(HeaderSecondary.prototype, 'items', function (items) {\n if (app.forum.attribute('canViewFlags')) {\n items.add('flags', , 15);\n }\n });\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/Post'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/humanTime'];","import { extend } from 'flarum/common/extend';\nimport app from 'flarum/forum/app';\nimport Post from 'flarum/forum/components/Post';\nimport Button from 'flarum/common/components/Button';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport PostControls from 'flarum/forum/utils/PostControls';\nimport humanTime from 'flarum/common/utils/humanTime';\n\nexport default function () {\n extend(Post.prototype, 'elementAttrs', function (attrs) {\n if (this.attrs.post.flags().length) {\n attrs.className += ' Post--flagged';\n }\n });\n\n Post.prototype.dismissFlag = function (body) {\n const post = this.attrs.post;\n\n delete post.data.relationships.flags;\n\n this.subtree.invalidate();\n\n if (app.flags.cache) {\n app.flags.cache.some((flag, i) => {\n if (flag.post() === post) {\n app.flags.cache.splice(i, 1);\n\n if (app.flags.index === post) {\n let next = app.flags.cache[i];\n\n if (!next) next = app.flags.cache[0];\n\n if (next) {\n const nextPost = next.post();\n app.flags.index = nextPost;\n m.route.set(app.route.post(nextPost));\n }\n }\n\n return true;\n }\n });\n }\n\n return app.request({\n url: app.forum.attribute('apiUrl') + post.apiEndpoint() + '/flags',\n method: 'DELETE',\n body,\n });\n };\n\n Post.prototype.flagActionItems = function () {\n const items = new ItemList();\n\n const controls = PostControls.destructiveControls(this.attrs.post);\n\n Object.keys(controls.items).forEach((k) => {\n const attrs = controls.get(k).attrs;\n\n attrs.className = 'Button';\n\n extend(attrs, 'onclick', () => this.dismissFlag());\n });\n\n items.add('controls',
{controls.toArray()}
);\n\n items.add(\n 'dismiss',\n ,\n -100\n );\n\n return items;\n };\n\n extend(Post.prototype, 'content', function (vdom) {\n const post = this.attrs.post;\n const flags = post.flags();\n\n if (!flags.length) return;\n\n if (post.isHidden()) this.revealContent = true;\n\n vdom.unshift(\n
\n
\n {flags.map((flag) => (\n
{this.flagReason(flag)}
\n ))}\n
\n
{this.flagActionItems().toArray()}
\n
\n );\n });\n\n Post.prototype.flagReason = function (flag) {\n if (flag.type() === 'user') {\n const user = flag.user();\n const reason = flag.reason() ? app.translator.trans(`flarum-flags.forum.flag_post.reason_${flag.reason()}_label`) : null;\n const detail = flag.reasonDetail();\n const time = humanTime(flag.createdAt());\n\n return [\n app.translator.trans(reason ? 'flarum-flags.forum.post.flagged_by_with_reason_text' : 'flarum-flags.forum.post.flagged_by_text', {\n time,\n user,\n reason,\n }),\n detail ? {detail} : '',\n ];\n }\n };\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extenders'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Post'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['components/Page'];","import app from 'flarum/forum/app';\nimport Page from 'flarum/components/Page';\n\nimport FlagList from './FlagList';\n\n/**\n * The `FlagsPage` component shows the flags list. It is only\n * used on mobile devices where the flags dropdown is within the drawer.\n */\nexport default class FlagsPage extends Page {\n oninit(vnode) {\n super.oninit(vnode);\n\n app.history.push('flags');\n\n app.flags.load();\n\n this.bodyClass = 'App--flags';\n }\n\n view() {\n return (\n
\n \n
\n );\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","import Model from 'flarum/common/Model';\nimport type Post from 'flarum/common/models/Post';\nimport type User from 'flarum/common/models/User';\n\nexport default class Flag extends Model {\n type() {\n return Model.attribute('type').call(this);\n }\n reason() {\n return Model.attribute('reason').call(this);\n }\n reasonDetail() {\n return Model.attribute('reasonDetail').call(this);\n }\n createdAt() {\n return Model.attribute('createdAt', Model.transformDate).call(this);\n }\n\n post() {\n return Model.hasOne('post').call(this);\n }\n user() {\n return Model.hasOne('user').call(this);\n }\n}\n","import Extend from 'flarum/common/extenders';\nimport Post from 'flarum/common/models/Post';\nimport FlagsPage from './components/FlagsPage';\nimport Flag from './models/Flag';\n\nexport default [\n new Extend.Routes() //\n .add('flags', '/flags', FlagsPage),\n\n new Extend.Store() //\n .add('flags', Flag),\n\n new Extend.Model(Post) //\n .hasMany('flags')\n .attribute('canFlag'),\n];\n","import addFlagsToPosts from './addFlagsToPosts';\nimport addFlagControl from './addFlagControl';\nimport addFlagsDropdown from './addFlagsDropdown';\nimport Flag from './models/Flag';\nimport FlagList from './components/FlagList';\nimport FlagPostModal from './components/FlagPostModal';\nimport FlagsPage from './components/FlagsPage';\nimport FlagsDropdown from './components/FlagsDropdown';\n\nexport default {\n 'flags/addFlagsToPosts': addFlagsToPosts,\n 'flags/addFlagControl': addFlagControl,\n 'flags/addFlagsDropdown': addFlagsDropdown,\n 'flags/models/Flag': Flag,\n 'flags/components/FlagList': FlagList,\n 'flags/components/FlagPostModal': FlagPostModal,\n 'flags/components/FlagsPage': FlagsPage,\n 'flags/components/FlagsDropdown': FlagsDropdown,\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core;","import app from 'flarum/forum/app';\n\nimport FlagListState from './states/FlagListState';\nimport addFlagControl from './addFlagControl';\nimport addFlagsDropdown from './addFlagsDropdown';\nimport addFlagsToPosts from './addFlagsToPosts';\n\nexport { default as extend } from './extend';\n\napp.initializers.add('flarum-flags', () => {\n app.flags = new FlagListState(app);\n\n addFlagControl();\n addFlagsDropdown();\n addFlagsToPosts();\n});\n\n// Expose compat API\nimport flagsCompat from './compat';\nimport { compat } from '@flarum/core/forum';\n\nObject.assign(compat, flagsCompat);\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","FlagListState","app","this","loading","load","cache","session","user","attribute","m","redraw","store","find","then","flags","pushAttributes","newFlagCount","sort","b","createdAt","_setPrototypeOf","p","setPrototypeOf","bind","__proto__","_inheritsLoose","subClass","superClass","create","constructor","FlagPostModal","oninit","vnode","success","reason","Stream","reasonDetail","className","title","content","onclick","hide","flagReasons","toArray","type","disabled","items","ItemList","guidelinesUrl","add","name","checked","withAttr","placeholder","oninput","href","target","undefined","onsubmit","e","preventDefault","save","relationships","post","attrs","errorHandler","onerror","loaded","Modal","extend","PostControls","isHidden","contentType","canFlag","icon","FlagList","state","view","length","map","flag","avatar","username","em","discussion","humanTime","contentPlain","LoadingIndicator","Component","FlagsDropdown","initAttrs","label","getMenu","menuClassName","menuClick","showing","component","goToRoute","route","set","getUnreadCount","getNewCount","NotificationsDropdown","HeaderSecondary","Post","body","data","subtree","invalidate","i","next","nextPost","url","apiEndpoint","method","controls","keys","forEach","k","dismissFlag","vdom","revealContent","unshift","flagReason","flagActionItems","detail","time","FlagsPage","bodyClass","Page","Flag","Model","Extend","hasMany","addFlagsToPosts","addFlagControl","addFlagsDropdown","assign","flagsCompat"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"forum.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,sDCL9D,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,a,aCAnCC,EAAa,WAChC,WAAYC,GACVC,KAAKD,IAAMA,EAOXC,KAAKC,SAAU,CACjB,CAyBC,OAvBD,YAIAC,KAAA,WAAO,WACDF,KAAKG,QAAUH,KAAKD,IAAIK,QAAQC,KAAKC,UAAU,kBAInDN,KAAKC,SAAU,EACfM,EAAEC,SAEFR,KAAKD,IAAIU,MACNC,KAAK,SACLC,MAAK,SAACC,GACL,EAAKb,IAAIK,QAAQC,KAAKQ,eAAe,CAAEC,aAAc,IACrD,EAAKX,MAAQS,EAAMG,MAAK,SAACrC,EAAGsC,GAAC,OAAKA,EAAEC,YAAcvC,EAAEuC,WAAW,GACjE,IAAE,OACK,WAAO,IACbN,MAAK,WACJ,EAAKV,SAAU,EACfM,EAAEC,QACJ,IACJ,EAAC,EAnC+B,GCAlC,MAAM,EAA+Bb,OAA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ICTvC,MAAM,GAA+BlI,OAAOC,KAAKC,OAAO,gB,eCInCiI,GAAI,uFAmBtB,OAnBsB,EACvBpF,KAAA,WACE,OAAOqF,KAAAA,UAAwB,QAAQxI,KAAKS,KAC9C,EAAC,EACDgC,OAAA,WACE,OAAO+F,KAAAA,UAA+B,UAAUxI,KAAKS,KACvD,EAAC,EACDkC,aAAA,WACE,OAAO6F,KAAAA,UAA+B,gBAAgBxI,KAAKS,KAC7D,EAAC,EACDiB,UAAA,WACE,OAAO8G,KAAAA,UAAgB,YAAaA,KAAAA,eAAqBxI,KAAKS,KAChE,EAAC,EAED6D,KAAA,WACE,OAAOkE,KAAAA,OAAmB,QAAQxI,KAAKS,KACzC,EAAC,EACDK,KAAA,WACE,OAAO0H,KAAAA,OAA0B,QAAQxI,KAAKS,KAChD,EAAC,EAnBsB,CAAS+H,MCClC,WACE,IAAIC,IAAAA,SACDjF,IAAI,QAAS,SAAU4E,KAE1B,IAAIK,IAAAA,QACDjF,IAAI,QAAS+E,IAEhB,IAAIE,IAAAA,OAAa5B,KACd6B,QAAc,SACd3H,UAAmB,YCLxB,IACE,wBAAyB4H,EACzB,uBAAwBC,EACxB,yBAA0BC,EAC1B,oBAAqBN,GACrB,4BAA6BrD,EAC7B,iCAAkC7C,EAClC,6BAA8B+F,GAC9B,iCAAkCrC,GCjB9B,GAA+B3F,OAAOC,KCS5CG,IAAAA,aAAAA,IAAqB,gBAAgB,WACnCA,IAAAA,MAAY,IAAID,EAAcC,KAE9BoI,IACAC,IACAF,GACF,IAMAnJ,OAAOsJ,OAAOxI,GAAAA,OAAQyI,G","sources":["webpack://@flarum/flags/webpack/bootstrap","webpack://@flarum/flags/webpack/runtime/compat get default export","webpack://@flarum/flags/webpack/runtime/define property getters","webpack://@flarum/flags/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/flags/webpack/runtime/make namespace object","webpack://@flarum/flags/external root \"flarum.core.compat['forum/app']\"","webpack://@flarum/flags/./src/forum/states/FlagListState.js","webpack://@flarum/flags/external root \"flarum.core.compat['common/extend']\"","webpack://@flarum/flags/external root \"flarum.core.compat['forum/utils/PostControls']\"","webpack://@flarum/flags/external root \"flarum.core.compat['common/components/Button']\"","webpack://@flarum/flags/../../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@flarum/flags/../../../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@flarum/flags/external root \"flarum.core.compat['common/components/Modal']\"","webpack://@flarum/flags/external root \"flarum.core.compat['common/utils/Stream']\"","webpack://@flarum/flags/external root \"flarum.core.compat['common/utils/withAttr']\"","webpack://@flarum/flags/external root \"flarum.core.compat['common/utils/ItemList']\"","webpack://@flarum/flags/./src/forum/components/FlagPostModal.js","webpack://@flarum/flags/./src/forum/addFlagControl.js","webpack://@flarum/flags/external root \"flarum.core.compat['forum/components/HeaderSecondary']\"","webpack://@flarum/flags/external root \"flarum.core.compat['forum/components/NotificationsDropdown']\"","webpack://@flarum/flags/external root \"flarum.core.compat['common/Component']\"","webpack://@flarum/flags/external root \"flarum.core.compat['common/components/Link']\"","webpack://@flarum/flags/external root \"flarum.core.compat['common/components/LoadingIndicator']\"","webpack://@flarum/flags/external root \"flarum.core.compat['common/helpers/avatar']\"","webpack://@flarum/flags/external root \"flarum.core.compat['common/helpers/username']\"","webpack://@flarum/flags/external root \"flarum.core.compat['common/helpers/icon']\"","webpack://@flarum/flags/external root \"flarum.core.compat['common/helpers/humanTime']\"","webpack://@flarum/flags/./src/forum/components/FlagList.js","webpack://@flarum/flags/./src/forum/components/FlagsDropdown.js","webpack://@flarum/flags/./src/forum/addFlagsDropdown.js","webpack://@flarum/flags/external root \"flarum.core.compat['forum/components/Post']\"","webpack://@flarum/flags/external root \"flarum.core.compat['common/utils/humanTime']\"","webpack://@flarum/flags/./src/forum/addFlagsToPosts.js","webpack://@flarum/flags/external root \"flarum.core.compat['common/extenders']\"","webpack://@flarum/flags/external root \"flarum.core.compat['common/models/Post']\"","webpack://@flarum/flags/external root \"flarum.core.compat['components/Page']\"","webpack://@flarum/flags/./src/forum/components/FlagsPage.js","webpack://@flarum/flags/external root \"flarum.core.compat['common/Model']\"","webpack://@flarum/flags/./src/forum/models/Flag.ts","webpack://@flarum/flags/./src/forum/extend.ts","webpack://@flarum/flags/./src/forum/compat.js","webpack://@flarum/flags/external assign \"flarum.core\"","webpack://@flarum/flags/./src/forum/index.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/app'];","export default class FlagListState {\n constructor(app) {\n this.app = app;\n\n /**\n * Whether or not the flags are loading.\n *\n * @type {Boolean}\n */\n this.loading = false;\n }\n\n /**\n * Load flags into the application's cache if they haven't already\n * been loaded.\n */\n load() {\n if (this.cache && !this.app.session.user.attribute('newFlagCount')) {\n return;\n }\n\n this.loading = true;\n m.redraw();\n\n this.app.store\n .find('flags')\n .then((flags) => {\n this.app.session.user.pushAttributes({ newFlagCount: 0 });\n this.cache = flags.sort((a, b) => b.createdAt() - a.createdAt());\n })\n .catch(() => {})\n .then(() => {\n this.loading = false;\n m.redraw();\n });\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/utils/PostControls'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n setPrototypeOf(subClass, superClass);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Modal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/Stream'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/withAttr'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/ItemList'];","import app from 'flarum/forum/app';\nimport Modal from 'flarum/common/components/Modal';\nimport Button from 'flarum/common/components/Button';\n\nimport Stream from 'flarum/common/utils/Stream';\nimport withAttr from 'flarum/common/utils/withAttr';\nimport ItemList from 'flarum/common/utils/ItemList';\n\nexport default class FlagPostModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.success = false;\n\n this.reason = Stream('');\n this.reasonDetail = Stream('');\n }\n\n className() {\n return 'FlagPostModal Modal--medium';\n }\n\n title() {\n return app.translator.trans('flarum-flags.forum.flag_post.title');\n }\n\n content() {\n if (this.success) {\n return (\n
\n
\n

{app.translator.trans('flarum-flags.forum.flag_post.confirmation_message')}

\n
\n \n
\n
\n
\n );\n }\n\n return (\n
\n
\n
\n
{this.flagReasons().toArray()}
\n
\n\n
\n \n
\n
\n
\n );\n }\n\n flagReasons() {\n const items = new ItemList();\n const guidelinesUrl = app.forum.attribute('guidelinesUrl');\n\n items.add(\n 'off-topic',\n ,\n 70\n );\n\n items.add(\n 'inappropriate',\n
: undefined,\n })}\n {this.reason() === 'inappropriate' && (\n \n )}\n ,\n 60\n );\n\n items.add(\n 'spam',\n ,\n 50\n );\n\n items.add(\n 'other',\n ,\n 10\n );\n\n return items;\n }\n\n onsubmit(e) {\n e.preventDefault();\n\n this.loading = true;\n\n app.store\n .createRecord('flags')\n .save(\n {\n reason: this.reason() === 'other' ? null : this.reason(),\n reasonDetail: this.reasonDetail(),\n relationships: {\n user: app.session.user,\n post: this.attrs.post,\n },\n },\n { errorHandler: this.onerror.bind(this) }\n )\n .then(() => (this.success = true))\n .catch(() => {})\n .then(this.loaded.bind(this));\n }\n}\n","import { extend } from 'flarum/common/extend';\nimport app from 'flarum/forum/app';\nimport PostControls from 'flarum/forum/utils/PostControls';\nimport Button from 'flarum/common/components/Button';\n\nimport FlagPostModal from './components/FlagPostModal';\n\nexport default function () {\n extend(PostControls, 'userControls', function (items, post) {\n if (post.isHidden() || post.contentType() !== 'comment' || !post.canFlag()) return;\n\n items.add(\n 'flag',\n \n );\n });\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/HeaderSecondary'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/NotificationsDropdown'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Link'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LoadingIndicator'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/avatar'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/username'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/icon'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/humanTime'];","import app from 'flarum/forum/app';\nimport Component from 'flarum/common/Component';\nimport Link from 'flarum/common/components/Link';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport avatar from 'flarum/common/helpers/avatar';\nimport username from 'flarum/common/helpers/username';\nimport icon from 'flarum/common/helpers/icon';\nimport humanTime from 'flarum/common/helpers/humanTime';\n\nexport default class FlagList extends Component {\n oninit(vnode) {\n super.oninit(vnode);\n this.state = this.attrs.state;\n }\n\n view() {\n const flags = this.state.cache || [];\n\n return (\n
\n
\n

{app.translator.trans('flarum-flags.forum.flagged_posts.title')}

\n
\n
\n
    \n {flags.length ? (\n flags.map((flag) => {\n const post = flag.post();\n\n return (\n
  • \n {\n app.flags.index = post;\n e.redraw = false;\n }}\n >\n {avatar(post.user())}\n {icon('fas fa-flag', { className: 'Notification-icon' })}\n \n {app.translator.trans('flarum-flags.forum.flagged_posts.item_text', {\n username: username(post.user()),\n em: ,\n discussion: post.discussion().title(),\n })}\n \n {humanTime(flag.createdAt())}\n
    {post.contentPlain()}
    \n \n
  • \n );\n })\n ) : !this.state.loading ? (\n
    {app.translator.trans('flarum-flags.forum.flagged_posts.empty_text')}
    \n ) : (\n \n )}\n
\n
\n
\n );\n }\n}\n","import app from 'flarum/forum/app';\nimport NotificationsDropdown from 'flarum/forum/components/NotificationsDropdown';\n\nimport FlagList from './FlagList';\n\nexport default class FlagsDropdown extends NotificationsDropdown {\n static initAttrs(attrs) {\n attrs.label = attrs.label || app.translator.trans('flarum-flags.forum.flagged_posts.tooltip');\n attrs.icon = attrs.icon || 'fas fa-flag';\n\n super.initAttrs(attrs);\n }\n\n getMenu() {\n return (\n
\n {this.showing && }\n
\n );\n }\n\n goToRoute() {\n m.route.set(app.route('flags'));\n }\n\n getUnreadCount() {\n return app.flags.cache ? app.flags.cache.length : app.forum.attribute('flagCount');\n }\n\n getNewCount() {\n return app.session.user.attribute('newFlagCount');\n }\n}\n","import { extend } from 'flarum/common/extend';\nimport app from 'flarum/forum/app';\nimport HeaderSecondary from 'flarum/forum/components/HeaderSecondary';\nimport FlagsDropdown from './components/FlagsDropdown';\n\nexport default function () {\n extend(HeaderSecondary.prototype, 'items', function (items) {\n if (app.forum.attribute('canViewFlags')) {\n items.add('flags', , 15);\n }\n });\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/Post'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/humanTime'];","import { extend } from 'flarum/common/extend';\nimport app from 'flarum/forum/app';\nimport Post from 'flarum/forum/components/Post';\nimport Button from 'flarum/common/components/Button';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport PostControls from 'flarum/forum/utils/PostControls';\nimport humanTime from 'flarum/common/utils/humanTime';\n\nexport default function () {\n extend(Post.prototype, 'elementAttrs', function (attrs) {\n if (this.attrs.post.flags().length) {\n attrs.className += ' Post--flagged';\n }\n });\n\n Post.prototype.dismissFlag = function (body) {\n const post = this.attrs.post;\n\n delete post.data.relationships.flags;\n\n this.subtree.invalidate();\n\n if (app.flags.cache) {\n app.flags.cache.some((flag, i) => {\n if (flag.post() === post) {\n app.flags.cache.splice(i, 1);\n\n if (app.flags.index === post) {\n let next = app.flags.cache[i];\n\n if (!next) next = app.flags.cache[0];\n\n if (next) {\n const nextPost = next.post();\n app.flags.index = nextPost;\n m.route.set(app.route.post(nextPost));\n }\n }\n\n return true;\n }\n });\n }\n\n return app.request({\n url: app.forum.attribute('apiUrl') + post.apiEndpoint() + '/flags',\n method: 'DELETE',\n body,\n });\n };\n\n Post.prototype.flagActionItems = function () {\n const items = new ItemList();\n\n const controls = PostControls.destructiveControls(this.attrs.post);\n\n Object.keys(controls.items).forEach((k) => {\n const attrs = controls.get(k).attrs;\n\n attrs.className = 'Button';\n\n extend(attrs, 'onclick', () => this.dismissFlag());\n });\n\n items.add('controls',
{controls.toArray()}
);\n\n items.add(\n 'dismiss',\n ,\n -100\n );\n\n return items;\n };\n\n extend(Post.prototype, 'content', function (vdom) {\n const post = this.attrs.post;\n const flags = post.flags();\n\n if (!flags.length) return;\n\n if (post.isHidden()) this.revealContent = true;\n\n vdom.unshift(\n
\n
\n {flags.map((flag) => (\n
{this.flagReason(flag)}
\n ))}\n
\n
{this.flagActionItems().toArray()}
\n
\n );\n });\n\n Post.prototype.flagReason = function (flag) {\n if (flag.type() === 'user') {\n const user = flag.user();\n const reason = flag.reason() ? app.translator.trans(`flarum-flags.forum.flag_post.reason_${flag.reason()}_label`) : null;\n const detail = flag.reasonDetail();\n const time = humanTime(flag.createdAt());\n\n return [\n app.translator.trans(reason ? 'flarum-flags.forum.post.flagged_by_with_reason_text' : 'flarum-flags.forum.post.flagged_by_text', {\n time,\n user,\n reason,\n }),\n !!detail && {detail},\n ];\n }\n };\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extenders'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Post'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['components/Page'];","import app from 'flarum/forum/app';\nimport Page from 'flarum/components/Page';\n\nimport FlagList from './FlagList';\n\n/**\n * The `FlagsPage` component shows the flags list. It is only\n * used on mobile devices where the flags dropdown is within the drawer.\n */\nexport default class FlagsPage extends Page {\n oninit(vnode) {\n super.oninit(vnode);\n\n app.history.push('flags');\n\n app.flags.load();\n\n this.bodyClass = 'App--flags';\n }\n\n view() {\n return (\n
\n \n
\n );\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","import Model from 'flarum/common/Model';\nimport type Post from 'flarum/common/models/Post';\nimport type User from 'flarum/common/models/User';\n\nexport default class Flag extends Model {\n type() {\n return Model.attribute('type').call(this);\n }\n reason() {\n return Model.attribute('reason').call(this);\n }\n reasonDetail() {\n return Model.attribute('reasonDetail').call(this);\n }\n createdAt() {\n return Model.attribute('createdAt', Model.transformDate).call(this);\n }\n\n post() {\n return Model.hasOne('post').call(this);\n }\n user() {\n return Model.hasOne('user').call(this);\n }\n}\n","import Extend from 'flarum/common/extenders';\nimport Post from 'flarum/common/models/Post';\nimport FlagsPage from './components/FlagsPage';\nimport Flag from './models/Flag';\n\nexport default [\n new Extend.Routes() //\n .add('flags', '/flags', FlagsPage),\n\n new Extend.Store() //\n .add('flags', Flag),\n\n new Extend.Model(Post) //\n .hasMany('flags')\n .attribute('canFlag'),\n];\n","import addFlagsToPosts from './addFlagsToPosts';\nimport addFlagControl from './addFlagControl';\nimport addFlagsDropdown from './addFlagsDropdown';\nimport Flag from './models/Flag';\nimport FlagList from './components/FlagList';\nimport FlagPostModal from './components/FlagPostModal';\nimport FlagsPage from './components/FlagsPage';\nimport FlagsDropdown from './components/FlagsDropdown';\n\nexport default {\n 'flags/addFlagsToPosts': addFlagsToPosts,\n 'flags/addFlagControl': addFlagControl,\n 'flags/addFlagsDropdown': addFlagsDropdown,\n 'flags/models/Flag': Flag,\n 'flags/components/FlagList': FlagList,\n 'flags/components/FlagPostModal': FlagPostModal,\n 'flags/components/FlagsPage': FlagsPage,\n 'flags/components/FlagsDropdown': FlagsDropdown,\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core;","import app from 'flarum/forum/app';\n\nimport FlagListState from './states/FlagListState';\nimport addFlagControl from './addFlagControl';\nimport addFlagsDropdown from './addFlagsDropdown';\nimport addFlagsToPosts from './addFlagsToPosts';\n\nexport { default as extend } from './extend';\n\napp.initializers.add('flarum-flags', () => {\n app.flags = new FlagListState(app);\n\n addFlagControl();\n addFlagsDropdown();\n addFlagsToPosts();\n});\n\n// Expose compat API\nimport flagsCompat from './compat';\nimport { compat } from '@flarum/core/forum';\n\nObject.assign(compat, flagsCompat);\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","FlagListState","app","this","loading","load","cache","session","user","attribute","m","redraw","store","find","then","flags","pushAttributes","newFlagCount","sort","b","createdAt","_setPrototypeOf","p","setPrototypeOf","bind","__proto__","_inheritsLoose","subClass","superClass","create","constructor","FlagPostModal","oninit","vnode","success","reason","Stream","reasonDetail","className","title","content","onclick","hide","flagReasons","toArray","type","disabled","items","ItemList","guidelinesUrl","add","name","checked","withAttr","placeholder","oninput","href","target","undefined","onsubmit","e","preventDefault","save","relationships","post","attrs","errorHandler","onerror","loaded","Modal","extend","PostControls","isHidden","contentType","canFlag","icon","FlagList","state","view","length","map","flag","avatar","username","em","discussion","humanTime","contentPlain","Component","FlagsDropdown","initAttrs","label","getMenu","menuClassName","menuClick","showing","goToRoute","route","set","getUnreadCount","getNewCount","NotificationsDropdown","HeaderSecondary","Post","body","data","subtree","invalidate","i","next","nextPost","url","apiEndpoint","method","controls","keys","forEach","k","dismissFlag","vdom","revealContent","unshift","flagReason","flagActionItems","detail","time","FlagsPage","bodyClass","Page","Flag","Model","Extend","hasMany","addFlagsToPosts","addFlagControl","addFlagsDropdown","assign","flagsCompat"],"sourceRoot":""} \ No newline at end of file