diff --git a/extensions/nicknames/js/dist/forum.js b/extensions/nicknames/js/dist/forum.js index 96a7bc27a8..e516041762 100644 --- a/extensions/nicknames/js/dist/forum.js +++ b/extensions/nicknames/js/dist/forum.js @@ -1,2 +1,2 @@ -(()=>{var e={n:n=>{var t=n&&n.__esModule?()=>n.default:()=>n;return e.d(t,{a:t}),t},d:(n,t)=>{for(var a in t)e.o(t,a)&&!e.o(n,a)&&Object.defineProperty(n,a,{enumerable:!0,get:t[a]})},o:(e,n)=>Object.prototype.hasOwnProperty.call(e,n),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},n={};(()=>{"use strict";e.r(n),e.d(n,{extend:()=>y});const t=flarum.reg.get("core","forum/app");var a=e.n(t);const r=flarum.reg.get("core","common/extend"),i=flarum.reg.get("core","common/components/Button");var o=e.n(i);const s=flarum.reg.get("core","common/utils/extractText");var c=e.n(s);const u=flarum.reg.get("core","common/utils/Stream");var l=e.n(u);const d=flarum.reg.get("core","common/components/FormModal");var f=e.n(d);const p=flarum.reg.get("core","common/components/Form");var g=e.n(p);class k extends(f()){oninit(e){super.oninit(e),this.nickname=l()(a().session.user.displayName())}className(){return"NickameModal Modal--small"}title(){return a().translator.trans("flarum-nicknames.forum.change_nickname.title")}content(){return m("div",{className:"Modal-body"},m(g(),{className:"Form--centered"},m("div",{className:"Form-group"},m("input",{type:"text",autocomplete:"off",name:"nickname",className:"FormControl",bidi:this.nickname,disabled:this.loading})),m("div",{className:"Form-group Form-controls"},m(o(),{className:"Button Button--primary Button--block",type:"submit",loading:this.loading},a().translator.trans("flarum-nicknames.forum.change_nickname.submit_button")))))}onsubmit(e){e.preventDefault(),this.nickname()!==a().session.user.displayName()?(this.loading=!0,a().session.user.save({nickname:this.nickname()},{errorHandler:this.onerror.bind(this)}).then(this.hide.bind(this)).catch((()=>{this.loading=!1,m.redraw()}))):this.hide()}}flarum.reg.add("flarum-nicknames","forum/components/NicknameModal",k);const h=flarum.reg.get("core","common/extenders");var b=e.n(h);const N=flarum.reg.get("core","common/models/User");var v=e.n(N);const y=[new(b().Model)(v()).attribute("canEditNickname")];a().initializers.add("flarum-nicknames",(()=>{(0,r.extend)("flarum/forum/components/SettingsPage","accountItems",(function(e){"nickname"===a().forum.attribute("displayNameDriver")&&this.user.canEditNickname()&&e.add("changeNickname",m(o(),{className:"Button",onclick:()=>a().modal.show(k)},a().translator.trans("flarum-nicknames.forum.settings.change_nickname_button")))})),(0,r.extend)("flarum/common/components/EditUserModal","oninit",(function(){this.nickname=l()(this.attrs.user.displayName())})),(0,r.extend)("flarum/common/components/EditUserModal","fields",(function(e){"nickname"===a().forum.attribute("displayNameDriver")&&this.attrs.user.canEditNickname()&&e.add("nickname",m("div",{className:"Form-group"},m("label",null,a().translator.trans("flarum-nicknames.forum.edit_user.nicknames_heading")),m("input",{className:"FormControl",placeholder:c()(a().translator.trans("flarum-nicknames.forum.edit_user.nicknames_text")),bidi:this.nickname})),100)})),(0,r.extend)("flarum/common/components/EditUserModal","data",(function(e){"nickname"===a().forum.attribute("displayNameDriver")&&this.attrs.user.canEditNickname()&&this.nickname()!==this.attrs.user.displayName()&&(e.nickname=this.nickname())})),(0,r.extend)("flarum/forum/components/SignUpModal","oninit",(function(){"nickname"===a().forum.attribute("displayNameDriver")&&(this.nickname=l()(this.attrs.username||""))})),(0,r.extend)("flarum/forum/components/SignUpModal","onready",(function(){"nickname"===a().forum.attribute("displayNameDriver")&&a().forum.attribute("setNicknameOnRegistration")&&a().forum.attribute("randomizeUsernameOnRegistration")&&this.$("[name=nickname]").select()})),(0,r.extend)("flarum/forum/components/SignUpModal","fields",(function(e){"nickname"===a().forum.attribute("displayNameDriver")&&a().forum.attribute("setNicknameOnRegistration")&&(e.add("nickname",m("div",{className:"Form-group"},m("input",{className:"FormControl",name:"nickname",type:"text",placeholder:c()(a().translator.trans("flarum-nicknames.forum.sign_up.nickname_placeholder")),bidi:this.nickname,disabled:this.loading||this.isProvided("nickname"),required:a().forum.attribute("randomizeUsernameOnRegistration")})),25),a().forum.attribute("randomizeUsernameOnRegistration")&&e.remove("username"))})),(0,r.extend)("flarum/forum/components/SignUpModal","submitData",(function(e){if("nickname"===a().forum.attribute("displayNameDriver")&&a().forum.attribute("setNicknameOnRegistration")&&(e.nickname=this.nickname(),a().forum.attribute("randomizeUsernameOnRegistration"))){const n=new Uint32Array(2);crypto.getRandomValues(n),e.username=n.join("")}}))}))})(),module.exports=n})(); +(()=>{var e={n:n=>{var t=n&&n.__esModule?()=>n.default:()=>n;return e.d(t,{a:t}),t},d:(n,t)=>{for(var a in t)e.o(t,a)&&!e.o(n,a)&&Object.defineProperty(n,a,{enumerable:!0,get:t[a]})},o:(e,n)=>Object.prototype.hasOwnProperty.call(e,n),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},n={};(()=>{"use strict";e.r(n),e.d(n,{extend:()=>y});const t=flarum.reg.get("core","forum/app");var a=e.n(t);const r=flarum.reg.get("core","common/extend"),i=flarum.reg.get("core","common/components/Button");var o=e.n(i);const s=flarum.reg.get("core","common/utils/extractText");var c=e.n(s);const u=flarum.reg.get("core","common/utils/Stream");var l=e.n(u);const d=flarum.reg.get("core","common/components/FormModal");var f=e.n(d);const p=flarum.reg.get("core","common/components/Form");var g=e.n(p);class k extends(f()){oninit(e){super.oninit(e),this.nickname=l()(a().session.user.displayName())}className(){return"NickameModal Modal--small"}title(){return a().translator.trans("flarum-nicknames.forum.change_nickname.title")}content(){return m("div",{className:"Modal-body"},m(g(),{className:"Form--centered"},m("div",{className:"Form-group"},m("input",{type:"text",autocomplete:"off",name:"nickname",className:"FormControl",bidi:this.nickname,disabled:this.loading})),m("div",{className:"Form-group Form-controls"},m(o(),{className:"Button Button--primary Button--block",type:"submit",loading:this.loading},a().translator.trans("flarum-nicknames.forum.change_nickname.submit_button")))))}onsubmit(e){e.preventDefault(),this.nickname()!==a().session.user.displayName()?(this.loading=!0,a().session.user.save({nickname:this.nickname()},{errorHandler:this.onerror.bind(this)}).then(this.hide.bind(this)).catch((()=>{this.loading=!1,m.redraw()}))):this.hide()}}flarum.reg.add("flarum-nicknames","forum/components/NicknameModal",k);const h=flarum.reg.get("core","common/extenders");var b=e.n(h);const N=flarum.reg.get("core","common/models/User");var v=e.n(N);const y=[new(b().Model)(v()).attribute("canEditNickname")];a().initializers.add("flarum-nicknames",(()=>{(0,r.extend)("flarum/forum/components/SettingsPage","accountItems",(function(e){"nickname"===a().forum.attribute("displayNameDriver")&&this.user.canEditNickname()&&e.add("changeNickname",m(o(),{className:"Button",onclick:()=>a().modal.show(k)},a().translator.trans("flarum-nicknames.forum.settings.change_nickname_button")))})),(0,r.extend)("flarum/common/components/EditUserModal","oninit",(function(){this.nickname=l()(this.attrs.user.displayName())})),(0,r.extend)("flarum/common/components/EditUserModal","fields",(function(e){"nickname"===a().forum.attribute("displayNameDriver")&&this.attrs.user.canEditNickname()&&e.add("nickname",m("div",{className:"Form-group"},m("label",null,a().translator.trans("flarum-nicknames.forum.edit_user.nicknames_heading")),m("input",{className:"FormControl",placeholder:c()(a().translator.trans("flarum-nicknames.forum.edit_user.nicknames_text")),bidi:this.nickname})),100)})),(0,r.extend)("flarum/common/components/EditUserModal","data",(function(e){"nickname"===a().forum.attribute("displayNameDriver")&&this.attrs.user.canEditNickname()&&this.nickname()!==this.attrs.user.displayName()&&(e.nickname=this.nickname())})),(0,r.extend)("flarum/forum/components/SignUpModal","oninit",(function(){"nickname"===a().forum.attribute("displayNameDriver")&&(this.nickname=l()(this.attrs.nickname||this.attrs.username||""))})),(0,r.extend)("flarum/forum/components/SignUpModal","onready",(function(){"nickname"===a().forum.attribute("displayNameDriver")&&a().forum.attribute("setNicknameOnRegistration")&&a().forum.attribute("randomizeUsernameOnRegistration")&&this.$("[name=nickname]").select()})),(0,r.extend)("flarum/forum/components/SignUpModal","fields",(function(e){"nickname"===a().forum.attribute("displayNameDriver")&&a().forum.attribute("setNicknameOnRegistration")&&(e.add("nickname",m("div",{className:"Form-group"},m("input",{className:"FormControl",name:"nickname",type:"text",placeholder:c()(a().translator.trans("flarum-nicknames.forum.sign_up.nickname_placeholder")),bidi:this.nickname,disabled:this.loading||this.isProvided("nickname"),required:a().forum.attribute("randomizeUsernameOnRegistration")})),25),a().forum.attribute("randomizeUsernameOnRegistration")&&e.remove("username"))})),(0,r.extend)("flarum/forum/components/SignUpModal","submitData",(function(e){if("nickname"===a().forum.attribute("displayNameDriver")&&a().forum.attribute("setNicknameOnRegistration")&&(e.nickname=this.nickname(),a().forum.attribute("randomizeUsernameOnRegistration"))){const n=new Uint32Array(2);crypto.getRandomValues(n),e.username=n.join("")}}))}))})(),module.exports=n})(); //# sourceMappingURL=forum.js.map \ No newline at end of file diff --git a/extensions/nicknames/js/dist/forum.js.map b/extensions/nicknames/js/dist/forum.js.map index 8526546bac..931419146f 100644 --- a/extensions/nicknames/js/dist/forum.js.map +++ b/extensions/nicknames/js/dist/forum.js.map @@ -1 +1 @@ -{"version":3,"file":"forum.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CA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D,UAAU,sBACpB,UAAUA,UAAU,8BAAgC,UAAUA,UAAU,oCAC1E3B,KAAKqC,EAAE,mBAAmBC,QAE9B,KACA,IAAAV,QAAO,sCAAuC,UAAU,SAAUC,GACf,aAA7C,UAAUF,UAAU,sBACpB,UAAUA,UAAU,+BACtBE,EAAMH,IAAI,WAAYlB,EAAE,MAAO,CAC7BJ,UAAW,cACVI,EAAE,QAAS,CACZJ,UAAW,cACXO,KAAM,WACNF,KAAM,OACNyB,YAAa,IAAY,eAAe5B,MAAM,wDAC9CM,KAAMZ,KAAKC,SACXY,SAAUb,KAAKc,SAAWd,KAAKuC,WAAW,YAC1CC,SAAU,UAAUb,UAAU,sCAC3B,IACD,UAAUA,UAAU,oCACtBE,EAAMY,OAAO,YAGnB,KACA,IAAAb,QAAO,sCAAuC,cAAc,SAAUO,GACpE,GAAiD,aAA7C,UAAUR,UAAU,sBACpB,UAAUA,UAAU,+BACtBQ,EAAKlC,SAAWD,KAAKC,WACjB,UAAU0B,UAAU,oCAAoC,CAC1D,MAAMe,EAAM,IAAIC,YAAY,GAC5BC,OAAOC,gBAAgBH,GACvBP,EAAKC,SAAWM,EAAII,KAAK,GAC3B,CAEJ,GAAE,G","sources":["webpack://@flarum/nicknames/webpack/bootstrap","webpack://@flarum/nicknames/webpack/runtime/compat get default export","webpack://@flarum/nicknames/webpack/runtime/define property getters","webpack://@flarum/nicknames/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/nicknames/webpack/runtime/make namespace object","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'forum/app')\"","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/components/Button')\"","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/utils/extractText')\"","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/utils/Stream')\"","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/components/FormModal')\"","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/components/Form')\"","webpack://@flarum/nicknames/./src/forum/components/NicknameModal.js","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/extenders')\"","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/models/User')\"","webpack://@flarum/nicknames/./src/forum/extend.ts","webpack://@flarum/nicknames/./src/forum/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.reg.get('core', 'forum/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extend');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Button');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/extractText');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/Stream');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/FormModal');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Form');","import app from 'flarum/forum/app';\nimport FormModal from 'flarum/common/components/FormModal';\nimport Button from 'flarum/common/components/Button';\nimport Stream from 'flarum/common/utils/Stream';\nimport Form from 'flarum/common/components/Form';\nexport default class NicknameModal extends FormModal {\n oninit(vnode) {\n super.oninit(vnode);\n this.nickname = Stream(app.session.user.displayName());\n }\n className() {\n return 'NickameModal Modal--small';\n }\n title() {\n return app.translator.trans('flarum-nicknames.forum.change_nickname.title');\n }\n content() {\n return m(\"div\", {\n className: \"Modal-body\"\n }, m(Form, {\n className: \"Form--centered\"\n }, m(\"div\", {\n className: \"Form-group\"\n }, m(\"input\", {\n type: \"text\",\n autocomplete: \"off\",\n name: \"nickname\",\n className: \"FormControl\",\n bidi: this.nickname,\n disabled: this.loading\n })), m(\"div\", {\n className: \"Form-group Form-controls\"\n }, m(Button, {\n className: \"Button Button--primary Button--block\",\n type: \"submit\",\n loading: this.loading\n }, app.translator.trans('flarum-nicknames.forum.change_nickname.submit_button')))));\n }\n onsubmit(e) {\n e.preventDefault();\n if (this.nickname() === app.session.user.displayName()) {\n this.hide();\n return;\n }\n this.loading = true;\n app.session.user.save({\n nickname: this.nickname()\n }, {\n errorHandler: this.onerror.bind(this)\n }).then(this.hide.bind(this)).catch(() => {\n this.loading = false;\n m.redraw();\n });\n }\n}\nflarum.reg.add('flarum-nicknames', 'forum/components/NicknameModal', NicknameModal);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extenders');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/models/User');","import Extend from 'flarum/common/extenders';\nimport User from 'flarum/common/models/User';\nexport default [new Extend.Model(User) //\n.attribute('canEditNickname')];","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport Button from 'flarum/common/components/Button';\nimport extractText from 'flarum/common/utils/extractText';\nimport Stream from 'flarum/common/utils/Stream';\nimport NickNameModal from './components/NicknameModal';\nexport { default as extend } from './extend';\napp.initializers.add('flarum-nicknames', () => {\n extend('flarum/forum/components/SettingsPage', 'accountItems', function (items) {\n if (app.forum.attribute('displayNameDriver') !== 'nickname') return;\n if (this.user.canEditNickname()) {\n items.add('changeNickname', m(Button, {\n className: \"Button\",\n onclick: () => app.modal.show(NickNameModal)\n }, app.translator.trans('flarum-nicknames.forum.settings.change_nickname_button')));\n }\n });\n extend('flarum/common/components/EditUserModal', 'oninit', function () {\n this.nickname = Stream(this.attrs.user.displayName());\n });\n extend('flarum/common/components/EditUserModal', 'fields', function (items) {\n if (app.forum.attribute('displayNameDriver') !== 'nickname') return;\n if (!this.attrs.user.canEditNickname()) return;\n items.add('nickname', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-nicknames.forum.edit_user.nicknames_heading')), m(\"input\", {\n className: \"FormControl\",\n placeholder: extractText(app.translator.trans('flarum-nicknames.forum.edit_user.nicknames_text')),\n bidi: this.nickname\n })), 100);\n });\n extend('flarum/common/components/EditUserModal', 'data', function (data) {\n if (app.forum.attribute('displayNameDriver') !== 'nickname') return;\n if (!this.attrs.user.canEditNickname()) return;\n if (this.nickname() !== this.attrs.user.displayName()) {\n data.nickname = this.nickname();\n }\n });\n extend('flarum/forum/components/SignUpModal', 'oninit', function () {\n if (app.forum.attribute('displayNameDriver') !== 'nickname') return;\n this.nickname = Stream(this.attrs.username || '');\n });\n extend('flarum/forum/components/SignUpModal', 'onready', function () {\n if (app.forum.attribute('displayNameDriver') !== 'nickname') return;\n if (app.forum.attribute('setNicknameOnRegistration') && app.forum.attribute('randomizeUsernameOnRegistration')) {\n this.$('[name=nickname]').select();\n }\n });\n extend('flarum/forum/components/SignUpModal', 'fields', function (items) {\n if (app.forum.attribute('displayNameDriver') !== 'nickname') return;\n if (app.forum.attribute('setNicknameOnRegistration')) {\n items.add('nickname', m(\"div\", {\n className: \"Form-group\"\n }, m(\"input\", {\n className: \"FormControl\",\n name: \"nickname\",\n type: \"text\",\n placeholder: extractText(app.translator.trans('flarum-nicknames.forum.sign_up.nickname_placeholder')),\n bidi: this.nickname,\n disabled: this.loading || this.isProvided('nickname'),\n required: app.forum.attribute('randomizeUsernameOnRegistration')\n })), 25);\n if (app.forum.attribute('randomizeUsernameOnRegistration')) {\n items.remove('username');\n }\n }\n });\n extend('flarum/forum/components/SignUpModal', 'submitData', function (data) {\n if (app.forum.attribute('displayNameDriver') !== 'nickname') return;\n if (app.forum.attribute('setNicknameOnRegistration')) {\n data.nickname = this.nickname();\n if (app.forum.attribute('randomizeUsernameOnRegistration')) {\n const arr = new Uint32Array(2);\n crypto.getRandomValues(arr);\n data.username = arr.join('');\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","reg","NicknameModal","oninit","vnode","super","this","nickname","user","displayName","className","title","trans","content","m","type","autocomplete","name","bidi","disabled","loading","onsubmit","e","preventDefault","save","errorHandler","onerror","bind","then","hide","catch","redraw","add","attribute","extend","items","canEditNickname","onclick","show","attrs","placeholder","data","username","$","select","isProvided","required","remove","arr","Uint32Array","crypto","getRandomValues","join"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"forum.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,C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C,WAAW,WACN,aAA7C,UAAUD,UAAU,sBACpB,UAAUA,UAAU,8BAAgC,UAAUA,UAAU,oCAC1E3B,KAAKqC,EAAE,mBAAmBC,QAE9B,KACA,IAAAV,QAAO,sCAAuC,UAAU,SAAUC,GACf,aAA7C,UAAUF,UAAU,sBACpB,UAAUA,UAAU,+BACtBE,EAAMH,IAAI,WAAYlB,EAAE,MAAO,CAC7BJ,UAAW,cACVI,EAAE,QAAS,CACZJ,UAAW,cACXO,KAAM,WACNF,KAAM,OACNyB,YAAa,IAAY,eAAe5B,MAAM,wDAC9CM,KAAMZ,KAAKC,SACXY,SAAUb,KAAKc,SAAWd,KAAKuC,WAAW,YAC1CC,SAAU,UAAUb,UAAU,sCAC3B,IACD,UAAUA,UAAU,oCACtBE,EAAMY,OAAO,YAGnB,KACA,IAAAb,QAAO,sCAAuC,cAAc,SAAUO,GACpE,GAAiD,aAA7C,UAAUR,UAAU,sBACpB,UAAUA,UAAU,+BACtBQ,EAAKlC,SAAWD,KAAKC,WACjB,UAAU0B,UAAU,oCAAoC,CAC1D,MAAMe,EAAM,IAAIC,YAAY,GAC5BC,OAAOC,gBAAgBH,GACvBP,EAAKC,SAAWM,EAAII,KAAK,GAC3B,CAEJ,GAAE,G","sources":["webpack://@flarum/nicknames/webpack/bootstrap","webpack://@flarum/nicknames/webpack/runtime/compat get default export","webpack://@flarum/nicknames/webpack/runtime/define property getters","webpack://@flarum/nicknames/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/nicknames/webpack/runtime/make namespace object","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'forum/app')\"","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/components/Button')\"","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/utils/extractText')\"","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/utils/Stream')\"","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/components/FormModal')\"","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/components/Form')\"","webpack://@flarum/nicknames/./src/forum/components/NicknameModal.js","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/extenders')\"","webpack://@flarum/nicknames/external root \"flarum.reg.get('core', 'common/models/User')\"","webpack://@flarum/nicknames/./src/forum/extend.ts","webpack://@flarum/nicknames/./src/forum/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.reg.get('core', 'forum/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extend');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Button');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/extractText');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/Stream');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/FormModal');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Form');","import app from 'flarum/forum/app';\nimport FormModal from 'flarum/common/components/FormModal';\nimport Button from 'flarum/common/components/Button';\nimport Stream from 'flarum/common/utils/Stream';\nimport Form from 'flarum/common/components/Form';\nexport default class NicknameModal extends FormModal {\n oninit(vnode) {\n super.oninit(vnode);\n this.nickname = Stream(app.session.user.displayName());\n }\n className() {\n return 'NickameModal Modal--small';\n }\n title() {\n return app.translator.trans('flarum-nicknames.forum.change_nickname.title');\n }\n content() {\n return m(\"div\", {\n className: \"Modal-body\"\n }, m(Form, {\n className: \"Form--centered\"\n }, m(\"div\", {\n className: \"Form-group\"\n }, m(\"input\", {\n type: \"text\",\n autocomplete: \"off\",\n name: \"nickname\",\n className: \"FormControl\",\n bidi: this.nickname,\n disabled: this.loading\n })), m(\"div\", {\n className: \"Form-group Form-controls\"\n }, m(Button, {\n className: \"Button Button--primary Button--block\",\n type: \"submit\",\n loading: this.loading\n }, app.translator.trans('flarum-nicknames.forum.change_nickname.submit_button')))));\n }\n onsubmit(e) {\n e.preventDefault();\n if (this.nickname() === app.session.user.displayName()) {\n this.hide();\n return;\n }\n this.loading = true;\n app.session.user.save({\n nickname: this.nickname()\n }, {\n errorHandler: this.onerror.bind(this)\n }).then(this.hide.bind(this)).catch(() => {\n this.loading = false;\n m.redraw();\n });\n }\n}\nflarum.reg.add('flarum-nicknames', 'forum/components/NicknameModal', NicknameModal);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extenders');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/models/User');","import Extend from 'flarum/common/extenders';\nimport User from 'flarum/common/models/User';\nexport default [new Extend.Model(User) //\n.attribute('canEditNickname')];","import app from 'flarum/forum/app';\nimport { extend } from 'flarum/common/extend';\nimport Button from 'flarum/common/components/Button';\nimport extractText from 'flarum/common/utils/extractText';\nimport Stream from 'flarum/common/utils/Stream';\nimport NickNameModal from './components/NicknameModal';\nexport { default as extend } from './extend';\napp.initializers.add('flarum-nicknames', () => {\n extend('flarum/forum/components/SettingsPage', 'accountItems', function (items) {\n if (app.forum.attribute('displayNameDriver') !== 'nickname') return;\n if (this.user.canEditNickname()) {\n items.add('changeNickname', m(Button, {\n className: \"Button\",\n onclick: () => app.modal.show(NickNameModal)\n }, app.translator.trans('flarum-nicknames.forum.settings.change_nickname_button')));\n }\n });\n extend('flarum/common/components/EditUserModal', 'oninit', function () {\n this.nickname = Stream(this.attrs.user.displayName());\n });\n extend('flarum/common/components/EditUserModal', 'fields', function (items) {\n if (app.forum.attribute('displayNameDriver') !== 'nickname') return;\n if (!this.attrs.user.canEditNickname()) return;\n items.add('nickname', m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-nicknames.forum.edit_user.nicknames_heading')), m(\"input\", {\n className: \"FormControl\",\n placeholder: extractText(app.translator.trans('flarum-nicknames.forum.edit_user.nicknames_text')),\n bidi: this.nickname\n })), 100);\n });\n extend('flarum/common/components/EditUserModal', 'data', function (data) {\n if (app.forum.attribute('displayNameDriver') !== 'nickname') return;\n if (!this.attrs.user.canEditNickname()) return;\n if (this.nickname() !== this.attrs.user.displayName()) {\n data.nickname = this.nickname();\n }\n });\n extend('flarum/forum/components/SignUpModal', 'oninit', function () {\n if (app.forum.attribute('displayNameDriver') !== 'nickname') return;\n this.nickname = Stream(this.attrs.nickname || this.attrs.username || '');\n });\n extend('flarum/forum/components/SignUpModal', 'onready', function () {\n if (app.forum.attribute('displayNameDriver') !== 'nickname') return;\n if (app.forum.attribute('setNicknameOnRegistration') && app.forum.attribute('randomizeUsernameOnRegistration')) {\n this.$('[name=nickname]').select();\n }\n });\n extend('flarum/forum/components/SignUpModal', 'fields', function (items) {\n if (app.forum.attribute('displayNameDriver') !== 'nickname') return;\n if (app.forum.attribute('setNicknameOnRegistration')) {\n items.add('nickname', m(\"div\", {\n className: \"Form-group\"\n }, m(\"input\", {\n className: \"FormControl\",\n name: \"nickname\",\n type: \"text\",\n placeholder: extractText(app.translator.trans('flarum-nicknames.forum.sign_up.nickname_placeholder')),\n bidi: this.nickname,\n disabled: this.loading || this.isProvided('nickname'),\n required: app.forum.attribute('randomizeUsernameOnRegistration')\n })), 25);\n if (app.forum.attribute('randomizeUsernameOnRegistration')) {\n items.remove('username');\n }\n }\n });\n extend('flarum/forum/components/SignUpModal', 'submitData', function (data) {\n if (app.forum.attribute('displayNameDriver') !== 'nickname') return;\n if (app.forum.attribute('setNicknameOnRegistration')) {\n data.nickname = this.nickname();\n if (app.forum.attribute('randomizeUsernameOnRegistration')) {\n const arr = new Uint32Array(2);\n crypto.getRandomValues(arr);\n data.username = arr.join('');\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","reg","NicknameModal","oninit","vnode","super","this","nickname","user","displayName","className","title","trans","content","m","type","autocomplete","name","bidi","disabled","loading","onsubmit","e","preventDefault","save","errorHandler","onerror","bind","then","hide","catch","redraw","add","attribute","extend","items","canEditNickname","onclick","show","attrs","placeholder","data","username","$","select","isProvided","required","remove","arr","Uint32Array","crypto","getRandomValues","join"],"sourceRoot":""} \ No newline at end of file diff --git a/framework/core/js/dist/forum.js b/framework/core/js/dist/forum.js index 91f735a5ca..ade8c9767f 100644 --- a/framework/core/js/dist/forum.js +++ b/framework/core/js/dist/forum.js @@ -1,3 +1,3 @@ /*! For license information please see forum.js.LICENSE.txt */ -(()=>{var t,e,r={6997:(t,e,r)=>{"use strict";r.d(e,{A:()=>L});var n=r(8805),s=r(5114),o=r(6064),i=r(7880),a=r(1344),l=r(4519),c=r(7088),u=r(7141),d=r(3984),h=r(3957),p=r(4586),f=r(117),g=r(8781),v=r(6987),b=r(1810),A=r(2361),y=r(76),w=r(4022),x=r(281),k=r(5223),C=r(7390),N=r(2288),S=r(4583),T=r(3945),E=r(4944),M=r(2217),P=r(8286),D=r(2891),I=r(1467),_=r(2188);class L{constructor(){(0,n.A)(this,"forum",void 0),(0,n.A)(this,"routes",{}),(0,n.A)(this,"initializers",new o.A),(0,n.A)(this,"session",void 0),(0,n.A)(this,"translator",new u.A),(0,n.A)(this,"store",new d.A({"access-tokens":I.A,forums:x.A,users:k.A,discussions:C.A,posts:N.A,groups:S.A,notifications:T.A})),(0,n.A)(this,"search",void 0),(0,n.A)(this,"cache",{}),(0,n.A)(this,"booted",!1),(0,n.A)(this,"current",new E.A(null)),(0,n.A)(this,"previous",new E.A(null)),(0,n.A)(this,"modal",new M.A),(0,n.A)(this,"alerts",new P.A),(0,n.A)(this,"drawer",void 0),(0,n.A)(this,"history",null),(0,n.A)(this,"pane",null),(0,n.A)(this,"data",void 0),(0,n.A)(this,"allowUserColorScheme",void 0),(0,n.A)(this,"refs",{fontawesome:"https://fontawesome.com/v6/icons?o=r&m=free"}),(0,n.A)(this,"_title",""),(0,n.A)(this,"_titleCount",0),(0,n.A)(this,"requestErrorAlert",null),(0,n.A)(this,"initialRoute",void 0)}set title(t){this._title=t}get title(){return this._title}set titleCount(t){this._titleCount=t}get titleCount(){return this._titleCount}load(t){this.data=t,this.translator.setLocale(t.locale)}initialize(){const t=[];return this.initializers.toArray().forEach((e=>{try{e(this)}catch(r){const n=e.itemName.includes("/")?e.itemName.replace(/(\/flarum-ext-)|(\/flarum-)/g,"-"):e.itemName;t.push((()=>(0,D.A)((0,f.A)(s.A.translator.trans("core.lib.error.extension_initialiation_failed_message",{extension:n})),`${n} failed to initialize`,r)))}})),t}boot(){const t=this.initialize();this.store.pushPayload({data:this.data.resources}),this.forum=this.store.getById("forums","1"),this.session=new h.A(this.store.getById("users",String(this.data.session.userId))??null,this.data.session.csrfToken),this.beforeMount(),this.mount(),this.initialRoute=window.location.href,t.forEach((t=>t()))}beforeMount(){}bootExtensions(t){Object.keys(t).forEach((e=>{const r=t[e];if(!r.extend)return;const n=r.extend.flat(1/0);for(const t of n)t.extend(this,{name:e,exports:r})}))}mount(t){void 0===t&&(t=""),m.mount(document.getElementById("modal"),{view:()=>m(a.A,{state:this.modal})}),m.mount(document.getElementById("alerts"),{view:()=>m(l.A,{state:this.alerts})}),this.drawer=new g.A,m.route(document.getElementById("content"),t+"/",(0,v.A)(this.routes,t));const e=document.getElementById("app"),r=document.querySelector(".App-header"),n=new A.A((t=>{const n=e.getBoundingClientRect().top+document.body.scrollTop;e.classList.toggle("affix",t>=n),e.classList.toggle("scrolled",t>n),r.classList.toggle("navbar-fixed-top",t>=n)}));n.start(),n.update(),document.body.classList.add("ontouchstart"in window?"touch":"no-touch"),this.initColorScheme(),(0,y.A)()}initColorScheme(t){void 0===t&&(t=null),t??=s.A.forum.attribute("colorScheme")??"auto",this.allowUserColorScheme="auto"===t;const e=this.session.user?.preferences()?.colorScheme;let r;this.allowUserColorScheme&&(r=e),r||=t,this.setColorScheme(r),this.allowUserColorScheme&&this.watchSystemColorSchemePreference((()=>{this.initColorScheme(t)}))}getSystemColorSchemePreference(){let t=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";return window.matchMedia("(prefers-contrast: more)").matches&&(t+="-hc"),t}watchSystemColorSchemePreference(t){window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t),window.matchMedia("(prefers-contrast: more)").addEventListener("change",t)}setColorScheme(t){t===_.z.Auto&&(t=this.getSystemColorSchemePreference()),document.documentElement.setAttribute("data-theme",t)}setColoredHeader(t){document.documentElement.setAttribute("data-colored-header",t?"true":"false")}preloadedApiDocument(){if(this.data.apiDocument&&window.location.href===this.initialRoute){const t=((0,d.J)(this.data.apiDocument),this.store.pushPayload(this.data.apiDocument));return this.data.apiDocument=null,t}return null}screen(){return getComputedStyle(document.documentElement).getPropertyValue("--flarum-screen")}setTitle(t){this.title=t,this.updateTitle()}setTitleCount(t){this.titleCount=t,this.updateTitle()}updateTitle(){const t=this.titleCount?`(${this.titleCount}) `:"",e=m.route.get()===this.forum.attribute("basePath")+"/",r={pageTitle:this.title,forumName:this.forum.attribute("title"),pageNumber:1};let n=e||!this.title?(0,f.A)(s.A.translator.trans("core.lib.meta_titles.without_page_title",r)):(0,f.A)(s.A.translator.trans("core.lib.meta_titles.with_page_title",r));n=t+n;const o=new DOMParser;document.title=o.parseFromString(n,"text/html").body.innerText}transformRequestOptions(t){const{background:e,deserialize:r,modifyText:n,...o}={...t},i={background:e??!0,deserialize:r??(t=>t),...o};if((0,w.X)(i,"config",((t,e)=>{e.setRequestHeader("X-CSRF-Token",this.session.csrfToken)})),i.method&&!["GET","POST"].includes(i.method)){const t=i.method;(0,w.X)(i,"config",((e,r)=>{r.setRequestHeader("X-HTTP-Method-Override",t)})),i.method="POST"}return i.extract=t=>{let e;e=n?n(t.responseText):t.responseText;const r=t.status;if(r<200||r>299)throw new b.A(r,`${e}`,i,t);if(t.getResponseHeader){const e=t.getResponseHeader("X-CSRF-Token");e&&(s.A.session.csrfToken=e)}try{return""===e?null:JSON.parse(e)}catch(r){throw new b.A(500,`${e}`,i,t)}},i}request(t){const e=this.transformRequestOptions(t);return this.requestErrorAlert&&this.alerts.dismiss(this.requestErrorAlert),m.request(e).catch((e=>this.requestErrorCatch(e,t.errorHandler)))}requestErrorCatch(t,e){const r=t.response?.errors?.map((t=>decodeURI(t.detail??"")))??[];let n;switch(t.status){case 422:n=r.map((t=>[t,m("br",null)])).flat().slice(0,-1);break;case 401:case 403:n=s.A.translator.trans("core.lib.error.permission_denied_message");break;case 404:case 410:n=s.A.translator.trans("core.lib.error.not_found_message");break;case 413:n=s.A.translator.trans("core.lib.error.payload_too_large_message");break;case 429:n=s.A.translator.trans("core.lib.error.rate_limit_exceeded_message");break;default:const e=t.response?.errors?.[0]?.code;n="db_error"===e&&s.A.session.user?.isAdmin()?s.A.translator.trans("core.lib.error.db_error_message"):this.requestWasCrossOrigin(t)?s.A.translator.trans("core.lib.error.generic_cross_origin_message"):s.A.translator.trans("core.lib.error.generic_message")}const o=s.A.forum.attribute("debug");return t.alert={type:"error",content:n,controls:o&&[m(i.A,{className:"Button Button--link",onclick:this.showDebug.bind(this,t,r)},s.A.translator.trans("core.lib.debug_button"))]},e?e(t):this.requestErrorDefaultHandler(t,o,r),Promise.reject(t)}requestWasCrossOrigin(t){return new URL(t.options.url,document.baseURI).origin!==window.location.origin}requestErrorDefaultHandler(t,e,r){if(!(t instanceof b.A))throw t;if(e&&t.xhr){const{method:e,url:n}=t.options,{status:s=""}=t.xhr;console.group(`${e} ${n} ${s}`),r.length?console.error(...r):console.error(t),console.groupEnd()}500===t.status&&e?s.A.modal.show(c.A,{error:t,formattedError:r}):t.alert&&(this.requestErrorAlert=this.alerts.show(t.alert,t.alert.content))}showDebug(t,e){null!==this.requestErrorAlert&&this.alerts.dismiss(this.requestErrorAlert),this.modal.show(c.A,{error:t,formattedError:e})}route(t,e){void 0===e&&(e={});const r=this.routes[t];if(!r)throw new Error(`Route '${t}' does not exist`);const n=r.path.replace(/:([^\/]+)/g,((t,r)=>`${(0,p.A)(e,r)}`));for(const t in e)e.hasOwnProperty(t)&&!e[t]&&delete e[t];const s=m.buildQueryString(e);return(""===m.route.prefix?this.forum.attribute("basePath"):"")+n+(s?"?"+s:"")}}flarum.reg.add("core","common/Application",L)},5710:(t,e,r)=>{"use strict";r.d(e,{A:()=>s});var n=r(8805);class s{constructor(){(0,n.A)(this,"element",void 0),(0,n.A)(this,"attrs",void 0),(0,n.A)(this,"state",void 0)}oninit(t){this.setAttrs(t.attrs)}oncreate(t){this.element=t.dom}onbeforeupdate(t){this.setAttrs(t.attrs)}onupdate(t){}onbeforeremove(t){}onremove(t){}$(t){const e=$(this.element);return t?e.find(t):e}static component(t,e){void 0===t&&(t={}),void 0===e&&(e=null);const r={...t};return m(this,r,e)}setAttrs(t){if(void 0===t&&(t={}),this.constructor.initAttrs(t),t){if("children"in t)throw new Error(`[${this.constructor.name}] The "children" attribute of attrs should never be used. Either pass children in as the vnode children or rename the attribute`);if("tag"in t)throw new Error(`[${this.constructor.name}] You cannot use the "tag" attribute name with Mithril 2.`)}this.attrs=t}static initAttrs(t){}}flarum.reg.add("core","common/Component",s)},5420:(t,e,r)=>{"use strict";r.d(e,{A:()=>o});var n=r(8805),s=r(5114);class o{constructor(t,e){void 0===t&&(t={}),void 0===e&&(e=s.A.store),(0,n.A)(this,"data",{}),(0,n.A)(this,"freshness",new Date),(0,n.A)(this,"exists",!1),(0,n.A)(this,"store",void 0),this.data=t,this.store=e}id(){return"id"in this.data?this.data.id:void 0}attribute(t){return this.data?.attributes?.[t]}pushData(t){if("id"in t&&(this.data.id=t.id),"type"in t&&(this.data.type=t.type),"attributes"in t){this.data.attributes||={};for(const e in t.attributes){const r=t.attributes[e];r&&r instanceof o&&delete t.attributes[e]}Object.assign(this.data.attributes,t.attributes)}if("relationships"in t){const e=this.data.relationships??{};for(const r in t.relationships){const n=t.relationships[r];if(null===n){delete e[r],delete t.relationships[r];continue}let s;s=n instanceof o?{data:o.getIdentifier(n)}:n instanceof Array?{data:n.map(o.getIdentifier)}:n,t.relationships[r]=s,e[r]=s}this.data.relationships=e}return this.freshness=new Date,this}pushAttributes(t){this.pushData({attributes:t})}save(t,e){void 0===e&&(e={});const r={type:this.data.type,attributes:t};if("id"in this.data&&(r.id=this.data.id),t.relationships){r.relationships={};for(const e in t.relationships){const n=t.relationships[e];null!==n&&(r.relationships[e]={data:n instanceof Array?n.map(o.getIdentifier):o.getIdentifier(n)})}delete t.relationships}const n=this.copyData();this.pushData(r);const i={data:r,meta:e.meta||void 0};return s.A.request({method:this.exists?"PATCH":"POST",url:s.A.forum.attribute("apiUrl")+this.apiEndpoint(),body:i,...e}).then((t=>this.store.pushPayload(t)),(t=>{throw this.pushData(n),m.redraw(),t}))}delete(t,e){return void 0===t&&(t={}),void 0===e&&(e={}),this.exists?s.A.request({method:"DELETE",url:s.A.forum.attribute("apiUrl")+this.apiEndpoint(),body:t,...e}).then((()=>{this.exists=!1,this.store.remove(this)})):Promise.resolve()}apiEndpoint(){return"/"+this.data.type+("id"in this.data?"/"+this.data.id:"")}copyData(){return JSON.parse(JSON.stringify(this.data))}rawRelationship(t){return this.data.relationships?.[t]?.data}static attribute(t,e){return function(){return e?e(this.attribute(t)):this.attribute(t)}}static hasOne(t){return function(){const e=this.data.relationships?.[t]?.data;if(e&&e instanceof Array)throw new Error(`Relationship ${t} on model ${this.data.type} is plural, so the hasOne method cannot be used to access it.`);return!!e&&this.store.getById(e.type,e.id)}}static hasMany(t){return function(){const e=this.data.relationships?.[t]?.data;if(e&&!(e instanceof Array))throw new Error(`Relationship ${t} on model ${this.data.type} is singular, so the hasMany method cannot be used to access it.`);return!!e&&e.map((t=>this.store.getById(t.type,t.id)))}}static transformDate(t){return null!=t?new Date(t):t}static getIdentifier(t){return t&&t.data&&"id"in t.data?{type:t.data.type,id:t.data.id}:null}}flarum.reg.add("core","common/Model",o)},3920:(t,e,r)=>{"use strict";r.d(e,{A:()=>p});var n=r(8805),s=r(5114),o=r(8631);class i extends o.px{key(){return s.A.translator.trans("core.lib.gambits.discussions.author.key",{},!0)}hint(){return s.A.translator.trans("core.lib.gambits.discussions.author.hint",{},!0)}filterKey(){return"author"}}flarum.reg.add("core","common/query/discussions/AuthorGambit",i);class a extends o.px{key(){return s.A.translator.trans("core.lib.gambits.discussions.created.key",{},!0)}hint(){return s.A.translator.trans("core.lib.gambits.discussions.created.hint",{},!0)}valuePattern(){return"(\\d{4}\\-\\d\\d\\-\\d\\d(?:\\.\\.(\\d{4}\\-\\d\\d\\-\\d\\d))?)"}filterKey(){return"created"}}flarum.reg.add("core","common/query/discussions/CreatedGambit",a);class l extends o.pm{key(){return s.A.translator.trans("core.lib.gambits.discussions.hidden.key",{},!0)}filterKey(){return"hidden"}enabled(){return!!s.A.session.user}}flarum.reg.add("core","common/query/discussions/HiddenGambit",l);class c extends o.pm{key(){return s.A.translator.trans("core.lib.gambits.discussions.unread.key",{},!0)}filterKey(){return"unread"}enabled(){return!!s.A.session.user}}flarum.reg.add("core","common/query/discussions/UnreadGambit",c);class u extends o.px{key(){return s.A.translator.trans("core.lib.gambits.users.email.key",{},!0)}hint(){return s.A.translator.trans("core.lib.gambits.users.email.hint",{},!0)}filterKey(){return"email"}enabled(){return!(!s.A.session.user||!s.A.forum.attribute("canEditUserCredentials"))}}flarum.reg.add("core","common/query/users/EmailGambit",u);class d extends o.px{key(){return s.A.translator.trans("core.lib.gambits.users.group.key",{},!0)}hint(){return s.A.translator.trans("core.lib.gambits.users.group.hint",{},!0)}filterKey(){return"group"}}flarum.reg.add("core","common/query/users/GroupGambit",d);class h extends o.px{key(){return s.A.translator.trans("core.lib.gambits.posts.discussion.key",{},!0)}hint(){return s.A.translator.trans("core.lib.gambits.posts.discussion.hint",{},!0)}filterKey(){return"discussion"}}flarum.reg.add("core","common/query/discussions/DiscussionGambit",h);class m{constructor(){(0,n.A)(this,"gambits",{discussions:[i,a,l,c],posts:[i,h],users:[u,d]})}apply(t,e){return e.q=this.match(t,e.q,((t,r,n)=>{const s=t.toFilter(r,n);Object.keys(s).forEach((r=>{r in e&&t.predicates&&Array.isArray(s[r])?e[r]=e[r].concat(s[r]):e[r]=s[r]}))})),e}match(t,e,r){const n=this.for(t).filter((t=>t.enabled()));if(0===n.length)return e;const s=e.split(" ");for(const t of n)for(const n of s){const s=new RegExp(`^(-?)${t.pattern()}$`,"i");let o=n.match(s);if(o){const s="-"===o[1];o.splice(1,1),r(t,o,s,n),e=e.replace(n,"")}}return e.trim().replace(/\s+/g," ")}from(t,e,r){const n=this.for(t);return 0===n.length||Object.keys(r).forEach((t=>{for(const s of n){const n="-"===t[0];n&&(t=t.substring(1)),s.filterKey()===t&&(e+=` ${s.fromFilter(r[t],n)}`)}})),e}for(t){return(this.gambits[t]||[]).map((t=>new t))}}flarum.reg.add("core","common/GambitManager",m);class p{constructor(t){(0,n.A)(this,"state",void 0),(0,n.A)(this,"gambits",new m),this.state=t}}(0,n.A)(p,"MIN_SEARCH_LEN",3),flarum.reg.add("core","common/SearchManager",p)},3957:(t,e,r)=>{"use strict";r.d(e,{A:()=>o});var n=r(8805),s=r(5114);class o{constructor(t,e){(0,n.A)(this,"user",void 0),(0,n.A)(this,"csrfToken",void 0),this.user=t,this.csrfToken=e}login(t,e){return void 0===e&&(e={}),s.A.request({method:"POST",url:`${s.A.forum.attribute("baseUrl")}/login`,body:t,...e})}logout(){window.location.href=`${s.A.forum.attribute("baseUrl")}/logout?token=${this.csrfToken}`}}flarum.reg.add("core","common/Session",o)},3984:(t,e,r)=>{"use strict";r.d(e,{A:()=>i,J:()=>o});var n=r(8805),s=r(5114);function o(t){return Array.isArray(t.data)}class i{constructor(t){(0,n.A)(this,"data",{}),(0,n.A)(this,"models",void 0),this.models=t}pushPayload(t){t.included&&t.included.map(this.pushObject.bind(this));const e=t.data instanceof Array?t.data.map((t=>this.pushObject(t))):this.pushObject(t.data);return e.payload=t,e}pushObject(t){if(!this.models[t.type])return setTimeout((()=>{throw new Error(`Pushing object of type \`${t.type}\` not allowed, as type not yet registered in the store.`)})),null;const e=this.data[t.type]=this.data[t.type]||{},r=e[t.id],n=r?r.pushData(t):this.createRecord(t.type,t);return e[t.id]=n,n.exists=!0,n}async find(t,e,r,n){void 0===r&&(r={}),void 0===n&&(n={});let i=r,a=s.A.forum.attribute("apiUrl")+"/"+t;return e instanceof Array?a+="?filter[id]="+e.join(","):"object"==typeof e?i=e:e&&(a+="/"+e),"filter"in i&&i?.filter?.q&&(i.filter=s.A.search.gambits.apply(t,i.filter)),s.A.request({method:"GET",url:a,params:i,...n}).then((t=>(o(t),this.pushPayload(t))))}getById(t,e){return this.data?.[t]?.[e]}getBy(t,e,r){return this.all(t).filter((t=>t[e]()===r))[0]}all(t){const e=this.data[t];return e?Object.values(e):[]}remove(t){delete this.data[t.data.type][t.id()]}createRecord(t,e){return void 0===e&&(e={}),e.type=e.type||t,new this.models[t](e,this)}}flarum.reg.add("core","common/Store",i)},7141:(t,e,r)=>{"use strict";r.d(e,{A:()=>c});var n=r(8805),s=r(8687),o=r(4856),i=r(6445),a=r(4586),l=r(117);class c{constructor(){(0,n.A)(this,"translations",{}),(0,n.A)(this,"formatter",new s.A5(null,this.formatterTypeHandlers(),s.S))}setLocale(t){this.formatter.locale=t}getLocale(){return this.formatter.locale}addTranslations(t){Object.assign(this.translations,t)}formatterTypeHandlers(){return{plural:o.fL,select:o.Jb}}preprocessParameters(t){if("user"in t){const e=(0,a.A)(t,"user");t.username||(t.username=(0,i.A)(e))}return t}trans(t,e,r){void 0===e&&(e={}),void 0===r&&(r=!1);const n=this.translations[t];if(n){e=this.preprocessParameters(e);const t=this.formatter.rich(n,e);return r?(0,l.A)(t):t}return t}}flarum.reg.add("core","common/Translator",c)},5114:(t,e,r)=>{"use strict";r.d(e,{A:()=>o});const n=window,s=new Proxy({},{get:(t,e)=>Reflect.get(n.app,e,n.app),set:(t,e,r)=>Reflect.set(n.app,e,r,n.app)}),o=s;flarum.reg.add("core","common/app",s)},9924:(t,e,r)=>{"use strict";r.d(e,{A:()=>u});var n=r(5710),s=r(7880),o=r(5673),i=r(4586),a=r(4268),l=r(5114),c=r(7479);class u extends n.A{view(t){const e=Object.assign({},this.attrs),r=(0,i.A)(e,"type");e.className=(0,a.A)("Alert",`Alert--${r}`,e.className);const n=(0,i.A)(e,"title"),u=(0,i.A)(e,"icon"),d=(0,i.A)(e,"content")||t.children,h=(0,i.A)(e,"controls")||[],p=(0,i.A)(e,"dismissible"),f=(0,i.A)(e,"ondismiss"),g=[];return(p||void 0===p)&&g.push(m(s.A,{"aria-label":l.A.translator.trans("core.lib.alert.dismiss_a11y_label"),icon:"fas fa-times",className:"Button Button--link Button--icon Alert-dismiss",onclick:f})),m("div",e,m("div",{className:(0,a.A)("Alert-container",e.containerClassName)},!!n&&m("div",{className:"Alert-title"},!!u&&m("span",{className:"Alert-title-icon"},m(c.A,{name:u})),m("span",{className:"Alert-title-text"},n)),m("span",{className:"Alert-body"},d),m("ul",{className:"Alert-controls"},(0,o.A)(h.concat(g)))))}}flarum.reg.add("core","common/components/Alert",u)},4519:(t,e,r)=>{"use strict";r.d(e,{A:()=>s});var n=r(5710);class s extends n.A{oninit(t){super.oninit(t),this.state=this.attrs.state}view(){const t=this.state.getActiveAlerts();return m("div",{className:"AlertManager"},Object.keys(t).map(Number).map((e=>{const r=t[e],n="error"===r.attrs.type;return m("div",{className:"AlertManager-alert",role:"alert","aria-live":n?"assertive":"polite"},m(r.componentClass,Object.assign({},r.attrs,{ondismiss:this.state.dismiss.bind(this.state,e)}),r.children))})))}}flarum.reg.add("core","common/components/AlertManager",s)},7891:(t,e,r)=>{"use strict";r.d(e,{A:()=>o});var n=r(4268),s=r(5710);class o extends s.A{view(t){const{user:e,...r}=t.attrs;r.className=(0,n.A)("Avatar",r.className),r.loading??="lazy";let s="";const o="undefined"===r.title||r.title;if(o||delete r.title,e){const t=e.displayName()||"?",n=e.avatarUrl();if(o&&(r.title=r.title||t),n)return m("img",Object.assign({},r,{src:n,alt:""}));s=t.charAt(0).toUpperCase(),r.style=!window.testing&&{"--avatar-bg":e.color()}}return m("span",r,s)}}flarum.reg.add("core","common/components/Avatar",o)},367:(t,e,r)=>{"use strict";r.d(e,{A:()=>l});var n=r(4391),s=r(5710),o=r(4268),i=r(3288),a=r(7479);class l extends s.A{view(){const{type:t,icon:e,label:r,color:s,style:l={},...c}=this.attrs,u=(0,o.A)("Badge",[t&&`Badge--${t}`],c.className,(0,i.A)(s)),d=e?m(a.A,{name:e,className:"Badge-icon"}):m.trust(" "),h={...l};window.testing||(h["--badge-bg"]=s);const p={...c,className:u,style:h},f=m("div",p,d);return r?m(n.A,{text:r},f):f}}flarum.reg.add("core","common/components/Badge",l)},7880:(t,e,r)=>{"use strict";r.d(e,{A:()=>u});var n=r(5710),s=r(5114);function o(){s.A.forum.attribute("debug")&&console.warn(...arguments)}flarum.reg.add("core","common/helpers/fireDebugWarning",o);var i=r(4268),a=r(117),l=r(43),c=r(7479);class u extends n.A{view(t){let{type:e,"aria-label":r,icon:n,disabled:s,loading:o,className:l,class:c,...u}=this.attrs;e||="button","object"==typeof r&&(r=(0,a.A)(r)),(s||o)&&delete u.onclick,l=(0,i.A)(c,l,{hasIcon:n,disabled:s||o,loading:o});const d={disabled:s,className:l,type:e,"aria-label":r,...u};return m("button",d,this.getButtonContent(t.children))}oncreate(t){super.oncreate(t);const{"aria-label":e}=this.attrs;this.view!==u.prototype.view||e||(0,a.A)(t.children)||this.element?.getAttribute?.("aria-label")||o('[Flarum Accessibility Warning] Button has no content and no accessible label. This means that screen-readers will not be able to interpret its meaning and just read "Button". Consider providing accessible text via the `aria-label` attribute. https://web.dev/button-name',this.element)}getButtonContent(t){const e=this.attrs.icon;return[e&&m(c.A,{name:e,className:"Button-icon"}),t&&m("span",{className:"Button-label"},t),this.attrs.loading&&m(l.A,{size:"small",display:"inline"})]}}flarum.reg.add("core","common/components/Button",u)},5215:(t,e,r)=>{"use strict";r.d(e,{A:()=>l});var n=r(5710),s=r(43),o=r(4268),i=r(9024),a=r(7479);class l extends n.A{view(t){const e=(0,o.A)(["Checkbox",this.attrs.state?"on":"off",this.attrs.className,this.attrs.loading&&"loading",this.attrs.disabled&&"disabled"]);return m("label",{className:e},m("input",{type:"checkbox",checked:this.attrs.state,disabled:this.attrs.disabled,onchange:(0,i.A)("checked",this.onchange.bind(this))}),m("div",{className:"Checkbox-display","aria-hidden":"true"},this.getDisplay()),t.children)}getDisplay(){return this.attrs.loading?m(s.A,{display:"unset",size:"small"}):m(a.A,{name:this.attrs.state?"fas fa-check":"fas fa-times"})}onchange(t){this.attrs.onchange&&this.attrs.onchange(t,this)}}flarum.reg.add("core","common/components/Checkbox",l)},4511:(t,e,r)=>{"use strict";r.d(e,{A:()=>u});var n=r(8805),s=r(5114),o=r(5710),i=r(5673),a=r(117),l=r(4391),c=r(7479);class u extends o.A{constructor(){super(...arguments),(0,n.A)(this,"showing",!1)}static initAttrs(t){t.className||="",t.buttonClassName||="",t.menuClassName||="",t.label||="",t.caretIcon??="fas fa-caret-down",t.accessibleToggleLabel||=(0,a.A)(s.A.translator.trans("core.lib.dropdown.toggle_dropdown_accessible_label"))}view(t){const e=t.children?(0,i.A)(t.children):[],r=!this.attrs.lazyDraw||this.showing;return m("div",{className:"ButtonGroup Dropdown dropdown "+this.attrs.className+" itemCount"+e.length+(this.showing?" open":"")},this.getButton(t.children),r&&this.getMenu(e))}oncreate(t){super.oncreate(t),this.$().on("shown.bs.dropdown",(()=>{const{lazyDraw:t,onshow:e}=this.attrs;this.showing=!0,t&&m.redraw.sync(),"function"==typeof e&&e(),t||m.redraw();const r=this.$(".Dropdown-menu"),n=r.hasClass("Dropdown-menu--right"),s=r.offset()?.top??0,o=r.height()??0,i=$(window).scrollTop()??0,a=$(window).height()??0;r.removeClass("Dropdown-menu--top Dropdown-menu--right"),r.toggleClass("Dropdown-menu--top",s+o>i+a),(r.offset()?.top||0)<0&&r.removeClass("Dropdown-menu--top");const l=r.offset()?.left??0,c=r.width()??0,u=$(window).scrollLeft()??0,d=$(window).width()??0;r.toggleClass("Dropdown-menu--right",n||l+c>u+d)})),this.$().on("hidden.bs.dropdown",(()=>{this.showing=!1,this.attrs.onhide&&this.attrs.onhide(),m.redraw()}))}getButton(t){let e=m("button",Object.assign({className:"Dropdown-toggle "+this.attrs.buttonClassName,"aria-haspopup":"menu","aria-label":this.attrs.accessibleToggleLabel,"data-toggle":"dropdown",onclick:this.attrs.onclick},this.attrs.buttonAttrs),this.getButtonContent(t));return this.attrs.tooltip&&(e=m(l.A,{text:this.attrs.tooltip,position:"bottom"},e)),e}getButtonContent(t){return[this.attrs.icon?m(c.A,{name:this.attrs.icon,className:"Button-icon"}):"",m("span",{className:"Button-label"},this.attrs.label),this.attrs.caretIcon?m(c.A,{name:this.attrs.caretIcon,className:"Button-caret"}):""]}getMenu(t){return m("ul",{className:"Dropdown-menu dropdown-menu "+this.attrs.menuClassName},t)}}flarum.reg.add("core","common/components/Dropdown",u)},592:(t,e,r)=>{"use strict";r.d(e,{A:()=>o});var n=r(5710),s=r(4268);class o extends n.A{view(t){return m("div",{className:(0,s.A)("FieldSet",this.attrs.className),role:"group","aria-label":this.attrs.label,"aria-disabled":!1},m("label",{className:"FieldSet-label","aria-hidden":"true"},this.attrs.label),this.attrs.description?m("div",{className:"FieldSet-description helpText"},this.attrs.description):null,m("div",{className:"FieldSet-items"},t.children))}}flarum.reg.add("core","common/components/FieldSet",o)},374:(t,e,r)=>{"use strict";r.d(e,{A:()=>o});var n=r(5710),s=r(4268);class o extends n.A{view(t){const{label:e,description:r,className:n,...o}=t.attrs;return m("div",Object.assign({className:(0,s.A)("Form",n)},o),(e||r)&&m("div",{className:"Form-header"},e&&m("label",null,e),r&&m("p",{className:"helpText"},r)),m("div",{className:"Form-body"},t.children))}}flarum.reg.add("core","common/components/Form",o)},2855:(t,e,r)=>{"use strict";r.d(e,{A:()=>s});var n=r(2849);class s extends n.A{wrapper(t){return m("form",{onsubmit:this.onsubmit.bind(this)},t)}onsubmit(t){}onready(){this.$().find("input, select, textarea").first().trigger("focus").trigger("select")}onerror(t){this.alertAttrs=t.alert,m.redraw(),422===t.status&&t.response?.errors?this.$("form [name="+t.response.errors[0].source.pointer.replace("/data/attributes/","")+"]").trigger("select"):this.onready()}}flarum.reg.add("core","common/components/FormModal",s)},3550:(t,e,r)=>{"use strict";r.d(e,{A:()=>s});var n=r(367);class s extends n.A{static initAttrs(t){super.initAttrs(t),t.group&&(t.icon=t.group.icon()||"",t.color=t.group.color()||"",t.label=void 0===t.label?t.group.nameSingular():t.label,t.type="group--"+t.group.id(),delete t.group)}}flarum.reg.add("core","common/components/GroupBadge",s)},7479:(t,e,r)=>{"use strict";r.d(e,{A:()=>o});var n=r(4268),s=r(5710);class o extends s.A{view(t){const{name:e,...r}=t.attrs;return r.className=(0,n.A)("icon",e,r.className),m("i",Object.assign({"aria-hidden":"true"},r))}}flarum.reg.add("core","common/components/Icon",o)},4164:(t,e,r)=>{"use strict";r.d(e,{A:()=>i});var n=r(5710),s=r(7479),o=r(4268);class i extends n.A{view(t){const{icon:e,className:r,...n}=t.attrs;return m("div",Object.assign({className:(0,o.A)("InfoTile",r)},n),this.icon(),m("div",{className:"InfoTile-text"},t.children))}icon(){return this.attrs.iconElement?this.attrs.iconElement:this.attrs.icon?m(s.A,{name:(0,o.A)(this.attrs.icon,"InfoTile-icon")}):null}}flarum.reg.add("core","common/components/InfoTile",i)},7882:(t,e,r)=>{"use strict";r.d(e,{A:()=>c});var n=r(5114),s=r(5710),o=r(7479),i=r(43),a=r(4268),l=r(7880);class c extends s.A{oninit(t){super.oninit(t)}view(t){const{className:e,...r}=this.attrs.inputAttrs||{},s=this.attrs.value||this.attrs.stream?.()||"";return m("div",{className:(0,a.A)("Input",this.attrs.className,{"Input--withPrefix":this.attrs.prefixIcon,"Input--withClear":this.attrs.clearable})},this.attrs.prefixIcon&&m(o.A,{name:(0,a.A)(this.attrs.prefixIcon,"Input-prefix-icon")}),this.input({inputClassName:e,value:s,inputAttrs:r}),this.attrs.loading&&m(i.A,{size:"small",display:"inline",containerClassName:"Button Button--icon Button--link"}),this.attrs.clearable&&s&&!this.attrs.loading&&m(l.A,{className:"Input-clear Button Button--icon Button--link",onclick:this.clear.bind(this),"aria-label":this.attrs.clearLabel||n.A.translator.trans("core.lib.input.clear_button"),type:"button",icon:"fas fa-times-circle"}))}input(t){let{inputClassName:e,value:r,inputAttrs:n}=t;const s={className:(0,a.A)("FormControl",e),type:this.attrs.type||"text",value:r,oninput:t=>this.onchange?.(t.target.value),"aria-label":this.attrs.ariaLabel,placeholder:this.attrs.placeholder,readonly:this.attrs.readonly||void 0,disabled:this.attrs.disabled||void 0,...n};return this.attrs.renderInput?this.attrs.renderInput(s):m("input",s)}onchange(t){this.attrs.stream?this.attrs.stream(t):this.attrs.onchange?.(t)}clear(){this.onchange("")}}flarum.reg.add("core","common/components/Input",c)},43:(t,e,r)=>{"use strict";r.d(e,{A:()=>i});var n=r(5114),s=r(5710),o=r(4268);class i extends s.A{view(){const{display:t="block",size:e="medium",containerClassName:r,className:s,...i}=this.attrs,a=(0,o.A)("LoadingIndicator",s),l=(0,o.A)("LoadingIndicator-container","unset"!==t&&`LoadingIndicator-container--${t}`,e&&`LoadingIndicator-container--${e}`,r);return m("div",Object.assign({"aria-label":n.A.translator.trans("core.lib.loading_indicator.accessible_label"),role:"status"},i.containerAttrs,{"data-size":e,className:l}),m("div",Object.assign({"aria-hidden":"true",className:a},i)))}}flarum.reg.add("core","common/components/LoadingIndicator",i)},2849:(t,e,r)=>{"use strict";r.d(e,{A:()=>c});var n=r(8805),s=r(5114),o=r(5710),i=r(9924),a=r(7880),l=r(4268);class c extends o.A{constructor(){super(...arguments),(0,n.A)(this,"loading",!1),(0,n.A)(this,"alertAttrs",null)}static get dismissibleOptions(){return{viaCloseButton:this.isDismissibleViaCloseButton,viaEscKey:this.isDismissibleViaEscKey,viaBackdropClick:this.isDismissibleViaBackdropClick}}oncreate(t){super.oncreate(t),this.attrs.animateShow((()=>this.onready()))}onbeforeremove(t){if(super.onbeforeremove(t),!this.attrs.state.modal)return new Promise((t=>setTimeout(t,300)))}view(){return this.alertAttrs&&(this.alertAttrs.dismissible=!1),m("div",{className:(0,l.A)("Modal modal-dialog fade",this.className())},m("div",{className:"Modal-content"},this.dismissibleOptions.viaCloseButton&&m("div",{className:"Modal-close App-backControl"},m(a.A,{icon:"fas fa-times",onclick:()=>this.hide(),className:"Button Button--icon Button--link","aria-label":s.A.translator.trans("core.lib.modal.close")})),this.wrapper(this.inner())))}wrapper(t){return m("[",null,t)}inner(){return m("[",null,m("div",{className:"Modal-header"},m("h3",{className:"App-titleControl App-titleControl--text"},this.title())),!!this.alertAttrs&&m("div",{className:"Modal-alert"},m(i.A,this.alertAttrs)),this.content())}onready(){}hide(){this.attrs.animateHide()}loaded(){this.loading=!1,m.redraw()}get dismissibleOptions(){return this.constructor.dismissibleOptions}}(0,n.A)(c,"isDismissibleViaCloseButton",!0),(0,n.A)(c,"isDismissibleViaEscKey",!0),(0,n.A)(c,"isDismissibleViaBackdropClick",!0),flarum.reg.add("core","common/components/Modal",c)},1344:(t,e,r)=>{"use strict";r.d(e,{A:()=>l});var n=r(8805),s=r(5710),o=r(8720),i=r(4945),a=r(43);class l extends s.A{constructor(){super(...arguments),(0,n.A)(this,"focusTrap",void 0),(0,n.A)(this,"lastSetFocusTrap",void 0),(0,n.A)(this,"modalClosing",!1),(0,n.A)(this,"keyUpListener",null)}view(t){return m("[",null,this.attrs.state.modalList.map(((t,e)=>{const r=t?.componentClass;return m("div",{key:t.key,className:"ModalManager modal","data-modal-key":t.key,"data-modal-number":e,role:"dialog","aria-modal":"true",style:!window.testing&&{"--modal-number":e},"aria-hidden":this.attrs.state.modal!==t&&"true"},!!r&&[m(r,Object.assign({key:t.key},t.attrs,{animateShow:this.animateShow.bind(this),animateHide:this.animateHide.bind(this),state:this.attrs.state})),m("div",{key:t.key,className:"ModalManager-invisibleBackdrop",onclick:this.handlePossibleBackdropClick.bind(this)})])})),(this.attrs.state.backdropShown||this.attrs.state.loadingModal)&&m("div",{className:"Modal-backdrop backdrop",ontransitionend:this.onBackdropTransitionEnd.bind(this),"data-showing":!!this.attrs.state.modalList.length||this.attrs.state.loadingModal,style:!window.testing&&{"--modal-count":this.attrs.state.modalList.length+Number(this.attrs.state.loadingModal)}},this.attrs.state.loadingModal&&m(a.A,null)))}oncreate(t){super.oncreate(t),this.keyUpListener=this.handleEscPress.bind(this),document.body.addEventListener("keyup",this.keyUpListener)}onbeforeremove(t){super.onbeforeremove(t),this.keyUpListener&&document.body.removeEventListener("keyup",this.keyUpListener),this.keyUpListener=null}onupdate(t){super.onupdate(t),requestAnimationFrame((()=>{try{if(!this.attrs.state.isModalOpen())return document.getElementById("app")?.removeAttribute("aria-hidden"),this.focusTrap.deactivate?.(),void(0,i.qY)();document.getElementById("app")?.setAttribute("aria-hidden","true");const t=this.attrs.state.modal.key;this.focusTrap&&this.lastSetFocusTrap!==t&&(this.focusTrap.deactivate?.(),(0,i.qY)()),this.activeDialogElement&&this.lastSetFocusTrap!==t&&(this.focusTrap=(0,o.K)(this.activeDialogElement,{allowOutsideClick:!0}),this.focusTrap.activate?.(),this.activeDialogManagerElement&&(0,i.mh)(this.activeDialogManagerElement,{reserveScrollBarGap:!0})),this.lastSetFocusTrap=t}catch{}}))}get activeDialogElement(){return document.body.querySelector(`.ModalManager[data-modal-key="${this.attrs.state.modal?.key}"] .Modal`)}get activeDialogManagerElement(){return document.body.querySelector(`.ModalManager[data-modal-key="${this.attrs.state.modal?.key}"]`)}animateShow(t){void 0===t&&(t=()=>{}),this.attrs.state.modal&&(this.activeDialogElement?.addEventListener("transitionend",(()=>{t()}),{once:!0}),requestAnimationFrame((()=>{this.activeDialogElement?.classList.add("in")})))}animateHide(t){void 0===t&&(t=()=>{}),this.modalClosing||(this.modalClosing=!0,this.activeDialogElement?.addEventListener("transitionend",(()=>{this.modalClosing=!1,this.attrs.state.close(),t()}),{once:!0}),this.activeDialogElement?.classList.remove("in"),this.activeDialogElement?.classList.add("out"))}handleEscPress(t){if(!this.attrs.state.modal)return;const e=this.attrs.state.modal.componentClass.dismissibleOptions;"Escape"===t.key&&e.viaEscKey&&(t.preventDefault(),this.animateHide())}handlePossibleBackdropClick(t){this.attrs.state.modal&&this.attrs.state.modal.componentClass.dismissibleOptions.viaBackdropClick&&this.animateHide()}onBackdropTransitionEnd(t){"opacity"===t.propertyName&&null===t.currentTarget.getAttribute("data-showing")&&(this.attrs.state.backdropShown=!1,m.redraw())}}flarum.reg.add("core","common/components/ModalManager",l)},2162:(t,e,r)=>{"use strict";r.d(e,{A:()=>l});var n=r(5114),s=r(5710),o=r(7880),i=r(6909),a=r(4268);class l extends s.A{view(){const{history:t,pane:e}=n.A;return m("div",{className:(0,a.A)("Navigation ButtonGroup",this.attrs.className),onmouseenter:e&&e.show.bind(e),onmouseleave:e&&e.onmouseleave.bind(e)},t?.canGoBack()?[this.getBackButton(),this.getPaneButton()]:this.getDrawerButton())}getBackButton(){const{history:t}=n.A,e=t?.getPrevious();return m(i.A,{className:"Button Navigation-back Button--icon",href:t?.backUrl(),icon:"fas fa-chevron-left","aria-label":e?.title,onclick:e=>{e.shiftKey||e.ctrlKey||e.metaKey||2===e.which||(e.preventDefault(),t?.back())}})}getPaneButton(){const{pane:t}=n.A;return t&&t.active?m(o.A,{className:(0,a.A)("Button Button--icon Navigation-pin",{active:t.pinned}),onclick:t.togglePinned.bind(t),icon:"fas fa-thumbtack"}):null}getDrawerButton(){if(!this.attrs.drawer)return null;const{drawer:t}=n.A,e=n.A.session.user;return m(o.A,{className:(0,a.A)("Button Button--icon Navigation-drawer",{new:e?.newNotificationCount()}),onclick:e=>{e.stopPropagation(),t.show()},icon:"fas fa-bars","aria-label":n.A.translator.trans("core.lib.nav.drawer_button")})}}flarum.reg.add("core","common/components/Navigation",l)},9377:(t,e,r)=>{"use strict";r.d(e,{A:()=>a});var n=r(8805),s=r(5114),o=r(5710),i=r(4944);class a extends o.A{constructor(){super(...arguments),(0,n.A)(this,"bodyClass",""),(0,n.A)(this,"scrollTopOnCreate",!0),(0,n.A)(this,"useBrowserScrollRestoration",!0)}oninit(t){super.oninit(t),s.A.previous=s.A.current,s.A.current=new i.A(this.constructor,{routeName:this.attrs.routeName}),s.A.drawer.hide(),s.A.modal.close()}oncreate(t){super.oncreate(t),this.bodyClass&&$("#app").addClass(this.bodyClass),this.scrollTopOnCreate&&$(window).scrollTop(0),"scrollRestoration"in history&&(history.scrollRestoration=this.useBrowserScrollRestoration?"auto":"manual")}onremove(t){super.onremove(t),this.bodyClass&&$("#app").removeClass(this.bodyClass)}}flarum.reg.add("core","common/components/Page",a)},7088:(t,e,r)=>{"use strict";r.d(e,{A:()=>s});var n=r(2849);class s extends n.A{className(){return"RequestErrorModal Modal--large"}title(){return!!this.attrs.error.xhr&&`${this.attrs.error.xhr.status} ${this.attrs.error.xhr.statusText}`}content(){const{error:t,formattedError:e}=this.attrs;let r;return r=e.length?e.join("\n\n"):t.response?JSON.stringify(t.response,null,2):t.responseText,r?.includes("