From 9db534c94381b6c296877eba642e3ee2bb86ef9a Mon Sep 17 00:00:00 2001 From: flarum-bot Date: Fri, 24 Mar 2023 19:35:26 +0000 Subject: [PATCH] Bundled output for commit b24f675b5f391e8a43c98eb1e1f38b8e9427f723 Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci] --- js/dist/forum.js | 2 +- js/dist/forum.js.map | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/dist/forum.js b/js/dist/forum.js index 90d246b..6b1d0ca 100644 --- a/js/dist/forum.js +++ b/js/dist/forum.js @@ -1,2 +1,2 @@ -(()=>{var t={n:e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},d:(e,n)=>{for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};(()=>{"use strict";t.r(e),t.d(e,{discussions:()=>ie,modals:()=>re});const n=flarum.core.compat["forum/app"];var o=t.n(n);function s(t,e){return s=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},s(t,e)}function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,s(t,e)}const i=flarum.core.compat["forum/components/EventPost"];var a=t.n(i),c=function(t){function e(){return t.apply(this,arguments)||this}r(e,t),e.initAttrs=function(e){t.initAttrs.call(this,e)};var n=e.prototype;return n.icon=function(){return o().forum.attribute("byobu.icon-postAction")},n.descriptionKey=function(){return"fof-byobu.forum.post.recipients_modified.made_public"},e}(a()),u=function(t){function e(){return t.apply(this,arguments)||this}r(e,t),e.initAttrs=function(e){t.initAttrs.call(this,e)};var n=e.prototype;return n.icon=function(){return o().forum.attribute("byobu.icon-postAction")},n.descriptionKey=function(){return"fof-byobu.forum.post.recipients_modified.removed_self"},e}(a());function p(t,e){if(null==t)return{};var n,o,s={},r=Object.keys(t);for(o=0;o=0||(s[n]=t[n]);return s}const l=flarum.core.compat["common/models/User"];var f=t.n(l);const d=flarum.core.compat["common/utils/classList"];var h=t.n(d);const b=flarum.core.compat["common/helpers/username"];var v=t.n(b);const y=flarum.core.compat["common/models/Group"];var g=t.n(y);const _=flarum.core.compat["common/components/LinkButton"];var P=t.n(_);const R=flarum.core.compat["common/Component"];var w=["recipient","link"],D=function(t){function e(){return t.apply(this,arguments)||this}return r(e,t),e.prototype.view=function(t){var e,n=this.attrs,s=n.recipient,r=n.link,i=p(n,w);if(i.style=i.style||{},i.className=h()("RecipientLabel",null==i?void 0:i.className),r&&s instanceof f()&&(i.href=o().route.user(s)),s instanceof f()){var a,c;e=v()(s),i.href||s.id()===(null==o()||null==(a=o().session)||null==(c=a.user)?void 0:c.id())||(i.href=o().route.user(s))}else{if(s instanceof g())return m("span",{class:i.className},s.namePlural());i.className+=" none",e=o().translator.trans("core.lib.username.deleted_text")}return m(P(),i,e)},e}(t.n(R)()),S=["link","className"];function k(t,e){void 0===e&&(e={});var n=e,o=n.link,s=n.className,r=p(n,S);return r.className=h()("RecipientsLabel",s),m("span",r,null==t?void 0:t.map((function(t,e){var n=t instanceof f()?"u":"g";return m(D,{key:n+"-"+e,recipient:t,link:o})})),!t&&m(D,null))}var x=function(t){function e(){return t.apply(this,arguments)||this}r(e,t),e.initAttrs=function(e){function n(t,e,n){return t.filter((function(t){return-1===e.indexOf(t)})).map((function(t){return o().store.getById(n,t)}))}t.initAttrs.call(this,e);var s=e.post.content();if(s.new||2!=s.length){var r=n(s.new.users,s.old.users,"users"),i=n(s.old.users,s.new.users,"users"),a=n(s.new.groups,s.old.groups,"groups"),c=n(s.old.groups,s.new.groups,"groups");e.added=r.concat(a),e.removed=i.concat(c)}else{var u=e.post.content()[0],p=e.post.content()[1];e.added=n(p,u,"users"),e.removed=n(u,p,"users")}};var n=e.prototype;return n.icon=function(){return o().forum.attribute("byobu.icon-postAction")},n.descriptionKey=function(){var t="fof-byobu.forum.post.recipients_modified.";return this.attrs.added.length?this.attrs.removed.length?t+"added_and_removed":t+"added":t+"removed"},n.descriptionData=function(){var t={};return this.attrs.added.length&&(t.added=k(this.attrs.added,{link:!0})),this.attrs.removed.length&&(t.removed=k(this.attrs.removed,{link:!0})),t},e}(a());const N=flarum.core.compat["common/extend"],U=flarum.core.compat["forum/components/SettingsPage"];var A=t.n(U);const C=flarum.core.compat["common/components/Switch"];var I=t.n(C);const M=flarum.core.compat["common/Model"];var G=t.n(M);const L=flarum.core.compat["common/components/Badge"];var B=t.n(L);const j=flarum.core.compat["common/models/Discussion"];var O=t.n(j);const E=flarum.core.compat["common/components/Button"];var T=t.n(E);const q=flarum.core.compat["forum/components/DiscussionListItem"];var V=t.n(q);const K=flarum.core.compat["forum/components/DiscussionHero"];var F=t.n(K);const W=flarum.core.compat["forum/states/DiscussionListState"];var z=t.n(W);const H=flarum.core.compat["forum/utils/DiscussionControls"];var J=t.n(H);const Q=flarum.core.compat["common/utils/ItemList"];var X=t.n(Q);const Y=flarum.core.compat["common/components/Modal"];var Z=t.n(Y);const tt=flarum.core.compat["forum/components/DiscussionPage"];var et=t.n(tt);const nt=flarum.core.compat["common/utils/Stream"];var ot=t.n(nt);const st=flarum.core.compat["forum/states/SearchState"];var rt=t.n(st);const it=flarum.core.compat["forum/components/Search"];var at=t.n(it);function ct(){return ct=Object.assign||function(t){for(var e=1;e=3;return this.sources||(this.sources=this.sourceItems().toArray()),m("div",{role:"search",className:"Search"},m("div",{className:"RecipientsInput-selected RecipientsLabel","aria-live":"polite"},m("h4",null,o().translator.trans("fof-byobu.forum.modal.labels.selected_users")),m("p",null,o().translator.trans("fof-byobu.forum.modal.help.selected_users")),this.attrs.selected().toArray().map((function(e){return m(_t(),{text:o().translator.trans("fof-byobu.forum.modal.help.click_user_to_remove_tooltip")},m(D,{"data-container":"[data-modal-number]",recipient:e,onclick:function(n){return t.removeRecipient(e,n)}}))}))),m("div",{className:"Form-group"},m("label",{for:"byobu-addrecipient-search-input-"+this.inputUuid},o().translator.trans("fof-byobu.forum.modal.labels.search_field")),m("div",{className:"AddRecipientModal-form-input Search-input"},m("input",{id:"byobu-addrecipient-search-input-"+this.inputUuid,className:h()("RecipientsInput","FormControl",{open:!!this.searchState.getValue(),focused:!!this.searchState.getValue(),active:!!this.searchState.getValue(),loading:!!this.loadingSources}),oncreate:function(t){return t.dom.focus()},type:"search",placeholder:bt()(o().translator.trans("fof-byobu.forum.input.search_recipients")),value:this.searchState.getValue(),oninput:function(e){return t.searchState.setValue(e.target.value)},onfocus:function(){return t.hasFocus=!0},onblur:function(){return t.hasFocus=!1}}),m("ul",{className:h()("Dropdown-menu","Search-results","fade",{in:!!e})},this.doSearch?this.sources.map((function(e){return e.view(t.searchState.getValue())})):yt().component({size:"tiny",className:"Button Button--icon Button--link"})))))},n.sourceItems=function(){var t=new(X());return(!this.attrs.discussion&&o().forum.attribute("canStartPrivateDiscussionWithUsers")||this.attrs.discussion&&this.attrs.discussion.canEditUserRecipients())&&t.add("users",new mt),(!this.attrs.discussion&&o().forum.attribute("canStartPrivateDiscussionWithGroups")||this.attrs.discussion&&this.attrs.discussion.canEditGroupRecipients())&&t.add("groups",new dt),t},n.addRecipient=function(t){var e=t.split(":"),n=e[0],o=e[1],s=this.findRecipient(n,o);this.attrs.selected().add(t,s),this.searchState.clear()},n.removeRecipient=function(t,e){var n;e.preventDefault(),t instanceof f()&&(n="users"),t instanceof g()&&(n="groups"),this.attrs.selected().remove(n+":"+t.id())},n.findRecipient=function(t,e){return o().store.getById(t,e)},e}(at()),Rt=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.selected=ot()(new(X())),this.attrs.discussion?this.assignInitialRecipients(this.attrs.discussion):this.attrs.selectedRecipients&&this.attrs.selectedRecipients.toArray().length>0?this.selected().merge(this.attrs.selectedRecipients):this.selected().add("users:"+o().session.user.id(),o().session.user),this.recipientSearch=new(rt())},n.isDismissible=function(){return!1},n.assignInitialRecipients=function(t){var e=this;t.recipientUsers().map((function(t){e.selected().add("users:"+t.id(),t)})),t.recipientGroups().map((function(t){e.selected().add("groups:"+t.id(),t)}))},n.className=function(){return"AddRecipientModal"},n.title=function(){return this.attrs.discussion?o().translator.trans("fof-byobu.forum.modal.titles.update_recipients",{title:m("em",null,this.attrs.discussion.title())}):o().translator.trans("fof-byobu.forum.modal.titles.add_recipients")},n.helpText=function(){return this.attrs.discussion?o().translator.trans("fof-byobu.forum.modal.help.update_recipients"):o().translator.trans("fof-byobu.forum.modal.help.add_recipients")},n.content=function(){return[m("div",{className:"Modal-body"},m("div",{class:"AddRecipientModal-help"},this.helpText()),m("div",{className:"AddRecipientModal-form"},Pt.component({state:this.recipientSearch,selected:this.selected,discussion:this.attrs.discussion}),m("div",{className:"AddRecipientModal-form-submit App-primaryControl"},T().component({type:"submit",className:"Button Button--primary",icon:"fas fa-check"},o().translator.trans("fof-byobu.forum.buttons.submit")),T().component({onclick:this.hide.bind(this),className:"Button Button--cancel"},o().translator.trans("fof-byobu.forum.buttons.cancel")))))]},n.select=function(t){(t.metaKey||t.ctrlKey||-1!==this.selected.indexOf(this.index))&&this.selected().length&&this.$("form").submit()},n.onsubmit=function(t){t.preventDefault();var e=this.attrs.discussion,n=this.selected(),s=[],r=[];n.toArray().forEach((function(t){t instanceof f()&&r.push(t),t instanceof g()&&s.push(t)})),e&&e.save({relationships:{recipientUsers:r,recipientGroups:s}}).then((function(){o().current instanceof et()&&o().current.stream.update(),m.redraw()})),this.attrs.onsubmit&&this.attrs.onsubmit(n),o().modal.close(),this.attrs.discussion||o().composer.show(),t.redraw=!1},e}(Z());const wt=flarum.core.compat["tags/components/TagDiscussionModal"];var Dt=function(t){function e(){return t.apply(this,arguments)||this}return r(e,t),e.prototype.onsubmit=function(t){t.preventDefault();var e=this.selected;this.attrs.resolve&&this.attrs.resolve(e),this.hide()},e}(t.n(wt)());Dt.isDismissible=!1;const St=flarum.core.compat["components/DiscussionPage"];var kt=t.n(St);var xt=function(t,e,n){var o=[];t.recipientUsers().length&&(o=o.concat(t.recipientUsers())),t.recipientGroups().length&&(o=o.concat(t.recipientGroups())),o&&o.length&&(n?e.add("recipients",k(o),10):e.add("recipients",k(o,{link:!0}),4))};const Nt=flarum.core.compat["forum/utils/UserControls"];var Ut=t.n(Nt);const At=flarum.core.compat["forum/components/DiscussionComposer"];var Ct=function(t){function e(){for(var e,n=arguments.length,o=new Array(n),s=0;s{var t={n:e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},d:(e,n)=>{for(var o in n)t.o(n,o)&&!t.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:n[o]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};(()=>{"use strict";t.r(e),t.d(e,{discussions:()=>zt,extend:()=>ae,modals:()=>Kt});const n=flarum.core.compat["forum/app"];var o=t.n(n);const s=flarum.core.compat["common/extend"],r=flarum.core.compat["forum/components/SettingsPage"];var i=t.n(r);const a=flarum.core.compat["common/components/Switch"];var c=t.n(a);const u=flarum.core.compat["common/components/Badge"];var l=t.n(u);const p=flarum.core.compat["common/models/Discussion"];var f=t.n(p);const d=flarum.core.compat["common/models/User"];var h=t.n(d);const b=flarum.core.compat["common/models/Group"];var v=t.n(b);const y=flarum.core.compat["common/components/Button"];var g=t.n(y);const _=flarum.core.compat["forum/components/DiscussionListItem"];var P=t.n(_);const w=flarum.core.compat["forum/components/DiscussionHero"];var R=t.n(w);const D=flarum.core.compat["forum/states/DiscussionListState"];var S=t.n(D);function x(t,e){if(null==t)return{};var n,o,s={},r=Object.keys(t);for(o=0;o=0||(s[n]=t[n]);return s}const k=flarum.core.compat["common/utils/classList"];var N=t.n(k);function U(t,e){return U=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},U(t,e)}function A(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,U(t,e)}const I=flarum.core.compat["common/helpers/username"];var C=t.n(I);const M=flarum.core.compat["common/components/LinkButton"];var L=t.n(M);const B=flarum.core.compat["common/Component"];var G=["recipient","link"],j=function(t){function e(){return t.apply(this,arguments)||this}return A(e,t),e.prototype.view=function(t){var e,n=this.attrs,s=n.recipient,r=n.link,i=x(n,G);if(i.style=i.style||{},i.className=N()("RecipientLabel",null==i?void 0:i.className),r&&s instanceof h()&&(i.href=o().route.user(s)),s instanceof h()){var a,c;e=C()(s),i.href||s.id()===(null==o()||null==(a=o().session)||null==(c=a.user)?void 0:c.id())||(i.href=o().route.user(s))}else{if(s instanceof v())return m("span",{class:i.className},s.namePlural());i.className+=" none",e=o().translator.trans("core.lib.username.deleted_text")}return m(L(),i,e)},e}(t.n(B)()),O=["link","className"];function T(t,e){void 0===e&&(e={});var n=e,o=n.link,s=n.className,r=x(n,O);return r.className=N()("RecipientsLabel",s),m("span",r,null==t?void 0:t.map((function(t,e){var n=t instanceof h()?"u":"g";return m(j,{key:n+"-"+e,recipient:t,link:o})})),!t&&m(j,null))}const q=flarum.core.compat["forum/utils/DiscussionControls"];var E=t.n(q);const V=flarum.core.compat["common/utils/ItemList"];var K=t.n(V);const F=flarum.core.compat["common/components/Modal"];var W=t.n(F);const z=flarum.core.compat["forum/components/DiscussionPage"];var H=t.n(z);const J=flarum.core.compat["common/utils/Stream"];var Q=t.n(J);const X=flarum.core.compat["forum/states/SearchState"];var Y=t.n(X);const Z=flarum.core.compat["forum/components/Search"];var tt=t.n(Z);function et(){return et=Object.assign||function(t){for(var e=1;e=3;return this.sources||(this.sources=this.sourceItems().toArray()),m("div",{role:"search",className:"Search"},m("div",{className:"RecipientsInput-selected RecipientsLabel","aria-live":"polite"},m("h4",null,o().translator.trans("fof-byobu.forum.modal.labels.selected_users")),m("p",null,o().translator.trans("fof-byobu.forum.modal.help.selected_users")),this.attrs.selected().toArray().map((function(e){return m(dt(),{text:o().translator.trans("fof-byobu.forum.modal.help.click_user_to_remove_tooltip")},m(j,{"data-container":"[data-modal-number]",recipient:e,onclick:function(n){return t.removeRecipient(e,n)}}))}))),m("div",{className:"Form-group"},m("label",{for:"byobu-addrecipient-search-input-"+this.inputUuid},o().translator.trans("fof-byobu.forum.modal.labels.search_field")),m("div",{className:"AddRecipientModal-form-input Search-input"},m("input",{id:"byobu-addrecipient-search-input-"+this.inputUuid,className:N()("RecipientsInput","FormControl",{open:!!this.searchState.getValue(),focused:!!this.searchState.getValue(),active:!!this.searchState.getValue(),loading:!!this.loadingSources}),oncreate:function(t){return t.dom.focus()},type:"search",placeholder:ut()(o().translator.trans("fof-byobu.forum.input.search_recipients")),value:this.searchState.getValue(),oninput:function(e){return t.searchState.setValue(e.target.value)},onfocus:function(){return t.hasFocus=!0},onblur:function(){return t.hasFocus=!1}}),m("ul",{className:N()("Dropdown-menu","Search-results","fade",{in:!!e})},this.doSearch?this.sources.map((function(e){return e.view(t.searchState.getValue())})):pt().component({size:"tiny",className:"Button Button--icon Button--link"})))))},n.sourceItems=function(){var t=new(K());return(!this.attrs.discussion&&o().forum.attribute("canStartPrivateDiscussionWithUsers")||this.attrs.discussion&&this.attrs.discussion.canEditUserRecipients())&&t.add("users",new it),(!this.attrs.discussion&&o().forum.attribute("canStartPrivateDiscussionWithGroups")||this.attrs.discussion&&this.attrs.discussion.canEditGroupRecipients())&&t.add("groups",new at),t},n.addRecipient=function(t){var e=t.split(":"),n=e[0],o=e[1],s=this.findRecipient(n,o);this.attrs.selected().add(t,s),this.searchState.clear()},n.removeRecipient=function(t,e){var n;e.preventDefault(),t instanceof h()&&(n="users"),t instanceof v()&&(n="groups"),this.attrs.selected().remove(n+":"+t.id())},n.findRecipient=function(t,e){return o().store.getById(t,e)},e}(tt()),ht=function(t){function e(){return t.apply(this,arguments)||this}A(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.selected=Q()(new(K())),this.attrs.discussion?this.assignInitialRecipients(this.attrs.discussion):this.attrs.selectedRecipients&&this.attrs.selectedRecipients.toArray().length>0?this.selected().merge(this.attrs.selectedRecipients):this.selected().add("users:"+o().session.user.id(),o().session.user),this.recipientSearch=new(Y())},n.isDismissible=function(){return!1},n.assignInitialRecipients=function(t){var e=this;t.recipientUsers().map((function(t){e.selected().add("users:"+t.id(),t)})),t.recipientGroups().map((function(t){e.selected().add("groups:"+t.id(),t)}))},n.className=function(){return"AddRecipientModal"},n.title=function(){return this.attrs.discussion?o().translator.trans("fof-byobu.forum.modal.titles.update_recipients",{title:m("em",null,this.attrs.discussion.title())}):o().translator.trans("fof-byobu.forum.modal.titles.add_recipients")},n.helpText=function(){return this.attrs.discussion?o().translator.trans("fof-byobu.forum.modal.help.update_recipients"):o().translator.trans("fof-byobu.forum.modal.help.add_recipients")},n.content=function(){return[m("div",{className:"Modal-body"},m("div",{class:"AddRecipientModal-help"},this.helpText()),m("div",{className:"AddRecipientModal-form"},mt.component({state:this.recipientSearch,selected:this.selected,discussion:this.attrs.discussion}),m("div",{className:"AddRecipientModal-form-submit App-primaryControl"},g().component({type:"submit",className:"Button Button--primary",icon:"fas fa-check"},o().translator.trans("fof-byobu.forum.buttons.submit")),g().component({onclick:this.hide.bind(this),className:"Button Button--cancel"},o().translator.trans("fof-byobu.forum.buttons.cancel")))))]},n.select=function(t){(t.metaKey||t.ctrlKey||-1!==this.selected.indexOf(this.index))&&this.selected().length&&this.$("form").submit()},n.onsubmit=function(t){t.preventDefault();var e=this.attrs.discussion,n=this.selected(),s=[],r=[];n.toArray().forEach((function(t){t instanceof h()&&r.push(t),t instanceof v()&&s.push(t)})),e&&e.save({relationships:{recipientUsers:r,recipientGroups:s}}).then((function(){o().current instanceof H()&&o().current.stream.update(),m.redraw()})),this.attrs.onsubmit&&this.attrs.onsubmit(n),o().modal.close(),this.attrs.discussion||o().composer.show(),t.redraw=!1},e}(W());const bt=flarum.core.compat["tags/components/TagDiscussionModal"];var vt=function(t){function e(){return t.apply(this,arguments)||this}return A(e,t),e.prototype.onsubmit=function(t){t.preventDefault();var e=this.selected;this.attrs.resolve&&this.attrs.resolve(e),this.hide()},e}(t.n(bt)());vt.isDismissible=!1;const yt=flarum.core.compat["components/DiscussionPage"];var gt=t.n(yt);var _t=function(t,e,n){var o=[];t.recipientUsers().length&&(o=o.concat(t.recipientUsers())),t.recipientGroups().length&&(o=o.concat(t.recipientGroups())),o&&o.length&&(n?e.add("recipients",T(o),10):e.add("recipients",T(o,{link:!0}),4))};const Pt=flarum.core.compat["forum/utils/UserControls"];var wt=t.n(Pt);const Rt=flarum.core.compat["forum/components/DiscussionComposer"];var Dt=function(t){function e(){for(var e,n=arguments.length,o=new Array(n),s=0;s {\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 function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\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['forum/components/EventPost'];","import app from 'flarum/forum/app';\nimport EventPost from 'flarum/forum/components/EventPost';\n\nexport default class MadePublic extends EventPost {\n static initAttrs(attrs: any) {\n super.initAttrs(attrs);\n }\n\n icon() {\n return app.forum.attribute('byobu.icon-postAction');\n }\n\n descriptionKey() {\n return 'fof-byobu.forum.post.recipients_modified.made_public';\n }\n}\n","import app from 'flarum/forum/app';\nimport EventPost from 'flarum/forum/components/EventPost';\n\nexport default class RecipientLeft extends EventPost {\n static initAttrs(attrs) {\n super.initAttrs(attrs);\n }\n\n icon() {\n return app.forum.attribute('byobu.icon-postAction');\n }\n\n descriptionKey() {\n return 'fof-byobu.forum.post.recipients_modified.removed_self';\n }\n}\n","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/User'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/classList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/username'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Group'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LinkButton'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","import type * as Mithril from 'mithril';\nimport username from 'flarum/common/helpers/username';\nimport User from 'flarum/common/models/User';\nimport Group from 'flarum/common/models/Group';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport classList from 'flarum/common/utils/classList';\nimport app from 'flarum/forum/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\n\nexport interface IRecipientLabelAttrs extends ComponentAttrs, Mithril.Attributes {\n recipient: User | Group;\n link: string;\n}\n\nexport default class RecipientLabel extends Component {\n view(vnode: Mithril.Vnode) {\n const { recipient, link, ...newAttrs } = this.attrs;\n\n newAttrs.style = newAttrs.style || {};\n newAttrs.className = classList('RecipientLabel', newAttrs?.className);\n\n if (link && recipient instanceof User) {\n newAttrs.href = app.route.user(recipient);\n }\n\n let label: string;\n\n if (recipient instanceof User) {\n label = username(recipient);\n\n if (!newAttrs.href && recipient.id() !== app?.session?.user?.id()) {\n newAttrs.href = app.route.user(recipient);\n }\n } else if (recipient instanceof Group) {\n return {recipient.namePlural()};\n } else {\n newAttrs.className += ' none';\n label = app.translator.trans('core.lib.username.deleted_text');\n }\n\n return {label};\n }\n}\n","import Group from 'flarum/common/models/Group';\nimport User from 'flarum/common/models/User';\nimport classList from 'flarum/common/utils/classList';\nimport RecipientLabel from './RecipientLabel';\n\nexport default function recipientsLabel(recipients?: (User | Group)[], attrs: Record = {}): JSX.Element {\n const { link, className, ...otherAttrs } = attrs;\n\n otherAttrs.className = classList('RecipientsLabel', className);\n\n return (\n \n {recipients?.map((recipient, index) => {\n const type = recipient instanceof User ? 'u' : 'g';\n\n return ;\n })}\n {!recipients && }\n \n );\n}\n","import app from 'flarum/forum/app';\nimport EventPost from 'flarum/forum/components/EventPost';\nimport recipientsLabel from '../pages/labels/recipientsLabels';\n\nexport default class RecipientsModified extends EventPost {\n static initAttrs(attrs) {\n super.initAttrs(attrs);\n\n function diff(diff1, diff2, store) {\n return diff1.filter((item) => diff2.indexOf(item) === -1).map((id) => app.store.getById(store, id));\n }\n\n const content = attrs.post.content();\n\n // For event posts existing before groups functionality.\n if (!content['new'] && content.length == 2) {\n const oldRecipients = attrs.post.content()[0];\n const newRecipients = attrs.post.content()[1];\n attrs.added = diff(newRecipients, oldRecipients, 'users');\n attrs.removed = diff(oldRecipients, newRecipients, 'users');\n } else {\n let usersAdded = diff(content['new']['users'], content['old']['users'], 'users');\n let usersRemoved = diff(content['old']['users'], content['new']['users'], 'users');\n let groupsAdded = diff(content['new']['groups'], content['old']['groups'], 'groups');\n let groupsRemoved = diff(content['old']['groups'], content['new']['groups'], 'groups');\n\n attrs.added = usersAdded.concat(groupsAdded);\n attrs.removed = usersRemoved.concat(groupsRemoved);\n }\n }\n\n icon() {\n return app.forum.attribute('byobu.icon-postAction');\n }\n\n descriptionKey() {\n var localeBase = 'fof-byobu.forum.post.recipients_modified.';\n\n if (this.attrs.added.length) {\n if (this.attrs.removed.length) {\n return localeBase + 'added_and_removed';\n }\n\n return localeBase + 'added';\n }\n\n return localeBase + 'removed';\n }\n\n descriptionData() {\n const data = {};\n\n if (this.attrs.added.length) {\n data.added = recipientsLabel(this.attrs.added, { link: true });\n }\n\n if (this.attrs.removed.length) {\n data.removed = recipientsLabel(this.attrs.removed, { link: true });\n }\n\n return data;\n }\n}\n","import app from 'flarum/forum/app';\nimport MadePublic from './MadePublic';\nimport RecipientLeft from './RecipientLeft';\nimport RecipientsModified from './RecipientsModified';\n\nexport default () => {\n app.postComponents.recipientsModified = RecipientsModified;\n app.postComponents.recipientLeft = RecipientLeft;\n app.postComponents.madePublic = MadePublic;\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/SettingsPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Switch'];","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport SettingsPage from 'flarum/forum/components/SettingsPage';\nimport Switch from 'flarum/common/components/Switch';\n\nexport default () => {\n privacyToggle();\n};\n\nfunction privacyToggle() {\n extend(SettingsPage.prototype, 'privacyItems', function (items) {\n items.add(\n 'byobu-block-dm',\n Switch.component(\n {\n state: this.user.blocksPd(),\n onchange: (value) => {\n this.blocksPdLoading = true;\n\n this.user.save({ blocksPd: value }).then(() => {\n this.blocksPdLoading = false;\n m.redraw();\n });\n },\n loading: this.blocksPdLoading,\n },\n app.translator.trans('fof-byobu.forum.user.settings.block_pd')\n )\n );\n });\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Model'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Badge'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Discussion'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionListItem'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionHero'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/states/DiscussionListState'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/utils/DiscussionControls'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/ItemList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Modal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/Stream'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/states/SearchState'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/Search'];","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}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/highlight'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/avatar'];","import app from 'flarum/forum/app';\nimport highlight from 'flarum/common/helpers/highlight';\nimport avatar from 'flarum/common/helpers/avatar';\nimport username from 'flarum/common/helpers/username';\n\nexport default class UserSearchSource {\n view(query) {\n if (query.length < 3 || this.loading) return;\n\n if (!app.cache.byobuResults) {\n app.cache.byobuResults = [];\n }\n\n this.query = query;\n\n if (!app.cache.byobuResults[this.query]) {\n this.loading = true;\n\n app.cache.byobuResults[this.query] = [];\n app.store\n .find('users', {\n filter: { q: this.query + ' allows-pd' },\n page: { limit: 5 },\n })\n .then(this.pushResults.bind(this));\n } else\n return [\n
  • {app.translator.trans('core.forum.search.users_heading')}
  • ,\n app.cache.byobuResults[this.query].map((user) => {\n const name = username(user);\n const children = [highlight(name.text, this.query)];\n\n return (\n
  • \n \n {avatar(user)}\n {{ ...name, text: undefined, children }}\n \n
  • \n );\n }),\n ];\n }\n\n pushResults(results) {\n results.payload.data.map((result) => {\n var user = app.store.getById('users', result.id);\n app.cache.byobuResults[this.query].push(user);\n });\n this.loading = false;\n m.redraw();\n }\n}\n","import app from 'flarum/forum/app';\nimport highlight from 'flarum/common/helpers/highlight';\n\nexport default class GroupSearchSource {\n search(query) {\n return app.store.find('groups', {\n filter: { q: query },\n page: { limit: 5 },\n });\n }\n\n view(query) {\n query = query.toLowerCase();\n\n const results = app.store.all('groups').filter((group) => group.namePlural().toLowerCase().substr(0, query.length) === query);\n\n if (!results.length) return '';\n\n return [\n
  • {app.translator.trans('fof-byobu.forum.search.headings.groups')}
  • ,\n results.map((group) => {\n const groupName = group.namePlural();\n var name = highlight(groupName, query);\n\n return (\n
  • \n \n {name}\n \n
  • \n );\n }),\n ];\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/extractText'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LoadingIndicator'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Tooltip'];","import app from 'flarum/forum/app';\nimport Search from 'flarum/forum/components/Search';\nimport UserSearchSource from './sources/UserSearchSource';\nimport GroupSearchSource from './sources/GroupSearchSource';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport classList from 'flarum/common/utils/classList';\nimport extractText from 'flarum/common/utils/extractText';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport RecipientLabel from '../pages/labels/RecipientLabel';\nimport User from 'flarum/common/models/User';\nimport Group from 'flarum/common/models/Group';\nimport Tooltip from 'flarum/common/components/Tooltip';\n\nexport default class RecipientSearch extends Search {\n /**\n * Used to prevent duplicate IDs. Doesn't remove the possibility, but is extremely low.\n */\n inputUuid;\n\n oninit(vnode) {\n super.oninit(vnode);\n\n this.inputUuid = Math.random().toString(36).substring(2);\n }\n\n oncreate(vnode) {\n super.oncreate(vnode);\n\n const $search = this;\n\n this.$('.Search-results').on('click', (e) => {\n const target = this.$('.SearchResult.active');\n\n $search.addRecipient(target.data('index'));\n $search.$('.RecipientsInput').focus();\n });\n\n this.$('.Search-results').on('touchstart', (e) => {\n const target = this.$(e.target.parentNode);\n\n $search.addRecipient(target.data('index'));\n $search.$('.RecipientsInput').focus();\n });\n\n $('.RecipientsInput')\n .on('input', () => {\n clearTimeout(this.typingTimer);\n this.doSearch = false;\n this.typingTimer = setTimeout(() => {\n this.doSearch = true;\n m.redraw();\n }, 900);\n })\n .on('keydown', () => {\n clearTimeout(this.typingTimer);\n });\n\n super.oncreate(vnode);\n }\n\n view() {\n if (typeof this.searchState.getValue() === 'undefined') {\n this.searchState.setValue('');\n }\n\n const loading = this.searchState.getValue() && this.searchState.getValue().length >= 3;\n\n if (!this.sources) {\n this.sources = this.sourceItems().toArray();\n }\n\n return (\n
    \n
    \n

    {app.translator.trans('fof-byobu.forum.modal.labels.selected_users')}

    \n

    {app.translator.trans('fof-byobu.forum.modal.help.selected_users')}

    \n\n {this.attrs\n .selected()\n .toArray()\n .map((recipient) => {\n return (\n \n this.removeRecipient(recipient, e)} />\n \n );\n })}\n
    \n\n
    \n \n\n
    \n vnode.dom.focus()}\n type=\"search\"\n placeholder={extractText(app.translator.trans('fof-byobu.forum.input.search_recipients'))}\n value={this.searchState.getValue()}\n oninput={(e) => this.searchState.setValue(e.target.value)}\n onfocus={() => (this.hasFocus = true)}\n onblur={() => (this.hasFocus = false)}\n />\n \n {!this.doSearch\n ? LoadingIndicator.component({ size: 'tiny', className: 'Button Button--icon Button--link' })\n : this.sources.map((source) => source.view(this.searchState.getValue()))}\n \n
    \n
    \n
    \n );\n }\n\n /**\n * Build an item list of SearchSources.\n *\n * @return {ItemList}\n */\n sourceItems() {\n const items = new ItemList();\n\n // Add user source based on permissions.\n if (\n (!this.attrs.discussion && app.forum.attribute('canStartPrivateDiscussionWithUsers')) ||\n (this.attrs.discussion && this.attrs.discussion.canEditUserRecipients())\n ) {\n items.add('users', new UserSearchSource());\n }\n\n // Add group source based on permissions.\n if (\n (!this.attrs.discussion && app.forum.attribute('canStartPrivateDiscussionWithGroups')) ||\n (this.attrs.discussion && this.attrs.discussion.canEditGroupRecipients())\n ) {\n items.add('groups', new GroupSearchSource());\n }\n\n return items;\n }\n\n /**\n * Adds a recipient.\n *\n * @param value\n */\n addRecipient(value) {\n let values = value.split(':'),\n type = values[0],\n id = values[1];\n\n let recipient = this.findRecipient(type, id);\n\n this.attrs.selected().add(value, recipient);\n\n this.searchState.clear();\n }\n\n /**\n * Removes a recipient.\n *\n * @param recipient\n */\n removeRecipient(recipient, e) {\n e.preventDefault();\n\n let type;\n\n if (recipient instanceof User) {\n type = 'users';\n }\n if (recipient instanceof Group) {\n type = 'groups';\n }\n\n this.attrs.selected().remove(type + ':' + recipient.id());\n }\n\n /**\n * Loads a recipient from the global store.\n *\n * @param store\n * @param id\n * @returns {Model}\n */\n findRecipient(store, id) {\n return app.store.getById(store, id);\n }\n}\n","import app from 'flarum/forum/app';\nimport Modal from 'flarum/common/components/Modal';\nimport DiscussionPage from 'flarum/forum/components/DiscussionPage';\nimport Button from 'flarum/common/components/Button';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Stream from 'flarum/common/utils/Stream';\nimport SearchState from 'flarum/forum/states/SearchState';\nimport RecipientSearch from '../search/RecipientSearch';\nimport User from 'flarum/common/models/User';\nimport Group from 'flarum/common/models/Group';\n\nexport default class AddRecipientModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.selected = Stream(new ItemList());\n\n if (this.attrs.discussion) {\n // Adds recipients of the currently viewed discussion.\n this.assignInitialRecipients(this.attrs.discussion);\n } else if (this.attrs.selectedRecipients && this.attrs.selectedRecipients.toArray().length > 0) {\n // Adds previously selected recipients.\n this.selected().merge(this.attrs.selectedRecipients);\n } else {\n // Adds the current user in case there are no selected recipients yet and this is a new discussion.\n this.selected().add('users:' + app.session.user.id(), app.session.user);\n }\n\n this.recipientSearch = new SearchState();\n }\n\n isDismissible() {\n return false;\n }\n\n assignInitialRecipients(discussion) {\n discussion.recipientUsers().map((user) => {\n this.selected().add('users:' + user.id(), user);\n });\n discussion.recipientGroups().map((group) => {\n this.selected().add('groups:' + group.id(), group);\n });\n }\n\n className() {\n return 'AddRecipientModal';\n }\n\n title() {\n return this.attrs.discussion\n ? app.translator.trans('fof-byobu.forum.modal.titles.update_recipients', { title: {this.attrs.discussion.title()} })\n : app.translator.trans('fof-byobu.forum.modal.titles.add_recipients');\n }\n\n helpText() {\n return this.attrs.discussion\n ? app.translator.trans('fof-byobu.forum.modal.help.update_recipients')\n : app.translator.trans('fof-byobu.forum.modal.help.add_recipients');\n }\n\n content() {\n return [\n
    \n
    {this.helpText()}
    \n
    \n {RecipientSearch.component({\n state: this.recipientSearch,\n selected: this.selected,\n discussion: this.attrs.discussion,\n })}\n
    \n {Button.component(\n {\n type: 'submit',\n className: 'Button Button--primary',\n icon: 'fas fa-check',\n },\n app.translator.trans('fof-byobu.forum.buttons.submit')\n )}\n {Button.component(\n {\n onclick: this.hide.bind(this),\n className: 'Button Button--cancel',\n },\n app.translator.trans('fof-byobu.forum.buttons.cancel')\n )}\n
    \n
    \n
    ,\n ];\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 this.$('form').submit();\n }\n }\n }\n\n onsubmit(e) {\n e.preventDefault();\n\n const discussion = this.attrs.discussion;\n const recipients = this.selected();\n\n let recipientGroups = [];\n let recipientUsers = [];\n\n recipients.toArray().forEach((recipient) => {\n if (recipient instanceof User) {\n recipientUsers.push(recipient);\n }\n if (recipient instanceof Group) {\n recipientGroups.push(recipient);\n }\n });\n\n // Recipients are updated here for existing discussions here.\n if (discussion) {\n discussion.save({ relationships: { recipientUsers, recipientGroups } }).then(() => {\n if (app.current instanceof DiscussionPage) {\n app.current.stream.update();\n }\n m.redraw();\n });\n }\n\n // Use the onsubmit callback to trigger an update in the DiscussionComposer\n if (this.attrs.onsubmit) this.attrs.onsubmit(recipients);\n\n app.modal.close();\n\n if (!this.attrs.discussion) {\n app.composer.show();\n }\n\n e.redraw = false;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['tags/components/TagDiscussionModal'];","import app from 'flarum/forum/app';\nimport TagDiscussionModal from 'flarum/tags/components/TagDiscussionModal';\n\nexport default class ByobuTagDiscussionModal extends TagDiscussionModal {\n static isDismissible = false;\n\n onsubmit(e) {\n e.preventDefault();\n\n const tags = this.selected;\n\n if (this.attrs.resolve) this.attrs.resolve(tags);\n\n this.hide();\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['components/DiscussionPage'];","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport Model from 'flarum/common/Model';\nimport Badge from 'flarum/common/components/Badge';\nimport Discussion from 'flarum/common/models/Discussion';\nimport User from 'flarum/common/models/User';\nimport Group from 'flarum/common/models/Group';\nimport Button from 'flarum/common/components/Button';\nimport DiscussionListItem from 'flarum/forum/components/DiscussionListItem';\nimport DiscussionHero from 'flarum/forum/components/DiscussionHero';\nimport DiscussionListState from 'flarum/forum/states/DiscussionListState';\nimport recipientsLabel from '../pages/labels/recipientsLabels';\nimport DiscussionControls from 'flarum/forum/utils/DiscussionControls';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport AddRecipientModal from './../modals/AddRecipientModal';\nimport ByobuTagDiscussionModal from '../modals/ByobuTagDiscussionModal';\nimport DiscussionPage from 'flarum/components/DiscussionPage';\n\nexport default () => {\n attributes();\n badges();\n index();\n hero();\n apiInclude();\n controls();\n};\n\nconst add = function (discussion, items, long) {\n let recipients = [];\n\n if (discussion.recipientUsers().length) {\n recipients = recipients.concat(discussion.recipientUsers());\n }\n\n if (discussion.recipientGroups().length) {\n recipients = recipients.concat(discussion.recipientGroups());\n }\n\n if (recipients && recipients.length) {\n if (long) {\n items.add('recipients', recipientsLabel(recipients), 10);\n } else {\n items.add('recipients', recipientsLabel(recipients, { link: true }), 4);\n }\n }\n};\n\nfunction badges() {\n extend(Discussion.prototype, 'badges', function (badges) {\n if (this.recipientUsers().length || this.recipientGroups().length) {\n badges.add(\n 'private',\n Badge.component({\n type: 'private',\n label: app.translator.trans('fof-byobu.forum.badges.is_private.tooltip'),\n icon: app.forum.data.attributes['byobu.icon-badge'],\n }),\n 10\n );\n }\n });\n}\n\nfunction index() {\n extend(DiscussionListItem.prototype, 'infoItems', function (items) {\n const discussion = this.attrs.discussion;\n\n add(discussion, items, true);\n });\n}\n\nfunction hero() {\n extend(DiscussionHero.prototype, 'items', function (items) {\n const discussion = this.attrs.discussion;\n\n add(discussion, items, false);\n });\n}\n\nfunction apiInclude() {\n extend(DiscussionListState.prototype, 'requestParams', function (params) {\n params.include.push('recipientUsers');\n params.include.push('recipientGroups');\n });\n}\n\nfunction controls() {\n extend(DiscussionControls, 'moderationControls', function (items, discussion) {\n if (discussion.canEditRecipients()) {\n items.add(\n 'recipients',\n Button.component(\n {\n icon: app.forum.data.attributes['byobu.icon-badge'],\n onclick: () =>\n app.modal.show(AddRecipientModal, {\n discussion,\n /**\n * @param {ItemList} recipients\n */\n onsubmit(recipients) {\n if (recipients.isEmpty()) {\n // The discussion might have been perma-deleted! Let's check...\n app.store\n .find(\n 'discussions',\n discussion.id(),\n {},\n {\n errorHandler(err) {\n if (err.status === 404) {\n // Almost certainly permadeleted, so let's just redirect to the PD list.\n m.route.set(app.route('byobuPrivate'));\n }\n },\n }\n )\n .catch((err) => {\n // some other error... assume not deleted\n console.error(err);\n });\n }\n },\n }),\n },\n app.translator.trans('fof-byobu.forum.buttons.edit_recipients')\n )\n );\n }\n if (discussion && discussion.recipientUsers().find((user) => user.id() === app.session.user.id())) {\n items.add(\n 'remove',\n Button.component(\n {\n icon: 'fas fa-user-slash',\n onclick: () => {\n if (discussion) {\n let recipients = new ItemList();\n discussion.recipientUsers().map((user) => {\n if (app.session.user.id() !== user.id()) {\n recipients.add('users:' + user.id(), user);\n }\n });\n\n let recipientGroups = [];\n let recipientUsers = [];\n\n recipients.toArray().forEach((recipient) => {\n if (recipient instanceof User) {\n recipientUsers.push(recipient);\n }\n if (recipient instanceof Group) {\n recipientGroups.push(recipient);\n }\n });\n\n discussion\n .save({\n relationships: {\n recipientUsers,\n recipientGroups,\n },\n })\n .then(() => app.history.back());\n }\n },\n },\n app.translator.trans('fof-byobu.forum.buttons.remove_from_discussion')\n )\n );\n\n if (discussion?.isPrivateDiscussion?.() && discussion?.canMakePublic?.()) {\n items.add(\n 'transform-public',\n {\n if (discussion && confirm(app.translator.trans('fof-byobu.forum.confirm.make_public'))) {\n const recipientGroups = [];\n const recipientUsers = [];\n\n if (flarum.extensions['flarum-tags']) {\n new Promise((resolve, reject) => {\n app.modal.show(ByobuTagDiscussionModal, { discussion, resolve, reject });\n }).then((tags) => {\n discussion.save({ relationships: { recipientUsers, recipientGroups }, public: discussion.id() }).then(() => {\n discussion.save({ relationships: { tags } }).then(() => {\n if (app.current.matches(DiscussionPage)) {\n app.current.get('stream').update();\n }\n m.redraw();\n });\n });\n });\n } else {\n discussion.save({ relationships: { recipientUsers, recipientGroups }, public: discussion.id() }).then(() => m.redraw());\n }\n }\n }}\n >\n {app.translator.trans('fof-byobu.forum.buttons.make_public')}\n \n );\n }\n }\n });\n}\n\nfunction attributes() {\n Discussion.prototype.recipientUsers = Model.hasMany('recipientUsers');\n Discussion.prototype.oldRecipientUsers = Model.hasMany('oldRecipientUsers');\n Discussion.prototype.recipientGroups = Model.hasMany('recipientGroups');\n Discussion.prototype.oldRecipientGroups = Model.hasMany('oldRecipientGroups');\n\n Discussion.prototype.canEditRecipients = Model.attribute('canEditRecipients');\n Discussion.prototype.canEditUserRecipients = Model.attribute('canEditUserRecipients');\n Discussion.prototype.canEditGroupRecipients = Model.attribute('canEditGroupRecipients');\n Discussion.prototype.canEditGroupRecipients = Model.attribute('canEditGroupRecipients');\n Discussion.prototype.canMakePublic = Model.attribute('canMakePublic');\n\n Discussion.prototype.isPrivateDiscussion = Model.attribute('isPrivateDiscussion');\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/utils/UserControls'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionComposer'];","import app from 'flarum/forum/app';\nimport DiscussionComposer from 'flarum/forum/components/DiscussionComposer';\nimport AddRecipientModal from '../../modals/AddRecipientModal';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport recipientCountLabel from '../labels/recipientCountLabel';\nimport User from 'flarum/common/models/User';\nimport Group from 'flarum/common/models/Group';\n\nexport default class PrivateDiscussionComposer extends DiscussionComposer {\n /**\n * Tells other extensions that this composer is a Byobu composer.\n */\n _isByobuComposer = true;\n\n static initAttrs(attrs) {\n super.initAttrs(attrs);\n\n attrs.titlePlaceholder = app.translator.trans('fof-byobu.forum.composer_private_discussion.title_placeholder');\n attrs.submitLabel = app.translator.trans('fof-byobu.forum.composer_private_discussion.submit_button');\n }\n\n oninit(vnode) {\n super.oninit(vnode);\n\n this.composer.fields.recipients = this.attrs.recipients || new ItemList();\n\n this.composer.fields.recipientUsers = this.attrs.recipientUsers || [];\n this.composer.fields.recipientGroups = this.attrs.recipientGroups || [];\n\n const username = m.route.param('username');\n\n if (typeof username !== 'undefined') {\n this.addDefaultRecipients(username);\n }\n }\n\n data() {\n let data = super.data();\n\n const users = [];\n const groups = [];\n\n if (this.composer.fields.recipients !== undefined) {\n this.composer.fields.recipients.toArray().forEach((recipient) => {\n if (recipient instanceof User) {\n users.push(recipient);\n }\n\n if (recipient instanceof Group) {\n groups.push(recipient);\n }\n });\n }\n\n data.relationships = data.relationships || {};\n\n if (users.length) {\n data.relationships.recipientUsers = users;\n }\n\n if (groups.length) {\n data.relationships.recipientGroups = groups;\n }\n\n delete data.relationships.tags;\n\n return data;\n }\n\n chooseRecipients() {\n app.modal.show(AddRecipientModal, {\n selectedRecipients: this.composer.fields.recipients,\n onsubmit: (recipients) => {\n this.composer.fields.recipients = recipients;\n\n // Focus on recipient autocomplete field.\n this.$('.RecipientsInput').focus();\n },\n });\n }\n\n headerItems() {\n let items = super.headerItems();\n\n items.remove('tags');\n\n if (app.session.user && app.forum.attribute('canStartPrivateDiscussion')) {\n const recipients = this.composer.fields.recipients.toArray();\n\n items.add(\n 'recipients',\n \n {recipients.length ? (\n recipientCountLabel(recipients.length)\n ) : (\n {app.translator.trans('fof-byobu.forum.buttons.add_recipients')}\n )}\n ,\n 5\n );\n }\n\n return items;\n }\n\n addDefaultRecipients(username) {\n const user = app.store.getBy('users', 'username', username);\n\n this.composer.fields.recipients.add('users:' + app.session.user.id(), app.session.user);\n\n if (user.id() !== app.session.user.id()) {\n this.composer.fields.recipients.add('users:' + user.id(), user);\n }\n }\n\n onsubmit() {\n this.loading = true;\n\n const recipients = this.composer.fields.recipients.toArray();\n\n if (recipients.length < 2) {\n this.chooseRecipients();\n\n this.loading = false;\n } else {\n const data = this.data();\n\n app.store\n .createRecord('discussions')\n .save(data)\n .then((discussion) => {\n if (app.cache.discussionList) {\n app.cache.discussionList.refresh();\n }\n m.route.set(app.route.discussion(discussion));\n\n app.composer.hide();\n }, this.loaded.bind(this));\n }\n }\n}\n","import app from 'flarum/forum/app';\n\nexport default function recipientCountLabel(count, attrs = {}) {\n attrs.style = attrs.style || {};\n attrs.className = 'RecipientLabel ' + (attrs.className || '');\n\n var label = app.translator.trans('fof-byobu.forum.labels.recipients', { count });\n\n return m('span', attrs, {label});\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/UserPage'];","import app from 'flarum/forum/app';\n\nexport default function canStartPrivateDiscussion(recipient) {\n return (\n app.session.user &&\n app.session.user.id() !== recipient.id() &&\n app.forum.attribute('canStartPrivateDiscussion') &&\n (!recipient.blocksPd() || (app.forum.attribute('canStartPrivateDiscussionWithBlockers') && recipient.cannotBeDirectMessaged()))\n );\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport Model from 'flarum/common/Model';\nimport User from 'flarum/common/models/User';\nimport UserControls from 'flarum/forum/utils/UserControls';\nimport PrivateDiscussionComposer from './../pages/discussions/PrivateDiscussionComposer';\nimport Button from 'flarum/common/components/Button';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport UserPage from 'flarum/forum/components/UserPage';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport canStartPrivateDiscussion from '../helpers/canStartPrivateDiscussion';\n\nexport default () => {\n attributes();\n message();\n sharedMessageHistory();\n};\n\nfunction message() {\n extend(UserControls, 'userControls', function (items, user) {\n if (canStartPrivateDiscussion(user)) {\n items.add(\n 'private-discussion',\n Button.component(\n {\n icon: app.forum.attribute('byobu.icon-badge'),\n onclick: (e) => {\n e.preventDefault();\n\n return new Promise((resolve) => {\n let recipients = new ItemList();\n recipients.add('users:' + app.session.user.id(), app.session.user);\n recipients.add('users:' + user.id(), user);\n\n PrivateDiscussionComposer.prototype.recipients = recipients;\n\n app.composer.load(PrivateDiscussionComposer, {\n user: app.session.user,\n recipients: recipients,\n recipientUsers: recipients,\n titlePlaceholder: app.translator.trans('fof-byobu.forum.composer_private_discussion.title_placeholder'),\n submitLabel: app.translator.trans('fof-byobu.forum.composer_private_discussion.submit_button'),\n });\n app.composer.show();\n\n return resolve(app.composer);\n });\n },\n },\n app.translator.trans('fof-byobu.forum.buttons.send_pd', { username: user.username() })\n )\n );\n }\n\n return items;\n });\n}\n\nfunction sharedMessageHistory() {\n extend(UserPage.prototype, 'navItems', function (items) {\n const href = app.route('byobuUserPrivate', { username: this.user.slug() });\n\n // Hide links from guests if they are not already on the page\n if (!app.session.user && m.route.get() !== href) return;\n // Hide link for your own page.\n if (app.session.user === this.user) return;\n\n items.add(\n 'byobu',\n LinkButton.component(\n {\n href,\n icon: app.forum.attribute('byobu.icon-badge'),\n },\n app.translator.trans('fof-byobu.forum.user.byobu_link')\n ),\n 85\n );\n });\n}\n\nfunction attributes() {\n User.prototype.blocksPd = Model.attribute('blocksPd');\n User.prototype.cannotBeDirectMessaged = Model.attribute('cannotBeDirectMessaged');\n User.prototype.unreadPrivateMessagesCount = Model.attribute('unreadPrivateMessagesCount');\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/IndexPage'];","import DiscussionListState from 'flarum/forum/states/DiscussionListState';\n\nexport default class PrivateDiscussionListState extends DiscussionListState {}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Dropdown'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/listItems'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionList'];","import DiscussionList from 'flarum/forum/components/DiscussionList';\n\nexport default class PrivateDiscussionList extends DiscussionList {}\n","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nexport default function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/LogInModal'];","import app from 'flarum/forum/app';\nimport Button from 'flarum/common/components/Button';\nimport LogInModal from 'flarum/forum/components/LogInModal';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport PrivateDiscussionComposer from './discussions/PrivateDiscussionComposer';\n\nexport default class PrivateComposing {\n constructor(recipient) {\n this.recipient = recipient;\n }\n\n action(e) {\n e.preventDefault();\n\n return new Promise((resolve, reject) => {\n if (app.session.user) {\n let recipients = new ItemList();\n\n recipients.add('users:' + app.session.user.id(), app.session.user);\n\n if (this.recipient && app.session.user.id() !== this.recipient.id()) {\n recipients.add('users:' + this.recipient.id(), this.recipient);\n }\n\n app.composer.load(PrivateDiscussionComposer, {\n user: app.session.user,\n recipients: recipients,\n recipientUsers: recipients,\n });\n\n app.composer.show();\n\n return resolve();\n } else {\n app.modal.show(LogInModal);\n\n return reject();\n }\n });\n }\n\n component() {\n return Button.component(\n {\n icon: 'fas fa-pen',\n className: 'Button Button--primary IndexPage-newDiscussion',\n itemClassName: 'App-primaryControl fof-byobu_primaryControl',\n onclick: this.action.bind(this),\n disabled: !this.canStartDiscussion,\n },\n app.translator.trans(this.canStartDiscussion ? 'fof-byobu.forum.nav.start_button' : 'core.forum.index.cannot_start_discussion_button')\n );\n }\n\n get canStartDiscussion() {\n return app.session.user && app.forum.attribute('canStartPrivateDiscussion');\n }\n}\n","import app from 'flarum/forum/app';\nimport UserPage from 'flarum/forum/components/UserPage';\nimport PrivateDiscussionListState from '../states/PrivateDiscussionListState';\nimport Button from 'flarum/common/components/Button';\nimport Dropdown from 'flarum/common/components/Dropdown';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport listItems from 'flarum/common/helpers/listItems';\nimport PrivateDiscussionList from './discussions/PrivateDiscussionList';\nimport PrivateComposing from './PrivateComposing';\nimport canStartPrivateDiscussion from '../helpers/canStartPrivateDiscussion';\n\nexport default class PrivateDiscussionsUserPage extends UserPage {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.changeSort('latest');\n }\n\n show(user) {\n // We can not create the list in init because the user will not be available if it has to be loaded asynchronously\n this.list = new PrivateDiscussionListState({\n q: `byobu:${user.slug()} is:private`,\n sort: this.sort,\n });\n\n this.list.refresh();\n\n // We call the parent method after creating the list, this way the this.list property\n // is set before content() is called for the first time\n super.show(user);\n }\n\n handleChangeSort(sort, e) {\n e.preventDefault();\n\n this.changeSort(sort);\n }\n\n changeSort(sort) {\n this.sort = sort;\n this.loadUser(m.route.param('username'));\n }\n\n content() {\n return (\n
    \n
    \n
      {listItems(this.actionItems().toArray())}
    \n
      {listItems(this.viewItems().toArray())}
    \n
    \n \n
    \n );\n }\n\n actionItems() {\n let composing = new PrivateComposing(this.user);\n\n const items = new ItemList();\n\n if (canStartPrivateDiscussion(this.user)) {\n items.add('start_private', composing.component());\n }\n\n return items;\n }\n\n viewItems() {\n const items = new ItemList();\n const sortMap = this.list.sortMap();\n\n const sortOptions = {};\n for (const i in sortMap) {\n sortOptions[i] = app.translator.trans('core.forum.index_sort.' + i + '_button');\n }\n\n items.add(\n 'sort',\n Dropdown.component(\n {\n buttonClassName: 'Button',\n label: sortOptions[this.sort] || Object.keys(sortMap).map((key) => sortOptions[key])[0],\n },\n Object.keys(sortOptions).map((value) => {\n const label = sortOptions[value];\n const active = (this.sort || Object.keys(sortMap)[0]) === value;\n\n return Button.component(\n {\n icon: active ? 'fas fa-check' : true,\n onclick: this.handleChangeSort.bind(this, value),\n active: active,\n },\n label\n );\n })\n )\n );\n\n return items;\n }\n}\n","import app from 'flarum/forum/app';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport PrivateDiscussionsUserPage from './PrivateDiscussionsUserPage';\n\nexport default () => {\n app.routes.byobuUserPrivate = { path: '/u/:username/private', component: PrivateDiscussionsUserPage };\n app.routes.byobuPrivate = { path: '/private', component: IndexPage };\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/NotificationGrid'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/Notification'];","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\n\nexport default class PrivateDiscussionNotification extends Notification {\n icon() {\n return app.forum.attribute('byobu.icon-badge');\n }\n\n href() {\n const notification = this.attrs.notification;\n const discussion = notification.subject();\n\n return app.route.discussion(discussion);\n }\n\n content() {\n const user = this.attrs.notification.fromUser();\n return app.translator.trans('fof-byobu.forum.notifications.pd_text', {\n user: user,\n });\n }\n\n excerpt() {\n return null;\n }\n}\n","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\n\nexport default class PrivateDiscussionReplyNotification extends Notification {\n icon() {\n return 'fas fa-reply';\n }\n\n href() {\n const notification = this.attrs.notification;\n const discussion = notification.subject();\n const content = notification.content() || {};\n\n return app.route.discussion(discussion, content.postNumber);\n }\n\n content() {\n const user = this.attrs.notification.fromUser();\n return app.translator.trans('fof-byobu.forum.notifications.pd_reply_text', {\n user: user,\n });\n }\n\n excerpt() {\n return null;\n }\n}\n","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\n\nexport default class PrivateDiscussionUserLeftNotification extends Notification {\n icon() {\n return app.forum.attribute('byobu.icon-badge');\n }\n\n href() {\n const notification = this.attrs.notification;\n const discussion = notification.subject();\n\n return app.route.discussion(discussion);\n }\n\n content() {\n const user = this.attrs.notification.fromUser();\n return app.translator.trans('fof-byobu.forum.notifications.pd_user_left_text', {\n user: user,\n });\n }\n\n excerpt() {\n return null;\n }\n}\n","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\n\nexport default class PrivateDiscussionAddedNotification extends Notification {\n icon() {\n return app.forum.attribute('byobu.icon-badge');\n }\n\n href() {\n const notification = this.attrs.notification;\n const discussion = notification.subject();\n\n return app.route.discussion(discussion);\n }\n\n content() {\n const user = this.attrs.notification.fromUser();\n return app.translator.trans('fof-byobu.forum.notifications.pd_added_text', {\n user: user,\n });\n }\n\n excerpt() {\n return null;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['components/Notification'];","import app from 'flarum/forum/app';\nimport Notification from 'flarum/components/Notification';\n\nexport default class PrivateDiscussionMadePublicNotification extends Notification {\n icon() {\n return app.forum.attribute('byobu.icon-badge');\n }\n\n href() {\n const notification = this.props.notification;\n const discussion = notification.subject();\n\n return app.route.discussion(discussion);\n }\n\n content() {\n const user = this.props.notification.fromUser();\n return app.translator.trans('fof-byobu.forum.notifications.pd_made_public_text', {\n user: user,\n });\n }\n\n excerpt() {\n return null;\n }\n}\n","import AddRecipientModal from './AddRecipientModal';\n\nexport const modals = {\n AddRecipientModal: AddRecipientModal,\n};\n","import PrivateDiscussionComposer from './PrivateDiscussionComposer';\nimport PrivateDiscussionList from './PrivateDiscussionList';\n\nexport const discussions = {\n PrivateDiscussionComposer: PrivateDiscussionComposer,\n PrivateDiscussionList: PrivateDiscussionList,\n};\n","import app from 'flarum/forum/app';\nimport events from './events';\nimport extend from './extend';\nimport pages from './pages';\nimport notifications from './notifications';\n\nexport * from './modals';\nexport * from './pages/discussions';\n\napp.initializers.add('fof-byobu', function () {\n events();\n extend();\n\n pages();\n notifications();\n});\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport DiscussionListState from 'flarum/forum/states/DiscussionListState';\nimport PrivateComposing from './PrivateComposing';\n\nexport default () => {\n extend(IndexPage.prototype, 'navItems', (items) => {\n const user = app.session.user;\n\n if (user) {\n items.add(\n 'privateDiscussions',\n LinkButton.component(\n {\n icon: app.forum.data.attributes['byobu.icon-badge'],\n href: app.route('byobuPrivate'),\n },\n app.translator.trans('fof-byobu.forum.nav.nav_item')\n ),\n 75\n );\n }\n });\n\n extend(IndexPage.prototype, 'setTitle', function () {\n if (app.current.get('routeName') === 'byobuPrivate') {\n app.setTitle(app.translator.trans('fof-byobu.forum.user.dropdown_label'));\n }\n });\n\n extend(DiscussionListState.prototype, 'requestParams', function (params) {\n if (app.current.get('routeName') === 'byobuPrivate') {\n params.filter.q = (params.filter.q || '') + ' is:private';\n\n params.include.push('recipientUsers');\n params.include.push('recipientGroups');\n }\n });\n\n extend(IndexPage.prototype, 'sidebarItems', function (items) {\n if (app.current.get('routeName') === 'byobuPrivate') {\n let compose = new PrivateComposing();\n\n items.replace('newDiscussion', compose.component());\n }\n });\n};\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport NotificationGrid from 'flarum/forum/components/NotificationGrid';\nimport PrivateDiscussionNotification from './PrivateDiscussionNotification';\nimport PrivateDiscussionRepliedNotification from './PrivateDiscussionReplyNotification';\nimport PrivateDiscussionUserLeftNotification from './PrivateDiscussionUserLeftNotification';\nimport PrivateDiscussionAddedNotification from './PrivateDiscussionAddedNotification';\nimport PrivateDiscussionMadePublicNotification from './PrivateDiscussionMadePublicNotification';\n\nexport default function () {\n app.notificationComponents.byobuPrivateDiscussionCreated = PrivateDiscussionNotification;\n app.notificationComponents.byobuPrivateDiscussionReplied = PrivateDiscussionRepliedNotification;\n app.notificationComponents.byobuRecipientRemoved = PrivateDiscussionUserLeftNotification;\n app.notificationComponents.byobuPrivateDiscussionAdded = PrivateDiscussionAddedNotification;\n app.notificationComponents.byobuPrivateDiscussionMadePubic = PrivateDiscussionMadePublicNotification;\n\n grid();\n}\n\nfunction grid() {\n // Add notification preferences.\n extend(NotificationGrid.prototype, 'notificationTypes', function (items) {\n items.add('byobuPrivateDiscussionCreated', {\n name: 'byobuPrivateDiscussionCreated',\n icon: app.forum.data.attributes['byobu.icon-badge'],\n label: app.translator.trans('fof-byobu.forum.notifications.pd_label'),\n });\n items.add('byobuPrivateDiscussionReplied', {\n name: 'byobuPrivateDiscussionReplied',\n icon: app.forum.data.attributes['byobu.icon-badge'],\n label: app.translator.trans('fof-byobu.forum.notifications.pd_reply_label'),\n });\n items.add('byobuPrivateDiscussionAdded', {\n name: 'byobuPrivateDiscussionAdded',\n icon: app.forum.data.attributes['byobu.icon-badge'],\n label: app.translator.trans('fof-byobu.forum.notifications.pd_added_label'),\n });\n items.add('byobuRecipientRemoved', {\n name: 'byobuRecipientRemoved',\n icon: app.forum.data.attributes['byobu.icon-badge'],\n label: app.translator.trans('fof-byobu.forum.notifications.pd_user_left_label'),\n });\n });\n}\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","_setPrototypeOf","p","setPrototypeOf","__proto__","_inheritsLoose","subClass","superClass","create","constructor","MadePublic","initAttrs","attrs","icon","app","descriptionKey","EventPost","RecipientLeft","_objectWithoutPropertiesLoose","source","excluded","i","target","sourceKeys","keys","length","indexOf","RecipientLabel","view","vnode","label","this","recipient","link","newAttrs","style","className","classList","User","href","username","id","user","Group","class","namePlural","Component","recipientsLabel","recipients","otherAttrs","map","index","type","RecipientsModified","diff","diff1","diff2","store","filter","item","content","post","usersAdded","usersRemoved","groupsAdded","groupsRemoved","added","concat","removed","oldRecipients","newRecipients","localeBase","descriptionData","data","_extends","assign","arguments","apply","UserSearchSource","query","loading","name","children","highlight","text","avatar","undefined","q","page","limit","then","pushResults","bind","results","payload","result","push","m","redraw","GroupSearchSource","search","toLowerCase","group","substr","groupName","RecipientSearch","inputUuid","oninit","Math","random","toString","substring","oncreate","$search","$","on","e","addRecipient","focus","parentNode","clearTimeout","typingTimer","doSearch","setTimeout","searchState","getValue","setValue","sources","sourceItems","toArray","role","selected","onclick","removeRecipient","for","open","focused","active","loadingSources","dom","placeholder","extractText","oninput","onfocus","hasFocus","onblur","in","LoadingIndicator","size","items","ItemList","discussion","canEditUserRecipients","add","canEditGroupRecipients","values","split","findRecipient","clear","preventDefault","remove","Search","AddRecipientModal","Stream","assignInitialRecipients","selectedRecipients","merge","recipientSearch","SearchState","isDismissible","recipientUsers","recipientGroups","title","helpText","component","state","Button","hide","select","metaKey","ctrlKey","submit","onsubmit","forEach","save","relationships","DiscussionPage","Modal","ByobuTagDiscussionModal","tags","resolve","TagDiscussionModal","long","PrivateDiscussionComposer","_isByobuComposer","titlePlaceholder","submitLabel","composer","fields","route","param","addDefaultRecipients","users","groups","chooseRecipients","headerItems","count","recipientCountLabel","set","loaded","DiscussionComposer","canStartPrivateDiscussion","blocksPd","cannotBeDirectMessaged","PrivateDiscussionListState","DiscussionListState","PrivateDiscussionList","DiscussionList","_defineProperties","props","descriptor","configurable","writable","PrivateComposing","Constructor","protoProps","action","Promise","reject","LogInModal","itemClassName","disabled","canStartDiscussion","PrivateDiscussionsUserPage","changeSort","show","list","slug","sort","refresh","handleChangeSort","loadUser","listItems","actionItems","viewItems","composing","sortMap","sortOptions","Dropdown","buttonClassName","UserPage","PrivateDiscussionNotification","notification","subject","fromUser","excerpt","Notification","PrivateDiscussionReplyNotification","postNumber","PrivateDiscussionUserLeftNotification","PrivateDiscussionAddedNotification","PrivateDiscussionMadePublicNotification","modals","discussions","Discussion","Model","extend","badges","Badge","DiscussionListItem","DiscussionHero","params","include","DiscussionControls","canEditRecipients","isEmpty","errorHandler","err","status","console","error","find","isPrivateDiscussion","canMakePublic","confirm","extensions","public","update","SettingsPage","Switch","onchange","blocksPdLoading","UserControls","LinkButton","path","IndexPage","compose","replace","PrivateDiscussionRepliedNotification","NotificationGrid"],"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,eAA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DyL,GACzDzL,IAAAA,uBAAAA,gCAA6D0L,IAO7DkD,EAAAA,EAAAA,QAAOgC,KAAAA,UAA4B,qBAAqB,SAAUjL,GAChEA,EAAMI,IAAI,gCAAiC,CACzC1E,KAAM,gCACNoG,KAAMzH,IAAAA,MAAAA,KAAAA,WAAAA,oBACNX,MAAOW,IAAAA,WAAAA,MAAqB,4CAE9B2F,EAAMI,IAAI,gCAAiC,CACzC1E,KAAM,gCACNoG,KAAMzH,IAAAA,MAAAA,KAAAA,WAAAA,oBACNX,MAAOW,IAAAA,WAAAA,MAAqB,kDAE9B2F,EAAMI,IAAI,8BAA+B,CACvC1E,KAAM,8BACNoG,KAAMzH,IAAAA,MAAAA,KAAAA,WAAAA,oBACNX,MAAOW,IAAAA,WAAAA,MAAqB,kDAE9B2F,EAAMI,IAAI,wBAAyB,CACjC1E,KAAM,wBACNoG,KAAMzH,IAAAA,MAAAA,KAAAA,WAAAA,oBACNX,MAAOW,IAAAA,WAAAA,MAAqB,qDAE/B,GD3BF,G","sources":["webpack://@fof/byobu/webpack/bootstrap","webpack://@fof/byobu/webpack/runtime/compat get default export","webpack://@fof/byobu/webpack/runtime/define property getters","webpack://@fof/byobu/webpack/runtime/hasOwnProperty shorthand","webpack://@fof/byobu/webpack/runtime/make namespace object","webpack://@fof/byobu/external root \"flarum.core.compat['forum/app']\"","webpack://@fof/byobu/external root \"flarum.core.compat['common/extend']\"","webpack://@fof/byobu/external root \"flarum.core.compat['forum/components/SettingsPage']\"","webpack://@fof/byobu/external root \"flarum.core.compat['common/components/Switch']\"","webpack://@fof/byobu/./src/forum/extenders/SettingsPage.js","webpack://@fof/byobu/external root \"flarum.core.compat['common/components/Badge']\"","webpack://@fof/byobu/external root \"flarum.core.compat['common/models/Discussion']\"","webpack://@fof/byobu/external root \"flarum.core.compat['common/models/User']\"","webpack://@fof/byobu/external root \"flarum.core.compat['common/models/Group']\"","webpack://@fof/byobu/external root \"flarum.core.compat['common/components/Button']\"","webpack://@fof/byobu/external root \"flarum.core.compat['forum/components/DiscussionListItem']\"","webpack://@fof/byobu/external root \"flarum.core.compat['forum/components/DiscussionHero']\"","webpack://@fof/byobu/external root \"flarum.core.compat['forum/states/DiscussionListState']\"","webpack://@fof/byobu/./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","webpack://@fof/byobu/external root \"flarum.core.compat['common/utils/classList']\"","webpack://@fof/byobu/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@fof/byobu/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/byobu/external root \"flarum.core.compat['common/helpers/username']\"","webpack://@fof/byobu/external root \"flarum.core.compat['common/components/LinkButton']\"","webpack://@fof/byobu/external root \"flarum.core.compat['common/Component']\"","webpack://@fof/byobu/./src/forum/pages/labels/RecipientLabel.tsx","webpack://@fof/byobu/./src/forum/pages/labels/recipientsLabels.tsx","webpack://@fof/byobu/external root \"flarum.core.compat['forum/utils/DiscussionControls']\"","webpack://@fof/byobu/external root \"flarum.core.compat['common/utils/ItemList']\"","webpack://@fof/byobu/external root \"flarum.core.compat['common/components/Modal']\"","webpack://@fof/byobu/external root \"flarum.core.compat['forum/components/DiscussionPage']\"","webpack://@fof/byobu/external root \"flarum.core.compat['common/utils/Stream']\"","webpack://@fof/byobu/external root \"flarum.core.compat['forum/states/SearchState']\"","webpack://@fof/byobu/external root \"flarum.core.compat['forum/components/Search']\"","webpack://@fof/byobu/./node_modules/@babel/runtime/helpers/esm/extends.js","webpack://@fof/byobu/external root \"flarum.core.compat['common/helpers/highlight']\"","webpack://@fof/byobu/external root \"flarum.core.compat['common/helpers/avatar']\"","webpack://@fof/byobu/./src/forum/search/sources/UserSearchSource.js","webpack://@fof/byobu/./src/forum/search/sources/GroupSearchSource.js","webpack://@fof/byobu/external root \"flarum.core.compat['common/utils/extractText']\"","webpack://@fof/byobu/external root \"flarum.core.compat['common/components/LoadingIndicator']\"","webpack://@fof/byobu/external root \"flarum.core.compat['common/components/Tooltip']\"","webpack://@fof/byobu/./src/forum/search/RecipientSearch.js","webpack://@fof/byobu/./src/forum/modals/AddRecipientModal.js","webpack://@fof/byobu/external root \"flarum.core.compat['tags/components/TagDiscussionModal']\"","webpack://@fof/byobu/./src/forum/modals/ByobuTagDiscussionModal.js","webpack://@fof/byobu/external root \"flarum.core.compat['components/DiscussionPage']\"","webpack://@fof/byobu/./src/forum/extenders/Discussion.js","webpack://@fof/byobu/external root \"flarum.core.compat['forum/utils/UserControls']\"","webpack://@fof/byobu/external root \"flarum.core.compat['forum/components/DiscussionComposer']\"","webpack://@fof/byobu/./src/forum/pages/discussions/PrivateDiscussionComposer.js","webpack://@fof/byobu/./src/forum/pages/labels/recipientCountLabel.js","webpack://@fof/byobu/external root \"flarum.core.compat['forum/components/UserPage']\"","webpack://@fof/byobu/./src/forum/helpers/canStartPrivateDiscussion.js","webpack://@fof/byobu/./src/forum/extenders/User.js","webpack://@fof/byobu/external root \"flarum.core.compat['forum/components/IndexPage']\"","webpack://@fof/byobu/./node_modules/@babel/runtime/helpers/esm/createClass.js","webpack://@fof/byobu/external root \"flarum.core.compat['forum/components/LogInModal']\"","webpack://@fof/byobu/./src/forum/pages/PrivateComposing.js","webpack://@fof/byobu/./src/forum/pages/PrivateDiscussionsPage.js","webpack://@fof/byobu/external root \"flarum.core.compat['forum/components/NotificationGrid']\"","webpack://@fof/byobu/external root \"flarum.core.compat['forum/components/Notification']\"","webpack://@fof/byobu/./src/forum/notifications/PrivateDiscussionNotification.js","webpack://@fof/byobu/./src/forum/notifications/PrivateDiscussionReplyNotification.js","webpack://@fof/byobu/./src/forum/notifications/PrivateDiscussionUserLeftNotification.js","webpack://@fof/byobu/./src/forum/notifications/PrivateDiscussionAddedNotification.js","webpack://@fof/byobu/external root \"flarum.core.compat['components/Notification']\"","webpack://@fof/byobu/./src/forum/notifications/PrivateDiscussionMadePublicNotification.js","webpack://@fof/byobu/./src/forum/modals/index.js","webpack://@fof/byobu/external root \"flarum.core.compat['forum/components/DiscussionList']\"","webpack://@fof/byobu/./src/forum/pages/discussions/PrivateDiscussionList.js","webpack://@fof/byobu/./src/forum/pages/discussions/index.js","webpack://@fof/byobu/external root \"flarum.core.compat['common/extenders']\"","webpack://@fof/byobu/external root \"flarum.core.compat['forum/components/EventPost']\"","webpack://@fof/byobu/./src/forum/events/MadePublic.ts","webpack://@fof/byobu/./src/forum/events/RecipientLeft.ts","webpack://@fof/byobu/./src/forum/events/RecipientsModified.js","webpack://@fof/byobu/./src/forum/states/PrivateDiscussionListState.js","webpack://@fof/byobu/external root \"flarum.core.compat['common/components/Dropdown']\"","webpack://@fof/byobu/external root \"flarum.core.compat['common/helpers/listItems']\"","webpack://@fof/byobu/./src/forum/pages/PrivateDiscussionsUserPage.js","webpack://@fof/byobu/./src/forum/extend.ts","webpack://@fof/byobu/./src/forum/index.ts","webpack://@fof/byobu/./src/forum/notifications/index.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extend'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/SettingsPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Switch'];","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport SettingsPage from 'flarum/forum/components/SettingsPage';\nimport Switch from 'flarum/common/components/Switch';\n\nexport default () => {\n privacyToggle();\n};\n\nfunction privacyToggle() {\n extend(SettingsPage.prototype, 'privacyItems', function (items) {\n items.add(\n 'byobu-block-dm',\n Switch.component(\n {\n state: this.user.blocksPd(),\n onchange: (value) => {\n this.blocksPdLoading = true;\n\n this.user.save({ blocksPd: value }).then(() => {\n this.blocksPdLoading = false;\n m.redraw();\n });\n },\n loading: this.blocksPdLoading,\n },\n app.translator.trans('fof-byobu.forum.user.settings.block_pd')\n )\n );\n });\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Badge'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Discussion'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/User'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/Group'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Button'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionListItem'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionHero'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/states/DiscussionListState'];","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/classList'];","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\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/helpers/username'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LinkButton'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/Component'];","import type * as Mithril from 'mithril';\nimport username from 'flarum/common/helpers/username';\nimport User from 'flarum/common/models/User';\nimport Group from 'flarum/common/models/Group';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport classList from 'flarum/common/utils/classList';\nimport app from 'flarum/forum/app';\nimport Component, { ComponentAttrs } from 'flarum/common/Component';\nimport { NestedStringArray } from '@askvortsov/rich-icu-message-formatter';\n\nexport interface IRecipientLabelAttrs extends ComponentAttrs, Mithril.Attributes {\n recipient: User | Group;\n link: string;\n}\n\nexport default class RecipientLabel extends Component {\n view(vnode: Mithril.Vnode) {\n const { recipient, link, ...newAttrs } = this.attrs;\n\n newAttrs.style = newAttrs.style || {};\n newAttrs.className = classList('RecipientLabel', newAttrs?.className);\n\n if (link && recipient instanceof User) {\n newAttrs.href = app.route.user(recipient);\n }\n\n let label: string | NestedStringArray;\n\n if (recipient instanceof User) {\n label = username(recipient);\n\n if (!newAttrs.href && recipient.id() !== app?.session?.user?.id()) {\n newAttrs.href = app.route.user(recipient);\n }\n } else if (recipient instanceof Group) {\n return {recipient.namePlural()};\n } else {\n newAttrs.className += ' none';\n label = app.translator.trans('core.lib.username.deleted_text');\n }\n\n return {label};\n }\n}\n","import Group from 'flarum/common/models/Group';\nimport User from 'flarum/common/models/User';\nimport classList from 'flarum/common/utils/classList';\nimport RecipientLabel from './RecipientLabel';\n\nexport default function recipientsLabel(recipients?: (User | Group)[], attrs: Record = {}): JSX.Element {\n const { link, className, ...otherAttrs } = attrs;\n\n otherAttrs.className = classList('RecipientsLabel', className);\n\n return (\n \n {recipients?.map((recipient, index) => {\n const type = recipient instanceof User ? 'u' : 'g';\n\n return ;\n })}\n {!recipients && }\n \n );\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/utils/DiscussionControls'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/ItemList'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Modal'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/Stream'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/states/SearchState'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/Search'];","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}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/highlight'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/avatar'];","import app from 'flarum/forum/app';\nimport highlight from 'flarum/common/helpers/highlight';\nimport avatar from 'flarum/common/helpers/avatar';\nimport username from 'flarum/common/helpers/username';\n\nexport default class UserSearchSource {\n view(query) {\n if (query.length < 3 || this.loading) return;\n\n if (!app.cache.byobuResults) {\n app.cache.byobuResults = [];\n }\n\n this.query = query;\n\n if (!app.cache.byobuResults[this.query]) {\n this.loading = true;\n\n app.cache.byobuResults[this.query] = [];\n app.store\n .find('users', {\n filter: { q: this.query + ' allows-pd' },\n page: { limit: 5 },\n })\n .then(this.pushResults.bind(this));\n } else\n return [\n
  • {app.translator.trans('core.forum.search.users_heading')}
  • ,\n app.cache.byobuResults[this.query].map((user) => {\n const name = username(user);\n const children = [highlight(name.text, this.query)];\n\n return (\n
  • \n \n {avatar(user)}\n {{ ...name, text: undefined, children }}\n \n
  • \n );\n }),\n ];\n }\n\n pushResults(results) {\n results.payload.data.map((result) => {\n var user = app.store.getById('users', result.id);\n app.cache.byobuResults[this.query].push(user);\n });\n this.loading = false;\n m.redraw();\n }\n}\n","import app from 'flarum/forum/app';\nimport highlight from 'flarum/common/helpers/highlight';\n\nexport default class GroupSearchSource {\n search(query) {\n return app.store.find('groups', {\n filter: { q: query },\n page: { limit: 5 },\n });\n }\n\n view(query) {\n query = query.toLowerCase();\n\n const results = app.store.all('groups').filter((group) => group.namePlural().toLowerCase().substr(0, query.length) === query);\n\n if (!results.length) return '';\n\n return [\n
  • {app.translator.trans('fof-byobu.forum.search.headings.groups')}
  • ,\n results.map((group) => {\n const groupName = group.namePlural();\n var name = highlight(groupName, query);\n\n return (\n
  • \n \n {name}\n \n
  • \n );\n }),\n ];\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/utils/extractText'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/LoadingIndicator'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Tooltip'];","import app from 'flarum/forum/app';\nimport Search from 'flarum/forum/components/Search';\nimport UserSearchSource from './sources/UserSearchSource';\nimport GroupSearchSource from './sources/GroupSearchSource';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport classList from 'flarum/common/utils/classList';\nimport extractText from 'flarum/common/utils/extractText';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport RecipientLabel from '../pages/labels/RecipientLabel';\nimport User from 'flarum/common/models/User';\nimport Group from 'flarum/common/models/Group';\nimport Tooltip from 'flarum/common/components/Tooltip';\n\nexport default class RecipientSearch extends Search {\n /**\n * Used to prevent duplicate IDs. Doesn't remove the possibility, but is extremely low.\n */\n inputUuid;\n\n oninit(vnode) {\n super.oninit(vnode);\n\n this.inputUuid = Math.random().toString(36).substring(2);\n }\n\n oncreate(vnode) {\n super.oncreate(vnode);\n\n const $search = this;\n\n this.$('.Search-results').on('click', (e) => {\n const target = this.$('.SearchResult.active');\n\n $search.addRecipient(target.data('index'));\n $search.$('.RecipientsInput').focus();\n });\n\n this.$('.Search-results').on('touchstart', (e) => {\n const target = this.$(e.target.parentNode);\n\n $search.addRecipient(target.data('index'));\n $search.$('.RecipientsInput').focus();\n });\n\n $('.RecipientsInput')\n .on('input', () => {\n clearTimeout(this.typingTimer);\n this.doSearch = false;\n this.typingTimer = setTimeout(() => {\n this.doSearch = true;\n m.redraw();\n }, 900);\n })\n .on('keydown', () => {\n clearTimeout(this.typingTimer);\n });\n\n super.oncreate(vnode);\n }\n\n view() {\n if (typeof this.searchState.getValue() === 'undefined') {\n this.searchState.setValue('');\n }\n\n const loading = this.searchState.getValue() && this.searchState.getValue().length >= 3;\n\n if (!this.sources) {\n this.sources = this.sourceItems().toArray();\n }\n\n return (\n
    \n
    \n

    {app.translator.trans('fof-byobu.forum.modal.labels.selected_users')}

    \n

    {app.translator.trans('fof-byobu.forum.modal.help.selected_users')}

    \n\n {this.attrs\n .selected()\n .toArray()\n .map((recipient) => {\n return (\n \n this.removeRecipient(recipient, e)} />\n \n );\n })}\n
    \n\n
    \n \n\n
    \n vnode.dom.focus()}\n type=\"search\"\n placeholder={extractText(app.translator.trans('fof-byobu.forum.input.search_recipients'))}\n value={this.searchState.getValue()}\n oninput={(e) => this.searchState.setValue(e.target.value)}\n onfocus={() => (this.hasFocus = true)}\n onblur={() => (this.hasFocus = false)}\n />\n \n {!this.doSearch\n ? LoadingIndicator.component({ size: 'tiny', className: 'Button Button--icon Button--link' })\n : this.sources.map((source) => source.view(this.searchState.getValue()))}\n \n
    \n
    \n
    \n );\n }\n\n /**\n * Build an item list of SearchSources.\n *\n * @return {ItemList}\n */\n sourceItems() {\n const items = new ItemList();\n\n // Add user source based on permissions.\n if (\n (!this.attrs.discussion && app.forum.attribute('canStartPrivateDiscussionWithUsers')) ||\n (this.attrs.discussion && this.attrs.discussion.canEditUserRecipients())\n ) {\n items.add('users', new UserSearchSource());\n }\n\n // Add group source based on permissions.\n if (\n (!this.attrs.discussion && app.forum.attribute('canStartPrivateDiscussionWithGroups')) ||\n (this.attrs.discussion && this.attrs.discussion.canEditGroupRecipients())\n ) {\n items.add('groups', new GroupSearchSource());\n }\n\n return items;\n }\n\n /**\n * Adds a recipient.\n *\n * @param value\n */\n addRecipient(value) {\n let values = value.split(':'),\n type = values[0],\n id = values[1];\n\n let recipient = this.findRecipient(type, id);\n\n this.attrs.selected().add(value, recipient);\n\n this.searchState.clear();\n }\n\n /**\n * Removes a recipient.\n *\n * @param recipient\n */\n removeRecipient(recipient, e) {\n e.preventDefault();\n\n let type;\n\n if (recipient instanceof User) {\n type = 'users';\n }\n if (recipient instanceof Group) {\n type = 'groups';\n }\n\n this.attrs.selected().remove(type + ':' + recipient.id());\n }\n\n /**\n * Loads a recipient from the global store.\n *\n * @param store\n * @param id\n * @returns {Model}\n */\n findRecipient(store, id) {\n return app.store.getById(store, id);\n }\n}\n","import app from 'flarum/forum/app';\nimport Modal from 'flarum/common/components/Modal';\nimport DiscussionPage from 'flarum/forum/components/DiscussionPage';\nimport Button from 'flarum/common/components/Button';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Stream from 'flarum/common/utils/Stream';\nimport SearchState from 'flarum/forum/states/SearchState';\nimport RecipientSearch from '../search/RecipientSearch';\nimport User from 'flarum/common/models/User';\nimport Group from 'flarum/common/models/Group';\n\nexport default class AddRecipientModal extends Modal {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.selected = Stream(new ItemList());\n\n if (this.attrs.discussion) {\n // Adds recipients of the currently viewed discussion.\n this.assignInitialRecipients(this.attrs.discussion);\n } else if (this.attrs.selectedRecipients && this.attrs.selectedRecipients.toArray().length > 0) {\n // Adds previously selected recipients.\n this.selected().merge(this.attrs.selectedRecipients);\n } else {\n // Adds the current user in case there are no selected recipients yet and this is a new discussion.\n this.selected().add('users:' + app.session.user.id(), app.session.user);\n }\n\n this.recipientSearch = new SearchState();\n }\n\n isDismissible() {\n return false;\n }\n\n assignInitialRecipients(discussion) {\n discussion.recipientUsers().map((user) => {\n this.selected().add('users:' + user.id(), user);\n });\n discussion.recipientGroups().map((group) => {\n this.selected().add('groups:' + group.id(), group);\n });\n }\n\n className() {\n return 'AddRecipientModal';\n }\n\n title() {\n return this.attrs.discussion\n ? app.translator.trans('fof-byobu.forum.modal.titles.update_recipients', { title: {this.attrs.discussion.title()} })\n : app.translator.trans('fof-byobu.forum.modal.titles.add_recipients');\n }\n\n helpText() {\n return this.attrs.discussion\n ? app.translator.trans('fof-byobu.forum.modal.help.update_recipients')\n : app.translator.trans('fof-byobu.forum.modal.help.add_recipients');\n }\n\n content() {\n return [\n
    \n
    {this.helpText()}
    \n
    \n {RecipientSearch.component({\n state: this.recipientSearch,\n selected: this.selected,\n discussion: this.attrs.discussion,\n })}\n
    \n {Button.component(\n {\n type: 'submit',\n className: 'Button Button--primary',\n icon: 'fas fa-check',\n },\n app.translator.trans('fof-byobu.forum.buttons.submit')\n )}\n {Button.component(\n {\n onclick: this.hide.bind(this),\n className: 'Button Button--cancel',\n },\n app.translator.trans('fof-byobu.forum.buttons.cancel')\n )}\n
    \n
    \n
    ,\n ];\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 this.$('form').submit();\n }\n }\n }\n\n onsubmit(e) {\n e.preventDefault();\n\n const discussion = this.attrs.discussion;\n const recipients = this.selected();\n\n let recipientGroups = [];\n let recipientUsers = [];\n\n recipients.toArray().forEach((recipient) => {\n if (recipient instanceof User) {\n recipientUsers.push(recipient);\n }\n if (recipient instanceof Group) {\n recipientGroups.push(recipient);\n }\n });\n\n // Recipients are updated here for existing discussions here.\n if (discussion) {\n discussion.save({ relationships: { recipientUsers, recipientGroups } }).then(() => {\n if (app.current instanceof DiscussionPage) {\n app.current.stream.update();\n }\n m.redraw();\n });\n }\n\n // Use the onsubmit callback to trigger an update in the DiscussionComposer\n if (this.attrs.onsubmit) this.attrs.onsubmit(recipients);\n\n app.modal.close();\n\n if (!this.attrs.discussion) {\n app.composer.show();\n }\n\n e.redraw = false;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['tags/components/TagDiscussionModal'];","import app from 'flarum/forum/app';\nimport TagDiscussionModal from 'flarum/tags/components/TagDiscussionModal';\n\nexport default class ByobuTagDiscussionModal extends TagDiscussionModal {\n static isDismissible = false;\n\n onsubmit(e) {\n e.preventDefault();\n\n const tags = this.selected;\n\n if (this.attrs.resolve) this.attrs.resolve(tags);\n\n this.hide();\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['components/DiscussionPage'];","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport Badge from 'flarum/common/components/Badge';\nimport Discussion from 'flarum/common/models/Discussion';\nimport User from 'flarum/common/models/User';\nimport Group from 'flarum/common/models/Group';\nimport Button from 'flarum/common/components/Button';\nimport DiscussionListItem from 'flarum/forum/components/DiscussionListItem';\nimport DiscussionHero from 'flarum/forum/components/DiscussionHero';\nimport DiscussionListState from 'flarum/forum/states/DiscussionListState';\nimport recipientsLabel from '../pages/labels/recipientsLabels';\nimport DiscussionControls from 'flarum/forum/utils/DiscussionControls';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport AddRecipientModal from '../modals/AddRecipientModal';\nimport ByobuTagDiscussionModal from '../modals/ByobuTagDiscussionModal';\nimport DiscussionPage from 'flarum/components/DiscussionPage';\n\nexport default () => {\n badges();\n index();\n hero();\n apiInclude();\n controls();\n};\n\nconst add = function (discussion, items, long) {\n let recipients = [];\n\n if (discussion.recipientUsers().length) {\n recipients = recipients.concat(discussion.recipientUsers());\n }\n\n if (discussion.recipientGroups().length) {\n recipients = recipients.concat(discussion.recipientGroups());\n }\n\n if (recipients && recipients.length) {\n if (long) {\n items.add('recipients', recipientsLabel(recipients), 10);\n } else {\n items.add('recipients', recipientsLabel(recipients, { link: true }), 4);\n }\n }\n};\n\nfunction badges() {\n extend(Discussion.prototype, 'badges', function (badges) {\n if (this.recipientUsers().length || this.recipientGroups().length) {\n badges.add(\n 'private',\n Badge.component({\n type: 'private',\n label: app.translator.trans('fof-byobu.forum.badges.is_private.tooltip'),\n icon: app.forum.data.attributes['byobu.icon-badge'],\n }),\n 10\n );\n }\n });\n}\n\nfunction index() {\n extend(DiscussionListItem.prototype, 'infoItems', function (items) {\n const discussion = this.attrs.discussion;\n\n add(discussion, items, true);\n });\n}\n\nfunction hero() {\n extend(DiscussionHero.prototype, 'items', function (items) {\n const discussion = this.attrs.discussion;\n\n add(discussion, items, false);\n });\n}\n\nfunction apiInclude() {\n extend(DiscussionListState.prototype, 'requestParams', function (params) {\n params.include.push('recipientUsers');\n params.include.push('recipientGroups');\n });\n}\n\nfunction controls() {\n extend(DiscussionControls, 'moderationControls', function (items, discussion) {\n if (discussion.canEditRecipients()) {\n items.add(\n 'recipients',\n Button.component(\n {\n icon: app.forum.data.attributes['byobu.icon-badge'],\n onclick: () =>\n app.modal.show(AddRecipientModal, {\n discussion,\n /**\n * @param {ItemList} recipients\n */\n onsubmit(recipients) {\n if (recipients.isEmpty()) {\n // The discussion might have been perma-deleted! Let's check...\n app.store\n .find(\n 'discussions',\n discussion.id(),\n {},\n {\n errorHandler(err) {\n if (err.status === 404) {\n // Almost certainly permadeleted, so let's just redirect to the PD list.\n m.route.set(app.route('byobuPrivate'));\n }\n },\n }\n )\n .catch((err) => {\n // some other error... assume not deleted\n console.error(err);\n });\n }\n },\n }),\n },\n app.translator.trans('fof-byobu.forum.buttons.edit_recipients')\n )\n );\n }\n if (discussion && discussion.recipientUsers().find((user) => user.id() === app.session.user.id())) {\n items.add(\n 'remove',\n Button.component(\n {\n icon: 'fas fa-user-slash',\n onclick: () => {\n if (discussion) {\n let recipients = new ItemList();\n discussion.recipientUsers().map((user) => {\n if (app.session.user.id() !== user.id()) {\n recipients.add('users:' + user.id(), user);\n }\n });\n\n let recipientGroups = [];\n let recipientUsers = [];\n\n recipients.toArray().forEach((recipient) => {\n if (recipient instanceof User) {\n recipientUsers.push(recipient);\n }\n if (recipient instanceof Group) {\n recipientGroups.push(recipient);\n }\n });\n\n discussion\n .save({\n relationships: {\n recipientUsers,\n recipientGroups,\n },\n })\n .then(() => app.history.back());\n }\n },\n },\n app.translator.trans('fof-byobu.forum.buttons.remove_from_discussion')\n )\n );\n\n if (discussion?.isPrivateDiscussion?.() && discussion?.canMakePublic?.()) {\n items.add(\n 'transform-public',\n {\n if (discussion && confirm(app.translator.trans('fof-byobu.forum.confirm.make_public'))) {\n const recipientGroups = [];\n const recipientUsers = [];\n\n if (flarum.extensions['flarum-tags']) {\n new Promise((resolve, reject) => {\n app.modal.show(ByobuTagDiscussionModal, { discussion, resolve, reject });\n }).then((tags) => {\n discussion.save({ relationships: { recipientUsers, recipientGroups }, public: discussion.id() }).then(() => {\n discussion.save({ relationships: { tags } }).then(() => {\n if (app.current.matches(DiscussionPage)) {\n app.current.get('stream').update();\n }\n m.redraw();\n });\n });\n });\n } else {\n discussion.save({ relationships: { recipientUsers, recipientGroups }, public: discussion.id() }).then(() => m.redraw());\n }\n }\n }}\n >\n {app.translator.trans('fof-byobu.forum.buttons.make_public')}\n \n );\n }\n }\n });\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/utils/UserControls'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionComposer'];","import app from 'flarum/forum/app';\nimport DiscussionComposer from 'flarum/forum/components/DiscussionComposer';\nimport AddRecipientModal from '../../modals/AddRecipientModal';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport recipientCountLabel from '../labels/recipientCountLabel';\nimport User from 'flarum/common/models/User';\nimport Group from 'flarum/common/models/Group';\n\nexport default class PrivateDiscussionComposer extends DiscussionComposer {\n /**\n * Tells other extensions that this composer is a Byobu composer.\n */\n _isByobuComposer = true;\n\n static initAttrs(attrs) {\n super.initAttrs(attrs);\n\n attrs.titlePlaceholder = app.translator.trans('fof-byobu.forum.composer_private_discussion.title_placeholder');\n attrs.submitLabel = app.translator.trans('fof-byobu.forum.composer_private_discussion.submit_button');\n }\n\n oninit(vnode) {\n super.oninit(vnode);\n\n this.composer.fields.recipients = this.attrs.recipients || new ItemList();\n\n this.composer.fields.recipientUsers = this.attrs.recipientUsers || [];\n this.composer.fields.recipientGroups = this.attrs.recipientGroups || [];\n\n const username = m.route.param('username');\n\n if (typeof username !== 'undefined') {\n this.addDefaultRecipients(username);\n }\n }\n\n data() {\n let data = super.data();\n\n const users = [];\n const groups = [];\n\n if (this.composer.fields.recipients !== undefined) {\n this.composer.fields.recipients.toArray().forEach((recipient) => {\n if (recipient instanceof User) {\n users.push(recipient);\n }\n\n if (recipient instanceof Group) {\n groups.push(recipient);\n }\n });\n }\n\n data.relationships = data.relationships || {};\n\n if (users.length) {\n data.relationships.recipientUsers = users;\n }\n\n if (groups.length) {\n data.relationships.recipientGroups = groups;\n }\n\n delete data.relationships.tags;\n\n return data;\n }\n\n chooseRecipients() {\n app.modal.show(AddRecipientModal, {\n selectedRecipients: this.composer.fields.recipients,\n onsubmit: (recipients) => {\n this.composer.fields.recipients = recipients;\n\n // Focus on recipient autocomplete field.\n this.$('.RecipientsInput').focus();\n },\n });\n }\n\n headerItems() {\n let items = super.headerItems();\n\n items.remove('tags');\n\n if (app.session.user && app.forum.attribute('canStartPrivateDiscussion')) {\n const recipients = this.composer.fields.recipients.toArray();\n\n items.add(\n 'recipients',\n \n {recipients.length ? (\n recipientCountLabel(recipients.length)\n ) : (\n {app.translator.trans('fof-byobu.forum.buttons.add_recipients')}\n )}\n ,\n 5\n );\n }\n\n return items;\n }\n\n addDefaultRecipients(username) {\n const user = app.store.getBy('users', 'slug', username);\n\n this.composer.fields.recipients.add('users:' + app.session.user.id(), app.session.user);\n\n if (user.id() !== app.session.user.id()) {\n this.composer.fields.recipients.add('users:' + user.id(), user);\n }\n }\n\n onsubmit() {\n this.loading = true;\n\n const recipients = this.composer.fields.recipients.toArray();\n\n if (recipients.length < 2) {\n this.chooseRecipients();\n\n this.loading = false;\n } else {\n const data = this.data();\n\n app.store\n .createRecord('discussions')\n .save(data)\n .then((discussion) => {\n if (app.cache.discussionList) {\n app.cache.discussionList.refresh();\n }\n m.route.set(app.route.discussion(discussion));\n\n app.composer.hide();\n }, this.loaded.bind(this));\n }\n }\n}\n","import app from 'flarum/forum/app';\n\nexport default function recipientCountLabel(count, attrs = {}) {\n attrs.style = attrs.style || {};\n attrs.className = 'RecipientLabel ' + (attrs.className || '');\n\n var label = app.translator.trans('fof-byobu.forum.labels.recipients', { count });\n\n return m('span', attrs, {label});\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/UserPage'];","import app from 'flarum/forum/app';\n\nexport default function canStartPrivateDiscussion(recipient) {\n return (\n app.session.user &&\n app.session.user.id() !== recipient.id() &&\n app.forum.attribute('canStartPrivateDiscussion') &&\n (!recipient.blocksPd() || (app.forum.attribute('canStartPrivateDiscussionWithBlockers') && recipient.cannotBeDirectMessaged()))\n );\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport UserControls from 'flarum/forum/utils/UserControls';\nimport PrivateDiscussionComposer from '../pages/discussions/PrivateDiscussionComposer';\nimport Button from 'flarum/common/components/Button';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport UserPage from 'flarum/forum/components/UserPage';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport canStartPrivateDiscussion from '../helpers/canStartPrivateDiscussion';\n\nexport default () => {\n message();\n sharedMessageHistory();\n};\n\nfunction message() {\n extend(UserControls, 'userControls', function (items, user) {\n if (canStartPrivateDiscussion(user)) {\n items.add(\n 'private-discussion',\n Button.component(\n {\n icon: app.forum.attribute('byobu.icon-badge'),\n onclick: (e) => {\n e.preventDefault();\n\n return new Promise((resolve) => {\n let recipients = new ItemList();\n recipients.add('users:' + app.session.user.id(), app.session.user);\n recipients.add('users:' + user.id(), user);\n\n PrivateDiscussionComposer.prototype.recipients = recipients;\n\n app.composer.load(PrivateDiscussionComposer, {\n user: app.session.user,\n recipients: recipients,\n recipientUsers: recipients,\n titlePlaceholder: app.translator.trans('fof-byobu.forum.composer_private_discussion.title_placeholder'),\n submitLabel: app.translator.trans('fof-byobu.forum.composer_private_discussion.submit_button'),\n });\n app.composer.show();\n\n return resolve(app.composer);\n });\n },\n },\n app.translator.trans('fof-byobu.forum.buttons.send_pd', { username: user.displayName() })\n )\n );\n }\n\n return items;\n });\n}\n\nfunction sharedMessageHistory() {\n extend(UserPage.prototype, 'navItems', function (items) {\n const href = app.route('byobuUserPrivate', { username: this.user.slug() });\n\n // Hide links from guests if they are not already on the page\n if (!app.session.user && m.route.get() !== href) return;\n // Hide link for your own page.\n if (app.session.user === this.user) return;\n\n items.add(\n 'byobu',\n LinkButton.component(\n {\n href,\n icon: app.forum.attribute('byobu.icon-badge'),\n },\n app.translator.trans('fof-byobu.forum.user.byobu_link')\n ),\n 85\n );\n });\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/IndexPage'];","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nexport default function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/LogInModal'];","import app from 'flarum/forum/app';\nimport Button from 'flarum/common/components/Button';\nimport LogInModal from 'flarum/forum/components/LogInModal';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport PrivateDiscussionComposer from './discussions/PrivateDiscussionComposer';\n\nexport default class PrivateComposing {\n constructor(recipient) {\n this.recipient = recipient;\n }\n\n action(e) {\n e.preventDefault();\n\n return new Promise((resolve, reject) => {\n if (app.session.user) {\n let recipients = new ItemList();\n\n recipients.add('users:' + app.session.user.id(), app.session.user);\n\n if (this.recipient && app.session.user.id() !== this.recipient.id()) {\n recipients.add('users:' + this.recipient.id(), this.recipient);\n }\n\n app.composer.load(PrivateDiscussionComposer, {\n user: app.session.user,\n recipients: recipients,\n recipientUsers: recipients,\n });\n\n app.composer.show();\n\n return resolve();\n } else {\n app.modal.show(LogInModal);\n\n return reject();\n }\n });\n }\n\n component() {\n return Button.component(\n {\n icon: 'fas fa-pen',\n className: 'Button Button--primary IndexPage-newDiscussion',\n itemClassName: 'App-primaryControl fof-byobu_primaryControl',\n onclick: this.action.bind(this),\n disabled: !this.canStartDiscussion,\n },\n app.translator.trans(this.canStartDiscussion ? 'fof-byobu.forum.nav.start_button' : 'core.forum.index.cannot_start_discussion_button')\n );\n }\n\n get canStartDiscussion() {\n return app.session.user && app.forum.attribute('canStartPrivateDiscussion');\n }\n}\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport DiscussionListState from 'flarum/forum/states/DiscussionListState';\nimport PrivateComposing from './PrivateComposing';\n\nexport default () => {\n extend(IndexPage.prototype, 'navItems', (items) => {\n const user = app.session.user;\n\n if (user) {\n items.add(\n 'privateDiscussions',\n LinkButton.component(\n {\n icon: app.forum.data.attributes['byobu.icon-badge'],\n href: app.route('byobuPrivate'),\n },\n app.translator.trans('fof-byobu.forum.nav.nav_item')\n ),\n 75\n );\n }\n });\n\n extend(IndexPage.prototype, 'setTitle', function () {\n if (app.current.get('routeName') === 'byobuPrivate') {\n app.setTitle(app.translator.trans('fof-byobu.forum.user.dropdown_label'));\n }\n });\n\n extend(DiscussionListState.prototype, 'requestParams', function (params) {\n if (app.current.get('routeName') === 'byobuPrivate') {\n params.filter.q = (params.filter.q || '') + ' is:private';\n\n params.include.push('recipientUsers');\n params.include.push('recipientGroups');\n }\n });\n\n extend(IndexPage.prototype, 'sidebarItems', function (items) {\n if (app.current.get('routeName') === 'byobuPrivate') {\n let compose = new PrivateComposing();\n\n items.setContent('newDiscussion', compose.component());\n }\n });\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/NotificationGrid'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/Notification'];","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\n\nexport default class PrivateDiscussionNotification extends Notification {\n icon() {\n return app.forum.attribute('byobu.icon-badge');\n }\n\n href() {\n const notification = this.attrs.notification;\n const discussion = notification.subject();\n\n return app.route.discussion(discussion);\n }\n\n content() {\n const user = this.attrs.notification.fromUser();\n return app.translator.trans('fof-byobu.forum.notifications.pd_text', {\n user: user,\n });\n }\n\n excerpt() {\n return null;\n }\n}\n","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\n\nexport default class PrivateDiscussionReplyNotification extends Notification {\n icon() {\n return 'fas fa-reply';\n }\n\n href() {\n const notification = this.attrs.notification;\n const discussion = notification.subject();\n const content = notification.content() || {};\n\n return app.route.discussion(discussion, content.postNumber);\n }\n\n content() {\n const user = this.attrs.notification.fromUser();\n return app.translator.trans('fof-byobu.forum.notifications.pd_reply_text', {\n user: user,\n });\n }\n\n excerpt() {\n return null;\n }\n}\n","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\n\nexport default class PrivateDiscussionUserLeftNotification extends Notification {\n icon() {\n return app.forum.attribute('byobu.icon-badge');\n }\n\n href() {\n const notification = this.attrs.notification;\n const discussion = notification.subject();\n\n return app.route.discussion(discussion);\n }\n\n content() {\n const user = this.attrs.notification.fromUser();\n return app.translator.trans('fof-byobu.forum.notifications.pd_user_left_text', {\n user: user,\n });\n }\n\n excerpt() {\n return null;\n }\n}\n","import app from 'flarum/forum/app';\nimport Notification from 'flarum/forum/components/Notification';\n\nexport default class PrivateDiscussionAddedNotification extends Notification {\n icon() {\n return app.forum.attribute('byobu.icon-badge');\n }\n\n href() {\n const notification = this.attrs.notification;\n const discussion = notification.subject();\n\n return app.route.discussion(discussion);\n }\n\n content() {\n const user = this.attrs.notification.fromUser();\n return app.translator.trans('fof-byobu.forum.notifications.pd_added_text', {\n user: user,\n });\n }\n\n excerpt() {\n return null;\n }\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['components/Notification'];","import app from 'flarum/forum/app';\nimport Notification from 'flarum/components/Notification';\n\nexport default class PrivateDiscussionMadePublicNotification extends Notification {\n icon() {\n return app.forum.attribute('byobu.icon-badge');\n }\n\n href() {\n const notification = this.props.notification;\n const discussion = notification.subject();\n\n return app.route.discussion(discussion);\n }\n\n content() {\n const user = this.props.notification.fromUser();\n return app.translator.trans('fof-byobu.forum.notifications.pd_made_public_text', {\n user: user,\n });\n }\n\n excerpt() {\n return null;\n }\n}\n","import AddRecipientModal from './AddRecipientModal';\n\nexport const modals = {\n AddRecipientModal: AddRecipientModal,\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/DiscussionList'];","import DiscussionList from 'flarum/forum/components/DiscussionList';\n\nexport default class PrivateDiscussionList extends DiscussionList {}\n","import PrivateDiscussionComposer from './PrivateDiscussionComposer';\nimport PrivateDiscussionList from './PrivateDiscussionList';\n\nexport const discussions = {\n PrivateDiscussionComposer: PrivateDiscussionComposer,\n PrivateDiscussionList: PrivateDiscussionList,\n};\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/extenders'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['forum/components/EventPost'];","import app from 'flarum/forum/app';\nimport EventPost from 'flarum/forum/components/EventPost';\n\nexport default class MadePublic extends EventPost {\n static initAttrs(attrs: any) {\n super.initAttrs(attrs);\n }\n\n icon() {\n return app.forum.attribute('byobu.icon-postAction');\n }\n\n descriptionKey() {\n return 'fof-byobu.forum.post.recipients_modified.made_public';\n }\n}\n","import app from 'flarum/forum/app';\nimport EventPost from 'flarum/forum/components/EventPost';\n\nexport default class RecipientLeft extends EventPost {\n static initAttrs(attrs: any) {\n super.initAttrs(attrs);\n }\n\n icon() {\n return app.forum.attribute('byobu.icon-postAction');\n }\n\n descriptionKey() {\n return 'fof-byobu.forum.post.recipients_modified.removed_self';\n }\n}\n","import app from 'flarum/forum/app';\nimport EventPost from 'flarum/forum/components/EventPost';\nimport recipientsLabel from '../pages/labels/recipientsLabels';\n\nexport default class RecipientsModified extends EventPost {\n static initAttrs(attrs) {\n super.initAttrs(attrs);\n\n function diff(diff1, diff2, store) {\n return diff1.filter((item) => diff2.indexOf(item) === -1).map((id) => app.store.getById(store, id));\n }\n\n const content = attrs.post.content();\n\n // For event posts existing before groups functionality.\n if (!content['new'] && content.length == 2) {\n const oldRecipients = attrs.post.content()[0];\n const newRecipients = attrs.post.content()[1];\n attrs.added = diff(newRecipients, oldRecipients, 'users');\n attrs.removed = diff(oldRecipients, newRecipients, 'users');\n } else {\n let usersAdded = diff(content['new']['users'], content['old']['users'], 'users');\n let usersRemoved = diff(content['old']['users'], content['new']['users'], 'users');\n let groupsAdded = diff(content['new']['groups'], content['old']['groups'], 'groups');\n let groupsRemoved = diff(content['old']['groups'], content['new']['groups'], 'groups');\n\n attrs.added = usersAdded.concat(groupsAdded);\n attrs.removed = usersRemoved.concat(groupsRemoved);\n }\n }\n\n icon() {\n return app.forum.attribute('byobu.icon-postAction');\n }\n\n descriptionKey() {\n var localeBase = 'fof-byobu.forum.post.recipients_modified.';\n\n if (this.attrs.added.length) {\n if (this.attrs.removed.length) {\n return localeBase + 'added_and_removed';\n }\n\n return localeBase + 'added';\n }\n\n return localeBase + 'removed';\n }\n\n descriptionData() {\n const data = {};\n\n if (this.attrs.added.length) {\n data.added = recipientsLabel(this.attrs.added, { link: true });\n }\n\n if (this.attrs.removed.length) {\n data.removed = recipientsLabel(this.attrs.removed, { link: true });\n }\n\n return data;\n }\n}\n","import DiscussionListState from 'flarum/forum/states/DiscussionListState';\n\nexport default class PrivateDiscussionListState extends DiscussionListState {}\n","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Dropdown'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/listItems'];","import app from 'flarum/forum/app';\nimport UserPage from 'flarum/forum/components/UserPage';\nimport PrivateDiscussionListState from '../states/PrivateDiscussionListState';\nimport Button from 'flarum/common/components/Button';\nimport Dropdown from 'flarum/common/components/Dropdown';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport listItems from 'flarum/common/helpers/listItems';\nimport PrivateDiscussionList from './discussions/PrivateDiscussionList';\nimport PrivateComposing from './PrivateComposing';\nimport canStartPrivateDiscussion from '../helpers/canStartPrivateDiscussion';\n\nexport default class PrivateDiscussionsUserPage extends UserPage {\n oninit(vnode) {\n super.oninit(vnode);\n\n this.changeSort('latest');\n }\n\n show(user) {\n // We can not create the list in init because the user will not be available if it has to be loaded asynchronously\n this.list = new PrivateDiscussionListState({\n q: `byobu:${user.slug()} is:private`,\n sort: this.sort,\n });\n\n this.list.refresh();\n\n // We call the parent method after creating the list, this way the this.list property\n // is set before content() is called for the first time\n super.show(user);\n }\n\n handleChangeSort(sort, e) {\n e.preventDefault();\n\n this.changeSort(sort);\n }\n\n changeSort(sort) {\n this.sort = sort;\n this.loadUser(m.route.param('username'));\n }\n\n content() {\n return (\n
    \n
    \n
      {listItems(this.actionItems().toArray())}
    \n
      {listItems(this.viewItems().toArray())}
    \n
    \n \n
    \n );\n }\n\n actionItems() {\n let composing = new PrivateComposing(this.user);\n\n const items = new ItemList();\n\n if (canStartPrivateDiscussion(this.user)) {\n items.add('start_private', composing.component());\n }\n\n return items;\n }\n\n viewItems() {\n const items = new ItemList();\n const sortMap = this.list.sortMap();\n\n const sortOptions = {};\n for (const i in sortMap) {\n sortOptions[i] = app.translator.trans('core.forum.index_sort.' + i + '_button');\n }\n\n items.add(\n 'sort',\n Dropdown.component(\n {\n buttonClassName: 'Button',\n label: sortOptions[this.sort] || Object.keys(sortMap).map((key) => sortOptions[key])[0],\n },\n Object.keys(sortOptions).map((value) => {\n const label = sortOptions[value];\n const active = (this.sort || Object.keys(sortMap)[0]) === value;\n\n return Button.component(\n {\n icon: active ? 'fas fa-check' : true,\n onclick: this.handleChangeSort.bind(this, value),\n active: active,\n },\n label\n );\n })\n )\n );\n\n return items;\n }\n}\n","import Extend from 'flarum/common/extenders';\nimport Discussion from 'flarum/common/models/Discussion';\nimport Group from 'flarum/common/models/Group';\nimport User from 'flarum/common/models/User';\nimport IndexPage from 'flarum/forum/components/IndexPage';\nimport MadePublic from './events/MadePublic';\nimport RecipientLeft from './events/RecipientLeft';\nimport RecipientsModified from './events/RecipientsModified';\nimport PrivateDiscussionsUserPage from './pages/PrivateDiscussionsUserPage';\n\nexport default [\n new Extend.PostTypes().add('recipientsModified', RecipientsModified).add('recipientLeft', RecipientLeft).add('madePublic', MadePublic),\n\n new Extend.Routes().add('byobuUserPrivate', '/u/:username/private', PrivateDiscussionsUserPage).add('byobuPrivate', '/private', IndexPage),\n\n new Extend.Model(Discussion)\n .hasMany('recipientUsers')\n .hasMany('oldRecipientUsers')\n .hasMany('recipientGroups')\n .hasMany('oldRecipientGroups')\n .attribute('canEditRecipients')\n .attribute('canEditUserRecipients')\n .attribute('canEditGroupRecipients')\n .attribute('canMakePublic')\n .attribute('isPrivateDiscussion'),\n\n new Extend.Model(User).attribute('blocksPd').attribute('cannotBeDirectMessaged').attribute('unreadPrivateMessagesCount'),\n];\n","import app from 'flarum/forum/app';\nimport extenders from './extenders';\nimport pages from './pages';\nimport notifications from './notifications';\n\nexport * from './modals';\nexport * from './pages/discussions';\n\nexport { default as extend } from './extend';\n\napp.initializers.add('fof-byobu', function () {\n extenders();\n\n pages();\n notifications();\n});\n","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport NotificationGrid from 'flarum/forum/components/NotificationGrid';\nimport PrivateDiscussionNotification from './PrivateDiscussionNotification';\nimport PrivateDiscussionRepliedNotification from './PrivateDiscussionReplyNotification';\nimport PrivateDiscussionUserLeftNotification from './PrivateDiscussionUserLeftNotification';\nimport PrivateDiscussionAddedNotification from './PrivateDiscussionAddedNotification';\nimport PrivateDiscussionMadePublicNotification from './PrivateDiscussionMadePublicNotification';\n\nexport default function () {\n app.notificationComponents.byobuPrivateDiscussionCreated = PrivateDiscussionNotification;\n app.notificationComponents.byobuPrivateDiscussionReplied = PrivateDiscussionRepliedNotification;\n app.notificationComponents.byobuRecipientRemoved = PrivateDiscussionUserLeftNotification;\n app.notificationComponents.byobuPrivateDiscussionAdded = PrivateDiscussionAddedNotification;\n app.notificationComponents.byobuPrivateDiscussionMadePubic = PrivateDiscussionMadePublicNotification;\n\n grid();\n}\n\nfunction grid() {\n // Add notification preferences.\n extend(NotificationGrid.prototype, 'notificationTypes', function (items) {\n items.add('byobuPrivateDiscussionCreated', {\n name: 'byobuPrivateDiscussionCreated',\n icon: app.forum.data.attributes['byobu.icon-badge'],\n label: app.translator.trans('fof-byobu.forum.notifications.pd_label'),\n });\n items.add('byobuPrivateDiscussionReplied', {\n name: 'byobuPrivateDiscussionReplied',\n icon: app.forum.data.attributes['byobu.icon-badge'],\n label: app.translator.trans('fof-byobu.forum.notifications.pd_reply_label'),\n });\n items.add('byobuPrivateDiscussionAdded', {\n name: 'byobuPrivateDiscussionAdded',\n icon: app.forum.data.attributes['byobu.icon-badge'],\n label: app.translator.trans('fof-byobu.forum.notifications.pd_added_label'),\n });\n items.add('byobuRecipientRemoved', {\n name: 'byobuRecipientRemoved',\n icon: app.forum.data.attributes['byobu.icon-badge'],\n label: app.translator.trans('fof-byobu.forum.notifications.pd_user_left_label'),\n });\n });\n}\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","_objectWithoutPropertiesLoose","source","excluded","i","target","sourceKeys","keys","length","indexOf","_setPrototypeOf","p","setPrototypeOf","__proto__","_inheritsLoose","subClass","superClass","create","constructor","RecipientLabel","view","vnode","label","this","attrs","recipient","link","newAttrs","style","className","classList","User","href","app","username","id","user","Group","class","namePlural","Component","recipientsLabel","recipients","otherAttrs","map","index","type","_extends","assign","arguments","apply","UserSearchSource","query","loading","name","children","highlight","text","avatar","undefined","filter","q","page","limit","then","pushResults","bind","results","payload","data","result","push","m","redraw","GroupSearchSource","search","toLowerCase","group","substr","groupName","RecipientSearch","inputUuid","oninit","Math","random","toString","substring","oncreate","$search","$","on","e","addRecipient","focus","parentNode","clearTimeout","typingTimer","doSearch","setTimeout","searchState","getValue","setValue","sources","sourceItems","toArray","role","selected","onclick","removeRecipient","for","open","focused","active","loadingSources","dom","placeholder","extractText","oninput","onfocus","hasFocus","onblur","in","LoadingIndicator","size","items","ItemList","discussion","canEditUserRecipients","add","canEditGroupRecipients","values","split","findRecipient","clear","preventDefault","remove","store","Search","AddRecipientModal","Stream","assignInitialRecipients","selectedRecipients","merge","recipientSearch","SearchState","isDismissible","recipientUsers","recipientGroups","title","helpText","content","component","state","Button","icon","hide","select","metaKey","ctrlKey","submit","onsubmit","forEach","save","relationships","DiscussionPage","Modal","ByobuTagDiscussionModal","tags","resolve","TagDiscussionModal","long","concat","PrivateDiscussionComposer","_isByobuComposer","initAttrs","titlePlaceholder","submitLabel","composer","fields","route","param","addDefaultRecipients","users","groups","chooseRecipients","headerItems","count","recipientCountLabel","set","loaded","DiscussionComposer","canStartPrivateDiscussion","blocksPd","cannotBeDirectMessaged","_defineProperties","props","descriptor","configurable","writable","PrivateComposing","Constructor","protoProps","action","Promise","reject","LogInModal","itemClassName","disabled","canStartDiscussion","PrivateDiscussionNotification","notification","subject","fromUser","excerpt","Notification","PrivateDiscussionReplyNotification","postNumber","PrivateDiscussionUserLeftNotification","PrivateDiscussionAddedNotification","PrivateDiscussionMadePublicNotification","modals","PrivateDiscussionList","DiscussionList","discussions","MadePublic","descriptionKey","EventPost","RecipientLeft","RecipientsModified","diff","diff1","diff2","item","post","usersAdded","usersRemoved","groupsAdded","groupsRemoved","added","removed","oldRecipients","newRecipients","localeBase","descriptionData","PrivateDiscussionListState","DiscussionListState","PrivateDiscussionsUserPage","changeSort","show","list","slug","sort","refresh","handleChangeSort","loadUser","listItems","actionItems","viewItems","composing","sortMap","sortOptions","Dropdown","buttonClassName","UserPage","Extend","IndexPage","Discussion","hasMany","attribute","extend","badges","Badge","DiscussionListItem","DiscussionHero","params","include","DiscussionControls","canEditRecipients","isEmpty","errorHandler","err","status","console","error","find","isPrivateDiscussion","canMakePublic","confirm","extensions","public","update","SettingsPage","Switch","onchange","blocksPdLoading","UserControls","displayName","LinkButton","compose","setContent","PrivateDiscussionRepliedNotification","NotificationGrid"],"sourceRoot":""} \ No newline at end of file