From 874279098087519ce1a0dbb6bcb3b33a7b3599b9 Mon Sep 17 00:00:00 2001 From: flarum-bot Date: Sat, 19 Oct 2024 16:48:34 +0000 Subject: [PATCH] Bundled output for commit 321020ab83b715d00b44434f9313c91e66b863dd Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci] --- .../js/dist-typings/models/ExternalExtension.d.ts | 2 +- .../package-manager/js/dist-typings/utils/versions.d.ts | 9 +++++++++ extensions/package-manager/js/dist/admin.js | 2 +- extensions/package-manager/js/dist/admin.js.map | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 extensions/package-manager/js/dist-typings/utils/versions.d.ts diff --git a/extensions/package-manager/js/dist-typings/models/ExternalExtension.d.ts b/extensions/package-manager/js/dist-typings/models/ExternalExtension.d.ts index dda4a0de7b..81f8bddf08 100644 --- a/extensions/package-manager/js/dist-typings/models/ExternalExtension.d.ts +++ b/extensions/package-manager/js/dist-typings/models/ExternalExtension.d.ts @@ -21,6 +21,6 @@ export default class ExternalExtension extends Model { downloads: () => number; readonly installed = false; isSupported(): boolean; - isStable(): boolean; + isProductionReady(): boolean; toLocalExtension(): Extension; } diff --git a/extensions/package-manager/js/dist-typings/utils/versions.d.ts b/extensions/package-manager/js/dist-typings/utils/versions.d.ts new file mode 100644 index 0000000000..08c35ab836 --- /dev/null +++ b/extensions/package-manager/js/dist-typings/utils/versions.d.ts @@ -0,0 +1,9 @@ +export declare enum VersionStability { + Stable = "stable", + Alpha = "alpha", + Beta = "beta", + RC = "rc", + Dev = "dev" +} +export declare function isProductionReady(version: string): boolean; +export declare function stability(version: string): VersionStability; diff --git a/extensions/package-manager/js/dist/admin.js b/extensions/package-manager/js/dist/admin.js index e4dc62fc8e..cd5813d08e 100755 --- a/extensions/package-manager/js/dist/admin.js +++ b/extensions/package-manager/js/dist/admin.js @@ -1,2 +1,2 @@ -(()=>{var e={151:function(e){e.exports=function(){"use strict";var e,t,a=1e3,n=6e4,s=36e5,r=864e5,o=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,i=31536e6,l=2628e6,m=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,u={years:i,months:l,days:r,hours:s,minutes:n,seconds:a,milliseconds:1,weeks:6048e5},c=function(e){return e instanceof b},d=function(e,t,a){return new b(e,a,t.$l)},g=function(e){return t.p(e)+"s"},p=function(e){return e<0},h=function(e){return p(e)?Math.ceil(e):Math.floor(e)},f=function(e){return Math.abs(e)},x=function(e,t){return e?p(e)?{negative:!0,format:""+f(e)+t}:{negative:!1,format:""+e+t}:{negative:!1,format:""}},b=function(){function p(e,t,a){var n=this;if(this.$d={},this.$l=a,void 0===e&&(this.$ms=0,this.parseFromMilliseconds()),t)return d(e*u[g(t)],this);if("number"==typeof e)return this.$ms=e,this.parseFromMilliseconds(),this;if("object"==typeof e)return Object.keys(e).forEach((function(t){n.$d[g(t)]=e[t]})),this.calMilliseconds(),this;if("string"==typeof e){var s=e.match(m);if(s){var r=s.slice(2).map((function(e){return null!=e?Number(e):0}));return this.$d.years=r[0],this.$d.months=r[1],this.$d.weeks=r[2],this.$d.days=r[3],this.$d.hours=r[4],this.$d.minutes=r[5],this.$d.seconds=r[6],this.calMilliseconds(),this}}return this}var f=p.prototype;return f.calMilliseconds=function(){var e=this;this.$ms=Object.keys(this.$d).reduce((function(t,a){return t+(e.$d[a]||0)*u[a]}),0)},f.parseFromMilliseconds=function(){var e=this.$ms;this.$d.years=h(e/i),e%=i,this.$d.months=h(e/l),e%=l,this.$d.days=h(e/r),e%=r,this.$d.hours=h(e/s),e%=s,this.$d.minutes=h(e/n),e%=n,this.$d.seconds=h(e/a),e%=a,this.$d.milliseconds=e},f.toISOString=function(){var e=x(this.$d.years,"Y"),t=x(this.$d.months,"M"),a=+this.$d.days||0;this.$d.weeks&&(a+=7*this.$d.weeks);var n=x(a,"D"),s=x(this.$d.hours,"H"),r=x(this.$d.minutes,"M"),o=this.$d.seconds||0;this.$d.milliseconds&&(o+=this.$d.milliseconds/1e3,o=Math.round(1e3*o)/1e3);var i=x(o,"S"),l=e.negative||t.negative||n.negative||s.negative||r.negative||i.negative,m=s.format||r.format||i.format?"T":"",u=(l?"-":"")+"P"+e.format+t.format+n.format+m+s.format+r.format+i.format;return"P"===u||"-P"===u?"P0D":u},f.toJSON=function(){return this.toISOString()},f.format=function(e){var a=e||"YYYY-MM-DDTHH:mm:ss",n={Y:this.$d.years,YY:t.s(this.$d.years,2,"0"),YYYY:t.s(this.$d.years,4,"0"),M:this.$d.months,MM:t.s(this.$d.months,2,"0"),D:this.$d.days,DD:t.s(this.$d.days,2,"0"),H:this.$d.hours,HH:t.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:t.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:t.s(this.$d.seconds,2,"0"),SSS:t.s(this.$d.milliseconds,3,"0")};return a.replace(o,(function(e,t){return t||String(n[e])}))},f.as=function(e){return this.$ms/u[g(e)]},f.get=function(e){var t=this.$ms,a=g(e);return"milliseconds"===a?t%=1e3:t="weeks"===a?h(t/u[a]):this.$d[a],t||0},f.add=function(e,t,a){var n;return n=t?e*u[g(t)]:c(e)?e.$ms:d(e,this).$ms,d(this.$ms+n*(a?-1:1),this)},f.subtract=function(e,t){return this.add(e,t,!0)},f.locale=function(e){var t=this.clone();return t.$l=e,t},f.clone=function(){return d(this.$ms,this)},f.humanize=function(t){return e().add(this.$ms,"ms").locale(this.$l).fromNow(!t)},f.valueOf=function(){return this.asMilliseconds()},f.milliseconds=function(){return this.get("milliseconds")},f.asMilliseconds=function(){return this.as("milliseconds")},f.seconds=function(){return this.get("seconds")},f.asSeconds=function(){return this.as("seconds")},f.minutes=function(){return this.get("minutes")},f.asMinutes=function(){return this.as("minutes")},f.hours=function(){return this.get("hours")},f.asHours=function(){return this.as("hours")},f.days=function(){return this.get("days")},f.asDays=function(){return this.as("days")},f.weeks=function(){return this.get("weeks")},f.asWeeks=function(){return this.as("weeks")},f.months=function(){return this.get("months")},f.asMonths=function(){return this.as("months")},f.years=function(){return this.get("years")},f.asYears=function(){return this.as("years")},p}(),v=function(e,t,a){return e.add(t.years()*a,"y").add(t.months()*a,"M").add(t.days()*a,"d").add(t.hours()*a,"h").add(t.minutes()*a,"m").add(t.seconds()*a,"s").add(t.milliseconds()*a,"ms")};return function(a,n,s){e=s,t=s().$utils(),s.duration=function(e,t){var a=s.locale();return d(e,{$l:a},t)},s.isDuration=c;var r=n.prototype.add,o=n.prototype.subtract;n.prototype.add=function(e,t){return c(e)?v(this,e,1):r.bind(this)(e,t)},n.prototype.subtract=function(e,t){return c(e)?v(this,e,-1):o.bind(this)(e,t)}}}()}},t={};function a(n){var s=t[n];if(void 0!==s)return s.exports;var r=t[n]={exports:{}};return e[n].call(r.exports,r,r.exports,a),r.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{"use strict";a.r(n),a.d(n,{extend:()=>He});const e=flarum.reg.get("core","common/extend"),t=flarum.reg.get("core","admin/app");var s=a.n(t);const r=flarum.reg.get("core","admin/components/ExtensionPage");var o=a.n(r);const i=flarum.reg.get("core","common/components/Button");var l=a.n(i);const u=flarum.reg.get("core","admin/components/LoadingModal");var c=a.n(u);const d=flarum.reg.get("core","admin/utils/isExtensionEnabled");var g=a.n(d);function p(){s().modal.close(),m.route.set(s().route("extension",{id:"flarum-extension-manager"})),s().extensionManager.queue.load({},!0),setTimeout((()=>{var e;null==(e=document.getElementById("ExtensionManager-queueSection"))||e.scrollIntoView({block:"nearest"})}),200)}function h(e){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h(e)}function f(e,t,a){return n=function(e,t){if("object"!=h(e)||!e)return e;var a=e[Symbol.toPrimitive];if(void 0!==a){var n=a.call(e,"string");if("object"!=h(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==h(n)?n:n+"")in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e;var n}window.jumpToQueue=p,flarum.reg.add("flarum-extension-manager","admin/utils/jumpToQueue",p);class x{constructor(){f(this,"polling",null),f(this,"tasks",null),f(this,"limit",20),f(this,"offset",0),f(this,"total",0),f(this,"loading",!1)}load(e,t){var a;return void 0===t&&(t=!1),this.loading=!0,e={page:{limit:this.limit,offset:this.offset,...null==(a=e)?void 0:a.page},...e},s().store.find("extension-manager-tasks",e||{}).then((e=>{var a;return this.tasks=e,this.total=(null==(a=e.payload.meta)||null==(a=a.page)?void 0:a.total)||0,m.redraw(),(null==e?void 0:e.find((e=>"pending"===e.status()||"running"===e.status())))?this.pollQueue(t):t?(s().extensionManager.control.setLoading(null),window.location.reload()):s().extensionManager.control.isLoading()&&s().extensionManager.control.setLoading(null),this.loading=!1,e}))}isLoading(){return this.loading}getItems(){return this.tasks}getTotalItems(){return this.total}getTotalPages(){return Math.ceil(this.total/this.limit)}pageNumber(){return Math.ceil(this.offset/this.limit)}getPerPage(){return this.limit}hasPrev(){return 0!==this.pageNumber()}hasNext(){return this.offset+this.limit{this.load({},e)}),6e3)}hasPending(){var e;return!(null==(e=this.tasks)||!e.find((e=>"pending"===e.status()||"running"===e.status())))}}function b(e){s().extensionManager.control.setLoading(null);const t=e.response.errors[0];if(!["composer_command_failure","extension_already_installed","extension_not_installed"].includes(t.code))throw e;switch(s().alerts.clear(),t.code){case"composer_command_failure":t.guessed_cause?(s().alerts.show({type:"error"},s().translator.trans("flarum-extension-manager.admin.exceptions.guessed_cause.".concat(t.guessed_cause))),s().modal.close()):s().alerts.show({type:"error"},s().translator.trans("flarum-extension-manager.admin.exceptions.composer_command_failure"));break;case"extension_already_installed":s().alerts.show({type:"error"},s().translator.trans("flarum-extension-manager.admin.exceptions.extension_already_installed")),s().modal.close();break;case"extension_not_installed":s().alerts.show({type:"error"},s().translator.trans("flarum-extension-manager.admin.exceptions.extension_not_installed")),s().modal.close()}}flarum.reg.add("flarum-extension-manager","admin/states/QueueState",x);const v=flarum.reg.get("core","common/utils/extractText");var y=a.n(v);class _{get lastUpdateRun(){const e=JSON.parse(s().data.settings["flarum-extension-manager.last_update_run"]);return e.limitedPackages=()=>[...e.major.limitedPackages,...e.minor.limitedPackages,...e.global.limitedPackages],e}constructor(){f(this,"loading",null),f(this,"packageUpdates",{}),f(this,"lastUpdateCheck",void 0),f(this,"extensionUpdates",void 0),f(this,"coreUpdate",null),this.lastUpdateCheck=JSON.parse(s().data.settings["flarum-extension-manager.last_update_check"]),this.extensionUpdates=this.formatExtensionUpdates(this.lastUpdateCheck),this.coreUpdate=this.formatCoreUpdate(this.lastUpdateCheck)}isLoading(e){return void 0===e&&(e=null),e&&this.loading===e||!e&&null!==this.loading}hasOperationRunning(){return this.isLoading()||s().extensionManager.queue.hasPending()}setLoading(e){this.loading=e}requirePackage(e){s().extensionManager.control.setLoading("extension-install"),s().modal.show(c()),s().request({method:"POST",url:"".concat(s().forum.attribute("apiUrl"),"/extension-manager/extensions"),body:{data:e}}).then((e=>{if(e.processing)p();else{const t=e.id;s().alerts.show({type:"success"},s().translator.trans("flarum-extension-manager.admin.extensions.successful_install",{extension:t})),window.location.href="".concat(s().forum.attribute("adminUrl"),"#/extension/").concat(t),window.location.reload()}})).catch(b).finally((()=>{s().modal.close(),m.redraw()}))}checkForUpdates(){this.setLoading("check"),s().request({method:"POST",url:"".concat(s().forum.attribute("apiUrl"),"/extension-manager/check-for-updates")}).then((e=>{e.processing?p():(this.lastUpdateCheck=e,this.extensionUpdates=this.formatExtensionUpdates(e),this.coreUpdate=this.formatCoreUpdate(e),this.setLoading(null),m.redraw())})).catch(b).finally((()=>{m.redraw()}))}updateCoreMinor(){confirm(y()(s().translator.trans("flarum-extension-manager.admin.minor_update_confirmation.content")))&&(s().modal.show(c()),this.setLoading("minor-update"),s().request({method:"POST",url:"".concat(s().forum.attribute("apiUrl"),"/extension-manager/minor-update")}).then((e=>{null!=e&&e.processing?p():(s().alerts.show({type:"success"},s().translator.trans("flarum-extension-manager.admin.update_successful")),window.location.reload())})).catch(b).finally((()=>{s().modal.close(),m.redraw()})))}updateExtension(e,t){s().modal.show(c()),this.setLoading("extension-update"),s().request({method:"PATCH",url:"".concat(s().forum.attribute("apiUrl"),"/extension-manager/extensions/").concat(e.id),body:{data:{updateMode:t}}}).then((t=>{null!=t&&t.processing?p():(s().alerts.show({type:"success"},s().translator.trans("flarum-extension-manager.admin.extensions.successful_update",{extension:e.extra["flarum-extension"].title})),window.location.reload())})).catch(b).finally((()=>{s().modal.close(),m.redraw()}))}updateGlobally(){s().modal.show(c()),this.setLoading("global-update"),s().request({method:"POST",url:"".concat(s().forum.attribute("apiUrl"),"/extension-manager/global-update")}).then((e=>{null!=e&&e.processing?p():(s().alerts.show({type:"success"},s().translator.trans("flarum-extension-manager.admin.updater.global_update_successful")),window.location.reload())})).catch(b).finally((()=>{s().modal.close(),m.redraw()}))}formatExtensionUpdates(e){var t;return this.packageUpdates={},null==e||null==(t=e.updates)||null==(t=t.installed)||t.filter((e=>{const t=e.name.replace("/","-").replace(/(flarum-ext-)|(flarum-)/,""),a=s().data.extensions[t],n=["semver-safe-update","update-possible"].includes(e["latest-status"]);return a&&n&&(this.packageUpdates[a.id]=e),a&&n})),Object.values(s().data.extensions).filter((e=>this.packageUpdates[e.id]))}formatCoreUpdate(e){var t;const a=null==e||null==(t=e.updates)||null==(t=t.installed)?void 0:t.filter((e=>"flarum/core"===e.name)).pop();return a?{package:a,extension:{id:"flarum-core",name:"flarum/core",version:s().data.settings.version,icon:{name:"",backgroundImage:"url(".concat(s().data.resources[0].attributes.baseUrl,"/assets/extensions/flarum-extension-manager/flarum.svg")},extra:{"flarum-extension":{title:y()(s().translator.trans("flarum-extension-manager.admin.updater.flarum"))}},links:{}}}:null}majorUpdate(e){let{dryRun:t}=e;s().extensionManager.control.setLoading(t?"major-update-dry-run":"major-update"),s().modal.show(c());const a=this.lastUpdateRun.major;s().request({method:"POST",url:"".concat(s().forum.attribute("apiUrl"),"/extension-manager/major-update"),body:{data:{dryRun:t}}}).then((e=>{null!=e&&e.processing?p():(s().alerts.show({type:"success"},s().translator.trans("flarum-extension-manager.admin.update_successful")),window.location.reload())})).catch(b).catch((e=>{var t;s().modal.close(),a.status="failure",a.incompatibleExtensions=null==(t=e.response)||null==(t=t.errors)||null==(t=t.pop())?void 0:t.incompatible_extensions})).finally((()=>{m.redraw()}))}}flarum.reg.add("flarum-extension-manager","admin/states/ControlSectionState",_);const k=flarum.reg.get("core","common/states/PaginatedListState");var N=a.n(k);class M extends(N()){get type(){return"external-extensions"}constructor(){super({sort:"-downloads"},1,12)}sortMap(){return{"-createdAt":{sort:"-createdAt",label:s().translator.trans("flarum-extension-manager.admin.sections.discover.sort.latest",{},!0)},"-downloads":{sort:"-downloads",label:s().translator.trans("flarum-extension-manager.admin.sections.discover.sort.top",{},!0)}}}}flarum.reg.add("flarum-extension-manager","admin/states/ExtensionListState",M);class w{constructor(){f(this,"queue",new x),f(this,"control",new _),f(this,"extensions",new M)}}flarum.reg.add("flarum-extension-manager","admin/states/ExtensionManagerState",w);const E=flarum.reg.get("core","common/extenders");var S=a.n(E);const B=flarum.reg.get("core","common/Component");var U=a.n(B);const C=flarum.reg.get("core","common/components/LoadingIndicator");var q=a.n(C);const P=flarum.reg.get("core","common/components/Tooltip");var T=a.n(P);const j=flarum.reg.get("core","common/components/Icon");var F=a.n(j);const $=flarum.reg.get("core","common/utils/ItemList");var L=a.n($);const I=flarum.reg.get("core","common/components/Link");var A=a.n(I);const D=flarum.reg.get("core","common/components/Pagination");var O=a.n(D);const Y=flarum.reg.get("core","common/utils/classList");var W=a.n(Y);class R extends(U()){view(e){const{className:t,type:a,...n}=this.attrs;return m("span",Object.assign({className:W()(["Label","Label--".concat(this.attrs.type),t])},n),e.children)}}flarum.reg.add("flarum-extension-manager","admin/components/Label",R);const G=flarum.reg.get("core","common/components/Modal");var V=a.n(G);class H extends(V()){className(){return"Modal--large QuickModal"}title(){return s().translator.trans("flarum-extension-manager.admin.sections.queue.operations.".concat(this.attrs.task.operation()))}content(){return m("div",{className:"Modal-body"},m("div",{className:"TaskOutputModal-data"},"failure"===this.attrs.task.status()&&m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.sections.queue.output_modal.guessed_cause")),m("div",{className:"FormControl TaskOutputModal-data-guessed-cause"},this.attrs.task.guessedCause()&&s().translator.trans("flarum-extension-manager.admin.exceptions.guessed_cause."+this.attrs.task.guessedCause())||s().translator.trans("flarum-extension-manager.admin.sections.queue.output_modal.cause_unknown"))),m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.sections.queue.output_modal.command")),m("div",{className:"FormControl TaskOutputModal-data-command"},m("code",null,"$ composer ",this.attrs.task.command()))),m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.sections.queue.output_modal.output")),m("div",{className:"FormControl TaskOutputModal-data-output"},m("code",null,m("pre",null,this.attrs.task.output()))))))}}flarum.reg.add("flarum-extension-manager","admin/components/TaskOutputModal",H);var z=a(151),Q=a.n(z);function J(e,t){dayjs.extend(Q());const a=dayjs(t).diff(e);return dayjs.duration(a).humanize()}flarum.reg.add("flarum-extension-manager","admin/utils/humanDuration",J);class Z extends(U()){oninit(e){super.oninit(e),s().extensionManager.queue.load()}view(){return m("section",{id:"ExtensionManager-queueSection",className:"ExtensionPage-settings ExtensionManager-queueSection"},m("div",{className:"ExtensionPage-permissions-header ExtensionManager-queueSection-header"},m("div",{className:"container"},m("h2",{className:"ExtensionTitle"},s().translator.trans("flarum-extension-manager.admin.sections.queue.title")),m(l(),{className:"Button Button--icon",icon:"fas fa-sync-alt",onclick:()=>s().extensionManager.queue.load(),"aria-label":s().translator.trans("flarum-extension-manager.admin.sections.queue.refresh"),disabled:s().extensionManager.control.isLoading()}))),m("div",{className:"container"},this.queueTable()))}columns(){const e=new(L());return e.add("operation",{label:y()(s().translator.trans("flarum-extension-manager.admin.sections.queue.columns.operation")),content:e=>m("div",{className:"ExtensionManager-queueTable-operation"},m("span",{className:"ExtensionManager-queueTable-operation-icon"},this.operationIcon(e.operation())),m("span",{className:"ExtensionManager-queueTable-operation-name"},s().translator.trans("flarum-extension-manager.admin.sections.queue.operations.".concat(e.operation()))))},80),e.add("package",{label:y()(s().translator.trans("flarum-extension-manager.admin.sections.queue.columns.package")),content:e=>{var t;const a=s().data.extensions[null==(t=e.package())?void 0:t.replace(/(\/flarum-|\/flarum-ext-|\/)/g,"-")];return a?m(A(),{className:"ExtensionManager-queueTable-package",href:s().route("extension",{id:a.id})},m("div",{className:"ExtensionManager-queueTable-package-icon ExtensionIcon",style:a.icon},!!a.icon&&m(F(),{name:a.icon.name})),m("div",{className:"ExtensionManager-queueTable-package-details"},m("span",{className:"ExtensionManager-queueTable-package-title"},a.extra["flarum-extension"].title),m("span",{className:"ExtensionManager-queueTable-package-name"},e.package()))):e.package()}},75),e.add("status",{label:y()(s().translator.trans("flarum-extension-manager.admin.sections.queue.columns.status")),content:e=>m("[",null,m(R,{className:"ExtensionManager-queueTable-status",type:{running:"neutral",failure:"error",pending:"warning",success:"success"}[e.status()]},s().translator.trans("flarum-extension-manager.admin.sections.queue.statuses.".concat(e.status()))),["pending","running"].includes(e.status())&&m(q(),{size:"small",display:"inline"}))},70),e.add("elapsedTime",{label:y()(s().translator.trans("flarum-extension-manager.admin.sections.queue.columns.elapsed_time")),content:e=>e.startedAt()&&e.finishedAt()?m(T(),{text:"".concat(dayjs(e.startedAt()).format("LL LTS")," ").concat(dayjs(e.finishedAt()).format("LL LTS"))},m("span",null,J(e.startedAt(),e.finishedAt()))):s().translator.trans("flarum-extension-manager.admin.sections.queue.task_just_started")},65),e.add("memoryUsed",{label:y()(s().translator.trans("flarum-extension-manager.admin.sections.queue.columns.peak_memory_used")),content:e=>m("span",null,e.peakMemoryUsed())},60),e.add("details",{label:y()(s().translator.trans("flarum-extension-manager.admin.sections.queue.columns.details")),content:e=>m(l(),{className:"Button Button--icon Table-controls-item",icon:"fas fa-file-alt","aria-label":s().translator.trans("flarum-extension-manager.admin.sections.queue.columns.details"),onclick:()=>s().modal.show(H,{task:e}),disabled:["pending","running"].includes(e.status())}),className:"Table-controls"},55),e}queueTable(){const e=s().extensionManager.queue.getItems();if(!e)return m(q(),null);if(e&&!e.length)return m("h3",{className:"ExtensionPage-subHeader"},s().translator.trans("flarum-extension-manager.admin.sections.queue.none"));const t=this.columns();return m("[",null,m("div",{className:W()("Table-container",{"loading-container":e&&s().extensionManager.queue.isLoading()})},m("table",{className:"Table ExtensionManager-queueTable"},m("thead",null,m("tr",null,t.toArray().map(((e,t)=>m("th",{key:t},e.label))))),m("tbody",null,e.map(((e,a)=>m("tr",{key:a},t.toArray().map(((t,a)=>{const{label:n,content:s,...r}=t;return m("td",Object.assign({key:a},r),s(e))}))))))),e&&s().extensionManager.queue.isLoading()&&m(q(),{size:"large"})),m(O(),{total:s().extensionManager.queue.getTotalItems(),currentPage:s().extensionManager.queue.pageNumber()+1,perPage:s().extensionManager.queue.getPerPage(),onChange:e=>s().extensionManager.queue.goto(e)}))}operationIcon(e){return m(F(),{name:{update_check:"fas fa-sync-alt",update_major:"fas fa-play",update_minor:"fas fa-play",update_global:"fas fa-play",extension_install:"fas fa-download",extension_remove:"fas fa-times",extension_update:"fas fa-arrow-alt-circle-up",why_not:"fas fa-exclamation-circle"}[e]})}}flarum.reg.add("flarum-extension-manager","admin/components/QueueSection",Z);const K=flarum.reg.get("core","common/components/Alert");var X=a.n(K);const ee=flarum.reg.get("core","common/utils/Stream");var te=a.n(ee);class ae extends(U()){constructor(){super(...arguments),f(this,"packageName",void 0)}oninit(e){super.oninit(e),this.packageName=te()("")}view(){return m("div",{className:"Form-group ExtensionManager-installer"},m("label",{htmlFor:"install-extension"},s().translator.trans("flarum-extension-manager.admin.extensions.install")),m("div",{className:"helpText"},s().translator.trans("flarum-extension-manager.admin.extensions.install_help",{link:m("a",{href:"https://flarum.org/extensions"},"flarum.org"),semantic_link:m("a",{href:"https://devhints.io/semver"}),code:m("code",null)})),m("div",{className:"FormControl-container"},m("input",{className:"FormControl",id:"install-extension",placeholder:"vendor/package-name",bidi:this.packageName}),m(l(),{className:"Button",icon:"fas fa-download",onclick:this.onsubmit.bind(this),loading:s().extensionManager.control.isLoading("extension-install"),disabled:s().extensionManager.control.hasOperationRunning()},s().translator.trans("flarum-extension-manager.admin.extensions.proceed"))))}data(){return{package:this.packageName()}}onsubmit(){s().extensionManager.control.requirePackage(this.data())}}flarum.reg.add("flarum-extension-manager","admin/components/Installer",ae);const ne=flarum.reg.get("core","common/helpers/humanTime");var se=a.n(ne);class re extends(V()){constructor(){super(...arguments),f(this,"loading",!0),f(this,"whyNot",null)}className(){return"Modal--large WhyNotModal"}title(){return s().translator.trans("flarum-extension-manager.admin.why_not_modal.title")}oncreate(e){super.oncreate(e),this.requestWhyNot()}content(){return m("div",{className:"Modal-body"},this.loading?m(q(),null):m("pre",{className:"WhyNotModal-contents"},this.whyNot))}requestWhyNot(){s().request({method:"POST",url:"".concat(s().forum.attribute("apiUrl"),"/extension-manager/why-not"),body:{data:{package:this.attrs.package}}}).then((e=>{this.loading=!1,this.whyNot=e.data.reason,m.redraw()})).catch(b)}}flarum.reg.add("flarum-extension-manager","admin/components/WhyNotModal",re);const oe=flarum.reg.get("core","common/components/Badge");var ie=a.n(oe);const le=flarum.reg.get("core","common/utils/formatAmount");var me=a.n(le);const ue=flarum.reg.get("core","common/Model");var ce=a.n(ue);class de extends(ce()){constructor(){super(...arguments),f(this,"extensionId",ce().attribute("extensionId")),f(this,"name",ce().attribute("name")),f(this,"title",ce().attribute("title")),f(this,"description",ce().attribute("description")),f(this,"iconUrl",ce().attribute("iconUrl")),f(this,"icon",ce().attribute("icon")),f(this,"highestVersion",ce().attribute("highestVersion")),f(this,"httpUri",ce().attribute("httpUri")),f(this,"discussUri",ce().attribute("discussUri")),f(this,"vendor",ce().attribute("vendor")),f(this,"isPremium",ce().attribute("isPremium")),f(this,"isLocale",ce().attribute("isLocale")),f(this,"locale",ce().attribute("locale")),f(this,"latestFlarumVersionSupported",ce().attribute("latestFlarumVersionSupported")),f(this,"downloads",ce().attribute("downloads")),f(this,"installed",!1)}isSupported(){const e=s().data.settings.version,t=this.latestFlarumVersionSupported();return e.split("-")[1]===t.split("-")[1]&&e.split(".")[0]===t.split(".")[0]}isStable(){const e=this.highestVersion().split("-");return 1===e.length||"stable"===e[1].split(".")[0]}toLocalExtension(){return{id:this.extensionId(),name:this.name(),version:this.highestVersion(),description:this.description(),icon:this.icon()||{name:"fas fa-box-open",backgroundColor:"#117187",color:"#fff"},links:{discuss:this.discussUri(),website:this.httpUri()},extra:{"flarum-extension":{title:this.title()}}}}}flarum.reg.add("flarum-extension-manager","admin/models/ExternalExtension",de);const ge=flarum.reg.get("core","common/components/Dropdown");var pe=a.n(ge);const he=flarum.reg.get("core","common/components/LinkButton");var fe=a.n(he);class xe extends(U()){getExtension(){return this.attrs.extension instanceof de?this.attrs.extension.toLocalExtension():this.attrs.extension}view(){const e=this.getExtension(),{isCore:t,isDanger:a}=this.attrs;return m("div",{className:W()("ExtensionCard",{"ExtensionCard--core":t,"ExtensionCard--danger":a})},m("div",{className:"ExtensionCard-header"},this.icon(),m(T(),{text:e.name},m("h4",null,e.extra["flarum-extension"].title)),this.attrs.extension instanceof de&&m("div",{className:"ExtensionCard-badges"},this.badges().toArray()),m("div",{className:"ExtensionCard-actions"},this.actionItems().toArray())),m("div",{className:"ExtensionCard-body"},m("p",null,e.description)),m("div",{className:"ExtensionCard-footer"},m("div",{className:"ExtensionCard-meta"},this.metaItems().toArray())))}icon(){var e,t;const a=this.getExtension();this.attrs.extension instanceof de&&a.id in s().data.extensions&&(a.icon=s().data.extensions[a.id].icon);const n=a.icon||{};return(null==(e=a.icon)||!e.name)&&this.attrs.extension instanceof de&&!(a.id in s().data.extensions)&&this.attrs.extension.iconUrl()&&(n.backgroundImage="url(".concat(this.attrs.extension.iconUrl(),")")),m("span",{className:"ExtensionIcon",style:a.icon},null!=(t=a.icon)&&t.name?m(F(),{name:a.icon.name}):null)}badges(){const e=new(L()),t=this.attrs.extension;return t.isSupported()?e.add("compatible",m(ie(),{icon:"fas fa-check",type:"success",label:s().translator.trans("flarum-extension-manager.admin.sections.discover.extension.badges.compatible"),className:"Badge--flat Badge--square"})):e.add("incompatible",m(ie(),{icon:"fas fa-times",type:"danger",label:s().translator.trans("flarum-extension-manager.admin.sections.discover.extension.badges.incompatible"),className:"Badge--flat Badge--square"})),t.isPremium()&&e.add("premium",m(ie(),{icon:"fas fa-dollar-sign",label:s().translator.trans("flarum-extension-manager.admin.sections.discover.extension.badges.premium"),className:"ExtensionCard-badge--premium Badge--flat Badge--square"})),t.isStable()||e.add("unstable",m(ie(),{icon:"fas fa-flask",label:s().translator.trans("flarum-extension-manager.admin.sections.discover.extension.badges.unstable"),className:"Badge--flat Badge--square Badge--danger"})),"fof"===t.name().split("/")[0]&&e.add("fof",m(ie(),{icon:"fas fa-users",label:s().translator.trans("flarum-extension-manager.admin.sections.discover.extension.badges.fof"),className:"Badge--flat Badge--square"})),"flarum"===t.name().split("/")[0]&&e.add("flarum",m(ie(),{icon:"fab fa-flarum",label:s().translator.trans("flarum-extension-manager.admin.sections.discover.extension.badges.flarum"),className:"ExtensionCard-badge--flarum Badge--flat Badge--square"})),e}metaItems(){var e;const t=new(L()),{updates:a,isCore:n}=this.attrs,r=a?null!=(e=a["latest-minor"])?e:a["latest-major"]&&!n?a["latest-major"]:null:null;return this.attrs.extension instanceof de?t.add("downloads",m("span",null,m(F(),{name:"fas fa-circle-down"}),s().translator.trans("flarum-extension-manager.admin.sections.discover.extension.downloads",{count:this.attrs.extension.downloads(),formattedCount:me()(this.attrs.extension.downloads())}))):t.add("version",m("div",{className:"ExtensionCard-version"},m("span",{className:"ExtensionCard-version-current"},this.version(a.version)),r?m("[",null,m(F(),{name:"fas fa-arrow-right"}),m(R,{className:"ExtensionCard-version-latest",type:a["latest-minor"]?"success":"warning"},this.version(r))):null)),this.attrs.extension instanceof de&&(t.add("version",m("div",{className:"ExtensionCard-version"},"v",this.version(this.attrs.extension.highestVersion()))),t.add("link",m(fe(),{className:"Button Button--ua-reset Button--link Button--icon",href:this.attrs.extension.httpUri(),target:"_blank",icon:"fas fa-external-link-alt",external:!0}))),t}actionItems(){const e=new(L()),{updates:t,extension:a,onClickUpdate:n,whyNotWarning:r}=this.attrs;return a instanceof de?a.extensionId()in s().data.extensions?e.add("installed",m(l(),{className:"Button Button--icon Button--flat Button--success",icon:"fas fa-check-circle",disabled:!0})):e.add("install",m(l(),{className:"Button Button--icon Button--flat",icon:"fas fa-cloud-arrow-down",onclick:()=>{s().extensionManager.control.requirePackage({package:a.name()})}})):(n&&"function"==typeof n?e.add("update",m(T(),{text:s().translator.trans("flarum-extension-manager.admin.extensions.update")},m(l(),{icon:"fas fa-cloud-arrow-down",className:"Button Button--icon Button--flat",onclick:n,"aria-label":s().translator.trans("flarum-extension-manager.admin.extensions.update")}))):n&&e.add("update",m(pe(),{buttonClassName:"Button Button--icon Button--flat",icon:"fas fa-ellipsis",label:s().translator.trans("flarum-extension-manager.admin.extensions.update")},m(l(),{icon:"fas fa-cloud-arrow-down",onclick:n.soft},s().translator.trans("flarum-extension-manager.admin.extensions.update_soft_label")),m(l(),{icon:"fas fa-rotate",onclick:n.hard,disabled:!t["direct-dependency"]},s().translator.trans("flarum-extension-manager.admin.extensions.update_hard_label")))),r&&e.add("whyNot",m(T(),{text:s().translator.trans("flarum-extension-manager.admin.extensions.check_why_it_failed_updating")},m(l(),{icon:"fas fa-exclamation-circle",className:"Button Button--icon Button--flat Button--danger",onclick:()=>s().modal.show(re,{package:a.name}),"aria-label":s().translator.trans("flarum-extension-manager.admin.extensions.check_why_it_failed_updating")})))),e}version(e){return"v"===e.charAt(0)?e.substring(1):e}}flarum.reg.add("flarum-extension-manager","admin/components/ExtensionCard",xe);class be extends(U()){constructor(){super(...arguments),f(this,"updateState",void 0)}oninit(e){super.oninit(e),this.updateState=this.attrs.updateState}view(){return m("div",{className:W()("Form-group Form-group--danger ExtensionManager-majorUpdate",{"ExtensionManager-majorUpdate--failed":"failure"===this.updateState.status,"ExtensionManager-majorUpdate--incompatibleExtensions":this.updateState.incompatibleExtensions.length})},m("img",{alt:"flarum logo",src:s().forum.attribute("baseUrl")+"/assets/extensions/flarum-extension-manager/flarum.svg"}),m("label",null,s().translator.trans("flarum-extension-manager.admin.major_updater.title",{version:this.attrs.coreUpdate["latest-major"]})),m("p",{className:"helpText"},s().translator.trans("flarum-extension-manager.admin.major_updater.description")),m("div",{className:"ExtensionManager-updaterControls"},m(T(),{text:s().translator.trans("flarum-extension-manager.admin.major_updater.dry_run_help")},m(l(),{className:"Button",icon:"fas fa-vial",onclick:this.update.bind(this,!0),disabled:s().extensionManager.control.hasOperationRunning()},s().translator.trans("flarum-extension-manager.admin.major_updater.dry_run"))),m(l(),{className:"Button Button--danger",icon:"fas fa-play",onclick:this.update.bind(this,!1),disabled:s().extensionManager.control.hasOperationRunning()},s().translator.trans("flarum-extension-manager.admin.major_updater.update"))),this.updateState.incompatibleExtensions.length?m("div",{className:"ExtensionManager-majorUpdate-incompatibleExtensions ExtensionManager-extensions-grid"},this.updateState.incompatibleExtensions.map((e=>m(xe,{extension:s().data.extensions[e.replace("flarum-","").replace("flarum-ext-","").replace("/","-")],updates:{},onClickUpdate:null,isDanger:!0})))):null,"failure"===this.updateState.status?m(X(),{type:"error",className:"ExtensionManager-majorUpdate-failure",dismissible:!1,controls:[m(l(),{className:"Button Button--text ExtensionManager-majorUpdate-failure-details",icon:"fas fa-question-circle",onclick:()=>s().modal.show(re,{package:"flarum/core"})},s().translator.trans("flarum-extension-manager.admin.major_updater.failure.why"))]},m("p",{className:"ExtensionManager-majorUpdate-failure-desc"},s().translator.trans("flarum-extension-manager.admin.major_updater.failure.desc"))):null)}update(e){s().extensionManager.control.majorUpdate({dryRun:e})}}flarum.reg.add("flarum-extension-manager","admin/components/MajorUpdater",be);const ve=flarum.reg.get("core","common/components/InfoTile");var ye=a.n(ve);class _e extends(U()){view(){const e=s().extensionManager.control.coreUpdate;return[m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.updater.updater_title")),m("div",{className:"helpText"},s().translator.trans("flarum-extension-manager.admin.updater.updater_help")),this.lastUpdateCheckView(),m("div",{className:"ExtensionManager-updaterControls"},this.controlItems().toArray()),this.availableUpdatesView()),e&&e.package["latest-major"]?m(be,{coreUpdate:e.package,updateState:s().extensionManager.control.lastUpdateRun.major}):null]}lastUpdateCheckView(){var e;return(null==(e=s().extensionManager.control.lastUpdateCheck)?void 0:e.checkedAt)&&m("p",{className:"ExtensionManager-lastUpdatedAt"},m("span",{className:"ExtensionManager-lastUpdatedAt-label"},s().translator.trans("flarum-extension-manager.admin.updater.last_update_checked_at")),m("span",{className:"ExtensionManager-lastUpdatedAt-value"},se()(s().extensionManager.control.lastUpdateCheck.checkedAt)))||null}availableUpdatesView(){const e=s().extensionManager.control;if(s().extensionManager.control.isLoading("check")||s().extensionManager.control.isLoading("global-update"))return m("div",{className:"ExtensionManager-extensions"},m(q(),null));const t=e.coreUpdate&&e.coreUpdate.package["latest-minor"];return e.extensionUpdates.length||t?m("div",{className:"ExtensionManager-extensions"},m("div",{className:"ExtensionManager-extensions-grid"},t?m(xe,{extension:e.coreUpdate.extension,updates:e.coreUpdate.package,isCore:!0,onClickUpdate:()=>e.updateCoreMinor(),whyNotWarning:e.lastUpdateRun.limitedPackages().includes("flarum/core")}):null,e.extensionUpdates.map((t=>m(xe,{extension:t,updates:e.packageUpdates[t.id],onClickUpdate:{soft:()=>e.updateExtension(t,"soft"),hard:()=>e.updateExtension(t,"hard")},whyNotWarning:e.lastUpdateRun.limitedPackages().includes(t.name)}))))):m("div",{className:"ExtensionManager-extensions ExtensionManager-extensions--empty"},m(ye(),{icon:"fas fa-plug-circle-check"},s().translator.trans("flarum-extension-manager.admin.updater.up_to_date")))}controlItems(){const e=new(L());return e.add("updateCheck",m(l(),{className:"Button",icon:"fas fa-sync-alt",onclick:()=>s().extensionManager.control.checkForUpdates(),loading:s().extensionManager.control.isLoading("check"),disabled:s().extensionManager.control.hasOperationRunning()},s().translator.trans("flarum-extension-manager.admin.updater.check_for_updates")),100),e.add("globalUpdate",m(l(),{className:"Button",icon:"fas fa-play",onclick:()=>s().extensionManager.control.updateGlobally(),loading:s().extensionManager.control.isLoading("global-update"),disabled:s().extensionManager.control.hasOperationRunning()},s().translator.trans("flarum-extension-manager.admin.updater.run_global_update"))),e}}flarum.reg.add("flarum-extension-manager","admin/components/Updater",_e);const ke=flarum.reg.get("core","common/components/Form");var Ne=a.n(ke);class Me extends(U()){oninit(e){super.oninit(e)}view(){return m("div",{className:"ExtensionPage-settings ExtensionManager-controlSection"},m("div",{className:"container"},s().data["flarum-extension-manager.writable_dirs"]?m(Ne(),null,m(ae,null),m(_e,null)):m("div",{className:"Form-group"},m(X(),{type:"warning",dismissible:!1},s().translator.trans("flarum-extension-manager.admin.file_permissions")))))}}flarum.reg.add("flarum-extension-manager","admin/components/ControlSection",Me);const we=flarum.reg.get("core","common/components/FormGroup");var Ee=a.n(we);class Se extends(U()){constructor(){super(...arguments),f(this,"settings",{}),f(this,"initialSettings",null),f(this,"loading",!1),f(this,"type",void 0)}oninit(e){super.oninit(e),this.submit(!0)}className(){return""}view(){return m("div",{className:W()("FormSection",this.className())},m("label",null,this.title()),this.content(),m("div",{className:"Form-group Form-controls"},this.submitButton()))}submitButton(){return[m(l(),{className:"Button Button--primary",loading:this.loading,onclick:()=>this.submit(!1),disabled:!this.isDirty()},s().translator.trans("core.admin.settings.submit_button"))]}customSettingComponents(){return Ee().prototype.customFieldComponents()}setting(e){var t;return null!=(t=this.settings[e])?t:this.settings[e]=te()()}submit(e){this.loading=!0;const t={};Object.keys(this.settings).forEach((e=>{t[e]=this.settings[e]()})),s().request({method:"POST",url:s().forum.attribute("apiUrl")+"/extension-manager/composer",body:{type:this.type,data:e?null:t}}).then((e=>{let{data:t}=e;Object.keys(t).forEach((e=>{this.settings[e]=te()(t[e])})),this.initialSettings=Array.isArray(t)?{}:t})).finally((()=>{this.loading=!1,m.redraw()}))}isDirty(){return JSON.stringify(this.initialSettings)!==JSON.stringify(this.settings)}}flarum.reg.add("flarum-extension-manager","admin/components/ConfigureJson",Se);const Be=flarum.reg.get("core","common/components/Select");var Ue=a.n(Be);class Ce extends(V()){constructor(){super(...arguments),f(this,"name",void 0),f(this,"repository",void 0)}oninit(e){super.oninit(e),this.name=te()(this.attrs.name||""),this.repository=te()(this.attrs.repository||{type:"composer",url:""})}className(){return"RepositoryModal Modal--small"}title(){const e=this.attrs.repository?"edit":"add";return s().translator.trans("flarum-extension-manager.admin.composer.".concat(e,"_repository_label"))}content(){const e={composer:s().translator.trans("flarum-extension-manager.admin.composer.repositories.types.composer"),vcs:s().translator.trans("flarum-extension-manager.admin.composer.repositories.types.vcs"),path:s().translator.trans("flarum-extension-manager.admin.composer.repositories.types.path")};return m("div",{className:"Modal-body"},m(Ne(),null,m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.composer.repositories.add_modal.name_label")),m("input",{className:"FormControl",bidi:this.name})),m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.composer.repositories.add_modal.type_label")),m(Ue(),{options:e,value:this.repository().type,onchange:e=>this.repository({...this.repository(),type:e})})),m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.composer.repositories.add_modal.url")),m("input",{className:"FormControl",onchange:e=>this.repository({...this.repository(),url:e.target.value}),value:this.repository().url})),m("div",{className:"Form-group"},m(l(),{className:"Button Button--primary",onclick:this.submit.bind(this)},s().translator.trans("flarum-extension-manager.admin.composer.repositories.add_modal.submit_button")))))}submit(){this.attrs.onsubmit(this.repository(),this.name()),this.hide()}}flarum.reg.add("flarum-extension-manager","admin/components/RepositoryModal",Ce);class qe extends Se{constructor(){super(...arguments),f(this,"type","composer")}title(){return s().translator.trans("flarum-extension-manager.admin.composer.title")}className(){return"ConfigureComposer"}content(){return m("div",{className:"Form ExtensionManager-SettingsGroups-content"},this.attrs.buildSettingComponent.call(this,{setting:"minimum-stability",label:s().translator.trans("flarum-extension-manager.admin.composer.minimum_stability.label"),help:s().translator.trans("flarum-extension-manager.admin.composer.minimum_stability.help"),type:"select",options:{stable:s().translator.trans("flarum-extension-manager.admin.composer.minimum_stability.options.stable"),RC:s().translator.trans("flarum-extension-manager.admin.composer.minimum_stability.options.rc"),beta:s().translator.trans("flarum-extension-manager.admin.composer.minimum_stability.options.beta"),alpha:s().translator.trans("flarum-extension-manager.admin.composer.minimum_stability.options.alpha"),dev:s().translator.trans("flarum-extension-manager.admin.composer.minimum_stability.options.dev")}}),m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.composer.repositories.label")),m("div",{className:"helpText"},s().translator.trans("flarum-extension-manager.admin.composer.repositories.help")),m("div",{className:"ConfigureComposer-repositories"},Object.keys(this.setting("repositories")()||{}).map((e=>{const t=this.setting("repositories")()[e];return m("div",{className:"ButtonGroup ButtonGroup--full"},m(l(),{className:"Button",icon:{composer:"fas fa-cubes",vcs:"fas fa-code-branch",path:"fas fa-folder"}[t.type],onclick:()=>s().modal.show(Ce,{name:e,repository:t,onsubmit:(t,a)=>{const n=this.setting("repositories")();delete n[e],this.setting("repositories")(n),this.onchange(t,a)}})},e," (",t.type,")"),m(l(),{className:"Button Button--icon",icon:"fas fa-trash","aria-label":s().translator.trans("flarum-extension-manager.admin.composer.delete_repository_label"),onclick:()=>{if(confirm(y()(s().translator.trans("flarum-extension-manager.admin.composer.delete_repository_confirmation")))){const t={...this.setting("repositories")()};delete t[e],this.setting("repositories")(t)}}}))})))))}submitButton(){const e=super.submitButton();return e.push(m(l(),{className:"Button",onclick:()=>s().modal.show(Ce,{onsubmit:this.onchange.bind(this)})},s().translator.trans("flarum-extension-manager.admin.composer.add_repository_label"))),e}onchange(e,t){this.setting("repositories")({...this.setting("repositories")(),[t]:e})}}flarum.reg.add("flarum-extension-manager","admin/components/ConfigureComposer",qe);class Pe extends(V()){constructor(){super(...arguments),f(this,"type",void 0),f(this,"host",void 0),f(this,"token",void 0)}oninit(e){super.oninit(e),this.type=te()(this.attrs.type||"bearer"),this.host=te()(this.attrs.host||""),this.token=te()(this.attrs.token||"")}className(){return"AuthMethodModal Modal--small"}title(){const e=this.attrs.host?"edit":"add";return s().translator.trans("flarum-extension-manager.admin.auth_config.".concat(e,"_label"))}content(){const e={"github-oauth":s().translator.trans("flarum-extension-manager.admin.auth_config.types.github-oauth"),"gitlab-oauth":s().translator.trans("flarum-extension-manager.admin.auth_config.types.gitlab-oauth"),"gitlab-token":s().translator.trans("flarum-extension-manager.admin.auth_config.types.gitlab-token"),bearer:s().translator.trans("flarum-extension-manager.admin.auth_config.types.bearer")};return m("div",{className:"Modal-body"},m(Ne(),null,m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.auth_config.add_modal.type_label")),m(Ue(),{options:e,value:this.type(),onchange:this.type})),m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.auth_config.add_modal.host_label")),m("input",{className:"FormControl",bidi:this.host,placeholder:s().translator.trans("flarum-extension-manager.admin.auth_config.add_modal.host_placeholder")})),m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.auth_config.add_modal.token_label")),m("textarea",{className:"FormControl",oninput:e=>this.token(e.target.value),rows:"6",placeholder:this.token().startsWith("unchanged:")?y()(s().translator.trans("flarum-extension-manager.admin.auth_config.add_modal.unchanged_token_placeholder")):""},this.token().startsWith("unchanged:")?"":this.token())),m("div",{className:"Form-group"},m(l(),{className:"Button Button--primary",onclick:this.submit.bind(this)},s().translator.trans("flarum-extension-manager.admin.auth_config.add_modal.submit_button")))))}submit(){this.attrs.onsubmit(this.type(),this.host(),this.token()),this.hide()}}flarum.reg.add("flarum-extension-manager","admin/components/AuthMethodModal",Pe);class Te extends Se{constructor(){super(...arguments),f(this,"type","auth")}title(){return s().translator.trans("flarum-extension-manager.admin.auth_config.title")}className(){return"ConfigureAuth"}content(){const e=Object.keys(this.settings),t=e.length&&e.every((e=>{const t=this.settings[e]();return Array.isArray(t)?t.length:Object.keys(t).length}));return m("div",{className:"ExtensionManager-SettingsGroups-content"},t?e.map((e=>{const t=this.settings[e]();return m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.auth_config.types.".concat(e))),m("div",{className:"ConfigureAuth-hosts"},Object.keys(t).map((a=>{const n=t[a];return m("div",{className:"ButtonGroup ButtonGroup--full"},m(l(),{className:"Button",icon:"fas fa-key",onclick:()=>s().modal.show(Pe,{type:e,host:a,token:n,onsubmit:this.onchange.bind(this,a)})},a),m(l(),{className:"Button Button--icon",icon:"fas fa-trash","aria-label":s().translator.trans("flarum-extension-manager.admin.auth_config.delete_label"),onclick:()=>{if(confirm(y()(s().translator.trans("flarum-extension-manager.admin.auth_config.delete_confirmation")))){const t={...this.setting(e)()};delete t[a],Object.keys(t).length?this.setting(e)(t):delete this.settings[e]}}}))}))))})):m("span",{className:"helpText"},s().translator.trans("flarum-extension-manager.admin.auth_config.no_auth_methods_configured")))}submitButton(){const e=super.submitButton();return e.push(m(l(),{className:"Button",loading:this.loading,onclick:()=>s().modal.show(Pe,{onsubmit:this.onchange.bind(this,null)})},s().translator.trans("flarum-extension-manager.admin.auth_config.add_label"))),e}onchange(e,t,a,n){const s={...this.setting(t)()};e&&delete s[e],s[a]=n,this.setting(t)(s)}}flarum.reg.add("flarum-extension-manager","admin/components/ConfigureAuth",Te);const je=flarum.reg.get("core","common/components/Input");var Fe=a.n(je);const $e=flarum.reg.get("core","common/helpers/listItems");var Le=a.n($e);const Ie=flarum.reg.get("core","common/utils/throttleDebounce");class Ae extends(U()){constructor(){super(...arguments),f(this,"search",te()("")),f(this,"warningsDismissed",te()(!1)),f(this,"applySearch",(0,Ie.throttle)(1200,(e=>{const t=s().extensionManager.extensions.getParams();s().extensionManager.extensions.refreshParams({...t,filter:{...t.filter,q:e}},1)})))}oninit(e){super.oninit(e),s().extensionManager.extensions.goto(1),this.warningsDismissed("true"===localStorage.getItem("flarum-extension-manager.warningsDismissed"))}load(e){void 0===e&&(e=1),s().extensionManager.extensions.goto(e)}view(){return m("div",{className:"ExtensionPage-settings ExtensionManager-DiscoverSection"},m("div",{className:"container"},m(Ne(),null,m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.sections.discover.title")),m("div",{className:"helpText"},s().translator.trans("flarum-extension-manager.admin.sections.discover.description"),this.warningsDismissed()&&m(l(),{className:"Button Button--text Button--warning Button--more",icon:"fas fa-exclamation-triangle",onclick:()=>this.setWarningDismissed(!1)}))),!this.warningsDismissed()&&m("div",{className:"ExtensionManager-warnings Form-group"},m(X(),{className:"ExtensionManager-primaryWarning",type:"warning",dismissible:!0,ondismiss:()=>this.setWarningDismissed(!0)},m("ul",null,Le()(this.warningItems().toArray())))),m("div",{className:"Tabs"},m("div",{className:"Tabs-nav"},this.tabItems().toArray()),m("div",{className:"Tabs-content"},m("hr",{className:"Tabs-divider"}),m("div",{className:"ExtensionManager-DiscoverSection-toolbar"},m("div",{className:"ExtensionManager-DiscoverSection-toolbar-primary"},this.toolbarPrimaryItems().toArray()),m("div",{className:"ExtensionManager-DiscoverSection-toolbar-secondary"},this.toolbarSecondaryItems().toArray())),this.extensionList(),m("div",{className:"ExtensionManager-DiscoverSection-footer"},this.footerItems().toArray()))))))}tabFilters(){return{"":{label:s().translator.trans("flarum-extension-manager.admin.sections.discover.tabs.discover"),active:()=>{var e;return!(null!=(e=s().extensionManager.extensions.getParams().filter)&&e.type)}},extension:{label:s().translator.trans("flarum-extension-manager.admin.sections.discover.tabs.extensions"),active:()=>{var e;return"extension"===(null==(e=s().extensionManager.extensions.getParams().filter)?void 0:e.type)}},locale:{label:s().translator.trans("flarum-extension-manager.admin.sections.discover.tabs.languages"),active:()=>{var e;return"locale"===(null==(e=s().extensionManager.extensions.getParams().filter)?void 0:e.type)}},theme:{label:s().translator.trans("flarum-extension-manager.admin.sections.discover.tabs.themes"),active:()=>{var e;return"theme"===(null==(e=s().extensionManager.extensions.getParams().filter)?void 0:e.type)}}}}tabItems(){const e=new(L()),t=this.tabFilters();return Object.keys(t).forEach((a=>{const n=t[a];e.add(a,m(l(),{className:"Button Button--link",active:n.active(),onclick:()=>{s().extensionManager.extensions.changeFilter("type",a)}},n.label))})),e}warningItems(){const e=new(L());return e.add("accessWarning",s().translator.trans("flarum-extension-manager.admin.settings.access_warning")),s().data.debugEnabled&&e.add("devModeWarning",s().translator.trans("flarum-extension-manager.admin.settings.debug_mode_warning")),e}toolbarPrimaryItems(){const e=new(L());return e.add("search",m(Fe(),{value:this.search(),onchange:e=>{this.search(e),this.applySearch(e)},inputAttrs:{className:"FormControl-alt"},clearable:!0,placeholder:s().translator.trans("flarum-extension-manager.admin.sections.discover.search"),prefixIcon:"fas fa-search"})),e}toolbarSecondaryItems(){var e,t;const a=new(L()),n=s().extensionManager.extensions.sortMap(),r=Object.keys(n).reduce(((e,t)=>{const a=n[t];return e[t]="string"!=typeof a?a.label:a,e}),{});a.add("sort",m(pe(),{buttonClassName:"Button",label:r[s().extensionManager.extensions.getParams().sort]||Object.keys(n).map((e=>r[e]))[0],accessibleToggleLabel:s().translator.trans("flarum-extension-manager.admin.sections.discover.sort.toggle_dropdown_accessible_label")},Object.keys(r).map((e=>{const t=r[e],a=s().extensionManager.extensions.getParams().sort===e;return m(l(),{icon:!a||"fas fa-check",onclick:()=>s().extensionManager.extensions.changeSort(e),active:a},t)}))));const o=(null!=(e=null==(t=s().extensionManager.extensions.getParams().filter)||null==(t=t.is)?void 0:t[0])?e:null)||"all";return a.add("party",m(pe(),{buttonClassName:"Button",label:s().translator.trans("flarum-extension-manager.admin.sections.discover.party_filter."+o),accessibleToggleLabel:s().translator.trans("flarum-extension-manager.admin.sections.discover.party_filter.toggle_dropdown_accessible_label")},["all","premium"].map((e=>m(l(),{icon:o!==e||"fas fa-check",onclick:()=>{s().extensionManager.extensions.changeFilter("is","all"===e?void 0:[e])},active:o===e},s().translator.trans("flarum-extension-manager.admin.sections.discover.party_filter."+e)))))),a}extensionList(){return!s().extensionManager.extensions.hasItems()&&s().extensionManager.extensions.isLoading()?m(q(),{display:"block"}):s().extensionManager.extensions.hasItems()?m("div",{className:W()("ExtensionManager-DiscoverSection-list",{"loading-container":s().extensionManager.extensions.isLoading()})},m("div",{className:"ExtensionManager-DiscoverSection-list-inner"},s().extensionManager.extensions.getPages().map((e=>e.items.map((e=>m(xe,{extension:e,key:e.name()})))))),s().extensionManager.extensions.hasItems()&&s().extensionManager.extensions.isLoading()&&m(q(),{size:"large"})):m("div",{className:"ExtensionManager-DiscoverSection-list ExtensionManager-DiscoverSection-list--empty"},m(ye(),{icon:"fas fa-plug-circle-exclamation"},s().translator.trans("flarum-extension-manager.admin.sections.discover.empty_results")))}footerItems(){const e=new(L());return e.add("pagination",m(O(),{total:s().extensionManager.extensions.totalItems,perPage:s().extensionManager.extensions.pageSize,currentPage:s().extensionManager.extensions.getLocation().page,onChange:e=>{s().extensionManager.extensions.getLocation().page!==e&&this.load(e)}})),e.add("premiumTermsLink",m(fe(),{className:"Button Button--link",href:"https://flarum.org/terms/premium-extensions",external:!0,target:"_blank",icon:"fas fa-circle-info"},s().translator.trans("flarum-extension-manager.admin.sections.discover.premium_extension_terms"))),e}setWarningDismissed(e){this.warningsDismissed(e),localStorage.setItem("flarum-extension-manager.warningsDismissed",e?"true":"false")}}flarum.reg.add("flarum-extension-manager","admin/components/DiscoverSection",Ae);class De extends(o()){content(){const e=s().registry.getSettings(this.extension.id);return m("div",{className:"ExtensionPage-settings"},m("div",{className:"container"},e?[m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.sections.settings.title")),m("div",{className:"helpText"},s().translator.trans("flarum-extension-manager.admin.sections.settings.description"))),m("div",{className:"FormSectionGroup ExtensionManager-SettingsGroups"},m("div",{className:"FormSection"},m("label",null,s().translator.trans("flarum-extension-manager.admin.settings.title")),m("div",{className:"Form"},e.map(this.buildSettingComponent.bind(this))),m("div",{className:"Form-group Form--controls"},this.submitButton())),m(qe,{buildSettingComponent:this.buildSettingComponent}),m(Te,{buildSettingComponent:this.buildSettingComponent}))]:m("h3",{className:"ExtensionPage-subHeader"},s().translator.trans("core.admin.extension.no_settings"))))}sections(e){const t=super.sections(e);return t.add("discover",m(Ae,null),15),t.add("control",m(Me,null),10),t.setPriority("content",8),"0"!==s().data.settings["flarum-extension-manager.queue_jobs"]&&s().data.settings["flarum-extension-manager.queue_jobs"]&&t.add("queue",m(Z,null),5),t.remove("permissions"),t}onsaved(){super.onsaved(),m.redraw()}}flarum.reg.add("flarum-extension-manager","admin/components/SettingsPage",De);const Oe=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],Ye=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],We=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],Re=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],Ge=(e,t,a)=>{let n=e;return"string"==typeof t||Array.isArray(t)?n=e.toLocaleString(t,a):!0!==t&&void 0===a||(n=e.toLocaleString(void 0,a)),n};class Ve extends(ce()){status(){return ce().attribute("status").call(this)}operation(){return ce().attribute("operation").call(this)}command(){return ce().attribute("command").call(this)}package(){return ce().attribute("package").call(this)}output(){return ce().attribute("output").call(this)}guessedCause(){return ce().attribute("guessedCause").call(this)}createdAt(){return ce().attribute("createdAt",ce().transformDate).call(this)}startedAt(){return ce().attribute("startedAt",ce().transformDate).call(this)}finishedAt(){return ce().attribute("finishedAt",ce().transformDate).call(this)}peakMemoryUsed(){return function(e,t){if(!Number.isFinite(e))throw new TypeError("Expected a finite number, got ".concat(typeof e,": ").concat(e));const a=(t={bits:!1,binary:!1,space:!0,...t}).bits?t.binary?Re:We:t.binary?Ye:Oe,n=t.space?" ":"";if(t.signed&&0===e)return" 0".concat(n).concat(a[0]);const s=e<0,r=s?"-":t.signed?"+":"";let o;if(s&&(e=-e),void 0!==t.minimumFractionDigits&&(o={minimumFractionDigits:t.minimumFractionDigits}),void 0!==t.maximumFractionDigits&&(o={maximumFractionDigits:t.maximumFractionDigits,...o}),e<1)return r+Ge(e,t.locale,o)+n+a[0];const i=Math.min(Math.floor(t.binary?Math.log(e)/Math.log(1024):Math.log10(e)/3),a.length-1);return e/=(t.binary?1024:1e3)**i,o||(e=e.toPrecision(3)),r+Ge(Number(e),t.locale,o)+n+a[i]}(1024*ce().attribute("peakMemoryUsed").call(this))}}flarum.reg.add("flarum-extension-manager","admin/models/Task",Ve);const He=[(new(S().Store)).add("extension-manager-tasks",Ve).add("external-extensions",de),(new(S().Admin)).setting((()=>({setting:"flarum-extension-manager.queue_jobs",label:s().translator.trans("flarum-extension-manager.admin.settings.queue_jobs"),help:m.trust(y()(s().translator.trans("flarum-extension-manager.admin.settings.queue_jobs_help",{basic_impl_link:"https://discuss.flarum.org/d/28151-database-queue-the-simplest-queue-even-for-shared-hosting",adv_impl_link:"https://discuss.flarum.org/d/21873-redis-sessions-cache-queues",php_version:"".concat(s().data.phpVersion,""),folder_perms_link:"https://docs.flarum.org/install#folder-ownership"}))),type:"boolean",disabled:s().data["flarum-extension-manager.using_sync_queue"]}))).setting((()=>({setting:"flarum-extension-manager.task_retention_days",label:s().translator.trans("flarum-extension-manager.admin.settings.task_retention_days"),help:s().translator.trans("flarum-extension-manager.admin.settings.task_retention_days_help"),type:"number"}))).page(De).generalIndexItems("settings",(()=>[{id:"minimum-stability",label:s().translator.trans("flarum-extension-manager.admin.composer.minimum_stability.label",{},!0),help:s().translator.trans("flarum-extension-manager.admin.composer.minimum_stability.help",{},!0)},{id:"repositories",label:s().translator.trans("flarum-extension-manager.admin.composer.repositories.label",{},!0),help:s().translator.trans("flarum-extension-manager.admin.composer.repositories.help",{},!0)},{id:"composer-auth",label:s().translator.trans("flarum-extension-manager.admin.auth_config.title",{},!0)},{id:"updates",label:s().translator.trans("flarum-extension-manager.admin.updater.updater_title",{},!0),help:s().translator.trans("flarum-extension-manager.admin.updater.updater_help",{},!0)}]))];s().initializers.add("flarum-extension-manager",(t=>{t.extensionManager=new w,t.data["flarum-extension-manager.using_sync_queue"]&&(t.data.settings["flarum-extension-manager.queue_jobs"]="0"),(0,e.extend)(o().prototype,"topItems",(function(e){"flarum-extension-manager"===this.extension.id||g()(this.extension.id)||e.add("remove",m(l(),{className:"Button Button--danger",icon:"fas fa-times",onclick:()=>{t.modal.show(c()),t.request({url:"".concat(t.forum.attribute("apiUrl"),"/extension-manager/extensions/").concat(this.extension.id),method:"DELETE"}).then((e=>{null!=e&&e.processing?p():(t.alerts.show({type:"success"},t.translator.trans("flarum-extension-manager.admin.extensions.successful_remove")),window.location=t.forum.attribute("adminUrl"))})).finally((()=>{t.modal.close()}))}},t.translator.trans("flarum-extension-manager.admin.extensions.remove")))}))}))})(),module.exports=n})(); +(()=>{var e={151:function(e){e.exports=function(){"use strict";var e,t,a=1e3,n=6e4,s=36e5,r=864e5,o=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,i=31536e6,l=2628e6,m=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,u={years:i,months:l,days:r,hours:s,minutes:n,seconds:a,milliseconds:1,weeks:6048e5},c=function(e){return e instanceof b},d=function(e,t,a){return new b(e,a,t.$l)},g=function(e){return t.p(e)+"s"},p=function(e){return e<0},h=function(e){return p(e)?Math.ceil(e):Math.floor(e)},f=function(e){return Math.abs(e)},x=function(e,t){return e?p(e)?{negative:!0,format:""+f(e)+t}:{negative:!1,format:""+e+t}:{negative:!1,format:""}},b=function(){function p(e,t,a){var n=this;if(this.$d={},this.$l=a,void 0===e&&(this.$ms=0,this.parseFromMilliseconds()),t)return d(e*u[g(t)],this);if("number"==typeof e)return this.$ms=e,this.parseFromMilliseconds(),this;if("object"==typeof e)return Object.keys(e).forEach((function(t){n.$d[g(t)]=e[t]})),this.calMilliseconds(),this;if("string"==typeof e){var s=e.match(m);if(s){var r=s.slice(2).map((function(e){return null!=e?Number(e):0}));return this.$d.years=r[0],this.$d.months=r[1],this.$d.weeks=r[2],this.$d.days=r[3],this.$d.hours=r[4],this.$d.minutes=r[5],this.$d.seconds=r[6],this.calMilliseconds(),this}}return this}var f=p.prototype;return f.calMilliseconds=function(){var e=this;this.$ms=Object.keys(this.$d).reduce((function(t,a){return t+(e.$d[a]||0)*u[a]}),0)},f.parseFromMilliseconds=function(){var e=this.$ms;this.$d.years=h(e/i),e%=i,this.$d.months=h(e/l),e%=l,this.$d.days=h(e/r),e%=r,this.$d.hours=h(e/s),e%=s,this.$d.minutes=h(e/n),e%=n,this.$d.seconds=h(e/a),e%=a,this.$d.milliseconds=e},f.toISOString=function(){var e=x(this.$d.years,"Y"),t=x(this.$d.months,"M"),a=+this.$d.days||0;this.$d.weeks&&(a+=7*this.$d.weeks);var n=x(a,"D"),s=x(this.$d.hours,"H"),r=x(this.$d.minutes,"M"),o=this.$d.seconds||0;this.$d.milliseconds&&(o+=this.$d.milliseconds/1e3,o=Math.round(1e3*o)/1e3);var i=x(o,"S"),l=e.negative||t.negative||n.negative||s.negative||r.negative||i.negative,m=s.format||r.format||i.format?"T":"",u=(l?"-":"")+"P"+e.format+t.format+n.format+m+s.format+r.format+i.format;return"P"===u||"-P"===u?"P0D":u},f.toJSON=function(){return this.toISOString()},f.format=function(e){var a=e||"YYYY-MM-DDTHH:mm:ss",n={Y:this.$d.years,YY:t.s(this.$d.years,2,"0"),YYYY:t.s(this.$d.years,4,"0"),M:this.$d.months,MM:t.s(this.$d.months,2,"0"),D:this.$d.days,DD:t.s(this.$d.days,2,"0"),H:this.$d.hours,HH:t.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:t.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:t.s(this.$d.seconds,2,"0"),SSS:t.s(this.$d.milliseconds,3,"0")};return a.replace(o,(function(e,t){return t||String(n[e])}))},f.as=function(e){return this.$ms/u[g(e)]},f.get=function(e){var t=this.$ms,a=g(e);return"milliseconds"===a?t%=1e3:t="weeks"===a?h(t/u[a]):this.$d[a],t||0},f.add=function(e,t,a){var n;return n=t?e*u[g(t)]:c(e)?e.$ms:d(e,this).$ms,d(this.$ms+n*(a?-1:1),this)},f.subtract=function(e,t){return this.add(e,t,!0)},f.locale=function(e){var t=this.clone();return t.$l=e,t},f.clone=function(){return d(this.$ms,this)},f.humanize=function(t){return e().add(this.$ms,"ms").locale(this.$l).fromNow(!t)},f.valueOf=function(){return this.asMilliseconds()},f.milliseconds=function(){return this.get("milliseconds")},f.asMilliseconds=function(){return this.as("milliseconds")},f.seconds=function(){return this.get("seconds")},f.asSeconds=function(){return this.as("seconds")},f.minutes=function(){return this.get("minutes")},f.asMinutes=function(){return this.as("minutes")},f.hours=function(){return this.get("hours")},f.asHours=function(){return this.as("hours")},f.days=function(){return this.get("days")},f.asDays=function(){return this.as("days")},f.weeks=function(){return this.get("weeks")},f.asWeeks=function(){return this.as("weeks")},f.months=function(){return this.get("months")},f.asMonths=function(){return this.as("months")},f.years=function(){return this.get("years")},f.asYears=function(){return this.as("years")},p}(),v=function(e,t,a){return e.add(t.years()*a,"y").add(t.months()*a,"M").add(t.days()*a,"d").add(t.hours()*a,"h").add(t.minutes()*a,"m").add(t.seconds()*a,"s").add(t.milliseconds()*a,"ms")};return function(a,n,s){e=s,t=s().$utils(),s.duration=function(e,t){var a=s.locale();return d(e,{$l:a},t)},s.isDuration=c;var r=n.prototype.add,o=n.prototype.subtract;n.prototype.add=function(e,t){return c(e)?v(this,e,1):r.bind(this)(e,t)},n.prototype.subtract=function(e,t){return c(e)?v(this,e,-1):o.bind(this)(e,t)}}}()}},t={};function a(n){var s=t[n];if(void 0!==s)return s.exports;var r=t[n]={exports:{}};return e[n].call(r.exports,r,r.exports,a),r.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};(()=>{"use strict";a.r(n),a.d(n,{extend:()=>Je});const e=flarum.reg.get("core","common/extend"),t=flarum.reg.get("core","admin/app");var s=a.n(t);const r=flarum.reg.get("core","admin/components/ExtensionPage");var o=a.n(r);const i=flarum.reg.get("core","common/components/Button");var l=a.n(i);const u=flarum.reg.get("core","admin/components/LoadingModal");var c=a.n(u);const d=flarum.reg.get("core","admin/utils/isExtensionEnabled");var g=a.n(d);function p(){s().modal.close(),m.route.set(s().route("extension",{id:"flarum-extension-manager"})),s().extensionManager.queue.load({},!0),setTimeout((()=>{var e;null==(e=document.getElementById("ExtensionManager-queueSection"))||e.scrollIntoView({block:"nearest"})}),200)}function h(e){return h="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},h(e)}function f(e,t,a){return n=function(e,t){if("object"!=h(e)||!e)return e;var a=e[Symbol.toPrimitive];if(void 0!==a){var n=a.call(e,"string");if("object"!=h(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(t),(t="symbol"==h(n)?n:n+"")in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e;var n}window.jumpToQueue=p,flarum.reg.add("flarum-extension-manager","admin/utils/jumpToQueue",p);class x{constructor(){f(this,"polling",null),f(this,"tasks",null),f(this,"limit",20),f(this,"offset",0),f(this,"total",0),f(this,"loading",!1)}load(e,t){var a;return void 0===t&&(t=!1),this.loading=!0,e={page:{limit:this.limit,offset:this.offset,...null==(a=e)?void 0:a.page},...e},s().store.find("extension-manager-tasks",e||{}).then((e=>{var a;return this.tasks=e,this.total=(null==(a=e.payload.meta)||null==(a=a.page)?void 0:a.total)||0,m.redraw(),(null==e?void 0:e.find((e=>"pending"===e.status()||"running"===e.status())))?this.pollQueue(t):t?(s().extensionManager.control.setLoading(null),window.location.reload()):s().extensionManager.control.isLoading()&&s().extensionManager.control.setLoading(null),this.loading=!1,e}))}isLoading(){return this.loading}getItems(){return this.tasks}getTotalItems(){return this.total}getTotalPages(){return Math.ceil(this.total/this.limit)}pageNumber(){return Math.ceil(this.offset/this.limit)}getPerPage(){return this.limit}hasPrev(){return 0!==this.pageNumber()}hasNext(){return this.offset+this.limit{this.load({},e)}),6e3)}hasPending(){var e;return!(null==(e=this.tasks)||!e.find((e=>"pending"===e.status()||"running"===e.status())))}}function b(e){s().extensionManager.control.setLoading(null);const t=e.response.errors[0];if(!["composer_command_failure","extension_already_installed","extension_not_installed"].includes(t.code))throw e;switch(s().alerts.clear(),t.code){case"composer_command_failure":t.guessed_cause?(s().alerts.show({type:"error"},s().translator.trans("flarum-extension-manager.admin.exceptions.guessed_cause.".concat(t.guessed_cause))),s().modal.close()):s().alerts.show({type:"error"},s().translator.trans("flarum-extension-manager.admin.exceptions.composer_command_failure"));break;case"extension_already_installed":s().alerts.show({type:"error"},s().translator.trans("flarum-extension-manager.admin.exceptions.extension_already_installed")),s().modal.close();break;case"extension_not_installed":s().alerts.show({type:"error"},s().translator.trans("flarum-extension-manager.admin.exceptions.extension_not_installed")),s().modal.close()}}flarum.reg.add("flarum-extension-manager","admin/states/QueueState",x);const v=flarum.reg.get("core","common/utils/extractText");var y=a.n(v);class _{get lastUpdateRun(){const e=JSON.parse(s().data.settings["flarum-extension-manager.last_update_run"]);return e.limitedPackages=()=>[...e.major.limitedPackages,...e.minor.limitedPackages,...e.global.limitedPackages],e}constructor(){f(this,"loading",null),f(this,"packageUpdates",{}),f(this,"lastUpdateCheck",void 0),f(this,"extensionUpdates",void 0),f(this,"coreUpdate",null),this.lastUpdateCheck=JSON.parse(s().data.settings["flarum-extension-manager.last_update_check"]),this.extensionUpdates=this.formatExtensionUpdates(this.lastUpdateCheck),this.coreUpdate=this.formatCoreUpdate(this.lastUpdateCheck)}isLoading(e){return void 0===e&&(e=null),e&&this.loading===e||!e&&null!==this.loading}hasOperationRunning(){return this.isLoading()||s().extensionManager.queue.hasPending()}setLoading(e){this.loading=e}requirePackage(e){s().extensionManager.control.setLoading("extension-install"),s().modal.show(c()),s().request({method:"POST",url:"".concat(s().forum.attribute("apiUrl"),"/extension-manager/extensions"),body:{data:e}}).then((e=>{if(e.processing)p();else{const t=e.id;s().alerts.show({type:"success"},s().translator.trans("flarum-extension-manager.admin.extensions.successful_install",{extension:t})),window.location.href="".concat(s().forum.attribute("adminUrl"),"#/extension/").concat(t),window.location.reload()}})).catch(b).finally((()=>{s().modal.close(),m.redraw()}))}checkForUpdates(){this.setLoading("check"),s().request({method:"POST",url:"".concat(s().forum.attribute("apiUrl"),"/extension-manager/check-for-updates")}).then((e=>{e.processing?p():(this.lastUpdateCheck=e,this.extensionUpdates=this.formatExtensionUpdates(e),this.coreUpdate=this.formatCoreUpdate(e),this.setLoading(null),m.redraw())})).catch(b).finally((()=>{m.redraw()}))}updateCoreMinor(){confirm(y()(s().translator.trans("flarum-extension-manager.admin.minor_update_confirmation.content")))&&(s().modal.show(c()),this.setLoading("minor-update"),s().request({method:"POST",url:"".concat(s().forum.attribute("apiUrl"),"/extension-manager/minor-update")}).then((e=>{null!=e&&e.processing?p():(s().alerts.show({type:"success"},s().translator.trans("flarum-extension-manager.admin.update_successful")),window.location.reload())})).catch(b).finally((()=>{s().modal.close(),m.redraw()})))}updateExtension(e,t){s().modal.show(c()),this.setLoading("extension-update"),s().request({method:"PATCH",url:"".concat(s().forum.attribute("apiUrl"),"/extension-manager/extensions/").concat(e.id),body:{data:{updateMode:t}}}).then((t=>{null!=t&&t.processing?p():(s().alerts.show({type:"success"},s().translator.trans("flarum-extension-manager.admin.extensions.successful_update",{extension:e.extra["flarum-extension"].title})),window.location.reload())})).catch(b).finally((()=>{s().modal.close(),m.redraw()}))}updateGlobally(){s().modal.show(c()),this.setLoading("global-update"),s().request({method:"POST",url:"".concat(s().forum.attribute("apiUrl"),"/extension-manager/global-update")}).then((e=>{null!=e&&e.processing?p():(s().alerts.show({type:"success"},s().translator.trans("flarum-extension-manager.admin.updater.global_update_successful")),window.location.reload())})).catch(b).finally((()=>{s().modal.close(),m.redraw()}))}formatExtensionUpdates(e){var t;return this.packageUpdates={},null==e||null==(t=e.updates)||null==(t=t.installed)||t.filter((e=>{const t=e.name.replace("/","-").replace(/(flarum-ext-)|(flarum-)/,""),a=s().data.extensions[t],n=["semver-safe-update","update-possible"].includes(e["latest-status"]);return a&&n&&(this.packageUpdates[a.id]=e),a&&n})),Object.values(s().data.extensions).filter((e=>this.packageUpdates[e.id]))}formatCoreUpdate(e){var t;const a=null==e||null==(t=e.updates)||null==(t=t.installed)?void 0:t.filter((e=>"flarum/core"===e.name)).pop();return a?{package:a,extension:{id:"flarum-core",name:"flarum/core",version:s().data.settings.version,icon:{name:"",backgroundImage:"url(".concat(s().data.resources[0].attributes.baseUrl,"/assets/extensions/flarum-extension-manager/flarum.svg")},extra:{"flarum-extension":{title:y()(s().translator.trans("flarum-extension-manager.admin.updater.flarum"))}},links:{}}}:null}majorUpdate(e){let{dryRun:t}=e;s().extensionManager.control.setLoading(t?"major-update-dry-run":"major-update"),s().modal.show(c());const a=this.lastUpdateRun.major;s().request({method:"POST",url:"".concat(s().forum.attribute("apiUrl"),"/extension-manager/major-update"),body:{data:{dryRun:t}}}).then((e=>{null!=e&&e.processing?p():(s().alerts.show({type:"success"},s().translator.trans("flarum-extension-manager.admin.update_successful")),window.location.reload())})).catch(b).catch((e=>{var t;s().modal.close(),a.status="failure",a.incompatibleExtensions=null==(t=e.response)||null==(t=t.errors)||null==(t=t.pop())?void 0:t.incompatible_extensions})).finally((()=>{m.redraw()}))}}flarum.reg.add("flarum-extension-manager","admin/states/ControlSectionState",_);const k=flarum.reg.get("core","common/states/PaginatedListState");var N=a.n(k);class M extends(N()){get type(){return"external-extensions"}constructor(){super({sort:"-downloads"},1,12)}sortMap(){return{"-createdAt":{sort:"-createdAt",label:s().translator.trans("flarum-extension-manager.admin.sections.discover.sort.latest",{},!0)},"-downloads":{sort:"-downloads",label:s().translator.trans("flarum-extension-manager.admin.sections.discover.sort.top",{},!0)}}}}flarum.reg.add("flarum-extension-manager","admin/states/ExtensionListState",M);class w{constructor(){f(this,"queue",new x),f(this,"control",new _),f(this,"extensions",new M)}}flarum.reg.add("flarum-extension-manager","admin/states/ExtensionManagerState",w);const E=flarum.reg.get("core","common/extenders");var S=a.n(E);const B=flarum.reg.get("core","common/Component");var U=a.n(B);const C=flarum.reg.get("core","common/components/LoadingIndicator");var q=a.n(C);const P=flarum.reg.get("core","common/components/Tooltip");var T=a.n(P);const j=flarum.reg.get("core","common/components/Icon");var F=a.n(j);const $=flarum.reg.get("core","common/utils/ItemList");var L=a.n($);const I=flarum.reg.get("core","common/components/Link");var A=a.n(I);const D=flarum.reg.get("core","common/components/Pagination");var O=a.n(D);const R=flarum.reg.get("core","common/utils/classList");var Y=a.n(R);class W extends(U()){view(e){const{className:t,type:a,...n}=this.attrs;return m("span",Object.assign({className:Y()(["Label","Label--".concat(this.attrs.type),t])},n),e.children)}}flarum.reg.add("flarum-extension-manager","admin/components/Label",W);const G=flarum.reg.get("core","common/components/Modal");var V=a.n(G);class H extends(V()){className(){return"Modal--large QuickModal"}title(){return s().translator.trans("flarum-extension-manager.admin.sections.queue.operations.".concat(this.attrs.task.operation()))}content(){return m("div",{className:"Modal-body"},m("div",{className:"TaskOutputModal-data"},"failure"===this.attrs.task.status()&&m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.sections.queue.output_modal.guessed_cause")),m("div",{className:"FormControl TaskOutputModal-data-guessed-cause"},this.attrs.task.guessedCause()&&s().translator.trans("flarum-extension-manager.admin.exceptions.guessed_cause."+this.attrs.task.guessedCause())||s().translator.trans("flarum-extension-manager.admin.sections.queue.output_modal.cause_unknown"))),m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.sections.queue.output_modal.command")),m("div",{className:"FormControl TaskOutputModal-data-command"},m("code",null,"$ composer ",this.attrs.task.command()))),m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.sections.queue.output_modal.output")),m("div",{className:"FormControl TaskOutputModal-data-output"},m("code",null,m("pre",null,this.attrs.task.output()))))))}}flarum.reg.add("flarum-extension-manager","admin/components/TaskOutputModal",H);var z=a(151),Q=a.n(z);function J(e,t){dayjs.extend(Q());const a=dayjs(t).diff(e);return dayjs.duration(a).humanize()}flarum.reg.add("flarum-extension-manager","admin/utils/humanDuration",J);class Z extends(U()){oninit(e){super.oninit(e),s().extensionManager.queue.load()}view(){return m("section",{id:"ExtensionManager-queueSection",className:"ExtensionPage-settings ExtensionManager-queueSection"},m("div",{className:"ExtensionPage-permissions-header ExtensionManager-queueSection-header"},m("div",{className:"container"},m("h2",{className:"ExtensionTitle"},s().translator.trans("flarum-extension-manager.admin.sections.queue.title")),m(l(),{className:"Button Button--icon",icon:"fas fa-sync-alt",onclick:()=>s().extensionManager.queue.load(),"aria-label":s().translator.trans("flarum-extension-manager.admin.sections.queue.refresh"),disabled:s().extensionManager.control.isLoading()}))),m("div",{className:"container"},this.queueTable()))}columns(){const e=new(L());return e.add("operation",{label:y()(s().translator.trans("flarum-extension-manager.admin.sections.queue.columns.operation")),content:e=>m("div",{className:"ExtensionManager-queueTable-operation"},m("span",{className:"ExtensionManager-queueTable-operation-icon"},this.operationIcon(e.operation())),m("span",{className:"ExtensionManager-queueTable-operation-name"},s().translator.trans("flarum-extension-manager.admin.sections.queue.operations.".concat(e.operation()))))},80),e.add("package",{label:y()(s().translator.trans("flarum-extension-manager.admin.sections.queue.columns.package")),content:e=>{var t;const a=s().data.extensions[null==(t=e.package())?void 0:t.replace(/(\/flarum-|\/flarum-ext-|\/)/g,"-")];return a?m(A(),{className:"ExtensionManager-queueTable-package",href:s().route("extension",{id:a.id})},m("div",{className:"ExtensionManager-queueTable-package-icon ExtensionIcon",style:a.icon},!!a.icon&&m(F(),{name:a.icon.name})),m("div",{className:"ExtensionManager-queueTable-package-details"},m("span",{className:"ExtensionManager-queueTable-package-title"},a.extra["flarum-extension"].title),m("span",{className:"ExtensionManager-queueTable-package-name"},e.package()))):e.package()}},75),e.add("status",{label:y()(s().translator.trans("flarum-extension-manager.admin.sections.queue.columns.status")),content:e=>m("[",null,m(W,{className:"ExtensionManager-queueTable-status",type:{running:"neutral",failure:"error",pending:"warning",success:"success"}[e.status()]},s().translator.trans("flarum-extension-manager.admin.sections.queue.statuses.".concat(e.status()))),["pending","running"].includes(e.status())&&m(q(),{size:"small",display:"inline"}))},70),e.add("elapsedTime",{label:y()(s().translator.trans("flarum-extension-manager.admin.sections.queue.columns.elapsed_time")),content:e=>e.startedAt()&&e.finishedAt()?m(T(),{text:"".concat(dayjs(e.startedAt()).format("LL LTS")," ").concat(dayjs(e.finishedAt()).format("LL LTS"))},m("span",null,J(e.startedAt(),e.finishedAt()))):s().translator.trans("flarum-extension-manager.admin.sections.queue.task_just_started")},65),e.add("memoryUsed",{label:y()(s().translator.trans("flarum-extension-manager.admin.sections.queue.columns.peak_memory_used")),content:e=>m("span",null,e.peakMemoryUsed())},60),e.add("details",{label:y()(s().translator.trans("flarum-extension-manager.admin.sections.queue.columns.details")),content:e=>m(l(),{className:"Button Button--icon Table-controls-item",icon:"fas fa-file-alt","aria-label":s().translator.trans("flarum-extension-manager.admin.sections.queue.columns.details"),onclick:()=>s().modal.show(H,{task:e}),disabled:["pending","running"].includes(e.status())}),className:"Table-controls"},55),e}queueTable(){const e=s().extensionManager.queue.getItems();if(!e)return m(q(),null);if(e&&!e.length)return m("h3",{className:"ExtensionPage-subHeader"},s().translator.trans("flarum-extension-manager.admin.sections.queue.none"));const t=this.columns();return m("[",null,m("div",{className:Y()("Table-container",{"loading-container":e&&s().extensionManager.queue.isLoading()})},m("table",{className:"Table ExtensionManager-queueTable"},m("thead",null,m("tr",null,t.toArray().map(((e,t)=>m("th",{key:t},e.label))))),m("tbody",null,e.map(((e,a)=>m("tr",{key:a},t.toArray().map(((t,a)=>{const{label:n,content:s,...r}=t;return m("td",Object.assign({key:a},r),s(e))}))))))),e&&s().extensionManager.queue.isLoading()&&m(q(),{size:"large"})),m(O(),{total:s().extensionManager.queue.getTotalItems(),currentPage:s().extensionManager.queue.pageNumber()+1,perPage:s().extensionManager.queue.getPerPage(),onChange:e=>s().extensionManager.queue.goto(e)}))}operationIcon(e){return m(F(),{name:{update_check:"fas fa-sync-alt",update_major:"fas fa-play",update_minor:"fas fa-play",update_global:"fas fa-play",extension_install:"fas fa-download",extension_remove:"fas fa-times",extension_update:"fas fa-arrow-alt-circle-up",why_not:"fas fa-exclamation-circle"}[e]})}}flarum.reg.add("flarum-extension-manager","admin/components/QueueSection",Z);const K=flarum.reg.get("core","common/components/Alert");var X=a.n(K);const ee=flarum.reg.get("core","common/utils/Stream");var te=a.n(ee);class ae extends(U()){constructor(){super(...arguments),f(this,"packageName",void 0)}oninit(e){super.oninit(e),this.packageName=te()("")}view(){return m("div",{className:"Form-group ExtensionManager-installer"},m("label",{htmlFor:"install-extension"},s().translator.trans("flarum-extension-manager.admin.extensions.install")),m("div",{className:"helpText"},s().translator.trans("flarum-extension-manager.admin.extensions.install_help",{link:m("a",{href:"https://flarum.org/extensions"},"flarum.org"),semantic_link:m("a",{href:"https://devhints.io/semver"}),code:m("code",null)})),m("div",{className:"FormControl-container"},m("input",{className:"FormControl",id:"install-extension",placeholder:"vendor/package-name",bidi:this.packageName}),m(l(),{className:"Button",icon:"fas fa-download",onclick:this.onsubmit.bind(this),loading:s().extensionManager.control.isLoading("extension-install"),disabled:s().extensionManager.control.hasOperationRunning()},s().translator.trans("flarum-extension-manager.admin.extensions.proceed"))))}data(){return{package:this.packageName()}}onsubmit(){s().extensionManager.control.requirePackage(this.data())}}flarum.reg.add("flarum-extension-manager","admin/components/Installer",ae);const ne=flarum.reg.get("core","common/helpers/humanTime");var se=a.n(ne);class re extends(V()){constructor(){super(...arguments),f(this,"loading",!0),f(this,"whyNot",null)}className(){return"Modal--large WhyNotModal"}title(){return s().translator.trans("flarum-extension-manager.admin.why_not_modal.title")}oncreate(e){super.oncreate(e),this.requestWhyNot()}content(){return m("div",{className:"Modal-body"},this.loading?m(q(),null):m("pre",{className:"WhyNotModal-contents"},this.whyNot))}requestWhyNot(){s().request({method:"POST",url:"".concat(s().forum.attribute("apiUrl"),"/extension-manager/why-not"),body:{data:{package:this.attrs.package}}}).then((e=>{this.loading=!1,this.whyNot=e.data.reason,m.redraw()})).catch(b)}}flarum.reg.add("flarum-extension-manager","admin/components/WhyNotModal",re);const oe=flarum.reg.get("core","common/components/Badge");var ie=a.n(oe);const le=flarum.reg.get("core","common/utils/formatAmount");var me=a.n(le);const ue=flarum.reg.get("core","common/Model");var ce=a.n(ue);let de=function(e){return e.Stable="stable",e.Alpha="alpha",e.Beta="beta",e.RC="rc",e.Dev="dev",e}({});function ge(e){return[de.Stable,de.RC].includes(pe(e))}function pe(e){const t=e.split("-");if(1===t.length)return de.Stable;switch(t[1].split(".")[0].toLowerCase()){case"alpha":return de.Alpha;case"beta":return de.Beta;case"rc":return de.RC;default:return de.Dev}}flarum.reg.add("flarum-extension-manager","admin/utils/versions",{VersionStability:de,isProductionReady:ge,stability:pe});class he extends(ce()){constructor(){super(...arguments),f(this,"extensionId",ce().attribute("extensionId")),f(this,"name",ce().attribute("name")),f(this,"title",ce().attribute("title")),f(this,"description",ce().attribute("description")),f(this,"iconUrl",ce().attribute("iconUrl")),f(this,"icon",ce().attribute("icon")),f(this,"highestVersion",ce().attribute("highestVersion")),f(this,"httpUri",ce().attribute("httpUri")),f(this,"discussUri",ce().attribute("discussUri")),f(this,"vendor",ce().attribute("vendor")),f(this,"isPremium",ce().attribute("isPremium")),f(this,"isLocale",ce().attribute("isLocale")),f(this,"locale",ce().attribute("locale")),f(this,"latestFlarumVersionSupported",ce().attribute("latestFlarumVersionSupported")),f(this,"downloads",ce().attribute("downloads")),f(this,"installed",!1)}isSupported(){const e=s().data.settings.version,t=this.latestFlarumVersionSupported();return e.split("-")[1]===t.split("-")[1]&&e.split(".")[0]===t.split(".")[0]}isProductionReady(){return ge(this.highestVersion())}toLocalExtension(){return{id:this.extensionId(),name:this.name(),version:this.highestVersion(),description:this.description(),icon:this.icon()||{name:"fas fa-box-open",backgroundColor:"#117187",color:"#fff"},links:{discuss:this.discussUri(),website:this.httpUri()},extra:{"flarum-extension":{title:this.title()}}}}}flarum.reg.add("flarum-extension-manager","admin/models/ExternalExtension",he);const fe=flarum.reg.get("core","common/components/Dropdown");var xe=a.n(fe);const be=flarum.reg.get("core","common/components/LinkButton");var ve=a.n(be);class ye extends(U()){getExtension(){return this.attrs.extension instanceof he?this.attrs.extension.toLocalExtension():this.attrs.extension}view(){const e=this.getExtension(),{isCore:t,isDanger:a}=this.attrs;return m("div",{className:Y()("ExtensionCard",{"ExtensionCard--core":t,"ExtensionCard--danger":a})},m("div",{className:"ExtensionCard-header"},this.icon(),m(T(),{text:e.name},m("h4",null,e.extra["flarum-extension"].title)),this.attrs.extension instanceof he&&m("div",{className:"ExtensionCard-badges"},this.badges().toArray()),m("div",{className:"ExtensionCard-actions"},this.actionItems().toArray())),m("div",{className:"ExtensionCard-body"},m("p",null,e.description)),m("div",{className:"ExtensionCard-footer"},m("div",{className:"ExtensionCard-meta"},this.metaItems().toArray())))}icon(){var e,t;const a=this.getExtension();this.attrs.extension instanceof he&&a.id in s().data.extensions&&(a.icon=s().data.extensions[a.id].icon);const n=a.icon||{};return(null==(e=a.icon)||!e.name)&&this.attrs.extension instanceof he&&!(a.id in s().data.extensions)&&this.attrs.extension.iconUrl()&&(n.backgroundImage="url(".concat(this.attrs.extension.iconUrl(),")")),m("span",{className:"ExtensionIcon",style:a.icon},null!=(t=a.icon)&&t.name?m(F(),{name:a.icon.name}):null)}badges(){const e=new(L()),t=this.attrs.extension;return t.isSupported()?e.add("compatible",m(ie(),{icon:"fas fa-check",type:"success",label:s().translator.trans("flarum-extension-manager.admin.sections.discover.extension.badges.compatible"),className:"Badge--flat Badge--square"})):e.add("incompatible",m(ie(),{icon:"fas fa-times",type:"danger",label:s().translator.trans("flarum-extension-manager.admin.sections.discover.extension.badges.incompatible"),className:"Badge--flat Badge--square"})),t.isPremium()&&e.add("premium",m(ie(),{icon:"fas fa-dollar-sign",label:s().translator.trans("flarum-extension-manager.admin.sections.discover.extension.badges.premium"),className:"ExtensionCard-badge--premium Badge--flat Badge--square"})),t.isProductionReady()||e.add("unstable",m(ie(),{icon:"fas fa-flask",label:s().translator.trans("flarum-extension-manager.admin.sections.discover.extension.badges.unstable"),className:"Badge--flat Badge--square Badge--danger"})),"fof"===t.name().split("/")[0]&&e.add("fof",m(ie(),{icon:"fas fa-users",label:s().translator.trans("flarum-extension-manager.admin.sections.discover.extension.badges.fof"),className:"Badge--flat Badge--square"})),"flarum"===t.name().split("/")[0]&&e.add("flarum",m(ie(),{icon:"fab fa-flarum",label:s().translator.trans("flarum-extension-manager.admin.sections.discover.extension.badges.flarum"),className:"ExtensionCard-badge--flarum Badge--flat Badge--square"})),e}metaItems(){var e;const t=new(L()),{updates:a,isCore:n}=this.attrs,r=a?null!=(e=a["latest-minor"])?e:a["latest-major"]&&!n?a["latest-major"]:null:null;return this.attrs.extension instanceof he?t.add("downloads",m("span",null,m(F(),{name:"fas fa-circle-down"}),s().translator.trans("flarum-extension-manager.admin.sections.discover.extension.downloads",{count:this.attrs.extension.downloads(),formattedCount:me()(this.attrs.extension.downloads())}))):t.add("version",m("div",{className:"ExtensionCard-version"},m("span",{className:"ExtensionCard-version-current"},this.version(a.version)),r?m("[",null,m(F(),{name:"fas fa-arrow-right"}),m(W,{className:"ExtensionCard-version-latest",type:a["latest-minor"]?"success":"warning"},this.version(r))):null)),this.attrs.extension instanceof he&&(t.add("version",m("div",{className:"ExtensionCard-version"},"v",this.version(this.attrs.extension.highestVersion()))),t.add("link",m(ve(),{className:"Button Button--ua-reset Button--link Button--icon",href:this.attrs.extension.httpUri(),target:"_blank",icon:"fas fa-external-link-alt",external:!0}))),t}actionItems(){const e=new(L()),{updates:t,extension:a,onClickUpdate:n,whyNotWarning:r}=this.attrs;return a instanceof he?a.extensionId()in s().data.extensions?e.add("installed",m(l(),{className:"Button Button--icon Button--flat Button--success",icon:"fas fa-check-circle",disabled:!0})):e.add("install",m(l(),{className:"Button Button--icon Button--flat",icon:"fas fa-cloud-arrow-down",onclick:()=>{s().extensionManager.control.requirePackage({package:a.name()})}})):(n&&"function"==typeof n?e.add("update",m(T(),{text:s().translator.trans("flarum-extension-manager.admin.extensions.update")},m(l(),{icon:"fas fa-cloud-arrow-down",className:"Button Button--icon Button--flat",onclick:n,"aria-label":s().translator.trans("flarum-extension-manager.admin.extensions.update")}))):n&&e.add("update",m(xe(),{buttonClassName:"Button Button--icon Button--flat",icon:"fas fa-ellipsis",label:s().translator.trans("flarum-extension-manager.admin.extensions.update")},m(l(),{icon:"fas fa-cloud-arrow-down",onclick:n.soft},s().translator.trans("flarum-extension-manager.admin.extensions.update_soft_label")),m(l(),{icon:"fas fa-rotate",onclick:n.hard,disabled:!t["direct-dependency"]},s().translator.trans("flarum-extension-manager.admin.extensions.update_hard_label")))),r&&e.add("whyNot",m(T(),{text:s().translator.trans("flarum-extension-manager.admin.extensions.check_why_it_failed_updating")},m(l(),{icon:"fas fa-exclamation-circle",className:"Button Button--icon Button--flat Button--danger",onclick:()=>s().modal.show(re,{package:a.name}),"aria-label":s().translator.trans("flarum-extension-manager.admin.extensions.check_why_it_failed_updating")})))),e}version(e){return"v"===e.charAt(0)?e.substring(1):e}}flarum.reg.add("flarum-extension-manager","admin/components/ExtensionCard",ye);class _e extends(U()){constructor(){super(...arguments),f(this,"updateState",void 0)}oninit(e){super.oninit(e),this.updateState=this.attrs.updateState}view(){return m("div",{className:Y()("Form-group Form-group--danger ExtensionManager-majorUpdate",{"ExtensionManager-majorUpdate--failed":"failure"===this.updateState.status,"ExtensionManager-majorUpdate--incompatibleExtensions":this.updateState.incompatibleExtensions.length})},m("img",{alt:"flarum logo",src:s().forum.attribute("baseUrl")+"/assets/extensions/flarum-extension-manager/flarum.svg"}),m("label",null,s().translator.trans("flarum-extension-manager.admin.major_updater.title",{version:this.attrs.coreUpdate["latest-major"]})),m("p",{className:"helpText"},s().translator.trans("flarum-extension-manager.admin.major_updater.description")),m("div",{className:"ExtensionManager-updaterControls"},m(T(),{text:s().translator.trans("flarum-extension-manager.admin.major_updater.dry_run_help")},m(l(),{className:"Button",icon:"fas fa-vial",onclick:this.update.bind(this,!0),disabled:s().extensionManager.control.hasOperationRunning()},s().translator.trans("flarum-extension-manager.admin.major_updater.dry_run"))),m(l(),{className:"Button Button--danger",icon:"fas fa-play",onclick:this.update.bind(this,!1),disabled:s().extensionManager.control.hasOperationRunning()},s().translator.trans("flarum-extension-manager.admin.major_updater.update"))),this.updateState.incompatibleExtensions.length?m("div",{className:"ExtensionManager-majorUpdate-incompatibleExtensions ExtensionManager-extensions-grid"},this.updateState.incompatibleExtensions.map((e=>m(ye,{extension:s().data.extensions[e.replace("flarum-","").replace("flarum-ext-","").replace("/","-")],updates:{},onClickUpdate:null,isDanger:!0})))):null,"failure"===this.updateState.status?m(X(),{type:"error",className:"ExtensionManager-majorUpdate-failure",dismissible:!1,controls:[m(l(),{className:"Button Button--text ExtensionManager-majorUpdate-failure-details",icon:"fas fa-question-circle",onclick:()=>s().modal.show(re,{package:"flarum/core"})},s().translator.trans("flarum-extension-manager.admin.major_updater.failure.why"))]},m("p",{className:"ExtensionManager-majorUpdate-failure-desc"},s().translator.trans("flarum-extension-manager.admin.major_updater.failure.desc"))):null)}update(e){s().extensionManager.control.majorUpdate({dryRun:e})}}flarum.reg.add("flarum-extension-manager","admin/components/MajorUpdater",_e);const ke=flarum.reg.get("core","common/components/InfoTile");var Ne=a.n(ke);class Me extends(U()){view(){const e=s().extensionManager.control.coreUpdate;return[m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.updater.updater_title")),m("div",{className:"helpText"},s().translator.trans("flarum-extension-manager.admin.updater.updater_help")),this.lastUpdateCheckView(),m("div",{className:"ExtensionManager-updaterControls"},this.controlItems().toArray()),this.availableUpdatesView()),e&&e.package["latest-major"]&&ge(e.package["latest-major"])?m(_e,{coreUpdate:e.package,updateState:s().extensionManager.control.lastUpdateRun.major}):null]}lastUpdateCheckView(){var e;return(null==(e=s().extensionManager.control.lastUpdateCheck)?void 0:e.checkedAt)&&m("p",{className:"ExtensionManager-lastUpdatedAt"},m("span",{className:"ExtensionManager-lastUpdatedAt-label"},s().translator.trans("flarum-extension-manager.admin.updater.last_update_checked_at")),m("span",{className:"ExtensionManager-lastUpdatedAt-value"},se()(s().extensionManager.control.lastUpdateCheck.checkedAt)))||null}availableUpdatesView(){const e=s().extensionManager.control;if(s().extensionManager.control.isLoading("check")||s().extensionManager.control.isLoading("global-update"))return m("div",{className:"ExtensionManager-extensions"},m(q(),null));const t=e.coreUpdate&&e.coreUpdate.package["latest-minor"];return e.extensionUpdates.length||t?m("div",{className:"ExtensionManager-extensions"},m("div",{className:"ExtensionManager-extensions-grid"},t?m(ye,{extension:e.coreUpdate.extension,updates:e.coreUpdate.package,isCore:!0,onClickUpdate:()=>e.updateCoreMinor(),whyNotWarning:e.lastUpdateRun.limitedPackages().includes("flarum/core")}):null,e.extensionUpdates.map((t=>m(ye,{extension:t,updates:e.packageUpdates[t.id],onClickUpdate:{soft:()=>e.updateExtension(t,"soft"),hard:()=>e.updateExtension(t,"hard")},whyNotWarning:e.lastUpdateRun.limitedPackages().includes(t.name)}))))):m("div",{className:"ExtensionManager-extensions ExtensionManager-extensions--empty"},m(Ne(),{icon:"fas fa-plug-circle-check"},s().translator.trans("flarum-extension-manager.admin.updater.up_to_date")))}controlItems(){const e=new(L());return e.add("updateCheck",m(l(),{className:"Button",icon:"fas fa-sync-alt",onclick:()=>s().extensionManager.control.checkForUpdates(),loading:s().extensionManager.control.isLoading("check"),disabled:s().extensionManager.control.hasOperationRunning()},s().translator.trans("flarum-extension-manager.admin.updater.check_for_updates")),100),e.add("globalUpdate",m(l(),{className:"Button",icon:"fas fa-play",onclick:()=>s().extensionManager.control.updateGlobally(),loading:s().extensionManager.control.isLoading("global-update"),disabled:s().extensionManager.control.hasOperationRunning()},s().translator.trans("flarum-extension-manager.admin.updater.run_global_update"))),e}}flarum.reg.add("flarum-extension-manager","admin/components/Updater",Me);const we=flarum.reg.get("core","common/components/Form");var Ee=a.n(we);class Se extends(U()){oninit(e){super.oninit(e)}view(){return m("div",{className:"ExtensionPage-settings ExtensionManager-controlSection"},m("div",{className:"container"},s().data["flarum-extension-manager.writable_dirs"]?m(Ee(),null,m(ae,null),m(Me,null)):m("div",{className:"Form-group"},m(X(),{type:"warning",dismissible:!1},s().translator.trans("flarum-extension-manager.admin.file_permissions")))))}}flarum.reg.add("flarum-extension-manager","admin/components/ControlSection",Se);const Be=flarum.reg.get("core","common/components/FormGroup");var Ue=a.n(Be);class Ce extends(U()){constructor(){super(...arguments),f(this,"settings",{}),f(this,"initialSettings",null),f(this,"loading",!1),f(this,"type",void 0)}oninit(e){super.oninit(e),this.submit(!0)}className(){return""}view(){return m("div",{className:Y()("FormSection",this.className())},m("label",null,this.title()),this.content(),m("div",{className:"Form-group Form-controls"},this.submitButton()))}submitButton(){return[m(l(),{className:"Button Button--primary",loading:this.loading,onclick:()=>this.submit(!1),disabled:!this.isDirty()},s().translator.trans("core.admin.settings.submit_button"))]}customSettingComponents(){return Ue().prototype.customFieldComponents()}setting(e){var t;return null!=(t=this.settings[e])?t:this.settings[e]=te()()}submit(e){this.loading=!0;const t={};Object.keys(this.settings).forEach((e=>{t[e]=this.settings[e]()})),s().request({method:"POST",url:s().forum.attribute("apiUrl")+"/extension-manager/composer",body:{type:this.type,data:e?null:t}}).then((e=>{let{data:t}=e;Object.keys(t).forEach((e=>{this.settings[e]=te()(t[e])})),this.initialSettings=Array.isArray(t)?{}:t})).finally((()=>{this.loading=!1,m.redraw()}))}isDirty(){return JSON.stringify(this.initialSettings)!==JSON.stringify(this.settings)}}flarum.reg.add("flarum-extension-manager","admin/components/ConfigureJson",Ce);const qe=flarum.reg.get("core","common/components/Select");var Pe=a.n(qe);class Te extends(V()){constructor(){super(...arguments),f(this,"name",void 0),f(this,"repository",void 0)}oninit(e){super.oninit(e),this.name=te()(this.attrs.name||""),this.repository=te()(this.attrs.repository||{type:"composer",url:""})}className(){return"RepositoryModal Modal--small"}title(){const e=this.attrs.repository?"edit":"add";return s().translator.trans("flarum-extension-manager.admin.composer.".concat(e,"_repository_label"))}content(){const e={composer:s().translator.trans("flarum-extension-manager.admin.composer.repositories.types.composer"),vcs:s().translator.trans("flarum-extension-manager.admin.composer.repositories.types.vcs"),path:s().translator.trans("flarum-extension-manager.admin.composer.repositories.types.path")};return m("div",{className:"Modal-body"},m(Ee(),null,m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.composer.repositories.add_modal.name_label")),m("input",{className:"FormControl",bidi:this.name})),m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.composer.repositories.add_modal.type_label")),m(Pe(),{options:e,value:this.repository().type,onchange:e=>this.repository({...this.repository(),type:e})})),m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.composer.repositories.add_modal.url")),m("input",{className:"FormControl",onchange:e=>this.repository({...this.repository(),url:e.target.value}),value:this.repository().url})),m("div",{className:"Form-group"},m(l(),{className:"Button Button--primary",onclick:this.submit.bind(this)},s().translator.trans("flarum-extension-manager.admin.composer.repositories.add_modal.submit_button")))))}submit(){this.attrs.onsubmit(this.repository(),this.name()),this.hide()}}flarum.reg.add("flarum-extension-manager","admin/components/RepositoryModal",Te);class je extends Ce{constructor(){super(...arguments),f(this,"type","composer")}title(){return s().translator.trans("flarum-extension-manager.admin.composer.title")}className(){return"ConfigureComposer"}content(){return m("div",{className:"Form ExtensionManager-SettingsGroups-content"},this.attrs.buildSettingComponent.call(this,{setting:"minimum-stability",label:s().translator.trans("flarum-extension-manager.admin.composer.minimum_stability.label"),help:s().translator.trans("flarum-extension-manager.admin.composer.minimum_stability.help"),type:"select",options:{stable:s().translator.trans("flarum-extension-manager.admin.composer.minimum_stability.options.stable"),RC:s().translator.trans("flarum-extension-manager.admin.composer.minimum_stability.options.rc"),beta:s().translator.trans("flarum-extension-manager.admin.composer.minimum_stability.options.beta"),alpha:s().translator.trans("flarum-extension-manager.admin.composer.minimum_stability.options.alpha"),dev:s().translator.trans("flarum-extension-manager.admin.composer.minimum_stability.options.dev")}}),m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.composer.repositories.label")),m("div",{className:"helpText"},s().translator.trans("flarum-extension-manager.admin.composer.repositories.help")),m("div",{className:"ConfigureComposer-repositories"},Object.keys(this.setting("repositories")()||{}).map((e=>{const t=this.setting("repositories")()[e];return m("div",{className:"ButtonGroup ButtonGroup--full"},m(l(),{className:"Button",icon:{composer:"fas fa-cubes",vcs:"fas fa-code-branch",path:"fas fa-folder"}[t.type],onclick:()=>s().modal.show(Te,{name:e,repository:t,onsubmit:(t,a)=>{const n=this.setting("repositories")();delete n[e],this.setting("repositories")(n),this.onchange(t,a)}})},e," (",t.type,")"),m(l(),{className:"Button Button--icon",icon:"fas fa-trash","aria-label":s().translator.trans("flarum-extension-manager.admin.composer.delete_repository_label"),onclick:()=>{if(confirm(y()(s().translator.trans("flarum-extension-manager.admin.composer.delete_repository_confirmation")))){const t={...this.setting("repositories")()};delete t[e],this.setting("repositories")(t)}}}))})))))}submitButton(){const e=super.submitButton();return e.push(m(l(),{className:"Button",onclick:()=>s().modal.show(Te,{onsubmit:this.onchange.bind(this)})},s().translator.trans("flarum-extension-manager.admin.composer.add_repository_label"))),e}onchange(e,t){this.setting("repositories")({...this.setting("repositories")(),[t]:e})}}flarum.reg.add("flarum-extension-manager","admin/components/ConfigureComposer",je);class Fe extends(V()){constructor(){super(...arguments),f(this,"type",void 0),f(this,"host",void 0),f(this,"token",void 0)}oninit(e){super.oninit(e),this.type=te()(this.attrs.type||"bearer"),this.host=te()(this.attrs.host||""),this.token=te()(this.attrs.token||"")}className(){return"AuthMethodModal Modal--small"}title(){const e=this.attrs.host?"edit":"add";return s().translator.trans("flarum-extension-manager.admin.auth_config.".concat(e,"_label"))}content(){const e={"github-oauth":s().translator.trans("flarum-extension-manager.admin.auth_config.types.github-oauth"),"gitlab-oauth":s().translator.trans("flarum-extension-manager.admin.auth_config.types.gitlab-oauth"),"gitlab-token":s().translator.trans("flarum-extension-manager.admin.auth_config.types.gitlab-token"),bearer:s().translator.trans("flarum-extension-manager.admin.auth_config.types.bearer")};return m("div",{className:"Modal-body"},m(Ee(),null,m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.auth_config.add_modal.type_label")),m(Pe(),{options:e,value:this.type(),onchange:this.type})),m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.auth_config.add_modal.host_label")),m("input",{className:"FormControl",bidi:this.host,placeholder:s().translator.trans("flarum-extension-manager.admin.auth_config.add_modal.host_placeholder")})),m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.auth_config.add_modal.token_label")),m("textarea",{className:"FormControl",oninput:e=>this.token(e.target.value),rows:"6",placeholder:this.token().startsWith("unchanged:")?y()(s().translator.trans("flarum-extension-manager.admin.auth_config.add_modal.unchanged_token_placeholder")):""},this.token().startsWith("unchanged:")?"":this.token())),m("div",{className:"Form-group"},m(l(),{className:"Button Button--primary",onclick:this.submit.bind(this)},s().translator.trans("flarum-extension-manager.admin.auth_config.add_modal.submit_button")))))}submit(){this.attrs.onsubmit(this.type(),this.host(),this.token()),this.hide()}}flarum.reg.add("flarum-extension-manager","admin/components/AuthMethodModal",Fe);class $e extends Ce{constructor(){super(...arguments),f(this,"type","auth")}title(){return s().translator.trans("flarum-extension-manager.admin.auth_config.title")}className(){return"ConfigureAuth"}content(){const e=Object.keys(this.settings),t=e.length&&e.every((e=>{const t=this.settings[e]();return Array.isArray(t)?t.length:Object.keys(t).length}));return m("div",{className:"ExtensionManager-SettingsGroups-content"},t?e.map((e=>{const t=this.settings[e]();return m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.auth_config.types.".concat(e))),m("div",{className:"ConfigureAuth-hosts"},Object.keys(t).map((a=>{const n=t[a];return m("div",{className:"ButtonGroup ButtonGroup--full"},m(l(),{className:"Button",icon:"fas fa-key",onclick:()=>s().modal.show(Fe,{type:e,host:a,token:n,onsubmit:this.onchange.bind(this,a)})},a),m(l(),{className:"Button Button--icon",icon:"fas fa-trash","aria-label":s().translator.trans("flarum-extension-manager.admin.auth_config.delete_label"),onclick:()=>{if(confirm(y()(s().translator.trans("flarum-extension-manager.admin.auth_config.delete_confirmation")))){const t={...this.setting(e)()};delete t[a],Object.keys(t).length?this.setting(e)(t):delete this.settings[e]}}}))}))))})):m("span",{className:"helpText"},s().translator.trans("flarum-extension-manager.admin.auth_config.no_auth_methods_configured")))}submitButton(){const e=super.submitButton();return e.push(m(l(),{className:"Button",loading:this.loading,onclick:()=>s().modal.show(Fe,{onsubmit:this.onchange.bind(this,null)})},s().translator.trans("flarum-extension-manager.admin.auth_config.add_label"))),e}onchange(e,t,a,n){const s={...this.setting(t)()};e&&delete s[e],s[a]=n,this.setting(t)(s)}}flarum.reg.add("flarum-extension-manager","admin/components/ConfigureAuth",$e);const Le=flarum.reg.get("core","common/components/Input");var Ie=a.n(Le);const Ae=flarum.reg.get("core","common/helpers/listItems");var De=a.n(Ae);const Oe=flarum.reg.get("core","common/utils/throttleDebounce");class Re extends(U()){constructor(){super(...arguments),f(this,"search",te()("")),f(this,"warningsDismissed",te()(!1)),f(this,"applySearch",(0,Oe.throttle)(1200,(e=>{const t=s().extensionManager.extensions.getParams();s().extensionManager.extensions.refreshParams({...t,filter:{...t.filter,q:e}},1)})))}oninit(e){super.oninit(e),s().extensionManager.extensions.goto(1),this.warningsDismissed("true"===localStorage.getItem("flarum-extension-manager.warningsDismissed"))}load(e){void 0===e&&(e=1),s().extensionManager.extensions.goto(e)}view(){return m("div",{className:"ExtensionPage-settings ExtensionManager-DiscoverSection"},m("div",{className:"container"},m(Ee(),null,m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.sections.discover.title")),m("div",{className:"helpText"},s().translator.trans("flarum-extension-manager.admin.sections.discover.description"),this.warningsDismissed()&&m(l(),{className:"Button Button--text Button--warning Button--more",icon:"fas fa-exclamation-triangle",onclick:()=>this.setWarningDismissed(!1)}))),!this.warningsDismissed()&&m("div",{className:"ExtensionManager-warnings Form-group"},m(X(),{className:"ExtensionManager-primaryWarning",type:"warning",dismissible:!0,ondismiss:()=>this.setWarningDismissed(!0)},m("ul",null,De()(this.warningItems().toArray())))),m("div",{className:"Tabs"},m("div",{className:"Tabs-nav"},this.tabItems().toArray()),m("div",{className:"Tabs-content"},m("hr",{className:"Tabs-divider"}),m("div",{className:"ExtensionManager-DiscoverSection-toolbar"},m("div",{className:"ExtensionManager-DiscoverSection-toolbar-primary"},this.toolbarPrimaryItems().toArray()),m("div",{className:"ExtensionManager-DiscoverSection-toolbar-secondary"},this.toolbarSecondaryItems().toArray())),this.extensionList(),m("div",{className:"ExtensionManager-DiscoverSection-footer"},this.footerItems().toArray()))))))}tabFilters(){return{"":{label:s().translator.trans("flarum-extension-manager.admin.sections.discover.tabs.discover"),active:()=>{var e;return!(null!=(e=s().extensionManager.extensions.getParams().filter)&&e.type)}},extension:{label:s().translator.trans("flarum-extension-manager.admin.sections.discover.tabs.extensions"),active:()=>{var e;return"extension"===(null==(e=s().extensionManager.extensions.getParams().filter)?void 0:e.type)}},locale:{label:s().translator.trans("flarum-extension-manager.admin.sections.discover.tabs.languages"),active:()=>{var e;return"locale"===(null==(e=s().extensionManager.extensions.getParams().filter)?void 0:e.type)}},theme:{label:s().translator.trans("flarum-extension-manager.admin.sections.discover.tabs.themes"),active:()=>{var e;return"theme"===(null==(e=s().extensionManager.extensions.getParams().filter)?void 0:e.type)}}}}tabItems(){const e=new(L()),t=this.tabFilters();return Object.keys(t).forEach((a=>{const n=t[a];e.add(a,m(l(),{className:"Button Button--link",active:n.active(),onclick:()=>{s().extensionManager.extensions.changeFilter("type",a)}},n.label))})),e}warningItems(){const e=new(L());return e.add("accessWarning",s().translator.trans("flarum-extension-manager.admin.settings.access_warning")),s().data.debugEnabled&&e.add("devModeWarning",s().translator.trans("flarum-extension-manager.admin.settings.debug_mode_warning")),e}toolbarPrimaryItems(){const e=new(L());return e.add("search",m(Ie(),{value:this.search(),onchange:e=>{this.search(e),this.applySearch(e)},inputAttrs:{className:"FormControl-alt"},clearable:!0,placeholder:s().translator.trans("flarum-extension-manager.admin.sections.discover.search"),prefixIcon:"fas fa-search"})),e}toolbarSecondaryItems(){var e,t;const a=new(L()),n=s().extensionManager.extensions.sortMap(),r=Object.keys(n).reduce(((e,t)=>{const a=n[t];return e[t]="string"!=typeof a?a.label:a,e}),{});a.add("sort",m(xe(),{buttonClassName:"Button",label:r[s().extensionManager.extensions.getParams().sort]||Object.keys(n).map((e=>r[e]))[0],accessibleToggleLabel:s().translator.trans("flarum-extension-manager.admin.sections.discover.sort.toggle_dropdown_accessible_label")},Object.keys(r).map((e=>{const t=r[e],a=s().extensionManager.extensions.getParams().sort===e;return m(l(),{icon:!a||"fas fa-check",onclick:()=>s().extensionManager.extensions.changeSort(e),active:a},t)}))));const o=(null!=(e=null==(t=s().extensionManager.extensions.getParams().filter)||null==(t=t.is)?void 0:t[0])?e:null)||"all";return a.add("party",m(xe(),{buttonClassName:"Button",label:s().translator.trans("flarum-extension-manager.admin.sections.discover.party_filter."+o),accessibleToggleLabel:s().translator.trans("flarum-extension-manager.admin.sections.discover.party_filter.toggle_dropdown_accessible_label")},["all","premium"].map((e=>m(l(),{icon:o!==e||"fas fa-check",onclick:()=>{s().extensionManager.extensions.changeFilter("is","all"===e?void 0:[e])},active:o===e},s().translator.trans("flarum-extension-manager.admin.sections.discover.party_filter."+e)))))),a}extensionList(){return!s().extensionManager.extensions.hasItems()&&s().extensionManager.extensions.isLoading()?m(q(),{display:"block"}):s().extensionManager.extensions.hasItems()?m("div",{className:Y()("ExtensionManager-DiscoverSection-list",{"loading-container":s().extensionManager.extensions.isLoading()})},m("div",{className:"ExtensionManager-DiscoverSection-list-inner"},s().extensionManager.extensions.getPages().map((e=>e.items.map((e=>m(ye,{extension:e,key:e.name()})))))),s().extensionManager.extensions.hasItems()&&s().extensionManager.extensions.isLoading()&&m(q(),{size:"large"})):m("div",{className:"ExtensionManager-DiscoverSection-list ExtensionManager-DiscoverSection-list--empty"},m(Ne(),{icon:"fas fa-plug-circle-exclamation"},s().translator.trans("flarum-extension-manager.admin.sections.discover.empty_results")))}footerItems(){const e=new(L());return e.add("pagination",m(O(),{total:s().extensionManager.extensions.totalItems,perPage:s().extensionManager.extensions.pageSize,currentPage:s().extensionManager.extensions.getLocation().page,onChange:e=>{s().extensionManager.extensions.getLocation().page!==e&&this.load(e)}})),e.add("premiumTermsLink",m(ve(),{className:"Button Button--link",href:"https://flarum.org/terms/premium-extensions",external:!0,target:"_blank",icon:"fas fa-circle-info"},s().translator.trans("flarum-extension-manager.admin.sections.discover.premium_extension_terms"))),e}setWarningDismissed(e){this.warningsDismissed(e),localStorage.setItem("flarum-extension-manager.warningsDismissed",e?"true":"false")}}flarum.reg.add("flarum-extension-manager","admin/components/DiscoverSection",Re);class Ye extends(o()){content(){const e=s().registry.getSettings(this.extension.id);return m("div",{className:"ExtensionPage-settings"},m("div",{className:"container"},e?[m("div",{className:"Form-group"},m("label",null,s().translator.trans("flarum-extension-manager.admin.sections.settings.title")),m("div",{className:"helpText"},s().translator.trans("flarum-extension-manager.admin.sections.settings.description"))),m("div",{className:"FormSectionGroup ExtensionManager-SettingsGroups"},m("div",{className:"FormSection"},m("label",null,s().translator.trans("flarum-extension-manager.admin.settings.title")),m("div",{className:"Form"},e.map(this.buildSettingComponent.bind(this))),m("div",{className:"Form-group Form--controls"},this.submitButton())),m(je,{buildSettingComponent:this.buildSettingComponent}),m($e,{buildSettingComponent:this.buildSettingComponent}))]:m("h3",{className:"ExtensionPage-subHeader"},s().translator.trans("core.admin.extension.no_settings"))))}sections(e){const t=super.sections(e);return t.add("discover",m(Re,null),15),t.add("control",m(Se,null),10),t.setPriority("content",8),"0"!==s().data.settings["flarum-extension-manager.queue_jobs"]&&s().data.settings["flarum-extension-manager.queue_jobs"]&&t.add("queue",m(Z,null),5),t.remove("permissions"),t}onsaved(){super.onsaved(),m.redraw()}}flarum.reg.add("flarum-extension-manager","admin/components/SettingsPage",Ye);const We=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],Ge=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],Ve=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],He=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],ze=(e,t,a)=>{let n=e;return"string"==typeof t||Array.isArray(t)?n=e.toLocaleString(t,a):!0!==t&&void 0===a||(n=e.toLocaleString(void 0,a)),n};class Qe extends(ce()){status(){return ce().attribute("status").call(this)}operation(){return ce().attribute("operation").call(this)}command(){return ce().attribute("command").call(this)}package(){return ce().attribute("package").call(this)}output(){return ce().attribute("output").call(this)}guessedCause(){return ce().attribute("guessedCause").call(this)}createdAt(){return ce().attribute("createdAt",ce().transformDate).call(this)}startedAt(){return ce().attribute("startedAt",ce().transformDate).call(this)}finishedAt(){return ce().attribute("finishedAt",ce().transformDate).call(this)}peakMemoryUsed(){return function(e,t){if(!Number.isFinite(e))throw new TypeError("Expected a finite number, got ".concat(typeof e,": ").concat(e));const a=(t={bits:!1,binary:!1,space:!0,...t}).bits?t.binary?He:Ve:t.binary?Ge:We,n=t.space?" ":"";if(t.signed&&0===e)return" 0".concat(n).concat(a[0]);const s=e<0,r=s?"-":t.signed?"+":"";let o;if(s&&(e=-e),void 0!==t.minimumFractionDigits&&(o={minimumFractionDigits:t.minimumFractionDigits}),void 0!==t.maximumFractionDigits&&(o={maximumFractionDigits:t.maximumFractionDigits,...o}),e<1)return r+ze(e,t.locale,o)+n+a[0];const i=Math.min(Math.floor(t.binary?Math.log(e)/Math.log(1024):Math.log10(e)/3),a.length-1);return e/=(t.binary?1024:1e3)**i,o||(e=e.toPrecision(3)),r+ze(Number(e),t.locale,o)+n+a[i]}(1024*ce().attribute("peakMemoryUsed").call(this))}}flarum.reg.add("flarum-extension-manager","admin/models/Task",Qe);const Je=[(new(S().Store)).add("extension-manager-tasks",Qe).add("external-extensions",he),(new(S().Admin)).setting((()=>({setting:"flarum-extension-manager.queue_jobs",label:s().translator.trans("flarum-extension-manager.admin.settings.queue_jobs"),help:m.trust(y()(s().translator.trans("flarum-extension-manager.admin.settings.queue_jobs_help",{basic_impl_link:"https://discuss.flarum.org/d/28151-database-queue-the-simplest-queue-even-for-shared-hosting",adv_impl_link:"https://discuss.flarum.org/d/21873-redis-sessions-cache-queues",php_version:"".concat(s().data.phpVersion,""),folder_perms_link:"https://docs.flarum.org/install#folder-ownership"}))),type:"boolean",disabled:s().data["flarum-extension-manager.using_sync_queue"]}))).setting((()=>({setting:"flarum-extension-manager.task_retention_days",label:s().translator.trans("flarum-extension-manager.admin.settings.task_retention_days"),help:s().translator.trans("flarum-extension-manager.admin.settings.task_retention_days_help"),type:"number"}))).page(Ye).generalIndexItems("settings",(()=>[{id:"minimum-stability",label:s().translator.trans("flarum-extension-manager.admin.composer.minimum_stability.label",{},!0),help:s().translator.trans("flarum-extension-manager.admin.composer.minimum_stability.help",{},!0)},{id:"repositories",label:s().translator.trans("flarum-extension-manager.admin.composer.repositories.label",{},!0),help:s().translator.trans("flarum-extension-manager.admin.composer.repositories.help",{},!0)},{id:"composer-auth",label:s().translator.trans("flarum-extension-manager.admin.auth_config.title",{},!0)},{id:"updates",label:s().translator.trans("flarum-extension-manager.admin.updater.updater_title",{},!0),help:s().translator.trans("flarum-extension-manager.admin.updater.updater_help",{},!0)}]))];s().initializers.add("flarum-extension-manager",(t=>{t.extensionManager=new w,t.data["flarum-extension-manager.using_sync_queue"]&&(t.data.settings["flarum-extension-manager.queue_jobs"]="0"),(0,e.extend)(o().prototype,"topItems",(function(e){"flarum-extension-manager"===this.extension.id||g()(this.extension.id)||e.add("remove",m(l(),{className:"Button Button--danger",icon:"fas fa-times",onclick:()=>{t.modal.show(c()),t.request({url:"".concat(t.forum.attribute("apiUrl"),"/extension-manager/extensions/").concat(this.extension.id),method:"DELETE"}).then((e=>{null!=e&&e.processing?p():(t.alerts.show({type:"success"},t.translator.trans("flarum-extension-manager.admin.extensions.successful_remove")),window.location=t.forum.attribute("adminUrl"))})).finally((()=>{t.modal.close()}))}},t.translator.trans("flarum-extension-manager.admin.extensions.remove")))}))}))})(),module.exports=n})(); //# sourceMappingURL=admin.js.map \ No newline at end of file diff --git a/extensions/package-manager/js/dist/admin.js.map b/extensions/package-manager/js/dist/admin.js.map index fb69eceaf8..4e2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MAE7D,IAAAgF,QAAO,cAAyB,YAAY,SAAUS,GAC1B,6BAAtB9O,KAAKwK,UAAU3F,IAAqC,IAAmB7E,KAAKwK,UAAU3F,KAG1FiK,EAAM7M,IAAI,SAAU7C,EAAE,IAAQ,CAC5BmO,UAAW,wBACXpB,KAAM,eACNuC,QAAS,KACPgP,EAAIE,MAAM/U,KAAK,KACf6U,EAAIG,QAAQ,CACV1T,IAAK,GAAGnB,OAAO0U,EAAII,MAAM1T,UAAU,UAAW,kCAAkCpB,OAAOhJ,KAAKwK,UAAU3F,IACtGqF,OAAQ,WACP1D,MAAK+B,IACU,MAAZA,GAAoBA,EAAS+B,WAC/B7F,KAEAiZ,EAAIK,OAAOlV,KAAK,CACdC,KAAM,WACL4U,EAAIM,WAAWjV,MAAM,gEACxBjD,OAAOuB,SAAWqW,EAAII,MAAM1T,UAAU,YACxC,IACCQ,SAAQ,KACT8S,EAAIE,MAAMlZ,OAAO,GACjB,GAEHgZ,EAAIM,WAAWjV,MAAM,qDAC1B,GAAE,G","sources":["webpack://@flarum/extension-manager/../../../node_modules/dayjs/plugin/duration.js","webpack://@flarum/extension-manager/webpack/bootstrap","webpack://@flarum/extension-manager/webpack/runtime/compat get default export","webpack://@flarum/extension-manager/webpack/runtime/define property getters","webpack://@flarum/extension-manager/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/extension-manager/webpack/runtime/make namespace object","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'admin/app')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'admin/components/ExtensionPage')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/Button')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'admin/components/LoadingModal')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'admin/utils/isExtensionEnabled')\"","webpack://@flarum/extension-manager/./src/admin/utils/jumpToQueue.ts","webpack://@flarum/extension-manager/../../../node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://@flarum/extension-manager/../../../node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://@flarum/extension-manager/../../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://@flarum/extension-manager/../../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://@flarum/extension-manager/./src/admin/states/QueueState.ts","webpack://@flarum/extension-manager/./src/admin/utils/errorHandler.ts","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/utils/extractText')\"","webpack://@flarum/extension-manager/./src/admin/states/ControlSectionState.ts","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/states/PaginatedListState')\"","webpack://@flarum/extension-manager/./src/admin/states/ExtensionListState.ts","webpack://@flarum/extension-manager/./src/admin/states/ExtensionManagerState.ts","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/extenders')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/Component')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/LoadingIndicator')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/Tooltip')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/Icon')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/utils/ItemList')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/Link')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/Pagination')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/utils/classList')\"","webpack://@flarum/extension-manager/./src/admin/components/Label.tsx","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/Modal')\"","webpack://@flarum/extension-manager/./src/admin/components/TaskOutputModal.tsx","webpack://@flarum/extension-manager/./src/admin/utils/humanDuration.ts","webpack://@flarum/extension-manager/./src/admin/components/QueueSection.tsx","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/Alert')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/utils/Stream')\"","webpack://@flarum/extension-manager/./src/admin/components/Installer.tsx","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/helpers/humanTime')\"","webpack://@flarum/extension-manager/./src/admin/components/WhyNotModal.tsx","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/Badge')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/utils/formatAmount')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/Model')\"","webpack://@flarum/extension-manager/./src/admin/models/ExternalExtension.ts","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/Dropdown')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/LinkButton')\"","webpack://@flarum/extension-manager/./src/admin/components/ExtensionCard.tsx","webpack://@flarum/extension-manager/./src/admin/components/MajorUpdater.tsx","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/InfoTile')\"","webpack://@flarum/extension-manager/./src/admin/components/Updater.tsx","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/Form')\"","webpack://@flarum/extension-manager/./src/admin/components/ControlSection.tsx","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/FormGroup')\"","webpack://@flarum/extension-manager/./src/admin/components/ConfigureJson.tsx","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/Select')\"","webpack://@flarum/extension-manager/./src/admin/components/RepositoryModal.tsx","webpack://@flarum/extension-manager/./src/admin/components/ConfigureComposer.tsx","webpack://@flarum/extension-manager/./src/admin/components/AuthMethodModal.tsx","webpack://@flarum/extension-manager/./src/admin/components/ConfigureAuth.tsx","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/Input')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/helpers/listItems')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/utils/throttleDebounce')\"","webpack://@flarum/extension-manager/./src/admin/components/DiscoverSection.tsx","webpack://@flarum/extension-manager/./src/admin/components/SettingsPage.tsx","webpack://@flarum/extension-manager/../../../node_modules/pretty-bytes/index.js","webpack://@flarum/extension-manager/./src/admin/models/Task.ts","webpack://@flarum/extension-manager/./src/admin/extend.tsx","webpack://@flarum/extension-manager/./src/admin/index.tsx"],"sourcesContent":["!function(t,s){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=s():\"function\"==typeof define&&define.amd?define(s):(t=\"undefined\"!=typeof globalThis?globalThis:t||self).dayjs_plugin_duration=s()}(this,(function(){\"use strict\";var t,s,n=1e3,i=6e4,e=36e5,r=864e5,o=/\\[([^\\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,u=31536e6,d=2628e6,a=/^(-|\\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,h={years:u,months:d,days:r,hours:e,minutes:i,seconds:n,milliseconds:1,weeks:6048e5},c=function(t){return t instanceof g},f=function(t,s,n){return new g(t,n,s.$l)},m=function(t){return s.p(t)+\"s\"},l=function(t){return t<0},$=function(t){return l(t)?Math.ceil(t):Math.floor(t)},y=function(t){return Math.abs(t)},v=function(t,s){return t?l(t)?{negative:!0,format:\"\"+y(t)+s}:{negative:!1,format:\"\"+t+s}:{negative:!1,format:\"\"}},g=function(){function l(t,s,n){var i=this;if(this.$d={},this.$l=n,void 0===t&&(this.$ms=0,this.parseFromMilliseconds()),s)return f(t*h[m(s)],this);if(\"number\"==typeof t)return this.$ms=t,this.parseFromMilliseconds(),this;if(\"object\"==typeof t)return Object.keys(t).forEach((function(s){i.$d[m(s)]=t[s]})),this.calMilliseconds(),this;if(\"string\"==typeof t){var e=t.match(a);if(e){var r=e.slice(2).map((function(t){return null!=t?Number(t):0}));return this.$d.years=r[0],this.$d.months=r[1],this.$d.weeks=r[2],this.$d.days=r[3],this.$d.hours=r[4],this.$d.minutes=r[5],this.$d.seconds=r[6],this.calMilliseconds(),this}}return this}var y=l.prototype;return y.calMilliseconds=function(){var t=this;this.$ms=Object.keys(this.$d).reduce((function(s,n){return s+(t.$d[n]||0)*h[n]}),0)},y.parseFromMilliseconds=function(){var t=this.$ms;this.$d.years=$(t/u),t%=u,this.$d.months=$(t/d),t%=d,this.$d.days=$(t/r),t%=r,this.$d.hours=$(t/e),t%=e,this.$d.minutes=$(t/i),t%=i,this.$d.seconds=$(t/n),t%=n,this.$d.milliseconds=t},y.toISOString=function(){var t=v(this.$d.years,\"Y\"),s=v(this.$d.months,\"M\"),n=+this.$d.days||0;this.$d.weeks&&(n+=7*this.$d.weeks);var i=v(n,\"D\"),e=v(this.$d.hours,\"H\"),r=v(this.$d.minutes,\"M\"),o=this.$d.seconds||0;this.$d.milliseconds&&(o+=this.$d.milliseconds/1e3,o=Math.round(1e3*o)/1e3);var u=v(o,\"S\"),d=t.negative||s.negative||i.negative||e.negative||r.negative||u.negative,a=e.format||r.format||u.format?\"T\":\"\",h=(d?\"-\":\"\")+\"P\"+t.format+s.format+i.format+a+e.format+r.format+u.format;return\"P\"===h||\"-P\"===h?\"P0D\":h},y.toJSON=function(){return this.toISOString()},y.format=function(t){var n=t||\"YYYY-MM-DDTHH:mm:ss\",i={Y:this.$d.years,YY:s.s(this.$d.years,2,\"0\"),YYYY:s.s(this.$d.years,4,\"0\"),M:this.$d.months,MM:s.s(this.$d.months,2,\"0\"),D:this.$d.days,DD:s.s(this.$d.days,2,\"0\"),H:this.$d.hours,HH:s.s(this.$d.hours,2,\"0\"),m:this.$d.minutes,mm:s.s(this.$d.minutes,2,\"0\"),s:this.$d.seconds,ss:s.s(this.$d.seconds,2,\"0\"),SSS:s.s(this.$d.milliseconds,3,\"0\")};return n.replace(o,(function(t,s){return s||String(i[t])}))},y.as=function(t){return this.$ms/h[m(t)]},y.get=function(t){var s=this.$ms,n=m(t);return\"milliseconds\"===n?s%=1e3:s=\"weeks\"===n?$(s/h[n]):this.$d[n],s||0},y.add=function(t,s,n){var i;return i=s?t*h[m(s)]:c(t)?t.$ms:f(t,this).$ms,f(this.$ms+i*(n?-1:1),this)},y.subtract=function(t,s){return this.add(t,s,!0)},y.locale=function(t){var s=this.clone();return s.$l=t,s},y.clone=function(){return f(this.$ms,this)},y.humanize=function(s){return t().add(this.$ms,\"ms\").locale(this.$l).fromNow(!s)},y.valueOf=function(){return this.asMilliseconds()},y.milliseconds=function(){return this.get(\"milliseconds\")},y.asMilliseconds=function(){return this.as(\"milliseconds\")},y.seconds=function(){return this.get(\"seconds\")},y.asSeconds=function(){return this.as(\"seconds\")},y.minutes=function(){return this.get(\"minutes\")},y.asMinutes=function(){return this.as(\"minutes\")},y.hours=function(){return this.get(\"hours\")},y.asHours=function(){return this.as(\"hours\")},y.days=function(){return this.get(\"days\")},y.asDays=function(){return this.as(\"days\")},y.weeks=function(){return this.get(\"weeks\")},y.asWeeks=function(){return this.as(\"weeks\")},y.months=function(){return this.get(\"months\")},y.asMonths=function(){return this.as(\"months\")},y.years=function(){return this.get(\"years\")},y.asYears=function(){return this.as(\"years\")},l}(),p=function(t,s,n){return t.add(s.years()*n,\"y\").add(s.months()*n,\"M\").add(s.days()*n,\"d\").add(s.hours()*n,\"h\").add(s.minutes()*n,\"m\").add(s.seconds()*n,\"s\").add(s.milliseconds()*n,\"ms\")};return function(n,i,e){t=e,s=e().$utils(),e.duration=function(t,s){var n=e.locale();return f(t,{$l:n},s)},e.isDuration=c;var r=i.prototype.add,o=i.prototype.subtract;i.prototype.add=function(t,s){return c(t)?p(this,t,1):r.bind(this)(t,s)},i.prototype.subtract=function(t,s){return c(t)?p(this,t,-1):o.bind(this)(t,s)}}}));","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\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', 'common/extend');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/ExtensionPage');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Button');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/LoadingModal');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/utils/isExtensionEnabled');","import app from 'flarum/admin/app';\n\n// @ts-ignore\nwindow.jumpToQueue = jumpToQueue;\nexport default function jumpToQueue() {\n app.modal.close();\n m.route.set(app.route('extension', {\n id: 'flarum-extension-manager'\n }));\n app.extensionManager.queue.load({}, true);\n setTimeout(() => {\n var _document$getElementB;\n (_document$getElementB = document.getElementById('ExtensionManager-queueSection')) == null || _document$getElementB.scrollIntoView({\n block: 'nearest'\n });\n }, 200);\n}\nflarum.reg.add('flarum-extension-manager', 'admin/utils/jumpToQueue', jumpToQueue);","export default function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}","import _typeof from \"./typeof.js\";\nexport default function toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nexport default class QueueState {\n constructor() {\n _defineProperty(this, \"polling\", null);\n _defineProperty(this, \"tasks\", null);\n _defineProperty(this, \"limit\", 20);\n _defineProperty(this, \"offset\", 0);\n _defineProperty(this, \"total\", 0);\n _defineProperty(this, \"loading\", false);\n }\n load(params, actionTaken) {\n var _params;\n if (actionTaken === void 0) {\n actionTaken = false;\n }\n this.loading = true;\n params = {\n page: {\n limit: this.limit,\n offset: this.offset,\n ...((_params = params) == null ? void 0 : _params.page)\n },\n ...params\n };\n return app.store.find('extension-manager-tasks', params || {}).then(data => {\n var _data$payload$meta;\n this.tasks = data;\n this.total = ((_data$payload$meta = data.payload.meta) == null || (_data$payload$meta = _data$payload$meta.page) == null ? void 0 : _data$payload$meta.total) || 0;\n m.redraw();\n\n // Check if there is a pending or running task\n const pendingTask = data == null ? void 0 : data.find(task => task.status() === 'pending' || task.status() === 'running');\n if (pendingTask) {\n this.pollQueue(actionTaken);\n } else if (actionTaken) {\n app.extensionManager.control.setLoading(null);\n\n // Refresh the page\n window.location.reload();\n } else if (app.extensionManager.control.isLoading()) {\n app.extensionManager.control.setLoading(null);\n }\n this.loading = false;\n return data;\n });\n }\n isLoading() {\n return this.loading;\n }\n getItems() {\n return this.tasks;\n }\n getTotalItems() {\n return this.total;\n }\n getTotalPages() {\n return Math.ceil(this.total / this.limit);\n }\n pageNumber() {\n return Math.ceil(this.offset / this.limit);\n }\n getPerPage() {\n return this.limit;\n }\n hasPrev() {\n return this.pageNumber() !== 0;\n }\n hasNext() {\n return this.offset + this.limit < this.total;\n }\n prev() {\n if (this.hasPrev()) {\n this.offset -= this.limit;\n this.load();\n }\n }\n next() {\n if (this.hasNext()) {\n this.offset += this.limit;\n this.load();\n }\n }\n goto(page) {\n this.offset = (page - 1) * this.limit;\n this.load();\n }\n pollQueue(actionTaken) {\n if (actionTaken === void 0) {\n actionTaken = false;\n }\n if (this.polling) {\n clearTimeout(this.polling);\n }\n this.polling = setTimeout(() => {\n this.load({}, actionTaken);\n }, 6000);\n }\n hasPending() {\n var _this$tasks;\n return !!((_this$tasks = this.tasks) != null && _this$tasks.find(task => task.status() === 'pending' || task.status() === 'running'));\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/states/QueueState', QueueState);","import app from 'flarum/admin/app';\nexport default function (e) {\n app.extensionManager.control.setLoading(null);\n const error = e.response.errors[0];\n if (!['composer_command_failure', 'extension_already_installed', 'extension_not_installed'].includes(error.code)) {\n throw e;\n }\n app.alerts.clear();\n switch (error.code) {\n case 'composer_command_failure':\n if (error.guessed_cause) {\n app.alerts.show({\n type: 'error'\n }, app.translator.trans(\"flarum-extension-manager.admin.exceptions.guessed_cause.\".concat(error.guessed_cause)));\n app.modal.close();\n } else {\n app.alerts.show({\n type: 'error'\n }, app.translator.trans('flarum-extension-manager.admin.exceptions.composer_command_failure'));\n }\n break;\n case 'extension_already_installed':\n app.alerts.show({\n type: 'error'\n }, app.translator.trans('flarum-extension-manager.admin.exceptions.extension_already_installed'));\n app.modal.close();\n break;\n case 'extension_not_installed':\n app.alerts.show({\n type: 'error'\n }, app.translator.trans('flarum-extension-manager.admin.exceptions.extension_not_installed'));\n app.modal.close();\n }\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/extractText');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport LoadingModal from 'flarum/admin/components/LoadingModal';\nimport errorHandler from '../utils/errorHandler';\nimport jumpToQueue from '../utils/jumpToQueue';\nimport extractText from 'flarum/common/utils/extractText';\nexport default class ControlSectionState {\n get lastUpdateRun() {\n const lastUpdateRun = JSON.parse(app.data.settings['flarum-extension-manager.last_update_run']);\n lastUpdateRun.limitedPackages = () => [...lastUpdateRun.major.limitedPackages, ...lastUpdateRun.minor.limitedPackages, ...lastUpdateRun.global.limitedPackages];\n return lastUpdateRun;\n }\n constructor() {\n _defineProperty(this, \"loading\", null);\n _defineProperty(this, \"packageUpdates\", {});\n _defineProperty(this, \"lastUpdateCheck\", void 0);\n _defineProperty(this, \"extensionUpdates\", void 0);\n _defineProperty(this, \"coreUpdate\", null);\n this.lastUpdateCheck = JSON.parse(app.data.settings['flarum-extension-manager.last_update_check']);\n this.extensionUpdates = this.formatExtensionUpdates(this.lastUpdateCheck);\n this.coreUpdate = this.formatCoreUpdate(this.lastUpdateCheck);\n }\n isLoading(name) {\n if (name === void 0) {\n name = null;\n }\n return name && this.loading === name || !name && this.loading !== null;\n }\n hasOperationRunning() {\n return this.isLoading() || app.extensionManager.queue.hasPending();\n }\n setLoading(name) {\n this.loading = name;\n }\n requirePackage(data) {\n app.extensionManager.control.setLoading('extension-install');\n app.modal.show(LoadingModal);\n app.request({\n method: 'POST',\n url: \"\".concat(app.forum.attribute('apiUrl'), \"/extension-manager/extensions\"),\n body: {\n data\n }\n }).then(response => {\n if (response.processing) {\n jumpToQueue();\n } else {\n const extensionId = response.id;\n app.alerts.show({\n type: 'success'\n }, app.translator.trans('flarum-extension-manager.admin.extensions.successful_install', {\n extension: extensionId\n }));\n window.location.href = \"\".concat(app.forum.attribute('adminUrl'), \"#/extension/\").concat(extensionId);\n window.location.reload();\n }\n }).catch(errorHandler).finally(() => {\n app.modal.close();\n m.redraw();\n });\n }\n checkForUpdates() {\n this.setLoading('check');\n app.request({\n method: 'POST',\n url: \"\".concat(app.forum.attribute('apiUrl'), \"/extension-manager/check-for-updates\")\n }).then(response => {\n if (response.processing) {\n jumpToQueue();\n } else {\n this.lastUpdateCheck = response;\n this.extensionUpdates = this.formatExtensionUpdates(response);\n this.coreUpdate = this.formatCoreUpdate(response);\n this.setLoading(null);\n m.redraw();\n }\n }).catch(errorHandler).finally(() => {\n m.redraw();\n });\n }\n updateCoreMinor() {\n if (confirm(extractText(app.translator.trans('flarum-extension-manager.admin.minor_update_confirmation.content')))) {\n app.modal.show(LoadingModal);\n this.setLoading('minor-update');\n app.request({\n method: 'POST',\n url: \"\".concat(app.forum.attribute('apiUrl'), \"/extension-manager/minor-update\")\n }).then(response => {\n if (response != null && response.processing) {\n jumpToQueue();\n } else {\n app.alerts.show({\n type: 'success'\n }, app.translator.trans('flarum-extension-manager.admin.update_successful'));\n window.location.reload();\n }\n }).catch(errorHandler).finally(() => {\n app.modal.close();\n m.redraw();\n });\n }\n }\n updateExtension(extension, updateMode) {\n app.modal.show(LoadingModal);\n this.setLoading('extension-update');\n app.request({\n method: 'PATCH',\n url: \"\".concat(app.forum.attribute('apiUrl'), \"/extension-manager/extensions/\").concat(extension.id),\n body: {\n data: {\n updateMode\n }\n }\n }).then(response => {\n if (response != null && response.processing) {\n jumpToQueue();\n } else {\n app.alerts.show({\n type: 'success'\n }, app.translator.trans('flarum-extension-manager.admin.extensions.successful_update', {\n extension: extension.extra['flarum-extension'].title\n }));\n window.location.reload();\n }\n }).catch(errorHandler).finally(() => {\n app.modal.close();\n m.redraw();\n });\n }\n updateGlobally() {\n app.modal.show(LoadingModal);\n this.setLoading('global-update');\n app.request({\n method: 'POST',\n url: \"\".concat(app.forum.attribute('apiUrl'), \"/extension-manager/global-update\")\n }).then(response => {\n if (response != null && response.processing) {\n jumpToQueue();\n } else {\n app.alerts.show({\n type: 'success'\n }, app.translator.trans('flarum-extension-manager.admin.updater.global_update_successful'));\n window.location.reload();\n }\n }).catch(errorHandler).finally(() => {\n app.modal.close();\n m.redraw();\n });\n }\n formatExtensionUpdates(lastUpdateCheck) {\n var _lastUpdateCheck$upda;\n this.packageUpdates = {};\n lastUpdateCheck == null || (_lastUpdateCheck$upda = lastUpdateCheck.updates) == null || (_lastUpdateCheck$upda = _lastUpdateCheck$upda.installed) == null || _lastUpdateCheck$upda.filter(composerPackage => {\n const id = composerPackage.name.replace('/', '-').replace(/(flarum-ext-)|(flarum-)/, '');\n const extension = app.data.extensions[id];\n const safeToUpdate = ['semver-safe-update', 'update-possible'].includes(composerPackage['latest-status']);\n if (extension && safeToUpdate) {\n this.packageUpdates[extension.id] = composerPackage;\n }\n return extension && safeToUpdate;\n });\n return Object.values(app.data.extensions).filter(extension => this.packageUpdates[extension.id]);\n }\n formatCoreUpdate(lastUpdateCheck) {\n var _lastUpdateCheck$upda2;\n const core = lastUpdateCheck == null || (_lastUpdateCheck$upda2 = lastUpdateCheck.updates) == null || (_lastUpdateCheck$upda2 = _lastUpdateCheck$upda2.installed) == null ? void 0 : _lastUpdateCheck$upda2.filter(composerPackage => composerPackage.name === 'flarum/core').pop();\n if (!core) return null;\n return {\n package: core,\n extension: {\n id: 'flarum-core',\n name: 'flarum/core',\n version: app.data.settings.version,\n icon: {\n name: '',\n // @ts-ignore\n backgroundImage: \"url(\".concat(app.data.resources[0]['attributes']['baseUrl'], \"/assets/extensions/flarum-extension-manager/flarum.svg\")\n },\n extra: {\n 'flarum-extension': {\n title: extractText(app.translator.trans('flarum-extension-manager.admin.updater.flarum'))\n }\n },\n links: {}\n }\n };\n }\n majorUpdate(_ref) {\n let {\n dryRun\n } = _ref;\n app.extensionManager.control.setLoading(dryRun ? 'major-update-dry-run' : 'major-update');\n app.modal.show(LoadingModal);\n const updateState = this.lastUpdateRun.major;\n app.request({\n method: 'POST',\n url: \"\".concat(app.forum.attribute('apiUrl'), \"/extension-manager/major-update\"),\n body: {\n data: {\n dryRun\n }\n }\n }).then(response => {\n if (response != null && response.processing) {\n jumpToQueue();\n } else {\n app.alerts.show({\n type: 'success'\n }, app.translator.trans('flarum-extension-manager.admin.update_successful'));\n window.location.reload();\n }\n }).catch(errorHandler).catch(e => {\n var _e$response;\n app.modal.close();\n updateState.status = 'failure';\n updateState.incompatibleExtensions = (_e$response = e.response) == null || (_e$response = _e$response.errors) == null || (_e$response = _e$response.pop()) == null ? void 0 : _e$response.incompatible_extensions;\n }).finally(() => {\n m.redraw();\n });\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/states/ControlSectionState', ControlSectionState);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/states/PaginatedListState');","import app from 'flarum/admin/app';\nimport PaginatedListState from 'flarum/common/states/PaginatedListState';\nexport default class ExtensionListState extends PaginatedListState {\n get type() {\n return 'external-extensions';\n }\n constructor() {\n super({\n sort: '-downloads'\n }, 1, 12);\n }\n sortMap() {\n return {\n '-createdAt': {\n sort: '-createdAt',\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.sort.latest', {}, true)\n },\n '-downloads': {\n sort: '-downloads',\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.sort.top', {}, true)\n }\n };\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/states/ExtensionListState', ExtensionListState);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport QueueState from './QueueState';\nimport ControlSectionState from './ControlSectionState';\nimport ExtensionListState from './ExtensionListState';\nexport default class ExtensionManagerState {\n constructor() {\n _defineProperty(this, \"queue\", new QueueState());\n _defineProperty(this, \"control\", new ControlSectionState());\n _defineProperty(this, \"extensions\", new ExtensionListState());\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/states/ExtensionManagerState', ExtensionManagerState);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extenders');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/Component');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/LoadingIndicator');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Tooltip');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Icon');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/ItemList');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Link');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Pagination');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/classList');","import Component from 'flarum/common/Component';\nimport classList from 'flarum/common/utils/classList';\nexport default class Label extends Component {\n view(vnode) {\n const {\n className,\n type,\n ...attrs\n } = this.attrs;\n return m(\"span\", Object.assign({\n className: classList(['Label', \"Label--\".concat(this.attrs.type), className])\n }, attrs), vnode.children);\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/Label', Label);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Modal');","import app from 'flarum/admin/app';\nimport Modal from 'flarum/common/components/Modal';\nexport default class TaskOutputModal extends Modal {\n className() {\n return 'Modal--large QuickModal';\n }\n title() {\n return app.translator.trans(\"flarum-extension-manager.admin.sections.queue.operations.\".concat(this.attrs.task.operation()));\n }\n content() {\n return m(\"div\", {\n className: \"Modal-body\"\n }, m(\"div\", {\n className: \"TaskOutputModal-data\"\n }, this.attrs.task.status() === 'failure' && m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.sections.queue.output_modal.guessed_cause')), m(\"div\", {\n className: \"FormControl TaskOutputModal-data-guessed-cause\"\n }, this.attrs.task.guessedCause() && app.translator.trans('flarum-extension-manager.admin.exceptions.guessed_cause.' + this.attrs.task.guessedCause()) || app.translator.trans('flarum-extension-manager.admin.sections.queue.output_modal.cause_unknown'))), m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.sections.queue.output_modal.command')), m(\"div\", {\n className: \"FormControl TaskOutputModal-data-command\"\n }, m(\"code\", null, \"$ composer \", this.attrs.task.command()))), m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.sections.queue.output_modal.output')), m(\"div\", {\n className: \"FormControl TaskOutputModal-data-output\"\n }, m(\"code\", null, m(\"pre\", null, this.attrs.task.output()))))));\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/TaskOutputModal', TaskOutputModal);","import duration from 'dayjs/plugin/duration';\nexport default function humanDuration(start, end) {\n dayjs.extend(duration);\n const durationTime = dayjs(end).diff(start);\n return dayjs.duration(durationTime).humanize();\n}\nflarum.reg.add('flarum-extension-manager', 'admin/utils/humanDuration', humanDuration);","import app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport Button from 'flarum/common/components/Button';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport Icon from 'flarum/common/components/Icon';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport extractText from 'flarum/common/utils/extractText';\nimport Link from 'flarum/common/components/Link';\nimport Pagination from 'flarum/common/components/Pagination';\nimport classList from 'flarum/common/utils/classList';\nimport Label from './Label';\nimport TaskOutputModal from './TaskOutputModal';\nimport humanDuration from '../utils/humanDuration';\nexport default class QueueSection extends Component {\n oninit(vnode) {\n super.oninit(vnode);\n app.extensionManager.queue.load();\n }\n view() {\n return m(\"section\", {\n id: \"ExtensionManager-queueSection\",\n className: \"ExtensionPage-settings ExtensionManager-queueSection\"\n }, m(\"div\", {\n className: \"ExtensionPage-permissions-header ExtensionManager-queueSection-header\"\n }, m(\"div\", {\n className: \"container\"\n }, m(\"h2\", {\n className: \"ExtensionTitle\"\n }, app.translator.trans('flarum-extension-manager.admin.sections.queue.title')), m(Button, {\n className: \"Button Button--icon\",\n icon: \"fas fa-sync-alt\",\n onclick: () => app.extensionManager.queue.load(),\n \"aria-label\": app.translator.trans('flarum-extension-manager.admin.sections.queue.refresh'),\n disabled: app.extensionManager.control.isLoading()\n }))), m(\"div\", {\n className: \"container\"\n }, this.queueTable()));\n }\n columns() {\n const items = new ItemList();\n items.add('operation', {\n label: extractText(app.translator.trans('flarum-extension-manager.admin.sections.queue.columns.operation')),\n content: task => m(\"div\", {\n className: \"ExtensionManager-queueTable-operation\"\n }, m(\"span\", {\n className: \"ExtensionManager-queueTable-operation-icon\"\n }, this.operationIcon(task.operation())), m(\"span\", {\n className: \"ExtensionManager-queueTable-operation-name\"\n }, app.translator.trans(\"flarum-extension-manager.admin.sections.queue.operations.\".concat(task.operation()))))\n }, 80);\n items.add('package', {\n label: extractText(app.translator.trans('flarum-extension-manager.admin.sections.queue.columns.package')),\n content: task => {\n var _task$package;\n const extension = app.data.extensions[(_task$package = task.package()) == null ? void 0 : _task$package.replace(/(\\/flarum-|\\/flarum-ext-|\\/)/g, '-')];\n return extension ? m(Link, {\n className: \"ExtensionManager-queueTable-package\",\n href: app.route('extension', {\n id: extension.id\n })\n }, m(\"div\", {\n className: \"ExtensionManager-queueTable-package-icon ExtensionIcon\",\n style: extension.icon\n }, !!extension.icon && m(Icon, {\n name: extension.icon.name\n })), m(\"div\", {\n className: \"ExtensionManager-queueTable-package-details\"\n }, m(\"span\", {\n className: \"ExtensionManager-queueTable-package-title\"\n }, extension.extra['flarum-extension'].title), m(\"span\", {\n className: \"ExtensionManager-queueTable-package-name\"\n }, task.package()))) : task.package();\n }\n }, 75);\n items.add('status', {\n label: extractText(app.translator.trans('flarum-extension-manager.admin.sections.queue.columns.status')),\n content: task => m('[', null, m(Label, {\n className: \"ExtensionManager-queueTable-status\",\n type: {\n running: 'neutral',\n failure: 'error',\n pending: 'warning',\n success: 'success'\n }[task.status()]\n }, app.translator.trans(\"flarum-extension-manager.admin.sections.queue.statuses.\".concat(task.status()))), ['pending', 'running'].includes(task.status()) && m(LoadingIndicator, {\n size: \"small\",\n display: \"inline\"\n }))\n }, 70);\n items.add('elapsedTime', {\n label: extractText(app.translator.trans('flarum-extension-manager.admin.sections.queue.columns.elapsed_time')),\n content: task => !task.startedAt() || !task.finishedAt() ? app.translator.trans('flarum-extension-manager.admin.sections.queue.task_just_started') : m(Tooltip, {\n text: \"\".concat(dayjs(task.startedAt()).format('LL LTS'), \" \").concat(dayjs(task.finishedAt()).format('LL LTS'))\n }, m(\"span\", null, humanDuration(task.startedAt(), task.finishedAt())))\n }, 65);\n items.add('memoryUsed', {\n label: extractText(app.translator.trans('flarum-extension-manager.admin.sections.queue.columns.peak_memory_used')),\n content: task => m(\"span\", null, task.peakMemoryUsed())\n }, 60);\n items.add('details', {\n label: extractText(app.translator.trans('flarum-extension-manager.admin.sections.queue.columns.details')),\n content: task => m(Button, {\n className: \"Button Button--icon Table-controls-item\",\n icon: \"fas fa-file-alt\",\n \"aria-label\": app.translator.trans('flarum-extension-manager.admin.sections.queue.columns.details')\n // @todo fix in core\n // @ts-ignore\n ,\n onclick: () => app.modal.show(TaskOutputModal, {\n task\n }),\n disabled: ['pending', 'running'].includes(task.status())\n }),\n className: 'Table-controls'\n }, 55);\n return items;\n }\n queueTable() {\n const tasks = app.extensionManager.queue.getItems();\n if (!tasks) {\n return m(LoadingIndicator, null);\n }\n if (tasks && !tasks.length) {\n return m(\"h3\", {\n className: \"ExtensionPage-subHeader\"\n }, app.translator.trans('flarum-extension-manager.admin.sections.queue.none'));\n }\n const columns = this.columns();\n return m('[', null, m(\"div\", {\n className: classList('Table-container', {\n 'loading-container': tasks && app.extensionManager.queue.isLoading()\n })\n }, m(\"table\", {\n className: \"Table ExtensionManager-queueTable\"\n }, m(\"thead\", null, m(\"tr\", null, columns.toArray().map((item, index) => m(\"th\", {\n key: index\n }, item.label)))), m(\"tbody\", null, tasks.map((task, index) => m(\"tr\", {\n key: index\n }, columns.toArray().map((item, index) => {\n const {\n label,\n content,\n ...attrs\n } = item;\n return m(\"td\", Object.assign({\n key: index\n }, attrs), content(task));\n }))))), tasks && app.extensionManager.queue.isLoading() && m(LoadingIndicator, {\n size: \"large\"\n })), m(Pagination, {\n total: app.extensionManager.queue.getTotalItems(),\n currentPage: app.extensionManager.queue.pageNumber() + 1,\n perPage: app.extensionManager.queue.getPerPage(),\n onChange: page => app.extensionManager.queue.goto(page)\n }));\n }\n operationIcon(operation) {\n return m(Icon, {\n name: {\n update_check: 'fas fa-sync-alt',\n update_major: 'fas fa-play',\n update_minor: 'fas fa-play',\n update_global: 'fas fa-play',\n extension_install: 'fas fa-download',\n extension_remove: 'fas fa-times',\n extension_update: 'fas fa-arrow-alt-circle-up',\n why_not: 'fas fa-exclamation-circle'\n }[operation]\n });\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/QueueSection', QueueSection);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Alert');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/Stream');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport Stream from 'flarum/common/utils/Stream';\nexport default class Installer extends Component {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"packageName\", void 0);\n }\n oninit(vnode) {\n super.oninit(vnode);\n this.packageName = Stream('');\n }\n view() {\n return m(\"div\", {\n className: \"Form-group ExtensionManager-installer\"\n }, m(\"label\", {\n htmlFor: \"install-extension\"\n }, app.translator.trans('flarum-extension-manager.admin.extensions.install')), m(\"div\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-extension-manager.admin.extensions.install_help', {\n link: m(\"a\", {\n href: \"https://flarum.org/extensions\"\n }, \"flarum.org\"),\n semantic_link: m(\"a\", {\n href: \"https://devhints.io/semver\"\n }),\n code: m(\"code\", null)\n })), m(\"div\", {\n className: \"FormControl-container\"\n }, m(\"input\", {\n className: \"FormControl\",\n id: \"install-extension\",\n placeholder: \"vendor/package-name\",\n bidi: this.packageName\n }), m(Button, {\n className: \"Button\",\n icon: \"fas fa-download\",\n onclick: this.onsubmit.bind(this),\n loading: app.extensionManager.control.isLoading('extension-install'),\n disabled: app.extensionManager.control.hasOperationRunning()\n }, app.translator.trans('flarum-extension-manager.admin.extensions.proceed'))));\n }\n data() {\n return {\n package: this.packageName()\n };\n }\n onsubmit() {\n app.extensionManager.control.requirePackage(this.data());\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/Installer', Installer);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/helpers/humanTime');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport Modal from 'flarum/common/components/Modal';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport errorHandler from '../utils/errorHandler';\nexport default class WhyNotModal extends Modal {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"loading\", true);\n _defineProperty(this, \"whyNot\", null);\n }\n className() {\n return 'Modal--large WhyNotModal';\n }\n title() {\n return app.translator.trans('flarum-extension-manager.admin.why_not_modal.title');\n }\n oncreate(vnode) {\n super.oncreate(vnode);\n this.requestWhyNot();\n }\n content() {\n return m(\"div\", {\n className: \"Modal-body\"\n }, this.loading ? m(LoadingIndicator, null) : m(\"pre\", {\n className: \"WhyNotModal-contents\"\n }, this.whyNot));\n }\n requestWhyNot() {\n app.request({\n method: 'POST',\n url: \"\".concat(app.forum.attribute('apiUrl'), \"/extension-manager/why-not\"),\n body: {\n data: {\n package: this.attrs.package\n }\n }\n }).then(response => {\n this.loading = false;\n this.whyNot = response.data.reason;\n m.redraw();\n }).catch(errorHandler);\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/WhyNotModal', WhyNotModal);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Badge');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/formatAmount');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/Model');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport Model from 'flarum/common/Model';\nimport app from 'flarum/admin/app';\nexport default class ExternalExtension extends Model {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"extensionId\", Model.attribute('extensionId'));\n _defineProperty(this, \"name\", Model.attribute('name'));\n _defineProperty(this, \"title\", Model.attribute('title'));\n _defineProperty(this, \"description\", Model.attribute('description'));\n _defineProperty(this, \"iconUrl\", Model.attribute('iconUrl'));\n _defineProperty(this, \"icon\", Model.attribute('icon'));\n _defineProperty(this, \"highestVersion\", Model.attribute('highestVersion'));\n _defineProperty(this, \"httpUri\", Model.attribute('httpUri'));\n _defineProperty(this, \"discussUri\", Model.attribute('discussUri'));\n _defineProperty(this, \"vendor\", Model.attribute('vendor'));\n _defineProperty(this, \"isPremium\", Model.attribute('isPremium'));\n _defineProperty(this, \"isLocale\", Model.attribute('isLocale'));\n _defineProperty(this, \"locale\", Model.attribute('locale'));\n _defineProperty(this, \"latestFlarumVersionSupported\", Model.attribute('latestFlarumVersionSupported'));\n _defineProperty(this, \"downloads\", Model.attribute('downloads'));\n _defineProperty(this, \"installed\", false);\n }\n isSupported() {\n const currentVersion = app.data.settings.version;\n const latestCompatibleVersion = this.latestFlarumVersionSupported();\n\n // If stability is not the same, it's not compatible.\n if (currentVersion.split('-')[1] !== latestCompatibleVersion.split('-')[1]) {\n return false;\n }\n\n // Minor versions are compatible.\n return currentVersion.split('.')[0] === latestCompatibleVersion.split('.')[0];\n }\n isStable() {\n const split = this.highestVersion().split('-');\n if (split.length === 1) {\n return true;\n }\n const stability = split[1].split('.');\n return stability[0] === 'stable';\n }\n toLocalExtension() {\n return {\n id: this.extensionId(),\n name: this.name(),\n version: this.highestVersion(),\n description: this.description(),\n icon: this.icon() || {\n name: 'fas fa-box-open',\n backgroundColor: '#117187',\n color: '#fff'\n },\n links: {\n discuss: this.discussUri(),\n website: this.httpUri()\n },\n extra: {\n 'flarum-extension': {\n title: this.title()\n }\n }\n };\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/models/ExternalExtension', ExternalExtension);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Dropdown');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/LinkButton');","import Component from 'flarum/common/Component';\nimport Icon from 'flarum/common/components/Icon';\nimport Badge from 'flarum/common/components/Badge';\nimport app from 'flarum/admin/app';\nimport Button from 'flarum/common/components/Button';\nimport formatAmount from 'flarum/common/utils/formatAmount';\nimport ExternalExtension from '../models/ExternalExtension';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport classList from 'flarum/common/utils/classList';\nimport Label from './Label';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport Dropdown from 'flarum/common/components/Dropdown';\nimport WhyNotModal from './WhyNotModal';\nimport LinkButton from 'flarum/common/components/LinkButton';\nexport default class ExtensionCard extends Component {\n getExtension() {\n return this.attrs.extension instanceof ExternalExtension ? this.attrs.extension.toLocalExtension() : this.attrs.extension;\n }\n view() {\n const extension = this.getExtension();\n const {\n isCore,\n isDanger\n } = this.attrs;\n return m(\"div\", {\n className: classList('ExtensionCard', {\n 'ExtensionCard--core': isCore,\n 'ExtensionCard--danger': isDanger\n })\n }, m(\"div\", {\n className: \"ExtensionCard-header\"\n }, this.icon(), m(Tooltip, {\n text: extension.name\n }, m(\"h4\", null, extension.extra['flarum-extension'].title)), this.attrs.extension instanceof ExternalExtension && m(\"div\", {\n className: \"ExtensionCard-badges\"\n }, this.badges().toArray()), m(\"div\", {\n className: \"ExtensionCard-actions\"\n }, this.actionItems().toArray())), m(\"div\", {\n className: \"ExtensionCard-body\"\n }, m(\"p\", null, extension.description)), m(\"div\", {\n className: \"ExtensionCard-footer\"\n }, m(\"div\", {\n className: \"ExtensionCard-meta\"\n }, this.metaItems().toArray())));\n }\n icon() {\n var _extension$icon, _extension$icon2;\n const extension = this.getExtension();\n if (this.attrs.extension instanceof ExternalExtension && extension.id in app.data.extensions) {\n extension.icon = app.data.extensions[extension.id].icon;\n }\n const style = extension.icon || {};\n if (!((_extension$icon = extension.icon) != null && _extension$icon.name) && this.attrs.extension instanceof ExternalExtension && !(extension.id in app.data.extensions) && this.attrs.extension.iconUrl()) {\n style.backgroundImage = \"url(\".concat(this.attrs.extension.iconUrl(), \")\");\n }\n return m(\"span\", {\n className: \"ExtensionIcon\",\n style: extension.icon\n }, (_extension$icon2 = extension.icon) != null && _extension$icon2.name ? m(Icon, {\n name: extension.icon.name\n }) : null);\n }\n badges() {\n const items = new ItemList();\n const extension = this.attrs.extension;\n if (extension.isSupported()) {\n items.add('compatible', m(Badge, {\n icon: \"fas fa-check\",\n type: \"success\",\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.extension.badges.compatible'),\n className: \"Badge--flat Badge--square\"\n }));\n } else {\n items.add('incompatible', m(Badge, {\n icon: \"fas fa-times\",\n type: \"danger\",\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.extension.badges.incompatible'),\n className: \"Badge--flat Badge--square\"\n }));\n }\n if (extension.isPremium()) {\n items.add('premium', m(Badge, {\n icon: \"fas fa-dollar-sign\",\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.extension.badges.premium'),\n className: \"ExtensionCard-badge--premium Badge--flat Badge--square\"\n }));\n }\n if (!extension.isStable()) {\n items.add('unstable', m(Badge, {\n icon: \"fas fa-flask\",\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.extension.badges.unstable'),\n className: \"Badge--flat Badge--square Badge--danger\"\n }));\n }\n if (extension.name().split('/')[0] === 'fof') {\n items.add('fof', m(Badge, {\n icon: \"fas fa-users\",\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.extension.badges.fof'),\n className: \"Badge--flat Badge--square\"\n }));\n }\n if (extension.name().split('/')[0] === 'flarum') {\n items.add('flarum', m(Badge, {\n icon: \"fab fa-flarum\",\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.extension.badges.flarum'),\n className: \"ExtensionCard-badge--flarum Badge--flat Badge--square\"\n }));\n }\n return items;\n }\n metaItems() {\n var _updates$latestMinor;\n const items = new ItemList();\n const {\n updates,\n isCore\n } = this.attrs;\n const latestVersion = updates ? (_updates$latestMinor = updates['latest-minor']) != null ? _updates$latestMinor : updates['latest-major'] && !isCore ? updates['latest-major'] : null : null;\n if (this.attrs.extension instanceof ExternalExtension) {\n items.add('downloads', m(\"span\", null, m(Icon, {\n name: \"fas fa-circle-down\"\n }), app.translator.trans('flarum-extension-manager.admin.sections.discover.extension.downloads', {\n count: this.attrs.extension.downloads(),\n formattedCount: formatAmount(this.attrs.extension.downloads())\n })));\n } else {\n items.add('version', m(\"div\", {\n className: \"ExtensionCard-version\"\n }, m(\"span\", {\n className: \"ExtensionCard-version-current\"\n }, this.version(updates['version'])), latestVersion ? m('[', null, m(Icon, {\n name: \"fas fa-arrow-right\"\n }), m(Label, {\n className: \"ExtensionCard-version-latest\",\n type: updates['latest-minor'] ? 'success' : 'warning'\n }, this.version(latestVersion))) : null));\n }\n if (this.attrs.extension instanceof ExternalExtension) {\n items.add('version', m(\"div\", {\n className: \"ExtensionCard-version\"\n }, \"v\", this.version(this.attrs.extension.highestVersion())));\n items.add('link', m(LinkButton, {\n className: \"Button Button--ua-reset Button--link Button--icon\",\n href: this.attrs.extension.httpUri(),\n target: \"_blank\",\n icon: \"fas fa-external-link-alt\",\n external: true\n }));\n }\n return items;\n }\n actionItems() {\n const items = new ItemList();\n const {\n updates,\n extension,\n onClickUpdate,\n whyNotWarning\n } = this.attrs;\n if (extension instanceof ExternalExtension) {\n if (!(extension.extensionId() in app.data.extensions)) {\n items.add('install', m(Button, {\n className: \"Button Button--icon Button--flat\",\n icon: \"fas fa-cloud-arrow-down\",\n onclick: () => {\n app.extensionManager.control.requirePackage({\n package: extension.name()\n });\n }\n }));\n } else {\n items.add('installed', m(Button, {\n className: \"Button Button--icon Button--flat Button--success\",\n icon: \"fas fa-check-circle\",\n disabled: true\n }));\n }\n } else {\n if (onClickUpdate && typeof onClickUpdate === 'function') {\n items.add('update', m(Tooltip, {\n text: app.translator.trans('flarum-extension-manager.admin.extensions.update')\n }, m(Button, {\n icon: \"fas fa-cloud-arrow-down\",\n className: \"Button Button--icon Button--flat\",\n onclick: onClickUpdate,\n \"aria-label\": app.translator.trans('flarum-extension-manager.admin.extensions.update')\n })));\n } else if (onClickUpdate) {\n items.add('update', m(Dropdown, {\n buttonClassName: \"Button Button--icon Button--flat\",\n icon: \"fas fa-ellipsis\",\n label: app.translator.trans('flarum-extension-manager.admin.extensions.update')\n }, m(Button, {\n icon: \"fas fa-cloud-arrow-down\",\n onclick: onClickUpdate.soft\n }, app.translator.trans('flarum-extension-manager.admin.extensions.update_soft_label')), m(Button, {\n icon: \"fas fa-rotate\",\n onclick: onClickUpdate.hard,\n disabled: !updates['direct-dependency']\n }, app.translator.trans('flarum-extension-manager.admin.extensions.update_hard_label'))));\n }\n if (whyNotWarning) items.add('whyNot', m(Tooltip, {\n text: app.translator.trans('flarum-extension-manager.admin.extensions.check_why_it_failed_updating')\n }, m(Button, {\n icon: \"fas fa-exclamation-circle\",\n className: \"Button Button--icon Button--flat Button--danger\",\n onclick: () => app.modal.show(WhyNotModal, {\n package: extension.name\n }),\n \"aria-label\": app.translator.trans('flarum-extension-manager.admin.extensions.check_why_it_failed_updating')\n })));\n }\n return items;\n }\n version(v) {\n return v.charAt(0) === 'v' ? v.substring(1) : v;\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/ExtensionCard', ExtensionCard);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport Alert from 'flarum/common/components/Alert';\nimport WhyNotModal from './WhyNotModal';\nimport ExtensionCard from './ExtensionCard';\nimport classList from 'flarum/common/utils/classList';\nexport default class MajorUpdater extends Component {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"updateState\", void 0);\n }\n oninit(vnode) {\n super.oninit(vnode);\n this.updateState = this.attrs.updateState;\n }\n view() {\n return m(\"div\", {\n className: classList('Form-group Form-group--danger ExtensionManager-majorUpdate', {\n 'ExtensionManager-majorUpdate--failed': this.updateState.status === 'failure',\n 'ExtensionManager-majorUpdate--incompatibleExtensions': this.updateState.incompatibleExtensions.length\n })\n }, m(\"img\", {\n alt: \"flarum logo\",\n src: app.forum.attribute('baseUrl') + '/assets/extensions/flarum-extension-manager/flarum.svg'\n }), m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.major_updater.title', {\n version: this.attrs.coreUpdate['latest-major']\n })), m(\"p\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-extension-manager.admin.major_updater.description')), m(\"div\", {\n className: \"ExtensionManager-updaterControls\"\n }, m(Tooltip, {\n text: app.translator.trans('flarum-extension-manager.admin.major_updater.dry_run_help')\n }, m(Button, {\n className: \"Button\",\n icon: \"fas fa-vial\",\n onclick: this.update.bind(this, true),\n disabled: app.extensionManager.control.hasOperationRunning()\n }, app.translator.trans('flarum-extension-manager.admin.major_updater.dry_run'))), m(Button, {\n className: \"Button Button--danger\",\n icon: \"fas fa-play\",\n onclick: this.update.bind(this, false),\n disabled: app.extensionManager.control.hasOperationRunning()\n }, app.translator.trans('flarum-extension-manager.admin.major_updater.update'))), this.updateState.incompatibleExtensions.length ? m(\"div\", {\n className: \"ExtensionManager-majorUpdate-incompatibleExtensions ExtensionManager-extensions-grid\"\n }, this.updateState.incompatibleExtensions.map(extension => m(ExtensionCard, {\n extension: app.data.extensions[extension.replace('flarum-', '').replace('flarum-ext-', '').replace('/', '-')],\n updates: {},\n onClickUpdate: null,\n isDanger: true\n }))) : null, this.updateState.status === 'failure' ? m(Alert, {\n type: \"error\",\n className: \"ExtensionManager-majorUpdate-failure\",\n dismissible: false,\n controls: [m(Button, {\n className: \"Button Button--text ExtensionManager-majorUpdate-failure-details\",\n icon: \"fas fa-question-circle\",\n onclick: () => app.modal.show(WhyNotModal, {\n package: 'flarum/core'\n })\n }, app.translator.trans('flarum-extension-manager.admin.major_updater.failure.why'))]\n }, m(\"p\", {\n className: \"ExtensionManager-majorUpdate-failure-desc\"\n }, app.translator.trans('flarum-extension-manager.admin.major_updater.failure.desc'))) : null);\n }\n update(dryRun) {\n app.extensionManager.control.majorUpdate({\n dryRun\n });\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/MajorUpdater', MajorUpdater);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/InfoTile');","import app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport humanTime from 'flarum/common/helpers/humanTime';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport MajorUpdater from './MajorUpdater';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport InfoTile from 'flarum/common/components/InfoTile';\nimport ExtensionCard from './ExtensionCard';\nexport default class Updater extends Component {\n view() {\n const core = app.extensionManager.control.coreUpdate;\n return [m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.updater.updater_title')), m(\"div\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-extension-manager.admin.updater.updater_help')), this.lastUpdateCheckView(), m(\"div\", {\n className: \"ExtensionManager-updaterControls\"\n }, this.controlItems().toArray()), this.availableUpdatesView()), core && core.package['latest-major'] ? m(MajorUpdater, {\n coreUpdate: core.package,\n updateState: app.extensionManager.control.lastUpdateRun.major\n }) : null];\n }\n lastUpdateCheckView() {\n var _app$extensionManager;\n return ((_app$extensionManager = app.extensionManager.control.lastUpdateCheck) == null ? void 0 : _app$extensionManager.checkedAt) && m(\"p\", {\n className: \"ExtensionManager-lastUpdatedAt\"\n }, m(\"span\", {\n className: \"ExtensionManager-lastUpdatedAt-label\"\n }, app.translator.trans('flarum-extension-manager.admin.updater.last_update_checked_at')), m(\"span\", {\n className: \"ExtensionManager-lastUpdatedAt-value\"\n }, humanTime(app.extensionManager.control.lastUpdateCheck.checkedAt))) || null;\n }\n availableUpdatesView() {\n const state = app.extensionManager.control;\n if (app.extensionManager.control.isLoading('check') || app.extensionManager.control.isLoading('global-update')) {\n return m(\"div\", {\n className: \"ExtensionManager-extensions\"\n }, m(LoadingIndicator, null));\n }\n const hasMinorCoreUpdate = state.coreUpdate && state.coreUpdate.package['latest-minor'];\n if (!(state.extensionUpdates.length || hasMinorCoreUpdate)) {\n return m(\"div\", {\n className: \"ExtensionManager-extensions ExtensionManager-extensions--empty\"\n }, m(InfoTile, {\n icon: \"fas fa-plug-circle-check\"\n }, app.translator.trans('flarum-extension-manager.admin.updater.up_to_date')));\n }\n return m(\"div\", {\n className: \"ExtensionManager-extensions\"\n }, m(\"div\", {\n className: \"ExtensionManager-extensions-grid\"\n }, hasMinorCoreUpdate ? m(ExtensionCard, {\n extension: state.coreUpdate.extension,\n updates: state.coreUpdate.package,\n isCore: true,\n onClickUpdate: () => state.updateCoreMinor(),\n whyNotWarning: state.lastUpdateRun.limitedPackages().includes('flarum/core')\n }) : null, state.extensionUpdates.map(extension => m(ExtensionCard, {\n extension: extension,\n updates: state.packageUpdates[extension.id],\n onClickUpdate: {\n soft: () => state.updateExtension(extension, 'soft'),\n hard: () => state.updateExtension(extension, 'hard')\n },\n whyNotWarning: state.lastUpdateRun.limitedPackages().includes(extension.name)\n }))));\n }\n controlItems() {\n const items = new ItemList();\n items.add('updateCheck', m(Button, {\n className: \"Button\",\n icon: \"fas fa-sync-alt\",\n onclick: () => app.extensionManager.control.checkForUpdates(),\n loading: app.extensionManager.control.isLoading('check'),\n disabled: app.extensionManager.control.hasOperationRunning()\n }, app.translator.trans('flarum-extension-manager.admin.updater.check_for_updates')), 100);\n items.add('globalUpdate', m(Button, {\n className: \"Button\",\n icon: \"fas fa-play\",\n onclick: () => app.extensionManager.control.updateGlobally(),\n loading: app.extensionManager.control.isLoading('global-update'),\n disabled: app.extensionManager.control.hasOperationRunning()\n }, app.translator.trans('flarum-extension-manager.admin.updater.run_global_update')));\n return items;\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/Updater', Updater);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Form');","import app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport Alert from 'flarum/common/components/Alert';\nimport Installer from './Installer';\nimport Updater from './Updater';\nimport Form from 'flarum/common/components/Form';\nexport default class ControlSection extends Component {\n oninit(vnode) {\n super.oninit(vnode);\n }\n view() {\n return m(\"div\", {\n className: \"ExtensionPage-settings ExtensionManager-controlSection\"\n }, m(\"div\", {\n className: \"container\"\n }, app.data['flarum-extension-manager.writable_dirs'] ? m(Form, null, m(Installer, null), m(Updater, null)) : m(\"div\", {\n className: \"Form-group\"\n }, m(Alert, {\n type: \"warning\",\n dismissible: false\n }, app.translator.trans('flarum-extension-manager.admin.file_permissions')))));\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/ControlSection', ControlSection);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/FormGroup');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport FormGroup from 'flarum/common/components/FormGroup';\nimport Stream from 'flarum/common/utils/Stream';\nimport Button from 'flarum/common/components/Button';\nimport classList from 'flarum/common/utils/classList';\nexport default class ConfigureJson extends Component {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"settings\", {});\n _defineProperty(this, \"initialSettings\", null);\n _defineProperty(this, \"loading\", false);\n _defineProperty(this, \"type\", void 0);\n }\n oninit(vnode) {\n super.oninit(vnode);\n this.submit(true);\n }\n className() {\n return '';\n }\n view() {\n return m(\"div\", {\n className: classList('FormSection', this.className())\n }, m(\"label\", null, this.title()), this.content(), m(\"div\", {\n className: \"Form-group Form-controls\"\n }, this.submitButton()));\n }\n submitButton() {\n return [m(Button, {\n className: \"Button Button--primary\",\n loading: this.loading,\n onclick: () => this.submit(false),\n disabled: !this.isDirty()\n }, app.translator.trans('core.admin.settings.submit_button'))];\n }\n customSettingComponents() {\n return FormGroup.prototype.customFieldComponents();\n }\n setting(key) {\n var _this$settings$key;\n return (_this$settings$key = this.settings[key]) != null ? _this$settings$key : this.settings[key] = Stream();\n }\n submit(readOnly) {\n this.loading = true;\n const configuration = {};\n Object.keys(this.settings).forEach(key => {\n configuration[key] = this.settings[key]();\n });\n app.request({\n method: 'POST',\n url: app.forum.attribute('apiUrl') + '/extension-manager/composer',\n body: {\n type: this.type,\n data: readOnly ? null : configuration\n }\n }).then(_ref => {\n let {\n data\n } = _ref;\n Object.keys(data).forEach(key => {\n this.settings[key] = Stream(data[key]);\n });\n this.initialSettings = Array.isArray(data) ? {} : data;\n }).finally(() => {\n this.loading = false;\n m.redraw();\n });\n }\n isDirty() {\n return JSON.stringify(this.initialSettings) !== JSON.stringify(this.settings);\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/ConfigureJson', ConfigureJson);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Select');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport Modal from 'flarum/common/components/Modal';\nimport app from 'flarum/admin/app';\nimport Select from 'flarum/common/components/Select';\nimport Stream from 'flarum/common/utils/Stream';\nimport Button from 'flarum/common/components/Button';\nimport Form from 'flarum/common/components/Form';\nexport default class RepositoryModal extends Modal {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"name\", void 0);\n _defineProperty(this, \"repository\", void 0);\n }\n oninit(vnode) {\n super.oninit(vnode);\n this.name = Stream(this.attrs.name || '');\n this.repository = Stream(this.attrs.repository || {\n type: 'composer',\n url: ''\n });\n }\n className() {\n return 'RepositoryModal Modal--small';\n }\n title() {\n const context = this.attrs.repository ? 'edit' : 'add';\n return app.translator.trans(\"flarum-extension-manager.admin.composer.\".concat(context, \"_repository_label\"));\n }\n content() {\n const types = {\n composer: app.translator.trans('flarum-extension-manager.admin.composer.repositories.types.composer'),\n vcs: app.translator.trans('flarum-extension-manager.admin.composer.repositories.types.vcs'),\n path: app.translator.trans('flarum-extension-manager.admin.composer.repositories.types.path')\n };\n return m(\"div\", {\n className: \"Modal-body\"\n }, m(Form, null, m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.composer.repositories.add_modal.name_label')), m(\"input\", {\n className: \"FormControl\",\n bidi: this.name\n })), m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.composer.repositories.add_modal.type_label')), m(Select, {\n options: types,\n value: this.repository().type,\n onchange: value => this.repository({\n ...this.repository(),\n type: value\n })\n })), m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.composer.repositories.add_modal.url')), m(\"input\", {\n className: \"FormControl\",\n onchange: e => this.repository({\n ...this.repository(),\n url: e.target.value\n }),\n value: this.repository().url\n })), m(\"div\", {\n className: \"Form-group\"\n }, m(Button, {\n className: \"Button Button--primary\",\n onclick: this.submit.bind(this)\n }, app.translator.trans('flarum-extension-manager.admin.composer.repositories.add_modal.submit_button')))));\n }\n submit() {\n this.attrs.onsubmit(this.repository(), this.name());\n this.hide();\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/RepositoryModal', RepositoryModal);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport ConfigureJson from './ConfigureJson';\nimport Button from 'flarum/common/components/Button';\nimport extractText from 'flarum/common/utils/extractText';\nimport RepositoryModal from './RepositoryModal';\nexport default class ConfigureComposer extends ConfigureJson {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"type\", 'composer');\n }\n title() {\n return app.translator.trans('flarum-extension-manager.admin.composer.title');\n }\n className() {\n return 'ConfigureComposer';\n }\n content() {\n return m(\"div\", {\n className: \"Form ExtensionManager-SettingsGroups-content\"\n }, this.attrs.buildSettingComponent.call(this, {\n setting: 'minimum-stability',\n label: app.translator.trans('flarum-extension-manager.admin.composer.minimum_stability.label'),\n help: app.translator.trans('flarum-extension-manager.admin.composer.minimum_stability.help'),\n type: 'select',\n options: {\n stable: app.translator.trans('flarum-extension-manager.admin.composer.minimum_stability.options.stable'),\n RC: app.translator.trans('flarum-extension-manager.admin.composer.minimum_stability.options.rc'),\n beta: app.translator.trans('flarum-extension-manager.admin.composer.minimum_stability.options.beta'),\n alpha: app.translator.trans('flarum-extension-manager.admin.composer.minimum_stability.options.alpha'),\n dev: app.translator.trans('flarum-extension-manager.admin.composer.minimum_stability.options.dev')\n }\n }), m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.composer.repositories.label')), m(\"div\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-extension-manager.admin.composer.repositories.help')), m(\"div\", {\n className: \"ConfigureComposer-repositories\"\n }, Object.keys(this.setting('repositories')() || {}).map(name => {\n const repository = this.setting('repositories')()[name];\n return m(\"div\", {\n className: \"ButtonGroup ButtonGroup--full\"\n }, m(Button, {\n className: \"Button\",\n icon: {\n composer: 'fas fa-cubes',\n vcs: 'fas fa-code-branch',\n path: 'fas fa-folder'\n }[repository.type],\n onclick: () => app.modal.show(RepositoryModal, {\n name,\n repository,\n onsubmit: (repository, newName) => {\n const repositories = this.setting('repositories')();\n delete repositories[name];\n this.setting('repositories')(repositories);\n this.onchange(repository, newName);\n }\n })\n }, name, \" (\", repository.type, \")\"), m(Button, {\n className: \"Button Button--icon\",\n icon: \"fas fa-trash\",\n \"aria-label\": app.translator.trans('flarum-extension-manager.admin.composer.delete_repository_label'),\n onclick: () => {\n if (confirm(extractText(app.translator.trans('flarum-extension-manager.admin.composer.delete_repository_confirmation')))) {\n const repositories = {\n ...this.setting('repositories')()\n };\n delete repositories[name];\n this.setting('repositories')(repositories);\n }\n }\n }));\n }))));\n }\n submitButton() {\n const items = super.submitButton();\n items.push(m(Button, {\n className: \"Button\",\n onclick: () => app.modal.show(RepositoryModal, {\n onsubmit: this.onchange.bind(this)\n })\n }, app.translator.trans('flarum-extension-manager.admin.composer.add_repository_label')));\n return items;\n }\n onchange(repository, name) {\n this.setting('repositories')({\n ...this.setting('repositories')(),\n [name]: repository\n });\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/ConfigureComposer', ConfigureComposer);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport Modal from 'flarum/common/components/Modal';\nimport app from 'flarum/admin/app';\nimport Select from 'flarum/common/components/Select';\nimport Stream from 'flarum/common/utils/Stream';\nimport Button from 'flarum/common/components/Button';\nimport extractText from 'flarum/common/utils/extractText';\nimport Form from 'flarum/common/components/Form';\nexport default class AuthMethodModal extends Modal {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"type\", void 0);\n _defineProperty(this, \"host\", void 0);\n _defineProperty(this, \"token\", void 0);\n }\n oninit(vnode) {\n super.oninit(vnode);\n this.type = Stream(this.attrs.type || 'bearer');\n this.host = Stream(this.attrs.host || '');\n this.token = Stream(this.attrs.token || '');\n }\n className() {\n return 'AuthMethodModal Modal--small';\n }\n title() {\n const context = this.attrs.host ? 'edit' : 'add';\n return app.translator.trans(\"flarum-extension-manager.admin.auth_config.\".concat(context, \"_label\"));\n }\n content() {\n const types = {\n 'github-oauth': app.translator.trans('flarum-extension-manager.admin.auth_config.types.github-oauth'),\n 'gitlab-oauth': app.translator.trans('flarum-extension-manager.admin.auth_config.types.gitlab-oauth'),\n 'gitlab-token': app.translator.trans('flarum-extension-manager.admin.auth_config.types.gitlab-token'),\n bearer: app.translator.trans('flarum-extension-manager.admin.auth_config.types.bearer')\n };\n return m(\"div\", {\n className: \"Modal-body\"\n }, m(Form, null, m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.auth_config.add_modal.type_label')), m(Select, {\n options: types,\n value: this.type(),\n onchange: this.type\n })), m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.auth_config.add_modal.host_label')), m(\"input\", {\n className: \"FormControl\",\n bidi: this.host,\n placeholder: app.translator.trans('flarum-extension-manager.admin.auth_config.add_modal.host_placeholder')\n })), m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.auth_config.add_modal.token_label')), m(\"textarea\", {\n className: \"FormControl\",\n oninput: e => this.token(e.target.value),\n rows: \"6\",\n placeholder: this.token().startsWith('unchanged:') ? extractText(app.translator.trans('flarum-extension-manager.admin.auth_config.add_modal.unchanged_token_placeholder')) : ''\n }, this.token().startsWith('unchanged:') ? '' : this.token())), m(\"div\", {\n className: \"Form-group\"\n }, m(Button, {\n className: \"Button Button--primary\",\n onclick: this.submit.bind(this)\n }, app.translator.trans('flarum-extension-manager.admin.auth_config.add_modal.submit_button')))));\n }\n submit() {\n this.attrs.onsubmit(this.type(), this.host(), this.token());\n this.hide();\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/AuthMethodModal', AuthMethodModal);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport ConfigureJson from './ConfigureJson';\nimport Button from 'flarum/common/components/Button';\nimport AuthMethodModal from './AuthMethodModal';\nimport extractText from 'flarum/common/utils/extractText';\nexport default class ConfigureAuth extends ConfigureJson {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"type\", 'auth');\n }\n title() {\n return app.translator.trans('flarum-extension-manager.admin.auth_config.title');\n }\n className() {\n return 'ConfigureAuth';\n }\n content() {\n const authSettings = Object.keys(this.settings);\n const hasAuthSettings = authSettings.length && authSettings.every(type => {\n const data = this.settings[type]();\n return Array.isArray(data) ? data.length : Object.keys(data).length;\n });\n return m(\"div\", {\n className: \"ExtensionManager-SettingsGroups-content\"\n }, hasAuthSettings ? authSettings.map(type => {\n const hosts = this.settings[type]();\n return m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans(\"flarum-extension-manager.admin.auth_config.types.\".concat(type))), m(\"div\", {\n className: \"ConfigureAuth-hosts\"\n }, Object.keys(hosts).map(host => {\n const data = hosts[host];\n return m(\"div\", {\n className: \"ButtonGroup ButtonGroup--full\"\n }, m(Button, {\n className: \"Button\",\n icon: \"fas fa-key\",\n onclick: () => app.modal.show(AuthMethodModal, {\n type,\n host,\n token: data,\n onsubmit: this.onchange.bind(this, host)\n })\n }, host), m(Button, {\n className: \"Button Button--icon\",\n icon: \"fas fa-trash\",\n \"aria-label\": app.translator.trans('flarum-extension-manager.admin.auth_config.delete_label'),\n onclick: () => {\n if (confirm(extractText(app.translator.trans('flarum-extension-manager.admin.auth_config.delete_confirmation')))) {\n const newType = {\n ...this.setting(type)()\n };\n delete newType[host];\n if (Object.keys(newType).length) {\n this.setting(type)(newType);\n } else {\n delete this.settings[type];\n }\n }\n }\n }));\n })));\n }) : m(\"span\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-extension-manager.admin.auth_config.no_auth_methods_configured')));\n }\n submitButton() {\n const items = super.submitButton();\n items.push(m(Button, {\n className: \"Button\",\n loading: this.loading,\n onclick: () => app.modal.show(AuthMethodModal, {\n onsubmit: this.onchange.bind(this, null)\n })\n }, app.translator.trans('flarum-extension-manager.admin.auth_config.add_label')));\n return items;\n }\n onchange(oldHost, type, host, token) {\n const data = {\n ...this.setting(type)()\n };\n if (oldHost) {\n delete data[oldHost];\n }\n data[host] = token;\n this.setting(type)(data);\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/ConfigureAuth', ConfigureAuth);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Input');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/helpers/listItems');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/throttleDebounce');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport Form from 'flarum/common/components/Form';\nimport Button from 'flarum/common/components/Button';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Input from 'flarum/common/components/Input';\nimport Stream from 'flarum/common/utils/Stream';\nimport Alert from 'flarum/common/components/Alert';\nimport listItems from 'flarum/common/helpers/listItems';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport Dropdown from 'flarum/common/components/Dropdown';\nimport ExtensionCard from './ExtensionCard';\nimport Pagination from 'flarum/common/components/Pagination';\nimport InfoTile from 'flarum/common/components/InfoTile';\nimport classList from 'flarum/common/utils/classList';\nimport { throttle } from 'flarum/common/utils/throttleDebounce';\nexport default class DiscoverSection extends Component {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"search\", Stream(''));\n _defineProperty(this, \"warningsDismissed\", Stream(false));\n _defineProperty(this, \"applySearch\", throttle(1200, value => {\n const params = app.extensionManager.extensions.getParams();\n app.extensionManager.extensions.refreshParams({\n ...params,\n filter: {\n ...params.filter,\n q: value\n }\n }, 1);\n }));\n }\n oninit(vnode) {\n super.oninit(vnode);\n app.extensionManager.extensions.goto(1);\n this.warningsDismissed(localStorage.getItem('flarum-extension-manager.warningsDismissed') === 'true');\n }\n load(page) {\n if (page === void 0) {\n page = 1;\n }\n app.extensionManager.extensions.goto(page);\n }\n view() {\n return m(\"div\", {\n className: \"ExtensionPage-settings ExtensionManager-DiscoverSection\"\n }, m(\"div\", {\n className: \"container\"\n }, m(Form, null, m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.sections.discover.title')), m(\"div\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-extension-manager.admin.sections.discover.description'), this.warningsDismissed() && m(Button, {\n className: \"Button Button--text Button--warning Button--more\",\n icon: \"fas fa-exclamation-triangle\",\n onclick: () => this.setWarningDismissed(false)\n }))), !this.warningsDismissed() && m(\"div\", {\n className: \"ExtensionManager-warnings Form-group\"\n }, m(Alert, {\n className: \"ExtensionManager-primaryWarning\",\n type: \"warning\",\n dismissible: true,\n ondismiss: () => this.setWarningDismissed(true)\n }, m(\"ul\", null, listItems(this.warningItems().toArray())))), m(\"div\", {\n className: \"Tabs\"\n }, m(\"div\", {\n className: \"Tabs-nav\"\n }, this.tabItems().toArray()), m(\"div\", {\n className: \"Tabs-content\"\n }, m(\"hr\", {\n className: \"Tabs-divider\"\n }), m(\"div\", {\n className: \"ExtensionManager-DiscoverSection-toolbar\"\n }, m(\"div\", {\n className: \"ExtensionManager-DiscoverSection-toolbar-primary\"\n }, this.toolbarPrimaryItems().toArray()), m(\"div\", {\n className: \"ExtensionManager-DiscoverSection-toolbar-secondary\"\n }, this.toolbarSecondaryItems().toArray())), this.extensionList(), m(\"div\", {\n className: \"ExtensionManager-DiscoverSection-footer\"\n }, this.footerItems().toArray()))))));\n }\n tabFilters() {\n return {\n '': {\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.tabs.discover'),\n active: () => {\n var _app$extensionManager;\n return !((_app$extensionManager = app.extensionManager.extensions.getParams().filter) != null && _app$extensionManager.type);\n }\n },\n extension: {\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.tabs.extensions'),\n active: () => {\n var _app$extensionManager2;\n return ((_app$extensionManager2 = app.extensionManager.extensions.getParams().filter) == null ? void 0 : _app$extensionManager2.type) === 'extension';\n }\n },\n locale: {\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.tabs.languages'),\n active: () => {\n var _app$extensionManager3;\n return ((_app$extensionManager3 = app.extensionManager.extensions.getParams().filter) == null ? void 0 : _app$extensionManager3.type) === 'locale';\n }\n },\n theme: {\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.tabs.themes'),\n active: () => {\n var _app$extensionManager4;\n return ((_app$extensionManager4 = app.extensionManager.extensions.getParams().filter) == null ? void 0 : _app$extensionManager4.type) === 'theme';\n }\n }\n };\n }\n tabItems() {\n const items = new ItemList();\n const tabs = this.tabFilters();\n Object.keys(tabs).forEach(key => {\n const tab = tabs[key];\n items.add(key, m(Button, {\n className: \"Button Button--link\",\n active: tab.active(),\n onclick: () => {\n app.extensionManager.extensions.changeFilter('type', key);\n }\n }, tab.label));\n });\n return items;\n }\n warningItems() {\n const items = new ItemList();\n items.add('accessWarning', app.translator.trans('flarum-extension-manager.admin.settings.access_warning'));\n if (app.data.debugEnabled) {\n items.add('devModeWarning', app.translator.trans('flarum-extension-manager.admin.settings.debug_mode_warning'));\n }\n return items;\n }\n toolbarPrimaryItems() {\n const items = new ItemList();\n items.add('search', m(Input, {\n value: this.search(),\n onchange: value => {\n this.search(value);\n this.applySearch(value);\n },\n inputAttrs: {\n className: 'FormControl-alt'\n },\n clearable: true,\n placeholder: app.translator.trans('flarum-extension-manager.admin.sections.discover.search'),\n prefixIcon: \"fas fa-search\"\n }));\n return items;\n }\n toolbarSecondaryItems() {\n var _app$extensionManager5, _app$extensionManager6;\n const items = new ItemList();\n const sortMap = app.extensionManager.extensions.sortMap();\n const sortOptions = Object.keys(sortMap).reduce((acc, sortId) => {\n const sort = sortMap[sortId];\n acc[sortId] = typeof sort !== 'string' ? sort.label : sort;\n return acc;\n }, {});\n items.add('sort', m(Dropdown, {\n buttonClassName: \"Button\",\n label: sortOptions[app.extensionManager.extensions.getParams().sort] || Object.keys(sortMap).map(key => sortOptions[key])[0],\n accessibleToggleLabel: app.translator.trans('flarum-extension-manager.admin.sections.discover.sort.toggle_dropdown_accessible_label')\n }, Object.keys(sortOptions).map(value => {\n const label = sortOptions[value];\n const active = app.extensionManager.extensions.getParams().sort === value;\n return m(Button, {\n icon: active ? 'fas fa-check' : true,\n onclick: () => app.extensionManager.extensions.changeSort(value),\n active: active\n }, label);\n })));\n const is = (_app$extensionManager5 = (_app$extensionManager6 = app.extensionManager.extensions.getParams().filter) == null || (_app$extensionManager6 = _app$extensionManager6.is) == null ? void 0 : _app$extensionManager6[0]) != null ? _app$extensionManager5 : null;\n const activeType = is || 'all';\n items.add('party', m(Dropdown, {\n buttonClassName: \"Button\",\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.party_filter.' + activeType),\n accessibleToggleLabel: app.translator.trans('flarum-extension-manager.admin.sections.discover.party_filter.toggle_dropdown_accessible_label')\n }, ['all', 'premium'].map(party => m(Button, {\n icon: activeType === party ? 'fas fa-check' : true,\n onclick: () => {\n app.extensionManager.extensions.changeFilter('is', party === 'all' ? undefined : [party]);\n },\n active: activeType === party\n }, app.translator.trans('flarum-extension-manager.admin.sections.discover.party_filter.' + party)))));\n return items;\n }\n extensionList() {\n if (!app.extensionManager.extensions.hasItems() && app.extensionManager.extensions.isLoading()) {\n return m(LoadingIndicator, {\n display: \"block\"\n });\n }\n if (!app.extensionManager.extensions.hasItems()) {\n return m(\"div\", {\n className: \"ExtensionManager-DiscoverSection-list ExtensionManager-DiscoverSection-list--empty\"\n }, m(InfoTile, {\n icon: \"fas fa-plug-circle-exclamation\"\n }, app.translator.trans('flarum-extension-manager.admin.sections.discover.empty_results')));\n }\n return m(\"div\", {\n className: classList('ExtensionManager-DiscoverSection-list', {\n 'loading-container': app.extensionManager.extensions.isLoading()\n })\n }, m(\"div\", {\n className: \"ExtensionManager-DiscoverSection-list-inner\"\n }, app.extensionManager.extensions.getPages().map(page => page.items.map(extension => m(ExtensionCard, {\n extension: extension,\n key: extension.name()\n })))), app.extensionManager.extensions.hasItems() && app.extensionManager.extensions.isLoading() && m(LoadingIndicator, {\n size: \"large\"\n }));\n }\n footerItems() {\n const items = new ItemList();\n items.add('pagination', m(Pagination, {\n total: app.extensionManager.extensions.totalItems,\n perPage: app.extensionManager.extensions.pageSize,\n currentPage: app.extensionManager.extensions.getLocation().page,\n onChange: page => {\n const current = app.extensionManager.extensions.getLocation().page;\n if (current === page) {\n return;\n }\n this.load(page);\n }\n }));\n items.add('premiumTermsLink', m(LinkButton, {\n className: \"Button Button--link\",\n href: \"https://flarum.org/terms/premium-extensions\",\n external: true,\n target: \"_blank\",\n icon: \"fas fa-circle-info\"\n }, app.translator.trans('flarum-extension-manager.admin.sections.discover.premium_extension_terms')));\n return items;\n }\n setWarningDismissed(dismissed) {\n this.warningsDismissed(dismissed);\n localStorage.setItem('flarum-extension-manager.warningsDismissed', dismissed ? 'true' : 'false');\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/DiscoverSection', DiscoverSection);","import app from 'flarum/admin/app';\nimport ExtensionPage from 'flarum/admin/components/ExtensionPage';\nimport QueueSection from './QueueSection';\nimport ControlSection from './ControlSection';\nimport ConfigureComposer from './ConfigureComposer';\nimport ConfigureAuth from './ConfigureAuth';\nimport DiscoverSection from './DiscoverSection';\nexport default class SettingsPage extends ExtensionPage {\n content() {\n const settings = app.registry.getSettings(this.extension.id);\n return m(\"div\", {\n className: \"ExtensionPage-settings\"\n }, m(\"div\", {\n className: \"container\"\n }, settings ? [m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.sections.settings.title')), m(\"div\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-extension-manager.admin.sections.settings.description'))), m(\"div\", {\n className: \"FormSectionGroup ExtensionManager-SettingsGroups\"\n }, m(\"div\", {\n className: \"FormSection\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.settings.title')), m(\"div\", {\n className: \"Form\"\n }, settings.map(this.buildSettingComponent.bind(this))), m(\"div\", {\n className: \"Form-group Form--controls\"\n }, this.submitButton())), m(ConfigureComposer, {\n buildSettingComponent: this.buildSettingComponent\n }), m(ConfigureAuth, {\n buildSettingComponent: this.buildSettingComponent\n }))] : m(\"h3\", {\n className: \"ExtensionPage-subHeader\"\n }, app.translator.trans('core.admin.extension.no_settings'))));\n }\n sections(vnode) {\n const items = super.sections(vnode);\n items.add('discover', m(DiscoverSection, null), 15);\n items.add('control', m(ControlSection, null), 10);\n items.setPriority('content', 8);\n if (app.data.settings['flarum-extension-manager.queue_jobs'] !== '0' && app.data.settings['flarum-extension-manager.queue_jobs']) {\n items.add('queue', m(QueueSection, null), 5);\n }\n items.remove('permissions');\n return items;\n }\n onsaved() {\n super.onsaved();\n m.redraw();\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/SettingsPage', SettingsPage);","const BYTE_UNITS = [\n\t'B',\n\t'kB',\n\t'MB',\n\t'GB',\n\t'TB',\n\t'PB',\n\t'EB',\n\t'ZB',\n\t'YB',\n];\n\nconst BIBYTE_UNITS = [\n\t'B',\n\t'KiB',\n\t'MiB',\n\t'GiB',\n\t'TiB',\n\t'PiB',\n\t'EiB',\n\t'ZiB',\n\t'YiB',\n];\n\nconst BIT_UNITS = [\n\t'b',\n\t'kbit',\n\t'Mbit',\n\t'Gbit',\n\t'Tbit',\n\t'Pbit',\n\t'Ebit',\n\t'Zbit',\n\t'Ybit',\n];\n\nconst BIBIT_UNITS = [\n\t'b',\n\t'kibit',\n\t'Mibit',\n\t'Gibit',\n\t'Tibit',\n\t'Pibit',\n\t'Eibit',\n\t'Zibit',\n\t'Yibit',\n];\n\n/*\nFormats the given number using `Number#toLocaleString`.\n- If locale is a string, the value is expected to be a locale-key (for example: `de`).\n- If locale is true, the system default locale is used for translation.\n- If no value for locale is specified, the number is returned unmodified.\n*/\nconst toLocaleString = (number, locale, options) => {\n\tlet result = number;\n\tif (typeof locale === 'string' || Array.isArray(locale)) {\n\t\tresult = number.toLocaleString(locale, options);\n\t} else if (locale === true || options !== undefined) {\n\t\tresult = number.toLocaleString(undefined, options);\n\t}\n\n\treturn result;\n};\n\nexport default function prettyBytes(number, options) {\n\tif (!Number.isFinite(number)) {\n\t\tthrow new TypeError(`Expected a finite number, got ${typeof number}: ${number}`);\n\t}\n\n\toptions = {\n\t\tbits: false,\n\t\tbinary: false,\n\t\tspace: true,\n\t\t...options,\n\t};\n\n\tconst UNITS = options.bits\n\t\t? (options.binary ? BIBIT_UNITS : BIT_UNITS)\n\t\t: (options.binary ? BIBYTE_UNITS : BYTE_UNITS);\n\n\tconst separator = options.space ? ' ' : '';\n\n\tif (options.signed && number === 0) {\n\t\treturn ` 0${separator}${UNITS[0]}`;\n\t}\n\n\tconst isNegative = number < 0;\n\tconst prefix = isNegative ? '-' : (options.signed ? '+' : '');\n\n\tif (isNegative) {\n\t\tnumber = -number;\n\t}\n\n\tlet localeOptions;\n\n\tif (options.minimumFractionDigits !== undefined) {\n\t\tlocaleOptions = {minimumFractionDigits: options.minimumFractionDigits};\n\t}\n\n\tif (options.maximumFractionDigits !== undefined) {\n\t\tlocaleOptions = {maximumFractionDigits: options.maximumFractionDigits, ...localeOptions};\n\t}\n\n\tif (number < 1) {\n\t\tconst numberString = toLocaleString(number, options.locale, localeOptions);\n\t\treturn prefix + numberString + separator + UNITS[0];\n\t}\n\n\tconst exponent = Math.min(Math.floor(options.binary ? Math.log(number) / Math.log(1024) : Math.log10(number) / 3), UNITS.length - 1);\n\tnumber /= (options.binary ? 1024 : 1000) ** exponent;\n\n\tif (!localeOptions) {\n\t\tnumber = number.toPrecision(3);\n\t}\n\n\tconst numberString = toLocaleString(Number(number), options.locale, localeOptions);\n\n\tconst unit = UNITS[exponent];\n\n\treturn prefix + numberString + separator + unit;\n}\n","import Model from 'flarum/common/Model';\nimport prettyBytes from 'pretty-bytes';\nexport default class Task extends Model {\n status() {\n return Model.attribute('status').call(this);\n }\n operation() {\n return Model.attribute('operation').call(this);\n }\n command() {\n return Model.attribute('command').call(this);\n }\n package() {\n return Model.attribute('package').call(this);\n }\n output() {\n return Model.attribute('output').call(this);\n }\n guessedCause() {\n return Model.attribute('guessedCause').call(this);\n }\n createdAt() {\n return Model.attribute('createdAt', Model.transformDate).call(this);\n }\n startedAt() {\n return Model.attribute('startedAt', Model.transformDate).call(this);\n }\n finishedAt() {\n return Model.attribute('finishedAt', Model.transformDate).call(this);\n }\n peakMemoryUsed() {\n return prettyBytes(Model.attribute('peakMemoryUsed').call(this) * 1024);\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/models/Task', Task);","import Extend from 'flarum/common/extenders';\nimport app from 'flarum/admin/app';\nimport extractText from 'flarum/common/utils/extractText';\nimport SettingsPage from './components/SettingsPage';\nimport Task from './models/Task';\nimport ExternalExtension from './models/ExternalExtension';\nexport default [new Extend.Store() //\n.add('extension-manager-tasks', Task).add('external-extensions', ExternalExtension), new Extend.Admin().setting(() => ({\n setting: 'flarum-extension-manager.queue_jobs',\n label: app.translator.trans('flarum-extension-manager.admin.settings.queue_jobs'),\n help: m.trust(extractText(app.translator.trans('flarum-extension-manager.admin.settings.queue_jobs_help', {\n basic_impl_link: 'https://discuss.flarum.org/d/28151-database-queue-the-simplest-queue-even-for-shared-hosting',\n adv_impl_link: 'https://discuss.flarum.org/d/21873-redis-sessions-cache-queues',\n php_version: \"\".concat(app.data.phpVersion, \"\"),\n folder_perms_link: 'https://docs.flarum.org/install#folder-ownership'\n }))),\n type: 'boolean',\n disabled: app.data['flarum-extension-manager.using_sync_queue']\n})).setting(() => ({\n setting: 'flarum-extension-manager.task_retention_days',\n label: app.translator.trans('flarum-extension-manager.admin.settings.task_retention_days'),\n help: app.translator.trans('flarum-extension-manager.admin.settings.task_retention_days_help'),\n type: 'number'\n})).page(SettingsPage).generalIndexItems('settings', () => [{\n id: 'minimum-stability',\n label: app.translator.trans('flarum-extension-manager.admin.composer.minimum_stability.label', {}, true),\n help: app.translator.trans('flarum-extension-manager.admin.composer.minimum_stability.help', {}, true)\n}, {\n id: 'repositories',\n label: app.translator.trans('flarum-extension-manager.admin.composer.repositories.label', {}, true),\n help: app.translator.trans('flarum-extension-manager.admin.composer.repositories.help', {}, true)\n}, {\n id: 'composer-auth',\n label: app.translator.trans('flarum-extension-manager.admin.auth_config.title', {}, true)\n}, {\n id: 'updates',\n label: app.translator.trans('flarum-extension-manager.admin.updater.updater_title', {}, true),\n help: app.translator.trans('flarum-extension-manager.admin.updater.updater_help', {}, true)\n}])];","import { extend } from 'flarum/common/extend';\nimport app from 'flarum/admin/app';\nimport ExtensionPage from 'flarum/admin/components/ExtensionPage';\nimport Button from 'flarum/common/components/Button';\nimport LoadingModal from 'flarum/admin/components/LoadingModal';\nimport isExtensionEnabled from 'flarum/admin/utils/isExtensionEnabled';\nimport jumpToQueue from './utils/jumpToQueue';\nimport ExtensionManagerState from './states/ExtensionManagerState';\nexport { default as extend } from './extend';\napp.initializers.add('flarum-extension-manager', app => {\n app.extensionManager = new ExtensionManagerState();\n if (app.data['flarum-extension-manager.using_sync_queue']) {\n app.data.settings['flarum-extension-manager.queue_jobs'] = '0';\n }\n extend(ExtensionPage.prototype, 'topItems', function (items) {\n if (this.extension.id === 'flarum-extension-manager' || isExtensionEnabled(this.extension.id)) {\n return;\n }\n items.add('remove', m(Button, {\n className: \"Button Button--danger\",\n icon: \"fas fa-times\",\n onclick: () => {\n app.modal.show(LoadingModal);\n app.request({\n url: \"\".concat(app.forum.attribute('apiUrl'), \"/extension-manager/extensions/\").concat(this.extension.id),\n method: 'DELETE'\n }).then(response => {\n if (response != null && response.processing) {\n jumpToQueue();\n } else {\n app.alerts.show({\n type: 'success'\n }, app.translator.trans('flarum-extension-manager.admin.extensions.successful_remove'));\n window.location = app.forum.attribute('adminUrl');\n }\n }).finally(() => {\n app.modal.close();\n });\n }\n }, app.translator.trans('flarum-extension-manager.admin.extensions.remove')));\n });\n});"],"names":["module","exports","t","s","n","i","e","r","o","u","d","a","h","years","months","days","hours","minutes","seconds","milliseconds","weeks","c","g","f","$l","m","p","l","$","Math","ceil","floor","y","abs","v","negative","format","this","$d","$ms","parseFromMilliseconds","Object","keys","forEach","calMilliseconds","match","slice","map","Number","prototype","reduce","toISOString","round","toJSON","Y","YY","YYYY","M","MM","D","DD","H","HH","mm","ss","SSS","replace","String","as","get","add","subtract","locale","clone","humanize","fromNow","valueOf","asMilliseconds","asSeconds","asMinutes","asHours","asDays","asWeeks","asMonths","asYears","$utils","duration","isDuration","bind","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","call","getter","__esModule","definition","key","defineProperty","enumerable","obj","prop","hasOwnProperty","Symbol","toStringTag","value","flarum","reg","jumpToQueue","close","route","set","id","queue","load","setTimeout","_document$getElementB","document","getElementById","scrollIntoView","block","_typeof","iterator","constructor","_defineProperty","toPrimitive","TypeError","configurable","writable","window","QueueState","params","actionTaken","_params","loading","page","limit","offset","find","then","data","_data$payload$meta","tasks","total","payload","meta","redraw","task","status","pollQueue","control","setLoading","location","reload","isLoading","getItems","getTotalItems","getTotalPages","pageNumber","getPerPage","hasPrev","hasNext","prev","next","goto","polling","clearTimeout","hasPending","_this$tasks","error","response","errors","includes","code","clear","guessed_cause","show","type","trans","concat","ControlSectionState","lastUpdateRun","JSON","parse","settings","limitedPackages","major","minor","global","lastUpdateCheck","extensionUpdates","formatExtensionUpdates","coreUpdate","formatCoreUpdate","name","hasOperationRunning","requirePackage","method","url","attribute","body","processing","extensionId","extension","href","catch","errorHandler","finally","checkForUpdates","updateCoreMinor","confirm","updateExtension","updateMode","extra","title","updateGlobally","_lastUpdateCheck$upda","packageUpdates","updates","installed","filter","composerPackage","extensions","safeToUpdate","values","_lastUpdateCheck$upda2","core","pop","package","version","icon","backgroundImage","resources","links","majorUpdate","_ref","dryRun","updateState","_e$response","incompatibleExtensions","incompatible_extensions","ExtensionListState","super","sort","sortMap","label","ExtensionManagerState","Label","view","vnode","className","attrs","assign","children","TaskOutputModal","operation","content","guessedCause","command","output","humanDuration","start","end","dayjs","extend","durationTime","diff","QueueSection","oninit","onclick","disabled","queueTable","columns","items","operationIcon","_task$package","style","running","failure","pending","success","size","display","startedAt","finishedAt","text","peakMemoryUsed","length","toArray","item","index","currentPage","perPage","onChange","update_check","update_major","update_minor","update_global","extension_install","extension_remove","extension_update","why_not","Installer","arguments","packageName","htmlFor","link","semantic_link","placeholder","bidi","onsubmit","WhyNotModal","oncreate","requestWhyNot","whyNot","reason","ExternalExtension","isSupported","currentVersion","latestCompatibleVersion","latestFlarumVersionSupported","split","isStable","highestVersion","toLocalExtension","description","backgroundColor","color","discuss","discussUri","website","httpUri","ExtensionCard","getExtension","isCore","isDanger","badges","actionItems","metaItems","_extension$icon","_extension$icon2","iconUrl","isPremium","_updates$latestMinor","latestVersion","count","downloads","formattedCount","target","external","onClickUpdate","whyNotWarning","buttonClassName","soft","hard","charAt","substring","MajorUpdater","alt","src","update","dismissible","controls","Updater","lastUpdateCheckView","controlItems","availableUpdatesView","_app$extensionManager","checkedAt","state","hasMinorCoreUpdate","ControlSection","ConfigureJson","submit","submitButton","isDirty","customSettingComponents","customFieldComponents","setting","_this$settings$key","readOnly","configuration","initialSettings","Array","isArray","stringify","RepositoryModal","repository","context","types","composer","vcs","path","options","onchange","hide","ConfigureComposer","buildSettingComponent","help","stable","RC","beta","alpha","dev","newName","repositories","push","AuthMethodModal","host","token","bearer","oninput","rows","startsWith","ConfigureAuth","authSettings","hasAuthSettings","every","hosts","newType","oldHost","DiscoverSection","throttle","getParams","refreshParams","q","warningsDismissed","localStorage","getItem","setWarningDismissed","ondismiss","warningItems","tabItems","toolbarPrimaryItems","toolbarSecondaryItems","extensionList","footerItems","tabFilters","active","_app$extensionManager2","_app$extensionManager3","theme","_app$extensionManager4","tabs","tab","changeFilter","debugEnabled","search","applySearch","inputAttrs","clearable","prefixIcon","_app$extensionManager5","_app$extensionManager6","sortOptions","acc","sortId","accessibleToggleLabel","changeSort","activeType","is","party","hasItems","getPages","totalItems","pageSize","getLocation","dismissed","setItem","SettingsPage","getSettings","sections","setPriority","remove","onsaved","BYTE_UNITS","BIBYTE_UNITS","BIT_UNITS","BIBIT_UNITS","toLocaleString","number","result","Task","createdAt","isFinite","UNITS","bits","binary","space","separator","signed","isNegative","prefix","localeOptions","minimumFractionDigits","maximumFractionDigits","exponent","min","log","log10","toPrecision","prettyBytes","trust","basic_impl_link","adv_impl_link","php_version","phpVersion","folder_perms_link","generalIndexItems","app","extensionManager","modal","request","forum","alerts","translator"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"admin.js","mappings":"6BAAoEA,EAAOC,QAAmJ,WAAW,aAAa,IAAIC,EAAEC,EAAEC,EAAE,IAAIC,EAAE,IAAIC,EAAE,KAAKC,EAAE,MAAMC,EAAE,sFAAsFC,EAAE,QAAQC,EAAE,OAAOC,EAAE,sKAAsKC,EAAE,CAACC,MAAMJ,EAAEK,OAAOJ,EAAEK,KAAKR,EAAES,MAAMV,EAAEW,QAAQZ,EAAEa,QAAQd,EAAEe,aAAa,EAAEC,MAAM,QAAQC,EAAE,SAASnB,GAAG,OAAOA,aAAaoB,CAAC,EAAEC,EAAE,SAASrB,EAAEC,EAAEC,GAAG,OAAO,IAAIkB,EAAEpB,EAAEE,EAAED,EAAEqB,GAAG,EAAEC,EAAE,SAASvB,GAAG,OAAOC,EAAEuB,EAAExB,GAAG,GAAG,EAAEyB,EAAE,SAASzB,GAAG,OAAOA,EAAE,CAAC,EAAE0B,EAAE,SAAS1B,GAAG,OAAOyB,EAAEzB,GAAG2B,KAAKC,KAAK5B,GAAG2B,KAAKE,MAAM7B,EAAE,EAAE8B,EAAE,SAAS9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AI,SAAU7C,EAAE,IAAQ,CAC5BmO,UAAW,wBACXpB,KAAM,eACNuC,QAAS,KACPuP,EAAIE,MAAMtV,KAAK,KACfoV,EAAIG,QAAQ,CACVjU,IAAK,GAAGnB,OAAOiV,EAAII,MAAMjU,UAAU,UAAW,kCAAkCpB,OAAOhJ,KAAKwK,UAAU3F,IACtGqF,OAAQ,WACP1D,MAAK+B,IACU,MAAZA,GAAoBA,EAAS+B,WAC/B7F,KAEAwZ,EAAIK,OAAOzV,KAAK,CACdC,KAAM,WACLmV,EAAIM,WAAWxV,MAAM,gEACxBjD,OAAOuB,SAAW4W,EAAII,MAAMjU,UAAU,YACxC,IACCQ,SAAQ,KACTqT,EAAIE,MAAMzZ,OAAO,GACjB,GAEHuZ,EAAIM,WAAWxV,MAAM,qDAC1B,GAAE,G","sources":["webpack://@flarum/extension-manager/../../../node_modules/dayjs/plugin/duration.js","webpack://@flarum/extension-manager/webpack/bootstrap","webpack://@flarum/extension-manager/webpack/runtime/compat get default export","webpack://@flarum/extension-manager/webpack/runtime/define property getters","webpack://@flarum/extension-manager/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/extension-manager/webpack/runtime/make namespace object","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/extend')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'admin/app')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'admin/components/ExtensionPage')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/Button')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'admin/components/LoadingModal')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'admin/utils/isExtensionEnabled')\"","webpack://@flarum/extension-manager/./src/admin/utils/jumpToQueue.ts","webpack://@flarum/extension-manager/../../../node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://@flarum/extension-manager/../../../node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://@flarum/extension-manager/../../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","webpack://@flarum/extension-manager/../../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js","webpack://@flarum/extension-manager/./src/admin/states/QueueState.ts","webpack://@flarum/extension-manager/./src/admin/utils/errorHandler.ts","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/utils/extractText')\"","webpack://@flarum/extension-manager/./src/admin/states/ControlSectionState.ts","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/states/PaginatedListState')\"","webpack://@flarum/extension-manager/./src/admin/states/ExtensionListState.ts","webpack://@flarum/extension-manager/./src/admin/states/ExtensionManagerState.ts","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/extenders')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/Component')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/LoadingIndicator')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/Tooltip')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/Icon')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/utils/ItemList')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/Link')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/Pagination')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/utils/classList')\"","webpack://@flarum/extension-manager/./src/admin/components/Label.tsx","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/Modal')\"","webpack://@flarum/extension-manager/./src/admin/components/TaskOutputModal.tsx","webpack://@flarum/extension-manager/./src/admin/utils/humanDuration.ts","webpack://@flarum/extension-manager/./src/admin/components/QueueSection.tsx","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/Alert')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/utils/Stream')\"","webpack://@flarum/extension-manager/./src/admin/components/Installer.tsx","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/helpers/humanTime')\"","webpack://@flarum/extension-manager/./src/admin/components/WhyNotModal.tsx","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/Badge')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/utils/formatAmount')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/Model')\"","webpack://@flarum/extension-manager/./src/admin/utils/versions.ts","webpack://@flarum/extension-manager/./src/admin/models/ExternalExtension.ts","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/Dropdown')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/LinkButton')\"","webpack://@flarum/extension-manager/./src/admin/components/ExtensionCard.tsx","webpack://@flarum/extension-manager/./src/admin/components/MajorUpdater.tsx","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/InfoTile')\"","webpack://@flarum/extension-manager/./src/admin/components/Updater.tsx","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/Form')\"","webpack://@flarum/extension-manager/./src/admin/components/ControlSection.tsx","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/FormGroup')\"","webpack://@flarum/extension-manager/./src/admin/components/ConfigureJson.tsx","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/Select')\"","webpack://@flarum/extension-manager/./src/admin/components/RepositoryModal.tsx","webpack://@flarum/extension-manager/./src/admin/components/ConfigureComposer.tsx","webpack://@flarum/extension-manager/./src/admin/components/AuthMethodModal.tsx","webpack://@flarum/extension-manager/./src/admin/components/ConfigureAuth.tsx","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/components/Input')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/helpers/listItems')\"","webpack://@flarum/extension-manager/external root \"flarum.reg.get('core', 'common/utils/throttleDebounce')\"","webpack://@flarum/extension-manager/./src/admin/components/DiscoverSection.tsx","webpack://@flarum/extension-manager/./src/admin/components/SettingsPage.tsx","webpack://@flarum/extension-manager/../../../node_modules/pretty-bytes/index.js","webpack://@flarum/extension-manager/./src/admin/models/Task.ts","webpack://@flarum/extension-manager/./src/admin/extend.tsx","webpack://@flarum/extension-manager/./src/admin/index.tsx"],"sourcesContent":["!function(t,s){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=s():\"function\"==typeof define&&define.amd?define(s):(t=\"undefined\"!=typeof globalThis?globalThis:t||self).dayjs_plugin_duration=s()}(this,(function(){\"use strict\";var t,s,n=1e3,i=6e4,e=36e5,r=864e5,o=/\\[([^\\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,u=31536e6,d=2628e6,a=/^(-|\\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,h={years:u,months:d,days:r,hours:e,minutes:i,seconds:n,milliseconds:1,weeks:6048e5},c=function(t){return t instanceof g},f=function(t,s,n){return new g(t,n,s.$l)},m=function(t){return s.p(t)+\"s\"},l=function(t){return t<0},$=function(t){return l(t)?Math.ceil(t):Math.floor(t)},y=function(t){return Math.abs(t)},v=function(t,s){return t?l(t)?{negative:!0,format:\"\"+y(t)+s}:{negative:!1,format:\"\"+t+s}:{negative:!1,format:\"\"}},g=function(){function l(t,s,n){var i=this;if(this.$d={},this.$l=n,void 0===t&&(this.$ms=0,this.parseFromMilliseconds()),s)return f(t*h[m(s)],this);if(\"number\"==typeof t)return this.$ms=t,this.parseFromMilliseconds(),this;if(\"object\"==typeof t)return Object.keys(t).forEach((function(s){i.$d[m(s)]=t[s]})),this.calMilliseconds(),this;if(\"string\"==typeof t){var e=t.match(a);if(e){var r=e.slice(2).map((function(t){return null!=t?Number(t):0}));return this.$d.years=r[0],this.$d.months=r[1],this.$d.weeks=r[2],this.$d.days=r[3],this.$d.hours=r[4],this.$d.minutes=r[5],this.$d.seconds=r[6],this.calMilliseconds(),this}}return this}var y=l.prototype;return y.calMilliseconds=function(){var t=this;this.$ms=Object.keys(this.$d).reduce((function(s,n){return s+(t.$d[n]||0)*h[n]}),0)},y.parseFromMilliseconds=function(){var t=this.$ms;this.$d.years=$(t/u),t%=u,this.$d.months=$(t/d),t%=d,this.$d.days=$(t/r),t%=r,this.$d.hours=$(t/e),t%=e,this.$d.minutes=$(t/i),t%=i,this.$d.seconds=$(t/n),t%=n,this.$d.milliseconds=t},y.toISOString=function(){var t=v(this.$d.years,\"Y\"),s=v(this.$d.months,\"M\"),n=+this.$d.days||0;this.$d.weeks&&(n+=7*this.$d.weeks);var i=v(n,\"D\"),e=v(this.$d.hours,\"H\"),r=v(this.$d.minutes,\"M\"),o=this.$d.seconds||0;this.$d.milliseconds&&(o+=this.$d.milliseconds/1e3,o=Math.round(1e3*o)/1e3);var u=v(o,\"S\"),d=t.negative||s.negative||i.negative||e.negative||r.negative||u.negative,a=e.format||r.format||u.format?\"T\":\"\",h=(d?\"-\":\"\")+\"P\"+t.format+s.format+i.format+a+e.format+r.format+u.format;return\"P\"===h||\"-P\"===h?\"P0D\":h},y.toJSON=function(){return this.toISOString()},y.format=function(t){var n=t||\"YYYY-MM-DDTHH:mm:ss\",i={Y:this.$d.years,YY:s.s(this.$d.years,2,\"0\"),YYYY:s.s(this.$d.years,4,\"0\"),M:this.$d.months,MM:s.s(this.$d.months,2,\"0\"),D:this.$d.days,DD:s.s(this.$d.days,2,\"0\"),H:this.$d.hours,HH:s.s(this.$d.hours,2,\"0\"),m:this.$d.minutes,mm:s.s(this.$d.minutes,2,\"0\"),s:this.$d.seconds,ss:s.s(this.$d.seconds,2,\"0\"),SSS:s.s(this.$d.milliseconds,3,\"0\")};return n.replace(o,(function(t,s){return s||String(i[t])}))},y.as=function(t){return this.$ms/h[m(t)]},y.get=function(t){var s=this.$ms,n=m(t);return\"milliseconds\"===n?s%=1e3:s=\"weeks\"===n?$(s/h[n]):this.$d[n],s||0},y.add=function(t,s,n){var i;return i=s?t*h[m(s)]:c(t)?t.$ms:f(t,this).$ms,f(this.$ms+i*(n?-1:1),this)},y.subtract=function(t,s){return this.add(t,s,!0)},y.locale=function(t){var s=this.clone();return s.$l=t,s},y.clone=function(){return f(this.$ms,this)},y.humanize=function(s){return t().add(this.$ms,\"ms\").locale(this.$l).fromNow(!s)},y.valueOf=function(){return this.asMilliseconds()},y.milliseconds=function(){return this.get(\"milliseconds\")},y.asMilliseconds=function(){return this.as(\"milliseconds\")},y.seconds=function(){return this.get(\"seconds\")},y.asSeconds=function(){return this.as(\"seconds\")},y.minutes=function(){return this.get(\"minutes\")},y.asMinutes=function(){return this.as(\"minutes\")},y.hours=function(){return this.get(\"hours\")},y.asHours=function(){return this.as(\"hours\")},y.days=function(){return this.get(\"days\")},y.asDays=function(){return this.as(\"days\")},y.weeks=function(){return this.get(\"weeks\")},y.asWeeks=function(){return this.as(\"weeks\")},y.months=function(){return this.get(\"months\")},y.asMonths=function(){return this.as(\"months\")},y.years=function(){return this.get(\"years\")},y.asYears=function(){return this.as(\"years\")},l}(),p=function(t,s,n){return t.add(s.years()*n,\"y\").add(s.months()*n,\"M\").add(s.days()*n,\"d\").add(s.hours()*n,\"h\").add(s.minutes()*n,\"m\").add(s.seconds()*n,\"s\").add(s.milliseconds()*n,\"ms\")};return function(n,i,e){t=e,s=e().$utils(),e.duration=function(t,s){var n=e.locale();return f(t,{$l:n},s)},e.isDuration=c;var r=i.prototype.add,o=i.prototype.subtract;i.prototype.add=function(t,s){return c(t)?p(this,t,1):r.bind(this)(t,s)},i.prototype.subtract=function(t,s){return c(t)?p(this,t,-1):o.bind(this)(t,s)}}}));","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\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', 'common/extend');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/app');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/ExtensionPage');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Button');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/components/LoadingModal');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'admin/utils/isExtensionEnabled');","import app from 'flarum/admin/app';\n\n// @ts-ignore\nwindow.jumpToQueue = jumpToQueue;\nexport default function jumpToQueue() {\n app.modal.close();\n m.route.set(app.route('extension', {\n id: 'flarum-extension-manager'\n }));\n app.extensionManager.queue.load({}, true);\n setTimeout(() => {\n var _document$getElementB;\n (_document$getElementB = document.getElementById('ExtensionManager-queueSection')) == null || _document$getElementB.scrollIntoView({\n block: 'nearest'\n });\n }, 200);\n}\nflarum.reg.add('flarum-extension-manager', 'admin/utils/jumpToQueue', jumpToQueue);","export default function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}","import toPropertyKey from \"./toPropertyKey.js\";\nexport default function _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}","import _typeof from \"./typeof.js\";\nexport default function toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nexport default class QueueState {\n constructor() {\n _defineProperty(this, \"polling\", null);\n _defineProperty(this, \"tasks\", null);\n _defineProperty(this, \"limit\", 20);\n _defineProperty(this, \"offset\", 0);\n _defineProperty(this, \"total\", 0);\n _defineProperty(this, \"loading\", false);\n }\n load(params, actionTaken) {\n var _params;\n if (actionTaken === void 0) {\n actionTaken = false;\n }\n this.loading = true;\n params = {\n page: {\n limit: this.limit,\n offset: this.offset,\n ...((_params = params) == null ? void 0 : _params.page)\n },\n ...params\n };\n return app.store.find('extension-manager-tasks', params || {}).then(data => {\n var _data$payload$meta;\n this.tasks = data;\n this.total = ((_data$payload$meta = data.payload.meta) == null || (_data$payload$meta = _data$payload$meta.page) == null ? void 0 : _data$payload$meta.total) || 0;\n m.redraw();\n\n // Check if there is a pending or running task\n const pendingTask = data == null ? void 0 : data.find(task => task.status() === 'pending' || task.status() === 'running');\n if (pendingTask) {\n this.pollQueue(actionTaken);\n } else if (actionTaken) {\n app.extensionManager.control.setLoading(null);\n\n // Refresh the page\n window.location.reload();\n } else if (app.extensionManager.control.isLoading()) {\n app.extensionManager.control.setLoading(null);\n }\n this.loading = false;\n return data;\n });\n }\n isLoading() {\n return this.loading;\n }\n getItems() {\n return this.tasks;\n }\n getTotalItems() {\n return this.total;\n }\n getTotalPages() {\n return Math.ceil(this.total / this.limit);\n }\n pageNumber() {\n return Math.ceil(this.offset / this.limit);\n }\n getPerPage() {\n return this.limit;\n }\n hasPrev() {\n return this.pageNumber() !== 0;\n }\n hasNext() {\n return this.offset + this.limit < this.total;\n }\n prev() {\n if (this.hasPrev()) {\n this.offset -= this.limit;\n this.load();\n }\n }\n next() {\n if (this.hasNext()) {\n this.offset += this.limit;\n this.load();\n }\n }\n goto(page) {\n this.offset = (page - 1) * this.limit;\n this.load();\n }\n pollQueue(actionTaken) {\n if (actionTaken === void 0) {\n actionTaken = false;\n }\n if (this.polling) {\n clearTimeout(this.polling);\n }\n this.polling = setTimeout(() => {\n this.load({}, actionTaken);\n }, 6000);\n }\n hasPending() {\n var _this$tasks;\n return !!((_this$tasks = this.tasks) != null && _this$tasks.find(task => task.status() === 'pending' || task.status() === 'running'));\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/states/QueueState', QueueState);","import app from 'flarum/admin/app';\nexport default function (e) {\n app.extensionManager.control.setLoading(null);\n const error = e.response.errors[0];\n if (!['composer_command_failure', 'extension_already_installed', 'extension_not_installed'].includes(error.code)) {\n throw e;\n }\n app.alerts.clear();\n switch (error.code) {\n case 'composer_command_failure':\n if (error.guessed_cause) {\n app.alerts.show({\n type: 'error'\n }, app.translator.trans(\"flarum-extension-manager.admin.exceptions.guessed_cause.\".concat(error.guessed_cause)));\n app.modal.close();\n } else {\n app.alerts.show({\n type: 'error'\n }, app.translator.trans('flarum-extension-manager.admin.exceptions.composer_command_failure'));\n }\n break;\n case 'extension_already_installed':\n app.alerts.show({\n type: 'error'\n }, app.translator.trans('flarum-extension-manager.admin.exceptions.extension_already_installed'));\n app.modal.close();\n break;\n case 'extension_not_installed':\n app.alerts.show({\n type: 'error'\n }, app.translator.trans('flarum-extension-manager.admin.exceptions.extension_not_installed'));\n app.modal.close();\n }\n}","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/extractText');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport LoadingModal from 'flarum/admin/components/LoadingModal';\nimport errorHandler from '../utils/errorHandler';\nimport jumpToQueue from '../utils/jumpToQueue';\nimport extractText from 'flarum/common/utils/extractText';\nexport default class ControlSectionState {\n get lastUpdateRun() {\n const lastUpdateRun = JSON.parse(app.data.settings['flarum-extension-manager.last_update_run']);\n lastUpdateRun.limitedPackages = () => [...lastUpdateRun.major.limitedPackages, ...lastUpdateRun.minor.limitedPackages, ...lastUpdateRun.global.limitedPackages];\n return lastUpdateRun;\n }\n constructor() {\n _defineProperty(this, \"loading\", null);\n _defineProperty(this, \"packageUpdates\", {});\n _defineProperty(this, \"lastUpdateCheck\", void 0);\n _defineProperty(this, \"extensionUpdates\", void 0);\n _defineProperty(this, \"coreUpdate\", null);\n this.lastUpdateCheck = JSON.parse(app.data.settings['flarum-extension-manager.last_update_check']);\n this.extensionUpdates = this.formatExtensionUpdates(this.lastUpdateCheck);\n this.coreUpdate = this.formatCoreUpdate(this.lastUpdateCheck);\n }\n isLoading(name) {\n if (name === void 0) {\n name = null;\n }\n return name && this.loading === name || !name && this.loading !== null;\n }\n hasOperationRunning() {\n return this.isLoading() || app.extensionManager.queue.hasPending();\n }\n setLoading(name) {\n this.loading = name;\n }\n requirePackage(data) {\n app.extensionManager.control.setLoading('extension-install');\n app.modal.show(LoadingModal);\n app.request({\n method: 'POST',\n url: \"\".concat(app.forum.attribute('apiUrl'), \"/extension-manager/extensions\"),\n body: {\n data\n }\n }).then(response => {\n if (response.processing) {\n jumpToQueue();\n } else {\n const extensionId = response.id;\n app.alerts.show({\n type: 'success'\n }, app.translator.trans('flarum-extension-manager.admin.extensions.successful_install', {\n extension: extensionId\n }));\n window.location.href = \"\".concat(app.forum.attribute('adminUrl'), \"#/extension/\").concat(extensionId);\n window.location.reload();\n }\n }).catch(errorHandler).finally(() => {\n app.modal.close();\n m.redraw();\n });\n }\n checkForUpdates() {\n this.setLoading('check');\n app.request({\n method: 'POST',\n url: \"\".concat(app.forum.attribute('apiUrl'), \"/extension-manager/check-for-updates\")\n }).then(response => {\n if (response.processing) {\n jumpToQueue();\n } else {\n this.lastUpdateCheck = response;\n this.extensionUpdates = this.formatExtensionUpdates(response);\n this.coreUpdate = this.formatCoreUpdate(response);\n this.setLoading(null);\n m.redraw();\n }\n }).catch(errorHandler).finally(() => {\n m.redraw();\n });\n }\n updateCoreMinor() {\n if (confirm(extractText(app.translator.trans('flarum-extension-manager.admin.minor_update_confirmation.content')))) {\n app.modal.show(LoadingModal);\n this.setLoading('minor-update');\n app.request({\n method: 'POST',\n url: \"\".concat(app.forum.attribute('apiUrl'), \"/extension-manager/minor-update\")\n }).then(response => {\n if (response != null && response.processing) {\n jumpToQueue();\n } else {\n app.alerts.show({\n type: 'success'\n }, app.translator.trans('flarum-extension-manager.admin.update_successful'));\n window.location.reload();\n }\n }).catch(errorHandler).finally(() => {\n app.modal.close();\n m.redraw();\n });\n }\n }\n updateExtension(extension, updateMode) {\n app.modal.show(LoadingModal);\n this.setLoading('extension-update');\n app.request({\n method: 'PATCH',\n url: \"\".concat(app.forum.attribute('apiUrl'), \"/extension-manager/extensions/\").concat(extension.id),\n body: {\n data: {\n updateMode\n }\n }\n }).then(response => {\n if (response != null && response.processing) {\n jumpToQueue();\n } else {\n app.alerts.show({\n type: 'success'\n }, app.translator.trans('flarum-extension-manager.admin.extensions.successful_update', {\n extension: extension.extra['flarum-extension'].title\n }));\n window.location.reload();\n }\n }).catch(errorHandler).finally(() => {\n app.modal.close();\n m.redraw();\n });\n }\n updateGlobally() {\n app.modal.show(LoadingModal);\n this.setLoading('global-update');\n app.request({\n method: 'POST',\n url: \"\".concat(app.forum.attribute('apiUrl'), \"/extension-manager/global-update\")\n }).then(response => {\n if (response != null && response.processing) {\n jumpToQueue();\n } else {\n app.alerts.show({\n type: 'success'\n }, app.translator.trans('flarum-extension-manager.admin.updater.global_update_successful'));\n window.location.reload();\n }\n }).catch(errorHandler).finally(() => {\n app.modal.close();\n m.redraw();\n });\n }\n formatExtensionUpdates(lastUpdateCheck) {\n var _lastUpdateCheck$upda;\n this.packageUpdates = {};\n lastUpdateCheck == null || (_lastUpdateCheck$upda = lastUpdateCheck.updates) == null || (_lastUpdateCheck$upda = _lastUpdateCheck$upda.installed) == null || _lastUpdateCheck$upda.filter(composerPackage => {\n const id = composerPackage.name.replace('/', '-').replace(/(flarum-ext-)|(flarum-)/, '');\n const extension = app.data.extensions[id];\n const safeToUpdate = ['semver-safe-update', 'update-possible'].includes(composerPackage['latest-status']);\n if (extension && safeToUpdate) {\n this.packageUpdates[extension.id] = composerPackage;\n }\n return extension && safeToUpdate;\n });\n return Object.values(app.data.extensions).filter(extension => this.packageUpdates[extension.id]);\n }\n formatCoreUpdate(lastUpdateCheck) {\n var _lastUpdateCheck$upda2;\n const core = lastUpdateCheck == null || (_lastUpdateCheck$upda2 = lastUpdateCheck.updates) == null || (_lastUpdateCheck$upda2 = _lastUpdateCheck$upda2.installed) == null ? void 0 : _lastUpdateCheck$upda2.filter(composerPackage => composerPackage.name === 'flarum/core').pop();\n if (!core) return null;\n return {\n package: core,\n extension: {\n id: 'flarum-core',\n name: 'flarum/core',\n version: app.data.settings.version,\n icon: {\n name: '',\n // @ts-ignore\n backgroundImage: \"url(\".concat(app.data.resources[0]['attributes']['baseUrl'], \"/assets/extensions/flarum-extension-manager/flarum.svg\")\n },\n extra: {\n 'flarum-extension': {\n title: extractText(app.translator.trans('flarum-extension-manager.admin.updater.flarum'))\n }\n },\n links: {}\n }\n };\n }\n majorUpdate(_ref) {\n let {\n dryRun\n } = _ref;\n app.extensionManager.control.setLoading(dryRun ? 'major-update-dry-run' : 'major-update');\n app.modal.show(LoadingModal);\n const updateState = this.lastUpdateRun.major;\n app.request({\n method: 'POST',\n url: \"\".concat(app.forum.attribute('apiUrl'), \"/extension-manager/major-update\"),\n body: {\n data: {\n dryRun\n }\n }\n }).then(response => {\n if (response != null && response.processing) {\n jumpToQueue();\n } else {\n app.alerts.show({\n type: 'success'\n }, app.translator.trans('flarum-extension-manager.admin.update_successful'));\n window.location.reload();\n }\n }).catch(errorHandler).catch(e => {\n var _e$response;\n app.modal.close();\n updateState.status = 'failure';\n updateState.incompatibleExtensions = (_e$response = e.response) == null || (_e$response = _e$response.errors) == null || (_e$response = _e$response.pop()) == null ? void 0 : _e$response.incompatible_extensions;\n }).finally(() => {\n m.redraw();\n });\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/states/ControlSectionState', ControlSectionState);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/states/PaginatedListState');","import app from 'flarum/admin/app';\nimport PaginatedListState from 'flarum/common/states/PaginatedListState';\nexport default class ExtensionListState extends PaginatedListState {\n get type() {\n return 'external-extensions';\n }\n constructor() {\n super({\n sort: '-downloads'\n }, 1, 12);\n }\n sortMap() {\n return {\n '-createdAt': {\n sort: '-createdAt',\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.sort.latest', {}, true)\n },\n '-downloads': {\n sort: '-downloads',\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.sort.top', {}, true)\n }\n };\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/states/ExtensionListState', ExtensionListState);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport QueueState from './QueueState';\nimport ControlSectionState from './ControlSectionState';\nimport ExtensionListState from './ExtensionListState';\nexport default class ExtensionManagerState {\n constructor() {\n _defineProperty(this, \"queue\", new QueueState());\n _defineProperty(this, \"control\", new ControlSectionState());\n _defineProperty(this, \"extensions\", new ExtensionListState());\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/states/ExtensionManagerState', ExtensionManagerState);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/extenders');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/Component');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/LoadingIndicator');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Tooltip');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Icon');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/ItemList');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Link');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Pagination');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/classList');","import Component from 'flarum/common/Component';\nimport classList from 'flarum/common/utils/classList';\nexport default class Label extends Component {\n view(vnode) {\n const {\n className,\n type,\n ...attrs\n } = this.attrs;\n return m(\"span\", Object.assign({\n className: classList(['Label', \"Label--\".concat(this.attrs.type), className])\n }, attrs), vnode.children);\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/Label', Label);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Modal');","import app from 'flarum/admin/app';\nimport Modal from 'flarum/common/components/Modal';\nexport default class TaskOutputModal extends Modal {\n className() {\n return 'Modal--large QuickModal';\n }\n title() {\n return app.translator.trans(\"flarum-extension-manager.admin.sections.queue.operations.\".concat(this.attrs.task.operation()));\n }\n content() {\n return m(\"div\", {\n className: \"Modal-body\"\n }, m(\"div\", {\n className: \"TaskOutputModal-data\"\n }, this.attrs.task.status() === 'failure' && m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.sections.queue.output_modal.guessed_cause')), m(\"div\", {\n className: \"FormControl TaskOutputModal-data-guessed-cause\"\n }, this.attrs.task.guessedCause() && app.translator.trans('flarum-extension-manager.admin.exceptions.guessed_cause.' + this.attrs.task.guessedCause()) || app.translator.trans('flarum-extension-manager.admin.sections.queue.output_modal.cause_unknown'))), m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.sections.queue.output_modal.command')), m(\"div\", {\n className: \"FormControl TaskOutputModal-data-command\"\n }, m(\"code\", null, \"$ composer \", this.attrs.task.command()))), m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.sections.queue.output_modal.output')), m(\"div\", {\n className: \"FormControl TaskOutputModal-data-output\"\n }, m(\"code\", null, m(\"pre\", null, this.attrs.task.output()))))));\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/TaskOutputModal', TaskOutputModal);","import duration from 'dayjs/plugin/duration';\nexport default function humanDuration(start, end) {\n dayjs.extend(duration);\n const durationTime = dayjs(end).diff(start);\n return dayjs.duration(durationTime).humanize();\n}\nflarum.reg.add('flarum-extension-manager', 'admin/utils/humanDuration', humanDuration);","import app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport Button from 'flarum/common/components/Button';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport Icon from 'flarum/common/components/Icon';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport extractText from 'flarum/common/utils/extractText';\nimport Link from 'flarum/common/components/Link';\nimport Pagination from 'flarum/common/components/Pagination';\nimport classList from 'flarum/common/utils/classList';\nimport Label from './Label';\nimport TaskOutputModal from './TaskOutputModal';\nimport humanDuration from '../utils/humanDuration';\nexport default class QueueSection extends Component {\n oninit(vnode) {\n super.oninit(vnode);\n app.extensionManager.queue.load();\n }\n view() {\n return m(\"section\", {\n id: \"ExtensionManager-queueSection\",\n className: \"ExtensionPage-settings ExtensionManager-queueSection\"\n }, m(\"div\", {\n className: \"ExtensionPage-permissions-header ExtensionManager-queueSection-header\"\n }, m(\"div\", {\n className: \"container\"\n }, m(\"h2\", {\n className: \"ExtensionTitle\"\n }, app.translator.trans('flarum-extension-manager.admin.sections.queue.title')), m(Button, {\n className: \"Button Button--icon\",\n icon: \"fas fa-sync-alt\",\n onclick: () => app.extensionManager.queue.load(),\n \"aria-label\": app.translator.trans('flarum-extension-manager.admin.sections.queue.refresh'),\n disabled: app.extensionManager.control.isLoading()\n }))), m(\"div\", {\n className: \"container\"\n }, this.queueTable()));\n }\n columns() {\n const items = new ItemList();\n items.add('operation', {\n label: extractText(app.translator.trans('flarum-extension-manager.admin.sections.queue.columns.operation')),\n content: task => m(\"div\", {\n className: \"ExtensionManager-queueTable-operation\"\n }, m(\"span\", {\n className: \"ExtensionManager-queueTable-operation-icon\"\n }, this.operationIcon(task.operation())), m(\"span\", {\n className: \"ExtensionManager-queueTable-operation-name\"\n }, app.translator.trans(\"flarum-extension-manager.admin.sections.queue.operations.\".concat(task.operation()))))\n }, 80);\n items.add('package', {\n label: extractText(app.translator.trans('flarum-extension-manager.admin.sections.queue.columns.package')),\n content: task => {\n var _task$package;\n const extension = app.data.extensions[(_task$package = task.package()) == null ? void 0 : _task$package.replace(/(\\/flarum-|\\/flarum-ext-|\\/)/g, '-')];\n return extension ? m(Link, {\n className: \"ExtensionManager-queueTable-package\",\n href: app.route('extension', {\n id: extension.id\n })\n }, m(\"div\", {\n className: \"ExtensionManager-queueTable-package-icon ExtensionIcon\",\n style: extension.icon\n }, !!extension.icon && m(Icon, {\n name: extension.icon.name\n })), m(\"div\", {\n className: \"ExtensionManager-queueTable-package-details\"\n }, m(\"span\", {\n className: \"ExtensionManager-queueTable-package-title\"\n }, extension.extra['flarum-extension'].title), m(\"span\", {\n className: \"ExtensionManager-queueTable-package-name\"\n }, task.package()))) : task.package();\n }\n }, 75);\n items.add('status', {\n label: extractText(app.translator.trans('flarum-extension-manager.admin.sections.queue.columns.status')),\n content: task => m('[', null, m(Label, {\n className: \"ExtensionManager-queueTable-status\",\n type: {\n running: 'neutral',\n failure: 'error',\n pending: 'warning',\n success: 'success'\n }[task.status()]\n }, app.translator.trans(\"flarum-extension-manager.admin.sections.queue.statuses.\".concat(task.status()))), ['pending', 'running'].includes(task.status()) && m(LoadingIndicator, {\n size: \"small\",\n display: \"inline\"\n }))\n }, 70);\n items.add('elapsedTime', {\n label: extractText(app.translator.trans('flarum-extension-manager.admin.sections.queue.columns.elapsed_time')),\n content: task => !task.startedAt() || !task.finishedAt() ? app.translator.trans('flarum-extension-manager.admin.sections.queue.task_just_started') : m(Tooltip, {\n text: \"\".concat(dayjs(task.startedAt()).format('LL LTS'), \" \").concat(dayjs(task.finishedAt()).format('LL LTS'))\n }, m(\"span\", null, humanDuration(task.startedAt(), task.finishedAt())))\n }, 65);\n items.add('memoryUsed', {\n label: extractText(app.translator.trans('flarum-extension-manager.admin.sections.queue.columns.peak_memory_used')),\n content: task => m(\"span\", null, task.peakMemoryUsed())\n }, 60);\n items.add('details', {\n label: extractText(app.translator.trans('flarum-extension-manager.admin.sections.queue.columns.details')),\n content: task => m(Button, {\n className: \"Button Button--icon Table-controls-item\",\n icon: \"fas fa-file-alt\",\n \"aria-label\": app.translator.trans('flarum-extension-manager.admin.sections.queue.columns.details')\n // @todo fix in core\n // @ts-ignore\n ,\n onclick: () => app.modal.show(TaskOutputModal, {\n task\n }),\n disabled: ['pending', 'running'].includes(task.status())\n }),\n className: 'Table-controls'\n }, 55);\n return items;\n }\n queueTable() {\n const tasks = app.extensionManager.queue.getItems();\n if (!tasks) {\n return m(LoadingIndicator, null);\n }\n if (tasks && !tasks.length) {\n return m(\"h3\", {\n className: \"ExtensionPage-subHeader\"\n }, app.translator.trans('flarum-extension-manager.admin.sections.queue.none'));\n }\n const columns = this.columns();\n return m('[', null, m(\"div\", {\n className: classList('Table-container', {\n 'loading-container': tasks && app.extensionManager.queue.isLoading()\n })\n }, m(\"table\", {\n className: \"Table ExtensionManager-queueTable\"\n }, m(\"thead\", null, m(\"tr\", null, columns.toArray().map((item, index) => m(\"th\", {\n key: index\n }, item.label)))), m(\"tbody\", null, tasks.map((task, index) => m(\"tr\", {\n key: index\n }, columns.toArray().map((item, index) => {\n const {\n label,\n content,\n ...attrs\n } = item;\n return m(\"td\", Object.assign({\n key: index\n }, attrs), content(task));\n }))))), tasks && app.extensionManager.queue.isLoading() && m(LoadingIndicator, {\n size: \"large\"\n })), m(Pagination, {\n total: app.extensionManager.queue.getTotalItems(),\n currentPage: app.extensionManager.queue.pageNumber() + 1,\n perPage: app.extensionManager.queue.getPerPage(),\n onChange: page => app.extensionManager.queue.goto(page)\n }));\n }\n operationIcon(operation) {\n return m(Icon, {\n name: {\n update_check: 'fas fa-sync-alt',\n update_major: 'fas fa-play',\n update_minor: 'fas fa-play',\n update_global: 'fas fa-play',\n extension_install: 'fas fa-download',\n extension_remove: 'fas fa-times',\n extension_update: 'fas fa-arrow-alt-circle-up',\n why_not: 'fas fa-exclamation-circle'\n }[operation]\n });\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/QueueSection', QueueSection);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Alert');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/Stream');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport Stream from 'flarum/common/utils/Stream';\nexport default class Installer extends Component {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"packageName\", void 0);\n }\n oninit(vnode) {\n super.oninit(vnode);\n this.packageName = Stream('');\n }\n view() {\n return m(\"div\", {\n className: \"Form-group ExtensionManager-installer\"\n }, m(\"label\", {\n htmlFor: \"install-extension\"\n }, app.translator.trans('flarum-extension-manager.admin.extensions.install')), m(\"div\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-extension-manager.admin.extensions.install_help', {\n link: m(\"a\", {\n href: \"https://flarum.org/extensions\"\n }, \"flarum.org\"),\n semantic_link: m(\"a\", {\n href: \"https://devhints.io/semver\"\n }),\n code: m(\"code\", null)\n })), m(\"div\", {\n className: \"FormControl-container\"\n }, m(\"input\", {\n className: \"FormControl\",\n id: \"install-extension\",\n placeholder: \"vendor/package-name\",\n bidi: this.packageName\n }), m(Button, {\n className: \"Button\",\n icon: \"fas fa-download\",\n onclick: this.onsubmit.bind(this),\n loading: app.extensionManager.control.isLoading('extension-install'),\n disabled: app.extensionManager.control.hasOperationRunning()\n }, app.translator.trans('flarum-extension-manager.admin.extensions.proceed'))));\n }\n data() {\n return {\n package: this.packageName()\n };\n }\n onsubmit() {\n app.extensionManager.control.requirePackage(this.data());\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/Installer', Installer);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/helpers/humanTime');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport Modal from 'flarum/common/components/Modal';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport errorHandler from '../utils/errorHandler';\nexport default class WhyNotModal extends Modal {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"loading\", true);\n _defineProperty(this, \"whyNot\", null);\n }\n className() {\n return 'Modal--large WhyNotModal';\n }\n title() {\n return app.translator.trans('flarum-extension-manager.admin.why_not_modal.title');\n }\n oncreate(vnode) {\n super.oncreate(vnode);\n this.requestWhyNot();\n }\n content() {\n return m(\"div\", {\n className: \"Modal-body\"\n }, this.loading ? m(LoadingIndicator, null) : m(\"pre\", {\n className: \"WhyNotModal-contents\"\n }, this.whyNot));\n }\n requestWhyNot() {\n app.request({\n method: 'POST',\n url: \"\".concat(app.forum.attribute('apiUrl'), \"/extension-manager/why-not\"),\n body: {\n data: {\n package: this.attrs.package\n }\n }\n }).then(response => {\n this.loading = false;\n this.whyNot = response.data.reason;\n m.redraw();\n }).catch(errorHandler);\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/WhyNotModal', WhyNotModal);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Badge');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/formatAmount');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/Model');","export let VersionStability = /*#__PURE__*/function (VersionStability) {\n VersionStability[\"Stable\"] = \"stable\";\n VersionStability[\"Alpha\"] = \"alpha\";\n VersionStability[\"Beta\"] = \"beta\";\n VersionStability[\"RC\"] = \"rc\";\n VersionStability[\"Dev\"] = \"dev\";\n return VersionStability;\n}({});\nexport function isProductionReady(version) {\n return [VersionStability.Stable, VersionStability.RC].includes(stability(version));\n}\nexport function stability(version) {\n const split = version.split('-');\n if (split.length === 1) {\n return VersionStability.Stable;\n }\n const stab = split[1].split('.')[0].toLowerCase();\n switch (stab) {\n case 'alpha':\n return VersionStability.Alpha;\n case 'beta':\n return VersionStability.Beta;\n case 'rc':\n return VersionStability.RC;\n default:\n return VersionStability.Dev;\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/utils/versions', { VersionStability: VersionStability,isProductionReady: isProductionReady,stability: stability, });","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport Model from 'flarum/common/Model';\nimport app from 'flarum/admin/app';\nimport { isProductionReady } from '../utils/versions';\nexport default class ExternalExtension extends Model {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"extensionId\", Model.attribute('extensionId'));\n _defineProperty(this, \"name\", Model.attribute('name'));\n _defineProperty(this, \"title\", Model.attribute('title'));\n _defineProperty(this, \"description\", Model.attribute('description'));\n _defineProperty(this, \"iconUrl\", Model.attribute('iconUrl'));\n _defineProperty(this, \"icon\", Model.attribute('icon'));\n _defineProperty(this, \"highestVersion\", Model.attribute('highestVersion'));\n _defineProperty(this, \"httpUri\", Model.attribute('httpUri'));\n _defineProperty(this, \"discussUri\", Model.attribute('discussUri'));\n _defineProperty(this, \"vendor\", Model.attribute('vendor'));\n _defineProperty(this, \"isPremium\", Model.attribute('isPremium'));\n _defineProperty(this, \"isLocale\", Model.attribute('isLocale'));\n _defineProperty(this, \"locale\", Model.attribute('locale'));\n _defineProperty(this, \"latestFlarumVersionSupported\", Model.attribute('latestFlarumVersionSupported'));\n _defineProperty(this, \"downloads\", Model.attribute('downloads'));\n _defineProperty(this, \"installed\", false);\n }\n isSupported() {\n const currentVersion = app.data.settings.version;\n const latestCompatibleVersion = this.latestFlarumVersionSupported();\n\n // If stability is not the same, it's not compatible.\n if (currentVersion.split('-')[1] !== latestCompatibleVersion.split('-')[1]) {\n return false;\n }\n\n // Minor versions are compatible.\n return currentVersion.split('.')[0] === latestCompatibleVersion.split('.')[0];\n }\n isProductionReady() {\n return isProductionReady(this.highestVersion());\n }\n toLocalExtension() {\n return {\n id: this.extensionId(),\n name: this.name(),\n version: this.highestVersion(),\n description: this.description(),\n icon: this.icon() || {\n name: 'fas fa-box-open',\n backgroundColor: '#117187',\n color: '#fff'\n },\n links: {\n discuss: this.discussUri(),\n website: this.httpUri()\n },\n extra: {\n 'flarum-extension': {\n title: this.title()\n }\n }\n };\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/models/ExternalExtension', ExternalExtension);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Dropdown');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/LinkButton');","import Component from 'flarum/common/Component';\nimport Icon from 'flarum/common/components/Icon';\nimport Badge from 'flarum/common/components/Badge';\nimport app from 'flarum/admin/app';\nimport Button from 'flarum/common/components/Button';\nimport formatAmount from 'flarum/common/utils/formatAmount';\nimport ExternalExtension from '../models/ExternalExtension';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport classList from 'flarum/common/utils/classList';\nimport Label from './Label';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport Dropdown from 'flarum/common/components/Dropdown';\nimport WhyNotModal from './WhyNotModal';\nimport LinkButton from 'flarum/common/components/LinkButton';\nexport default class ExtensionCard extends Component {\n getExtension() {\n return this.attrs.extension instanceof ExternalExtension ? this.attrs.extension.toLocalExtension() : this.attrs.extension;\n }\n view() {\n const extension = this.getExtension();\n const {\n isCore,\n isDanger\n } = this.attrs;\n return m(\"div\", {\n className: classList('ExtensionCard', {\n 'ExtensionCard--core': isCore,\n 'ExtensionCard--danger': isDanger\n })\n }, m(\"div\", {\n className: \"ExtensionCard-header\"\n }, this.icon(), m(Tooltip, {\n text: extension.name\n }, m(\"h4\", null, extension.extra['flarum-extension'].title)), this.attrs.extension instanceof ExternalExtension && m(\"div\", {\n className: \"ExtensionCard-badges\"\n }, this.badges().toArray()), m(\"div\", {\n className: \"ExtensionCard-actions\"\n }, this.actionItems().toArray())), m(\"div\", {\n className: \"ExtensionCard-body\"\n }, m(\"p\", null, extension.description)), m(\"div\", {\n className: \"ExtensionCard-footer\"\n }, m(\"div\", {\n className: \"ExtensionCard-meta\"\n }, this.metaItems().toArray())));\n }\n icon() {\n var _extension$icon, _extension$icon2;\n const extension = this.getExtension();\n if (this.attrs.extension instanceof ExternalExtension && extension.id in app.data.extensions) {\n extension.icon = app.data.extensions[extension.id].icon;\n }\n const style = extension.icon || {};\n if (!((_extension$icon = extension.icon) != null && _extension$icon.name) && this.attrs.extension instanceof ExternalExtension && !(extension.id in app.data.extensions) && this.attrs.extension.iconUrl()) {\n style.backgroundImage = \"url(\".concat(this.attrs.extension.iconUrl(), \")\");\n }\n return m(\"span\", {\n className: \"ExtensionIcon\",\n style: extension.icon\n }, (_extension$icon2 = extension.icon) != null && _extension$icon2.name ? m(Icon, {\n name: extension.icon.name\n }) : null);\n }\n badges() {\n const items = new ItemList();\n const extension = this.attrs.extension;\n if (extension.isSupported()) {\n items.add('compatible', m(Badge, {\n icon: \"fas fa-check\",\n type: \"success\",\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.extension.badges.compatible'),\n className: \"Badge--flat Badge--square\"\n }));\n } else {\n items.add('incompatible', m(Badge, {\n icon: \"fas fa-times\",\n type: \"danger\",\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.extension.badges.incompatible'),\n className: \"Badge--flat Badge--square\"\n }));\n }\n if (extension.isPremium()) {\n items.add('premium', m(Badge, {\n icon: \"fas fa-dollar-sign\",\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.extension.badges.premium'),\n className: \"ExtensionCard-badge--premium Badge--flat Badge--square\"\n }));\n }\n if (!extension.isProductionReady()) {\n items.add('unstable', m(Badge, {\n icon: \"fas fa-flask\",\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.extension.badges.unstable'),\n className: \"Badge--flat Badge--square Badge--danger\"\n }));\n }\n if (extension.name().split('/')[0] === 'fof') {\n items.add('fof', m(Badge, {\n icon: \"fas fa-users\",\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.extension.badges.fof'),\n className: \"Badge--flat Badge--square\"\n }));\n }\n if (extension.name().split('/')[0] === 'flarum') {\n items.add('flarum', m(Badge, {\n icon: \"fab fa-flarum\",\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.extension.badges.flarum'),\n className: \"ExtensionCard-badge--flarum Badge--flat Badge--square\"\n }));\n }\n return items;\n }\n metaItems() {\n var _updates$latestMinor;\n const items = new ItemList();\n const {\n updates,\n isCore\n } = this.attrs;\n const latestVersion = updates ? (_updates$latestMinor = updates['latest-minor']) != null ? _updates$latestMinor : updates['latest-major'] && !isCore ? updates['latest-major'] : null : null;\n if (this.attrs.extension instanceof ExternalExtension) {\n items.add('downloads', m(\"span\", null, m(Icon, {\n name: \"fas fa-circle-down\"\n }), app.translator.trans('flarum-extension-manager.admin.sections.discover.extension.downloads', {\n count: this.attrs.extension.downloads(),\n formattedCount: formatAmount(this.attrs.extension.downloads())\n })));\n } else {\n items.add('version', m(\"div\", {\n className: \"ExtensionCard-version\"\n }, m(\"span\", {\n className: \"ExtensionCard-version-current\"\n }, this.version(updates['version'])), latestVersion ? m('[', null, m(Icon, {\n name: \"fas fa-arrow-right\"\n }), m(Label, {\n className: \"ExtensionCard-version-latest\",\n type: updates['latest-minor'] ? 'success' : 'warning'\n }, this.version(latestVersion))) : null));\n }\n if (this.attrs.extension instanceof ExternalExtension) {\n items.add('version', m(\"div\", {\n className: \"ExtensionCard-version\"\n }, \"v\", this.version(this.attrs.extension.highestVersion())));\n items.add('link', m(LinkButton, {\n className: \"Button Button--ua-reset Button--link Button--icon\",\n href: this.attrs.extension.httpUri(),\n target: \"_blank\",\n icon: \"fas fa-external-link-alt\",\n external: true\n }));\n }\n return items;\n }\n actionItems() {\n const items = new ItemList();\n const {\n updates,\n extension,\n onClickUpdate,\n whyNotWarning\n } = this.attrs;\n if (extension instanceof ExternalExtension) {\n if (!(extension.extensionId() in app.data.extensions)) {\n items.add('install', m(Button, {\n className: \"Button Button--icon Button--flat\",\n icon: \"fas fa-cloud-arrow-down\",\n onclick: () => {\n app.extensionManager.control.requirePackage({\n package: extension.name()\n });\n }\n }));\n } else {\n items.add('installed', m(Button, {\n className: \"Button Button--icon Button--flat Button--success\",\n icon: \"fas fa-check-circle\",\n disabled: true\n }));\n }\n } else {\n if (onClickUpdate && typeof onClickUpdate === 'function') {\n items.add('update', m(Tooltip, {\n text: app.translator.trans('flarum-extension-manager.admin.extensions.update')\n }, m(Button, {\n icon: \"fas fa-cloud-arrow-down\",\n className: \"Button Button--icon Button--flat\",\n onclick: onClickUpdate,\n \"aria-label\": app.translator.trans('flarum-extension-manager.admin.extensions.update')\n })));\n } else if (onClickUpdate) {\n items.add('update', m(Dropdown, {\n buttonClassName: \"Button Button--icon Button--flat\",\n icon: \"fas fa-ellipsis\",\n label: app.translator.trans('flarum-extension-manager.admin.extensions.update')\n }, m(Button, {\n icon: \"fas fa-cloud-arrow-down\",\n onclick: onClickUpdate.soft\n }, app.translator.trans('flarum-extension-manager.admin.extensions.update_soft_label')), m(Button, {\n icon: \"fas fa-rotate\",\n onclick: onClickUpdate.hard,\n disabled: !updates['direct-dependency']\n }, app.translator.trans('flarum-extension-manager.admin.extensions.update_hard_label'))));\n }\n if (whyNotWarning) items.add('whyNot', m(Tooltip, {\n text: app.translator.trans('flarum-extension-manager.admin.extensions.check_why_it_failed_updating')\n }, m(Button, {\n icon: \"fas fa-exclamation-circle\",\n className: \"Button Button--icon Button--flat Button--danger\",\n onclick: () => app.modal.show(WhyNotModal, {\n package: extension.name\n }),\n \"aria-label\": app.translator.trans('flarum-extension-manager.admin.extensions.check_why_it_failed_updating')\n })));\n }\n return items;\n }\n version(v) {\n return v.charAt(0) === 'v' ? v.substring(1) : v;\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/ExtensionCard', ExtensionCard);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport Tooltip from 'flarum/common/components/Tooltip';\nimport Alert from 'flarum/common/components/Alert';\nimport WhyNotModal from './WhyNotModal';\nimport ExtensionCard from './ExtensionCard';\nimport classList from 'flarum/common/utils/classList';\nexport default class MajorUpdater extends Component {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"updateState\", void 0);\n }\n oninit(vnode) {\n super.oninit(vnode);\n this.updateState = this.attrs.updateState;\n }\n view() {\n return m(\"div\", {\n className: classList('Form-group Form-group--danger ExtensionManager-majorUpdate', {\n 'ExtensionManager-majorUpdate--failed': this.updateState.status === 'failure',\n 'ExtensionManager-majorUpdate--incompatibleExtensions': this.updateState.incompatibleExtensions.length\n })\n }, m(\"img\", {\n alt: \"flarum logo\",\n src: app.forum.attribute('baseUrl') + '/assets/extensions/flarum-extension-manager/flarum.svg'\n }), m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.major_updater.title', {\n version: this.attrs.coreUpdate['latest-major']\n })), m(\"p\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-extension-manager.admin.major_updater.description')), m(\"div\", {\n className: \"ExtensionManager-updaterControls\"\n }, m(Tooltip, {\n text: app.translator.trans('flarum-extension-manager.admin.major_updater.dry_run_help')\n }, m(Button, {\n className: \"Button\",\n icon: \"fas fa-vial\",\n onclick: this.update.bind(this, true),\n disabled: app.extensionManager.control.hasOperationRunning()\n }, app.translator.trans('flarum-extension-manager.admin.major_updater.dry_run'))), m(Button, {\n className: \"Button Button--danger\",\n icon: \"fas fa-play\",\n onclick: this.update.bind(this, false),\n disabled: app.extensionManager.control.hasOperationRunning()\n }, app.translator.trans('flarum-extension-manager.admin.major_updater.update'))), this.updateState.incompatibleExtensions.length ? m(\"div\", {\n className: \"ExtensionManager-majorUpdate-incompatibleExtensions ExtensionManager-extensions-grid\"\n }, this.updateState.incompatibleExtensions.map(extension => m(ExtensionCard, {\n extension: app.data.extensions[extension.replace('flarum-', '').replace('flarum-ext-', '').replace('/', '-')],\n updates: {},\n onClickUpdate: null,\n isDanger: true\n }))) : null, this.updateState.status === 'failure' ? m(Alert, {\n type: \"error\",\n className: \"ExtensionManager-majorUpdate-failure\",\n dismissible: false,\n controls: [m(Button, {\n className: \"Button Button--text ExtensionManager-majorUpdate-failure-details\",\n icon: \"fas fa-question-circle\",\n onclick: () => app.modal.show(WhyNotModal, {\n package: 'flarum/core'\n })\n }, app.translator.trans('flarum-extension-manager.admin.major_updater.failure.why'))]\n }, m(\"p\", {\n className: \"ExtensionManager-majorUpdate-failure-desc\"\n }, app.translator.trans('flarum-extension-manager.admin.major_updater.failure.desc'))) : null);\n }\n update(dryRun) {\n app.extensionManager.control.majorUpdate({\n dryRun\n });\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/MajorUpdater', MajorUpdater);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/InfoTile');","import app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport Button from 'flarum/common/components/Button';\nimport humanTime from 'flarum/common/helpers/humanTime';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport MajorUpdater from './MajorUpdater';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport InfoTile from 'flarum/common/components/InfoTile';\nimport ExtensionCard from './ExtensionCard';\nimport { isProductionReady } from '../utils/versions';\nexport default class Updater extends Component {\n view() {\n const core = app.extensionManager.control.coreUpdate;\n return [m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.updater.updater_title')), m(\"div\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-extension-manager.admin.updater.updater_help')), this.lastUpdateCheckView(), m(\"div\", {\n className: \"ExtensionManager-updaterControls\"\n }, this.controlItems().toArray()), this.availableUpdatesView()), core && core.package['latest-major'] && isProductionReady(core.package['latest-major']) ? m(MajorUpdater, {\n coreUpdate: core.package,\n updateState: app.extensionManager.control.lastUpdateRun.major\n }) : null];\n }\n lastUpdateCheckView() {\n var _app$extensionManager;\n return ((_app$extensionManager = app.extensionManager.control.lastUpdateCheck) == null ? void 0 : _app$extensionManager.checkedAt) && m(\"p\", {\n className: \"ExtensionManager-lastUpdatedAt\"\n }, m(\"span\", {\n className: \"ExtensionManager-lastUpdatedAt-label\"\n }, app.translator.trans('flarum-extension-manager.admin.updater.last_update_checked_at')), m(\"span\", {\n className: \"ExtensionManager-lastUpdatedAt-value\"\n }, humanTime(app.extensionManager.control.lastUpdateCheck.checkedAt))) || null;\n }\n availableUpdatesView() {\n const state = app.extensionManager.control;\n if (app.extensionManager.control.isLoading('check') || app.extensionManager.control.isLoading('global-update')) {\n return m(\"div\", {\n className: \"ExtensionManager-extensions\"\n }, m(LoadingIndicator, null));\n }\n const hasMinorCoreUpdate = state.coreUpdate && state.coreUpdate.package['latest-minor'];\n if (!(state.extensionUpdates.length || hasMinorCoreUpdate)) {\n return m(\"div\", {\n className: \"ExtensionManager-extensions ExtensionManager-extensions--empty\"\n }, m(InfoTile, {\n icon: \"fas fa-plug-circle-check\"\n }, app.translator.trans('flarum-extension-manager.admin.updater.up_to_date')));\n }\n return m(\"div\", {\n className: \"ExtensionManager-extensions\"\n }, m(\"div\", {\n className: \"ExtensionManager-extensions-grid\"\n }, hasMinorCoreUpdate ? m(ExtensionCard, {\n extension: state.coreUpdate.extension,\n updates: state.coreUpdate.package,\n isCore: true,\n onClickUpdate: () => state.updateCoreMinor(),\n whyNotWarning: state.lastUpdateRun.limitedPackages().includes('flarum/core')\n }) : null, state.extensionUpdates.map(extension => m(ExtensionCard, {\n extension: extension,\n updates: state.packageUpdates[extension.id],\n onClickUpdate: {\n soft: () => state.updateExtension(extension, 'soft'),\n hard: () => state.updateExtension(extension, 'hard')\n },\n whyNotWarning: state.lastUpdateRun.limitedPackages().includes(extension.name)\n }))));\n }\n controlItems() {\n const items = new ItemList();\n items.add('updateCheck', m(Button, {\n className: \"Button\",\n icon: \"fas fa-sync-alt\",\n onclick: () => app.extensionManager.control.checkForUpdates(),\n loading: app.extensionManager.control.isLoading('check'),\n disabled: app.extensionManager.control.hasOperationRunning()\n }, app.translator.trans('flarum-extension-manager.admin.updater.check_for_updates')), 100);\n items.add('globalUpdate', m(Button, {\n className: \"Button\",\n icon: \"fas fa-play\",\n onclick: () => app.extensionManager.control.updateGlobally(),\n loading: app.extensionManager.control.isLoading('global-update'),\n disabled: app.extensionManager.control.hasOperationRunning()\n }, app.translator.trans('flarum-extension-manager.admin.updater.run_global_update')));\n return items;\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/Updater', Updater);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Form');","import app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport Alert from 'flarum/common/components/Alert';\nimport Installer from './Installer';\nimport Updater from './Updater';\nimport Form from 'flarum/common/components/Form';\nexport default class ControlSection extends Component {\n oninit(vnode) {\n super.oninit(vnode);\n }\n view() {\n return m(\"div\", {\n className: \"ExtensionPage-settings ExtensionManager-controlSection\"\n }, m(\"div\", {\n className: \"container\"\n }, app.data['flarum-extension-manager.writable_dirs'] ? m(Form, null, m(Installer, null), m(Updater, null)) : m(\"div\", {\n className: \"Form-group\"\n }, m(Alert, {\n type: \"warning\",\n dismissible: false\n }, app.translator.trans('flarum-extension-manager.admin.file_permissions')))));\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/ControlSection', ControlSection);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/FormGroup');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport FormGroup from 'flarum/common/components/FormGroup';\nimport Stream from 'flarum/common/utils/Stream';\nimport Button from 'flarum/common/components/Button';\nimport classList from 'flarum/common/utils/classList';\nexport default class ConfigureJson extends Component {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"settings\", {});\n _defineProperty(this, \"initialSettings\", null);\n _defineProperty(this, \"loading\", false);\n _defineProperty(this, \"type\", void 0);\n }\n oninit(vnode) {\n super.oninit(vnode);\n this.submit(true);\n }\n className() {\n return '';\n }\n view() {\n return m(\"div\", {\n className: classList('FormSection', this.className())\n }, m(\"label\", null, this.title()), this.content(), m(\"div\", {\n className: \"Form-group Form-controls\"\n }, this.submitButton()));\n }\n submitButton() {\n return [m(Button, {\n className: \"Button Button--primary\",\n loading: this.loading,\n onclick: () => this.submit(false),\n disabled: !this.isDirty()\n }, app.translator.trans('core.admin.settings.submit_button'))];\n }\n customSettingComponents() {\n return FormGroup.prototype.customFieldComponents();\n }\n setting(key) {\n var _this$settings$key;\n return (_this$settings$key = this.settings[key]) != null ? _this$settings$key : this.settings[key] = Stream();\n }\n submit(readOnly) {\n this.loading = true;\n const configuration = {};\n Object.keys(this.settings).forEach(key => {\n configuration[key] = this.settings[key]();\n });\n app.request({\n method: 'POST',\n url: app.forum.attribute('apiUrl') + '/extension-manager/composer',\n body: {\n type: this.type,\n data: readOnly ? null : configuration\n }\n }).then(_ref => {\n let {\n data\n } = _ref;\n Object.keys(data).forEach(key => {\n this.settings[key] = Stream(data[key]);\n });\n this.initialSettings = Array.isArray(data) ? {} : data;\n }).finally(() => {\n this.loading = false;\n m.redraw();\n });\n }\n isDirty() {\n return JSON.stringify(this.initialSettings) !== JSON.stringify(this.settings);\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/ConfigureJson', ConfigureJson);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Select');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport Modal from 'flarum/common/components/Modal';\nimport app from 'flarum/admin/app';\nimport Select from 'flarum/common/components/Select';\nimport Stream from 'flarum/common/utils/Stream';\nimport Button from 'flarum/common/components/Button';\nimport Form from 'flarum/common/components/Form';\nexport default class RepositoryModal extends Modal {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"name\", void 0);\n _defineProperty(this, \"repository\", void 0);\n }\n oninit(vnode) {\n super.oninit(vnode);\n this.name = Stream(this.attrs.name || '');\n this.repository = Stream(this.attrs.repository || {\n type: 'composer',\n url: ''\n });\n }\n className() {\n return 'RepositoryModal Modal--small';\n }\n title() {\n const context = this.attrs.repository ? 'edit' : 'add';\n return app.translator.trans(\"flarum-extension-manager.admin.composer.\".concat(context, \"_repository_label\"));\n }\n content() {\n const types = {\n composer: app.translator.trans('flarum-extension-manager.admin.composer.repositories.types.composer'),\n vcs: app.translator.trans('flarum-extension-manager.admin.composer.repositories.types.vcs'),\n path: app.translator.trans('flarum-extension-manager.admin.composer.repositories.types.path')\n };\n return m(\"div\", {\n className: \"Modal-body\"\n }, m(Form, null, m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.composer.repositories.add_modal.name_label')), m(\"input\", {\n className: \"FormControl\",\n bidi: this.name\n })), m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.composer.repositories.add_modal.type_label')), m(Select, {\n options: types,\n value: this.repository().type,\n onchange: value => this.repository({\n ...this.repository(),\n type: value\n })\n })), m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.composer.repositories.add_modal.url')), m(\"input\", {\n className: \"FormControl\",\n onchange: e => this.repository({\n ...this.repository(),\n url: e.target.value\n }),\n value: this.repository().url\n })), m(\"div\", {\n className: \"Form-group\"\n }, m(Button, {\n className: \"Button Button--primary\",\n onclick: this.submit.bind(this)\n }, app.translator.trans('flarum-extension-manager.admin.composer.repositories.add_modal.submit_button')))));\n }\n submit() {\n this.attrs.onsubmit(this.repository(), this.name());\n this.hide();\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/RepositoryModal', RepositoryModal);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport ConfigureJson from './ConfigureJson';\nimport Button from 'flarum/common/components/Button';\nimport extractText from 'flarum/common/utils/extractText';\nimport RepositoryModal from './RepositoryModal';\nexport default class ConfigureComposer extends ConfigureJson {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"type\", 'composer');\n }\n title() {\n return app.translator.trans('flarum-extension-manager.admin.composer.title');\n }\n className() {\n return 'ConfigureComposer';\n }\n content() {\n return m(\"div\", {\n className: \"Form ExtensionManager-SettingsGroups-content\"\n }, this.attrs.buildSettingComponent.call(this, {\n setting: 'minimum-stability',\n label: app.translator.trans('flarum-extension-manager.admin.composer.minimum_stability.label'),\n help: app.translator.trans('flarum-extension-manager.admin.composer.minimum_stability.help'),\n type: 'select',\n options: {\n stable: app.translator.trans('flarum-extension-manager.admin.composer.minimum_stability.options.stable'),\n RC: app.translator.trans('flarum-extension-manager.admin.composer.minimum_stability.options.rc'),\n beta: app.translator.trans('flarum-extension-manager.admin.composer.minimum_stability.options.beta'),\n alpha: app.translator.trans('flarum-extension-manager.admin.composer.minimum_stability.options.alpha'),\n dev: app.translator.trans('flarum-extension-manager.admin.composer.minimum_stability.options.dev')\n }\n }), m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.composer.repositories.label')), m(\"div\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-extension-manager.admin.composer.repositories.help')), m(\"div\", {\n className: \"ConfigureComposer-repositories\"\n }, Object.keys(this.setting('repositories')() || {}).map(name => {\n const repository = this.setting('repositories')()[name];\n return m(\"div\", {\n className: \"ButtonGroup ButtonGroup--full\"\n }, m(Button, {\n className: \"Button\",\n icon: {\n composer: 'fas fa-cubes',\n vcs: 'fas fa-code-branch',\n path: 'fas fa-folder'\n }[repository.type],\n onclick: () => app.modal.show(RepositoryModal, {\n name,\n repository,\n onsubmit: (repository, newName) => {\n const repositories = this.setting('repositories')();\n delete repositories[name];\n this.setting('repositories')(repositories);\n this.onchange(repository, newName);\n }\n })\n }, name, \" (\", repository.type, \")\"), m(Button, {\n className: \"Button Button--icon\",\n icon: \"fas fa-trash\",\n \"aria-label\": app.translator.trans('flarum-extension-manager.admin.composer.delete_repository_label'),\n onclick: () => {\n if (confirm(extractText(app.translator.trans('flarum-extension-manager.admin.composer.delete_repository_confirmation')))) {\n const repositories = {\n ...this.setting('repositories')()\n };\n delete repositories[name];\n this.setting('repositories')(repositories);\n }\n }\n }));\n }))));\n }\n submitButton() {\n const items = super.submitButton();\n items.push(m(Button, {\n className: \"Button\",\n onclick: () => app.modal.show(RepositoryModal, {\n onsubmit: this.onchange.bind(this)\n })\n }, app.translator.trans('flarum-extension-manager.admin.composer.add_repository_label')));\n return items;\n }\n onchange(repository, name) {\n this.setting('repositories')({\n ...this.setting('repositories')(),\n [name]: repository\n });\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/ConfigureComposer', ConfigureComposer);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport Modal from 'flarum/common/components/Modal';\nimport app from 'flarum/admin/app';\nimport Select from 'flarum/common/components/Select';\nimport Stream from 'flarum/common/utils/Stream';\nimport Button from 'flarum/common/components/Button';\nimport extractText from 'flarum/common/utils/extractText';\nimport Form from 'flarum/common/components/Form';\nexport default class AuthMethodModal extends Modal {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"type\", void 0);\n _defineProperty(this, \"host\", void 0);\n _defineProperty(this, \"token\", void 0);\n }\n oninit(vnode) {\n super.oninit(vnode);\n this.type = Stream(this.attrs.type || 'bearer');\n this.host = Stream(this.attrs.host || '');\n this.token = Stream(this.attrs.token || '');\n }\n className() {\n return 'AuthMethodModal Modal--small';\n }\n title() {\n const context = this.attrs.host ? 'edit' : 'add';\n return app.translator.trans(\"flarum-extension-manager.admin.auth_config.\".concat(context, \"_label\"));\n }\n content() {\n const types = {\n 'github-oauth': app.translator.trans('flarum-extension-manager.admin.auth_config.types.github-oauth'),\n 'gitlab-oauth': app.translator.trans('flarum-extension-manager.admin.auth_config.types.gitlab-oauth'),\n 'gitlab-token': app.translator.trans('flarum-extension-manager.admin.auth_config.types.gitlab-token'),\n bearer: app.translator.trans('flarum-extension-manager.admin.auth_config.types.bearer')\n };\n return m(\"div\", {\n className: \"Modal-body\"\n }, m(Form, null, m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.auth_config.add_modal.type_label')), m(Select, {\n options: types,\n value: this.type(),\n onchange: this.type\n })), m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.auth_config.add_modal.host_label')), m(\"input\", {\n className: \"FormControl\",\n bidi: this.host,\n placeholder: app.translator.trans('flarum-extension-manager.admin.auth_config.add_modal.host_placeholder')\n })), m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.auth_config.add_modal.token_label')), m(\"textarea\", {\n className: \"FormControl\",\n oninput: e => this.token(e.target.value),\n rows: \"6\",\n placeholder: this.token().startsWith('unchanged:') ? extractText(app.translator.trans('flarum-extension-manager.admin.auth_config.add_modal.unchanged_token_placeholder')) : ''\n }, this.token().startsWith('unchanged:') ? '' : this.token())), m(\"div\", {\n className: \"Form-group\"\n }, m(Button, {\n className: \"Button Button--primary\",\n onclick: this.submit.bind(this)\n }, app.translator.trans('flarum-extension-manager.admin.auth_config.add_modal.submit_button')))));\n }\n submit() {\n this.attrs.onsubmit(this.type(), this.host(), this.token());\n this.hide();\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/AuthMethodModal', AuthMethodModal);","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport ConfigureJson from './ConfigureJson';\nimport Button from 'flarum/common/components/Button';\nimport AuthMethodModal from './AuthMethodModal';\nimport extractText from 'flarum/common/utils/extractText';\nexport default class ConfigureAuth extends ConfigureJson {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"type\", 'auth');\n }\n title() {\n return app.translator.trans('flarum-extension-manager.admin.auth_config.title');\n }\n className() {\n return 'ConfigureAuth';\n }\n content() {\n const authSettings = Object.keys(this.settings);\n const hasAuthSettings = authSettings.length && authSettings.every(type => {\n const data = this.settings[type]();\n return Array.isArray(data) ? data.length : Object.keys(data).length;\n });\n return m(\"div\", {\n className: \"ExtensionManager-SettingsGroups-content\"\n }, hasAuthSettings ? authSettings.map(type => {\n const hosts = this.settings[type]();\n return m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans(\"flarum-extension-manager.admin.auth_config.types.\".concat(type))), m(\"div\", {\n className: \"ConfigureAuth-hosts\"\n }, Object.keys(hosts).map(host => {\n const data = hosts[host];\n return m(\"div\", {\n className: \"ButtonGroup ButtonGroup--full\"\n }, m(Button, {\n className: \"Button\",\n icon: \"fas fa-key\",\n onclick: () => app.modal.show(AuthMethodModal, {\n type,\n host,\n token: data,\n onsubmit: this.onchange.bind(this, host)\n })\n }, host), m(Button, {\n className: \"Button Button--icon\",\n icon: \"fas fa-trash\",\n \"aria-label\": app.translator.trans('flarum-extension-manager.admin.auth_config.delete_label'),\n onclick: () => {\n if (confirm(extractText(app.translator.trans('flarum-extension-manager.admin.auth_config.delete_confirmation')))) {\n const newType = {\n ...this.setting(type)()\n };\n delete newType[host];\n if (Object.keys(newType).length) {\n this.setting(type)(newType);\n } else {\n delete this.settings[type];\n }\n }\n }\n }));\n })));\n }) : m(\"span\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-extension-manager.admin.auth_config.no_auth_methods_configured')));\n }\n submitButton() {\n const items = super.submitButton();\n items.push(m(Button, {\n className: \"Button\",\n loading: this.loading,\n onclick: () => app.modal.show(AuthMethodModal, {\n onsubmit: this.onchange.bind(this, null)\n })\n }, app.translator.trans('flarum-extension-manager.admin.auth_config.add_label')));\n return items;\n }\n onchange(oldHost, type, host, token) {\n const data = {\n ...this.setting(type)()\n };\n if (oldHost) {\n delete data[oldHost];\n }\n data[host] = token;\n this.setting(type)(data);\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/ConfigureAuth', ConfigureAuth);","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/components/Input');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/helpers/listItems');","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.reg.get('core', 'common/utils/throttleDebounce');","import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport app from 'flarum/admin/app';\nimport Component from 'flarum/common/Component';\nimport Form from 'flarum/common/components/Form';\nimport Button from 'flarum/common/components/Button';\nimport LoadingIndicator from 'flarum/common/components/LoadingIndicator';\nimport ItemList from 'flarum/common/utils/ItemList';\nimport Input from 'flarum/common/components/Input';\nimport Stream from 'flarum/common/utils/Stream';\nimport Alert from 'flarum/common/components/Alert';\nimport listItems from 'flarum/common/helpers/listItems';\nimport LinkButton from 'flarum/common/components/LinkButton';\nimport Dropdown from 'flarum/common/components/Dropdown';\nimport ExtensionCard from './ExtensionCard';\nimport Pagination from 'flarum/common/components/Pagination';\nimport InfoTile from 'flarum/common/components/InfoTile';\nimport classList from 'flarum/common/utils/classList';\nimport { throttle } from 'flarum/common/utils/throttleDebounce';\nexport default class DiscoverSection extends Component {\n constructor() {\n super(...arguments);\n _defineProperty(this, \"search\", Stream(''));\n _defineProperty(this, \"warningsDismissed\", Stream(false));\n _defineProperty(this, \"applySearch\", throttle(1200, value => {\n const params = app.extensionManager.extensions.getParams();\n app.extensionManager.extensions.refreshParams({\n ...params,\n filter: {\n ...params.filter,\n q: value\n }\n }, 1);\n }));\n }\n oninit(vnode) {\n super.oninit(vnode);\n app.extensionManager.extensions.goto(1);\n this.warningsDismissed(localStorage.getItem('flarum-extension-manager.warningsDismissed') === 'true');\n }\n load(page) {\n if (page === void 0) {\n page = 1;\n }\n app.extensionManager.extensions.goto(page);\n }\n view() {\n return m(\"div\", {\n className: \"ExtensionPage-settings ExtensionManager-DiscoverSection\"\n }, m(\"div\", {\n className: \"container\"\n }, m(Form, null, m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.sections.discover.title')), m(\"div\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-extension-manager.admin.sections.discover.description'), this.warningsDismissed() && m(Button, {\n className: \"Button Button--text Button--warning Button--more\",\n icon: \"fas fa-exclamation-triangle\",\n onclick: () => this.setWarningDismissed(false)\n }))), !this.warningsDismissed() && m(\"div\", {\n className: \"ExtensionManager-warnings Form-group\"\n }, m(Alert, {\n className: \"ExtensionManager-primaryWarning\",\n type: \"warning\",\n dismissible: true,\n ondismiss: () => this.setWarningDismissed(true)\n }, m(\"ul\", null, listItems(this.warningItems().toArray())))), m(\"div\", {\n className: \"Tabs\"\n }, m(\"div\", {\n className: \"Tabs-nav\"\n }, this.tabItems().toArray()), m(\"div\", {\n className: \"Tabs-content\"\n }, m(\"hr\", {\n className: \"Tabs-divider\"\n }), m(\"div\", {\n className: \"ExtensionManager-DiscoverSection-toolbar\"\n }, m(\"div\", {\n className: \"ExtensionManager-DiscoverSection-toolbar-primary\"\n }, this.toolbarPrimaryItems().toArray()), m(\"div\", {\n className: \"ExtensionManager-DiscoverSection-toolbar-secondary\"\n }, this.toolbarSecondaryItems().toArray())), this.extensionList(), m(\"div\", {\n className: \"ExtensionManager-DiscoverSection-footer\"\n }, this.footerItems().toArray()))))));\n }\n tabFilters() {\n return {\n '': {\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.tabs.discover'),\n active: () => {\n var _app$extensionManager;\n return !((_app$extensionManager = app.extensionManager.extensions.getParams().filter) != null && _app$extensionManager.type);\n }\n },\n extension: {\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.tabs.extensions'),\n active: () => {\n var _app$extensionManager2;\n return ((_app$extensionManager2 = app.extensionManager.extensions.getParams().filter) == null ? void 0 : _app$extensionManager2.type) === 'extension';\n }\n },\n locale: {\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.tabs.languages'),\n active: () => {\n var _app$extensionManager3;\n return ((_app$extensionManager3 = app.extensionManager.extensions.getParams().filter) == null ? void 0 : _app$extensionManager3.type) === 'locale';\n }\n },\n theme: {\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.tabs.themes'),\n active: () => {\n var _app$extensionManager4;\n return ((_app$extensionManager4 = app.extensionManager.extensions.getParams().filter) == null ? void 0 : _app$extensionManager4.type) === 'theme';\n }\n }\n };\n }\n tabItems() {\n const items = new ItemList();\n const tabs = this.tabFilters();\n Object.keys(tabs).forEach(key => {\n const tab = tabs[key];\n items.add(key, m(Button, {\n className: \"Button Button--link\",\n active: tab.active(),\n onclick: () => {\n app.extensionManager.extensions.changeFilter('type', key);\n }\n }, tab.label));\n });\n return items;\n }\n warningItems() {\n const items = new ItemList();\n items.add('accessWarning', app.translator.trans('flarum-extension-manager.admin.settings.access_warning'));\n if (app.data.debugEnabled) {\n items.add('devModeWarning', app.translator.trans('flarum-extension-manager.admin.settings.debug_mode_warning'));\n }\n return items;\n }\n toolbarPrimaryItems() {\n const items = new ItemList();\n items.add('search', m(Input, {\n value: this.search(),\n onchange: value => {\n this.search(value);\n this.applySearch(value);\n },\n inputAttrs: {\n className: 'FormControl-alt'\n },\n clearable: true,\n placeholder: app.translator.trans('flarum-extension-manager.admin.sections.discover.search'),\n prefixIcon: \"fas fa-search\"\n }));\n return items;\n }\n toolbarSecondaryItems() {\n var _app$extensionManager5, _app$extensionManager6;\n const items = new ItemList();\n const sortMap = app.extensionManager.extensions.sortMap();\n const sortOptions = Object.keys(sortMap).reduce((acc, sortId) => {\n const sort = sortMap[sortId];\n acc[sortId] = typeof sort !== 'string' ? sort.label : sort;\n return acc;\n }, {});\n items.add('sort', m(Dropdown, {\n buttonClassName: \"Button\",\n label: sortOptions[app.extensionManager.extensions.getParams().sort] || Object.keys(sortMap).map(key => sortOptions[key])[0],\n accessibleToggleLabel: app.translator.trans('flarum-extension-manager.admin.sections.discover.sort.toggle_dropdown_accessible_label')\n }, Object.keys(sortOptions).map(value => {\n const label = sortOptions[value];\n const active = app.extensionManager.extensions.getParams().sort === value;\n return m(Button, {\n icon: active ? 'fas fa-check' : true,\n onclick: () => app.extensionManager.extensions.changeSort(value),\n active: active\n }, label);\n })));\n const is = (_app$extensionManager5 = (_app$extensionManager6 = app.extensionManager.extensions.getParams().filter) == null || (_app$extensionManager6 = _app$extensionManager6.is) == null ? void 0 : _app$extensionManager6[0]) != null ? _app$extensionManager5 : null;\n const activeType = is || 'all';\n items.add('party', m(Dropdown, {\n buttonClassName: \"Button\",\n label: app.translator.trans('flarum-extension-manager.admin.sections.discover.party_filter.' + activeType),\n accessibleToggleLabel: app.translator.trans('flarum-extension-manager.admin.sections.discover.party_filter.toggle_dropdown_accessible_label')\n }, ['all', 'premium'].map(party => m(Button, {\n icon: activeType === party ? 'fas fa-check' : true,\n onclick: () => {\n app.extensionManager.extensions.changeFilter('is', party === 'all' ? undefined : [party]);\n },\n active: activeType === party\n }, app.translator.trans('flarum-extension-manager.admin.sections.discover.party_filter.' + party)))));\n return items;\n }\n extensionList() {\n if (!app.extensionManager.extensions.hasItems() && app.extensionManager.extensions.isLoading()) {\n return m(LoadingIndicator, {\n display: \"block\"\n });\n }\n if (!app.extensionManager.extensions.hasItems()) {\n return m(\"div\", {\n className: \"ExtensionManager-DiscoverSection-list ExtensionManager-DiscoverSection-list--empty\"\n }, m(InfoTile, {\n icon: \"fas fa-plug-circle-exclamation\"\n }, app.translator.trans('flarum-extension-manager.admin.sections.discover.empty_results')));\n }\n return m(\"div\", {\n className: classList('ExtensionManager-DiscoverSection-list', {\n 'loading-container': app.extensionManager.extensions.isLoading()\n })\n }, m(\"div\", {\n className: \"ExtensionManager-DiscoverSection-list-inner\"\n }, app.extensionManager.extensions.getPages().map(page => page.items.map(extension => m(ExtensionCard, {\n extension: extension,\n key: extension.name()\n })))), app.extensionManager.extensions.hasItems() && app.extensionManager.extensions.isLoading() && m(LoadingIndicator, {\n size: \"large\"\n }));\n }\n footerItems() {\n const items = new ItemList();\n items.add('pagination', m(Pagination, {\n total: app.extensionManager.extensions.totalItems,\n perPage: app.extensionManager.extensions.pageSize,\n currentPage: app.extensionManager.extensions.getLocation().page,\n onChange: page => {\n const current = app.extensionManager.extensions.getLocation().page;\n if (current === page) {\n return;\n }\n this.load(page);\n }\n }));\n items.add('premiumTermsLink', m(LinkButton, {\n className: \"Button Button--link\",\n href: \"https://flarum.org/terms/premium-extensions\",\n external: true,\n target: \"_blank\",\n icon: \"fas fa-circle-info\"\n }, app.translator.trans('flarum-extension-manager.admin.sections.discover.premium_extension_terms')));\n return items;\n }\n setWarningDismissed(dismissed) {\n this.warningsDismissed(dismissed);\n localStorage.setItem('flarum-extension-manager.warningsDismissed', dismissed ? 'true' : 'false');\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/DiscoverSection', DiscoverSection);","import app from 'flarum/admin/app';\nimport ExtensionPage from 'flarum/admin/components/ExtensionPage';\nimport QueueSection from './QueueSection';\nimport ControlSection from './ControlSection';\nimport ConfigureComposer from './ConfigureComposer';\nimport ConfigureAuth from './ConfigureAuth';\nimport DiscoverSection from './DiscoverSection';\nexport default class SettingsPage extends ExtensionPage {\n content() {\n const settings = app.registry.getSettings(this.extension.id);\n return m(\"div\", {\n className: \"ExtensionPage-settings\"\n }, m(\"div\", {\n className: \"container\"\n }, settings ? [m(\"div\", {\n className: \"Form-group\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.sections.settings.title')), m(\"div\", {\n className: \"helpText\"\n }, app.translator.trans('flarum-extension-manager.admin.sections.settings.description'))), m(\"div\", {\n className: \"FormSectionGroup ExtensionManager-SettingsGroups\"\n }, m(\"div\", {\n className: \"FormSection\"\n }, m(\"label\", null, app.translator.trans('flarum-extension-manager.admin.settings.title')), m(\"div\", {\n className: \"Form\"\n }, settings.map(this.buildSettingComponent.bind(this))), m(\"div\", {\n className: \"Form-group Form--controls\"\n }, this.submitButton())), m(ConfigureComposer, {\n buildSettingComponent: this.buildSettingComponent\n }), m(ConfigureAuth, {\n buildSettingComponent: this.buildSettingComponent\n }))] : m(\"h3\", {\n className: \"ExtensionPage-subHeader\"\n }, app.translator.trans('core.admin.extension.no_settings'))));\n }\n sections(vnode) {\n const items = super.sections(vnode);\n items.add('discover', m(DiscoverSection, null), 15);\n items.add('control', m(ControlSection, null), 10);\n items.setPriority('content', 8);\n if (app.data.settings['flarum-extension-manager.queue_jobs'] !== '0' && app.data.settings['flarum-extension-manager.queue_jobs']) {\n items.add('queue', m(QueueSection, null), 5);\n }\n items.remove('permissions');\n return items;\n }\n onsaved() {\n super.onsaved();\n m.redraw();\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/components/SettingsPage', SettingsPage);","const BYTE_UNITS = [\n\t'B',\n\t'kB',\n\t'MB',\n\t'GB',\n\t'TB',\n\t'PB',\n\t'EB',\n\t'ZB',\n\t'YB',\n];\n\nconst BIBYTE_UNITS = [\n\t'B',\n\t'KiB',\n\t'MiB',\n\t'GiB',\n\t'TiB',\n\t'PiB',\n\t'EiB',\n\t'ZiB',\n\t'YiB',\n];\n\nconst BIT_UNITS = [\n\t'b',\n\t'kbit',\n\t'Mbit',\n\t'Gbit',\n\t'Tbit',\n\t'Pbit',\n\t'Ebit',\n\t'Zbit',\n\t'Ybit',\n];\n\nconst BIBIT_UNITS = [\n\t'b',\n\t'kibit',\n\t'Mibit',\n\t'Gibit',\n\t'Tibit',\n\t'Pibit',\n\t'Eibit',\n\t'Zibit',\n\t'Yibit',\n];\n\n/*\nFormats the given number using `Number#toLocaleString`.\n- If locale is a string, the value is expected to be a locale-key (for example: `de`).\n- If locale is true, the system default locale is used for translation.\n- If no value for locale is specified, the number is returned unmodified.\n*/\nconst toLocaleString = (number, locale, options) => {\n\tlet result = number;\n\tif (typeof locale === 'string' || Array.isArray(locale)) {\n\t\tresult = number.toLocaleString(locale, options);\n\t} else if (locale === true || options !== undefined) {\n\t\tresult = number.toLocaleString(undefined, options);\n\t}\n\n\treturn result;\n};\n\nexport default function prettyBytes(number, options) {\n\tif (!Number.isFinite(number)) {\n\t\tthrow new TypeError(`Expected a finite number, got ${typeof number}: ${number}`);\n\t}\n\n\toptions = {\n\t\tbits: false,\n\t\tbinary: false,\n\t\tspace: true,\n\t\t...options,\n\t};\n\n\tconst UNITS = options.bits\n\t\t? (options.binary ? BIBIT_UNITS : BIT_UNITS)\n\t\t: (options.binary ? BIBYTE_UNITS : BYTE_UNITS);\n\n\tconst separator = options.space ? ' ' : '';\n\n\tif (options.signed && number === 0) {\n\t\treturn ` 0${separator}${UNITS[0]}`;\n\t}\n\n\tconst isNegative = number < 0;\n\tconst prefix = isNegative ? '-' : (options.signed ? '+' : '');\n\n\tif (isNegative) {\n\t\tnumber = -number;\n\t}\n\n\tlet localeOptions;\n\n\tif (options.minimumFractionDigits !== undefined) {\n\t\tlocaleOptions = {minimumFractionDigits: options.minimumFractionDigits};\n\t}\n\n\tif (options.maximumFractionDigits !== undefined) {\n\t\tlocaleOptions = {maximumFractionDigits: options.maximumFractionDigits, ...localeOptions};\n\t}\n\n\tif (number < 1) {\n\t\tconst numberString = toLocaleString(number, options.locale, localeOptions);\n\t\treturn prefix + numberString + separator + UNITS[0];\n\t}\n\n\tconst exponent = Math.min(Math.floor(options.binary ? Math.log(number) / Math.log(1024) : Math.log10(number) / 3), UNITS.length - 1);\n\tnumber /= (options.binary ? 1024 : 1000) ** exponent;\n\n\tif (!localeOptions) {\n\t\tnumber = number.toPrecision(3);\n\t}\n\n\tconst numberString = toLocaleString(Number(number), options.locale, localeOptions);\n\n\tconst unit = UNITS[exponent];\n\n\treturn prefix + numberString + separator + unit;\n}\n","import Model from 'flarum/common/Model';\nimport prettyBytes from 'pretty-bytes';\nexport default class Task extends Model {\n status() {\n return Model.attribute('status').call(this);\n }\n operation() {\n return Model.attribute('operation').call(this);\n }\n command() {\n return Model.attribute('command').call(this);\n }\n package() {\n return Model.attribute('package').call(this);\n }\n output() {\n return Model.attribute('output').call(this);\n }\n guessedCause() {\n return Model.attribute('guessedCause').call(this);\n }\n createdAt() {\n return Model.attribute('createdAt', Model.transformDate).call(this);\n }\n startedAt() {\n return Model.attribute('startedAt', Model.transformDate).call(this);\n }\n finishedAt() {\n return Model.attribute('finishedAt', Model.transformDate).call(this);\n }\n peakMemoryUsed() {\n return prettyBytes(Model.attribute('peakMemoryUsed').call(this) * 1024);\n }\n}\nflarum.reg.add('flarum-extension-manager', 'admin/models/Task', Task);","import Extend from 'flarum/common/extenders';\nimport app from 'flarum/admin/app';\nimport extractText from 'flarum/common/utils/extractText';\nimport SettingsPage from './components/SettingsPage';\nimport Task from './models/Task';\nimport ExternalExtension from './models/ExternalExtension';\nexport default [new Extend.Store() //\n.add('extension-manager-tasks', Task).add('external-extensions', ExternalExtension), new Extend.Admin().setting(() => ({\n setting: 'flarum-extension-manager.queue_jobs',\n label: app.translator.trans('flarum-extension-manager.admin.settings.queue_jobs'),\n help: m.trust(extractText(app.translator.trans('flarum-extension-manager.admin.settings.queue_jobs_help', {\n basic_impl_link: 'https://discuss.flarum.org/d/28151-database-queue-the-simplest-queue-even-for-shared-hosting',\n adv_impl_link: 'https://discuss.flarum.org/d/21873-redis-sessions-cache-queues',\n php_version: \"\".concat(app.data.phpVersion, \"\"),\n folder_perms_link: 'https://docs.flarum.org/install#folder-ownership'\n }))),\n type: 'boolean',\n disabled: app.data['flarum-extension-manager.using_sync_queue']\n})).setting(() => ({\n setting: 'flarum-extension-manager.task_retention_days',\n label: app.translator.trans('flarum-extension-manager.admin.settings.task_retention_days'),\n help: app.translator.trans('flarum-extension-manager.admin.settings.task_retention_days_help'),\n type: 'number'\n})).page(SettingsPage).generalIndexItems('settings', () => [{\n id: 'minimum-stability',\n label: app.translator.trans('flarum-extension-manager.admin.composer.minimum_stability.label', {}, true),\n help: app.translator.trans('flarum-extension-manager.admin.composer.minimum_stability.help', {}, true)\n}, {\n id: 'repositories',\n label: app.translator.trans('flarum-extension-manager.admin.composer.repositories.label', {}, true),\n help: app.translator.trans('flarum-extension-manager.admin.composer.repositories.help', {}, true)\n}, {\n id: 'composer-auth',\n label: app.translator.trans('flarum-extension-manager.admin.auth_config.title', {}, true)\n}, {\n id: 'updates',\n label: app.translator.trans('flarum-extension-manager.admin.updater.updater_title', {}, true),\n help: app.translator.trans('flarum-extension-manager.admin.updater.updater_help', {}, true)\n}])];","import { extend } from 'flarum/common/extend';\nimport app from 'flarum/admin/app';\nimport ExtensionPage from 'flarum/admin/components/ExtensionPage';\nimport Button from 'flarum/common/components/Button';\nimport LoadingModal from 'flarum/admin/components/LoadingModal';\nimport isExtensionEnabled from 'flarum/admin/utils/isExtensionEnabled';\nimport jumpToQueue from './utils/jumpToQueue';\nimport ExtensionManagerState from './states/ExtensionManagerState';\nexport { default as extend } from './extend';\napp.initializers.add('flarum-extension-manager', app => {\n app.extensionManager = new ExtensionManagerState();\n if (app.data['flarum-extension-manager.using_sync_queue']) {\n app.data.settings['flarum-extension-manager.queue_jobs'] = '0';\n }\n extend(ExtensionPage.prototype, 'topItems', function (items) {\n if (this.extension.id === 'flarum-extension-manager' || isExtensionEnabled(this.extension.id)) {\n return;\n }\n items.add('remove', m(Button, {\n className: \"Button Button--danger\",\n icon: \"fas fa-times\",\n onclick: () => {\n app.modal.show(LoadingModal);\n app.request({\n url: \"\".concat(app.forum.attribute('apiUrl'), \"/extension-manager/extensions/\").concat(this.extension.id),\n method: 'DELETE'\n }).then(response => {\n if (response != null && response.processing) {\n jumpToQueue();\n } else {\n app.alerts.show({\n type: 'success'\n }, app.translator.trans('flarum-extension-manager.admin.extensions.successful_remove'));\n window.location = app.forum.attribute('adminUrl');\n }\n }).finally(() => {\n app.modal.close();\n });\n }\n }, app.translator.trans('flarum-extension-manager.admin.extensions.remove')));\n });\n});"],"names":["module","exports","t","s","n","i","e","r","o","u","d","a","h","years","months","days","hours","minutes","seconds","milliseconds","weeks","c","g","f","$l","m","p","l","$","Math","ceil","floor","y","abs","v","negative","format","this","$d","$ms","parseFromMilliseconds","Object","keys","forEach","calMilliseconds","match","slice","map","Number","prototype","reduce","toISOString","round","toJSON","Y","YY","YYYY","M","MM","D","DD","H","HH","mm","ss","SSS","replace","String","as","get","add","subtract","locale","clone","humanize","fromNow","valueOf","asMilliseconds","asSeconds","asMinutes","asHours","asDays","asWeeks","asMonths","asYears","$utils","duration","isDuration","bind","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","call","getter","__esModule","definition","key","defineProperty","enumerable","obj","prop","hasOwnProperty","Symbol","toStringTag","value","flarum","reg","jumpToQueue","close","route","set","id","queue","load","setTimeout","_document$getElementB","document","getElementById","scrollIntoView","block","_typeof","iterator","constructor","_defineProperty","toPrimitive","TypeError","configurable","writable","window","QueueState","params","actionTaken","_params","loading","page","limit","offset","find","then","data","_data$payload$meta","tasks","total","payload","meta","redraw","task","status","pollQueue","control","setLoading","location","reload","isLoading","getItems","getTotalItems","getTotalPages","pageNumber","getPerPage","hasPrev","hasNext","prev","next","goto","polling","clearTimeout","hasPending","_this$tasks","error","response","errors","includes","code","clear","guessed_cause","show","type","trans","concat","ControlSectionState","lastUpdateRun","JSON","parse","settings","limitedPackages","major","minor","global","lastUpdateCheck","extensionUpdates","formatExtensionUpdates","coreUpdate","formatCoreUpdate","name","hasOperationRunning","requirePackage","method","url","attribute","body","processing","extensionId","extension","href","catch","errorHandler","finally","checkForUpdates","updateCoreMinor","confirm","updateExtension","updateMode","extra","title","updateGlobally","_lastUpdateCheck$upda","packageUpdates","updates","installed","filter","composerPackage","extensions","safeToUpdate","values","_lastUpdateCheck$upda2","core","pop","package","version","icon","backgroundImage","resources","links","majorUpdate","_ref","dryRun","updateState","_e$response","incompatibleExtensions","incompatible_extensions","ExtensionListState","super","sort","sortMap","label","ExtensionManagerState","Label","view","vnode","className","attrs","assign","children","TaskOutputModal","operation","content","guessedCause","command","output","humanDuration","start","end","dayjs","extend","durationTime","diff","QueueSection","oninit","onclick","disabled","queueTable","columns","items","operationIcon","_task$package","style","running","failure","pending","success","size","display","startedAt","finishedAt","text","peakMemoryUsed","length","toArray","item","index","currentPage","perPage","onChange","update_check","update_major","update_minor","update_global","extension_install","extension_remove","extension_update","why_not","Installer","arguments","packageName","htmlFor","link","semantic_link","placeholder","bidi","onsubmit","WhyNotModal","oncreate","requestWhyNot","whyNot","reason","VersionStability","isProductionReady","Stable","RC","stability","split","toLowerCase","Alpha","Beta","Dev","ExternalExtension","isSupported","currentVersion","latestCompatibleVersion","latestFlarumVersionSupported","highestVersion","toLocalExtension","description","backgroundColor","color","discuss","discussUri","website","httpUri","ExtensionCard","getExtension","isCore","isDanger","badges","actionItems","metaItems","_extension$icon","_extension$icon2","iconUrl","isPremium","_updates$latestMinor","latestVersion","count","downloads","formattedCount","target","external","onClickUpdate","whyNotWarning","buttonClassName","soft","hard","charAt","substring","MajorUpdater","alt","src","update","dismissible","controls","Updater","lastUpdateCheckView","controlItems","availableUpdatesView","_app$extensionManager","checkedAt","state","hasMinorCoreUpdate","ControlSection","ConfigureJson","submit","submitButton","isDirty","customSettingComponents","customFieldComponents","setting","_this$settings$key","readOnly","configuration","initialSettings","Array","isArray","stringify","RepositoryModal","repository","context","types","composer","vcs","path","options","onchange","hide","ConfigureComposer","buildSettingComponent","help","stable","beta","alpha","dev","newName","repositories","push","AuthMethodModal","host","token","bearer","oninput","rows","startsWith","ConfigureAuth","authSettings","hasAuthSettings","every","hosts","newType","oldHost","DiscoverSection","throttle","getParams","refreshParams","q","warningsDismissed","localStorage","getItem","setWarningDismissed","ondismiss","warningItems","tabItems","toolbarPrimaryItems","toolbarSecondaryItems","extensionList","footerItems","tabFilters","active","_app$extensionManager2","_app$extensionManager3","theme","_app$extensionManager4","tabs","tab","changeFilter","debugEnabled","search","applySearch","inputAttrs","clearable","prefixIcon","_app$extensionManager5","_app$extensionManager6","sortOptions","acc","sortId","accessibleToggleLabel","changeSort","activeType","is","party","hasItems","getPages","totalItems","pageSize","getLocation","dismissed","setItem","SettingsPage","getSettings","sections","setPriority","remove","onsaved","BYTE_UNITS","BIBYTE_UNITS","BIT_UNITS","BIBIT_UNITS","toLocaleString","number","result","Task","createdAt","isFinite","UNITS","bits","binary","space","separator","signed","isNegative","prefix","localeOptions","minimumFractionDigits","maximumFractionDigits","exponent","min","log","log10","toPrecision","prettyBytes","trust","basic_impl_link","adv_impl_link","php_version","phpVersion","folder_perms_link","generalIndexItems","app","extensionManager","modal","request","forum","alerts","translator"],"sourceRoot":""} \ No newline at end of file