diff --git a/framework/core/js/dist-typings/admin/components/AdminPage.d.ts b/framework/core/js/dist-typings/admin/components/AdminPage.d.ts index 0d21f6ca06..7ede89eef8 100644 --- a/framework/core/js/dist-typings/admin/components/AdminPage.d.ts +++ b/framework/core/js/dist-typings/admin/components/AdminPage.d.ts @@ -93,6 +93,10 @@ export default abstract class AdminPage{var t,e,n={1207:(t,e,n)=>{"use strict";n.d(e,{J:()=>B,Z:()=>R});var r=n(7905),s=n(7465),o=n(4041),a=n(8312),i=n(7224),l=n(8588),c=n(406),u=n(4153);function d(t){return Array.isArray(t.data)}class h{constructor(t){(0,r.Z)(this,"data",{}),(0,r.Z)(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 `".concat(t.type,"` not allowed, as type not yet registered in the store."))})),null;const e=this.data[t.type]=this.data[t.type]||{},n=e[t.id],r=n?n.pushData(t):this.createRecord(t.type,t);return e[t.id]=r,r.exists=!0,r}async find(t,e,n,r){var o,a;void 0===n&&(n={}),void 0===r&&(r={});let i=n,l=s.Z.forum.attribute("apiUrl")+"/"+t;return e instanceof Array?l+="?filter[id]="+e.join(","):"object"==typeof e?i=e:e&&(l+="/"+e),"filter"in i&&null!=(o=i)&&null!=(a=o.filter)&&a.q&&(i.filter=s.Z.search.gambits.apply(t,i.filter)),s.Z.request({method:"GET",url:l,params:i,...r}).then((t=>(d(t),this.pushPayload(t))))}getById(t,e){var n,r;return null==(n=this.data)||null==(r=n[t])?void 0:r[e]}getBy(t,e,n){return this.all(t).filter((t=>t[e]()===n))[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",h);class p{constructor(t,e){(0,r.Z)(this,"user",void 0),(0,r.Z)(this,"csrfToken",void 0),this.user=t,this.csrfToken=e}login(t,e){return void 0===e&&(e={}),s.Z.request({method:"POST",url:"".concat(s.Z.forum.attribute("baseUrl"),"/login"),body:t,...e})}logout(){window.location.href="".concat(s.Z.forum.attribute("baseUrl"),"/logout?token=").concat(this.csrfToken)}}flarum.reg.add("core","common/Session",p);var f=n(6786),g=n(1552),v=n(7569),b=n(4430),y=n(6386),w=n(4718),Z=n(9423);function x(){$("[data-humantime]").each((function(){const t=$(this),e=(0,Z.Z)(t.attr("datetime"));t.html(e)}))}function N(){setInterval(x,1e4)}flarum.reg.add("core","common/utils/liveHumanTimes",N);var C=n(8134),k=n(3813),_=n(7498),S=n(6322),E=n(4125),T=n(7645),A=n(5788),P=n(5104),M=n(5123),D=n(5278);function I(t,e,n){var r,o;console.group("%c".concat(e),"background-color: #d83e3e; color: #ffffff; font-weight: bold;"),console.error(n),console.groupEnd(),null!=(r=s.Z.session)&&null!=(o=r.user)&&o.isAdmin()&&s.Z.alerts.show({type:"error"},"".concat(t))}flarum.reg.add("core","common/helpers/fireApplicationError",I);var L=n(9175);class O extends L.Z{token(){return L.Z.attribute("token").call(this)}userId(){return L.Z.attribute("userId").call(this)}title(){return L.Z.attribute("title").call(this)}type(){return L.Z.attribute("type").call(this)}createdAt(){return L.Z.attribute("createdAt",L.Z.transformDate).call(this)}lastActivityAt(){return L.Z.attribute("lastActivityAt",L.Z.transformDate).call(this)}lastIpAddress(){return L.Z.attribute("lastIpAddress").call(this)}device(){return L.Z.attribute("device").call(this)}isCurrent(){return L.Z.attribute("isCurrent").call(this)}isSessionToken(){return L.Z.attribute("isSessionToken").call(this)}}flarum.reg.add("core","common/models/AccessToken",O);var j=n(8394);let B=function(t){return t.NO_MAINTENANCE="none",t.HIGH_MAINTENANCE="high",t.LOW_MAINTENANCE="low",t.SAFE_MODE="safe",t}({});class R{constructor(){(0,r.Z)(this,"forum",void 0),(0,r.Z)(this,"routes",{}),(0,r.Z)(this,"initializers",new o.Z),(0,r.Z)(this,"session",void 0),(0,r.Z)(this,"translator",new u.Z),(0,r.Z)(this,"store",new h({"access-tokens":O,forums:k.Z,users:_.Z,discussions:S.Z,posts:E.Z,groups:T.Z,notifications:A.Z})),(0,r.Z)(this,"search",void 0),(0,r.Z)(this,"cache",{}),(0,r.Z)(this,"booted",!1),(0,r.Z)(this,"current",new P.Z(null)),(0,r.Z)(this,"previous",new P.Z(null)),(0,r.Z)(this,"modal",new M.Z),(0,r.Z)(this,"alerts",new D.Z),(0,r.Z)(this,"drawer",void 0),(0,r.Z)(this,"history",null),(0,r.Z)(this,"pane",null),(0,r.Z)(this,"data",void 0),(0,r.Z)(this,"allowUserColorScheme",void 0),(0,r.Z)(this,"_title",""),(0,r.Z)(this,"_titleCount",0),(0,r.Z)(this,"requestErrorAlert",null),(0,r.Z)(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)}boot(){var t;const e=[];this.initializers.toArray().forEach((t=>{try{t(this)}catch(n){const r=t.itemName.includes("/")?t.itemName.replace(/(\/flarum-ext-)|(\/flarum-)/g,"-"):t.itemName;e.push((()=>I((0,g.Z)(s.Z.translator.trans("core.lib.error.extension_initialiation_failed_message",{extension:r})),"".concat(r," failed to initialize"),n)))}})),this.store.pushPayload({data:this.data.resources}),this.forum=this.store.getById("forums","1"),this.session=new p(null!=(t=this.store.getById("users",String(this.data.session.userId)))?t:null,this.data.session.csrfToken),this.mount(),this.initialRoute=window.location.href,e.forEach((t=>t()))}bootExtensions(t){Object.keys(t).forEach((e=>{const n=t[e];if(!n.extend)return;const r=n.extend.flat(1/0);for(const t of r)t.extend(this,{name:e,exports:n})}))}mount(t){void 0===t&&(t=""),m.mount(document.getElementById("modal"),{view:()=>m(i.Z,{state:this.modal})}),m.mount(document.getElementById("alerts"),{view:()=>m(l.Z,{state:this.alerts})}),this.drawer=new v.Z,m.route(document.getElementById("content"),t+"/",(0,b.Z)(this.routes,t));const e=document.getElementById("app"),n=document.querySelector(".App-header"),r=new w.Z((t=>{const r=e.getBoundingClientRect().top+document.body.scrollTop;e.classList.toggle("affix",t>=r),e.classList.toggle("scrolled",t>r),n.classList.toggle("navbar-fixed-top",t>=r)}));r.start(),r.update(),document.body.classList.add("ontouchstart"in window?"touch":"no-touch"),this.initColorScheme(),N()}initColorScheme(t){var e,n,r;void 0===t&&(t=null),null!=t||(t=null!=(e=document.documentElement.getAttribute("data-theme"))?e:"auto"),this.allowUserColorScheme="auto"===t;const s=null==(n=this.session.user)||null==(r=n.preferences())?void 0:r.colorScheme;let o;this.allowUserColorScheme&&(o=s),o||(o=t),this.setColorScheme(o),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===j.e.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=(d(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?"(".concat(this.titleCount,") "):"",e=m.route.get()===this.forum.attribute("basePath")+"/",n={pageTitle:this.title,forumName:this.forum.attribute("title"),pageNumber:1};let r=e||!this.title?(0,g.Z)(s.Z.translator.trans("core.lib.meta_titles.without_page_title",n)):(0,g.Z)(s.Z.translator.trans("core.lib.meta_titles.with_page_title",n));r=t+r;const o=new DOMParser;document.title=o.parseFromString(r,"text/html").body.innerText}transformRequestOptions(t){const{background:e,deserialize:n,modifyText:r,...o}={...t},a={background:null==e||e,deserialize:null!=n?n:t=>t,...o};if((0,C.l)(a,"config",((t,e)=>{e.setRequestHeader("X-CSRF-Token",this.session.csrfToken)})),a.method&&!["GET","POST"].includes(a.method)){const t=a.method;(0,C.l)(a,"config",((e,n)=>{n.setRequestHeader("X-HTTP-Method-Override",t)})),a.method="POST"}return a.extract=t=>{let e;e=r?r(t.responseText):t.responseText;const n=t.status;if(n<200||n>299)throw new y.Z(n,"".concat(e),a,t);if(t.getResponseHeader){const e=t.getResponseHeader("X-CSRF-Token");e&&(s.Z.session.csrfToken=e)}try{return""===e?null:JSON.parse(e)}catch(n){throw new y.Z(500,"".concat(e),a,t)}},a}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){var n,r,o,i,l,c,u;const d=null!=(n=null==(r=t.response)||null==(o=r.errors)?void 0:o.map((t=>{var e;return decodeURI(null!=(e=t.detail)?e:"")})))?n:[];let h;switch(t.status){case 422:h=d.map((t=>[t,m("br",null)])).flat().slice(0,-1);break;case 401:case 403:h=s.Z.translator.trans("core.lib.error.permission_denied_message");break;case 404:case 410:h=s.Z.translator.trans("core.lib.error.not_found_message");break;case 413:h=s.Z.translator.trans("core.lib.error.payload_too_large_message");break;case 429:h=s.Z.translator.trans("core.lib.error.rate_limit_exceeded_message");break;default:h="db_error"===(null==(i=t.response)||null==(l=i.errors)||null==(c=l[0])?void 0:c.code)&&null!=(u=s.Z.session.user)&&u.isAdmin()?s.Z.translator.trans("core.lib.error.db_error_message"):this.requestWasCrossOrigin(t)?s.Z.translator.trans("core.lib.error.generic_cross_origin_message"):s.Z.translator.trans("core.lib.error.generic_message")}const p=s.Z.forum.attribute("debug");return t.alert={type:"error",content:h,controls:p&&[m(a.Z,{className:"Button Button--link",onclick:this.showDebug.bind(this,t,d)},s.Z.translator.trans("core.lib.debug_button"))]},e?e(t):this.requestErrorDefaultHandler(t,p,d),Promise.reject(t)}requestWasCrossOrigin(t){return new URL(t.options.url,document.baseURI).origin!==window.location.origin}requestErrorDefaultHandler(t,e,n){if(!(t instanceof y.Z))throw t;if(e&&t.xhr){const{method:e,url:r}=t.options,{status:s=""}=t.xhr;console.group("".concat(e," ").concat(r," ").concat(s)),n.length?console.error(...n):console.error(t),console.groupEnd()}500===t.status&&e?s.Z.modal.show(c.Z,{error:t,formattedError:n}):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.Z,{error:t,formattedError:e})}route(t,e){void 0===e&&(e={});const n=this.routes[t];if(!n)throw new Error("Route '".concat(t,"' does not exist"));const r=n.path.replace(/:([^\/]+)/g,((t,n)=>"".concat((0,f.Z)(e,n))));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"):"")+r+(s?"?"+s:"")}}flarum.reg.add("core","common/Application",R)},2190:(t,e,n)=>{"use strict";n.d(e,{Z:()=>s});var r=n(7905);class s{constructor(){(0,r.Z)(this,"element",void 0),(0,r.Z)(this,"attrs",void 0),(0,r.Z)(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 n={...t};return m(this,n,e)}setAttrs(t){if(void 0===t&&(t={}),this.constructor.initAttrs(t),t){if("children"in t)throw new Error("[".concat(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("[".concat(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)},9175:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var r=n(7905),s=n(7465);class o{constructor(t,e){void 0===t&&(t={}),void 0===e&&(e=s.Z.store),(0,r.Z)(this,"data",{}),(0,r.Z)(this,"freshness",new Date),(0,r.Z)(this,"exists",!1),(0,r.Z)(this,"store",void 0),this.data=t,this.store=e}id(){return"id"in this.data?this.data.id:void 0}attribute(t){var e,n;return null==(e=this.data)||null==(n=e.attributes)?void 0:n[t]}pushData(t){if("id"in t&&(this.data.id=t.id),"type"in t&&(this.data.type=t.type),"attributes"in t){var e;(e=this.data).attributes||(e.attributes={});for(const e in t.attributes){const n=t.attributes[e];n&&n instanceof o&&delete t.attributes[e]}Object.assign(this.data.attributes,t.attributes)}if("relationships"in t){var n;const e=null!=(n=this.data.relationships)?n:{};for(const n in t.relationships){const r=t.relationships[n];if(null===r){delete e[n],delete t.relationships[n];continue}let s;s=r instanceof o?{data:o.getIdentifier(r)}:r instanceof Array?{data:r.map(o.getIdentifier)}:r,t.relationships[n]=s,e[n]=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 n={type:this.data.type,attributes:t};if("id"in this.data&&(n.id=this.data.id),t.relationships){n.relationships={};for(const e in t.relationships){const r=t.relationships[e];null!==r&&(n.relationships[e]={data:r instanceof Array?r.map(o.getIdentifier):o.getIdentifier(r)})}delete t.relationships}const r=this.copyData();this.pushData(n);const a={data:n,meta:e.meta||void 0};return s.Z.request({method:this.exists?"PATCH":"POST",url:s.Z.forum.attribute("apiUrl")+this.apiEndpoint(),body:a,...e}).then((t=>this.store.pushPayload(t)),(t=>{throw this.pushData(r),m.redraw(),t}))}delete(t,e){return void 0===t&&(t={}),void 0===e&&(e={}),this.exists?s.Z.request({method:"DELETE",url:s.Z.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){var e,n;return null==(e=this.data.relationships)||null==(n=e[t])?void 0:n.data}static attribute(t,e){return function(){return e?e(this.attribute(t)):this.attribute(t)}}static hasOne(t){return function(){var e,n;const r=null==(e=this.data.relationships)||null==(n=e[t])?void 0:n.data;if(r&&r instanceof Array)throw new Error("Relationship ".concat(t," on model ").concat(this.data.type," is plural, so the hasOne method cannot be used to access it."));return!!r&&this.store.getById(r.type,r.id)}}static hasMany(t){return function(){var e,n;const r=null==(e=this.data.relationships)||null==(n=e[t])?void 0:n.data;if(r&&!(r instanceof Array))throw new Error("Relationship ".concat(t," on model ").concat(this.data.type," is singular, so the hasMany method cannot be used to access it."));return!!r&&r.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)},4773:(t,e,n)=>{"use strict";n.d(e,{Z:()=>p});var r=n(7905),s=n(7465),o=n(1586);class a extends o.y3{key(){return s.Z.translator.trans("core.lib.gambits.discussions.author.key",{},!0)}hint(){return s.Z.translator.trans("core.lib.gambits.discussions.author.hint",{},!0)}filterKey(){return"author"}}flarum.reg.add("core","common/query/discussions/AuthorGambit",a);class i extends o.y3{key(){return s.Z.translator.trans("core.lib.gambits.discussions.created.key",{},!0)}hint(){return s.Z.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",i);class l extends o.gD{key(){return s.Z.translator.trans("core.lib.gambits.discussions.hidden.key",{},!0)}filterKey(){return"hidden"}enabled(){return!!s.Z.session.user}}flarum.reg.add("core","common/query/discussions/HiddenGambit",l);class c extends o.gD{key(){return s.Z.translator.trans("core.lib.gambits.discussions.unread.key",{},!0)}filterKey(){return"unread"}enabled(){return!!s.Z.session.user}}flarum.reg.add("core","common/query/discussions/UnreadGambit",c);class u extends o.y3{key(){return s.Z.translator.trans("core.lib.gambits.users.email.key",{},!0)}hint(){return s.Z.translator.trans("core.lib.gambits.users.email.hint",{},!0)}filterKey(){return"email"}enabled(){return!(!s.Z.session.user||!s.Z.forum.attribute("canEditUserCredentials"))}}flarum.reg.add("core","common/query/users/EmailGambit",u);class d extends o.y3{key(){return s.Z.translator.trans("core.lib.gambits.users.group.key",{},!0)}hint(){return s.Z.translator.trans("core.lib.gambits.users.group.hint",{},!0)}filterKey(){return"group"}}flarum.reg.add("core","common/query/users/GroupGambit",d);class m extends o.y3{key(){return s.Z.translator.trans("core.lib.gambits.posts.discussion.key",{},!0)}hint(){return s.Z.translator.trans("core.lib.gambits.posts.discussion.hint",{},!0)}filterKey(){return"discussion"}}flarum.reg.add("core","common/query/discussions/DiscussionGambit",m);class h{constructor(){(0,r.Z)(this,"gambits",{discussions:[a,i,l,c],posts:[a,m],users:[u,d]})}apply(t,e){return e.q=this.match(t,e.q,((t,n,r)=>{const s=t.toFilter(n,r);Object.keys(s).forEach((n=>{n in e&&t.predicates&&Array.isArray(s[n])?e[n]=e[n].concat(s[n]):e[n]=s[n]}))})),e}match(t,e,n){const r=this.for(t).filter((t=>t.enabled()));if(0===r.length)return e;const s=e.split(" ");for(const t of r)for(const r of s){const s=new RegExp("^(-?)".concat(t.pattern(),"$"),"i");let o=r.match(s);if(o){const s="-"===o[1];o.splice(1,1),n(t,o,s,r),e=e.replace(r,"")}}return e.trim().replace(/\s+/g," ")}from(t,e,n){const r=this.for(t);return 0===r.length||Object.keys(n).forEach((t=>{for(const s of r){const r="-"===t[0];r&&(t=t.substring(1)),s.filterKey()===t&&(e+=" ".concat(s.fromFilter(n[t],r)))}})),e}for(t){return(this.gambits[t]||[]).map((t=>new t))}}flarum.reg.add("core","common/GambitManager",h);class p{constructor(t){(0,r.Z)(this,"state",void 0),(0,r.Z)(this,"gambits",new h),this.state=t}}(0,r.Z)(p,"MIN_SEARCH_LEN",3),flarum.reg.add("core","common/SearchManager",p)},4153:(t,e,n)=>{"use strict";n.d(e,{Z:()=>V});var r,s=n(7905),o=n(6880),a=n.n(o),i=n(6353),l=n.n(i),c=n(2512),u=n.n(c),d=n(8328),h=n.n(d),p=n(9939),f=n.n(p),g=n(1627),v=n.n(g),b=n(871),y=n.n(b);function w(t){return t.reduce((function(t,e){return t.concat(Array.isArray(e)?w(e):e)}),[])}function Z(t){var e={};return function(){for(var n=arguments.length,r=new Array(n),s=0;s3&&void 0!==arguments[3]?arguments[3]:[];if(!t)return r;if(1===n)return r.push(t),r;var s=t.indexOf(e);if(-1===s)return r.push(t),r;var o=t.substring(0,s).trim(),a=t.substring(s+e.length+1).trim();return r.push(o),k(a,e,n-1,r)}function _(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function S(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,a=x(e),i=a.args,l=a.cases,c=parseInt(t);i.forEach((function(t){t.startsWith("offset:")&&(c-=parseInt(t.slice("offset:".length)))}));var u=[];if("PluralRules"in Intl){void 0!==r&&r.resolvedOptions().locale===n||(r=new Intl.PluralRules(n));var d=r.select(c);d!==T&&u.push(d)}1===c&&u.push("one"),u.push("=".concat(c),T);for(var m=0;m1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0,s=x(e),o=s.cases;return t in o?r(o[t],n):M in o?r(o.other,n):t}function I(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],s=[],o=function(r,o,a,i,l,c){if(o)return{break:!0};var u=L(t,a,i,l);if(!u)return s;var d=u.segmentIndex===i,m=t[u.segmentIndex],h=[];if(d)h.push(r.slice(l+1,u.segmentStart));else{h.push(r.slice(l+1));for(var p=i+1;p"===i[m]){var h=i.slice(c+1+l,m),p=s(i,l,h,a,m,c);if(p.exit)return;if(p.newSegmentIndex&&(a=p.newSegmentIndex),p.processedSegment&&(d=!0),p.break)break;l=!1,c=null,u=!1}else u&&(o=i[m],!/[a-zA-Z-_]/.test(o))&&(l=!1,c=null,u=!1);else c=m,u=!0,"/"===i[m+1]&&(l=!0,m++);d||r.push(i)}else r.push(i)}}function j(t){return Object.keys(t).reduce((function(e,n){return e[n]=R(t[n]),e}),{})}function B(t){return"string"!=typeof t?t:t.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/&/g,"&")}function R(t){return"string"==typeof t||t instanceof String?t.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"):Array.isArray(t)?t.map(R):t}function H(t,e,n){return"<".concat(t,">").concat(B(n),"")}var $=function(t){h()(s,t);var e,n,r=(e=s,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=v()(e);if(n){var s=v()(this).constructor;t=Reflect.construct(r,arguments,s)}else t=r.apply(this,arguments);return f()(this,t)});function s(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return l()(this,s),(e=r.call(this,t,n)).richHandler=o||H,e}return u()(s,[{key:"rich",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=j(e),r=w(this.process(t,n)),s=Math.random().toString(36)+Math.random().toString(36)+Math.random().toString(36),o=Object.fromEntries(Object.entries(e).map((function(t){var e=a()(t,2),n=e[0];return e[1],[n,s]}))),i=w(this.process(t,o)),l=I(i,o,(function(){return s})),c=l.map((function(t,e){return t===s?null:e})).filter((function(t){return null!==t}));return I(r,n,this.richHandler,c)}}]),s}(function(){function t(e){var n=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};l()(this,t),y()(this,"format",Z((function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return w(n.process(t,e)).join("")}))),this.locale=e,this.typeHandlers=r}return u()(t,[{key:"process",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t)return[];var n=t.indexOf("{");if(-1!==n){var r=N(t,n);if(-1===r)throw new Error('Unbalanced curly braces in string: "'.concat(t,'"'));var s=t.substring(n,r+1);if(s){var o=[],i=t.substring(0,n);i&&o.push(i);var l=C(s),c=a()(l,3),u=c[0],d=c[1],m=c[2],h=e[u];null==h&&(h="");var p=d&&this.typeHandlers[d];o.push(p?p(h,m,this.locale,e,this.process.bind(this)):h);var f=t.substring(r+1);return f&&o.push(this.process(f,e)),o}}return[t]}}]),t}());function F(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function q(t){for(var e=1;e{"use strict";n.d(e,{Z:()=>o});const r=window,s=new Proxy({},{get:(t,e)=>Reflect.get(r.app,e,r.app),set:(t,e,n)=>Reflect.set(r.app,e,n,r.app)}),o=s;flarum.reg.add("core","common/app",s)},3817:(t,e,n)=>{"use strict";n.d(e,{Z:()=>u});var r=n(2190),s=n(8312),o=n(1268),a=n(6786),i=n(3344),l=n(7465),c=n(9133);class u extends r.Z{view(t){const e=Object.assign({},this.attrs),n=(0,a.Z)(e,"type");e.className=(0,i.Z)("Alert","Alert--".concat(n),e.className);const r=(0,a.Z)(e,"title"),u=(0,a.Z)(e,"icon"),d=(0,a.Z)(e,"content")||t.children,h=(0,a.Z)(e,"controls")||[],p=(0,a.Z)(e,"dismissible"),f=(0,a.Z)(e,"ondismiss"),g=[];return(p||void 0===p)&&g.push(m(s.Z,{"aria-label":l.Z.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,i.Z)("Alert-container",e.containerClassName)},!!r&&m("div",{className:"Alert-title"},!!u&&m("span",{className:"Alert-title-icon"},m(c.Z,{name:u})),m("span",{className:"Alert-title-text"},r)),m("span",{className:"Alert-body"},d),m("ul",{className:"Alert-controls"},(0,o.Z)(h.concat(g)))))}}flarum.reg.add("core","common/components/Alert",u)},8588:(t,e,n)=>{"use strict";n.d(e,{Z:()=>s});var r=n(2190);class s extends r.Z{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 n=t[e],r="error"===n.attrs.type;return m("div",{className:"AlertManager-alert",role:"alert","aria-live":r?"assertive":"polite"},m(n.componentClass,Object.assign({},n.attrs,{ondismiss:this.state.dismiss.bind(this.state,e)}),n.children))})))}}flarum.reg.add("core","common/components/AlertManager",s)},7323:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var r=n(3344),s=n(2190);class o extends s.Z{view(t){const{user:e,...n}=t.attrs;n.className=(0,r.Z)("Avatar",n.className),null!=n.loading||(n.loading="lazy");let s="";const o="undefined"===n.title||n.title;if(o||delete n.title,e){const t=e.displayName()||"?",r=e.avatarUrl();if(o&&(n.title=n.title||t),r)return m("img",Object.assign({},n,{src:r,alt:""}));s=t.charAt(0).toUpperCase(),n.style={"--avatar-bg":e.color()}}return m("span",n,s)}}flarum.reg.add("core","common/components/Avatar",o)},3804:(t,e,n)=>{"use strict";n.d(e,{Z:()=>l});var r=n(6439),s=n(2190),o=n(3344),a=n(9215),i=n(9133);class l extends s.Z{view(){const{type:t,icon:e,label:n,color:s,style:l={},...c}=this.attrs,u=(0,o.Z)("Badge",[t&&"Badge--".concat(t)],c.className,(0,a.Z)(s)),d=e?m(i.Z,{name:e,className:"Badge-icon"}):m.trust(" "),h={...l,"--badge-bg":s},p={...c,className:u,style:h},f=m("div",p,d);return n?m(r.Z,{text:n},f):f}}flarum.reg.add("core","common/components/Badge",l)},8312:(t,e,n)=>{"use strict";n.d(e,{Z:()=>u});var r=n(2190),s=n(7465);function o(){s.Z.forum.attribute("debug")&&console.warn(...arguments)}flarum.reg.add("core","common/helpers/fireDebugWarning",o);var a=n(3344),i=n(1552),l=n(5226),c=n(9133);class u extends r.Z{view(t){let{type:e,"aria-label":n,icon:r,disabled:s,loading:o,className:l,class:c,...u}=this.attrs;e||(e="button"),"object"==typeof n&&(n=(0,i.Z)(n)),(s||o)&&delete u.onclick,l=(0,a.Z)(c,l,{hasIcon:r,disabled:s||o,loading:o});const d={disabled:s,className:l,type:e,"aria-label":n,...u};return m("button",d,this.getButtonContent(t.children))}oncreate(t){var e,n;super.oncreate(t);const{"aria-label":r}=this.attrs;this.view!==u.prototype.view||r||(0,i.Z)(t.children)||null!=(e=this.element)&&null!=(n=e.getAttribute)&&n.call(e,"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.Z,{name:e,className:"Button-icon"}),t&&m("span",{className:"Button-label"},t),this.attrs.loading&&m(l.Z,{size:"small",display:"inline"})]}}flarum.reg.add("core","common/components/Button",u)},7298:(t,e,n)=>{"use strict";n.d(e,{Z:()=>l});var r=n(2190),s=n(5226),o=n(3344),a=n(7669),i=n(9133);class l extends r.Z{view(t){const e=(0,o.Z)(["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,a.Z)("checked",this.onchange.bind(this))}),m("div",{className:"Checkbox-display","aria-hidden":"true"},this.getDisplay()),t.children)}getDisplay(){return this.attrs.loading?m(s.Z,{display:"unset",size:"small"}):m(i.Z,{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)},344:(t,e,n)=>{"use strict";n.d(e,{Z:()=>u});var r=n(7905),s=n(7465),o=n(2190),a=n(1268),i=n(1552),l=n(6439),c=n(9133);class u extends o.Z{constructor(){super(...arguments),(0,r.Z)(this,"showing",!1)}static initAttrs(t){t.className||(t.className=""),t.buttonClassName||(t.buttonClassName=""),t.menuClassName||(t.menuClassName=""),t.label||(t.label=""),null!=t.caretIcon||(t.caretIcon="fas fa-caret-down"),t.accessibleToggleLabel||(t.accessibleToggleLabel=(0,i.Z)(s.Z.translator.trans("core.lib.dropdown.toggle_dropdown_accessible_label")))}view(t){const e=t.children?(0,a.Z)(t.children):[],n=!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),n&&this.getMenu(e))}oncreate(t){super.oncreate(t),this.$().on("shown.bs.dropdown",(()=>{var t,e,n,r,s,o,a,i,l,c,u;const{lazyDraw:d,onshow:h}=this.attrs;this.showing=!0,d&&m.redraw.sync(),"function"==typeof h&&h(),d||m.redraw();const p=this.$(".Dropdown-menu"),f=p.hasClass("Dropdown-menu--right"),g=null!=(t=null==(e=p.offset())?void 0:e.top)?t:0,v=null!=(n=p.height())?n:0,b=null!=(r=$(window).scrollTop())?r:0,y=null!=(s=$(window).height())?s:0;p.removeClass("Dropdown-menu--top Dropdown-menu--right"),p.toggleClass("Dropdown-menu--top",g+v>b+y),((null==(o=p.offset())?void 0:o.top)||0)<0&&p.removeClass("Dropdown-menu--top");const w=null!=(a=null==(i=p.offset())?void 0:i.left)?a:0,Z=null!=(l=p.width())?l:0,x=null!=(c=$(window).scrollLeft())?c:0,N=null!=(u=$(window).width())?u:0;p.toggleClass("Dropdown-menu--right",f||w+Z>x+N)})),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.Z,{text:this.attrs.tooltip,position:"bottom"},e)),e}getButtonContent(t){return[this.attrs.icon?m(c.Z,{name:this.attrs.icon,className:"Button-icon"}):"",m("span",{className:"Button-label"},this.attrs.label),this.attrs.caretIcon?m(c.Z,{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)},8034:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var r=n(2190),s=n(3344);class o extends r.Z{view(t){return m("div",{className:(0,s.Z)("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)},6352:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var r=n(2190),s=n(3344);class o extends r.Z{view(t){const{label:e,description:n,className:r,...o}=t.attrs;return m("div",Object.assign({className:(0,s.Z)("Form",r)},o),m("div",{className:"Form-header"},e&&m("label",null,e),n&&m("p",{className:"helpText"},n)),m("div",{className:"Form-body"},t.children))}}flarum.reg.add("core","common/components/Form",o)},899:(t,e,n)=>{"use strict";n.d(e,{Z:()=>s});var r=n(7108);class s extends r.Z{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){var e;this.alertAttrs=t.alert,m.redraw(),422===t.status&&null!=(e=t.response)&&e.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)},6697:(t,e,n)=>{"use strict";n.d(e,{Z:()=>s});var r=n(3804);class s extends r.Z{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)},9133:(t,e,n)=>{"use strict";n.d(e,{Z:()=>o});var r=n(3344),s=n(2190);class o extends s.Z{view(t){const{name:e,...n}=t.attrs;return n.className=(0,r.Z)("icon",e,n.className),m("i",Object.assign({"aria-hidden":"true"},n))}}flarum.reg.add("core","common/components/Icon",o)},3986:(t,e,n)=>{"use strict";n.d(e,{Z:()=>a});var r=n(2190),s=n(9133),o=n(3344);class a extends r.Z{view(t){const{icon:e,className:n,...r}=t.attrs;return m("div",Object.assign({className:(0,o.Z)("InfoTile",n)},r),this.icon(),m("div",{className:"InfoTile-text"},t.children))}icon(){return this.attrs.iconElement?this.attrs.iconElement:this.attrs.icon?m(s.Z,{name:(0,o.Z)(this.attrs.icon,"InfoTile-icon")}):null}}flarum.reg.add("core","common/components/InfoTile",a)},9908:(t,e,n)=>{"use strict";n.d(e,{Z:()=>c});var r=n(6789),s=n(2190),o=n(9133),a=n(5226),i=n(3344),l=n(8312);class c extends s.Z{oninit(t){super.oninit(t)}view(t){var e,n;const{className:s,...c}=this.attrs.inputAttrs||{},u=this.attrs.value||(null==(e=(n=this.attrs).stream)?void 0:e.call(n))||"";return m("div",{className:(0,i.Z)("Input",this.attrs.className,{"Input--withPrefix":this.attrs.prefixIcon,"Input--withClear":this.attrs.clearable})},this.attrs.prefixIcon&&m(o.Z,{name:(0,i.Z)(this.attrs.prefixIcon,"Input-prefix-icon")}),this.input({inputClassName:s,value:u,inputAttrs:c}),this.attrs.loading&&m(a.Z,{size:"small",display:"inline",containerClassName:"Button Button--icon Button--link"}),this.attrs.clearable&&u&&!this.attrs.loading&&m(l.Z,{className:"Input-clear Button Button--icon Button--link",onclick:this.clear.bind(this),"aria-label":this.attrs.clearLabel||r.Z.translator.trans("core.lib.input.clear_button"),type:"button",icon:"fas fa-times-circle"}))}input(t){let{inputClassName:e,value:n,inputAttrs:r}=t;const s={className:(0,i.Z)("FormControl",e),type:this.attrs.type||"text",value:n,oninput:t=>{var e;return null==(e=this.onchange)?void 0:e.call(this,t.target.value)},"aria-label":this.attrs.ariaLabel,placeholder:this.attrs.placeholder,readonly:this.attrs.readonly||void 0,disabled:this.attrs.disabled||void 0,...r};return this.attrs.renderInput?this.attrs.renderInput(s):m("input",s)}onchange(t){var e,n;this.attrs.stream?this.attrs.stream(t):null==(e=(n=this.attrs).onchange)||e.call(n,t)}clear(){this.onchange("")}}flarum.reg.add("core","common/components/Input",c)},5226:(t,e,n)=>{"use strict";n.d(e,{Z:()=>a});var r=n(7465),s=n(2190),o=n(3344);class a extends s.Z{view(){const{display:t="block",size:e="medium",containerClassName:n,className:s,...a}=this.attrs,i=(0,o.Z)("LoadingIndicator",s),l=(0,o.Z)("LoadingIndicator-container","unset"!==t&&"LoadingIndicator-container--".concat(t),e&&"LoadingIndicator-container--".concat(e),n);return m("div",Object.assign({"aria-label":r.Z.translator.trans("core.lib.loading_indicator.accessible_label"),role:"status"},a.containerAttrs,{"data-size":e,className:l}),m("div",Object.assign({"aria-hidden":"true",className:i},a)))}}flarum.reg.add("core","common/components/LoadingIndicator",a)},7108:(t,e,n)=>{"use strict";n.d(e,{Z:()=>c});var r=n(7905),s=n(7465),o=n(2190),a=n(3817),i=n(8312),l=n(3344);class c extends o.Z{constructor(){super(...arguments),(0,r.Z)(this,"loading",!1),(0,r.Z)(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.Z)("Modal modal-dialog fade",this.className())},m("div",{className:"Modal-content"},this.dismissibleOptions.viaCloseButton&&m("div",{className:"Modal-close App-backControl"},m(i.Z,{icon:"fas fa-times",onclick:()=>this.hide(),className:"Button Button--icon Button--link","aria-label":s.Z.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(a.Z,this.alertAttrs)),this.content())}onready(){}hide(){this.attrs.animateHide()}loaded(){this.loading=!1,m.redraw()}get dismissibleOptions(){return this.constructor.dismissibleOptions}}(0,r.Z)(c,"isDismissibleViaCloseButton",!0),(0,r.Z)(c,"isDismissibleViaEscKey",!0),(0,r.Z)(c,"isDismissibleViaBackdropClick",!0),flarum.reg.add("core","common/components/Modal",c)},7224:(t,e,n)=>{"use strict";n.d(e,{Z:()=>w});var r=n(7905),s=n(2190),o=n(7835),a=!1;if("undefined"!=typeof window){var i={get passive(){a=!0}};window.addEventListener("testPassive",null,i),window.removeEventListener("testPassive",null,i)}var l="undefined"!=typeof window&&window.navigator&&window.navigator.platform&&(/iP(ad|hone|od)/.test(window.navigator.platform)||"MacIntel"===window.navigator.platform&&window.navigator.maxTouchPoints>1),c=[],u=!1,d=-1,h=void 0,p=void 0,f=void 0,g=function(t){return c.some((function(e){return!(!e.options.allowTouchMove||!e.options.allowTouchMove(t))}))},v=function(t){var e=t||window.event;return!!g(e.target)||e.touches.length>1||(e.preventDefault&&e.preventDefault(),!1)},b=function(){l&&(c.forEach((function(t){t.targetElement.ontouchstart=null,t.targetElement.ontouchmove=null})),u&&(document.removeEventListener("touchmove",v,a?{passive:!1}:void 0),u=!1),d=-1),l?function(){if(void 0!==p){var t=-parseInt(document.body.style.top,10),e=-parseInt(document.body.style.left,10);document.body.style.position=p.position,document.body.style.top=p.top,document.body.style.left=p.left,window.scrollTo(e,t),p=void 0}}():(void 0!==f&&(document.body.style.paddingRight=f,f=void 0),void 0!==h&&(document.body.style.overflow=h,h=void 0)),c=[]},y=n(5226);class w extends s.Z{constructor(){super(...arguments),(0,r.Z)(this,"focusTrap",void 0),(0,r.Z)(this,"lastSetFocusTrap",void 0),(0,r.Z)(this,"modalClosing",!1),(0,r.Z)(this,"keyUpListener",null)}view(t){return m("[",null,this.attrs.state.modalList.map(((t,e)=>{const n=null==t?void 0: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:{"--modal-number":e},"aria-hidden":this.attrs.state.modal!==t&&"true"},!!n&&[m(n,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:{"--modal-count":this.attrs.state.modalList.length+Number(this.attrs.state.loadingModal)}},this.attrs.state.loadingModal&&m(y.Z,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{var t,e,n,r;if(!this.attrs.state.isModalOpen())return null==(e=document.getElementById("app"))||e.setAttribute("aria-hidden","false"),null==(n=(r=this.focusTrap).deactivate)||n.call(r),void b();null==(t=document.getElementById("app"))||t.setAttribute("aria-hidden","true");const w=this.attrs.state.modal.key;var s,i,m,y;this.focusTrap&&this.lastSetFocusTrap!==w&&(null==(s=(i=this.focusTrap).deactivate)||s.call(i),b()),this.activeDialogElement&&this.lastSetFocusTrap!==w&&(this.focusTrap=(0,o.v)(this.activeDialogElement,{allowOutsideClick:!0}),null==(m=(y=this.focusTrap).activate)||m.call(y),function(t,e){if(t){if(!c.some((function(e){return e.targetElement===t}))){var n={targetElement:t,options:e||{}};c=[].concat(function(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e=r&&(document.body.style.top=-(e+t))}))}),300)}})):function(t){if(void 0===f){var e=!!t&&!0===t.reserveScrollBarGap,n=window.innerWidth-document.documentElement.clientWidth;if(e&&n>0){var r=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right"),10);f=document.body.style.paddingRight,document.body.style.paddingRight=r+n+"px"}}void 0===h&&(h=document.body.style.overflow,document.body.style.overflow="hidden")}(e),l&&(t.ontouchstart=function(t){1===t.targetTouches.length&&(d=t.targetTouches[0].clientY)},t.ontouchmove=function(e){1===e.targetTouches.length&&function(t,e){var n=t.targetTouches[0].clientY-d;!g(t.target)&&(e&&0===e.scrollTop&&n>0||function(t){return!!t&&t.scrollHeight-t.scrollTop<=t.clientHeight}(e)&&n<0?v(t):t.stopPropagation())}(e,t)},u||(document.addEventListener("touchmove",v,a?{passive:!1}:void 0),u=!0))}}else console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.")}(this.activeDialogManagerElement,{reserveScrollBarGap:!0})),this.lastSetFocusTrap=w}catch{}}))}get activeDialogElement(){var t;return document.body.querySelector('.ModalManager[data-modal-key="'.concat(null==(t=this.attrs.state.modal)?void 0:t.key,'"] .Modal'))}get activeDialogManagerElement(){var t;return document.body.querySelector('.ModalManager[data-modal-key="'.concat(null==(t=this.attrs.state.modal)?void 0:t.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",w)},5386:(t,e,n)=>{"use strict";n.d(e,{Z:()=>l});var r=n(7465),s=n(2190),o=n(8312),a=n(2360),i=n(3344);class l extends s.Z{view(){const{history:t,pane:e}=r.Z;return m("div",{className:(0,i.Z)("Navigation ButtonGroup",this.attrs.className),onmouseenter:e&&e.show.bind(e),onmouseleave:e&&e.onmouseleave.bind(e)},null!=t&&t.canGoBack()?[this.getBackButton(),this.getPaneButton()]:this.getDrawerButton())}getBackButton(){const{history:t}=r.Z,e=null==t?void 0:t.getPrevious();return m(a.Z,{className:"Button Navigation-back Button--icon",href:null==t?void 0:t.backUrl(),icon:"fas fa-chevron-left","aria-label":null==e?void 0:e.title,onclick:e=>{e.shiftKey||e.ctrlKey||e.metaKey||2===e.which||(e.preventDefault(),null==t||t.back())}})}getPaneButton(){const{pane:t}=r.Z;return t&&t.active?m(o.Z,{className:(0,i.Z)("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}=r.Z,e=r.Z.session.user;return m(o.Z,{className:(0,i.Z)("Button Button--icon Navigation-drawer",{new:null==e?void 0:e.newNotificationCount()}),onclick:e=>{e.stopPropagation(),t.show()},icon:"fas fa-bars","aria-label":r.Z.translator.trans("core.lib.nav.drawer_button")})}}flarum.reg.add("core","common/components/Navigation",l)},4661:(t,e,n)=>{"use strict";n.d(e,{Z:()=>i});var r=n(7905),s=n(7465),o=n(2190),a=n(5104);class i extends o.Z{constructor(){super(...arguments),(0,r.Z)(this,"bodyClass",""),(0,r.Z)(this,"scrollTopOnCreate",!0),(0,r.Z)(this,"useBrowserScrollRestoration",!0)}oninit(t){super.oninit(t),s.Z.previous=s.Z.current,s.Z.current=new a.Z(this.constructor,{routeName:this.attrs.routeName}),s.Z.drawer.hide(),s.Z.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",i)},406:(t,e,n)=>{"use strict";n.d(e,{Z:()=>s});var r=n(7108);class s extends r.Z{className(){return"RequestErrorModal Modal--large"}title(){return!!this.attrs.error.xhr&&"".concat(this.attrs.error.xhr.status," ").concat(this.attrs.error.xhr.statusText)}content(){var t;const{error:e,formattedError:n}=this.attrs;let r;return r=n.length?n.join("\n\n"):e.response?JSON.stringify(e.response,null,2):e.responseText,null!=(t=r)&&t.includes("