From 7d955e043129737ff7c4537356c34f7bf50a6704 Mon Sep 17 00:00:00 2001 From: flarum-bot Date: Mon, 7 Mar 2022 20:25:15 +0000 Subject: [PATCH] Bundled output for commit 294ef714da0b8ead531217606bdab1745bbee6d1 Includes transpiled JS/TS. [skip ci] --- js/dist/admin.js | 2 +- js/dist/admin.js.map | 2 +- js/dist/forum.js | 2 +- js/dist/forum.js.map | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/js/dist/admin.js b/js/dist/admin.js index 579c0a8..b672ebb 100644 --- a/js/dist/admin.js +++ b/js/dist/admin.js @@ -1,2 +1,2 @@ -module.exports=function(t){var e={};function o(i){if(e[i])return e[i].exports;var n=e[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,o),n.l=!0,n.exports}return o.m=t,o.c=e,o.d=function(t,e,i){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(o.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)o.d(i,n,function(e){return t[e]}.bind(null,n));return i},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=48)}({1:function(t,e,o){"use strict";function i(t,e){return(i=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function n(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,i(t,e)}o.d(e,"a",(function(){return n}))},16:function(t,e){t.exports=flarum.core.compat["common/components/Badge"]},2:function(t,e){t.exports=flarum.core.compat["common/models/User"]},3:function(t,e){t.exports=flarum.core.compat["admin/app"]},45:function(t,e){t.exports=flarum.core.compat["admin/components/ExtensionPage"]},46:function(t,e){t.exports=flarum.core.compat["common/helpers/icon"]},48:function(t,e,o){"use strict";o.r(e);var i=o(3),n=o.n(i),r=o(2),s=o.n(r),a=o(1),u=o(45),c=o.n(u),f=o(16),p=o.n(f),l=o(46),b=o.n(l),d=function(t){function e(){return t.apply(this,arguments)||this}Object(a.a)(e,t);var o=e.prototype;return o.oninit=function(e){t.prototype.oninit.call(this,e),this.badgeDefault="fas fa-map",this.postActionDefault="far fa-map"},o.content=function(){var t=flarum.extensions["flarum-tags"]?n.a.translator.trans("flarum-tags.admin.edit_tag.icon_text",{a:m("a",{href:"https://fontawesome.com/icons?m=free",tabindex:"-1"})}):"";return[m("div",{className:"ByobuSettingsPage"},m("div",{className:"container"},m("div",{className:"Form"},m("div",{className:"Form-group"},this.buildSettingComponent({type:"string",setting:"fof-byobu.icon-badge",label:n.a.translator.trans("fof-byobu.admin.settings.badge-icon"),help:m("div",null,m(p.a,{icon:this.setting("fof-byobu.icon-badge").toJSON()||this.badgeDefault})," ",t),placeholder:this.badgeDefault}),this.buildSettingComponent({type:"string",setting:"fof-byobu.icon-postAction",label:n.a.translator.trans("fof-byobu.admin.settings.post-event-icon"),help:m("div",null,b()(this.setting("fof-byobu.icon-postAction").toJSON()||this.postActionDefault)," ",t),placeholder:this.postActionDefault}),this.buildSettingComponent({type:"boolean",setting:"fof-byobu.makePublic",label:n.a.translator.trans("fof-byobu.admin.settings.enable-make-public-option"),help:n.a.translator.trans("fof-byobu.admin.settings.enable-make-public-option-help")})),m("div",{className:"Form-group"},this.submitButton()))))]},e}(c.a);n.a.initializers.add("fof-byobu",(function(){var t;n.a.store.models.recipients=s.a,n.a.extensionData.for("fof-byobu").registerPage(d),(t=n.a.extensionData.for("fof-byobu")).registerPermission({icon:"far fa-map",label:n.a.translator.trans("fof-byobu.admin.permission.create_private_discussions_with_users"),permission:"discussion.startPrivateDiscussionWithUsers",tagScoped:!1},"start",95).registerPermission({icon:"far fa-map",label:n.a.translator.trans("fof-byobu.admin.permission.create_private_discussions_with_groups"),permission:"discussion.startPrivateDiscussionWithGroups",tagScoped:!1},"start",95).registerPermission({icon:"far fa-map",label:n.a.translator.trans("fof-byobu.admin.permission.create_private_discussions_with_blocking_users"),permission:"startPrivateDiscussionWithBlockers",tagScoped:!1},"start",95).registerPermission({icon:"far fa-map",label:n.a.translator.trans("fof-byobu.admin.permission.edit_user_recipients"),permission:"discussion.editUserRecipients",tagScoped:!1},"moderate",95).registerPermission({icon:"far fa-map",label:n.a.translator.trans("fof-byobu.admin.permission.edit_group_recipients"),permission:"discussion.editGroupRecipients",tagScoped:!1},"moderate",95).registerPermission({icon:"fas fa-flag",label:n.a.translator.trans("fof-byobu.admin.permission.view_private_discussions-when-flagged"),permission:"user.viewPrivateDiscussionsWhenFlagged",tagScoped:!1},"moderate",95),n.a.data.settings["fof-byobu.makePublic"]&&t.registerPermission({icon:"far fa-map",label:n.a.translator.trans("fof-byobu.admin.permission.make_private_into_public"),permission:"discussion.makePublic",tagScoped:!1},"reply",95)}))}}); +(()=>{var t={n:e=>{var o=e&&e.__esModule?()=>e.default:()=>e;return t.d(o,{a:o}),o},d:(e,o)=>{for(var i in o)t.o(o,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:o[i]})},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);const o=flarum.core.compat["admin/app"];var i=t.n(o);const s=flarum.core.compat["common/models/User"];var a=t.n(s);function n(t,e){return n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},n(t,e)}const r=flarum.core.compat["admin/components/ExtensionPage"];var c=t.n(r);const p=flarum.core.compat["common/components/Badge"];var l=t.n(p);const u=flarum.core.compat["common/helpers/icon"];var f=t.n(u),b=function(t){var e,o;function s(){return t.apply(this,arguments)||this}o=t,(e=s).prototype=Object.create(o.prototype),e.prototype.constructor=e,n(e,o);var a=s.prototype;return a.oninit=function(e){t.prototype.oninit.call(this,e),this.badgeDefault="fas fa-map",this.postActionDefault="far fa-map"},a.content=function(){var t=flarum.extensions["flarum-tags"]?i().translator.trans("flarum-tags.admin.edit_tag.icon_text",{a:m("a",{href:"https://fontawesome.com/icons?m=free",tabindex:"-1"})}):"";return[m("div",{className:"ByobuSettingsPage"},m("div",{className:"container"},m("div",{className:"Form"},m("div",{className:"Form-group"},this.buildSettingComponent({type:"string",setting:"fof-byobu.icon-badge",label:i().translator.trans("fof-byobu.admin.settings.badge-icon"),help:m("div",null,m(l(),{icon:this.setting("fof-byobu.icon-badge").toJSON()||this.badgeDefault})," ",t),placeholder:this.badgeDefault}),this.buildSettingComponent({type:"string",setting:"fof-byobu.icon-postAction",label:i().translator.trans("fof-byobu.admin.settings.post-event-icon"),help:m("div",null,f()(this.setting("fof-byobu.icon-postAction").toJSON()||this.postActionDefault)," ",t),placeholder:this.postActionDefault}),this.buildSettingComponent({type:"boolean",setting:"fof-byobu.makePublic",label:i().translator.trans("fof-byobu.admin.settings.enable-make-public-option"),help:i().translator.trans("fof-byobu.admin.settings.enable-make-public-option-help")})),m("div",{className:"Form-group"},this.submitButton()))))]},s}(c());i().initializers.add("fof-byobu",(function(){var t;i().store.models.recipients=a(),i().extensionData.for("fof-byobu").registerPage(b),(t=i().extensionData.for("fof-byobu")).registerPermission({icon:"far fa-map",label:i().translator.trans("fof-byobu.admin.permission.create_private_discussions_with_users"),permission:"discussion.startPrivateDiscussionWithUsers",tagScoped:!1},"start",95).registerPermission({icon:"far fa-map",label:i().translator.trans("fof-byobu.admin.permission.create_private_discussions_with_groups"),permission:"discussion.startPrivateDiscussionWithGroups",tagScoped:!1},"start",95).registerPermission({icon:"far fa-map",label:i().translator.trans("fof-byobu.admin.permission.create_private_discussions_with_blocking_users"),permission:"startPrivateDiscussionWithBlockers",tagScoped:!1},"start",95).registerPermission({icon:"far fa-map",label:i().translator.trans("fof-byobu.admin.permission.edit_user_recipients"),permission:"discussion.editUserRecipients",tagScoped:!1},"moderate",95).registerPermission({icon:"far fa-map",label:i().translator.trans("fof-byobu.admin.permission.edit_group_recipients"),permission:"discussion.editGroupRecipients",tagScoped:!1},"moderate",95).registerPermission({icon:"fas fa-flag",label:i().translator.trans("fof-byobu.admin.permission.view_private_discussions-when-flagged"),permission:"user.viewPrivateDiscussionsWhenFlagged",tagScoped:!1},"moderate",95),i().data.settings["fof-byobu.makePublic"]&&t.registerPermission({icon:"far fa-map",label:i().translator.trans("fof-byobu.admin.permission.make_private_into_public"),permission:"discussion.makePublic",tagScoped:!1},"reply",95)}))})(),module.exports=e})(); //# sourceMappingURL=admin.js.map \ No newline at end of file diff --git a/js/dist/admin.js.map b/js/dist/admin.js.map index 6b646d4..d30f5d7 100644 --- a/js/dist/admin.js.map +++ b/js/dist/admin.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://@fof/byobu/webpack/bootstrap","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 \"flarum.core.compat['common/components/Badge']\"","webpack://@fof/byobu/external \"flarum.core.compat['common/models/User']\"","webpack://@fof/byobu/external \"flarum.core.compat['admin/app']\"","webpack://@fof/byobu/external \"flarum.core.compat['admin/components/ExtensionPage']\"","webpack://@fof/byobu/external \"flarum.core.compat['common/helpers/icon']\"","webpack://@fof/byobu/./src/admin/components/ByobuSettingsPage.tsx","webpack://@fof/byobu/./src/admin/index.ts","webpack://@fof/byobu/./src/admin/addPrivateDiscussionPermission.ts"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","_setPrototypeOf","setPrototypeOf","__proto__","_inheritsLoose","subClass","superClass","constructor","flarum","core","compat","ByobuSetingsPage","oninit","vnode","this","badgeDefault","postActionDefault","content","helpText","extensions","app","translator","trans","a","href","tabindex","className","buildSettingComponent","type","setting","label","help","icon","toJSON","placeholder","submitButton","ExtensionPage","initializers","add","byobuData","store","models","recipients","User","extensionData","registerPage","ByobuSettings","registerPermission","permission","tagScoped","data","settings"],"mappings":"2BACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QA0Df,OArDAF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA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Ef,KAAM,aACNF,MAAOV,IAAIC,WAAWC,MAAM,oDAC5B0B,WAAY,iCACZC,WAAW,GAEb,WACA,IAEDF,mBACC,CACEf,KAAM,cACNF,MAAOV,IAAIC,WAAWC,MAAM,oEAC5B0B,WAAY,yCACZC,WAAW,GAEb,WACA,IAGA7B,IAAI8B,KAAKC,SAAS,yBACpBZ,EAAUQ,mBACR,CACEf,KAAM,aACNF,MAAOV,IAAIC,WAAWC,MAAM,uDAC5B0B,WAAY,wBACZC,WAAW,GAEb,QACA","file":"admin.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 48);\n","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}","module.exports = flarum.core.compat['common/components/Badge'];","module.exports = flarum.core.compat['common/models/User'];","module.exports = flarum.core.compat['admin/app'];","module.exports = flarum.core.compat['admin/components/ExtensionPage'];","module.exports = flarum.core.compat['common/helpers/icon'];","import app from 'flarum/admin/app';\nimport ExtensionPage from 'flarum/admin/components/ExtensionPage';\nimport Badge from 'flarum/common/components/Badge';\nimport icon from 'flarum/common/helpers/icon';\n\nimport type Mithril from 'mithril';\n\nexport default class ByobuSetingsPage extends ExtensionPage {\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.badgeDefault = 'fas fa-map';\n this.postActionDefault = 'far fa-map';\n }\n\n content() {\n const helpText = flarum.extensions['flarum-tags']\n ? app.translator.trans('flarum-tags.admin.edit_tag.icon_text', {\n a: ,\n })\n : '';\n\n return [\n
\n
\n
\n
\n {this.buildSettingComponent({\n type: 'string',\n setting: 'fof-byobu.icon-badge',\n label: app.translator.trans('fof-byobu.admin.settings.badge-icon'),\n help: (\n
\n {helpText}\n
\n ),\n placeholder: this.badgeDefault,\n })}\n {this.buildSettingComponent({\n type: 'string',\n setting: 'fof-byobu.icon-postAction',\n label: app.translator.trans('fof-byobu.admin.settings.post-event-icon'),\n help: (\n
\n {icon(this.setting('fof-byobu.icon-postAction').toJSON() || this.postActionDefault)} {helpText}\n
\n ),\n placeholder: this.postActionDefault,\n })}\n {this.buildSettingComponent({\n type: 'boolean',\n setting: 'fof-byobu.makePublic',\n label: app.translator.trans('fof-byobu.admin.settings.enable-make-public-option'),\n help: app.translator.trans('fof-byobu.admin.settings.enable-make-public-option-help'),\n })}\n
\n
{this.submitButton()}
\n
\n
\n
,\n ];\n }\n}\n","import app from 'flarum/admin/app';\nimport User from 'flarum/common/models/User';\n\nimport addPrivateDiscussionPermission from './addPrivateDiscussionPermission';\nimport ByobuSettings from './components/ByobuSettingsPage';\n\napp.initializers.add('fof-byobu', () => {\n app.store.models.recipients = User;\n\n app.extensionData.for('fof-byobu').registerPage(ByobuSettings);\n\n addPrivateDiscussionPermission();\n});\n","import app from 'flarum/admin/app';\n\nexport default function () {\n const byobuData = app.extensionData.for('fof-byobu');\n\n byobuData\n .registerPermission(\n {\n icon: 'far fa-map',\n label: app.translator.trans('fof-byobu.admin.permission.create_private_discussions_with_users'),\n permission: 'discussion.startPrivateDiscussionWithUsers',\n tagScoped: false,\n },\n 'start',\n 95\n )\n .registerPermission(\n {\n icon: 'far fa-map',\n label: app.translator.trans('fof-byobu.admin.permission.create_private_discussions_with_groups'),\n permission: 'discussion.startPrivateDiscussionWithGroups',\n tagScoped: false,\n },\n 'start',\n 95\n )\n .registerPermission(\n {\n icon: 'far fa-map',\n label: app.translator.trans('fof-byobu.admin.permission.create_private_discussions_with_blocking_users'),\n permission: 'startPrivateDiscussionWithBlockers',\n tagScoped: false,\n },\n 'start',\n 95\n )\n .registerPermission(\n {\n icon: 'far fa-map',\n label: app.translator.trans('fof-byobu.admin.permission.edit_user_recipients'),\n permission: 'discussion.editUserRecipients',\n tagScoped: false,\n },\n 'moderate',\n 95\n )\n .registerPermission(\n {\n icon: 'far fa-map',\n label: app.translator.trans('fof-byobu.admin.permission.edit_group_recipients'),\n permission: 'discussion.editGroupRecipients',\n tagScoped: false,\n },\n 'moderate',\n 95\n )\n .registerPermission(\n {\n icon: 'fas fa-flag',\n label: app.translator.trans('fof-byobu.admin.permission.view_private_discussions-when-flagged'),\n permission: 'user.viewPrivateDiscussionsWhenFlagged',\n tagScoped: false,\n },\n 'moderate',\n 95\n );\n\n if (app.data.settings['fof-byobu.makePublic']) {\n byobuData.registerPermission(\n {\n icon: 'far fa-map',\n label: app.translator.trans('fof-byobu.admin.permission.make_private_into_public'),\n permission: 'discussion.makePublic',\n tagScoped: false,\n },\n 'reply',\n 95\n );\n }\n}\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"admin.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,GCLRF,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,MCJ3ER,EAAwB,CAAC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A,yBACFc,EAAUI,mBACR,CACET,KAAM,aACNF,MAAOP,IAAAA,WAAAA,MAAqB,uDAC5BmB,WAAY,wBACZC,WAAW,GAEb,QACA,Q","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['admin/app']\"","webpack://@fof/byobu/external root \"flarum.core.compat['common/models/User']\"","webpack://@fof/byobu/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://@fof/byobu/external root \"flarum.core.compat['admin/components/ExtensionPage']\"","webpack://@fof/byobu/external root \"flarum.core.compat['common/components/Badge']\"","webpack://@fof/byobu/external root \"flarum.core.compat['common/helpers/icon']\"","webpack://@fof/byobu/./src/admin/components/ByobuSettingsPage.tsx","webpack://@fof/byobu/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@fof/byobu/./src/admin/index.ts","webpack://@fof/byobu/./src/admin/addPrivateDiscussionPermission.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/app'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/models/User'];","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}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/components/ExtensionPage'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/components/Badge'];","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['common/helpers/icon'];","import app from 'flarum/admin/app';\nimport ExtensionPage from 'flarum/admin/components/ExtensionPage';\nimport Badge from 'flarum/common/components/Badge';\nimport icon from 'flarum/common/helpers/icon';\n\nimport type Mithril from 'mithril';\n\nexport default class ByobuSetingsPage extends ExtensionPage {\n oninit(vnode: Mithril.Vnode) {\n super.oninit(vnode);\n\n this.badgeDefault = 'fas fa-map';\n this.postActionDefault = 'far fa-map';\n }\n\n content() {\n const helpText = flarum.extensions['flarum-tags']\n ? app.translator.trans('flarum-tags.admin.edit_tag.icon_text', {\n a:
,\n })\n : '';\n\n return [\n
\n
\n
\n
\n {this.buildSettingComponent({\n type: 'string',\n setting: 'fof-byobu.icon-badge',\n label: app.translator.trans('fof-byobu.admin.settings.badge-icon'),\n help: (\n
\n {helpText}\n
\n ),\n placeholder: this.badgeDefault,\n })}\n {this.buildSettingComponent({\n type: 'string',\n setting: 'fof-byobu.icon-postAction',\n label: app.translator.trans('fof-byobu.admin.settings.post-event-icon'),\n help: (\n
\n {icon(this.setting('fof-byobu.icon-postAction').toJSON() || this.postActionDefault)} {helpText}\n
\n ),\n placeholder: this.postActionDefault,\n })}\n {this.buildSettingComponent({\n type: 'boolean',\n setting: 'fof-byobu.makePublic',\n label: app.translator.trans('fof-byobu.admin.settings.enable-make-public-option'),\n help: app.translator.trans('fof-byobu.admin.settings.enable-make-public-option-help'),\n })}\n
\n
{this.submitButton()}
\n
\n
\n
,\n ];\n }\n}\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}","import app from 'flarum/admin/app';\nimport User from 'flarum/common/models/User';\n\nimport addPrivateDiscussionPermission from './addPrivateDiscussionPermission';\nimport ByobuSettings from './components/ByobuSettingsPage';\n\napp.initializers.add('fof-byobu', () => {\n app.store.models.recipients = User;\n\n app.extensionData.for('fof-byobu').registerPage(ByobuSettings);\n\n addPrivateDiscussionPermission();\n});\n","import app from 'flarum/admin/app';\n\nexport default function () {\n const byobuData = app.extensionData.for('fof-byobu');\n\n byobuData\n .registerPermission(\n {\n icon: 'far fa-map',\n label: app.translator.trans('fof-byobu.admin.permission.create_private_discussions_with_users'),\n permission: 'discussion.startPrivateDiscussionWithUsers',\n tagScoped: false,\n },\n 'start',\n 95\n )\n .registerPermission(\n {\n icon: 'far fa-map',\n label: app.translator.trans('fof-byobu.admin.permission.create_private_discussions_with_groups'),\n permission: 'discussion.startPrivateDiscussionWithGroups',\n tagScoped: false,\n },\n 'start',\n 95\n )\n .registerPermission(\n {\n icon: 'far fa-map',\n label: app.translator.trans('fof-byobu.admin.permission.create_private_discussions_with_blocking_users'),\n permission: 'startPrivateDiscussionWithBlockers',\n tagScoped: false,\n },\n 'start',\n 95\n )\n .registerPermission(\n {\n icon: 'far fa-map',\n label: app.translator.trans('fof-byobu.admin.permission.edit_user_recipients'),\n permission: 'discussion.editUserRecipients',\n tagScoped: false,\n },\n 'moderate',\n 95\n )\n .registerPermission(\n {\n icon: 'far fa-map',\n label: app.translator.trans('fof-byobu.admin.permission.edit_group_recipients'),\n permission: 'discussion.editGroupRecipients',\n tagScoped: false,\n },\n 'moderate',\n 95\n )\n .registerPermission(\n {\n icon: 'fas fa-flag',\n label: app.translator.trans('fof-byobu.admin.permission.view_private_discussions-when-flagged'),\n permission: 'user.viewPrivateDiscussionsWhenFlagged',\n tagScoped: false,\n },\n 'moderate',\n 95\n );\n\n if (app.data.settings['fof-byobu.makePublic']) {\n byobuData.registerPermission(\n {\n icon: 'far fa-map',\n label: app.translator.trans('fof-byobu.admin.permission.make_private_into_public'),\n permission: 'discussion.makePublic',\n tagScoped: false,\n },\n 'reply',\n 95\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__","ByobuSetingsPage","subClass","superClass","create","constructor","oninit","vnode","this","badgeDefault","postActionDefault","content","helpText","extensions","app","href","tabindex","className","buildSettingComponent","type","setting","label","help","icon","toJSON","placeholder","submitButton","ExtensionPage","byobuData","User","registerPage","ByobuSettings","registerPermission","permission","tagScoped"],"sourceRoot":""} \ No newline at end of file diff --git a/js/dist/forum.js b/js/dist/forum.js index 5a4507c..07a61c9 100644 --- a/js/dist/forum.js +++ b/js/dist/forum.js @@ -1,2 +1,2 @@ -module.exports=function(t){var e={};function n(o){if(e[o])return e[o].exports;var s=e[o]={i:o,l:!1,exports:{}};return t[o].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)n.d(o,s,function(e){return t[e]}.bind(null,s));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=47)}([function(t,e){t.exports=flarum.core.compat["forum/app"]},function(t,e,n){"use strict";function o(t,e){return(o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function s(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,o(t,e)}n.d(e,"a",(function(){return s}))},function(t,e){t.exports=flarum.core.compat["common/models/User"]},,function(t,e){t.exports=flarum.core.compat["common/extend"]},function(t,e){t.exports=flarum.core.compat["common/utils/ItemList"]},function(t,e){t.exports=flarum.core.compat["common/Model"]},function(t,e){t.exports=flarum.core.compat["common/components/Button"]},function(t,e){t.exports=flarum.core.compat["common/models/Discussion"]},function(t,e){t.exports=flarum.core.compat["common/models/Group"]},function(t,e){t.exports=flarum.core.compat["forum/components/Notification"]},function(t,e){t.exports=flarum.core.compat["common/utils/classList"]},function(t,e){t.exports=flarum.core.compat["forum/components/EventPost"]},function(t,e){t.exports=flarum.core.compat["common/components/LinkButton"]},function(t,e){t.exports=flarum.core.compat["forum/states/DiscussionListState"]},function(t,e){t.exports=flarum.core.compat["forum/components/IndexPage"]},function(t,e){t.exports=flarum.core.compat["common/components/Badge"]},function(t,e){t.exports=flarum.core.compat["common/helpers/username"]},function(t,e){t.exports=flarum.core.compat["common/helpers/highlight"]},function(t,e){t.exports=flarum.core.compat["forum/components/UserPage"]},function(t,e){t.exports=flarum.core.compat["common/helpers/listItems"]},function(t,e){t.exports=flarum.core.compat["common/Component"]},function(t,e){t.exports=flarum.core.compat["forum/components/SettingsPage"]},function(t,e){t.exports=flarum.core.compat["common/components/Switch"]},function(t,e){t.exports=flarum.core.compat["forum/components/DiscussionListItem"]},function(t,e){t.exports=flarum.core.compat["forum/components/DiscussionHero"]},function(t,e){t.exports=flarum.core.compat["forum/utils/DiscussionControls"]},function(t,e){t.exports=flarum.core.compat["common/components/Modal"]},function(t,e){t.exports=flarum.core.compat["forum/components/DiscussionPage"]},function(t,e){t.exports=flarum.core.compat["common/utils/Stream"]},function(t,e){t.exports=flarum.core.compat["forum/states/SearchState"]},function(t,e){t.exports=flarum.core.compat["forum/components/Search"]},function(t,e){t.exports=flarum.core.compat["common/helpers/avatar"]},function(t,e){t.exports=flarum.core.compat["common/utils/extractText"]},function(t,e){t.exports=flarum.core.compat["common/components/LoadingIndicator"]},function(t,e){t.exports=flarum.core.compat["common/components/Tooltip"]},function(t,e){t.exports=flarum.core.compat["tags/components/TagDiscussionModal"]},function(t,e){t.exports=flarum.core.compat["components/DiscussionPage"]},function(t,e){t.exports=flarum.core.compat["forum/utils/UserControls"]},function(t,e){t.exports=flarum.core.compat["forum/components/DiscussionComposer"]},function(t,e){t.exports=flarum.core.compat["common/components/Dropdown"]},function(t,e){t.exports=flarum.core.compat["forum/components/DiscussionList"]},function(t,e){t.exports=flarum.core.compat["forum/components/LogInModal"]},function(t,e){t.exports=flarum.core.compat["forum/components/NotificationGrid"]},function(t,e){t.exports=flarum.core.compat["components/Notification"]},,,function(t,e,n){"use strict";n.r(e),n.d(e,"modals",(function(){return ue})),n.d(e,"discussions",(function(){return pe}));var o=n(0),s=n.n(o),r=n(1),i=n(12),a=n.n(i),c=function(t){function e(){return t.apply(this,arguments)||this}Object(r.a)(e,t),e.initAttrs=function(e){t.initAttrs.call(this,e)};var n=e.prototype;return n.icon=function(){return s.a.forum.attribute("byobu.icon-postAction")},n.descriptionKey=function(){return"fof-byobu.forum.post.recipients_modified.made_public"},e}(a.a),u=function(t){function e(){return t.apply(this,arguments)||this}Object(r.a)(e,t),e.initAttrs=function(e){t.initAttrs.call(this,e)};var n=e.prototype;return n.icon=function(){return s.a.forum.attribute("byobu.icon-postAction")},n.descriptionKey=function(){return"fof-byobu.forum.post.recipients_modified.removed_self"},e}(a.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}var f=n(2),l=n.n(f),d=n(11),b=n.n(d),h=n(17),y=n.n(h),v=n(9),g=n.n(v),x=n(13),_=n.n(x),P=n(21),R=["recipient","link"],w=function(t){function e(){return t.apply(this,arguments)||this}return Object(r.a)(e,t),e.prototype.view=function(t){var e,n=this.attrs,o=n.recipient,r=n.link,i=p(n,R);if(i.style=i.style||{},i.className=b()("RecipientLabel",null==i?void 0:i.className),r&&o instanceof l.a&&(i.href=s.a.route.user(o)),o instanceof l.a){var a,c;e=y()(o),i.href||o.id()===(null==s.a||null==(a=s.a.session)||null==(c=a.user)?void 0:c.id())||(i.href=s.a.route.user(o))}else{if(o instanceof g.a)return m("span",{class:i.className},o.namePlural());i.className+=" none",e=s.a.translator.trans("core.lib.username.deleted_text")}return m(_.a,i,e)},e}(n.n(P).a),D=["link","className"];function j(t,e){void 0===e&&(e={});var n=e,o=n.link,s=n.className,r=p(n,D);return r.className=b()("RecipientsLabel",s),m("span",r,null==t?void 0:t.map((function(t,e){var n=t instanceof l.a?"u":"g";return m(w,{key:n+"-"+e,recipient:t,link:o})})),!t&&m(w,null))}var k=function(t){function e(){return t.apply(this,arguments)||this}Object(r.a)(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 s.a.store.getById(n,t)}))}t.initAttrs.call(this,e);var o=e.post.content();if(o.new||2!=o.length){var r=n(o.new.users,o.old.users,"users"),i=n(o.old.users,o.new.users,"users"),a=n(o.new.groups,o.old.groups,"groups"),c=n(o.old.groups,o.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 s.a.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=j(this.attrs.added,{link:!0})),this.attrs.removed.length&&(t.removed=j(this.attrs.removed,{link:!0})),t},e}(a.a),O=n(4),N=n(22),U=n.n(N),S=n(23),A=n.n(S),C=function(){Object(O.extend)(U.a.prototype,"privacyItems",(function(t){var e=this;t.add("byobu-block-dm",A.a.component({state:this.user.blocksPd(),onchange:function(t){e.blocksPdLoading=!0,e.user.save({blocksPd:t}).then((function(){e.blocksPdLoading=!1,m.redraw()}))},loading:this.blocksPdLoading},s.a.translator.trans("fof-byobu.forum.user.settings.block_pd")))}))};var M=n(6),I=n.n(M),G=n(16),L=n.n(G),B=n(8),T=n.n(B),E=n(7),q=n.n(E),V=n(24),K=n.n(V),F=n(25),W=n.n(F),z=n(14),H=n.n(z),J=n(26),Q=n.n(J),X=n(5),Y=n.n(X),Z=n(27),tt=n.n(Z),et=n(28),nt=n.n(et),ot=n(29),st=n.n(ot),rt=n(30),it=n.n(rt),at=n(31),ct=n.n(at);function ut(){return(ut=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,s.a.translator.trans("fof-byobu.forum.modal.labels.selected_users")),m("p",null,s.a.translator.trans("fof-byobu.forum.modal.help.selected_users")),this.attrs.selected().toArray().map((function(e){return m(_t.a,{text:s.a.translator.trans("fof-byobu.forum.modal.help.click_user_to_remove_tooltip")},m(w,{"data-container":"body",recipient:e,onclick:function(n){return t.removeRecipient(e,n)}}))}))),m("div",{className:"Form-group"},m("label",{for:"byobu-addrecipient-search-input-"+this.inputUuid},s.a.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:b()("RecipientsInput","FormControl",{open:!!this.state.getValue(),focused:!!this.state.getValue(),active:!!this.state.getValue(),loading:!!this.loadingSources}),oncreate:function(t){return t.dom.focus()},type:"search",placeholder:yt()(s.a.translator.trans("fof-byobu.forum.input.search_recipients")),value:this.state.getValue(),oninput:function(e){return t.state.setValue(e.target.value)},onfocus:function(){return t.hasFocus=!0},onblur:function(){return t.hasFocus=!1}}),m("ul",{className:b()("Dropdown-menu","Search-results","fade",{in:!!e})},this.doSearch?this.sources.map((function(e){return e.view(t.state.getValue())})):gt.a.component({size:"tiny",className:"Button Button--icon Button--link"})))))},n.sourceItems=function(){var t=new Y.a;return(!this.attrs.discussion&&s.a.forum.attribute("canStartPrivateDiscussionWithUsers")||this.attrs.discussion&&this.attrs.discussion.canEditUserRecipients())&&t.add("users",new dt),(!this.attrs.discussion&&s.a.forum.attribute("canStartPrivateDiscussionWithGroups")||this.attrs.discussion&&this.attrs.discussion.canEditGroupRecipients())&&t.add("groups",new bt),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.state.clear()},n.removeRecipient=function(t,e){var n;e.preventDefault(),t instanceof l.a&&(n="users"),t instanceof g.a&&(n="groups"),this.attrs.selected().remove(n+":"+t.id())},n.findRecipient=function(t,e){return s.a.store.getById(t,e)},e}(ct.a),Rt=function(t){function e(){return t.apply(this,arguments)||this}Object(r.a)(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.selected=st()(new Y.a),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:"+s.a.session.user.id(),s.a.session.user),this.recipientSearch=new it.a},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?s.a.translator.trans("fof-byobu.forum.modal.titles.update_recipients",{title:m("em",null,this.attrs.discussion.title())}):s.a.translator.trans("fof-byobu.forum.modal.titles.add_recipients")},n.helpText=function(){return this.attrs.discussion?s.a.translator.trans("fof-byobu.forum.modal.help.update_recipients"):s.a.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"},q.a.component({type:"submit",className:"Button Button--primary",icon:"fas fa-check"},s.a.translator.trans("fof-byobu.forum.buttons.submit")),q.a.component({onclick:this.hide.bind(this),className:"Button Button--cancel"},s.a.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(),o=[],r=[];n.toArray().forEach((function(t){t instanceof l.a&&r.push(t),t instanceof g.a&&o.push(t)})),e&&e.save({relationships:{recipientUsers:r,recipientGroups:o}}).then((function(){s.a.current instanceof nt.a&&s.a.current.stream.update(),m.redraw()})),this.attrs.onsubmit&&this.attrs.onsubmit(n),s.a.modal.close(),this.attrs.discussion||s.a.composer.show(),t.redraw=!1},e}(tt.a),wt=n(36),Dt=function(t){function e(){return t.apply(this,arguments)||this}return Object(r.a)(e,t),e.prototype.onsubmit=function(t){t.preventDefault();var e=this.selected;this.attrs.resolve&&this.attrs.resolve(e),this.hide()},e}(n.n(wt).a);Dt.isDismissible=!1;var jt=n(37),kt=n.n(jt),Ot=function(){T.a.prototype.recipientUsers=I.a.hasMany("recipientUsers"),T.a.prototype.oldRecipientUsers=I.a.hasMany("oldRecipientUsers"),T.a.prototype.recipientGroups=I.a.hasMany("recipientGroups"),T.a.prototype.oldRecipientGroups=I.a.hasMany("oldRecipientGroups"),T.a.prototype.canEditRecipients=I.a.attribute("canEditRecipients"),T.a.prototype.canEditUserRecipients=I.a.attribute("canEditUserRecipients"),T.a.prototype.canEditGroupRecipients=I.a.attribute("canEditGroupRecipients"),T.a.prototype.canEditGroupRecipients=I.a.attribute("canEditGroupRecipients"),T.a.prototype.canMakePublic=I.a.attribute("canMakePublic"),T.a.prototype.isPrivateDiscussion=I.a.attribute("isPrivateDiscussion"),Object(O.extend)(T.a.prototype,"badges",(function(t){(this.recipientUsers().length||this.recipientGroups().length)&&t.add("private",L.a.component({type:"private",label:s.a.translator.trans("fof-byobu.forum.badges.is_private.tooltip"),icon:s.a.forum.data.attributes["byobu.icon-badge"]}),10)})),Object(O.extend)(K.a.prototype,"infoItems",(function(t){var e=this.attrs.discussion;Nt(e,t,!0)})),Object(O.extend)(W.a.prototype,"items",(function(t){var e=this.attrs.discussion;Nt(e,t,!1)})),Object(O.extend)(H.a.prototype,"requestParams",(function(t){t.include.push("recipientUsers"),t.include.push("recipientGroups")})),Object(O.extend)(Q.a,"moderationControls",(function(t,e){e.canEditRecipients()&&t.add("recipients",q.a.component({icon:s.a.forum.data.attributes["byobu.icon-badge"],onclick:function(){return s.a.modal.show(Rt,{discussion:e})}},s.a.translator.trans("fof-byobu.forum.buttons.edit_recipients"))),e&&e.recipientUsers().find((function(t){return t.id()===s.a.session.user.id()}))&&(t.add("remove",q.a.component({icon:"fas fa-user-slash",onclick:function(){if(e){var t=new Y.a;e.recipientUsers().map((function(e){s.a.session.user.id()!==e.id()&&t.add("users:"+e.id(),e)}));var n=[],o=[];t.toArray().forEach((function(t){t instanceof l.a&&o.push(t),t instanceof g.a&&n.push(t)})),e.save({relationships:{recipientUsers:o,recipientGroups:n}}).then((function(){return s.a.history.back()}))}}},s.a.translator.trans("fof-byobu.forum.buttons.remove_from_discussion"))),null!=e&&null!=e.isPrivateDiscussion&&e.isPrivateDiscussion()&&null!=e&&null!=e.canMakePublic&&e.canMakePublic()&&t.add("transform-public",m(q.a,{icon:"far fa-eye",onclick:function(){if(e&&confirm(s.a.translator.trans("fof-byobu.forum.confirm.make_public"))){var t=[],n=[];flarum.extensions["flarum-tags"]?new Promise((function(t,n){s.a.modal.show(Dt,{discussion:e,resolve:t,reject:n})})).then((function(o){e.save({relationships:{recipientUsers:n,recipientGroups:t},public:e.id()}).then((function(){e.save({relationships:{tags:o}}).then((function(){s.a.current.matches(kt.a)&&s.a.current.get("stream").update(),m.redraw()}))}))})):e.save({relationships:{recipientUsers:n,recipientGroups:t},public:e.id()}).then((function(){return m.redraw()}))}}},s.a.translator.trans("fof-byobu.forum.buttons.make_public"))))}))},Nt=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",j(o),10):e.add("recipients",j(o,{link:!0}),4))};var Ut=n(38),St=n.n(Ut),At=n(39);var Ct=function(t){function e(){for(var e,n=arguments.length,o=new Array(n),s=0;s{var t={n:e=>{var o=e&&e.__esModule?()=>e.default:()=>e;return t.d(o,{a:o}),o},d:(e,o)=>{for(var n in o)t.o(o,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:o[n]})},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:()=>re,modals:()=>se});const o=flarum.core.compat["forum/app"];var n=t.n(o);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 o=e.prototype;return o.icon=function(){return n().forum.attribute("byobu.icon-postAction")},o.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 o=e.prototype;return o.icon=function(){return n().forum.attribute("byobu.icon-postAction")},o.descriptionKey=function(){return"fof-byobu.forum.post.recipients_modified.removed_self"},e}(a());function p(t,e){if(null==t)return{};var o,n,s={},r=Object.keys(t);for(n=0;n=0||(s[o]=t[o]);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,o=this.attrs,s=o.recipient,r=o.link,i=p(o,w);if(i.style=i.style||{},i.className=h()("RecipientLabel",null==i?void 0:i.className),r&&s instanceof f()&&(i.href=n().route.user(s)),s instanceof f()){var a,c;e=v()(s),i.href||s.id()===(null==n()||null==(a=n().session)||null==(c=a.user)?void 0:c.id())||(i.href=n().route.user(s))}else{if(s instanceof g())return m("span",{class:i.className},s.namePlural());i.className+=" none",e=n().translator.trans("core.lib.username.deleted_text")}return m(P(),i,e)},e}(t.n(R)()),k=["link","className"];function N(t,e){void 0===e&&(e={});var o=e,n=o.link,s=o.className,r=p(o,k);return r.className=h()("RecipientsLabel",s),m("span",r,null==t?void 0:t.map((function(t,e){var o=t instanceof f()?"u":"g";return m(D,{key:o+"-"+e,recipient:t,link:n})})),!t&&m(D,null))}var x=function(t){function e(){return t.apply(this,arguments)||this}r(e,t),e.initAttrs=function(e){function o(t,e,o){return t.filter((function(t){return-1===e.indexOf(t)})).map((function(t){return n().store.getById(o,t)}))}t.initAttrs.call(this,e);var s=e.post.content();if(s.new||2!=s.length){var r=o(s.new.users,s.old.users,"users"),i=o(s.old.users,s.new.users,"users"),a=o(s.new.groups,s.old.groups,"groups"),c=o(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=o(p,u,"users"),e.removed=o(u,p,"users")}};var o=e.prototype;return o.icon=function(){return n().forum.attribute("byobu.icon-postAction")},o.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"},o.descriptionData=function(){var t={};return this.attrs.added.length&&(t.added=N(this.attrs.added,{link:!0})),this.attrs.removed.length&&(t.removed=N(this.attrs.removed,{link:!0})),t},e}(a());const U=flarum.core.compat["common/extend"],S=flarum.core.compat["forum/components/SettingsPage"];var A=t.n(S);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 T=flarum.core.compat["common/components/Button"];var E=t.n(T);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 ot=flarum.core.compat["common/utils/Stream"];var nt=t.n(ot);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,n().translator.trans("fof-byobu.forum.modal.labels.selected_users")),m("p",null,n().translator.trans("fof-byobu.forum.modal.help.selected_users")),this.attrs.selected().toArray().map((function(e){return m(_t(),{text:n().translator.trans("fof-byobu.forum.modal.help.click_user_to_remove_tooltip")},m(D,{"data-container":"body",recipient:e,onclick:function(o){return t.removeRecipient(e,o)}}))}))),m("div",{className:"Form-group"},m("label",{for:"byobu-addrecipient-search-input-"+this.inputUuid},n().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.state.getValue(),focused:!!this.state.getValue(),active:!!this.state.getValue(),loading:!!this.loadingSources}),oncreate:function(t){return t.dom.focus()},type:"search",placeholder:bt()(n().translator.trans("fof-byobu.forum.input.search_recipients")),value:this.state.getValue(),oninput:function(e){return t.state.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.state.getValue())})):yt().component({size:"tiny",className:"Button Button--icon Button--link"})))))},o.sourceItems=function(){var t=new(X());return(!this.attrs.discussion&&n().forum.attribute("canStartPrivateDiscussionWithUsers")||this.attrs.discussion&&this.attrs.discussion.canEditUserRecipients())&&t.add("users",new mt),(!this.attrs.discussion&&n().forum.attribute("canStartPrivateDiscussionWithGroups")||this.attrs.discussion&&this.attrs.discussion.canEditGroupRecipients())&&t.add("groups",new dt),t},o.addRecipient=function(t){var e=t.split(":"),o=e[0],n=e[1],s=this.findRecipient(o,n);this.attrs.selected().add(t,s),this.state.clear()},o.removeRecipient=function(t,e){var o;e.preventDefault(),t instanceof f()&&(o="users"),t instanceof g()&&(o="groups"),this.attrs.selected().remove(o+":"+t.id())},o.findRecipient=function(t,e){return n().store.getById(t,e)},e}(at()),Rt=function(t){function e(){return t.apply(this,arguments)||this}r(e,t);var o=e.prototype;return o.oninit=function(e){t.prototype.oninit.call(this,e),this.selected=nt()(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:"+n().session.user.id(),n().session.user),this.recipientSearch=new(rt())},o.isDismissible=function(){return!1},o.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)}))},o.className=function(){return"AddRecipientModal"},o.title=function(){return this.attrs.discussion?n().translator.trans("fof-byobu.forum.modal.titles.update_recipients",{title:m("em",null,this.attrs.discussion.title())}):n().translator.trans("fof-byobu.forum.modal.titles.add_recipients")},o.helpText=function(){return this.attrs.discussion?n().translator.trans("fof-byobu.forum.modal.help.update_recipients"):n().translator.trans("fof-byobu.forum.modal.help.add_recipients")},o.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"},E().component({type:"submit",className:"Button Button--primary",icon:"fas fa-check"},n().translator.trans("fof-byobu.forum.buttons.submit")),E().component({onclick:this.hide.bind(this),className:"Button Button--cancel"},n().translator.trans("fof-byobu.forum.buttons.cancel")))))]},o.select=function(t){(t.metaKey||t.ctrlKey||-1!==this.selected.indexOf(this.index))&&this.selected().length&&this.$("form").submit()},o.onsubmit=function(t){t.preventDefault();var e=this.attrs.discussion,o=this.selected(),s=[],r=[];o.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(){n().current instanceof et()&&n().current.stream.update(),m.redraw()})),this.attrs.onsubmit&&this.attrs.onsubmit(o),n().modal.close(),this.attrs.discussion||n().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 kt=flarum.core.compat["components/DiscussionPage"];var Nt=t.n(kt);var xt=function(t,e,o){var n=[];t.recipientUsers().length&&(n=n.concat(t.recipientUsers())),t.recipientGroups().length&&(n=n.concat(t.recipientGroups())),n&&n.length&&(o?e.add("recipients",N(n),10):e.add("recipients",N(n,{link:!0}),4))};const Ut=flarum.core.compat["forum/utils/UserControls"];var St=t.n(Ut);const At=flarum.core.compat["forum/components/DiscussionComposer"];var Ct=function(t){function e(){for(var e,o=arguments.length,n=new Array(o),s=0;s= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}","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 { 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","export default function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}","import 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","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.state.getValue() === 'undefined') {\n this.state.setValue('');\n }\n\n const loading = this.state.getValue() && this.state.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.state.getValue()}\n oninput={(e) => this.state.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.state.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.state.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","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","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: () => app.modal.show(AddRecipientModal, { discussion }),\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","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","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';\n\nexport default () => {\n attributes();\n message();\n sharedMessageHistory();\n};\n\nfunction message() {\n extend(UserControls, 'userControls', function (items, user) {\n if (\n app.session.user &&\n app.session.user.id() !== user.id() &&\n app.forum.attribute('canStartPrivateDiscussion') &&\n (user.blocksPd() === false || (app.forum.attribute('canStartPrivateDiscussionWithBlockers') && user.cannotBeDirectMessaged()))\n ) {\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","import SettingsPage from './SettingsPage';\nimport Discussion from './Discussion';\nimport User from './User';\n\nexport default () => {\n Discussion();\n SettingsPage();\n User();\n};\n","import DiscussionListState from 'flarum/forum/states/DiscussionListState';\n\nexport default class PrivateDiscussionListState extends DiscussionListState {}\n","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}","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';\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 (app.session.user && app.forum.attribute('canStartPrivateDiscussion')) {\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 routes from './routes';\nimport PrivateDiscussionsPage from './PrivateDiscussionsPage';\n\nexport default () => {\n routes();\n PrivateDiscussionsPage();\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","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 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","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","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","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","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","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","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 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"],"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,GCLRF,EAA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,IAAI,wBAAyB,CACjCxE,KAAM,wBACNpE,KAAMC,IAAAA,MAAAA,KAAAA,WAAAA,oBACNgB,MAAOhB,IAAAA,WAAAA,MAAqB,6D","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/./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['forum/components/EventPost']\"","webpack://@fof/byobu/./src/forum/events/MadePublic.ts","webpack://@fof/byobu/./src/forum/events/RecipientLeft.js","webpack://@fof/byobu/./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","webpack://@fof/byobu/external root \"flarum.core.compat['common/models/User']\"","webpack://@fof/byobu/external root \"flarum.core.compat['common/utils/classList']\"","webpack://@fof/byobu/external root \"flarum.core.compat['common/helpers/username']\"","webpack://@fof/byobu/external root \"flarum.core.compat['common/models/Group']\"","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/./src/forum/events/RecipientsModified.js","webpack://@fof/byobu/./src/forum/events/index.js","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/extend/SettingsPage.js","webpack://@fof/byobu/external root \"flarum.core.compat['common/Model']\"","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/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/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/extend/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/extend/User.js","webpack://@fof/byobu/external root \"flarum.core.compat['forum/components/IndexPage']\"","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/external root \"flarum.core.compat['forum/components/DiscussionList']\"","webpack://@fof/byobu/./src/forum/pages/discussions/PrivateDiscussionList.js","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/PrivateDiscussionsUserPage.js","webpack://@fof/byobu/./src/forum/pages/routes.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/./src/forum/pages/discussions/index.js","webpack://@fof/byobu/./src/forum/index.ts","webpack://@fof/byobu/./src/forum/pages/PrivateDiscussionsPage.js","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'];","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.state.getValue() === 'undefined') {\n this.state.setValue('');\n }\n\n const loading = this.state.getValue() && this.state.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.state.getValue()}\n oninput={(e) => this.state.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.state.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.state.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: () => app.modal.show(AddRecipientModal, { discussion }),\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';\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';\n\nexport default () => {\n attributes();\n message();\n sharedMessageHistory();\n};\n\nfunction message() {\n extend(UserControls, 'userControls', function (items, user) {\n if (\n app.session.user &&\n app.session.user.id() !== user.id() &&\n app.forum.attribute('canStartPrivateDiscussion') &&\n (user.blocksPd() === false || (app.forum.attribute('canStartPrivateDiscussionWithBlockers') && user.cannotBeDirectMessaged()))\n ) {\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';\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 (app.session.user && app.forum.attribute('canStartPrivateDiscussion')) {\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","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","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","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","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","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","state","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","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","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","Notification","PrivateDiscussionReplyNotification","postNumber","PrivateDiscussionUserLeftNotification","PrivateDiscussionAddedNotification","PrivateDiscussionMadePublicNotification","modals","discussions","Discussion","Model","extend","badges","Badge","DiscussionListItem","DiscussionHero","params","include","DiscussionControls","canEditRecipients","find","isPrivateDiscussion","canMakePublic","confirm","extensions","public","update","SettingsPage","Switch","blocksPd","onchange","blocksPdLoading","UserControls","cannotBeDirectMessaged","LinkButton","path","IndexPage","compose","replace","PrivateDiscussionRepliedNotification","NotificationGrid"],"sourceRoot":""} \ No newline at end of file